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

Unified Diff: ui/ozone/platform/drm/common/drm_util.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: Rebase after quirks changes Created 4 years, 9 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
« no previous file with comments | « ui/ozone/common/native_display_delegate_ozone.cc ('k') | ui/ozone/platform/drm/gpu/drm_device.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/common/drm_util.cc
diff --git a/ui/ozone/platform/drm/common/drm_util.cc b/ui/ozone/platform/drm/common/drm_util.cc
index eb560ab5ab1f06fd71d5a4deab5530ee3f29aafd..586571a1972405c38b15215468781269d3fe0d87 100644
--- a/ui/ozone/platform/drm/common/drm_util.cc
+++ b/ui/ozone/platform/drm/common/drm_util.cc
@@ -157,6 +157,19 @@ int ConnectorIndex(int device_index, int display_index) {
return ((device_index << 4) + display_index) & 0xFF;
}
+bool HasColorCorrectionMatrix(int fd, drmModeCrtc* crtc) {
+ ScopedDrmObjectPropertyPtr crtc_props(
+ drmModeObjectGetProperties(fd, crtc->crtc_id, DRM_MODE_OBJECT_CRTC));
+
+ for (uint32_t i = 0; i < crtc_props->count_props; ++i) {
+ ScopedDrmPropertyPtr property(drmModeGetProperty(fd, crtc_props->props[i]));
+ if (property && !strcmp(property->name, "CTM")) {
+ return true;
+ }
+ }
+ return false;
+}
+
} // namespace
HardwareDisplayControllerInfo::HardwareDisplayControllerInfo(
@@ -229,6 +242,8 @@ DisplaySnapshot_Params CreateDisplaySnapshotParams(
params.type = GetDisplayType(info->connector());
params.is_aspect_preserving_scaling =
IsAspectPreserving(fd, info->connector());
+ params.has_color_correction_matrix =
+ HasColorCorrectionMatrix(fd, info->crtc());
ScopedDrmPropertyBlobPtr edid_blob(
GetDrmPropertyBlob(fd, info->connector(), "EDID"));
« no previous file with comments | « ui/ozone/common/native_display_delegate_ozone.cc ('k') | ui/ozone/platform/drm/gpu/drm_device.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698