summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
diff options
context:
space:
mode:
authorLijo Lazar <lijo.lazar@amd.com>2025-01-10 10:33:19 +0300
committerAlex Deucher <alexander.deucher@amd.com>2025-02-13 05:02:55 +0300
commitca449221078983a4b70a77187e0ddb7445a3fce0 (patch)
tree6de0e9d3eb23ba85a87456dfc651c84a17f54aec /drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
parent485380f7fe518b89386f87e0d9896174374d20cb (diff)
downloadlinux-ca449221078983a4b70a77187e0ddb7445a3fce0.tar.xz
drm/amdgpu: Check RRMT status for JPEG v4.0.3
RRMT could get dynamically enabled/disabled by PSP firmware. Read the status from register for reading RRMT status. For VFs, this is not accessible, hence assume that it's always disabled for now. Signed-off-by: Lijo Lazar <lijo.lazar@amd.com> Reviewed-by: Sathishkumar S <sathishkumar.sundararaju@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
index 88f9771c1686..9459e8cc7413 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_3.c
@@ -61,8 +61,7 @@ static int amdgpu_ih_srcid_jpeg[] = {
static inline bool jpeg_v4_0_3_normalizn_reqd(struct amdgpu_device *adev)
{
- return amdgpu_sriov_vf(adev) ||
- (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 4));
+ return (adev->jpeg.caps & AMDGPU_JPEG_CAPS(RRMT_ENABLED)) == 0;
}
/**
@@ -331,6 +330,11 @@ static int jpeg_v4_0_3_hw_init(struct amdgpu_ip_block *ip_block)
}
}
} else {
+ /* This flag is not set for VF, assumed to be disabled always */
+ if (RREG32_SOC15(VCN, GET_INST(VCN, 0), regVCN_RRMT_CNTL) &
+ 0x100)
+ adev->jpeg.caps |= AMDGPU_JPEG_CAPS(RRMT_ENABLED);
+
for (i = 0; i < adev->jpeg.num_jpeg_inst; ++i) {
jpeg_inst = GET_INST(JPEG, i);