From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Nautiyal, Ankit K" <ankit.k.nautiyal@intel.com>
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
jani.nikula@linux.intel.com,
mitulkumar.ajitkumar.golani@intel.com
Subject: Re: [PATCH 15/22] drm/i915/display: Use fixed_rr timings in modeset sequence
Date: Wed, 5 Mar 2025 14:53:46 +0200 [thread overview]
Message-ID: <Z8hJWsf51NBUQG9i@intel.com> (raw)
In-Reply-To: <5f674c8e-3ac5-4e8d-9e9b-19e59d28a96b@intel.com>
On Wed, Mar 05, 2025 at 02:11:21PM +0530, Nautiyal, Ankit K wrote:
>
> On 3/5/2025 12:20 AM, Ville Syrjälä wrote:
> > On Tue, Mar 04, 2025 at 01:49:41PM +0530, Ankit Nautiyal wrote:
> >> During modeset enable sequence, program the fixed timings, and turn on the
> >> VRR Timing Generator (VRR TG) for platforms that always use VRR TG.
> >>
> >> For this intel_vrr_set_transcoder now always programs fixed timings.
> >> Later if vrr timings are required, vrr_enable() will switch
> >> to the real VRR timings.
> >>
> >> For platforms that will always use VRR TG, the VRR_CTL Enable bit is set
> >> and reset in the transcoder enable/disable path.
> >>
> >> v2: Update intel_vrr_set_transcoder_timings for fixed_rr.
> >> v3: Update intel_set_transcoder_timings_lrr for fixed_rr. (Ville)
> >> v4: Have separate functions to enable/disable VRR CTL
> >> v5:
> >> -For platforms that do not always have VRRTG on, do write bits other
> >> than enable bit and also use write the TRANS_VRR_PUSH register. (Ville)
> >> -Avoid writing trans_ctl_vrr if !vrr_possible().
> >>
> >> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> >> ---
> >> drivers/gpu/drm/i915/display/intel_ddi.c | 5 ++
> >> drivers/gpu/drm/i915/display/intel_dp_mst.c | 4 ++
> >> drivers/gpu/drm/i915/display/intel_vrr.c | 59 ++++++++++++++++-----
> >> drivers/gpu/drm/i915/display/intel_vrr.h | 3 ++
> >> 4 files changed, 57 insertions(+), 14 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> >> index 20fc258a4d6d..6f083c28c455 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> >> @@ -78,6 +78,7 @@
> >> #include "intel_tc.h"
> >> #include "intel_vdsc.h"
> >> #include "intel_vdsc_regs.h"
> >> +#include "intel_vrr.h"
> >> #include "skl_scaler.h"
> >> #include "skl_universal_plane.h"
> >>
> >> @@ -3273,6 +3274,8 @@ static void intel_ddi_post_disable(struct intel_atomic_state *state,
> >> const struct intel_crtc_state *old_crtc_state,
> >> const struct drm_connector_state *old_conn_state)
> >> {
> >> + intel_vrr_transcoder_disable(old_crtc_state);
> >> +
> > This isn't symmetric with the enable. If we do the enable just after
> > intel_ddi_enable_transcoder_func() then I would like to see the disable
> > done just before intel_ddi_disable_transcoder_func().
>
> Yes you are right. But as per bspec it seems enable and disable
> sequences are different.
> For enable the sequence is: TRANS_DDI_FUNC_CTL -> VRR_CTL ->TRANS_CONF
>
> But as per bspec: 49190, and 68849for Disable it is: VRR_CTL ->
> TRANS_CONF -> TRANS_DDI_FUNC_CTL
I don't think that part applies to PTL anymore. In fact looks like
there's no VRR disable step listed anymore listed. But I think we
should have one, and the symmetric spot to enable makes most sense
to me.
>
> Though I am following the spec, I am getting issues in the disabling
> part. Specifically WARN : pipe_off wait timed out for some platforms as
> flagged by the CI BAT failures.
Hmm. I think the hardware should have swithed over to the
legacy timing generator at that point since the transcoder
was still active. So not sure what's causing the timeout.
Did you have the TRANS_VTOTAL=0 patch included in those tests?
>
> I can try the change you mentioned to see if it helps.
>
>
> >
> >> if (!intel_crtc_has_type(old_crtc_state, INTEL_OUTPUT_DP_MST))
> >> intel_ddi_post_disable_hdmi_or_sst(state, encoder, old_crtc_state,
> >> old_conn_state);
> >> @@ -3521,6 +3524,8 @@ static void intel_ddi_enable(struct intel_atomic_state *state,
> >>
> >> intel_ddi_enable_transcoder_func(encoder, crtc_state);
> >>
> >> + intel_vrr_transcoder_enable(crtc_state);
> >> +
> >> /* Enable/Disable DP2.0 SDP split config before transcoder */
> >> intel_audio_sdp_split_update(crtc_state);
> >>
> >> diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> >> index bd47cf127b4c..7dbc9b3bdbe4 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> >> @@ -1049,6 +1049,8 @@ static void mst_stream_post_disable(struct intel_atomic_state *state,
> >> intel_crtc_vblank_off(old_pipe_crtc_state);
> >> }
> >>
> >> + intel_vrr_transcoder_disable(old_crtc_state);
> >> +
> > Same here.
> >
> >> intel_disable_transcoder(old_crtc_state);
> >>
> >> drm_dp_remove_payload_part1(&intel_dp->mst.mgr, new_mst_state, new_payload);
> >> @@ -1326,6 +1328,8 @@ static void mst_stream_enable(struct intel_atomic_state *state,
> >>
> >> intel_ddi_enable_transcoder_func(encoder, pipe_config);
> >>
> >> + intel_vrr_transcoder_enable(pipe_config);
> >> +
> >> intel_ddi_clear_act_sent(encoder, pipe_config);
> >>
> >> intel_de_rmw(display, TRANS_DDI_FUNC_CTL(display, trans), 0,
> >> diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
> >> index c1387d3f60b2..97040ab9ed86 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_vrr.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_vrr.c
> >> @@ -456,12 +456,6 @@ void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state)
> >> intel_de_rmw(display, CHICKEN_TRANS(display, cpu_transcoder),
> >> 0, PIPE_VBLANK_WITH_DELAY);
> >>
> >> - if (!intel_vrr_possible(crtc_state)) {
> >> - intel_de_write(display,
> >> - TRANS_VRR_CTL(display, cpu_transcoder), 0);
> >> - return;
> >> - }
> >> -
> >> if (crtc_state->cmrr.enable) {
> >> intel_de_write(display, TRANS_CMRR_M_HI(display, cpu_transcoder),
> >> upper_32_bits(crtc_state->cmrr.cmrr_m));
> >> @@ -473,14 +467,7 @@ void intel_vrr_set_transcoder_timings(const struct intel_crtc_state *crtc_state)
> >> lower_32_bits(crtc_state->cmrr.cmrr_n));
> >> }
> >>
> >> - intel_de_write(display, TRANS_VRR_VMIN(display, cpu_transcoder),
> >> - crtc_state->vrr.vmin - 1);
> >> - intel_de_write(display, TRANS_VRR_VMAX(display, cpu_transcoder),
> >> - crtc_state->vrr.vmax - 1);
> >> - intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
> >> - trans_vrr_ctl(crtc_state));
> >> - intel_de_write(display, TRANS_VRR_FLIPLINE(display, cpu_transcoder),
> >> - crtc_state->vrr.flipline - 1);
> >> + intel_vrr_set_fixed_rr_timings(crtc_state);
> >>
> >> if (HAS_AS_SDP(display))
> >> intel_de_write(display,
> >> @@ -614,6 +601,50 @@ void intel_vrr_disable(const struct intel_crtc_state *old_crtc_state)
> >> intel_vrr_set_fixed_rr_timings(old_crtc_state);
> >> }
> >>
> >> +void intel_vrr_transcoder_enable(const struct intel_crtc_state *crtc_state)
> >> +{
> >> + struct intel_display *display = to_intel_display(crtc_state);
> >> + enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
> >> +
> >> + if (!HAS_VRR(display))
> >> + return;
> >> +
> >> + if (!intel_vrr_possible(crtc_state))
> >> + return;
> >> +
> >> + if (!intel_vrr_always_use_vrr_tg(display)) {
> >> + intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
> >> + trans_vrr_ctl(crtc_state));
> >> + return;
> >> + }
> >> +
> >> + intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
> >> + VRR_CTL_VRR_ENABLE | trans_vrr_ctl(crtc_state));
> >> +
> >> + intel_de_write(display, TRANS_PUSH(display, cpu_transcoder),
> >> + TRANS_PUSH_EN);
> > IIRC push should generally be set before the VRR_CTL enable.
> > Perhaps doesn't matter here, since the transcoder is still
> > not enabled, but would be nice to be consistent with intel_vrr_enable().
>
> You are right will change this.
>
>
> >
> >> +}
> >> +
> >> +void intel_vrr_transcoder_disable(const struct intel_crtc_state *crtc_state)
> >> +{
> >> + struct intel_display *display = to_intel_display(crtc_state);
> >> + enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
> >> +
> >> + if (!HAS_VRR(display))
> >> + return;
> >> +
> >> + if (!intel_vrr_possible(crtc_state))
> >> + return;
> >> +
> >> + if (!intel_vrr_always_use_vrr_tg(display)) {
> >> + intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
> >> + trans_vrr_ctl(crtc_state));
> >> + return;
> >> + }
> >> +
> >> + intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder), 0);
> > Should probably clear the push enable for good measure too.
>
> Will clear the push enable, while disabling.
>
>
> PS: I had tried both with and without clearing the PUSH enable after
> disabling VRR, but the "pipe_off wait timed out" persisted.
>
>
> >
> >> +}
> >> +
> >> static
> >> bool intel_vrr_is_fixed_rr(const struct intel_crtc_state *crtc_state)
> >> {
> >> diff --git a/drivers/gpu/drm/i915/display/intel_vrr.h b/drivers/gpu/drm/i915/display/intel_vrr.h
> >> index 514822577e8a..c81f98f83b58 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_vrr.h
> >> +++ b/drivers/gpu/drm/i915/display/intel_vrr.h
> >> @@ -12,6 +12,7 @@ struct drm_connector_state;
> >> struct intel_atomic_state;
> >> struct intel_connector;
> >> struct intel_crtc_state;
> >> +struct intel_display;
> > Leftover from some other change?
>
> Sorry about this , it was indeed leftover from other patch.
>
>
> Regards,
>
> Ankit
>
> >
> >> struct intel_dsb;
> >>
> >> bool intel_vrr_is_capable(struct intel_connector *connector);
> >> @@ -35,5 +36,7 @@ int intel_vrr_vmin_vtotal(const struct intel_crtc_state *crtc_state);
> >> int intel_vrr_vmax_vblank_start(const struct intel_crtc_state *crtc_state);
> >> int intel_vrr_vmin_vblank_start(const struct intel_crtc_state *crtc_state);
> >> int intel_vrr_vblank_delay(const struct intel_crtc_state *crtc_state);
> >> +void intel_vrr_transcoder_enable(const struct intel_crtc_state *crtc_state);
> >> +void intel_vrr_transcoder_disable(const struct intel_crtc_state *crtc_state);
> >>
> >> #endif /* __INTEL_VRR_H__ */
> >> --
> >> 2.45.2
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2025-03-05 12:53 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-04 8:19 [PATCH 00/22] Use VRR timing generator for fixed refresh rate modes Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 01/22] drm/i915/vrr: Remove unwanted comment Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 02/22] drm/i915:vrr: Separate out functions to compute vmin and vmax Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 03/22] drm/i915/vrr: Make helpers for cmrr and vrr timings Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 04/22] drm/i915/vrr: Disable CMRR Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 05/22] drm/i915/vrr: Track vrr.enable only for variable timing Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 06/22] drm/i915/vrr: Use crtc_vtotal for vmin Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 07/22] drm/i915/vrr: Prepare for fixed refresh rate timings Ankit Nautiyal
2025-03-04 18:49 ` Ville Syrjälä
2025-03-05 8:30 ` Nautiyal, Ankit K
2025-03-04 8:19 ` [PATCH 08/22] drm/i915/display: Enable MSA Ignore Timing PAR only when in not fixed_rr mode Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 09/22] drm/i915/hdmi: Use VRR Timing generator for HDMI for fixed_rr Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 10/22] drm/i915/dp_mst: Use VRR Timing generator for DP MST " Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 11/22] drm/i915/display: Disable PSR before disabling VRR Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 12/22] drm/i915/display: Move intel_psr_post_plane_update() at the later Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 13/22] drm/i915/vrr: Refactor condition for computing vmax and LRR Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 14/22] drm/i915/vrr: Always set vrr vmax/vmin/flipline in vrr_{enable/disable} Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 15/22] drm/i915/display: Use fixed_rr timings in modeset sequence Ankit Nautiyal
2025-03-04 18:50 ` Ville Syrjälä
2025-03-05 8:41 ` Nautiyal, Ankit K
2025-03-05 12:53 ` Ville Syrjälä [this message]
2025-03-05 14:45 ` Nautiyal, Ankit K
2025-03-04 8:19 ` [PATCH 16/22] drm/i915/vrr: Use fixed timings for platforms that support VRR Ankit Nautiyal
2025-03-04 18:53 ` Ville Syrjälä
2025-03-05 8:46 ` Nautiyal, Ankit K
2025-03-04 8:19 ` [PATCH 17/22] drm/i915/display: Move vrr.guardband/pipeline_full out of !fastset block Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 18/22] drm/i915/display: Use fixed rr timings in intel_set_transcoder_timings_lrr() Ankit Nautiyal
2025-03-04 18:56 ` Ville Syrjälä
2025-03-05 8:52 ` Nautiyal, Ankit K
2025-03-04 8:19 ` [PATCH 19/22] drm/i915/vrr: Allow fixed_rr with pipe joiner Ankit Nautiyal
2025-03-04 19:07 ` Ville Syrjälä
2025-03-05 9:35 ` Nautiyal, Ankit K
2025-03-04 8:19 ` [PATCH 20/22] drm/i915/vrr: Always use VRR timing generator for MTL+ Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 21/22] drm/i915/display: Add fixed_rr to crtc_state dump Ankit Nautiyal
2025-03-04 8:19 ` [PATCH 22/22] drm/i915/display: Avoid use of VTOTAL.Vtotal bits Ankit Nautiyal
2025-03-04 9:16 ` ✓ CI.Patch_applied: success for Use VRR timing generator for fixed refresh rate modes (rev6) Patchwork
2025-03-04 9:17 ` ✗ CI.checkpatch: warning " Patchwork
2025-03-04 9:18 ` ✓ CI.KUnit: success " Patchwork
2025-03-04 9:35 ` ✓ CI.Build: " Patchwork
2025-03-04 9:37 ` ✓ CI.Hooks: " Patchwork
2025-03-04 9:38 ` ✗ CI.checksparse: warning " Patchwork
2025-03-04 10:04 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-03-04 11:18 ` ✗ Xe.CI.Full: " Patchwork
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=Z8hJWsf51NBUQG9i@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=ankit.k.nautiyal@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=mitulkumar.ajitkumar.golani@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