Commit 86194cf8 authored by Felix Kuehling's avatar Felix Kuehling Committed by Oded Gabbay

drm/amdkfd: Fix allocated_queues bitmap initialization

Use shared_resources.queue_bitmap to determine the queues available
for KFD in each pipe.
Signed-off-by: default avatarFelix Kuehling <Felix.Kuehling@amd.com>
Reviewed-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@gmail.com>
parent c76cf869
...@@ -513,7 +513,7 @@ static int init_scheduler(struct device_queue_manager *dqm) ...@@ -513,7 +513,7 @@ static int init_scheduler(struct device_queue_manager *dqm)
static int initialize_nocpsch(struct device_queue_manager *dqm) static int initialize_nocpsch(struct device_queue_manager *dqm)
{ {
int i; int pipe, queue;
BUG_ON(!dqm); BUG_ON(!dqm);
...@@ -531,8 +531,14 @@ static int initialize_nocpsch(struct device_queue_manager *dqm) ...@@ -531,8 +531,14 @@ static int initialize_nocpsch(struct device_queue_manager *dqm)
return -ENOMEM; return -ENOMEM;
} }
for (i = 0; i < get_pipes_per_mec(dqm); i++) for (pipe = 0; pipe < get_pipes_per_mec(dqm); pipe++) {
dqm->allocated_queues[i] = (1 << get_queues_per_pipe(dqm)) - 1; int pipe_offset = pipe * get_queues_per_pipe(dqm);
for (queue = 0; queue < get_queues_per_pipe(dqm); queue++)
if (test_bit(pipe_offset + queue,
dqm->dev->shared_resources.queue_bitmap))
dqm->allocated_queues[pipe] |= 1 << queue;
}
dqm->vmid_bitmap = (1 << VMID_PER_DEVICE) - 1; dqm->vmid_bitmap = (1 << VMID_PER_DEVICE) - 1;
dqm->sdma_bitmap = (1 << CIK_SDMA_QUEUES) - 1; dqm->sdma_bitmap = (1 << CIK_SDMA_QUEUES) - 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment