xf86-video-intel: src/sna/gen2_render.c src/sna/sna_dri.c src/sna/sna_render.c
Chris Wilson
ickle at kemper.freedesktop.org
Fri Sep 27 11:52:58 PDT 2013
src/sna/gen2_render.c | 3 +++
src/sna/sna_dri.c | 4 ++--
src/sna/sna_render.c | 16 +++++++++-------
3 files changed, 14 insertions(+), 9 deletions(-)
New commits:
commit 2893d2b51653cc254000454ad054cd9f0afb1291
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Sep 27 19:52:30 2013 +0100
sna: Fix regression in picture extraction
This is a little helper function, that just returns a bool, not the
error code used by the render backends. Instead the caller tries an
alternative method of extraction before giving up.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index 385a5fd..9ae8352 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -264,6 +264,8 @@ gen2_emit_texture(struct sna *sna,
uint32_t texcoordtype;
uint32_t filter;
+ assert(channel->bo);
+
if (channel->is_affine)
texcoordtype = TEXCOORDTYPE_CARTESIAN;
else
@@ -2569,6 +2571,7 @@ gen2_render_composite_spans(struct sna *sna,
case 1:
break;
}
+ assert(tmp->base.src.bo || tmp->base.src.is_solid);
tmp->prim_emit = gen2_emit_composite_spans_primitive;
tmp->base.floats_per_vertex = 3;
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index a009d3e..00a65a9 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -1148,8 +1148,8 @@ can_flip(struct sna * sna,
pixmap = get_window_pixmap(win);
if (pixmap != sna->front) {
- DBG(("%s: no, window is not attached to the front buffer\n",
- __FUNCTION__));
+ DBG(("%s: no, window (pixmap=%ld) is not attached to the front buffer (pixmap=%ld)\n",
+ __FUNCTION__, pixmap->drawable.serialNumber, sna->front->drawable.serialNumber));
return false;
}
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 73d53ba..c023629 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -897,8 +897,10 @@ sna_render_pixmap_partial(struct sna *sna,
DBG(("%s (%d, %d)x(%d, %d), pitch %d, max %d\n",
__FUNCTION__, x, y, w, h, bo->pitch, sna->render.max_3d_pitch));
- if (bo->pitch > sna->render.max_3d_pitch)
+ if (bo->pitch > sna->render.max_3d_pitch) {
+ DBG(("%s: pitch too great %d > %d\n", __FUNCTION__, bo->pitch, sna->render.max_3d_pitch));
return false;
+ }
box.x1 = x;
box.y1 = y;
@@ -981,7 +983,7 @@ sna_render_pixmap_partial(struct sna *sna,
return true;
}
-static int
+static bool
sna_render_picture_partial(struct sna *sna,
PicturePtr picture,
struct sna_composite_channel *channel,
@@ -1033,14 +1035,14 @@ sna_render_picture_partial(struct sna *sna,
priv = sna_pixmap_force_to_gpu(pixmap,
MOVE_READ | MOVE_SOURCE_HINT);
if (priv == NULL)
- return 0;
+ return false;
bo = priv->gpu_bo;
}
if (bo->pitch > sna->render.max_3d_pitch) {
DBG(("%s: pitch too great %d > %d\n", __FUNCTION__, bo->pitch, sna->render.max_3d_pitch));
- return -1;
+ return false;
}
if (bo->tiling) {
@@ -1076,14 +1078,14 @@ sna_render_picture_partial(struct sna *sna,
if (w <= 0 || h <= 0 ||
w > sna->render.max_3d_size ||
h > sna->render.max_3d_size)
- return 0;
+ return false;
/* How many tiles across are we? */
channel->bo = kgem_create_proxy(&sna->kgem, bo,
box.y1 * bo->pitch + offset,
h * bo->pitch);
if (channel->bo == NULL)
- return 0;
+ return false;
if (channel->transform) {
memset(&channel->embedded_transform,
@@ -1109,7 +1111,7 @@ sna_render_picture_partial(struct sna *sna,
channel->scale[1] = 1.f/h;
channel->width = w;
channel->height = h;
- return 1;
+ return true;
}
int
More information about the xorg-commit
mailing list