From c1755599db1d9a20954b84ccc07afd892bb6ac9e Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Thu, 2 Jul 2009 13:04:51 -0700 Subject: Clear the bo on the rotate scratch pixmap Since the scratch pixmap header will be re-used after allocation, we need to clear its bo attachment when we stop using it, otherwise a later user will use a bogus bo. Reviewed-by: Keith Packard Signed-off-by: Jesse Barnes --- src/drmmode_display.c | 4 +++- src/i830_display.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index d5904ad5..e9296dce 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -382,8 +382,10 @@ drmmode_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *dat drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; - if (rotate_pixmap) + if (rotate_pixmap) { + i830_set_pixmap_bo(rotate_pixmap, NULL); FreeScratchPixmapHeader(rotate_pixmap); + } if (data) { diff --git a/src/i830_display.c b/src/i830_display.c index 26874c5c..59ededcf 100644 --- a/src/i830_display.c +++ b/src/i830_display.c @@ -1966,8 +1966,10 @@ i830_crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data) ScrnInfoPtr pScrn = crtc->scrn; I830CrtcPrivatePtr intel_crtc = crtc->driver_private; - if (rotate_pixmap) + if (rotate_pixmap) { + i830_set_pixmap_bo(rotate_pixmap, NULL); FreeScratchPixmapHeader(rotate_pixmap); + } if (data) { /* Be sure to sync acceleration before the memory gets unbound. */ -- cgit v1.2.3