diff --git a/src/i830_video.c b/src/i830_video.c index 87fa020..ff80cb6 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -2188,6 +2188,19 @@ i830_fill_colorkey (ScreenPtr pScreen, uint32_t key, RegionPtr clipboxes) FreeScratchGC (gc); } +static void +i830_clear_video_buf(ScrnInfoPtr pScrn, i830_memory *buf) +{ + I830Ptr pI830 = I830PTR(pScrn); + + if (pI830->memory_manager) { + drm_intel_bo_map(buf->bo, TRUE); + memset(buf->bo->virtual, 0, buf->size); + drm_intel_bo_unmap(buf->bo); + } else + memset(pI830->FbBase + buf->offset, 0, buf->size); +} + /* * The source rectangle of the video is defined by (src_x, src_y, src_w, src_h). * The dest rectangle of the video is defined by (drw_x, drw_y, drw_w, drw_h). @@ -2396,6 +2409,8 @@ I830PutImage(ScrnInfoPtr pScrn, if (pPriv->buf == NULL) return BadAlloc; + i830_clear_video_buf(pScrn, pPriv->buf); + /* fixup pointers */ #ifdef INTEL_XVMC if (id == FOURCC_XVMC && IS_I915(pI830)) {