diff options
author | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2016-01-12 17:32:35 +0000 |
---|---|---|
committer | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2016-01-13 10:02:36 +0000 |
commit | d9f3af96c2426bbe5b71b8875ee0ce3a01065c33 (patch) | |
tree | 308f7774591da48a07876c8fbb565328e1087a04 /drivers/gpu | |
parent | c9cacf9349ae4ce516627dac931766bfe98df793 (diff) | |
download | blackbird-obmc-linux-d9f3af96c2426bbe5b71b8875ee0ce3a01065c33.tar.gz blackbird-obmc-linux-d9f3af96c2426bbe5b71b8875ee0ce3a01065c33.zip |
drm/i915: Compact logical ring interrupt initialization
Identically to vfuncs interrupt mask initialization can also be
compacted for more readable code.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1452619956-27014-2-git-send-email-tvrtko.ursulin@linux.intel.com
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index e29cf1c73745..4a6ba0a4aa3d 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -1962,6 +1962,13 @@ logical_ring_default_vfuncs(struct drm_device *dev, } } +static inline void +logical_ring_default_irqs(struct intel_engine_cs *ring, unsigned shift) +{ + ring->irq_enable_mask = GT_RENDER_USER_INTERRUPT << shift; + ring->irq_keep_mask = GT_CONTEXT_SWITCH_INTERRUPT << shift; +} + static int logical_ring_init(struct drm_device *dev, struct intel_engine_cs *ring) { @@ -2017,10 +2024,8 @@ static int logical_render_ring_init(struct drm_device *dev) ring->name = "render ring"; ring->id = RCS; ring->mmio_base = RENDER_RING_BASE; - ring->irq_enable_mask = - GT_RENDER_USER_INTERRUPT << GEN8_RCS_IRQ_SHIFT; - ring->irq_keep_mask = - GT_CONTEXT_SWITCH_INTERRUPT << GEN8_RCS_IRQ_SHIFT; + + logical_ring_default_irqs(ring, GEN8_RCS_IRQ_SHIFT); if (HAS_L3_DPF(dev)) ring->irq_keep_mask |= GT_RENDER_L3_PARITY_ERROR_INTERRUPT; @@ -2068,11 +2073,8 @@ static int logical_bsd_ring_init(struct drm_device *dev) ring->name = "bsd ring"; ring->id = VCS; ring->mmio_base = GEN6_BSD_RING_BASE; - ring->irq_enable_mask = - GT_RENDER_USER_INTERRUPT << GEN8_VCS1_IRQ_SHIFT; - ring->irq_keep_mask = - GT_CONTEXT_SWITCH_INTERRUPT << GEN8_VCS1_IRQ_SHIFT; + logical_ring_default_irqs(ring, GEN8_VCS1_IRQ_SHIFT); logical_ring_default_vfuncs(dev, ring); return logical_ring_init(dev, ring); @@ -2086,11 +2088,8 @@ static int logical_bsd2_ring_init(struct drm_device *dev) ring->name = "bds2 ring"; ring->id = VCS2; ring->mmio_base = GEN8_BSD2_RING_BASE; - ring->irq_enable_mask = - GT_RENDER_USER_INTERRUPT << GEN8_VCS2_IRQ_SHIFT; - ring->irq_keep_mask = - GT_CONTEXT_SWITCH_INTERRUPT << GEN8_VCS2_IRQ_SHIFT; + logical_ring_default_irqs(ring, GEN8_VCS2_IRQ_SHIFT); logical_ring_default_vfuncs(dev, ring); return logical_ring_init(dev, ring); @@ -2104,11 +2103,8 @@ static int logical_blt_ring_init(struct drm_device *dev) ring->name = "blitter ring"; ring->id = BCS; ring->mmio_base = BLT_RING_BASE; - ring->irq_enable_mask = - GT_RENDER_USER_INTERRUPT << GEN8_BCS_IRQ_SHIFT; - ring->irq_keep_mask = - GT_CONTEXT_SWITCH_INTERRUPT << GEN8_BCS_IRQ_SHIFT; + logical_ring_default_irqs(ring, GEN8_BCS_IRQ_SHIFT); logical_ring_default_vfuncs(dev, ring); return logical_ring_init(dev, ring); @@ -2122,11 +2118,8 @@ static int logical_vebox_ring_init(struct drm_device *dev) ring->name = "video enhancement ring"; ring->id = VECS; ring->mmio_base = VEBOX_RING_BASE; - ring->irq_enable_mask = - GT_RENDER_USER_INTERRUPT << GEN8_VECS_IRQ_SHIFT; - ring->irq_keep_mask = - GT_CONTEXT_SWITCH_INTERRUPT << GEN8_VECS_IRQ_SHIFT; + logical_ring_default_irqs(ring, GEN8_VECS_IRQ_SHIFT); logical_ring_default_vfuncs(dev, ring); return logical_ring_init(dev, ring); |