From: Meenakshikumar Somasundaram <[email protected]>

[Why & How]
Init a flag to track if dpia enabled previously
and update that to boot options.

Reviewed-by: Ovidiu Bunea <[email protected]>
Signed-off-by: Meenakshikumar Somasundaram <[email protected]>
Signed-off-by: Roman Li <[email protected]>
Signed-off-by: Chuanyu Tseng <[email protected]>
---
 drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.c 
b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.c
index 4d274b7034e8..7833a4fb7fbf 100644
--- a/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.c
+++ b/drivers/gpu/drm/amd/display/dmub/src/dmub_dcn42.c
@@ -39,13 +39,14 @@ void dmub_srv_dcn42_regs_init(struct dmub_srv *dmub, struct 
dc_context *ctx)
 void dmub_dcn42_enable_dmub_boot_options(struct dmub_srv *dmub, const struct 
dmub_srv_hw_params *params)
 {
        union dmub_fw_boot_options boot_options = {0};
-       union dmub_fw_boot_options cur_boot_options = {0};
 
-       cur_boot_options = dmub_dcn42_get_fw_boot_option(dmub);
+       if (!dmub->dpia_supported) {
+               dmub->dpia_supported = 
dmub_dcn42_get_fw_boot_option(dmub).bits.enable_dpia;
+       }
 
        boot_options.bits.z10_disable = params->disable_z10;
        boot_options.bits.dpia_supported = params->dpia_supported;
-       boot_options.bits.enable_dpia = cur_boot_options.bits.enable_dpia && 
!params->disable_dpia;
+       boot_options.bits.enable_dpia = dmub->dpia_supported && 
!params->disable_dpia;
        boot_options.bits.usb4_cm_version = params->usb4_cm_version;
        boot_options.bits.dpia_hpd_int_enable_supported = 
params->dpia_hpd_int_enable_supported;
        boot_options.bits.power_optimization = params->power_optimization;
-- 
2.43.0

Reply via email to