Skip to contentSkip to conversation

drm/amd : Add HDP flush during jpeg init

PATCH In review Timmy Tsai 2 participants 2 messages Sep 8, 2023

Subsystems (2)
lore
Share & tools
lore

Timmy Tsai

author
#0 lore raw

PATCH v2 1/1 drm/amd : Add HDP flush during jpeg init

During jpeg init, CPU writes to frame buffer which can be cached by HDP, occasionally causing invalid header to be sent to MMSCH. Perform HDP flush after writing to frame buffer before continuing with jpeg init sequence.

---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c +3 -0
index 3eb3dcd56..02b8eca91 100644
@@ -468,6 +468,9 @@ static int jpeg_v4_0_start_sriov(struct amdgpu_device *adev)
 	table_loc = (uint32_t *)table->cpu_addr;
 	memcpy((void *)table_loc, &header, size);
 
+	/* Perform HDP flush before writing to MMSCH registers */
+	amdgpu_device_flush_hdp(adev, NULL);
+
 	/* message MMSCH (in VCN[0]) to initialize this client
 	 * 1, write to mmsch_vf_ctx_addr_lo/hi register with GPU mc addr
 	 * of memory descriptor location
Signature · 1 line
2.34.1
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Timmy Tsai

During jpeg init, CPU writes to frame buffer which can be cached by HDP, occasionally causing invalid header to be sent to MMSCH. Perform HDP flush after writing to frame buffer before continuing with jpeg init sequence.

Quoted 21 lines
---
 drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/jpeg_v4_0.c +3 -1
index 3eb3dcd56..02b8eca91 100644
@@ -468,6 +468,9 @@ static int jpeg_v4_0_start_sriov(struct amdgpu_device *adev)
        table_loc = (uint32_t *)table->cpu_addr;
        memcpy((void *)table_loc, &header, size);
 
+       /* Perform HDP flush before writing to MMSCH registers */
+       amdgpu_device_flush_hdp(adev, NULL);
+
        /* message MMSCH (in VCN[0]) to initialize this client
         * 1, write to mmsch_vf_ctx_addr_lo/hi register with GPU mc addr
         * of memory descriptor location
--

2.34.1