| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <sys/mman.h> | 9 #include <sys/mman.h> |
| 10 #include <xf86drmMode.h> | 10 #include <xf86drmMode.h> |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 params.size = gfx::Size(mode.hdisplay, mode.vdisplay); | 201 params.size = gfx::Size(mode.hdisplay, mode.vdisplay); |
| 202 params.is_interlaced = mode.flags & DRM_MODE_FLAG_INTERLACE; | 202 params.is_interlaced = mode.flags & DRM_MODE_FLAG_INTERLACE; |
| 203 params.refresh_rate = GetRefreshRate(mode); | 203 params.refresh_rate = GetRefreshRate(mode); |
| 204 | 204 |
| 205 return params; | 205 return params; |
| 206 } | 206 } |
| 207 | 207 |
| 208 DisplaySnapshot_Params CreateDisplaySnapshotParams( | 208 DisplaySnapshot_Params CreateDisplaySnapshotParams( |
| 209 HardwareDisplayControllerInfo* info, | 209 HardwareDisplayControllerInfo* info, |
| 210 int fd, | 210 int fd, |
| 211 size_t display_index) { | 211 size_t display_index, |
| 212 const gfx::Point& origin) { |
| 212 DisplaySnapshot_Params params; | 213 DisplaySnapshot_Params params; |
| 213 params.display_id = display_index; | 214 params.display_id = display_index; |
| 215 params.origin = origin; |
| 214 params.physical_size = | 216 params.physical_size = |
| 215 gfx::Size(info->connector()->mmWidth, info->connector()->mmHeight); | 217 gfx::Size(info->connector()->mmWidth, info->connector()->mmHeight); |
| 216 params.type = GetDisplayType(info->connector()); | 218 params.type = GetDisplayType(info->connector()); |
| 217 params.is_aspect_preserving_scaling = | 219 params.is_aspect_preserving_scaling = |
| 218 IsAspectPreserving(fd, info->connector()); | 220 IsAspectPreserving(fd, info->connector()); |
| 219 | 221 |
| 220 ScopedDrmPropertyBlobPtr edid_blob( | 222 ScopedDrmPropertyBlobPtr edid_blob( |
| 221 GetDrmPropertyBlob(fd, info->connector(), "EDID")); | 223 GetDrmPropertyBlob(fd, info->connector(), "EDID")); |
| 222 | 224 |
| 223 if (edid_blob) { | 225 if (edid_blob) { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 // since it should be the best mode. | 257 // since it should be the best mode. |
| 256 if (!params.has_native_mode && !params.modes.empty()) { | 258 if (!params.has_native_mode && !params.modes.empty()) { |
| 257 params.has_native_mode = true; | 259 params.has_native_mode = true; |
| 258 params.native_mode = params.modes.front(); | 260 params.native_mode = params.modes.front(); |
| 259 } | 261 } |
| 260 | 262 |
| 261 return params; | 263 return params; |
| 262 } | 264 } |
| 263 | 265 |
| 264 } // namespace ui | 266 } // namespace ui |
| OLD | NEW |