drm/amd/display: Check bss_data_size before going down legacy DMUB load path

[Why]
New unified firmware binary with only inst const still passes down
fw_bss_data != NULL and params->bss_data_size == 0 from DM.

This leads it into the legacy path causing firmware state allocation to
be too small.

[How]
Check bss_data_size as well.

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Zhan Liu <Zhan.Liu@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Nicholas Kazlauskas 2020-04-30 12:18:16 -04:00 committed by Alex Deucher
parent 65f9ace4ac
commit 08a512d4ab
1 changed files with 2 additions and 2 deletions

View File

@ -98,12 +98,12 @@ dmub_get_fw_meta_info(const struct dmub_srv_region_params *params)
uint32_t blob_size = 0;
uint32_t meta_offset = 0;
if (params->fw_bss_data) {
if (params->fw_bss_data && params->bss_data_size) {
/* Legacy metadata region. */
blob = params->fw_bss_data;
blob_size = params->bss_data_size;
meta_offset = DMUB_FW_META_OFFSET;
} else if (params->fw_inst_const) {
} else if (params->fw_inst_const && params->inst_const_size) {
/* Combined metadata region. */
blob = params->fw_inst_const;
blob_size = params->inst_const_size;