diff options
author | Lijo Lazar <lijo.lazar@amd.com> | 2023-02-17 07:02:44 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-06-09 16:56:54 +0300 |
commit | 0f2e1d620eca56c4ceebc041aabb1eda26b2cfd0 (patch) | |
tree | fd0b6232a75745f863df55e585164b40f148694c /drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c | |
parent | b6f90baafe267a0705c5d9b1429c875d3c39fbc7 (diff) | |
download | linux-0f2e1d620eca56c4ceebc041aabb1eda26b2cfd0.tar.xz |
drm/amdgpu: Get supported memory partition modes
Expand the interface to get supported memory partition modes also along
with the current memory partition mode.
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/nbio_v7_9.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c b/drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c index fa4b423c399b..e1552d645308 100644 --- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c @@ -408,12 +408,19 @@ static void nbio_v7_9_set_compute_partition_mode(struct amdgpu_device *adev, WREG32_SOC15(NBIO, 0, regBIF_BX_PF0_PARTITION_COMPUTE_STATUS, tmp); } -static enum amdgpu_memory_partition nbio_v7_9_get_memory_partition_mode(struct amdgpu_device *adev) +static enum amdgpu_memory_partition +nbio_v7_9_get_memory_partition_mode(struct amdgpu_device *adev, u32 *supp_modes) { u32 tmp; + tmp = RREG32_SOC15(NBIO, 0, regBIF_BX_PF0_PARTITION_MEM_STATUS); tmp = REG_GET_FIELD(tmp, BIF_BX_PF0_PARTITION_MEM_STATUS, NPS_MODE); + if (supp_modes) { + *supp_modes = + RREG32_SOC15(NBIO, 0, regBIF_BX_PF0_PARTITION_MEM_CAP); + } + return ffs(tmp); } |