drm/i915: Initialize pm_intr_keep during intel_irq_init for GuC
Subsystems (2)
PATCH 1/3 drm/i915: Initialize pm_intr_keep during intel_irq_init for GuC
Driver needs to ensure that it doesn't mask the PM interrupts, which are unmasked/needed by GuC firmware. For that, Driver maintains a bitmask of interrupts to be kept unmasked, pm_intr_keep.
pm_intr_keep was determined across GuC load. GuC gets loaded in different scenarios and it is not going to change the pm_intr_keep so this patch moves its setup to intel_irq_init.
This patch fixes incorrect RPS masking and solves bunch of SKL GT3 performance regressions as Host RPS was taking frequency down when GuC is enabled. This was happening due to signed last_adj that becomes negative after 32 UP interrupts and makes cur_freq=min starting the ramp again. Next patch in the series avoids such frequency transitions.
Cc: Szwichtenberg, Radoslaw <[email protected]>
Cc: Tomi Sarvela <[email protected]>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97017
--- drivers/gpu/drm/i915/i915_irq.c | 24 ++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_reg.h | 3 ++- drivers/gpu/drm/i915/intel_guc_loader.c | 26 -------------------------- 3 files changed, 26 insertions(+), 27 deletions(-)
drivers/gpu/drm/i915/i915_irq.c +24 -0
@@ -4193,6 +4193,30 @@ void intel_irq_init(struct drm_i915_private *dev_priv)if (INTEL_INFO (dev_priv)->gen >=8 ) dev_priv->rps.pm_intr_keep |=GEN8_PMINTR_REDIRECT_TO_GUC ; +/* +* The REDIRECT_TO_GUC bit of the PMINTRMSK register directs all +* (unmasked) PM interrupts to the GuC. All other bits of this +* register *disable* generation of a specific interrupt. +* +* 'pm_intr_keep' indicates bits that are NOT to be set when +* writing to the PM interrupt mask register, i.e. interrupts +* that must not be disabled. +* +* If the GuC is handling these interrupts, then we must not let +* the PM code disable ANY interrupt that the GuC is expecting. +* So for each ENABLED (0) bit in this register, we must SET the +* bit in pm_intr_keep so that it's left enabled for the GuC. +* GuC needs ARAT expired interrupt unmasked hence it is set in +* pm_intr_keep. +* +* Here we CLEAR REDIRECT_TO_GUC bit in pm_intr_keep, which will +* result in the register bit being left SET! +*/ +if (HAS_GUC_SCHED (dev_priv)) { + dev_priv->rps.pm_intr_keep |=ARAT_EXPIRED_INTRMSK ; + dev_priv->rps.pm_intr_keep &= ~GEN8_PMINTR_REDIRECT_TO_GUC ; + } +if (IS_GEN2 (dev_priv)) {/* Gen2 doesn't have a hardware frame counter */ dev->max_vblank_count =0 ;
drivers/gpu/drm/i915/i915_reg.h +2 -1
@@ -7395,7 +7395,8 @@ enum {#define VLV_RCEDATA _MMIO(0xA0BC)#define GEN6_RC6pp_THRESHOLD _MMIO(0xA0C0)#define GEN6_PMINTRMSK _MMIO(0xA168) -#define GEN8_PMINTR_REDIRECT_TO_GUC (1<<31) +#define GEN8_PMINTR_REDIRECT_TO_GUC (1<<31) +#define ARAT_EXPIRED_INTRMSK (1<<9)#define GEN8_MISC_CTRL0 _MMIO(0xA180)#define VLV_PWRDWNUPCTL _MMIO(0xA294)#define GEN9_MEDIA_PG_IDLE_HYSTERESIS _MMIO(0xA0C4)
drivers/gpu/drm/i915/intel_guc_loader.c +0 -26
@@ -114,7 +114,6 @@ static void guc_interrupts_capture(struct drm_i915_private *dev_priv)struct intel_engine_cs *engine;enum intel_engine_id id;int irqs; -u32 tmp;/* tell all command streamers to forward interrupts (but not vblank) to GuC */ irqs =_MASKED_BIT_ENABLE (GFX_INTERRUPT_STEERING );
@@ -128,31 +127,6 @@ static void guc_interrupts_capture(struct drm_i915_private *dev_priv)I915_WRITE (GUC_BCS_RCS_IER , ~irqs);I915_WRITE (GUC_VCS2_VCS1_IER , ~irqs);I915_WRITE (GUC_WD_VECS_IER , ~irqs); - -/* -* The REDIRECT_TO_GUC bit of the PMINTRMSK register directs all -* (unmasked) PM interrupts to the GuC. All other bits of this -* register *disable* generation of a specific interrupt. -* -* 'pm_intr_keep' indicates bits that are NOT to be set when -* writing to the PM interrupt mask register, i.e. interrupts -* that must not be disabled. -* -* If the GuC is handling these interrupts, then we must not let -* the PM code disable ANY interrupt that the GuC is expecting. -* So for each ENABLED (0) bit in this register, we must SET the -* bit in pm_intr_keep so that it's left enabled for the GuC. -* -* OTOH the REDIRECT_TO_GUC bit is initially SET in pm_intr_keep -* (so interrupts go to the DISPLAY unit at first); but here we -* need to CLEAR that bit, which will result in the register bit -* being left SET! -*/ - tmp =I915_READ (GEN6_PMINTRMSK ); -if (tmp &GEN8_PMINTR_REDIRECT_TO_GUC ) { - dev_priv->rps.pm_intr_keep |= ~tmp; - dev_priv->rps.pm_intr_keep &= ~GEN8_PMINTR_REDIRECT_TO_GUC ; - } }static u32 get_gttype (struct drm_i915_private *dev_priv)
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/3 drm/i915: Set adjustment to zero on Up/Down interrupts if freq is already max/min
When we reach the user's RPS limits, stop requesting an adjustment. Even though we will clamp the requested frequency later, we rely on interrupt masking to disable further adjustments in the same direction. Even though it is unlikely (one scenario is a bug in the driver, another is careful manipulation through the uAPI) if we keep exponentially increasing the adjustment value, it will wrap and cause a negative adjustment.
--- drivers/gpu/drm/i915/i915_irq.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/i915/i915_irq.c +6 -0
@@ -1170,6 +1170,9 @@ static void gen6_pm_rps_work(struct work_struct *work) adj *=2 ; else /* CHV needs even encode values */ adj =IS_CHERRYVIEW (dev_priv) ?2 :1 ; + +if (new_delay >= dev_priv->rps.max_freq_softlimit) + adj =0 ;/* * For better performance, jump directly * to RPe if we're below it.
@@ -1191,6 +1194,9 @@ static void gen6_pm_rps_work(struct work_struct *work) adj *=2 ; else /* CHV needs even encode values */ adj =IS_CHERRYVIEW (dev_priv) ?-2 :-1 ; + +if (new_delay <= dev_priv->rps.min_freq_softlimit) + adj =0 ; }else {/* unknown event */ adj =0 ; }
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/3 drm/i915: Enable GuC submission
In reply to Sagar Arun Kamble--- drivers/gpu/drm/i915/i915_params.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_params.c +2 -2
@@ -56,8 +56,8 @@ struct i915_params i915 __read_mostly = { .verbose_state_checks = 1, .nuclear_pageflip = 0, .edp_vswing = 0, - .enable_guc_loading = 0, - .enable_guc_submission = 0, + .enable_guc_loading = 1, + .enable_guc_submission = 1, .guc_log_level = -1, .enable_dp_mst = true, .inject_load_failure = 0,
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for series starting with [CI,1/3] drm/i915: Initialize pm_intr_keep during intel_irq_init for GuC
In reply to Sagar Arun Kamble== Series Details ==
== Series Details ==
Series: series starting with [CI,1/3] drm/i915: Initialize pm_intr_keep during intel_irq_init for GuC
URL : https://patchwork.freedesktop.org/series/18254/
State : failure
== Summary ==
Series 18254v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/18254/revisions/1/mbox/
Test gem_busy:
Subgroup basic-hang-default:
fail -> PASS (fi-ivb-3520m)
Test gem_ringfill:
Subgroup basic-default-hang:
pass -> DMESG-FAIL (fi-bxt-j4205)
pass -> DMESG-FAIL (fi-skl-6770hq)
Subgroup basic-default-interruptible:
pass -> SKIP (fi-bxt-j4205)
pass -> SKIP (fi-skl-6770hq)
Test gem_sync:
Subgroup basic-all:
pass -> FAIL (fi-bxt-j4205)
pass -> FAIL (fi-skl-6770hq)
Subgroup basic-each:
pass -> FAIL (fi-bxt-j4205)
pass -> FAIL (fi-skl-6770hq)
Subgroup basic-many-each:
pass -> FAIL (fi-bxt-j4205)
pass -> FAIL (fi-skl-6770hq)
Subgroup basic-store-all:
pass -> FAIL (fi-bxt-j4205)
pass -> FAIL (fi-skl-6770hq)
Subgroup basic-store-each:
pass -> FAIL (fi-bxt-j4205)
pass -> FAIL (fi-skl-6770hq)
Test gem_tiled_blits:
Subgroup basic:
pass -> FAIL (fi-bxt-j4205)
pass -> FAIL (fi-skl-6770hq)
Test gem_tiled_fence_blits:
Subgroup basic:
pass -> FAIL (fi-bxt-j4205)
pass -> FAIL (fi-skl-6770hq)
Test gem_wait:
Subgroup basic-busy-all:
pass -> FAIL (fi-bxt-j4205)
pass -> FAIL (fi-skl-6770hq)
Subgroup basic-wait-all:
pass -> FAIL (fi-bxt-j4205)
pass -> FAIL (fi-skl-6770hq)
Test gem_workarounds:
Subgroup basic-read:
pass -> FAIL (fi-bxt-j4205)
pass -> FAIL (fi-skl-6770hq)fi-bdw-5557u total:246 pass:232 dwarn:0 dfail:0 fail:0 skip:14 fi-bsw-n3050 total:246 pass:207 dwarn:0 dfail:0 fail:0 skip:39 fi-bxt-j4205 total:246 pass:212 dwarn:0 dfail:1 fail:10 skip:23 fi-bxt-t5700 total:79 pass:66 dwarn:0 dfail:0 fail:0 skip:12 fi-byt-j1900 total:246 pass:219 dwarn:0 dfail:0 fail:0 skip:27 fi-byt-n2820 total:246 pass:215 dwarn:0 dfail:0 fail:0 skip:31 fi-hsw-4770 total:246 pass:227 dwarn:0 dfail:0 fail:0 skip:19 fi-hsw-4770r total:246 pass:227 dwarn:0 dfail:0 fail:0 skip:19 fi-ivb-3520m total:246 pass:225 dwarn:0 dfail:0 fail:0 skip:21 fi-kbl-7500u total:246 pass:225 dwarn:0 dfail:0 fail:0 skip:21 fi-skl-6260u total:246 pass:233 dwarn:0 dfail:0 fail:0 skip:13 fi-skl-6700hq total:246 pass:226 dwarn:0 dfail:0 fail:0 skip:20 fi-skl-6700k total:246 pass:222 dwarn:3 dfail:0 fail:0 skip:21 fi-skl-6770hq total:246 pass:221 dwarn:0 dfail:1 fail:10 skip:14 fi-snb-2520m total:246 pass:215 dwarn:0 dfail:0 fail:0 skip:31 fi-snb-2600 total:246 pass:214 dwarn:0 dfail:0 fail:0 skip:32
6155f94d32e438a9656de680897060bd2245629a drm-tip: 2017y-01m-19d-18h-24m-49s UTC integration manifest f89e5e8 drm/i915: Enable GuC submission
486fbda drm/i915: Set adjustment to zero on Up/Down interrupts if freq is already max/min 6bf613c drm/i915: Initialize pm_intr_keep during intel_irq_init for GuC
== Logs ==
For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_3553/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx