aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_pm.c
diff options
context:
space:
mode:
authorBen Widawsky <benjamin.widawsky@intel.com>2013-10-18 15:32:07 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-10-21 04:03:39 -0400
commitdc39fff7229c01550cad1ee8fa0309dfafdcd2e7 (patch)
treef9f7c390671054355efc57d17ca98670253b488d /drivers/gpu/drm/i915/intel_pm.c
parent6da7f10d296f4ac625f96b39eef22c41398727e3 (diff)
drm/i915: Print RC6 info less often
Since we use intel_enable_rc6() now for more than just when we're enabling RC6, we'll see this message many times, and it is just confusing. As an example, calc_residency calls this function whenever poked via sysfs. This leaves the impression in dmesg that we're constantly re-enabling RC6. While at it, move the defines and description from drv.h to intel_pm.c, since these are only ever used in that code. Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c54
1 files changed, 43 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 8064ff927bcc..bff5fa377039 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -32,6 +32,27 @@
32#include <linux/module.h> 32#include <linux/module.h>
33#include <drm/i915_powerwell.h> 33#include <drm/i915_powerwell.h>
34 34
35/**
36 * RC6 is a special power stage which allows the GPU to enter an very
37 * low-voltage mode when idle, using down to 0V while at this stage. This
38 * stage is entered automatically when the GPU is idle when RC6 support is
39 * enabled, and as soon as new workload arises GPU wakes up automatically as well.
40 *
41 * There are different RC6 modes available in Intel GPU, which differentiate
42 * among each other with the latency required to enter and leave RC6 and
43 * voltage consumed by the GPU in different states.
44 *
45 * The combination of the following flags define which states GPU is allowed
46 * to enter, while RC6 is the normal RC6 state, RC6p is the deep RC6, and
47 * RC6pp is deepest RC6. Their support by hardware varies according to the
48 * GPU, BIOS, chipset and platform. RC6 is usually the safest one and the one
49 * which brings the most power savings; deeper states save more power, but
50 * require higher latency to switch to and wake up.
51 */
52#define INTEL_RC6_ENABLE (1<<0)
53#define INTEL_RC6p_ENABLE (1<<1)
54#define INTEL_RC6pp_ENABLE (1<<2)
55
35/* FBC, or Frame Buffer Compression, is a technique employed to compress the 56/* FBC, or Frame Buffer Compression, is a technique employed to compress the
36 * framebuffer contents in-memory, aiming at reducing the required bandwidth 57 * framebuffer contents in-memory, aiming at reducing the required bandwidth
37 * during in-memory transfers and, therefore, reduce the power packet. 58 * during in-memory transfers and, therefore, reduce the power packet.
@@ -3685,6 +3706,20 @@ static void valleyview_disable_rps(struct drm_device *dev)
3685 } 3706 }
3686} 3707}
3687 3708
3709static void intel_print_rc6_info(struct drm_device *dev, u32 mode)
3710{
3711 if (IS_GEN6(dev))
3712 DRM_DEBUG_DRIVER("Sandybridge: deep RC6 disabled\n");
3713
3714 if (IS_HASWELL(dev))
3715 DRM_DEBUG_DRIVER("Haswell: only RC6 available\n");
3716
3717 DRM_INFO("Enabling RC6 states: RC6 %s, RC6p %s, RC6pp %s\n",
3718 (mode & GEN6_RC_CTL_RC6_ENABLE) ? "on" : "off",
3719 (mode & GEN6_RC_CTL_RC6p_ENABLE) ? "on" : "off",
3720 (mode & GEN6_RC_CTL_RC6pp_ENABLE) ? "on" : "off");
3721}
3722
3688int intel_enable_rc6(const struct drm_device *dev) 3723int intel_enable_rc6(const struct drm_device *dev)
3689{ 3724{
3690 /* No RC6 before Ironlake */ 3725 /* No RC6 before Ironlake */
@@ -3699,18 +3734,13 @@ int intel_enable_rc6(const struct drm_device *dev)
3699 if (INTEL_INFO(dev)->gen == 5) 3734 if (INTEL_INFO(dev)->gen == 5)
3700 return 0; 3735 return 0;
3701 3736
3702 if (IS_HASWELL(dev)) { 3737 if (IS_HASWELL(dev))
3703 DRM_DEBUG_DRIVER("Haswell: only RC6 available\n");
3704 return INTEL_RC6_ENABLE; 3738 return INTEL_RC6_ENABLE;
3705 }
3706 3739
3707 /* snb/ivb have more than one rc6 state. */ 3740 /* snb/ivb have more than one rc6 state. */
3708 if (INTEL_INFO(dev)->gen == 6) { 3741 if (INTEL_INFO(dev)->gen == 6)
3709 DRM_DEBUG_DRIVER("Sandybridge: deep RC6 disabled\n");
3710 return INTEL_RC6_ENABLE; 3742 return INTEL_RC6_ENABLE;
3711 }
3712 3743
3713 DRM_DEBUG_DRIVER("RC6 and deep RC6 enabled\n");
3714 return (INTEL_RC6_ENABLE | INTEL_RC6p_ENABLE); 3744 return (INTEL_RC6_ENABLE | INTEL_RC6p_ENABLE);
3715} 3745}
3716 3746
@@ -3812,10 +3842,7 @@ static void gen6_enable_rps(struct drm_device *dev)
3812 rc6_mask |= GEN6_RC_CTL_RC6pp_ENABLE; 3842 rc6_mask |= GEN6_RC_CTL_RC6pp_ENABLE;
3813 } 3843 }
3814 3844
3815 DRM_INFO("Enabling RC6 states: RC6 %s, RC6p %s, RC6pp %s\n", 3845 intel_print_rc6_info(dev, rc6_mask);
3816 (rc6_mask & GEN6_RC_CTL_RC6_ENABLE) ? "on" : "off",
3817 (rc6_mask & GEN6_RC_CTL_RC6p_ENABLE) ? "on" : "off",
3818 (rc6_mask & GEN6_RC_CTL_RC6pp_ENABLE) ? "on" : "off");
3819 3846
3820 I915_WRITE(GEN6_RC_CONTROL, 3847 I915_WRITE(GEN6_RC_CONTROL,
3821 rc6_mask | 3848 rc6_mask |
@@ -4051,6 +4078,9 @@ static void valleyview_enable_rps(struct drm_device *dev)
4051 VLV_RENDER_RC6_COUNT_EN)); 4078 VLV_RENDER_RC6_COUNT_EN));
4052 if (intel_enable_rc6(dev) & INTEL_RC6_ENABLE) 4079 if (intel_enable_rc6(dev) & INTEL_RC6_ENABLE)
4053 rc6_mode = GEN7_RC_CTL_TO_MODE; 4080 rc6_mode = GEN7_RC_CTL_TO_MODE;
4081
4082 intel_print_rc6_info(dev, rc6_mode);
4083
4054 I915_WRITE(GEN6_RC_CONTROL, rc6_mode); 4084 I915_WRITE(GEN6_RC_CONTROL, rc6_mode);
4055 4085
4056 val = vlv_punit_read(dev_priv, PUNIT_REG_GPU_FREQ_STS); 4086 val = vlv_punit_read(dev_priv, PUNIT_REG_GPU_FREQ_STS);
@@ -4222,6 +4252,8 @@ static void ironlake_enable_rc6(struct drm_device *dev)
4222 4252
4223 I915_WRITE(PWRCTXA, i915_gem_obj_ggtt_offset(dev_priv->ips.pwrctx) | PWRCTX_EN); 4253 I915_WRITE(PWRCTXA, i915_gem_obj_ggtt_offset(dev_priv->ips.pwrctx) | PWRCTX_EN);
4224 I915_WRITE(RSTDBYCTL, I915_READ(RSTDBYCTL) & ~RCX_SW_EXIT); 4254 I915_WRITE(RSTDBYCTL, I915_READ(RSTDBYCTL) & ~RCX_SW_EXIT);
4255
4256 intel_print_rc6_info(dev, INTEL_RC6_ENABLE);
4225} 4257}
4226 4258
4227static unsigned long intel_pxfreq(u32 vidfreq) 4259static unsigned long intel_pxfreq(u32 vidfreq)