summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Liu <r66033@freescale.com>2014-05-12 14:56:25 +0800
committerRichard Liu <r66033@freescale.com>2014-05-15 15:09:15 +0800
commit5db76ac6bdd54f3825a3e2d339bbd44ead73987e (patch)
tree49e9408f926af0913c9f4f647f53e4cf95c324b8
parent88397e3badf1539d763c8edc9c537ba79ecbf25a (diff)
ENGR00313001 separate GPU low memory killer and reserve memory account
separate GPU low memory killer and GPU reserve memory account query code, so that we can separate control GPU low memory killer and android system low memory killer to query the reserve memory account. Signed-off-by: Richard Liu <r66033@freescale.com>
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c6
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c14
2 files changed, 14 insertions, 6 deletions
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
index d10bf41b6df2..abcea2fe5398 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
@@ -536,7 +536,7 @@ gckKERNEL_Destroy(
return gcvSTATUS_OK;
}
-#ifdef CONFIG_ANDROID_RESERVED_MEMORY_ACCOUNT
+#ifdef CONFIG_GPU_LOW_MEMORY_KILLER
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/oom.h>
@@ -677,7 +677,7 @@ _AllocateMemory(
gcmkVERIFY_ARGUMENT(Pool != gcvNULL);
gcmkVERIFY_ARGUMENT(Bytes != 0);
-#ifdef CONFIG_ANDROID_RESERVED_MEMORY_ACCOUNT
+#ifdef CONFIG_GPU_LOW_MEMORY_KILLER
_AllocateMemory_Retry:
#endif
/* Get initial pool. */
@@ -869,7 +869,7 @@ _AllocateMemory_Retry:
if (node == gcvNULL)
{
-#ifdef CONFIG_ANDROID_RESERVED_MEMORY_ACCOUNT
+#ifdef CONFIG_GPU_LOW_MEMORY_KILLER
if(forceContiguous == gcvTRUE)
{
if(force_contiguous_lowmem_shrink(Kernel) == 0)
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 ebd316e24c5b..63ed28c9c326 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
@@ -1,7 +1,7 @@
/****************************************************************************
*
* Copyright (C) 2005 - 2013 by Vivante Corp.
-* Copyright (C) 2011-2013 Freescale Semiconductor, Inc.
+* Copyright (C) 2011-2014 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -37,6 +37,9 @@
#ifdef CONFIG_ANDROID_RESERVED_MEMORY_ACCOUNT
# include <linux/resmem_account.h>
+#endif
+
+#ifdef CONFIG_GPU_LOW_MEMORY_KILLER
# include <linux/kernel.h>
# include <linux/mm.h>
# include <linux/oom.h>
@@ -893,9 +896,11 @@ static int drv_init(struct device *pdev)
/* Reset the base address */
device->baseAddress = 0;
}
+#ifdef CONFIG_GPU_LOW_MEMORY_KILLER
+ task_free_register(&task_nb);
+#endif
#ifdef CONFIG_ANDROID_RESERVED_MEMORY_ACCOUNT
- task_free_register(&task_nb);
viv_gpu_resmem_handler.data = device->kernels[gcvCORE_MAJOR];
register_reserved_memory_account(&viv_gpu_resmem_handler);
#endif
@@ -980,8 +985,11 @@ static void drv_exit(void)
{
gcmkHEADER();
-#ifdef CONFIG_ANDROID_RESERVED_MEMORY_ACCOUNT
+#ifdef CONFIG_GPU_LOW_MEMORY_KILLER
task_free_unregister(&task_nb);
+#endif
+
+#ifdef CONFIG_ANDROID_RESERVED_MEMORY_ACCOUNT
unregister_reserved_memory_account(&viv_gpu_resmem_handler);
#endif