[Intel-gfx] [PATCH] drm/i915: Bail if we do not setup the RCS engine

Tvrtko Ursulin tvrtko.ursulin at linux.intel.com
Tue Apr 11 16:03:09 UTC 2017


On 11/04/2017 16:30, Chris Wilson wrote:
> In places, we assume that RCS exists. This has been true forever, but
> let us catch this failure during bringup by adding an explicit check
> that we do have an RCS engine.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/intel_engine_cs.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index 71e89a93fe18..3595209d86cf 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -154,9 +154,9 @@ int intel_engines_init_early(struct drm_i915_private *dev_priv)
>  {
>  	struct intel_device_info *device_info = mkwrite_device_info(dev_priv);
>  	unsigned int ring_mask = INTEL_INFO(dev_priv)->ring_mask;
> -	unsigned int mask = 0;
>  	struct intel_engine_cs *engine;
>  	enum intel_engine_id id;
> +	unsigned int mask = 0;

+/- 0 :)

>  	unsigned int i;
>  	int err;
>
> @@ -183,6 +183,12 @@ int intel_engines_init_early(struct drm_i915_private *dev_priv)
>  	if (WARN_ON(mask != ring_mask))
>  		device_info->ring_mask = mask;
>
> +	/* We always presume we have at least RCS available for probing */
> +	if (WARN_ON(!(mask & ENGINE_MASK(RCS)))) {

No idea why would you want this. You could also just use HAS_ENGINE 
since info->ring_mask is up to date by this point. And you can make 
ring_mask const if it makes any difference. :)

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>

Regards,

Tvrtko

> +		err = -ENODEV;
> +		goto cleanup;
> +	}
> +
>  	device_info->num_rings = hweight32(mask);
>
>  	return 0;
>


More information about the Intel-gfx mailing list