dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 2/8] drm/i915/psr: CAN_PSR() macro to check for PSR source and sink support.
Date: Tue, 19 Dec 2017 13:23:46 -0800	[thread overview]
Message-ID: <20171219212346.q2keu32iyicodzzu@intel.com> (raw)
In-Reply-To: <20171219052659.2355-3-dhinakaran.pandiyan@intel.com>

On Tue, Dec 19, 2017 at 05:26:53AM +0000, Dhinakaran Pandiyan wrote:
> 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: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_drv.h |  1 +
>  drivers/gpu/drm/i915/intel_psr.c | 19 ++++---------------
>  2 files changed, 5 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 30f791f89d64..48676e99316e 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1760,6 +1760,7 @@ static inline void intel_backlight_device_unregister(struct intel_connector *con
>  
>  
>  /* intel_psr.c */
> +#define CAN_PSR(dev_priv) (HAS_PSR(dev_priv) && dev_priv->psr.sink_support)

not sure about the "CAN"... but I don't have better suggestion and I believe
it is somehow clear enough...

>  void intel_psr_enable(struct intel_dp *intel_dp,
>  		      const struct intel_crtc_state *crtc_state);
>  void intel_psr_disable(struct intel_dp *intel_dp,
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index c4d75e82a1df..76339cf387cb 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -56,14 +56,6 @@
>  #include "intel_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;
> -}

I wonder why we haven't done this before in favor of sink_support///
my bad... 

> -
>  static bool vlv_is_psr_active_on_pipe(struct drm_device *dev, int pipe)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(dev);
> @@ -358,10 +350,7 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,
>  		&crtc_state->base.adjusted_mode;
>  	int psr_setup_time;
>  
> -	if (!HAS_PSR(dev_priv))
> -		return;
> -
> -	if (!is_edp_psr(intel_dp))
> +	if (!CAN_PSR(dev_priv))
>  		return;
>  
>  	if (!i915_modparams.enable_psr) {
> @@ -794,7 +783,7 @@ void intel_psr_single_frame_update(struct drm_i915_private *dev_priv,
>  	enum pipe pipe;
>  	u32 val;
>  
> -	if (!HAS_PSR(dev_priv))
> +	if (!CAN_PSR(dev_priv))
>  		return;
>  
>  	/*
> @@ -843,7 +832,7 @@ void intel_psr_invalidate(struct drm_i915_private *dev_priv,
>  	struct drm_crtc *crtc;
>  	enum pipe pipe;
>  
> -	if (!HAS_PSR(dev_priv))
> +	if (!CAN_PSR(dev_priv))
>  		return;
>  
>  	mutex_lock(&dev_priv->psr.lock);
> @@ -883,7 +872,7 @@ void intel_psr_flush(struct drm_i915_private *dev_priv,
>  	struct drm_crtc *crtc;
>  	enum pipe pipe;
>  
> -	if (!HAS_PSR(dev_priv))
> +	if (!CAN_PSR(dev_priv))
>  		return;

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

>  
>  	mutex_lock(&dev_priv->psr.lock);
> -- 
> 2.11.0
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-12-19 21:23 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19  5:26 [PATCH v2 0/8] Fix PSR-vblank-DMC interaction Dhinakaran Pandiyan
2017-12-19  5:26 ` [PATCH v2 1/8] drm/i915/psr: Kill psr.source_ok flag Dhinakaran Pandiyan
2017-12-19 21:16   ` Rodrigo Vivi
2017-12-19  5:26 ` [PATCH v2 2/8] drm/i915/psr: CAN_PSR() macro to check for PSR source and sink support Dhinakaran Pandiyan
2017-12-19 21:23   ` Rodrigo Vivi [this message]
2017-12-19  5:26 ` [PATCH v2 3/8] drm/i915/psr: Avoid initializing PSR if there is no " Dhinakaran Pandiyan
2017-12-19 21:29   ` Rodrigo Vivi
2017-12-19 21:40     ` Pandiyan, Dhinakaran
2018-01-03 21:59       ` Rodrigo Vivi
2017-12-19  5:26 ` [PATCH v2 4/8] drm/vblank: Do not update vblank counts if vblanks are already disabled Dhinakaran Pandiyan
2017-12-19  5:26 ` [PATCH v2 5/8] drm/vblank: Restoring vblank counts after device runtime PM events Dhinakaran Pandiyan
2017-12-19  5:26 ` [PATCH v2 6/8] drm/i915: Use an atomic_t array to track power domain use count Dhinakaran Pandiyan
2017-12-21 12:37   ` Maarten Lankhorst
2017-12-22  6:13     ` Pandiyan, Dhinakaran
2017-12-19  5:26 ` [PATCH v2 7/8] drm/i915: Introduce a non-blocking power domain for vblank interrupts Dhinakaran Pandiyan
2017-12-19 21:41   ` Rodrigo Vivi
2017-12-19 23:20     ` Pandiyan, Dhinakaran
2017-12-19  5:26 ` [PATCH v2 8/8] drm/i915: Use the vblank power domain disallow or disable DC states Dhinakaran Pandiyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171219212346.q2keu32iyicodzzu@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox