From: Alvin Lee <[email protected]>

Need to check caps flag to determine whether LSDMA is supported in DMU

Reviewed-by: Rafal Ostrowski <[email protected]>
Signed-off-by: Alvin Lee <[email protected]>
Signed-off-by: Fangzhi Zuo <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c    | 3 +++
 drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h | 1 +
 2 files changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c 
b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
index fffbf1983143..7b09af1cb306 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
+++ b/drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c
@@ -2084,6 +2084,9 @@ bool dmub_lsdma_init(struct dc_dmub_srv *dc_dmub_srv)
        struct dmub_cmd_lsdma_data *lsdma_data = &cmd.lsdma.lsdma_data;
        bool result;
 
+       if (!dc_dmub_srv->dmub->feature_caps.lsdma_support_in_dmu)
+               return false;
+
        memset(&cmd, 0, sizeof(cmd));
 
        cmd.cmd_common.header.type     = DMUB_CMD__LSDMA;
diff --git a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h 
b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
index a0ffa046d8c2..067949d6eeb8 100644
--- a/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
+++ b/drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h
@@ -721,6 +721,7 @@ struct dmub_feature_caps {
        uint8_t replay_supported;
        uint8_t replay_reserved[3];
        uint8_t abm_aux_backlight_support;
+       uint8_t lsdma_support_in_dmu;
 };
 
 struct dmub_visual_confirm_color {
-- 
2.43.0

Reply via email to