| 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_gpu_display_manager.h" | 5 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "ui/display/types/gamma_ramp_rgb_entry.h" | 9 #include "ui/display/types/gamma_ramp_rgb_entry.h" |
| 10 #include "ui/ozone/common/display_util.h" | 10 #include "ui/ozone/common/display_util.h" |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 bool DrmGpuDisplayManager::SetHDCPState(int64_t display_id, HDCPState state) { | 188 bool DrmGpuDisplayManager::SetHDCPState(int64_t display_id, HDCPState state) { |
| 189 DrmDisplay* display = FindDisplay(display_id); | 189 DrmDisplay* display = FindDisplay(display_id); |
| 190 if (!display) { | 190 if (!display) { |
| 191 LOG(ERROR) << "There is no display with ID " << display_id; | 191 LOG(ERROR) << "There is no display with ID " << display_id; |
| 192 return false; | 192 return false; |
| 193 } | 193 } |
| 194 | 194 |
| 195 return display->SetHDCPState(state); | 195 return display->SetHDCPState(state); |
| 196 } | 196 } |
| 197 | 197 |
| 198 void DrmGpuDisplayManager::SetGammaRamp( | 198 void DrmGpuDisplayManager::SetColorCorrection( |
| 199 int64_t display_id, | 199 int64_t display_id, |
| 200 const std::vector<GammaRampRGBEntry>& lut) { | 200 const std::vector<GammaRampRGBEntry>& degamma_lut, |
| 201 const std::vector<GammaRampRGBEntry>& gamma_lut, |
| 202 const std::vector<float>& correction_matrix) { |
| 201 DrmDisplay* display = FindDisplay(display_id); | 203 DrmDisplay* display = FindDisplay(display_id); |
| 202 if (!display) { | 204 if (!display) { |
| 203 LOG(ERROR) << "There is no display with ID " << display_id; | 205 LOG(ERROR) << "There is no display with ID " << display_id; |
| 204 return; | 206 return; |
| 205 } | 207 } |
| 206 | 208 |
| 207 display->SetGammaRamp(lut); | 209 display->SetColorCorrection(degamma_lut, gamma_lut, correction_matrix); |
| 208 } | 210 } |
| 209 | 211 |
| 210 DrmDisplay* DrmGpuDisplayManager::FindDisplay(int64_t display_id) { | 212 DrmDisplay* DrmGpuDisplayManager::FindDisplay(int64_t display_id) { |
| 211 for (const auto& display : displays_) { | 213 for (const auto& display : displays_) { |
| 212 if (display->display_id() == display_id) | 214 if (display->display_id() == display_id) |
| 213 return display.get(); | 215 return display.get(); |
| 214 } | 216 } |
| 215 | 217 |
| 216 return nullptr; | 218 return nullptr; |
| 217 } | 219 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 234 DisplayComparator(new_display.get())); | 236 DisplayComparator(new_display.get())); |
| 235 | 237 |
| 236 if (it == old_displays.end()) { | 238 if (it == old_displays.end()) { |
| 237 screen_manager_->AddDisplayController( | 239 screen_manager_->AddDisplayController( |
| 238 new_display->drm(), new_display->crtc(), new_display->connector()); | 240 new_display->drm(), new_display->crtc(), new_display->connector()); |
| 239 } | 241 } |
| 240 } | 242 } |
| 241 } | 243 } |
| 242 | 244 |
| 243 } // namespace ui | 245 } // namespace ui |
| OLD | NEW |