struct amdgpu_buffer_size_alignments alignment_info = {};
struct amdgpu_heap_info vram, visible_vram, gtt;
struct drm_amdgpu_info_hw_ip dma = {};
+ struct drm_amdgpu_info_hw_ip compute = {};
drmDevicePtr devinfo;
int r;
int i, j;
fprintf(stderr, "amdgpu: amdgpu_query_hw_ip_info(dma) failed.\n");
goto fail;
}
+
+ r = amdgpu_query_hw_ip_info(ws->dev, AMDGPU_HW_IP_COMPUTE, 0, &compute);
+ if (r) {
+ fprintf(stderr, "amdgpu: amdgpu_query_hw_ip_info(compute) failed.\n");
+ goto fail;
+ }
ws->info.pci_id = ws->amdinfo.asic_id; /* TODO: is this correct? */
ws->info.vce_harvest_config = ws->amdinfo.vce_harvest_config;
fprintf(stderr, "amdgpu: Cannot create addrlib.\n");
goto fail;
}
+
+ assert(util_is_power_of_two(dma.available_rings + 1));
+ assert(util_is_power_of_two(compute.available_rings + 1));
+
/* Set hardware information. */
ws->info.name = get_chip_name(ws->info.family);
ws->info.gart_size = gtt.heap_size;
ws->info.num_tile_pipes = radv_cik_get_num_tile_pipes(&ws->amdinfo);
ws->info.pipe_interleave_bytes = 256 << ((ws->amdinfo.gb_addr_cfg >> 4) & 0x7);
ws->info.has_virtual_memory = TRUE;
- ws->info.has_sdma = dma.available_rings != 0;
+ ws->info.sdma_rings = util_bitcount(dma.available_rings);
+ ws->info.compute_rings = util_bitcount(compute.available_rings);
/* Get the number of good compute units. */
ws->info.num_good_compute_units = 0;