diff options
author | Evan Quan <evan.quan@amd.com> | 2020-07-06 05:03:00 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-07-21 21:37:37 +0200 |
commit | 22f2447c04728665a26c63981db05d901537b833 (patch) | |
tree | c042bf8b4b8817dcbf0cd9a228f3757ac9708234 /drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | |
parent | drm/amdgpu: add read amdgpu_gfxoff status in debugfs (diff) | |
download | linux-22f2447c04728665a26c63981db05d901537b833.tar.xz linux-22f2447c04728665a26c63981db05d901537b833.zip |
drm/amd/powerplay: widely share the API for data table retrieving
Considering the data table retrieving can be more widely shared,
amdgpu_atombios.c is the right place.
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c index c687432da426..29f767e026e4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c @@ -2036,3 +2036,20 @@ int amdgpu_atombios_init(struct amdgpu_device *adev) return 0; } +int amdgpu_atombios_get_data_table(struct amdgpu_device *adev, + uint32_t table, + uint16_t *size, + uint8_t *frev, + uint8_t *crev, + uint8_t **addr) +{ + uint16_t data_start; + + if (!amdgpu_atom_parse_data_header(adev->mode_info.atom_context, table, + size, frev, crev, &data_start)) + return -EINVAL; + + *addr = (uint8_t *)adev->mode_info.atom_context->bios + data_start; + + return 0; +} |