Hi

Am 15.05.26 um 18:56 schrieb Michel Dänzer:
[ Adding the wayland-devel list for awareness ]

On 5/15/26 17:12, Michel Dänzer wrote:
On 5/15/26 13:55, Thomas Zimmermann wrote:
DRM's WAIT_VBLANK ioctl synchronizes user-space clients to display
refresh. This is meaningless with vblank timers, which run unrelated
to the hardware's vblank.

Disable the ioctl for simulated vblanks. Set DRM_VBLANK_FLAG_SIMULATED
for CRTCs with simulated vblank events in all such drivers. The vblank
timers of these devices still rate-limit the number of page-flip events
to match the display refresh.

According to maintainers, user-space compositors do not require the ioctl
for rate-limitting display output. Weston and Kwin rely on page-flip
events. Mutter uses and internal timer to limit the number of display
updates per second.
Actually mutter fundamentally relies on atomic commit completion events for that, 
same as Weston & KWin. Mutter uses the WAIT_VBLANK ioctl only for minimizing 
input → output latency (which can hide issues when completion of atomic commits 
isn't properly throttled).


(Just a side not on the cover letter, no objections to the patches themselves)
After more discussion on IRC, I have some concerns.


The big one first: For drivers with no strict refresh cycle (i.e. an atomic commit can 
take effect more or less anytime after at least one "refresh cycle" has passed 
since the last one), does this change really make sense / what's the actual benefit?

I don't have a strong opinion on that matter. I just think we should clarify the meaning of these ioctls.

Timing page flip is currently not supported on any driver without hardware vblank IRQ or a vblank timer. The situation might vary among compositors, but there have been plenty of reports of animation and frame rates either being too high or too low. So I think we should rollout vblank timers for all drivers without hardware vblank IRQ.

Right now, vblank timers act like a vblank IRQ in these ioctls. That's a convenient position for user space.

But we don't really sync anything with hardware here, so the alternate proposal is to not support them.  This also appears to be the original intention of these ioctls.  Vblank timers would just limit the internal page-flip rate, but nothing else. That's the more defensive approach. I'd prefer this, as it does not give out guarantees to user space that future drivers might not be able to fulfill.





In the case of the asahi & nvidia drivers, the problem with exposing this 
functionality to user space is that if the timestamps aren't accurate, it can 
result in missing display refresh cycles, which are dictated by hardware. That's 
why it makes sense to reject it there.

When there's no strict refresh cycle, that issue doesn't apply though.


Any changes made to the WAIT_VBLANK ioctl should also be made to the 
CRTC_GET_SEQUENCE / CRTC_QUEUE_SEQUENCE ioctls, which are slightly different 
UAPI for the same functionality.

I'll send out an update with that fixed in a bit.

Best regards
Thomas





--
--
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)


Reply via email to