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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 if (edid_blob) { | 225 if (edid_blob) { |
226 std::vector<uint8_t> edid( | 226 std::vector<uint8_t> edid( |
227 static_cast<uint8_t*>(edid_blob->data), | 227 static_cast<uint8_t*>(edid_blob->data), |
228 static_cast<uint8_t*>(edid_blob->data) + edid_blob->length); | 228 static_cast<uint8_t*>(edid_blob->data) + edid_blob->length); |
229 | 229 |
230 if (!GetDisplayIdFromEDID(edid, display_index, ¶ms.display_id, | 230 if (!GetDisplayIdFromEDID(edid, display_index, ¶ms.display_id, |
231 ¶ms.product_id)) | 231 ¶ms.product_id)) |
232 params.display_id = display_index; | 232 params.display_id = display_index; |
233 | 233 |
234 ParseOutputDeviceData(edid, nullptr, ¶ms.display_name, nullptr, | 234 ParseOutputDeviceData(edid, nullptr, nullptr, ¶ms.display_name, nullptr, |
235 nullptr); | 235 nullptr); |
236 ParseOutputOverscanFlag(edid, ¶ms.has_overscan); | 236 ParseOutputOverscanFlag(edid, ¶ms.has_overscan); |
237 } else { | 237 } else { |
238 VLOG(1) << "Failed to get EDID blob for connector " | 238 VLOG(1) << "Failed to get EDID blob for connector " |
239 << info->connector()->connector_id; | 239 << info->connector()->connector_id; |
240 } | 240 } |
241 | 241 |
242 for (int i = 0; i < info->connector()->count_modes; ++i) { | 242 for (int i = 0; i < info->connector()->count_modes; ++i) { |
243 const drmModeModeInfo& mode = info->connector()->modes[i]; | 243 const drmModeModeInfo& mode = info->connector()->modes[i]; |
244 params.modes.push_back(CreateDisplayModeParams(mode)); | 244 params.modes.push_back(CreateDisplayModeParams(mode)); |
(...skipping 13 matching lines...) Expand all Loading... |
258 // since it should be the best mode. | 258 // since it should be the best mode. |
259 if (!params.has_native_mode && !params.modes.empty()) { | 259 if (!params.has_native_mode && !params.modes.empty()) { |
260 params.has_native_mode = true; | 260 params.has_native_mode = true; |
261 params.native_mode = params.modes.front(); | 261 params.native_mode = params.modes.front(); |
262 } | 262 } |
263 | 263 |
264 return params; | 264 return params; |
265 } | 265 } |
266 | 266 |
267 } // namespace ui | 267 } // namespace ui |
OLD | NEW |