gallium/radeon: handle buffer_map staging buffer failures better
authorMarek Olšák <marek.olsak@amd.com>
Thu, 10 Sep 2015 15:53:28 +0000 (17:53 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 24 Sep 2015 17:51:42 +0000 (19:51 +0200)
Cc: 11.0 <mesa-stable@lists.freedesktop.org>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeon/r600_buffer_common.c

index 4adcccbb8ed87aac5cff9d5bb323b8eb289e87e0..f341ecb41a511e1742db22d87815b5e48d462594 100644 (file)
@@ -305,12 +305,11 @@ static void *r600_buffer_transfer_map(struct pipe_context *ctx,
                                data += box->x % R600_MAP_BUFFER_ALIGNMENT;
                                return r600_buffer_get_transfer(ctx, resource, level, usage, box,
                                                                ptransfer, data, staging, offset);
-                       } else {
-                               return NULL; /* error, shouldn't occur though */
                        }
+               } else {
+                       /* At this point, the buffer is always idle (we checked it above). */
+                       usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
                }
-               /* At this point, the buffer is always idle (we checked it above). */
-               usage |= PIPE_TRANSFER_UNSYNCHRONIZED;
        }
        /* Using a staging buffer in GTT for larger reads is much faster. */
        else if ((usage & PIPE_TRANSFER_READ) &&