| 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/gpu/drm_display_snapshot.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_display_snapshot.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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 drm_(drm), | 84 drm_(drm), |
| 85 connector_(connector->connector_id), | 85 connector_(connector->connector_id), |
| 86 crtc_(crtc->crtc_id) { | 86 crtc_(crtc->crtc_id) { |
| 87 ScopedDrmPropertyBlobPtr edid_blob(drm->GetPropertyBlob(connector, "EDID")); | 87 ScopedDrmPropertyBlobPtr edid_blob(drm->GetPropertyBlob(connector, "EDID")); |
| 88 | 88 |
| 89 if (edid_blob) { | 89 if (edid_blob) { |
| 90 std::vector<uint8_t> edid( | 90 std::vector<uint8_t> edid( |
| 91 static_cast<uint8_t*>(edid_blob->data), | 91 static_cast<uint8_t*>(edid_blob->data), |
| 92 static_cast<uint8_t*>(edid_blob->data) + edid_blob->length); | 92 static_cast<uint8_t*>(edid_blob->data) + edid_blob->length); |
| 93 | 93 |
| 94 if (!GetDisplayIdFromEDID(edid, index, &display_id_)) | 94 if (!GetDisplayIdFromEDID(edid, index, &display_id_, &product_id_)) |
| 95 display_id_ = index; | 95 display_id_ = index; |
| 96 | 96 |
| 97 ParseOutputDeviceData(edid, nullptr, &display_name_, nullptr, nullptr); | 97 ParseOutputDeviceData(edid, nullptr, &display_name_, nullptr, nullptr); |
| 98 ParseOutputOverscanFlag(edid, &overscan_flag_); | 98 ParseOutputOverscanFlag(edid, &overscan_flag_); |
| 99 } else { | 99 } else { |
| 100 VLOG(1) << "Failed to get EDID blob for connector " | 100 VLOG(1) << "Failed to get EDID blob for connector " |
| 101 << connector->connector_id; | 101 << connector->connector_id; |
| 102 } | 102 } |
| 103 | 103 |
| 104 for (int i = 0; i < connector->count_modes; ++i) { | 104 for (int i = 0; i < connector->count_modes; ++i) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 124 std::string DrmDisplaySnapshot::ToString() const { | 124 std::string DrmDisplaySnapshot::ToString() const { |
| 125 return base::StringPrintf( | 125 return base::StringPrintf( |
| 126 "[type=%d, connector=%" PRIu32 ", crtc=%" PRIu32 | 126 "[type=%d, connector=%" PRIu32 ", crtc=%" PRIu32 |
| 127 ", origin=%s, mode=%s, dim=%s]", | 127 ", origin=%s, mode=%s, dim=%s]", |
| 128 type_, connector_, crtc_, origin_.ToString().c_str(), | 128 type_, connector_, crtc_, origin_.ToString().c_str(), |
| 129 current_mode_ ? current_mode_->ToString().c_str() : "NULL", | 129 current_mode_ ? current_mode_->ToString().c_str() : "NULL", |
| 130 physical_size_.ToString().c_str()); | 130 physical_size_.ToString().c_str()); |
| 131 } | 131 } |
| 132 | 132 |
| 133 } // namespace ui | 133 } // namespace ui |
| OLD | NEW |