#include <asm/io.h>
#endif
-//#include <mali_kbase.h>
+#include <mali_kbase.h>
+#include <mali_kbase_defs.h>
+
#include "meson_main2.h"
int meson_gpu_data_invalid_count = 0;
int meson_gpu_fault = 0;
+extern u64 kbase_pm_get_ready_cores(struct kbase_device *kbdev, enum kbase_pm_core_type type);
static ssize_t domain_stat_read(struct class *class,
struct class_attribute *attr, char *buf)
{
unsigned int val;
+ u64 core_ready;
mali_plat_info_t* pmali_plat = get_mali_plat_data();
+ struct platform_device* ptr_plt_dev = pmali_plat->pdev;
+ struct kbase_device *kbdev = dev_get_drvdata(&ptr_plt_dev->dev);
- val = readl(pmali_plat->reg_base_aobus + 0xf0) & 0xff;
- return sprintf(buf, "%x\n", val>>4);
- return 0;
+ core_ready = kbase_pm_get_ready_cores(kbdev, KBASE_PM_CORE_SHADER);
+ val = core_ready;
+ return sprintf(buf, "%x\n", val);
}
#define PREHEAT_CMD "preheat"
return ret;
}
#ifdef CONFIG_DEVFREQ_THERMAL
+/* note:
+ * why return the config_pp which come from dts [num_of_pp] dirrectly
+ * 1. the return value only used for thermal,
+ * and we have not dynamic adjust the core num.
+ * 2. avoid influent the IC before T5.
+ * TODO: need improve it, if we add dynamic adjust the core num.*/
static u32 mali_get_online_pp(void)
{
- unsigned int val;
- mali_plat_info_t* pmali_plat = get_mali_plat_data();
+ u32 fix_pp_num = mali_plat_data.cfg_pp;
- val = readl(pmali_plat->reg_base_aobus + 0xf0) & 0xff;
- if (val == 0x07) /* No pp is working */
- return 0;
-
-#ifndef MESON_DRV_BRING
- return 2;
-#else
- return mali_executor_get_num_cores_enabled();
-#endif
+ return fix_pp_num;
}
#endif
#endif