Skip to content

Commit e77a800

Browse files
unsccaptain1alexdeucher
authored andcommitted
drm/amd/display: Use region6 size in fw_meta_info
[Why] If driver allocated region6 size is not same as the size in firmware, dmcub won't enable region6. [How] Use region6 size in dmcub_fw_meta instead of a constant value. Reviewed-by: Nicholas Kazlauskas <[email protected]> Signed-off-by: JinZe Xu <[email protected]> Signed-off-by: Hamza Mahfooz <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent bc04292 commit e77a800

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ enum dmub_status
497497
const struct dmub_fw_meta_info *fw_info;
498498
uint32_t fw_state_size = DMUB_FW_STATE_SIZE;
499499
uint32_t trace_buffer_size = DMUB_TRACE_BUFFER_SIZE;
500+
uint32_t shared_state_size = DMUB_FW_HEADER_SHARED_STATE_SIZE;
500501
uint32_t window_sizes[DMUB_WINDOW_TOTAL] = { 0 };
501502

502503
if (!dmub->sw_init)
@@ -514,6 +515,7 @@ enum dmub_status
514515

515516
fw_state_size = fw_info->fw_region_size;
516517
trace_buffer_size = fw_info->trace_buffer_size;
518+
shared_state_size = fw_info->shared_state_size;
517519

518520
/**
519521
* If DM didn't fill in a version, then fill it in based on
@@ -534,7 +536,7 @@ enum dmub_status
534536
window_sizes[DMUB_WINDOW_5_TRACEBUFF] = trace_buffer_size;
535537
window_sizes[DMUB_WINDOW_6_FW_STATE] = fw_state_size;
536538
window_sizes[DMUB_WINDOW_7_SCRATCH_MEM] = DMUB_SCRATCH_MEM_SIZE;
537-
window_sizes[DMUB_WINDOW_SHARED_STATE] = DMUB_FW_HEADER_SHARED_STATE_SIZE;
539+
window_sizes[DMUB_WINDOW_SHARED_STATE] = max(DMUB_FW_HEADER_SHARED_STATE_SIZE, shared_state_size);
538540

539541
out->fb_size =
540542
dmub_srv_calc_regions_for_memory_type(params, out, window_sizes, DMUB_WINDOW_MEMORY_TYPE_FB);

0 commit comments

Comments
 (0)