winsys/amdgpu: simplify amdgpu_cs_add_buffer() a bit
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 14 Apr 2017 16:32:24 +0000 (18:32 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 17 Apr 2017 09:59:17 +0000 (11:59 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/winsys/amdgpu/drm/amdgpu_cs.c

index 3ae5d33..f068d8e 100644 (file)
@@ -527,18 +527,17 @@ static unsigned amdgpu_cs_add_buffer(struct radeon_winsys_cs *rcs,
       }
 
       buffer = &cs->real_buffers[index];
-      buffer->u.real.priority_usage |= 1llu << priority;
-      buffer->usage |= usage;
    } else {
       index = amdgpu_lookup_or_add_sparse_buffer(acs, bo);
       if (index < 0)
          return 0;
 
       buffer = &cs->sparse_buffers[index];
-      buffer->usage |= usage;
-      buffer->u.real.priority_usage |= 1llu << priority;
    }
 
+   buffer->u.real.priority_usage |= 1llu << priority;
+   buffer->usage |= usage;
+
    cs->last_added_bo = bo;
    cs->last_added_bo_index = index;
    cs->last_added_bo_usage = buffer->usage;