Skip to content

Commit b185c31

Browse files
committed
drm/amdgpu: track MQD size for gfx and compute
It varies by generation and we need to know the size to expose this via debugfs. Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 8a93c69 commit b185c31

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

+2
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ int amdgpu_gfx_mqd_sw_init(struct amdgpu_device *adev,
420420
return r;
421421
}
422422

423+
ring->mqd_size = mqd_size;
423424
/* prepare MQD backup */
424425
adev->gfx.me.mqd_backup[i] = kmalloc(mqd_size, GFP_KERNEL);
425426
if (!adev->gfx.me.mqd_backup[i])
@@ -440,6 +441,7 @@ int amdgpu_gfx_mqd_sw_init(struct amdgpu_device *adev,
440441
return r;
441442
}
442443

444+
ring->mqd_size = mqd_size;
443445
/* prepare MQD backup */
444446
adev->gfx.mec.mqd_backup[i + xcc_id * adev->gfx.num_compute_rings] = kmalloc(mqd_size, GFP_KERNEL);
445447
if (!adev->gfx.mec.mqd_backup[i])

drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h

+1
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ struct amdgpu_ring {
258258
struct amdgpu_bo *mqd_obj;
259259
uint64_t mqd_gpu_addr;
260260
void *mqd_ptr;
261+
unsigned mqd_size;
261262
uint64_t eop_gpu_addr;
262263
u32 doorbell_index;
263264
bool use_doorbell;

0 commit comments

Comments
 (0)