disp: msm: dsi: add support for splitlink sublinks video data swap
Change adds support for enabling splitlink sublinks video data swap. Change-Id: I731b85a5e8fe8638005433819957dd0658f72963 Signed-off-by: Vara Reddy <varar@codeaurora.org>
This commit is contained in:
@@ -997,7 +997,7 @@ static int dsi_ctrl_update_link_freqs(struct dsi_ctrl *dsi_ctrl,
|
||||
if (host_cfg->data_lanes & DSI_DATA_LANE_3)
|
||||
num_of_lanes++;
|
||||
|
||||
if (split_link->split_link_enabled)
|
||||
if (split_link->enabled)
|
||||
num_of_lanes = split_link->lanes_per_sublink;
|
||||
|
||||
config->common_config.num_data_lanes = num_of_lanes;
|
||||
@@ -1368,6 +1368,10 @@ static void dsi_kickoff_msg_tx(struct dsi_ctrl *dsi_ctrl,
|
||||
dsi_hw_ops.reset_trig_ctrl(&dsi_ctrl->hw,
|
||||
&dsi_ctrl->host_config.common_config);
|
||||
|
||||
if (dsi_hw_ops.splitlink_cmd_setup && split_link->enabled)
|
||||
dsi_hw_ops.splitlink_cmd_setup(&dsi_ctrl->hw,
|
||||
&dsi_ctrl->host_config.common_config, flags);
|
||||
|
||||
/*
|
||||
* Always enable DMA scheduling for video mode panel.
|
||||
*
|
||||
|
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/delay.h>
|
||||
@@ -56,7 +56,7 @@ static void dsi_split_link_setup(struct dsi_ctrl_hw *ctrl,
|
||||
{
|
||||
u32 reg;
|
||||
|
||||
if (!cfg->split_link.split_link_enabled)
|
||||
if (!cfg->split_link.enabled)
|
||||
return;
|
||||
|
||||
reg = DSI_R32(ctrl, DSI_SPLIT_LINK);
|
||||
@@ -69,6 +69,14 @@ static void dsi_split_link_setup(struct dsi_ctrl_hw *ctrl,
|
||||
reg &= ~(0x7 << 20);
|
||||
reg |= DSI_CTRL_MDP0_LINK_SEL;
|
||||
|
||||
/* COMMAND_INPUT_SWAP|VIDEO_INPUT_SWAP */
|
||||
if (cfg->split_link.sublink_swap) {
|
||||
if (cfg->split_link.panel_mode == DSI_OP_CMD_MODE)
|
||||
reg |= BIT(8);
|
||||
else
|
||||
reg |= BIT(4);
|
||||
}
|
||||
|
||||
/* EN */
|
||||
reg |= 0x1;
|
||||
|
||||
|
@@ -443,14 +443,18 @@ struct dsi_mode_info {
|
||||
|
||||
/**
|
||||
* struct dsi_split_link_config - Split Link Configuration
|
||||
* @split_link_enabled: Split Link Enabled.
|
||||
* @enabled: Split Link Enabled.
|
||||
* @sublink_swap: Split link left right sublinks swap.
|
||||
* @num_sublinks: Number of sublinks.
|
||||
* @lanes_per_sublink: Number of lanes per sublink.
|
||||
* @panel_mode: Specifies cmd or video mode.
|
||||
*/
|
||||
struct dsi_split_link_config {
|
||||
bool split_link_enabled;
|
||||
bool enabled;
|
||||
bool sublink_swap;
|
||||
u32 num_sublinks;
|
||||
u32 lanes_per_sublink;
|
||||
enum dsi_op_mode panel_mode;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -2055,7 +2055,7 @@ static void adjust_timing_by_ctrl_count(const struct dsi_display *display,
|
||||
struct dsi_display_mode *mode)
|
||||
{
|
||||
struct dsi_host_common_cfg *host = &display->panel->host_config;
|
||||
bool is_split_link = host->split_link.split_link_enabled;
|
||||
bool is_split_link = host->split_link.enabled;
|
||||
u32 sublinks_count = host->split_link.num_sublinks;
|
||||
|
||||
if (is_split_link && sublinks_count > 1) {
|
||||
@@ -5297,16 +5297,9 @@ static int dsi_display_validate_split_link(struct dsi_display *display)
|
||||
struct dsi_display_ctrl *ctrl;
|
||||
struct dsi_host_common_cfg *host = &display->panel->host_config;
|
||||
|
||||
if (!host->split_link.split_link_enabled)
|
||||
if (!host->split_link.enabled)
|
||||
return 0;
|
||||
|
||||
if (display->panel->panel_mode == DSI_OP_CMD_MODE) {
|
||||
DSI_ERR("[%s] split link is not supported in command mode\n",
|
||||
display->name);
|
||||
rc = -ENOTSUPP;
|
||||
goto error;
|
||||
}
|
||||
|
||||
display_for_each_ctrl(i, display) {
|
||||
ctrl = &display->ctrl[i];
|
||||
if (!ctrl->ctrl->split_link_supported) {
|
||||
@@ -5317,13 +5310,14 @@ static int dsi_display_validate_split_link(struct dsi_display *display)
|
||||
}
|
||||
|
||||
set_bit(DSI_PHY_SPLIT_LINK, ctrl->phy->hw.feature_map);
|
||||
host->split_link.panel_mode = display->panel->panel_mode;
|
||||
}
|
||||
|
||||
DSI_DEBUG("Split link is enabled\n");
|
||||
return 0;
|
||||
|
||||
error:
|
||||
host->split_link.split_link_enabled = false;
|
||||
host->split_link.enabled = false;
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -6553,7 +6547,7 @@ int dsi_display_get_info(struct drm_connector *connector,
|
||||
info->te_source = display->te_source;
|
||||
|
||||
host = &display->panel->host_config;
|
||||
if (host->split_link.split_link_enabled)
|
||||
if (host->split_link.enabled)
|
||||
info->capabilities |= MSM_DISPLAY_SPLIT_LINK;
|
||||
|
||||
info->dsc_count = display->panel->dsc_count;
|
||||
@@ -6827,7 +6821,7 @@ int dsi_display_get_modes(struct dsi_display *display,
|
||||
display_mode.timing.mdp_transfer_time_us;
|
||||
}
|
||||
|
||||
is_split_link = host->split_link.split_link_enabled;
|
||||
is_split_link = host->split_link.enabled;
|
||||
sublinks_count = host->split_link.num_sublinks;
|
||||
if (is_split_link && sublinks_count > 1) {
|
||||
display_mode.timing.h_active *= sublinks_count;
|
||||
@@ -6924,7 +6918,7 @@ int dsi_display_get_panel_vfp(void *dsi_display,
|
||||
}
|
||||
|
||||
host = &display->panel->host_config;
|
||||
if (host->split_link.split_link_enabled)
|
||||
if (host->split_link.enabled)
|
||||
h_active *= host->split_link.num_sublinks;
|
||||
else
|
||||
h_active *= display->ctrl_count;
|
||||
|
@@ -1157,7 +1157,7 @@ static void dsi_panel_parse_split_link_config(struct dsi_host_common_cfg *host,
|
||||
|
||||
if (!supported) {
|
||||
DSI_DEBUG("[%s] Split link is not supported\n", name);
|
||||
split_link->split_link_enabled = false;
|
||||
split_link->enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1177,9 +1177,14 @@ static void dsi_panel_parse_split_link_config(struct dsi_host_common_cfg *host,
|
||||
split_link->lanes_per_sublink = val;
|
||||
}
|
||||
|
||||
supported = utils->read_bool(utils->data, "qcom,split-link-sublink-swap");
|
||||
|
||||
if (!supported)
|
||||
split_link->sublink_swap = false;
|
||||
|
||||
DSI_DEBUG("[%s] Split link is supported %d-%d\n", name,
|
||||
split_link->num_sublinks, split_link->lanes_per_sublink);
|
||||
split_link->split_link_enabled = true;
|
||||
split_link->enabled = true;
|
||||
}
|
||||
|
||||
static int dsi_panel_parse_host_config(struct dsi_panel *panel)
|
||||
|
Reference in New Issue
Block a user