[PATCH 16/18] drm/i915: Enable YUV to RGB for Gen10 in Plane Ctrl Reg

Vidya Srinivas vidya.srinivas at intel.com
Mon Feb 26 02:47:02 UTC 2018


If the fb format is YUV, enable the plane CSC mode bits
for the conversion.

v2: Addressed review comments from Shashank Sharma
Alignment issue fixed in i915_reg.h

v3: Adding Reviewed By from Shashank Sharma

Reviewed-by: Shashank Sharma <shashank.sharma at intel.com>
Signed-off-by: Vidya Srinivas <vidya.srinivas at intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h      | 6 ++++++
 drivers/gpu/drm/i915/intel_display.c | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 40c4ad5..226e951 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -6460,6 +6460,12 @@ enum {
 #define _PLANE_COLOR_CTL_3_A			0x703CC /* GLK+ */
 #define   PLANE_COLOR_PIPE_GAMMA_ENABLE		(1 << 30)
 #define   PLANE_COLOR_PIPE_CSC_ENABLE		(1 << 23)
+#define   PLANE_COLOR_CSC_MASK			(0x7 << 17)
+#define   PLANE_COLOR_CSC_MODE_BYPASS		(0 << 17)
+#define   PLANE_COLOR_YUV601_TO_RGB709		(1 << 17)
+#define   PLANE_COLOR_YUV709_TO_RGB709		(2 << 17)
+#define   PLANE_COLOR_YUV2020_TO_RGB2020	(3 << 17)
+#define   PLANE_COLOR_RGB709_TO_RGB2020		(4 << 17)
 #define   PLANE_COLOR_PLANE_GAMMA_DISABLE	(1 << 13)
 #define   PLANE_COLOR_ALPHA_MASK		(0x3 << 4)
 #define   PLANE_COLOR_ALPHA_DISABLE		(0 << 4)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e348ed9..b653f1e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3615,6 +3615,8 @@ u32 glk_plane_color_ctl(const struct intel_crtc_state *crtc_state,
 	plane_color_ctl |= PLANE_COLOR_PIPE_CSC_ENABLE;
 	plane_color_ctl |= PLANE_COLOR_PLANE_GAMMA_DISABLE;
 	plane_color_ctl |= glk_plane_color_ctl_alpha(fb->format->format);
+	if (fb && intel_format_is_yuv(fb->format->format))
+		plane_color_ctl |= PLANE_COLOR_YUV709_TO_RGB709;
 
 	return plane_color_ctl;
 }
-- 
2.7.4



More information about the Intel-gfx-trybot mailing list