diff options
author | Lijo Lazar <lijo.lazar@amd.com> | 2023-01-27 18:40:14 +0530 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-06-09 09:55:40 -0400 |
commit | 6e01882267a696b022cfe3473a0d3e5ccbe54010 (patch) | |
tree | 697f93ac19553cab83aad584e9b430d027b8cfa5 /drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | |
parent | 4d5275ab0b18d17697392aafd93e206e6b9de647 (diff) | |
download | lwn-6e01882267a696b022cfe3473a0d3e5ccbe54010.tar.gz lwn-6e01882267a696b022cfe3473a0d3e5ccbe54010.zip |
drm/amdgpu: Add API to get tmr info from acpi
In certain configs, TMR information is available from ACPI. Add API to
fetch the information.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c index a3a2ef43abfc..9dbdd699dcea 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c @@ -1072,6 +1072,26 @@ static int amdgpu_acpi_enumerate_xcc(void) return 0; } +int amdgpu_acpi_get_tmr_info(struct amdgpu_device *adev, u64 *tmr_offset, + u64 *tmr_size) +{ + struct amdgpu_acpi_dev_info *dev_info; + u16 bdf; + + if (!tmr_offset || !tmr_size) + return -EINVAL; + + bdf = (adev->pdev->bus->number << 8) | adev->pdev->devfn; + dev_info = amdgpu_acpi_get_dev(bdf); + if (!dev_info) + return -ENOENT; + + *tmr_offset = dev_info->tmr_base; + *tmr_size = dev_info->tmr_size; + + return 0; +} + /** * amdgpu_acpi_event - handle notify events * |