summaryrefslogtreecommitdiff
path: root/src/i830_batchbuffer.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-12-02 14:12:19 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2009-12-02 14:12:19 +0000
commitb68d3646f1fdfe012c16741958c7a62136a9b5aa (patch)
tree25f0ad8411db93fc36efabef39cdc9450041eb0b /src/i830_batchbuffer.c
parent0ff4d42a42b9e537b083343ee7dcc41cb41ae7cf (diff)
Review use of errno after libdrm call
Since drm may not actually set the appropriate errno after a failure, we must use the return code instead when determining the cause of failure. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/i830_batchbuffer.c')
-rw-r--r--src/i830_batchbuffer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c
index 0c755d62..e1537aec 100644
--- a/src/i830_batchbuffer.c
+++ b/src/i830_batchbuffer.c
@@ -32,7 +32,6 @@
#include <assert.h>
#include <stdlib.h>
-#include <errno.h>
#include "xf86.h"
#include "i830.h"
@@ -44,6 +43,7 @@
static void intel_next_batch(ScrnInfoPtr scrn)
{
intel_screen_private *intel = intel_get_screen_private(scrn);
+ int ret;
/* The 865 has issues with larger-than-page-sized batch buffers. */
if (IS_I865G(intel))
@@ -53,8 +53,9 @@ static void intel_next_batch(ScrnInfoPtr scrn)
intel->batch_bo =
dri_bo_alloc(intel->bufmgr, "batch", 4096 * 4, 4096);
- if (dri_bo_map(intel->batch_bo, 1) != 0)
- FatalError("Failed to map batchbuffer: %s\n", strerror(errno));
+ ret = dri_bo_map(intel->batch_bo, 1);
+ if (ret != 0)
+ FatalError("Failed to map batchbuffer: %s\n", strerror(-ret));
intel->batch_used = 0;
intel->batch_ptr = intel->batch_bo->virtual;