> -----Original Message----- > From: Intel-gfx <[email protected]> On Behalf Of Suraj > Kandpal > Sent: 17 September 2026 10:37 > To: [email protected]; [email protected] > Cc: Nautiyal, Ankit K <[email protected]>; Murthy, Arun R > <[email protected]>; Kandpal, Suraj <[email protected]> > Subject: [PATCH v4 01/10] drm/i915/display: Add helper to compute link M/N > ratio for reuse > > From: Ankit Nautiyal <[email protected]> > > Introduce intel_display_compute_link_m_n() to compute the link M/N ratio from > the pixel clock and the link symbol clock. This logic was previously embedded > within intel_link_compute_m_n(). > > The new helper allows reuse of link M/N computation in other contexts without > requiring the full data M/N calculation. The commit says this helper is for reuse, but it remains static with no caller added, please either explain the intended upcoming user in the commit message or make the helper non-static when the caller is introduced. > > No functional changes intended. > > v2: > - Rename function (Jani) > - The link symbol clock is passed in rather than derived here, so that the DP > specific conversion from the link rate stays with the caller. (Jani) > > Signed-off-by: Ankit Nautiyal <[email protected]> > Signed-off-by: Suraj Kandpal <[email protected]> > --- > drivers/gpu/drm/i915/display/intel_display.c | 15 +++++++++++---- > 1 file changed, 11 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c > b/drivers/gpu/drm/i915/display/intel_display.c > index 9151ea6c15ab..f04a6f97e05a 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -2641,13 +2641,20 @@ static void compute_m_n(u32 *ret_m, u32 *ret_n, > intel_reduce_m_n_ratio(ret_m, ret_n); > } > > +static void intel_display_compute_link_m_n(u32 *link_m, u32 *link_n, > + int pixel_clock, int > link_symbol_clock) > { > + compute_m_n(link_m, link_n, > + pixel_clock, link_symbol_clock, > + 0x80000); Since this helper may be reused elsewhere, please document here that the fixed N is intentional and follows the Windows/BIOS M/N requirement. > +} > + > 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 link_symbol_clock = intel_dp_link_symbol_clock(link_clock); > u32 data_m = intel_dp_effective_data_rate(pixel_clock, > bits_per_pixel_x16, > bw_overhead); > u32 data_n = drm_dp_max_dprx_data_rate(link_clock, nlanes); @@ - > 2664,9 +2671,9 @@ intel_link_compute_m_n(u16 bits_per_pixel_x16, int nlanes, > data_m, data_n, > 0x8000000); > > - compute_m_n(&m_n->link_m, &m_n->link_n, > - pixel_clock, link_symbol_clock, > - 0x80000); > + intel_display_compute_link_m_n(&m_n->link_m, &m_n->link_n, > + pixel_clock, > + intel_dp_link_symbol_clock(link_clock)); With mentioned changes addressed, LGTM Reviewed-by: Mitul Golani<[email protected]> > } > > void intel_panel_sanitize_ssc(struct intel_display *display) > -- > 2.34.1
RE: [PATCH v4 01/10] drm/i915/display: Add helper to compute link M/N ratio for reuse
Golani, Mitulkumar Ajitkumar Tue, 29 Sep 2026 10:44:59 -0700
- [PATCH v4 10/10] drm/i915/dp: Bump the max Li... Suraj Kandpal
- [PATCH v4 07/10] drm/i915/display: Add bits f... Suraj Kandpal
- Re: [PATCH v4 07/10] drm/i915/display: A... sashiko-bot
- RE: [PATCH v4 07/10] drm/i915/displa... Kandpal, Suraj
- RE: [PATCH v4 07/10] drm/i915/display: A... Golani, Mitulkumar Ajitkumar
- RE: [PATCH v4 07/10] drm/i915/displa... Kandpal, Suraj
- [PATCH v4 08/10] drm/i915/display: Implement ... Suraj Kandpal
- RE: [PATCH v4 08/10] drm/i915/display: I... Golani, Mitulkumar Ajitkumar
- RE: [PATCH v4 08/10] drm/i915/displa... Kandpal, Suraj
- [PATCH v4 01/10] drm/i915/display: Add helper... Suraj Kandpal
- RE: [PATCH v4 01/10] drm/i915/display: A... Golani, Mitulkumar Ajitkumar
- RE: [PATCH v4 01/10] drm/i915/displa... Kandpal, Suraj
- [PATCH v4 04/10] drm/i915/dp: Add M/N ratio c... Suraj Kandpal
- RE: [PATCH v4 04/10] drm/i915/dp: Add M/... Golani, Mitulkumar Ajitkumar
- RE: [PATCH v4 04/10] drm/i915/dp: Ad... Kandpal, Suraj
- [PATCH v5 00/10] Implement Wa_14021768792 to ... Suraj Kandpal
- [PATCH v5 01/11] drm/i915/display: Add helper... Suraj Kandpal
- [PATCH v5 03/11] drm/i915/display_wa: Add sup... Suraj Kandpal
- [PATCH v5 02/11] drm/i915/dp: Limit M/N ratio... Suraj Kandpal
- [PATCH v5 04/11] drm/i915/dp_mst: Limit M/N r... Suraj Kandpal
- [PATCH v5 05/11] drm/i915/dp: Add M/N ratio c... Suraj Kandpal
