summaryrefslogtreecommitdiff
path: root/drivers/mxc/gpu-viv/hal/kernel
diff options
context:
space:
mode:
authorb02279 <b02279@b02279-Ubuntu64.(none)>2012-02-17 16:17:30 +0800
committerJason Liu <r64343@freescale.com>2012-07-20 13:23:02 +0800
commit5145beaad56e044a0b2e667e299be088f6eea998 (patch)
treeb9cb85a9000c66fd722c96cb7f0f4009a3c43901 /drivers/mxc/gpu-viv/hal/kernel
parentc2b6c819c44bad9cf7cd9836237bbaad58305935 (diff)
ENGR00174654 Update gpu kernel driver to vivante 4.6.5 release
Signed-off-by: Loren Huang <b02279@freescale.com> Acked-by: Lily Zhang
Diffstat (limited to 'drivers/mxc/gpu-viv/hal/kernel')
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c14
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h6
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c55
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c8
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_debug.c2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_heap.c2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_interrupt_vg.c2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c201
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu_vg.c2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_precomp.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c208
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h22
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h14
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_cl.h301
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_compiler.h54
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver_vg.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_dump.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h7
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine_vg.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h21
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_md5.h112
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_mem.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h55
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_profiler.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_raster.h8
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_rename.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_types.h2
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h6
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_vg.h2
36 files changed, 641 insertions, 493 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 4aeb53ce883a..dc4395904aea 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -1308,8 +1308,7 @@ gckKERNEL_Dispatch(
case gcvHAL_RESET:
/* Reset the hardware. */
- gcmkONERROR(
- gckHARDWARE_Reset(Kernel->hardware));
+ gckKERNEL_Recovery(Kernel);
break;
case gcvHAL_DEBUG:
@@ -1352,6 +1351,7 @@ gckKERNEL_Dispatch(
{
/* Video memory has no physical handles. */
physical = gcvNULL;
+ paddr = Interface->u.Cache.physical;
}
else
{
@@ -2501,11 +2501,19 @@ gckKERNEL_Recovery(
gcmkVERIFY_OBJECT(hardware, gcvOBJ_HARDWARE);
/* Handle all outstanding events now. */
+#if gcdSMP
+ gcmkONERROR(gckOS_AtomSet(Kernel->os, eventObj->pending, ~0U));
+#else
eventObj->pending = ~0U;
+#endif
gcmkONERROR(gckEVENT_Notify(eventObj, 1));
/* Again in case more events got submitted. */
+#if gcdSMP
+ gcmkONERROR(gckOS_AtomSet(Kernel->os, eventObj->pending, ~0U));
+#else
eventObj->pending = ~0U;
+#endif
gcmkONERROR(gckEVENT_Notify(eventObj, 2));
#if gcdSECURE_USER
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h
index b3228d7bae91..a331e2443e29 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -339,10 +339,6 @@ struct _gckKERNEL
#if gcdENABLE_VG
gckVGKERNEL vg;
#endif
-
-#if gcdMULTICORE_MAPPING
- gckKERNEL anotherKernel;
-#endif
};
/* gckCOMMAND object. */
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c
index ec9c8ee2ee56..35deaf3ce9f3 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -534,7 +534,7 @@ gckCOMMAND_Destroy(
gcmkVERIFY_OBJECT(Command, gcvOBJ_COMMAND);
/* Stop the command queue. */
- gcmkVERIFY_OK(gckCOMMAND_Stop(Command));
+ gcmkVERIFY_OK(gckCOMMAND_Stop(Command, gcvFALSE));
for (i = 0; i < gcdCOMMAND_QUEUES; ++i)
{
@@ -858,7 +858,8 @@ OnError:
*/
gceSTATUS
gckCOMMAND_Stop(
- IN gckCOMMAND Command
+ IN gckCOMMAND Command,
+ IN gctBOOL FromRecovery
)
{
gckHARDWARE hardware;
@@ -925,7 +926,7 @@ gckCOMMAND_Stop(
#endif
/* Wait for idle. */
- gcmkONERROR(gckHARDWARE_GetIdle(hardware, gcvTRUE, &idle));
+ gcmkONERROR(gckHARDWARE_GetIdle(hardware, !FromRecovery, &idle));
}
/* Command queue is no longer running. */
@@ -1001,10 +1002,14 @@ gckCOMMAND_Commit(
gctSIZE_T linkBytes;
gctSIZE_T bytes;
gctUINT32 offset;
+#if gcdNONPAGED_MEMORY_CACHEABLE
gctPHYS_ADDR entryPhysical;
+#endif
gctPOINTER entryLogical;
gctSIZE_T entryBytes;
+#if gcdNONPAGED_MEMORY_CACHEABLE
gctPHYS_ADDR exitPhysical;
+#endif
gctPOINTER exitLogical;
gctSIZE_T exitBytes;
gctPHYS_ADDR waitLinkPhysical;
@@ -1144,7 +1149,9 @@ gckCOMMAND_Commit(
}
/* Compute the entry. */
+#if gcdNONPAGED_MEMORY_CACHEABLE
entryPhysical = (gctUINT8_PTR) commandBufferPhysical + offset;
+#endif
entryLogical = commandBufferLogical + offset;
entryBytes = commandBufferSize - offset;
}
@@ -1177,13 +1184,17 @@ gckCOMMAND_Commit(
/* Compute the entry. */
if (Command->pipeSelect == gcvPIPE_2D)
{
+#if gcdNONPAGED_MEMORY_CACHEABLE
entryPhysical = (gctUINT8_PTR) contextBuffer->physical + pipeBytes;
+#endif
entryLogical = (gctUINT8_PTR) contextBuffer->logical + pipeBytes;
entryBytes = Context->bufferSize - pipeBytes;
}
else
{
+#if gcdNONPAGED_MEMORY_CACHEABLE
entryPhysical = (gctUINT8_PTR) contextBuffer->physical;
+#endif
entryLogical = (gctUINT8_PTR) contextBuffer->logical;
entryBytes = Context->bufferSize;
}
@@ -1243,13 +1254,17 @@ gckCOMMAND_Commit(
/* Compute the entry. */
if (Command->pipeSelect == gcvPIPE_2D)
{
+#if gcdNONPAGED_MEMORY_CACHEABLE
entryPhysical = (gctUINT8_PTR) contextBuffer->physical + pipeBytes;
+#endif
entryLogical = (gctUINT8_PTR) contextBuffer->logical + pipeBytes;
entryBytes = Context->entryOffset3D - pipeBytes;
}
else
{
+#if gcdNONPAGED_MEMORY_CACHEABLE
entryPhysical = (gctUINT8_PTR) contextBuffer->physical;
+#endif
entryLogical = (gctUINT8_PTR) contextBuffer->logical;
entryBytes = Context->entryOffset3D;
}
@@ -1319,7 +1334,9 @@ gckCOMMAND_Commit(
: Context->entryOffset3D;
/* Compute the entry. */
+#if gcdNONPAGED_MEMORY_CACHEABLE
entryPhysical = (gctUINT8_PTR) contextBuffer->physical + offset;
+#endif
entryLogical = (gctUINT8_PTR) contextBuffer->logical + offset;
entryBytes = Context->bufferSize - offset;
@@ -1367,10 +1384,11 @@ gckCOMMAND_Commit(
/* Compute the entry. */
if (Command->pipeSelect == gcvPIPE_3D)
{
+#if gcdNONPAGED_MEMORY_CACHEABLE
entryPhysical
= (gctUINT8_PTR) contextBuffer->physical
+ Context->entryOffsetXDFrom3D;
-
+#endif
entryLogical
= (gctUINT8_PTR) contextBuffer->logical
+ Context->entryOffsetXDFrom3D;
@@ -1381,10 +1399,11 @@ gckCOMMAND_Commit(
}
else
{
+#if gcdNONPAGED_MEMORY_CACHEABLE
entryPhysical
= (gctUINT8_PTR) contextBuffer->physical
+ Context->entryOffsetXDFrom2D;
-
+#endif
entryLogical
= (gctUINT8_PTR) contextBuffer->logical
+ Context->entryOffsetXDFrom2D;
@@ -1469,13 +1488,17 @@ gckCOMMAND_Commit(
/* Compute the entry. */
if (Command->pipeSelect == gcvPIPE_2D)
{
+#if gcdNONPAGED_MEMORY_CACHEABLE
entryPhysical = (gctUINT8_PTR) contextBuffer->physical + pipeBytes;
+#endif
entryLogical = (gctUINT8_PTR) contextBuffer->logical + pipeBytes;
entryBytes = Context->bufferSize - pipeBytes;
}
else
{
+#if gcdNONPAGED_MEMORY_CACHEABLE
entryPhysical = (gctUINT8_PTR) contextBuffer->physical;
+#endif
entryLogical = (gctUINT8_PTR) contextBuffer->logical;
entryBytes = Context->bufferSize;
}
@@ -1525,13 +1548,17 @@ gckCOMMAND_Commit(
/* Compute the entry. */
if (Command->pipeSelect == gcvPIPE_2D)
{
+#if gcdNONPAGED_MEMORY_CACHEABLE
entryPhysical = (gctUINT8_PTR) contextBuffer->physical + pipeBytes;
+#endif
entryLogical = (gctUINT8_PTR) contextBuffer->logical + pipeBytes;
entryBytes = Context->entryOffset3D - pipeBytes;
}
else
{
+#if gcdNONPAGED_MEMORY_CACHEABLE
entryPhysical = (gctUINT8_PTR) contextBuffer->physical;
+#endif
entryLogical = (gctUINT8_PTR) contextBuffer->logical;
entryBytes = Context->entryOffset3D;
}
@@ -1589,7 +1616,9 @@ gckCOMMAND_Commit(
: Context->entryOffset3D;
/* Compute the entry. */
+#if gcdNONPAGED_MEMORY_CACHEABLE
entryPhysical = (gctUINT8_PTR) contextBuffer->physical + offset;
+#endif
entryLogical = (gctUINT8_PTR) contextBuffer->logical + offset;
entryBytes = Context->bufferSize - offset;
@@ -1649,7 +1678,9 @@ gckCOMMAND_Commit(
}
/* Compute the entry. */
+#if gcdNONPAGED_MEMORY_CACHEABLE
entryPhysical = (gctUINT8_PTR) commandBufferPhysical + offset;
+#endif
entryLogical = commandBufferLogical + offset;
entryBytes = commandBufferSize - offset;
}
@@ -1705,7 +1736,9 @@ gckCOMMAND_Commit(
if (Command->newQueue)
{
/* New command queue, jump to the beginning of it. */
+#if gcdNONPAGED_MEMORY_CACHEABLE
exitPhysical = Command->physical;
+#endif
exitLogical = Command->logical;
exitBytes = Command->offset + waitLinkBytes;
}
@@ -1713,7 +1746,9 @@ gckCOMMAND_Commit(
{
/* Still within the preexisting command queue, jump to the new
WAIT/LINK command sequence. */
+#if gcdNONPAGED_MEMORY_CACHEABLE
exitPhysical = waitLinkPhysical;
+#endif
exitLogical = waitLinkLogical;
exitBytes = waitLinkBytes;
}
@@ -2106,7 +2141,9 @@ gckCOMMAND_Execute(
gctUINT32 waitOffset;
gctSIZE_T waitBytes;
+#if gcdNONPAGED_MEMORY_CACHEABLE
gctPHYS_ADDR execPhysical;
+#endif
gctPOINTER execLogical;
gctSIZE_T execBytes;
@@ -2144,7 +2181,9 @@ gckCOMMAND_Execute(
if (Command->newQueue)
{
/* New command queue, jump to the beginning of it. */
+#if gcdNONPAGED_MEMORY_CACHEABLE
execPhysical = Command->physical;
+#endif
execLogical = Command->logical;
execBytes = waitLinkOffset + waitLinkBytes;
}
@@ -2152,7 +2191,9 @@ gckCOMMAND_Execute(
{
/* Still within the preexisting command queue, jump directly to the
reserved area. */
+#if gcdNONPAGED_MEMORY_CACHEABLE
execPhysical = (gctUINT8 *) Command->physical + Command->offset;
+#endif
execLogical = (gctUINT8 *) Command->logical + Command->offset;
execBytes = RequestedBytes + waitLinkBytes;
}
@@ -2380,7 +2421,7 @@ gckCOMMAND_Stall(
);
/* Bail out on timeout. */
- if (gcmIS_ERROR(status))
+ if (gcmIS_ERROR(status) && !FromPower)
{
/* Broadcast the stuck GPU. */
gcmkONERROR(gckOS_Broadcast(
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c
index 7f5cd4607352..0f2292db4002 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
index a394b8e76a89..ca53c74c5428 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -558,7 +558,7 @@ gckKERNEL_FindRecord(
{
gceSTATUS status;
gctBOOL acquired = gcvFALSE;
- gcsDATABASE_RECORD_PTR record, previous;
+ gcsDATABASE_RECORD_PTR record;
gcmkHEADER_ARG("Kernel=0x%x Database=0x%x Type=%d Data=0x%x",
Kernel, Database, Type, Data);
@@ -569,7 +569,7 @@ gckKERNEL_FindRecord(
acquired = gcvTRUE;
/* Scan the database for this record. */
- for (record = Database->list, previous = gcvNULL;
+ for (record = Database->list;
record != gcvNULL;
record = record->next
)
@@ -581,8 +581,6 @@ gckKERNEL_FindRecord(
/* Found it! */
break;
}
-
- previous = record;
}
if (record == gcvNULL)
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_debug.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_debug.c
index 1eba4ea42a83..299ce1495211 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_debug.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_debug.c
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c
index 052be7de4487..3da8aa95960a 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_heap.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_heap.c
index 597c97916c52..c68e0c159f8f 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_heap.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_heap.c
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_interrupt_vg.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_interrupt_vg.c
index ec5dd4c346b0..028b4696e824 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_interrupt_vg.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_interrupt_vg.c
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c
index 2f16004fb4ff..b25e2ef460da 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -51,6 +51,140 @@ typedef struct _gcsMMU_STLB
#define gcvMMU_STLB_SIZE gcmALIGN(sizeof(gcsMMU_STLB), 4)
+#if gcdSHARED_PAGETABLE
+typedef struct _gcsSharedPageTable * gcsSharedPageTable_PTR;
+typedef struct _gcsSharedPageTable
+{
+ /* Logical of shared pagetable. */
+ gctPOINTER logical;
+
+ /* Physical of shared pagetable. */
+ gctPHYS_ADDR physical;
+
+ /* Number of cores use this shared pagetable. */
+ gctUINT32 reference;
+
+ /* Mutex to protect this shared pagetable. */
+ gctPOINTER mutex;
+
+ /* Hardwares which use this shared pagetable. */
+ gckHARDWARE hardwares[gcdCORE_COUNT];
+
+ /* flat mapping flags. Only useful for new MMU. */
+ gctBOOL flatMappingSetup;
+}
+gcsSharedPageTable;
+
+static gcsSharedPageTable_PTR sharedPageTable = gcvNULL;
+
+static gceSTATUS
+_Free(
+ IN gckMMU Mmu
+ )
+{
+ sharedPageTable->reference--;
+
+ if (sharedPageTable->reference == 0)
+ {
+ if (sharedPageTable->logical)
+ {
+ gcmkVERIFY_OK(
+ gckOS_FreeContiguous(Mmu->os,
+ sharedPageTable->physical,
+ (gctPOINTER) sharedPageTable->logical,
+ Mmu->pageTableSize));
+ }
+
+ if (sharedPageTable->mutex)
+ {
+ gcmkVERIFY_OK(gckOS_DeleteMutex(Mmu->os, sharedPageTable->mutex));
+ }
+
+ gcmkVERIFY_OK(gcmkOS_SAFE_FREE(Mmu->os, sharedPageTable));
+ }
+
+ return gcvSTATUS_OK;
+}
+
+static gceSTATUS
+_Construct(
+ IN gckMMU Mmu
+ )
+{
+ gceSTATUS status;
+ gctPOINTER pointer;
+ gctPHYS_ADDR physical;
+
+ gcmkHEADER_ARG("Mmu=%lu", Mmu);
+
+ if (sharedPageTable == gcvNULL)
+ {
+ gcmkONERROR(
+ gckOS_Allocate(Mmu->os,
+ sizeof(struct _gcsSharedPageTable),
+ &pointer));
+ sharedPageTable = pointer;
+
+ gcmkONERROR(
+ gckOS_ZeroMemory(sharedPageTable,
+ sizeof(struct _gcsSharedPageTable)));
+
+ /* Create shared page table. */
+ gcmkONERROR(
+ gckOS_AllocateContiguous(Mmu->os,
+ gcvFALSE,
+ &Mmu->pageTableSize,
+ &physical,
+ &pointer));
+
+ sharedPageTable->logical = pointer;
+ sharedPageTable->physical = physical;
+
+ /* Create the page table mutex. */
+ gcmkONERROR(gckOS_CreateMutex(Mmu->os, &sharedPageTable->mutex));
+
+ /* Invalid all the entries. */
+ gcmkONERROR(
+ gckOS_ZeroMemory(sharedPageTable->logical, Mmu->pageTableSize));
+ }
+
+ Mmu->pageTableLogical = sharedPageTable->logical;
+ Mmu->pageTablePhysical = sharedPageTable->physical;
+ Mmu->pageTableMutex = sharedPageTable->mutex;
+
+ sharedPageTable->hardwares[sharedPageTable->reference] = Mmu->hardware;
+
+ sharedPageTable->reference++;
+
+ gcmkFOOTER_ARG("sharedPageTable->reference=%lu", sharedPageTable->reference);
+ return gcvSTATUS_OK;
+
+OnError:
+ if (sharedPageTable)
+ {
+ if (sharedPageTable->logical)
+ {
+ gcmkVERIFY_OK(
+ gckOS_FreeContiguous(Mmu->os,
+ sharedPageTable->physical,
+ (gctPOINTER) sharedPageTable->logical,
+ Mmu->pageTableSize));
+ }
+
+ if (sharedPageTable->mutex)
+ {
+ gcmkVERIFY_OK(gckOS_DeleteMutex(Mmu->os, sharedPageTable->mutex));
+ }
+
+ gcmkVERIFY_OK(gcmkOS_SAFE_FREE(Mmu->os, sharedPageTable));
+ }
+
+ gcmkFOOTER();
+ return status;
+}
+
+#endif
+
static gceSTATUS
_Link(
IN gckMMU Mmu,
@@ -301,6 +435,15 @@ _FillFlatMapping(
gctUINT32 sStart = (start & gcdMMU_STLB_64K_MASK) >> gcdMMU_STLB_64K_SHIFT;
gctUINT32 sEnd = (end & gcdMMU_STLB_64K_MASK) >> gcdMMU_STLB_64K_SHIFT;
+#if gcdSHARED_PAGETABLE
+ if (sharedPageTable->flatMappingSetup == gcvTRUE)
+ {
+ gcmkTRACE_ZONE(gcvLEVEL_INFO, gcvZONE_MMU,
+ "flat mapping has been created by another core");
+ return gcvSTATUS_OK;
+ }
+#endif
+
/* Grab the mutex. */
gcmkONERROR(gckOS_AcquireMutex(Mmu->os, Mmu->pageTableMutex, gcvINFINITE));
mutex = gcvTRUE;
@@ -419,6 +562,9 @@ _FillFlatMapping(
/* Release the mutex. */
gcmkVERIFY_OK(gckOS_ReleaseMutex(Mmu->os, Mmu->pageTableMutex));
+#if gcdSHARED_PAGETABLE
+ sharedPageTable->flatMappingSetup = gcvTRUE;
+#endif
return gcvSTATUS_OK;
OnError:
@@ -522,8 +668,10 @@ gckMMU_Construct(
mmu->nodeMutex = gcvNULL;
#endif
+#if !gcdSHARED_PAGETABLE
/* Create the page table mutex. */
gcmkONERROR(gckOS_CreateMutex(os, &mmu->pageTableMutex));
+#endif
#ifdef __QNXNTO__
/* Create the node list mutex. */
@@ -534,6 +682,10 @@ gckMMU_Construct(
{
/* Allocate the page table (not more than 256 kB). */
mmu->pageTableSize = gcmMIN(MmuSize, 256 << 10);
+
+#if gcdSHARED_PAGETABLE
+ _Construct(mmu);
+#else
gcmkONERROR(
gckOS_AllocateContiguous(os,
gcvFALSE,
@@ -542,6 +694,7 @@ gckMMU_Construct(
&pointer));
mmu->pageTableLogical = pointer;
+#endif
/* Compute number of entries in page table. */
mmu->pageTableEntries = mmu->pageTableSize / sizeof(gctUINT32);
@@ -562,6 +715,9 @@ gckMMU_Construct(
/* Allocate the 4K mode MTLB table. */
mmu->pageTableSize = gcdMMU_MTLB_SIZE + 64;
+#if gcdSHARED_PAGETABLE
+ _Construct(mmu);
+#else
gcmkONERROR(
gckOS_AllocateContiguous(os,
gcvFALSE,
@@ -574,6 +730,7 @@ gckMMU_Construct(
/* Invalid all the entries. */
gcmkONERROR(
gckOS_ZeroMemory(pointer, mmu->pageTableSize));
+#endif
}
/* Return the gckMMU object pointer. */
@@ -590,11 +747,16 @@ OnError:
if (mmu->pageTableLogical != gcvNULL)
{
/* Free the page table. */
+#if gcdSHARED_PAGETABLE
+ _Free(mmu);
+#else
gcmkVERIFY_OK(
gckOS_FreeContiguous(os,
mmu->pageTablePhysical,
(gctPOINTER) mmu->pageTableLogical,
mmu->pageTableSize));
+#endif
+
}
if (mmu->pageTableMutex != gcvNULL)
@@ -692,19 +854,25 @@ gckMMU_Destroy(
}
/* Free the page table. */
+#if gcdSHARED_PAGETABLE
+ _Free(Mmu);
+#else
gcmkVERIFY_OK(
gckOS_FreeContiguous(Mmu->os,
Mmu->pageTablePhysical,
(gctPOINTER) Mmu->pageTableLogical,
Mmu->pageTableSize));
+#endif
#ifdef __QNXNTO__
/* Delete the node list mutex. */
gcmkVERIFY_OK(gckOS_DeleteMutex(Mmu->os, Mmu->nodeMutex));
#endif
+#if !gcdSHARED_PAGETABLE
/* Delete the page table mutex. */
gcmkVERIFY_OK(gckOS_DeleteMutex(Mmu->os, Mmu->pageTableMutex));
+#endif
/* Mark the gckMMU object as unknown. */
Mmu->object.type = gcvOBJ_UNKNOWN;
@@ -976,9 +1144,11 @@ gckMMU_AllocatePages(
| (gcvMMU_STLB_SIZE << 10);
}
+#if !gcdSHARED_PAGETABLE
/* Flush the MMU cache. */
gcmkONERROR(
gckHARDWARE_FlushMMU(Mmu->hardware));
+#endif
/* Success. */
gcmkFOOTER_ARG("*PageTable=0x%x *Address=%08x",
@@ -1085,10 +1255,6 @@ gckMMU_FreePages(
gcmkONERROR(gcvSTATUS_INVALID_ARGUMENT);
}
- /* Flush the MMU cache. */
- gcmkONERROR(
- gckHARDWARE_FlushMMU(Mmu->hardware));
-
/* Grab the mutex. */
gcmkONERROR(gckOS_AcquireMutex(Mmu->os, Mmu->pageTableMutex, gcvINFINITE));
mutex = gcvTRUE;
@@ -1334,6 +1500,31 @@ OnError:
}
#endif
+#if gcdSHARED_PAGETABLE
+gceSTATUS
+gckMMU_FlushAllMmuCache(
+ void
+ )
+{
+ gceSTATUS status;
+ gctINT i;
+ for (i = 0; i < gcdCORE_COUNT; i++)
+ {
+ if (sharedPageTable->hardwares[i])
+ {
+ gcmkTRACE_ZONE(gcvLEVEL_INFO, gcvZONE_MMU,
+ "Flush MMU Cache for hardware=0x%x",
+ sharedPageTable->hardwares[i]);
+ gcmkONERROR(gckHARDWARE_FlushMMU(sharedPageTable->hardwares[i]));
+ }
+ }
+
+ return gcvSTATUS_OK;
+OnError:
+ return status;
+}
+#endif
+
/******************************************************************************
****************************** T E S T C O D E ******************************
******************************************************************************/
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu_vg.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu_vg.c
index e3206277d891..ac74f33c6e59 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu_vg.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu_vg.c
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_precomp.h b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_precomp.h
index 73664914c0fc..004e6bd85b6c 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_precomp.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_precomp.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c
index 29d28e8fe349..343f4f4d0d1d 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.h b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.h
index bf0f30511097..04fccf4066d4 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c
index 33438b617bfe..dac5e2330397 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -773,6 +773,93 @@ OnError:
return status;
}
+#if gcdENABLE_BANK_ALIGNMENT
+
+#if !gcdBANK_BIT_START
+#error gcdBANK_BIT_START not defined.
+#endif
+
+#if !gcdBANK_BIT_END
+#error gcdBANK_BIT_END not defined.
+#endif
+/*******************************************************************************
+** _GetSurfaceBankAlignment
+**
+** Return the required offset alignment required to the make BaseAddress
+** aligned properly.
+**
+** INPUT:
+**
+** gckOS Os
+** Pointer to gcoOS object.
+**
+** gceSURF_TYPE Type
+** Type of allocation.
+**
+** gctUINT32 BaseAddress
+** Base address of current video memory node.
+**
+** OUTPUT:
+**
+** gctUINT32_PTR AlignmentOffset
+** Pointer to a variable that will hold the number of bytes to skip in
+** the current video memory node in order to make the alignment bank
+** aligned.
+*/
+static gceSTATUS
+_GetSurfaceBankAlignment(
+ IN gceSURF_TYPE Type,
+ IN gctUINT32 BaseAddress,
+ OUT gctUINT32_PTR AlignmentOffset
+ )
+{
+ gctUINT32 bank;
+ /* To retrieve the bank. */
+ static const gctUINT32 bankMask = (0xFFFFFFFF << gcdBANK_BIT_START)
+ ^ (0xFFFFFFFF << (gcdBANK_BIT_END + 1));
+
+ /* To retrieve the bank and all the lower bytes. */
+ static const gctUINT32 byteMask = ~(0xFFFFFFFF << (gcdBANK_BIT_END + 1));
+
+ gcmkHEADER_ARG("Type=%d BaseAddress=0x%x ", Type, BaseAddress);
+
+ /* Verify the arguments. */
+ gcmkVERIFY_ARGUMENT(AlignmentOffset != gcvNULL);
+
+ switch (Type)
+ {
+ case gcvSURF_RENDER_TARGET:
+ bank = (BaseAddress & bankMask) >> (gcdBANK_BIT_START);
+
+ /* Align to the first bank. */
+ *AlignmentOffset = (bank == 0) ?
+ 0 :
+ ((1 << (gcdBANK_BIT_END + 1)) + 0) - (BaseAddress & byteMask);
+ break;
+
+ case gcvSURF_DEPTH:
+ bank = (BaseAddress & bankMask) >> (gcdBANK_BIT_START);
+
+ /* Align to the third bank. */
+ *AlignmentOffset = (bank == 2) ?
+ 0 :
+ ((1 << (gcdBANK_BIT_END + 1)) + (2 << gcdBANK_BIT_START)) - (BaseAddress & byteMask);
+
+ /* Add a channel offset at the channel bit. */
+ *AlignmentOffset += (1 << gcdBANK_CHANNEL_BIT);
+ break;
+
+ default:
+ /* no alignment needed. */
+ *AlignmentOffset = 0;
+ }
+
+ /* Return the status. */
+ gcmkFOOTER_ARG("*AlignmentOffset=%u", *AlignmentOffset);
+ return gcvSTATUS_OK;
+}
+#endif
+
static gcuVIDMEM_NODE_PTR
_FindNode(
IN gckVIDMEM Memory,
@@ -803,8 +890,7 @@ _FindNode(
node->VidMem.bytes != 0;
node = node->VidMem.nextFree)
{
- gcmkONERROR(gckOS_GetSurfaceBankAlignment(
- Memory->os,
+ gcmkONERROR(_GetSurfaceBankAlignment(
Type,
node->VidMem.memory->baseAddress + node->VidMem.offset,
&bankAlignment));
@@ -1657,66 +1743,37 @@ gckVIDMEM_Lock(
else
#endif
{
- if (Node->Virtual.pageTables[Kernel->core] == gcvNULL)
- {
-#if gcdMULTICORE_MAPPING
- gckKERNEL anotherKernel = Kernel->anotherKernel;
-#endif
+ /* Allocate pages inside the MMU. */
+ gcmkONERROR(
+ gckMMU_AllocatePages(Kernel->mmu,
+ Node->Virtual.pageCount,
+ &Node->Virtual.pageTables[Kernel->core],
+ &Node->Virtual.addresses[Kernel->core]));
+ }
- /* Allocate pages inside the MMU. */
- gcmkONERROR(
- gckMMU_AllocatePages(Kernel->mmu,
- Node->Virtual.pageCount,
- &Node->Virtual.pageTables[Kernel->core],
- &Node->Virtual.addresses[Kernel->core]));
-
- Node->Virtual.lockKernels[Kernel->core] = Kernel;
-
-#if gcdMULTICORE_MAPPING
- if (anotherKernel)
- {
- gcmkONERROR(
- gckMMU_AllocatePages(anotherKernel->mmu,
- Node->Virtual.pageCount,
- &Node->Virtual.pageTables[anotherKernel->core],
- &Node->Virtual.addresses[anotherKernel->core]));
-
- Node->Virtual.lockKernels[anotherKernel->core] = Kernel;
- }
-#endif
+ Node->Virtual.lockKernels[Kernel->core] = Kernel;
- /* Map the pages. */
+ /* Map the pages. */
#ifdef __QNXNTO__
- gcmkONERROR(
- gckOS_MapPagesEx(os,
+ gcmkONERROR(
+ gckOS_MapPagesEx(os,
Kernel->core,
Node->Virtual.physical,
Node->Virtual.logical,
Node->Virtual.pageCount,
Node->Virtual.pageTables[Kernel->core]));
#else
-
- gcmkONERROR(
- gckOS_MapPagesEx(os,
- Kernel->core,
- Node->Virtual.physical,
- Node->Virtual.pageCount,
- Node->Virtual.pageTables[Kernel->core]));
-
-#if gcdMULTICORE_MAPPING
- if (anotherKernel)
- {
- gcmkONERROR(
- gckOS_MapPagesEx(os,
- anotherKernel->core,
- Node->Virtual.physical,
- Node->Virtual.pageCount,
- Node->Virtual.pageTables[anotherKernel->core]));
- }
+ gcmkONERROR(
+ gckOS_MapPagesEx(os,
+ Kernel->core,
+ Node->Virtual.physical,
+ Node->Virtual.pageCount,
+ Node->Virtual.pageTables[Kernel->core]));
#endif
+
+#if gcdSHARED_PAGETABLE
+ gcmkONERROR(gckMMU_FlushAllMmuCache());
#endif
- }
- }
}
gcmkTRACE_ZONE(gcvLEVEL_INFO, gcvZONE_VIDMEM,
@@ -1941,12 +1998,18 @@ gckVIDMEM_Unlock(
gckVGMMU_FreePages(Kernel->vg->mmu,
Node->Virtual.pageTables[Kernel->core],
Node->Virtual.pageCount));
-
- /* Mark page table as freed. */
- Node->Virtual.pageTables[Kernel->core] = gcvNULL;
- Node->Virtual.lockKernels[Kernel->core] = gcvNULL;
}
+ else
#endif
+ {
+ gcmkONERROR(
+ gckMMU_FreePages(Kernel->mmu,
+ Node->Virtual.pageTables[Kernel->core],
+ Node->Virtual.pageCount));
+ }
+ /* Mark page table as freed. */
+ Node->Virtual.pageTables[Kernel->core] = gcvNULL;
+ Node->Virtual.lockKernels[Kernel->core] = gcvNULL;
}
#ifdef __QNXNTO__
@@ -1962,39 +2025,6 @@ gckVIDMEM_Unlock(
if (totalLocked == 0)
{
- if (Node->Virtual.pageTables[Kernel->core] != gcvNULL)
- {
-#if gcdMULTICORE_MAPPING
- gckKERNEL anotherKernel = Kernel->anotherKernel;
-#endif
- gcmkONERROR(
- gckMMU_FreePages(Kernel->mmu,
- Node->Virtual.pageTables[Kernel->core],
- Node->Virtual.pageCount));
-
-#if gcdMULTICORE_MAPPING
- if (anotherKernel)
- {
- gcmkONERROR(
- gckMMU_FreePages(anotherKernel->mmu,
- Node->Virtual.pageTables[anotherKernel->core],
- Node->Virtual.pageCount));
- }
-#endif
-
- /* Mark page table as freed. */
- Node->Virtual.pageTables[Kernel->core] = gcvNULL;
- Node->Virtual.lockKernels[Kernel->core] = gcvNULL;
-
-#if gcdMULTICORE_MAPPING
- if (anotherKernel)
- {
- Node->Virtual.pageTables[anotherKernel->core] = gcvNULL;
- Node->Virtual.lockKernels[anotherKernel->core] = gcvNULL;
- }
-#endif
- }
-
/* Owner have already freed this node
** and we are the last one to unlock, do
** real free */
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h
index 0b1417665440..9c474786818f 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -920,16 +920,6 @@ gckOS_DeviceControl(
IN gctSIZE_T OutputBufferSize
);
-#if gcdENABLE_BANK_ALIGNMENT
-gceSTATUS
-gckOS_GetSurfaceBankAlignment(
- IN gckOS Os,
- IN gceSURF_TYPE Type,
- IN gctUINT32 BaseAddress,
- OUT gctUINT32_PTR Alignment
- );
-#endif
-
/*******************************************************************************
**
** gckOS_GetProcessID
@@ -2203,7 +2193,8 @@ gckCOMMAND_Start(
/* Stop the command queue. */
gceSTATUS
gckCOMMAND_Stop(
- IN gckCOMMAND Command
+ IN gckCOMMAND Command,
+ IN gctBOOL FromRecovery
);
/* Commit a buffer to the command queue. */
@@ -2330,6 +2321,13 @@ gckMMU_FreeHandleMemory(
);
#endif
+#if gcdSHARED_PAGETABLE
+gceSTATUS
+gckMMU_FlushAllMmuCache(
+ void
+ );
+#endif
+
#if VIVANTE_PROFILER
gceSTATUS
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 6137f5f857c6..90aa35f38fbe 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
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -28,6 +28,7 @@
#include "gc_hal_types.h"
#include "gc_hal_dump.h"
+#include "gc_hal_md5.h"
#ifdef __cplusplus
extern "C" {
@@ -692,8 +693,8 @@ gcoOS_FreeContiguous(
#if gcdENABLE_BANK_ALIGNMENT
gceSTATUS
-gcoOS_GetBankOffsetBytes(
- IN gcoOS Os,
+gcoSURF_GetBankOffsetBytes(
+ IN gcoSURF Surfce,
IN gceSURF_TYPE Type,
IN gctUINT32 Stride,
IN gctUINT32_PTR Bytes
@@ -1893,6 +1894,13 @@ gcoSURF_CPUCacheOperation(
IN gceCACHEOPERATION Operation
);
+
+gceSTATUS
+gcoSURF_SetLinearResolveAddress(
+ IN gcoSURF Surface,
+ IN gctUINT32 Address,
+ IN gctPOINTER Memory
+ );
/******************************************************************************\
********************************* gcoDUMP Object ********************************
\******************************************************************************/
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_cl.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_cl.h
deleted file mode 100644
index 86982c207059..000000000000
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_cl.h
+++ /dev/null
@@ -1,301 +0,0 @@
-/****************************************************************************
-*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
-*
-* 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
-* the Free Software Foundation; either version 2 of the license, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not write to the Free Software
-* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*
-*****************************************************************************/
-
-
-
-
-#ifndef __gc_hal_user_cl_h_
-#define __gc_hal_user_cl_h_
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define USE_NEW_MEMORY_ALLOCATION 0
-
-/******************************************************************************\
-****************************** Object Declarations *****************************
-\******************************************************************************/
-
-/* gcoCL_DEVICE_INFO object. */
-typedef struct _gcoCL_DEVICE_INFO
-{
- gctUINT maxComputeUnits;
- gctUINT maxWorkItemDimensions;
- gctUINT maxWorkItemSizes[3];
- gctUINT maxWorkGroupSize;
- gctUINT maxGlobalWorkSize ;
- gctUINT clockFrequency;
-
- gctUINT addrBits;
- gctUINT64 maxMemAllocSize;
- gctUINT64 globalMemSize;
- gctUINT64 localMemSize;
- gctUINT localMemType; /* cl_device_local_mem_type */
- gctUINT globalMemCacheType; /* cl_device_mem_cache_type */
- gctUINT globalMemCachelineSize;
- gctUINT64 globalMemCacheSize;
- gctUINT maxConstantArgs;
- gctUINT64 maxConstantBufferSize;
- gctUINT maxParameterSize;
- gctUINT memBaseAddrAlign;
- gctUINT minDataTypeAlignSize;
-
- gctBOOL imageSupport;
- gctUINT maxReadImageArgs;
- gctUINT maxWriteImageArgs;
- gctUINT vectorWidthChar;
- gctUINT vectorWidthShort;
- gctUINT vectorWidthInt;
- gctUINT vectorWidthLong;
- gctUINT vectorWidthFloat;
- gctUINT vectorWidthDouble;
- gctUINT vectorWidthHalf;
- gctUINT image2DMaxWidth;
- gctUINT image2DMaxHeight;
- gctUINT image3DMaxWidth;
- gctUINT image3DMaxHeight;
- gctUINT image3DMaxDepth;
- gctUINT maxSamplers;
-
- gctUINT64 queueProperties; /* cl_command_queue_properties */
- gctBOOL hostUnifiedMemory;
- gctBOOL errorCorrectionSupport;
- gctUINT64 singleFpConfig; /* cl_device_fp_config */
- gctUINT64 doubleFpConfig; /* cl_device_fp_config */
- gctUINT profilingTimingRes;
- gctBOOL endianLittle;
- gctBOOL deviceAvail;
- gctBOOL compilerAvail;
- gctUINT64 execCapability; /* cl_device_exec_capabilities */
-} gcoCL_DEVICE_INFO;
-
-typedef gcoCL_DEVICE_INFO * gcoCL_DEVICE_INFO_PTR;
-
-
-/*******************************************************************************
-**
-** gcoCL_InitializeHardware
-**
-** Initialize hardware. This is required for each thread.
-**
-** INPUT:
-**
-** Nothing
-**
-** OUTPUT:
-**
-** Nothing
-*/
-gceSTATUS
-gcoCL_InitializeHardware(
- );
-
-/*******************************************************************************
-**
-** gcoCL_AllocateMemory
-**
-** Allocate contiguous memory from the kernel.
-**
-** INPUT:
-**
-** gctSIZE_T * Bytes
-** Pointer to the number of bytes to allocate.
-**
-** OUTPUT:
-**
-** gctSIZE_T * Bytes
-** Pointer to a variable that will receive the aligned number of bytes
-** allocated.
-**
-** gctPHYS_ADDR * Physical
-** Pointer to a variable that will receive the physical addresses of
-** the allocated memory.
-**
-** gctPOINTER * Logical
-** Pointer to a variable that will receive the logical address of the
-** allocation.
-**
-** gcsSURF_NODE_PTR * Node
-** Pointer to a variable that will receive the gcsSURF_NODE structure
-** pointer that describes the video memory to lock.
-*/
-gceSTATUS
-gcoCL_AllocateMemory(
- IN OUT gctSIZE_T * Bytes,
- OUT gctPHYS_ADDR * Physical,
- OUT gctPOINTER * Logical,
- OUT gcsSURF_NODE_PTR * Node
- );
-
-/*******************************************************************************
-**
-** gcoCL_FreeMemory
-**
-** Free contiguous memeory to the kernel.
-**
-** INPUT:
-**
-** gctPHYS_ADDR Physical
-** The physical addresses of the allocated pages.
-**
-** gctPOINTER Logical
-** The logical address of the allocation.
-**
-** gctSIZE_T Bytes
-** Number of bytes allocated.
-**
-** gcsSURF_NODE_PTR Node
-** Pointer to a gcsSURF_NODE structure
-** that describes the video memory to unlock.
-**
-** OUTPUT:
-**
-** Nothing
-*/
-gceSTATUS
-gcoCL_FreeMemory(
- IN gctPHYS_ADDR Physical,
- IN gctPOINTER Logical,
- IN gctSIZE_T Bytes,
- IN gcsSURF_NODE_PTR Node
- );
-
-/*******************************************************************************
-**
-** gcoCL_CreateTexture
-**
-** Create texture for image.
-**
-** INPUT:
-**
-** gctUINT Width
-** Width of the image.
-**
-** gctUINT Heighth
-** Heighth of the image.
-**
-** gctUINT Depth
-** Depth of the image.
-**
-** gctCONST_POINTER Memory
-** Pointer to the data of the input image.
-**
-** gctUINT Stride
-** Size of one row.
-**
-** gctUINT Slice
-** Size of one plane.
-**
-** gceSURF_FORMAT FORMAT
-** Format of the image.
-**
-** gceENDIAN_HINT EndianHint
-** Endian needed to handle the image data.
-**
-** OUTPUT:
-**
-** gcoTEXTURE * Texture
-** Pointer to a variable that will receive the gcoTEXTURE structure.
-**
-** gcoSURF * Surface
-** Pointer to a variable that will receive the gcoSURF structure.
-**
-** gctPHYS_ADDR * Physical
-** Pointer to a variable that will receive the physical addresses of
-** the allocated memory.
-**
-** gctPOINTER * Logical
-** Pointer to a variable that will receive the logical address of the
-** allocation.
-*/
-gceSTATUS
-gcoCL_CreateTexture(
- IN gctUINT Width,
- IN gctUINT Height,
- IN gctUINT Depth,
- IN gctCONST_POINTER Memory,
- IN gctUINT Stride,
- IN gctUINT Slice,
- IN gceSURF_FORMAT Format,
- IN gceENDIAN_HINT EndianHint,
- OUT gcoTEXTURE * Texture,
- OUT gcoSURF * Surface,
- OUT gctPHYS_ADDR * Physical,
- OUT gctPOINTER * Logical
- );
-
-/*******************************************************************************
-**
-** gcoCL_DestroyTexture
-**
-** Destroy an gcoTEXTURE object.
-**
-** INPUT:
-**
-** gcoTEXTURE Texture
-** Pointer to an gcoTEXTURE object.
-**
-** OUTPUT:
-**
-** Nothing.
-*/
-gceSTATUS
-gcoCL_DestroyTexture(
- IN gcoTEXTURE Texture
- );
-
-/*******************************************************************************
-**
-** gcoCL_QueryDeviceInfo
-**
-** Query the OpenCL capabilities of the device.
-**
-** INPUT:
-**
-** Nothing
-**
-** OUTPUT:
-**
-** gcoCL_DEVICE_INFO_PTR DeviceInfo
-** Pointer to the device information
-*/
-gceSTATUS
-gcoCL_QueryDeviceInfo(
- OUT gcoCL_DEVICE_INFO_PTR DeviceInfo
- );
-
-gceSTATUS
-gcoCL_SubmitSignal(
- IN gctSIGNAL Signal,
- IN gctHANDLE Process
- );
-
-gceSTATUS
-gcoCL_Flush(
- IN gctBOOL Stall
- );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __gc_hal_user_cl_h_ */
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_compiler.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_compiler.h
index 7c2c3469b8d6..996af728b53d 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_compiler.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_compiler.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -109,32 +109,32 @@ typedef enum _gcSL_OPCODE
gcSL_STORE, /* 0x37 */
gcSL_BARRIER, /* 0x38 */
gcSL_STORE1, /* 0x39 */
- /*gcSL_COS_CL, 0x3A */
- /*gcSL_TAN_CL, 0x3B */
- /*gcSL_ACOS_CL, 0x3C */
- /*gcSL_ASIN_CL, 0x3D */
- /*gcSL_ATAN_CL, 0x3E */
- /*gcSL_SINH_CL, 0x3F */
- /*gcSL_COSH_CL, 0x40 */
- /*gcSL_TANH_CL, 0x41 */
- /*gcSL_ASINH_CL, 0x42 */
- /*gcSL_ACOSH_CL, 0x43 */
- /*gcSL_ATANH_CL, 0x44 */
- /*gcSL_SINPI_CL, 0x45 */
- /*gcSL_COSPI_CL, 0x46 */
- /*gcSL_TANPI_CL, 0x47 */
- /*gcSL_ASINPI_CL, 0x48 */
- /*gcSL_ACOSPI_CL, 0x49 */
- /*gcSL_ATANPI_CL, 0x4A */
- /*gcSL_ATAN2_CL, 0x4B */
- /*gcSL_ATAN2PI_CL, 0x4C */
- /*gcSL_POW_CL, 0x4D */
- /*gcSL_RSQ_CL, 0x4E */
- /*gcSL_LOG_CL, 0x4F */
- /*gcSL_EXP_CL, 0x50 */
- /*gcSL_SQRT_CL, 0x51 */
- /*gcSL_CBRT_CL, 0x52 */
- gcSL_ADDLO = 0x53, /* 0x53 */ /* Float only. */
+ gcSL_ATOMADD, /* 0x3A */
+ gcSL_ATOMSUB, /* 0x3B */
+ gcSL_ATOMXCHG, /* 0x3C */
+ gcSL_ATOMCMPXCHG, /* 0x3D */
+ gcSL_ATOMMIN, /* 0x3E */
+ gcSL_ATOMMAX, /* 0x3F */
+ gcSL_ATOMOR, /* 0x40 */
+ gcSL_ATOMAND, /* 0x41 */
+ gcSL_ATOMXOR, /* 0x42 */
+ /*gcSL_UNUSED, 0x43 */
+ /*gcSL_UNUSED, 0x44 */
+ /*gcSL_UNUSED, 0x45 */
+ /*gcSL_UNUSED, 0x46 */
+ /*gcSL_UNUSED, 0x47 */
+ /*gcSL_UNUSED, 0x48 */
+ /*gcSL_UNUSED, 0x49 */
+ /*gcSL_UNUSED, 0x4A */
+ /*gcSL_UNUSED, 0x4B */
+ /*gcSL_UNUSED, 0x4C */
+ /*gcSL_UNUSED, 0x4D */
+ /*gcSL_UNUSED, 0x4E */
+ /*gcSL_UNUSED, 0x4F */
+ /*gcSL_UNUSED, 0x50 */
+ /*gcSL_UNUSED, 0x51 */
+ /*gcSL_UNUSED, 0x52 */
+ gcSL_ADDLO = 0x53, /* 0x53 */ /* Float only. */
gcSL_MULLO, /* 0x54 */ /* Float only. */
gcSL_CONV, /* 0x55 */
gcSL_GETEXP, /* 0x56 */
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver.h
index 505a23d93b46..a8a22e8f641b 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -730,7 +730,7 @@ typedef struct _gcsHAL_INTERFACE
struct _gcsHAL_CACHE
{
IN gceCACHEOPERATION operation;
- IN gctHANDLE process;
+ IN gctPOINTER physical;
IN gctPOINTER logical;
IN gctSIZE_T bytes;
IN gcuVIDMEM_NODE_PTR node;
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver_vg.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver_vg.h
index 934c3df8b9a4..fe57968ba423 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver_vg.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver_vg.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_dump.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_dump.h
index 340bc9b23429..9b2db2244989 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_dump.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_dump.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h
index 6b3a6e54516a..994469e08196 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -80,6 +80,11 @@ typedef struct _halDISPLAY_INFO
** if the address is not known for the specified display. */
unsigned long physical;
+#ifndef __QNXNTO__
+ /* 355_FB_MULTI_BUFFER */
+ gctINT multiBuffer;
+ gctINT backBufferY;
+#endif
/* The color info of the display. */
unsigned int alphaLength;
unsigned int alphaOffset;
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h
index 86852a2ffaf6..abc62e5d04c7 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine_vg.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine_vg.h
index 27241935df78..571e03e057e4 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine_vg.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine_vg.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h
index f28675448dae..d885c1c1add0 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -129,6 +129,13 @@ typedef enum _gceFEATURE
gcvFEATURE_2D_ROTATION_STALL_FIX,
gcvFEATURE_2D_MULTI_SOURCE_BLT_EX,
gcvFEATURE_BUG_FIXES10,
+ gcvFEATURE_2D_MINOR_TILING,
+ /* Supertiled compressed textures are supported. */
+ gcvFEATURE_TEX_COMPRRESSION_SUPERTILED,
+ gcvFEATURE_FAST_MSAA,
+ gcvFEATURE_BUG_FIXED_INDEXED_TRIANGLE_STRIP,
+ gcvFEATURE_TEXTURE_TILED_READ,
+ gcvFEATURE_DEPTH_BIAS_FIX
}
gceFEATURE;
@@ -190,6 +197,9 @@ typedef enum _gceSURF_TYPE
gcvSURF_NO_VIDMEM = 0x200, /* Used to allocate surfaces with no underlying vidmem node.
In Android, vidmem node is allocated by another process. */
gcvSURF_CACHEABLE = 0x400, /* Used to allocate a cacheable surface */
+#if gcdANDROID_UNALIGNED_LINEAR_COMPOSITION_ADJUST
+ gcvSURF_FLIP = 0x800, /* The Resolve Target the will been flip resolve from RT */
+#endif
gcvSURF_RENDER_TARGET_NO_TILE_STATUS = gcvSURF_RENDER_TARGET
| gcvSURF_NO_TILE_STATUS,
@@ -209,7 +219,12 @@ typedef enum _gceSURF_TYPE
| gcvSURF_CACHEABLE,
gcvSURF_CACHEABLE_BITMAP = gcvSURF_BITMAP
- | gcvSURF_CACHEABLE
+ | gcvSURF_CACHEABLE,
+
+#if gcdANDROID_UNALIGNED_LINEAR_COMPOSITION_ADJUST
+ gcvSURF_FLIP_BITMAP = gcvSURF_BITMAP
+ | gcvSURF_FLIP,
+#endif
}
gceSURF_TYPE;
@@ -380,6 +395,7 @@ typedef enum _gceSURF_FORMAT
gcvSURF_G32R32,
gcvSURF_X32G32R32,
gcvSURF_A32R32,
+ gcvSURF_RG16,
/* Floating point formats. */
gcvSURF_R16F = 1200,
@@ -666,6 +682,7 @@ typedef enum _gceTILING
gcvSUPERTILED,
gcvMULTI_TILED,
gcvMULTI_SUPERTILED,
+ gcvMINORTILED,
}
gceTILING;
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h
index c8c14f308aa0..24edc0bdc81e 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_md5.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_md5.h
new file mode 100644
index 000000000000..ac0f9733332d
--- /dev/null
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_md5.h
@@ -0,0 +1,112 @@
+/****************************************************************************
+*
+* Copyright (C) 2005 - 2012 by Vivante Corp.
+*
+* 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
+* the Free Software Foundation; either version 2 of the license, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not write to the Free Software
+* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*
+*****************************************************************************/
+
+
+/*
+ Copyright (C) 1999, 2002 Aladdin Enterprises. All rights reserved.
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+ L. Peter Deutsch
+ ghost@aladdin.com
+
+ */
+/* $Id: gc_hal_md5.h,v 1.1.6.1 2012/02/09 00:22:42 semih.demirer Exp $ */
+/*
+ Independent implementation of MD5 (RFC 1321).
+
+ This code implements the MD5 Algorithm defined in RFC 1321, whose
+ text is available at
+ http://www.ietf.org/rfc/rfc1321.txt
+ The code is derived from the text of the RFC, including the test suite
+ (section A.5) but excluding the rest of Appendix A. It does not include
+ any code or documentation that is identified in the RFC as being
+ copyrighted.
+
+ The original and principal author of md5.h is L. Peter Deutsch
+ <ghost@aladdin.com>. Other authors are noted in the change history
+ that follows (in reverse chronological order):
+
+ 2002-04-13 lpd Removed support for non-ANSI compilers; removed
+ references to Ghostscript; clarified derivation from RFC 1321;
+ now handles byte order either statically or dynamically.
+ 1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
+ 1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5);
+ added conditionalization for C++ compilation from Martin
+ Purschke <purschke@bnl.gov>.
+ 1999-05-03 lpd Original version.
+ */
+
+
+#ifndef __gc_hal_md5_h_
+#define __gc_hal_md5_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * This package supports both compile-time and run-time determination of CPU
+ * byte order. If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be
+ * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is
+ * defined as non-zero, the code will be compiled to run only on big-endian
+ * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to
+ * run on either big- or little-endian CPUs, but will run slightly less
+ * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined.
+ */
+
+typedef unsigned char gctMD5_Byte; /* 8-bit byte */
+typedef unsigned int gctMD5_Word; /* 32-bit word */
+
+/* Define the state of the MD5 Algorithm. */
+typedef struct _gcsMD5_State {
+ gctMD5_Word count[2]; /* message length in bits, lsw first */
+ gctMD5_Word abcd[4]; /* digest buffer */
+ gctMD5_Byte buf[64]; /* accumulate block */
+} gcsMD5_State;
+
+/* Initialize the algorithm. */
+void gcoMD5_Init(gcsMD5_State *pms);
+
+/* Append a string to the message. */
+void gcoMD5_Append(gcsMD5_State *pms, const gctMD5_Byte *data, int nbytes);
+
+/* Finish the message and return the digest. */
+void gcoMD5_Finish(gcsMD5_State *pms, gctMD5_Byte digest[16]);
+
+#ifdef __cplusplus
+} /* end extern "C" */
+#endif
+
+#endif /* md5_INCLUDED */
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_mem.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_mem.h
index 9599388d683d..e64f7e740b1a 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_mem.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_mem.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
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 adc020af954c..3c785318b951 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
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -395,7 +395,7 @@
gcdENABLE_BANK_ALIGNMENT
When enabled, video memory is allocated bank aligned. The vendor can modify
- gckOS_GetSurfaceBankAlignment() and gcoOS_GetBankOffsetBytes() to define how
+ _GetSurfaceBankAlignment() and gcoSURF_GetBankOffsetBytes() to define how
different types of allocations are bank and channel aligned.
When disabled (default), no bank alignment is done.
*/
@@ -404,6 +404,36 @@
#endif
/*
+ gcdBANK_BIT_START
+
+ Specifies the start bit of the bank (inclusive).
+*/
+#ifndef gcdBANK_BIT_START
+# define gcdBANK_BIT_START 12
+#endif
+
+/*
+ gcdBANK_BIT_END
+
+ Specifies the end bit of the bank (inclusive).
+*/
+#ifndef gcdBANK_BIT_END
+# define gcdBANK_BIT_END 14
+#endif
+
+/*
+ gcdBANK_CHANNEL_BIT
+
+ When set, video memory when allocated bank aligned is allocated such that
+ render and depth buffer addresses alternate on the channel bit specified.
+ This option has an effect only when gcdENABLE_BANK_ALIGNMENT is enabled.
+ When disabled (default), no alteration is done.
+*/
+#ifndef gcdBANK_CHANNEL_BIT
+# define gcdBANK_CHANNEL_BIT 7
+#endif
+
+/*
gcdDYNAMIC_SPEED
When non-zero, it informs the kernel driver to use the speed throttling
@@ -584,7 +614,7 @@
This define enables the recovery code.
*/
#ifndef gcdENABLE_RECOVERY
-# define gcdENABLE_RECOVERY 0
+# define gcdENABLE_RECOVERY 1
#endif
/*
@@ -674,13 +704,22 @@
# define gcdENABLE_OUTER_CACHE_PATCH 0
#endif
+#ifndef gcdANDROID_UNALIGNED_LINEAR_COMPOSITION_ADJUST
+# define gcdANDROID_UNALIGNED_LINEAR_COMPOSITION_ADJUST 0
+#endif
+
+#ifndef gcdSHARED_PAGETABLE
+# define gcdSHARED_PAGETABLE 1
+#endif
+
/*
- gcdMULTICORE_MAPPING
+ gcdBLOB_CACHE_ENABLED
+ When non-zero, Android blob cache extension will be enabled.
+ Otherwise, caching will be by-passed.
+ */
- Make different cores own same VA
-*/
-#ifndef gcdMULTICORE_MAPPING
-# define gcdMULTICORE_MAPPING 1
+#ifndef gcdBLOB_CACHE_ENABLED
+# define gcdBLOB_CACHE_ENABLED 0
#endif
#endif /* __gc_hal_options_h_ */
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_profiler.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_profiler.h
index 93fb48281941..3ff3f0194ee9 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_profiler.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_profiler.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_raster.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_raster.h
index 4a52bd81ce3d..c303462d381f 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_raster.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_raster.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -920,6 +920,12 @@ gco2D_SetROP(
IN gctUINT8 BgRop
);
+gceSTATUS
+gco2D_SetGdiStretchMode(
+ IN gco2D Engine,
+ IN gctBOOL Enable
+ );
+
#ifdef __cplusplus
}
#endif
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_rename.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_rename.h
index 52b96d81dcd7..ed6718d931d4 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_rename.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_rename.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_types.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_types.h
index 8b97268084df..4fffc2a7790a 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_types.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_types.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h
index 97719934bf35..f4291dfccea2 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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
@@ -28,9 +28,9 @@
#define gcvVERSION_MINOR 6
-#define gcvVERSION_PATCH 4
+#define gcvVERSION_PATCH 5
-#define gcvVERSION_BUILD 1311
+#define gcvVERSION_BUILD 1358
#define gcvVERSION_DATE __DATE__
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_vg.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_vg.h
index 60c497d2ad8a..47ee72ab5066 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_vg.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_vg.h
@@ -1,6 +1,6 @@
/****************************************************************************
*
-* Copyright (C) 2005 - 2011 by Vivante Corp.
+* Copyright (C) 2005 - 2012 by Vivante Corp.
*
* 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