Explorar o código

disp: msm: sde: remove hardcoding of LLCC use case id

Remove hardcoding LLCC use case id and use catalog information
to decide which system cache section to use.

Change-Id: I9748ca1f3569db0cf77689af296def0759fe94cc
Signed-off-by: Amine Najahi <[email protected]>
Amine Najahi %!s(int64=3) %!d(string=hai) anos
pai
achega
213997b2c9
Modificáronse 3 ficheiros con 5 adicións e 4 borrados
  1. 2 4
      msm/sde/sde_core_perf.c
  2. 1 0
      msm/sde/sde_hw_catalog.c
  3. 2 0
      msm/sde/sde_hw_catalog.h

+ 2 - 4
msm/sde/sde_core_perf.c

@@ -13,7 +13,6 @@
 #include <linux/clk.h>
 #include <linux/bitmap.h>
 #include <linux/sde_rsc.h>
-#include <linux/platform_device.h>
 #include <linux/soc/qcom/llcc-qcom.h>
 
 #include "msm_prop.h"
@@ -328,7 +327,6 @@ static int _sde_core_perf_activate_llcc(struct sde_kms *kms,
 	struct drm_device *drm_dev;
 	struct device *dev;
 	struct platform_device *pdev;
-	u32 llcc_id[SDE_SYS_CACHE_MAX] = {LLCC_DISP};
 	int rc = 0;
 
 	if (!kms || !kms->dev || !kms->dev->dev) {
@@ -354,10 +352,10 @@ static int _sde_core_perf_activate_llcc(struct sde_kms *kms,
 		activate ? "" : "de",
 		type, kms->perf.llcc_active[type]);
 
-	slice = llcc_slice_getd(llcc_id[type]);
+	slice = llcc_slice_getd(kms->catalog->sc_cfg[type].llcc_uid);
 	if (IS_ERR_OR_NULL(slice))  {
 		SDE_ERROR("failed to get llcc slice for uid:%d\n",
-				llcc_id[type]);
+				kms->catalog->sc_cfg[type].llcc_uid);
 		rc = -EINVAL;
 		goto exit;
 	}

+ 1 - 0
msm/sde/sde_hw_catalog.c

@@ -3526,6 +3526,7 @@ static int sde_cache_parse_dt(struct device_node *np,
 			return -EINVAL;
 		}
 
+		sc_cfg->llcc_uid = usecase_id;
 		sc_cfg->llcc_scid = llcc_get_slice_id(slice);
 		sc_cfg->llcc_slice_size = llcc_get_slice_size(slice);
 		SDE_DEBUG("img cache:%d usecase_id:%d, scid:%d slice_size:%zu kb\n",

+ 2 - 0
msm/sde/sde_hw_catalog.h

@@ -1634,11 +1634,13 @@ struct sde_perf_cdp_cfg {
 /**
  * struct sde_sc_cfg - define system cache configuration
  * @has_sys_cache: true if system cache is enabled
+ * @llcc_uuid: llcc use case id for the system cache
  * @llcc_scid: scid for the system cache
  * @llcc_slice_size: slice size of the system cache
  */
 struct sde_sc_cfg {
 	bool has_sys_cache;
+	int llcc_uid;
 	int llcc_scid;
 	size_t llcc_slice_size;
 };