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

Unified Diff: ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc

Issue 1035523004: [6/8][Ozone-Drm] Fix lookup for DRM property values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@async-content-protection5
Patch Set: Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc
diff --git a/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc b/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc
index 60b335bfaa429bcc04c425c8af45ec900b8b6dce..2c368aa3acd097d872e3e35220407227a34dbcf5 100644
--- a/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc
+++ b/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc
@@ -347,11 +347,22 @@ bool DrmGpuDisplayManager::GetHDCPState(const DrmDisplaySnapshot& output,
return false;
}
- DCHECK_LT(static_cast<int>(hdcp_property->prop_id), connector->count_props);
- int hdcp_state_idx = connector->prop_values[hdcp_property->prop_id];
- DCHECK_LT(hdcp_state_idx, hdcp_property->count_enums);
+ std::string name;
+ for (int prop_idx = 0; prop_idx < connector->count_props; ++prop_idx) {
spang 2015/03/26 17:56:29 Please factor out the property search.
dnicoara 2015/04/14 21:57:17 Done.
+ if (connector->props[prop_idx] != hdcp_property->prop_id)
+ continue;
+
+ for (int enum_idx = 0; enum_idx < hdcp_property->count_enums; ++enum_idx) {
spang 2015/03/26 17:56:29 It'll be a lot clearer if you do. drm_mode_proper
dnicoara 2015/04/14 21:57:17 Done.
+ if (hdcp_property->enums[enum_idx].value ==
+ connector->prop_values[prop_idx]) {
+ name = hdcp_property->enums[enum_idx].name;
+ break;
+ }
+ }
+
+ break;
+ }
- std::string name(hdcp_property->enums[hdcp_state_idx].name);
for (size_t i = 0; i < arraysize(kContentProtectionStates); ++i) {
if (name == kContentProtectionStates[i].name) {
*state = kContentProtectionStates[i].state;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698