summaryrefslogtreecommitdiff
path: root/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c')
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
index 4d48bd55f115..bff85a0e9bf4 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
@@ -25,7 +25,9 @@
#include <linux/mm.h>
#include <linux/mman.h>
#include <linux/slab.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
#include <mach/hardware.h>
+#endif
#include <linux/pm_runtime.h>
#define _GC_OBJ_ZONE gcvZONE_DEVICE
@@ -305,6 +307,7 @@ gckGALDEVICE_Construct(
IN gctUINT LogFileSize,
IN struct device *pdev,
IN gctINT PowerManagement,
+ IN gctINT GpuProfiler,
OUT gckGALDEVICE *Device
)
{
@@ -369,6 +372,10 @@ gckGALDEVICE_Construct(
#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)
/*get gpu regulator*/
device->gpu_regulator = regulator_get(pdev, "cpu_vddgpu");
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
+ device->gpu_regulator = devm_regulator_get(pdev, "pu");
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
if (IS_ERR(device->gpu_regulator)) {
gcmkTRACE_ZONE(gcvLEVEL_ERROR, gcvZONE_DRIVER,
"%s(%d): Failed to get gpu regulator %s/%s \n",
@@ -541,6 +548,10 @@ gckGALDEVICE_Construct(
device->kernels[gcvCORE_MAJOR]->hardware, PowerManagement
));
+ gcmkONERROR(gckHARDWARE_SetGpuProfiler(
+ device->kernels[gcvCORE_MAJOR]->hardware, GpuProfiler
+ ));
+
#if COMMAND_PROCESSOR_VERSION == 1
/* Start the command queue. */
gcmkONERROR(gckCOMMAND_Start(device->kernels[gcvCORE_MAJOR]->command));
@@ -599,6 +610,7 @@ gckGALDEVICE_Construct(
device->kernels[gcvCORE_2D]->hardware, PowerManagement
));
+
#if COMMAND_PROCESSOR_VERSION == 1
/* Start the command queue. */
gcmkONERROR(gckCOMMAND_Start(device->kernels[gcvCORE_2D]->command));
@@ -635,6 +647,7 @@ gckGALDEVICE_Construct(
device->kernels[gcvCORE_VG]->vg->hardware,
PowerManagement
));
+
#endif
}
else
@@ -849,6 +862,7 @@ gckGALDEVICE_Construct(
}
else
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0)
mem_region = request_mem_region(
ContiguousBase, ContiguousSize, "galcore managed memory"
);
@@ -864,6 +878,7 @@ gckGALDEVICE_Construct(
gcmkONERROR(gcvSTATUS_OUT_OF_RESOURCES);
}
+#endif
device->requestedContiguousBase = ContiguousBase;
device->requestedContiguousSize = ContiguousSize;