[Intel-gfx] [PATCH v2] drm/i915: Assert that the context pin_counts do not overflow

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Fri Mar 17 07:29:37 UTC 2017


On to, 2017-03-16 at 17:16 +0000, Chris Wilson wrote:
> This should be impossible, but let's assert that we do not pin a context
> 4 billion times before retiring!
> 
> v2: Fix the assertion -- the patch had just one job to do!
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> Cc: Mika Kuoppala <mika.kuoppala at intel.com>

<SNIP>

> @@ -748,6 +748,7 @@ static int execlists_context_pin(struct intel_engine_cs *engine,
>  
>  	if (ce->pin_count++)
>  		return 0;
> +	GEM_BUG_ON(!ce->pin_count); /* no overflow please! */

An average engineer is able to tell this is about overflow, even
without the comment :P

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the Intel-gfx mailing list