diff options
author | Marek Olšák <[email protected]> | 2018-07-12 00:27:06 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2018-07-16 13:32:33 -0400 |
commit | 6b1e0e51e6dbb896ec0dccc6e5dd1bb3e0f35c2b (patch) | |
tree | 9a511c7d4cd5717735c9ee3a201f6cc76ee3bf2f /src/gallium/winsys/amdgpu | |
parent | 54ad9b444c8e73da498211870e785239ad3ff1aa (diff) |
radeonsi: rework RADEON_PRIO flags to be <= 31
This decreases sizeof(struct amdgpu_cs_buffer) from 24 to 16 bytes.
Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/gallium/winsys/amdgpu')
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 6 | ||||
-rw-r--r-- | src/gallium/winsys/amdgpu/drm/amdgpu_cs.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c index ec164175dbc..872e67a790a 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c @@ -629,7 +629,7 @@ static unsigned amdgpu_cs_add_buffer(struct radeon_cmdbuf *rcs, */ if (bo == cs->last_added_bo && (usage & cs->last_added_bo_usage) == usage && - (1ull << priority) & cs->last_added_bo_priority_usage) + (1u << priority) & cs->last_added_bo_priority_usage) return cs->last_added_bo_index; if (!bo->sparse) { @@ -658,7 +658,7 @@ static unsigned amdgpu_cs_add_buffer(struct radeon_cmdbuf *rcs, buffer = &cs->sparse_buffers[index]; } - buffer->u.real.priority_usage |= 1ull << priority; + buffer->u.real.priority_usage |= 1u << priority; buffer->usage |= usage; cs->last_added_bo = bo; @@ -1339,7 +1339,7 @@ void amdgpu_cs_submit_ib(void *job, int thread_index) assert(buffer->u.real.priority_usage != 0); handles[num_handles] = buffer->bo->bo; - flags[num_handles] = (util_last_bit64(buffer->u.real.priority_usage) - 1) / 4; + flags[num_handles] = (util_last_bit(buffer->u.real.priority_usage) - 1) / 2; ++num_handles; } diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h index 3b10cc66c21..9f5a4fd991a 100644 --- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h +++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h @@ -46,7 +46,7 @@ struct amdgpu_cs_buffer { struct amdgpu_winsys_bo *bo; union { struct { - uint64_t priority_usage; + uint32_t priority_usage; } real; struct { uint32_t real_idx; /* index of underlying real BO */ @@ -94,7 +94,7 @@ struct amdgpu_cs_context { struct amdgpu_winsys_bo *last_added_bo; unsigned last_added_bo_index; unsigned last_added_bo_usage; - uint64_t last_added_bo_priority_usage; + uint32_t last_added_bo_priority_usage; struct pipe_fence_handle **fence_dependencies; unsigned num_fence_dependencies; |