All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Thomas Zimmermann <tzimmermann@suse.de>, dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org,
	ville.syrjala@linux.intel.com
Subject: Re: [PATCH 06/24] drm/vblank: prefer drm_crtc_vblank_crtc() over drm_vblank_crtc()
Date: Tue, 11 Nov 2025 10:43:15 +0200	[thread overview]
Message-ID: <acce5e2b3827d8dfa12e571f8a4dfef475f7f232@intel.com> (raw)
In-Reply-To: <bcdc1246-d589-4769-b89f-d779ac4984b2@suse.de>

On Tue, 11 Nov 2025, Thomas Zimmermann <tzimmermann@suse.de> wrote:
> Am 10.11.25 um 17:17 schrieb Jani Nikula:
>> Use the higher level function where crtc is available.
>>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
>
> Is there a long-term plan to replace drm_vblank_crtc() entirely? 
> Otherwise this looks a bit pointless.

Well, almost entirely. There are a few cases (plus the one that Ville
mentioned later in the series) that need to operate on dev + pipe
alone. The main point is that when you have a crtc and use that for the
source of pipe, you don't have to do range checks on the pipe. This
becomes gradually more evident in the series.

BR,
Jani.



>
>> ---
>>   drivers/gpu/drm/drm_vblank.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c
>> index e3a5a783686f..96dbff63f52d 100644
>> --- a/drivers/gpu/drm/drm_vblank.c
>> +++ b/drivers/gpu/drm/drm_vblank.c
>> @@ -712,7 +712,7 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal(
>>   {
>>   	struct drm_device *dev = crtc->dev;
>>   	unsigned int pipe = crtc->index;
>> -	struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
>> +	struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
>>   	struct timespec64 ts_etime, ts_vblank_time;
>>   	ktime_t stime, etime;
>>   	bool vbl_status;
>> @@ -1302,7 +1302,7 @@ int drm_crtc_wait_one_vblank(struct drm_crtc *crtc)
>>   {
>>   	struct drm_device *dev = crtc->dev;
>>   	int pipe = drm_crtc_index(crtc);
>> -	struct drm_vblank_crtc *vblank = drm_vblank_crtc(dev, pipe);
>> +	struct drm_vblank_crtc *vblank = drm_crtc_vblank_crtc(crtc);
>>   	int ret;
>>   	u64 last;
>>   

-- 
Jani Nikula, Intel

  reply	other threads:[~2025-11-11  8:43 UTC|newest]

Thread overview: 61+ 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 [this message]
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
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
2025-11-10 21:11 ` ✓ i915.CI.BAT: success " Patchwork
2025-11-11  2:46 ` ✓ i915.CI.Full: " 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=acce5e2b3827d8dfa12e571f8a4dfef475f7f232@intel.com \
    --to=jani.nikula@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=tzimmermann@suse.de \
    --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 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.