From: Thomas Zimmermann <tzimmermann@suse.de>
To: Jani Nikula <jani.nikula@intel.com>, dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
ville.syrjala@linux.intel.com
Subject: Re: [PATCH 10/24] drm/vblank: use the vblank based interfaces more
Date: Wed, 12 Nov 2025 16:56:38 +0100 [thread overview]
Message-ID: <454ddf9e-c995-4f1c-a2db-8a5c921d0515@suse.de> (raw)
In-Reply-To: <5bc164f2dfe11bf9a2655797e17e420405261c21.1762791343.git.jani.nikula@intel.com>
Am 10.11.25 um 17:17 schrieb Jani Nikula:
> With the prep work in place, we can get rid of _drm_vblank_get(),
> _drm_vblank_put(), and _drm_vblank_count().
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/drm_vblank.c | 44 ++++++++----------------------------
> 1 file changed, 10 insertions(+), 34 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
> index 91bedf8e6ea8..1c0ade41a57f 100644
> --- a/drivers/gpu/drm/drm_vblank.c
> +++ b/drivers/gpu/drm/drm_vblank.c
> @@ -403,14 +403,6 @@ u64 drm_vblank_count(struct drm_vblank_crtc *vblank)
> return count;
> }
>
> -static u64 _drm_vblank_count(struct drm_device *dev, unsigned int pipe)
> -{
> - if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
> - return 0;
> -
> - return drm_vblank_count(drm_vblank_crtc(dev, pipe));
> -}
> -
> /**
> * drm_crtc_accurate_vblank_count - retrieve the master vblank counter
> * @crtc: which counter to retrieve
> @@ -940,7 +932,7 @@ drm_get_last_vbltimestamp(struct drm_device *dev, unsigned int pipe,
> */
> u64 drm_crtc_vblank_count(struct drm_crtc *crtc)
> {
> - return _drm_vblank_count(crtc->dev, drm_crtc_index(crtc));
> + return drm_vblank_count(drm_crtc_vblank_crtc(crtc));
> }
> EXPORT_SYMBOL(drm_crtc_vblank_count);
>
> @@ -1238,14 +1230,6 @@ int drm_vblank_get(struct drm_vblank_crtc *vblank)
> return ret;
> }
>
> -static int _drm_vblank_get(struct drm_device *dev, unsigned int pipe)
> -{
> - if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
> - return -EINVAL;
> -
> - return drm_vblank_get(drm_vblank_crtc(dev, pipe));
> -}
> -
> /**
> * drm_crtc_vblank_get - get a reference count on vblank events
> * @crtc: which CRTC to own
> @@ -1258,7 +1242,7 @@ static int _drm_vblank_get(struct drm_device *dev, unsigned int pipe)
> */
> int drm_crtc_vblank_get(struct drm_crtc *crtc)
> {
> - return _drm_vblank_get(crtc->dev, drm_crtc_index(crtc));
> + return drm_vblank_get(drm_crtc_vblank_crtc(crtc));
> }
> EXPORT_SYMBOL(drm_crtc_vblank_get);
>
> @@ -1282,14 +1266,6 @@ void drm_vblank_put(struct drm_vblank_crtc *vblank)
> }
> }
>
> -static void _drm_vblank_put(struct drm_device *dev, unsigned int pipe)
> -{
> - if (drm_WARN_ON(dev, pipe >= dev->num_crtcs))
> - return;
> -
> - drm_vblank_put(drm_vblank_crtc(dev, pipe));
> -}
> -
> /**
> * drm_crtc_vblank_put - give up ownership of vblank events
> * @crtc: which counter to give up
> @@ -1300,7 +1276,7 @@ static void _drm_vblank_put(struct drm_device *dev, unsigned int pipe)
> */
> void drm_crtc_vblank_put(struct drm_crtc *crtc)
> {
> - _drm_vblank_put(crtc->dev, drm_crtc_index(crtc));
> + drm_vblank_put(drm_crtc_vblank_crtc(crtc));
> }
> EXPORT_SYMBOL(drm_crtc_vblank_put);
>
> @@ -1401,7 +1377,7 @@ void drm_crtc_vblank_off(struct drm_crtc *crtc)
> "wanted %llu, current %llu\n",
> e->sequence, seq);
> list_del(&e->base.link);
> - _drm_vblank_put(dev, pipe);
> + drm_vblank_put(vblank);
> send_vblank_event(dev, e, seq, now);
> }
>
> @@ -1677,7 +1653,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
>
> e->sequence = req_seq;
> if (drm_vblank_passed(seq, req_seq)) {
> - _drm_vblank_put(dev, pipe);
> + drm_vblank_put(vblank);
> send_vblank_event(dev, e, seq, now);
> vblwait->reply.sequence = seq;
> } else {
> @@ -1694,7 +1670,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, unsigned int pipe,
> spin_unlock_irq(&dev->event_lock);
> kfree(e);
> err_put:
> - _drm_vblank_put(dev, pipe);
> + drm_vblank_put(vblank);
> return ret;
> }
>
> @@ -1812,14 +1788,14 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
> return 0;
> }
>
> - ret = _drm_vblank_get(dev, pipe);
> + ret = drm_vblank_get(vblank);
> if (ret) {
> drm_dbg_core(dev,
> "crtc %d failed to acquire vblank counter, %d\n",
> pipe, ret);
> return ret;
> }
> - seq = _drm_vblank_count(dev, pipe);
> + seq = drm_vblank_count(vblank);
>
> switch (vblwait->request.type & _DRM_VBLANK_TYPES_MASK) {
> case _DRM_VBLANK_RELATIVE:
> @@ -1855,7 +1831,7 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
> drm_dbg_core(dev, "waiting on vblank count %llu, crtc %u\n",
> req_seq, pipe);
> wait = wait_event_interruptible_timeout(vblank->queue,
> - drm_vblank_passed(_drm_vblank_count(dev, pipe), req_seq) ||
> + drm_vblank_passed(drm_vblank_count(vblank), req_seq) ||
> !READ_ONCE(vblank->enabled),
> msecs_to_jiffies(3000));
>
> @@ -1885,7 +1861,7 @@ int drm_wait_vblank_ioctl(struct drm_device *dev, void *data,
> }
>
> done:
> - _drm_vblank_put(dev, pipe);
> + drm_vblank_put(vblank);
> return ret;
> }
>
--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Jochen Jaser, Andrew McDonald, Werner Knoblich, (HRB 36809, AG Nürnberg)
next prev parent reply other threads:[~2025-11-12 15:56 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-10 16:17 [PATCH 00/24] drm/vblank: refactoring and cleanups Jani Nikula
2025-11-10 16:17 ` [PATCH 01/24] drm/vblank: Unexport drm_wait_one_vblank() Jani Nikula
2025-11-11 8:14 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 02/24] drm/vblank: remove drm_wait_one_vblank() completely Jani Nikula
2025-11-11 8:17 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 03/24] drm/vblank: remove superfluous pipe check Jani Nikula
2025-11-11 8:18 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 04/24] drm/vblank: add return value to drm_crtc_wait_one_vblank() Jani Nikula
2025-11-10 16:17 ` [PATCH 05/24] drm/vblank: use the drm_vblank_crtc() and drm_crtc_vblank_crtc() helpers more Jani Nikula
2025-11-11 8:23 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 06/24] drm/vblank: prefer drm_crtc_vblank_crtc() over drm_vblank_crtc() Jani Nikula
2025-11-11 8:26 ` Thomas Zimmermann
2025-11-11 8:43 ` Jani Nikula
2025-11-11 16:00 ` Ville Syrjälä
2025-11-12 8:26 ` Jani Nikula
2025-11-12 11:56 ` Ville Syrjälä
2025-11-12 15:50 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 07/24] drm/vblank: pass vlank to drm_vblank_get()/_put()/_count() Jani Nikula
2025-11-11 8:32 ` Thomas Zimmermann
2025-11-11 8:53 ` Jani Nikula
2025-11-11 9:04 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 08/24] drm/vblank: pass vblank to drm_update_vblank_count() Jani Nikula
2025-11-12 15:54 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 09/24] drm/vblank: pass vblank to drm_handle_vblank_events() Jani Nikula
2025-11-12 15:56 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 10/24] drm/vblank: use the vblank based interfaces more Jani Nikula
2025-11-12 15:56 ` Thomas Zimmermann [this message]
2025-11-10 16:17 ` [PATCH 11/24] drm/vblank: pass vblank to drm_queue_vblank_event() Jani Nikula
2025-11-12 15:57 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 12/24] drm/vblank: pass vblank to drm_wait_vblank_reply() Jani Nikula
2025-11-12 16:01 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 13/24] drm/vblank: pass vblank to drm_vblank_count_and_time() Jani Nikula
2025-11-11 6:52 ` kernel test robot
2025-11-12 16:03 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 14/24] drm/vblank: pass vblank to drm_reset_vblank_timestamp() Jani Nikula
2025-11-12 16:07 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 15/24] drm/vblank: pass vblank to store_vblank() Jani Nikula
2025-11-12 16:08 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 16/24] drm/vblank: pass vblank to drm_vblank_enable() Jani Nikula
2025-11-12 16:08 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 17/24] drm/vblank: merge drm_vblank_restore() into drm_crtc_vblank_restore() Jani Nikula
2025-11-12 16:10 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 18/24] drm/vblank: add drm_crtc_from_vblank() helper Jani Nikula
2025-11-12 16:38 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 19/24] drm/vblank: pass vblank to __get_vblank_counter() and drm_max_vblank_count() Jani Nikula
2025-11-12 16:40 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 20/24] drm/vblank: pass vblank to __{enable,disable}_vblank() Jani Nikula
2025-11-12 16:41 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 21/24] drm/vblank: pass vblank to drm_get_last_vbltimestamp() Jani Nikula
2025-11-12 16:44 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 22/24] drm/vblank: pass vblank to drm_vblank_disable_and_save(), make static Jani Nikula
2025-11-12 16:46 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 23/24] drm/vblank: reduce pipe checks Jani Nikula
2025-11-10 17:45 ` Ville Syrjälä
2025-11-11 8:56 ` Jani Nikula
2025-11-12 16:54 ` Thomas Zimmermann
2025-11-10 16:17 ` [PATCH 24/24] drm/vblank: clean up debug logging Jani Nikula
2025-11-13 14:05 ` Thomas Zimmermann
2025-11-10 17:12 ` ✗ CI.KUnit: failure for drm/vblank: refactoring and cleanups 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=454ddf9e-c995-4f1c-a2db-8a5c921d0515@suse.de \
--to=tzimmermann@suse.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@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).