aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_ringbuffer.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-12 17:07:46 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-12 17:07:46 -0500
commit0a87a2db485a1456b7427914969c0e8195a1bbda (patch)
tree8d0186672af22c6ee76118c471881cd66a36502d /drivers/gpu/drm/i915/intel_ringbuffer.c
parent7226572d8ed48f7e1aa9de5383d919490d6e9a0c (diff)
parentfcf3aac5fc307f0cae429f5844ddc25761662858 (diff)
Merge tag 'topic/i915-hda-componentized-2015-01-12' into drm-intel-next-queued
Conflicts: drivers/gpu/drm/i915/intel_runtime_pm.c Separate branch so that Takashi can also pull just this refactoring into sound-next. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.c')
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 3cad32a80108..12a36f0ca53d 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -373,12 +373,15 @@ gen7_render_ring_flush(struct intel_engine_cs *ring,
373 flags |= PIPE_CONTROL_VF_CACHE_INVALIDATE; 373 flags |= PIPE_CONTROL_VF_CACHE_INVALIDATE;
374 flags |= PIPE_CONTROL_CONST_CACHE_INVALIDATE; 374 flags |= PIPE_CONTROL_CONST_CACHE_INVALIDATE;
375 flags |= PIPE_CONTROL_STATE_CACHE_INVALIDATE; 375 flags |= PIPE_CONTROL_STATE_CACHE_INVALIDATE;
376 flags |= PIPE_CONTROL_MEDIA_STATE_CLEAR;
376 /* 377 /*
377 * TLB invalidate requires a post-sync write. 378 * TLB invalidate requires a post-sync write.
378 */ 379 */
379 flags |= PIPE_CONTROL_QW_WRITE; 380 flags |= PIPE_CONTROL_QW_WRITE;
380 flags |= PIPE_CONTROL_GLOBAL_GTT_IVB; 381 flags |= PIPE_CONTROL_GLOBAL_GTT_IVB;
381 382
383 flags |= PIPE_CONTROL_STALL_AT_SCOREBOARD;
384
382 /* Workaround: we must issue a pipe_control with CS-stall bit 385 /* Workaround: we must issue a pipe_control with CS-stall bit
383 * set before a pipe_control command that has the state cache 386 * set before a pipe_control command that has the state cache
384 * invalidate bit set. */ 387 * invalidate bit set. */
@@ -727,7 +730,7 @@ static int intel_rcs_ctx_init(struct intel_engine_cs *ring,
727} 730}
728 731
729static int wa_add(struct drm_i915_private *dev_priv, 732static int wa_add(struct drm_i915_private *dev_priv,
730 const u32 addr, const u32 val, const u32 mask) 733 const u32 addr, const u32 mask, const u32 val)
731{ 734{
732 const u32 idx = dev_priv->workarounds.count; 735 const u32 idx = dev_priv->workarounds.count;
733 736
@@ -743,22 +746,25 @@ static int wa_add(struct drm_i915_private *dev_priv,
743 return 0; 746 return 0;
744} 747}
745 748
746#define WA_REG(addr, val, mask) { \ 749#define WA_REG(addr, mask, val) { \
747 const int r = wa_add(dev_priv, (addr), (val), (mask)); \ 750 const int r = wa_add(dev_priv, (addr), (mask), (val)); \
748 if (r) \ 751 if (r) \
749 return r; \ 752 return r; \
750 } 753 }
751 754
752#define WA_SET_BIT_MASKED(addr, mask) \ 755#define WA_SET_BIT_MASKED(addr, mask) \
753 WA_REG(addr, _MASKED_BIT_ENABLE(mask), (mask) & 0xffff) 756 WA_REG(addr, (mask), _MASKED_BIT_ENABLE(mask))
754 757
755#define WA_CLR_BIT_MASKED(addr, mask) \ 758#define WA_CLR_BIT_MASKED(addr, mask) \
756 WA_REG(addr, _MASKED_BIT_DISABLE(mask), (mask) & 0xffff) 759 WA_REG(addr, (mask), _MASKED_BIT_DISABLE(mask))
760
761#define WA_SET_FIELD_MASKED(addr, mask, value) \
762 WA_REG(addr, mask, _MASKED_FIELD(mask, value))
757 763
758#define WA_SET_BIT(addr, mask) WA_REG(addr, I915_READ(addr) | (mask), mask) 764#define WA_SET_BIT(addr, mask) WA_REG(addr, mask, I915_READ(addr) | (mask))
759#define WA_CLR_BIT(addr, mask) WA_REG(addr, I915_READ(addr) & ~(mask), mask) 765#define WA_CLR_BIT(addr, mask) WA_REG(addr, mask, I915_READ(addr) & ~(mask))
760 766
761#define WA_WRITE(addr, val) WA_REG(addr, val, 0xffffffff) 767#define WA_WRITE(addr, val) WA_REG(addr, 0xffffffff, val)
762 768
763static int bdw_init_workarounds(struct intel_engine_cs *ring) 769static int bdw_init_workarounds(struct intel_engine_cs *ring)
764{ 770{
@@ -802,8 +808,9 @@ static int bdw_init_workarounds(struct intel_engine_cs *ring)
802 * disable bit, which we don't touch here, but it's good 808 * disable bit, which we don't touch here, but it's good
803 * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM). 809 * to keep in mind (see 3DSTATE_PS and 3DSTATE_WM).
804 */ 810 */
805 WA_SET_BIT_MASKED(GEN7_GT_MODE, 811 WA_SET_FIELD_MASKED(GEN7_GT_MODE,
806 GEN6_WIZ_HASHING_MASK | GEN6_WIZ_HASHING_16x4); 812 GEN6_WIZ_HASHING_MASK,
813 GEN6_WIZ_HASHING_16x4);
807 814
808 return 0; 815 return 0;
809} 816}