[PATCH] drm/amdgpu/display: flush the HDP when setting up DMCUB firmware
Zhang, Hawking
Hawking.Zhang at amd.com
Fri Apr 29 02:45:47 UTC 2022
[AMD Official Use Only - General]
Reviewed-by: Hawking Zhang <Hawking.Zhang at amd.com>
Regards,
Hawking
-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Alex Deucher
Sent: Friday, April 29, 2022 06:13
To: amd-gfx at lists.freedesktop.org
Cc: Deucher, Alexander <Alexander.Deucher at amd.com>
Subject: [PATCH] drm/amdgpu/display: flush the HDP when setting up DMCUB firmware
When data is written to VRAM via the PCI BAR, the data goes through a block called HDP which has a write queue and a read cache. When the driver writes to VRAM, it needs to flush the HDP write queue to make sure all the data written has actually hit VRAM.
When we write the DMCUB firmware to vram, we never flushed the HDP. In theory this could cause DMCUB errors if we try and start the DMCUB firmware without making sure the data has hit memory.
This doesn't fix any known issues, but is the right thing to do.
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index a6c3e1d74124..5c1fd3a91cd5 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1133,6 +1133,10 @@ static int dm_dmub_hw_init(struct amdgpu_device *adev)
break;
}
+ /* flush HDP */
+ mb();
+ amdgpu_device_flush_hdp(adev, NULL);
+
status = dmub_srv_hw_init(dmub_srv, &hw_params);
if (status != DMUB_STATUS_OK) {
DRM_ERROR("Error initializing DMUB HW: %d\n", status);
--
2.35.1
More information about the amd-gfx
mailing list