summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/i830.h1
-rw-r--r--src/i830_driver.c2
-rw-r--r--src/i830_video.c3
3 files changed, 5 insertions, 1 deletions
diff --git a/src/i830.h b/src/i830.h
index b252f56c..5772f1d2 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -431,6 +431,7 @@ typedef struct _I830Rec {
#ifdef I830_XV
/* For Xvideo */
i830_memory *overlay_regs;
+ void *offscreenImages; /**< remembered memory block for release */
#endif
#ifdef INTEL_XVMC
/* For XvMC */
diff --git a/src/i830_driver.c b/src/i830_driver.c
index f1ea5115..2249a990 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -3700,6 +3700,8 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
#ifdef I830_XV
i965_free_video(pScrn);
+ free(pI830->offscreenImages);
+ pI830->offscreenImages = NULL;
#endif
dri_bufmgr_destroy(pI830->bufmgr);
diff --git a/src/i830_video.c b/src/i830_video.c
index a62d7a13..f73c1f7f 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -2886,11 +2886,12 @@ I830InitOffscreenImages(ScreenPtr pScreen)
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn);
- /* need to free this someplace */
if (!(offscreenImages = xalloc(sizeof(XF86OffscreenImageRec)))) {
return;
}
+ pI830->offscreenImages = offscreenImages;
+
offscreenImages[0].image = &Images[0];
offscreenImages[0].flags = VIDEO_OVERLAID_IMAGES /*| VIDEO_CLIP_TO_VIEWPORT*/;
offscreenImages[0].alloc_surface = I830AllocateSurface;