[Intel-gfx] [PATCH 23/24] drm/i915: Add a workaround for sprite only <-> primary only switching

Daniel Vetter daniel at ffwll.ch
Fri Mar 7 22:32:55 CET 2014


On Fri, Mar 07, 2014 at 06:32:30PM +0200, ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> ILK and IVB don't like switching between sprite only and primary only
> configurations when LP1+ watermarks have been enabled in the recent
> past. Like WaCxSRDisabledForSpriteScaling we can avoid the flash
> by disabling LP1+ watermarks for one frame before the critical plane
> reconfiguration.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_pm.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index ddf77d5..c011da5 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -3127,9 +3127,18 @@ static int ilk_update_sprite_wm(struct drm_plane *plane,
>  	 * when scaling is disabled.
>  	 *
>  	 * WaCxSRDisabledForSpriteScaling:ivb
> +	 *
> +	 * We also seem to need something similar when switching between
> +	 * primary only and sprite only configurations. Otherwise the screen
> +	 * flashes black. No underrun reported though.
>  	 */
>  	if (IS_IVYBRIDGE(dev) && config->spr.scaled && ilk_disable_lp_wm(crtc))
>  		intel_wait_for_vblank(dev, to_intel_plane(plane)->pipe);
> +	else if (config->pri.enabled != config->spr.enabled &&
> +		 config->pri.enabled != params.pri.enabled &&
> +		 config->spr.enabled != params.spr.enabled &&
> +		 ilk_disable_lp_wm(crtc))

I think it would help readability a bit to extract this monster condition
into a tiny helper with descriptive name ... just my bikeshed of the day.
-Daniel

> +		intel_wait_for_vblank(dev, to_intel_plane(plane)->pipe);
>  
>  	params.pri = config->pri;
>  	params.spr = config->spr;
> -- 
> 1.8.3.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list