[QUESTION] drmModeAtomicCommit returns -EINVAL on return

Michel Dänzer michel at daenzer.net
Mon Jun 7 08:32:33 UTC 2021


On 2021-06-05 6:06 a.m., Sichem Zhou wrote:
> 
> 1. Is there any way to debug when the functions like drmModeSetCrtc,
> drmModePageFlip and drmModeAtomicCommit returns non zero, besides
> getting the errno?

Enable appropriate debugging bits in /sys/module/drm/parameters/debug, reproduce problem, (disable debugging bits again), check dmesg.


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

There's no need to wait for vblank.


I have to defer to others for your other questions.


-- 
Earthling Michel Dänzer               |               https://redhat.com
Libre software enthusiast             |             Mesa and X developer


More information about the dri-devel mailing list