diff mbox

[2/3] drm/i915/glk: Load the degamma LUT even in legacy gamma mode

Message ID 20170203131115.2058-3-ander.conselvan.de.oliveira@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ander Conselvan de Oliveira Feb. 3, 2017, 1:11 p.m. UTC
In Geminilake, the degamma table is enabled or disabled by the pipe CSC
enable bit, so its active even when running in the legacy gamma mode.
So always set sane values for that table, since the default value is all
zeroes.

This fixes blank screens after a suspend/resume cycle while legacy gamma
is in use.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
---
 drivers/gpu/drm/i915/intel_color.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ander Conselvan de Oliveira Feb. 9, 2017, 8:29 a.m. UTC | #1
On Fri, 2017-02-03 at 15:11 +0200, Ander Conselvan de Oliveira wrote:
> In Geminilake, the degamma table is enabled or disabled by the pipe CSC
> enable bit, so its active even when running in the legacy gamma mode.
> So always set sane values for that table, since the default value is all
> zeroes.
> 
> This fixes blank screens after a suspend/resume cycle while legacy gamma
> is in use.

Ville, any comments on this? This is the only thing preventing me from merging
the other patch that flips the switch.

Thanks,
Ander

> 
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_color.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
> index 82e1809..c221891 100644
> --- a/drivers/gpu/drm/i915/intel_color.c
> +++ b/drivers/gpu/drm/i915/intel_color.c
> @@ -453,12 +453,13 @@ static void glk_load_luts(struct drm_crtc_state *state)
> >  	struct intel_crtc_state *intel_state = to_intel_crtc_state(state);
> >  	enum pipe pipe = to_intel_crtc(crtc)->pipe;
>  
> > +	glk_load_degamma_lut(state);
> +
> >  	if (crtc_state_is_legacy(state)) {
> >  		haswell_load_luts(state);
> >  		return;
> >  	}
>  
> > -	glk_load_degamma_lut(state);
> >  	bdw_load_lut(state, 0, (struct drm_color_lut *) state->gamma_lut,
> >  		     INTEL_INFO(dev_priv)->color.gamma_lut_size, 0);
>
Ville Syrjala Feb. 9, 2017, 2:47 p.m. UTC | #2
On Fri, Feb 03, 2017 at 03:11:14PM +0200, Ander Conselvan de Oliveira wrote:
> In Geminilake, the degamma table is enabled or disabled by the pipe CSC
> enable bit, so its active even when running in the legacy gamma mode.
> So always set sane values for that table, since the default value is all
> zeroes.
> 
> This fixes blank screens after a suspend/resume cycle while legacy gamma
> is in use.
> 
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>

Makes sense

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_color.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
> index 82e1809..c221891 100644
> --- a/drivers/gpu/drm/i915/intel_color.c
> +++ b/drivers/gpu/drm/i915/intel_color.c
> @@ -453,12 +453,13 @@ static void glk_load_luts(struct drm_crtc_state *state)
>  	struct intel_crtc_state *intel_state = to_intel_crtc_state(state);
>  	enum pipe pipe = to_intel_crtc(crtc)->pipe;
>  
> +	glk_load_degamma_lut(state);
> +
>  	if (crtc_state_is_legacy(state)) {
>  		haswell_load_luts(state);
>  		return;
>  	}
>  
> -	glk_load_degamma_lut(state);
>  	bdw_load_lut(state, 0, (struct drm_color_lut *) state->gamma_lut,
>  		     INTEL_INFO(dev_priv)->color.gamma_lut_size, 0);
>  
> -- 
> 2.9.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_color.c b/drivers/gpu/drm/i915/intel_color.c
index 82e1809..c221891 100644
--- a/drivers/gpu/drm/i915/intel_color.c
+++ b/drivers/gpu/drm/i915/intel_color.c
@@ -453,12 +453,13 @@  static void glk_load_luts(struct drm_crtc_state *state)
 	struct intel_crtc_state *intel_state = to_intel_crtc_state(state);
 	enum pipe pipe = to_intel_crtc(crtc)->pipe;
 
+	glk_load_degamma_lut(state);
+
 	if (crtc_state_is_legacy(state)) {
 		haswell_load_luts(state);
 		return;
 	}
 
-	glk_load_degamma_lut(state);
 	bdw_load_lut(state, 0, (struct drm_color_lut *) state->gamma_lut,
 		     INTEL_INFO(dev_priv)->color.gamma_lut_size, 0);