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

Side by Side Diff: ui/ozone/platform/drm/gpu/drm_display.cc

Issue 1182063002: Add support for more advanced color correction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@qcms-fixed-point-gamma
Patch Set: Integrate dnicoara@ feedback Created 4 years, 10 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 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 if (!hdcp_property) { 163 if (!hdcp_property) {
164 LOG(ERROR) << "'" << kContentProtection << "' property doesn't exist."; 164 LOG(ERROR) << "'" << kContentProtection << "' property doesn't exist.";
165 return false; 165 return false;
166 } 166 }
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::SetGammaRamp(const std::vector<GammaRampRGBEntry>& lut) { 173 void DrmDisplay::SetColorCorrection(
174 if (!drm_->SetGammaRamp(crtc_, lut)) { 174 const std::vector<GammaRampRGBEntry>& degamma_lut,
175 LOG(ERROR) << "Failed to set gamma ramp for display: crtc_id = " << crtc_ 175 const std::vector<GammaRampRGBEntry>& gamma_lut,
176 << " size = " << lut.size(); 176 const std::vector<float>& correction_matrix) {
177 if (degamma_lut.size() == 0) {
178 if (!drm_->SetGammaRamp(crtc_, gamma_lut)) {
179 LOG(ERROR) << "Failed to set gamma ramp for display: crtc_id = " << crtc_
180 << " size = " << gamma_lut.size();
spang 2016/02/22 18:57:51 PLOG?
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 }
177 } 188 }
178 } 189 }
179 190
180 } // namespace ui 191 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698