drm/i915/tgl: Introduce gen12 forcewake ranges
Subsystems (3)
PATCH 1/4 drm/i915/tgl: Introduce gen12 forcewake ranges
From: Michel Thierry <[email protected]>
The media ranges extend beyond what gen11 gives so we can't piggypack on gen11 ranges, even on read side.
Introduce a table for gen12 and accessors for it.
v2: correctly implement gen12_fwtable_write/read (Daniele)
v3: update with ranges from bspec.
v4: avoid GEN11_NEEDS_FORCEWAKE on read size (Mika)
BSpec: 18331.
--- drivers/gpu/drm/i915/intel_uncore.c | 75 ++++++++++++++++++- drivers/gpu/drm/i915/selftests/intel_uncore.c | 2 + 2 files changed, 76 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_uncore.c +74 -1
@@ -910,6 +910,9 @@ static const struct intel_forcewake_range __vlv_fw_ranges[] = { __fwd; \ }) +#define __gen12_fwtable_reg_read_fw_domains (uncore, offset) \ + find_fw_domain(uncore, offset) +/* *Must* be sorted by offset! See intel_shadow_table_check(). */ static const i915_reg_t gen8_shadowed_regs[] = {RING_TAIL (RENDER_RING_BASE ),/* 0x2000 (base) */
@@ -935,6 +938,20 @@ static const i915_reg_t gen11_shadowed_regs[] = {/* TODO: Other registers are not yet used */ }; +static const i915_reg_t gen12_shadowed_regs[] = { +RING_TAIL (RENDER_RING_BASE ),/* 0x2000 (base) */ +GEN6_RPNSWREQ ,/* 0xA008 */ +GEN6_RC_VIDEO_FREQ ,/* 0xA00C */ +RING_TAIL (BLT_RING_BASE ),/* 0x22000 (base) */ +RING_TAIL (GEN11_BSD_RING_BASE ),/* 0x1C0000 (base) */ +RING_TAIL (GEN11_BSD2_RING_BASE ),/* 0x1C4000 (base) */ +RING_TAIL (GEN11_VEBOX_RING_BASE ),/* 0x1C8000 (base) */ +RING_TAIL (GEN11_BSD3_RING_BASE ),/* 0x1D0000 (base) */ +RING_TAIL (GEN11_BSD4_RING_BASE ),/* 0x1D4000 (base) */ +RING_TAIL (GEN11_VEBOX2_RING_BASE ),/* 0x1D8000 (base) */ +/* TODO: Other registers are not yet used */ +}; +static int mmio_reg_cmp (u32 key,const i915_reg_t *reg) {u32 offset =i915_mmio_reg_offset (*reg);
@@ -957,6 +974,7 @@ static bool is_gen##x##_shadowed(u32 offset) \ __is_genX_shadowed(8) __is_genX_shadowed(11) +__is_genX_shadowed(12)static enum forcewake_domains gen6_reg_write_fw_domains (struct intel_uncore *uncore,i915_reg_t reg)
@@ -1010,6 +1028,15 @@ static const struct intel_forcewake_range __chv_fw_ranges[] = { __fwd; \ }) +#define __gen12_fwtable_reg_write_fw_domains (uncore, offset) \ +({ \ + enum forcewake_domains __fwd = 0; \ + const u32 __offset = (offset); \ + if (!is_gen12_shadowed(__offset)) \ + __fwd = find_fw_domain(uncore, __offset); \ + __fwd; \ +}) +/* *Must* be sorted by offset ranges! See intel_fw_table_check(). */ static const struct intel_forcewake_range __gen9_fw_ranges[] = {GEN_FW_RANGE (0x0 ,0xaff ,FORCEWAKE_BLITTER ),
@@ -1080,6 +1107,46 @@ static const struct intel_forcewake_range __gen11_fw_ranges[] = {GEN_FW_RANGE (0x1d8000 ,0x1dbfff ,FORCEWAKE_MEDIA_VEBOX1 ) }; +/* *Must* be sorted by offset ranges! See intel_fw_table_check(). */ +static const struct intel_forcewake_range __gen12_fw_ranges[] = { +GEN_FW_RANGE (0x0 ,0xaff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0xb00 ,0x1fff ,0 ),/* uncore range */ +GEN_FW_RANGE (0x2000 ,0x26ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x2700 ,0x2fff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x3000 ,0x3fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x4000 ,0x51ff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x5200 ,0x7fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8000 ,0x813f ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x8140 ,0x815f ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8160 ,0x82ff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x8300 ,0x84ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8500 ,0x8bff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x8c00 ,0x8cff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8d00 ,0x93ff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x9400 ,0x97ff ,FORCEWAKE_ALL ), +GEN_FW_RANGE (0x9800 ,0xafff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0xb000 ,0xb47f ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0xb480 ,0xdfff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0xe000 ,0xe8ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0xe900 ,0x147ff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x14800 ,0x148ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x14900 ,0x19fff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x1a000 ,0x1a7ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x1a800 ,0x1afff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x1b000 ,0x1bfff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x1c000 ,0x243ff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x24400 ,0x247ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x24800 ,0x3ffff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x40000 ,0x1bffff ,0 ), +GEN_FW_RANGE (0x1c0000 ,0x1c3fff ,FORCEWAKE_MEDIA_VDBOX0 ), +GEN_FW_RANGE (0x1c4000 ,0x1c7fff ,FORCEWAKE_MEDIA_VDBOX1 ), +GEN_FW_RANGE (0x1c8000 ,0x1cbfff ,FORCEWAKE_MEDIA_VEBOX0 ), +GEN_FW_RANGE (0x1cc000 ,0x1cffff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x1d0000 ,0x1d3fff ,FORCEWAKE_MEDIA_VDBOX2 ), +GEN_FW_RANGE (0x1d4000 ,0x1d7fff ,FORCEWAKE_MEDIA_VDBOX3 ), +GEN_FW_RANGE (0x1d8000 ,0x1dbfff ,FORCEWAKE_MEDIA_VEBOX1 ) +}; +static void ilk_dummy_write (struct intel_uncore *uncore) {
@@ -1228,6 +1295,7 @@ __gen_read(func, 16) \ __gen_read(func, 32) \ __gen_read(func, 64) +__gen_reg_read_funcs (gen12_fwtable);__gen_reg_read_funcs (gen11_fwtable);__gen_reg_read_funcs (fwtable);__gen_reg_read_funcs (gen6);
@@ -1319,6 +1387,7 @@ __gen_write(func, 8) \ __gen_write(func, 16) \ __gen_write(func, 32) +__gen_reg_write_funcs (gen12_fwtable);__gen_reg_write_funcs (gen11_fwtable);__gen_reg_write_funcs (fwtable);__gen_reg_write_funcs (gen8);
@@ -1690,10 +1759,14 @@ static int uncore_forcewake_init(struct intel_uncore *uncore)ASSIGN_FW_DOMAINS_TABLE (uncore, __gen9_fw_ranges);ASSIGN_WRITE_MMIO_VFUNCS (uncore, fwtable);ASSIGN_READ_MMIO_VFUNCS (uncore, fwtable); - }else { + }else if (IS_GEN (i915,11 )) {ASSIGN_FW_DOMAINS_TABLE (uncore, __gen11_fw_ranges);ASSIGN_WRITE_MMIO_VFUNCS (uncore, gen11_fwtable);ASSIGN_READ_MMIO_VFUNCS (uncore, gen11_fwtable); + }else { +ASSIGN_FW_DOMAINS_TABLE (uncore, __gen12_fw_ranges); +ASSIGN_WRITE_MMIO_VFUNCS (uncore, gen12_fwtable); +ASSIGN_READ_MMIO_VFUNCS (uncore, gen12_fwtable); } uncore->pmic_bus_access_nb.notifier_call = i915_pmic_bus_access_notifier;
drivers/gpu/drm/i915/selftests/intel_uncore.c +2 -0
@@ -67,6 +67,7 @@ static int intel_shadow_table_check(void) } reg_lists[] = { { gen8_shadowed_regs, ARRAY_SIZE(gen8_shadowed_regs) }, { gen11_shadowed_regs, ARRAY_SIZE(gen11_shadowed_regs) }, + { gen12_shadowed_regs, ARRAY_SIZE(gen12_shadowed_regs) }, }; const i915_reg_t *reg; unsigned int i, j;
@@ -101,6 +102,7 @@ int intel_uncore_mock_selftests(void) { __chv_fw_ranges, ARRAY_SIZE(__chv_fw_ranges), false }, { __gen9_fw_ranges, ARRAY_SIZE(__gen9_fw_ranges), true }, { __gen11_fw_ranges, ARRAY_SIZE(__gen11_fw_ranges), true }, + { __gen12_fw_ranges, ARRAY_SIZE(__gen12_fw_ranges), true }, };int err, i;
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/4 drm/i915/tgl: s/ss/eu fuse reading support
From: Daniele Ceraolo Spurio <[email protected]>
Gen12 has dual-subslices (DSS), which compared to gen11 subslices have some duplicated resources/paths. Although DSS behave similarly to 2 subslices, instead of splitting this and presenting userspace with bits not directly representative of hardware resources, present userspace with a subslice_mask made up of DSS bits instead.
Bspec: 29547
Bspec: 12247
--- drivers/gpu/drm/i915/gt/intel_sseu.h | 9 +-- drivers/gpu/drm/i915/i915_debugfs.c | 3 +- drivers/gpu/drm/i915/i915_reg.h | 2 + drivers/gpu/drm/i915/intel_device_info.c | 87 ++++++++++++++++++------ include/uapi/drm/i915_drm.h | 6 +- 5 files changed, 76 insertions(+), 31 deletions(-)
drivers/gpu/drm/i915/gt/intel_sseu.h +2 -7
@@ -18,12 +18,13 @@ struct drm_i915_private;#define GEN_MAX_SUBSLICES (8)/* ICL upper bound */ #define GEN_SSEU_STRIDE (max_entries) DIV_ROUND_UP(max_entries, BITS_PER_BYTE)#define GEN_MAX_SUBSLICE_STRIDE GEN_SSEU_STRIDE(GEN_MAX_SUBSLICES) -#define GEN_MAX_EUS (10)/* HSW upper bound */ +#define GEN_MAX_EUS (16)/* TGL upper bound */ #define GEN_MAX_EU_STRIDE GEN_SSEU_STRIDE(GEN_MAX_EUS)struct sseu_dev_info {u8 slice_mask;u8 subslice_mask[GEN_MAX_SLICES *GEN_MAX_SUBSLICE_STRIDE ]; +u8 eu_mask[GEN_MAX_SLICES *GEN_MAX_SUBSLICES *GEN_MAX_EU_STRIDE ];u16 eu_total;u8 eu_per_subslice;u8 min_eu_in_pool;
@@ -40,12 +41,6 @@ struct sseu_dev_info {u8 ss_stride;u8 eu_stride; - -/* We don't have more than 8 eus per subslice at the moment and as we -* store eus enabled using bits, no need to multiply by eus per -* subslice. -*/ -u8 eu_mask[GEN_MAX_SLICES *GEN_MAX_SUBSLICES ]; };/*
drivers/gpu/drm/i915/i915_debugfs.c +2 -1
@@ -3820,7 +3820,8 @@ static void gen10_sseu_device_status(struct drm_i915_private *dev_priv,for (ss =0 ; ss < info->sseu.max_subslices; ss++) {unsigned int eu_cnt; -if (!(s_reg[s] & (GEN9_PGCTL_SS_ACK (ss)))) +if (info->sseu.has_subslice_pg && + !(s_reg[s] & (GEN9_PGCTL_SS_ACK (ss))))/* skip disabled subslice */ continue ;
drivers/gpu/drm/i915/i915_reg.h +2 -0
@@ -2956,6 +2956,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)#define GEN11_GT_SUBSLICE_DISABLE _MMIO(0x913C) +#define GEN12_GT_DSS_ENABLE _MMIO(0x913C) +#define GEN6_BSD_SLEEP_PSMI_CONTROL _MMIO(0x12050)#define GEN6_BSD_SLEEP_MSG_DISABLE (1 << 0)#define GEN6_BSD_SLEEP_FLUSH_DISABLE (1 << 2)
drivers/gpu/drm/i915/intel_device_info.c +66 -21
113 lines not on this page · raw message
include/uapi/drm/i915_drm.h +4 -2
@@ -2033,8 +2033,10 @@ struct drm_i915_query {* (data[X / 8] >> (X % 8)) & 1 * * - the subslice mask for each slice with one bit per subslice telling -* whether a subslice is available. The availability of subslice Y in slice -* X can be queried with the following formula : +* whether a subslice is available. Gen12 has dual-subslices, which are +* similar to two gen11 subslices. For gen12, this array represents dual- +* subslices. The availability of subslice Y in slice X can be queried +* with the following formula : * * (data[subslice_offset + * X * subslice_stride +
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/4] drm/i915/tgl: s/ss/eu fuse reading support
Quoted 97 lines · Mika Kuoppala
From: Daniele Ceraolo Spurio <[email protected]>
Gen12 has dual-subslices (DSS), which compared to gen11 subslices have some duplicated resources/paths. Although DSS behave similarly to 2 subslices, instead of splitting this and presenting userspace with bits not directly representative of hardware resources, present userspace with a
subslice_maskmade up of DSS bits instead.Bspec: 29547
Bspec: 12247Cc Kelvin Gardiner <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Lionel Landwerlin <[email protected]>CC Radhakrishna Sripada <[email protected]>Cc Michel Thierry <[email protected]> #v1Cc Daniele Ceraolo Spurio <[email protected]>Cc José Roberto de Souza <[email protected]>Signed-off-by Daniele Ceraolo Spurio <[email protected]>Signed-off-by James Ausmus <[email protected]>Signed-off-by Oscar Mateo <[email protected]>Signed-off-by Sudeep Dutt <[email protected]>Signed-off-by Stuart Summers <[email protected]>--- drivers/gpu/drm/i915/gt/intel_sseu.h | 9 +-- drivers/gpu/drm/i915/i915_debugfs.c | 3 +- drivers/gpu/drm/i915/i915_reg.h | 2 + drivers/gpu/drm/i915/intel_device_info.c | 87 ++++++++++++++++++------ include/uapi/drm/i915_drm.h | 6 +- 5 files changed, 76 insertions(+), 31 deletions(-)drivers/gpu/drm/i915/gt/intel_sseu.h +2
-7@@ -18,12 +18,13 @@ struct drm_i915_private;#define GEN_MAX_SUBSLICES (8)/* ICL upper bound */ #define GEN_SSEU_STRIDE (max_entries) DIV_ROUND_UP(max_entries, BITS_PER_BYTE)#define GEN_MAX_SUBSLICE_STRIDE GEN_SSEU_STRIDE(GEN_MAX_SUBSLICES) -#define GEN_MAX_EUS (10)/* HSW upper bound */ +#define GEN_MAX_EUS (16)/* TGL upper bound */ #define GEN_MAX_EU_STRIDE GEN_SSEU_STRIDE(GEN_MAX_EUS)struct sseu_dev_info {u8 slice_mask;u8 subslice_mask[GEN_MAX_SLICES *GEN_MAX_SUBSLICE_STRIDE ]; +u8 eu_mask[GEN_MAX_SLICES *GEN_MAX_SUBSLICES *GEN_MAX_EU_STRIDE ];u16 eu_total;u8 eu_per_subslice;u8 min_eu_in_pool;@@ -40,12 +41,6 @@ struct sseu_dev_info {u8 ss_stride;u8 eu_stride; - -/* We don't have more than 8 eus per subslice at the moment and as we -* store eus enabled using bits, no need to multiply by eus per -* subslice. -*/ -u8 eu_mask[GEN_MAX_SLICES *GEN_MAX_SUBSLICES ]; };/* drivers/gpu/drm/i915/i915_debugfs.c +2
-1@@ -3820,7 +3820,8 @@ static void gen10_sseu_device_status(struct drm_i915_private *dev_priv,for (ss =0 ; ss < info->sseu.max_subslices; ss++) {unsigned int eu_cnt; -if (!(s_reg[s] & (GEN9_PGCTL_SS_ACK (ss)))) +if (info->sseu.has_subslice_pg && + !(s_reg[s] & (GEN9_PGCTL_SS_ACK (ss))))/* skip disabled subslice */ continue ;drivers/gpu/drm/i915/i915_reg.h +2
-0@@ -2956,6 +2956,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)#define GEN11_GT_SUBSLICE_DISABLE _MMIO(0x913C) +#define GEN12_GT_DSS_ENABLE _MMIO(0x913C) +#define GEN6_BSD_SLEEP_PSMI_CONTROL _MMIO(0x12050)#define GEN6_BSD_SLEEP_MSG_DISABLE (1 << 0)#define GEN6_BSD_SLEEP_FLUSH_DISABLE (1 << 2)drivers/gpu/drm/i915/intel_device_info.c +0
-0@@ -182,13 +182,73 @@ static u16 compute_eu_total(const struct sseu_dev_info *sseu)return total; }
drivers/gpu/drm/i915/intel_device_info.c static u16 compute_eu_total(const struct sseu_dev_info *sseu) · line 194
Quoted 10 lines
drivers/gpu/drm/i915/intel_device_info.c +10
-0+static void gen11_compute_sseu_info (struct sseu_dev_info *sseu, +u8 s_en,u32 ss_en,u16 eu_en) +{ +int s, ss; + +/* ss_en represents entire subslice mask across all slices */ +if (sseu->max_slices * sseu->max_subslices > +sizeof (ss_en) *BITS_PER_BYTE ) { +DRM_ERROR ("Invalid topology, max_slices: %d, max_subslices %d\n" , + sseu->max_slices, sseu->max_subslices);
Don't you want a GEM_BUG_ON() here to match the rest of the code?
Seems like a driver bug if we reach that case.
Otherwise :
Cheers,
-Lionel
Quoted 109 lines
drivers/gpu/drm/i915/intel_device_info.c +56
-21+return ; + } + +for (s =0 ; s < sseu->max_slices; s++) { +if ((s_en &BIT (s)) ==0 ) +continue ; + + sseu->slice_mask |=BIT (s); + +intel_sseu_set_subslices (sseu, s, ss_en); + +for (ss =0 ; ss < sseu->max_subslices; ss++) +if (intel_sseu_has_subslice (sseu, s, ss)) +sseu_set_eus (sseu, s, ss, eu_en); + } + sseu->eu_per_subslice =hweight16 (eu_en); + sseu->eu_total =compute_eu_total (sseu); +} + +static void gen12_sseu_info_init (struct drm_i915_private *dev_priv) +{ +struct sseu_dev_info *sseu = &RUNTIME_INFO (dev_priv)->sseu; +u8 s_en; +u32 dss_en; +u16 eu_en =0 ; +u8 eu_en_fuse; +int eu; + +/* +* Gen12 has Dual-Subslices, which behave similarly to 2 gen11 SS. +* Instead of splitting these, provide userspace with an array +* of DSS to more closely represent the hardware resource. +*/ +intel_sseu_set_info (sseu,1 ,6 ,16 ); + + s_en =I915_READ (GEN11_GT_SLICE_ENABLE ) &GEN11_GT_S_ENA_MASK ; + + dss_en =I915_READ (GEN12_GT_DSS_ENABLE ); + +/* one bit per pair of EUs */ + eu_en_fuse = ~(I915_READ (GEN11_EU_DISABLE ) &GEN11_EU_DIS_MASK ); +for (eu =0 ; eu < sseu->max_eus_per_subslice /2 ; eu++) +if (eu_en_fuse &BIT (eu)) + eu_en |=BIT (eu *2 ) |BIT (eu *2 +1 ); + +gen11_compute_sseu_info (sseu, s_en, dss_en, eu_en); + +/* TGL only supports slice-level power gating */ + sseu->has_slice_pg =1 ; +} +static void gen11_sseu_info_init (struct drm_i915_private *dev_priv) {struct sseu_dev_info *sseu = &RUNTIME_INFO (dev_priv)->sseu;u8 s_en; -u32 ss_en, ss_en_mask; +u32 ss_en;u8 eu_en; -int s;if (IS_ELKHARTLAKE (dev_priv))intel_sseu_set_info (sseu,1 ,4 ,8 );@@ -197,26 +257,9 @@ static void gen11_sseu_info_init(struct drm_i915_private *dev_priv) s_en =I915_READ (GEN11_GT_SLICE_ENABLE ) &GEN11_GT_S_ENA_MASK ; ss_en = ~I915_READ (GEN11_GT_SUBSLICE_DISABLE ); - ss_en_mask =BIT (sseu->max_subslices) -1 ; eu_en = ~(I915_READ (GEN11_EU_DISABLE ) &GEN11_EU_DIS_MASK ); -for (s =0 ; s < sseu->max_slices; s++) { -if (s_en &BIT (s)) { -int ss_idx = sseu->max_subslices * s; -int ss; - - sseu->slice_mask |=BIT (s); - -intel_sseu_set_subslices (sseu, s, (ss_en >> ss_idx) & - ss_en_mask); - -for (ss =0 ; ss < sseu->max_subslices; ss++) -if (intel_sseu_has_subslice (sseu, s, ss)) -sseu_set_eus (sseu, s, ss, eu_en); - } - } - sseu->eu_per_subslice =hweight8 (eu_en); - sseu->eu_total =compute_eu_total (sseu); +gen11_compute_sseu_info (sseu, s_en, ss_en, eu_en);/* ICL has no power gating restrictions. */ sseu->has_slice_pg =1 ;@@ -959,8 +1002,10 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)gen9_sseu_info_init (dev_priv); else if (IS_GEN(dev_priv, 10)) gen10_sseu_info_init(dev_priv); - else if (INTEL_GEN(dev_priv) >= 11) + else if (IS_GEN(dev_priv, 11)) gen11_sseu_info_init(dev_priv); + else if (INTEL_GEN(dev_priv) >= 12) + gen12_sseu_info_init(dev_priv);if (IS_GEN (dev_priv,6 ) &&intel_vtd_active ()) {DRM_INFO ("Disabling ppGTT for VT-d support\n" );include/uapi/drm/i915_drm.h +0
-0@@ -2033,8 +2033,10 @@ struct drm_i915_query {* (data[X / 8] >> (X % 8)) & 1 *
include/uapi/drm/i915_drm.h struct drm_i915_query { · line 2042
Quoted 10 lines
include/uapi/drm/i915_drm.h +4
-2* - the subslice mask for each slice with one bit per subslice telling -* whether a subslice is available. The availability of subslice Y in slice -* X can be queried with the following formula : +* whether a subslice is available. Gen12 has dual-subslices, which are +* similar to two gen11 subslices. For gen12, this array represents dual- +* subslices. The availability of subslice Y in slice X can be queried +* with the following formula : * * (data[subslice_offset + * X * subslice_stride +
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/4 drm/i915/tgl: s/ss/eu fuse reading support
From: Daniele Ceraolo Spurio <[email protected]>
Gen12 has dual-subslices (DSS), which compared to gen11 subslices have some duplicated resources/paths. Although DSS behave similarly to 2 subslices, instead of splitting this and presenting userspace with bits not directly representative of hardware resources, present userspace with a subslice_mask made up of DSS bits instead.
v2: GEM_BUG_ON on mask size (Lionel)
Bspec: 29547
Bspec: 12247
--- drivers/gpu/drm/i915/gt/intel_sseu.h | 9 +-- drivers/gpu/drm/i915/i915_debugfs.c | 3 +- drivers/gpu/drm/i915/i915_reg.h | 2 + drivers/gpu/drm/i915/intel_device_info.c | 83 ++++++++++++++++++------ include/uapi/drm/i915_drm.h | 6 +- 5 files changed, 72 insertions(+), 31 deletions(-)
drivers/gpu/drm/i915/gt/intel_sseu.h +2 -7
@@ -18,12 +18,13 @@ struct drm_i915_private;#define GEN_MAX_SUBSLICES (8)/* ICL upper bound */ #define GEN_SSEU_STRIDE (max_entries) DIV_ROUND_UP(max_entries, BITS_PER_BYTE)#define GEN_MAX_SUBSLICE_STRIDE GEN_SSEU_STRIDE(GEN_MAX_SUBSLICES) -#define GEN_MAX_EUS (10)/* HSW upper bound */ +#define GEN_MAX_EUS (16)/* TGL upper bound */ #define GEN_MAX_EU_STRIDE GEN_SSEU_STRIDE(GEN_MAX_EUS)struct sseu_dev_info {u8 slice_mask;u8 subslice_mask[GEN_MAX_SLICES *GEN_MAX_SUBSLICE_STRIDE ]; +u8 eu_mask[GEN_MAX_SLICES *GEN_MAX_SUBSLICES *GEN_MAX_EU_STRIDE ];u16 eu_total;u8 eu_per_subslice;u8 min_eu_in_pool;
@@ -40,12 +41,6 @@ struct sseu_dev_info {u8 ss_stride;u8 eu_stride; - -/* We don't have more than 8 eus per subslice at the moment and as we -* store eus enabled using bits, no need to multiply by eus per -* subslice. -*/ -u8 eu_mask[GEN_MAX_SLICES *GEN_MAX_SUBSLICES ]; };/*
drivers/gpu/drm/i915/i915_debugfs.c +2 -1
@@ -3820,7 +3820,8 @@ static void gen10_sseu_device_status(struct drm_i915_private *dev_priv,for (ss =0 ; ss < info->sseu.max_subslices; ss++) {unsigned int eu_cnt; -if (!(s_reg[s] & (GEN9_PGCTL_SS_ACK (ss)))) +if (info->sseu.has_subslice_pg && + !(s_reg[s] & (GEN9_PGCTL_SS_ACK (ss))))/* skip disabled subslice */ continue ;
drivers/gpu/drm/i915/i915_reg.h +2 -0
@@ -2956,6 +2956,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)#define GEN11_GT_SUBSLICE_DISABLE _MMIO(0x913C) +#define GEN12_GT_DSS_ENABLE _MMIO(0x913C) +#define GEN6_BSD_SLEEP_PSMI_CONTROL _MMIO(0x12050)#define GEN6_BSD_SLEEP_MSG_DISABLE (1 << 0)#define GEN6_BSD_SLEEP_FLUSH_DISABLE (1 << 2)
drivers/gpu/drm/i915/intel_device_info.c +62 -21
109 lines not on this page · raw message
include/uapi/drm/i915_drm.h +4 -2
@@ -2033,8 +2033,10 @@ struct drm_i915_query {* (data[X / 8] >> (X % 8)) & 1 * * - the subslice mask for each slice with one bit per subslice telling -* whether a subslice is available. The availability of subslice Y in slice -* X can be queried with the following formula : +* whether a subslice is available. Gen12 has dual-subslices, which are +* similar to two gen11 subslices. For gen12, this array represents dual- +* subslices. The availability of subslice Y in slice X can be queried +* with the following formula : * * (data[subslice_offset + * X * subslice_stride +
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/4] drm/i915/tgl: s/ss/eu fuse reading support
In reply to Mika KuoppalaQuoted 50 lines · Mika Kuoppala
From: Daniele Ceraolo Spurio <[email protected]>
Gen12 has dual-subslices (DSS), which compared to gen11 subslices have some duplicated resources/paths. Although DSS behave similarly to 2 subslices, instead of splitting this and presenting userspace with bits not directly representative of hardware resources, present userspace with a
subslice_maskmade up of DSS bits instead.Bspec: 29547
Bspec: 12247Cc Kelvin Gardiner <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Lionel Landwerlin <[email protected]>CC Radhakrishna Sripada <[email protected]>Cc Michel Thierry <[email protected]> #v1Cc Daniele Ceraolo Spurio <[email protected]>Cc José Roberto de Souza <[email protected]>Signed-off-by Daniele Ceraolo Spurio <[email protected]>Signed-off-by James Ausmus <[email protected]>Signed-off-by Oscar Mateo <[email protected]>Signed-off-by Sudeep Dutt <[email protected]>Signed-off-by Stuart Summers <[email protected]>--- drivers/gpu/drm/i915/gt/intel_sseu.h | 9 +-- drivers/gpu/drm/i915/i915_debugfs.c | 3 +- drivers/gpu/drm/i915/i915_reg.h | 2 + drivers/gpu/drm/i915/intel_device_info.c | 87 ++++++++++++++++++------ include/uapi/drm/i915_drm.h | 6 +- 5 files changed, 76 insertions(+), 31 deletions(-)drivers/gpu/drm/i915/gt/intel_sseu.h +2
-1@@ -18,12 +18,13 @@ struct drm_i915_private;#define GEN_MAX_SUBSLICES (8)/* ICL upper bound */ #define GEN_SSEU_STRIDE (max_entries) DIV_ROUND_UP(max_entries, BITS_PER_BYTE)#define GEN_MAX_SUBSLICE_STRIDE GEN_SSEU_STRIDE(GEN_MAX_SUBSLICES) -#define GEN_MAX_EUS (10)/* HSW upper bound */ +#define GEN_MAX_EUS (16)/* TGL upper bound */ #define GEN_MAX_EU_STRIDE GEN_SSEU_STRIDE(GEN_MAX_EUS)struct sseu_dev_info {u8 slice_mask;u8 subslice_mask[GEN_MAX_SLICES *GEN_MAX_SUBSLICE_STRIDE ]; +u8 eu_mask[GEN_MAX_SLICES *GEN_MAX_SUBSLICES *GEN_MAX_EU_STRIDE ];u16 eu_total;u8 eu_per_subslice;u8 min_eu_in_pool;
drivers/gpu/drm/i915/gt/intel_sseu.h struct sseu_dev_info { · line 48
Quoted 9 lines
drivers/gpu/drm/i915/gt/intel_sseu.h +0
-6@@ -40,12 +41,6 @@ struct sseu_dev_info {u8 ss_stride;u8 eu_stride; - -/* We don't have more than 8 eus per subslice at the moment and as we -* store eus enabled using bits, no need to multiply by eus per -* subslice. -*/ -u8 eu_mask[GEN_MAX_SLICES *GEN_MAX_SUBSLICES ];
Comment indeed looks obsolete even with old GEM_MAX_EUS.
Howewer more importantly, was the code broken before? Now we size considering the stride, but before GEN_MAX_EU_STRIDE was GEN_SSEU_STRIDE(GEN_MAX_EUS) = DIV_ROUND_UP(10, BITS_PER_BYTE) = 2, no? So wasn't the array too small?
P.S. Moving the position of the field is just noise?
Quoted 56 lines
drivers/gpu/drm/i915/gt/intel_sseu.h +0
-0};/* drivers/gpu/drm/i915/i915_debugfs.c +2
-1@@ -3820,7 +3820,8 @@ static void gen10_sseu_device_status(struct drm_i915_private *dev_priv,for (ss =0 ; ss < info->sseu.max_subslices; ss++) {unsigned int eu_cnt; -if (!(s_reg[s] & (GEN9_PGCTL_SS_ACK (ss)))) +if (info->sseu.has_subslice_pg && + !(s_reg[s] & (GEN9_PGCTL_SS_ACK (ss))))/* skip disabled subslice */ continue ;drivers/gpu/drm/i915/i915_reg.h +2
-0@@ -2956,6 +2956,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)#define GEN11_GT_SUBSLICE_DISABLE _MMIO(0x913C) +#define GEN12_GT_DSS_ENABLE _MMIO(0x913C) +#define GEN6_BSD_SLEEP_PSMI_CONTROL _MMIO(0x12050)#define GEN6_BSD_SLEEP_MSG_DISABLE (1 << 0)#define GEN6_BSD_SLEEP_FLUSH_DISABLE (1 << 2)drivers/gpu/drm/i915/intel_device_info.c +18
-0@@ -182,13 +182,73 @@ static u16 compute_eu_total(const struct sseu_dev_info *sseu)return total; } +static void gen11_compute_sseu_info (struct sseu_dev_info *sseu, +u8 s_en,u32 ss_en,u16 eu_en) +{ +int s, ss; + +/* ss_en represents entire subslice mask across all slices */ +if (sseu->max_slices * sseu->max_subslices > +sizeof (ss_en) *BITS_PER_BYTE ) { +DRM_ERROR ("Invalid topology, max_slices: %d, max_subslices %d\n" , + sseu->max_slices, sseu->max_subslices); +return ; + } + +for (s =0 ; s < sseu->max_slices; s++) { +if ((s_en &BIT (s)) ==0 ) +continue ; + + sseu->slice_mask |=BIT (s);
drivers/gpu/drm/i915/intel_device_info.c static u16 compute_eu_total(const struct sseu_dev_info *sseu) · line 212
Quoted 10 lines
drivers/gpu/drm/i915/intel_device_info.c +10
-0+ +intel_sseu_set_subslices (sseu, s, ss_en); + +for (ss =0 ; ss < sseu->max_subslices; ss++) +if (intel_sseu_has_subslice (sseu, s, ss)) +sseu_set_eus (sseu, s, ss, eu_en); + } + sseu->eu_per_subslice =hweight16 (eu_en); + sseu->eu_total =compute_eu_total (sseu); +}
Can we be kind to reviewers and extract this helper in a separate preceding patch? It even modifies the loop while extracting it so double reason to separate.
Quoted 5 lines
drivers/gpu/drm/i915/intel_device_info.c +5
-0+ +static void gen12_sseu_info_init (struct drm_i915_private *dev_priv) +{ +struct sseu_dev_info *sseu = &RUNTIME_INFO (dev_priv)->sseu; +u8 s_en;
drivers/gpu/drm/i915/intel_device_info.c static u16 compute_eu_total(const struct sseu_dev_info *sseu) · line 227
Quoted 10 lines
drivers/gpu/drm/i915/intel_device_info.c +10
-0+u32 dss_en; +u16 eu_en =0 ; +u8 eu_en_fuse; +int eu; + +/* +* Gen12 has Dual-Subslices, which behave similarly to 2 gen11 SS. +* Instead of splitting these, provide userspace with an array +* of DSS to more closely represent the hardware resource. +*/
My pet peeve about this code shouldnt' have been made to be about userspace at all... i915_query.c/query_topology_info is where userspace struct drm_i915_query_topology_info is populated :I Rant over.. Sorry Mika, not directed to you as the current shepherd of this patch.
Quoted 74 lines
drivers/gpu/drm/i915/intel_device_info.c +23
-21+intel_sseu_set_info (sseu,1 ,6 ,16 ); + + s_en =I915_READ (GEN11_GT_SLICE_ENABLE ) &GEN11_GT_S_ENA_MASK ; + + dss_en =I915_READ (GEN12_GT_DSS_ENABLE ); + +/* one bit per pair of EUs */ + eu_en_fuse = ~(I915_READ (GEN11_EU_DISABLE ) &GEN11_EU_DIS_MASK ); +for (eu =0 ; eu < sseu->max_eus_per_subslice /2 ; eu++) +if (eu_en_fuse &BIT (eu)) + eu_en |=BIT (eu *2 ) |BIT (eu *2 +1 ); + +gen11_compute_sseu_info (sseu, s_en, dss_en, eu_en); + +/* TGL only supports slice-level power gating */ + sseu->has_slice_pg =1 ; +} +static void gen11_sseu_info_init (struct drm_i915_private *dev_priv) {struct sseu_dev_info *sseu = &RUNTIME_INFO (dev_priv)->sseu;u8 s_en; -u32 ss_en, ss_en_mask; +u32 ss_en;u8 eu_en; -int s;if (IS_ELKHARTLAKE (dev_priv))intel_sseu_set_info (sseu,1 ,4 ,8 );@@ -197,26 +257,9 @@ static void gen11_sseu_info_init(struct drm_i915_private *dev_priv) s_en =I915_READ (GEN11_GT_SLICE_ENABLE ) &GEN11_GT_S_ENA_MASK ; ss_en = ~I915_READ (GEN11_GT_SUBSLICE_DISABLE ); - ss_en_mask =BIT (sseu->max_subslices) -1 ; eu_en = ~(I915_READ (GEN11_EU_DISABLE ) &GEN11_EU_DIS_MASK ); -for (s =0 ; s < sseu->max_slices; s++) { -if (s_en &BIT (s)) { -int ss_idx = sseu->max_subslices * s; -int ss; - - sseu->slice_mask |=BIT (s); - -intel_sseu_set_subslices (sseu, s, (ss_en >> ss_idx) & - ss_en_mask); - -for (ss =0 ; ss < sseu->max_subslices; ss++) -if (intel_sseu_has_subslice (sseu, s, ss)) -sseu_set_eus (sseu, s, ss, eu_en); - } - } - sseu->eu_per_subslice =hweight8 (eu_en); - sseu->eu_total =compute_eu_total (sseu); +gen11_compute_sseu_info (sseu, s_en, ss_en, eu_en);/* ICL has no power gating restrictions. */ sseu->has_slice_pg =1 ;@@ -959,8 +1002,10 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)gen9_sseu_info_init (dev_priv); else if (IS_GEN(dev_priv, 10)) gen10_sseu_info_init(dev_priv); - else if (INTEL_GEN(dev_priv) >= 11) + else if (IS_GEN(dev_priv, 11)) gen11_sseu_info_init(dev_priv); + else if (INTEL_GEN(dev_priv) >= 12) + gen12_sseu_info_init(dev_priv);if (IS_GEN (dev_priv,6 ) &&intel_vtd_active ()) {DRM_INFO ("Disabling ppGTT for VT-d support\n" );include/uapi/drm/i915_drm.h +0
-0
include/uapi/drm/i915_drm.h struct drm_i915_query { · line 2037
Quoted 7 lines
include/uapi/drm/i915_drm.h +2
-2@@ -2033,8 +2033,10 @@ struct drm_i915_query {* (data[X / 8] >> (X % 8)) & 1 * * - the subslice mask for each slice with one bit per subslice telling -* whether a subslice is available. The availability of subslice Y in slice -* X can be queried with the following formula : +* whether a subslice is available. Gen12 has dual-subslices, which are +* similar to two gen11 subslices. For gen12, this array represents dual-
It's ugly in user facing documentation if we cannot decide whether it is Gen12 or gen12. Gen12 special case also probably warrants to be in its own paragraph.
Maybe also be clearer by saying each *bit* in this array represents one dual-subslice in Gen12.
include/uapi/drm/i915_drm.h struct drm_i915_query { · line 2042
Quoted 6 lines
include/uapi/drm/i915_drm.h +2
-0+* subslices. The availability of subslice Y in slice X can be queried +* with the following formula : * * (data[subslice_offset + * X * subslice_stride +
Just a casual read since I was copied, I am not assigning myself to be a reviewer. :)
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/4] drm/i915/tgl: s/ss/eu fuse reading support
Quoting Tvrtko Ursulin (2019-09-12 16:18:08)
Quoted 10 lines · Mika Kuoppala
Quoted 8 lines
include/uapi/drm/i915_drm.h +0
-0@@ -2033,8 +2033,10 @@ struct drm_i915_query {* (data[X / 8] >> (X % 8)) & 1 * * - the subslice mask for each slice with one bit per subslice telling
Quoted 8 lines
include/uapi/drm/i915_drm.h struct drm_i915_query { · line 2037
Quoted 4 lines
include/uapi/drm/i915_drm.h +2
-2-* whether a subslice is available. The availability of subslice Y in slice -* X can be queried with the following formula : +* whether a subslice is available. Gen12 has dual-subslices, which are +* similar to two gen11 subslices. For gen12, this array represents dual- It's ugly in user facing documentation if we cannot decide whether it is Gen12 or gen12. Gen12 special case also probably warrants to be in its own paragraph.
Here it was using sentence capitalisation, which suits it if we are treating it as an ordinary noun. If went with a proper noun, then Gen12 throughout. I might be wrong, but my impression is that we've historically used ordinary nouns (gen5-8, gen11, etc). -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/4] drm/i915/tgl: s/ss/eu fuse reading support
Quoted 20 lines · Chris Wilson
Quoting Tvrtko Ursulin (2019-09-12 16:18:08)
Quoted 10 lines · Mika Kuoppala
Quoted 8 lines
include/uapi/drm/i915_drm.h +0
-0@@ -2033,8 +2033,10 @@ struct drm_i915_query {* (data[X / 8] >> (X % 8)) & 1 * * - the subslice mask for each slice with one bit per subslice telling Quoted 8 lines
include/uapi/drm/i915_drm.h struct drm_i915_query { · line 2037
Quoted 4 lines
include/uapi/drm/i915_drm.h +2
-2-* whether a subslice is available. The availability of subslice Y in slice -* X can be queried with the following formula : +* whether a subslice is available. Gen12 has dual-subslices, which are +* similar to two gen11 subslices. For gen12, this array represents dual- It's ugly in user facing documentation if we cannot decide whether it is Gen12 or gen12. Gen12 special case also probably warrants to be in its own paragraph.
Quoted 4 lines
Here it was using sentence capitalisation, which suits it if we are treating it as an ordinary noun. If went with a proper noun, then Gen12 throughout. I might be wrong, but my impression is that we've historically used ordinary nouns (gen5-8, gen11, etc).
My bad.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/4 drm/i915/tgl: Re-enable rc6
In reply to Mika KuoppalaWe think that we got rc6 problems sorted out. Flip the switch and let CI expose our tendency to naive optimism.
--- drivers/gpu/drm/i915/i915_pci.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/i915_pci.c +0 -1
@@ -797,7 +797,6 @@ static const struct intel_device_info intel_tigerlake_12_info = { .display.has_modular_fia = 1, .engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VCS0) | BIT(VCS2), - .has_rc6 = false, /* XXX disabled for debugging */ };#undef GEN
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/4 drm/i915/tgl: Disable preemption while being debugged
In reply to Mika KuoppalaFrom: Chris Wilson <[email protected]>
We see failures where the context continues executing past a preemption event, eventually leading to situations where a request has executed before we have event submitted it to HW! It seems like tgl is ignoring our RING_TAIL updates, but more likely is that there is a missing update required for our semaphore waits around preemption.
--- drivers/gpu/drm/i915/i915_pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/i915_pci.c +1 -0
@@ -797,6 +797,7 @@ static const struct intel_device_info intel_tigerlake_12_info = { .display.has_modular_fia = 1, .engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(VECS0) | BIT(VCS0) | BIT(VCS2), + .has_logical_ring_preemption = false, /* XXX disabled for debugging */ };#undef GEN
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 10 lines · Mika Kuoppala
From: Michel Thierry <[email protected]>
The media ranges extend beyond what gen11 gives so we can't piggypack on gen11 ranges, even on read side.
Introduce a table for gen12 and accessors for it.
v2: correctly implement gen12_fwtable_write/read (Daniele)
v3: update with ranges from bspec.
v4: avoidGEN11_NEEDS_FORCEWAKEon read size (Mika)
If we think the overhead of the unneeded BSEARCH is not too bad, should we remove this from the other accessors as well? Having only the gen12 paths behave differently feels inconsistent. We should recoup the cost later with the display uncore split (if I manage to find time to get back to it).
Quoted 2 lines
BSpec: 18331.
This should be 52078 for TGL.
Quoted 102 lines
Cc Tvrtko Ursulin <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Signed-off-by Michel Thierry <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>--- drivers/gpu/drm/i915/intel_uncore.c | 75 ++++++++++++++++++- drivers/gpu/drm/i915/selftests/intel_uncore.c | 2 + 2 files changed, 76 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_uncore.c +57
-0@@ -910,6 +910,9 @@ static const struct intel_forcewake_range __vlv_fw_ranges[] = { __fwd; \ }) +#define __gen12_fwtable_reg_read_fw_domains (uncore, offset) \ + find_fw_domain(uncore, offset) +/* *Must* be sorted by offset! See intel_shadow_table_check(). */ static const i915_reg_t gen8_shadowed_regs[] = {RING_TAIL (RENDER_RING_BASE ),/* 0x2000 (base) */ @@ -935,6 +938,20 @@ static const i915_reg_t gen11_shadowed_regs[] = {/* TODO: Other registers are not yet used */ }; +static const i915_reg_t gen12_shadowed_regs[] = { +RING_TAIL (RENDER_RING_BASE ),/* 0x2000 (base) */ +GEN6_RPNSWREQ ,/* 0xA008 */ +GEN6_RC_VIDEO_FREQ ,/* 0xA00C */ +RING_TAIL (BLT_RING_BASE ),/* 0x22000 (base) */ +RING_TAIL (GEN11_BSD_RING_BASE ),/* 0x1C0000 (base) */ +RING_TAIL (GEN11_BSD2_RING_BASE ),/* 0x1C4000 (base) */ +RING_TAIL (GEN11_VEBOX_RING_BASE ),/* 0x1C8000 (base) */ +RING_TAIL (GEN11_BSD3_RING_BASE ),/* 0x1D0000 (base) */ +RING_TAIL (GEN11_BSD4_RING_BASE ),/* 0x1D4000 (base) */ +RING_TAIL (GEN11_VEBOX2_RING_BASE ),/* 0x1D8000 (base) */ +/* TODO: Other registers are not yet used */ +}; +static int mmio_reg_cmp (u32 key,const i915_reg_t *reg) {u32 offset =i915_mmio_reg_offset (*reg);@@ -957,6 +974,7 @@ static bool is_gen##x##_shadowed(u32 offset) \ __is_genX_shadowed(8) __is_genX_shadowed(11) +__is_genX_shadowed(12)static enum forcewake_domains gen6_reg_write_fw_domains (struct intel_uncore *uncore,i915_reg_t reg)@@ -1010,6 +1028,15 @@ static const struct intel_forcewake_range __chv_fw_ranges[] = { __fwd; \ }) +#define __gen12_fwtable_reg_write_fw_domains (uncore, offset) \ +({ \ + enum forcewake_domains __fwd = 0; \ + const u32 __offset = (offset); \ + if (!is_gen12_shadowed(__offset)) \ + __fwd = find_fw_domain(uncore, __offset); \ + __fwd; \ +}) +/* *Must* be sorted by offset ranges! See intel_fw_table_check(). */ static const struct intel_forcewake_range __gen9_fw_ranges[] = {GEN_FW_RANGE (0x0 ,0xaff ,FORCEWAKE_BLITTER ),@@ -1080,6 +1107,46 @@ static const struct intel_forcewake_range __gen11_fw_ranges[] = {GEN_FW_RANGE (0x1d8000 ,0x1dbfff ,FORCEWAKE_MEDIA_VEBOX1 ) }; +/* *Must* be sorted by offset ranges! See intel_fw_table_check(). */ +static const struct intel_forcewake_range __gen12_fw_ranges[] = { +GEN_FW_RANGE (0x0 ,0xaff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0xb00 ,0x1fff ,0 ),/* uncore range */ +GEN_FW_RANGE (0x2000 ,0x26ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x2700 ,0x2fff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x3000 ,0x3fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x4000 ,0x51ff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x5200 ,0x7fff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8000 ,0x813f ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x8140 ,0x815f ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8160 ,0x82ff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x8300 ,0x84ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8500 ,0x8bff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x8c00 ,0x8cff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x8d00 ,0x93ff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x9400 ,0x97ff ,FORCEWAKE_ALL ), +GEN_FW_RANGE (0x9800 ,0xafff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0xb000 ,0xb47f ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0xb480 ,0xdfff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0xe000 ,0xe8ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0xe900 ,0x147ff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x14800 ,0x148ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x14900 ,0x19fff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x1a000 ,0x1a7ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x1a800 ,0x1afff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x1b000 ,0x1bfff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x1c000 ,0x243ff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x24400 ,0x247ff ,FORCEWAKE_RENDER ), +GEN_FW_RANGE (0x24800 ,0x3ffff ,FORCEWAKE_BLITTER ),
drivers/gpu/drm/i915/intel_uncore.c static const struct intel_forcewake_range __gen11_fw_ranges[] = { · line 1149
Quoted 10 lines
drivers/gpu/drm/i915/intel_uncore.c +10
-0+GEN_FW_RANGE (0x40000 ,0x1bffff ,0 ), +GEN_FW_RANGE (0x1c0000 ,0x1c3fff ,FORCEWAKE_MEDIA_VDBOX0 ), +GEN_FW_RANGE (0x1c4000 ,0x1c7fff ,FORCEWAKE_MEDIA_VDBOX1 ), +GEN_FW_RANGE (0x1c8000 ,0x1cbfff ,FORCEWAKE_MEDIA_VEBOX0 ), +GEN_FW_RANGE (0x1cc000 ,0x1cffff ,FORCEWAKE_BLITTER ), +GEN_FW_RANGE (0x1d0000 ,0x1d3fff ,FORCEWAKE_MEDIA_VDBOX2 ), +GEN_FW_RANGE (0x1d4000 ,0x1d7fff ,FORCEWAKE_MEDIA_VDBOX3 ), + GEN_FW_RANGE(0x1d8000, 0x1dbfff, FORCEWAKE_MEDIA_VEBOX1) +}; +
Matches the specs. The Gen11 specs also now lists the new FORCEWAKE_RENDER ranges, so I was wondering if they were just unused on gen11 and we could maybe just add them to the gen11 table, but then I noticed that the gen11 table also now has the following ranges marked as RENDER (which we currently do not have):
0xDF00-0xDFFF 0x16E00-0x16FFF 0x17000-0x17FFF 0x18000-0x19FFF
So there is anyway a divergence and we need 2 separate table (and we need to fix the gen11 one).
Daniele
Quoted 49 lines
drivers/gpu/drm/i915/intel_uncore.c +7
-1static void ilk_dummy_write (struct intel_uncore *uncore) {@@ -1228,6 +1295,7 @@ __gen_read(func, 16) \ __gen_read(func, 32) \ __gen_read(func, 64) +__gen_reg_read_funcs (gen12_fwtable);__gen_reg_read_funcs (gen11_fwtable);__gen_reg_read_funcs (fwtable);__gen_reg_read_funcs (gen6);@@ -1319,6 +1387,7 @@ __gen_write(func, 8) \ __gen_write(func, 16) \ __gen_write(func, 32) +__gen_reg_write_funcs (gen12_fwtable);__gen_reg_write_funcs (gen11_fwtable);__gen_reg_write_funcs (fwtable);__gen_reg_write_funcs (gen8);@@ -1690,10 +1759,14 @@ static int uncore_forcewake_init(struct intel_uncore *uncore)ASSIGN_FW_DOMAINS_TABLE (uncore, __gen9_fw_ranges);ASSIGN_WRITE_MMIO_VFUNCS (uncore, fwtable);ASSIGN_READ_MMIO_VFUNCS (uncore, fwtable); - }else { + }else if (IS_GEN (i915,11 )) {ASSIGN_FW_DOMAINS_TABLE (uncore, __gen11_fw_ranges);ASSIGN_WRITE_MMIO_VFUNCS (uncore, gen11_fwtable);ASSIGN_READ_MMIO_VFUNCS (uncore, gen11_fwtable); + }else { +ASSIGN_FW_DOMAINS_TABLE (uncore, __gen12_fw_ranges); +ASSIGN_WRITE_MMIO_VFUNCS (uncore, gen12_fwtable); +ASSIGN_READ_MMIO_VFUNCS (uncore, gen12_fwtable); } uncore->pmic_bus_access_nb.notifier_call = i915_pmic_bus_access_notifier;drivers/gpu/drm/i915/selftests/intel_uncore.c +1
-0@@ -67,6 +67,7 @@ static int intel_shadow_table_check(void) } reg_lists[] = { { gen8_shadowed_regs, ARRAY_SIZE(gen8_shadowed_regs) }, { gen11_shadowed_regs, ARRAY_SIZE(gen11_shadowed_regs) }, + { gen12_shadowed_regs, ARRAY_SIZE(gen12_shadowed_regs) }, }; const i915_reg_t *reg; unsigned int i, j;
drivers/gpu/drm/i915/selftests/intel_uncore.c int intel_uncore_mock_selftests(void) · line 108
Quoted 7 lines
drivers/gpu/drm/i915/selftests/intel_uncore.c +1
-0@@ -101,6 +102,7 @@ int intel_uncore_mock_selftests(void) { __chv_fw_ranges, ARRAY_SIZE(__chv_fw_ranges), false }, { __gen9_fw_ranges, ARRAY_SIZE(__gen9_fw_ranges), true }, { __gen11_fw_ranges, ARRAY_SIZE(__gen11_fw_ranges), true }, + { __gen12_fw_ranges, ARRAY_SIZE(__gen12_fw_ranges), true }, };int err, i;
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.SPARSE: warning for series starting with [1/4] drm/i915/tgl: Introduce gen12 forcewake ranges (rev2)
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: series starting with [1/4] drm/i915/tgl: Introduce gen12 forcewake ranges (rev2)
URL : https://patchwork.freedesktop.org/series/66608/
State : warning
== Summary ==
$ dim sparse origin/drm-tip Sparse version: v0.6.0 Commit: drm/i915/tgl: Introduce gen12 forcewake ranges +./include/linux/spinlock.h:393:9: warning: context imbalance in 'gen12_fwtable_read16' - different lock contexts for basic block +./include/linux/spinlock.h:393:9: warning: context imbalance in 'gen12_fwtable_read32' - different lock contexts for basic block +./include/linux/spinlock.h:393:9: warning: context imbalance in 'gen12_fwtable_read64' - different lock contexts for basic block +./include/linux/spinlock.h:393:9: warning: context imbalance in 'gen12_fwtable_read8' - different lock contexts for basic block +./include/linux/spinlock.h:393:9: warning: context imbalance in 'gen12_fwtable_write16' - different lock contexts for basic block +./include/linux/spinlock.h:393:9: warning: context imbalance in 'gen12_fwtable_write32' - different lock contexts for basic block +./include/linux/spinlock.h:393:9: warning: context imbalance in 'gen12_fwtable_write8' - different lock contexts for basic block
Commit: drm/i915/tgl: s/ss/eu fuse reading support Okay!
Commit: drm/i915/tgl: Re-enable rc6
Okay!
Commit: drm/i915/tgl: Disable preemption while being debugged Okay!
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for series starting with [1/4] drm/i915/tgl: Introduce gen12 forcewake ranges (rev2)
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: series starting with [1/4] drm/i915/tgl: Introduce gen12 forcewake ranges (rev2)
URL : https://patchwork.freedesktop.org/series/66608/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6883 -> Patchwork_14384
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14384/
Known issues
------------
Here are the changes found in Patchwork_14384 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_suspend@basic-s3:
- fi-blb-e6850: [PASS][1] -> [INCOMPLETE][2] ([fdo#107718])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-blb-e6850/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14384/fi-blb-e6850/igt@[email protected]
* igt@gem_mmap_gtt@basic-short:
- fi-icl-u3: [PASS][3] -> [DMESG-WARN][4] ([fdo#107724])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-icl-u3/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14384/fi-icl-u3/igt@[email protected]
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-icl-u2: [PASS][5] -> [FAIL][6] ([fdo#109483])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-icl-u2/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14384/fi-icl-u2/igt@[email protected]
* igt@kms_frontbuffer_tracking@basic:
- fi-hsw-peppy: [PASS][7] -> [DMESG-WARN][8] ([fdo#102614])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-hsw-peppy/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14384/fi-hsw-peppy/igt@[email protected]
- fi-icl-u2: [PASS][9] -> [FAIL][10] ([fdo#103167])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-icl-u2/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14384/fi-icl-u2/igt@[email protected]
* igt@prime_vgem@basic-fence-flip:
- fi-ilk-650: [PASS][11] -> [DMESG-WARN][12] ([fdo#106387]) +1 similar issue
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-ilk-650/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14384/fi-ilk-650/igt@[email protected]
#### Possible fixes ####
* igt@i915_module_load@reload:
- fi-icl-u3: [DMESG-WARN][13] ([fdo#107724] / [fdo#111214]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-icl-u3/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14384/fi-icl-u3/igt@[email protected]
* igt@i915_selftest@live_execlists:
- fi-skl-gvtdvm: [DMESG-FAIL][15] ([fdo#111108]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14384/fi-skl-gvtdvm/igt@i915_selftest@live_execlists.html
#### Warnings ####
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-icl-u2: [FAIL][17] ([fdo#109483]) -> [DMESG-WARN][18] ([fdo#102505] / [fdo#110390])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-icl-u2/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14384/fi-icl-u2/igt@[email protected]
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [FAIL][19] ([fdo#111096]) -> [FAIL][20] ([fdo#111407])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6883/fi-kbl-7500u/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14384/fi-kbl-7500u/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#102505]: https://bugs.freedesktop.org/show_bug.cgi?id=102505
[fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#106107]: https://bugs.freedesktop.org/show_bug.cgi?id=106107
[fdo#106350]: https://bugs.freedesktop.org/show_bug.cgi?id=106350
[fdo#106387]: https://bugs.freedesktop.org/show_bug.cgi?id=106387
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#109483]: https://bugs.freedesktop.org/show_bug.cgi?id=109483
[fdo#110390]: https://bugs.freedesktop.org/show_bug.cgi?id=110390
[fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
[fdo#111108]: https://bugs.freedesktop.org/show_bug.cgi?id=111108
[fdo#111214]: https://bugs.freedesktop.org/show_bug.cgi?id=111214
[fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
[fdo#111593]: https://bugs.freedesktop.org/show_bug.cgi?id=111593
Participating hosts (55 -> 48)
------------------------------
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_6883 -> Patchwork_14384
CI-20190529: 20190529
CI_DRM_6883: 66ebb484c4bf16531678a935499adc17c1b3be0d @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5178: efb4539494d94f03374874d3b61bd04ef3802aaa @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_14384: 05400834940c530700156889c2a4606d8946cfea @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
05400834940c drm/i915/tgl: Disable preemption while being debugged 754468a31f94 drm/i915/tgl: Re-enable rc6fdcc0ee6bda9 drm/i915/tgl: s/ss/eu fuse reading support 59f50898694a drm/i915/tgl: Introduce gen12 forcewake ranges
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14384/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BUILD: failure for series starting with [1/4] drm/i915/tgl: Introduce gen12 forcewake ranges (rev3)
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: series starting with [1/4] drm/i915/tgl: Introduce gen12 forcewake ranges (rev3)
URL : https://patchwork.freedesktop.org/series/66608/
State : failure
== Summary ==
Applying: drm/i915/tgl: Introduce gen12 forcewake ranges
Applying: drm/i915/tgl: s/ss/eu fuse reading support
Applying: drm/i915/tgl: Re-enable rc6
Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/i915_pci.c
Falling back to patching base and 3-way merge... Auto-merging drivers/gpu/drm/i915/i915_pci.c
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/i915_pci.c
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch' to see the failed patch Patch failed at 0003 drm/i915/tgl: Re-enable rc6
When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx