All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: sunpeng.li@amd.com, amd-gfx@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, Harry.Wentland@amd.com,
	Nicholas.Kazlauskas@amd.com, simona@ffwll.ch, airlied@gmail.com
Subject: Re: [PATCH v2 1/2] drm: Introduce drm_crtc_vblank_prepare()
Date: Tue, 9 Dec 2025 12:47:23 +0200	[thread overview]
Message-ID: <aTf-O8DFcCJPhrPd@intel.com> (raw)
In-Reply-To: <d2b8706e41648fcd271d00f2be54545c9090442f@intel.com>

On Tue, Dec 09, 2025 at 12:05:31PM +0200, Jani Nikula wrote:
> On Mon, 01 Dec 2025, <sunpeng.li@amd.com> wrote:
> > From: Leo Li <sunpeng.li@amd.com>
> >
> > Some drivers need to perform blocking operations prior to enabling
> > vblank interrupts. A display hardware spin-up from a low-power state
> > that requires synchronization with the rest of the driver via a mutex,
> > for example.
> >
> > To support this, introduce a new drm_crtc_vblank_prepare() helper that
> > calls back into the driver -- if implemented -- for the driver to do
> > such preparation work.
> >
> > In DRM core, call this helper before drm_vblank_get(). Drivers can
> > choose to call this if they implement the callback in the future.
> 
> Have you considered hiding all of this inside drm_vblank.c? Call prepare
> in drm_crtc_vblank_get() and a couple of other places? And actually
> don't call it on !drm_dev_has_vblank(dev)?
> 
> There's just so much littering all over the place with the prepare, and
> it seems brittle. Especially when you expect not only the drm core but
> also the relevant drivers to call drm_crtc_vblank_prepare() when needed.
> 
> There does seem to be a few places in amdgpu that wrap the
> drm_crtc_vblank_get() inside dev->event_lock, but is there really any
> need to do so? Do the get first, and grab the event_lock after?
> 
> Some random comments inline.
> 
> Cc: Ville

drm_vblank_get() can get called from any kind of context.
The only workable solution might be the schedule a work from
.vblank_enable() and do whatever is needed from there.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2025-12-09 10:47 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 23:18 [PATCH v2 1/2] drm: Introduce drm_crtc_vblank_prepare() sunpeng.li
2025-12-01 23:18 ` [PATCH v2 2/2] drm/amd/display: Implement prepare_vblank_enable callback sunpeng.li
2025-12-08 15:46   ` Harry Wentland
2025-12-08 15:43 ` [PATCH v2 1/2] drm: Introduce drm_crtc_vblank_prepare() Harry Wentland
2025-12-09 10:05 ` Jani Nikula
2025-12-09 10:47   ` Ville Syrjälä [this message]
2025-12-10 17:55     ` Leo Li
2026-01-02 22:45       ` Leo Li
2025-12-10 17:26   ` Leo Li
  -- strict thread matches above, loose matches on Subject: below --
2025-12-04  3:46 kernel test robot
2025-12-04  8:25 ` Dan Carpenter
2025-12-05  3:17 kernel test robot

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=aTf-O8DFcCJPhrPd@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=Harry.Wentland@amd.com \
    --cc=Nicholas.Kazlauskas@amd.com \
    --cc=airlied@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=simona@ffwll.ch \
    --cc=sunpeng.li@amd.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.