Bläddra i källkod

disp: msm: sde: add api to query topology details.

This change adds new resource manager api to get number of
ctl paths, interfaces and compression encoders used in the
current topology. This API is required to support both dsc
and vdc encoders and make implementation more generic.

Change-Id: I6cc25e51574cf71cd39f479049572ee7b7e0ead0
Signed-off-by: Abhijit Kulkarni <[email protected]>
Abhijit Kulkarni 6 år sedan
förälder
incheckning
a8f60081ae
2 ändrade filer med 17 tillägg och 8 borttagningar
  1. 8 2
      msm/sde/sde_encoder_phys.h
  2. 9 6
      msm/sde/sde_rm.h

+ 8 - 2
msm/sde/sde_encoder_phys.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2015-2020, The Linux Foundation. All rights reserved.
  */
 
 #ifndef __SDE_ENCODER_PHYS_H__
@@ -693,6 +693,7 @@ static inline bool _sde_encoder_phys_is_dual_ctl(
 {
 	struct sde_kms *sde_kms;
 	enum sde_rm_topology_name topology;
+	const struct sde_rm_topology_def* def;
 
 	if (!phys_enc) {
 		pr_err("invalid phys_enc\n");
@@ -706,8 +707,13 @@ static inline bool _sde_encoder_phys_is_dual_ctl(
 	}
 
 	topology = sde_connector_get_topology_name(phys_enc->connector);
+	def = sde_rm_topology_get_topology_def(&sde_kms->rm, topology);
+	if (IS_ERR_OR_NULL(def)) {
+		pr_err("invalid topology\n");
+		return false;
+	}
 
-	return sde_rm_topology_is_dual_ctl(&sde_kms->rm, topology);
+	return (def->num_ctl == 2) ? true : false;
 }
 
 /**

+ 9 - 6
msm/sde/sde_rm.h

@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
  */
 
 #ifndef __SDE_RM_H__
@@ -277,12 +277,15 @@ int sde_rm_update_topology(struct drm_connector_state *conn_state,
 	struct msm_display_topology *topology);
 
 /**
- * sde_rm_topology_is_dual_ctl - checks if topoloy requires two control paths
+ * sde_rm_topology_get_topology_def - returns the information about num
+ *	of hw blocks used in this topology
  * @rm: SDE Resource Manager handle
  * @topology: topology selected for the display
- * @return: true if two control paths are required or false
+ * @return: pointer to struct containing topology definition
  */
-static inline bool sde_rm_topology_is_dual_ctl(struct sde_rm *rm,
+static inline const struct sde_rm_topology_def*
+	sde_rm_topology_get_topology_def(
+		struct sde_rm *rm,
 		enum sde_rm_topology_name topology)
 {
 	if ((!rm) || (topology <= SDE_RM_TOPOLOGY_NONE) ||
@@ -290,10 +293,10 @@ static inline bool sde_rm_topology_is_dual_ctl(struct sde_rm *rm,
 		pr_err("invalid arguments: rm:%d topology:%d\n",
 				rm == NULL, topology);
 
-		return false;
+		return ERR_PTR(-EINVAL);
 	}
 
-	return rm->topology_tbl[topology].num_ctl == DUAL_CTL;
+	return &rm->topology_tbl[topology];
 }
 
 /**