radv: abstract queue family away from queue family index.

If we introduce another queue type (video decode) we can have a
disconnect between the RADV_QUEUE_ enum and the API queue_family_index.

currently the driver has
GENERAL, COMPUTE, TRANSFER which would end up at QFI 0, 1, <nothing>
since we don't create transfer.

Now if I add VDEC we get
GENERAL, COMPUTE, TRANSFER, VDEC at QFI 0, 1, <nothing>, 2
or if you do nocompute
GENERAL, COMPUTE, TRANSFER, VDEC at QFI 0, <nothing>, <nothing>, 1

This means we have to add a remapping table between the API qfi
and the internal qf.

This patches tries to do that, in theory right now it just adds
overhead, but I'd like to exercise these paths.

v2: add radv_queue_ring abstraction, and pass physical device in,
as it makes adding uvd later easier.
v3: rename, and drop one direction as unneeded now, drop queue_family_index
from cmd_buffers.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13687>
This commit is contained in:
Dave Airlie
2021-11-05 16:03:24 +10:00
committed by Marge Bot
parent afb4cced5c
commit 1ec4e568de
14 changed files with 163 additions and 110 deletions

View File

@@ -520,7 +520,7 @@ radv_get_saved_pipeline(struct radv_device *device, enum ring_type ring)
static void
radv_dump_queue_state(struct radv_queue *queue, const char *dump_dir, FILE *f)
{
enum ring_type ring = radv_queue_family_to_ring(queue->vk.queue_family_index);
enum ring_type ring = radv_queue_ring(queue);
struct radv_pipeline *pipeline;
fprintf(f, "RING_%s:\n", ring == RING_GFX ? "GFX" : "COMPUTE");
@@ -631,7 +631,7 @@ radv_dump_device_name(struct radv_device *device, FILE *f)
static void
radv_dump_umr_ring(struct radv_queue *queue, FILE *f)
{
enum ring_type ring = radv_queue_family_to_ring(queue->vk.queue_family_index);
enum ring_type ring = radv_queue_ring(queue);
struct radv_device *device = queue->device;
char cmd[128];
@@ -649,7 +649,7 @@ radv_dump_umr_ring(struct radv_queue *queue, FILE *f)
static void
radv_dump_umr_waves(struct radv_queue *queue, FILE *f)
{
enum ring_type ring = radv_queue_family_to_ring(queue->vk.queue_family_index);
enum ring_type ring = radv_queue_ring(queue);
struct radv_device *device = queue->device;
char cmd[128];
@@ -682,7 +682,7 @@ radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_cmdbuf *cs)
enum ring_type ring;
uint64_t addr;
ring = radv_queue_family_to_ring(queue->vk.queue_family_index);
ring = radv_queue_ring(queue);
bool hang_occurred = radv_gpu_hang_occured(queue, ring);
bool vm_fault_occurred = false;
@@ -989,7 +989,7 @@ radv_dump_sq_hw_regs(struct radv_device *device)
void
radv_check_trap_handler(struct radv_queue *queue)
{
enum ring_type ring = radv_queue_family_to_ring(queue->vk.queue_family_index);
enum ring_type ring = radv_queue_ring(queue);
struct radv_device *device = queue->device;
struct radeon_winsys *ws = device->ws;