diff options
author | Niclas Zeising <zeising@daemonic.se> | 2020-04-14 17:01:57 +0200 |
---|---|---|
committer | Niclas Zeising <zeising@daemonic.se> | 2020-04-14 18:53:26 +0200 |
commit | 3845392426e9798c1fb2a6fc5e97bf5dfd5c443d (patch) | |
tree | 92108d157e3597937c32a8272c827a8f06a88594 /src/radeon_exa.c | |
parent | c0eb5dbd9c1db6b6d5b1574bcd8c584170d7ab54 (diff) |
Fix return value check of drmIoctl()
When the drmModeSetCursor2() call was replaced with bare drmIoctl() call in
92df7097, a bug was introduced. With the use of drmModeSetCursor2(),
the return value from drmIoctl() (which calls ioctl()) were mangled, if
they were negative, they were replaced by -errno by a wrapper function
in xf86drMode.c in libdrm. After replacing drmModeSetCursor2() with the
call to drmIoctl(), this mangling no longer happens, and we need to
explicitly check if the call to drmIoctl() fails, which is indicated by
returning -1, and then why it failed, by checking errno.
If the error indicated by errno is EINVAL, then we can't use the
DRM_IOCTL_MODE_CURSOR2 ioctl(), and need to fall back to the
DRM_IOCTL_MODE_CURSOR ioctl().
This bug can manifest itself by an invisible hw cursor on systems where the
DRM_IOCTL_MODE_CURSOR2 is not implemented by the graphics driver.
Credit also to Alexey Dokuchaev for help with developing the fix and
testing.
This fixes #190
Signed-off-by: Niclas Zeising <zeising@daemonic.se>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Diffstat (limited to 'src/radeon_exa.c')
0 files changed, 0 insertions, 0 deletions