summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-05-17 15:14:55 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-05-17 15:14:55 +0100
commit723cc45b2707aa160eac6d5b56a20e19cc42c8a3 (patch)
tree2e40dd0905b34b2ff88dba02b5571c4d8c812f1d
parent2c00297bc3b4969f28e2eb19bce36ece50ce4ccb (diff)
dri: Check error code from GetScratchGC()
It may fail so be prepared, and do use the right drawable! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/i830_dri.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 7ba91661..15aafdd7 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -302,7 +302,10 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion,
RegionPtr pCopyClip;
GCPtr gc;
- gc = GetScratchGC(drawable->depth, screen);
+ gc = GetScratchGC(dst->depth, screen);
+ if (!gc)
+ return;
+
pCopyClip = REGION_CREATE(screen, NULL, 0);
REGION_COPY(screen, pCopyClip, pRegion);
(*gc->funcs->ChangeClip) (gc, CT_REGION, pCopyClip, 0);
@@ -390,12 +393,12 @@ I830DRI2CopyRegion(DrawablePtr drawable, RegionPtr pRegion,
*
* We can't rely on getting into the block handler before the DRI
* client gets to run again so flush now. */
+ intel_batch_emit_flush(scrn);
intel_batch_submit(scrn);
#if ALWAYS_SYNC
intel_sync(scrn);
#endif
drmCommandNone(intel->drmSubFD, DRM_I915_GEM_THROTTLE);
-
}
#if DRI2INFOREC_VERSION >= 4