xf86-video-amdgpu: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed May 27 15:40:20 UTC 2020


 src/drmmode_display.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 680b9a2976f9eb8010c8160c425c2194fb5429d1
Author: Niclas Zeising <zeising at daemonic.se>
Date:   Wed Apr 15 10:34:32 2020 +0200

    Fix return value check of drmIoctl()
    
    When the drmModeSetCursor2() call was replaced with bare drmIoctl() call in
    b344e155, 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.
    
    Signed-off-by: Niclas Zeising <zeising at daemonic.se>

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 1fcc252..09649dd 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1784,7 +1784,7 @@ static void drmmode_show_cursor(xf86CrtcPtr crtc)
 		arg.hot_y = yhot;
 
 		ret = drmIoctl(pAMDGPUEnt->fd, DRM_IOCTL_MODE_CURSOR2, &arg);
-		if (ret == -EINVAL)
+		if (ret == -1 && errno == EINVAL)
 			use_set_cursor2 = FALSE;
 		else
 			return;


More information about the xorg-commit mailing list