mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-26 12:10:22 +01:00
winsys/amdgpu: don't use amdgpu_fence::ctx for fence dependencies
The only remaining use of ctx is amdgpu_fence_is_syncobj. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
This commit is contained in:
parent
7ccdcae4b5
commit
44df9517cd
3 changed files with 9 additions and 1 deletions
|
|
@ -1366,7 +1366,7 @@ static void amdgpu_cs_submit_ib(void *job, void *gdata, int thread_index)
|
|||
struct amdgpu_fence *prev_fence =
|
||||
(struct amdgpu_fence*)queue->fences[prev_seq_no % AMDGPU_FENCE_RING_SIZE];
|
||||
|
||||
if (prev_fence && (ws->info.ip[acs->ip_type].num_queues > 1 || prev_fence->ctx != acs->ctx))
|
||||
if (prev_fence && (ws->info.ip[acs->ip_type].num_queues > 1 || queue->last_ctx != acs->ctx))
|
||||
add_seq_no_to_list(ws, &seq_no_dependencies, acs->queue_index, prev_seq_no);
|
||||
|
||||
/* Since the kernel driver doesn't synchronize execution between different
|
||||
|
|
@ -1424,6 +1424,9 @@ static void amdgpu_cs_submit_ib(void *job, void *gdata, int thread_index)
|
|||
amdgpu_fence_reference(&queue->fences[next_seq_no % AMDGPU_FENCE_RING_SIZE], cs->fence);
|
||||
queue->latest_seq_no = next_seq_no;
|
||||
((struct amdgpu_fence*)cs->fence)->queue_seq_no = next_seq_no;
|
||||
|
||||
/* Update the last used context in the queue. */
|
||||
amdgpu_ctx_reference(&queue->last_ctx, acs->ctx);
|
||||
simple_mtx_unlock(&ws->bo_fence_lock);
|
||||
|
||||
struct drm_amdgpu_bo_list_entry *bo_list = NULL;
|
||||
|
|
|
|||
|
|
@ -75,6 +75,8 @@ static void do_winsys_deinit(struct amdgpu_winsys *ws)
|
|||
for (unsigned i = 0; i < ARRAY_SIZE(ws->queues); i++) {
|
||||
for (unsigned j = 0; j < ARRAY_SIZE(ws->queues[i].fences); j++)
|
||||
amdgpu_fence_reference(&ws->queues[i].fences[j], NULL);
|
||||
|
||||
amdgpu_ctx_reference(&ws->queues[i].last_ctx, NULL);
|
||||
}
|
||||
|
||||
if (util_queue_is_initialized(&ws->cs_queue))
|
||||
|
|
|
|||
|
|
@ -117,6 +117,9 @@ struct amdgpu_queue {
|
|||
* never become idle in certain very unlucky scenarios and running out of memory.
|
||||
*/
|
||||
uint_seq_no latest_seq_no;
|
||||
|
||||
/* The last context using this queue. */
|
||||
struct amdgpu_ctx *last_ctx;
|
||||
};
|
||||
|
||||
/* This is part of every BO. */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue