summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/intel_ringbuffer.h
diff options
context:
space:
mode:
authorDave Gordon <david.s.gordon@intel.com>2016-07-13 16:03:35 +0100
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>2016-07-14 11:16:18 +0100
commitc2c7f240081da626ed9da6dc536306d2ad393c9a (patch)
treef7b19ed9893ade3fa06cddd36205c254f8a51134 /drivers/gpu/drm/i915/intel_ringbuffer.h
parent035ea405c91e2dc89325a79129cf9af2b9c2ae8e (diff)
downloadlwn-c2c7f240081da626ed9da6dc536306d2ad393c9a.tar.gz
lwn-c2c7f240081da626ed9da6dc536306d2ad393c9a.zip
drm/i915: unify first-stage engine struct setup
intel_lrc.c has a table of "logical rings" (meaning engines), while intel_ringbuffer.c has separately open-coded initialisation for each engine. We can deduplicate this somewhat by using the same first-stage engine-setup function for both modes. So here we expose the function that transfers information from the static table of (all) known engines to the dev_priv->engine array of engines available on this device (adjusting the names along the way) and then embed calls to it in both the LRC and the legacy-mode setup. Signed-off-by: Dave Gordon <david.s.gordon@intel.com> Reviewed-by: Chris Wilson <chris-wilson.co.uk> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.h')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index 12cb7ed90014..f8eeb50868c3 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -147,6 +147,7 @@ struct intel_engine_cs {
unsigned int hw_id;
unsigned int guc_id; /* XXX same as hw_id? */
u32 mmio_base;
+ unsigned int irq_shift;
struct intel_ringbuffer *buffer;
struct list_head buffers;
@@ -361,6 +362,10 @@ struct intel_engine_cs {
u32 (*get_cmd_length_mask)(u32 cmd_header);
};
+struct intel_engine_cs *
+intel_engine_setup(struct drm_i915_private *dev_priv,
+ enum intel_engine_id id);
+
static inline bool
intel_engine_initialized(const struct intel_engine_cs *engine)
{