disp: msm: update rm topology mapping tables

This change updates resource topology mapping tables and includes
logic to compare compression types for dsc vs vdc.

Change-Id: I1735edeb07aec8ed0065f84ac0824c58158412f3
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
This commit is contained in:
Narendra Muppalla
2020-03-30 15:11:45 -07:00
committed by Gerrit - the friendly Code Review server
parent 62cb53cc59
commit 218244e58b
7 changed files with 72 additions and 40 deletions

View File

@@ -425,6 +425,7 @@ int dp_connector_get_mode_info(struct drm_connector *connector,
sizeof(mode_info->comp_info)); sizeof(mode_info->comp_info));
topology->num_enc = topology->num_lm; topology->num_enc = topology->num_lm;
topology->comp_type = mode_info->comp_info.comp_type;
} }
return 0; return 0;

View File

@@ -512,14 +512,14 @@ int dsi_conn_get_mode_info(struct drm_connector *connector,
memcpy(&mode_info->topology, &dsi_mode.priv_info->topology, memcpy(&mode_info->topology, &dsi_mode.priv_info->topology,
sizeof(struct msm_display_topology)); sizeof(struct msm_display_topology));
mode_info->comp_info.comp_type = MSM_DISPLAY_COMPRESSION_NONE;
if (dsi_mode.priv_info->dsc_enabled) { if (dsi_mode.priv_info->dsc_enabled) {
mode_info->comp_info.comp_type = MSM_DISPLAY_COMPRESSION_DSC; 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, memcpy(&mode_info->comp_info.dsc_info, &dsi_mode.priv_info->dsc,
sizeof(dsi_mode.priv_info->dsc)); sizeof(dsi_mode.priv_info->dsc));
} else if (dsi_mode.priv_info->vdc_enabled) { } else if (dsi_mode.priv_info->vdc_enabled) {
mode_info->comp_info.comp_type = MSM_DISPLAY_COMPRESSION_VDC; 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, memcpy(&mode_info->comp_info.vdc_info, &dsi_mode.priv_info->vdc,
sizeof(dsi_mode.priv_info->vdc)); sizeof(dsi_mode.priv_info->vdc));
} }

View File

