diff mbox series

[4/6] drm/i915: Configure overlay cc_out precision based on crtc gamma config

Message ID 20191028113036.27553-4-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series [1/6] drm/i915: Fix i845/i865 cursor width | expand

Commit Message

Ville Syrjala Oct. 28, 2019, 11:30 a.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Put the overlay color conversion unit into 10bit mode if the
pipe isn't using the 8bit legacy gamma. Not 100% sure this is
what the intention of the bit was but makes at least some sense to
me.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_overlay.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Chris Wilson May 15, 2020, 4:40 p.m. UTC | #1
Quoting Ville Syrjala (2019-10-28 11:30:34)
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Put the overlay color conversion unit into 10bit mode if the
> pipe isn't using the 8bit legacy gamma. Not 100% sure this is
> what the intention of the bit was but makes at least some sense to
> me.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

It has 2 chances.
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_overlay.c b/drivers/gpu/drm/i915/display/intel_overlay.c
index 23829374f751..e51592e35efe 100644
--- a/drivers/gpu/drm/i915/display/intel_overlay.c
+++ b/drivers/gpu/drm/i915/display/intel_overlay.c
@@ -777,9 +777,13 @@  static int intel_overlay_do_put_image(struct intel_overlay *overlay,
 	intel_frontbuffer_flush(new_bo->frontbuffer, ORIGIN_DIRTYFB);
 
 	if (!overlay->active) {
-		u32 oconfig;
+		const struct intel_crtc_state *crtc_state =
+			overlay->crtc->config;
+		u32 oconfig = 0;
 
-		oconfig = OCONF_CC_OUT_8BIT;
+		if (crtc_state->gamma_enable &&
+		    crtc_state->gamma_mode == GAMMA_MODE_MODE_8BIT)
+			oconfig |= OCONF_CC_OUT_8BIT;
 		if (IS_GEN(dev_priv, 4))
 			oconfig |= OCONF_CSC_MODE_BT709;
 		oconfig |= pipe == 0 ?