drm/amd/display: Read default boot options
authorDuncan Ma <duncan.ma@amd.com>
Mon, 22 Apr 2024 14:17:11 +0000 (10:17 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 May 2024 19:47:59 +0000 (15:47 -0400)
[WHY]
DPIA boot option is set by VBIOS. It gets
overwritten when driver loads DMU.

[HOW]
Read PreOS boot options and determine if
dpia is enabled.

Reviewed-by: Ovidiu Bunea <ovidiu.bunea@amd.com>
Acked-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Duncan Ma <duncan.ma@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn35.c

index 70e63aeb8f89b1da59189fd315fe14623915a174..7f53074f4e48a5488f77d1ce3f4e10e25fe8f1f9 100644 (file)
@@ -410,10 +410,13 @@ union dmub_fw_boot_options dmub_dcn35_get_fw_boot_option(struct dmub_srv *dmub)
 void dmub_dcn35_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_dcn35_get_fw_boot_option(dmub);
 
        boot_options.bits.z10_disable = params->disable_z10;
        boot_options.bits.dpia_supported = params->dpia_supported;
-       boot_options.bits.enable_dpia = params->disable_dpia == true ? 0:1;
+       boot_options.bits.enable_dpia = cur_boot_options.bits.enable_dpia && !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;