cursor-rendere-native: Don't declare HW cursors broken on EACCES

Don't permanently fall back to OpenGL based cursor rendering when
setting the HW cursor fails with EACCES as that may happen on VT
switching and other things temporarily revoking fd access.

https://bugzilla.gnome.org/show_bug.cgi?id=785381
This commit is contained in:
Jonas Ådahl 2017-07-24 11:44:57 +08:00
parent 406359bba1
commit 3244ed37a9

View File

@ -200,6 +200,8 @@ set_crtc_cursor (MetaCursorRendererNative *native,
if (drmModeSetCursor2 (priv->drm_fd, crtc->crtc_id, handle.u32,
priv->cursor_width, priv->cursor_height,
hot_x, hot_y) < 0)
{
if (errno != EACCES)
{
g_warning ("drmModeSetCursor2 failed with (%s), "
"drawing cursor with OpenGL from now on",
@ -207,6 +209,7 @@ set_crtc_cursor (MetaCursorRendererNative *native,
priv->has_hw_cursor = FALSE;
priv->hw_cursor_broken = TRUE;
}
}
if (cursor_priv->pending_bo_state == META_CURSOR_GBM_BO_STATE_SET)
{