Skip to content

Commit

Permalink
drm/i915: Only unpin the default ctx object if it exists
Browse files Browse the repository at this point in the history
Since commit 691e641
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Wed Apr 9 09:07:36 2014 +0100

    drm/i915: Always use kref tracking for all contexts.

we have contexts everywhere, and so we must be careful to distinguish
fake contexts, which do not have an associated bo, and real ones, which
do. In particular, we now need to be careful not to dereference NULL
pointers.

This is one such example, as the commit highlighted above failed to move
the unpinning of the default ctx object into the real-context-only
branch.

Reported-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78792
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Chris Wilson authored and Daniel Vetter committed May 16, 2014
1 parent 823c690 commit d3b448d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/i915/i915_gem_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ void i915_gem_context_fini(struct drm_device *dev)
i915_gem_context_unreference(dctx);
dev_priv->ring[RCS].last_context = NULL;
}

i915_gem_object_ggtt_unpin(dctx->obj);
}

for (i = 0; i < I915_NUM_RINGS; i++) {
Expand All @@ -461,7 +463,6 @@ void i915_gem_context_fini(struct drm_device *dev)
ring->last_context = NULL;
}

i915_gem_object_ggtt_unpin(dctx->obj);
i915_gem_context_unreference(dctx);
}

Expand Down

0 comments on commit d3b448d

Please sign in to comment.