Commit 3e538e43 authored by Dillon Varone's avatar Dillon Varone Committed by Alex Deucher

drm/amd/display: Add UCLK p-state support message to dcn401

[WHY&HOW]
Improves on the SMU interface to explicitly declare P-State support.
Reviewed-by: default avatarAlvin Lee <alvin.lee2@amd.com>
Acked-by: default avatarZaeem Mohamed <zaeem.mohamed@amd.com>
Signed-off-by: default avatarDillon Varone <dillon.varone@amd.com>
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 5e211d2c
...@@ -38,7 +38,7 @@ union dcn401_clk_mgr_block_sequence_params { ...@@ -38,7 +38,7 @@ union dcn401_clk_mgr_block_sequence_params {
struct { struct {
/* inputs */ /* inputs */
bool support; bool support;
} update_fclk_pstate_support_params; } update_pstate_support_params;
struct { struct {
/* inputs */ /* inputs */
unsigned int num_ways; unsigned int num_ways;
...@@ -82,6 +82,7 @@ enum dcn401_clk_mgr_block_sequence_func { ...@@ -82,6 +82,7 @@ enum dcn401_clk_mgr_block_sequence_func {
CLK_MGR401_UPDATE_IDLE_HARDMINS, CLK_MGR401_UPDATE_IDLE_HARDMINS,
CLK_MGR401_UPDATE_DEEP_SLEEP_DCFCLK, CLK_MGR401_UPDATE_DEEP_SLEEP_DCFCLK,
CLK_MGR401_UPDATE_FCLK_PSTATE_SUPPORT, CLK_MGR401_UPDATE_FCLK_PSTATE_SUPPORT,
CLK_MGR401_UPDATE_UCLK_PSTATE_SUPPORT,
CLK_MGR401_UPDATE_CAB_FOR_UCLK, CLK_MGR401_UPDATE_CAB_FOR_UCLK,
CLK_MGR401_UPDATE_WAIT_FOR_DMUB_ACK, CLK_MGR401_UPDATE_WAIT_FOR_DMUB_ACK,
CLK_MGR401_INDICATE_DRR_STATUS, CLK_MGR401_INDICATE_DRR_STATUS,
......
...@@ -131,12 +131,20 @@ static bool dcn401_smu_send_msg_with_param_delay(struct clk_mgr_internal *clk_mg ...@@ -131,12 +131,20 @@ static bool dcn401_smu_send_msg_with_param_delay(struct clk_mgr_internal *clk_mg
return false; return false;
} }
void dcn401_smu_send_fclk_pstate_message(struct clk_mgr_internal *clk_mgr, bool enable) void dcn401_smu_send_fclk_pstate_message(struct clk_mgr_internal *clk_mgr, bool support)
{ {
smu_print("FCLK P-state support value is : %d\n", enable); smu_print("FCLK P-state support value is : %d\n", support);
dcn401_smu_send_msg_with_param(clk_mgr, dcn401_smu_send_msg_with_param(clk_mgr,
DALSMC_MSG_SetFclkSwitchAllow, enable ? FCLK_PSTATE_SUPPORTED : FCLK_PSTATE_NOTSUPPORTED, NULL); DALSMC_MSG_SetFclkSwitchAllow, support, NULL);
}
void dcn401_smu_send_uclk_pstate_message(struct clk_mgr_internal *clk_mgr, bool support)
{
smu_print("UCLK P-state support value is : %d\n", support);
dcn401_smu_send_msg_with_param(clk_mgr,
DALSMC_MSG_SetUclkPstateAllow, support, NULL);
} }
void dcn401_smu_send_cab_for_uclk_message(struct clk_mgr_internal *clk_mgr, unsigned int num_ways) void dcn401_smu_send_cab_for_uclk_message(struct clk_mgr_internal *clk_mgr, unsigned int num_ways)
......
...@@ -9,10 +9,8 @@ ...@@ -9,10 +9,8 @@
#include "core_types.h" #include "core_types.h"
#include "dcn32/dcn32_clk_mgr_smu_msg.h" #include "dcn32/dcn32_clk_mgr_smu_msg.h"
#define FCLK_PSTATE_NOTSUPPORTED 0x00 void dcn401_smu_send_fclk_pstate_message(struct clk_mgr_internal *clk_mgr, bool support);
#define FCLK_PSTATE_SUPPORTED 0x01 void dcn401_smu_send_uclk_pstate_message(struct clk_mgr_internal *clk_mgr, bool support);
void dcn401_smu_send_fclk_pstate_message(struct clk_mgr_internal *clk_mgr, bool enable);
void dcn401_smu_send_cab_for_uclk_message(struct clk_mgr_internal *clk_mgr, unsigned int num_ways); void dcn401_smu_send_cab_for_uclk_message(struct clk_mgr_internal *clk_mgr, unsigned int num_ways);
void dcn401_smu_transfer_wm_table_dram_2_smu(struct clk_mgr_internal *clk_mgr); void dcn401_smu_transfer_wm_table_dram_2_smu(struct clk_mgr_internal *clk_mgr);
void dcn401_smu_set_pme_workaround(struct clk_mgr_internal *clk_mgr); void dcn401_smu_set_pme_workaround(struct clk_mgr_internal *clk_mgr);
......
...@@ -1978,6 +1978,10 @@ unsigned int dcn32_calculate_mall_ways_from_bytes(const struct dc *dc, unsigned ...@@ -1978,6 +1978,10 @@ unsigned int dcn32_calculate_mall_ways_from_bytes(const struct dc *dc, unsigned
{ {
uint32_t cache_lines_used, lines_per_way, total_cache_lines, num_ways; uint32_t cache_lines_used, lines_per_way, total_cache_lines, num_ways;
if (total_size_in_mall_bytes == 0) {
return 0;
}
/* add 2 lines for worst case alignment */ /* add 2 lines for worst case alignment */
cache_lines_used = total_size_in_mall_bytes / dc->caps.cache_line_size + 2; cache_lines_used = total_size_in_mall_bytes / dc->caps.cache_line_size + 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment