Make the assertions guarding syscalls (drmIoctl in particular) verbose

Currently all we see is gem_read: ret == 0 failed, where it would help
to see the errno and/or the ret.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson
2012-03-29 12:45:59 +01:00
parent 9dbce0991f
commit b7bd1837cc
3 changed files with 23 additions and 29 deletions
+3 -5
View File
@@ -32,6 +32,7 @@
#include <assert.h>
#include "drm.h"
#include "drmtest.h"
#include "intel_batchbuffer.h"
#include "intel_bufmgr.h"
#include "intel_chipset.h"
@@ -78,7 +79,6 @@ void
intel_batchbuffer_flush_on_ring(struct intel_batchbuffer *batch, int ring)
{
unsigned int used = batch->ptr - batch->buffer;
int ret;
if (used == 0)
return;
@@ -101,13 +101,11 @@ intel_batchbuffer_flush_on_ring(struct intel_batchbuffer *batch, int ring)
batch->ptr += 4;
used = batch->ptr - batch->buffer;
ret = drm_intel_bo_subdata(batch->bo, 0, used, batch->buffer);
assert(ret == 0);
do_or_die(drm_intel_bo_subdata(batch->bo, 0, used, batch->buffer));
batch->ptr = NULL;
ret = drm_intel_bo_mrb_exec(batch->bo, used, NULL, 0, 0, ring);
assert(ret == 0);
do_or_die(drm_intel_bo_mrb_exec(batch->bo, used, NULL, 0, 0, ring));
intel_batchbuffer_reset(batch);
}