diff options
author | 2023-01-25 20:04:52 +0530 | |
---|---|---|
committer | 2023-06-09 09:56:48 -0400 | |
commit | 4bdca2057933ef08a2ca7f44e30a8894ff78c472 (patch) | |
tree | e912c75e92fcddf37de41396a41334262c06179a /drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | |
parent | drm/amdgpu: Use apt name for FW reserved region (diff) | |
download | linux-4bdca2057933ef08a2ca7f44e30a8894ff78c472.tar.gz linux-4bdca2057933ef08a2ca7f44e30a8894ff78c472.tar.bz2 linux-4bdca2057933ef08a2ca7f44e30a8894ff78c472.zip |
drm/amdgpu: Add utility functions for xcp
Add utility functions to get details of xcp and iterate through
available xcps.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Le Ma <le.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c index e8aa4d6c6b62..337d558a3145 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xcp.c @@ -256,3 +256,15 @@ int amdgpu_xcp_get_partition(struct amdgpu_xcp_mgr *xcp_mgr, return id_mask; } + +int amdgpu_xcp_get_inst_details(struct amdgpu_xcp *xcp, + enum AMDGPU_XCP_IP_BLOCK ip, + uint32_t *inst_mask) +{ + if (!xcp->valid || !inst_mask || !(xcp->ip[ip].valid)) + return -EINVAL; + + *inst_mask = xcp->ip[ip].inst_mask; + + return 0; +} |