All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kulkarni, Vandita" <vandita.kulkarni@intel.com>
To: "Nikula, Jani" <jani.nikula@intel.com>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Cc: "Nikula, Jani" <jani.nikula@intel.com>
Subject: Re: [Intel-gfx] [PATCH v3 10/13] drm/i915/dsi: take compression into account in afe_clk()
Date: Thu, 5 Dec 2019 14:36:37 +0000	[thread overview]
Message-ID: <57510F3E2013164E925CD03ED7512A3B809DA518@BGSMSX108.gar.corp.intel.com> (raw)
In-Reply-To: <665dbd42cb61301ad9e758ddacad6d07c54c5986.1574775655.git.jani.nikula@intel.com>

> -----Original Message-----
> From: Jani Nikula <jani.nikula@intel.com>
> Sent: Tuesday, November 26, 2019 7:13 PM
> To: intel-gfx@lists.freedesktop.org
> Cc: Nikula, Jani <jani.nikula@intel.com>; Kulkarni, Vandita
> <vandita.kulkarni@intel.com>; Ville Syrjälä <ville.syrjala@linux.intel.com>
> Subject: [PATCH v3 10/13] drm/i915/dsi: take compression into account in
> afe_clk()
> 
> Pass crtc_state to afe_clk() to be able to take compression into account in
> the computation. Once we enable compression, that is.
> 
> Cc: Vandita Kulkarni <vandita.kulkarni@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Looks good to me.
Reviewed-by: Vandita Kulkarni <vandita.kulkarni@intel.com>

