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

Commit 1b8263ad authored by Jayaprakash's avatar Jayaprakash
Browse files

disp: msm: sde: modify dsc blocks reservation check in RM



Add changes to reserve dsc blocks by routing even numbered
dsc encoders to even pingpong blks and odd numbered dsc encoders
to odd numbered pingpong blks.

Change-Id: I9242b3f7a2784194f9e4a7d30eff6ae3ec16b196
Signed-off-by: default avatarJayaprakash <jmadiset@codeaurora.org>
parent ee482d3c
Loading
Loading
Loading
Loading
+33 −4
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#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)
#define IS_COMPATIBLE_PP_DSC(p, d) (p % 2 == d % 2)

/**
 * toplogy information to be used when ctl path version does not
@@ -1230,7 +1231,8 @@ static int _sde_rm_reserve_ctls(
static bool _sde_rm_check_dsc(struct sde_rm *rm,
		struct sde_rm_rsvp *rsvp,
		struct sde_rm_hw_blk *dsc,
		struct sde_rm_hw_blk *paired_dsc)
		struct sde_rm_hw_blk *paired_dsc,
		struct sde_rm_hw_blk *pp_blk)
{
	const struct sde_dsc_cfg *dsc_cfg = to_sde_hw_dsc(dsc->hw)->caps;

@@ -1240,6 +1242,14 @@ static bool _sde_rm_check_dsc(struct sde_rm *rm,
		return false;
	}

	/**
	 * This check is required for routing even numbered DSC
	 * blks to any of the even numbered PP blks and odd numbered
	 * DSC blks to any of the odd numbered PP blks.
	 */
	if (!pp_blk || !IS_COMPATIBLE_PP_DSC(pp_blk->id, dsc->id))
		return false;

	/* Check if this dsc is a peer of the proposed paired DSC */
	if (paired_dsc) {
		const struct sde_dsc_cfg *paired_dsc_cfg =
@@ -1255,6 +1265,22 @@ static bool _sde_rm_check_dsc(struct sde_rm *rm,
	return true;
}

static void sde_rm_get_rsvp_nxt_hw_blks(
		struct sde_rm *rm,
		struct sde_rm_rsvp *rsvp,
		int type,
		struct sde_rm_hw_blk **blk_arr)
{
	struct sde_rm_hw_blk *blk;
	int i = 0;

	list_for_each_entry(blk, &rm->hw_blks[type], list) {
		if (blk->rsvp_nxt && blk->rsvp_nxt->seq ==
					rsvp->seq)
			blk_arr[i++] = blk;
	}
}

static int _sde_rm_reserve_dsc(
		struct sde_rm *rm,
		struct sde_rm_rsvp *rsvp,
@@ -1263,6 +1289,7 @@ static int _sde_rm_reserve_dsc(
{
	struct sde_rm_hw_iter iter_i, iter_j;
	struct sde_rm_hw_blk *dsc[MAX_BLOCKS];
	struct sde_rm_hw_blk *pp[MAX_BLOCKS];
	int alloc_count = 0;
	int num_dsc_enc = top->num_comp_enc;
	int i;
@@ -1271,6 +1298,7 @@ static int _sde_rm_reserve_dsc(
		return 0;

	sde_rm_init_hw_iter(&iter_i, 0, SDE_HW_BLK_DSC);
	sde_rm_get_rsvp_nxt_hw_blks(rm, rsvp, SDE_HW_BLK_PINGPONG, pp);

	/* Find a first DSC */
	while (alloc_count != num_dsc_enc &&
@@ -1281,7 +1309,8 @@ static int _sde_rm_reserve_dsc(
		if (_dsc_ids && (iter_i.blk->id != _dsc_ids[alloc_count]))
			continue;

		if (!_sde_rm_check_dsc(rm, rsvp, iter_i.blk, NULL))
		if (!_sde_rm_check_dsc(rm, rsvp, iter_i.blk, NULL,
					 pp[alloc_count]))
			continue;

		SDE_DEBUG("blk id = %d, _dsc_ids[%d] = %d\n",
@@ -1303,8 +1332,8 @@ static int _sde_rm_reserve_dsc(
					_dsc_ids[alloc_count]))
				continue;

			if (!_sde_rm_check_dsc(rm, rsvp,
					iter_j.blk, iter_i.blk))
			if (!_sde_rm_check_dsc(rm, rsvp, iter_j.blk,
					 iter_i.blk, pp[alloc_count]))
				continue;

			SDE_DEBUG("blk id = %d, _dsc_ids[%d] = %d\n",