public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 10/11] drm/i915/cdclk: Relocate intel_vdsc_min_cdclk()
Date: Wed, 30 Oct 2024 13:40:27 +0200	[thread overview]
Message-ID: <874j4tn7is.fsf@intel.com> (raw)
In-Reply-To: <20241029215217.3697-11-ville.syrjala@linux.intel.com>

On Tue, 29 Oct 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Move intel_vdsc_min_cdclk() into intel_vdsc.c from intel_cdclk.c
> so that details about DSC are better contained.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_cdclk.c | 46 ----------------------
>  drivers/gpu/drm/i915/display/intel_vdsc.c  | 46 ++++++++++++++++++++++
>  drivers/gpu/drm/i915/display/intel_vdsc.h  |  1 +
>  3 files changed, 47 insertions(+), 46 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_cdclk.c b/drivers/gpu/drm/i915/display/intel_cdclk.c
> index d376f7bccf21..9f38dd14b2d8 100644
> --- a/drivers/gpu/drm/i915/display/intel_cdclk.c
> +++ b/drivers/gpu/drm/i915/display/intel_cdclk.c
> @@ -37,7 +37,6 @@
>  #include "intel_cdclk.h"
>  #include "intel_crtc.h"
>  #include "intel_de.h"
> -#include "intel_dp.h"
>  #include "intel_display_types.h"
>  #include "intel_mchbar_regs.h"
>  #include "intel_pci_config.h"
> @@ -2805,51 +2804,6 @@ static int intel_planes_min_cdclk(const struct intel_crtc_state *crtc_state)
>  	return min_cdclk;
>  }
>  
> -static int intel_vdsc_min_cdclk(const struct intel_crtc_state *crtc_state)
> -{
> -	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> -	struct intel_display *display = to_intel_display(crtc);
> -	int num_vdsc_instances = intel_dsc_get_num_vdsc_instances(crtc_state);
> -	int min_cdclk;
> -
> -	if (!crtc_state->dsc.compression_enable)
> -		return 0;
> -
> -	/*
> -	 * When we decide to use only one VDSC engine, since
> -	 * each VDSC operates with 1 ppc throughput, pixel clock
> -	 * cannot be higher than the VDSC clock (cdclk)
> -	 * If there 2 VDSC engines, then pixel clock can't be higher than
> -	 * VDSC clock(cdclk) * 2 and so on.
> -	 */
> -	min_cdclk = DIV_ROUND_UP(crtc_state->pixel_rate, num_vdsc_instances);
> -
> -	if (crtc_state->joiner_pipes) {
> -		int pixel_clock = intel_dp_mode_to_fec_clock(crtc_state->hw.adjusted_mode.clock);
> -
> -		/*
> -		 * According to Bigjoiner bw check:
> -		 * compressed_bpp <= PPC * CDCLK * Big joiner Interface bits / Pixel clock
> -		 *
> -		 * We have already computed compressed_bpp, so now compute the min CDCLK that
> -		 * is required to support this compressed_bpp.
> -		 *
> -		 * => CDCLK >= compressed_bpp * Pixel clock / (PPC * Bigjoiner Interface bits)
> -		 *
> -		 * Since PPC = 2 with bigjoiner
> -		 * => CDCLK >= compressed_bpp * Pixel clock  / 2 * Bigjoiner Interface bits
> -		 */
> -		int bigjoiner_interface_bits = DISPLAY_VER(display) >= 14 ? 36 : 24;
> -		int min_cdclk_bj =
> -			(fxp_q4_to_int_roundup(crtc_state->dsc.compressed_bpp_x16) *
> -			 pixel_clock) / (2 * bigjoiner_interface_bits);
> -
> -		min_cdclk = max(min_cdclk, min_cdclk_bj);
> -	}
> -
> -	return min_cdclk;
> -}
> -
>  int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state)
>  {
>  	int min_cdclk;
> diff --git a/drivers/gpu/drm/i915/display/intel_vdsc.c b/drivers/gpu/drm/i915/display/intel_vdsc.c
> index 40525f5c4c42..e6cb712373a9 100644
> --- a/drivers/gpu/drm/i915/display/intel_vdsc.c
> +++ b/drivers/gpu/drm/i915/display/intel_vdsc.c
> @@ -14,6 +14,7 @@
>  #include "intel_crtc.h"
>  #include "intel_de.h"
>  #include "intel_display_types.h"
> +#include "intel_dp.h"
>  #include "intel_dsi.h"
>  #include "intel_qp_tables.h"
>  #include "intel_vdsc.h"
> @@ -1003,3 +1004,48 @@ void intel_vdsc_state_dump(struct drm_printer *p, int indent,
>  	intel_vdsc_dump_state(p, indent, crtc_state);
>  	drm_dsc_dump_config(p, indent, &crtc_state->dsc.config);
>  }
> +
> +int intel_vdsc_min_cdclk(const struct intel_crtc_state *crtc_state)
> +{
> +	struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
> +	struct intel_display *display = to_intel_display(crtc);
> +	int num_vdsc_instances = intel_dsc_get_num_vdsc_instances(crtc_state);
> +	int min_cdclk;
> +
> +	if (!crtc_state->dsc.compression_enable)
> +		return 0;
> +
> +	/*
> +	 * When we decide to use only one VDSC engine, since
> +	 * each VDSC operates with 1 ppc throughput, pixel clock
> +	 * cannot be higher than the VDSC clock (cdclk)
> +	 * If there 2 VDSC engines, then pixel clock can't be higher than
> +	 * VDSC clock(cdclk) * 2 and so on.
> +	 */
> +	min_cdclk = DIV_ROUND_UP(crtc_state->pixel_rate, num_vdsc_instances);
> +
> +	if (crtc_state->joiner_pipes) {
> +		int pixel_clock = intel_dp_mode_to_fec_clock(crtc_state->hw.adjusted_mode.clock);
> +
> +		/*
> +		 * According to Bigjoiner bw check:
> +		 * compressed_bpp <= PPC * CDCLK * Big joiner Interface bits / Pixel clock
> +		 *
> +		 * We have already computed compressed_bpp, so now compute the min CDCLK that
> +		 * is required to support this compressed_bpp.
> +		 *
> +		 * => CDCLK >= compressed_bpp * Pixel clock / (PPC * Bigjoiner Interface bits)
> +		 *
> +		 * Since PPC = 2 with bigjoiner
> +		 * => CDCLK >= compressed_bpp * Pixel clock  / 2 * Bigjoiner Interface bits
> +		 */
> +		int bigjoiner_interface_bits = DISPLAY_VER(display) >= 14 ? 36 : 24;
> +		int min_cdclk_bj =
> +			(fxp_q4_to_int_roundup(crtc_state->dsc.compressed_bpp_x16) *
> +			 pixel_clock) / (2 * bigjoiner_interface_bits);
> +
> +		min_cdclk = max(min_cdclk, min_cdclk_bj);
> +	}
> +
> +	return min_cdclk;
> +}
> diff --git a/drivers/gpu/drm/i915/display/intel_vdsc.h b/drivers/gpu/drm/i915/display/intel_vdsc.h
> index 290b2e9b3482..9e2812f99dd7 100644
> --- a/drivers/gpu/drm/i915/display/intel_vdsc.h
> +++ b/drivers/gpu/drm/i915/display/intel_vdsc.h
> @@ -31,5 +31,6 @@ void intel_dsc_dp_pps_write(struct intel_encoder *encoder,
>  			    const struct intel_crtc_state *crtc_state);
>  void intel_vdsc_state_dump(struct drm_printer *p, int indent,
>  			   const struct intel_crtc_state *crtc_state);
> +int intel_vdsc_min_cdclk(const struct intel_crtc_state *crtc_state);
>  
>  #endif /* __INTEL_VDSC_H__ */

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-10-30 11:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-29 21:52 [PATCH 00/11] drm/i915/cdclk: Declutter CDCLK code Ville Syrjala
2024-10-29 21:52 ` [PATCH 01/11] drm/i915: Introduce HAS_DOUBLE_WIDE() Ville Syrjala
2024-10-30 11:23   ` Jani Nikula
2024-10-29 21:52 ` [PATCH 02/11] drm/i915/cdclk: Extract intel_cdclk_guardband() and intel_cdclk_ppc() Ville Syrjala
2024-10-30 11:23   ` Jani Nikula
2024-10-29 21:52 ` [PATCH 03/11] drm/i915/cdclk: Extract hsw_ips_min_cdclk() Ville Syrjala
2024-10-30 11:26   ` Jani Nikula
2024-10-29 21:52 ` [PATCH 04/11] drm/i915/cdclk: Extract intel_audio_min_cdclk() Ville Syrjala
2024-10-30 11:30   ` Jani Nikula
2024-10-29 21:52 ` [PATCH 05/11] drm/i915/cdclk: Factor out has_audio check in intel_audio_min_cdclk() Ville Syrjala
2024-10-30 11:30   ` Jani Nikula
2024-10-29 21:52 ` [PATCH 06/11] drm/i915/cdclk: Extract vlv_dsi_min_cdclk() Ville Syrjala
2024-10-30 11:34   ` Jani Nikula
2024-10-30 13:22     ` Ville Syrjälä
2024-10-30 17:55       ` Jani Nikula
2024-10-29 21:52 ` [PATCH 07/11] drm/i915/cdclk: Factor out INTEL_OUTPUT_DSI check in vlv_dsi_min_cdclk() Ville Syrjala
2024-10-30 11:35   ` Jani Nikula
2024-10-29 21:52 ` [PATCH 08/11] drm/i915/cdclk: Suck the compression_enable check into intel_vdsc_min_cdclk() Ville Syrjala
2024-10-30 11:37   ` Jani Nikula
2024-10-29 21:52 ` [PATCH 09/11] drm/i915/cdclk: Drop pointles max_t() usage in intel_vdsc_min_cdclk() Ville Syrjala
2024-10-30 11:39   ` Jani Nikula
2024-10-29 21:52 ` [PATCH 10/11] drm/i915/cdclk: Relocate intel_vdsc_min_cdclk() Ville Syrjala
2024-10-30 11:40   ` Jani Nikula [this message]
2024-10-29 21:52 ` [PATCH 11/11] drm/i915/cdclk: Unify cdclk max() parameter order Ville Syrjala
2024-10-30 11:41   ` Jani Nikula
2024-10-30  1:30 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/cdclk: Declutter CDCLK code Patchwork
2024-10-30  1:30 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-10-30  1:46 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-10-31 13:20 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/cdclk: Declutter CDCLK code (rev2) Patchwork
2024-10-31 13:20 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-10-31 14:16 ` ✓ Fi.CI.BAT: success " Patchwork
2024-10-31 21:02 ` ✗ 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=874j4tn7is.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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