Regards,
Vandita
> ---
>  drivers/gpu/drm/i915/display/icl_dsi.c | 40 +++++++++++++++-----------
>  1 file changed, 24 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/icl_dsi.c
> b/drivers/gpu/drm/i915/display/icl_dsi.c
> index d576f29cef75..5149a28a874b 100644
> --- a/drivers/gpu/drm/i915/display/icl_dsi.c
> +++ b/drivers/gpu/drm/i915/display/icl_dsi.c
> @@ -302,17 +302,22 @@ static void configure_dual_link_mode(struct
> intel_encoder *encoder,  }
> 
>  /* aka DSI 8X clock */
> -static int afe_clk(struct intel_encoder *encoder)
> +static int afe_clk(struct intel_encoder *encoder,
> +		   const struct intel_crtc_state *crtc_state)
>  {
>  	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
>  	int bpp;
> 
> -	bpp = mipi_dsi_pixel_format_to_bpp(intel_dsi->pixel_format);
> +	if (crtc_state->dsc.compression_enable)
> +		bpp = crtc_state->dsc.compressed_bpp;
> +	else
> +		bpp = mipi_dsi_pixel_format_to_bpp(intel_dsi-
> >pixel_format);
> 
>  	return DIV_ROUND_CLOSEST(intel_dsi->pclk * bpp, intel_dsi-
> >lane_count);  }
> 
> -static void gen11_dsi_program_esc_clk_div(struct intel_encoder *encoder)
> +static void gen11_dsi_program_esc_clk_div(struct intel_encoder *encoder,
> +					  const struct intel_crtc_state
> *crtc_state)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); @@ -
> 320,7 +325,7 @@ static void gen11_dsi_program_esc_clk_div(struct
> intel_encoder *encoder)
>  	int afe_clk_khz;
>  	u32 esc_clk_div_m;
> 
> -	afe_clk_khz = afe_clk(encoder);
> +	afe_clk_khz = afe_clk(encoder, crtc_state);
>  	esc_clk_div_m = DIV_ROUND_UP(afe_clk_khz, DSI_MAX_ESC_CLK);
> 
>  	for_each_dsi_port(port, intel_dsi->ports) { @@ -498,7 +503,9 @@
> static void gen11_dsi_enable_ddi_buffer(struct intel_encoder *encoder)
>  	}
>  }
> 
> -static void gen11_dsi_setup_dphy_timings(struct intel_encoder *encoder)
> +static void
> +gen11_dsi_setup_dphy_timings(struct intel_encoder *encoder,
> +			     const struct intel_crtc_state *crtc_state)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); @@ -
> 539,7 +546,7 @@ static void gen11_dsi_setup_dphy_timings(struct
> intel_encoder *encoder)
>  	 * leave all fields at HW default values.
>  	 */
>  	if (IS_GEN(dev_priv, 11)) {
> -		if (afe_clk(encoder) <= 800000) {
> +		if (afe_clk(encoder, crtc_state) <= 800000) {
>  			for_each_dsi_port(port, intel_dsi->ports) {
>  				tmp =
> I915_READ(DPHY_TA_TIMING_PARAM(port));
>  				tmp &= ~TA_SURE_MASK;
> @@ -649,7 +656,7 @@ gen11_dsi_configure_transcoder(struct intel_encoder
> *encoder,
>  			tmp |= EOTP_DISABLED;
> 
>  		/* enable link calibration if freq > 1.5Gbps */
> -		if (afe_clk(encoder) >= 1500 * 1000) {
> +		if (afe_clk(encoder, pipe_config) >= 1500 * 1000) {
>  			tmp &= ~LINK_CALIBRATION_MASK;
>  			tmp |= CALIBRATION_ENABLED_INITIAL_ONLY;
>  		}
> @@ -915,7 +922,8 @@ static void gen11_dsi_enable_transcoder(struct
> intel_encoder *encoder)
>  	}
>  }
> 
> -static void gen11_dsi_setup_timeouts(struct intel_encoder *encoder)
> +static void gen11_dsi_setup_timeouts(struct intel_encoder *encoder,
> +				     const struct intel_crtc_state *crtc_state)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); @@ -
> 930,7 +938,7 @@ static void gen11_dsi_setup_timeouts(struct intel_encoder
> *encoder)
>  	 * TIME_NS = (BYTE_CLK_COUNT * 8 * 10^6)/ Bitrate
>  	 * ESCAPE_CLK_COUNT  = TIME_NS/ESC_CLK_NS
>  	 */
> -	divisor = intel_dsi_tlpx_ns(intel_dsi) * afe_clk(encoder) * 1000;
> +	divisor = intel_dsi_tlpx_ns(intel_dsi) * afe_clk(encoder, crtc_state)
> +* 1000;
>  	mul = 8 * 1000000;
>  	hs_tx_timeout = DIV_ROUND_UP(intel_dsi->hs_tx_timeout * mul,
>  				     divisor);
> @@ -966,7 +974,7 @@ static void gen11_dsi_setup_timeouts(struct
> intel_encoder *encoder)
> 
>  static void
>  gen11_dsi_enable_port_and_phy(struct intel_encoder *encoder,
> -			      const struct intel_crtc_state *pipe_config)
> +			      const struct intel_crtc_state *crtc_state)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> 
> @@ -983,13 +991,13 @@ gen11_dsi_enable_port_and_phy(struct
> intel_encoder *encoder,
>  	gen11_dsi_enable_ddi_buffer(encoder);
> 
>  	/* setup D-PHY timings */
> -	gen11_dsi_setup_dphy_timings(encoder);
> +	gen11_dsi_setup_dphy_timings(encoder, crtc_state);
> 
>  	/* step 4h: setup DSI protocol timeouts */
> -	gen11_dsi_setup_timeouts(encoder);
> +	gen11_dsi_setup_timeouts(encoder, crtc_state);
> 
>  	/* Step (4h, 4i, 4j, 4k): Configure transcoder */
> -	gen11_dsi_configure_transcoder(encoder, pipe_config);
> +	gen11_dsi_configure_transcoder(encoder, crtc_state);
> 
>  	/* Step 4l: Gate DDI clocks */
>  	if (IS_GEN(dev_priv, 11))
> @@ -1036,14 +1044,14 @@ static void gen11_dsi_powerup_panel(struct
> intel_encoder *encoder)  }
> 
>  static void gen11_dsi_pre_pll_enable(struct intel_encoder *encoder,
> -				     const struct intel_crtc_state *pipe_config,
> +				     const struct intel_crtc_state *crtc_state,
>  				     const struct drm_connector_state
> *conn_state)  {
>  	/* step2: enable IO power */
>  	gen11_dsi_enable_io_power(encoder);
> 
>  	/* step3: enable DSI PLL */
> -	gen11_dsi_program_esc_clk_div(encoder);
> +	gen11_dsi_program_esc_clk_div(encoder, crtc_state);
>  }
> 
>  static void gen11_dsi_pre_enable(struct intel_encoder *encoder, @@ -
> 1300,7 +1308,7 @@ static int gen11_dsi_compute_config(struct
> intel_encoder *encoder,
>  		pipe_config->pipe_bpp = 18;
> 
>  	pipe_config->clock_set = true;
> -	pipe_config->port_clock = afe_clk(encoder) / 5;
> +	pipe_config->port_clock = afe_clk(encoder, pipe_config) / 5;
> 
>  	return 0;
>  }
> --
> 2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-12-05 14:36 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26 13:42 [PATCH v3 00/13] drm/i915/dsi: enable DSC Jani Nikula
2019-11-26 13:42 ` [Intel-gfx] " Jani Nikula
2019-11-26 13:42 ` [PATCH v3 01/13] drm/i915/bios: pass devdata to parse_ddi_port Jani Nikula
2019-11-26 13:42   ` [Intel-gfx] " Jani Nikula
2019-12-04  7:52   ` Kulkarni, Vandita
2019-11-26 13:42 ` [PATCH v3 02/13] drm/i915/bios: parse compression parameters block Jani Nikula
2019-11-26 13:42   ` [Intel-gfx] " Jani Nikula
2019-12-04  8:07   ` Kulkarni, Vandita
2019-11-26 13:42 ` [PATCH v3 03/13] drm/i915/bios: add support for querying DSC details for encoder Jani Nikula
2019-11-26 13:42   ` [Intel-gfx] " Jani Nikula
2019-12-05  4:42   ` Kulkarni, Vandita
2019-11-26 13:42 ` [PATCH v3 04/13] drm/i915/dsc: move DP specific compute params to intel_dp.c Jani Nikula
2019-11-26 13:42   ` [Intel-gfx] " Jani Nikula
2019-12-05  5:07   ` Kulkarni, Vandita
2019-11-26 13:42 ` [PATCH v3 05/13] drm/i915/dsc: move slice height calculation to encoder Jani Nikula
2019-11-26 13:42   ` [Intel-gfx] " Jani Nikula
2019-12-05  5:28   ` Kulkarni, Vandita
2019-11-26 13:42 ` [PATCH v3 06/13] drm/i915/dsc: add support for computing and writing PPS for DSI encoders Jani Nikula
2019-11-26 13:42   ` [Intel-gfx] " Jani Nikula
2019-12-05  5:44   ` Kulkarni, Vandita
2019-12-09 15:43     ` Jani Nikula
2019-11-26 13:42 ` [PATCH v3 07/13] drm/i915/dsi: set pipe_bpp on ICL configure config Jani Nikula
2019-11-26 13:42   ` [Intel-gfx] " Jani Nikula
2019-12-05 10:15   ` Kulkarni, Vandita
2019-12-09 15:46     ` Jani Nikula
2019-11-26 13:42 ` [PATCH v3 08/13] drm/i915/dsi: abstract afe_clk calculation Jani Nikula
2019-11-26 13:42   ` [Intel-gfx] " Jani Nikula
2019-12-05  8:25   ` Kulkarni, Vandita
2019-11-26 13:42 ` [PATCH v3 09/13] drm/i915/dsi: use afe_clk() instead of intel_dsi_bitrate() Jani Nikula
2019-11-26 13:42   ` [Intel-gfx] " Jani Nikula
2019-12-05 13:06   ` Kulkarni, Vandita
2019-11-26 13:42 ` [PATCH v3 10/13] drm/i915/dsi: take compression into account in afe_clk() Jani Nikula
2019-11-26 13:42   ` [Intel-gfx] " Jani Nikula
2019-12-05 14:36   ` Kulkarni, Vandita [this message]
2019-11-26 13:42 ` [PATCH v3 11/13] drm/i915/dsi: use compressed pixel format with DSC Jani Nikula
2019-11-26 13:42   ` [Intel-gfx] " Jani Nikula
2019-12-05 14:44   ` Kulkarni, Vandita
2019-11-26 13:42 ` [PATCH v3 12/13] drm/i915/dsi: account for DSC in horizontal timings Jani Nikula
2019-11-26 13:42   ` [Intel-gfx] " Jani Nikula
2019-12-05 14:52   ` Kulkarni, Vandita
2019-11-26 13:42 ` [PATCH v3 13/13] drm/i915/dsi: add support for DSC Jani Nikula
2019-11-26 13:42   ` [Intel-gfx] " Jani Nikula
2019-12-05  6:14   ` Kulkarni, Vandita
2019-12-09 16:02     ` Jani Nikula
2019-11-26 18:22 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dsi: enable DSC (rev3) Patchwork
2019-11-26 18:22   ` [Intel-gfx] " Patchwork
2019-11-26 18:52 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-11-26 18:52   ` [Intel-gfx] " Patchwork
2019-11-27 14:07 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dsi: enable DSC (rev4) Patchwork
2019-11-27 14:07   ` [Intel-gfx] " Patchwork
2019-11-27 14:30 ` ✓ Fi.CI.BAT: success " Patchwork
2019-11-27 14:30   ` [Intel-gfx] " Patchwork
2019-11-28 14:21 ` ✗ Fi.CI.IGT: failure " Patchwork
2019-11-28 14:21   ` [Intel-gfx] " Patchwork
2019-12-05 15:24 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dsi: enable DSC (rev5) Patchwork
2019-12-05 16:20 ` [Intel-gfx] ✗ Fi.CI.BAT: 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=57510F3E2013164E925CD03ED7512A3B809DA518@BGSMSX108.gar.corp.intel.com \
    --to=vandita.kulkarni@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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.