Skip to content

Commit

Permalink
drm/amdgpu: add amdgpu_device reference in ip block
Browse files Browse the repository at this point in the history
To handle amdgpu_device reference for different GPUs
we add it's reference in each ip block which can be
used to differentiate between difference gpu devices.

Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Suggested-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Sunil Khatri authored and Alex Deucher committed Sep 26, 2024
1 parent 6e37ae8 commit 37b9932
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ struct amdgpu_ip_block_version {
struct amdgpu_ip_block {
struct amdgpu_ip_block_status status;
const struct amdgpu_ip_block_version *version;
struct amdgpu_device *adev;
};

int amdgpu_device_ip_block_version_cmp(struct amdgpu_device *adev,
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -2337,6 +2337,8 @@ int amdgpu_device_ip_block_add(struct amdgpu_device *adev,
DRM_INFO("add ip block number %d <%s>\n", adev->num_ip_blocks,
ip_block_version->funcs->name);

adev->ip_blocks[adev->num_ip_blocks].adev = adev;

adev->ip_blocks[adev->num_ip_blocks++].version = ip_block_version;

return 0;
Expand Down

0 comments on commit 37b9932

Please sign in to comment.