drm/amdgpu: Add user queue instance count in HW IP info
authorJesse Zhang <jesse.zhang@amd.com>
Wed, 25 Jun 2025 07:29:45 +0000 (15:29 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 16 Jul 2025 20:17:35 +0000 (16:17 -0400)
commit78d0a27ae0e2e70b22895f4b388cc0ab88e3c6ca
tree781b64d869e4eca92533245847798b58fe60cb1e
parent55d42f6169760d052330f3c949c02e37867b87d8
drm/amdgpu: Add user queue instance count in HW IP info

This change exposes the number of available user queue instances
for each hardware IP type (GFX, COMPUTE, SDMA) through the
drm_amdgpu_info_hw_ip interface.

Key changes:
1. Added userq_num_instance field to drm_amdgpu_info_hw_ip structure
2. Implemented counting of available HQD slots using:
   - mes.gfx_hqd_mask for GFX queues
   - mes.compute_hqd_mask for COMPUTE queues
   - mes.sdma_hqd_mask for SDMA queues
3. Only counts available instances when user queues are enabled
   (!disable_uq)

v2: using the adev->mes.gfx_hqd_mask[]/compute_hqd_mask[]/sdma_hqd_mask[] masks
  to determine the number of queue slots available for each engine type (Alex)
v3: rename userq_num_instance to userq_num_hqds (Alex)

Suggested-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
include/uapi/drm/amdgpu_drm.h