AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Timur Kristóf" <timur.kristof@gmail.com>
To: Leo Li <sunpeng.li@amd.com>,
	amd-gfx@lists.freedesktop.org,
	Harry Wentland <harry.wentland@amd.com>
Cc: Aurabindo.Pillai@amd.com, mario.limonciello@amd.com,
	wiagn233@outlook.com,  sysdadmin@m1k.cloud
Subject: Re: [PATCH] drm/amd/display: Use vline2 interrupt on DCN instead of vstartup
Date: Wed, 06 May 2026 23:57:22 +0200	[thread overview]
Message-ID: <2253800.9o76ZdvQCi@timur-hyperion> (raw)
In-Reply-To: <dc74c28b-e4e0-4617-b5af-317e29625782@amd.com>

On Wednesday, May 6, 2026 10:32:16 PM Central European Summer Time Harry 
Wentland wrote:
> On 2026-05-06 16:00, Leo Li wrote:
> > On 2026-05-04 16:54, Timur Kristóf wrote:
> >> On Monday, May 4, 2026 8:36:49 PM Central European Summer Time
> >> 
> >> sunpeng.li@amd.com wrote:
> >>> From: Leo Li <sunpeng.li@amd.com>
> >>> 
> >>> [Why]
> >>> 
> >>> VStartup is an OTG event that fires when the pixel pipeline prepares for
> >>> pixel scanout of the next frame. It was previously used to deliver
> >>> vblank events for commits that do not trigger a fb address update, and
> >>> hence a pflip interrupt (hw cursor updates, for example).
> >>> 
> >>> The issue with vstartup is that HW can mask the interrupt in cases where
> >>> idle optimizations are enabled or when a HW lock is active. This could
> >>> the explain the range of flip_done timeouts frequently seen in the wild.
> >> 
> >> Can you help me understand how that could happen with vstartup?
> >> Specifically, what is a "HW lock" and when is it active?
> > 
> > Hi Timur,
> > 
> > I should've prefaced this patch to say that this is a theoretical fix. I
> > haven't been able to reproduce the timeout issues myself, and this patch
> > came out of internal discussions with folks more familiar with the HW. I
> > don't think this will fix *all* cases of flip_done timeouts, but it may
> > address some of them.
> > 
> > (But timeouts aside, we *should* transition to vline since it's more
> > reliable than vstartup.)
> > 
> > To answer your questions: depending on the DCN generation, there can be a
> > few things that affects vstartup firing:
> > 
> > * DPG - DCN can Dynamically Power Gate parts of the display pipe when a
> > 
> >   self-refresh capable eDP is connected. DPG is engaged when there's
> >   enough
> >   static frames (detected thru drm_vblank_off) Once gated, even though the
> >   OTG (output timing generator) is still enabled, vstartup is masked.
> >   vline is unaffected.
> > 
> > * GSL - Driver can use the Global Sync Lock to block HW from latching onto
> > 
> >   double-buffered registers during programming, to prevent HW from
> >   latching onto a partially programmed state. This will mask vstartup,
> >   but vline is unaffected. See dcn20_pipe_control_lock()
> > 
> > * MALL - A DCN accessible cache introduced in DCN32+ DGPUs that can store
> > fb> 
> >   data to allow for longer DRAM sleep. When scanning out from MALL,
> >   vstartup is masked, vline is unaffected.
> >> 
> >> Many users have experienced flip_done timeouts while playing games.
> >> In that scenario, would any idle optimization be enabled or is there a
> >> "HW
> >> lock"?
> > 
> > If the game stops submitting frames for ~15 refresh cycles, it's possible
> > that PSR kicks in. Though I know there are plenty of reporters running on
> > external without PSR support. If it's DGPUs, it's very likely due to
> > MALL. A reporter I was debugging with said disabling MALL showed good
> > results[1]. If it's an APU with an external monitor, then that's less
> > clear.
> > 
> > A lot of the reporters seem to be running Phoenix (DCN314), with a common
> > symptom of DMUB timing out[2]. If a self-refresh panel is involved, then
> > I'm curious if this vline2 patch would help. Hamza's recent patch[3] that
> > enables various levels of reset may help to mitigate, but it doesn't fix
> > the root-cause. I'm planning a branch with this patch and [3], along with
> > debug dumps on flip_done timeouts for reporters to try.
> > 
> > [1]https://lore.kernel.org/amd-gfx/e415c38b-4102-40e4-a195-0256caf34802@m1
> > k.cloud/ [2]https://gitlab.freedesktop.org/drm/amd/-/work_items/4831
> > [3]https://lore.kernel.org/lkml/20260505182105.420525-2-someguy@effective-> > light.com/> 
> >>> DCN hardware provides 3 generic OTG interrupts that can be programmed
> >>> to>> fire on a specific line. Vline 0 and 1 are currently reserved,
> >>> with vline2 available to use for event delivery. These interrupts
> >>> cannot be masked, as long as the OTG is active.
> >>> 
> >>> [How]
> >>> 
> >>> Switch to vline2 for vblank handling. Today, DC will program the
> >>> vline2 position to at vupdate -- the point at which HW latches to
> >>> double-buffered registers.
> >>> 
> >>> Since all the vline interrupt types share the same interrupt src_id,
> >>> refactor the existing vline0 infrastructure to allow for all the vline0,
> >>> 1, and 2 types.
> >>> 
> >>> Since this is intended to replace vstartup for DCN, use the same handler
> >>> logic, but be careful to leave DCE on vstartup.
> >> 
> >> Why not also switch DCE?
> >> Does DCE not have the vline interrupts or does it not have the same issue
> >> with the vstartup interrupt?
> > 
> > I didn't want to touch DCE since I don't have information on how these
> > interrupts behave on them, and I didn't want to regress anything. Would
> > need to do some digging to find out.
> 
> DCE's architecture is quite different in this regard. No VSTARTUP, VUPDATE
> signals and interrupts on DCE.
> 

Hi Harry,

I'm pretty sure DCE has VUPDATE, starting from DCE 8, it is used for VRR.
You can verify this in irq_service_dce80.c

Not sure about VSTART, I'm a bit confused about that, but Leo above says that 
DCE uses that, but I can't find it.

Timur






  reply	other threads:[~2026-05-06 21:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-04 18:36 [PATCH] drm/amd/display: Use vline2 interrupt on DCN instead of vstartup sunpeng.li
2026-05-04 20:54 ` Timur Kristóf
2026-05-06 20:00   ` Leo Li
2026-05-06 20:32     ` Harry Wentland
2026-05-06 21:57       ` Timur Kristóf [this message]
2026-05-06 22:03     ` Timur Kristóf
2026-05-07  6:15       ` Shengyu Qu
2026-05-07 14:08       ` Leo Li
2026-05-10  6:06 ` Shengyu Qu

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=2253800.9o76ZdvQCi@timur-hyperion \
    --to=timur.kristof@gmail.com \
    --cc=Aurabindo.Pillai@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=mario.limonciello@amd.com \
    --cc=sunpeng.li@amd.com \
    --cc=sysdadmin@m1k.cloud \
    --cc=wiagn233@outlook.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