summaryrefslogtreecommitdiff
path: root/drivers/mxc/gpu-viv
diff options
context:
space:
mode:
authorRichard Liu <r66033@freescale.com>2012-07-26 10:59:12 +0800
committerRichard Liu <r66033@freescale.com>2012-07-26 11:03:15 +0800
commit0396e473de89e1fb48a17e16b9ec7d1e37fa7461 (patch)
treee90f35f651e004bacaa5c8af93adf3951d0bc8e7 /drivers/mxc/gpu-viv
parentf63a8292fe128987ea4f8ab695f08a7fd9ea69bc (diff)
ENGR00217633 Add force contiguous memory pool in gpu driver
Add force contiguous memory pool in gpu driver Signed-off-by: Richard Liu <r66033@freescale.com> Acked-by: Lily Zhang
Diffstat (limited to 'drivers/mxc/gpu-viv')
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c13
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h2
3 files changed, 14 insertions, 3 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 4d16d182b231..b14bf79c038a 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
@@ -464,6 +464,7 @@ _AllocateMemory(
gctINT loopCount;
gcuVIDMEM_NODE_PTR node = gcvNULL;
gctBOOL tileStatusInVirtual;
+ gctBOOL forceContiguous = gcvFALSE;
gcmkHEADER_ARG("Kernel=0x%x *Pool=%d Bytes=%lu Alignment=%lu Type=%d",
Kernel, *Pool, Bytes, Alignment, Type);
@@ -474,6 +475,8 @@ _AllocateMemory(
/* Get initial pool. */
switch (pool = *Pool)
{
+ case gcvPOOL_DEFAULT_FORCE_CONTIGUOUS:
+ forceContiguous = gcvTRUE;
case gcvPOOL_DEFAULT:
case gcvPOOL_LOCAL:
pool = gcvPOOL_LOCAL_INTERNAL;
@@ -489,6 +492,12 @@ _AllocateMemory(
loopCount = (gctINT) gcvPOOL_NUMBER_OF_POOLS;
break;
+ case gcvPOOL_DEFAULT_FORCE_CONTIGUOUS_CACHEABLE:
+ pool = gcvPOOL_CONTIGUOUS;
+ loopCount = 1;
+ forceContiguous = gcvTRUE;
+ break;
+
default:
loopCount = 1;
break;
@@ -510,7 +519,7 @@ _AllocateMemory(
if (pool == gcvPOOL_CONTIGUOUS)
{
#if gcdCONTIGUOUS_SIZE_LIMIT
- if (Bytes > gcdCONTIGUOUS_SIZE_LIMIT)
+ if (Bytes > gcdCONTIGUOUS_SIZE_LIMIT && forceContiguous == gcvFALSE)
{
status = gcvSTATUS_OUT_OF_MEMORY;
}
@@ -521,7 +530,7 @@ _AllocateMemory(
status = gckVIDMEM_ConstructVirtual(Kernel, gcvTRUE, Bytes, &node);
}
- if (gcmIS_SUCCESS(status))
+ if (gcmIS_SUCCESS(status) || forceContiguous == gcvTRUE)
{
/* Memory allocated. */
break;
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h
index d0298eed15e9..85b41312f772 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h
@@ -159,6 +159,8 @@ typedef enum _gcePOOL
gcvPOOL_VIRTUAL,
gcvPOOL_USER,
gcvPOOL_CONTIGUOUS,
+ gcvPOOL_DEFAULT_FORCE_CONTIGUOUS,
+ gcvPOOL_DEFAULT_FORCE_CONTIGUOUS_CACHEABLE,
gcvPOOL_NUMBER_OF_POOLS
}
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h
index 27fbf5689340..d1ddd004dc3c 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h
@@ -765,7 +765,7 @@
limited by gcdCONTIGUOUS_SIZE_LIMIT.
*/
#ifndef gcdCONTIGUOUS_SIZE_LIMIT
-# define gcdCONTIGUOUS_SIZE_LIMIT 4096
+# define gcdCONTIGUOUS_SIZE_LIMIT 0
#endif
/* gcdALPHA_KILL_IN_SHADER