mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 03:53:37 +02:00
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>
This commit is contained in:
parent
6e9d61769b
commit
3baa07dcfa
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user