[QUESTION] drmModeAtomicCommit returns -EINVAL on return

Sichem Zhou sichem.zh at gmail.com
Sat Jun 5 04:06:17 UTC 2021


Hi,

Sorry to post usage questions here, but I didn't find a better place.

I used libdrm for my wayland based compositor, it generally works but
I've been experiencing hiccups here and there. I have a few questions.
Most of them are generic and one of them is specific.

1. Is there any way to debug when the functions like drmModeSetCrtc,
drmModePageFlip and drmModeAtomicCommit returns non zero, besides
getting the errno?

2. Do I need to attach a 0 fb_id and 0 crtc_id if I intend to
deactivate the connector? It seems I don't need to do it in legacy drm
code, and I am required to do it using atomic functions.

3. I tried what I described above for returning to tty, however I got
-ENIVAL on return(maybe it is because I didn't wait for vblank).

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?

Is it actually valid to set a 0 crtc_id for connector and 0 fb_id for crtc?

Sorry I didn't place the actual code here, my application is already
rather complex and a lot of abstraction on top of it.

Best regards,
Sichem


More information about the dri-devel mailing list