* Rogue KM Version Note
*
* L 1.17:
- * Support gpu disable dvfs case.
- * Add rk_tf_check_version to compatible for rk3328.
+ * Support gpu disable dvfs case.
+ * Add rk_tf_check_version to compatible for rk3328.
* L 1.18:
- * If fix freq,then don't force to drop freq to the lowest.
+ * If fix freq,then don't force to drop freq to the lowest.
*
* M 1.21:
- * Merge 1.5_RTM3604260 DDK code.
+ * Merge 1.5_RTM3604260 DDK code.
* M 1.24:
- * Merge 1.5_ED3653583 DDK code.
+ * Merge 1.5_ED3653583 DDK code.
* M 1.28:
- * Merge 1.5_ED3776568 DDK code.
+ * Merge 1.5_ED3776568 DDK code.
* M 1.29
- * 1. Reopen bEnableRDPowIsland since it doesn't appear splash screen when click the drawerbutton.
- * 2. Don't set PVR_ANDROID_HAS_SET_BUFFERS_DATASPACE by default.
- * 3. Remove hGPUUtilLock to avoid dead lock.
- * 4. Get raw ion_device by IonDevAcquire.
+ * 1. Reopen bEnableRDPowIsland since it doesn't appear splash screen when click the drawerbutton.
+ * 2. Don't set PVR_ANDROID_HAS_SET_BUFFERS_DATASPACE by default.
+ * 3. Remove hGPUUtilLock to avoid dead lock.
+ * 4. Get raw ion_device by IonDevAcquire.
* M 1.31
- * 1. Merge 1.5_ED3830101 DDK code.
+ * 1. Merge 1.5_ED3830101 DDK code.
* M 1.31+
- * 1. Let Rogue M support kernel 4.4.
- * 2. Close OPEN_GPU_PD temporarily.
+ * 1. Let Rogue M support kernel 4.4.
+ * 2. Close OPEN_GPU_PD temporarily.
+ * M 1.31_2
+ * 1. Add GPU dvfs support.
+ * 2. Adjust the code indentation.
+ * 3. Use late_initcall instead of module_init to load gpu driver.
+ * 4. Add GPU pd support.
+ * 5. Disable RD power island.
*/
#define PVR_STR(X) #X
#include <linux/clk-private.h>
#else
#include <linux/clk-provider.h>
+#include <linux/pm_runtime.h>
#endif
#include <linux/pm_opp.h>
#include <asm/compiler.h>
}
#if OPEN_GPU_PD
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0))
/*
* The power management
* software must power down pd_gpu_1 before power down pd_gpu_0,
struct rk_context *platform;
platform = dev_get_drvdata(&gpsPVRLDMDev->dev);
-
PVR_ASSERT(platform != NULL);
if (!platform->bEnablePd && platform->pd_gpu_0 && platform->pd_gpu_1) {
struct rk_context *platform;
platform = dev_get_drvdata(&gpsPVRLDMDev->dev);
-
PVR_ASSERT(platform != NULL);
if (platform->bEnablePd && platform->pd_gpu_0 && platform->pd_gpu_1) {
PVR_DPF((PVR_DBG_WARNING, "Failed to enable gpu_pd clock!"));
}
}
+#else
+static IMG_VOID RgxEnablePower(IMG_VOID)
+{
+ struct rk_context *platform;
+
+ platform = dev_get_drvdata(&gpsPVRLDMDev->dev);
+ PVR_ASSERT(platform != NULL);
+
+ if (!platform->bEnablePd) {
+ pm_runtime_get_sync(&gpsPVRLDMDev->dev);
+ platform->bEnablePd = IMG_TRUE;
+ } else {
+ PVR_DPF((PVR_DBG_WARNING, "Failed to enable gpu_pd clock!"));
+ }
+}
+
+static IMG_VOID RgxDisablePower(IMG_VOID)
+{
+ struct rk_context *platform;
+
+ platform = dev_get_drvdata(&gpsPVRLDMDev->dev);
+
+ PVR_ASSERT(platform != NULL);
+
+ if (platform->bEnablePd) {
+ pm_runtime_put(&gpsPVRLDMDev->dev);
+ platform->bEnablePd = IMG_FALSE;
+ } else {
+ PVR_DPF((PVR_DBG_WARNING, "Failed to enable gpu_pd clock!"));
+ }
+}
#endif
+#endif //end of OPEN_GPU_PD
IMG_VOID RgxResume(IMG_VOID)
{
spin_lock_init(&platform->timer_lock);
#if OPEN_GPU_PD
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0))
platform->pd_gpu_0 = devm_clk_get(&gpsPVRLDMDev->dev, "pd_gpu_0");
if (IS_ERR_OR_NULL(platform->pd_gpu_0)) {
PVR_DPF((PVR_DBG_ERROR,
"RgxRkInit: Failed to find pd_gpu_1 clock source"));
goto fail1;
}
+#else
+ pm_runtime_enable(&gpsPVRLDMDev->dev);
#endif
+#endif //end of OPEN_GPU_PD
platform->aclk_gpu_mem =
devm_clk_get(&gpsPVRLDMDev->dev, "aclk_gpu_mem");
fail3:
platform->aclk_gpu_mem = NULL;
fail2:
-#if OPEN_GPU_PD
+#if OPEN_GPU_PD && (LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0))
platform->pd_gpu_1 = NULL;
fail1:
platform->pd_gpu_0 = NULL;
-fail0:
#else
return;
#endif //end of OPEN_GPU_PD
platform->aclk_gpu_mem = NULL;
}
#if OPEN_GPU_PD
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0))
if (platform->pd_gpu_1) {
platform->pd_gpu_1 = NULL;
}
if (platform->pd_gpu_0) {
platform->pd_gpu_0 = NULL;
}
+#else
+ pm_runtime_disable(&gpsPVRLDMDev->dev);
#endif
+#endif //OPEN_GPU_PD
if (platform->dvfs_enabled) {
#if RK33_DVFS_SUPPORT