drm/i915: Simplify testing for am-I-the-kernel-context?
authorChris Wilson <chris@chris-wilson.co.uk>
Fri, 6 Jan 2017 15:20:13 +0000 (15:20 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 6 Jan 2017 16:02:12 +0000 (16:02 +0000)
commit984ff29f74c0c130b43f0c5b0fe0fbca5de0fddc
treeb2dcdc306f0c3cb210afec411c1a3a54f1e74c30
parente8f9ae9b5062b43b6cb3dd6e45107c8edf25f1d0
drm/i915: Simplify testing for am-I-the-kernel-context?

The kernel context (dev_priv->kernel_context) is unique in that it is
not associated with any user filp - it is the only one with
ctx->file_priv == NULL. This is a simpler test than comparing it against
dev_priv->kernel_context which involves some pointer dancing.

In checking that this is true, we notice that the gvt context is
allocating itself a i915_hw_ppgtt it doesn't use and not flagging that
its file_priv should be invalid.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170106152013.24684-5-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_context.c
drivers/gpu/drm/i915/i915_gem_context.h
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.c