Skip to content

Commit

Permalink
drm/i915: fix up ilk rc6 disabling confusion
Browse files Browse the repository at this point in the history
While creating the new enable/disable_gt_powersave functions in

commit 8090c6b
Author: Daniel Vetter <[email protected]>
Date:   Sun Jun 24 16:42:32 2012 +0200

    drm/i915: wrap up gt powersave enabling functions

I've botched up the handling of ironlake_disable_rc6. Fix this up by
calling it at the right place. Note though that ironlake_disable_rc6
does a bit more than just disabling rc6 - it also tears down all the
allocated context objects.

Hence we need to move intel_teardown_rc6 out and directly call it from
intel_modeset_cleanup.

Also properly mark ironlake_enable_rc6 as static and kill the un-used
declaration in i915_drv.h.

Note: In review a question popped out why disable_rc6 also tears down
the backing object and why we should move that out - it's simply for
consistency with gen6+ rps code, which does it that way.

Cc: Ben Widawsky <[email protected]>
Reviewed-by: Eugeni Dodonov <[email protected]>
Reviewed-by: Ben Widawsky <[email protected]>
Signed-Off-by: Daniel Vetter <[email protected]>
  • Loading branch information
danvet committed Jul 5, 2012
1 parent 6590190 commit 930ebb4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,6 @@ extern bool intel_fbc_enabled(struct drm_device *dev);
extern void intel_disable_fbc(struct drm_device *dev);
extern bool ironlake_set_drps(struct drm_device *dev, u8 val);
extern void ironlake_init_pch_refclk(struct drm_device *dev);
extern void ironlake_enable_rc6(struct drm_device *dev);
extern void gen6_set_rps(struct drm_device *dev, u8 val);
extern void intel_detect_pch(struct drm_device *dev);
extern int intel_trans_dp_port_sel(struct drm_crtc *crtc);
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -7267,6 +7267,8 @@ void intel_modeset_cleanup(struct drm_device *dev)

intel_disable_gt_powersave(dev);

ironlake_teardown_rc6(dev);

if (IS_VALLEYVIEW(dev))
vlv_init_dpio(dev);

Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/intel_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ extern void intel_gpu_ips_teardown(void);
extern void intel_enable_gt_powersave(struct drm_device *dev);
extern void intel_disable_gt_powersave(struct drm_device *dev);
extern void gen6_gt_check_fifodbg(struct drm_i915_private *dev_priv);
extern void ironlake_teardown_rc6(struct drm_device *dev);

extern void intel_ddi_dpms(struct drm_encoder *encoder, int mode);
extern void intel_ddi_mode_set(struct drm_encoder *encoder,
Expand Down
14 changes: 7 additions & 7 deletions drivers/gpu/drm/i915/intel_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2563,7 +2563,7 @@ static void gen6_update_ring_freq(struct drm_device *dev)
}
}

static void ironlake_teardown_rc6(struct drm_device *dev)
void ironlake_teardown_rc6(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;

Expand All @@ -2580,7 +2580,7 @@ static void ironlake_teardown_rc6(struct drm_device *dev)
}
}

void ironlake_disable_rc6(struct drm_device *dev)
static void ironlake_disable_rc6(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;

Expand All @@ -2596,8 +2596,6 @@ void ironlake_disable_rc6(struct drm_device *dev)
I915_WRITE(RSTDBYCTL, I915_READ(RSTDBYCTL) & ~RCX_SW_EXIT);
POSTING_READ(RSTDBYCTL);
}

ironlake_teardown_rc6(dev);
}

static int ironlake_setup_rc6(struct drm_device *dev)
Expand All @@ -2619,7 +2617,7 @@ static int ironlake_setup_rc6(struct drm_device *dev)
return 0;
}

void ironlake_enable_rc6(struct drm_device *dev)
static void ironlake_enable_rc6(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_ring_buffer *ring = &dev_priv->ring[RCS];
Expand Down Expand Up @@ -3241,10 +3239,12 @@ static void intel_init_emon(struct drm_device *dev)

void intel_disable_gt_powersave(struct drm_device *dev)
{
if (IS_IRONLAKE_M(dev))
if (IS_IRONLAKE_M(dev)) {
ironlake_disable_drps(dev);
else if (INTEL_INFO(dev)->gen >= 6 && !IS_VALLEYVIEW(dev))
ironlake_disable_rc6(dev);
} else if (INTEL_INFO(dev)->gen >= 6 && !IS_VALLEYVIEW(dev)) {
gen6_disable_rps(dev);
}
}

void intel_enable_gt_powersave(struct drm_device *dev)
Expand Down

0 comments on commit 930ebb4

Please sign in to comment.