Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c244a5fa authored by Abhijit Kulkarni's avatar Abhijit Kulkarni Committed by Gerrit - the friendly Code Review server
Browse files

drm/msm/sde: add support to select topology table



The control path changes in sdm855 requires that topology table
is different from previous chipset. This changes adds support to
select the correct topology table based on the control path
features.

Change-Id: I6ad72f3072b66cdee00f04fea7469f510be04f84
Signed-off-by: default avatarAbhijit Kulkarni <kabhijit@codeaurora.org>
parent 2ffbe5f0
Loading
Loading
Loading
Loading
+28 −2
Original line number Diff line number Diff line
@@ -47,6 +47,10 @@ struct sde_rm_topology_def {
	int needs_split_display;
};

/**
 * 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 },
@@ -59,6 +63,23 @@ static const struct sde_rm_topology_def g_top_table[] = {
	{   SDE_RM_TOPOLOGY_PPSPLIT,              1, 0, 2, 1, true  },
};

/**
 * 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_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_DSCMERGE,    2, 2, 1, 1, false },
	{   SDE_RM_TOPOLOGY_PPSPLIT,              1, 0, 2, 1, true  },
};


/**
 * struct sde_rm_requirements - Reservation requirements parameter bundle
 * @top_ctrl:  topology control preference from kernel client
@@ -417,6 +438,11 @@ 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;
	else
		rm->topology_tbl = g_top_table;

	/* Some of the sub-blocks require an mdptop to be created */
	rm->hw_mdp = sde_hw_mdptop_init(MDP_TOP, mmio, cat);
	if (IS_ERR_OR_NULL(rm->hw_mdp)) {
@@ -1583,9 +1609,9 @@ static int _sde_rm_populate_requirements(
	sde_encoder_get_hw_resources(enc, &reqs->hw_res, conn_state);

	for (i = 0; i < SDE_RM_TOPOLOGY_MAX; i++) {
		if (RM_IS_TOPOLOGY_MATCH(g_top_table[i],
		if (RM_IS_TOPOLOGY_MATCH(rm->topology_tbl[i],
					reqs->hw_res.topology)) {
			reqs->topology = &g_top_table[i];
			reqs->topology = &rm->topology_tbl[i];
			break;
		}
	}
+1 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@ struct sde_rm {
	uint32_t lm_max_width;
	uint32_t rsvp_next_seq;
	struct mutex rm_lock;
	const struct sde_rm_topology_def *topology_tbl;
};

/**