summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-09-01 10:44:24 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-09-01 10:44:50 +0100
commitc4d994014160d8c946af731196a908991c77d9f9 (patch)
treea8672fbaf2c761db3f5e72b6c79bde9b0eeda513 /src
parent25c1b478a957ceb0474e7121840b7eed1ba2e140 (diff)
sna/gen2+: Add the missing assertions in case the drawrect is invalid
Only the later gen had these useful assertions, add them to the rest just in case. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/gen2_render.c1
-rw-r--r--src/sna/gen3_render.c2
-rw-r--r--src/sna/gen4_render.c3
3 files changed, 6 insertions, 0 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index d2f6fe74..7d518232 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -543,6 +543,7 @@ gen2_get_batch(struct sna *sna)
static void gen2_emit_target(struct sna *sna, const struct sna_composite_op *op)
{
+ assert(!too_large(op->dst.width, op->dst.height));
assert(op->dst.bo->pitch >= 8 && op->dst.bo->pitch <= MAX_3D_PITCH);
assert(sna->render_state.gen2.vertex_offset == 0);
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index ab94bdbf..c5ec9bcb 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -1341,6 +1341,8 @@ static void gen3_emit_target(struct sna *sna,
{
struct gen3_render_state *state = &sna->render_state.gen3;
+ assert(!too_large(width, height));
+
/* BUF_INFO is an implicit flush, so skip if the target is unchanged. */
assert(bo->unique_id != 0);
if (bo->unique_id != state->current_dst) {
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index e7328101..d8b76a15 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -1283,6 +1283,9 @@ gen4_emit_drawing_rectangle(struct sna *sna, const struct sna_composite_op *op)
uint32_t limit = (op->dst.height - 1) << 16 | (op->dst.width - 1);
uint32_t offset = (uint16_t)op->dst.y << 16 | (uint16_t)op->dst.x;
+ assert(!too_large(op->dst.x, op->dst.y));
+ assert(!too_large(op->dst.width, op->dst.height));
+
if (sna->render_state.gen4.drawrect_limit == limit &&
sna->render_state.gen4.drawrect_offset == offset)
return;