disp: msm: sde: adjust DSC encoders to support all 4LM topologies

Add support for all 4LM topologies in new DCE encoder framework.
This change also aligns with the new way of checking topology
information.

Change-Id: I20785c96569fd07cbd8016d244a7e4c929bfa071
Signed-off-by: Amine Najahi <anajahi@codeaurora.org>
This commit is contained in:
Amine Najahi
2020-05-01 16:46:25 -04:00
parent 4fef803aff
commit 6a50aedbfa
11 changed files with 185 additions and 59 deletions

View File

@@ -2133,6 +2133,63 @@ bool sde_rm_topology_is_quad_pipe(struct sde_rm *rm,
return false;
}
bool sde_rm_topology_is_dual_pipe(struct sde_rm *rm,
struct drm_crtc_state *state)
{
int i;
struct sde_crtc_state *cstate;
uint64_t topology = SDE_RM_TOPOLOGY_NONE;
if ((!rm) || (!state)) {
pr_err("invalid arguments: rm:%d state:%d\n",
rm == NULL, state == NULL);
return false;
}
cstate = to_sde_crtc_state(state);
for (i = 0; i < cstate->num_connectors; i++) {
struct drm_connector *conn = cstate->connectors[i];
topology = sde_connector_get_topology_name(conn);
if (TOPOLOGY_DUALPIPE_MERGE_MODE(topology))
return true;
}
return false;
}
bool sde_rm_topology_is_3dmux_dsc(struct sde_rm *rm,
struct drm_crtc_state *state)
{
int i;
struct sde_crtc_state *cstate;
uint64_t topology = SDE_RM_TOPOLOGY_NONE;
const struct sde_rm_topology_def *def;
int num_lm, num_enc;
if ((!rm) || (!state)) {
pr_err("invalid arguments: rm:%d state:%d\n",
rm == NULL, state == NULL);
return false;
}
cstate = to_sde_crtc_state(state);
for (i = 0; i < cstate->num_connectors; i++) {
struct drm_connector *conn = cstate->connectors[i];
topology = sde_connector_get_topology_name(conn);
def = sde_rm_topology_get_topology_def(rm, topology);
num_lm = def->num_lm;
num_enc = def->num_comp_enc;
if (num_lm > num_enc && num_enc)
return true;
}
return false;
}
/**
* _sde_rm_release_rsvp - release resources and release a reservation
* @rm: KMS handle