> > > > > -----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.
We don't mention in the commit message that this function will be used says in the 4th patch of this patch series. We have already mentioned that this will be reused later on . I can however add that this function will be used in later commits. > > > > > 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. We really don't want to document this here in this commit seeing as this was not documented where it was previously called Either and this commit only moves that call into a helper function. Other wise we will end up with a lot of unnecessary documentation In code which is not required. Ankit Nautiyal what do you think ? Regards, Suraj Kandpal > > > +} > > + > > 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
