nv50,nvc0: avoid doing work inside of an assert
authorIlia Mirkin <imirkin@alum.mit.edu>
Mon, 5 Jan 2015 05:17:26 +0000 (00:17 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Mon, 5 Jan 2015 05:34:33 +0000 (00:34 -0500)
assert is compiled out in release builds - don't put logic into it. Note
that this particular instance is only used for vp debugging and is
normally compiled out.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/gallium/drivers/nouveau/nv50/nv98_video_vp.c
src/gallium/drivers/nouveau/nvc0/nvc0_video_vp.c

index e74abe2..7780a17 100644 (file)
@@ -44,7 +44,8 @@ static void dump_comm_vp(struct nouveau_vp3_decoder *dec, struct comm *comm, u32
 
        if ((comm->pvp_stage & 0xff) != 0xff) {
                unsigned *map;
-               assert(nouveau_bo_map(inter_bo, NOUVEAU_BO_RD|NOUVEAU_BO_NOBLOCK, dec->client) >= 0);
+               int ret = nouveau_bo_map(inter_bo, NOUVEAU_BO_RD|NOUVEAU_BO_NOBLOCK, dec->client);
+               assert(ret >= 0);
                map = inter_bo->map;
                for (i = 0; i < comm->byte_ofs + slice_size; i += 0x10) {
                        debug_printf("%05x: %08x %08x %08x %08x\n", i, map[i/4], map[i/4+1], map[i/4+2], map[i/4+3]);
index 33c7375..28bcb62 100644 (file)
@@ -44,7 +44,8 @@ static void dump_comm_vp(struct nouveau_vp3_decoder *dec, struct comm *comm, u32
 
        if ((comm->pvp_stage & 0xff) != 0xff) {
                unsigned *map;
-               assert(nouveau_bo_map(inter_bo, NOUVEAU_BO_RD|NOUVEAU_BO_NOBLOCK, dec->client) >= 0);
+               int ret = nouveau_bo_map(inter_bo, NOUVEAU_BO_RD|NOUVEAU_BO_NOBLOCK, dec->client);
+               assert(ret >= 0);
                map = inter_bo->map;
                for (i = 0; i < comm->byte_ofs + slice_size; i += 0x10) {
                        debug_printf("%05x: %08x %08x %08x %08x\n", i, map[i/4], map[i/4+1], map[i/4+2], map[i/4+3]);