drm/i915: Add REG_WRITE_FOOTER
Subsystems (2)
PATCH 1/1 drm/i915: Add REG_WRITE_FOOTER
From: Ville Syrjälä <[email protected]>
Add a REG_WRITE_FOOTER macro as a counterpart to the REG_WRITE_HEADER. The current code has the spin_lock() in the HEADER, but the spin_unlock() is open coded, which looks rather confusing on the first glance. A bit of additional symmetry might help.
--- drivers/gpu/drm/i915/intel_uncore.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_uncore.c +9 -5
@@ -535,12 +535,15 @@ __gen4_read(64)trace_i915_reg_rw (true, reg, val,sizeof (val), trace); \ spin_lock_irqsave(&dev_priv->uncore.lock, irqflags) +#define REG_WRITE_FOOTER \ + spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags) +#define __gen4_write (x) \ static void \ gen4_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool trace) { \ REG_WRITE_HEADER; \ __raw_i915_write##x(dev_priv, reg, val); \ - spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); \ + REG_WRITE_FOOTER; \ }#define __gen5_write (x) \
@@ -549,7 +552,7 @@ gen5_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool traceREG_WRITE_HEADER ; \ilk_dummy_write (dev_priv); \ __raw_i915_write##x(dev_priv, reg, val); \ - spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags); \ + REG_WRITE_FOOTER; \ }#define __gen6_write (x) \
@@ -564,7 +567,7 @@ gen6_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool traceif (unlikely (__fifo_ret)) { \gen6_gt_check_fifodbg (dev_priv); \ } \ -spin_unlock_irqrestore (&dev_priv->uncore.lock, irqflags); \ +REG_WRITE_FOOTER ; \ }#define __hsw_write (x) \
@@ -581,7 +584,7 @@ hsw_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool trace)gen6_gt_check_fifodbg (dev_priv); \ } \hsw_unclaimed_reg_check (dev_priv, reg); \ -spin_unlock_irqrestore (&dev_priv->uncore.lock, irqflags); \ +REG_WRITE_FOOTER ; \ }static const u32 gen8_shadowed_regs[] = {
@@ -619,7 +622,7 @@ gen8_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, bool trace dev_priv->uncore.funcs.force_wake_put (dev_priv, \FORCEWAKE_ALL ); \ } \ -spin_unlock_irqrestore (&dev_priv->uncore.lock, irqflags); \ +REG_WRITE_FOOTER ; \ }__gen8_write (8 )
@@ -648,6 +651,7 @@ __gen4_write(64)#undef __gen6_write#undef __gen5_write#undef __gen4_write +#undef REG_WRITE_FOOTER#undef REG_WRITE_HEADERvoid intel_uncore_init (struct drm_device *dev)
Signature · 6 lines
1.8.3.2 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 8 lines · [email protected] writes:
From: Ville Syrjälä <[email protected]>
Add a
REG_WRITE_FOOTERmacro as a counterpart to theREG_WRITE_HEADER. The current code has thespin_lock()in the HEADER, but thespin_unlock()is open coded, which looks rather confusing on the first glance. A bit of additional symmetry might help.Signed-off-by Ville Syrjälä <[email protected]>
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx