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

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

Issue 1028563003: Load and apply a vcgt table from an ICC file to the internal display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address oshima & spang feedback Created 5 years, 8 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
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..9a76c190647b2d50c279f08d9030aa1753809a7c 100644
--- a/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc
+++ b/ui/ozone/platform/drm/gpu/drm_gpu_display_manager.cc
@@ -236,6 +236,26 @@ void DrmGpuDisplayManager::RemoveGraphicsDevice(const base::FilePath& path) {
devices_.erase(it);
}
+void DrmGpuDisplayManager::SetGammaRamp(int64_t id,
+ const std::vector<uint16_t>& r,
+ const std::vector<uint16_t>& g,
+ const std::vector<uint16_t>& b) {
+ DrmDisplaySnapshot* display = FindDisplaySnapshot(id);
+ if (!display) {
+ LOG(ERROR) << "There is no display with ID " << id;
+ return;
+ }
+
+ if (r.size() != g.size() || g.size() != b.size()) {
+ LOG(ERROR) << "Gamma ramp channels must all the same length.";
+ }
+
+ if (!display->drm()->SetGammaRamp(display->crtc(), r, g, b)) {
+ LOG(ERROR) << "Failed to set gamma ramp for display: crtc_id = "
+ << display->crtc() << " size = " << r.size();
+ }
+}
+
DrmDisplaySnapshot* DrmGpuDisplayManager::FindDisplaySnapshot(int64_t id) {
for (size_t i = 0; i < cached_displays_.size(); ++i)
if (cached_displays_[i]->display_id() == id)

Powered by Google App Engine
This is Rietveld 408576698