diff options
| author | Lijo Lazar <lijo.lazar@amd.com> | 2026-03-17 10:33:53 +0300 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2026-03-18 00:50:38 +0300 |
| commit | 3baa07dcfa51ff8d801d4566d6a7199834a73614 (patch) | |
| tree | 9524c111dc6c75b24916fd3998d96f440720903b | |
| parent | 6e9d61769b2b65e414fa9996da2b544a9eb45df5 (diff) | |
| download | linux-3baa07dcfa51ff8d801d4566d6a7199834a73614.tar.xz | |
drm/amdgpu: Add client id helpers to mmhub
Add data structure and helpers to get client id data of mmhub.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.h index 92918101a95d..6b8214650e5d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_mmhub.h @@ -66,12 +66,37 @@ struct amdgpu_mmhub_funcs { int (*get_xgmi_info)(struct amdgpu_device *adev); }; +struct amdgpu_mmhub_client_ids { + const char * const (*names)[2]; + unsigned int size; +}; + struct amdgpu_mmhub { struct ras_common_if *ras_if; const struct amdgpu_mmhub_funcs *funcs; struct amdgpu_mmhub_ras *ras; + struct amdgpu_mmhub_client_ids client_ids; }; +static inline void +amdgpu_mmhub_init_client_info(struct amdgpu_mmhub *mmhub, + const char * const (*names)[2], + unsigned int size) +{ + mmhub->client_ids.names = names; + mmhub->client_ids.size = size; +} + +static inline const char * +amdgpu_mmhub_client_name(struct amdgpu_mmhub *mmhub, + u32 cid, bool is_write) +{ + if (cid < mmhub->client_ids.size) + return mmhub->client_ids.names[cid][is_write]; + + return NULL; +} + int amdgpu_mmhub_ras_sw_init(struct amdgpu_device *adev); #endif |
