nouveau: remove unnecessary EAGAIN loops
authorMarcin Slusarz <marcin.slusarz@gmail.com>
Sun, 22 Apr 2012 22:31:48 +0000 (00:31 +0200)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 24 Apr 2012 02:41:39 +0000 (12:41 +1000)
drmCommandWrite / drmCommandWriteRead already loop on EAGAIN.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
nouveau/nouveau.c
nouveau/pushbuf.c

index 699b9b763b2af1d95af774448c4dccb2968eb035..f0bc2c3f25f79fc31575c8b1c9043f499306062b 100644 (file)
@@ -461,12 +461,8 @@ nouveau_bo_wait(struct nouveau_bo *bo, uint32_t access,
        if (access & NOUVEAU_BO_NOBLOCK)
                req.flags |= NOUVEAU_GEM_CPU_PREP_NOWAIT;
 
-       do {
-               ret = drmCommandWrite(bo->device->fd,
-                                     DRM_NOUVEAU_GEM_CPU_PREP,
-                                     &req, sizeof(req));
-       } while (ret == -EAGAIN);
-
+       ret = drmCommandWrite(bo->device->fd, DRM_NOUVEAU_GEM_CPU_PREP,
+                             &req, sizeof(req));
        if (ret == 0)
                nvbo->access = 0;
        return ret;
index 103737e6337310495fea12deff491ea8b5869bb3..7b9dbaade2c0c39ca5d5a5b6930f71e57be8481d 100644 (file)
@@ -341,11 +341,8 @@ pushbuf_submit(struct nouveau_pushbuf *push, struct nouveau_object *chan)
                        pushbuf_dump(krec, krec_id++, fifo->channel);
 
 #ifndef SIMULATE
-               do {
-                       ret = drmCommandWriteRead(dev->fd,
-                                                 DRM_NOUVEAU_GEM_PUSHBUF,
-                                                 &req, sizeof(req));
-               } while (ret == -EAGAIN);
+               ret = drmCommandWriteRead(dev->fd, DRM_NOUVEAU_GEM_PUSHBUF,
+                                         &req, sizeof(req));
                nvpb->suffix0 = req.suffix0;
                nvpb->suffix1 = req.suffix1;
                dev->vram_limit = (req.vram_available * 80) / 100;