All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: clinton.a.taylor@intel.com, Intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH V3] drn/i915/edp: Only use alternate fixed mode when requested
Date: Wed, 02 May 2018 10:22:16 +0300	[thread overview]
Message-ID: <87in86cyjb.fsf@intel.com> (raw)
In-Reply-To: <1525133500-30566-1-git-send-email-clinton.a.taylor@intel.com>

On Mon, 30 Apr 2018, clinton.a.taylor@intel.com wrote:
> From: Clint Taylor <clinton.a.taylor@intel.com>
>
> In commit dc911f5bd8aa ("drm/i915/edp: Allow alternate fixed mode for eDP
> if available."), the patch was always selecting the alternate refresh rate
> even though user space was asking for the higher rate. This patch confirms
> the alt mode setup time meets requirements and only uses the alt mode if
> psr is enable for the platform.

I'm confused.

If the panel supports two refresh rates, why would PSR have to be a
requirement for selecting one of them? If we now have bugs about only
being able to select one, won't we then get bugs about only being able
to select the other?

I don't think this should be tied to PSR.

BR,
Jani.

>
> V2: use clock instead of vrefresh for compare.
> V3: Confirm PSR is enabled and alt mode setup time is valid
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105469
>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Clint Taylor <clinton.a.taylor@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c  |  4 +++-
>  drivers/gpu/drm/i915/intel_drv.h |  2 ++
>  drivers/gpu/drm/i915/intel_psr.c | 35 +++++++++++++++++++++++------------
>  3 files changed, 28 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 83da50b..59b8a5c 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -1864,7 +1864,9 @@ static bool intel_edp_compare_alt_mode(struct drm_display_mode *m1,
>  			intel_connector->panel.alt_fixed_mode;
>  		struct drm_display_mode *req_mode = &pipe_config->base.mode;
>  
> -		if (!intel_edp_compare_alt_mode(req_mode, panel_mode))
> +		if ((!intel_edp_compare_alt_mode(req_mode, panel_mode) &&
> +		    intel_psr_setup_time_valid(intel_dp, req_mode)) ||
> +		    (!i915_modparams.enable_psr))
>  			panel_mode = intel_connector->panel.fixed_mode;
>  
>  		drm_mode_debug_printmodeline(panel_mode);
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 11a1932..e69ce10 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1908,6 +1908,8 @@ void intel_psr_flush(struct drm_i915_private *dev_priv,
>  void intel_psr_init(struct drm_i915_private *dev_priv);
>  void intel_psr_single_frame_update(struct drm_i915_private *dev_priv,
>  				   unsigned frontbuffer_bits);
> +bool intel_psr_setup_time_valid(struct intel_dp *intel_dp,
> +				    const struct drm_display_mode *mode);
>  void intel_psr_compute_config(struct intel_dp *intel_dp,
>  			      struct intel_crtc_state *crtc_state);
>  void intel_psr_irq_control(struct drm_i915_private *dev_priv, bool debug);
> diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c
> index 6233a32..9cc4109 100644
> --- a/drivers/gpu/drm/i915/intel_psr.c
> +++ b/drivers/gpu/drm/i915/intel_psr.c
> @@ -578,6 +578,27 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
>  	return true;
>  }
>  
> +bool intel_psr_setup_time_valid(struct intel_dp *intel_dp, const struct drm_display_mode *mode)
> +{
> +	int psr_setup_time = 0;
> +
> +	psr_setup_time = drm_dp_psr_setup_time(intel_dp->psr_dpcd);
> +	if (psr_setup_time < 0) {
> +		DRM_DEBUG_KMS("PSR condition failed: Invalid PSR setup time (0x%02x)\n",
> +			      intel_dp->psr_dpcd[1]);
> +		return false;
> +	}
> +
> +	if (intel_usecs_to_scanlines(mode, psr_setup_time) >
> +	    mode->crtc_vtotal - mode->crtc_vdisplay - 1) {
> +		DRM_DEBUG_KMS("PSR condition failed: PSR setup time (%d us) too long\n",
> +			      psr_setup_time);
> +		return false;
> +	}
> +
> +	return true;
> +}
> +
>  void intel_psr_compute_config(struct intel_dp *intel_dp,
>  			      struct intel_crtc_state *crtc_state)
>  {
> @@ -585,7 +606,6 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,
>  	struct drm_i915_private *dev_priv = to_i915(dig_port->base.base.dev);
>  	const struct drm_display_mode *adjusted_mode =
>  		&crtc_state->base.adjusted_mode;
> -	int psr_setup_time;
>  
>  	if (!CAN_PSR(dev_priv))
>  		return;
> @@ -626,17 +646,8 @@ void intel_psr_compute_config(struct intel_dp *intel_dp,
>  		return;
>  	}
>  
> -	psr_setup_time = drm_dp_psr_setup_time(intel_dp->psr_dpcd);
> -	if (psr_setup_time < 0) {
> -		DRM_DEBUG_KMS("PSR condition failed: Invalid PSR setup time (0x%02x)\n",
> -			      intel_dp->psr_dpcd[1]);
> -		return;
> -	}
> -
> -	if (intel_usecs_to_scanlines(adjusted_mode, psr_setup_time) >
> -	    adjusted_mode->crtc_vtotal - adjusted_mode->crtc_vdisplay - 1) {
> -		DRM_DEBUG_KMS("PSR condition failed: PSR setup time (%d us) too long\n",
> -			      psr_setup_time);
> +	if (!intel_psr_setup_time_valid(intel_dp, adjusted_mode)) {
> +		DRM_DEBUG_KMS("PSR Setup invalid\n");
>  		return;
>  	}

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-05-02  7:22 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-10 18:33 [PATCH] drm/i915/edp: Only use alternate fixed mode when requested clinton.a.taylor
2018-04-10 18:46 ` ✗ Fi.CI.BAT: warning for " Patchwork
2018-04-10 20:19 ` [PATCH] " Chris Wilson
2018-04-10 20:40 ` ✗ Fi.CI.IGT: warning for " Patchwork
2018-04-11 23:13 ` [PATCH] " clinton.a.taylor
2018-04-11 23:11   ` Chris Wilson
2018-04-12 21:31     ` Clint Taylor
2018-04-14 17:57       ` Vivi, Rodrigo
2018-04-30  7:49         ` Jani Nikula
2018-04-30 21:54           ` Clint Taylor
2018-04-12  0:04 ` ✓ Fi.CI.BAT: success for drm/i915/edp: Only use alternate fixed mode when requested (rev2) Patchwork
2018-04-12  3:55 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-05-01  0:09 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/edp: Only use alternate fixed mode when requested (rev3) Patchwork
2018-05-01  0:11 ` [PATCH V3] drn/i915/edp: Only use alternate fixed mode when requested clinton.a.taylor
2018-05-02  7:22   ` Jani Nikula [this message]
2018-05-02 13:56     ` Rodrigo Vivi
2018-05-01  0:28 ` ✓ Fi.CI.BAT: success for drm/i915/edp: Only use alternate fixed mode when requested (rev3) Patchwork
2018-05-01  2:52 ` ✓ Fi.CI.IGT: " Patchwork

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=87in86cyjb.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=clinton.a.taylor@intel.com \
    --cc=rodrigo.vivi@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.