From: "Hogander, Jouni" <jouni.hogander@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
"Kahola, Mika" <mika.kahola@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915/alpm: Remove error handling from get_lfps_cycle_min_max_time
Date: Thu, 18 Sep 2025 06:27:01 +0000 [thread overview]
Message-ID: <0203a13de3dbc31110de8f818dd8106275decbc5.camel@intel.com> (raw)
In-Reply-To: <DS4PPF69154114FBE889E16B6C68A0A6A5EEF15A@DS4PPF69154114F.namprd11.prod.outlook.com>
On Mon, 2025-09-15 at 15:03 +0000, Kahola, Mika wrote:
> > -----Original Message-----
> > From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf
> > Of Jouni Högander
> > Sent: Friday, 12 September 2025 9.41
> > To: intel-xe@lists.freedesktop.org; intel-gfx@lists.freedesktop.org
> > Cc: Hogander, Jouni <jouni.hogander@intel.com>
> > Subject: [PATCH] drm/i915/alpm: Remove error handling from
> > get_lfps_cycle_min_max_time
> >
> > Getter for LFPS cycle min/max times is unnecessarily checking
> > faulty port clock value. This doesn't make sense as erroneous port
> > clock value would have been noticed already at this point. Remove
> > this check and use 140/800 ns always when port clock >
> > 540000.
> >
>
> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Thank you Mika for checking my patch. This is now pushed to drm-intel-
next.
BR,
Jouni Högander
>
> > Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_alpm.c | 29 +++++++------------
> > ----
> > 1 file changed, 8 insertions(+), 21 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c
> > b/drivers/gpu/drm/i915/display/intel_alpm.c
> > index ed7a7ed486b5..749119cc0b28 100644
> > --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> > +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> > @@ -58,43 +58,32 @@ static int get_silence_period_symbols(const
> > struct intel_crtc_state *crtc_state)
> > 1000 / 1000;
> > }
> >
> > -static int get_lfps_cycle_min_max_time(const struct
> > intel_crtc_state *crtc_state,
> > - int *min, int *max)
> > +static void get_lfps_cycle_min_max_time(const struct
> > intel_crtc_state *crtc_state,
> > + int *min, int *max)
> > {
> > if (crtc_state->port_clock < 540000) {
> > *min = 65 * LFPS_CYCLE_COUNT;
> > *max = 75 * LFPS_CYCLE_COUNT;
> > - } else if (crtc_state->port_clock <= 810000) {
> > + } else {
> > *min = 140;
> > *max = 800;
> > - } else {
> > - *min = *max = -1;
> > - return -1;
> > }
> > -
> > - return 0;
> > }
> >
> > static int get_lfps_cycle_time(const struct intel_crtc_state
> > *crtc_state) {
> > - int tlfps_cycle_min, tlfps_cycle_max, ret;
> > + int tlfps_cycle_min, tlfps_cycle_max;
> >
> > - ret = get_lfps_cycle_min_max_time(crtc_state,
> > &tlfps_cycle_min,
> > - &tlfps_cycle_max);
> > - if (ret)
> > - return ret;
> > + get_lfps_cycle_min_max_time(crtc_state, &tlfps_cycle_min,
> > + &tlfps_cycle_max);
> >
> > return tlfps_cycle_min + (tlfps_cycle_max -
> > tlfps_cycle_min) / 2; }
> >
> > static int get_lfps_half_cycle_clocks(const struct
> > intel_crtc_state *crtc_state) {
> > - int lfps_cycle_time = get_lfps_cycle_time(crtc_state);
> > -
> > - if (lfps_cycle_time < 0)
> > - return -1;
> > -
> > - return lfps_cycle_time * crtc_state->port_clock / 1000 /
> > 1000 / (2 * LFPS_CYCLE_COUNT);
> > + return get_lfps_cycle_time(crtc_state) * crtc_state-
> > >port_clock / 1000 /
> > + 1000 / (2 * LFPS_CYCLE_COUNT);
> > }
> >
> > /*
> > @@ -146,8 +135,6 @@ _lnl_compute_aux_less_alpm_params(struct
> > intel_dp *intel_dp,
> > silence_period = get_silence_period_symbols(crtc_state);
> >
> > lfps_half_cycle = get_lfps_half_cycle_clocks(crtc_state);
> > - if (lfps_half_cycle < 0)
> > - return false;
> >
> > if (aux_less_wake_lines > ALPM_CTL_AUX_LESS_WAKE_TIME_MASK
> > ||
> > silence_period > PORT_ALPM_CTL_SILENCE_PERIOD_MASK ||
> > --
> > 2.43.0
>
prev parent reply other threads:[~2025-09-18 6:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-12 6:40 [PATCH] drm/i915/alpm: Remove error handling from get_lfps_cycle_min_max_time Jouni Högander
2025-09-12 7:36 ` ✓ i915.CI.BAT: success for " Patchwork
2025-09-13 8:54 ` ✓ i915.CI.Full: " Patchwork
2025-09-15 15:03 ` [PATCH] " Kahola, Mika
2025-09-18 6:27 ` Hogander, Jouni [this message]
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=0203a13de3dbc31110de8f818dd8106275decbc5.camel@intel.com \
--to=jouni.hogander@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=mika.kahola@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