summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-15 18:18:19 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-15 18:19:18 +0000
commit19c184b7e4f8de747ed6fb1f6f910238193cf2a1 (patch)
tree4ca4c4e94aeed0fd9d3b379c3a384295e5285d1b
parente68a8748f3418179eb41e8d81ba1050b883b7e47 (diff)
sna/gen3: Check for upload failure of video bo
And propagate that failure back to the client. Reported-by: Paul Neumann <paul104x@yahoo.de> References: https://bugs.freedesktop.org/show_bug.cgi?id=43716 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen3_render.c2
-rw-r--r--src/sna/sna_video_textured.c13
2 files changed, 10 insertions, 5 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index 89cd4bd1..7151e125 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -3410,6 +3410,8 @@ gen3_render_video(struct sna *sna,
DBG(("%s: %dx%d -> %dx%d\n", __FUNCTION__, src_w, src_h, drw_w, drw_h));
dst_bo = sna_pixmap_get_bo(pixmap);
+ if (dst_bo == NULL)
+ return FALSE;
if (pixmap->drawable.width > 2048 ||
pixmap->drawable.height > 2048 ||
diff --git a/src/sna/sna_video_textured.c b/src/sna/sna_video_textured.c
index 8531fc6b..ba0e146c 100644
--- a/src/sna/sna_video_textured.c
+++ b/src/sna/sna_video_textured.c
@@ -227,6 +227,7 @@ sna_video_textured_put_image(ScrnInfoPtr scrn,
BoxRec dstBox;
xf86CrtcPtr crtc;
Bool flush = false;
+ Bool ret;
if (!sna_pixmap(pixmap))
return BadAlloc;
@@ -265,10 +266,12 @@ sna_video_textured_put_image(ScrnInfoPtr scrn,
flush = sna_wait_for_scanline(sna, pixmap, crtc,
&clip->extents);
- sna->render.video(sna, video, &frame, clip,
- src_w, src_h,
- drw_w, drw_h,
- pixmap);
+ ret = Success;
+ if (!sna->render.video(sna, video, &frame, clip,
+ src_w, src_h,
+ drw_w, drw_h,
+ pixmap))
+ ret = BadAlloc;
kgem_bo_destroy(&sna->kgem, frame.bo);
@@ -280,7 +283,7 @@ sna_video_textured_put_image(ScrnInfoPtr scrn,
if (flush)
kgem_submit(&sna->kgem);
- return Success;
+ return ret;
}
static int