diff options
author | Rodrigo Vivi <rodrigo.vivi@gmail.com> | 2014-09-16 19:19:06 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-09-24 04:37:00 -0400 |
commit | 0aa48783979d40a1de59eb5b04989e1398400c3c (patch) | |
tree | f8c75ec0f472cb9809ce2393f63b77cca9af1d8b | |
parent | ba80f4d4266b2c804a2dd6deec6e2df32cb033ce (diff) |
drm/i915: PSR: Organize PSR enable function
We don't need to setup everything else if it doesn't match all conditions.
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index e0066c03e7f1..43b381a087f4 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -2148,10 +2148,12 @@ void intel_edp_psr_enable(struct intel_dp *intel_dp) | |||
2148 | mutex_lock(&dev_priv->psr.lock); | 2148 | mutex_lock(&dev_priv->psr.lock); |
2149 | if (dev_priv->psr.enabled) { | 2149 | if (dev_priv->psr.enabled) { |
2150 | DRM_DEBUG_KMS("PSR already in use\n"); | 2150 | DRM_DEBUG_KMS("PSR already in use\n"); |
2151 | mutex_unlock(&dev_priv->psr.lock); | 2151 | goto unlock; |
2152 | return; | ||
2153 | } | 2152 | } |
2154 | 2153 | ||
2154 | if (!intel_edp_psr_match_conditions(intel_dp)) | ||
2155 | goto unlock; | ||
2156 | |||
2155 | dev_priv->psr.busy_frontbuffer_bits = 0; | 2157 | dev_priv->psr.busy_frontbuffer_bits = 0; |
2156 | 2158 | ||
2157 | intel_edp_psr_setup_vsc(intel_dp); | 2159 | intel_edp_psr_setup_vsc(intel_dp); |
@@ -2160,8 +2162,8 @@ void intel_edp_psr_enable(struct intel_dp *intel_dp) | |||
2160 | I915_WRITE(EDP_PSR_DEBUG_CTL(dev), EDP_PSR_DEBUG_MASK_MEMUP | | 2162 | I915_WRITE(EDP_PSR_DEBUG_CTL(dev), EDP_PSR_DEBUG_MASK_MEMUP | |
2161 | EDP_PSR_DEBUG_MASK_HPD | EDP_PSR_DEBUG_MASK_LPSP); | 2163 | EDP_PSR_DEBUG_MASK_HPD | EDP_PSR_DEBUG_MASK_LPSP); |
2162 | 2164 | ||
2163 | if (intel_edp_psr_match_conditions(intel_dp)) | 2165 | dev_priv->psr.enabled = intel_dp; |
2164 | dev_priv->psr.enabled = intel_dp; | 2166 | unlock: |
2165 | mutex_unlock(&dev_priv->psr.lock); | 2167 | mutex_unlock(&dev_priv->psr.lock); |
2166 | } | 2168 | } |
2167 | 2169 | ||