[Intel-gfx] [PATCH 08/14] drm/i915: Pre-compute plane control register value

Chris Wilson chris at chris-wilson.co.uk
Fri Mar 17 22:01:05 UTC 2017


On Fri, Mar 17, 2017 at 11:18:02PM +0200, ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Computing the plane control register value is branchy so moving it out
> from the plane commit hook seems prudent. Let's pre-compute it during
> the atomic check phase and store the result in the plane state.

i845_cursor_ctl parameters starting to look more sensible.

> @@ -986,6 +978,14 @@ intel_check_sprite_plane(struct drm_plane *plane,

This function still doesn't do what it says on the tin!!!

>  		ret = skl_check_plane_surface(state);
>  		if (ret)
>  			return ret;
> +
> +		state->ctl = skl_plane_ctl(crtc_state, state);
> +	} else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
> +		state->ctl = vlv_sprite_ctl(crtc_state, state);
> +	} else if (INTEL_GEN(dev_priv) >= 7) {
> +		state->ctl = ivb_sprite_ctl(crtc_state, state);
> +	} else {
> +		state->ctl = ilk_sprite_ctl(crtc_state, state);
>  	}

Precomputing these is a very good idea.
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list