Skip to contentSkip to conversation

drm/i915: Remove WaFbcDisableDpfcClockGating on IVB

PATCH In review Ben Widawsky 5 participants 17 messages Oct 24, 2013 – Oct 28, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 drm/i915: Remove WaFbcDisableDpfcClockGating on IVB

Production IVB does not need it. I confirmed this with Art.

---
 drivers/gpu/drm/i915/intel_pm.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -10
index d4dd543..33ad028 100644
@@ -254,12 +254,6 @@ static void ironlake_disable_fbc(struct drm_device *dev)
 		dpfc_ctl &= ~DPFC_CTL_EN;
 		I915_WRITE(ILK_DPFC_CONTROL, dpfc_ctl);
 
-		if (IS_IVYBRIDGE(dev))
-			/* WaFbcDisableDpfcClockGating:ivb */
-			I915_WRITE(ILK_DSPCLK_GATE_D,
-				   I915_READ(ILK_DSPCLK_GATE_D) &
-				   ~ILK_DPFCUNIT_CLOCK_GATE_DISABLE);
-
 		if (IS_HASWELL(dev))
 			/* WaFbcDisableDpfcClockGating:hsw */
 			I915_WRITE(HSW_CLKGATE_DISABLE_PART_1,
@@ -295,10 +289,6 @@ static void gen7_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
 	if (IS_IVYBRIDGE(dev)) {
 		/* WaFbcAsynchFlipDisableFbcQueue:ivb */
 		I915_WRITE(ILK_DISPLAY_CHICKEN1, ILK_FBCQ_DIS);
-		/* WaFbcDisableDpfcClockGating:ivb */
-		I915_WRITE(ILK_DSPCLK_GATE_D,
-			   I915_READ(ILK_DSPCLK_GATE_D) |
-			   ILK_DPFCUNIT_CLOCK_GATE_DISABLE);
 	} else {
 		/* WaFbcAsynchFlipDisableFbcQueue:hsw */
 		I915_WRITE(HSW_PIPE_SLICE_CHICKEN_1(intel_crtc->pipe),
Signature · 1 line
1.8.4.1
#1 lore raw

PATCH 2/4 drm/i915: Remove WaFbcDisableDpfcClockGating on HSW

Production HSW does not need it. I confirmed this with Art.

---
 drivers/gpu/drm/i915/i915_reg.h |  3 ---
 drivers/gpu/drm/i915/intel_pm.c | 10 ----------
 2 files changed, 13 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +0 -3
index 6c98238..6799d53 100644
@@ -1110,9 +1110,6 @@
 					     _HSW_PIPE_SLICE_CHICKEN_1_A, + \
 					     _HSW_PIPE_SLICE_CHICKEN_1_B)
 
-#define HSW_CLKGATE_DISABLE_PART_1	0x46500
-#define   HSW_DPFC_GATING_DISABLE	(1<<23)
-
 /*
  * GPIO regs
  */
drivers/gpu/drm/i915/intel_pm.c +0 -10
index 33ad028..686699c 100644
@@ -254,12 +254,6 @@ static void ironlake_disable_fbc(struct drm_device *dev)
 		dpfc_ctl &= ~DPFC_CTL_EN;
 		I915_WRITE(ILK_DPFC_CONTROL, dpfc_ctl);
 
-		if (IS_HASWELL(dev))
-			/* WaFbcDisableDpfcClockGating:hsw */
-			I915_WRITE(HSW_CLKGATE_DISABLE_PART_1,
-				   I915_READ(HSW_CLKGATE_DISABLE_PART_1) &
-				   ~HSW_DPFC_GATING_DISABLE);
-
 		DRM_DEBUG_KMS("disabled FBC\n");
 	}
 }
@@ -293,10 +287,6 @@ static void gen7_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
 		/* WaFbcAsynchFlipDisableFbcQueue:hsw */
 		I915_WRITE(HSW_PIPE_SLICE_CHICKEN_1(intel_crtc->pipe),
 			   HSW_BYPASS_FBC_QUEUE);
-		/* WaFbcDisableDpfcClockGating:hsw */
-		I915_WRITE(HSW_CLKGATE_DISABLE_PART_1,
-			   I915_READ(HSW_CLKGATE_DISABLE_PART_1) |
-			   HSW_DPFC_GATING_DISABLE);
 	}
 
 	I915_WRITE(SNB_DPFC_CTL_SA,
Signature · 1 line
1.8.4.1
Reviewed-by on v1 2/4
#2 lore raw

Re: [PATCH 2/4] drm/i915: Remove WaFbcDisableDpfcClockGating on HSW

2013/10/24 Ben Widawsky <[email protected]>:

Quoted 3 lines

Production HSW does not need it. I confirmed this with Art.

I just hope these things don't start uncovering bugs :)

Quoted 54 lines
---
 drivers/gpu/drm/i915/i915_reg.h |  3 ---
 drivers/gpu/drm/i915/intel_pm.c | 10 ----------
 2 files changed, 13 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +0 -3
index 6c98238..6799d53 100644
@@ -1110,9 +1110,6 @@
                                             _HSW_PIPE_SLICE_CHICKEN_1_A, + \
                                             _HSW_PIPE_SLICE_CHICKEN_1_B)
 
