Commit 6afed33b authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Chris Wilson
Browse files

sna: Switch back to hwcursor on the next cursor update

Once we've switched to using the swcursor (possibly
due to the cursor ioctl failing) we currently keep
using the swcursor until the modeset.

That's not particularly great as the swcursor has several
issues. Apart from the (presumably expected) flicker,
the cursor also tends to leave horrible trails behind
around dri2/3 windows (happens with tearfree at least).

To avoid some of that let's try to switch back to the hwcursor
a bit sooner. We can do that neatly via the convenient swcursor
block handler.

v2 [ickle]: Apply the restoration after the screen update is complete.
v3 [vsyrjala]: Push it back to restore_swcursor and remove the
fullscreen redraw -- prevents terrible flickering in v2!

References: https://bugs.freedesktop.org/show_bug.cgi?id=106935

Signed-off-by: Ville Syrjälä's avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
parent a63b6a22
...@@ -6286,23 +6286,15 @@ sna_realize_cursor(xf86CursorInfoPtr info, CursorPtr cursor) ...@@ -6286,23 +6286,15 @@ sna_realize_cursor(xf86CursorInfoPtr info, CursorPtr cursor)
return NULL; return NULL;
} }
static void enable_fb_access(ScrnInfoPtr scrn, int state)
{
scrn->EnableDisableFBAccess(
#ifdef XF86_HAS_SCRN_CONV
scrn,
#else
scrn->scrnIndex,
#endif
state);
}
static void __restore_swcursor(ScrnInfoPtr scrn) static void __restore_swcursor(ScrnInfoPtr scrn)
{ {
struct sna *sna = to_sna(scrn);
DBG(("%s: attempting to restore SW cursor\n", __FUNCTION__)); DBG(("%s: attempting to restore SW cursor\n", __FUNCTION__));
enable_fb_access(scrn, FALSE); xf86CursorResetCursor(scrn->pScreen);
enable_fb_access(scrn, TRUE);
/* Try to switch back to the HW cursor on the next cursor update */
sna->cursor.disable = false;
RemoveBlockAndWakeupHandlers((void *)__restore_swcursor, RemoveBlockAndWakeupHandlers((void *)__restore_swcursor,
(void *)NoopDDA, (void *)NoopDDA,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment