Skip to content

Commit 9356404

Browse files
committed
drm/i915: Switch over to the LLC/eLLC hotspot avoidance hash mode for CCS
Use the LLC/eLLC hotspot avoidance mode for CCS on LLC machines. This is reported to give better performance. Testing has indicated that we don't need to enforce any massive 2 or 4 MiB alignment for all compressed resources even though there are still plenty of stale comments in the spec suggesting that we do. We do need to make sure every hardware unit that deals with the compressed data uses the same hash mode. Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Jason Ekstrand <jason@jlekstrand.net> Cc: Daniel Stone <daniels@collabora.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170824191100.10949-4-ville.syrjala@linux.intel.com Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
1 parent 3fd3a6f commit 9356404

File tree

3 files changed

+33
-15
lines changed

3 files changed

+33
-15
lines changed

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6913,7 +6913,7 @@ enum {
69136913
# define CHICKEN3_DGMG_DONE_FIX_DISABLE (1 << 2)
69146914

69156915
#define CHICKEN_PAR1_1 _MMIO(0x42080)
6916-
#define SKL_RC_HASH_OUTSIDE (1 << 15)
6916+
#define SKL_DE_COMPRESSED_HASH_MODE (1 << 15)
69176917
#define DPA_MASK_VBLANK_SRD (1 << 15)
69186918
#define FORCE_ARB_IDLE_PLANES (1 << 14)
69196919
#define SKL_EDP_PSR_FIX_RDWRAP (1 << 3)
@@ -6991,6 +6991,7 @@ enum {
69916991
# define GEN7_CSC1_RHWO_OPT_DISABLE_IN_RCC ((1<<10) | (1<<26))
69926992
# define GEN9_RHWO_OPTIMIZATION_DISABLE (1<<14)
69936993
#define COMMON_SLICE_CHICKEN2 _MMIO(0x7014)
6994+
# define GEN9_PBE_COMPRESSED_HASH_SELECTION (1<<13)
69946995
# define GEN9_DISABLE_GATHER_AT_SET_SHADER_COMMON_SLICE (1<<12)
69956996
# define GEN8_SBE_DISABLE_REPLAY_BUF_OPTIMIZATION (1<<8)
69966997
# define GEN8_CSC2_SBE_VUE_CACHE_CONSERVATIVE (1<<0)
@@ -8085,6 +8086,7 @@ enum {
80858086
#define GEN8_SAMPLER_POWER_BYPASS_DIS (1<<1)
80868087

80878088
#define GEN9_HALF_SLICE_CHICKEN7 _MMIO(0xe194)
8089+
#define GEN9_SAMPLER_HASH_COMPRESSED_READ_ADDR (1<<8)
80888090
#define GEN9_ENABLE_YV12_BUGFIX (1<<4)
80898091
#define GEN9_ENABLE_GPGPU_PREEMPTION (1<<2)
80908092

@@ -9385,4 +9387,8 @@ enum skl_power_gate {
93859387
#define GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_SKL 0x67F1427F /* " " */
93869388
#define GEN9_L3_LRA_1_GPGPU_DEFAULT_VALUE_BXT 0x5FF101FF /* " " */
93879389

9390+
#define MMCD_MISC_CTRL _MMIO(0x4ddc) /* skl+ */
9391+
#define MMCD_PCLA (1 << 31)
9392+
#define MMCD_HOTSPOT_EN (1 << 27)
9393+
93889394
#endif /* _I915_REG_H_ */

drivers/gpu/drm/i915/intel_engine_cs.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,19 @@ static int gen9_init_workarounds(struct intel_engine_cs *engine)
938938
I915_WRITE(GAM_ECOCHK, I915_READ(GAM_ECOCHK) |
939939
ECOCHK_DIS_TLB);
940940

941+
if (HAS_LLC(dev_priv)) {
942+
/* WaCompressedResourceSamplerPbeMediaNewHashMode:skl,kbl
943+
*
944+
* Must match Display Engine. See
945+
* WaCompressedResourceDisplayNewHashMode.
946+
*/
947+
WA_SET_BIT_MASKED(COMMON_SLICE_CHICKEN2,
948+
GEN9_PBE_COMPRESSED_HASH_SELECTION);
949+
WA_SET_BIT_MASKED(GEN9_HALF_SLICE_CHICKEN7,
950+
GEN9_SAMPLER_HASH_COMPRESSED_READ_ADDR);
951+
WA_SET_BIT(MMCD_MISC_CTRL, MMCD_PCLA | MMCD_HOTSPOT_EN);
952+
}
953+
941954
/* WaClearFlowControlGpgpuContextSave:skl,bxt,kbl,glk,cfl */
942955
/* WaDisablePartialInstShootdown:skl,bxt,kbl,glk,cfl */
943956
WA_SET_BIT_MASKED(GEN8_ROW_CHICKEN,

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,23 @@
5858

5959
static void gen9_init_clock_gating(struct drm_i915_private *dev_priv)
6060
{
61+
if (HAS_LLC(dev_priv)) {
62+
/*
63+
* WaCompressedResourceDisplayNewHashMode:skl,kbl
64+
* Display WA#0390: skl,kbl
65+
*
66+
* Must match Sampler, Pixel Back End, and Media. See
67+
* WaCompressedResourceSamplerPbeMediaNewHashMode.
68+
*/
69+
I915_WRITE(CHICKEN_PAR1_1,
70+
I915_READ(CHICKEN_PAR1_1) |
71+
SKL_DE_COMPRESSED_HASH_MODE);
72+
}
73+
6174
/* See Bspec note for PSR2_CTL bit 31, Wa#828:skl,bxt,kbl,cfl */
6275
I915_WRITE(CHICKEN_PAR1_1,
6376
I915_READ(CHICKEN_PAR1_1) | SKL_EDP_PSR_FIX_RDWRAP);
6477

65-
/*
66-
* Display WA#0390: skl,bxt,kbl,glk
67-
*
68-
* Must match Sampler, Pixel Back End, and Media
69-
* (0xE194 bit 8, 0x7014 bit 13, 0x4DDC bits 27 and 31).
70-
*
71-
* Including bits outside the page in the hash would
72-
* require 2 (or 4?) MiB alignment of resources. Just
73-
* assume the defaul hashing mode which only uses bits
74-
* within the page.
75-
*/
76-
I915_WRITE(CHICKEN_PAR1_1,
77-
I915_READ(CHICKEN_PAR1_1) & ~SKL_RC_HASH_OUTSIDE);
78-
7978
I915_WRITE(GEN8_CONFIG0,
8079
I915_READ(GEN8_CONFIG0) | GEN9_DEFAULT_FIXES);
8180

0 commit comments

Comments
 (0)