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

Side by Side Diff: ui/display/util/x11/edid_parser_x11.cc

Issue 1151583002: Generate display product id with EDID manufacturer product code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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/display/util/x11/edid_parser_x11.h" 5 #include "ui/display/util/x11/edid_parser_x11.h"
6 6
7 #include <X11/extensions/Xrandr.h> 7 #include <X11/extensions/Xrandr.h>
8 #include <X11/Xatom.h> 8 #include <X11/Xatom.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // manufacturer's ID, product code, and human readable name. Returns false if it 79 // manufacturer's ID, product code, and human readable name. Returns false if it
80 // fails to get those data and doesn't touch manufacturer ID/product code/name. 80 // fails to get those data and doesn't touch manufacturer ID/product code/name.
81 // nullptr can be passed for unwanted output parameters. 81 // nullptr can be passed for unwanted output parameters.
82 bool GetOutputDeviceData(XID output, 82 bool GetOutputDeviceData(XID output,
83 uint16_t* manufacturer_id, 83 uint16_t* manufacturer_id,
84 std::string* human_readable_name) { 84 std::string* human_readable_name) {
85 std::vector<uint8_t> edid; 85 std::vector<uint8_t> edid;
86 if (!GetEDIDProperty(output, &edid)) 86 if (!GetEDIDProperty(output, &edid))
87 return false; 87 return false;
88 88
89 return ParseOutputDeviceData(edid, manufacturer_id, human_readable_name, 89 return ParseOutputDeviceData(edid, manufacturer_id, nullptr,
90 nullptr, nullptr); 90 human_readable_name, nullptr, nullptr);
91 } 91 }
92 92
93 } // namespace 93 } // namespace
94 94
95 bool GetDisplayId(XID output_id, 95 bool GetDisplayId(XID output_id,
96 uint8_t output_index, 96 uint8_t output_index,
97 int64_t* display_id_out) { 97 int64_t* display_id_out) {
98 std::vector<uint8_t> edid; 98 std::vector<uint8_t> edid;
99 if (!GetEDIDProperty(output_id, &edid)) 99 if (!GetEDIDProperty(output_id, &edid))
100 return false; 100 return false;
(...skipping 12 matching lines...) Expand all
113 bool GetOutputOverscanFlag(RROutput output, bool* flag) { 113 bool GetOutputOverscanFlag(RROutput output, bool* flag) {
114 std::vector<uint8_t> edid; 114 std::vector<uint8_t> edid;
115 if (!GetEDIDProperty(output, &edid)) 115 if (!GetEDIDProperty(output, &edid))
116 return false; 116 return false;
117 117
118 bool found = ParseOutputOverscanFlag(edid, flag); 118 bool found = ParseOutputOverscanFlag(edid, flag);
119 return found; 119 return found;
120 } 120 }
121 121
122 } // namespace ui 122 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698