Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: Arun R Murthy <arun.r.murthy@intel.com>
Cc: <dri-devel@lists.freedesktop.org>,
	<intel-gfx@lists.freedesktop.org>,
	<intel-xe@lists.freedesktop.org>, <vinod.govindapillai@intel.com>
Subject: Re: [PATCH 1/3] drm/drm_dp_helper: export link symbol cycles calculation
Date: Tue, 8 Apr 2025 17:15:16 +0300	[thread overview]
Message-ID: <Z_UvdB05S0sPbs6l@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <20250408-hblank-v1-1-4ba17aebee65@intel.com>

On Tue, Apr 08, 2025 at 09:40:34AM +0530, Arun R Murthy wrote:
> Link symbol cycles are required for the calculation of the minimum
> HBlank calculation.
> 
> Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
> ---
>  drivers/gpu/drm/display/drm_dp_helper.c | 10 ++++++----
>  include/drm/display/drm_dp_helper.h     |  5 +++++
>  2 files changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c
> index 57828f2b7b5a0582ca4a6f2a9be2d5909fe8ad24..488aaef61e3aa8b25975dfc98cbccdf5b7f083f8 100644
> --- a/drivers/gpu/drm/display/drm_dp_helper.c
> +++ b/drivers/gpu/drm/display/drm_dp_helper.c
> @@ -4393,17 +4393,18 @@ EXPORT_SYMBOL(drm_panel_dp_aux_backlight);
>  #endif
>  
>  /* See DP Standard v2.1 2.6.4.4.1.1, 2.8.4.4, 2.8.7 */
> -static int drm_dp_link_symbol_cycles(int lane_count, int pixels, int bpp_x16,
> -				     int symbol_size, bool is_mst)
> +int drm_dp_link_symbol_cycles(int lane_count, int pixels, int bpp_x16,
> +			      int symbol_size, bool is_mst)
>  {
>  	int cycles = DIV_ROUND_UP(pixels * bpp_x16, 16 * symbol_size * lane_count);
>  	int align = is_mst ? 4 / lane_count : 1;
>  
>  	return ALIGN(cycles, align);
>  }
> +EXPORT_SYMBOL(drm_dp_link_symbol_cycles);
>  
> -static int drm_dp_link_dsc_symbol_cycles(int lane_count, int pixels, int slice_count,
> -					 int bpp_x16, int symbol_size, bool is_mst)
> +int drm_dp_link_dsc_symbol_cycles(int lane_count, int pixels, int slice_count,
> +				  int bpp_x16, int symbol_size, bool is_mst)
>  {
>  	int slice_pixels = DIV_ROUND_UP(pixels, slice_count);
>  	int slice_data_cycles = drm_dp_link_symbol_cycles(lane_count, slice_pixels,

Could you simplify this i/f by calculating the DSC/non-DSC specific
symbol count based on whether the passed in dsc_slice_count is non-zero
or zero respectively (renaming this function to drm_dp_link_symbol_cycles() and the
original drm_dp_link_symbol_cycles() to stg else)?

That way you'd need to export only one function and drm_dp_bw_overhead()
would also get simplified.

> @@ -4412,6 +4413,7 @@ static int drm_dp_link_dsc_symbol_cycles(int lane_count, int pixels, int slice_c
>  
>  	return slice_count * (slice_data_cycles + slice_eoc_cycles);
>  }
> +EXPORT_SYMBOL(drm_dp_link_dsc_symbol_cycles);
>  
>  /**
>   * drm_dp_bw_overhead - Calculate the BW overhead of a DP link stream
> diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h
> index d9614e2c89397536f44bb7258e894628ae1dccc9..f6bfa3b74810438b837540dccb08a987bcdb5d03 100644
> --- a/include/drm/display/drm_dp_helper.h
> +++ b/include/drm/display/drm_dp_helper.h
> @@ -972,4 +972,9 @@ int drm_dp_max_dprx_data_rate(int max_link_rate, int max_lanes);
>  
>  ssize_t drm_dp_vsc_sdp_pack(const struct drm_dp_vsc_sdp *vsc, struct dp_sdp *sdp);
>  
> +int drm_dp_link_symbol_cycles(int lane_count, int pixels, int bpp_x16,
> +			      int symbol_size, bool is_mst);
> +int drm_dp_link_dsc_symbol_cycles(int lane_count, int pixels, int slice_count,
> +				  int bpp_x16, int symbol_size, bool is_mst);
> +
>  #endif /* _DRM_DP_HELPER_H_ */
> 
> -- 
> 2.25.1
> 

  reply	other threads:[~2025-04-08 14:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08  4:10 [PATCH 0/3] Rework/Correction on minimum hblank calculation Arun R Murthy
2025-04-08  4:10 ` [PATCH 1/3] drm/drm_dp_helper: export link symbol cycles calculation Arun R Murthy
2025-04-08 14:15   ` Imre Deak [this message]
2025-04-08  4:10 ` [PATCH 2/3] drm/i915/display: export function to count dsc slices Arun R Murthy
2025-04-08  4:10 ` [PATCH 3/3] drm/i915/audio: move min_hblank from dp_mst to audio Arun R Murthy
2025-04-08 14:59   ` Imre Deak
2025-04-08  4:31 ` ✗ CI.Patch_applied: failure for Rework/Correction on minimum hblank calculation Patchwork
2025-04-08 13:57 ` [PATCH 0/3] " Imre Deak

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=Z_UvdB05S0sPbs6l@ideak-desk.fi.intel.com \
    --to=imre.deak@intel.com \
    --cc=arun.r.murthy@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=vinod.govindapillai@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