Merge "disp: msm: dsi: refine the logic for mode filling and calculation"
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

commit
690701d8c0
@@ -3446,8 +3446,11 @@ int dsi_panel_get_mode_count(struct dsi_panel *panel)
|
||||
{
|
||||
const u32 SINGLE_MODE_SUPPORT = 1;
|
||||
struct dsi_parser_utils *utils;
|
||||
struct device_node *timings_np;
|
||||
struct device_node *timings_np, *child_np;
|
||||
int num_dfps_rates, num_bit_clks;
|
||||
int num_video_modes = 0, num_cmd_modes = 0;
|
||||
int count, rc = 0;
|
||||
void *utils_data = NULL;
|
||||
|
||||
if (!panel) {
|
||||
DSI_ERR("invalid params\n");
|
||||
@@ -3483,6 +3486,28 @@ int dsi_panel_get_mode_count(struct dsi_panel *panel)
|
||||
count = SINGLE_MODE_SUPPORT;
|
||||
|
||||
panel->num_timing_nodes = count;
|
||||
dsi_for_each_child_node(timings_np, child_np) {
|
||||
utils_data = child_np;
|
||||
if (utils->read_bool(utils->data, "qcom,mdss-dsi-video-mode"))
|
||||
num_video_modes++;
|
||||
else if (utils->read_bool(utils->data,
|
||||
"qcom,mdss-dsi-cmd-mode"))
|
||||
num_cmd_modes++;
|
||||
else if (panel->panel_mode == DSI_OP_VIDEO_MODE)
|
||||
num_video_modes++;
|
||||
else if (panel->panel_mode == DSI_OP_CMD_MODE)
|
||||
num_cmd_modes++;
|
||||
}
|
||||
|
||||
num_dfps_rates = !panel->dfps_caps.dfps_support ? 1 :
|
||||
panel->dfps_caps.dfps_list_len;
|
||||
|
||||
num_bit_clks = !panel->dyn_clk_caps.dyn_clk_support ? 1 :
|
||||
panel->dyn_clk_caps.bit_clk_list_len;
|
||||
|
||||
/* Inflate num_of_modes by fps and bit clks in dfps */
|
||||
panel->num_display_modes = (num_cmd_modes * num_bit_clks) +
|
||||
(num_video_modes * num_bit_clks * num_dfps_rates);
|
||||
|
||||
error:
|
||||
return rc;
|
||||
|
Reference in New Issue
Block a user