diff options
author | Dave Airlie <airlied@redhat.com> | 2013-02-07 20:08:10 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2013-02-07 20:08:10 -0500 |
commit | cd17ef4114ad5c514b17e6a0bb02a309ab90b692 (patch) | |
tree | 9c162eaa96931597b83e165702e3483ba5c6bb1e /drivers/gpu/drm/i915/intel_pm.c | |
parent | 67c964000236497e00c646472cd6b70b5c5109c8 (diff) | |
parent | 7d37beaaf3dbc6ff16f4d32a4dd6f8c557c6ab50 (diff) |
Merge tag 'drm-intel-next-2013-02-01' of git://people.freedesktop.org/~danvet/drm-intel into drm-next
Daniel writes:
"Probably the last feature pull for 3.9, there's some fixes outstanding
thought that I'd like to sneak in. And maybe 3.8 takes a bit longer ...
Anyway, highlights of this pull:
- Kill the horrible IS_DISPLAYREG hack to handle the mmio offset movements
on vlv, big thanks to Ville.
- Dynamic power well support for Haswell, shaves away a bit when only
using the eDP port on pipe A (Paulo). Plus unclaimed register fixes
uncovered by this.
- Clarifications of the gpu hang/reset state transitions, hopefully fixing
a few spurious -EIO deaths in userspace.
- Haswell ELD fixes.
- Some more (pp)gtt cleanups from Ben.
- A few smaller things all over.
Plus all the stuff from the previous rather small pull request:
- Broadcast RBG improvements and reduced color range fixes from Ville.
- Ben is on a "kill legacy gtt code for good" spree, first pile of patches
included.
- No-relocs and bo lut improvements for faster execbuf from Chris.
- Some refactorings from Imre."
* tag 'drm-intel-next-2013-02-01' of git://people.freedesktop.org/~danvet/drm-intel: (101 commits)
GPU/i915: Fix acpi_bus_get_device() check in drivers/gpu/drm/i915/intel_opregion.c
drm/i915: Set the SR01 "screen off" bit in i915_redisable_vga() too
drm/i915: Kill IS_DISPLAYREG()
drm/i915: Introduce i915_vgacntrl_reg()
drm/i915: gen6_gmch_remove can be static
drm/i915: dynamic Haswell display power well support
drm/i915: check the power down well on assert_pipe()
drm/i915: don't send DP "idle" pattern before "normal" on HSW PORT_A
drm/i915: don't run hsw power well code on !hsw
drm/i915: kill cargo-culted locking from power well code
drm/i915: Only run idle processing from i915_gem_retire_requests_worker
drm/i915: Fix CAGF for HSW
drm/i915: Reclaim GTT space for failed PPGTT
drm/i915: remove intel_gtt structure
drm/i915: Add probe and remove to the gtt ops
drm/i915: extract hw ppgtt setup/cleanup code
drm/i915: pte_encode is gen6+
drm/i915: vfuncs for ppgtt
drm/i915: vfuncs for gtt_clear_range/insert_entries
drm/i915: Error state should print /sys/kernel/debug
...
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 62 |
1 files changed, 44 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index ca9734529229..f7f67360e740 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -3687,6 +3687,10 @@ static void gen7_setup_fixed_func_scheduler(struct drm_i915_private *dev_priv) | |||
3687 | reg |= GEN7_FF_VS_SCHED_HW; | 3687 | reg |= GEN7_FF_VS_SCHED_HW; |
3688 | reg |= GEN7_FF_DS_SCHED_HW; | 3688 | reg |= GEN7_FF_DS_SCHED_HW; |
3689 | 3689 | ||
3690 | /* WaVSRefCountFullforceMissDisable */ | ||
3691 | if (IS_HASWELL(dev_priv->dev)) | ||
3692 | reg &= ~GEN7_FF_VS_REF_CNT_FFME; | ||
3693 | |||
3690 | I915_WRITE(GEN7_FF_THREAD_MODE, reg); | 3694 | I915_WRITE(GEN7_FF_THREAD_MODE, reg); |
3691 | } | 3695 | } |
3692 | 3696 | ||
@@ -4050,35 +4054,57 @@ void intel_init_clock_gating(struct drm_device *dev) | |||
4050 | dev_priv->display.init_clock_gating(dev); | 4054 | dev_priv->display.init_clock_gating(dev); |
4051 | } | 4055 | } |
4052 | 4056 | ||
4053 | /* Starting with Haswell, we have different power wells for | 4057 | void intel_set_power_well(struct drm_device *dev, bool enable) |
4054 | * different parts of the GPU. This attempts to enable them all. | ||
4055 | */ | ||
4056 | void intel_init_power_wells(struct drm_device *dev) | ||
4057 | { | 4058 | { |
4058 | struct drm_i915_private *dev_priv = dev->dev_private; | 4059 | struct drm_i915_private *dev_priv = dev->dev_private; |
4059 | unsigned long power_wells[] = { | 4060 | bool is_enabled, enable_requested; |
4060 | HSW_PWR_WELL_CTL1, | 4061 | uint32_t tmp; |
4061 | HSW_PWR_WELL_CTL2, | ||
4062 | HSW_PWR_WELL_CTL4 | ||
4063 | }; | ||
4064 | int i; | ||
4065 | 4062 | ||
4066 | if (!IS_HASWELL(dev)) | 4063 | if (!IS_HASWELL(dev)) |
4067 | return; | 4064 | return; |
4068 | 4065 | ||
4069 | mutex_lock(&dev->struct_mutex); | 4066 | tmp = I915_READ(HSW_PWR_WELL_DRIVER); |
4067 | is_enabled = tmp & HSW_PWR_WELL_STATE; | ||
4068 | enable_requested = tmp & HSW_PWR_WELL_ENABLE; | ||
4070 | 4069 | ||
4071 | for (i = 0; i < ARRAY_SIZE(power_wells); i++) { | 4070 | if (enable) { |
4072 | int well = I915_READ(power_wells[i]); | 4071 | if (!enable_requested) |
4072 | I915_WRITE(HSW_PWR_WELL_DRIVER, HSW_PWR_WELL_ENABLE); | ||
4073 | 4073 | ||
4074 | if ((well & HSW_PWR_WELL_STATE) == 0) { | 4074 | if (!is_enabled) { |
4075 | I915_WRITE(power_wells[i], well & HSW_PWR_WELL_ENABLE); | 4075 | DRM_DEBUG_KMS("Enabling power well\n"); |
4076 | if (wait_for((I915_READ(power_wells[i]) & HSW_PWR_WELL_STATE), 20)) | 4076 | if (wait_for((I915_READ(HSW_PWR_WELL_DRIVER) & |
4077 | DRM_ERROR("Error enabling power well %lx\n", power_wells[i]); | 4077 | HSW_PWR_WELL_STATE), 20)) |
4078 | DRM_ERROR("Timeout enabling power well\n"); | ||
4079 | } | ||
4080 | } else { | ||
4081 | if (enable_requested) { | ||
4082 | I915_WRITE(HSW_PWR_WELL_DRIVER, 0); | ||
4083 | DRM_DEBUG_KMS("Requesting to disable the power well\n"); | ||
4078 | } | 4084 | } |
4079 | } | 4085 | } |
4086 | } | ||
4080 | 4087 | ||
4081 | mutex_unlock(&dev->struct_mutex); | 4088 | /* |
4089 | * Starting with Haswell, we have a "Power Down Well" that can be turned off | ||
4090 | * when not needed anymore. We have 4 registers that can request the power well | ||
4091 | * to be enabled, and it will only be disabled if none of the registers is | ||
4092 | * requesting it to be enabled. | ||
4093 | */ | ||
4094 | void intel_init_power_well(struct drm_device *dev) | ||
4095 | { | ||
4096 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
4097 | |||
4098 | if (!IS_HASWELL(dev)) | ||
4099 | return; | ||
4100 | |||
4101 | /* For now, we need the power well to be always enabled. */ | ||
4102 | intel_set_power_well(dev, true); | ||
4103 | |||
4104 | /* We're taking over the BIOS, so clear any requests made by it since | ||
4105 | * the driver is in charge now. */ | ||
4106 | if (I915_READ(HSW_PWR_WELL_BIOS) & HSW_PWR_WELL_ENABLE) | ||
4107 | I915_WRITE(HSW_PWR_WELL_BIOS, 0); | ||
4082 | } | 4108 | } |
4083 | 4109 | ||
4084 | /* Set up chip specific power management-related functions */ | 4110 | /* Set up chip specific power management-related functions */ |