| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_display.h" |
| 6 | 6 |
| 7 #include <xf86drmMode.h> | 7 #include <xf86drmMode.h> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/display/types/gamma_ramp_rgb_entry.h" | 10 #include "ui/display/types/gamma_ramp_rgb_entry.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 return drm_->SetProperty( | 168 return drm_->SetProperty( |
| 169 connector_, hdcp_property->prop_id, | 169 connector_, hdcp_property->prop_id, |
| 170 GetContentProtectionValue(hdcp_property.get(), state)); | 170 GetContentProtectionValue(hdcp_property.get(), state)); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void DrmDisplay::SetColorCorrection( | 173 void DrmDisplay::SetColorCorrection( |
| 174 const std::vector<GammaRampRGBEntry>& degamma_lut, | 174 const std::vector<GammaRampRGBEntry>& degamma_lut, |
| 175 const std::vector<GammaRampRGBEntry>& gamma_lut, | 175 const std::vector<GammaRampRGBEntry>& gamma_lut, |
| 176 const std::vector<float>& correction_matrix) { | 176 const std::vector<float>& correction_matrix) { |
| 177 if (!drm_->SetColorCorrection(crtc_, degamma_lut, gamma_lut, | 177 if (degamma_lut.empty()) { |
| 178 correction_matrix)) { | 178 if (!drm_->SetGammaRamp(crtc_, gamma_lut)) { |
| 179 LOG(ERROR) << "Failed to set color correction for display: crtc_id = " | 179 LOG(ERROR) << "Failed to set gamma ramp for display: crtc_id = " << crtc_ |
| 180 << crtc_; | 180 << " size = " << gamma_lut.size(); |
| 181 } |
| 182 } else { |
| 183 if (!drm_->SetColorCorrection(crtc_, degamma_lut, gamma_lut, |
| 184 correction_matrix)) { |
| 185 LOG(ERROR) << "Failed to set color correction for display: crtc_id = " |
| 186 << crtc_; |
| 187 } |
| 181 } | 188 } |
| 182 } | 189 } |
| 183 | 190 |
| 184 } // namespace ui | 191 } // namespace ui |
| OLD | NEW |