summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2008-02-26 09:19:27 +0100
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2008-02-26 09:19:27 +0100
commit32879e14610906c23b3ca874ba7234370132d76c (patch)
tree18cff45e98e7449df7328f29b0006e2a722e8371
parentf1c82bf9a4d248389ea5a558575e566d17dbd9d8 (diff)
[intel] Handle -EAGAINs correctly in execbuffer.
Dont stop on fence creation errors.
-rw-r--r--src/mesa/drivers/dri/intel/intel_ioctl.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_ioctl.c b/src/mesa/drivers/dri/intel/intel_ioctl.c
index c8f70ae478..66e36102b9 100644
--- a/src/mesa/drivers/dri/intel/intel_ioctl.c
+++ b/src/mesa/drivers/dri/intel/intel_ioctl.c
@@ -155,6 +155,7 @@ intel_exec_ioctl(struct intel_context *intel,
{
struct drm_i915_execbuffer execbuf;
dri_fence *fo;
+ int ret;
assert(intel->locked);
assert(used);
@@ -179,13 +180,27 @@ intel_exec_ioctl(struct intel_context *intel,
execbuf.ops_list = (unsigned long)start; // TODO
execbuf.fence_arg.flags = DRM_FENCE_FLAG_SHAREABLE | DRM_I915_FENCE_FLAG_FLUSHED;
- if (drmCommandWriteRead(intel->driFd, DRM_I915_EXECBUFFER, &execbuf,
- sizeof(execbuf))) {
+ do {
+ ret = drmCommandWriteRead(intel->driFd, DRM_I915_EXECBUFFER, &execbuf,
+ sizeof(execbuf));
+ } while (ret == -EAGAIN);
+
+ if (ret != 0) {
fprintf(stderr, "DRM_I915_EXECBUFFER: %d\n", -errno);
UNLOCK_HARDWARE(intel);
exit(1);
}
+ if (execbuf.fence_arg.error != 0) {
+
+ /*
+ * Fence creation has failed, but the GPU has been
+ * idled by the kernel. Safe to continue.
+ */
+
+ *fence = NULL;
+ return;
+ }
fo = intel_ttm_fence_create_from_arg(intel->bufmgr, "fence buffers",
&execbuf.fence_arg);