aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/xorg/xorg_crtc.c
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2010-03-10 18:33:17 +0100
committerMichel Dänzer <[email protected]>2010-03-10 18:33:17 +0100
commita56da1005d30da60701e33b75d5f4f37096df060 (patch)
tree839d749316482cd858843d51ab2198cece18797b /src/gallium/state_trackers/xorg/xorg_crtc.c
parenta840bf4146b7e06cc94eb59d8265fe6593b232c4 (diff)
parent766d90f1a201d8fd19e49df14d712efbb82223b4 (diff)
Merge branch '7.8'
Diffstat (limited to 'src/gallium/state_trackers/xorg/xorg_crtc.c')
-rw-r--r--src/gallium/state_trackers/xorg/xorg_crtc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c
index 44f7da0f960..7268a79a23d 100644
--- a/src/gallium/state_trackers/xorg/xorg_crtc.c
+++ b/src/gallium/state_trackers/xorg/xorg_crtc.c
@@ -276,7 +276,21 @@ err_bo_destroy:
static void
crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 * image)
{
+ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
modesettingPtr ms = modesettingPTR(crtc->scrn);
+
+ /* Older X servers have cursor reference counting bugs leading to use of
+ * freed memory and consequently random crashes. Should be fixed as of
+ * xserver 1.8, but this workaround shouldn't hurt anyway.
+ */
+ if (config->cursor)
+ config->cursor->refcnt++;
+
+ if (ms->cursor)
+ FreeCursor(ms->cursor, None);
+
+ ms->cursor = config->cursor;
+
if (ms->screen)
crtc_load_cursor_argb_ga3d(crtc, image);
#ifdef HAVE_LIBKMS