@@ -645,11 +645,13 @@ struct msm_compression_info {
* @num_lm: number of layer mixers used * @num_lm: number of layer mixers used
* @num_enc: number of compression encoder blocks used * @num_enc: number of compression encoder blocks used
* @num_intf: number of interfaces the panel is mounted on * @num_intf: number of interfaces the panel is mounted on
* @comp_type: type of compression supported
*/ */
struct msm_display_topology { struct msm_display_topology {
u32 num_lm; u32 num_lm;
u32 num_enc; u32 num_enc;
u32 num_intf; u32 num_intf;
enum msm_display_compression_type comp_type;
}; };
/** /**

View File

@@ -2303,8 +2303,8 @@ static int sde_connector_populate_mode_info(struct drm_connector *conn,
sde_kms_info_add_keyint(info, "bit_clk_rate", sde_kms_info_add_keyint(info, "bit_clk_rate",
mode_info.clk_rate); mode_info.clk_rate);
topology_idx = (int)sde_rm_get_topology_name( topology_idx = (int)sde_rm_get_topology_name(&sde_kms->rm,
mode_info.topology); mode_info.topology);
if (topology_idx < SDE_RM_TOPOLOGY_MAX) { if (topology_idx < SDE_RM_TOPOLOGY_MAX) {
sde_kms_info_add_keystr(info, "topology", sde_kms_info_add_keystr(info, "topology",
e_topology_name[topology_idx].name); e_topology_name[topology_idx].name);

View File

@@ -877,7 +877,8 @@ static int _sde_encoder_atomic_check_reserve(struct drm_encoder *drm_enc,
if (crtc_state->active) if (crtc_state->active)
topology = &sde_conn_state->mode_info.topology; 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) { if (ret) {
SDE_ERROR_ENC(sde_enc, SDE_ERROR_ENC(sde_enc,
"RM failed to update topology, rc: %d\n", ret); "RM failed to update topology, rc: %d\n", ret);

View File

@@ -31,40 +31,61 @@
#define RM_RQ_CWB(r) ((r)->top_ctrl & BIT(SDE_RM_TOPCTL_CWB)) #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 && \ #define RM_IS_TOPOLOGY_MATCH(t, r) ((t).num_lm == (r).num_lm && \
(t).num_comp_enc == (r).num_enc && \ (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 * toplogy information to be used when ctl path version does not
* support driving more than one interface per ctl_path * support driving more than one interface per ctl_path
*/ */
static const struct sde_rm_topology_def g_top_table[] = { static const struct sde_rm_topology_def g_top_table[SDE_RM_TOPOLOGY_MAX] = {
{ SDE_RM_TOPOLOGY_NONE, 0, 0, 0, 0, false }, { SDE_RM_TOPOLOGY_NONE, 0, 0, 0, 0, false,
{ SDE_RM_TOPOLOGY_SINGLEPIPE, 1, 0, 1, 1, false }, MSM_DISPLAY_COMPRESSION_NONE },
{ SDE_RM_TOPOLOGY_SINGLEPIPE_DSC, 1, 1, 1, 1, false }, { SDE_RM_TOPOLOGY_SINGLEPIPE, 1, 0, 1, 1, false,
{ SDE_RM_TOPOLOGY_DUALPIPE, 2, 0, 2, 2, true }, MSM_DISPLAY_COMPRESSION_NONE },
{ SDE_RM_TOPOLOGY_DUALPIPE_DSC, 2, 2, 2, 2, true }, { SDE_RM_TOPOLOGY_SINGLEPIPE_DSC, 1, 1, 1, 1, false,
{ SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE, 2, 0, 1, 1, false }, MSM_DISPLAY_COMPRESSION_DSC },
{ SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE_DSC, 2, 1, 1, 1, false }, { SDE_RM_TOPOLOGY_DUALPIPE, 2, 0, 2, 2, true,
{ SDE_RM_TOPOLOGY_DUALPIPE_DSCMERGE, 2, 2, 1, 1, false }, MSM_DISPLAY_COMPRESSION_NONE },
{ SDE_RM_TOPOLOGY_PPSPLIT, 1, 0, 2, 1, true }, { 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 * topology information to be used when the ctl path version
* is SDE_CTL_CFG_VERSION_1_0_0 * is SDE_CTL_CFG_VERSION_1_0_0
*/ */
static const struct sde_rm_topology_def g_ctl_ver_1_top_table[] = { static const struct sde_rm_topology_def g_top_table_v1[SDE_RM_TOPOLOGY_MAX] = {
{ SDE_RM_TOPOLOGY_NONE, 0, 0, 0, 0, false }, { SDE_RM_TOPOLOGY_NONE, 0, 0, 0, 0, false,
{ SDE_RM_TOPOLOGY_SINGLEPIPE, 1, 0, 1, 1, false }, MSM_DISPLAY_COMPRESSION_NONE },
{ SDE_RM_TOPOLOGY_SINGLEPIPE_DSC, 1, 1, 1, 1, false }, { SDE_RM_TOPOLOGY_SINGLEPIPE, 1, 0, 1, 1, false,
{ SDE_RM_TOPOLOGY_SINGLEPIPE_VDC, 1, 1, 1, 1, false }, MSM_DISPLAY_COMPRESSION_NONE },
{ SDE_RM_TOPOLOGY_DUALPIPE, 2, 0, 2, 1, true }, { SDE_RM_TOPOLOGY_SINGLEPIPE_DSC, 1, 1, 1, 1, false,
{ SDE_RM_TOPOLOGY_DUALPIPE_DSC, 2, 2, 2, 1, true }, MSM_DISPLAY_COMPRESSION_DSC },
{ SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE, 2, 0, 1, 1, false }, { SDE_RM_TOPOLOGY_SINGLEPIPE_VDC, 1, 1, 1, 1, false,
{ SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE_DSC, 2, 1, 1, 1, false }, MSM_DISPLAY_COMPRESSION_VDC },
{ SDE_RM_TOPOLOGY_DUALPIPE_3DMERGE_VDC, 2, 1, 1, 1, false }, { SDE_RM_TOPOLOGY_DUALPIPE, 2, 0, 2, 1, true,
{ SDE_RM_TOPOLOGY_DUALPIPE_DSCMERGE, 2, 2, 1, 1, false }, MSM_DISPLAY_COMPRESSION_NONE },
{ SDE_RM_TOPOLOGY_PPSPLIT, 1, 0, 2, 1, true }, { 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; iter->type = type;
} }
enum sde_rm_topology_name sde_rm_get_topology_name( enum sde_rm_topology_name sde_rm_get_topology_name(struct sde_rm *rm,
struct msm_display_topology topology) struct msm_display_topology topology)
{ {
int i; int i;
for (i = 0; i < SDE_RM_TOPOLOGY_MAX; i++) for (i = 0; i < SDE_RM_TOPOLOGY_MAX; i++)
if (RM_IS_TOPOLOGY_MATCH(g_top_table[i], topology)) if (RM_IS_TOPOLOGY_MATCH(rm->topology_tbl[i],
return g_top_table[i].top_name; topology))
return rm->topology_tbl[i].top_name;
return SDE_RM_TOPOLOGY_NONE; return SDE_RM_TOPOLOGY_NONE;
} }
@@ -714,7 +736,7 @@ int sde_rm_init(struct sde_rm *rm,
rm->dev = dev; rm->dev = dev;
if (IS_SDE_CTL_REV_100(cat->ctl_rev)) 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 else
rm->topology_tbl = g_top_table; rm->topology_tbl = g_top_table;
@@ -2035,7 +2057,8 @@ static struct drm_connector *_sde_rm_get_connector(
return conn; 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) struct msm_display_topology *topology)
{ {
int i, ret = 0; int i, ret = 0;
@@ -2048,8 +2071,8 @@ int sde_rm_update_topology(struct drm_connector_state *conn_state,
if (topology) { if (topology) {
top = *topology; top = *topology;
for (i = 0; i < SDE_RM_TOPOLOGY_MAX; i++) for (i = 0; i < SDE_RM_TOPOLOGY_MAX; i++)
if (RM_IS_TOPOLOGY_MATCH(g_top_table[i], top)) { if (RM_IS_TOPOLOGY_MATCH(rm->topology_tbl[i], top)) {
top_name = g_top_table[i].top_name; top_name = rm->topology_tbl[i].top_name;
break; break;
} }
} }

View File

@@ -88,6 +88,7 @@ enum sde_rm_qsync_modes {
* @num_intf: number of interface used * @num_intf: number of interface used
* @num_ctl: number of control path used * @num_ctl: number of control path used
* @needs_split_display: If set split display is enabled * @needs_split_display: If set split display is enabled
* @comp_type: type of compression supported
*/ */
struct sde_rm_topology_def { struct sde_rm_topology_def {
enum sde_rm_topology_name top_name; enum sde_rm_topology_name top_name;
@@ -95,7 +96,8 @@ struct sde_rm_topology_def {
int num_comp_enc; int num_comp_enc;
int num_intf; int num_intf;
int num_ctl; 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 * sde_rm_get_topology_name - get the name of the given topology config
* @rm: SDE resource manager handle
* @topology: msm_display_topology topology config * @topology: msm_display_topology topology config
* @Return: name of the given topology * @Return: name of the given topology
*/ */
enum sde_rm_topology_name sde_rm_get_topology_name( enum sde_rm_topology_name sde_rm_get_topology_name(struct sde_rm *rm,
struct msm_display_topology topology); 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 * sde_rm_update_topology - sets topology property of the connector
* @rm: SDE resource manager handle
* @conn_state: drm state of the connector * @conn_state: drm state of the connector
* @topology: topology selected for the display * @topology: topology selected for the display
* @return: 0 on success or error * @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); struct msm_display_topology *topology);
/** /**