public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Aditya Swarup <aditya.swarup@intel.com>, intel-gfx@lists.freedesktop.org
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Subject: Re: [PATCH] drm/i915/icl: Enable SSC for ICL using panel_use_ssc
Date: Thu, 06 Jun 2019 10:08:54 +0300	[thread overview]
Message-ID: <87d0jr2nsp.fsf@intel.com> (raw)
In-Reply-To: <20190605215733.10227-1-aditya.swarup@intel.com>

On Wed, 05 Jun 2019, Aditya Swarup <aditya.swarup@intel.com> wrote:
> To enable SSC for DPLL, we need to set the bit DPLL_CFGCR0_SSC_ENABLE_ICL
> while configuring cfgcr0 register. This bit should be set only when we
> are enabling SSC using kernel mod parameter panel_use_ssc.

Well, we should not be relying on the kernel parameter for any normal
operation. By default we rely on VBT.

> Also, moving intel_panel_use_ssc() declaration to intel_drv.h.

Please don't add new inline functions to intel_drv.h. We're trying to
clean up our headers.

One further comment inline.

> Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Cc: Clinton Taylor <Clinton.A.Taylor@intel.com>
> Cc: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c  | 8 --------
>  drivers/gpu/drm/i915/intel_dpll_mgr.c | 4 ++++
>  drivers/gpu/drm/i915/intel_drv.h      | 8 ++++++++
>  3 files changed, 12 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 012ad08f38c3..34c82a17ab1b 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -7377,14 +7377,6 @@ intel_link_compute_m_n(u16 bits_per_pixel, int nlanes,
>  		    constant_n);
>  }
>  
> -static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
> -{
> -	if (i915_modparams.panel_use_ssc >= 0)
> -		return i915_modparams.panel_use_ssc != 0;
> -	return dev_priv->vbt.lvds_use_ssc
> -		&& !(dev_priv->quirks & QUIRK_LVDS_SSC_DISABLE);
> -}
> -
>  static u32 pnv_dpll_compute_fp(struct dpll *dpll)
>  {
>  	return (1 << dpll->n) << 16 | dpll->m2;
> diff --git a/drivers/gpu/drm/i915/intel_dpll_mgr.c b/drivers/gpu/drm/i915/intel_dpll_mgr.c
> index 897d93537414..6c460fb81d6a 100644
> --- a/drivers/gpu/drm/i915/intel_dpll_mgr.c
> +++ b/drivers/gpu/drm/i915/intel_dpll_mgr.c
> @@ -2527,6 +2527,10 @@ static bool icl_calc_dpll_state(struct intel_crtc_state *crtc_state,
>  	cfgcr0 = DPLL_CFGCR0_DCO_FRACTION(pll_params.dco_fraction) |
>  		 pll_params.dco_integer;
>  
> +	if (intel_panel_use_ssc(dev_priv)) {
> +		cfgcr0 |= DPLL_CFGCR0_SSC_ENABLE_ICL;
> +	}
> +

The VBT field and the module parameter reference an internal panel. Why
should this be enabled for all outputs?

BR,
Jani.


>  	cfgcr1 = DPLL_CFGCR1_QDIV_RATIO(pll_params.qdiv_ratio) |
>  		 DPLL_CFGCR1_QDIV_MODE(pll_params.qdiv_mode) |
>  		 DPLL_CFGCR1_KDIV(pll_params.kdiv) |
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 270f5bb43d9b..e9af27e841b3 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1497,6 +1497,14 @@ intel_wait_for_vblank(struct drm_i915_private *dev_priv, enum pipe pipe)
>  {
>  	drm_wait_one_vblank(&dev_priv->drm, pipe);
>  }
> +static inline bool
> +intel_panel_use_ssc(struct drm_i915_private *dev_priv)
> +{
> +	if (i915_modparams.panel_use_ssc >= 0)
> +		return i915_modparams.panel_use_ssc != 0;
> +	return dev_priv->vbt.lvds_use_ssc
> +		&& !(dev_priv->quirks & QUIRK_LVDS_SSC_DISABLE);
> +}
>  static inline void
>  intel_wait_for_vblank_if_active(struct drm_i915_private *dev_priv, int pipe)
>  {

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

  parent reply	other threads:[~2019-06-06  7:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05 21:57 [PATCH] drm/i915/icl: Enable SSC for ICL using panel_use_ssc Aditya Swarup
2019-06-05 22:48 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-06-05 23:44 ` ✓ Fi.CI.BAT: success " Patchwork
2019-06-06  7:08 ` Jani Nikula [this message]
2019-06-07 21:53 ` ✗ Fi.CI.IGT: failure " 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=87d0jr2nsp.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=aditya.swarup@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox