提交 a533b4ba 编写于 作者: C Chris Wilson

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: NChris 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.ukReviewed-by: NMika Kuoppala <mika.kuoppala@intel.com>
上级 d3df42b7
...@@ -742,6 +742,7 @@ static int execlists_context_pin(struct intel_engine_cs *engine, ...@@ -742,6 +742,7 @@ static int execlists_context_pin(struct intel_engine_cs *engine,
if (ce->pin_count++) if (ce->pin_count++)
return 0; return 0;
GEM_BUG_ON(!ce->pin_count); /* no overflow please! */
if (!ce->state) { if (!ce->state) {
ret = execlists_context_deferred_alloc(ctx, engine); ret = execlists_context_deferred_alloc(ctx, engine);
......
...@@ -1445,6 +1445,7 @@ static int intel_ring_context_pin(struct intel_engine_cs *engine, ...@@ -1445,6 +1445,7 @@ static int intel_ring_context_pin(struct intel_engine_cs *engine,
if (ce->pin_count++) if (ce->pin_count++)
return 0; return 0;
GEM_BUG_ON(!ce->pin_count); /* no overflow please! */
if (ce->state) { if (ce->state) {
ret = context_pin(ctx); ret = context_pin(ctx);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册