[PATCH 09/14] drm/amd/display: add NULL pointer check

Stylon Wang stylon.wang at amd.com
Wed May 31 04:48:08 UTC 2023


From: Charlene Liu <charlene.liu at amd.com>

[why]
check dmub_Srv exist or not before accessing dmub.

Acked-by: Stylon Wang <stylon.wang at amd.com>
Signed-off-by: Charlene Liu <charlene.liu at amd.com>
Reviewed-by: Zhan Liu <Zhan.Liu at amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
index 0d3ec50b1385..41b4c360c5b2 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -276,7 +276,7 @@ static void program_cursor_attributes(
 		}
 
 		dc->hwss.set_cursor_attribute(pipe_ctx);
-
+		if (dc->ctx->dmub_srv)
 		dc_send_update_cursor_info_to_dmu(pipe_ctx, i);
 		if (dc->hwss.set_cursor_sdr_white_level)
 			dc->hwss.set_cursor_sdr_white_level(pipe_ctx);
@@ -396,7 +396,7 @@ static void program_cursor_position(
 		}
 
 		dc->hwss.set_cursor_position(pipe_ctx);
-
+		if (dc->ctx->dmub_srv)
 		dc_send_update_cursor_info_to_dmu(pipe_ctx, i);
 	}
 
-- 
2.40.1



More information about the amd-gfx mailing list