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

Commit ac7bd94d authored by Jayant Shekhar's avatar Jayant Shekhar
Browse files

drm/msm/sde: Add api to get number of dsc encoders in topology



Expose an api to query on number of dsc encoders required to support
a given topology in SDE driver.

Change-Id: I63aac35f2044f5251053e697ac796caad33372a7
Signed-off-by: default avatarJayant Shekhar <jshekhar@codeaurora.org>
parent fb1800c4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1406,6 +1406,9 @@ static int _sde_encoder_dsc_setup(struct sde_encoder_virt *sde_enc,
		return -EINVAL;
	}

	params->num_channels =
		sde_rm_get_topology_num_encoders(topology);

	SDE_DEBUG_ENC(sde_enc, "topology:%d\n", topology);
	SDE_EVT32(DRMID(&sde_enc->base), topology,
			sde_enc->cur_conn_roi.x,
+3 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 * Copyright (C) 2013 Red Hat
 * Author: Rob Clark <robdclark@gmail.com>
 *
@@ -58,11 +58,13 @@ struct sde_encoder_hw_resources {
 * @is_primary: set to true if the display is primary display
 * @affected_displays:  bitmask, bit set means the ROI of the commit lies within
 *                      the bounds of the physical display at the bit index
 * @num_channels: Add number of encoder channels
 */
struct sde_encoder_kickoff_params {
	u32 inline_rotate_prefill;
	u32 is_primary;
	unsigned long affected_displays;
	u32 num_channels;
};

/**
+12 −0
Original line number Diff line number Diff line
@@ -216,6 +216,18 @@ int sde_rm_get_hw_count(struct sde_rm *rm, uint32_t enc_id,
	mutex_unlock(&rm->rm_lock);
	return count;
}

int sde_rm_get_topology_num_encoders(enum sde_rm_topology_name topology)
{
	int i;

	for (i = 0; i < SDE_RM_TOPOLOGY_MAX; i++)
		if (g_top_table[i].top_name == topology)
			return g_top_table[i].num_comp_enc;

	return 0;
}

static bool _sde_rm_get_hw_locked(struct sde_rm *rm, struct sde_rm_hw_iter *i)
{
	struct list_head *blk_list;
+6 −0
Original line number Diff line number Diff line
@@ -120,6 +120,12 @@ struct sde_rm_hw_iter {
enum sde_rm_topology_name sde_rm_get_topology_name(
	struct msm_display_topology topology);

/**
 * sde_rm_get_topology_num_encoders - get number of encoders in given topology
 * @topology: topology name
 * @Return: number of encoders in given topology
 */
int sde_rm_get_topology_num_encoders(enum sde_rm_topology_name topology);

/**
 * sde_rm_init - Read hardware catalog and create reservation tracking objects