[Mesa-dev] [PATCH 2/3] winsys/amdgpu: simplify amdgpu_cs_add_buffer() a bit

Samuel Pitoiset samuel.pitoiset at gmail.com
Fri Apr 14 16:32:24 UTC 2017


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index 3ae5d33fce..f068d8ea7a 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -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;
-- 
2.12.2



More information about the mesa-dev mailing list