r300g: flush CS in bo_map even if we get USAGE_DONTBLOCK
authorMarek Olšák <maraeo@gmail.com>
Mon, 14 Feb 2011 22:15:55 +0000 (23:15 +0100)
committerMarek Olšák <maraeo@gmail.com>
Mon, 14 Feb 2011 22:34:45 +0000 (23:34 +0100)
Because an app may do something like this:

while (!(ptr = bo_map(..., DONT_BLOCK))) {
    /* Do some other work. */
}

And it would be looping endlessly if we didn't flush.

src/gallium/winsys/radeon/drm/radeon_drm_bo.c

index 550886d14f85d0e3e87739bcde323beb6f99d847..027e9d3f47aa14901623236c928f22fb1465a961 100644 (file)
@@ -162,6 +162,7 @@ static void *radeon_bo_map_internal(struct pb_buffer *_buf,
 
     if (flags & PB_USAGE_DONTBLOCK) {
         if (radeon_bo_is_referenced_by_cs(cs, bo)) {
+            cs->flush_cs(cs->flush_data);
             return NULL;
         }