aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.h
diff options
context:
space:
mode:
authorOscar Mateo <oscar.mateo@intel.com>2014-07-24 12:04:13 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-08-11 10:04:16 -0400
commitc9e003af2d44d9f6eafe855448c41c9ac08ae895 (patch)
tree3fd7998eabbdc626e4bc9f123fc2a4fa7f31656f /drivers/gpu/drm/i915/i915_drv.h
parentede7d42baeece583c864badb6f9081f4cded6c32 (diff)
drm/i915/bdw: Introduce one context backing object per engine
A context backing object only makes sense for a given engine (because it holds state data specific to that engine). In legacy ringbuffer sumission mode, the only MI_SET_CONTEXT we really perform is for the render engine, so one backing object is all we nee. With Execlists, however, we need backing objects for every engine, as contexts become the only way to submit workloads to the GPU. To tackle this problem, we multiplex the context struct to contain <no-of-engines> objects. Originally, I colored this code by instantiating one new context for every engine I wanted to use, but this change suggested by Brad Volkin makes it more elegant. v2: Leave the old backing object pointer behind. Daniel Vetter suggested using a union, but it makes more sense to keep rcs_state as a NULL pointer behind, to make sure no one uses it incorrectly when Execlists are enabled, similar to what he suggested for ring->buffer (Rusty's API level 5). v3: Use the name "state" instead of the too-generic "obj", so that it mirrors the name choice for the legacy rcs_state. Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index fd2aa15ce02b..ad70e8ec18bc 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -626,11 +626,17 @@ struct intel_context {
626 struct i915_ctx_hang_stats hang_stats; 626 struct i915_ctx_hang_stats hang_stats;
627 struct i915_address_space *vm; 627 struct i915_address_space *vm;
628 628
629 /* Legacy ring buffer submission */
629 struct { 630 struct {
630 struct drm_i915_gem_object *rcs_state; 631 struct drm_i915_gem_object *rcs_state;
631 bool initialized; 632 bool initialized;
632 } legacy_hw_ctx; 633 } legacy_hw_ctx;
633 634
635 /* Execlists */
636 struct {
637 struct drm_i915_gem_object *state;
638 } engine[I915_NUM_RINGS];
639
634 struct list_head link; 640 struct list_head link;
635}; 641};
636 642