drm/i915/icl: Check for fused-off VDBOX and VEBOX instances
Subsystems (2)
PATCH 1/8 drm/i915/icl: Check for fused-off VDBOX and VEBOX instances
From: Oscar Mateo <[email protected]>
In Gen11, the Video Decode engines (aka VDBOX, aka VCS, aka BSD) and the Video Enhancement engines (aka VEBOX, aka VECS) could be fused off. Also, each VDBOX and VEBOX has its own power well, which only exist if the related engine exists in the HW.
Unfortunately, we have a Catch-22 situation going on: we need the blitter forcewake to read the register with the fuse info, but we cannot initialize the forcewake domains without knowin about the engines present in the HW. We workaround this problem by allowing the initialization of all forcewake domains and then pruning the fused off ones, as per the fuse information.
Bspec: 20680
v2: We were shifting incorrectly for vebox disable (Vinay)
v3: Assert mmio is ready and warn if we have attempted to initialize
forcewake for fused-off engines (Paulo)
v4:
- Use INTEL_GEN in new code (Tvrtko)
- Shorter local variable (Tvrtko, Michal)
- Keep "if (!...) continue" style (Tvrtko)
- No unnecessary BUG_ON (Tvrtko)
- WARN_ON and cleanup if wrong mask (Tvrtko, Michal)
- Use I915_READ_FW (Michal)
- Use I915_MAX_VCS/VECS macros (Michal)
v5: Rebased by Rodrigo fixing conflicts on top of:
commit 33def1ff7b0 ("drm/i915: Simplify intel_engines_init")v6: Fix v5. Remove info->num_rings. (by Oscar)
v7: Rebase (Rodrigo).
v8:
- s/intel_device_info_fused_off_engines/intel_device_info_init_mmio (Chris)
- Make vdbox_disable & vebox_disable local variables (Chris)
v9:
- Move function declaration to intel_device_info.h (Michal)
- Missing indent in bit fields definitions (Michal)
- When RC6 is enabled by BIOS, the fuse register cannot be read until the blitter powerwell is awake. Shuffle where the fuse is read, prune the forcewake domains after the fact and change the commit message accordingly (Vinay, Sagar, Chris).
v10:
- Improved commit message (Sagar)
- New line in header file (Sagar)
- Specify the message in fw_domain_reset applies to ICL+ (Sagar)
--- drivers/gpu/drm/i915/i915_drv.c | 4 +++ drivers/gpu/drm/i915/i915_reg.h | 5 +++ drivers/gpu/drm/i915/intel_device_info.c | 47 +++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_device_info.h | 2 ++ drivers/gpu/drm/i915/intel_uncore.c | 56 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uncore.h | 1 + 6 files changed, 115 insertions(+)
drivers/gpu/drm/i915/i915_drv.c +4 -0
@@ -1033,6 +1033,10 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)intel_uncore_init (dev_priv); +intel_device_info_init_mmio (dev_priv); + +intel_uncore_prune (dev_priv); +intel_uc_init_mmio (dev_priv); ret =intel_engines_init_mmio (dev_priv);
drivers/gpu/drm/i915/i915_reg.h +5 -0
@@ -2545,6 +2545,11 @@ enum i915_power_well_id {#define GEN10_EU_DISABLE3 _MMIO(0x9140)#define GEN10_EU_DIS_SS_MASK 0xff +#define GEN11_GT_VEBOX_VDBOX_DISABLE _MMIO(0x9140) +#define GEN11_GT_VDBOX_DISABLE_MASK 0xff +#define GEN11_GT_VEBOX_DISABLE_SHIFT 16 +#define GEN11_GT_VEBOX_DISABLE_MASK (0xff << GEN11_GT_VEBOX_DISABLE_SHIFT) +#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 +47 -0
50 lines not on this page · raw message
drivers/gpu/drm/i915/intel_device_info.h +2 -0
@@ -247,6 +247,8 @@ void intel_device_info_dump_runtime(const struct intel_device_info *info,void intel_device_info_dump_topology (const struct sseu_dev_info *sseu,struct drm_printer *p); +void intel_device_info_init_mmio (struct drm_i915_private *dev_priv); +void intel_driver_caps_print (const struct intel_driver_caps *caps,struct drm_printer *p);
drivers/gpu/drm/i915/intel_uncore.c +56 -0
74 lines not on this page · raw message
drivers/gpu/drm/i915/intel_uncore.h +1 -0
@@ -140,6 +140,7 @@ struct intel_uncore {void intel_uncore_sanitize (struct drm_i915_private *dev_priv);void intel_uncore_init (struct drm_i915_private *dev_priv); +void intel_uncore_prune (struct drm_i915_private *dev_priv);bool intel_uncore_unclaimed_mmio (struct drm_i915_private *dev_priv);bool intel_uncore_arm_unclaimed_mmio_detection (struct drm_i915_private *dev_priv);void intel_uncore_fini (struct drm_i915_private *dev_priv);
Signature · 6 lines
2.14.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/8 drm/i915/icl: Enable the extra video decode and enhancement boxes for Icelake 11
From: Oscar Mateo <[email protected]>
Icelake 11 has one vebox and two vdboxes (0 and 2).
Bspec: 21140
v2: Split out in two (Daniele)
--- drivers/gpu/drm/i915/i915_pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/i915/i915_pci.c +1 -0
@@ -602,6 +602,7 @@ static const struct intel_device_info intel_icelake_11_info = {PLATFORM (INTEL_ICELAKE ), .is_alpha_support = 1, .has_resource_streamer = 0, + .ring_mask = RENDER_RING | BLT_RING | VEBOX_RING | BSD_RING | BSD3_RING, };#undef GEN
Signature · 6 lines
2.14.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/8 drm/i915/icl: Update subslice define for ICL 11
In reply to Mika KuoppalaFrom: Kelvin Gardiner <[email protected]>
ICL 11 has a greater number of maximum subslices. This patch reflects this.
v2: GEN11 updates to MCR_SELECTOR (Oscar)
v3: Copypasta error in the new defines (Lionel)
Bspec: 21139
BSpec: 21108
--- drivers/gpu/drm/i915/i915_reg.h | 4 ++++ drivers/gpu/drm/i915/intel_engine_cs.c | 22 ++++++++++++++++++---- drivers/gpu/drm/i915/intel_ringbuffer.h | 2 +- 3 files changed, 23 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +4 -0
@@ -2151,6 +2151,10 @@ enum i915_power_well_id {#define GEN8_MCR_SLICE_MASK GEN8_MCR_SLICE(3)#define GEN8_MCR_SUBSLICE (subslice) (((subslice) & 3) << 24)#define GEN8_MCR_SUBSLICE_MASK GEN8_MCR_SUBSLICE(3) +#define GEN11_MCR_SLICE (slice) (((slice) & 0xf) << 27) +#define GEN11_MCR_SLICE_MASK GEN11_MCR_SLICE(0xf) +#define GEN11_MCR_SUBSLICE (subslice) (((subslice) & 0x7) << 24) +#define GEN11_MCR_SUBSLICE_MASK GEN11_MCR_SUBSLICE(0x7)#define RING_IPEIR (base) _MMIO((base)+0x64)#define RING_IPEHR (base) _MMIO((base)+0x68)/*
drivers/gpu/drm/i915/intel_engine_cs.c +18 -4
@@ -800,10 +800,24 @@ static inline uint32_t read_subslice_reg(struct drm_i915_private *dev_priv, int slice, int subslice, i915_reg_t reg) { + uint32_t mcr_slice_subslice_mask; +uint32_t mcr_slice_subslice_select;uint32_t mcr;uint32_t ret;enum forcewake_domains fw_domains; +if (INTEL_GEN (dev_priv) >=11 ) { + mcr_slice_subslice_mask =GEN11_MCR_SLICE_MASK | +GEN11_MCR_SUBSLICE_MASK ; + mcr_slice_subslice_select =GEN11_MCR_SLICE (slice) | +GEN11_MCR_SUBSLICE (subslice); + }else { + mcr_slice_subslice_mask =GEN8_MCR_SLICE_MASK | +GEN8_MCR_SUBSLICE_MASK ; + mcr_slice_subslice_select =GEN8_MCR_SLICE (slice) | +GEN8_MCR_SUBSLICE (subslice); + } + fw_domains =intel_uncore_forcewake_for_reg (dev_priv, reg,FW_REG_READ ); fw_domains |= intel_uncore_forcewake_for_reg(dev_priv,
@@ -818,14 +832,14 @@ read_subslice_reg(struct drm_i915_private *dev_priv, int slice,* The HW expects the slice and sublice selectors to be reset to 0 * after reading out the registers. */ -WARN_ON_ONCE (mcr & (GEN8_MCR_SLICE_MASK |GEN8_MCR_SUBSLICE_MASK )); - mcr &= ~(GEN8_MCR_SLICE_MASK |GEN8_MCR_SUBSLICE_MASK ); - mcr |=GEN8_MCR_SLICE (slice) |GEN8_MCR_SUBSLICE (subslice); +WARN_ON_ONCE (mcr & mcr_slice_subslice_mask); + mcr &= ~mcr_slice_subslice_mask; + mcr |= mcr_slice_subslice_select;I915_WRITE_FW (GEN8_MCR_SELECTOR , mcr); ret =I915_READ_FW (reg); - mcr &= ~(GEN8_MCR_SLICE_MASK |GEN8_MCR_SUBSLICE_MASK ); + mcr &= ~mcr_slice_subslice_mask;I915_WRITE_FW (GEN8_MCR_SELECTOR , mcr);intel_uncore_forcewake_put__locked (dev_priv, fw_domains);
drivers/gpu/drm/i915/intel_ringbuffer.h +1 -1
@@ -86,7 +86,7 @@ hangcheck_action_to_str(const enum intel_engine_hangcheck_action a) }#define I915_MAX_SLICES 3 -#define I915_MAX_SUBSLICES 3 +#define I915_MAX_SUBSLICES 8#define instdone_slice_mask (dev_priv__) \ (INTEL_GEN(dev_priv__) == 7 ? \
Signature · 6 lines
2.14.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/8] drm/i915/icl: Update subslice define for ICL 11
Quoted 8 lines · Mika Kuoppala
From: Kelvin Gardiner <[email protected]>
ICL 11 has a greater number of maximum subslices. This patch reflects this.
v2: GEN11 updates to
MCR_SELECTOR(Oscar)
v3: Copypasta error in the new defines (Lionel)
Quoted 8 lines
Bspec: 21139
BSpec: 21108Signed-off-by Kelvin Gardiner <[email protected]>Reviewed-by Oscar Mateo <[email protected]> (v1)Reviewed-by Daniele Ceraolo Spurio <[email protected]> (v1)Signed-off-by Oscar Mateo <[email protected]>Reviewed-by Lionel Landwerlin <[email protected]>
Pushed up-to this one.
Thanks for patches and review.
-Mika
Quoted 89 lines
--- drivers/gpu/drm/i915/i915_reg.h | 4 ++++ drivers/gpu/drm/i915/intel_engine_cs.c | 22 ++++++++++++++++++---- drivers/gpu/drm/i915/intel_ringbuffer.h | 2 +- 3 files changed, 23 insertions(+), 5 deletions(-)drivers/gpu/drm/i915/i915_reg.h +4
-0@@ -2151,6 +2151,10 @@ enum i915_power_well_id {#define GEN8_MCR_SLICE_MASK GEN8_MCR_SLICE(3)#define GEN8_MCR_SUBSLICE (subslice) (((subslice) & 3) << 24)#define GEN8_MCR_SUBSLICE_MASK GEN8_MCR_SUBSLICE(3) +#define GEN11_MCR_SLICE (slice) (((slice) & 0xf) << 27) +#define GEN11_MCR_SLICE_MASK GEN11_MCR_SLICE(0xf) +#define GEN11_MCR_SUBSLICE (subslice) (((subslice) & 0x7) << 24) +#define GEN11_MCR_SUBSLICE_MASK GEN11_MCR_SUBSLICE(0x7)#define RING_IPEIR (base) _MMIO((base)+0x64)#define RING_IPEHR (base) _MMIO((base)+0x68)/* drivers/gpu/drm/i915/intel_engine_cs.c +18
-4@@ -800,10 +800,24 @@ static inline uint32_t read_subslice_reg(struct drm_i915_private *dev_priv, int slice, int subslice, i915_reg_t reg) { + uint32_t mcr_slice_subslice_mask; +uint32_t mcr_slice_subslice_select;uint32_t mcr;uint32_t ret;enum forcewake_domains fw_domains; +if (INTEL_GEN (dev_priv) >=11 ) { + mcr_slice_subslice_mask =GEN11_MCR_SLICE_MASK | +GEN11_MCR_SUBSLICE_MASK ; + mcr_slice_subslice_select =GEN11_MCR_SLICE (slice) | +GEN11_MCR_SUBSLICE (subslice); + }else { + mcr_slice_subslice_mask =GEN8_MCR_SLICE_MASK | +GEN8_MCR_SUBSLICE_MASK ; + mcr_slice_subslice_select =GEN8_MCR_SLICE (slice) | +GEN8_MCR_SUBSLICE (subslice); + } + fw_domains =intel_uncore_forcewake_for_reg (dev_priv, reg,FW_REG_READ ); fw_domains |= intel_uncore_forcewake_for_reg(dev_priv,@@ -818,14 +832,14 @@ read_subslice_reg(struct drm_i915_private *dev_priv, int slice,* The HW expects the slice and sublice selectors to be reset to 0 * after reading out the registers. */ -WARN_ON_ONCE (mcr & (GEN8_MCR_SLICE_MASK |GEN8_MCR_SUBSLICE_MASK )); - mcr &= ~(GEN8_MCR_SLICE_MASK |GEN8_MCR_SUBSLICE_MASK ); - mcr |=GEN8_MCR_SLICE (slice) |GEN8_MCR_SUBSLICE (subslice); +WARN_ON_ONCE (mcr & mcr_slice_subslice_mask); + mcr &= ~mcr_slice_subslice_mask; + mcr |= mcr_slice_subslice_select;I915_WRITE_FW (GEN8_MCR_SELECTOR , mcr); ret =I915_READ_FW (reg); - mcr &= ~(GEN8_MCR_SLICE_MASK |GEN8_MCR_SUBSLICE_MASK ); + mcr &= ~mcr_slice_subslice_mask;I915_WRITE_FW (GEN8_MCR_SELECTOR , mcr);intel_uncore_forcewake_put__locked (dev_priv, fw_domains);drivers/gpu/drm/i915/intel_ringbuffer.h +1
-1@@ -86,7 +86,7 @@ hangcheck_action_to_str(const enum intel_engine_hangcheck_action a) }#define I915_MAX_SLICES 3 -#define I915_MAX_SUBSLICES 3 +#define I915_MAX_SUBSLICES 8#define instdone_slice_mask (dev_priv__) \ (INTEL_GEN(dev_priv__) == 7 ? \Signature · 6 lines
2.14.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/8 drm/i915/icl: Added ICL 11 slice, subslice and EU fuse detection
In reply to Mika KuoppalaFrom: Kelvin Gardiner <[email protected]>
This patch adds support to detect ICL, slice, subslice and EU fuse settings.
Add addresses for ICL 11 slice, subslice and EU fuses registers. These register addresses are the same as previous platforms but the format and / or the meaning of the information is different. Therefore Gen11 defines for these registers are added.
v2 (James): Rebase
Bspec: 9731
Bspec: 20643
Bspec: 20673
--- drivers/gpu/drm/i915/i915_reg.h | 9 +++++++++ drivers/gpu/drm/i915/intel_device_info.c | 25 ++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +9 -0
@@ -2554,6 +2554,15 @@ enum i915_power_well_id {#define GEN11_GT_VEBOX_DISABLE_SHIFT 16#define GEN11_GT_VEBOX_DISABLE_MASK (0xff << GEN11_GT_VEBOX_DISABLE_SHIFT) +#define GEN11_EU_DISABLE _MMIO(0x9134) +#define GEN11_EU_DIS_MASK 0xFF + +#define GEN11_GT_SLICE_ENABLE _MMIO(0x9138) +#define GEN11_GT_S_ENA_MASK 0xFF + +#define GEN11_GT_SUBSLICE_DISABLE _MMIO(0x913C) +#define GEN11_GT_SS_DIS_MASK 0xFF +#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 +24 -1
@@ -158,6 +158,27 @@ static u16 compute_eu_total(const struct sseu_dev_info *sseu)return total; } +static void gen11_sseu_info_init (struct drm_i915_private *dev_priv) +{ +struct sseu_dev_info *sseu = &mkwrite_device_info (dev_priv)->sseu; +int eu_max =8 ; +u32 eu_disable; + + sseu->slice_mask =I915_READ (GEN11_GT_SLICE_ENABLE ) & +GEN11_GT_S_ENA_MASK ; + sseu->subslice_mask[0 ] = ~(I915_READ (GEN11_GT_SUBSLICE_DISABLE ) & +GEN11_GT_SS_DIS_MASK ); + eu_disable =I915_READ (GEN11_EU_DISABLE ) &GEN11_GT_S_ENA_MASK ; + + sseu->eu_per_subslice = eu_max -hweight32 (eu_disable); + sseu->eu_total = sseu->eu_per_subslice *hweight32 (sseu->subslice_mask[0 ]); + +/* ICL has no power gating restrictions. */ + sseu->has_slice_pg =1 ; + sseu->has_subslice_pg =1 ; + sseu->has_eu_pg =1 ; +} +static void gen10_sseu_info_init (struct drm_i915_private *dev_priv) {struct sseu_dev_info *sseu = &mkwrite_device_info (dev_priv)->sseu;
@@ -768,8 +789,10 @@ void intel_device_info_runtime_init(struct intel_device_info *info)broadwell_sseu_info_init (dev_priv); else if (INTEL_GEN(dev_priv) == 9) gen9_sseu_info_init(dev_priv); - else if (INTEL_GEN(dev_priv) >= 10) + else if (INTEL_GEN(dev_priv) == 10) gen10_sseu_info_init(dev_priv); + else if (INTEL_INFO(dev_priv)->gen >= 11) + gen11_sseu_info_init(dev_priv);/* Initialize command stream timestamp frequency */ info->cs_timestamp_frequency_khz =read_timestamp_frequency (dev_priv);
Signature · 6 lines
2.14.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 4/8] drm/i915/icl: Added ICL 11 slice, subslice and EU fuse detection
Quoted 61 lines · Mika Kuoppala
From: Kelvin Gardiner <[email protected]>
This patch adds support to detect ICL, slice, subslice and EU fuse settings.
Add addresses for ICL 11 slice, subslice and EU fuses registers. These register addresses are the same as previous platforms but the format and / or the meaning of the information is different. Therefore Gen11 defines for these registers are added.
v2 (James): Rebase
Bspec: 9731
Bspec: 20643
Bspec: 20673Signed-off-by Kelvin Gardiner <[email protected]>Signed-off-by James Ausmus <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 9 +++++++++ drivers/gpu/drm/i915/intel_device_info.c | 25 ++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/i915_reg.h +9
-0@@ -2554,6 +2554,15 @@ enum i915_power_well_id {#define GEN11_GT_VEBOX_DISABLE_SHIFT 16#define GEN11_GT_VEBOX_DISABLE_MASK (0xff << GEN11_GT_VEBOX_DISABLE_SHIFT) +#define GEN11_EU_DISABLE _MMIO(0x9134) +#define GEN11_EU_DIS_MASK 0xFF + +#define GEN11_GT_SLICE_ENABLE _MMIO(0x9138) +#define GEN11_GT_S_ENA_MASK 0xFF + +#define GEN11_GT_SUBSLICE_DISABLE _MMIO(0x913C) +#define GEN11_GT_SS_DIS_MASK 0xFF +#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 +10
-0@@ -158,6 +158,27 @@ static u16 compute_eu_total(const struct sseu_dev_info *sseu)return total; } +static void gen11_sseu_info_init (struct drm_i915_private *dev_priv) +{ +struct sseu_dev_info *sseu = &mkwrite_device_info (dev_priv)->sseu; +int eu_max =8 ; +u32 eu_disable; + + sseu->slice_mask =I915_READ (GEN11_GT_SLICE_ENABLE ) & +GEN11_GT_S_ENA_MASK ; + sseu->subslice_mask[0 ] = ~(I915_READ (GEN11_GT_SUBSLICE_DISABLE ) & +GEN11_GT_SS_DIS_MASK );
drivers/gpu/drm/i915/intel_device_info.c static u16 compute_eu_total(const struct sseu_dev_info *sseu) · line 180
Quoted 10 lines
drivers/gpu/drm/i915/intel_device_info.c +10
-0+ eu_disable =I915_READ (GEN11_EU_DISABLE ) &GEN11_GT_S_ENA_MASK ; + + sseu->eu_per_subslice = eu_max -hweight32 (eu_disable); + sseu->eu_total = sseu->eu_per_subslice *hweight32 (sseu->subslice_mask[0 ]); + +/* ICL has no power gating restrictions. */ + sseu->has_slice_pg =1 ; + sseu->has_subslice_pg =1 ; + sseu->has_eu_pg =1 ; +}
Storing the available slice/subslices/EUs has changed a bit. This patch will most likely fail on the i915_query tests from IGT.
I've updated this patch here : https://github.com/djdeath/linux/commit/ad46d70ee757c943e98472e18d841cb631df09b9
Quoted 6 lines
drivers/gpu/drm/i915/intel_device_info.c +1
-0+static void gen10_sseu_info_init (struct drm_i915_private *dev_priv) {struct sseu_dev_info *sseu = &mkwrite_device_info (dev_priv)->sseu;@@ -768,8 +789,10 @@ void intel_device_info_runtime_init(struct intel_device_info *info)broadwell_sseu_info_init (dev_priv);
drivers/gpu/drm/i915/intel_device_info.c void intel_device_info_runtime_init(struct intel_device_info *info) · line 798
Quoted 10 lines
drivers/gpu/drm/i915/intel_device_info.c +3
-1else if (INTEL_GEN (dev_priv) ==9 )gen9_sseu_info_init (dev_priv); -else if (INTEL_GEN (dev_priv) >=10 ) +else if (INTEL_GEN (dev_priv) ==10 )gen10_sseu_info_init (dev_priv); +else if (INTEL_INFO (dev_priv)->gen >=11 ) +gen11_sseu_info_init (dev_priv);/* Initialize command stream timestamp frequency */ info->cs_timestamp_frequency_khz =read_timestamp_frequency (dev_priv);
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 4/8 drm/i915/icl: Added ICL 11 slice, subslice and EU fuse detection
In reply to Mika KuoppalaFrom: Kelvin Gardiner <[email protected]>
This patch adds support to detect ICL, slice, subslice and EU fuse settings.
Add addresses for ICL 11 slice, subslice and EU fuses registers. These register addresses are the same as previous platforms but the format and / or the meaning of the information is different. Therefore Gen11 defines for these registers are added.
Bspec: 9731
Bspec: 20643
Bspec: 20673
v2: Update fusing information storage after introducing the new query
uAPI (Lionel)
--- drivers/gpu/drm/i915/i915_reg.h | 9 +++++++ drivers/gpu/drm/i915/intel_device_info.c | 42 +++++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_reg.h +9 -0
@@ -2876,6 +2876,15 @@ enum i915_power_well_id {#define GEN11_GT_VEBOX_DISABLE_SHIFT 16#define GEN11_GT_VEBOX_DISABLE_MASK (0xff << GEN11_GT_VEBOX_DISABLE_SHIFT) +#define GEN11_EU_DISABLE _MMIO(0x9134) +#define GEN11_EU_DIS_MASK 0xFF + +#define GEN11_GT_SLICE_ENABLE _MMIO(0x9138) +#define GEN11_GT_S_ENA_MASK 0xFF + +#define GEN11_GT_SUBSLICE_DISABLE _MMIO(0x913C) +#define GEN11_GT_SS_DIS_MASK 0xFF +#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 +41 -1
55 lines not on this page · raw message
Signature · 6 lines
2.16.2 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/8 drm/i915/icl: Add reset control register changes
In reply to Mika KuoppalaFrom: Michel Thierry <[email protected]>
The bits used to reset the different engines/domains have changed in GEN11, this patch maps the reset engine mask bits with the new bits in the reset control register.
v2: Use shift-left instead of BIT macro to match the file style (Paulo).
v3: Reuse gen8_reset_engines (Daniele).
v4: Do not call intel_uncore_forcewake_reset after reset, we may be using the forcewake to read protected registers elsewhere and those results may be clobbered by the concurrent dropping of forcewake.
bspec: 19212
--- drivers/gpu/drm/i915/i915_reg.h | 11 ++++++++ drivers/gpu/drm/i915/intel_uncore.c | 53 +++++++++++++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +11 -0
@@ -301,6 +301,17 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)#define GEN6_GRDOM_VECS (1 << 4)#define GEN9_GRDOM_GUC (1 << 5)#define GEN8_GRDOM_MEDIA2 (1 << 7) +/* GEN11 changed all bit defs except for FULL & RENDER */ +#define GEN11_GRDOM_FULL GEN6_GRDOM_FULL +#define GEN11_GRDOM_RENDER GEN6_GRDOM_RENDER +#define GEN11_GRDOM_BLT (1 << 2) +#define GEN11_GRDOM_GUC (1 << 3) +#define GEN11_GRDOM_MEDIA (1 << 5) +#define GEN11_GRDOM_MEDIA2 (1 << 6) +#define GEN11_GRDOM_MEDIA3 (1 << 7) +#define GEN11_GRDOM_MEDIA4 (1 << 8) +#define GEN11_GRDOM_VECS (1 << 13) +#define GEN11_GRDOM_VECS2 (1 << 14)#define RING_PP_DIR_BASE (engine) _MMIO((engine)->mmio_base+0x228)#define RING_PP_DIR_BASE_READ (engine) _MMIO((engine)->mmio_base+0x518)
drivers/gpu/drm/i915/intel_uncore.c +51 -2
76 lines not on this page · raw message
Signature · 6 lines
2.14.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 5/8] drm/i915/icl: Add reset control register changes
Quoted 31 lines · Mika Kuoppala
From: Michel Thierry <[email protected]>
The bits used to reset the different engines/domains have changed in GEN11, this patch maps the reset engine mask bits with the new bits in the reset control register.
v2: Use shift-left instead of BIT macro to match the file style (Paulo).
v3: Reusegen8_reset_engines(Daniele).
v4: Do not callintel_uncore_forcewake_resetafter reset, we may be using the forcewake to read protected registers elsewhere and those results may be clobbered by the concurrent dropping of forcewake.bspec: 19212
Cc Oscar Mateo <[email protected]>Cc Antonio Argenziano <[email protected]>Cc Paulo Zanoni <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Signed-off-by Michel Thierry <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 11 ++++++++ drivers/gpu/drm/i915/intel_uncore.c | 53 +++++++++++++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_reg.h +0
-0@@ -301,6 +301,17 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)#define GEN6_GRDOM_VECS (1 << 4)#define GEN9_GRDOM_GUC (1 << 5)
drivers/gpu/drm/i915/i915_reg.h static inline bool i915_mmio_reg_valid(i915_reg_t reg) · line 312
Quoted 10 lines
drivers/gpu/drm/i915/i915_reg.h +9
-0#define GEN8_GRDOM_MEDIA2 (1 << 7) +/* GEN11 changed all bit defs except for FULL & RENDER */ +#define GEN11_GRDOM_FULL GEN6_GRDOM_FULL +#define GEN11_GRDOM_RENDER GEN6_GRDOM_RENDER +#define GEN11_GRDOM_BLT (1 << 2) +#define GEN11_GRDOM_GUC (1 << 3) +#define GEN11_GRDOM_MEDIA (1 << 5) +#define GEN11_GRDOM_MEDIA2 (1 << 6) +#define GEN11_GRDOM_MEDIA3 (1 << 7) +#define GEN11_GRDOM_MEDIA4 (1 << 8)
I would like these to be named like they are in bspec. First being MEDIA0.
drivers/gpu/drm/i915/i915_reg.h static inline bool i915_mmio_reg_valid(i915_reg_t reg) · line 314
Quoted 2 lines
drivers/gpu/drm/i915/i915_reg.h +2
-0+#define GEN11_GRDOM_VECS (1 << 13) +#define GEN11_GRDOM_VECS2 (1 << 14)
And same to these, VECS0 and VECS1.
-Mika
Quoted 93 lines
drivers/gpu/drm/i915/i915_reg.h +0
-0#define RING_PP_DIR_BASE (engine) _MMIO((engine)->mmio_base+0x228)#define RING_PP_DIR_BASE_READ (engine) _MMIO((engine)->mmio_base+0x518)drivers/gpu/drm/i915/intel_uncore.c +51
-2@@ -1909,6 +1909,50 @@ static int gen6_reset_engines(struct drm_i915_private *dev_priv,return gen6_hw_domain_reset (dev_priv, hw_mask); } +/** +* gen11_reset_engines - reset individual engines +* @dev_priv: i915 device +* @engine_mask: mask of intel_ring_flag() engines or ALL_ENGINES for full reset +* +* This function will reset the individual engines that are set in engine_mask. +* If you provide ALL_ENGINES as mask, full global domain reset will be issued. +* +* Note: It is responsibility of the caller to handle the difference between +* asking full domain reset versus reset for all available individual engines. +* +* Returns 0 on success, nonzero on error. +*/ +static int gen11_reset_engines (struct drm_i915_private *dev_priv, +unsigned engine_mask) +{ +struct intel_engine_cs *engine; +const u32 hw_engine_mask[I915_NUM_ENGINES ] = { + [RCS ] =GEN11_GRDOM_RENDER , + [BCS ] =GEN11_GRDOM_BLT , + [VCS ] =GEN11_GRDOM_MEDIA , + [VCS2 ] =GEN11_GRDOM_MEDIA2 , + [VCS3 ] =GEN11_GRDOM_MEDIA3 , + [VCS4 ] =GEN11_GRDOM_MEDIA4 , + [VECS ] =GEN11_GRDOM_VECS , + [VECS2 ] =GEN11_GRDOM_VECS2 , + }; +u32 hw_mask; + +BUILD_BUG_ON (VECS2 +1 !=I915_NUM_ENGINES ); + +if (engine_mask ==ALL_ENGINES ) { + hw_mask =GEN11_GRDOM_FULL ; + }else { +unsigned int tmp; + + hw_mask =0 ; +for_each_engine_masked (engine, dev_priv, engine_mask, tmp) + hw_mask |= hw_engine_mask[engine->id]; + } + +return gen6_hw_domain_reset (dev_priv, hw_mask); +} +/** * __intel_wait_for_register_fw - wait until register matches expected state * @dev_priv: the i915 device @@ -2056,7 +2100,10 @@ static int gen8_reset_engines(struct drm_i915_private *dev_priv,if (gen8_reset_engine_start (engine)) goto not_ready; -return gen6_reset_engines (dev_priv, engine_mask); +if (INTEL_GEN (dev_priv) >=11 ) +return gen11_reset_engines (dev_priv, engine_mask); +else +return gen6_reset_engines (dev_priv, engine_mask); not_ready:for_each_engine_masked (engine, dev_priv, engine_mask, tmp)@@ -2141,12 +2188,14 @@ bool intel_has_reset_engine(struct drm_i915_private *dev_priv)int intel_reset_guc (struct drm_i915_private *dev_priv) { +u32 guc_domain =INTEL_GEN (dev_priv) >=11 ?GEN11_GRDOM_GUC : +GEN9_GRDOM_GUC ;int ret;GEM_BUG_ON (!HAS_GUC (dev_priv));intel_uncore_forcewake_get (dev_priv,FORCEWAKE_ALL ); - ret =gen6_hw_domain_reset (dev_priv,GEN9_GRDOM_GUC ); + ret =gen6_hw_domain_reset (dev_priv, guc_domain);intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL );return ret;Signature · 6 lines
2.14.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 5/8] drm/i915/icl: Add reset control register changes
In reply to Mika KuoppalaQuoting Mika Kuoppala (2018-03-16 12:14:53)
Quoted 4 lines
drivers/gpu/drm/i915/intel_uncore.c +4
-0+static int gen11_reset_engines (struct drm_i915_private *dev_priv, +unsigned engine_mask) +{ +struct intel_engine_cs *engine;
drivers/gpu/drm/i915/intel_uncore.c static int gen6_reset_engines(struct drm_i915_private *dev_priv, · line 1938
Quoted 10 lines
drivers/gpu/drm/i915/intel_uncore.c +10
-0+const u32 hw_engine_mask[I915_NUM_ENGINES ] = { + [RCS ] =GEN11_GRDOM_RENDER , + [BCS ] =GEN11_GRDOM_BLT , + [VCS ] =GEN11_GRDOM_MEDIA , + [VCS2 ] =GEN11_GRDOM_MEDIA2 , + [VCS3 ] =GEN11_GRDOM_MEDIA3 , + [VCS4 ] =GEN11_GRDOM_MEDIA4 , + [VECS ] =GEN11_GRDOM_VECS , + [VECS2 ] =GEN11_GRDOM_VECS2 , + };
No gratuitously decorating Christmas trees.
drivers/gpu/drm/i915/intel_uncore.c static int gen6_reset_engines(struct drm_i915_private *dev_priv, · line 1945
Quoted 7 lines
drivers/gpu/drm/i915/intel_uncore.c +7
-0+u32 hw_mask; + +BUILD_BUG_ON (VECS2 +1 !=I915_NUM_ENGINES ); + +if (engine_mask ==ALL_ENGINES ) { + hw_mask =GEN11_GRDOM_FULL ; + }else {
Plonk struct intel_engine_cs *engine; here instead.
drivers/gpu/drm/i915/intel_uncore.c static int gen6_reset_engines(struct drm_i915_private *dev_priv, · line 1951
Quoted 6 lines
drivers/gpu/drm/i915/intel_uncore.c +6
-0+unsigned int tmp; + + hw_mask =0 ; +for_each_engine_masked (engine, dev_priv, engine_mask, tmp) + hw_mask |= hw_engine_mask[engine->id]; + }
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 5/8] drm/i915/icl: Add reset control register changes
In reply to Mika KuoppalaQuoted 71 lines · Mika Kuoppala
From: Michel Thierry <[email protected]>
The bits used to reset the different engines/domains have changed in GEN11, this patch maps the reset engine mask bits with the new bits in the reset control register.
v2: Use shift-left instead of BIT macro to match the file style (Paulo).
v3: Reusegen8_reset_engines(Daniele).
v4: Do not callintel_uncore_forcewake_resetafter reset, we may be using the forcewake to read protected registers elsewhere and those results may be clobbered by the concurrent dropping of forcewake.bspec: 19212
Cc Oscar Mateo <[email protected]>Cc Antonio Argenziano <[email protected]>Cc Paulo Zanoni <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Signed-off-by Michel Thierry <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 11 ++++++++ drivers/gpu/drm/i915/intel_uncore.c | 53 +++++++++++++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_reg.h +11
-0@@ -301,6 +301,17 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)#define GEN6_GRDOM_VECS (1 << 4)#define GEN9_GRDOM_GUC (1 << 5)#define GEN8_GRDOM_MEDIA2 (1 << 7) +/* GEN11 changed all bit defs except for FULL & RENDER */ +#define GEN11_GRDOM_FULL GEN6_GRDOM_FULL +#define GEN11_GRDOM_RENDER GEN6_GRDOM_RENDER +#define GEN11_GRDOM_BLT (1 << 2) +#define GEN11_GRDOM_GUC (1 << 3) +#define GEN11_GRDOM_MEDIA (1 << 5) +#define GEN11_GRDOM_MEDIA2 (1 << 6) +#define GEN11_GRDOM_MEDIA3 (1 << 7) +#define GEN11_GRDOM_MEDIA4 (1 << 8) +#define GEN11_GRDOM_VECS (1 << 13) +#define GEN11_GRDOM_VECS2 (1 << 14)#define RING_PP_DIR_BASE (engine) _MMIO((engine)->mmio_base+0x228)#define RING_PP_DIR_BASE_READ (engine) _MMIO((engine)->mmio_base+0x518)drivers/gpu/drm/i915/intel_uncore.c +17
-0@@ -1909,6 +1909,50 @@ static int gen6_reset_engines(struct drm_i915_private *dev_priv,return gen6_hw_domain_reset (dev_priv, hw_mask); } +/** +* gen11_reset_engines - reset individual engines +* @dev_priv: i915 device +* @engine_mask: mask of intel_ring_flag() engines or ALL_ENGINES for full reset +* +* This function will reset the individual engines that are set in engine_mask. +* If you provide ALL_ENGINES as mask, full global domain reset will be issued. +* +* Note: It is responsibility of the caller to handle the difference between +* asking full domain reset versus reset for all available individual engines. +* +* Returns 0 on success, nonzero on error. +*/ +static int gen11_reset_engines (struct drm_i915_private *dev_priv, +unsigned engine_mask) +{ +struct intel_engine_cs *engine;
drivers/gpu/drm/i915/intel_uncore.c static int gen6_reset_engines(struct drm_i915_private *dev_priv, · line 1938
Quoted 10 lines
drivers/gpu/drm/i915/intel_uncore.c +10
-0+const u32 hw_engine_mask[I915_NUM_ENGINES ] = { + [RCS ] =GEN11_GRDOM_RENDER , + [BCS ] =GEN11_GRDOM_BLT , + [VCS ] =GEN11_GRDOM_MEDIA , + [VCS2 ] =GEN11_GRDOM_MEDIA2 , + [VCS3 ] =GEN11_GRDOM_MEDIA3 , + [VCS4 ] =GEN11_GRDOM_MEDIA4 , + [VECS ] =GEN11_GRDOM_VECS , + [VECS2 ] =GEN11_GRDOM_VECS2 , + };
Just a thought, but since this function is a copy of gen6_reset_engines with the only difference being the array (GEN11_GRDOM_FULL is also the same as GEN6_GRDOM_FULL), would it make sense to just add the array to the gen6 function? e.g.:
const u32 gen6_hw_engine_mask[] = {
....
}
const u32 gen11_hw_engine_mask[] = {
....
}
const u32 *hw_engine_mask = INTEL_GEN(dev_priv) >= 11 ?
gen11_hw_engine_mask : gen6_hw_engine_mask;My Ack still stands regardless and I also agree with renaming the defines to be closer to the specs.
Daniele
Quoted 39 lines
drivers/gpu/drm/i915/intel_uncore.c +23
-1+u32 hw_mask; + +BUILD_BUG_ON (VECS2 +1 !=I915_NUM_ENGINES ); + +if (engine_mask ==ALL_ENGINES ) { + hw_mask =GEN11_GRDOM_FULL ; + }else { +unsigned int tmp; + + hw_mask =0 ; +for_each_engine_masked (engine, dev_priv, engine_mask, tmp) + hw_mask |= hw_engine_mask[engine->id]; + } + +return gen6_hw_domain_reset (dev_priv, hw_mask); +} +/** * __intel_wait_for_register_fw - wait until register matches expected state * @dev_priv: the i915 device @@ -2056,7 +2100,10 @@ static int gen8_reset_engines(struct drm_i915_private *dev_priv,if (gen8_reset_engine_start (engine)) goto not_ready; -return gen6_reset_engines (dev_priv, engine_mask); +if (INTEL_GEN (dev_priv) >=11 ) +return gen11_reset_engines (dev_priv, engine_mask); +else +return gen6_reset_engines (dev_priv, engine_mask); not_ready:for_each_engine_masked (engine, dev_priv, engine_mask, tmp)@@ -2141,12 +2188,14 @@ bool intel_has_reset_engine(struct drm_i915_private *dev_priv)int intel_reset_guc (struct drm_i915_private *dev_priv) { +u32 guc_domain =INTEL_GEN (dev_priv) >=11 ?GEN11_GRDOM_GUC : +GEN9_GRDOM_GUC ;
drivers/gpu/drm/i915/intel_uncore.c bool intel_has_reset_engine(struct drm_i915_private *dev_priv) · line 2201
Quoted 10 lines
drivers/gpu/drm/i915/intel_uncore.c +1
-1int ret;GEM_BUG_ON (!HAS_GUC (dev_priv));intel_uncore_forcewake_get (dev_priv,FORCEWAKE_ALL ); - ret =gen6_hw_domain_reset (dev_priv,GEN9_GRDOM_GUC ); + ret =gen6_hw_domain_reset (dev_priv, guc_domain);intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL );return ret;
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 5/8] drm/i915/icl: Add reset control register changes
Quoting Daniele Ceraolo Spurio (2018-03-16 20:28:25)
Quoted 90 lines · Mika Kuoppala
Quoted 71 lines
From: Michel Thierry <[email protected]>
The bits used to reset the different engines/domains have changed in GEN11, this patch maps the reset engine mask bits with the new bits in the reset control register.
v2: Use shift-left instead of BIT macro to match the file style (Paulo).
v3: Reusegen8_reset_engines(Daniele).
v4: Do not callintel_uncore_forcewake_resetafter reset, we may be using the forcewake to read protected registers elsewhere and those results may be clobbered by the concurrent dropping of forcewake.bspec: 19212
Cc Oscar Mateo <[email protected]>Cc Antonio Argenziano <[email protected]>Cc Paulo Zanoni <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Signed-off-by Michel Thierry <[email protected]>--- drivers/gpu/drm/i915/i915_reg.h | 11 ++++++++ drivers/gpu/drm/i915/intel_uncore.c | 53 +++++++++++++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_reg.h +11
-0@@ -301,6 +301,17 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)#define GEN6_GRDOM_VECS (1 << 4)#define GEN9_GRDOM_GUC (1 << 5)#define GEN8_GRDOM_MEDIA2 (1 << 7) +/* GEN11 changed all bit defs except for FULL & RENDER */ +#define GEN11_GRDOM_FULL GEN6_GRDOM_FULL +#define GEN11_GRDOM_RENDER GEN6_GRDOM_RENDER +#define GEN11_GRDOM_BLT (1 << 2) +#define GEN11_GRDOM_GUC (1 << 3) +#define GEN11_GRDOM_MEDIA (1 << 5) +#define GEN11_GRDOM_MEDIA2 (1 << 6) +#define GEN11_GRDOM_MEDIA3 (1 << 7) +#define GEN11_GRDOM_MEDIA4 (1 << 8) +#define GEN11_GRDOM_VECS (1 << 13) +#define GEN11_GRDOM_VECS2 (1 << 14)#define RING_PP_DIR_BASE (engine) _MMIO((engine)->mmio_base+0x228)#define RING_PP_DIR_BASE_READ (engine) _MMIO((engine)->mmio_base+0x518)drivers/gpu/drm/i915/intel_uncore.c +17
-0@@ -1909,6 +1909,50 @@ static int gen6_reset_engines(struct drm_i915_private *dev_priv,return gen6_hw_domain_reset (dev_priv, hw_mask); } +/** +* gen11_reset_engines - reset individual engines +* @dev_priv: i915 device +* @engine_mask: mask of intel_ring_flag() engines or ALL_ENGINES for full reset +* +* This function will reset the individual engines that are set in engine_mask. +* If you provide ALL_ENGINES as mask, full global domain reset will be issued. +* +* Note: It is responsibility of the caller to handle the difference between +* asking full domain reset versus reset for all available individual engines. +* +* Returns 0 on success, nonzero on error. +*/ +static int gen11_reset_engines (struct drm_i915_private *dev_priv, +unsigned engine_mask) +{ +struct intel_engine_cs *engine;drivers/gpu/drm/i915/intel_uncore.c static int gen6_reset_engines(struct drm_i915_private *dev_priv, · line 1938
Quoted 10 lines
drivers/gpu/drm/i915/intel_uncore.c +10
-0+const u32 hw_engine_mask[I915_NUM_ENGINES ] = { + [RCS ] =GEN11_GRDOM_RENDER , + [BCS ] =GEN11_GRDOM_BLT , + [VCS ] =GEN11_GRDOM_MEDIA , + [VCS2 ] =GEN11_GRDOM_MEDIA2 , + [VCS3 ] =GEN11_GRDOM_MEDIA3 , + [VCS4 ] =GEN11_GRDOM_MEDIA4 , + [VECS ] =GEN11_GRDOM_VECS , + [VECS2 ] =GEN11_GRDOM_VECS2 , + };Just a thought, but since this function is a copy of
gen6_reset_engineswith the only difference being the array (GEN11_GRDOM_FULLis also the same asGEN6_GRDOM_FULL), would it make sense to just add the array to the gen6 function? e.g.:
Quoted 10 lines
const u32 gen6_hw_engine_mask[] = {
....
}
const u32 gen11_hw_engine_mask[] = {
....
}
const u32 *hw_engine_mask = INTEL_GEN(dev_priv) >= 11 ?
gen11_hw_engine_mask : gen6_hw_engine_mask;Oh, and we are definitely in the territory where static const should result in a smaller binary (.text + .data).
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 5/8] drm/i915/icl: Add reset control register changes
In reply to Daniele Ceraolo SpurioQuoted 84 lines · Daniele Ceraolo Spurio
Quoted 81 lines · Mika Kuoppala
From: Michel Thierry <[email protected]>
The bits used to reset the different engines/domains have changed in GEN11, this patch maps the reset engine mask bits with the new bits in the reset control register.
v2: Use shift-left instead of BIT macro to match the file style (Paulo).
v3: Reusegen8_reset_engines(Daniele).
v4: Do not callintel_uncore_forcewake_resetafter reset, we may be using the forcewake to read protected registers elsewhere and those results may be clobbered by the concurrent dropping of forcewake.bspec: 19212
Cc Oscar Mateo <[email protected]>Cc Antonio Argenziano <[email protected]>Cc Paulo Zanoni <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Signed-off-by Michel Thierry <[email protected]>---
drivers/gpu/drm/i915/i915_reg.h | 11 ++++++++drivers/gpu/drm/i915/intel_uncore.c| 53
+++++++++++++++++++++++++++++++++++--2 files changed, 62 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/i915_reg.h +11
-0@@ -301,6 +301,17 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg) #define GEN6_GRDOM_VECS (1 << 4) #define GEN9_GRDOM_GUC (1 << 5) #define GEN8_GRDOM_MEDIA2 (1 << 7) +/* GEN11 changed all bit defs except for FULL & RENDER */ +#define GEN11_GRDOM_FULL GEN6_GRDOM_FULL +#define GEN11_GRDOM_RENDER GEN6_GRDOM_RENDER +#define GEN11_GRDOM_BLT (1 << 2) +#define GEN11_GRDOM_GUC (1 << 3) +#define GEN11_GRDOM_MEDIA (1 << 5) +#define GEN11_GRDOM_MEDIA2 (1 << 6) +#define GEN11_GRDOM_MEDIA3 (1 << 7) +#define GEN11_GRDOM_MEDIA4 (1 << 8) +#define GEN11_GRDOM_VECS (1 << 13) +#define GEN11_GRDOM_VECS2 (1 << 14) #define RING_PP_DIR_BASE(engine) _MMIO((engine)->mmio_base+0x228) #define RING_PP_DIR_BASE_READ(engine) _MMIO((engine)->mmio_base+0x518)drivers/gpu/drm/i915/intel_uncore.c +4
-0@@ -1909,6 +1909,50 @@ static int gen6_reset_engines(structdrm_i915_private *dev_priv, return gen6_hw_domain_reset(dev_priv, hw_mask); } +/** +* gen11_reset_engines - reset individual engines +* @dev_priv: i915 device +* @engine_mask: mask of intel_ring_flag() engines or ALL_ENGINES for full reset
+ *
+ * This function will reset the individual engines that are set inengine_mask.
+ * If you provideALL_ENGINESas mask, full global domain reset will be issued.
+ *
+ * Note: It is responsibility of the caller to handle the difference between
+ * asking full domain reset versus reset for all available individual engines.
+ *
+ * Returns 0 on success, nonzero on error.
+ */drivers/gpu/drm/i915/intel_uncore.c +8
-0+static int gen11_reset_engines (struct drm_i915_private *dev_priv, + unsigned engine_mask) +{ + struct intel_engine_cs *engine; + const u32 hw_engine_mask[I915_NUM_ENGINES] = { + [RCS] = GEN11_GRDOM_RENDER, + [BCS] = GEN11_GRDOM_BLT, + [VCS] = GEN11_GRDOM_MEDIA,
Quoted 8 lines
Quoted 6 lines
+ [VCS2] =
GEN11_GRDOM_MEDIA2,
+ [VCS3] =GEN11_GRDOM_MEDIA3,
+ [VCS4] =GEN11_GRDOM_MEDIA4,
+ [VECS] =GEN11_GRDOM_VECS,
+ [VECS2] =GEN11_GRDOM_VECS2,
+ };Just a thought, but since this function is a copy of
gen6_reset_engineswith the only difference being the array (GEN11_GRDOM_FULLis also the same asGEN6_GRDOM_FULL), would it make sense to just add the array to the gen6 function? e.g.:
There are more changes for gen11 coming (locking/unlocking the shared SFC units), so I don't think it's a good idea to combine them.
Quoted 53 lines
const u32 gen6_hw_engine_mask[] = {
....
}
const u32 gen11_hw_engine_mask[] = {
....
}const u32
*hw_engine_mask=INTEL_GEN(dev_priv)>= 11 ?gen11_hw_engine_mask:gen6_hw_engine_mask;My Ack still stands regardless and I also agree with renaming the defines to be closer to the specs.
Daniele
Quoted 37 lines
+ u32
hw_mask;drivers/gpu/drm/i915/intel_uncore.c +16
-0+ + BUILD_BUG_ON(VECS2 + 1 != I915_NUM_ENGINES); + + if (engine_mask == ALL_ENGINES) { + hw_mask = GEN11_GRDOM_FULL; + } else { + unsigned int tmp; + + hw_mask = 0; + for_each_engine_masked(engine, dev_priv, engine_mask, tmp) + hw_mask |= hw_engine_mask[engine->id]; + } + + return gen6_hw_domain_reset(dev_priv, hw_mask); +} +/**
*__intel_wait_for_register_fw- wait until register matches expected state
* @dev_priv: the i915 devicedrivers/gpu/drm/i915/intel_uncore.c +4
-1@@ -2056,7 +2100,10 @@ static int gen8_reset_engines(structdrm_i915_private *dev_priv, if (gen8_reset_engine_start(engine)) goto not_ready; - return gen6_reset_engines(dev_priv, engine_mask); + if (INTEL_GEN(dev_priv) >= 11) + return gen11_reset_engines(dev_priv, engine_mask); + else + return gen6_reset_engines(dev_priv, engine_mask);
not_ready:
for_each_engine_masked(engine, dev_priv, engine_mask, tmp)drivers/gpu/drm/i915/intel_uncore.c +2
-0@@ -2141,12 +2188,14 @@ bool intel_has_reset_engine(struct drm_i915_private *dev_priv) int intel_reset_guc(struct drm_i915_private *dev_priv) { + u32 guc_domain = INTEL_GEN(dev_priv) >= 11 ? GEN11_GRDOM_GUC : + GEN9_GRDOM_GUC;
Quoted 8 lines
drivers/gpu/drm/i915/intel_uncore.c bool intel_has_reset_engine(struct drm_i915_private *dev_priv)
Quoted 8 lines
drivers/gpu/drm/i915/intel_uncore.c +1
-1int ret; GEM_BUG_ON(!HAS_GUC(dev_priv)); intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL); - ret = gen6_hw_domain_reset(dev_priv, GEN9_GRDOM_GUC); + ret = gen6_hw_domain_reset(dev_priv, guc_domain); intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL); return ret;
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/8 drm/i915/icl: Handle RPS interrupts correctly for Gen11
In reply to Mika KuoppalaFrom: Oscar Mateo <[email protected]>
Using the new hierarchical interrupt infrastructure.
v2: Rebase
v3: Rebase
--- drivers/gpu/drm/i915/i915_irq.c | 73 ++++++++++++++++++++++++++++++++++------ drivers/gpu/drm/i915/intel_drv.h | 1 + drivers/gpu/drm/i915/intel_pm.c | 6 ++-- 3 files changed, 66 insertions(+), 14 deletions(-)
drivers/gpu/drm/i915/i915_irq.c +62 -11
@@ -308,17 +308,29 @@ void gen5_disable_gt_irq(struct drm_i915_private *dev_priv, uint32_t mask)static i915_reg_t gen6_pm_iir (struct drm_i915_private *dev_priv) { +WARN_ON_ONCE (INTEL_GEN (dev_priv) >=11 ); +return INTEL_GEN (dev_priv) >=8 ?GEN8_GT_IIR (2 ) :GEN6_PMIIR ; }static i915_reg_t gen6_pm_imr (struct drm_i915_private *dev_priv) { -return INTEL_GEN (dev_priv) >=8 ?GEN8_GT_IMR (2 ) :GEN6_PMIMR ; +if (INTEL_GEN (dev_priv) >=11 ) +return GEN11_GPM_WGBOXPERF_INTR_MASK ; +else if (INTEL_GEN (dev_priv) >=8 ) +return GEN8_GT_IMR (2 ); +else +return GEN6_PMIMR ; }static i915_reg_t gen6_pm_ier (struct drm_i915_private *dev_priv) { -return INTEL_GEN (dev_priv) >=8 ?GEN8_GT_IER (2 ) :GEN6_PMIER ; +if (INTEL_GEN (dev_priv) >=11 ) +return GEN11_GPM_WGBOXPERF_INTR_ENABLE ; +else if (INTEL_GEN (dev_priv) >=8 ) +return GEN8_GT_IER (2 ); +else +return GEN6_PMIER ; }/**
@@ -400,6 +412,32 @@ static void gen6_disable_pm_irq(struct drm_i915_private *dev_priv, u32 disable_m/* though a barrier is missing here, but don't really need a one */ } +static u32 +gen11_gt_engine_intr (struct drm_i915_private *const i915, +const unsigned int bank,const unsigned int bit); + +void gen11_reset_rps_interrupts (struct drm_i915_private *dev_priv) +{ +u32 dw; + +spin_lock_irq (&dev_priv->irq_lock); + +/* +* According to the BSpec, DW_IIR bits cannot be cleared without +* first servicing the Selector & Shared IIR registers. +*/ + dw =I915_READ_FW (GEN11_GT_INTR_DW0 ); +while (dw &BIT (GEN11_GTPM )) { +gen11_gt_engine_intr (dev_priv,0 ,GEN11_GTPM ); +I915_WRITE_FW (GEN11_GT_INTR_DW0 ,BIT (GEN11_GTPM )); + dw =I915_READ_FW (GEN11_GT_INTR_DW0 ); + } + + dev_priv->gt_pm.rps.pm_iir =0 ; + +spin_unlock_irq (&dev_priv->irq_lock); +} +void gen6_reset_rps_interrupts (struct drm_i915_private *dev_priv) {spin_lock_irq (&dev_priv->irq_lock);
@@ -415,12 +453,12 @@ void gen6_enable_rps_interrupts(struct drm_i915_private *dev_priv)if (READ_ONCE (rps->interrupts_enabled))return ; -if (WARN_ON_ONCE (IS_GEN11 (dev_priv))) -return ; -spin_lock_irq (&dev_priv->irq_lock);WARN_ON_ONCE (rps->pm_iir); -WARN_ON_ONCE (I915_READ (gen6_pm_iir (dev_priv)) & dev_priv->pm_rps_events); +if (INTEL_GEN (dev_priv) >=11 ) +WARN_ON_ONCE (I915_READ_FW (GEN11_GT_INTR_DW0 ) &BIT (GEN11_GTPM )); +else +WARN_ON_ONCE (I915_READ (gen6_pm_iir (dev_priv)) & dev_priv->pm_rps_events); rps->interrupts_enabled = true;gen6_enable_pm_irq (dev_priv, dev_priv->pm_rps_events);
@@ -434,9 +472,6 @@ void gen6_disable_rps_interrupts(struct drm_i915_private *dev_priv)if (!READ_ONCE (rps->interrupts_enabled))return ; -if (WARN_ON_ONCE (IS_GEN11 (dev_priv))) -return ; -spin_lock_irq (&dev_priv->irq_lock); rps->interrupts_enabled = false;
@@ -453,7 +488,10 @@ void gen6_disable_rps_interrupts(struct drm_i915_private *dev_priv)* state of the worker can be discarded. */ cancel_work_sync (&rps->work); -gen6_reset_rps_interrupts (dev_priv); +if (INTEL_GEN (dev_priv) >=11 ) +gen11_reset_rps_interrupts (dev_priv); +else +gen6_reset_rps_interrupts (dev_priv); }void gen9_reset_guc_interrupts (struct drm_i915_private *dev_priv)
@@ -2750,6 +2788,9 @@ gen11_gt_engine_irq_handler(struct drm_i915_private * const i915,case GEN11_BCS :return gen8_cs_irq_handler (engine[BCS ], iir); + +case GEN11_GTPM : +return gen6_rps_irq_handler (i915, iir); }case 1 :switch (engine_n) {
@@ -3314,6 +3355,9 @@ static void gen11_gt_irq_reset(struct drm_i915_private *dev_priv)I915_WRITE (GEN11_VCS0_VCS1_INTR_MASK , ~0 );I915_WRITE (GEN11_VCS2_VCS3_INTR_MASK , ~0 );I915_WRITE (GEN11_VECS0_VECS1_INTR_MASK , ~0 ); + +I915_WRITE (GEN11_GPM_WGBOXPERF_INTR_ENABLE ,0 ); +I915_WRITE (GEN11_GPM_WGBOXPERF_INTR_MASK , ~0 ); }static void gen11_irq_reset (struct drm_device *dev)
@@ -3852,7 +3896,14 @@ static void gen11_gt_irq_postinstall(struct drm_i915_private *dev_priv)I915_WRITE (GEN11_VCS2_VCS3_INTR_MASK , ~(irqs | irqs <<16 ));I915_WRITE (GEN11_VECS0_VECS1_INTR_MASK , ~(irqs | irqs <<16 )); - dev_priv->pm_imr =0xffffffff ;/* TODO */ +/* +* RPS interrupts will get enabled/disabled on demand when RPS itself +* is enabled/disabled. +*/ + dev_priv->pm_ier =0x0 ; + dev_priv->pm_imr = ~dev_priv->pm_ier; +I915_WRITE (GEN11_GPM_WGBOXPERF_INTR_ENABLE ,0 ); +I915_WRITE (GEN11_GPM_WGBOXPERF_INTR_MASK , ~0 ); }static int gen11_irq_postinstall (struct drm_device *dev)
drivers/gpu/drm/i915/intel_drv.h +1 -0
@@ -1325,6 +1325,7 @@ void gen5_enable_gt_irq(struct drm_i915_private *dev_priv, uint32_t mask);void gen5_disable_gt_irq (struct drm_i915_private *dev_priv,uint32_t mask);void gen6_mask_pm_irq (struct drm_i915_private *dev_priv,u32 mask);void gen6_unmask_pm_irq (struct drm_i915_private *dev_priv,u32 mask); +void gen11_reset_rps_interrupts (struct drm_i915_private *dev_priv);void gen6_reset_rps_interrupts (struct drm_i915_private *dev_priv);void gen6_enable_rps_interrupts (struct drm_i915_private *dev_priv);void gen6_disable_rps_interrupts (struct drm_i915_private *dev_priv);
drivers/gpu/drm/i915/intel_pm.c +3 -3
@@ -8025,10 +8025,10 @@ void intel_sanitize_gt_powersave(struct drm_i915_private *dev_priv) dev_priv->gt_pm.rc6.enabled = true;/* force RC6 disabling */ intel_disable_gt_powersave (dev_priv); -if (INTEL_GEN (dev_priv) <11 ) -gen6_reset_rps_interrupts (dev_priv); +if (INTEL_GEN (dev_priv) >=11 ) +gen11_reset_rps_interrupts (dev_priv);else -WARN_ON_ONCE (1 ); +gen6_reset_rps_interrupts (dev_priv); }static inline void intel_disable_llc_pstate (struct drm_i915_private *i915)
Signature · 6 lines
2.14.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/8 drm/i915/icl: Enable RC6 and RPS in Gen11
In reply to Mika KuoppalaFrom: Oscar Mateo <[email protected]>
AFAICT, once the new interrupt is in place, the rest should behave the same as Gen10.
v2: Update ring frequencies (Sagar)
v3: Rebase.
--- drivers/gpu/drm/i915/i915_debugfs.c | 10 +++++----- drivers/gpu/drm/i915/intel_pm.c | 10 ++++------ 2 files changed, 9 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +5 -5
@@ -1215,20 +1215,20 @@ static int i915_frequency_info(struct seq_file *m, void *unused) max_freq = (IS_GEN9_LP (dev_priv) ? rp_state_cap >>0 : rp_state_cap >>16 ) &0xff ; max_freq *= (IS_GEN9_BC (dev_priv) || -IS_CANNONLAKE (dev_priv) ?GEN9_FREQ_SCALER :1 ); +INTEL_GEN (dev_priv) >=10 ?GEN9_FREQ_SCALER :1 );seq_printf (m,"Lowest (RPN) frequency: %dMHz\n" ,intel_gpu_freq (dev_priv, max_freq)); max_freq = (rp_state_cap &0xff00 ) >>8 ; max_freq *= (IS_GEN9_BC (dev_priv) || -IS_CANNONLAKE (dev_priv) ?GEN9_FREQ_SCALER :1 ); +INTEL_GEN (dev_priv) >=10 ?GEN9_FREQ_SCALER :1 );seq_printf (m,"Nominal (RP1) frequency: %dMHz\n" ,intel_gpu_freq (dev_priv, max_freq)); max_freq = (IS_GEN9_LP (dev_priv) ? rp_state_cap >>16 : rp_state_cap >>0 ) &0xff ; max_freq *= (IS_GEN9_BC (dev_priv) || -IS_CANNONLAKE (dev_priv) ?GEN9_FREQ_SCALER :1 ); +INTEL_GEN (dev_priv) >=10 ?GEN9_FREQ_SCALER :1 );seq_printf (m,"Max non-overclocked (RP0) frequency: %dMHz\n" ,intel_gpu_freq (dev_priv, max_freq)); seq_printf(m, "Max overclocked frequency: %dMHz\n",
@@ -1811,7 +1811,7 @@ static int i915_ring_freq_table(struct seq_file *m, void *unused) min_gpu_freq = rps->min_freq; max_gpu_freq = rps->max_freq; -if (IS_GEN9_BC (dev_priv) ||IS_CANNONLAKE (dev_priv)) { +if (IS_GEN9_BC (dev_priv) ||INTEL_GEN (dev_priv) >=10 ) {/* Convert GT frequency to 50 HZ units */ min_gpu_freq /=GEN9_FREQ_SCALER ; max_gpu_freq /=GEN9_FREQ_SCALER ;
@@ -1827,7 +1827,7 @@ static int i915_ring_freq_table(struct seq_file *m, void *unused)seq_printf (m,"%d\t\t%d\t\t\t\t%d\n" ,intel_gpu_freq (dev_priv, (gpu_freq * (IS_GEN9_BC (dev_priv) || -IS_CANNONLAKE (dev_priv) ? +INTEL_GEN (dev_priv) >=10 ?GEN9_FREQ_SCALER :1 ))), ((ia_freq >>0 ) &0xff ) *100 , ((ia_freq >>8 ) &0xff ) *100 );
drivers/gpu/drm/i915/intel_pm.c +4 -6
@@ -6572,7 +6572,7 @@ static void gen6_init_rps_frequencies(struct drm_i915_private *dev_priv) rps->efficient_freq = rps->rp1_freq;if (IS_HASWELL (dev_priv) ||IS_BROADWELL (dev_priv) || -IS_GEN9_BC (dev_priv) ||IS_CANNONLAKE (dev_priv)) { +IS_GEN9_BC (dev_priv) ||INTEL_GEN (dev_priv) >=10 ) {u32 ddcc_status =0 ; if (sandybridge_pcode_read(dev_priv,
@@ -6585,7 +6585,7 @@ static void gen6_init_rps_frequencies(struct drm_i915_private *dev_priv) rps->max_freq); } -if (IS_GEN9_BC (dev_priv) ||IS_CANNONLAKE (dev_priv)) { +if (IS_GEN9_BC (dev_priv) ||INTEL_GEN (dev_priv) >=10 ) {/* Store the frequency values in 16.66 MHZ units, which is * the natural hardware unit for SKL */
@@ -6920,7 +6920,7 @@ static void gen6_update_ring_freq(struct drm_i915_private *dev_priv) min_gpu_freq = rps->min_freq; max_gpu_freq = rps->max_freq; -if (IS_GEN9_BC (dev_priv) ||IS_CANNONLAKE (dev_priv)) { +if (IS_GEN9_BC (dev_priv) ||INTEL_GEN (dev_priv) >=10 ) {/* Convert GT frequency to 50 HZ units */ min_gpu_freq /=GEN9_FREQ_SCALER ; max_gpu_freq /=GEN9_FREQ_SCALER ;
@@ -6935,7 +6935,7 @@ static void gen6_update_ring_freq(struct drm_i915_private *dev_priv)int diff = max_gpu_freq - gpu_freq;unsigned int ia_freq =0 , ring_freq =0 ; -if (IS_GEN9_BC (dev_priv) ||IS_CANNONLAKE (dev_priv)) { +if (IS_GEN9_BC (dev_priv) ||INTEL_GEN (dev_priv) >=10 ) {/* * ring_freq = 2 * GT. ring_freq is in 100MHz units * No floor required for ring frequency on SKL.
@@ -8141,8 +8141,6 @@ static void intel_enable_rps(struct drm_i915_private *dev_priv)cherryview_enable_rps (dev_priv); }else if (IS_VALLEYVIEW (dev_priv)) {valleyview_enable_rps (dev_priv); - }else if (WARN_ON_ONCE (INTEL_GEN (dev_priv) >=11 )) { -/* TODO */ }else if (INTEL_GEN (dev_priv) >=9 ) {gen9_enable_rps (dev_priv); }else if (IS_BROADWELL (dev_priv)) {
Signature · 6 lines
2.14.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/8 drm/i915/icl: Use hw engine class, instance to find irq handler
In reply to Mika KuoppalaInterrupt identity register we already read from hardware contains engine class and instance fields. Leverage these fields to find correct engine to handle the interrupt.
v3: rebase on top of rps intr
use correct class / instance limits (Michel)
--- drivers/gpu/drm/i915/i915_irq.c | 80 +++++++++++++++-------------------------- drivers/gpu/drm/i915/i915_reg.h | 4 ++- 2 files changed, 31 insertions(+), 53 deletions(-)
drivers/gpu/drm/i915/i915_irq.c +28 -52
@@ -413,8 +413,8 @@ static void gen6_disable_pm_irq(struct drm_i915_private *dev_priv, u32 disable_m }static u32 -gen11_gt_engine_intr (struct drm_i915_private *const i915, -const unsigned int bank,const unsigned int bit); +gen11_gt_engine_identity (struct drm_i915_private *const i915, +const unsigned int bank,const unsigned int bit);void gen11_reset_rps_interrupts (struct drm_i915_private *dev_priv) {
@@ -428,7 +428,7 @@ void gen11_reset_rps_interrupts(struct drm_i915_private *dev_priv)*/ dw =I915_READ_FW (GEN11_GT_INTR_DW0 );while (dw &BIT (GEN11_GTPM )) { -gen11_gt_engine_intr (dev_priv,0 ,GEN11_GTPM ); +gen11_gt_engine_identity (dev_priv,0 ,GEN11_GTPM );I915_WRITE_FW (GEN11_GT_INTR_DW0 ,BIT (GEN11_GTPM )); dw =I915_READ_FW (GEN11_GT_INTR_DW0 ); }
@@ -2771,50 +2771,9 @@ static void __fini_wedge(struct wedge_me *w) (W )->i915; \ __fini_wedge((W))) -static void -gen11_gt_engine_irq_handler (struct drm_i915_private *const i915, -const unsigned int bank, -const unsigned int engine_n, -const u16 iir) -{ -struct intel_engine_cs **const engine = i915->engine; - -switch (bank) { -case 0 : -switch (engine_n) { - -case GEN11_RCS0 : -return gen8_cs_irq_handler (engine[RCS ], iir); - -case GEN11_BCS : -return gen8_cs_irq_handler (engine[BCS ], iir); - -case GEN11_GTPM : -return gen6_rps_irq_handler (i915, iir); - } -case 1 : -switch (engine_n) { - -case GEN11_VCS (0 ): -return gen8_cs_irq_handler (engine[_VCS (0 )], iir); -case GEN11_VCS (1 ): -return gen8_cs_irq_handler (engine[_VCS (1 )], iir); -case GEN11_VCS (2 ): -return gen8_cs_irq_handler (engine[_VCS (2 )], iir); -case GEN11_VCS (3 ): -return gen8_cs_irq_handler (engine[_VCS (3 )], iir); - -case GEN11_VECS (0 ): -return gen8_cs_irq_handler (engine[_VECS (0 )], iir); -case GEN11_VECS (1 ): -return gen8_cs_irq_handler (engine[_VECS (1 )], iir); - } - } -} -static u32 -gen11_gt_engine_intr (struct drm_i915_private *const i915, -const unsigned int bank,const unsigned int bit) +gen11_gt_engine_identity (struct drm_i915_private *const i915, +const unsigned int bank,const unsigned int bit) {void __iomem *const regs = i915->regs;u32 timeout_ts;
@@ -2841,7 +2800,26 @@ gen11_gt_engine_intr(struct drm_i915_private * const i915,raw_reg_write (regs,GEN11_INTR_IDENTITY_REG (bank),GEN11_INTR_DATA_VALID ); -return ident &GEN11_INTR_ENGINE_MASK ; +return ident; +} + +static void +gen11_gt_identity_handler (struct drm_i915_private *const i915, +const u32 identity) +{ +const u8 class =GEN11_INTR_ENGINE_CLASS (identity); +const u8 instance =GEN11_INTR_ENGINE_INSTANCE (identity); +const u16 iir =GEN11_INTR_ENGINE_MASK (identity); + +if (unlikely (!iir)) +return ; + +if (class <=MAX_ENGINE_CLASS && instance <=MAX_ENGINE_INSTANCE ) +return gen8_cs_irq_handler (i915->engine_class[class][instance], + iir); + +if (class ==GEN11_GTPM ) +return gen6_rps_irq_handler (i915, iir); } static void
@@ -2866,12 +2844,10 @@ gen11_gt_irq_handler(struct drm_i915_private * const i915, }for_each_set_bit (bit, &intr_dw,32 ) { -const u16 iir =gen11_gt_engine_intr (i915, bank, bit); - -if (unlikely (!iir)) -continue ; +const u32 ident =gen11_gt_engine_identity (i915, + bank, bit); -gen11_gt_engine_irq_handler (i915, bank, bit, iir); +gen11_gt_identity_handler (i915, ident); }/* Clear must be after shared has been served for engine */
drivers/gpu/drm/i915/i915_reg.h +3 -1
@@ -6826,7 +6826,9 @@ enum {#define GEN11_INTR_IDENTITY_REG0 _MMIO(0x190060)#define GEN11_INTR_IDENTITY_REG1 _MMIO(0x190064)#define GEN11_INTR_DATA_VALID (1 << 31) -#define GEN11_INTR_ENGINE_MASK (0xffff) +#define GEN11_INTR_ENGINE_MASK (x) ((x) & 0xffff) +#define GEN11_INTR_ENGINE_CLASS (x) (((x) & GENMASK(18, 16)) >> 16) +#define GEN11_INTR_ENGINE_INSTANCE (x) (((x) & GENMASK(25, 20)) >> 20)#define GEN11_INTR_IDENTITY_REG (x) _MMIO(0x190060 + (x * 4))
Signature · 6 lines
2.14.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 8/8] drm/i915/icl: Use hw engine class, instance to find irq handler
Quoted 110 lines · Mika Kuoppala
Interrupt identity register we already read from hardware contains engine class and instance fields. Leverage these fields to find correct engine to handle the interrupt.
v3: rebase on top of rps intr
use correct class / instance limits (Michel)Suggested-by Daniele Ceraolo Spurio <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Cc Chris Wilson <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Michel Thierry <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>--- drivers/gpu/drm/i915/i915_irq.c | 80 +++++++++++++++-------------------------- drivers/gpu/drm/i915/i915_reg.h | 4 ++- 2 files changed, 31 insertions(+), 53 deletions(-)drivers/gpu/drm/i915/i915_irq.c +15
-47@@ -413,8 +413,8 @@ static void gen6_disable_pm_irq(struct drm_i915_private *dev_priv, u32 disable_m }static u32 -gen11_gt_engine_intr (struct drm_i915_private *const i915, -const unsigned int bank,const unsigned int bit); +gen11_gt_engine_identity (struct drm_i915_private *const i915, +const unsigned int bank,const unsigned int bit);void gen11_reset_rps_interrupts (struct drm_i915_private *dev_priv) {@@ -428,7 +428,7 @@ void gen11_reset_rps_interrupts(struct drm_i915_private *dev_priv)*/ dw =I915_READ_FW (GEN11_GT_INTR_DW0 );while (dw &BIT (GEN11_GTPM )) { -gen11_gt_engine_intr (dev_priv,0 ,GEN11_GTPM ); +gen11_gt_engine_identity (dev_priv,0 ,GEN11_GTPM );I915_WRITE_FW (GEN11_GT_INTR_DW0 ,BIT (GEN11_GTPM )); dw =I915_READ_FW (GEN11_GT_INTR_DW0 ); }@@ -2771,50 +2771,9 @@ static void __fini_wedge(struct wedge_me *w) (W )->i915; \ __fini_wedge((W))) -static void -gen11_gt_engine_irq_handler (struct drm_i915_private *const i915, -const unsigned int bank, -const unsigned int engine_n, -const u16 iir) -{ -struct intel_engine_cs **const engine = i915->engine; - -switch (bank) { -case 0 : -switch (engine_n) { - -case GEN11_RCS0 : -return gen8_cs_irq_handler (engine[RCS ], iir); - -case GEN11_BCS : -return gen8_cs_irq_handler (engine[BCS ], iir); - -case GEN11_GTPM : -return gen6_rps_irq_handler (i915, iir); - } -case 1 : -switch (engine_n) { - -case GEN11_VCS (0 ): -return gen8_cs_irq_handler (engine[_VCS (0 )], iir); -case GEN11_VCS (1 ): -return gen8_cs_irq_handler (engine[_VCS (1 )], iir); -case GEN11_VCS (2 ): -return gen8_cs_irq_handler (engine[_VCS (2 )], iir); -case GEN11_VCS (3 ): -return gen8_cs_irq_handler (engine[_VCS (3 )], iir); - -case GEN11_VECS (0 ): -return gen8_cs_irq_handler (engine[_VECS (0 )], iir); -case GEN11_VECS (1 ): -return gen8_cs_irq_handler (engine[_VECS (1 )], iir); - } - } -} -static u32 -gen11_gt_engine_intr (struct drm_i915_private *const i915, -const unsigned int bank,const unsigned int bit) +gen11_gt_engine_identity (struct drm_i915_private *const i915, +const unsigned int bank,const unsigned int bit) {void __iomem *const regs = i915->regs;u32 timeout_ts;@@ -2841,7 +2800,26 @@ gen11_gt_engine_intr(struct drm_i915_private * const i915,raw_reg_write (regs,GEN11_INTR_IDENTITY_REG (bank),GEN11_INTR_DATA_VALID ); -return ident &GEN11_INTR_ENGINE_MASK ; +return ident; +} + +static void +gen11_gt_identity_handler (struct drm_i915_private *const i915, +const u32 identity) +{ +const u8 class =GEN11_INTR_ENGINE_CLASS (identity); +const u8 instance =GEN11_INTR_ENGINE_INSTANCE (identity); +const u16 iir =GEN11_INTR_ENGINE_MASK (identity);
drivers/gpu/drm/i915/i915_irq.c gen11_gt_engine_intr(struct drm_i915_private * const i915, · line 2822
Quoted 10 lines
drivers/gpu/drm/i915/i915_irq.c +10
-0+ +if (unlikely (!iir)) +return ; + +if (class <=MAX_ENGINE_CLASS && instance <=MAX_ENGINE_INSTANCE ) +return gen8_cs_irq_handler (i915->engine_class[class][instance], + iir); + +if (class ==GEN11_GTPM ) +return gen6_rps_irq_handler (i915, iir);
Hi,
GEN11_GTPM should be
[Class ID] == 'OTHER_CLASS (4)', and [Engine Id] == 1.
(I'm looking at bspec 20944)
So not only the GPTM check needs to be before the
if (class <= MAX_ENGINE_CLASS),
but it can't use GEN11_GTPM either.
-Michel
Quoted 25 lines
drivers/gpu/drm/i915/i915_irq.c +3
-5} static void@@ -2866,12 +2844,10 @@ gen11_gt_irq_handler(struct drm_i915_private * const i915, }for_each_set_bit (bit, &intr_dw,32 ) { -const u16 iir =gen11_gt_engine_intr (i915, bank, bit); - -if (unlikely (!iir)) -continue ; +const u32 ident =gen11_gt_engine_identity (i915, + bank, bit); -gen11_gt_engine_irq_handler (i915, bank, bit, iir); +gen11_gt_identity_handler (i915, ident); }/* Clear must be after shared has been served for engine */ drivers/gpu/drm/i915/i915_reg.h +0
-0
drivers/gpu/drm/i915/i915_reg.h enum { · line 6834
Quoted 10 lines
drivers/gpu/drm/i915/i915_reg.h +3
-1@@ -6826,7 +6826,9 @@ enum {#define GEN11_INTR_IDENTITY_REG0 _MMIO(0x190060)#define GEN11_INTR_IDENTITY_REG1 _MMIO(0x190064)#define GEN11_INTR_DATA_VALID (1 << 31) -#define GEN11_INTR_ENGINE_MASK (0xffff) +#define GEN11_INTR_ENGINE_MASK (x) ((x) & 0xffff) +#define GEN11_INTR_ENGINE_CLASS (x) (((x) & GENMASK(18, 16)) >> 16) +#define GEN11_INTR_ENGINE_INSTANCE (x) (((x) & GENMASK(25, 20)) >> 20)#define GEN11_INTR_IDENTITY_REG (x) _MMIO(0x190060 + (x * 4))
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 8/8] drm/i915/icl: Use hw engine class, instance to find irq handler
Quoted 129 lines · Michel Thierry
Quoted 110 lines · Mika Kuoppala
Interrupt identity register we already read from hardware contains engine class and instance fields. Leverage these fields to find correct engine to handle the interrupt.
v3: rebase on top of rps intr
use correct class / instance limits (Michel)Suggested-by Daniele Ceraolo Spurio <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Cc Chris Wilson <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Michel Thierry <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>---
drivers/gpu/drm/i915/i915_irq.c| 80
+++++++++++++++--------------------------
drivers/gpu/drm/i915/i915_reg.h| 4 ++-2 files changed, 31 insertions(+), 53 deletions(-)drivers/gpu/drm/i915/i915_irq.c +0
-0@@ -413,8 +413,8 @@ static void gen6_disable_pm_irq(struct
drm_i915_private*dev_priv, u32disable_m
}
static u32drivers/gpu/drm/i915/i915_irq.c +2
-2-gen11_gt_engine_intr(struct drm_i915_private * const i915, - const unsigned int bank, const unsigned int bit); +gen11_gt_engine_identity(struct drm_i915_private * const i915, + const unsigned int bank, const unsigned int bit);void
gen11_reset_rps_interrupts(struct drm_i915_private *dev_priv){drivers/gpu/drm/i915/i915_irq.c +1
-1@@ -428,7 +428,7 @@ void gen11_reset_rps_interrupts(structdrm_i915_private *dev_priv) */ dw = I915_READ_FW(GEN11_GT_INTR_DW0); while (dw & BIT(GEN11_GTPM)) { - gen11_gt_engine_intr(dev_priv, 0, GEN11_GTPM); + gen11_gt_engine_identity(dev_priv, 0, GEN11_GTPM); I915_WRITE_FW(GEN11_GT_INTR_DW0, BIT(GEN11_GTPM)); dw = I915_READ_FW(GEN11_GT_INTR_DW0);}
drivers/gpu/drm/i915/i915_irq.c +0
-41@@ -2771,50 +2771,9 @@ static void __fini_wedge(struct wedge_me *w) (W)->i915; \ __fini_wedge((W))) -static void -gen11_gt_engine_irq_handler (struct drm_i915_private *const i915, - const unsigned int bank, - const unsigned int engine_n, - const u16 iir) -{ - struct intel_engine_cs ** const engine = i915->engine; - - switch (bank) { - case 0: - switch (engine_n) { - - case GEN11_RCS0: - return gen8_cs_irq_handler(engine[RCS], iir); - - case GEN11_BCS: - return gen8_cs_irq_handler(engine[BCS], iir); - - case GEN11_GTPM: - return gen6_rps_irq_handler(i915, iir); - } - case 1: - switch (engine_n) { - - case GEN11_VCS(0): - return gen8_cs_irq_handler(engine[_VCS(0)], iir); - case GEN11_VCS(1): - return gen8_cs_irq_handler(engine[_VCS(1)], iir); - case GEN11_VCS(2): - return gen8_cs_irq_handler(engine[_VCS(2)], iir); - case GEN11_VCS(3): - return gen8_cs_irq_handler(engine[_VCS(3)], iir); - - case GEN11_VECS(0): - return gen8_cs_irq_handler(engine[_VECS(0)], iir); - case GEN11_VECS(1): - return gen8_cs_irq_handler(engine[_VECS(1)], iir); - } - } -} -static u32
drivers/gpu/drm/i915/i915_irq.c +2
-2-gen11_gt_engine_intr(struct drm_i915_private * const i915, - const unsigned int bank, const unsigned int bit) +gen11_gt_engine_identity(struct drm_i915_private * const i915, + const unsigned int bank, const unsigned int bit){
void__iomem* const regs =i915->regs;
u32timeout_ts;drivers/gpu/drm/i915/i915_irq.c +10
-1@@ -2841,7 +2800,26 @@ gen11_gt_engine_intr(struct drm_i915_private * const i915, raw_reg_write(regs, GEN11_INTR_IDENTITY_REG(bank), GEN11_INTR_DATA_VALID); - return ident & GEN11_INTR_ENGINE_MASK; + return ident; +} + +static void +gen11_gt_identity_handler (struct drm_i915_private *const i915, + const u32 identity) +{ + const u8 class = GEN11_INTR_ENGINE_CLASS(identity); + const u8 instance = GEN11_INTR_ENGINE_INSTANCE(identity); + const u16 iir = GEN11_INTR_ENGINE_MASK(identity);drivers/gpu/drm/i915/i915_irq.c gen11_gt_engine_intr(struct drm_i915_private * · line 2822
Quoted 10 lines
drivers/gpu/drm/i915/i915_irq.c +10
-0+ + if (unlikely(!iir)) + return; + + if (class <= MAX_ENGINE_CLASS && instance <= MAX_ENGINE_INSTANCE) + return gen8_cs_irq_handler(i915->engine_class[class][instance], + iir); + + if (class == GEN11_GTPM) + return gen6_rps_irq_handler(i915, iir);Hi,
GEN11_GTPMshould be
[Class ID] == 'OTHER_CLASS(4)', and
[Engine Id] == 1.
(I'm looking at bspec 20944)
Quoted 7 lines
So not only the GPTM check needs to be before the
if (class <=MAX_ENGINE_CLASS),but it can't use
GEN11_GTPMeither.-Michel
I'm not fully convinced about checking against MAX_ENGINE_CLASS or MAX_ENGINE_INSTANCE, since we do have cases that are within those values but are still invalid (e.g. VCS1). Maybe we can just do something simpler (that should still be safe) like:
/* OTHER_CLASS is for interrupts not comings from an engine */
if (class != OTHER_CLASS) {
engine = i915->engine_class[class][instance];
if (likely(engine))
return gen8_cs_irq_handler(...);
} else {
if (instance == 1)
return gen6_rps_irq_handler(...);
/* more cases incoming (e.g. GuC) */
}Quoted 24 lines
Quoted 24 lines
drivers/gpu/drm/i915/i915_irq.c +0
-0}static void
drivers/gpu/drm/i915/i915_irq.c +3
-5@@ -2866,12 +2844,10 @@ gen11_gt_irq_handler(struct drm_i915_private * const i915, } for_each_set_bit(bit, &intr_dw, 32) { - const u16 iir = gen11_gt_engine_intr(i915, bank, bit); - - if (unlikely(!iir)) - continue; + const u32 ident = gen11_gt_engine_identity(i915, + bank, bit); - gen11_gt_engine_irq_handler(i915, bank, bit, iir); + gen11_gt_identity_handler(i915, ident); } /* Clear must be after shared has been served for engine */drivers/gpu/drm/i915/i915_reg.h +0
-0@@ -6826,7 +6826,9 @@ enum { #define GEN11_INTR_IDENTITY_REG0 _MMIO(0x190060) #define GEN11_INTR_IDENTITY_REG1 _MMIO(0x190064)
Quoted 8 lines
drivers/gpu/drm/i915/i915_reg.h enum { · line 6834
Quoted 8 lines
drivers/gpu/drm/i915/i915_reg.h +3
-1#define GEN11_INTR_DATA_VALID (1 << 31) -#define GEN11_INTR_ENGINE_MASK (0xffff) +#define GEN11_INTR_ENGINE_MASK(x) ((x) & 0xffff) +#define GEN11_INTR_ENGINE_CLASS(x) (((x) & GENMASK(18, 16)) >> 16) +#define GEN11_INTR_ENGINE_INSTANCE(x) (((x) & GENMASK(25, 20)) >> 20) #define GEN11_INTR_IDENTITY_REG(x) _MMIO(0x190060 + (x * 4))
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 8/8] drm/i915/icl: Use hw engine class, instance to find irq handler
Quoted 135 lines · Daniele Ceraolo Spurio
Quoted 132 lines · Michel Thierry
Quoted 110 lines · Mika Kuoppala
Interrupt identity register we already read from hardware contains engine class and instance fields. Leverage these fields to find correct engine to handle the interrupt.
v3: rebase on top of rps intr
use correct class / instance limits (Michel)Suggested-by Daniele Ceraolo Spurio <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Cc Chris Wilson <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Michel Thierry <[email protected]>Signed-off-by Mika Kuoppala <[email protected]>---
drivers/gpu/drm/i915/i915_irq.c| 80
+++++++++++++++--------------------------
drivers/gpu/drm/i915/i915_reg.h| 4 ++-2 files changed, 31 insertions(+), 53 deletions(-)drivers/gpu/drm/i915/i915_irq.c +0
-0@@ -413,8 +413,8 @@ static void gen6_disable_pm_irq(struct
drm_i915_private*dev_priv, u32disable_m
}
static u32drivers/gpu/drm/i915/i915_irq.c +2
-2-gen11_gt_engine_intr(struct drm_i915_private * const i915, - const unsigned int bank, const unsigned int bit); +gen11_gt_engine_identity(struct drm_i915_private * const i915, + const unsigned int bank, const unsigned int bit);void
gen11_reset_rps_interrupts(struct drm_i915_private *dev_priv){drivers/gpu/drm/i915/i915_irq.c +1
-1@@ -428,7 +428,7 @@ void gen11_reset_rps_interrupts(structdrm_i915_private *dev_priv) */ dw = I915_READ_FW(GEN11_GT_INTR_DW0); while (dw & BIT(GEN11_GTPM)) { - gen11_gt_engine_intr(dev_priv, 0, GEN11_GTPM); + gen11_gt_engine_identity(dev_priv, 0, GEN11_GTPM); I915_WRITE_FW(GEN11_GT_INTR_DW0, BIT(GEN11_GTPM)); dw = I915_READ_FW(GEN11_GT_INTR_DW0);}
drivers/gpu/drm/i915/i915_irq.c +0
-41@@ -2771,50 +2771,9 @@ static void __fini_wedge(struct wedge_me *w) (W)->i915; \ __fini_wedge((W))) -static void -gen11_gt_engine_irq_handler (struct drm_i915_private *const i915, - const unsigned int bank, - const unsigned int engine_n, - const u16 iir) -{ - struct intel_engine_cs ** const engine = i915->engine; - - switch (bank) { - case 0: - switch (engine_n) { - - case GEN11_RCS0: - return gen8_cs_irq_handler(engine[RCS], iir); - - case GEN11_BCS: - return gen8_cs_irq_handler(engine[BCS], iir); - - case GEN11_GTPM: - return gen6_rps_irq_handler(i915, iir); - } - case 1: - switch (engine_n) { - - case GEN11_VCS(0): - return gen8_cs_irq_handler(engine[_VCS(0)], iir); - case GEN11_VCS(1): - return gen8_cs_irq_handler(engine[_VCS(1)], iir); - case GEN11_VCS(2): - return gen8_cs_irq_handler(engine[_VCS(2)], iir); - case GEN11_VCS(3): - return gen8_cs_irq_handler(engine[_VCS(3)], iir); - - case GEN11_VECS(0): - return gen8_cs_irq_handler(engine[_VECS(0)], iir); - case GEN11_VECS(1): - return gen8_cs_irq_handler(engine[_VECS(1)], iir); - } - } -} -static u32
drivers/gpu/drm/i915/i915_irq.c +2
-2-gen11_gt_engine_intr(struct drm_i915_private * const i915, - const unsigned int bank, const unsigned int bit) +gen11_gt_engine_identity(struct drm_i915_private * const i915, + const unsigned int bank, const unsigned int bit){
void__iomem* const regs =i915->regs;
u32timeout_ts;drivers/gpu/drm/i915/i915_irq.c +10
-1@@ -2841,7 +2800,26 @@ gen11_gt_engine_intr(struct drm_i915_private * const i915, raw_reg_write(regs, GEN11_INTR_IDENTITY_REG(bank), GEN11_INTR_DATA_VALID); - return ident & GEN11_INTR_ENGINE_MASK; + return ident; +} + +static void +gen11_gt_identity_handler (struct drm_i915_private *const i915, + const u32 identity) +{ + const u8 class = GEN11_INTR_ENGINE_CLASS(identity); + const u8 instance = GEN11_INTR_ENGINE_INSTANCE(identity); + const u16 iir = GEN11_INTR_ENGINE_MASK(identity);drivers/gpu/drm/i915/i915_irq.c gen11_gt_engine_intr(struct drm_i915_private * · line 2822
Quoted 10 lines
drivers/gpu/drm/i915/i915_irq.c +10
-0+ + if (unlikely(!iir)) + return; + + if (class <= MAX_ENGINE_CLASS && instance <= MAX_ENGINE_INSTANCE) + return gen8_cs_irq_handler(i915->engine_class[class][instance], + iir); + + if (class == GEN11_GTPM) + return gen6_rps_irq_handler(i915, iir);Hi,
GEN11_GTPMshould be
[Class ID] == 'OTHER_CLASS(4)', and
[Engine Id] == 1.
(I'm looking at bspec 20944)So not only the GPTM check needs to be before the
if (class <=MAX_ENGINE_CLASS),
Quoted 7 lines
Quoted 4 lines
but it can't use
GEN11_GTPMeither.-Michel
I'm not fully convinced about checking against
MAX_ENGINE_CLASSorMAX_ENGINE_INSTANCE, since we do have cases that are within those values but are still invalid (e.g. VCS1). Maybe we can just do something simpler (that should still be safe) like:
Thinking about this again you were right, we do need a check for MAX_ENGINE_CLASS and MAX_ENGINE_INSTANCE to avoid overflowing the engine_class array. However, while the MAX_ENGINE_CLASS check applies to all cases, the MAX_ENGINE_INSTANCE one only applies for class != OTHER_CLASS, so we may need to split them accordingly.
Daniele
Quoted 41 lines
/*
OTHER_CLASSis for interrupts not comings from an engine */ if (class !=OTHER_CLASS) {
engine = i915->engine_class[class][instance]; if (likely(engine))
returngen8_cs_irq_handler(...);
} else {
if (instance == 1)
returngen6_rps_irq_handler(...);/* more cases incoming (e.g. GuC) */
}Quoted 29 lines
Quoted 29 lines
drivers/gpu/drm/i915/i915_irq.c +0
-0}static void
drivers/gpu/drm/i915/i915_irq.c +3
-5@@ -2866,12 +2844,10 @@ gen11_gt_irq_handler(struct drm_i915_private * const i915, } for_each_set_bit(bit, &intr_dw, 32) { - const u16 iir = gen11_gt_engine_intr(i915, bank, bit); - - if (unlikely(!iir)) - continue; + const u32 ident = gen11_gt_engine_identity(i915, + bank, bit); - gen11_gt_engine_irq_handler(i915, bank, bit, iir); + gen11_gt_identity_handler(i915, ident); } /* Clear must be after shared has been served for engine */drivers/gpu/drm/i915/i915_reg.h +3
-1@@ -6826,7 +6826,9 @@ enum { #define GEN11_INTR_IDENTITY_REG0 _MMIO(0x190060) #define GEN11_INTR_IDENTITY_REG1 _MMIO(0x190064) #define GEN11_INTR_DATA_VALID (1 << 31) -#define GEN11_INTR_ENGINE_MASK (0xffff) +#define GEN11_INTR_ENGINE_MASK(x) ((x) & 0xffff) +#define GEN11_INTR_ENGINE_CLASS(x) (((x) & GENMASK(18, 16)) >> 16) +#define GEN11_INTR_ENGINE_INSTANCE(x) (((x) & GENMASK(25, 20))
Quoted 7 lines
Quoted 3 lines
drivers/gpu/drm/i915/i915_reg.h enum { · line 6834
Quoted 3 lines
drivers/gpu/drm/i915/i915_reg.h +0
-0>> 20) #define GEN11_INTR_IDENTITY_REG(x) _MMIO(0x190060 + (x * 4))_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
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/8] drm/i915/icl: Check for fused-off VDBOX and VEBOX instances (rev2)
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: series starting with [1/8] drm/i915/icl: Check for fused-off VDBOX and VEBOX instances (rev2)
URL : https://patchwork.freedesktop.org/series/40093/
State : success
== Summary ==
Series 40093v2 series starting with [1/8] drm/i915/icl: Check for fused-off VDBOX and VEBOX instances
https://patchwork.freedesktop.org/api/1.0/series/40093/revisions/2/mbox/
---- Known issues:
Test gem_exec_suspend:
Subgroup basic-s3:
incomplete -> PASS (fi-cnl-y3) fdo#105086
Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
fail -> PASS (fi-gdg-551) fdo#102575
Test kms_flip:
Subgroup basic-flip-vs-wf_vblank:
pass -> FAIL (fi-cfl-s2) fdo#100368
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
incomplete -> PASS (fi-snb-2520m) fdo#103713
Subgroup suspend-read-crc-pipe-c:
pass -> INCOMPLETE (fi-bxt-dsi) fdo#103927fdo#105086 https://bugs.freedesktop.org/show_bug.cgi?id=105086
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fi-bdw-5557u total:285 pass:264 dwarn:0 dfail:0 fail:0 skip:21 time:431s fi-bdw-gvtdvm total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:441s fi-blb-e6850 total:285 pass:220 dwarn:1 dfail:0 fail:0 skip:64 time:380s fi-bsw-n3050 total:285 pass:239 dwarn:0 dfail:0 fail:0 skip:46 time:539s fi-bwr-2160 total:285 pass:180 dwarn:0 dfail:0 fail:0 skip:105 time:296s fi-bxt-dsi total:243 pass:216 dwarn:0 dfail:0 fail:0 skip:26 fi-bxt-j4205 total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:512s fi-byt-j1900 total:285 pass:250 dwarn:0 dfail:0 fail:0 skip:35 time:515s fi-byt-n2820 total:285 pass:246 dwarn:0 dfail:0 fail:0 skip:39 time:510s fi-cfl-8700k total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:410s fi-cfl-s2 total:285 pass:258 dwarn:0 dfail:0 fail:1 skip:26 time:574s fi-cfl-u total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:512s fi-cnl-drrs total:285 pass:254 dwarn:3 dfail:0 fail:0 skip:28 time:525s fi-cnl-y3 total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:586s fi-elk-e7500 total:285 pass:225 dwarn:1 dfail:0 fail:0 skip:59 time:430s fi-gdg-551 total:285 pass:177 dwarn:0 dfail:0 fail:0 skip:108 time:315s fi-glk-1 total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:537s fi-hsw-4770 total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:402s fi-ilk-650 total:285 pass:225 dwarn:0 dfail:0 fail:0 skip:60 time:418s fi-ivb-3520m total:285 pass:256 dwarn:0 dfail:0 fail:0 skip:29 time:467s fi-ivb-3770 total:285 pass:252 dwarn:0 dfail:0 fail:0 skip:33 time:426s fi-kbl-7500u total:285 pass:260 dwarn:1 dfail:0 fail:0 skip:24 time:479s fi-kbl-7567u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:470s fi-kbl-r total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:513s fi-pnv-d510 total:285 pass:219 dwarn:1 dfail:0 fail:0 skip:65 time:653s fi-skl-6260u total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:442s fi-skl-6600u total:285 pass:258 dwarn:0 dfail:0 fail:0 skip:27 time:535s fi-skl-6700hq total:285 pass:259 dwarn:0 dfail:0 fail:0 skip:26 time:541s fi-skl-6700k2 total:285 pass:261 dwarn:0 dfail:0 fail:0 skip:24 time:502s fi-skl-6770hq total:285 pass:265 dwarn:0 dfail:0 fail:0 skip:20 time:498s fi-skl-guc total:285 pass:257 dwarn:0 dfail:0 fail:0 skip:28 time:430s fi-skl-gvtdvm total:285 pass:262 dwarn:0 dfail:0 fail:0 skip:23 time:445s fi-snb-2520m total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:571s fi-snb-2600 total:285 pass:245 dwarn:0 dfail:0 fail:0 skip:40 time:398s
b8d045232d3b836e7a203cda08a1bd3353658b5b drm-tip: 2018y-03m-16d-12h-56m-11s UTC integration manifest 8a3e383e6156 drm/i915/icl: Use hw engine class, instance to find irq handler 3bbfd755c401 drm/i915/icl: Enable RC6 and RPS in Gen114cb245e55bce drm/i915/icl: Handle RPS interrupts correctly for Gen11ea4b36ea4c40 drm/i915/icl: Add reset control register changesaeef5a6bb95f drm/i915/icl: Added ICL 11 slice, subslice and EU fuse detection 862027777456 drm/i915/icl: Update subslice define for ICL 119b6257a28af3 drm/i915/icl: Enable the extra video decode and enhancement boxes for Icelake 11 4e674c6f5ff5 drm/i915/icl: Check for fused-off VDBOX and VEBOX instances
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8374/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for series starting with [1/8] drm/i915/icl: Check for fused-off VDBOX and VEBOX instances (rev2)
In reply to Mika Kuoppala== Series Details ==
== Series Details ==
Series: series starting with [1/8] drm/i915/icl: Check for fused-off VDBOX and VEBOX instances (rev2)
URL : https://patchwork.freedesktop.org/series/40093/
State : success
== Summary ==
---- Possible new issues:
Test gem_fenced_exec_thrash:
Subgroup 2-spare-fences:
dmesg-warn -> PASS (shard-hsw)
Test kms_busy:
Subgroup basic-modeset-a:
dmesg-warn -> PASS (shard-hsw)---- Known issues:
Test kms_flip:
Subgroup 2x-plain-flip-fb-recreate-interruptible:
fail -> PASS (shard-hsw) fdo#100368
Test kms_rotation_crc:
Subgroup sprite-rotation-180:
fail -> PASS (shard-hsw) fdo#105185
Test prime_vgem:
Subgroup basic-fence-flip:
fail -> PASS (shard-apl) fdo#104008fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#105185 https://bugs.freedesktop.org/show_bug.cgi?id=105185
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
shard-apl total:3442 pass:1814 dwarn:1 dfail:0 fail:7 skip:1619 time:13092s shard-hsw total:3442 pass:1768 dwarn:1 dfail:0 fail:1 skip:1671 time:11920s shard-snb total:3442 pass:1355 dwarn:1 dfail:0 fail:4 skip:2081 time:7228s
Blacklisted hosts:
shard-kbl total:3442 pass:1939 dwarn:1 dfail:0 fail:9 skip:1493 time:9916s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8374/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 53 lines · Mika Kuoppala
From: Oscar Mateo <[email protected]>
In Gen11, the Video Decode engines (aka VDBOX, aka VCS, aka BSD) and the Video Enhancement engines (aka VEBOX, aka VECS) could be fused off. Also, each VDBOX and VEBOX has its own power well, which only exist if the related engine exists in the HW.
Unfortunately, we have a Catch-22 situation going on: we need the blitter forcewake to read the register with the fuse info, but we cannot initialize the forcewake domains without knowin about the engines present in the HW. We workaround this problem by allowing the initialization of all forcewake domains and then pruning the fused off ones, as per the fuse information.
Bspec: 20680
v2: We were shifting incorrectly for vebox disable (Vinay)
v3: Assert mmio is ready and warn if we have attempted to initialize
forcewake for fused-off engines (Paulo)v4:
- UseINTEL_GENin new code (Tvrtko)
- Shorter local variable (Tvrtko, Michal)
- Keep "if (!...) continue" style (Tvrtko)
- No unnecessaryBUG_ON(Tvrtko)
-WARN_ONand cleanup if wrong mask (Tvrtko, Michal)
- UseI915_READ_FW(Michal)
- Use I915_MAX_VCS/VECS macros (Michal)v5: Rebased by Rodrigo fixing conflicts on top of:
commit 33def1ff7b0 ("drm/i915: Simplify intel_engines_init")v6: Fix v5. Remove
info->num_rings. (by Oscar)v7: Rebase (Rodrigo).
v8:
- s/intel_device_info_fused_off_engines/intel_device_info_init_mmio (Chris)
- Makevdbox_disable&vebox_disablelocal variables (Chris)v9:
- Move function declaration tointel_device_info.h(Michal)
- Missing indent in bit fields definitions (Michal)
- When RC6 is enabled by BIOS, the fuse register cannot be read until the blitter powerwell is awake. Shuffle where the fuse is read, prune the forcewake domains after the fact and change the commit message accordingly (Vinay, Sagar, Chris).v10:
- Improved commit message (Sagar)
- New line in header file (Sagar)
- Specify the message infw_domain_resetapplies to ICL+ (Sagar)
Quoted 9 lines
Cc Paulo Zanoni <[email protected]>Cc Vinay Belgaumkar <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Michal Wajdeczko <[email protected]>Cc Chris Wilson <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Cc Sagar Arun Kamble <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>Signed-off-by Oscar Mateo <[email protected]>
Quoted 201 lines
--- drivers/gpu/drm/i915/i915_drv.c | 4 +++ drivers/gpu/drm/i915/i915_reg.h | 5 +++ drivers/gpu/drm/i915/intel_device_info.c | 47 +++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_device_info.h | 2 ++ drivers/gpu/drm/i915/intel_uncore.c | 56 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uncore.h | 1 + 6 files changed, 115 insertions(+)drivers/gpu/drm/i915/i915_drv.c +4
-0@@ -1033,6 +1033,10 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)intel_uncore_init (dev_priv); +intel_device_info_init_mmio (dev_priv); + +intel_uncore_prune (dev_priv); +intel_uc_init_mmio (dev_priv); ret =intel_engines_init_mmio (dev_priv);drivers/gpu/drm/i915/i915_reg.h +5
-0@@ -2545,6 +2545,11 @@ enum i915_power_well_id {#define GEN10_EU_DISABLE3 _MMIO(0x9140)#define GEN10_EU_DIS_SS_MASK 0xff +#define GEN11_GT_VEBOX_VDBOX_DISABLE _MMIO(0x9140) +#define GEN11_GT_VDBOX_DISABLE_MASK 0xff +#define GEN11_GT_VEBOX_DISABLE_SHIFT 16 +#define GEN11_GT_VEBOX_DISABLE_MASK (0xff << GEN11_GT_VEBOX_DISABLE_SHIFT) +#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 +47
-0@@ -780,3 +780,50 @@ void intel_driver_caps_print(const struct intel_driver_caps *caps, {drm_printf (p,"scheduler: %x\n" , caps->scheduler); } + +/* +* Determine which engines are fused off in our particular hardware. Since the +* fuse register is in the blitter powerwell, we need forcewake to be ready at +* this point (but later we need to prune the forcewake domains for engines that +* are indeed fused off). +*/ +void intel_device_info_init_mmio (struct drm_i915_private *dev_priv) +{ +struct intel_device_info *info =mkwrite_device_info (dev_priv); +u8 vdbox_disable, vebox_disable; +u32 media_fuse; +int i; + +if (INTEL_GEN (dev_priv) <11 ) +return ; + + media_fuse =I915_READ (GEN11_GT_VEBOX_VDBOX_DISABLE ); + + vdbox_disable = media_fuse &GEN11_GT_VDBOX_DISABLE_MASK ; + vebox_disable = (media_fuse &GEN11_GT_VEBOX_DISABLE_MASK ) >> +GEN11_GT_VEBOX_DISABLE_SHIFT ; + +DRM_DEBUG_DRIVER ("vdbox disable: %04x\n" , vdbox_disable); +for (i =0 ; i <I915_MAX_VCS ; i++) { +if (!HAS_ENGINE (dev_priv,_VCS (i))) +continue ; + +if (!(BIT (i) & vdbox_disable)) +continue ; + + info->ring_mask &= ~ENGINE_MASK (_VCS (i)); +DRM_DEBUG_DRIVER ("vcs%u fused off\n" , i); + } + +DRM_DEBUG_DRIVER ("vebox disable: %04x\n" , vebox_disable); +for (i =0 ; i <I915_MAX_VECS ; i++) { +if (!HAS_ENGINE (dev_priv,_VECS (i))) +continue ; + +if (!(BIT (i) & vebox_disable)) +continue ; + + info->ring_mask &= ~ENGINE_MASK (_VECS (i)); +DRM_DEBUG_DRIVER ("vecs%u fused off\n" , i); + } +}drivers/gpu/drm/i915/intel_device_info.h +2
-0@@ -247,6 +247,8 @@ void intel_device_info_dump_runtime(const struct intel_device_info *info,void intel_device_info_dump_topology (const struct sseu_dev_info *sseu,struct drm_printer *p); +void intel_device_info_init_mmio (struct drm_i915_private *dev_priv); +void intel_driver_caps_print (const struct intel_driver_caps *caps,struct drm_printer *p);drivers/gpu/drm/i915/intel_uncore.c +56
-0@@ -62,6 +62,11 @@ static inline void fw_domain_reset(struct drm_i915_private *i915, const struct intel_uncore_forcewake_domain *d) { +/* +* We don't really know if the powerwell for the forcewake domain we are +* trying to reset here does exist at this point (engines could be fused +* off in ICL+), so no waiting for acks +*/ __raw_i915_write32(i915, d->reg_set, i915->uncore.fw_reset); }@@ -1353,6 +1358,23 @@ static void fw_domain_init(struct drm_i915_private *dev_priv,fw_domain_reset (dev_priv, d); } +static void fw_domain_fini (struct drm_i915_private *dev_priv, +enum forcewake_domain_id domain_id) +{ +struct intel_uncore_forcewake_domain *d; + +if (WARN_ON (domain_id >=FW_DOMAIN_ID_COUNT )) +return ; + + d = &dev_priv->uncore.fw_domain[domain_id]; + +WARN_ON (d->wake_count); +WARN_ON (hrtimer_cancel (&d->timer)); +memset (d,0 ,sizeof (*d)); + + dev_priv->uncore.fw_domains &= ~BIT (domain_id); +} +static void intel_uncore_fw_domains_init (struct drm_i915_private *dev_priv) {if (INTEL_GEN (dev_priv) <=5 ||intel_vgpu_active (dev_priv))@@ -1565,6 +1587,40 @@ void intel_uncore_init(struct drm_i915_private *dev_priv) &dev_priv->uncore.pmic_bus_access_nb); } +/* +* We might have detected that some engines are fused off after we initialized +* the forcewake domains. Prune them, to make sure they only reference existing +* engines. +*/ +void intel_uncore_prune (struct drm_i915_private *dev_priv) +{ +if (INTEL_GEN (dev_priv) >=11 ) { +enum forcewake_domains fw_domains = dev_priv->uncore.fw_domains; +enum forcewake_domain_id domain_id; +int i; + +for (i =0 ; i <I915_MAX_VCS ; i++) { + domain_id =FW_DOMAIN_ID_MEDIA_VDBOX0 + i; + +if (HAS_ENGINE (dev_priv,_VCS (i))) +continue ; + +if (fw_domains &BIT (domain_id)) +fw_domain_fini (dev_priv, domain_id); + } + +for (i =0 ; i <I915_MAX_VECS ; i++) { + domain_id =FW_DOMAIN_ID_MEDIA_VEBOX0 + i; + +if (HAS_ENGINE (dev_priv,_VECS (i))) +continue ; + +if (fw_domains &BIT (domain_id)) +fw_domain_fini (dev_priv, domain_id); + } + } +} +void intel_uncore_fini (struct drm_i915_private *dev_priv) {/* Paranoia: make sure we have disabled everything before we exit. */ drivers/gpu/drm/i915/intel_uncore.h +1
-0@@ -140,6 +140,7 @@ struct intel_uncore {void intel_uncore_sanitize (struct drm_i915_private *dev_priv);void intel_uncore_init (struct drm_i915_private *dev_priv); +void intel_uncore_prune (struct drm_i915_private *dev_priv);bool intel_uncore_unclaimed_mmio (struct drm_i915_private *dev_priv);bool intel_uncore_arm_unclaimed_mmio_detection (struct drm_i915_private *dev_priv);void intel_uncore_fini (struct drm_i915_private *dev_priv);
Signature · 7 lines
Thanks, Sagar _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
This patch seems to have fallen through the cracks..
Quoted 264 lines · Sagar Arun Kamble
Quoted 53 lines · Mika Kuoppala
From: Oscar Mateo <[email protected]>
In Gen11, the Video Decode engines (aka VDBOX, aka VCS, aka BSD) and the Video Enhancement engines (aka VEBOX, aka VECS) could be fused off. Also, each VDBOX and VEBOX has its own power well, which only exist if the related engine exists in the HW.
Unfortunately, we have a Catch-22 situation going on: we need the blitter forcewake to read the register with the fuse info, but we cannot initialize the forcewake domains without knowin about the engines present in the HW. We workaround this problem by allowing the initialization of all forcewake domains and then pruning the fused off ones, as per the fuse information.
Bspec: 20680
v2: We were shifting incorrectly for vebox disable (Vinay)
v3: Assert mmio is ready and warn if we have attempted to initialize forcewake for fused-off engines (Paulo)
v4:
- UseINTEL_GENin new code (Tvrtko)
- Shorter local variable (Tvrtko, Michal)
- Keep "if (!...) continue" style (Tvrtko)
- No unnecessaryBUG_ON(Tvrtko)
-WARN_ONand cleanup if wrong mask (Tvrtko, Michal)
- UseI915_READ_FW(Michal)
- Use I915_MAX_VCS/VECS macros (Michal)v5: Rebased by Rodrigo fixing conflicts on top of:
commit33def1ff7b0("drm/i915: Simplifyintel_engines_init")v6: Fix v5. Remove
info->num_rings. (by Oscar)v7: Rebase (Rodrigo).
v8:
- s/intel_device_info_fused_off_engines/intel_device_info_init_mmio (Chris)
- Makevdbox_disable&vebox_disablelocal variables (Chris)v9:
- Move function declaration tointel_device_info.h(Michal)
- Missing indent in bit fields definitions (Michal)
- When RC6 is enabled by BIOS, the fuse register cannot be read until the blitter powerwell is awake. Shuffle where the fuse is read, prune the forcewake domains after the fact and change the commit message accordingly (Vinay, Sagar, Chris).v10:
- Improved commit message (Sagar)
- New line in header file (Sagar)
- Specify the message infw_domain_resetapplies to ICL+ (Sagar)Quoted 9 lines
Cc Paulo Zanoni <[email protected]>Cc Vinay Belgaumkar <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Michal Wajdeczko <[email protected]>Cc Chris Wilson <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Cc Sagar Arun Kamble <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>Signed-off-by Oscar Mateo <[email protected]>Reviewed-by Sagar Arun Kamble <[email protected]>Quoted 198 lines
---
drivers/gpu/drm/i915/i915_drv.c | 4 +++ drivers/gpu/drm/i915/i915_reg.h | 5 +++drivers/gpu/drm/i915/intel_device_info.c| 47
+++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_device_info.h| 2 ++ drivers/gpu/drm/i915/intel_uncore.c | 56
++++++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_uncore.h | 1 +6 files changed, 115 insertions(+)drivers/gpu/drm/i915/i915_drv.c +4
-0@@ -1033,6 +1033,10 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv) intel_uncore_init(dev_priv); + intel_device_info_init_mmio(dev_priv); + + intel_uncore_prune(dev_priv); + intel_uc_init_mmio(dev_priv); ret = intel_engines_init_mmio(dev_priv);drivers/gpu/drm/i915/i915_reg.h +5
-0@@ -2545,6 +2545,11 @@ enum i915_power_well_id { #define GEN10_EU_DISABLE3 _MMIO(0x9140) #define GEN10_EU_DIS_SS_MASK 0xff +#define GEN11_GT_VEBOX_VDBOX_DISABLE _MMIO(0x9140) +#define GEN11_GT_VDBOX_DISABLE_MASK 0xff +#define GEN11_GT_VEBOX_DISABLE_SHIFT 16 +#define GEN11_GT_VEBOX_DISABLE_MASK (0xff << GEN11_GT_VEBOX_DISABLE_SHIFT) + #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@@ -780,3 +780,50 @@ void intel_driver_caps_print(const structintel_driver_caps *caps, { drm_printf(p, "scheduler: %x\n", caps->scheduler);}
drivers/gpu/drm/i915/intel_device_info.c +3
-0+ +/* +* Determine which engines are fused off in our particular hardware. Since the
+ * fuse register is in the blitter powerwell, we need forcewake to be ready at
+ * this point (but later we need to prune the forcewake domains for engines that
+ * are indeed fused off).
+ */drivers/gpu/drm/i915/intel_device_info.c +40
-0+void intel_device_info_init_mmio (struct drm_i915_private *dev_priv) +{ + struct intel_device_info *info = mkwrite_device_info(dev_priv); + u8 vdbox_disable, vebox_disable; + u32 media_fuse; + int i; + + if (INTEL_GEN(dev_priv) < 11) + return; + + media_fuse = I915_READ(GEN11_GT_VEBOX_VDBOX_DISABLE); + + vdbox_disable = media_fuse & GEN11_GT_VDBOX_DISABLE_MASK; + vebox_disable = (media_fuse & GEN11_GT_VEBOX_DISABLE_MASK) >> + GEN11_GT_VEBOX_DISABLE_SHIFT; + + DRM_DEBUG_DRIVER("vdbox disable: %04x\n", vdbox_disable); + for (i = 0; i < I915_MAX_VCS; i++) { + if (!HAS_ENGINE(dev_priv, _VCS(i))) + continue; + + if (!(BIT(i) & vdbox_disable)) + continue; + + info->ring_mask &= ~ENGINE_MASK(_VCS(i)); + DRM_DEBUG_DRIVER("vcs%u fused off\n", i); + } + + DRM_DEBUG_DRIVER("vebox disable: %04x\n", vebox_disable); + for (i = 0; i < I915_MAX_VECS; i++) { + if (!HAS_ENGINE(dev_priv, _VECS(i))) + continue; + + if (!(BIT(i) & vebox_disable)) + continue; + + info->ring_mask &= ~ENGINE_MASK(_VECS(i)); + DRM_DEBUG_DRIVER("vecs%u fused off\n", i); + } +}drivers/gpu/drm/i915/intel_device_info.h +2
-0@@ -247,6 +247,8 @@ void intel_device_info_dump_runtime(const structintel_device_info *info, void intel_device_info_dump_topology(const struct sseu_dev_info *sseu, struct drm_printer *p); +void intel_device_info_init_mmio (struct drm_i915_private *dev_priv); + void intel_driver_caps_print(const struct intel_driver_caps *caps, struct drm_printer *p);drivers/gpu/drm/i915/intel_uncore.c +2
-0@@ -62,6 +62,11 @@ static inline void fw_domain_reset(struct drm_i915_private *i915, const struct intel_uncore_forcewake_domain *d) { + /* +* We don't really know if the powerwell for the forcewake domain we are
+ * trying to reset here does exist at this point (engines could be fused
+ * off in ICL+), so no waiting for acks
+ */
__raw_i915_write32(i915, d->reg_set, i915->uncore.fw_reset); }drivers/gpu/drm/i915/intel_uncore.c +19
-0@@ -1353,6 +1358,23 @@ static void fw_domain_init(structdrm_i915_private *dev_priv, fw_domain_reset(dev_priv, d); } +static void fw_domain_fini (struct drm_i915_private *dev_priv, + enum forcewake_domain_id domain_id) +{ + struct intel_uncore_forcewake_domain *d; + + if (WARN_ON(domain_id >= FW_DOMAIN_ID_COUNT)) + return; + + d = &dev_priv->uncore.fw_domain[domain_id]; + + WARN_ON(d->wake_count); + WARN_ON(hrtimer_cancel(&d->timer)); + memset(d, 0, sizeof(*d)); + + dev_priv->uncore.fw_domains &= ~BIT(domain_id); +} + static void intel_uncore_fw_domains_init(struct drm_i915_private *dev_priv) { if (INTEL_GEN(dev_priv) <= 5 || intel_vgpu_active(dev_priv))@@ -1565,6 +1587,40 @@ void intel_uncore_init(struct drm_i915_private *dev_priv) &dev_priv->uncore.pmic_bus_access_nb); } +/* +* We might have detected that some engines are fused off after we initialized
+ * the forcewake domains. Prune them, to make sure they only reference existing
+ * engines.
+ */drivers/gpu/drm/i915/intel_uncore.c +29
-0+void intel_uncore_prune (struct drm_i915_private *dev_priv) +{ + if (INTEL_GEN(dev_priv) >= 11) { + enum forcewake_domains fw_domains = dev_priv->uncore.fw_domains; + enum forcewake_domain_id domain_id; + int i; + + for (i = 0; i < I915_MAX_VCS; i++) { + domain_id = FW_DOMAIN_ID_MEDIA_VDBOX0 + i; + + if (HAS_ENGINE(dev_priv, _VCS(i))) + continue; + + if (fw_domains & BIT(domain_id)) + fw_domain_fini(dev_priv, domain_id); + } + + for (i = 0; i < I915_MAX_VECS; i++) { + domain_id = FW_DOMAIN_ID_MEDIA_VEBOX0 + i; + + if (HAS_ENGINE(dev_priv, _VECS(i))) + continue; + + if (fw_domains & BIT(domain_id)) + fw_domain_fini(dev_priv, domain_id); + } + } +} +void
intel_uncore_fini(struct drm_i915_private *dev_priv)
{
/* Paranoia: make sure we have disabled everything before we exit. */drivers/gpu/drm/i915/intel_uncore.h +0
-1--- a/drivers/gpu/drm/i915/intel_uncore.h
Quoted 9 lines
drivers/gpu/drm/i915/intel_uncore.h struct intel_uncore { · line 145
Quoted 8 lines
+++
b/drivers/gpu/drm/i915/intel_uncore.hdrivers/gpu/drm/i915/intel_uncore.h +1
-0@@ -140,6 +140,7 @@ struct intel_uncore { void intel_uncore_sanitize(struct drm_i915_private *dev_priv); void intel_uncore_init(struct drm_i915_private *dev_priv); +void intel_uncore_prune (struct drm_i915_private *dev_priv); bool intel_uncore_unclaimed_mmio(struct drm_i915_private *dev_priv); bool intel_uncore_arm_unclaimed_mmio_detection(struct drm_i915_private *dev_priv); void intel_uncore_fini(struct drm_i915_private *dev_priv);
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Hi Mika,
Even after this series, we're still missing support for reading the timestamp frequency (read_timestamp_frequency in intel_device_info.c). I'm pretty sure someone wrote a patch for it. Do you any idea?
If not, I can send something.
Thanks,
-
Lionel
Quoted 256 lines · Mika Kuoppala
From: Oscar Mateo <[email protected]>
In Gen11, the Video Decode engines (aka VDBOX, aka VCS, aka BSD) and the Video Enhancement engines (aka VEBOX, aka VECS) could be fused off. Also, each VDBOX and VEBOX has its own power well, which only exist if the related engine exists in the HW.
Unfortunately, we have a Catch-22 situation going on: we need the blitter forcewake to read the register with the fuse info, but we cannot initialize the forcewake domains without knowin about the engines present in the HW. We workaround this problem by allowing the initialization of all forcewake domains and then pruning the fused off ones, as per the fuse information.
Bspec: 20680
v2: We were shifting incorrectly for vebox disable (Vinay)
v3: Assert mmio is ready and warn if we have attempted to initialize
forcewake for fused-off engines (Paulo)v4:
- UseINTEL_GENin new code (Tvrtko)
- Shorter local variable (Tvrtko, Michal)
- Keep "if (!...) continue" style (Tvrtko)
- No unnecessaryBUG_ON(Tvrtko)
-WARN_ONand cleanup if wrong mask (Tvrtko, Michal)
- UseI915_READ_FW(Michal)
- Use I915_MAX_VCS/VECS macros (Michal)v5: Rebased by Rodrigo fixing conflicts on top of:
commit 33def1ff7b0 ("drm/i915: Simplify intel_engines_init")v6: Fix v5. Remove
info->num_rings. (by Oscar)v7: Rebase (Rodrigo).
v8:
- s/intel_device_info_fused_off_engines/intel_device_info_init_mmio (Chris)
- Makevdbox_disable&vebox_disablelocal variables (Chris)v9:
- Move function declaration tointel_device_info.h(Michal)
- Missing indent in bit fields definitions (Michal)
- When RC6 is enabled by BIOS, the fuse register cannot be read until the blitter powerwell is awake. Shuffle where the fuse is read, prune the forcewake domains after the fact and change the commit message accordingly (Vinay, Sagar, Chris).v10:
- Improved commit message (Sagar)
- New line in header file (Sagar)
- Specify the message infw_domain_resetapplies to ICL+ (Sagar)Cc Paulo Zanoni <[email protected]>Cc Vinay Belgaumkar <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Michal Wajdeczko <[email protected]>Cc Chris Wilson <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Cc Sagar Arun Kamble <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>Signed-off-by Oscar Mateo <[email protected]>--- drivers/gpu/drm/i915/i915_drv.c | 4 +++ drivers/gpu/drm/i915/i915_reg.h | 5 +++ drivers/gpu/drm/i915/intel_device_info.c | 47 +++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_device_info.h | 2 ++ drivers/gpu/drm/i915/intel_uncore.c | 56 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uncore.h | 1 + 6 files changed, 115 insertions(+)drivers/gpu/drm/i915/i915_drv.c +4
-0@@ -1033,6 +1033,10 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)intel_uncore_init (dev_priv); +intel_device_info_init_mmio (dev_priv); + +intel_uncore_prune (dev_priv); +intel_uc_init_mmio (dev_priv); ret =intel_engines_init_mmio (dev_priv);drivers/gpu/drm/i915/i915_reg.h +5
-0@@ -2545,6 +2545,11 @@ enum i915_power_well_id {#define GEN10_EU_DISABLE3 _MMIO(0x9140)#define GEN10_EU_DIS_SS_MASK 0xff +#define GEN11_GT_VEBOX_VDBOX_DISABLE _MMIO(0x9140) +#define GEN11_GT_VDBOX_DISABLE_MASK 0xff +#define GEN11_GT_VEBOX_DISABLE_SHIFT 16 +#define GEN11_GT_VEBOX_DISABLE_MASK (0xff << GEN11_GT_VEBOX_DISABLE_SHIFT) +#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 +47
-0@@ -780,3 +780,50 @@ void intel_driver_caps_print(const struct intel_driver_caps *caps, {drm_printf (p,"scheduler: %x\n" , caps->scheduler); } + +/* +* Determine which engines are fused off in our particular hardware. Since the +* fuse register is in the blitter powerwell, we need forcewake to be ready at +* this point (but later we need to prune the forcewake domains for engines that +* are indeed fused off). +*/ +void intel_device_info_init_mmio (struct drm_i915_private *dev_priv) +{ +struct intel_device_info *info =mkwrite_device_info (dev_priv); +u8 vdbox_disable, vebox_disable; +u32 media_fuse; +int i; + +if (INTEL_GEN (dev_priv) <11 ) +return ; + + media_fuse =I915_READ (GEN11_GT_VEBOX_VDBOX_DISABLE ); + + vdbox_disable = media_fuse &GEN11_GT_VDBOX_DISABLE_MASK ; + vebox_disable = (media_fuse &GEN11_GT_VEBOX_DISABLE_MASK ) >> +GEN11_GT_VEBOX_DISABLE_SHIFT ; + +DRM_DEBUG_DRIVER ("vdbox disable: %04x\n" , vdbox_disable); +for (i =0 ; i <I915_MAX_VCS ; i++) { +if (!HAS_ENGINE (dev_priv,_VCS (i))) +continue ; + +if (!(BIT (i) & vdbox_disable)) +continue ; + + info->ring_mask &= ~ENGINE_MASK (_VCS (i)); +DRM_DEBUG_DRIVER ("vcs%u fused off\n" , i); + } + +DRM_DEBUG_DRIVER ("vebox disable: %04x\n" , vebox_disable); +for (i =0 ; i <I915_MAX_VECS ; i++) { +if (!HAS_ENGINE (dev_priv,_VECS (i))) +continue ; + +if (!(BIT (i) & vebox_disable)) +continue ; + + info->ring_mask &= ~ENGINE_MASK (_VECS (i)); +DRM_DEBUG_DRIVER ("vecs%u fused off\n" , i); + } +}drivers/gpu/drm/i915/intel_device_info.h +2
-0@@ -247,6 +247,8 @@ void intel_device_info_dump_runtime(const struct intel_device_info *info,void intel_device_info_dump_topology (const struct sseu_dev_info *sseu,struct drm_printer *p); +void intel_device_info_init_mmio (struct drm_i915_private *dev_priv); +void intel_driver_caps_print (const struct intel_driver_caps *caps,struct drm_printer *p);drivers/gpu/drm/i915/intel_uncore.c +56
-0@@ -62,6 +62,11 @@ static inline void fw_domain_reset(struct drm_i915_private *i915, const struct intel_uncore_forcewake_domain *d) { +/* +* We don't really know if the powerwell for the forcewake domain we are +* trying to reset here does exist at this point (engines could be fused +* off in ICL+), so no waiting for acks +*/ __raw_i915_write32(i915, d->reg_set, i915->uncore.fw_reset); }@@ -1353,6 +1358,23 @@ static void fw_domain_init(struct drm_i915_private *dev_priv,fw_domain_reset (dev_priv, d); } +static void fw_domain_fini (struct drm_i915_private *dev_priv, +enum forcewake_domain_id domain_id) +{ +struct intel_uncore_forcewake_domain *d; + +if (WARN_ON (domain_id >=FW_DOMAIN_ID_COUNT )) +return ; + + d = &dev_priv->uncore.fw_domain[domain_id]; + +WARN_ON (d->wake_count); +WARN_ON (hrtimer_cancel (&d->timer)); +memset (d,0 ,sizeof (*d)); + + dev_priv->uncore.fw_domains &= ~BIT (domain_id); +} +static void intel_uncore_fw_domains_init (struct drm_i915_private *dev_priv) {if (INTEL_GEN (dev_priv) <=5 ||intel_vgpu_active (dev_priv))@@ -1565,6 +1587,40 @@ void intel_uncore_init(struct drm_i915_private *dev_priv) &dev_priv->uncore.pmic_bus_access_nb); } +/* +* We might have detected that some engines are fused off after we initialized +* the forcewake domains. Prune them, to make sure they only reference existing +* engines. +*/ +void intel_uncore_prune (struct drm_i915_private *dev_priv) +{ +if (INTEL_GEN (dev_priv) >=11 ) { +enum forcewake_domains fw_domains = dev_priv->uncore.fw_domains; +enum forcewake_domain_id domain_id; +int i; + +for (i =0 ; i <I915_MAX_VCS ; i++) { + domain_id =FW_DOMAIN_ID_MEDIA_VDBOX0 + i; + +if (HAS_ENGINE (dev_priv,_VCS (i))) +continue ; + +if (fw_domains &BIT (domain_id)) +fw_domain_fini (dev_priv, domain_id); + } + +for (i =0 ; i <I915_MAX_VECS ; i++) { + domain_id =FW_DOMAIN_ID_MEDIA_VEBOX0 + i; + +if (HAS_ENGINE (dev_priv,_VECS (i))) +continue ; + +if (fw_domains &BIT (domain_id)) +fw_domain_fini (dev_priv, domain_id); + } + } +} +void intel_uncore_fini (struct drm_i915_private *dev_priv) {/* Paranoia: make sure we have disabled everything before we exit. */ drivers/gpu/drm/i915/intel_uncore.h +0
-0
drivers/gpu/drm/i915/intel_uncore.h struct intel_uncore { · line 146
Quoted 7 lines
drivers/gpu/drm/i915/intel_uncore.h +1
-0@@ -140,6 +140,7 @@ struct intel_uncore {void intel_uncore_sanitize (struct drm_i915_private *dev_priv);void intel_uncore_init (struct drm_i915_private *dev_priv); +void intel_uncore_prune (struct drm_i915_private *dev_priv);bool intel_uncore_unclaimed_mmio (struct drm_i915_private *dev_priv);bool intel_uncore_arm_unclaimed_mmio_detection (struct drm_i915_private *dev_priv);void intel_uncore_fini (struct drm_i915_private *dev_priv);
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Em Sex, 2018-03-23 às 16:28 +0000, Lionel Landwerlin escreveu:
Quoted 8 lines
Hi Mika,
Even after this series, we're still missing support for reading the timestamp frequency (
read_timestamp_frequencyinintel_device_info.c).
I'm pretty sure someone wrote a patch for it. Do you any idea?If not, I can send something.
Yes, we have them. I'll see if I missed them while upstreaming and resend in that case.
Quoted 312 lines
Thanks,
-
LionelQuoted 305 lines · Mika Kuoppala
From: Oscar Mateo <[email protected]>
In Gen11, the Video Decode engines (aka VDBOX, aka VCS, aka BSD) and the
Video Enhancement engines (aka VEBOX, aka VECS) could be fused off. Also,
each VDBOX and VEBOX has its own power well, which only exist if the related
engine exists in the HW.Unfortunately, we have a Catch-22 situation going on: we need the blitter
forcewake to read the register with the fuse info, but we cannot initialize
the forcewake domains without knowin about the engines present in the HW.
We workaround this problem by allowing the initialization of all forcewake
domains and then pruning the fused off ones, as per the fuse information.Bspec: 20680
v2: We were shifting incorrectly for vebox disable (Vinay)
v3: Assert mmio is ready and warn if we have attempted to initialize
forcewake for fused-off engines (Paulo)v4:
- UseINTEL_GENin new code (Tvrtko)
- Shorter local variable (Tvrtko, Michal)
- Keep "if (!...) continue" style (Tvrtko)
- No unnecessaryBUG_ON(Tvrtko)
-WARN_ONand cleanup if wrong mask (Tvrtko, Michal)
- UseI915_READ_FW(Michal)
- Use I915_MAX_VCS/VECS macros (Michal)v5: Rebased by Rodrigo fixing conflicts on top of:
commit 33def1ff7b0 ("drm/i915: Simplify intel_engines_init")v6: Fix v5. Remove
info->num_rings. (by Oscar)v7: Rebase (Rodrigo).
v8:
-s/intel_device_info_fused_off_engines/intel_device_info_init_mmio (Chris)
- Makevdbox_disable&vebox_disablelocal variables (Chris)v9:
- Move function declaration tointel_device_info.h(Michal)
- Missing indent in bit fields definitions (Michal)
- When RC6 is enabled by BIOS, the fuse register cannot be read
until
the blitter powerwell is awake. Shuffle where the fuse is
read, prune
the forcewake domains after the fact and change the commit
message
accordingly (Vinay, Sagar, Chris).v10:
- Improved commit message (Sagar)
- New line in header file (Sagar)
- Specify the message infw_domain_resetapplies to ICL+ (Sagar)Cc Paulo Zanoni <[email protected]>Cc Vinay Belgaumkar <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Michal Wajdeczko <[email protected]>Cc Chris Wilson <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Cc Sagar Arun Kamble <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>Signed-off-by Oscar Mateo <[email protected]>--- drivers/gpu/drm/i915/i915_drv.c | 4 +++ drivers/gpu/drm/i915/i915_reg.h | 5 +++ drivers/gpu/drm/i915/intel_device_info.c | 47 +++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_device_info.h | 2 ++ drivers/gpu/drm/i915/intel_uncore.c | 56 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uncore.h | 1 + 6 files changed, 115 insertions(+)drivers/gpu/drm/i915/i915_drv.c +4
-0@@ -1033,6 +1033,10 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)intel_uncore_init (dev_priv ); +intel_device_info_init_mmio (dev_priv); + +intel_uncore_prune (dev_priv); +intel_uc_init_mmio (dev_priv);ret = intel_engines_init_mmio(dev_priv);drivers/gpu/drm/i915/i915_reg.h +5
-0@@ -2545,6 +2545,11 @@ enum i915_power_well_id {#define GEN10_EU_DISABLE3 _MMIO(0x9140)#define GEN10_EU_DIS_SS_MASK 0xff +#define GEN11_GT_VEBOX_VDBOX_DISABLE _MMIO(0x9140) +#define GEN11_GT_VDBOX_DISABLE_MASK 0xff +#define GEN11_GT_VEBOX_DISABLE_SHIFT 16 +#define GEN11_GT_VEBOX_DISABLE_MASK (0xff << GEN11_GT_VEBOX_DISABLE_SHIFT) +#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 +3
-0@@ -780,3 +780,50 @@ void intel_driver_caps_print(const struct intel_driver_caps *caps, {drm_printf (p,"scheduler: %x\n" , caps->scheduler); } + +/* +* Determine which engines are fused off in our particular hardware. Since the
+ * fuse register is in the blitter powerwell, we need forcewake to be ready at
+ * this point (but later we need to prune the forcewake domains for engines that
+ * are indeed fused off).
+ */
+voidintel_device_info_init_mmio(struct drm_i915_private *dev_priv)drivers/gpu/drm/i915/intel_device_info.c +2
-0+{ + struct intel_device_info *info =
mkwrite_device_info(dev_priv);drivers/gpu/drm/i915/intel_device_info.c +11
-0+u8 vdbox_disable, vebox_disable; +u32 media_fuse; +int i; + +if (INTEL_GEN (dev_priv) <11 ) +return ; + + media_fuse =I915_READ (GEN11_GT_VEBOX_VDBOX_DISABLE ); + + vdbox_disable = media_fuse &GEN11_GT_VDBOX_DISABLE_MASK ; + vebox_disable = (media_fuse &GEN11_GT_VEBOX_DISABLE_MASK )Quoted 1 line
Quoted 1 line
drivers/gpu/drm/i915/intel_device_info.c +26
-0+GEN11_GT_VEBOX_DISABLE_SHIFT ; + +DRM_DEBUG_DRIVER ("vdbox disable: %04x\n" , vdbox_disable); +for (i =0 ; i <I915_MAX_VCS ; i++) { +if (!HAS_ENGINE (dev_priv,_VCS (i))) +continue ; + +if (!(BIT (i) & vdbox_disable)) +continue ; + + info->ring_mask &= ~ENGINE_MASK (_VCS (i)); +DRM_DEBUG_DRIVER ("vcs%u fused off\n" , i); + } + +DRM_DEBUG_DRIVER ("vebox disable: %04x\n" , vebox_disable); +for (i =0 ; i <I915_MAX_VECS ; i++) { +if (!HAS_ENGINE (dev_priv,_VECS (i))) +continue ; + +if (!(BIT (i) & vebox_disable)) +continue ; + + info->ring_mask &= ~ENGINE_MASK (_VECS (i)); +DRM_DEBUG_DRIVER ("vecs%u fused off\n" , i); + } +}drivers/gpu/drm/i915/intel_device_info.h +2
-0@@ -247,6 +247,8 @@ void intel_device_info_dump_runtime(conststruct intel_device_info *info, void intel_device_info_dump_topology(const struct sseu_dev_info *sseu,struct drm_printer *p); +void intel_device_info_init_mmio (struct drm_i915_private *dev_priv); +void intel_driver_caps_print(const struct
intel_driver_caps
*caps,
structdrm_printer*p);drivers/gpu/drm/i915/intel_uncore.c +2
-0@@ -62,6 +62,11 @@ static inline void fw_domain_reset(struct drm_i915_private *i915, const struct intel_uncore_forcewake_domain *d) { +/* +* We don't really know if the powerwell for the forcewake domain we are
drivers/gpu/drm/i915/intel_uncore.c +1
-0+* trying to reset here does exist at this point (engines could be fused
drivers/gpu/drm/i915/intel_uncore.c +2
-0+* off in ICL+), so no waiting for acks +*/ __raw_i915_write32(i915, d->reg_set, i915-Quoted 1 line
uncore.fw_reset);
}
drivers/gpu/drm/i915/intel_uncore.c +17
-0@@ -1353,6 +1358,23 @@ static void fw_domain_init(structdrm_i915_private *dev_priv,fw_domain_reset (dev_priv ,d ); } +static void fw_domain_fini (struct drm_i915_private *dev_priv, +enum forcewake_domain_id domain_id) +{ +struct intel_uncore_forcewake_domain *d; + +if (WARN_ON (domain_id >=FW_DOMAIN_ID_COUNT )) +return ; + + d = &dev_priv->uncore.fw_domain[domain_id]; + +WARN_ON (d->wake_count); +WARN_ON (hrtimer_cancel (&d->timer)); +memset (d,0 ,sizeof (*d)); + + dev_priv->uncore.fw_domains &= ~BIT (domain_id); +} +static void intel_uncore_fw_domains_init (struct drm_i915_private *dev_priv){
if (INTEL_GEN(dev_priv)<= 5 ||intel_vgpu_active(dev_priv))drivers/gpu/drm/i915/intel_uncore.c +2
-0@@ -1565,6 +1587,40 @@ void intel_uncore_init(struct drm_i915_private *dev_priv) &dev_priv->uncore.pmic_bus_access_nb); } +/* +* We might have detected that some engines are fused off after we initialized
+ * the forcewake domains. Prune them, to make sure they only reference existing
+ * engines.
+ */drivers/gpu/drm/i915/intel_uncore.c +4
-0+void intel_uncore_prune (struct drm_i915_private *dev_priv) +{ +if (INTEL_GEN (dev_priv) >=11 ) { + enum forcewake_domains fw_domains = dev_priv-Quoted 1 line
uncore.fw_domains;
drivers/gpu/drm/i915/intel_uncore.c +11
-0+enum forcewake_domain_id domain_id; +int i; + +for (i =0 ; i <I915_MAX_VCS ; i++) { + domain_id =FW_DOMAIN_ID_MEDIA_VDBOX0 + i; + +if (HAS_ENGINE (dev_priv,_VCS (i))) +continue ; + +if (fw_domains &BIT (domain_id)) + fw_domain_fini(dev_priv,
domain_id);drivers/gpu/drm/i915/intel_uncore.c +10
-0+ } + +for (i =0 ; i <I915_MAX_VECS ; i++) { + domain_id =FW_DOMAIN_ID_MEDIA_VEBOX0 + i; + +if (HAS_ENGINE (dev_priv,_VECS (i))) +continue ; + +if (fw_domains &BIT (domain_id)) + fw_domain_fini(dev_priv,
domain_id);drivers/gpu/drm/i915/intel_uncore.c +4
-0+ } + } +} +void intel_uncore_fini (struct drm_i915_private *dev_priv) {/* Paranoia: make sure we have disabled everything before we exit. */
drivers/gpu/drm/i915/intel_uncore.h +0
-0@@ -140,6 +140,7 @@ struct intel_uncore {
Quoted 10 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_uncore.h +1
-0void intel_uncore_sanitize (struct drm_i915_private *dev_priv);void intel_uncore_init (struct drm_i915_private *dev_priv); +void intel_uncore_prune (struct drm_i915_private *dev_priv);bool intel_uncore_unclaimed_mmio (struct drm_i915_private *dev_priv); bool intel_uncore_arm_unclaimed_mmio_detection(struct
drm_i915_private*dev_priv);
voidintel_uncore_fini(struct drm_i915_private *dev_priv);
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Em Ter, 2018-03-27 às 15:42 -0700, Paulo Zanoni escreveu:
Quoted 9 lines
Em Sex, 2018-03-23 às 16:28 +0000, Lionel Landwerlin escreveu:
Quoted 8 lines
Hi Mika,
Even after this series, we're still missing support for reading the
timestamp frequency (read_timestamp_frequencyinintel_device_info.c).
I'm pretty sure someone wrote a patch for it. Do you any idea?
Quoted 4 lines
Quoted 1 line
If not, I can send something.
Yes, we have them. I'll see if I missed them while upstreaming and resend in that case.
https://patchwork.freedesktop.org/patch/196710/
Hey Lionel, the Reviewed-by stamp you gave on the patch was before we upstreamed it, so we need you (or someone else) to re-check the patch and re-issue the reviewed-by tag. We do this because of the rebasing that happened between the R-B tag and the upstreaming, since issues can be introduced in between. If you can check the patch again and validate the r-b tag (or point the issues) then we can move forward and hopefully merge it.
Thanks,
Paulo
Quoted 342 lines
Quoted 331 lines
Thanks,
-
LionelQuoted 323 lines · Mika Kuoppala
From: Oscar Mateo <[email protected]>
In Gen11, the Video Decode engines (aka VDBOX, aka VCS, aka BSD) and the
Video Enhancement engines (aka VEBOX, aka VECS) could be fused off.
Also,
each VDBOX and VEBOX has its own power well, which only exist if the related
engine exists in the HW.Unfortunately, we have a Catch-22 situation going on: we need the blitter
forcewake to read the register with the fuse info, but we cannot initialize
the forcewake domains without knowin about the engines present in the HW.
We workaround this problem by allowing the initialization of all forcewake
domains and then pruning the fused off ones, as per the fuse information.Bspec: 20680
v2: We were shifting incorrectly for vebox disable (Vinay)
v3: Assert mmio is ready and warn if we have attempted to initialize
forcewake for fused-off engines (Paulo)v4:
- UseINTEL_GENin new code (Tvrtko)
- Shorter local variable (Tvrtko, Michal)
- Keep "if (!...) continue" style (Tvrtko)
- No unnecessaryBUG_ON(Tvrtko)
-WARN_ONand cleanup if wrong mask (Tvrtko, Michal)
- UseI915_READ_FW(Michal)
- Use I915_MAX_VCS/VECS macros (Michal)v5: Rebased by Rodrigo fixing conflicts on top of:
commit 33def1ff7b0 ("drm/i915: Simplify intel_engines_init")v6: Fix v5. Remove
info->num_rings. (by Oscar)v7: Rebase (Rodrigo).
v8:
-s/intel_device_info_fused_off_engines/intel_device_info_init_mmio (Chris)
- Makevdbox_disable&vebox_disablelocal variables (Chris)v9:
- Move function declaration tointel_device_info.h(Michal)
- Missing indent in bit fields definitions (Michal)
- When RC6 is enabled by BIOS, the fuse register cannot be
read
until
the blitter powerwell is awake. Shuffle where the fuse is
read, prune
the forcewake domains after the fact and change the commit
message
accordingly (Vinay, Sagar, Chris).v10:
- Improved commit message (Sagar)
- New line in header file (Sagar)
- Specify the message infw_domain_resetapplies to ICL+
(Sagar)Cc Paulo Zanoni <[email protected]>Cc Vinay Belgaumkar <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Michal Wajdeczko <[email protected]>Cc Chris Wilson <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Cc Sagar Arun Kamble <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>Signed-off-by Oscar Mateo <[email protected]>--- drivers/gpu/drm/i915/i915_drv.c | 4 +++ drivers/gpu/drm/i915/i915_reg.h | 5 +++ drivers/gpu/drm/i915/intel_device_info.c | 47 +++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_device_info.h | 2 ++ drivers/gpu/drm/i915/intel_uncore.c | 56 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uncore.h | 1 + 6 files changed, 115 insertions(+)drivers/gpu/drm/i915/i915_drv.c +4
-0@@ -1033,6 +1033,10 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)intel_uncore_init (dev_priv ); +intel_device_info_init_mmio (dev_priv); + +intel_uncore_prune (dev_priv); +intel_uc_init_mmio (dev_priv);ret = intel_engines_init_mmio(dev_priv);drivers/gpu/drm/i915/i915_reg.h +5
-0@@ -2545,6 +2545,11 @@ enum i915_power_well_id {#define GEN10_EU_DISABLE3 _MMIO(0x9140)#define GEN10_EU_DIS_SS_MASK 0xff +#define GEN11_GT_VEBOX_VDBOX_DISABLE _MMIO(0x9140) +#define GEN11_GT_VDBOX_DISABLE_MASK 0xff +#define GEN11_GT_VEBOX_DISABLE_SHIFT 16 +#define GEN11_GT_VEBOX_DISABLE_MASK (0xff << GEN11_GT_VEBOX_DISABLE_SHIFT) +#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 +3
-0@@ -780,3 +780,50 @@ void intel_driver_caps_print(const struct intel_driver_caps *caps, {drm_printf (p,"scheduler: %x\n" , caps->scheduler); } + +/* +* Determine which engines are fused off in our particular hardware. Since the
+ * fuse register is in the blitter powerwell, we need forcewake to
be ready at
+ * this point (but later we need to prune the forcewake domains for engines that
+ * are indeed fused off).
+ */
+voidintel_device_info_init_mmio(struct drm_i915_private *dev_priv)drivers/gpu/drm/i915/intel_device_info.c +2
-0+{ + struct intel_device_info *info =
mkwrite_device_info(dev_priv);drivers/gpu/drm/i915/intel_device_info.c +10
-0+u8 vdbox_disable, vebox_disable; +u32 media_fuse; +int i; + +if (INTEL_GEN (dev_priv) <11 ) +return ; + + media_fuse =I915_READ (GEN11_GT_VEBOX_VDBOX_DISABLE ); + + vdbox_disable = media_fuse &
GEN11_GT_VDBOX_DISABLE_MASK;drivers/gpu/drm/i915/intel_device_info.c +1
-0+ vebox_disable = (media_fuse &
GEN11_GT_VEBOX_DISABLE_MASK)Quoted 1 line
Quoted 1 line
drivers/gpu/drm/i915/intel_device_info.c +3
-0+GEN11_GT_VEBOX_DISABLE_SHIFT ; + + DRM_DEBUG_DRIVER("vdbox disable: %04x\n",
vdbox_disable);drivers/gpu/drm/i915/intel_device_info.c +12
-0+for (i =0 ; i <I915_MAX_VCS ; i++) { +if (!HAS_ENGINE (dev_priv,_VCS (i))) +continue ; + +if (!(BIT (i) & vdbox_disable)) +continue ; + + info->ring_mask &= ~ENGINE_MASK (_VCS (i)); +DRM_DEBUG_DRIVER ("vcs%u fused off\n" , i); + } + + DRM_DEBUG_DRIVER("vebox disable: %04x\n",
vebox_disable);drivers/gpu/drm/i915/intel_device_info.c +11
-0+for (i =0 ; i <I915_MAX_VECS ; i++) { +if (!HAS_ENGINE (dev_priv,_VECS (i))) +continue ; + +if (!(BIT (i) & vebox_disable)) +continue ; + + info->ring_mask &= ~ENGINE_MASK (_VECS (i)); +DRM_DEBUG_DRIVER ("vecs%u fused off\n" , i); + } +}drivers/gpu/drm/i915/intel_device_info.h +2
-0@@ -247,6 +247,8 @@ void intel_device_info_dump_runtime(conststruct intel_device_info *info, void intel_device_info_dump_topology(const struct sseu_dev_info *sseu,struct drm_printer *p); +void intel_device_info_init_mmio (struct drm_i915_private *dev_priv); +void intel_driver_caps_print(const struct
intel_driver_caps
*caps,
structdrm_printer*p);drivers/gpu/drm/i915/intel_uncore.c +2
-0@@ -62,6 +62,11 @@ static inline void fw_domain_reset(struct drm_i915_private *i915, const struct intel_uncore_forcewake_domain *d) { +/* +* We don't really know if the powerwell for the forcewake
domain we aredrivers/gpu/drm/i915/intel_uncore.c +1
-0+* trying to reset here does exist at this point (engines
could be fuseddrivers/gpu/drm/i915/intel_uncore.c +2
-0+* off in ICL+), so no waiting for acks +*/ __raw_i915_write32(i915, d->reg_set, i915-Quoted 1 line
uncore.fw_reset);
}drivers/gpu/drm/i915/intel_uncore.c +17
-0@@ -1353,6 +1358,23 @@ static void fw_domain_init(structdrm_i915_private *dev_priv,fw_domain_reset (dev_priv ,d ); } +static void fw_domain_fini (struct drm_i915_private *dev_priv, +enum forcewake_domain_id domain_id) +{ +struct intel_uncore_forcewake_domain *d; + +if (WARN_ON (domain_id >=FW_DOMAIN_ID_COUNT )) +return ; + + d = &dev_priv->uncore.fw_domain[domain_id]; + +WARN_ON (d->wake_count); +WARN_ON (hrtimer_cancel (&d->timer)); +memset (d,0 ,sizeof (*d)); + + dev_priv->uncore.fw_domains &= ~BIT (domain_id); +} + static void intel_uncore_fw_domains_init(struct
drm_i915_private*dev_priv)
{
if (INTEL_GEN(dev_priv)<= 5 ||intel_vgpu_active(dev_priv))drivers/gpu/drm/i915/intel_uncore.c +2
-0@@ -1565,6 +1587,40 @@ void intel_uncore_init(struct drm_i915_private *dev_priv) &dev_priv->uncore.pmic_bus_access_nb); } +/* +* We might have detected that some engines are fused off after we
initialized
+ * the forcewake domains. Prune them, to make sure they only reference existing
+ * engines.
+ */drivers/gpu/drm/i915/intel_uncore.c +4
-0+void intel_uncore_prune (struct drm_i915_private *dev_priv) +{ +if (INTEL_GEN (dev_priv) >=11 ) { + enum forcewake_domains fw_domains = dev_priv-Quoted 1 line
uncore.fw_domains;
drivers/gpu/drm/i915/intel_uncore.c +5
-0+enum forcewake_domain_id domain_id; +int i; + +for (i =0 ; i <I915_MAX_VCS ; i++) { + domain_id = FW_DOMAIN_ID_MEDIA_VDBOX0 +i;
drivers/gpu/drm/i915/intel_uncore.c +6
-0+ +if (HAS_ENGINE (dev_priv,_VCS (i))) +continue ; + +if (fw_domains &BIT (domain_id)) + fw_domain_fini(dev_priv,
domain_id);drivers/gpu/drm/i915/intel_uncore.c +4
-0+ } + +for (i =0 ; i <I915_MAX_VECS ; i++) { + domain_id = FW_DOMAIN_ID_MEDIA_VEBOX0 +i;
drivers/gpu/drm/i915/intel_uncore.c +6
-0+ +if (HAS_ENGINE (dev_priv,_VECS (i))) +continue ; + +if (fw_domains &BIT (domain_id)) + fw_domain_fini(dev_priv,
domain_id);drivers/gpu/drm/i915/intel_uncore.c +4
-0+ } + } +} +void intel_uncore_fini (struct drm_i915_private *dev_priv) {/* Paranoia: make sure we have disabled everything before
we exit. */drivers/gpu/drm/i915/intel_uncore.h +0
-0@@ -140,6 +140,7 @@ struct intel_uncore {Quoted 10 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_uncore.h +1
-0void intel_uncore_sanitize (struct drm_i915_private *dev_priv);void intel_uncore_init (struct drm_i915_private *dev_priv); +void intel_uncore_prune (struct drm_i915_private *dev_priv);bool intel_uncore_unclaimed_mmio (struct drm_i915_private *dev_priv); bool intel_uncore_arm_unclaimed_mmio_detection(struct
drm_i915_private*dev_priv);
voidintel_uncore_fini(struct drm_i915_private *dev_priv);
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 23 lines · Paulo Zanoni
Em Ter, 2018-03-27 às 15:42 -0700, Paulo Zanoni escreveu:
Quoted 9 lines
Em Sex, 2018-03-23 às 16:28 +0000, Lionel Landwerlin escreveu:
Quoted 8 lines
Hi Mika,
Even after this series, we're still missing support for reading the
timestamp frequency (read_timestamp_frequencyinintel_device_info.c).
I'm pretty sure someone wrote a patch for it. Do you any idea?Quoted 3 lines
Quoted 1 line
If not, I can send something.
Yes, we have them. I'll see if I missed them while upstreaming and resend in that case.
https://patchwork.freedesktop.org/patch/196710/
Hey Lionel, the Reviewed-by stamp you gave on the patch was before we upstreamed it, so we need you (or someone else) to re-check the patch and re-issue the reviewed-by tag. We do this because of the rebasing that happened between the R-B tag and the upstreaming, since issues can be introduced in between. If you can check the patch again and validate the r-b tag (or point the issues) then we can move forward and hopefully merge it.
Quoted 2 lines
Thanks,
Paulo
Thanks, just sent another Rb, please push it :)
Quoted 335 lines
Quoted 335 lines
Quoted 335 lines
Thanks,
-
LionelQuoted 327 lines · Mika Kuoppala
From: Oscar Mateo <[email protected]>
In Gen11, the Video Decode engines (aka VDBOX, aka VCS, aka BSD) and the
Video Enhancement engines (aka VEBOX, aka VECS) could be fused off.
Also,
each VDBOX and VEBOX has its own power well, which only exist if the related
engine exists in the HW.Unfortunately, we have a Catch-22 situation going on: we need the blitter
forcewake to read the register with the fuse info, but we cannot initialize
the forcewake domains without knowin about the engines present in the HW.
We workaround this problem by allowing the initialization of all forcewake
domains and then pruning the fused off ones, as per the fuse information.Bspec: 20680
v2: We were shifting incorrectly for vebox disable (Vinay)
v3: Assert mmio is ready and warn if we have attempted to initialize
forcewake for fused-off engines (Paulo)v4:
- UseINTEL_GENin new code (Tvrtko)
- Shorter local variable (Tvrtko, Michal)
- Keep "if (!...) continue" style (Tvrtko)
- No unnecessaryBUG_ON(Tvrtko)
-WARN_ONand cleanup if wrong mask (Tvrtko, Michal)
- UseI915_READ_FW(Michal)
- Use I915_MAX_VCS/VECS macros (Michal)v5: Rebased by Rodrigo fixing conflicts on top of:
commit 33def1ff7b0 ("drm/i915: Simplify intel_engines_init")v6: Fix v5. Remove
info->num_rings. (by Oscar)v7: Rebase (Rodrigo).
v8:
-s/intel_device_info_fused_off_engines/intel_device_info_init_mmio (Chris)
- Makevdbox_disable&vebox_disablelocal variables (Chris)v9:
- Move function declaration tointel_device_info.h(Michal)
- Missing indent in bit fields definitions (Michal)
- When RC6 is enabled by BIOS, the fuse register cannot be
read
until
the blitter powerwell is awake. Shuffle where the fuse is
read, prune
the forcewake domains after the fact and change the commit
message
accordingly (Vinay, Sagar, Chris).v10:
- Improved commit message (Sagar)
- New line in header file (Sagar)
- Specify the message infw_domain_resetapplies to ICL+
(Sagar)Cc Paulo Zanoni <[email protected]>Cc Vinay Belgaumkar <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Michal Wajdeczko <[email protected]>Cc Chris Wilson <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Cc Sagar Arun Kamble <[email protected]>Signed-off-by Rodrigo Vivi <[email protected]>Signed-off-by Oscar Mateo <[email protected]>--- drivers/gpu/drm/i915/i915_drv.c | 4 +++ drivers/gpu/drm/i915/i915_reg.h | 5 +++ drivers/gpu/drm/i915/intel_device_info.c | 47 +++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_device_info.h | 2 ++ drivers/gpu/drm/i915/intel_uncore.c | 56 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uncore.h | 1 + 6 files changed, 115 insertions(+)drivers/gpu/drm/i915/i915_drv.c +4
-0@@ -1033,6 +1033,10 @@ static int i915_driver_init_mmio(struct drm_i915_private *dev_priv)intel_uncore_init (dev_priv ); +intel_device_info_init_mmio (dev_priv); + +intel_uncore_prune (dev_priv); +intel_uc_init_mmio (dev_priv);ret = intel_engines_init_mmio(dev_priv);drivers/gpu/drm/i915/i915_reg.h +5
-0@@ -2545,6 +2545,11 @@ enum i915_power_well_id {#define GEN10_EU_DISABLE3 _MMIO(0x9140)#define GEN10_EU_DIS_SS_MASK 0xff +#define GEN11_GT_VEBOX_VDBOX_DISABLE _MMIO(0x9140) +#define GEN11_GT_VDBOX_DISABLE_MASK 0xff +#define GEN11_GT_VEBOX_DISABLE_SHIFT 16 +#define GEN11_GT_VEBOX_DISABLE_MASK (0xff << GEN11_GT_VEBOX_DISABLE_SHIFT) +#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 +3
-0@@ -780,3 +780,50 @@ void intel_driver_caps_print(const struct intel_driver_caps *caps, {drm_printf (p,"scheduler: %x\n" , caps->scheduler); } + +/* +* Determine which engines are fused off in our particular hardware. Since the
+ * fuse register is in the blitter powerwell, we need forcewake to
be ready at
+ * this point (but later we need to prune the forcewake domains for engines that
+ * are indeed fused off).
+ */
+voidintel_device_info_init_mmio(struct drm_i915_private *dev_priv)drivers/gpu/drm/i915/intel_device_info.c +2
-0+{ + struct intel_device_info *info =
mkwrite_device_info(dev_priv);drivers/gpu/drm/i915/intel_device_info.c +10
-0+u8 vdbox_disable, vebox_disable; +u32 media_fuse; +int i; + +if (INTEL_GEN (dev_priv) <11 ) +return ; + + media_fuse =I915_READ (GEN11_GT_VEBOX_VDBOX_DISABLE ); + + vdbox_disable = media_fuse &
GEN11_GT_VDBOX_DISABLE_MASK;drivers/gpu/drm/i915/intel_device_info.c +1
-0+ vebox_disable = (media_fuse &
GEN11_GT_VEBOX_DISABLE_MASK)drivers/gpu/drm/i915/intel_device_info.c +3
-0+GEN11_GT_VEBOX_DISABLE_SHIFT ; + + DRM_DEBUG_DRIVER("vdbox disable: %04x\n",
vdbox_disable);drivers/gpu/drm/i915/intel_device_info.c +12
-0+for (i =0 ; i <I915_MAX_VCS ; i++) { +if (!HAS_ENGINE (dev_priv,_VCS (i))) +continue ; + +if (!(BIT (i) & vdbox_disable)) +continue ; + + info->ring_mask &= ~ENGINE_MASK (_VCS (i)); +DRM_DEBUG_DRIVER ("vcs%u fused off\n" , i); + } + + DRM_DEBUG_DRIVER("vebox disable: %04x\n",
vebox_disable);drivers/gpu/drm/i915/intel_device_info.c +11
-0+for (i =0 ; i <I915_MAX_VECS ; i++) { +if (!HAS_ENGINE (dev_priv,_VECS (i))) +continue ; + +if (!(BIT (i) & vebox_disable)) +continue ; + + info->ring_mask &= ~ENGINE_MASK (_VECS (i)); +DRM_DEBUG_DRIVER ("vecs%u fused off\n" , i); + } +}drivers/gpu/drm/i915/intel_device_info.h +2
-0@@ -247,6 +247,8 @@ void intel_device_info_dump_runtime(conststruct intel_device_info *info, void intel_device_info_dump_topology(const struct sseu_dev_info *sseu,struct drm_printer *p); +void intel_device_info_init_mmio (struct drm_i915_private *dev_priv); +void intel_driver_caps_print(const struct
intel_driver_caps
*caps,
structdrm_printer*p);drivers/gpu/drm/i915/intel_uncore.c +2
-0@@ -62,6 +62,11 @@ static inline void fw_domain_reset(struct drm_i915_private *i915, const struct intel_uncore_forcewake_domain *d) { +/* +* We don't really know if the powerwell for the forcewake
domain we aredrivers/gpu/drm/i915/intel_uncore.c +1
-0+* trying to reset here does exist at this point (engines
could be fuseddrivers/gpu/drm/i915/intel_uncore.c +2
-0+* off in ICL+), so no waiting for acks +*/ __raw_i915_write32(i915, d->reg_set, i915-Quoted 1 line
uncore.fw_reset);
}
drivers/gpu/drm/i915/intel_uncore.c +17
-0@@ -1353,6 +1358,23 @@ static void fw_domain_init(structdrm_i915_private *dev_priv,fw_domain_reset (dev_priv ,d ); } +static void fw_domain_fini (struct drm_i915_private *dev_priv, +enum forcewake_domain_id domain_id) +{ +struct intel_uncore_forcewake_domain *d; + +if (WARN_ON (domain_id >=FW_DOMAIN_ID_COUNT )) +return ; + + d = &dev_priv->uncore.fw_domain[domain_id]; + +WARN_ON (d->wake_count); +WARN_ON (hrtimer_cancel (&d->timer)); +memset (d,0 ,sizeof (*d)); + + dev_priv->uncore.fw_domains &= ~BIT (domain_id); +} + static void intel_uncore_fw_domains_init(struct
drm_i915_private*dev_priv){ if (INTEL_GEN(dev_priv) <= 5 ||
intel_vgpu_active(dev_priv))drivers/gpu/drm/i915/intel_uncore.c +2
-0@@ -1565,6 +1587,40 @@ void intel_uncore_init(struct drm_i915_private *dev_priv) &dev_priv->uncore.pmic_bus_access_nb); } +/* +* We might have detected that some engines are fused off after we
initialized
+ * the forcewake domains. Prune them, to make sure they only reference existing
+ * engines.
+ */drivers/gpu/drm/i915/intel_uncore.c +4
-0+void intel_uncore_prune (struct drm_i915_private *dev_priv) +{ +if (INTEL_GEN (dev_priv) >=11 ) { + enum forcewake_domains fw_domains = dev_priv-Quoted 1 line
uncore.fw_domains;
drivers/gpu/drm/i915/intel_uncore.c +5
-0+enum forcewake_domain_id domain_id; +int i; + +for (i =0 ; i <I915_MAX_VCS ; i++) { + domain_id = FW_DOMAIN_ID_MEDIA_VDBOX0 +i;
drivers/gpu/drm/i915/intel_uncore.c +6
-0+ +if (HAS_ENGINE (dev_priv,_VCS (i))) +continue ; + +if (fw_domains &BIT (domain_id)) + fw_domain_fini(dev_priv,
domain_id);drivers/gpu/drm/i915/intel_uncore.c +4
-0+ } + +for (i =0 ; i <I915_MAX_VECS ; i++) { + domain_id = FW_DOMAIN_ID_MEDIA_VEBOX0 +i;
drivers/gpu/drm/i915/intel_uncore.c +6
-0+ +if (HAS_ENGINE (dev_priv,_VECS (i))) +continue ; + +if (fw_domains &BIT (domain_id)) + fw_domain_fini(dev_priv,
domain_id);drivers/gpu/drm/i915/intel_uncore.c +4
-0+ } + } +} +void intel_uncore_fini (struct drm_i915_private *dev_priv) {/* Paranoia: make sure we have disabled everything before
we exit. */drivers/gpu/drm/i915/intel_uncore.h +1
-0@@ -140,6 +140,7 @@ struct intel_uncore {void intel_uncore_sanitize (struct drm_i915_private *dev_priv);void intel_uncore_init (struct drm_i915_private *dev_priv); +void intel_uncore_prune (struct drm_i915_private *dev_priv);bool intel_uncore_unclaimed_mmio (struct drm_i915_private *dev_priv); bool intel_uncore_arm_unclaimed_mmio_detection(structdrm_i915_private *dev_priv); void intel_uncore_fini(struct drm_i915_private *dev_priv);
Quoted 4 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx