[QUESTION] drmModeAtomicCommit returns -EINVAL on return

Daniel Vetter daniel at ffwll.ch
Tue Jun 8 15:34:54 UTC 2021


> > 4. Do I need to wait for vblank for modesetting? I know it will be an
> > error if I tried to do drmModePageFlip before the last one is handled
> > but what about drmModeSetCrtc? Do I need to wait for a vblank for the
> > last pageflip?
>
> Right now, if you don't wait for any pending page flip to complete before
> drmModeSetCrtc, the two may race, and the CRTC may end up scanning out from the FB set by the page flip.
>
> Maybe this race should be prevented in the kernel though.

Maybe this could happen on non-atomic drivers, but on atomic drivers
there's no race, the setcrtc will wait for the previous pageflip to
complete first. Ofc if you call both from 2 threads at the same time
then either could win, but if you do one after the other there's no
ordering issues with atomic drivers.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch


More information about the dri-devel mailing list