[PATCH v1] drm/amdgpu/jpeg: configure doorbell for each playback

Gopalakrishnan, Veerabadhran (Veera) Veerabadhran.Gopalakrishnan at amd.com
Thu Dec 7 16:29:23 UTC 2023


[AMD Official Use Only - General]

Looking good to me.

Reviewed-by: Veerabadhran Gopalakrishnan <Veerabadhran.Gopalakrishnan at amd.com>

Regards,
Veera

-----Original Message-----
From: Jamadar, Saleemkhan <Saleemkhan.Jamadar at amd.com>
Sent: Thursday, December 7, 2023 9:22 PM
To: Jamadar, Saleemkhan <Saleemkhan.Jamadar at amd.com>; Liu, Leo <Leo.Liu at amd.com>; Gopalakrishnan, Veerabadhran (Veera) <Veerabadhran.Gopalakrishnan at amd.com>; amd-gfx at lists.freedesktop.org
Cc: Sundararaju, Sathishkumar <Sathishkumar.Sundararaju at amd.com>; Rao, Srinath <Srinath.rao at amd.com>; Deucher, Alexander <Alexander.Deucher at amd.com>; Koenig, Christian <Christian.Koenig at amd.com>
Subject: [PATCH v1] drm/amdgpu/jpeg: configure doorbell for each playback

Doorbell is configured during start of each playback.

v1 - add comment for the doorbell programming change (Veera)

Signed-off-by: Saleemkhan Jamadar <saleemkhan.jamadar at amd.com>
Acked-by: Leo Liu <leo.liu at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
index 9df011323d4b..6ede85b28cc8 100644
--- a/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
+++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v4_0_5.c
@@ -155,13 +155,6 @@ static int jpeg_v4_0_5_hw_init(void *handle)
        struct amdgpu_ring *ring = adev->jpeg.inst->ring_dec;
        int r;

-       adev->nbio.funcs->vcn_doorbell_range(adev, ring->use_doorbell,
-                               (adev->doorbell_index.vcn.vcn_ring0_1 << 1), 0);
-
-       WREG32_SOC15(VCN, 0, regVCN_JPEG_DB_CTRL,
-               ring->doorbell_index << VCN_JPEG_DB_CTRL__OFFSET__SHIFT |
-               VCN_JPEG_DB_CTRL__EN_MASK);
-
        r = amdgpu_ring_test_helper(ring);
        if (r)
                return r;
@@ -336,6 +329,14 @@ static int jpeg_v4_0_5_start(struct amdgpu_device *adev)
        if (adev->pm.dpm_enabled)
                amdgpu_dpm_enable_jpeg(adev, true);

+       /* doorbell programming is done for every playback */
+       adev->nbio.funcs->vcn_doorbell_range(adev, ring->use_doorbell,
+                               (adev->doorbell_index.vcn.vcn_ring0_1 << 1), 0);
+
+       WREG32_SOC15(VCN, 0, regVCN_JPEG_DB_CTRL,
+               ring->doorbell_index << VCN_JPEG_DB_CTRL__OFFSET__SHIFT |
+               VCN_JPEG_DB_CTRL__EN_MASK);
+
        /* disable power gating */
        r = jpeg_v4_0_5_disable_static_power_gating(adev);
        if (r)
--
2.25.1



More information about the amd-gfx mailing list