OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/ozone/platform/drm/common/drm_util.h" | 5 #include "ui/ozone/platform/drm/common/drm_util.h" |
6 | 6 |
7 #include <drm_fourcc.h> | 7 #include <drm_fourcc.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 #include <sys/mman.h> | 10 #include <sys/mman.h> |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 params.physical_size = | 227 params.physical_size = |
228 gfx::Size(info->connector()->mmWidth, info->connector()->mmHeight); | 228 gfx::Size(info->connector()->mmWidth, info->connector()->mmHeight); |
229 params.type = GetDisplayType(info->connector()); | 229 params.type = GetDisplayType(info->connector()); |
230 params.is_aspect_preserving_scaling = | 230 params.is_aspect_preserving_scaling = |
231 IsAspectPreserving(fd, info->connector()); | 231 IsAspectPreserving(fd, info->connector()); |
232 | 232 |
233 ScopedDrmPropertyBlobPtr edid_blob( | 233 ScopedDrmPropertyBlobPtr edid_blob( |
234 GetDrmPropertyBlob(fd, info->connector(), "EDID")); | 234 GetDrmPropertyBlob(fd, info->connector(), "EDID")); |
235 | 235 |
236 if (edid_blob) { | 236 if (edid_blob) { |
237 std::vector<uint8_t> edid( | 237 params.edid.assign( |
238 static_cast<uint8_t*>(edid_blob->data), | 238 static_cast<uint8_t*>(edid_blob->data), |
239 static_cast<uint8_t*>(edid_blob->data) + edid_blob->length); | 239 static_cast<uint8_t*>(edid_blob->data) + edid_blob->length); |
240 | 240 |
241 GetDisplayIdFromEDID(edid, connector_index, ¶ms.display_id, | 241 GetDisplayIdFromEDID(params.edid, connector_index, ¶ms.display_id, |
242 ¶ms.product_id); | 242 ¶ms.product_id); |
243 | 243 |
244 ParseOutputDeviceData(edid, nullptr, nullptr, ¶ms.display_name, nullptr, | 244 ParseOutputDeviceData(params.edid, nullptr, nullptr, ¶ms.display_name, |
245 nullptr); | 245 nullptr, nullptr); |
246 ParseOutputOverscanFlag(edid, ¶ms.has_overscan); | 246 ParseOutputOverscanFlag(params.edid, ¶ms.has_overscan); |
247 } else { | 247 } else { |
248 VLOG(1) << "Failed to get EDID blob for connector " | 248 VLOG(1) << "Failed to get EDID blob for connector " |
249 << info->connector()->connector_id; | 249 << info->connector()->connector_id; |
250 } | 250 } |
251 | 251 |
252 for (int i = 0; i < info->connector()->count_modes; ++i) { | 252 for (int i = 0; i < info->connector()->count_modes; ++i) { |
253 const drmModeModeInfo& mode = info->connector()->modes[i]; | 253 const drmModeModeInfo& mode = info->connector()->modes[i]; |
254 params.modes.push_back(CreateDisplayModeParams(mode)); | 254 params.modes.push_back(CreateDisplayModeParams(mode)); |
255 | 255 |
256 if (info->crtc()->mode_valid && SameMode(info->crtc()->mode, mode)) { | 256 if (info->crtc()->mode_valid && SameMode(info->crtc()->mode, mode)) { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 case gfx::BufferFormat::BGRX_8888: | 320 case gfx::BufferFormat::BGRX_8888: |
321 return DRM_FORMAT_XRGB8888; | 321 return DRM_FORMAT_XRGB8888; |
322 case gfx::BufferFormat::UYVY_422: | 322 case gfx::BufferFormat::UYVY_422: |
323 return DRM_FORMAT_UYVY; | 323 return DRM_FORMAT_UYVY; |
324 default: | 324 default: |
325 NOTREACHED(); | 325 NOTREACHED(); |
326 return 0; | 326 return 0; |
327 } | 327 } |
328 } | 328 } |
329 } // namespace ui | 329 } // namespace ui |
OLD | NEW |