From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 11/11] drm/i915/dp: Reuse intel_dp_{max, effective}_data_rate in intel_link_compute_m_n()
Date: Fri, 17 Nov 2023 19:11:42 +0200 [thread overview]
Message-ID: <ZVeezrlkQxzKh2Fs@intel.com> (raw)
In-Reply-To: <20231116131841.1588781-12-imre.deak@intel.com>
On Thu, Nov 16, 2023 at 03:18:41PM +0200, Imre Deak wrote:
> Reuse intel_dp_max_data_rate() and intel_dp_effective_data_rate() in
> intel_link_compute_m_n(), instead of open-coding the equivalent. Note
> the kbit/sec -> kByte/sec unit change in the M/N values, but this not
> reducing the precision, as the link rate value is based anyway on a less
> precise 10 kbit/sec value.
>
> Suggested-by: Jani Nikula <jani.nikula@linux.intel.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display.c | 25 +++-----------------
> 1 file changed, 3 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 744c321792fcf..199ecd8879461 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -2389,36 +2389,17 @@ static void compute_m_n(u32 *ret_m, u32 *ret_n,
> intel_reduce_m_n_ratio(ret_m, ret_n);
> }
>
> -static void
> -add_bw_alloc_overhead(int link_clock, int bw_overhead,
> - int pixel_data_rate, int link_data_rate,
> - u32 *data_m, u32 *data_n)
> -{
> - bool is_uhbr = drm_dp_is_uhbr_rate(link_clock);
> - int ch_coding_efficiency =
> - drm_dp_bw_channel_coding_efficiency(is_uhbr);
> -
> - *data_m = DIV_ROUND_UP_ULL(mul_u32_u32(pixel_data_rate, bw_overhead),
> - 1000000);
> - *data_n = DIV_ROUND_DOWN_ULL(mul_u32_u32(link_data_rate, ch_coding_efficiency),
> - 1000000);
> -}
> -
> void
> intel_link_compute_m_n(u16 bits_per_pixel_x16, int nlanes,
> int pixel_clock, int link_clock,
> int bw_overhead,
> struct intel_link_m_n *m_n)
> {
> - u32 data_clock = DIV_ROUND_UP(bits_per_pixel_x16 * pixel_clock, 16);
> u32 link_symbol_clock = intel_dp_link_symbol_clock(link_clock);
> - u32 data_m;
> - u32 data_n;
> + u32 data_m = intel_dp_effective_data_rate(pixel_clock, bits_per_pixel_x16,
> + bw_overhead);
> + u32 data_n = intel_dp_max_data_rate(link_clock, nlanes);
>
> - add_bw_alloc_overhead(link_clock, bw_overhead,
> - data_clock,
> - link_clock * 10 * nlanes,
> - &data_m, &data_n);
> /*
> * Windows/BIOS uses fixed M/N values always. Follow suit.
> *
> --
> 2.39.2
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2023-11-17 17:14 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-16 13:18 [Intel-gfx] [PATCH v2 00/11] drm/i915: Fix UHBR data, link M/N/TU and PBN values Imre Deak
2023-11-16 13:18 ` [Intel-gfx] [PATCH v2 01/11] drm/dp_mst: Store the MST PBN divider value in fixed point format Imre Deak
2023-11-17 10:56 ` Ville Syrjälä
2023-11-17 14:11 ` Imre Deak
2023-11-21 13:54 ` Imre Deak
2023-11-16 13:18 ` [Intel-gfx] [PATCH v2 02/11] drm/dp_mst: Fix PBN divider calculation for UHBR rates Imre Deak
2023-11-17 11:00 ` Ville Syrjälä
2023-11-17 13:58 ` Imre Deak
2023-11-17 15:09 ` [Intel-gfx] [PATCH v3 " Imre Deak
2023-11-17 16:21 ` Ville Syrjälä
2023-11-17 19:40 ` Rodrigo Vivi
2023-11-21 13:39 ` Maarten Lankhorst
2023-11-16 13:18 ` [Intel-gfx] [PATCH v2 03/11] drm/dp_mst: Add kunit tests for drm_dp_get_vc_payload_bw() Imre Deak
2023-11-17 11:04 ` Ville Syrjälä
2023-11-17 14:35 ` Imre Deak
2023-11-17 15:09 ` [Intel-gfx] [PATCH v3 " Imre Deak
2023-11-17 15:27 ` [Intel-gfx] [PATCH v4 " Imre Deak
2023-11-17 16:18 ` Ville Syrjälä
2023-11-20 12:52 ` [Intel-gfx] [PATCH v5 " Imre Deak
2023-11-18 23:41 ` [Intel-gfx] [PATCH v2 " kernel test robot
2023-11-16 13:18 ` [Intel-gfx] [PATCH v2 04/11] drm/i915/dp: Replace intel_dp_is_uhbr_rate() with drm_dp_is_uhbr_rate() Imre Deak
2023-11-17 3:21 ` Murthy, Arun R
2023-11-16 13:18 ` [Intel-gfx] [PATCH v2 05/11] drm/i915/dp: Account for channel coding efficiency on UHBR links Imre Deak
2023-11-16 13:18 ` [Intel-gfx] [PATCH v2 06/11] drm/i915/dp: Fix UHBR link M/N values Imre Deak
2023-11-16 13:18 ` [Intel-gfx] [PATCH v2 07/11] drm/i915/dp_mst: Calculate the BW overhead in intel_dp_mst_find_vcpi_slots_for_bpp() Imre Deak
2023-11-17 9:18 ` Murthy, Arun R
2023-11-16 13:18 ` [Intel-gfx] [PATCH v2 08/11] drm/i915/dp_mst: Fix PBN / MTP_TU size calculation for UHBR rates Imre Deak
2023-11-17 15:09 ` [Intel-gfx] [PATCH v3 " Imre Deak
2023-11-16 13:18 ` [Intel-gfx] [PATCH v2 09/11] drm/i915/dp: Report a rounded-down value as the maximum data rate Imre Deak
2023-11-17 11:43 ` Lisovskiy, Stanislav
2023-11-16 13:18 ` [Intel-gfx] [PATCH v2 10/11] drm/i915/dp: Simplify intel_dp_max_data_rate() Imre Deak
2023-11-17 17:10 ` Ville Syrjälä
2023-11-16 13:18 ` [Intel-gfx] [PATCH v2 11/11] drm/i915/dp: Reuse intel_dp_{max, effective}_data_rate in intel_link_compute_m_n() Imre Deak
2023-11-17 17:11 ` Ville Syrjälä [this message]
2023-11-16 16:55 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Fix UHBR data, link M/N/TU and PBN values Patchwork
2023-11-16 16:55 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-11-16 17:09 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-11-17 14:11 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2023-11-17 20:23 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Fix UHBR data, link M/N/TU and PBN values (rev5) Patchwork
2023-11-17 20:23 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-11-17 20:37 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-11-18 17:09 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-11-20 12:31 ` [Intel-gfx] [PATCH v2 00/11] drm/i915: Fix UHBR data, link M/N/TU and PBN values Jani Nikula
2023-11-20 13:10 ` Imre Deak
2023-11-20 13:36 ` Jani Nikula
2023-11-21 2:23 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Fix UHBR data, link M/N/TU and PBN values (rev6) Patchwork
2023-11-21 2:23 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2023-11-21 2:37 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-11-21 20:54 ` Imre Deak
2023-11-21 22:42 ` [Intel-gfx] [PATCH v2 00/11] drm/i915: Fix UHBR data, link M/N/TU and PBN values Lyude Paul
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=ZVeezrlkQxzKh2Fs@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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