From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Hogander, Jouni" <jouni.hogander@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Cc: "ville.syrjala@linux.intel.com" <ville.syrjala@linux.intel.com>,
"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 6/7] drm/i915/psr: Add VRR send push interface for PSR usage
Date: Thu, 10 Oct 2024 12:53:37 +0300 [thread overview]
Message-ID: <87set4707y.fsf@intel.com> (raw)
In-Reply-To: <96da83312410aac2d9994778a503909e9267ec28.camel@intel.com>
On Thu, 10 Oct 2024, "Hogander, Jouni" <jouni.hogander@intel.com> wrote:
> On Thu, 2024-10-10 at 11:03 +0300, Jani Nikula wrote:
>> On Thu, 10 Oct 2024, Jouni Högander <jouni.hogander@intel.com> wrote:
>> > Add own interface for PSR usage to perform push on frontbuffer
>> > tracking
>> > invalidate and flush call backs. Use this new interface from PSR
>> > code.
>> >
>> > Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
>> > ---
>> > drivers/gpu/drm/i915/display/intel_psr.c | 7 ++++++-
>> > drivers/gpu/drm/i915/display/intel_vrr.c | 18 ++++++++++++++++++
>> > drivers/gpu/drm/i915/display/intel_vrr.h | 4 ++++
>> > 3 files changed, 28 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
>> > b/drivers/gpu/drm/i915/display/intel_psr.c
>> > index 5be8076475f0b..7959a33771b13 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_psr.c
>> > +++ b/drivers/gpu/drm/i915/display/intel_psr.c
>> > @@ -2326,8 +2326,13 @@ static void psr_force_exit(struct intel_dp
>> > *intel_dp)
>> > * This workaround do not exist for platforms with display
>> > 10 or newer
>> > * but testing proved that it works for up display 13, for
>> > newer
>> > * than that testing will be needed.
>> > + *
>> > + * In Lunarlake we can use TRANS_PUSH mechanism to force
>> > sending update
>> > + * to sink.
>> > */
>> > - intel_de_write(display, CURSURFLIVE(display, intel_dp-
>> > >psr.pipe), 0);
>> > + DISPLAY_VER(display) >= 20 ?
>> > + intel_vrr_psr_send_push(display, cpu_transcoder) :
>> > + intel_de_write(display, CURSURFLIVE(display,
>> > intel_dp->psr.pipe), 0);
>> > }
>> >
>> > void intel_psr2_program_trans_man_trk_ctl(const struct
>> > intel_crtc_state *crtc_state)
>> > diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c
>> > b/drivers/gpu/drm/i915/display/intel_vrr.c
>> > index 5925ade4591d4..d51830d173b61 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_vrr.c
>> > +++ b/drivers/gpu/drm/i915/display/intel_vrr.c
>> > @@ -328,6 +328,24 @@ void intel_vrr_send_push(const struct
>> > intel_crtc_state *crtc_state)
>> > trans_push_val);
>> > }
>> >
>> > +/**
>> > + * intel_vrr_psr_send_push - Send push interface for PSR code
>> > + * @display: Intel display
>> > + * @cpu_transcoder: cpu_transcode
>> > + *
>> > + * This is for PSR usage to perform push on frontbuffer tracking
>> > invalidate and
>> > + * flush call back. PSR mutex should be taken by caller.
>> > + */
>> > +void intel_vrr_psr_send_push(struct intel_display *display,
>> > + enum transcoder cpu_transcoder)
>> > +{
>> > + if (DISPLAY_VER(display) < 20)
>> > + return;
>> > +
>> > + intel_de_rmw(display, TRANS_PUSH(display, cpu_transcoder),
>> > 0,
>> > + TRANS_PUSH_SEND | LNL_TRANS_PUSH_PSR_PR_EN);
>> > +}
>> > +
>> > bool intel_vrr_is_push_sent(const struct intel_crtc_state
>> > *crtc_state)
>> > {
>> > struct intel_display *display =
>> > to_intel_display(crtc_state);
>> > diff --git a/drivers/gpu/drm/i915/display/intel_vrr.h
>> > b/drivers/gpu/drm/i915/display/intel_vrr.h
>> > index a75f159168c11..3da7ba12697ff 100644
>> > --- a/drivers/gpu/drm/i915/display/intel_vrr.h
>> > +++ b/drivers/gpu/drm/i915/display/intel_vrr.h
>> > @@ -12,6 +12,8 @@ struct drm_connector_state;
>> > struct intel_atomic_state;
>> > struct intel_connector;
>> > struct intel_crtc_state;
>> > +struct intel_display;
>> > +enum transcoder;
>> >
>> > bool intel_vrr_is_capable(struct intel_connector *connector);
>> > bool intel_vrr_is_in_range(struct intel_connector *connector, int
>> > vrefresh);
>> > @@ -25,6 +27,8 @@ bool intel_vrr_is_push_sent(const struct
>> > intel_crtc_state *crtc_state);
>> > void intel_vrr_disable(const struct intel_crtc_state
>> > *old_crtc_state);
>> > void intel_vrr_psr_frame_change_enable(const struct
>> > intel_crtc_state *crtc_state);
>> > void intel_vrr_psr_frame_change_disable(const struct
>> > intel_crtc_state *crtc_state);
>> > +void intel_vrr_psr_send_push(struct intel_display *display,
>> > + enum transcoder cpu_transcoder);
>>
>> Nitpick, why not just make that parameter crtc_state like for all the
>> other functions?
>
> This is about to be used from frontbuffer flush/invalidate path as
> well. There we do not have crtc_state directly. I'll guess we could use
> current state of crtc. Do you think that would be better?
I wasn't aware of the potential future use. Just stick with this, at
least for now.
BR,
Jani.
>
> BR,
>
> Jouni Högander
>
>>
>> BR,
>> Jani.
>>
>> > void intel_vrr_get_config(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);
>>
>
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-10-10 9:53 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-10 5:33 [PATCH 0/7] Use trans push mechanism to generate frame change event Jouni Högander
2024-10-10 5:33 ` [PATCH 1/7] drm/i915/psr: Add TRANS_PUSH register bit definition for PSR Jouni Högander
2024-10-10 5:33 ` [PATCH 2/7] drm/i915/vrr: Do not overwrite TRANS_PUSH PSR Frame Change Enable Jouni Högander
2024-10-10 12:06 ` Ville Syrjälä
2024-10-11 10:14 ` Hogander, Jouni
2024-10-10 5:33 ` [PATCH 3/7] drm/i915/vrr: Use TRANS_PUSH mechanism for PSR frame change Jouni Högander
2024-10-10 5:33 ` [PATCH 4/7] drm/i915/psr: Rename psr_force_hw_tracking_exit as psr_force_exit Jouni Högander
2024-10-10 5:33 ` [PATCH 5/7] drm/i915/psr: Simplify frontbuffer invalidate/flush callbacks Jouni Högander
2024-10-10 5:33 ` [PATCH 6/7] drm/i915/psr: Add VRR send push interface for PSR usage Jouni Högander
2024-10-10 8:03 ` Jani Nikula
2024-10-10 9:25 ` Hogander, Jouni
2024-10-10 9:53 ` Jani Nikula [this message]
2024-10-10 5:33 ` [PATCH 7/7] drm/i915/display: Generate PSR frame change event on cursor update Jouni Högander
2024-10-10 6:53 ` ✗ CI.Patch_applied: failure for Use trans push mechanism to generate frame change event 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=87set4707y.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jouni.hogander@intel.com \
--cc=ville.syrjala@linux.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;
as well as URLs for NNTP newsgroup(s).