GNOME Bugzilla – Bug 770020
wayland mutter hw mouse cursor invisible
Last modified: 2017-03-29 03:17:52 UTC
When starting mutter (from tty1 as wayland display manager) hardware cursor is invisible. Issue seems to be in set_crtc_cursor function, where drmModeSetCursor2 fails with the error: drmModeSetCursor2 failed: No such device or address IRC log: jadahl> memeka: good to know. I guess it would be good to trigger the texture based falback if that happens
Created attachment 348676 [details] [review] cursor-renderer-native: fallback to texture cursor As discussed with Carlos over IRC, this patch triggers the fallback texture cursor in case drmModeSetCursor2 fails.
Review of attachment 348676 [details] [review]: ::: src/backends/native/meta-cursor-renderer-native.c @@ +189,3 @@ + priv->cursor_width, priv->cursor_height, hot_x, hot_y) < 0) + { + priv->has_hw_cursor = FALSE; As we can (probably, I'd say) assume that drmModeSetCursor2() will not work at all, we should also make sure we don't try to memcpy every cursor into a gbm buffer then fail to syscall-set it each time after this. Because, with this, we'd still try every single time, then fail every single time. So, to avoid the future known failed syscalls, and wasted allocs and memcpys, you can add a "broken" state to the priv, and check that state in should_have_hw_cursor() and ..._realize().
Created attachment 348815 [details] [review] cursor-renderer-native: fallback to texture cursor As discussed with Carlos over IRC, this patch triggers the fallback texture cursor in case drmModeSetCursor2 fails. As suggested by Jonas, it adds a `broken` state, that is checked in should_have_hw_cursor() and meta_cursor_renderer_native_realize_cursor_from_*() to avoid copying every cursor into a gbm buffer when we know it will fail every single time.
Created attachment 348816 [details] [review] cursor-renderer-native: fallback to texture cursor Previous patch doesn't build; it doesn't contain my last change. As discussed with Carlos over IRC, this patch triggers the fallback texture cursor in case drmModeSetCursor2 fails. As suggested by Jonas, it adds a `broken` state, that is checked in should_have_hw_cursor() and meta_cursor_renderer_native_realize_cursor_from_*() to avoid copying every cursor into a gbm buffer when we know it will fail every single time.
Review of attachment 348816 [details] [review]: Looks good. A bonus follow up would be to clean up the gbm buffers now already, but this will AFAICS fix the issue. Could also consider adding a g_warning() there, to make the user potentially aware that their cursor is not drawn with the cursor plane.
Since you marked the patch as accepted-commit_now, can I / am I expected to make these changes?
I suspect you don't have commit access to mutter at this stage, so I'll land them for you.
Indeed I don't, thanks for merging them for me!
Attachment 348816 [details] pushed (with a minor whitespace change) as 0d5274b - cursor-renderer-native: fallback to texture cursor