Commit dab385a8 authored by Otavio Salvador's avatar Otavio Salvador

linux-imx (3.0.35): Add support to Vivante 4.6.9p12 GPU code

This backport the support for Vivante 4.6.9p12 GPU from 3.5.7 kernel
while Freescale does not make a new 3.0.35 release with this.

Change-Id: I34a4d2a6a2afa5437ab444e2259a43b523123438
Signed-off-by: default avatarOtavio Salvador <otavio@ossystems.com.br>
parent deb0bf5d
From 2df4dba8faa9a781a5a1c6c09d646d2b692c9a0c Mon Sep 17 00:00:00 2001
From: Loren Huang <b02279@freescale.com>
Date: Tue, 4 Jun 2013 15:08:15 +0800
Subject: [PATCH 2/6] ENGR00265465 gpu:Add global value for minimum 3D clock
export
Add global value gpu3DMinClock so that minimum 3D clock can be change by user.
When gpu min clock is too low, it may cause IPU starvation issue in certain case.
Use echo x > /sys/module/galcore/parameters/gpu3DMinClock to change it.
Cherry-pick from 3.0.35 branch.
Upstream-Status: Backport [3.5.7-1.0.0]
Signed-off-by: Loren Huang <b02279@freescale.com>
Acked-by: Lily Zhang
---
drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c | 6 +++++-
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c | 3 +++
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c
index 3829999..ebd36fe 100644
--- a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c
+++ b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c
@@ -36,6 +36,7 @@ typedef struct _gcsiDEBUG_REGISTERS
}
gcsiDEBUG_REGISTERS;
+extern int gpu3DMinClock;
/******************************************************************************\
********************************* Support Code *********************************
\******************************************************************************/
@@ -4630,7 +4631,10 @@ gckHARDWARE_GetFscaleValue(
)
{
*FscaleValue = Hardware->powerOnFscaleVal;
- *MinFscaleValue = 1;
+ if ((gpu3DMinClock > 0) && (gpu3DMinClock <= 64) && (Hardware->core == gcvCORE_MAJOR))
+ *MinFscaleValue = gpu3DMinClock;
+ else
+ *MinFscaleValue = 1;
*MaxFscaleValue = 64;
return gcvSTATUS_OK;
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
index 2ed3d0e..64cace1 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
@@ -146,6 +146,9 @@ module_param(logFileSize,uint, 0644);
static int showArgs = 0;
module_param(showArgs, int, 0644);
+int gpu3DMinClock = 0;
+module_param(gpu3DMinClock, int, 0644);
+
#if ENABLE_GPU_CLOCK_BY_DRIVER
unsigned long coreClock = 156000000;
module_param(coreClock, ulong, 0644);
--
1.8.3.2
From 1579de9397783ab5321c80f1e76661653ef38ccd Mon Sep 17 00:00:00 2001
From: Robin Gong <b38343@freescale.com>
Date: Thu, 9 May 2013 11:45:55 +0800
Subject: [PATCH 3/6] ENGR00261814-4 gpu: use new PU power on/off interface
use new PU power on/off interface in GPU driver
Upstream-Status: Backport [3.5.7-1.0.0]
Signed-off-by: Robin Gong <b38343@freescale.com>
Acked-by: Lily Zhang
---
.../mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
index 9c2bae6..dfbc699 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
@@ -6819,8 +6819,13 @@ gckOS_SetGPUPower(
}
if((Power == gcvTRUE) && (oldPowerState == gcvFALSE))
{
- if(!IS_ERR(Os->device->gpu_regulator))
- regulator_enable(Os->device->gpu_regulator);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
+ if(!IS_ERR(Os->device->gpu_regulator))
+ regulator_enable(Os->device->gpu_regulator);
+#else
+ imx_gpc_power_up_pu(true);
+#endif
+
#ifdef CONFIG_PM
pm_runtime_get_sync(Os->device->pmdev);
#endif
@@ -6930,8 +6935,13 @@ gckOS_SetGPUPower(
#ifdef CONFIG_PM
pm_runtime_put_sync(Os->device->pmdev);
#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
if(!IS_ERR(Os->device->gpu_regulator))
- regulator_disable(Os->device->gpu_regulator);
+ regulator_disable(Os->device->gpu_regulator);
+#else
+ imx_gpc_power_up_pu(false);
+#endif
}
/* TODO: Put your code here. */
gcmkFOOTER_NO();
--
1.8.3.2
From a845abe4589366d3e37b5a646be6337984074b28 Mon Sep 17 00:00:00 2001
From: Loren HUANG <b02279@freescale.com>
Date: Wed, 22 May 2013 17:21:30 +0800
Subject: [PATCH 5/6] ENGR00264275 [GPU]Correct suspend/resume calling after
adding runtime pm.
After enabling runtime pm the suspend/resume entry is changed.
-Add new entry for suspend/resume in runtime pm frame work.
-Add static define for all runtime pm function.
Upstream-Status: Backport [3.5.7-1.0.0]
Signed-off-by: Loren HUANG <b02279@freescale.com>
Acked-by: Lily Zhang
---
.../gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
index 183000d..3632a6c 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
@@ -1252,20 +1252,32 @@ static const struct of_device_id mxs_gpu_dt_ids[] = {
MODULE_DEVICE_TABLE(of, mxs_gpu_dt_ids);
#ifdef CONFIG_PM
-int gpu_runtime_suspend(struct device *dev)
+static int gpu_runtime_suspend(struct device *dev)
{
release_bus_freq(BUS_FREQ_HIGH);
return 0;
}
-int gpu_runtime_resume(struct device *dev)
+static int gpu_runtime_resume(struct device *dev)
{
request_bus_freq(BUS_FREQ_HIGH);
return 0;
}
+static int gpu_system_suspend(struct device *dev)
+{
+ pm_message_t state={0};
+ return gpu_suspend(to_platform_device(dev), state);
+}
+
+static int gpu_system_resume(struct device *dev)
+{
+ return gpu_resume(to_platform_device(dev));
+}
+
static const struct dev_pm_ops gpu_pm_ops = {
SET_RUNTIME_PM_OPS(gpu_runtime_suspend, gpu_runtime_resume, NULL)
+ SET_SYSTEM_SLEEP_PM_OPS(gpu_system_suspend, gpu_system_resume)
};
#endif
#endif
--
1.8.3.2
From 376d63e9b981118f83646a836ce6626e541de1a3 Mon Sep 17 00:00:00 2001
From: Loren HUANG <b02279@freescale.com>
Date: Fri, 31 May 2013 18:29:58 +0800
Subject: [PATCH 6/6] ENGR00265130 gpu:Correct section mismatch in gpu kernel
driver
-Remove the __devinit for suspend/resume function.
-Replace __devinit to __devexit for remove function.
Upstream-Status: Backport [3.5.7-1.0.0]
Signed-off-by: Loren HUANG <b02279@freescale.com>
Acked-by: Lily Zhang
---
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
index 3632a6c..9d9dc57 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c
@@ -1111,7 +1111,7 @@ static int __devinit gpu_probe(struct platform_device *pdev)
return ret;
}
-static int __devinit gpu_remove(struct platform_device *pdev)
+static int __devexit gpu_remove(struct platform_device *pdev)
{
gcmkHEADER();
#if gcdENABLE_FSCALE_VAL_ADJUST
@@ -1123,7 +1123,7 @@ static int __devinit gpu_remove(struct platform_device *pdev)
return 0;
}
-static int __devinit gpu_suspend(struct platform_device *dev, pm_message_t state)
+static int gpu_suspend(struct platform_device *dev, pm_message_t state)
{
gceSTATUS status;
gckGALDEVICE device;
@@ -1173,7 +1173,7 @@ static int __devinit gpu_suspend(struct platform_device *dev, pm_message_t state
return 0;
}
-static int __devinit gpu_resume(struct platform_device *dev)
+static int gpu_resume(struct platform_device *dev)
{
gceSTATUS status;
gckGALDEVICE device;
@@ -1284,7 +1284,7 @@ static const struct dev_pm_ops gpu_pm_ops = {
static struct platform_driver gpu_driver = {
.probe = gpu_probe,
- .remove = gpu_remove,
+ .remove = __devexit_p(gpu_remove),
.suspend = gpu_suspend,
.resume = gpu_resume,
--
1.8.3.2
From b37a944f55a5010bd08297a63db0275540922f32 Mon Sep 17 00:00:00 2001
From: Otavio Salvador <otavio@ossystems.com.br>
Date: Thu, 22 Aug 2013 16:31:29 -0300
Subject: [PATCH] drm/vivante: Add ":00" sufix in returned bus Id
This makes the 3.0.35 compatible with a Xorg driver build for 3.5.7 or
newer kernels.
Upstream-Status: Inapropriate [embedded specific]
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
drivers/gpu/drm/vivante/vivante_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vivante/vivante_drv.c b/drivers/gpu/drm/vivante/vivante_drv.c
index 4224608..cea360d 100644
--- a/drivers/gpu/drm/vivante/vivante_drv.c
+++ b/drivers/gpu/drm/vivante/vivante_drv.c
@@ -55,7 +55,7 @@
#include "drm_pciids.h"
-static char platformdevicename[] = "Vivante GCCore";
+static char platformdevicename[] = "Vivante GCCore:00";
static struct platform_device *pplatformdev;
static struct drm_driver driver = {
--
1.8.4.rc1
......@@ -10,3 +10,12 @@ COMPATIBLE_MACHINE = "(mx6)"
# Revision of 4.0.0 branch
SRCREV = "3383d801188adc582b849c6fd1fe1c53be7dbaa9"
LOCALVERSION = "-4.0.0+yocto"
# GPU support patches
SRC_URI += "file://drm-vivante-Add-00-sufix-in-returned-bus-Id.patch \
file://0001-ENGR00255688-4.6.9p11.1-gpu-GPU-Kernel-driver-integr.patch \
file://0002-ENGR00265465-gpu-Add-global-value-for-minimum-3D-clo.patch \
file://0003-ENGR00261814-4-gpu-use-new-PU-power-on-off-interface.patch \
file://0004-ENGR00264288-1-GPU-Integrate-4.6.9p12-release-kernel.patch \
file://0005-ENGR00264275-GPU-Correct-suspend-resume-calling-afte.patch \
file://0006-ENGR00265130-gpu-Correct-section-mismatch-in-gpu-ker.patch"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment