aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/packages/rpm/el5/SOURCES/libdrm-nouveau-restart-pushbuf.patch
blob: 408a519cc7028e88ff4258e66b8ad73c909e2ed5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 67628aa39dd74807989492af5451a3a5c0232e39 Mon Sep 17 00:00:00 2001
From: Ben Skeggs <bskeggs@redhat.com>
Date: Tue, 20 Oct 2009 12:57:46 +1000
Subject: [PATCH] nouveau: retry if pushbuf ioctl interrupted by signal

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
---
 libdrm/nouveau/nouveau_pushbuf.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/libdrm/nouveau/nouveau_pushbuf.c b/libdrm/nouveau/nouveau_pushbuf.c
index 1192e22..fbcddd7 100644
--- a/libdrm/nouveau/nouveau_pushbuf.c
+++ b/libdrm/nouveau/nouveau_pushbuf.c
@@ -270,6 +270,7 @@ nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
 		if (nvpb->base.remaining > 2) /* space() will fixup if not */
 			nvpb->base.remaining -= 2;
 
+restart_cal:
 		req.channel = chan->id;
 		req.handle = nvpb->buffer[nvpb->current]->handle;
 		req.offset = nvpb->current_offset * 4;
@@ -284,12 +285,15 @@ nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
 		ret = drmCommandWriteRead(nvdev->fd,
 					  DRM_NOUVEAU_GEM_PUSHBUF_CALL,
 					  &req, sizeof(req));
+		if (ret == -EAGAIN)
+			goto restart_cal;
 		nvpb->cal_suffix0 = req.suffix0;
 		nvpb->cal_suffix1 = req.suffix1;
 		assert(ret == 0);
 	} else {
 		struct drm_nouveau_gem_pushbuf req;
 
+restart_push:
 		req.channel = chan->id;
 		req.nr_dwords = nvpb->size - nvpb->base.remaining;
 		req.dwords = (uint64_t)(unsigned long)nvpb->pushbuf;
@@ -299,6 +303,8 @@ nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min)
 		req.relocs = (uint64_t)(unsigned long)nvpb->relocs;
 		ret = drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GEM_PUSHBUF,
 				      &req, sizeof(req));
+		if (ret == -EAGAIN)
+			goto restart_push;
 		assert(ret == 0);
 	}
 
-- 
1.6.5.1