From 98e8f452929f09ff64db6ca1afa3decb4f0a1206 Mon Sep 17 00:00:00 2001 From: Stuart Bennett Date: Fri, 16 Jan 2009 22:26:28 +0000 Subject: [PATCH] xv: return BadAlloc if destination pixmap is not put into EXA offscreen (#15792) Lets the player get X errors, instead of the card choking trying to do system memory addresses --- src/nouveau_xv.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/nouveau_xv.c b/src/nouveau_xv.c index d42032e..7cfeae8 100644 --- a/src/nouveau_xv.c +++ b/src/nouveau_xv.c @@ -924,6 +924,8 @@ NV_set_action_flags(ScrnInfoPtr pScrn, DrawablePtr pDraw, NVPortPrivPtr pPriv, { PixmapPtr ppix = NVGetDrawablePixmap(pDraw); + /* this is whether ppix is in the viewable fb, not related to + the EXA "offscreen" stuff */ if (!NVExaPixmapIsOnscreen(ppix)) *action_flags &= ~USE_OVERLAY; } @@ -1416,6 +1418,16 @@ CPU_copy: /* Ensure pixmap is in offscreen memory */ exaMoveInPixmap(ppix); + + /* check if it made it offscreen */ +#if NOUVEAU_EXA_PIXMAPS + if (!pNv->EXADriverPtr->PixmapIsOffscreen(ppix)) +#else + if (exaGetPixmapOffset(ppix) >= pNv->FB->size) +#endif + /* we lost, insufficient space probably */ + return BadAlloc; + ExaOffscreenMarkUsed(ppix); #ifdef COMPOSITE -- 1.6.0.2