mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-19 20:13:49 -04:00
drm/amdgpu: Add helpers to set/get unique ids
Add a struct to store unique id information for each type. Add helper to fetch the unique id. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Asad Kamal <asad.kamal@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -819,6 +819,20 @@ struct amdgpu_ip_map_info {
|
||||
uint32_t mask);
|
||||
};
|
||||
|
||||
enum amdgpu_uid_type {
|
||||
AMDGPU_UID_TYPE_XCD,
|
||||
AMDGPU_UID_TYPE_AID,
|
||||
AMDGPU_UID_TYPE_SOC,
|
||||
AMDGPU_UID_TYPE_MAX
|
||||
};
|
||||
|
||||
#define AMDGPU_UID_INST_MAX 8 /* max number of instances for each UID type */
|
||||
|
||||
struct amdgpu_uid {
|
||||
uint64_t uid[AMDGPU_UID_TYPE_MAX][AMDGPU_UID_INST_MAX];
|
||||
struct amdgpu_device *adev;
|
||||
};
|
||||
|
||||
struct amd_powerplay {
|
||||
void *pp_handle;
|
||||
const struct amd_pm_funcs *pp_funcs;
|
||||
@@ -1302,6 +1316,7 @@ struct amdgpu_device {
|
||||
struct list_head userq_mgr_list;
|
||||
struct mutex userq_mutex;
|
||||
bool userq_halt_for_enforce_isolation;
|
||||
struct amdgpu_uid *uid_info;
|
||||
};
|
||||
|
||||
static inline uint32_t amdgpu_ip_version(const struct amdgpu_device *adev,
|
||||
@@ -1785,4 +1800,9 @@ static inline int amdgpu_device_bus_status_check(struct amdgpu_device *adev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void amdgpu_device_set_uid(struct amdgpu_uid *uid_info,
|
||||
enum amdgpu_uid_type type, uint8_t inst,
|
||||
uint64_t uid);
|
||||
uint64_t amdgpu_device_get_uid(struct amdgpu_uid *uid_info,
|
||||
enum amdgpu_uid_type type, uint8_t inst);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user