]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: set ctx->initialized only after RCS
authorBen Widawsky <benjamin.widawsky@intel.com>
Sat, 28 Dec 2013 21:31:49 +0000 (13:31 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 10 Jan 2014 07:21:51 +0000 (08:21 +0100)
commit6880bc1e51bcdf294910864d84cca130d9a93e4a
treeaeee2559d674ccef50e2e62b834ca508dcfde95b
parent51a3c2db85d75734e19939dc6896cd2d2cf43ce8
drm/i915: set ctx->initialized only after RCS

The initialized flag is used to specify a context has been initialized
and it's context is safe to load, ie. the 3d state is setup properly.
With full PPGTT, we emit the address space loads during context switch
and this currently marks a context as initialized. With full PPGTT
patches, if a client first emits a batch to !RCS, then later, RCS, the
code will mistake the context as initialized and try to reload an
uninitialized context.

1. context 1 blit // context marked as initialized, but isn't
2. context 1 render // loads random state from step 2

It is really easy to hit this with a planned upcoming patch which makes
default context reuse possible.

NOTE: This should only effect full PPGTT branches, ie. current
drm-intel-nightly.

Thanks to Chris for helping me track this down.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: Simplify the failure scenario in the commit message according
to Chris' review a bit.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem_context.c