You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

libdrm-nouveau-restart-pushbuf.patch 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. From 67628aa39dd74807989492af5451a3a5c0232e39 Mon Sep 17 00:00:00 2001
  2. From: Ben Skeggs <bskeggs@redhat.com>
  3. Date: Tue, 20 Oct 2009 12:57:46 +1000
  4. Subject: [PATCH] nouveau: retry if pushbuf ioctl interrupted by signal
  5. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  6. ---
  7. libdrm/nouveau/nouveau_pushbuf.c | 6 ++++++
  8. 1 files changed, 6 insertions(+), 0 deletions(-)
  9. diff --git a/libdrm/nouveau/nouveau_pushbuf.c b/libdrm/nouveau/nouveau_pushbuf.c
  10. index 1192e22..fbcddd7 100644
  11. --- a/libdrm/nouveau/nouveau_pushbuf.c
  12. +++ b/libdrm/nouveau/nouveau_pushbuf.c
  13. @@ -270,6 +270,7 @@ nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
  14. if (nvpb->base.remaining > 2) /* space() will fixup if not */
  15. nvpb->base.remaining -= 2;
  16. +restart_cal:
  17. req.channel = chan->id;
  18. req.handle = nvpb->buffer[nvpb->current]->handle;
  19. req.offset = nvpb->current_offset * 4;
  20. @@ -284,12 +285,15 @@ nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
  21. ret = drmCommandWriteRead(nvdev->fd,
  22. DRM_NOUVEAU_GEM_PUSHBUF_CALL,
  23. &req, sizeof(req));
  24. + if (ret == -EAGAIN)
  25. + goto restart_cal;
  26. nvpb->cal_suffix0 = req.suffix0;
  27. nvpb->cal_suffix1 = req.suffix1;
  28. assert(ret == 0);
  29. } else {
  30. struct drm_nouveau_gem_pushbuf req;
  31. +restart_push:
  32. req.channel = chan->id;
  33. req.nr_dwords = nvpb->size - nvpb->base.remaining;
  34. req.dwords = (uint64_t)(unsigned long)nvpb->pushbuf;
  35. @@ -299,6 +303,8 @@ nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
  36. req.relocs = (uint64_t)(unsigned long)nvpb->relocs;
  37. ret = drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GEM_PUSHBUF,
  38. &req, sizeof(req));
  39. + if (ret == -EAGAIN)
  40. + goto restart_push;
  41. assert(ret == 0);
  42. }
  43. --
  44. 1.6.5.1