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/21] drm/i915/display: Use fixed_rr timings in modeset sequence
Date: Fri, 7 Mar 2025 14:50:46 +0200 [thread overview]
Message-ID: <Z8rrpvnqE4Lcc4hb@intel.com> (raw)
In-Reply-To: <9d1d55c7-199b-47a6-913e-d221d7cf2853@intel.com>
On Fri, Mar 07, 2025 at 05:33:46PM +0530, Nautiyal, Ankit K wrote:
>
> On 3/6/2025 10:16 PM, Ville Syrjälä wrote:
> > On Thu, Mar 06, 2025 at 06:40:54PM +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().
> >> v6:
> >> -Disable VRR just before intel_ddi_disable_transcoder_func(). (Ville)
> >> -Correct the sequence of configuring PUSH and VRR Enable/Disable. (Ville)
> >>
> >> 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 | 63 ++++++++++++++++-----
> >> drivers/gpu/drm/i915/display/intel_vrr.h | 2 +
> >> 4 files changed, 60 insertions(+), 14 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> >> index 676c1826f15c..6d89a87b3419 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"
> >>
> >> @@ -3248,6 +3249,8 @@ static void intel_ddi_post_disable_hdmi_or_sst(struct intel_atomic_state *state,
> >> drm_dp_dpcd_poll_act_handled(&intel_dp->aux, 0);
> >> }
> >>
> >> + intel_vrr_transcoder_disable(old_crtc_state);
> >> +
> >> intel_ddi_disable_transcoder_func(old_crtc_state);
> >>
> >> for_each_pipe_crtc_modeset_disable(display, pipe_crtc, old_crtc_state, i) {
> >> @@ -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..d2988b9a6e7b 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c
> >> @@ -1065,6 +1065,8 @@ static void mst_stream_post_disable(struct intel_atomic_state *state,
> >> drm_dp_remove_payload_part2(&intel_dp->mst.mgr, new_mst_state,
> >> old_payload, new_payload);
> >>
> >> + intel_vrr_transcoder_disable(old_crtc_state);
> >> +
> >> intel_ddi_disable_transcoder_func(old_crtc_state);
> >>
> >> for_each_pipe_crtc_modeset_disable(display, pipe_crtc, old_crtc_state, i) {
> >> @@ -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 f523a48e6186..d7580b6e4e37 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_vrr.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_vrr.c
> >> @@ -460,12 +460,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));
> >> @@ -477,14 +471,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,
> >> @@ -618,6 +605,54 @@ 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_PUSH(display, cpu_transcoder),
> >> + TRANS_PUSH_EN);
> >> +
> >> + intel_de_write(display, TRANS_VRR_CTL(display, cpu_transcoder),
> >> + VRR_CTL_VRR_ENABLE | trans_vrr_ctl(crtc_state));
> >> +}
> >> +
> >> +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));
> > IMO we should write 0 here too.
>
> There is one problem. If we do not write trans_vrr_ctl but crtc_state
> has flipline, vmin, vmax all set to some value, then we get mismatch in
> vrr_get_config.
This is intel_vrr_transcoder_disable(). Nothing is expected to be
configured for disabled transcoders.
--
Ville Syrjälä
Intel
next prev parent reply other threads:[~2025-03-07 12:50 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 13:10 [PATCH 00/21] Use VRR timing generator for fixed refresh rate modes Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 01/21] drm/i915/vrr: Remove unwanted comment Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 02/21] drm/i915:vrr: Separate out functions to compute vmin and vmax Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 03/21] drm/i915/vrr: Make helpers for cmrr and vrr timings Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 04/21] drm/i915/vrr: Disable CMRR Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 05/21] drm/i915/vrr: Track vrr.enable only for variable timing Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 06/21] drm/i915/vrr: Use crtc_vtotal for vmin Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 07/21] drm/i915/vrr: Prepare for fixed refresh rate timings Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 08/21] drm/i915/display: Enable MSA Ignore Timing PAR only when in not fixed_rr mode Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 09/21] drm/i915/hdmi: Use VRR Timing generator for HDMI for fixed_rr Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 10/21] drm/i915/dp_mst: Use VRR Timing generator for DP MST " Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 11/21] drm/i915/display: Disable PSR before disabling VRR Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 12/21] drm/i915/display: Move intel_psr_post_plane_update() at the later Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 13/21] drm/i915/vrr: Refactor condition for computing vmax and LRR Ankit Nautiyal
2025-03-06 16:40 ` Ville Syrjälä
2025-03-06 13:10 ` [PATCH 14/21] drm/i915/vrr: Always set vrr vmax/vmin/flipline in vrr_{enable/disable} Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 15/21] drm/i915/display: Use fixed_rr timings in modeset sequence Ankit Nautiyal
2025-03-06 16:46 ` Ville Syrjälä
2025-03-07 12:03 ` Nautiyal, Ankit K
2025-03-07 12:50 ` Ville Syrjälä [this message]
2025-03-09 14:55 ` Nautiyal, Ankit K
2025-03-06 13:10 ` [PATCH 16/21] drm/i915/vrr: Use fixed timings for platforms that support VRR Ankit Nautiyal
2025-03-06 16:47 ` Ville Syrjälä
2025-03-06 13:10 ` [PATCH 17/21] drm/i915/display: Move vrr.guardband/pipeline_full out of !fastset block Ankit Nautiyal
2025-03-07 14:26 ` Ville Syrjälä
2025-03-09 16:35 ` Nautiyal, Ankit K
2025-03-10 15:52 ` Ville Syrjälä
2025-03-06 13:10 ` [PATCH 18/21] drm/i915/display: Use fixed rr timings in intel_set_transcoder_timings_lrr() Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 19/21] drm/i915/vrr: Allow fixed_rr with pipe joiner Ankit Nautiyal
2025-03-06 13:10 ` [PATCH 20/21] drm/i915/vrr: Always use VRR timing generator for MTL+ Ankit Nautiyal
2025-03-06 13:11 ` [PATCH 21/21] drm/i915/display: Add fixed_rr to crtc_state dump Ankit Nautiyal
2025-03-06 14:15 ` ✗ Fi.CI.SPARSE: warning for Use VRR timing generator for fixed refresh rate modes (rev12) Patchwork
2025-03-06 14:29 ` ✓ CI.Patch_applied: success for Use VRR timing generator for fixed refresh rate modes (rev7) Patchwork
2025-03-06 14:30 ` ✓ CI.checkpatch: " Patchwork
2025-03-06 14:31 ` ✓ CI.KUnit: " Patchwork
2025-03-06 14:39 ` ✗ i915.CI.BAT: failure for Use VRR timing generator for fixed refresh rate modes (rev12) Patchwork
2025-03-06 14:51 ` ✓ CI.Build: success for Use VRR timing generator for fixed refresh rate modes (rev7) Patchwork
2025-03-06 14:51 ` ✓ CI.Hooks: " Patchwork
2025-03-06 14:52 ` ✗ CI.checksparse: warning " Patchwork
2025-03-06 15:14 ` ✓ Xe.CI.BAT: success " Patchwork
2025-03-07 0:19 ` ✓ Xe.CI.Full: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2025-03-10 12:15 [PATCH 00/21] Use VRR timing generator for fixed refresh rate modes Ankit Nautiyal
2025-03-10 12:16 ` [PATCH 15/21] drm/i915/display: Use fixed_rr timings in modeset sequence Ankit Nautiyal
2025-03-10 18:07 ` Ville Syrjälä
2025-03-11 8:54 ` Nautiyal, Ankit K
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=Z8rrpvnqE4Lcc4hb@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.