summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Liu <r66033@freescale.com>2014-05-12 14:56:25 +0800
committerLoren Huang <b02279@freescale.com>2014-08-20 22:51:57 +0800
commite2363cd4a83dafe8dae2f03646406efa114bacb9 (patch)
tree46a51357f32f835a500c448dd5dac64852c725c8
parentae8710fcddbbdfa6dcc6821e51ad58e81e45b492 (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> (cherry picked from commit 6fbb4058a21d24384e4c8f2d3fd8ef33c2141302) (cherry picked from commit dde88d1e7c3173c16844c9a0fa7f84365fa4ed76)
-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 a2ad58796927..63ed89e00d27 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
@@ -534,7 +534,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>
@@ -675,7 +675,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. */
@@ -867,7 +867,7 @@ _AllocateMemory_Retry:
if (node == gcvNULL)
{
-#ifdef CONFIG_ANDROID_RESERVED_MEMORY_ACCOUNT
+#ifdef CONFIG_GPU_LOW_MEMORY_KILLER
if(forceContiguous == gcvTRUE)
{
int ret;
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