GLuint used, GLboolean allow_unlock)
{
struct intel_context *intel = batch->intel;
+ int ret = 0;
dri_bo_unmap(batch->buf);
struct drm_i915_gem_execbuffer *execbuf;
execbuf = dri_process_relocs(batch->buf);
- intel_exec_ioctl(batch->intel,
- used,
- batch->cliprect_mode != LOOP_CLIPRECTS,
- allow_unlock,
- execbuf);
+ ret = intel_exec_ioctl(batch->intel,
+ used,
+ batch->cliprect_mode != LOOP_CLIPRECTS,
+ allow_unlock,
+ execbuf);
} else {
dri_process_relocs(batch->buf);
- intel_batch_ioctl(batch->intel,
- batch->buf->offset,
- used,
- batch->cliprect_mode != LOOP_CLIPRECTS,
- allow_unlock);
+ ret = intel_batch_ioctl(batch->intel,
+ batch->buf->offset,
+ used,
+ batch->cliprect_mode != LOOP_CLIPRECTS,
+ allow_unlock);
}
}
intel->vtbl.debug_batch(intel);
}
+ if (ret != 0) {
+ UNLOCK_HARDWARE(intel);
+ exit(1);
+ }
intel->vtbl.new_batch(intel);
}
}
-void
+int
intel_batch_ioctl(struct intel_context *intel,
GLuint start_offset,
GLuint used,
struct drm_i915_batchbuffer batch;
if (intel->no_hw)
- return;
+ return 0;
assert(intel->locked);
assert(used);
if (drmCommandWrite(intel->driFd, DRM_I915_BATCHBUFFER, &batch,
sizeof(batch))) {
fprintf(stderr, "DRM_I915_BATCHBUFFER: %d\n", -errno);
- UNLOCK_HARDWARE(intel);
- exit(1);
+ return -errno;
}
+
+ return 0;
}
-void
+int
intel_exec_ioctl(struct intel_context *intel,
GLuint used,
GLboolean ignore_cliprects, GLboolean allow_unlock,
assert(used);
if (intel->no_hw)
- return;
+ return 0;
execbuf->batch_start_offset = 0;
execbuf->batch_len = used;
if (ret != 0) {
fprintf(stderr, "DRM_I915_GEM_EXECBUFFER: %d\n", -errno);
- UNLOCK_HARDWARE(intel);
- exit(1);
+ return -errno;
}
+
+ return 0;
}
void intelWaitIrq( struct intel_context *intel, int seq );
int intelEmitIrqLocked( struct intel_context *intel );
-void intel_batch_ioctl( struct intel_context *intel,
- GLuint start_offset,
- GLuint used,
- GLboolean ignore_cliprects,
- GLboolean allow_unlock );
-void intel_exec_ioctl(struct intel_context *intel,
+int intel_batch_ioctl(struct intel_context *intel,
+ GLuint start_offset,
GLuint used,
- GLboolean ignore_cliprects, GLboolean allow_unlock,
- struct drm_i915_gem_execbuffer *execbuf);
+ GLboolean ignore_cliprects,
+ GLboolean allow_unlock);
+int intel_exec_ioctl(struct intel_context *intel,
+ GLuint used,
+ GLboolean ignore_cliprects, GLboolean allow_unlock,
+ struct drm_i915_gem_execbuffer *execbuf);
#endif