diff --git a/msm/dp/dp_drm.c b/msm/dp/dp_drm.c index a5af544ec6..7496d60d3e 100644 --- a/msm/dp/dp_drm.c +++ b/msm/dp/dp_drm.c @@ -425,6 +425,7 @@ int dp_connector_get_mode_info(struct drm_connector *connector, sizeof(mode_info->comp_info)); topology->num_enc = topology->num_lm; + topology->comp_type = mode_info->comp_info.comp_type; } return 0; diff --git a/msm/dsi/dsi_drm.c b/msm/dsi/dsi_drm.c index 4bf12feec3..14aa3481be 100644 --- a/msm/dsi/dsi_drm.c +++ b/msm/dsi/dsi_drm.c @@ -512,14 +512,14 @@ int dsi_conn_get_mode_info(struct drm_connector *connector, memcpy(&mode_info->topology, &dsi_mode.priv_info->topology, sizeof(struct msm_display_topology)); - mode_info->comp_info.comp_type = MSM_DISPLAY_COMPRESSION_NONE; - if (dsi_mode.priv_info->dsc_enabled) { mode_info->comp_info.comp_type = MSM_DISPLAY_COMPRESSION_DSC; + mode_info->topology.comp_type = MSM_DISPLAY_COMPRESSION_DSC; memcpy(&mode_info->comp_info.dsc_info, &dsi_mode.priv_info->dsc, sizeof(dsi_mode.priv_info->dsc)); } else if (dsi_mode.priv_info->vdc_enabled) { mode_info->comp_info.comp_type = MSM_DISPLAY_COMPRESSION_VDC; + mode_info->topology.comp_type = MSM_DISPLAY_COMPRESSION_VDC; memcpy(&mode_info->comp_info.vdc_info, &dsi_mode.priv_info->vdc, sizeof(dsi_mode.priv_info->vdc)); } diff --git a/msm/msm_drv.h b/msm/msm_drv.h index 3c34da5fda..d1f6d440a0 100644 --- a/msm/msm_drv.h +++ b/msm/msm_drv.h @@ -645,11 +645,13 @@ struct msm_compression_info { * @num_lm: number of layer mixers used * @num_enc: number of compression encoder blocks used * @num_intf: number of interfaces the panel is mounted on + * @comp_type: type of compression supported */ struct msm_display_topology { u32 num_lm; u32 num_enc; u32 num_intf; + enum msm_display_compression_type comp_type; }; /** diff --git a/msm/sde/sde_connector.c b/msm/sde/sde_connector.c index 22d5f61e86..888c1d1dd5 100644 --- a/msm/sde/sde_connector.c +++ b/msm/sde/sde_connector.c @@ -2303,8 +2303,8 @@ static int sde_connector_populate_mode_info(struct drm_connector *conn, sde_kms_info_add_keyint(info, "bit_clk_rate", mode_info.clk_rate); - topology_idx = (int)sde_rm_get_topology_name( - mode_info.topology); + topology_idx = (int)sde_rm_get_topology_name(&sde_kms->rm, + mode_info.topology); if (topology_idx < SDE_RM_TOPOLOGY_MAX) { sde_kms_info_add_keystr(info, "topology", e_topology_name[topology_idx].name); diff --git a/msm/sde/sde_encoder.c b/msm/sde/sde_encoder.c index 638fb11e29..fb73f2305e 100644 --- a/msm/sde/sde_encoder.c +++ b/msm/sde/sde_encoder.c @@ -877,7 +877,8 @@ static int _sde_encoder_atomic_check_reserve(struct drm_encoder *drm_enc, if (crtc_state->active) topology = &sde_conn_state->mode_info.topology; - ret = sde_rm_update_topology(conn_state, topology); + ret = sde_rm_update_topology(&sde_kms->rm, + conn_state, topology); if (ret) { SDE_ERROR_ENC(sde_enc, "RM failed to update topology, rc: %d\n", ret); diff --git a/msm/sde/sde_rm.c b/msm/sde/sde_rm.c index c3552a738f..843d388aa5 100644 --- a/msm/sde/sde_rm.c +++ b/msm/sde/sde_rm.c @@ -31,40 +31,61 @@ #define RM_RQ_CWB(r) ((r)->top_ctrl & BIT(SDE_RM_TOPCTL_CWB)) #define RM_IS_TOPOLOGY_MATCH(t, r) ((t).num_lm == (r).num_lm && \ (t).num_comp_enc == (r).num_enc && \ - (t).num_intf == (r).num_intf) + (t).num_intf == (r).num_intf && \ + (t).comp_type == (r).comp_type) /** * toplogy information to be used when ctl path version does not * support driving more than one interface per ctl_path */ -static const struct sde_rm_topology_def g_top_table[] = { - { SDE_RM_TOPOLOGY_NONE, 0, 0, 0, 0, false }, - { SDE_RM_TOPOLOGY_SINGLEPIPE, 1, 0, 1, 1, false }, - { SDE_RM_TOPOLOGY_SINGLEPIPE_DSC, 1, 1, 1, 1, false }, - { SDE_RM_TOPOLOGY_DUALPIPE, 2, 0, 2, 2, true }, - { SDE_RM_TOPOLOGY_DUALPIPE_DSC, 2, 2, 2, 2, true }, - { SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE, 2, 0, 1, 1, false }, - { SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE_DSC, 2, 1, 1, 1, false }, - { SDE_RM_TOPOLOGY_DUALPIPE_DSCMERGE, 2, 2, 1, 1, false }, - { SDE_RM_TOPOLOGY_PPSPLIT, 1, 0, 2, 1, true }, +static const struct sde_rm_topology_def g_top_table[SDE_RM_TOPOLOGY_MAX] = { + { SDE_RM_TOPOLOGY_NONE, 0, 0, 0, 0, false, + MSM_DISPLAY_COMPRESSION_NONE }, + { SDE_RM_TOPOLOGY_SINGLEPIPE, 1, 0, 1, 1, false, + MSM_DISPLAY_COMPRESSION_NONE }, + { SDE_RM_TOPOLOGY_SINGLEPIPE_DSC, 1, 1, 1, 1, false, + MSM_DISPLAY_COMPRESSION_DSC }, + { SDE_RM_TOPOLOGY_DUALPIPE, 2, 0, 2, 2, true, + MSM_DISPLAY_COMPRESSION_NONE }, + { SDE_RM_TOPOLOGY_DUALPIPE_DSC, 2, 2, 2, 2, true, + MSM_DISPLAY_COMPRESSION_DSC }, + { SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE, 2, 0, 1, 1, false, + MSM_DISPLAY_COMPRESSION_NONE }, + { SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE_DSC, 2, 1, 1, 1, false, + MSM_DISPLAY_COMPRESSION_DSC }, + { SDE_RM_TOPOLOGY_DUALPIPE_DSCMERGE, 2, 2, 1, 1, false, + MSM_DISPLAY_COMPRESSION_DSC }, + { SDE_RM_TOPOLOGY_PPSPLIT, 1, 0, 2, 1, true, + MSM_DISPLAY_COMPRESSION_NONE }, }; /** * topology information to be used when the ctl path version * is SDE_CTL_CFG_VERSION_1_0_0 */ -static const struct sde_rm_topology_def g_ctl_ver_1_top_table[] = { - { SDE_RM_TOPOLOGY_NONE, 0, 0, 0, 0, false }, - { SDE_RM_TOPOLOGY_SINGLEPIPE, 1, 0, 1, 1, false }, - { SDE_RM_TOPOLOGY_SINGLEPIPE_DSC, 1, 1, 1, 1, false }, - { SDE_RM_TOPOLOGY_SINGLEPIPE_VDC, 1, 1, 1, 1, false }, - { SDE_RM_TOPOLOGY_DUALPIPE, 2, 0, 2, 1, true }, - { SDE_RM_TOPOLOGY_DUALPIPE_DSC, 2, 2, 2, 1, true }, - { SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE, 2, 0, 1, 1, false }, - { SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE_DSC, 2, 1, 1, 1, false }, - { SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE_VDC, 2, 1, 1, 1, false }, - { SDE_RM_TOPOLOGY_DUALPIPE_DSCMERGE, 2, 2, 1, 1, false }, - { SDE_RM_TOPOLOGY_PPSPLIT, 1, 0, 2, 1, true }, +static const struct sde_rm_topology_def g_top_table_v1[SDE_RM_TOPOLOGY_MAX] = { + { SDE_RM_TOPOLOGY_NONE, 0, 0, 0, 0, false, + MSM_DISPLAY_COMPRESSION_NONE }, + { SDE_RM_TOPOLOGY_SINGLEPIPE, 1, 0, 1, 1, false, + MSM_DISPLAY_COMPRESSION_NONE }, + { SDE_RM_TOPOLOGY_SINGLEPIPE_DSC, 1, 1, 1, 1, false, + MSM_DISPLAY_COMPRESSION_DSC }, + { SDE_RM_TOPOLOGY_SINGLEPIPE_VDC, 1, 1, 1, 1, false, + MSM_DISPLAY_COMPRESSION_VDC }, + { SDE_RM_TOPOLOGY_DUALPIPE, 2, 0, 2, 1, true, + MSM_DISPLAY_COMPRESSION_NONE }, + { SDE_RM_TOPOLOGY_DUALPIPE_DSC, 2, 2, 2, 1, true, + MSM_DISPLAY_COMPRESSION_DSC }, + { SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE, 2, 0, 1, 1, false, + MSM_DISPLAY_COMPRESSION_NONE }, + { SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE_DSC, 2, 1, 1, 1, false, + MSM_DISPLAY_COMPRESSION_DSC }, + { SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE_VDC, 2, 1, 1, 1, false, + MSM_DISPLAY_COMPRESSION_VDC }, + { SDE_RM_TOPOLOGY_DUALPIPE_DSCMERGE, 2, 2, 1, 1, false, + MSM_DISPLAY_COMPRESSION_DSC }, + { SDE_RM_TOPOLOGY_PPSPLIT, 1, 0, 2, 1, true, + MSM_DISPLAY_COMPRESSION_NONE }, }; @@ -308,14 +329,15 @@ void sde_rm_init_hw_iter( iter->type = type; } -enum sde_rm_topology_name sde_rm_get_topology_name( - struct msm_display_topology topology) +enum sde_rm_topology_name sde_rm_get_topology_name(struct sde_rm *rm, + struct msm_display_topology topology) { int i; for (i = 0; i < SDE_RM_TOPOLOGY_MAX; i++) - if (RM_IS_TOPOLOGY_MATCH(g_top_table[i], topology)) - return g_top_table[i].top_name; + if (RM_IS_TOPOLOGY_MATCH(rm->topology_tbl[i], + topology)) + return rm->topology_tbl[i].top_name; return SDE_RM_TOPOLOGY_NONE; } @@ -714,7 +736,7 @@ int sde_rm_init(struct sde_rm *rm, rm->dev = dev; if (IS_SDE_CTL_REV_100(cat->ctl_rev)) - rm->topology_tbl = g_ctl_ver_1_top_table; + rm->topology_tbl = g_top_table_v1; else rm->topology_tbl = g_top_table; @@ -2035,7 +2057,8 @@ static struct drm_connector *_sde_rm_get_connector( return conn; } -int sde_rm_update_topology(struct drm_connector_state *conn_state, +int sde_rm_update_topology(struct sde_rm *rm, + struct drm_connector_state *conn_state, struct msm_display_topology *topology) { int i, ret = 0; @@ -2048,8 +2071,8 @@ int sde_rm_update_topology(struct drm_connector_state *conn_state, if (topology) { top = *topology; for (i = 0; i < SDE_RM_TOPOLOGY_MAX; i++) - if (RM_IS_TOPOLOGY_MATCH(g_top_table[i], top)) { - top_name = g_top_table[i].top_name; + if (RM_IS_TOPOLOGY_MATCH(rm->topology_tbl[i], top)) { + top_name = rm->topology_tbl[i].top_name; break; } } diff --git a/msm/sde/sde_rm.h b/msm/sde/sde_rm.h index df1fb5ffa5..c39d56a3ec 100644 --- a/msm/sde/sde_rm.h +++ b/msm/sde/sde_rm.h @@ -88,6 +88,7 @@ enum sde_rm_qsync_modes { * @num_intf: number of interface used * @num_ctl: number of control path used * @needs_split_display: If set split display is enabled + * @comp_type: type of compression supported */ struct sde_rm_topology_def { enum sde_rm_topology_name top_name; @@ -95,7 +96,8 @@ struct sde_rm_topology_def { int num_comp_enc; int num_intf; int num_ctl; - int needs_split_display; + bool needs_split_display; + enum msm_display_compression_type comp_type; }; /** @@ -156,11 +158,12 @@ struct sde_rm_hw_request { /** * sde_rm_get_topology_name - get the name of the given topology config + * @rm: SDE resource manager handle * @topology: msm_display_topology topology config * @Return: name of the given topology */ -enum sde_rm_topology_name sde_rm_get_topology_name( - struct msm_display_topology topology); +enum sde_rm_topology_name sde_rm_get_topology_name(struct sde_rm *rm, + struct msm_display_topology topology); /** @@ -273,11 +276,13 @@ int sde_rm_cont_splash_res_init(struct msm_drm_private *priv, /** * sde_rm_update_topology - sets topology property of the connector + * @rm: SDE resource manager handle * @conn_state: drm state of the connector * @topology: topology selected for the display * @return: 0 on success or error */ -int sde_rm_update_topology(struct drm_connector_state *conn_state, +int sde_rm_update_topology(struct sde_rm *rm, + struct drm_connector_state *conn_state, struct msm_display_topology *topology); /**