Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(163)

Side by Side Diff: ui/ozone/platform/dri/display_snapshot_dri.cc

Issue 854203002: Read EDID for the 1st display for startup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/dri/display_snapshot_dri.h" 5 #include "ui/ozone/platform/dri/display_snapshot_dri.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <xf86drmMode.h> 9 #include <xf86drmMode.h>
10 10
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 drmModeCrtc* crtc, 72 drmModeCrtc* crtc,
73 uint32_t index) 73 uint32_t index)
74 : DisplaySnapshot(index, 74 : DisplaySnapshot(index,
75 gfx::Point(crtc->x, crtc->y), 75 gfx::Point(crtc->x, crtc->y),
76 gfx::Size(connector->mmWidth, connector->mmHeight), 76 gfx::Size(connector->mmWidth, connector->mmHeight),
77 GetDisplayType(connector), 77 GetDisplayType(connector),
78 IsAspectPreserving(drm, connector), 78 IsAspectPreserving(drm, connector),
79 false, 79 false,
80 std::string(), 80 std::string(),
81 std::vector<const DisplayMode*>(), 81 std::vector<const DisplayMode*>(),
82 NULL, 82 nullptr,
83 NULL), 83 nullptr),
84 connector_(connector->connector_id), 84 connector_(connector->connector_id),
85 crtc_(crtc->crtc_id), 85 crtc_(crtc->crtc_id),
86 dpms_property_(drm->GetProperty(connector, "DPMS")) { 86 dpms_property_(drm->GetProperty(connector, "DPMS")) {
87 if (!dpms_property_) 87 if (!dpms_property_)
88 VLOG(1) << "Failed to find the DPMS property for connector " 88 VLOG(1) << "Failed to find the DPMS property for connector "
89 << connector->connector_id; 89 << connector->connector_id;
90 90
91 ScopedDrmPropertyBlobPtr edid_blob(drm->GetPropertyBlob(connector, "EDID")); 91 ScopedDrmPropertyBlobPtr edid_blob(drm->GetPropertyBlob(connector, "EDID"));
92 92
93 if (edid_blob) { 93 if (edid_blob) {
94 std::vector<uint8_t> edid( 94 std::vector<uint8_t> edid(
95 static_cast<uint8_t*>(edid_blob->data), 95 static_cast<uint8_t*>(edid_blob->data),
96 static_cast<uint8_t*>(edid_blob->data) + edid_blob->length); 96 static_cast<uint8_t*>(edid_blob->data) + edid_blob->length);
97 97
98 if (!GetDisplayIdFromEDID(edid, index, &display_id_)) 98 if (!GetDisplayIdFromEDID(edid, index, &display_id_))
99 display_id_ = index; 99 display_id_ = index;
100 100
101 ParseOutputDeviceData(edid, NULL, &display_name_); 101 ParseOutputDeviceData(edid, nullptr, &display_name_, nullptr, nullptr);
102 ParseOutputOverscanFlag(edid, &overscan_flag_); 102 ParseOutputOverscanFlag(edid, &overscan_flag_);
103 } else { 103 } else {
104 VLOG(1) << "Failed to get EDID blob for connector " 104 VLOG(1) << "Failed to get EDID blob for connector "
105 << connector->connector_id; 105 << connector->connector_id;
106 } 106 }
107 107
108 for (int i = 0; i < connector->count_modes; ++i) { 108 for (int i = 0; i < connector->count_modes; ++i) {
109 drmModeModeInfo& mode = connector->modes[i]; 109 drmModeModeInfo& mode = connector->modes[i];
110 modes_.push_back(new DisplayModeDri(mode)); 110 modes_.push_back(new DisplayModeDri(mode));
111 111
(...skipping 15 matching lines...) Expand all
127 127
128 std::string DisplaySnapshotDri::ToString() const { 128 std::string DisplaySnapshotDri::ToString() const {
129 return base::StringPrintf( 129 return base::StringPrintf(
130 "[type=%d, connector=%" PRIu32 ", crtc=%" PRIu32 ", mode=%s, dim=%s]", 130 "[type=%d, connector=%" PRIu32 ", crtc=%" PRIu32 ", mode=%s, dim=%s]",
131 type_, connector_, crtc_, 131 type_, connector_, crtc_,
132 current_mode_ ? current_mode_->ToString().c_str() : "NULL", 132 current_mode_ ? current_mode_->ToString().c_str() : "NULL",
133 physical_size_.ToString().c_str()); 133 physical_size_.ToString().c_str());
134 } 134 }
135 135
136 } // namespace ui 136 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698