aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-09-13 09:35:34 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2017-09-13 12:24:32 -0400
commit6d2cb5aa383bf020ee95e33d9d107975f340ae1c (patch)
tree5812dcf736a75ebcf72859de19ca1223fbeede40 /drivers/gpu/drm/i915/intel_ringbuffer.h
parent34a04e5e46cb984a6bab336484fa856574db332f (diff)
drm/i915/execlists: Read the context-status buffer from the HWSP
The engine provides a mirror of the CSB in the HWSP. If we use the cacheable reads from the HWSP, we can shave off a few mmio reads per context-switch interrupt (which are quite frequent!). Just removing a couple of mmio is not enough to actually reduce any latency, but a small reduction in overall cpu usage. Much appreciation for Ben dropping the bombshell that the CSB was in the HWSP and for Michel in digging out the details. v2: Don't be lazy, add the defines for the indices. v3: Include the HWSP in debugfs/i915_engine_info v4: Check for GVT-g, it currently depends on intercepting CSB mmio v5: Fixup GVT-g mmio path v6: Disable HWSP if VT-d is active as the iommu adds unpredictable memory latency. (Mika) v7: Also markup the CSB read with READ_ONCE() as it may still be an mmio read and we want to stop the compiler from issuing a later (v.slow) reload. Suggested-by: Ben Widawsky <benjamin.widawsky@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michel Thierry <michel.thierry@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Zhenyu Wang <zhenyuw@linux.intel.com> Cc: Zhi Wang <zhi.a.wang@intel.com> Acked-by: Michel Thierry <michel.thierry@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170913133534.26927-1-chris@chris-wilson.co.uk Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.h')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index 79c0021f3700..5c055b62966d 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -391,6 +391,7 @@ struct intel_engine_cs {
391 struct rb_root execlist_queue; 391 struct rb_root execlist_queue;
392 struct rb_node *execlist_first; 392 struct rb_node *execlist_first;
393 unsigned int fw_domains; 393 unsigned int fw_domains;
394 bool csb_use_mmio;
394 395
395 /* Contexts are pinned whilst they are active on the GPU. The last 396 /* Contexts are pinned whilst they are active on the GPU. The last
396 * context executed remains active whilst the GPU is idle - the 397 * context executed remains active whilst the GPU is idle - the
@@ -496,6 +497,8 @@ intel_write_status_page(struct intel_engine_cs *engine, int reg, u32 value)
496#define I915_GEM_HWS_SCRATCH_INDEX 0x40 497#define I915_GEM_HWS_SCRATCH_INDEX 0x40
497#define I915_GEM_HWS_SCRATCH_ADDR (I915_GEM_HWS_SCRATCH_INDEX << MI_STORE_DWORD_INDEX_SHIFT) 498#define I915_GEM_HWS_SCRATCH_ADDR (I915_GEM_HWS_SCRATCH_INDEX << MI_STORE_DWORD_INDEX_SHIFT)
498 499
500#define I915_HWS_CSB_BUF0_INDEX 0x10
501
499struct intel_ring * 502struct intel_ring *
500intel_engine_create_ring(struct intel_engine_cs *engine, int size); 503intel_engine_create_ring(struct intel_engine_cs *engine, int size);
501int intel_ring_pin(struct intel_ring *ring, 504int intel_ring_pin(struct intel_ring *ring,