From: "Leo (Sunpeng) Li" <[email protected]>

Calling dcn10_cursor_set_position() before dcn10_cursor_set_attributes()
with invalid (0-value) attributes can cause the ASIC to hang. This fix
checks that address.quadpart is non-zero within set_position before calling
set_attributes.

Change-Id: I89d45b5e66b60bb936c02b97bcec36ff8c10465c
Signed-off-by: Leo (Sunpeng) Li <[email protected]>
Reviewed-by: Harry Wentland <[email protected]>
Reviewed-by: Tony Cheng <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c 
b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c
index 3062b7de4fe2..082c98c11293 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_ipp.c
@@ -614,6 +614,16 @@ static void dcn10_cursor_set_position(
        uint32_t cur_en = pos->enable ? 1 : 0;
        uint32_t dst_x_offset = (src_x_offset >= 0) ? src_x_offset : 0;
 
+       /*
+        * Guard aganst cursor_set_position() from being called with invalid
+        * attributes
+        *
+        * TODO: Look at combining cursor_set_position() and
+        * cursor_set_attributes() into cursor_update()
+        */
+       if (ippn10->curs_attr.address.quad_part == 0)
+               return;
+
        dst_x_offset *= param->ref_clk_khz;
        dst_x_offset /= param->pixel_clk_khz;
 
-- 
2.11.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to