Commit 4371d896 authored by Dhinakaran Pandiyan's avatar Dhinakaran Pandiyan Committed by Rodrigo Vivi

drm/i915/psr: CAN_PSR() macro to check for PSR source and sink support.

The global variable dev_priv->psr.sink_support is set if an eDP sink
supports PSR. Use this instead of redoing the check with is_edp_psr().
Combine source and sink support checks into a macro that can be used to
return early from psr_{invalidate, single_frame_update, flush}.

Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180103213824.1405-2-dhinakaran.pandiyan@intel.com
parent 457f1e5f
...@@ -1760,6 +1760,7 @@ static inline void intel_backlight_device_unregister(struct intel_connector *con ...@@ -1760,6 +1760,7 @@ static inline void intel_backlight_device_unregister(struct intel_connector *con
/* intel_psr.c */ /* intel_psr.c */
#define CAN_PSR(dev_priv) (HAS_PSR(dev_priv) && dev_priv->psr.sink_support)
void intel_psr_enable(struct intel_dp *intel_dp, void intel_psr_enable(struct intel_dp *intel_dp,
const struct intel_crtc_state *crtc_state); const struct intel_crtc_state *crtc_state);
void intel_psr_disable(struct intel_dp *intel_dp, void intel_psr_disable(struct intel_dp *intel_dp,
......
...@@ -56,14 +56,6 @@ ...@@ -56,14 +56,6 @@
#include "intel_drv.h" #include "intel_drv.h"
#include "i915_drv.h" #include "i915_drv.h"
static bool is_edp_psr(struct intel_dp *intel_dp)
{
if (!intel_dp_is_edp(intel_dp))
return false;
return intel_dp->psr_dpcd[0] & DP_PSR_IS_SUPPORTED;
}
static bool vlv_is_psr_active_on_pipe(struct drm_device *dev, int pipe) static bool vlv_is_psr_active_on_pipe(struct drm_device *dev, int pipe)
{ {
struct drm_i915_private *dev_priv = to_i915(dev); struct drm_i915_private *dev_priv = to_i915(dev);
...@@ -358,10 +350,7 @@ void intel_psr_compute_config(struct intel_dp *intel_dp, ...@@ -358,10 +350,7 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,
&crtc_state->base.adjusted_mode; &crtc_state->base.adjusted_mode;
int psr_setup_time; int psr_setup_time;
if (!HAS_PSR(dev_priv)) if (!CAN_PSR(dev_priv))
return;
if (!is_edp_psr(intel_dp))
return; return;
if (!i915_modparams.enable_psr) { if (!i915_modparams.enable_psr) {
...@@ -794,7 +783,7 @@ void intel_psr_single_frame_update(struct drm_i915_private *dev_priv, ...@@ -794,7 +783,7 @@ void intel_psr_single_frame_update(struct drm_i915_private *dev_priv,
enum pipe pipe; enum pipe pipe;
u32 val; u32 val;
if (!HAS_PSR(dev_priv)) if (!CAN_PSR(dev_priv))
return; return;
/* /*
...@@ -843,7 +832,7 @@ void intel_psr_invalidate(struct drm_i915_private *dev_priv, ...@@ -843,7 +832,7 @@ void intel_psr_invalidate(struct drm_i915_private *dev_priv,
struct drm_crtc *crtc; struct drm_crtc *crtc;
enum pipe pipe; enum pipe pipe;
if (!HAS_PSR(dev_priv)) if (!CAN_PSR(dev_priv))
return; return;
mutex_lock(&dev_priv->psr.lock); mutex_lock(&dev_priv->psr.lock);
...@@ -883,7 +872,7 @@ void intel_psr_flush(struct drm_i915_private *dev_priv, ...@@ -883,7 +872,7 @@ void intel_psr_flush(struct drm_i915_private *dev_priv,
struct drm_crtc *crtc; struct drm_crtc *crtc;
enum pipe pipe; enum pipe pipe;
if (!HAS_PSR(dev_priv)) if (!CAN_PSR(dev_priv))
return; return;
mutex_lock(&dev_priv->psr.lock); mutex_lock(&dev_priv->psr.lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment