Merge "disp: msm: dp: add support for continuous PPS command"

This commit is contained in:
qctecmdr
2020-12-02 06:10:51 -08:00
committed by Gerrit - the friendly Code Review server
10 changed files with 42 additions and 3 deletions

View File

@@ -1534,6 +1534,7 @@ static void dp_catalog_panel_dp_flush(struct dp_catalog_panel *panel,
struct dp_catalog_private *catalog;
struct dp_io_data *io_data;
u32 dp_flush, offset;
struct dp_dsc_cfg_data *dsc;
if (!panel) {
DP_ERR("invalid input\n");
@@ -1547,6 +1548,7 @@ static void dp_catalog_panel_dp_flush(struct dp_catalog_panel *panel,
catalog = dp_catalog_get_priv(panel);
io_data = catalog->io.dp_link;
dsc = &panel->dsc;
if (panel->stream_id == DP_STREAM_0)
offset = 0;
@@ -1554,6 +1556,11 @@ static void dp_catalog_panel_dp_flush(struct dp_catalog_panel *panel,
offset = MMSS_DP1_FLUSH - MMSS_DP_FLUSH;
dp_flush = dp_read(MMSS_DP_FLUSH + offset);
if ((flush_bit == DP_PPS_FLUSH) &&
dsc->continuous_pps)
dp_flush &= ~BIT(2);
dp_flush |= BIT(flush_bit);
dp_write(MMSS_DP_FLUSH + offset, dp_flush);
}

View File

@@ -149,6 +149,7 @@ struct dp_catalog_audio {
struct dp_dsc_cfg_data {
bool dsc_en;
bool continuous_pps;
char pps[128];
u32 pps_len;
u32 pps_word[32];

View File

@@ -1883,6 +1883,7 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
}
g_dp_display->is_mst_supported = dp->parser->has_mst;
g_dp_display->dsc_cont_pps = dp->parser->dsc_continuous_pps;
dp->catalog = dp_catalog_get(dev, dp->parser);
if (IS_ERR(dp->catalog)) {

View File

@@ -70,6 +70,7 @@ struct dp_display {
void *base_dp_panel;
bool is_sst_connected;
bool is_mst_supported;
bool dsc_cont_pps;
u32 max_pclk_khz;
void *dp_mst_prv_info;
u32 max_mixer_count;

View File

@@ -366,6 +366,10 @@ int dp_connector_post_init(struct drm_connector *connector, void *display)
dp_display->bridge->dp_panel = sde_conn->drv_panel;
rc = dp_mst_init(dp_display);
if (dp_display->dsc_cont_pps)
sde_conn->ops.update_pps = NULL;
end:
return rc;
}

View File

@@ -1768,6 +1768,21 @@ static void dp_mst_connector_pre_destroy(struct drm_connector *connector,
SDE_EVT32_EXTERNAL(SDE_EVTLOG_FUNC_EXIT, conn_id);
}
static int dp_mst_connector_post_init(struct drm_connector *connector,
void *display)
{
struct dp_display *dp_display = display;
struct sde_connector *sde_conn = to_sde_connector(connector);
if (!dp_display || !connector)
return -EINVAL;
if (dp_display->dsc_cont_pps)
sde_conn->ops.update_pps = NULL;
return 0;
}
/* DRM MST callbacks */
static struct drm_connector *
@@ -1775,7 +1790,7 @@ dp_mst_add_connector(struct drm_dp_mst_topology_mgr *mgr,
struct drm_dp_mst_port *port, const char *pathprop)
{
static const struct sde_connector_ops dp_mst_connector_ops = {
.post_init = NULL,
.post_init = dp_mst_connector_post_init,
.detect = dp_mst_connector_detect,
.get_modes = dp_mst_connector_get_modes,
.mode_valid = dp_mst_connector_mode_valid,
@@ -2120,7 +2135,7 @@ dp_mst_drm_fixed_connector_init(struct dp_display *dp_display,
struct drm_encoder *encoder)
{
static const struct sde_connector_ops dp_mst_connector_ops = {
.post_init = NULL,
.post_init = dp_mst_connector_post_init,
.detect = dp_mst_fixed_connector_detect,
.get_modes = dp_mst_connector_get_modes,
.mode_valid = dp_mst_connector_mode_valid,

View File

@@ -2221,7 +2221,7 @@ static void dp_panel_config_dsc(struct dp_panel *dp_panel, bool enable)
dsc->be_in_lane = _dp_panel_calc_be_in_lane(dp_panel);
dsc->dsc_en = true;
dsc->dto_en = true;
dsc->continuous_pps = dp_panel->dsc_continuous_pps;
dp_panel_get_dto_params(comp_info->comp_ratio, &dsc->dto_n,
&dsc->dto_d, pinfo->bpp);
} else {
@@ -2229,6 +2229,7 @@ static void dp_panel_config_dsc(struct dp_panel *dp_panel, bool enable)
dsc->dto_en = false;
dsc->dto_n = 0;
dsc->dto_d = 0;
dsc->continuous_pps = false;
}
catalog->stream_id = dp_panel->stream_id;
@@ -3026,6 +3027,7 @@ struct dp_panel *dp_panel_get(struct dp_panel_in *in)
dp_panel->dsc_feature_enable = panel->parser->dsc_feature_enable;
dp_panel->fec_feature_enable = panel->parser->fec_feature_enable;
dp_panel->dsc_continuous_pps = panel->parser->dsc_continuous_pps;
if (in->base_panel) {
memcpy(dp_panel->dpcd, in->base_panel->dpcd,

View File

@@ -133,6 +133,7 @@ struct dp_panel {
bool dsc_en;
bool fec_en;
bool widebus_en;
bool dsc_continuous_pps;
bool mst_state;
s64 fec_overhead_fp;

View File

@@ -727,8 +727,13 @@ static void dp_parser_dsc(struct dp_parser *parser)
parser->dsc_feature_enable = of_property_read_bool(dev->of_node,
"qcom,dsc-feature-enable");
parser->dsc_continuous_pps = of_property_read_bool(dev->of_node,
"qcom,dsc-continuous-pps");
DP_DEBUG("dsc parsing successful. dsc:%d\n",
parser->dsc_feature_enable);
DP_DEBUG("cont_pps:%d\n",
parser->dsc_continuous_pps);
}
static void dp_parser_fec(struct dp_parser *parser)

View File

@@ -195,6 +195,7 @@ static inline char *dp_phy_aux_config_type_to_string(u32 cfg_type)
* @gpio_aux_switch: presence GPIO AUX switch status
* @dsc_feature_enable: DSC feature enable status
* @fec_feature_enable: FEC feature enable status
* @dsc_continuous_pps: PPS sent every frame by HW
* @has_widebus: widebus (2PPC) feature eanble status
*@mst_fixed_port: mst port_num reserved for fixed topology
* @parse: function to be called by client to parse device tree.
@@ -221,6 +222,7 @@ struct dp_parser {
bool no_aux_switch;
bool dsc_feature_enable;
bool fec_feature_enable;
bool dsc_continuous_pps;
bool has_widebus;
bool gpio_aux_switch;
bool lphw_hpd;