On Tue, 11 Nov 2025, Thomas Zimmermann <[email protected]> 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 <[email protected]>
>
> Reviewed-by: Thomas Zimmermann <[email protected]>
>
> 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