-#define HSW_CLKGATE_DISABLE_PART_1     0x46500
-#define   HSW_DPFC_GATING_DISABLE      (1<<23)
-
 /*
  * GPIO regs
  */
drivers/gpu/drm/i915/intel_pm.c +0 -11
index 33ad028..686699c 100644
@@ -254,12 +254,6 @@ static void ironlake_disable_fbc(struct drm_device *dev)
                dpfc_ctl &= ~DPFC_CTL_EN;
                I915_WRITE(ILK_DPFC_CONTROL, dpfc_ctl);
 
-               if (IS_HASWELL(dev))
-                       /* WaFbcDisableDpfcClockGating:hsw */
-                       I915_WRITE(HSW_CLKGATE_DISABLE_PART_1,
-                                  I915_READ(HSW_CLKGATE_DISABLE_PART_1) &
-                                  ~HSW_DPFC_GATING_DISABLE);
-
                DRM_DEBUG_KMS("disabled FBC\n");
        }
 }
@@ -293,10 +287,6 @@ static void gen7_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
                /* WaFbcAsynchFlipDisableFbcQueue:hsw */
                I915_WRITE(HSW_PIPE_SLICE_CHICKEN_1(intel_crtc->pipe),
                           HSW_BYPASS_FBC_QUEUE);
-               /* WaFbcDisableDpfcClockGating:hsw */
-               I915_WRITE(HSW_CLKGATE_DISABLE_PART_1,
-                          I915_READ(HSW_CLKGATE_DISABLE_PART_1) |
-                          HSW_DPFC_GATING_DISABLE);
        }
 
        I915_WRITE(SNB_DPFC_CTL_SA,
--

1.8.4.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Paulo Zanoni
#3 lore raw

Re: [PATCH 2/4] drm/i915: Remove WaFbcDisableDpfcClockGating on HSW

Quoted 8 lines · Paulo Zanoni

2013/10/24 Ben Widawsky <[email protected]>:

Quoted 3 lines

Production HSW does not need it. I confirmed this with Art.

I just hope these things don't start uncovering bugs :)

Merged the first 2 patches of this series. Not sure what to do with the other two, since fbc is essentially disabled on pre-hsw. And no one seems to really work on it :( So I only see minimal reasons to frob with it ... -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#4 lore raw

Re: [PATCH 2/4] drm/i915: Remove WaFbcDisableDpfcClockGating on HSW

2013/10/27 Daniel Vetter <[email protected]>:

Quoted 6 lines · Paulo Zanoni
Quoted 5 lines

2013/10/24 Ben Widawsky <[email protected]>:

Quoted 3 lines

Production HSW does not need it. I confirmed this with Art.

Quoted 7 lines
Quoted 3 lines

I just hope these things don't start uncovering bugs :)

Merged the first 2 patches of this series. Not sure what to do with the other two, since fbc is essentially disabled on pre-hsw. And no one seems to really work on it :( So I only see minimal reasons to frob with it ...

IMHO what you said is another reason to actually merge the other two patches, since they make FBC-only WAs be applied only on FBC (e.g., probably never).

Quoted 5 lines

-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

Signature · 1 line
Paulo Zanoni
#5 lore raw

Re: [PATCH 2/4] drm/i915: Remove WaFbcDisableDpfcClockGating on HSW

Quoted 11 lines · Paulo Zanoni

2013/10/27 Daniel Vetter <[email protected]>:

Quoted 10 lines · Paulo Zanoni
Quoted 8 lines

2013/10/24 Ben Widawsky <[email protected]>:

Quoted 3 lines

Production HSW does not need it. I confirmed this with Art.

I just hope these things don't start uncovering bugs :)

Quoted 7 lines
Quoted 3 lines

Merged the first 2 patches of this series. Not sure what to do with the other two, since fbc is essentially disabled on pre-hsw. And no one seems to really work on it :( So I only see minimal reasons to frob with it ...

IMHO what you said is another reason to actually merge the other two patches, since they make FBC-only WAs be applied only on FBC (e.g., probably never).

Another reason would be keeping the codepaths at least somewhat similar. Could make it a bit easier to fix things later. If it would be me who gets to fix the FBC mess at some point, I'd try to fix it for all gens for sure.

At some point I posted a patch to attempt a quick FBC fix for SNB:
"[PATCH] drm/i915: Attempt to fix FBC render tracking with hardware contexts"

In theory that could make FBC work equally well for SNB as it works for IVB+. And I must confess that I have FBC enabled on my IVB ultrabook currently since it appears to save a rather significant amount of power.

Signature · 2 lines
Ville Syrjälä
Intel OTC
#6 lore raw

Re: [PATCH 2/4] drm/i915: Remove WaFbcDisableDpfcClockGating on HSW

Quoted 25 lines · Ville Syrjälä
Quoted 11 lines · Paulo Zanoni

2013/10/27 Daniel Vetter <[email protected]>:

Quoted 10 lines · Paulo Zanoni
Quoted 8 lines

2013/10/24 Ben Widawsky <[email protected]>:

Quoted 3 lines

Production HSW does not need it. I confirmed this with Art.

I just hope these things don't start uncovering bugs :)

Quoted 7 lines
Quoted 3 lines

Merged the first 2 patches of this series. Not sure what to do with the other two, since fbc is essentially disabled on pre-hsw. And no one seems to really work on it :( So I only see minimal reasons to frob with it ...

IMHO what you said is another reason to actually merge the other two patches, since they make FBC-only WAs be applied only on FBC (e.g., probably never).

Another reason would be keeping the codepaths at least somewhat similar. Could make it a bit easier to fix things later. If it would be me who gets to fix the FBC mess at some point, I'd try to fix it for all gens for sure.

Quoted 10 lines

At some point I posted a patch to attempt a quick FBC fix for SNB:
"[PATCH] drm/i915: Attempt to fix FBC render tracking with hardware contexts"

In theory that could make FBC work equally well for SNB as it works for IVB+. And I must confess that I have FBC enabled on my IVB ultrabook currently since it appears to save a rather significant amount of power.

Signature · 2 lines
Ville Syrjälä
Intel OTC

I just looked at your patch, and I should probably comment there, but it's 5 months old :D. Did you actually observe a fix of something with that patch? I feel like the way in which we enable/disable tracking, it shouldn't make a difference.

FWIW: I have two other patches I didn't post yet for SNB. Unfortunately, I only know one person with failing fbc on SNB, and given his description, I am not certain it will fix anything.

http://cgit.freedesktop.org/~bwidawsk/drm-intel/log/?h=fbc_fixes

Signature · 5 lines
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

Re: [PATCH 2/4] drm/i915: Remove WaFbcDisableDpfcClockGating on HSW

Quoted 38 lines · Ben Widawsky
Quoted 25 lines · Ville Syrjälä
Quoted 11 lines · Paulo Zanoni

2013/10/27 Daniel Vetter <[email protected]>:

Quoted 10 lines · Paulo Zanoni
Quoted 8 lines

2013/10/24 Ben Widawsky <[email protected]>:

Quoted 3 lines

Production HSW does not need it. I confirmed this with Art.

I just hope these things don't start uncovering bugs :)

Quoted 7 lines
Quoted 3 lines

Merged the first 2 patches of this series. Not sure what to do with the other two, since fbc is essentially disabled on pre-hsw. And no one seems to really work on it :( So I only see minimal reasons to frob with it ...

IMHO what you said is another reason to actually merge the other two patches, since they make FBC-only WAs be applied only on FBC (e.g., probably never).

Another reason would be keeping the codepaths at least somewhat similar. Could make it a bit easier to fix things later. If it would be me who gets to fix the FBC mess at some point, I'd try to fix it for all gens for sure.

Quoted 10 lines

At some point I posted a patch to attempt a quick FBC fix for SNB:
"[PATCH] drm/i915: Attempt to fix FBC render tracking with hardware contexts"

In theory that could make FBC work equally well for SNB as it works for IVB+. And I must confess that I have FBC enabled on my IVB ultrabook currently since it appears to save a rather significant amount of power.

Signature · 2 lines
Ville Syrjälä
Intel OTC
Quoted 4 lines

I just looked at your patch, and I should probably comment there, but it's 5 months old :D. Did you actually observe a fix of something with that patch? I feel like the way in which we enable/disable tracking, it shouldn't make a difference.

I've never even tried to enable FBC on SNB ;)

But it should easy to trick it into doing the wrong thing.

1) switch to context A
2) page flip to buf 0
-> FBC RT address will point to buf 0
3) switch to context B
4) page flip to buf 1
-> FBC RT address will point to buf 1
5) switch to context A
-> FBC RT addres will be restored to point to buf 0
6) render into buf 1 and observe that FBC doesn't invalidate the compressed data

Signature · 2 lines
Ville Syrjälä
Intel OTC
#8 lore raw

Re: [PATCH 2/4] drm/i915: Remove WaFbcDisableDpfcClockGating on HSW

