drm/i915: Trickle feed bits v2
Subsystems (2)
cover drm/i915: Trickle feed bits v2
This is a re-send of the trickle feed patches.
Patches 1-3 are unchanged.
I left out the VLV patch until I can clarify the situation a bit more.
I also got sick of the amount of copy pasted code, so I also added another patch to refactor the code a bit (patch 4)
PATCH 1/4 drm/i915: Disable primary plane trickle feed for g4x
From: Ville Syrjälä <[email protected]>
The docs say that the trickle feed disable bit is present (for primary planes only, not video sprites) on CTG, and that it must be set for ELK. Just set it for all g4x chipsets.
v2: Do it in init_clock_gating too
--- drivers/gpu/drm/i915/intel_display.c | 3 +++ drivers/gpu/drm/i915/intel_pm.c | 9 +++++++++ 2 files changed, 12 insertions(+)
drivers/gpu/drm/i915/intel_display.c +3 -0
@@ -1958,6 +1958,9 @@ static int i9xx_update_plane(struct drm_crtc *crtc, struct drm_framebuffer *fb, dspcntr &= ~DISPPLANE_TILED ; } +if (IS_G4X (dev)) + dspcntr |=DISPPLANE_TRICKLE_FEED_DISABLE ; +I915_WRITE (reg, dspcntr); linear_offset = y * fb->pitches[0 ] + x * (fb->bits_per_pixel /8 );
drivers/gpu/drm/i915/intel_pm.c +9 -0
@@ -4908,6 +4908,7 @@ static void g4x_init_clock_gating(struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;uint32_t dspclk_gate; +int pipe;I915_WRITE (RENCLK_GATE_D1 ,0 ); I915_WRITE(RENCLK_GATE_D2, VF_UNIT_CLOCK_GATE_DISABLE |
@@ -4924,6 +4925,14 @@ static void g4x_init_clock_gating(struct drm_device *dev)/* WaDisableRenderCachePipelinedFlush */ I915_WRITE (CACHE_MODE_0 ,_MASKED_BIT_ENABLE (CM0_PIPELINED_RENDER_FLUSH_DISABLE )); + +for_each_pipe (pipe) { +I915_WRITE (DSPCNTR (pipe), +I915_READ (DSPCNTR (pipe)) | +DISPPLANE_TRICKLE_FEED_DISABLE ); +intel_flush_display_plane (dev_priv, pipe); + } + }static void crestline_init_clock_gating (struct drm_device *dev)
Signature · 6 lines
1.8.1.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/4 drm/i915: Disable trickle feed via MI_ARB_STATE for the gen4
In reply to [email protected]From: Ville Syrjälä <[email protected]>
According to BSpec, trickle feed should be disabled for BW and mobile CL. Those constraints seem to match all of our gen4 chipsets.
Trickle feed is disabled via the MI_ARB_STATE register instead of per plane controls on gen4.
--- drivers/gpu/drm/i915/intel_pm.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +4 -0
@@ -4944,6 +4944,8 @@ static void crestline_init_clock_gating(struct drm_device *dev)I915_WRITE (DSPCLK_GATE_D ,0 );I915_WRITE (RAMCLK_GATE_D ,0 );I915_WRITE16 (DEUC ,0 ); +I915_WRITE (MI_ARB_STATE , +_MASKED_BIT_ENABLE (MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE )); }static void broadwater_init_clock_gating (struct drm_device *dev)
@@ -4956,6 +4958,8 @@ static void broadwater_init_clock_gating(struct drm_device *dev)I965_ISC_CLOCK_GATE_DISABLE | I965_FBC_CLOCK_GATE_DISABLE);I915_WRITE (RENCLK_GATE_D2 ,0 ); +I915_WRITE (MI_ARB_STATE , +_MASKED_BIT_ENABLE (MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE )); }static void gen3_init_clock_gating (struct drm_device *dev)
Signature · 6 lines
1.8.1.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/4 drm/i915: Disable trickle feed in ironlake_init_clock_gating()
In reply to [email protected]From: Ville Syrjälä <[email protected]>
We disable trickle feed in all the (relevant) clock gating functions, except ironlake_init_clock_gating(). Copy paste the same code there as well.
--- drivers/gpu/drm/i915/intel_pm.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/i915/intel_pm.c +8 -0
@@ -4391,6 +4391,7 @@ 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 ; +int pipe;/* Required for FBC */ dspclk_gate |= ILK_DPFCRUNIT_CLOCK_GATE_DISABLE |
@@ -4450,6 +4451,13 @@ static void ironlake_init_clock_gating(struct drm_device *dev)I915_WRITE (CACHE_MODE_0 ,_MASKED_BIT_ENABLE (CM0_PIPELINED_RENDER_FLUSH_DISABLE )); +for_each_pipe (pipe) { +I915_WRITE (DSPCNTR (pipe), +I915_READ (DSPCNTR (pipe)) | +DISPPLANE_TRICKLE_FEED_DISABLE ); +intel_flush_display_plane (dev_priv, pipe); + } +ibx_init_clock_gating (dev); }
Signature · 6 lines
1.8.1.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/4 drm/i915: Refactor ctg+ trickle feed disable
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Pull the code to disable trickle feed for all primary planes into a separate function.
--- drivers/gpu/drm/i915/intel_pm.c | 62 +++++++++++++---------------------------- 1 file changed, 19 insertions(+), 43 deletions(-)
drivers/gpu/drm/i915/intel_pm.c +19 -43
@@ -4387,11 +4387,23 @@ static void ibx_init_clock_gating(struct drm_device *dev)I915_WRITE (SOUTH_DSPCLK_GATE_D ,PCH_DPLSUNIT_CLOCK_GATE_DISABLE ); } +static void g4x_disable_trickle_feed (struct drm_device *dev) +{ +struct drm_i915_private *dev_priv = dev->dev_private; +int pipe; + +for_each_pipe (pipe) { +I915_WRITE (DSPCNTR (pipe), +I915_READ (DSPCNTR (pipe)) | +DISPPLANE_TRICKLE_FEED_DISABLE ); +intel_flush_display_plane (dev_priv, pipe); + } +} +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 ; -int pipe;/* Required for FBC */ dspclk_gate |= ILK_DPFCRUNIT_CLOCK_GATE_DISABLE |
@@ -4451,12 +4463,7 @@ static void ironlake_init_clock_gating(struct drm_device *dev)I915_WRITE (CACHE_MODE_0 ,_MASKED_BIT_ENABLE (CM0_PIPELINED_RENDER_FLUSH_DISABLE )); -for_each_pipe (pipe) { -I915_WRITE (DSPCNTR (pipe), -I915_READ (DSPCNTR (pipe)) | -DISPPLANE_TRICKLE_FEED_DISABLE ); -intel_flush_display_plane (dev_priv, pipe); - } +g4x_disable_trickle_feed (dev);ibx_init_clock_gating (dev); }
@@ -4512,7 +4519,6 @@ static void gen6_check_mch_setup(struct drm_device *dev)static void gen6_init_clock_gating (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private; -int pipe;uint32_t dspclk_gate =ILK_VRHUNIT_CLOCK_GATE_DISABLE ;I915_WRITE (ILK_DSPCLK_GATE_D , dspclk_gate);
@@ -4588,12 +4594,7 @@ static void gen6_init_clock_gating(struct drm_device *dev)I915_WRITE (GEN6_MBCTL ,I915_READ (GEN6_MBCTL ) |GEN6_MBCTL_ENABLE_BOOT_FETCH ); -for_each_pipe (pipe) { -I915_WRITE (DSPCNTR (pipe), -I915_READ (DSPCNTR (pipe)) | -DISPPLANE_TRICKLE_FEED_DISABLE ); -intel_flush_display_plane (dev_priv, pipe); - } +g4x_disable_trickle_feed (dev);/* The default value should be 0x200 according to docs, but the two * platforms I checked have a 0 for this. (Maybe BIOS overrides?) */
@@ -4654,7 +4655,6 @@ static void lpt_suspend_hw(struct drm_device *dev)static void haswell_init_clock_gating (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private; -int pipe;I915_WRITE (WM3_LP_ILK ,0 );I915_WRITE (WM2_LP_ILK ,0 );
@@ -4680,12 +4680,7 @@ static void haswell_init_clock_gating(struct drm_device *dev)I915_READ (GEN7_SQ_CHICKEN_MBCUNIT_CONFIG ) | GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB); -for_each_pipe (pipe) { -I915_WRITE (DSPCNTR (pipe), -I915_READ (DSPCNTR (pipe)) | -DISPPLANE_TRICKLE_FEED_DISABLE ); -intel_flush_display_plane (dev_priv, pipe); - } +g4x_disable_trickle_feed (dev);/* WaVSRefCountFullforceMissDisable:hsw */ gen7_setup_fixed_func_scheduler (dev_priv);
@@ -4711,7 +4706,6 @@ static void haswell_init_clock_gating(struct drm_device *dev)static void ivybridge_init_clock_gating (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private; -int pipe;uint32_t snpcr;I915_WRITE (WM3_LP_ILK ,0 );
@@ -4780,12 +4774,7 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)I915_READ (GEN7_SQ_CHICKEN_MBCUNIT_CONFIG ) | GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB); -for_each_pipe (pipe) { -I915_WRITE (DSPCNTR (pipe), -I915_READ (DSPCNTR (pipe)) | -DISPPLANE_TRICKLE_FEED_DISABLE ); -intel_flush_display_plane (dev_priv, pipe); - } +g4x_disable_trickle_feed (dev);/* WaMbcDriverBootEnable:ivb */ I915_WRITE(GEN6_MBCTL, I915_READ(GEN6_MBCTL) |
@@ -4812,7 +4801,6 @@ static void ivybridge_init_clock_gating(struct drm_device *dev)static void valleyview_init_clock_gating (struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private; -int pipe;I915_WRITE (DSPCLK_GATE_D ,VRHUNIT_CLOCK_GATE_DISABLE );
@@ -4885,12 +4873,7 @@ static void valleyview_init_clock_gating(struct drm_device *dev)I915_WRITE (GEN7_UCGCTL4 ,GEN7_L3BANK2X_CLOCK_GATE_DISABLE ); -for_each_pipe (pipe) { -I915_WRITE (DSPCNTR (pipe), -I915_READ (DSPCNTR (pipe)) | -DISPPLANE_TRICKLE_FEED_DISABLE ); -intel_flush_display_plane (dev_priv, pipe); - } +g4x_disable_trickle_feed (dev);I915_WRITE (CACHE_MODE_1 ,_MASKED_BIT_ENABLE (PIXEL_SUBSPAN_COLLECT_OPT_DISABLE ));
@@ -4916,7 +4899,6 @@ static void g4x_init_clock_gating(struct drm_device *dev) {struct drm_i915_private *dev_priv = dev->dev_private;uint32_t dspclk_gate; -int pipe;I915_WRITE (RENCLK_GATE_D1 ,0 ); I915_WRITE(RENCLK_GATE_D2, VF_UNIT_CLOCK_GATE_DISABLE |
@@ -4934,13 +4916,7 @@ static void g4x_init_clock_gating(struct drm_device *dev)I915_WRITE (CACHE_MODE_0 ,_MASKED_BIT_ENABLE (CM0_PIPELINED_RENDER_FLUSH_DISABLE )); -for_each_pipe (pipe) { -I915_WRITE (DSPCNTR (pipe), -I915_READ (DSPCNTR (pipe)) | -DISPPLANE_TRICKLE_FEED_DISABLE ); -intel_flush_display_plane (dev_priv, pipe); - } - +g4x_disable_trickle_feed (dev); }static void crestline_init_clock_gating (struct drm_device *dev)
Signature · 6 lines
1.8.1.5 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 8 lines · On Fri, Jun 07, 2013 at 10:47:00AM +0300, [email protected] wrote:
This is a re-send of the trickle feed patches.
Patches 1-3 are unchanged.
I left out the VLV patch until I can clarify the situation a bit more.
I also got sick of the amount of copy pasted code, so I also added another patch to refactor the code a bit (patch 4)
All Reviewed-by: Chris Wilson <[email protected]> -Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Quoted 11 lines · Chris Wilson
Quoted 8 lines · On Fri, Jun 07, 2013 at 10:47:00AM +0300, [email protected] wrote:
This is a re-send of the trickle feed patches.
Patches 1-3 are unchanged.
I left out the VLV patch until I can clarify the situation a bit more.
I also got sick of the amount of copy pasted code, so I also added another patch to refactor the code a bit (patch 4)
All Reviewed-by: Chris Wilson <[email protected]>
All merged to dinq, thanks for the patches&review. -Daniel
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch