Chromium Code Reviews| 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; |