Quoted 48 lines · Ville Syrjälä
Quoted 38 lines · Ben Widawsky
Quoted 25 lines · Ville Syrjälä
Quoted 11 lines · Paulo Zanoni

2013/10/27 Daniel Vetter <[email protected]>:

Quoted 10 lines · Paulo Zanoni
Quoted 8 lines

2013/10/24 Ben Widawsky <[email protected]>:

Quoted 3 lines

Production HSW does not need it. I confirmed this with Art.

I just hope these things don't start uncovering bugs :)

Quoted 7 lines
Quoted 3 lines

Merged the first 2 patches of this series. Not sure what to do with the other two, since fbc is essentially disabled on pre-hsw. And no one seems to really work on it :( So I only see minimal reasons to frob with it ...

IMHO what you said is another reason to actually merge the other two patches, since they make FBC-only WAs be applied only on FBC (e.g., probably never).

Another reason would be keeping the codepaths at least somewhat similar. Could make it a bit easier to fix things later. If it would be me who gets to fix the FBC mess at some point, I'd try to fix it for all gens for sure.

Quoted 10 lines

At some point I posted a patch to attempt a quick FBC fix for SNB:
"[PATCH] drm/i915: Attempt to fix FBC render tracking with hardware contexts"

In theory that could make FBC work equally well for SNB as it works for IVB+. And I must confess that I have FBC enabled on my IVB ultrabook currently since it appears to save a rather significant amount of power.

Signature · 2 lines
Ville Syrjälä
Intel OTC
Quoted 4 lines

I just looked at your patch, and I should probably comment there, but it's 5 months old :D. Did you actually observe a fix of something with that patch? I feel like the way in which we enable/disable tracking, it shouldn't make a difference.

I've never even tried to enable FBC on SNB ;)

But it should easy to trick it into doing the wrong thing.

Quoted 14 lines

1) switch to context A
2) page flip to buf 0
-> FBC RT address will point to buf 0
3) switch to context B
4) page flip to buf 1
-> FBC RT address will point to buf 1
5) switch to context A
-> FBC RT addres will be restored to point to buf 0
6) render into buf 1 and observe that FBC doesn't invalidate the compressed data

Signature · 2 lines
Ville Syrjälä
Intel OTC

I thought this is fine because we set the enable bit concurrently with the base address, and disable when not being used. I really don't know the code well enough though.

Signature · 5 lines
Ben Widawsky, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

Re: [PATCH 2/4] drm/i915: Remove WaFbcDisableDpfcClockGating on HSW

In reply to Paulo Zanoni
Quoted 11 lines · Paulo Zanoni

2013/10/27 Daniel Vetter <[email protected]>:

Quoted 10 lines · Paulo Zanoni
Quoted 8 lines

2013/10/24 Ben Widawsky <[email protected]>:

Quoted 3 lines

Production HSW does not need it. I confirmed this with Art.

I just hope these things don't start uncovering bugs :)

Quoted 7 lines
Quoted 3 lines

Merged the first 2 patches of this series. Not sure what to do with the other two, since fbc is essentially disabled on pre-hsw. And no one seems to really work on it :( So I only see minimal reasons to frob with it ...

IMHO what you said is another reason to actually merge the other two patches, since they make FBC-only WAs be applied only on FBC (e.g., probably never).

Oh, that was just a comment on top since the last 2 patches in this series are blocked on review comments anyway. I'll pull them in once that's settled. But maybe it spurs someone to work a bit on fbc ... -Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#10 lore raw

PATCH 3/4 drm/i915: WaFbcDisableDpfcrClockGating only with fbc

In reply to Ben Widawsky

We were turning this on for ILK regardless of whether or not we use FBC. We can save the slightest amount of power if we don't disable it when not using FBC.

The workaround should be bit 8 for ILK. Notice it is 1 bit difference from SNB. This is actually DPFCR unit as we've defined it.

---
 drivers/gpu/drm/i915/intel_pm.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +13 -2
index 686699c..bbcf100 100644
@@ -238,6 +238,11 @@ static void ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
 			   SNB_CPU_FENCE_ENABLE | obj->fence_reg);
 		I915_WRITE(DPFC_CPU_FENCE_OFFSET, crtc->y);
 		sandybridge_blit_fbc_update(dev);
+	} else {
+		/* WaFbcDisableDpfcClockGating:ilk */
+		I915_WRITE(ILK_DSPCLK_GATE_D,
+			   I915_READ(ILK_DSPCLK_GATE_D) |
+			   ILK_DPFCRUNIT_CLOCK_GATE_DISABLE);
 	}
 
 	DRM_DEBUG_KMS("enabled fbc on plane %c\n", plane_name(intel_crtc->plane));
@@ -254,6 +259,12 @@ static void ironlake_disable_fbc(struct drm_device *dev)
 		dpfc_ctl &= ~DPFC_CTL_EN;
 		I915_WRITE(ILK_DPFC_CONTROL, dpfc_ctl);
 
+		if (IS_GEN5(dev))
+			/* WaFbcDisableDpfcClockGating:ilk */
+			I915_WRITE(ILK_DSPCLK_GATE_D,
+				   I915_READ(ILK_DSPCLK_GATE_D) &
+				   ~ILK_DPFCRUNIT_CLOCK_GATE_DISABLE);
+
 		DRM_DEBUG_KMS("disabled FBC\n");
 	}
 }
@@ -4932,9 +4943,9 @@ static void ironlake_init_clock_gating(struct drm_device *dev)
 
 	/*
 	 * Required for FBC
-	 * WaFbcDisableDpfcClockGating:ilk
+	 * WaFbcDisableDpfcClockGating:snb
 	 */
-	dspclk_gate |= ILK_DPFCRUNIT_CLOCK_GATE_DISABLE |
+	dspclk_gate |=
 		   ILK_DPFCUNIT_CLOCK_GATE_DISABLE |
 		   ILK_DPFDUNIT_CLOCK_GATE_ENABLE;
 
Signature · 1 line
1.8.4.1
#11 lore raw

Re: [PATCH 3/4] drm/i915: WaFbcDisableDpfcrClockGating only with fbc

2013/10/24 Ben Widawsky <[email protected]>:

Quoted 3 lines

We were turning this on for ILK regardless of whether or not we use FBC. We can save the slightest amount of power if we don't disable it when not using FBC.

Finally someone did what I requested months ago:
http://lists.freedesktop.org/archives/intel-gfx/2013-June/028906.html
:)

Quoted 3 lines

The workaround should be bit 8 for ILK. Notice it is 1 bit difference from SNB. This is actually DPFCR unit as we've defined it.

Ok, so we have bits 8 and 9. Judging by the register names, I would say bit 9 is WaFbcDisableDpfcClockGating (without 'r') and bit 8 is the ironlake-only WaFbcDisableDpfcrClockGating. Is that right?

Quoted 11 lines
---
 drivers/gpu/drm/i915/intel_pm.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -0
index 686699c..bbcf100 100644

drivers/gpu/drm/i915/intel_pm.c static void ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval) · line 242

Quoted 5 lines
drivers/gpu/drm/i915/intel_pm.c +2 -0
@@ -238,6 +238,11 @@ static void ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
                           SNB_CPU_FENCE_ENABLE | obj->fence_reg);
                I915_WRITE(DPFC_CPU_FENCE_OFFSET, crtc->y);
                sandybridge_blit_fbc_update(dev);
+       } else {
+               /* WaFbcDisableDpfcClockGating:ilk */

If you agree with me on the question above, then the WA name here is missing an 'r' char.

drivers/gpu/drm/i915/intel_pm.c static void ironlake_disable_fbc(struct drm_device *dev) · line 263

Quoted 12 lines
drivers/gpu/drm/i915/intel_pm.c +5 -0
+               I915_WRITE(ILK_DSPCLK_GATE_D,
+                          I915_READ(ILK_DSPCLK_GATE_D) |
+                          ILK_DPFCRUNIT_CLOCK_GATE_DISABLE);
        }
 
        DRM_DEBUG_KMS("enabled fbc on plane %c\n", plane_name(intel_crtc->plane));
@@ -254,6 +259,12 @@ static void ironlake_disable_fbc(struct drm_device *dev)
                dpfc_ctl &= ~DPFC_CTL_EN;
                I915_WRITE(ILK_DPFC_CONTROL, dpfc_ctl);
 
+               if (IS_GEN5(dev))
+                       /* WaFbcDisableDpfcClockGating:ilk */

Same here.

drivers/gpu/drm/i915/intel_pm.c static void ironlake_init_clock_gating(struct drm_device *dev) · line 4946

Quoted 13 lines
drivers/gpu/drm/i915/intel_pm.c +5 -1
+                       I915_WRITE(ILK_DSPCLK_GATE_D,
+                                  I915_READ(ILK_DSPCLK_GATE_D) &
+                                  ~ILK_DPFCRUNIT_CLOCK_GATE_DISABLE);
+
                DRM_DEBUG_KMS("disabled FBC\n");
        }
 }
@@ -4932,9 +4943,9 @@ static void ironlake_init_clock_gating(struct drm_device *dev)
 
        /*
         * Required for FBC
-        * WaFbcDisableDpfcClockGating:ilk
+        * WaFbcDisableDpfcClockGating:snb

The ":snb" part is certainly wrong since this function doesn't run on SNB.

The actual code (excluding comments) looks correct.

Quoted 13 lines
drivers/gpu/drm/i915/intel_pm.c +1 -2
         */
-       dspclk_gate |= ILK_DPFCRUNIT_CLOCK_GATE_DISABLE |
+       dspclk_gate |=
                   ILK_DPFCUNIT_CLOCK_GATE_DISABLE |
                   ILK_DPFDUNIT_CLOCK_GATE_ENABLE;
 
--

1.8.4.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Paulo Zanoni
#12 lore raw

Re: [PATCH 3/4] drm/i915: WaFbcDisableDpfcrClockGating only with fbc

Quoted 11 lines · Paulo Zanoni

2013/10/24 Ben Widawsky <[email protected]>:

Quoted 3 lines

We were turning this on for ILK regardless of whether or not we use FBC. We can save the slightest amount of power if we don't disable it when not using FBC.

Finally someone did what I requested months ago:
http://lists.freedesktop.org/archives/intel-gfx/2013-June/028906.html
:)

Quoted 1 line
Quoted 6 lines
Quoted 2 lines

The workaround should be bit 8 for ILK. Notice it is 1 bit difference from SNB. This is actually DPFCR unit as we've defined it.

Ok, so we have bits 8 and 9. Judging by the register names, I would say bit 9 is WaFbcDisableDpfcClockGating (without 'r') and bit 8 is the ironlake-only WaFbcDisableDpfcrClockGating. Is that right?

Actually from what I remember in the database (not looking currently), the workaround names are the same, but maybe my eyes missed the 'R'. I differentiated it with the 'R' so that anyone who was reviewing it didn't go insane.

Quoted 8 lines
Quoted 8 lines
---
 drivers/gpu/drm/i915/intel_pm.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
Quoted 13 lines

drivers/gpu/drm/i915/intel_pm.c static void ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval) · line 242

Quoted 10 lines
drivers/gpu/drm/i915/intel_pm.c +2 -0
index 686699c..bbcf100 100644
@@ -238,6 +238,11 @@ static void ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
                           SNB_CPU_FENCE_ENABLE | obj->fence_reg);
                I915_WRITE(DPFC_CPU_FENCE_OFFSET, crtc->y);
                sandybridge_blit_fbc_update(dev);
+       } else {
+               /* WaFbcDisableDpfcClockGating:ilk */

If you agree with me on the question above, then the WA name here is missing an 'r' char.

I guess I have to go back to the database now to check. I don't have the bookmark anywhere on my machines here.

Quoted 27 lines
Quoted 9 lines
drivers/gpu/drm/i915/intel_pm.c +3 -0
+               I915_WRITE(ILK_DSPCLK_GATE_D,
+                          I915_READ(ILK_DSPCLK_GATE_D) |
+                          ILK_DPFCRUNIT_CLOCK_GATE_DISABLE);
        }
 
        DRM_DEBUG_KMS("enabled fbc on plane %c\n", plane_name(intel_crtc->plane));

drivers/gpu/drm/i915/intel_pm.c static void ironlake_disable_fbc(struct drm_device *dev) · line 263

Quoted 5 lines
drivers/gpu/drm/i915/intel_pm.c +2 -0
@@ -254,6 +259,12 @@ static void ironlake_disable_fbc(struct drm_device *dev)
                dpfc_ctl &= ~DPFC_CTL_EN;
                I915_WRITE(ILK_DPFC_CONTROL, dpfc_ctl);
 
+               if (IS_GEN5(dev))
+                       /* WaFbcDisableDpfcClockGating:ilk */

Same here.

Quoted 9 lines
drivers/gpu/drm/i915/intel_pm.c +4 -0
+                       I915_WRITE(ILK_DSPCLK_GATE_D,
+                                  I915_READ(ILK_DSPCLK_GATE_D) &
+                                  ~ILK_DPFCRUNIT_CLOCK_GATE_DISABLE);
+
                DRM_DEBUG_KMS("disabled FBC\n");
        }
 }
@@ -4932,9 +4943,9 @@ static void ironlake_init_clock_gating(struct drm_device *dev)
 
Quoted 9 lines

drivers/gpu/drm/i915/intel_pm.c static void ironlake_init_clock_gating(struct drm_device *dev) · line 4946

Quoted 4 lines
drivers/gpu/drm/i915/intel_pm.c +1 -1
        /*
         * Required for FBC
-        * WaFbcDisableDpfcClockGating:ilk
+        * WaFbcDisableDpfcClockGating:snb

The ":snb" part is certainly wrong since this function doesn't run on SNB.

The actual code (excluding comments) looks correct.

Oops, thanks. The diff should just remove the line completely.

Quoted 19 lines
Quoted 14 lines
drivers/gpu/drm/i915/intel_pm.c +1 -2
         */
-       dspclk_gate |= ILK_DPFCRUNIT_CLOCK_GATE_DISABLE |
+       dspclk_gate |=
                   ILK_DPFCUNIT_CLOCK_GATE_DISABLE |
                   ILK_DPFDUNIT_CLOCK_GATE_ENABLE;
 
--

1.8.4.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Paulo Zanoni
Signature · 1 line
Ben Widawsky, Intel Open Source Technology Center
#13 lore raw

PATCH 4/4 drm/i915: WaFbcDisableDpfcClockGating only with fbc

In reply to Ben Widawsky

We were turning this on for SNB regardless of whether or not we use FBC. We can save the slightest amount of power if we don't disable it when not using FBC.

The workaround should be bit 9 for SNB.

---
 drivers/gpu/drm/i915/intel_pm.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +15 -10
index bbcf100..4ebbe65 100644
@@ -237,6 +237,12 @@ static void ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
 		I915_WRITE(SNB_DPFC_CTL_SA,
 			   SNB_CPU_FENCE_ENABLE | obj->fence_reg);
 		I915_WRITE(DPFC_CPU_FENCE_OFFSET, crtc->y);
+
+		/* WaFbcDisableDpfcClockGating:snb */
+		I915_WRITE(ILK_DSPCLK_GATE_D,
+			   I915_READ(ILK_DSPCLK_GATE_D) |
+			   ILK_DPFCUNIT_CLOCK_GATE_DISABLE);
+
 		sandybridge_blit_fbc_update(dev);
 	} else {
 		/* WaFbcDisableDpfcClockGating:ilk */
@@ -259,7 +265,12 @@ static void ironlake_disable_fbc(struct drm_device *dev)
 		dpfc_ctl &= ~DPFC_CTL_EN;
 		I915_WRITE(ILK_DPFC_CONTROL, dpfc_ctl);
 
-		if (IS_GEN5(dev))
+		if (IS_GEN6(dev))
+			/* WaFbcDisableDpfcClockGating:snb */
+			I915_WRITE(ILK_DSPCLK_GATE_D,
+				   I915_READ(ILK_DSPCLK_GATE_D) &
+				   ~ILK_DPFCUNIT_CLOCK_GATE_DISABLE);
+		else if (IS_GEN5(dev))
 			/* WaFbcDisableDpfcClockGating:ilk */
 			I915_WRITE(ILK_DSPCLK_GATE_D,
 				   I915_READ(ILK_DSPCLK_GATE_D) &
@@ -4939,15 +4950,9 @@ static void g4x_disable_trickle_feed(struct drm_device *dev)
 static void ironlake_init_clock_gating(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	uint32_t dspclk_gate = ILK_VRHUNIT_CLOCK_GATE_DISABLE;
-
-	/*
-	 * Required for FBC
-	 * WaFbcDisableDpfcClockGating:snb
-	 */
-	dspclk_gate |=
-		   ILK_DPFCUNIT_CLOCK_GATE_DISABLE |
-		   ILK_DPFDUNIT_CLOCK_GATE_ENABLE;
+	uint32_t dspclk_gate =
+		ILK_VRHUNIT_CLOCK_GATE_DISABLE |
+		ILK_DPFDUNIT_CLOCK_GATE_ENABLE;
 
 	I915_WRITE(PCH_3DCGDIS0,
 		   MARIUNIT_CLOCK_GATE_DISABLE |
Signature · 1 line
1.8.4.1
#14 lore raw

Re: [PATCH 4/4] drm/i915: WaFbcDisableDpfcClockGating only with fbc

2013/10/24 Ben Widawsky <[email protected]>:

Quoted 5 lines

We were turning this on for SNB regardless of whether or not we use FBC. We can save the slightest amount of power if we don't disable it when not using FBC.

The workaround should be bit 9 for SNB.

First, see comment in patch 3. So you're removing the WA on ILK and applying it for SNB-only. Since the spec doesn't say "SNB only", I guess we need this WA on both gens.

Quoted 63 lines
---
 drivers/gpu/drm/i915/intel_pm.c | 25 +++++++++++++++----------
 1 file changed, 15 insertions(+), 10 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +15 -11
index bbcf100..4ebbe65 100644
@@ -237,6 +237,12 @@ static void ironlake_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
                I915_WRITE(SNB_DPFC_CTL_SA,
                           SNB_CPU_FENCE_ENABLE | obj->fence_reg);
                I915_WRITE(DPFC_CPU_FENCE_OFFSET, crtc->y);
+
+               /* WaFbcDisableDpfcClockGating:snb */
+               I915_WRITE(ILK_DSPCLK_GATE_D,
+                          I915_READ(ILK_DSPCLK_GATE_D) |
+                          ILK_DPFCUNIT_CLOCK_GATE_DISABLE);
+
                sandybridge_blit_fbc_update(dev);
        } else {
                /* WaFbcDisableDpfcClockGating:ilk */
@@ -259,7 +265,12 @@ static void ironlake_disable_fbc(struct drm_device *dev)
                dpfc_ctl &= ~DPFC_CTL_EN;
                I915_WRITE(ILK_DPFC_CONTROL, dpfc_ctl);
 
-               if (IS_GEN5(dev))
+               if (IS_GEN6(dev))
+                       /* WaFbcDisableDpfcClockGating:snb */
+                       I915_WRITE(ILK_DSPCLK_GATE_D,
+                                  I915_READ(ILK_DSPCLK_GATE_D) &
+                                  ~ILK_DPFCUNIT_CLOCK_GATE_DISABLE);
+               else if (IS_GEN5(dev))
                        /* WaFbcDisableDpfcClockGating:ilk */
                        I915_WRITE(ILK_DSPCLK_GATE_D,
                                   I915_READ(ILK_DSPCLK_GATE_D) &
@@ -4939,15 +4950,9 @@ static void g4x_disable_trickle_feed(struct drm_device *dev)
 static void ironlake_init_clock_gating(struct drm_device *dev)
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
-       uint32_t dspclk_gate = ILK_VRHUNIT_CLOCK_GATE_DISABLE;
-
-       /*
-        * Required for FBC
-        * WaFbcDisableDpfcClockGating:snb
-        */
-       dspclk_gate |=
-                  ILK_DPFCUNIT_CLOCK_GATE_DISABLE |
-                  ILK_DPFDUNIT_CLOCK_GATE_ENABLE;
+       uint32_t dspclk_gate =
+               ILK_VRHUNIT_CLOCK_GATE_DISABLE |
+               ILK_DPFDUNIT_CLOCK_GATE_ENABLE;
 
        I915_WRITE(PCH_3DCGDIS0,
                   MARIUNIT_CLOCK_GATE_DISABLE |
--

1.8.4.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Paulo Zanoni
#15 lore raw

Re: [PATCH 4/4] drm/i915: WaFbcDisableDpfcClockGating only with fbc

Quoted 10 lines · Paulo Zanoni

2013/10/24 Ben Widawsky <[email protected]>:

Quoted 5 lines

We were turning this on for SNB regardless of whether or not we use FBC. We can save the slightest amount of power if we don't disable it when not using FBC.

The workaround should be bit 9 for SNB.

First, see comment in patch 3. So you're removing the WA on ILK and applying it for SNB-only. Since the spec doesn't say "SNB only", I guess we need this WA on both gens.

This is a question for Art, since he confirmed this privately IIRC.

Art does ILK need bit 8 and 9 set in 0x42020?

[snip]

Signature · 1 line
Ben Widawsky, Intel Open Source Technology Center
Reviewed-by on v1 1/4
#16 lore raw
In reply to Ben Widawsky

2013/10/24 Ben Widawsky <[email protected]>:

Quoted 3 lines

Production IVB does not need it. I confirmed this with Art.

Quoted 39 lines
---
 drivers/gpu/drm/i915/intel_pm.c | 10 ----------
 1 file changed, 10 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +0 -11
index d4dd543..33ad028 100644
@@ -254,12 +254,6 @@ static void ironlake_disable_fbc(struct drm_device *dev)
                dpfc_ctl &= ~DPFC_CTL_EN;
                I915_WRITE(ILK_DPFC_CONTROL, dpfc_ctl);
 
-               if (IS_IVYBRIDGE(dev))
-                       /* WaFbcDisableDpfcClockGating:ivb */
-                       I915_WRITE(ILK_DSPCLK_GATE_D,
-                                  I915_READ(ILK_DSPCLK_GATE_D) &
-                                  ~ILK_DPFCUNIT_CLOCK_GATE_DISABLE);
-
                if (IS_HASWELL(dev))
                        /* WaFbcDisableDpfcClockGating:hsw */
                        I915_WRITE(HSW_CLKGATE_DISABLE_PART_1,
@@ -295,10 +289,6 @@ static void gen7_enable_fbc(struct drm_crtc *crtc, unsigned long interval)
        if (IS_IVYBRIDGE(dev)) {
                /* WaFbcAsynchFlipDisableFbcQueue:ivb */
                I915_WRITE(ILK_DISPLAY_CHICKEN1, ILK_FBCQ_DIS);
-               /* WaFbcDisableDpfcClockGating:ivb */
-               I915_WRITE(ILK_DSPCLK_GATE_D,
-                          I915_READ(ILK_DSPCLK_GATE_D) |
-                          ILK_DPFCUNIT_CLOCK_GATE_DISABLE);
        } else {
                /* WaFbcAsynchFlipDisableFbcQueue:hsw */
                I915_WRITE(HSW_PIPE_SLICE_CHICKEN_1(intel_crtc->pipe),
--

1.8.4.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Paulo Zanoni