RC6/Forcewake/Turbo related changes for Gen9
Subsystems (2)
cover RC6/Forcewake/Turbo related changes for Gen9
Patch 1: On BXT, forcewake ACK is taking time more than 2ms sometimes. Setting it to recommanded value of 50ms. This is maximum timeout limit.
Patch 2: On GT CPD Exit CS behavior is leading to hangs on BXT A0/A1. WA is to disable turbo and frequency requests.
Patch 3 and Patch 4:
WaRsDisableCoarsePowerGating is applicable to Gen9 platforms with revision prior to BXT B0 and until SKL E0. Per this WA, both render and media PG need to be disabled. Due to this only blitter forcewake need to be used for all GT accesses.
Patch 5: When GuC is enabled, it need to be informed about status of Coarse Power Gating (CPG) for GuC to know when to forcewake render/media domains.
Alex Dai (1):
drm/i915: Notify Coarse Power Gating changes to GuC
Sagar Arun Kamble (4):
drm/i915: Increase maximum polling time to 50ms for forcewake
request/clear ack
drm/i915/bxt: WaGsvDisableTurbo
drm/i915: WaRsDisableCoarsePowerGating
drm/i915: Use only blitter forcewake
drivers/gpu/drm/i915/i915_debugfs.c | 5 ++- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_guc_submission.c | 18 ++++++++++ drivers/gpu/drm/i915/intel_guc.h | 1 + drivers/gpu/drm/i915/intel_pm.c | 29 +++++++++++++--- drivers/gpu/drm/i915/intel_uncore.c | 55 ++++++++++++++++++++++++------ 6 files changed, 93 insertions(+), 16 deletions(-)
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/5 drm/i915: Increase maximum polling time to 50ms for forcewake request/clear ack
On BXT, We Observe timeout for forcewake request completion with 2ms polling period as given here:
[drm:fw_domains_get] ERROR render: timed out waiting for forcewake ack request. Polling for 50ms is recommended to avoid these timeouts.
--- drivers/gpu/drm/i915/intel_uncore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_uncore.c +1 -1
@@ -27,7 +27,7 @@#include <linux/pm_runtime.h> -#define FORCEWAKE_ACK_TIMEOUT_MS 2 +#define FORCEWAKE_ACK_TIMEOUT_MS 50#define __raw_i915_read8 (dev_priv__, reg__) readb((dev_priv__)->regs + (reg__))#define __raw_i915_write8 (dev_priv__, reg__, val__) writeb(val__, (dev_priv__)->regs + (reg__))
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 1/5] drm/i915: Increase maximum polling time to 50ms for forcewake request/clear ack
Quoted 6 lines · Sagar Arun Kamble
On BXT, We Observe timeout for forcewake request completion with 2ms polling period as given here:
[drm:fw_domains_get] ERROR render: timed out waiting for forcewake ack request. Polling for 50ms is recommended to avoid these timeouts.Change-Id Ie715b0069a3049606e9602bc5e97a6511890864dSigned-off-by Sagar Arun Kamble <[email protected]>
Probably needs cc: stable plus a pile of bugzilla links all over ... -Daniel
Quoted 24 lines
--- drivers/gpu/drm/i915/intel_uncore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/intel_uncore.c +1
-1@@ -27,7 +27,7 @@#include <linux/pm_runtime.h> -#define FORCEWAKE_ACK_TIMEOUT_MS 2 +#define FORCEWAKE_ACK_TIMEOUT_MS 50#define __raw_i915_read8 (dev_priv__, reg__) readb((dev_priv__)->regs + (reg__))#define __raw_i915_write8 (dev_priv__, reg__, val__) writeb(val__, (dev_priv__)->regs + (reg__))Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 1/5] drm/i915: Increase maximum polling time to 50ms for forcewake request/clear ack
Quoted 9 lines · Daniel Vetter
Quoted 6 lines · Sagar Arun Kamble
On BXT, We Observe timeout for forcewake request completion with 2ms polling period as given here:
[drm:fw_domains_get] ERROR render: timed out waiting for forcewake ack request. Polling for 50ms is recommended to avoid these timeouts.Change-Id Ie715b0069a3049606e9602bc5e97a6511890864dSigned-off-by Sagar Arun Kamble <[email protected]>Probably needs cc: stable plus a pile of bugzilla links all over ...
If the required wait is typically that long, shouldn't we be worried about busy polling?
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 1/5] drm/i915: Increase maximum polling time to 50ms for forcewake request/clear ack
Quoted 7 lines · Tvrtko Ursulin
Quoted 5 lines · Daniel Vetter
Quoted 4 lines · Sagar Arun Kamble
On BXT, We Observe timeout for forcewake request completion with 2ms polling period as given here:
[drm:fw_domains_get] ERROR render: timed out waiting for forcewake ack request. Polling for 50ms is recommended to avoid these timeouts.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
Change-Id Ie715b0069a3049606e9602bc5e97a6511890864dSigned-off-by Sagar Arun Kamble <[email protected]>Probably needs cc: stable plus a pile of bugzilla links all over ...
If the required wait is typically that long, shouldn't we be worried about busy polling?
With an exponential backoff (i.e. busyspin for the first ~jiffie/1ms) then usleep_range 1, 2, 4, 8,..?
And also keeping the fw wakelock for longer than a jiffie to optimistically avoid these multi-jiffie stalls. Whilst grumbling. -Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 1/5] drm/i915: Increase maximum polling time to 50ms for forcewake request/clear ack
Quoted 13 lines · Chris Wilson
Quoted 12 lines · Tvrtko Ursulin
Quoted 9 lines · Daniel Vetter
Quoted 6 lines · Sagar Arun Kamble
On BXT, We Observe timeout for forcewake request completion with 2ms polling period as given here:
[drm:fw_domains_get] ERROR render: timed out waiting for forcewake ack request. Polling for 50ms is recommended to avoid these timeouts.Change-Id Ie715b0069a3049606e9602bc5e97a6511890864dSigned-off-by Sagar Arun Kamble <[email protected]>Probably needs cc: stable plus a pile of bugzilla links all over ...
Quoted 8 lines
Quoted 2 lines
If the required wait is typically that long, shouldn't we be worried about busy polling?
With an exponential backoff (i.e. busyspin for the first ~jiffie/1ms) then
usleep_range1, 2, 4, 8,..?And also keeping the fw wakelock for longer than a jiffie to optimistically avoid these multi-jiffie stalls. Whilst grumbling.
For the atomic case holding it longer is the only option.
But key is how typical or atypical these long waits are. Measuring that together with power use sounds critical.
Spread of required waits would also give the answer to what the best sleeping strategy for the non-atomic case is.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 1/5] drm/i915: Increase maximum polling time to 50ms for forcewake request/clear ack
In reply to Sagar Arun KambleLooks fine to me.
Reviewed by: Alex Dai <[email protected]>.
Quoted 15 lines · Sagar Arun Kamble
On BXT, We Observe timeout for forcewake request completion with 2ms polling period as given here:
[drm:fw_domains_get] ERROR render: timed out waiting for forcewake ack request. Polling for 50ms is recommended to avoid these timeouts.Change-Id Ie715b0069a3049606e9602bc5e97a6511890864dSigned-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/intel_uncore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/intel_uncore.c +0
-0
drivers/gpu/drm/i915/intel_uncore.c line 33
Quoted 8 lines
drivers/gpu/drm/i915/intel_uncore.c +1
-1@@ -27,7 +27,7 @@#include <linux/pm_runtime.h> -#define FORCEWAKE_ACK_TIMEOUT_MS 2 +#define FORCEWAKE_ACK_TIMEOUT_MS 50#define __raw_i915_read8 (dev_priv__, reg__) readb((dev_priv__)->regs + (reg__))#define __raw_i915_write8 (dev_priv__, reg__, val__) writeb(val__, (dev_priv__)->regs + (reg__))
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter
AppliedRe: [PATCH 1/5] drm/i915: Increase maximum polling time to 50ms for forcewake request/clear ack
Quoted 10 lines · Yu Dai
Looks fine to me.
Reviewed by: Alex Dai <[email protected]>.Quoted 6 lines · Sagar Arun Kamble
On BXT, We Observe timeout for forcewake request completion with 2ms polling period as given here:
[drm:fw_domains_get] ERROR render: timed out waiting for forcewake ack request. Polling for 50ms is recommended to avoid these timeouts.Change-Id Ie715b0069a3049606e9602bc5e97a6511890864dSigned-off-by Sagar Arun Kamble <[email protected]>
Queued for -next, thanks for the patch.
-Daniel
Quoted 19 lines
Quoted 9 lines
--- drivers/gpu/drm/i915/intel_uncore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/i915/intel_uncore.c +0
-0drivers/gpu/drm/i915/intel_uncore.c line 30
Quoted 5 lines
drivers/gpu/drm/i915/intel_uncore.c +1
-1@@ -27,7 +27,7 @@#include <linux/pm_runtime.h> -#define FORCEWAKE_ACK_TIMEOUT_MS 2 +#define FORCEWAKE_ACK_TIMEOUT_MS 50#define __raw_i915_read8 (dev_priv__, reg__) readb((dev_priv__)->regs + (reg__))#define __raw_i915_write8 (dev_priv__, reg__, val__) writeb(val__, (dev_priv__)->regs + (reg__))_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/5 drm/i915/bxt: WaGsvDisableTurbo
In reply to Sagar Arun KambleDisable Turbo on steppings prior to B0 on BXT due to hangs seen during GT CPD exit.
--- drivers/gpu/drm/i915/intel_pm.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +10 -0
@@ -4450,6 +4450,10 @@ static void gen6_set_rps(struct drm_device *dev, u8 val) {struct drm_i915_private *dev_priv = dev->dev_private; +/* WaGsvDisableTurbo: Workaround to disable turbo on BXT A* */ +if (IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) +return ; +WARN_ON (!mutex_is_locked (&dev_priv->rps.hw_lock));WARN_ON (val > dev_priv->rps.max_freq);WARN_ON (val < dev_priv->rps.min_freq);
@@ -4770,6 +4774,12 @@ static void gen9_enable_rps(struct drm_device *dev)gen6_init_rps_frequencies (dev); +/* WaGsvDisableTurbo: Workaround to disable turbo on BXT A* */ +if (IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) { +intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL ); +return ; + } +/* Program defaults and thresholds for RPS*/ I915_WRITE (GEN6_RC_VIDEO_FREQ ,GEN9_FREQUENCY (dev_priv->rps.rp1_freq));
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/5] drm/i915/bxt: WaGsvDisableTurbo
Gentle reminder for review.
Thanks
Sagar
Quoted 26 lines · Sagar Arun Kamble
Disable Turbo on steppings prior to B0 on BXT due to hangs seen during GT CPD exit.
Change-Id I50c5c03f59f5ba092db19e17234951d89db42c6cSigned-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/gpu/drm/i915/intel_pm.c +4
-0@@ -4450,6 +4450,10 @@ static void gen6_set_rps(struct drm_device *dev, u8 val) {struct drm_i915_private *dev_priv = dev->dev_private; +/* WaGsvDisableTurbo: Workaround to disable turbo on BXT A* */ +if (IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) +return ; +WARN_ON (!mutex_is_locked (&dev_priv->rps.hw_lock));WARN_ON (val > dev_priv->rps.max_freq);WARN_ON (val < dev_priv->rps.min_freq);@@ -4770,6 +4774,12 @@ static void gen9_enable_rps(struct drm_device *dev)gen6_init_rps_frequencies (dev);
drivers/gpu/drm/i915/intel_pm.c static void gen9_enable_rps(struct drm_device *dev) · line 4785
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +6
-0+/* WaGsvDisableTurbo: Workaround to disable turbo on BXT A* */ +if (IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) { +intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL ); +return ; + } +/* Program defaults and thresholds for RPS*/ I915_WRITE (GEN6_RC_VIDEO_FREQ ,GEN9_FREQUENCY (dev_priv->rps.rp1_freq));
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/5] drm/i915/bxt: WaGsvDisableTurbo
Hi Tom, Akash
Kindly review this patch.
Thanks
Sagar
Quoted 38 lines · Sagar A
Gentle reminder for review.
Thanks
SagarQuoted 32 lines · Sagar Arun Kamble
Disable Turbo on steppings prior to B0 on BXT due to hangs seen during GT CPD exit.
Change-Id I50c5c03f59f5ba092db19e17234951d89db42c6cSigned-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/gpu/drm/i915/intel_pm.c +8
-0@@ -4450,6 +4450,10 @@ static void gen6_set_rps(struct drm_device *dev, u8 val) {struct drm_i915_private *dev_priv = dev->dev_private; +/* WaGsvDisableTurbo: Workaround to disable turbo on BXT A* */ + if (IS_BROXTON(dev) && (INTEL_REVID(dev) < BXT_REVID_B0)) + return; +WARN_ON (!mutex_is_locked (&dev_priv->rps.hw_lock));WARN_ON (val > dev_priv->rps.max_freq);WARN_ON (val < dev_priv->rps.min_freq);@@ -4770,6 +4774,12 @@ static void gen9_enable_rps(struct drm_device *dev)gen6_init_rps_frequencies (dev); +/* WaGsvDisableTurbo: Workaround to disable turbo on BXT A* */ + if (IS_BROXTON(dev) && (INTEL_REVID(dev) < BXT_REVID_B0)) { +intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL ); +return ; + } +
Quoted 8 lines
drivers/gpu/drm/i915/intel_pm.c static void gen9_enable_rps(struct drm_device *dev) · line 4785
Quoted 3 lines
drivers/gpu/drm/i915/intel_pm.c +0
-0/* Program defaults and thresholds for RPS*/ I915_WRITE (GEN6_RC_VIDEO_FREQ ,GEN9_FREQUENCY (dev_priv->rps.rp1_freq));_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/5] drm/i915/bxt: WaGsvDisableTurbo
In reply to Sagar Arun KambleLooks fine to me.
Reviewed by: Alex Dai <[email protected]>.
Quoted 26 lines · Sagar Arun Kamble
Disable Turbo on steppings prior to B0 on BXT due to hangs seen during GT CPD exit.
Change-Id I50c5c03f59f5ba092db19e17234951d89db42c6cSigned-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/gpu/drm/i915/intel_pm.c +4
-0@@ -4450,6 +4450,10 @@ static void gen6_set_rps(struct drm_device *dev, u8 val) {struct drm_i915_private *dev_priv = dev->dev_private; +/* WaGsvDisableTurbo: Workaround to disable turbo on BXT A* */ +if (IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) +return ; +WARN_ON (!mutex_is_locked (&dev_priv->rps.hw_lock));WARN_ON (val > dev_priv->rps.max_freq);WARN_ON (val < dev_priv->rps.min_freq);@@ -4770,6 +4774,12 @@ static void gen9_enable_rps(struct drm_device *dev)gen6_init_rps_frequencies (dev);
drivers/gpu/drm/i915/intel_pm.c static void gen9_enable_rps(struct drm_device *dev) · line 4785
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +6
-0+/* WaGsvDisableTurbo: Workaround to disable turbo on BXT A* */ +if (IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) { +intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL ); +return ; + } +/* Program defaults and thresholds for RPS*/ I915_WRITE (GEN6_RC_VIDEO_FREQ ,GEN9_FREQUENCY (dev_priv->rps.rp1_freq));
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter
AppliedRe: [PATCH 2/5] drm/i915/bxt: WaGsvDisableTurbo
Quoted 8 lines · Yu Dai
Looks fine to me.
Reviewed by: Alex Dai <[email protected]>.Quoted 4 lines · Sagar Arun Kamble
Disable Turbo on steppings prior to B0 on BXT due to hangs seen during GT CPD exit.
Change-Id I50c5c03f59f5ba092db19e17234951d89db42c6cSigned-off-by Sagar Arun Kamble <[email protected]>
Queued for -next, thanks for the patch.
-Daniel
Quoted 34 lines
Quoted 19 lines
--- drivers/gpu/drm/i915/intel_pm.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/gpu/drm/i915/intel_pm.c +4
-0@@ -4450,6 +4450,10 @@ static void gen6_set_rps(struct drm_device *dev, u8 val) {struct drm_i915_private *dev_priv = dev->dev_private; +/* WaGsvDisableTurbo: Workaround to disable turbo on BXT A* */ +if (IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) +return ; +WARN_ON (!mutex_is_locked (&dev_priv->rps.hw_lock));WARN_ON (val > dev_priv->rps.max_freq);WARN_ON (val < dev_priv->rps.min_freq);drivers/gpu/drm/i915/intel_pm.c static void gen9_enable_rps(struct drm_device *dev) · line 4783
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +6
-0@@ -4770,6 +4774,12 @@ static void gen9_enable_rps(struct drm_device *dev)gen6_init_rps_frequencies (dev); +/* WaGsvDisableTurbo: Workaround to disable turbo on BXT A* */ +if (IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) { +intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL ); +return ; + } +/* Program defaults and thresholds for RPS*/ I915_WRITE (GEN6_RC_VIDEO_FREQ ,GEN9_FREQUENCY (dev_priv->rps.rp1_freq));_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/5 drm/i915: WaRsDisableCoarsePowerGating
In reply to Sagar Arun KambleWaRsDisableCoarsePowerGating: Coarse Power Gating (CPG) needs to be disabled for platforms prior to BXT B0 and till SKL E0.
--- drivers/gpu/drm/i915/intel_pm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +7 -4
@@ -4840,11 +4840,14 @@ static void gen9_enable_rc6(struct drm_device *dev)/* * 3b: Enable Coarse Power Gating only when RC6 is enabled. -* WaDisableRenderPowerGating:skl,bxt - Render PG need to be disabled with RC6. +* WaRsDisableCoarsePowerGating:skl,bxt - Render/Media PG need to be disabled with RC6. */ -I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? -GEN9_MEDIA_PG_ENABLE :0 ); - +if ((IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) || + (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) +I915_WRITE (GEN9_PG_ENABLE ,0 ); +else +I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? + (GEN9_RENDER_PG_ENABLE |GEN9_MEDIA_PG_ENABLE ) :0 );intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL );
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/5] drm/i915: WaRsDisableCoarsePowerGating
Hi Alex,
Kindly review this patch.
Thanks
Sagar
Quoted 22 lines · Sagar Arun Kamble
WaRsDisableCoarsePowerGating: Coarse Power Gating (CPG) needs to be disabled for platforms prior to BXT B0 and till SKL E0.
Change-Id Ia3c4c16e050c88d3e259f601054875c812d69c3aSigned-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_pm.c +1
-3@@ -4840,11 +4840,14 @@ static void gen9_enable_rc6(struct drm_device *dev)/* * 3b: Enable Coarse Power Gating only when RC6 is enabled. -* WaDisableRenderPowerGating:skl,bxt - Render PG need to be disabled with RC6. +* WaRsDisableCoarsePowerGating:skl,bxt - Render/Media PG need to be disabled with RC6. */ -I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? -GEN9_MEDIA_PG_ENABLE :0 );
drivers/gpu/drm/i915/intel_pm.c static void gen9_enable_rc6(struct drm_device *dev) · line 4853
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +6
-1- +if ((IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) || + (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) +I915_WRITE (GEN9_PG_ENABLE ,0 ); +else +I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? + (GEN9_RENDER_PG_ENABLE |GEN9_MEDIA_PG_ENABLE ) :0 );intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL );
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/2 drm/i915: Add IS_SKL_GT3 and IS_SKL_GT4 macro.
It will be usefull to specify w/a that affects only SKL GT3 and GT4.
--- drivers/gpu/drm/i915/i915_drv.h | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +5 -0
@@ -2491,6 +2491,11 @@ struct drm_i915_cmd_table {#define IS_SKL_ULX (dev) (INTEL_DEVID(dev) == 0x190E || \ INTEL_DEVID(dev) == 0x1915 || \ INTEL_DEVID(dev) == 0x191E) +#define IS_SKL_GT3 (dev) (IS_SKYLAKE(dev) && \ + (INTEL_DEVID(dev) & 0x00F0) == 0x0020) +#define IS_SKL_GT4 (dev) (IS_SKYLAKE(dev) && \ + (INTEL_DEVID(dev) & 0x00F0) == 0x0030) +#define IS_PRELIMINARY_HW (intel_info) ((intel_info)->is_preliminary)#define SKL_REVID_A0 (0x0)
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/2 drm/i915: WaRsDisableCoarsePowerGating
WaRsDisableCoarsePowerGating: Coarse Power Gating (CPG) needs to be disabled for platforms prior to BXT B0 and SKL GT3/GT4 till E0.
v2: Added GT3/GT4 Check.
--- drivers/gpu/drm/i915/intel_pm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +7 -4
@@ -4853,11 +4853,14 @@ static void gen9_enable_rc6(struct drm_device *dev)/* * 3b: Enable Coarse Power Gating only when RC6 is enabled. -* WaDisableRenderPowerGating:skl,bxt - Render PG need to be disabled with RC6. +* WaRsDisableCoarsePowerGating:skl,bxt - Render/Media PG need to be disabled with RC6. */ -I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? -GEN9_MEDIA_PG_ENABLE :0 ); - +if ((IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) || + ((IS_SKL_GT3 (dev) ||IS_SKL_GT4 ) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) +I915_WRITE (GEN9_PG_ENABLE ,0 ); +else +I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? + (GEN9_RENDER_PG_ENABLE |GEN9_MEDIA_PG_ENABLE ) :0 );intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL );
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 1/1 drm/i915: WaRsDisableCoarsePowerGating
WaRsDisableCoarsePowerGating: Coarse Power Gating (CPG) needs to be disabled for platforms prior to BXT B0 and SKL GT3/GT4 till E0.
v2: Added GT3/GT4 Check.
--- drivers/gpu/drm/i915/intel_pm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +7 -4
@@ -4853,11 +4853,14 @@ static void gen9_enable_rc6(struct drm_device *dev)/* * 3b: Enable Coarse Power Gating only when RC6 is enabled. -* WaDisableRenderPowerGating:skl,bxt - Render PG need to be disabled with RC6. +* WaRsDisableCoarsePowerGating:skl,bxt - Render/Media PG need to be disabled with RC6. */ -I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? -GEN9_MEDIA_PG_ENABLE :0 ); - +if ((IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) || + ((IS_SKL_GT3 (dev) ||IS_SKL_GT4 (dev)) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) +I915_WRITE (GEN9_PG_ENABLE ,0 ); +else +I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? + (GEN9_RENDER_PG_ENABLE |GEN9_MEDIA_PG_ENABLE ) :0 );intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL );
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/5] drm/i915: WaRsDisableCoarsePowerGating
In reply to Sagar Arun KambleQuoted 22 lines · Sagar Arun Kamble
WaRsDisableCoarsePowerGating: Coarse Power Gating (CPG) needs to be disabled for platforms prior to BXT B0 and till SKL E0.
Change-Id Ia3c4c16e050c88d3e259f601054875c812d69c3aSigned-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_pm.c +1
-3@@ -4840,11 +4840,14 @@ static void gen9_enable_rc6(struct drm_device *dev)/* * 3b: Enable Coarse Power Gating only when RC6 is enabled. -* WaDisableRenderPowerGating:skl,bxt - Render PG need to be disabled with RC6. +* WaRsDisableCoarsePowerGating:skl,bxt - Render/Media PG need to be disabled with RC6. */ -I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? -GEN9_MEDIA_PG_ENABLE :0 );
drivers/gpu/drm/i915/intel_pm.c static void gen9_enable_rc6(struct drm_device *dev) · line 4853
Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +6
-1- +if ((IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) || + (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) +I915_WRITE (GEN9_PG_ENABLE ,0 ); +else +I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? + (GEN9_RENDER_PG_ENABLE |GEN9_MEDIA_PG_ENABLE ) :0 );intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL );
Reviewed by: Alex Dai <[email protected]>.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/5] drm/i915: WaRsDisableCoarsePowerGating
Quoted 26 lines · Yu Dai
Quoted 23 lines · Sagar Arun Kamble
WaRsDisableCoarsePowerGating: Coarse Power Gating (CPG) needs to be disabled for platforms prior to BXT B0 and till SKL E0.
Change-Id Ia3c4c16e050c88d3e259f601054875c812d69c3aSigned-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/intel_pm.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_pm.c +2
-4@@ -4840,11 +4840,14 @@ static void gen9_enable_rc6(struct drm_device *dev)/* * 3b: Enable Coarse Power Gating only when RC6 is enabled. -* WaDisableRenderPowerGating:skl,bxt - Render PG need to be disabled with RC6. +* WaRsDisableCoarsePowerGating:skl,bxt - Render/Media PG need to be disabled with RC6. */ -I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? -GEN9_MEDIA_PG_ENABLE :0 ); - + if ((IS_BROXTON(dev) && (INTEL_REVID(dev) < BXT_REVID_B0)) ||
Quoted 8 lines
drivers/gpu/drm/i915/intel_pm.c static void gen9_enable_rc6(struct drm_device *dev) · line 4852
Quoted 6 lines
drivers/gpu/drm/i915/intel_pm.c +5
-0+ (IS_SKYLAKE(dev) && (INTEL_REVID(dev) <= SKL_REVID_E0))) +I915_WRITE (GEN9_PG_ENABLE ,0 ); + else + I915_WRITE(GEN9_PG_ENABLE, (rc6_mask & GEN6_RC_CTL_RC6_ENABLE) ? + (GEN9_RENDER_PG_ENABLE | GEN9_MEDIA_PG_ENABLE) : 0);intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL );Reviewed by: Alex Dai <[email protected]>.
You reviewed an old version of this patch.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/5 drm/i915: Use only blitter forcewake
In reply to Sagar Arun KambleCoarse power gating is disabled prior to BXT B0 and till SKL E0, hence even for render and media well registers blitter forcewake request need to be used.
--- drivers/gpu/drm/i915/i915_debugfs.c | 5 +++- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_uncore.c | 53 ++++++++++++++++++++++++++++++------- 3 files changed, 48 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +4 -1
@@ -1509,7 +1509,10 @@ static int gen6_drpc_info(struct seq_file *m)intel_runtime_pm_get (dev_priv);spin_lock_irq (&dev_priv->uncore.lock); - forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_RENDER ].wake_count; +if (use_blitter_forcewake (dev)) + forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_BLITTER ].wake_count; +else + forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_RENDER ].wake_count;spin_unlock_irq (&dev_priv->uncore.lock);if (forcewake_count) {
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -2691,6 +2691,7 @@ extern void intel_uncore_check_errors(struct drm_device *dev);extern void intel_uncore_fini (struct drm_device *dev);extern void intel_uncore_forcewake_reset (struct drm_device *dev,bool restore);const char *intel_uncore_forcewake_domain_to_str (const enum forcewake_domain_id id); +bool use_blitter_forcewake (struct drm_device *dev);void intel_uncore_forcewake_get (struct drm_i915_private *dev_priv,enum forcewake_domains domains); void intel_uncore_forcewake_put(struct drm_i915_private *dev_priv,
drivers/gpu/drm/i915/intel_uncore.c +43 -10
97 lines not on this page · raw message
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 4/5] drm/i915: Use only blitter forcewake
Quoted 3 lines · Sagar Arun Kamble
Coarse power gating is disabled prior to BXT B0 and till SKL E0, hence even for render and media well registers blitter forcewake request need to be used.
Just insert a custom force_wake_get/put for the w/a.
Something like
gen9_force_wake_get_wa()
{
return fw_domains_get(BLITTER);
}The fw counting will make it work just fine.
-Chris
Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 4/5] drm/i915: Use only blitter forcewake
Thanks Chris.
Domain refcount tracking is not common single function.
its present in __force_wake_get, __intel_uncore_forcewake_get and likewise for put functions.
Either we will have to bring them together in fw_domains_get and then add change you have suggested Or
Prepare WA version of __force_wake_get and __intel_uncore_forcewake_get
Or
approach in the current patch where we only init blitter domain.
This will work from __intel_uncore_forcewake_get as well as it filters domains based on dev_priv->uncore.fw_domains.
Let me know which approach looks good.
Quoted 8 lines · Chris Wilson
Quoted 3 lines · Sagar Arun Kamble
Coarse power gating is disabled prior to BXT B0 and till SKL E0, hence even for render and media well registers blitter forcewake request need to be used.
Just insert a custom force_wake_get/put for the w/a.
Something like
Quoted 8 lines
gen9_force_wake_get_wa(){ return fw_domains_get(BLITTER); }The fw counting will make it work just fine.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 4/5] drm/i915: Use only blitter forcewake
In reply to Sagar Arun KambleQuoted 45 lines · Sagar Arun Kamble
Coarse power gating is disabled prior to BXT B0 and till SKL E0, hence even for render and media well registers blitter forcewake request need to be used.
Change-Id Ibfa8abf02b4d27ca1fcd68fc9e98c2daade7c286Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 5 +++- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_uncore.c | 53 ++++++++++++++++++++++++++++++------- 3 files changed, 48 insertions(+), 11 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +4
-1@@ -1509,7 +1509,10 @@ static int gen6_drpc_info(struct seq_file *m)intel_runtime_pm_get (dev_priv);spin_lock_irq (&dev_priv->uncore.lock); - forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_RENDER ].wake_count; +if (use_blitter_forcewake (dev)) + forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_BLITTER ].wake_count; +else + forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_RENDER ].wake_count;spin_unlock_irq (&dev_priv->uncore.lock);if (forcewake_count) {drivers/gpu/drm/i915/i915_drv.h +1
-0@@ -2691,6 +2691,7 @@ extern void intel_uncore_check_errors(struct drm_device *dev);extern void intel_uncore_fini (struct drm_device *dev);extern void intel_uncore_forcewake_reset (struct drm_device *dev,bool restore);const char *intel_uncore_forcewake_domain_to_str (const enum forcewake_domain_id id); +bool use_blitter_forcewake (struct drm_device *dev);void intel_uncore_forcewake_get (struct drm_i915_private *dev_priv,enum forcewake_domains domains); void intel_uncore_forcewake_put(struct drm_i915_private *dev_priv,drivers/gpu/drm/i915/intel_uncore.c +0
-0
drivers/gpu/drm/i915/intel_uncore.c intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id) · line 71
Quoted 9 lines
drivers/gpu/drm/i915/intel_uncore.c +6
-0@@ -63,6 +63,19 @@ intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id)return "unknown" ; } +bool use_blitter_forcewake (struct drm_device *dev) +{ +/* +* Due to WaRsDisableCoarsePowerGating, Only blitter forcewake need to +* be used on platforms previous to BXT B0 and until SKL E0. +*/
You say only blitter forcewake need be used. OK, but how does that imply that you need to grab the blitter forcewake for render/media wells as well?
Quoted 101 lines
drivers/gpu/drm/i915/intel_uncore.c +37
-10+if ((IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) || + (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) +return true; +else +return false; +} +static void assert_device_not_suspended (struct drm_i915_private *dev_priv) {@@ -129,6 +142,9 @@ fw_domains_get(struct drm_i915_private *dev_priv, enum forcewake_domains fw_domastruct intel_uncore_forcewake_domain *d;enum forcewake_domain_id id; +WARN_ON (use_blitter_forcewake (dev_priv->dev) && + (fw_domains & ~FORCEWAKE_BLITTER )); +for_each_fw_domain_mask (d, fw_domains, dev_priv, id) {fw_domain_wait_ack_clear (d);fw_domain_get (d);@@ -142,6 +158,9 @@ fw_domains_put(struct drm_i915_private *dev_priv, enum forcewake_domains fw_domastruct intel_uncore_forcewake_domain *d;enum forcewake_domain_id id; +WARN_ON (use_blitter_forcewake (dev_priv->dev) && + (fw_domains & ~FORCEWAKE_BLITTER )); +for_each_fw_domain_mask (d, fw_domains, dev_priv, id) {fw_domain_put (d);fw_domain_posting_read (d);@@ -313,6 +332,11 @@ void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)if (fw) dev_priv->uncore.funcs.force_wake_put (dev_priv, fw); +if (use_blitter_forcewake (dev) && !restore) { +__raw_i915_write32 (dev_priv,FORCEWAKE_RENDER_GEN9 ,_MASKED_BIT_DISABLE (0xffff )); +__raw_i915_write32 (dev_priv,FORCEWAKE_MEDIA_GEN9 ,_MASKED_BIT_DISABLE (0xffff )); + } +fw_domains_reset (dev_priv,FORCEWAKE_ALL );if (restore) {/* If reset with a user forcewake, try to restore */ @@ -780,8 +804,11 @@ gen9_read##x(struct drm_i915_private *dev_priv, off_t reg, bool trace) { \ fw_engine =FORCEWAKE_RENDER |FORCEWAKE_MEDIA ; \ else \ fw_engine =FORCEWAKE_BLITTER ; \ -if (fw_engine) \ +if (fw_engine) { \ +if (use_blitter_forcewake (dev_priv->dev)) \ + fw_engine =FORCEWAKE_BLITTER ; \__force_wake_get (dev_priv, fw_engine); \ + } \ val = __raw_i915_read##x(dev_priv, reg); \ GEN6_READ_FOOTER; \ }@@ -994,8 +1021,11 @@ gen9_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, \ fw_engine =FORCEWAKE_RENDER |FORCEWAKE_MEDIA ; \ else \ fw_engine =FORCEWAKE_BLITTER ; \ -if (fw_engine) \ +if (fw_engine) { \ +if (use_blitter_forcewake (dev_priv->dev)) \ + fw_engine =FORCEWAKE_BLITTER ; \__force_wake_get (dev_priv, fw_engine); \ + } \ __raw_i915_write##x(dev_priv, reg, val); \ GEN6_WRITE_FOOTER; \ }@@ -1106,14 +1136,17 @@ static void intel_uncore_fw_domains_init(struct drm_device *dev)if (IS_GEN9 (dev)) { dev_priv->uncore.funcs.force_wake_get = fw_domains_get; dev_priv->uncore.funcs.force_wake_put = fw_domains_put; -fw_domain_init (dev_priv,FW_DOMAIN_ID_RENDER , -FORCEWAKE_RENDER_GEN9 , -FORCEWAKE_ACK_RENDER_GEN9 ); -fw_domain_init (dev_priv,FW_DOMAIN_ID_BLITTER , -FORCEWAKE_BLITTER_GEN9 , -FORCEWAKE_ACK_BLITTER_GEN9 ); -fw_domain_init (dev_priv,FW_DOMAIN_ID_MEDIA , -FORCEWAKE_MEDIA_GEN9 ,FORCEWAKE_ACK_MEDIA_GEN9 ); +if (!use_blitter_forcewake (dev)) { +fw_domain_init (dev_priv,FW_DOMAIN_ID_RENDER , +FORCEWAKE_RENDER_GEN9 , +FORCEWAKE_ACK_RENDER_GEN9 ); +fw_domain_init (dev_priv,FW_DOMAIN_ID_MEDIA , +FORCEWAKE_MEDIA_GEN9 , +FORCEWAKE_ACK_MEDIA_GEN9 ); + } +fw_domain_init (dev_priv,FW_DOMAIN_ID_BLITTER , +FORCEWAKE_BLITTER_GEN9 , +FORCEWAKE_ACK_BLITTER_GEN9 ); }else if (IS_VALLEYVIEW (dev)) { dev_priv->uncore.funcs.force_wake_get = fw_domains_get;if (!IS_CHERRYVIEW (dev))Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 4/5] drm/i915: Use only blitter forcewake
Quoted 49 lines · Ville Syrjälä
Quoted 48 lines · Sagar Arun Kamble
Coarse power gating is disabled prior to BXT B0 and till SKL E0, hence even for render and media well registers blitter forcewake request need to be used.
Change-Id Ibfa8abf02b4d27ca1fcd68fc9e98c2daade7c286Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 5 +++- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_uncore.c | 53 ++++++++++++++++++++++++++++++------- 3 files changed, 48 insertions(+), 11 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +4
-1@@ -1509,7 +1509,10 @@ static int gen6_drpc_info(struct seq_file *m)intel_runtime_pm_get (dev_priv);spin_lock_irq (&dev_priv->uncore.lock); - forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_RENDER ].wake_count; +if (use_blitter_forcewake (dev)) + forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_BLITTER ].wake_count; +else + forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_RENDER ].wake_count;spin_unlock_irq (&dev_priv->uncore.lock);if (forcewake_count) {drivers/gpu/drm/i915/i915_drv.h +1
-0@@ -2691,6 +2691,7 @@ extern void intel_uncore_check_errors(struct drm_device *dev);extern void intel_uncore_fini (struct drm_device *dev);extern void intel_uncore_forcewake_reset (struct drm_device *dev,bool restore);const char *intel_uncore_forcewake_domain_to_str (const enum forcewake_domain_id id); +bool use_blitter_forcewake (struct drm_device *dev);void intel_uncore_forcewake_get (struct drm_i915_private *dev_priv,enum forcewake_domains domains); void intel_uncore_forcewake_put(struct drm_i915_private *dev_priv,drivers/gpu/drm/i915/intel_uncore.c +0
-0@@ -63,6 +63,19 @@ intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id)return "unknown" ; }
Quoted 9 lines
drivers/gpu/drm/i915/intel_uncore.c intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id) · line 71
Quoted 6 lines
drivers/gpu/drm/i915/intel_uncore.c +6
-0+bool use_blitter_forcewake (struct drm_device *dev) +{ +/* +* Due to WaRsDisableCoarsePowerGating, Only blitter forcewake need to +* be used on platforms previous to BXT B0 and until SKL E0. +*/ You say only blitter forcewake need be used. OK, but how does that imply that you need to grab the blitter forcewake for render/media wells as well?
Ok. I need to reword the commit message. Change is to grab blitter fw for all register accesses in GT.
Quoted 98 lines
Quoted 98 lines
drivers/gpu/drm/i915/intel_uncore.c +37
-10+if ((IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) || + (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) +return true; +else +return false; +} +static void assert_device_not_suspended (struct drm_i915_private *dev_priv) {@@ -129,6 +142,9 @@ fw_domains_get(struct drm_i915_private *dev_priv, enum forcewake_domains fw_domastruct intel_uncore_forcewake_domain *d;enum forcewake_domain_id id; +WARN_ON (use_blitter_forcewake (dev_priv->dev) && + (fw_domains & ~FORCEWAKE_BLITTER )); +for_each_fw_domain_mask (d, fw_domains, dev_priv, id) {fw_domain_wait_ack_clear (d);fw_domain_get (d);@@ -142,6 +158,9 @@ fw_domains_put(struct drm_i915_private *dev_priv, enum forcewake_domains fw_domastruct intel_uncore_forcewake_domain *d;enum forcewake_domain_id id; +WARN_ON (use_blitter_forcewake (dev_priv->dev) && + (fw_domains & ~FORCEWAKE_BLITTER )); +for_each_fw_domain_mask (d, fw_domains, dev_priv, id) {fw_domain_put (d);fw_domain_posting_read (d);@@ -313,6 +332,11 @@ void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)if (fw) dev_priv->uncore.funcs.force_wake_put (dev_priv, fw); +if (use_blitter_forcewake (dev) && !restore) { +__raw_i915_write32 (dev_priv,FORCEWAKE_RENDER_GEN9 ,_MASKED_BIT_DISABLE (0xffff )); +__raw_i915_write32 (dev_priv,FORCEWAKE_MEDIA_GEN9 ,_MASKED_BIT_DISABLE (0xffff )); + } +fw_domains_reset (dev_priv,FORCEWAKE_ALL );if (restore) {/* If reset with a user forcewake, try to restore */ @@ -780,8 +804,11 @@ gen9_read##x(struct drm_i915_private *dev_priv, off_t reg, bool trace) { \ fw_engine =FORCEWAKE_RENDER |FORCEWAKE_MEDIA ; \ else \ fw_engine =FORCEWAKE_BLITTER ; \ -if (fw_engine) \ +if (fw_engine) { \ +if (use_blitter_forcewake (dev_priv->dev)) \ + fw_engine =FORCEWAKE_BLITTER ; \__force_wake_get (dev_priv, fw_engine); \ + } \ val = __raw_i915_read##x(dev_priv, reg); \ GEN6_READ_FOOTER; \ }@@ -994,8 +1021,11 @@ gen9_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, \ fw_engine =FORCEWAKE_RENDER |FORCEWAKE_MEDIA ; \ else \ fw_engine =FORCEWAKE_BLITTER ; \ -if (fw_engine) \ +if (fw_engine) { \ +if (use_blitter_forcewake (dev_priv->dev)) \ + fw_engine =FORCEWAKE_BLITTER ; \__force_wake_get (dev_priv, fw_engine); \ + } \ __raw_i915_write##x(dev_priv, reg, val); \ GEN6_WRITE_FOOTER; \ }@@ -1106,14 +1136,17 @@ static void intel_uncore_fw_domains_init(struct drm_device *dev)if (IS_GEN9 (dev)) { dev_priv->uncore.funcs.force_wake_get = fw_domains_get; dev_priv->uncore.funcs.force_wake_put = fw_domains_put; -fw_domain_init (dev_priv,FW_DOMAIN_ID_RENDER , -FORCEWAKE_RENDER_GEN9 , -FORCEWAKE_ACK_RENDER_GEN9 ); -fw_domain_init (dev_priv,FW_DOMAIN_ID_BLITTER , -FORCEWAKE_BLITTER_GEN9 , -FORCEWAKE_ACK_BLITTER_GEN9 ); -fw_domain_init (dev_priv,FW_DOMAIN_ID_MEDIA , -FORCEWAKE_MEDIA_GEN9 ,FORCEWAKE_ACK_MEDIA_GEN9 ); +if (!use_blitter_forcewake (dev)) { +fw_domain_init (dev_priv,FW_DOMAIN_ID_RENDER , +FORCEWAKE_RENDER_GEN9 , +FORCEWAKE_ACK_RENDER_GEN9 ); +fw_domain_init (dev_priv,FW_DOMAIN_ID_MEDIA , +FORCEWAKE_MEDIA_GEN9 , +FORCEWAKE_ACK_MEDIA_GEN9 ); + } +fw_domain_init (dev_priv,FW_DOMAIN_ID_BLITTER , +FORCEWAKE_BLITTER_GEN9 , +FORCEWAKE_ACK_BLITTER_GEN9 ); }else if (IS_VALLEYVIEW (dev)) { dev_priv->uncore.funcs.force_wake_get = fw_domains_get;if (!IS_CHERRYVIEW (dev))Signature · 1 line
1.9.1
Quoted 4 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 4/5] drm/i915: Use only blitter forcewake
Quoted 61 lines · Sagar A
Quoted 49 lines · Ville Syrjälä
Quoted 48 lines · Sagar Arun Kamble
Coarse power gating is disabled prior to BXT B0 and till SKL E0, hence even for render and media well registers blitter forcewake request need to be used.
Change-Id Ibfa8abf02b4d27ca1fcd68fc9e98c2daade7c286Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 5 +++- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_uncore.c | 53 ++++++++++++++++++++++++++++++------- 3 files changed, 48 insertions(+), 11 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +4
-1@@ -1509,7 +1509,10 @@ static int gen6_drpc_info(struct seq_file *m)intel_runtime_pm_get (dev_priv);spin_lock_irq (&dev_priv->uncore.lock); - forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_RENDER ].wake_count; +if (use_blitter_forcewake (dev)) + forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_BLITTER ].wake_count; +else + forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_RENDER ].wake_count;spin_unlock_irq (&dev_priv->uncore.lock);if (forcewake_count) {drivers/gpu/drm/i915/i915_drv.h +1
-0@@ -2691,6 +2691,7 @@ extern void intel_uncore_check_errors(struct drm_device *dev);extern void intel_uncore_fini (struct drm_device *dev);extern void intel_uncore_forcewake_reset (struct drm_device *dev,bool restore);const char *intel_uncore_forcewake_domain_to_str (const enum forcewake_domain_id id); +bool use_blitter_forcewake (struct drm_device *dev);void intel_uncore_forcewake_get (struct drm_i915_private *dev_priv,enum forcewake_domains domains); void intel_uncore_forcewake_put(struct drm_i915_private *dev_priv,drivers/gpu/drm/i915/intel_uncore.c +0
-0@@ -63,6 +63,19 @@ intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id)return "unknown" ; }Quoted 9 lines
drivers/gpu/drm/i915/intel_uncore.c intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id) · line 71
Quoted 6 lines
drivers/gpu/drm/i915/intel_uncore.c +6
-0+bool use_blitter_forcewake (struct drm_device *dev) +{ +/* +* Due to WaRsDisableCoarsePowerGating, Only blitter forcewake need to +* be used on platforms previous to BXT B0 and until SKL E0. +*/ You say only blitter forcewake need be used. OK, but how does that imply that you need to grab the blitter forcewake for render/media wells as well?
Quoted 2 lines
Ok. I need to reword the commit message. Change is to grab blitter fw for all register accesses in GT.
Where is that documented BTW? I couldn't find anything solid.
Quoted 102 lines
Quoted 102 lines
Quoted 102 lines
drivers/gpu/drm/i915/intel_uncore.c +37
-10+if ((IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) || + (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) +return true; +else +return false; +} +static void assert_device_not_suspended (struct drm_i915_private *dev_priv) {@@ -129,6 +142,9 @@ fw_domains_get(struct drm_i915_private *dev_priv, enum forcewake_domains fw_domastruct intel_uncore_forcewake_domain *d;enum forcewake_domain_id id; +WARN_ON (use_blitter_forcewake (dev_priv->dev) && + (fw_domains & ~FORCEWAKE_BLITTER )); +for_each_fw_domain_mask (d, fw_domains, dev_priv, id) {fw_domain_wait_ack_clear (d);fw_domain_get (d);@@ -142,6 +158,9 @@ fw_domains_put(struct drm_i915_private *dev_priv, enum forcewake_domains fw_domastruct intel_uncore_forcewake_domain *d;enum forcewake_domain_id id; +WARN_ON (use_blitter_forcewake (dev_priv->dev) && + (fw_domains & ~FORCEWAKE_BLITTER )); +for_each_fw_domain_mask (d, fw_domains, dev_priv, id) {fw_domain_put (d);fw_domain_posting_read (d);@@ -313,6 +332,11 @@ void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)if (fw) dev_priv->uncore.funcs.force_wake_put (dev_priv, fw); +if (use_blitter_forcewake (dev) && !restore) { +__raw_i915_write32 (dev_priv,FORCEWAKE_RENDER_GEN9 ,_MASKED_BIT_DISABLE (0xffff )); +__raw_i915_write32 (dev_priv,FORCEWAKE_MEDIA_GEN9 ,_MASKED_BIT_DISABLE (0xffff )); + } +fw_domains_reset (dev_priv,FORCEWAKE_ALL );if (restore) {/* If reset with a user forcewake, try to restore */ @@ -780,8 +804,11 @@ gen9_read##x(struct drm_i915_private *dev_priv, off_t reg, bool trace) { \ fw_engine =FORCEWAKE_RENDER |FORCEWAKE_MEDIA ; \ else \ fw_engine =FORCEWAKE_BLITTER ; \ -if (fw_engine) \ +if (fw_engine) { \ +if (use_blitter_forcewake (dev_priv->dev)) \ + fw_engine =FORCEWAKE_BLITTER ; \__force_wake_get (dev_priv, fw_engine); \ + } \ val = __raw_i915_read##x(dev_priv, reg); \ GEN6_READ_FOOTER; \ }@@ -994,8 +1021,11 @@ gen9_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, \ fw_engine =FORCEWAKE_RENDER |FORCEWAKE_MEDIA ; \ else \ fw_engine =FORCEWAKE_BLITTER ; \ -if (fw_engine) \ +if (fw_engine) { \ +if (use_blitter_forcewake (dev_priv->dev)) \ + fw_engine =FORCEWAKE_BLITTER ; \__force_wake_get (dev_priv, fw_engine); \ + } \ __raw_i915_write##x(dev_priv, reg, val); \ GEN6_WRITE_FOOTER; \ }@@ -1106,14 +1136,17 @@ static void intel_uncore_fw_domains_init(struct drm_device *dev)if (IS_GEN9 (dev)) { dev_priv->uncore.funcs.force_wake_get = fw_domains_get; dev_priv->uncore.funcs.force_wake_put = fw_domains_put; -fw_domain_init (dev_priv,FW_DOMAIN_ID_RENDER , -FORCEWAKE_RENDER_GEN9 , -FORCEWAKE_ACK_RENDER_GEN9 ); -fw_domain_init (dev_priv,FW_DOMAIN_ID_BLITTER , -FORCEWAKE_BLITTER_GEN9 , -FORCEWAKE_ACK_BLITTER_GEN9 ); -fw_domain_init (dev_priv,FW_DOMAIN_ID_MEDIA , -FORCEWAKE_MEDIA_GEN9 ,FORCEWAKE_ACK_MEDIA_GEN9 ); +if (!use_blitter_forcewake (dev)) { +fw_domain_init (dev_priv,FW_DOMAIN_ID_RENDER , +FORCEWAKE_RENDER_GEN9 , +FORCEWAKE_ACK_RENDER_GEN9 ); +fw_domain_init (dev_priv,FW_DOMAIN_ID_MEDIA , +FORCEWAKE_MEDIA_GEN9 , +FORCEWAKE_ACK_MEDIA_GEN9 ); + } +fw_domain_init (dev_priv,FW_DOMAIN_ID_BLITTER , +FORCEWAKE_BLITTER_GEN9 , +FORCEWAKE_ACK_BLITTER_GEN9 ); }else if (IS_VALLEYVIEW (dev)) { dev_priv->uncore.funcs.force_wake_get = fw_domains_get;if (!IS_CHERRYVIEW (dev))Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 4/5] drm/i915: Use only blitter forcewake
Quoted 61 lines · Ville Syrjälä
Quoted 60 lines · Sagar A
Quoted 58 lines · Ville Syrjälä
Quoted 45 lines · Sagar Arun Kamble
Coarse power gating is disabled prior to BXT B0 and till SKL E0, hence even for render and media well registers blitter forcewake request need to be used.
Change-Id Ibfa8abf02b4d27ca1fcd68fc9e98c2daade7c286Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/i915_debugfs.c | 5 +++- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/intel_uncore.c | 53 ++++++++++++++++++++++++++++++------- 3 files changed, 48 insertions(+), 11 deletions(-)drivers/gpu/drm/i915/i915_debugfs.c +4
-1@@ -1509,7 +1509,10 @@ static int gen6_drpc_info(struct seq_file *m)intel_runtime_pm_get (dev_priv);spin_lock_irq (&dev_priv->uncore.lock); - forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_RENDER ].wake_count; +if (use_blitter_forcewake (dev)) + forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_BLITTER ].wake_count; +else + forcewake_count = dev_priv->uncore.fw_domain[FW_DOMAIN_ID_RENDER ].wake_count;spin_unlock_irq (&dev_priv->uncore.lock);if (forcewake_count) {drivers/gpu/drm/i915/i915_drv.h +1
-0@@ -2691,6 +2691,7 @@ extern void intel_uncore_check_errors(struct drm_device *dev);extern void intel_uncore_fini (struct drm_device *dev);extern void intel_uncore_forcewake_reset (struct drm_device *dev,bool restore);const char *intel_uncore_forcewake_domain_to_str (const enum forcewake_domain_id id); +bool use_blitter_forcewake (struct drm_device *dev);void intel_uncore_forcewake_get (struct drm_i915_private *dev_priv,enum forcewake_domains domains); void intel_uncore_forcewake_put(struct drm_i915_private *dev_priv,drivers/gpu/drm/i915/intel_uncore.c +0
-0drivers/gpu/drm/i915/intel_uncore.c intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id) · line 71
Quoted 9 lines
drivers/gpu/drm/i915/intel_uncore.c +6
-0@@ -63,6 +63,19 @@ intel_uncore_forcewake_domain_to_str(const enum forcewake_domain_id id)return "unknown" ; } +bool use_blitter_forcewake (struct drm_device *dev) +{ +/* +* Due to WaRsDisableCoarsePowerGating, Only blitter forcewake need to +* be used on platforms previous to BXT B0 and until SKL E0. +*/ You say only blitter forcewake need be used. OK, but how does that imply that you need to grab the blitter forcewake for render/media wells as well?
Quoted 3 lines
Quoted 2 lines
Ok. I need to reword the commit message. Change is to grab blitter fw for all register accesses in GT.
Where is that documented BTW? I couldn't find anything solid.
This is not documented as part of WaRsDisableCoarsePowerGating.
But if Coarse Power Gating is disabled it is as good as legacy RC6 flow like in HSW/BDW. And hence we need to take blitter forcewake for all accesses.
Quoted 97 lines
Quoted 97 lines
Quoted 97 lines
Quoted 97 lines
drivers/gpu/drm/i915/intel_uncore.c +37
-10+if ((IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) || + (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) +return true; +else +return false; +} +static void assert_device_not_suspended (struct drm_i915_private *dev_priv) {@@ -129,6 +142,9 @@ fw_domains_get(struct drm_i915_private *dev_priv, enum forcewake_domains fw_domastruct intel_uncore_forcewake_domain *d;enum forcewake_domain_id id; +WARN_ON (use_blitter_forcewake (dev_priv->dev) && + (fw_domains & ~FORCEWAKE_BLITTER )); +for_each_fw_domain_mask (d, fw_domains, dev_priv, id) {fw_domain_wait_ack_clear (d);fw_domain_get (d);@@ -142,6 +158,9 @@ fw_domains_put(struct drm_i915_private *dev_priv, enum forcewake_domains fw_domastruct intel_uncore_forcewake_domain *d;enum forcewake_domain_id id; +WARN_ON (use_blitter_forcewake (dev_priv->dev) && + (fw_domains & ~FORCEWAKE_BLITTER )); +for_each_fw_domain_mask (d, fw_domains, dev_priv, id) {fw_domain_put (d);fw_domain_posting_read (d);@@ -313,6 +332,11 @@ void intel_uncore_forcewake_reset(struct drm_device *dev, bool restore)if (fw) dev_priv->uncore.funcs.force_wake_put (dev_priv, fw); +if (use_blitter_forcewake (dev) && !restore) { +__raw_i915_write32 (dev_priv,FORCEWAKE_RENDER_GEN9 ,_MASKED_BIT_DISABLE (0xffff )); +__raw_i915_write32 (dev_priv,FORCEWAKE_MEDIA_GEN9 ,_MASKED_BIT_DISABLE (0xffff )); + } +fw_domains_reset (dev_priv,FORCEWAKE_ALL );if (restore) {/* If reset with a user forcewake, try to restore */ @@ -780,8 +804,11 @@ gen9_read##x(struct drm_i915_private *dev_priv, off_t reg, bool trace) { \ fw_engine =FORCEWAKE_RENDER |FORCEWAKE_MEDIA ; \ else \ fw_engine =FORCEWAKE_BLITTER ; \ -if (fw_engine) \ +if (fw_engine) { \ +if (use_blitter_forcewake (dev_priv->dev)) \ + fw_engine =FORCEWAKE_BLITTER ; \__force_wake_get (dev_priv, fw_engine); \ + } \ val = __raw_i915_read##x(dev_priv, reg); \ GEN6_READ_FOOTER; \ }@@ -994,8 +1021,11 @@ gen9_write##x(struct drm_i915_private *dev_priv, off_t reg, u##x val, \ fw_engine =FORCEWAKE_RENDER |FORCEWAKE_MEDIA ; \ else \ fw_engine =FORCEWAKE_BLITTER ; \ -if (fw_engine) \ +if (fw_engine) { \ +if (use_blitter_forcewake (dev_priv->dev)) \ + fw_engine =FORCEWAKE_BLITTER ; \__force_wake_get (dev_priv, fw_engine); \ + } \ __raw_i915_write##x(dev_priv, reg, val); \ GEN6_WRITE_FOOTER; \ }@@ -1106,14 +1136,17 @@ static void intel_uncore_fw_domains_init(struct drm_device *dev)if (IS_GEN9 (dev)) { dev_priv->uncore.funcs.force_wake_get = fw_domains_get; dev_priv->uncore.funcs.force_wake_put = fw_domains_put; -fw_domain_init (dev_priv,FW_DOMAIN_ID_RENDER , -FORCEWAKE_RENDER_GEN9 , -FORCEWAKE_ACK_RENDER_GEN9 ); -fw_domain_init (dev_priv,FW_DOMAIN_ID_BLITTER , -FORCEWAKE_BLITTER_GEN9 , -FORCEWAKE_ACK_BLITTER_GEN9 ); -fw_domain_init (dev_priv,FW_DOMAIN_ID_MEDIA , -FORCEWAKE_MEDIA_GEN9 ,FORCEWAKE_ACK_MEDIA_GEN9 ); +if (!use_blitter_forcewake (dev)) { +fw_domain_init (dev_priv,FW_DOMAIN_ID_RENDER , +FORCEWAKE_RENDER_GEN9 , +FORCEWAKE_ACK_RENDER_GEN9 ); +fw_domain_init (dev_priv,FW_DOMAIN_ID_MEDIA , +FORCEWAKE_MEDIA_GEN9 , +FORCEWAKE_ACK_MEDIA_GEN9 ); + } +fw_domain_init (dev_priv,FW_DOMAIN_ID_BLITTER , +FORCEWAKE_BLITTER_GEN9 , +FORCEWAKE_ACK_BLITTER_GEN9 ); }else if (IS_VALLEYVIEW (dev)) { dev_priv->uncore.funcs.force_wake_get = fw_domains_get;if (!IS_CHERRYVIEW (dev))Signature · 1 line
1.9.1
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/5 drm/i915: Notify Coarse Power Gating changes to GuC
In reply to Sagar Arun KambleFrom: Alex Dai <[email protected]>
--- drivers/gpu/drm/i915/i915_guc_submission.c | 18 ++++++++++++++++++ drivers/gpu/drm/i915/intel_guc.h | 1 + drivers/gpu/drm/i915/intel_pm.c | 16 ++++++++++++---- 3 files changed, 31 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_guc_submission.c +18 -0
@@ -877,6 +877,24 @@ int i915_guc_submission_enable(struct drm_device *dev)return 0 ; } +void i915_guc_sample_forcewake (struct drm_device *dev,u32 fw_data) +{ +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_guc *guc = &dev_priv->guc; +struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw; + +/* Notify GuC about CPG changes. */ +if (guc_fw->guc_fw_fetch_status ==GUC_FIRMWARE_SUCCESS ) { +u32 data[2 ]; + + data[0 ] =HOST2GUC_ACTION_SAMPLE_FORCEWAKE ; + data[1 ] = fw_data; + +if (host2guc_action (guc, data,2 )) +DRM_ERROR ("Unable to notify GuC of CPG change\n" ); + } +} +void i915_guc_submission_disable (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;
drivers/gpu/drm/i915/intel_guc.h +1 -0
@@ -118,5 +118,6 @@ int i915_guc_submit(struct i915_guc_client *client, struct drm_i915_gem_request *rq);void i915_guc_submission_disable (struct drm_device *dev);void i915_guc_submission_fini (struct drm_device *dev); +void i915_guc_sample_forcewake (struct drm_device *dev,u32 fw_data);#endif
drivers/gpu/drm/i915/intel_pm.c +12 -4
@@ -4616,6 +4616,9 @@ static void gen9_disable_rps(struct drm_device *dev)struct drm_i915_private *dev_priv = dev->dev_private;I915_WRITE (GEN6_RC_CONTROL ,0 ); + +i915_guc_sample_forcewake (dev,0 ); +I915_WRITE (GEN9_PG_ENABLE ,0 ); }
@@ -4804,6 +4807,7 @@ static void gen9_enable_rc6(struct drm_device *dev)struct drm_i915_private *dev_priv = dev->dev_private;struct intel_engine_cs *ring;uint32_t rc6_mask =0 ; +uint32_t cpg_data =0 ;int unused;/* 1a: Software RC state - RC0 */
@@ -4843,11 +4847,15 @@ static void gen9_enable_rc6(struct drm_device *dev)* WaRsDisableCoarsePowerGating:skl,bxt - Render/Media PG need to be disabled with RC6. */ if ((IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) || - (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) + (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) { +i915_guc_sample_forcewake (dev,0 );I915_WRITE (GEN9_PG_ENABLE ,0 ); -else -I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? - (GEN9_RENDER_PG_ENABLE |GEN9_MEDIA_PG_ENABLE ) :0 ); + }else { + cpg_data = (rc6_mask &GEN6_RC_CTL_RC6_ENABLE )? + (GEN9_RENDER_PG_ENABLE |GEN9_MEDIA_PG_ENABLE ):0 ; +i915_guc_sample_forcewake (dev, cpg_data); +I915_WRITE (GEN9_PG_ENABLE , cpg_data); + }intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL );
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 5/5] drm/i915: Notify Coarse Power Gating changes to GuC
Quoted 2 lines · Sagar Arun Kamble
From: Alex Dai <[email protected]>
[TOR:] This commit message is inadequate. The needed information is in the cover letter but is lacking here. Please rebase with Alex's previous patch "drm/i915: Notify GuC rc6 state"
Quoted 97 lines
Signed-off-by Alex Dai <[email protected]>Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/i915_guc_submission.c | 18 ++++++++++++++++++ drivers/gpu/drm/i915/intel_guc.h | 1 + drivers/gpu/drm/i915/intel_pm.c | 16 ++++++++++++---- 3 files changed, 31 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/i915_guc_submission.c +18
-0@@ -877,6 +877,24 @@ int i915_guc_submission_enable(struct drm_device *dev)return 0 ; } +void i915_guc_sample_forcewake (struct drm_device *dev,u32 fw_data) +{ +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_guc *guc = &dev_priv->guc; +struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw; + +/* Notify GuC about CPG changes. */ +if (guc_fw->guc_fw_fetch_status ==GUC_FIRMWARE_SUCCESS ) { +u32 data[2 ]; + + data[0 ] =HOST2GUC_ACTION_SAMPLE_FORCEWAKE ; + data[1 ] = fw_data; + +if (host2guc_action (guc, data,2 )) +DRM_ERROR ("Unable to notify GuC of CPG change\n" ); + } +} +void i915_guc_submission_disable (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;drivers/gpu/drm/i915/intel_guc.h +1
-0@@ -118,5 +118,6 @@ int i915_guc_submit(struct i915_guc_client *client, struct drm_i915_gem_request *rq);void i915_guc_submission_disable (struct drm_device *dev);void i915_guc_submission_fini (struct drm_device *dev); +void i915_guc_sample_forcewake (struct drm_device *dev,u32 fw_data);#endif drivers/gpu/drm/i915/intel_pm.c +12
-4@@ -4616,6 +4616,9 @@ static void gen9_disable_rps(struct drm_device *dev)struct drm_i915_private *dev_priv = dev->dev_private;I915_WRITE (GEN6_RC_CONTROL ,0 ); + +i915_guc_sample_forcewake (dev,0 ); +I915_WRITE (GEN9_PG_ENABLE ,0 ); }@@ -4804,6 +4807,7 @@ static void gen9_enable_rc6(struct drm_device *dev)struct drm_i915_private *dev_priv = dev->dev_private;struct intel_engine_cs *ring;uint32_t rc6_mask =0 ; +uint32_t cpg_data =0 ;int unused;/* 1a: Software RC state - RC0 */ @@ -4843,11 +4847,15 @@ static void gen9_enable_rc6(struct drm_device *dev)* WaRsDisableCoarsePowerGating:skl,bxt - Render/Media PG need to be disabled with RC6. */ if ((IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) || - (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) + (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) { +i915_guc_sample_forcewake (dev,0 );I915_WRITE (GEN9_PG_ENABLE ,0 ); -else -I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? - (GEN9_RENDER_PG_ENABLE |GEN9_MEDIA_PG_ENABLE ) :0 ); + }else { + cpg_data = (rc6_mask &GEN6_RC_CTL_RC6_ENABLE )? + (GEN9_RENDER_PG_ENABLE |GEN9_MEDIA_PG_ENABLE ):0 ; +i915_guc_sample_forcewake (dev, cpg_data); +I915_WRITE (GEN9_PG_ENABLE , cpg_data); + }intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL );Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 5/5] drm/i915: Notify Coarse Power Gating changes to GuC
Hi Alex,
Kindly incorporate changes in this patch in your patch at:
http://lists.freedesktop.org/archives/intel-gfx/2015-September/075668.html - [PATCH 5/6] drm/i915/guc: Media domain bit needed when notify GuC rc6 state
This is because GuC sample forcewake parameters depend on Coarse power gating configuration.
Thanks
Sagar
Quoted 98 lines · Tom
Quoted 2 lines · Sagar Arun Kamble
From: Alex Dai <[email protected]>
[TOR:] This commit message is inadequate. The needed information is in the cover letter but is lacking here. Please rebase with Alex's previous patch "drm/i915: Notify GuC rc6 state"
Quoted 90 lines
Signed-off-by Alex Dai <[email protected]>Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/i915_guc_submission.c | 18 ++++++++++++++++++ drivers/gpu/drm/i915/intel_guc.h | 1 + drivers/gpu/drm/i915/intel_pm.c | 16 ++++++++++++---- 3 files changed, 31 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/i915_guc_submission.c +18
-0@@ -877,6 +877,24 @@ int i915_guc_submission_enable(struct drm_device *dev)return 0 ; } +void i915_guc_sample_forcewake (struct drm_device *dev,u32 fw_data) +{ +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_guc *guc = &dev_priv->guc; +struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw; + +/* Notify GuC about CPG changes. */ +if (guc_fw->guc_fw_fetch_status ==GUC_FIRMWARE_SUCCESS ) { +u32 data[2 ]; + + data[0 ] =HOST2GUC_ACTION_SAMPLE_FORCEWAKE ; + data[1 ] = fw_data; + +if (host2guc_action (guc, data,2 )) +DRM_ERROR ("Unable to notify GuC of CPG change\n" ); + } +} +void i915_guc_submission_disable (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;drivers/gpu/drm/i915/intel_guc.h +1
-0@@ -118,5 +118,6 @@ int i915_guc_submit(struct i915_guc_client *client, struct drm_i915_gem_request *rq);void i915_guc_submission_disable (struct drm_device *dev);void i915_guc_submission_fini (struct drm_device *dev); +void i915_guc_sample_forcewake (struct drm_device *dev,u32 fw_data);#endif drivers/gpu/drm/i915/intel_pm.c +12
-4@@ -4616,6 +4616,9 @@ static void gen9_disable_rps(struct drm_device *dev)struct drm_i915_private *dev_priv = dev->dev_private;I915_WRITE (GEN6_RC_CONTROL ,0 ); + +i915_guc_sample_forcewake (dev,0 ); +I915_WRITE (GEN9_PG_ENABLE ,0 ); }@@ -4804,6 +4807,7 @@ static void gen9_enable_rc6(struct drm_device *dev)struct drm_i915_private *dev_priv = dev->dev_private;struct intel_engine_cs *ring;uint32_t rc6_mask =0 ; +uint32_t cpg_data =0 ;int unused;/* 1a: Software RC state - RC0 */ @@ -4843,11 +4847,15 @@ static void gen9_enable_rc6(struct drm_device *dev)* WaRsDisableCoarsePowerGating:skl,bxt - Render/Media PG need to be disabled with RC6. */ if ((IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) || - (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) + (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) { +i915_guc_sample_forcewake (dev,0 );I915_WRITE (GEN9_PG_ENABLE ,0 ); -else -I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? - (GEN9_RENDER_PG_ENABLE |GEN9_MEDIA_PG_ENABLE ) :0 ); + }else { + cpg_data = (rc6_mask &GEN6_RC_CTL_RC6_ENABLE )? + (GEN9_RENDER_PG_ENABLE |GEN9_MEDIA_PG_ENABLE ):0 ; +i915_guc_sample_forcewake (dev, cpg_data); +I915_WRITE (GEN9_PG_ENABLE , cpg_data); + }intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL );
Quoted 7 lines
Quoted 7 lines
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 5/5] drm/i915: Notify Coarse Power Gating changes to GuC
Quoted 40 lines · Sagar A
Hi Alex,
Kindly incorporate changes in this patch in your patch at:
http://lists.freedesktop.org/archives/intel-gfx/2015-September/075668.html
- [PATCH 5/6] drm/i915/guc: Media domain bit needed when notify GuC rc6 stateThis is because GuC sample forcewake parameters depend on Coarse power gating configuration.
Thanks
SagarQuoted 24 lines · Tom
Quoted 2 lines · Sagar Arun Kamble
From: Alex Dai <[email protected]>
[TOR:] This commit message is inadequate. The needed information is in the cover letter but is lacking here. Please rebase with Alex's previous patch "drm/i915: Notify GuC rc6 state"
Quoted 16 lines
Signed-off-by Alex Dai <[email protected]>Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/i915_guc_submission.c | 18 ++++++++++++++++++ drivers/gpu/drm/i915/intel_guc.h | 1 + drivers/gpu/drm/i915/intel_pm.c | 16 ++++++++++++---- 3 files changed, 31 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/i915_guc_submission.c +0
-0@@ -877,6 +877,24 @@ int i915_guc_submission_enable(struct drm_device *dev)return 0 ; }
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/i915_guc_submission.c int i915_guc_submission_enable(struct drm_device *dev) · line 887
Quoted 8 lines
drivers/gpu/drm/i915/i915_guc_submission.c +8
-0+void i915_guc_sample_forcewake (struct drm_device *dev,u32 fw_data) +{ +struct drm_i915_private *dev_priv = dev->dev_private; +struct intel_guc *guc = &dev_priv->guc; +struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw; + +/* Notify GuC about CPG changes. */ +if (guc_fw->guc_fw_fetch_status ==GUC_FIRMWARE_SUCCESS ) {
This might not be safe to protect code below. In the case of suspend, the guc_fw_fetch_status and guc_fw_load_status both are SUCCESS. However, we need to reload fw before any host2guc calls.
Quoted 10 lines
Quoted 10 lines
drivers/gpu/drm/i915/i915_guc_submission.c int i915_guc_submission_enable(struct drm_device *dev) · line 897
Quoted 10 lines
drivers/gpu/drm/i915/i915_guc_submission.c +10
-0+u32 data[2 ]; + + data[0 ] =HOST2GUC_ACTION_SAMPLE_FORCEWAKE ; + data[1 ] = fw_data; + +if (host2guc_action (guc, data,2 )) +DRM_ERROR ("Unable to notify GuC of CPG change\n" ); + } +} +
Please call host2guc_sample_forcewake rather than a host2guc_action.
Quoted 54 lines
Quoted 54 lines
Quoted 54 lines
drivers/gpu/drm/i915/i915_guc_submission.c +0
-0void i915_guc_submission_disable (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;drivers/gpu/drm/i915/intel_guc.h +1
-0@@ -118,5 +118,6 @@ int i915_guc_submit(struct i915_guc_client *client, struct drm_i915_gem_request *rq);void i915_guc_submission_disable (struct drm_device *dev);void i915_guc_submission_fini (struct drm_device *dev); +void i915_guc_sample_forcewake (struct drm_device *dev,u32 fw_data);#endif drivers/gpu/drm/i915/intel_pm.c +12
-4@@ -4616,6 +4616,9 @@ static void gen9_disable_rps(struct drm_device *dev)struct drm_i915_private *dev_priv = dev->dev_private;I915_WRITE (GEN6_RC_CONTROL ,0 ); + +i915_guc_sample_forcewake (dev,0 ); +I915_WRITE (GEN9_PG_ENABLE ,0 ); }@@ -4804,6 +4807,7 @@ static void gen9_enable_rc6(struct drm_device *dev)struct drm_i915_private *dev_priv = dev->dev_private;struct intel_engine_cs *ring;uint32_t rc6_mask =0 ; +uint32_t cpg_data =0 ;int unused;/* 1a: Software RC state - RC0 */ @@ -4843,11 +4847,15 @@ static void gen9_enable_rc6(struct drm_device *dev)* WaRsDisableCoarsePowerGating:skl,bxt - Render/Media PG need to be disabled with RC6. */ if ((IS_BROXTON (dev) && (INTEL_REVID (dev) <BXT_REVID_B0 )) || - (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) + (IS_SKYLAKE (dev) && (INTEL_REVID (dev) <=SKL_REVID_E0 ))) { +i915_guc_sample_forcewake (dev,0 );I915_WRITE (GEN9_PG_ENABLE ,0 ); -else -I915_WRITE (GEN9_PG_ENABLE , (rc6_mask &GEN6_RC_CTL_RC6_ENABLE ) ? - (GEN9_RENDER_PG_ENABLE |GEN9_MEDIA_PG_ENABLE ) :0 ); + }else { + cpg_data = (rc6_mask &GEN6_RC_CTL_RC6_ENABLE )? + (GEN9_RENDER_PG_ENABLE |GEN9_MEDIA_PG_ENABLE ):0 ; +i915_guc_sample_forcewake (dev, cpg_data); +I915_WRITE (GEN9_PG_ENABLE , cpg_data); + }
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/i915/intel_pm.c static void gen9_enable_rc6(struct drm_device *dev)
Quoted 3 lines
drivers/gpu/drm/i915/intel_pm.c +0
-1intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL ); --
Be note that calling guc function here actually happens in another thread. The host2guc action will fail if GuC is not loaded. So there is a potential racing issue here. I believe the failure will happen during suspend / resume. I believe calling i915_guc_sample_forcewake or host2guc_sample_forcewake after GuC is initialized is good enough.
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx