summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-08-04 09:51:34 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-08-04 09:51:34 +0100
commit6c7d105ccae32fba49a07a03b726cc3fe2de3d27 (patch)
tree2cfb75d38eb55da4b7a729d657216706248d3bbf /src
parent38f940dfea494d3093236f065392c431be06ae6e (diff)
display: Handle cursor error paths.
Check that the cursor was allocated before freeing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/intel_display.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/intel_display.c b/src/intel_display.c
index bdf5b6c9..e39bccbe 100644
--- a/src/intel_display.c
+++ b/src/intel_display.c
@@ -468,7 +468,6 @@ intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
struct intel_crtc *intel_crtc = crtc->driver_private;
int ret;
- /* cursor should be mapped already */
ret = dri_bo_subdata(intel_crtc->cursor, 0, 64*64*4, image);
if (ret)
xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
@@ -612,8 +611,11 @@ intel_crtc_destroy(xf86CrtcPtr crtc)
{
struct intel_crtc *intel_crtc = crtc->driver_private;
- drm_intel_bo_unreference(intel_crtc->cursor);
- intel_crtc->cursor = NULL;
+ if (intel_crtc->cursor) {
+ drmModeSetCursor(intel_crtc->mode->fd, crtc_id(intel_crtc), 0, 64, 64);
+ drm_intel_bo_unreference(intel_crtc->cursor);
+ intel_crtc->cursor = NULL;
+ }
list_del(&intel_crtc->link);
free(intel_crtc);
@@ -661,7 +663,6 @@ intel_crtc_init(ScrnInfoPtr scrn, struct intel_mode *mode, int num)
intel_crtc->cursor = drm_intel_bo_alloc(intel->bufmgr, "ARGB cursor",
HWCURSOR_SIZE_ARGB,
GTT_PAGE_SIZE);
- drm_intel_bo_disable_reuse(intel_crtc->cursor);
intel_crtc->crtc = crtc;
list_add(&intel_crtc->link, &mode->crtcs);