1
0

disp: msm: add support for seamless dsc switch

This change adds logic to determine dsc switch based on
the connector property "CONNECTOR_PROP_DSC_MODE" and
performs seamless DSC switch if there is any change in
DSC configuration. The connector property is populated
in msm_sub_mode based on which suitable mode is selected.

Change-Id: Ifc4931f16dfb814781bc1d72b103e09103e6bfee
Signed-off-by: Yashwanth <yvulapu@codeaurora.org>
Este cometimento está contido em:
Yashwanth
2021-04-26 13:37:48 +05:30
cometido por Gerrit - the friendly Code Review server
ascendente ffc7cdbe08
cometimento 7e03fb61fd
17 ficheiros modificados com 156 adições e 36 eliminações

Ver ficheiro

@@ -36,10 +36,6 @@
#define SEC_PANEL_NAME_MAX_LEN 256
#define DSI_MODE_MATCH_ACTIVE_TIMINGS (1 << 0)
#define DSI_MODE_MATCH_PORCH_TIMINGS (1 << 1)
#define DSI_MODE_MATCH_FULL_TIMINGS (DSI_MODE_MATCH_ACTIVE_TIMINGS | DSI_MODE_MATCH_PORCH_TIMINGS)
u8 dbgfs_tx_cmd_buf[SZ_4K];
static char dsi_display_primary[MAX_CMDLINE_PARAM_LEN];
static char dsi_display_secondary[MAX_CMDLINE_PARAM_LEN];
@@ -6235,7 +6231,7 @@ static int dsi_display_ext_get_info(struct drm_connector *connector,
}
static int dsi_display_ext_get_mode_info(struct drm_connector *connector,
const struct drm_display_mode *drm_mode,
const struct drm_display_mode *drm_mode, struct msm_sub_mode *sub_mode,
struct msm_mode_info *mode_info,
void *display, const struct msm_resource_caps_info *avail_res)
{
@@ -7167,11 +7163,16 @@ static bool dsi_display_mode_match(const struct dsi_display_mode *mode1,
!dsi_display_match_timings(mode1, mode2, match_flags))
return false;
if ((match_flags & DSI_MODE_MATCH_DSC_CONFIG) &&
mode1->priv_info->dsc_enabled != mode2->priv_info->dsc_enabled)
return false;
return true;
}
int dsi_display_find_mode(struct dsi_display *display,
const struct dsi_display_mode *cmp,
struct dsi_display_mode *cmp,
struct msm_sub_mode *sub_mode,
struct dsi_display_mode **out_mode)
{
u32 count, i;
@@ -7179,6 +7180,7 @@ int dsi_display_find_mode(struct dsi_display *display,
struct dsi_display_mode *m;
struct dsi_dyn_clk_caps *dyn_clk_caps;
unsigned int match_flags = DSI_MODE_MATCH_FULL_TIMINGS;
struct dsi_display_mode_priv_info priv_info;
if (!display || !out_mode)
return -EINVAL;
@@ -7209,6 +7211,15 @@ int dsi_display_find_mode(struct dsi_display *display,
if (dyn_clk_caps->maintain_const_fps)
match_flags = DSI_MODE_MATCH_ACTIVE_TIMINGS;
if (sub_mode && sub_mode->dsc_mode) {
match_flags |= DSI_MODE_MATCH_DSC_CONFIG;
cmp->priv_info = &priv_info;
memset(cmp->priv_info, 0,
sizeof(struct dsi_display_mode_priv_info));
cmp->priv_info->dsc_enabled = (sub_mode->dsc_mode ==
MSM_DISPLAY_DSC_MODE_ENABLED) ? true : false;
}
if (dsi_display_mode_match(cmp, m, match_flags)) {
*out_mode = m;
rc = 0;
@@ -7286,11 +7297,20 @@ int dsi_display_validate_mode_change(struct dsi_display *display,
if (sde_conn->expected_panel_mode == MSM_DISPLAY_VIDEO_MODE &&
display->config.panel_mode == DSI_OP_CMD_MODE) {
adj_mode->dsi_mode_flags |= DSI_MODE_FLAG_POMS_TO_VID;
SDE_EVT32(SDE_EVTLOG_FUNC_CASE1, sde_conn->expected_panel_mode,
display->config.panel_mode);
DSI_DEBUG("Panel operating mode change to video detected\n");
} else if (sde_conn->expected_panel_mode == MSM_DISPLAY_CMD_MODE &&
display->config.panel_mode == DSI_OP_VIDEO_MODE) {
adj_mode->dsi_mode_flags |= DSI_MODE_FLAG_POMS_TO_CMD;
SDE_EVT32(SDE_EVTLOG_FUNC_CASE2, sde_conn->expected_panel_mode,
display->config.panel_mode);
DSI_DEBUG("Panel operating mode change to command detected\n");
} else if (cur_mode->timing.dsc_enabled != adj_mode->timing.dsc_enabled) {
adj_mode->dsi_mode_flags |= DSI_MODE_FLAG_DMS;
SDE_EVT32(SDE_EVTLOG_FUNC_CASE3, cur_mode->timing.dsc_enabled,
adj_mode->timing.dsc_enabled);
DSI_DEBUG("DSC mode change detected\n");
} else {
dyn_clk_caps = &(display->panel->dyn_clk_caps);
/* dfps and dynamic clock with const fps use case */
@@ -7300,7 +7320,7 @@ int dsi_display_validate_mode_change(struct dsi_display *display,
dyn_clk_caps->maintain_const_fps) {
DSI_DEBUG("Mode switch is seamless variable refresh\n");
adj_mode->dsi_mode_flags |= DSI_MODE_FLAG_VRR;
SDE_EVT32(SDE_EVTLOG_FUNC_CASE1,
SDE_EVT32(SDE_EVTLOG_FUNC_CASE4,
cur_mode->timing.refresh_rate,
adj_mode->timing.refresh_rate,
cur_mode->timing.h_front_porch,
@@ -7333,7 +7353,7 @@ int dsi_display_validate_mode_change(struct dsi_display *display,
adj_mode->dsi_mode_flags |=
DSI_MODE_FLAG_DYN_CLK;
SDE_EVT32(SDE_EVTLOG_FUNC_CASE2,
SDE_EVT32(SDE_EVTLOG_FUNC_CASE5,
cur_mode->pixel_clk_khz,
adj_mode->pixel_clk_khz);
}