diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-03-16 17:16:28 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-03-16 20:48:58 +0000 |
commit | a533b4ba776c16bce53b9739c47409ed3cfe5776 (patch) | |
tree | 0adc1d91e9dfc7166677595f2d3da49e7cdfbc49 /drivers/gpu/drm/i915/intel_lrc.c | |
parent | d3df42b76f583c6c4c6235a1b44339505eaff559 (diff) | |
download | op-kernel-dev-a533b4ba776c16bce53b9739c47409ed3cfe5776.zip op-kernel-dev-a533b4ba776c16bce53b9739c47409ed3cfe5776.tar.gz |
drm/i915: Assert that the context pin_counts do not overflow
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@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170316171628.3228-1-chris@chris-wilson.co.uk
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lrc.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 0e847d7..becde55 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -742,6 +742,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! */ if (!ce->state) { ret = execlists_context_deferred_alloc(ctx, engine); |