MGS-1274 gpu: Integrate 5.0.11.p8 driver
authorShawn Xiao <b49994@freescale.com>
Fri, 11 Dec 2015 08:51:47 +0000 (16:51 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 19:49:30 +0000 (14:49 -0500)
Once received Vivate 5.0.11.p8_early_pre driver, integrate the kernel
related part to kernel.

Signed-off-by: Shawn Xiao <b49994@freescale.com>
74 files changed:
drivers/mxc/gpu-viv/Kbuild
drivers/mxc/gpu-viv/config
drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.c
drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.h
drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware.c
drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware.h
drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_recorder.c
drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.c
drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.h
drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_vg.c
drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_vg.h
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_debug.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_heap.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_interrupt_vg.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu_vg.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_power.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_precomp.h
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_security.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.h
drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver_vg.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_dump.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform_type.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine_vg.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_mem.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_profiler.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_raster.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_rename.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_security_interface.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_statistics.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_types.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h
drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_vg.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_array.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_array.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debug.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_iommu.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_math.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_mutex.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_platform.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_probe.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_security_channel.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.h
drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c
drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.config

index b651bbf..485e7a3 100644 (file)
@@ -2,7 +2,7 @@
 #
 #    The MIT License (MIT)
 #
-#    Copyright (c) 2014 Vivante Corporation
+#    Copyright (c) 2014 - 2015 Vivante Corporation
 #
 #    Permission is hereby granted, free of charge, to any person obtaining a
 #    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 #
 #    The GPL License (GPL)
 #
-#    Copyright (C) 2014  Vivante Corporation
+#    Copyright (C) 2014 - 2015 Vivante Corporation
 #
 #    This program is free software; you can redistribute it and/or
 #    modify it under the terms of the GNU General Public License
@@ -56,7 +56,6 @@
 #
 # Linux build file for kernel HAL driver.
 #
-
 AQROOT := $(srctree)/drivers/mxc/gpu-viv
 
 include $(AQROOT)/config
@@ -161,15 +160,16 @@ ifeq ($(KERNELRELEASE), )
 
 # Define targets.
 all:
-       @make V=$(V) ARCH=$(ARCH_TYPE) -C $(KERNEL_DIR) SUBDIRS=`pwd` modules
+       @$(MAKE) V=$(V) ARCH=$(ARCH_TYPE) -C $(KERNEL_DIR) SUBDIRS=`pwd` modules
 
 clean:
        @rm -rf $(OBJS)
-       @rm -rf modules.order Module.symvers
+       @rm -rf modules.order Module.symvers .tmp_versions
        @find $(AQROOT) -name ".gc_*.cmd" | xargs rm -f
 
 install: all
        @mkdir -p $(SDK_DIR)/drivers
+       @cp $(MODULE_NAME).ko $(SDK_DIR)/drivers
 
 else
 
@@ -306,8 +306,8 @@ endif
 
 EXTRA_CFLAGS += -DHOST=\"$(HOST)\"
 
-obj-$(CONFIG_MXC_GPU_VIV) += galcore.o
+obj-m = $(MODULE_NAME).o
 
-galcore-objs  := $(OBJS)
+$(MODULE_NAME)-objs  = $(OBJS)
 
 endif
index 9484141..0eeffef 100644 (file)
@@ -1,20 +1,54 @@
 ##############################################################################
 #
-#    Copyright (C) 2005 - 2014 by Vivante Corp.
+#    The MIT License (MIT)
 #
-#    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.
+#    Copyright (c) 2014 - 2015 Vivante Corporation
+#
+#    Permission is hereby granted, free of charge, to any person obtaining a
+#    copy of this software and associated documentation files (the "Software"),
+#    to deal in the Software without restriction, including without limitation
+#    the rights to use, copy, modify, merge, publish, distribute, sublicense,
+#    and/or sell copies of the Software, and to permit persons to whom the
+#    Software is furnished to do so, subject to the following conditions:
+#
+#    The above copyright notice and this permission notice shall be included in
+#    all copies or substantial portions of the Software.
+#
+#    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+#    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+#    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+#    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+#    DEALINGS IN THE SOFTWARE.
+#
+##############################################################################
+#
+#    The GPL License (GPL)
+#
+#    Copyright (C) 2014 - 2015 Vivante Corporation
+#
+#    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
+#    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.
+#    along with this program; if not, write to the Free Software Foundation,
+#    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+##############################################################################
+#
+#    Note: This software is released under dual MIT and GPL licenses. A
+#    recipient may use this file under the terms of either the MIT license or
+#    GPL License. If you wish to use only one license not the other, you can
+#    indicate your decision by deleting one of the above license notices in your
+#    version of this file.
 #
 ##############################################################################
 
index 04e669a..f633db8 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -1129,8 +1129,13 @@ _InitializeContextBuffer(
     index += _State(Context, index, 0x014A0 >> 2, 0x00000000, 1, gcvFALSE, gcvFALSE);
     index += _State(Context, index, 0x014A8 >> 2, 0xFFFFFFFF, 1, gcvFALSE, gcvFALSE);
     index += _State(Context, index, 0x014AC >> 2, 0xFFFFFFFF, 1, gcvFALSE, gcvFALSE);
-    index += _State(Context, index, 0x014B0 >> 2, 0x00000000, 1, gcvFALSE, gcvFALSE);
-    index += _State(Context, index, 0x014B4 >> 2, 0x00000000, 1, gcvFALSE, gcvFALSE);
+
+    if(((((gctUINT32) (Context->hardware->identity.chipMinorFeatures1)) >> (0 ? 11:11) & ((gctUINT32) ((((1 ? 11:11) - (0 ? 11:11) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 11:11) - (0 ? 11:11) + 1)))))) == (0x1 & ((gctUINT32) ((((1 ? 11:11) - (0 ? 11:11) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 11:11) - (0 ? 11:11) + 1))))))) )
+    {
+        index += _State(Context, index, 0x014B0 >> 2, 0x00000000, 1, gcvFALSE, gcvFALSE);
+        index += _State(Context, index, 0x014B4 >> 2, 0x00000000, 1, gcvFALSE, gcvFALSE);
+    }
+
     index += _State(Context, index, 0x014A4 >> 2, 0x000E400C, 1, gcvFALSE, gcvFALSE);
     index += _State(Context, index, 0x01580 >> 2, 0x00000000, 3, gcvFALSE, gcvFALSE);
     index += _State(Context, index, 0x014B8 >> 2, 0x00000000, 1, gcvFALSE, gcvFALSE);
@@ -1138,17 +1143,14 @@ _InitializeContextBuffer(
     /* Composition states. */
     index += _State(Context, index, 0x03008 >> 2, 0x00000000, 1, gcvFALSE, gcvFALSE);
 
+       index += _State(Context, index, (0x01460 >> 2) + (0 << 3), 0x00000000, Context->hardware->identity.pixelPipes, gcvFALSE, gcvTRUE);
+
     if (Context->hardware->identity.pixelPipes == 1)
     {
-        index += _State(Context, index, 0x01460 >> 2, 0x00000000, 8, gcvFALSE, gcvTRUE);
-
         index += _State(Context, index, 0x01430 >> 2, 0x00000000, 1, gcvFALSE, gcvTRUE);
         index += _State(Context, index, 0x01410 >> 2, 0x00000000, 1, gcvFALSE, gcvTRUE);
     }
-    else
-    {
-        index += _State(Context, index, (0x01460 >> 2) + (0 << 3), 0x00000000, Context->hardware->identity.pixelPipes, gcvFALSE, gcvTRUE);
-    }
+
 
     if (Context->hardware->identity.pixelPipes > 1 || halti0)
     {
@@ -1432,15 +1434,18 @@ _DestroyContext(
 #if REMOVE_DUPLICATED_COPY_FROM_USER
         if (Context->recordArrayMap != gcvNULL)
         {
-            gcsRECORD_ARRAY_MAP_PTR map = Context->recordArrayMap;
+            gctUINT i;
 
-            do
+            for (i = 0; i < gcdCONTEXT_BUFFER_COUNT; i++)
             {
-                /* Free record array. */
-                gcmkONERROR(gcmkOS_SAFE_FREE(Context->os, map->kData));
-                map = map->next;
+                gcsRECORD_ARRAY_MAP_PTR map = &Context->recordArrayMap[i];
+
+                if (map->kData != gcvNULL)
+                {
+                    /* Free record array. */
+                    gcmkONERROR(gcmkOS_SAFE_FREE(Context->os, map->kData));
+                }
             }
-            while (map != Context->recordArrayMap);
 
             gcmkONERROR(gcmkOS_SAFE_FREE(Context->os, Context->recordArrayMap));
         }
@@ -1578,6 +1583,16 @@ gckCONTEXT_Construct(
         = gcmSIZEOF(gcsSTATE_DELTA_RECORD) * (gctUINT)context->numStates;
 #endif
 
+#ifdef CONFIG_ANDROID
+    if (!((context->hardware->identity.chipModel == gcv3000)
+     && (context->hardware->identity.chipRevision == 0x5450)
+     && (context->hardware->identity.chipFlags & gcvCHIP_FLAG_GC2000_R2))
+    )
+    {
+        context->recordArraySize
+            = gcmSIZEOF(gcsSTATE_DELTA_RECORD) * (gctUINT)context->numStates;
+    }
+#endif
 
     if (context->maxState > 0)
     {
@@ -1925,13 +1940,18 @@ gckCONTEXT_Update(
 #if REMOVE_DUPLICATED_COPY_FROM_USER
     if (needCopy && (Context->recordArrayMap == gcvNULL))
     {
+        gctSIZE_T size = gcmSIZEOF(struct _gcsRECORD_ARRAY_MAP)
+                       * gcdCONTEXT_BUFFER_COUNT;
+
         /* Allocate enough maps. */
         gcmkONERROR(gckOS_Allocate(
             Context->os,
-            gcmSIZEOF(gcsRECORD_ARRAY_MAP_PTR) * gcdCONTEXT_BUFFER_COUNT,
+            size,
             (gctPOINTER *) &Context->recordArrayMap
             ));
 
+        gcmkONERROR(gckOS_ZeroMemory(Context->recordArrayMap, size));
+
         for (i = 0; i < gcdCONTEXT_BUFFER_COUNT; i++)
         {
             /* Next mapping id. */
@@ -1940,16 +1960,43 @@ gckCONTEXT_Update(
             recordArrayMap = &Context->recordArrayMap[i];
 
             /* Allocate the buffer. */
-            gcmkONERROR(gckOS_Allocate(
+            status = gckOS_Allocate(
                 Context->os,
                 Context->recordArraySize,
                 (gctPOINTER *) &recordArrayMap->kData
-                ));
+                );
+
+            if (gcmIS_ERROR(status))
+            {
+                break;
+            }
 
             /* Initialize fields. */
             recordArrayMap->key  = 0;
             recordArrayMap->next = &Context->recordArrayMap[n];
         }
+
+        if (gcmIS_ERROR(status))
+        {
+            /* Error roll back. */
+            for (i = 0; i < gcdCONTEXT_BUFFER_COUNT; i++)
+            {
+                recordArrayMap = &Context->recordArrayMap[i];
+
+                if (recordArrayMap->kData)
+                {
+                    /* Free allocated recordArray. */
+                    gcmkOS_SAFE_FREE(Context->os, recordArrayMap->kData);
+                    recordArrayMap->kData = gcvNULL;
+                }
+            }
+
+            /* Free recordArray map. */
+            gcmkOS_SAFE_FREE(Context->os, Context->recordArrayMap);
+            Context->recordArrayMap = gcvNULL;
+
+            gcmkONERROR(status);
+        }
     }
 #else
     if (needCopy && (Context->recordArray == gcvNULL))
index b02878b..1c84e0e 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index d672d85..3184eb5 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -348,6 +348,7 @@ _IdentifyHardware(
                                            || (Identity->chipRevision == 0x5039)
                                            || (Identity->chipRevision >= 0x5040)))
     || ((Identity->chipModel == gcv800) && (Identity->chipRevision == 0x4612))
+       || ((Identity->chipModel == gcv880) && (Identity->chipRevision == 0x5124))
     || ((Identity->chipModel == gcv600) && (Identity->chipRevision >= 0x4650))
     || ((Identity->chipModel == gcv860) && (Identity->chipRevision == 0x4647))
     || ((Identity->chipModel == gcv400) && (Identity->chipRevision >= 0x4633)))
@@ -1154,8 +1155,7 @@ gckHARDWARE_Construct(
             ? 0x0100
             : 0x0000;
 
-    /* VIV: Don't do sftware reset here for 0x2000, 0xfff5450 to workaround #12789. */
-    if (!(_IsHardwareMatch(hardware, gcv3000, 0x5450)))
+    if (!(_IsHardwareMatch(hardware, gcv3000, 0x5450) && (hardware->identity.chipFlags & gcvCHIP_FLAG_GC2000_R2)))
     {
         /* _ResetGPU need powerBaseAddress. */
         status = _ResetGPU(hardware, Os, Core);
@@ -7018,6 +7018,9 @@ gckHARDWARE_Reset(
         gcmkONERROR(_ResetGPU(Hardware, Hardware->os, Hardware->core));
     }
 
+    /* Force the command queue to reload the next context. */
+    Hardware->kernel->command->currContext = gcvNULL;
+
     /* Initialize hardware. */
     gcmkONERROR(gckHARDWARE_InitializeHardware(Hardware));
 
@@ -7336,8 +7339,8 @@ gckHARDWARE_IsFeatureAvailable(
         break;
 
     case gcvFEATURE_MMU:
-        available= ((((gctUINT32) (Hardware->identity.chipMinorFeatures1)) >> (0 ? 28:28) & ((gctUINT32) ((((1 ? 28:28) - (0 ? 28:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 28:28) - (0 ? 28:28) + 1)))))) == (0x1 & ((gctUINT32) ((((1 ? 28:28) - (0 ? 28:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 28:28) - (0 ? 28:28) + 1)))))));
-       break;
+        available = ((((gctUINT32) (Hardware->identity.chipMinorFeatures1)) >> (0 ? 28:28) & ((gctUINT32) ((((1 ? 28:28) - (0 ? 28:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 28:28) - (0 ? 28:28) + 1)))))) == (0x1 & ((gctUINT32) ((((1 ? 28:28) - (0 ? 28:28) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 28:28) - (0 ? 28:28) + 1)))))));
+        break;
 
     default:
         gcmkFATAL("Invalid feature has been requested.");
index 3a51870..62faf50 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 540d9e8..8f9f4c1 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index c111f98..d726359 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 8f11855..ecfd1ab 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index d50c471..6aeed61 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 1ab69db..aae638f 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 9fbfbf1..0d9a990 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index c04f1f8..6f2b935 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 2c322d1..5d072ab 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 1ae1c62..99eee27 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index be42946..d363f24 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 7bd0c57..a35b055 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index b69e156..f1e1a6d 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -1775,6 +1775,14 @@ gckEVENT_Submit(
             gcmkVERIFY_OK(_QueryFlush(Event, Event->queues[id].head, &flush));
 
 #if gcdNULL_DRIVER
+#if gcdINTERRUPT_STATISTIC
+            gcmkVERIFY_OK(gckOS_AtomIncrement(
+                Event->os,
+                Event->interruptCount,
+                &oldValue
+                ));
+#endif
+
             /* Notify immediately on infinite hardware. */
             gcmkONERROR(gckEVENT_Interrupt(Event, 1 << id));
 
@@ -1862,6 +1870,14 @@ gckEVENT_Submit(
                 ));
 #endif
 
+#if gcdINTERRUPT_STATISTIC
+            gcmkVERIFY_OK(gckOS_AtomIncrement(
+                Event->os,
+                Event->interruptCount,
+                &oldValue
+                ));
+#endif
+
 #if gcdSECURITY
             gckKERNEL_SecurityExecute(
                 Event->kernel,
@@ -1873,14 +1889,6 @@ gckEVENT_Submit(
             gcmkONERROR(gckCOMMAND_Execute(command, executeBytes));
 #endif
 #endif
-#if gcdINTERRUPT_STATISTIC
-            gcmkVERIFY_OK(gckOS_AtomIncrement(
-                Event->os,
-                Event->interruptCount,
-                &oldValue
-                ));
-#endif
-
         }
 
         /* Release the command queue. */
index 3d7da98..16b46a3 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 3fed5af..cda9ccc 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index b6baf0a..0b37843 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -126,11 +126,13 @@ typedef struct _gcsMirrorPageTable
 
     /* Number of cores use this shared pagetable. */
     gctUINT32       reference;
+
+    /* Mutex. */
+    gctPOINTER      mutex;
 }
 gcsMirrorPageTable;
 
 static gcsMirrorPageTable_PTR mirrorPageTable = gcvNULL;
-static gctPOINTER mirrorPageTableMutex = gcvNULL;
 #endif
 
 typedef struct _gcsDynamicSpaceNode * gcsDynamicSpaceNode_PTR;
@@ -1360,7 +1362,7 @@ OnError:
                     sizeof(struct _gcsMirrorPageTable)));
 
         gcmkONERROR(
-            gckOS_CreateMutex(Kernel->os, &mirrorPageTableMutex));
+            gckOS_CreateMutex(Kernel->os, &mirrorPageTable->mutex));
     }
 
     gcmkONERROR(_Construct(Kernel, MmuSize, Mmu));
@@ -1413,8 +1415,8 @@ gckMMU_Destroy(
 
     if (mirrorPageTable->reference == 0)
     {
+        gcmkVERIFY_OK(gcmkOS_SAFE_FREE(Mmu->os, mirrorPageTable->mutex));
         gcmkVERIFY_OK(gcmkOS_SAFE_FREE(Mmu->os, mirrorPageTable));
-        gcmkVERIFY_OK(gcmkOS_SAFE_FREE(Mmu->os, mirrorPageTableMutex));
     }
 
     return _Destroy(Mmu);
@@ -1761,57 +1763,35 @@ gckMMU_AllocatePagesEx(
 {
 #if gcdMIRROR_PAGETABLE
     gceSTATUS status;
-    gctPOINTER pageTable;
-    gctUINT32 address;
-    gctINT i;
     gckMMU mmu;
     gctBOOL acquired = gcvFALSE;
-    gctBOOL allocated = gcvFALSE;
 
-    gckOS_AcquireMutex(Mmu->os, mirrorPageTableMutex, gcvINFINITE);
+    gcmkHEADER();
+
+    gckOS_AcquireMutex(Mmu->os, mirrorPageTable->mutex, gcvINFINITE);
     acquired = gcvTRUE;
 
-    /* Allocate page table for current MMU. */
-    for (i = 0; i < (gctINT)mirrorPageTable->reference; i++)
-    {
-        if (Mmu == mirrorPageTable->mmus[i])
-        {
-            gcmkONERROR(_AllocatePages(Mmu, PageCount, Type, PageTable, Address));
-            allocated = gcvTRUE;
-        }
-    }
+    /* Get first mmu. */
+    mmu = mirrorPageTable->mmus[0];
 
-    /* Allocate page table for other MMUs. */
-    for (i = 0; i < (gctINT)mirrorPageTable->reference; i++)
-    {
-        mmu = mirrorPageTable->mmus[i];
+    gcmkVERIFY_OBJECT(mmu, gcvOBJ_MMU);
 
-        if (Mmu != mmu)
-        {
-            gcmkONERROR(_AllocatePages(mmu, PageCount, Type, &pageTable, &address));
-            gcmkASSERT(address == *Address);
-        }
-    }
+    /* Allocate page table from first mmu. */
+    gcmkONERROR(_AllocatePages(mmu, PageCount, Type, PageTable, Address));
 
-    gckOS_ReleaseMutex(Mmu->os, mirrorPageTableMutex);
+    gckOS_ReleaseMutex(Mmu->os, mirrorPageTable->mutex);
     acquired = gcvFALSE;
 
+    gcmkFOOTER_NO();
     return gcvSTATUS_OK;
-OnError:
-
-    if (allocated)
-    {
-        /* Page tables for multiple GPU always keep the same. So it is impossible
-         * the fist one allocates successfully but others fail.
-         */
-        gcmkASSERT(0);
-    }
 
+OnError:
     if (acquired)
     {
-        gckOS_ReleaseMutex(Mmu->os, mirrorPageTableMutex);
+        gckOS_ReleaseMutex(Mmu->os, mirrorPageTable->mutex);
     }
 
+    gcmkFOOTER();
     return status;
 #else
     return _AllocatePages(Mmu, PageCount, Type, PageTable, Address);
@@ -1828,25 +1808,22 @@ gckMMU_FreePages(
 #if gcdMIRROR_PAGETABLE
     gctINT i;
     gctUINT32 offset;
-    gckMMU mmu;
+    gckMMU mmu = mirrorPageTable->mmus[0];
 
-    gckOS_AcquireMutex(Mmu->os, mirrorPageTableMutex, gcvINFINITE);
+    gckOS_AcquireMutex(Mmu->os, mirrorPageTable->mutex, gcvINFINITE);
 
-    gcmkVERIFY_OK(_FreePages(Mmu, PageTable, PageCount));
+    gcmkVERIFY_OK(_FreePages(mmu, PageTable, PageCount));
 
-    offset = (gctUINT32)PageTable - (gctUINT32)Mmu->pageTableLogical;
+    offset = (gctUINT32)PageTable - (gctUINT32)mmu->pageTableLogical;
 
-    for (i = 0; i < (gctINT)mirrorPageTable->reference; i++)
+    for (i = 1; i < (gctINT)mirrorPageTable->reference; i++)
     {
         mmu = mirrorPageTable->mmus[i];
 
-        if (mmu != Mmu)
-        {
-            gcmkVERIFY_OK(_FreePages(mmu, mmu->pageTableLogical + offset/4, PageCount));
-        }
+        gcmkVERIFY_OK(_FreePages(mmu, mmu->pageTableLogical + offset/4, PageCount));
     }
 
-    gckOS_ReleaseMutex(Mmu->os, mirrorPageTableMutex);
+    gckOS_ReleaseMutex(Mmu->os, mirrorPageTable->mutex);
 
     return gcvSTATUS_OK;
 #else
@@ -1864,8 +1841,8 @@ gckMMU_SetPage(
 #if gcdMIRROR_PAGETABLE
     gctUINT32_PTR pageEntry;
     gctINT i;
-    gckMMU mmu;
-    gctUINT32 offset = (gctUINT32)PageEntry - (gctUINT32)Mmu->pageTableLogical;
+    gckMMU mmu = mirrorPageTable->mmus[0];
+    gctUINT32 offset = (gctUINT32)PageEntry - (gctUINT32)mmu->pageTableLogical;
 #endif
     gctUINT32 addressExt;
     gctUINT32 address;
@@ -1882,6 +1859,11 @@ gckMMU_SetPage(
     /* [39:32]. */
     addressExt = (gctUINT32)((PageAddress >> 32) & 0xFF);
 
+#if gcdMIRROR_PAGETABLE
+    /* Set first mmu. */
+    Mmu = mmu;
+#endif
+
     if (Mmu->hardware->mmuVersion == 0)
     {
         _WritePageEntry(PageEntry, address);
@@ -1892,24 +1874,20 @@ gckMMU_SetPage(
     }
 
 #if gcdMIRROR_PAGETABLE
-    for (i = 0; i < (gctINT)mirrorPageTable->reference; i++)
+    for (i = 1; i < (gctINT)mirrorPageTable->reference; i++)
     {
         mmu = mirrorPageTable->mmus[i];
 
-        if (mmu != Mmu)
-        {
-            pageEntry = mmu->pageTableLogical + offset / 4;
+        pageEntry = mmu->pageTableLogical + offset / 4;
 
-            if (mmu->hardware->mmuVersion == 0)
-            {
-                _WritePageEntry(pageEntry, address);
-            }
-            else
-            {
-                _WritePageEntry(pageEntry, _SetPage(address, addressExt));
-            }
+        if (mmu->hardware->mmuVersion == 0)
+        {
+            _WritePageEntry(pageEntry, address);
+        }
+        else
+        {
+            _WritePageEntry(pageEntry, _SetPage(address, addressExt));
         }
-
     }
 #endif
 
index 62f5c8a..8fc0049 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 5246cfc..c66ba04 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index a2b5e77..fe9b4f4 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 8f738f1..3ca9fe8 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index f992faa..9ea18b8 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -137,7 +137,7 @@ gceSTATUS gckVGKERNEL_Construct(
 
         /* Construct the gckVGMMU object. */
         gcmkERR_BREAK(gckVGMMU_Construct(
-            kernel, gcmMB2BYTES(1), &kernel->mmu
+            kernel, gcmKB2BYTES(gcdGC355_VGMMU_MEMORY_SIZE_KB), &kernel->mmu
             ));
 
         /* Return pointer to the gckKERNEL object. */
@@ -563,18 +563,22 @@ gceSTATUS gckVGKERNEL_Dispatch(
             Kernel, processID,
             (gctUINT32)kernelInterface->u.ReleaseVideoMemory.node
             ));
-        {
-            gckVIDMEM_NODE nodeObject;
+    {
+        gckVIDMEM_NODE nodeObject;
 
-            /* Remove record from process db. */
-            gcmkERR_BREAK(
-                gckKERNEL_RemoveProcessDB(Kernel, processID, gcvDB_VIDEO_MEMORY_LOCKED, (gctPOINTER)kernelInterface->u.ReleaseVideoMemory.node));
+        /* Remove record from process db. */
+        gcmkERR_BREAK(
+            gckKERNEL_RemoveProcessDB(Kernel, processID,
+                                      gcvDB_VIDEO_MEMORY_LOCKED,
+                                      (gctPOINTER)kernelInterface->u.ReleaseVideoMemory.node));
 
-            gcmkERR_BREAK(
-                gckVIDMEM_HANDLE_Lookup(Kernel, processID, (gctUINT32)kernelInterface->u.ReleaseVideoMemory.node, &nodeObject));
+        gcmkERR_BREAK(
+            gckVIDMEM_HANDLE_Lookup(Kernel, processID,
+                                    (gctUINT32)kernelInterface->u.ReleaseVideoMemory.node, &nodeObject));
+
+        gckVIDMEM_NODE_Dereference(Kernel, nodeObject);
+    }
 
-            gckVIDMEM_NODE_Dereference(Kernel, nodeObject);
-        }
 
         break;
 
@@ -853,6 +857,9 @@ gceSTATUS gckVGKERNEL_Dispatch(
 #endif
         break;
 
+    case gcvHAL_EVENT_COMMIT:
+        gcmkERR_BREAK(gcvSTATUS_NOT_SUPPORTED);
+        break;
 
     default:
         /* Invalid command. */
index 2ad509e..3c81083 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 16fd872..2504cc9 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 5fcc4ae..2800d42 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 7a5cb12..0f87835 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -134,190 +134,6 @@ typedef struct _gcsUSER_MEMORY_DESC *   gcsUSER_MEMORY_DESC_PTR;
     }\
 }
 
-#if defined(ANDROID)
-typedef struct _gcoOS_SymbolsList gcoOS_SymbolsList;
-#endif
-
-/******************************************************************************\
-******************************* Process local storage *************************
-\******************************************************************************/
-
-typedef struct _gcsPLS * gcsPLS_PTR;
-
-#if gcdENABLE_3D
-/******************************************************************************
-**
-** Patch defines which should be moved to dedicate file later
-**
-** !!! ALWAYS ADD new ID in the TAIL, otherwise will break exising TRACE FILE
-*******************************************************************************/
-typedef enum _gcePATCH_ID
-{
-    gcvPATCH_NOTINIT = -1,
-    gcvPATCH_INVALID = 0,
-
-#if gcdDEBUG_OPTION
-    gcvPATCH_DEBUG,
-#endif
-
-    gcvPATCH_GTFES30,
-    gcvPATCH_CTGL11,
-    gcvPATCH_CTGL20,
-    gcvPATCH_GLBM11,
-    gcvPATCH_GLBM21,
-    gcvPATCH_GLBM25,
-    gcvPATCH_GLBM27,
-    gcvPATCH_GLBMGUI,
-    gcvPATCH_GFXBENCH,
-    gcvPATCH_ANTUTU,        /* Antutu 3.x */
-    gcvPATCH_ANTUTU4X,      /* Antutu 4.x */
-    gcvPATCH_QUADRANT,
-    gcvPATCH_GPUBENCH,
-    gcvPATCH_DUOKAN,
-    gcvPATCH_GLOFTSXHM,
-    gcvPATCH_XRUNNER,
-    gcvPATCH_BUSPARKING3D,
-    gcvPATCH_SIEGECRAFT,
-    gcvPATCH_PREMIUM,
-    gcvPATCH_RACEILLEGAL,
-    gcvPATCH_MEGARUN,
-    gcvPATCH_BMGUI,
-    gcvPATCH_NENAMARK,
-    gcvPATCH_NENAMARK2,
-    gcvPATCH_FISHNOODLE,
-    gcvPATCH_MM06,
-    gcvPATCH_MM07,
-    gcvPATCH_BM21,
-    gcvPATCH_SMARTBENCH,
-    gcvPATCH_JPCT,
-    gcvPATCH_NEOCORE,
-    gcvPATCH_RTESTVA,
-    gcvPATCH_NBA2013,
-    gcvPATCH_BARDTALE,
-    gcvPATCH_F18,
-    gcvPATCH_CARPARK,
-    gcvPATCH_CARCHALLENGE,
-    gcvPATCH_HEROESCALL,
-    gcvPATCH_GLOFTF3HM,
-    gcvPATCH_CRAZYRACING,
-    gcvPATCH_FIREFOX,
-    gcvPATCH_CHROME,
-    gcvPATCH_MONOPOLY,
-    gcvPATCH_SNOWCOLD,
-    gcvPATCH_BM3,
-    gcvPATCH_BASEMARKX,
-    gcvPATCH_DEQP,
-    gcvPATCH_SF4,
-    gcePATCH_MGOHEAVEN2,
-    gcePATCH_SILIBILI,
-    gcePATCH_ELEMENTSDEF,
-    gcePATCH_GLOFTKRHM,
-    gcvPATCH_OCLCTS,
-    gcvPATCH_A8HP,
-    gcvPATCH_A8CN,
-    gcvPATCH_WISTONESG,
-    gcvPATCH_SPEEDRACE,
-    gcvPATCH_FSBHAWAIIF,
-    gcvPATCH_AIRNAVY,
-    gcvPATCH_F18NEW,
-    gcvPATCH_CKZOMBIES2,
-    gcvPATCH_EADGKEEPER,
-    gcvPATCH_BASEMARK2V2,
-    gcvPATCH_RIPTIDEGP2,
-    gcvPATCH_OESCTS,
-    gcvPATCH_GANGSTAR,
-    gcvPATCH_WHRKYZIXOVAN,
-    gcvPATCH_NAMESGAS,
-    gcvPATCH_AFTERBURNER,
-    gcvPATCH_UIMARK,
-    gcvPATCH_FM_OES_PLAYER,
-    gcvPATCH_SUMSUNG_BENCH,
-    gcvPATCH_ROCKSTAR_MAXPAYNE,
-    gcvPATCH_TITANPACKING,
-    gcvPATCH_OES20SFT,
-    gcvPATCH_OES30SFT,
-    gcvPATCH_BASEMARKOSIICN,
-    gcvPATCH_FRUITNINJA,
-    gcvPATCH_ANDROID_WEBGL,
-#if defined(ANDROID)
-    gcePATCH_ANDROID_CTS_MEDIA_PRESENTATIONTIME,
-#endif
-    gcvPATCH_ANDROID_COMPOSITOR,
-    gcvPATCH_CTS_TEXTUREVIEW,
-    gcvPATCH_WATER2_CHUKONG,
-    gcvPATCH_GOOGLEEARTH,
-    gcvPATCH_LEANBACK,
-    gcvPATCH_ANGRYBIRDS,
-    gcvPATCH_REALRACING,
-    gcvPATCH_CLASHOFCLAN,
-    gcvPATCH_TEMPLERUN,
-    gcvPATCH_SBROWSER,
-
-    gcvPATCH_COUNT
-} gcePATCH_ID;
-#endif /* gcdENABLE_3D */
-
-#if gcdENABLE_3D
-#define gcdPROC_IS_WEBGL(patchId) ((patchId) == gcvPATCH_CHROME || (patchId) == gcvPATCH_FIREFOX || (patchId) == gcvPATCH_ANDROID_WEBGL)
-#endif /* gcdENABLE_3D */
-
-typedef void (* gctPLS_DESTRUCTOR) (
-    gcsPLS_PTR
-    );
-
-typedef struct _gcsPLS
-{
-    /* Global objects. */
-    gcoOS                       os;
-    gcoHAL                      hal;
-
-    /* Internal memory pool. */
-    gctSIZE_T                   internalSize;
-    gctPHYS_ADDR                internalPhysical;
-    gctPOINTER                  internalLogical;
-
-    /* External memory pool. */
-    gctSIZE_T                   externalSize;
-    gctPHYS_ADDR                externalPhysical;
-    gctPOINTER                  externalLogical;
-
-    /* Contiguous memory pool. */
-    gctSIZE_T                   contiguousSize;
-    gctPHYS_ADDR                contiguousPhysical;
-    gctPOINTER                  contiguousLogical;
-
-    /* EGL-specific process-wide objects. */
-    gctPOINTER                  eglDisplayInfo;
-    gctPOINTER                  eglSurfaceInfo;
-    gceSURF_FORMAT              eglConfigFormat;
-
-    /* PLS reference count */
-    gcsATOM_PTR                 reference;
-
-    /* PorcessID of the constrcutor process */
-    gctUINT32                   processID;
-
-    /* ThreadID of the constrcutor process. */
-    gctSIZE_T                   threadID;
-    /* Flag for calling module destructor. */
-    gctBOOL                     exiting;
-
-    gctBOOL                     bNeedSupportNP2Texture;
-
-    gctPLS_DESTRUCTOR           destructor;
-    /* Mutex to guard PLS access. currently it's for EGL.
-    ** We can use this mutex for every PLS access.
-    */
-    gctPOINTER                  accessLock;
-#if gcdENABLE_3D
-    /* Global patchID to overwrite the detection */
-    gcePATCH_ID                 patchID;
-#endif
-}
-gcsPLS;
-
-extern gcsPLS gcPLS;
-
 #if gcdENABLE_3D
 #define gcPLS_INITIALIZER \
 { \
@@ -967,26 +783,6 @@ gcoHAL_GetDump(
     OUT gcoDUMP * Dump
     );
 
-#if gcdENABLE_3D
-gceSTATUS
-gcoHAL_SetPatchID(
-    IN  gcoHAL Hal,
-    IN  gcePATCH_ID PatchID
-    );
-
-/* Get Patch ID based on process name */
-gceSTATUS
-gcoHAL_GetPatchID(
-    IN  gcoHAL Hal,
-    OUT gcePATCH_ID * PatchID
-    );
-
-gceSTATUS
-gcoHAL_SetGlobalPatchID(
-    IN  gcoHAL Hal,
-    IN  gcePATCH_ID PatchID
-    );
-#endif /* gcdENABLE_3D */
 /* Call the kernel HAL layer. */
 gceSTATUS
 gcoHAL_Call(
@@ -1747,24 +1543,6 @@ gcoOS_QueryCurrentProcessName(
     IN gctSIZE_T Size
     );
 
-/* Detect if the current process is the executable specified. */
-gceSTATUS
-gcoOS_DetectProcessByName(
-    IN gctCONST_STRING Name
-    );
-
-gceSTATUS
-gcoOS_DetectProcessByEncryptedName(
-    IN gctCONST_STRING Name
-    );
-
-#if defined(ANDROID)
-gceSTATUS
-gcoOS_DetectProgrameByEncryptedSymbols(
-    IN gcoOS_SymbolsList Symbols
-    );
-#endif
-
 /*----------------------------------------------------------------------------*/
 /*----- Atoms ----------------------------------------------------------------*/
 
@@ -2684,6 +2462,14 @@ gcoSURF_Lock(
     IN OUT gctPOINTER * Memory
     );
 
+gceSTATUS
+gcoSURF_LockEx(
+    IN gcoSURF Surface,
+    OPTIONAL OUT gctUINT32 * Address,
+    OPTIONAL OUT gctPOINTER * Memory,
+    OPTIONAL OUT gctPHYS_ADDR_T *BusAddress
+    );
+
 /* Unlock the surface. */
 gceSTATUS
 gcoSURF_Unlock(
@@ -4949,15 +4735,6 @@ gcGetUserDebugOption(
     void
     );
 
-#if defined(ANDROID)
-struct _gcoOS_SymbolsList
-{
-#if gcdENABLE_3D
-    gcePATCH_ID patchId;
-#endif
-    const char * symList[10];
-};
-#endif
 
 #if gcdHAS_ELLIPSIS
 #define gcmUSER_DEBUG_MSG(level, ...) \
index 8a4be08..89a6558 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index f23139c..2a8e798 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index b203f8f..17de8d5 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 5fdc54a..dc982c3 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -93,9 +93,15 @@ typedef struct _DFBPixmap *  HALNativePixmapType;
 
 /* Wayland platform. */
 #include <wayland-egl.h>
+#include <pthread.h>
+
 
 #define WL_COMPOSITOR_SIGNATURE (0x31415926)
 
+#define WL_CLIENT_SIGNATURE     (0x27182818)
+
+#define WL_LOCAL_DISPLAY_SIGNATURE      (0x27182991)
+
 typedef struct _gcsWL_VIV_BUFFER
 {
    struct wl_resource *wl_buffer;
@@ -114,6 +120,12 @@ typedef struct _gcsWL_EGL_DISPLAY
    gctINT file;
 } gcsWL_EGL_DISPLAY;
 
+typedef struct _gcsWL_LOCAL_DISPLAY
+{
+   gctUINT wl_signature;
+   gctPOINTER localInfo;
+} gcsWL_LOCAL_DISPLAY;
+
 typedef struct _gcsWL_EGL_BUFFER_INFO
 {
    gctINT32 width;
@@ -125,16 +137,17 @@ typedef struct _gcsWL_EGL_BUFFER_INFO
    gcePOOL pool;
    gctUINT bytes;
    gcoSURF surface;
-   gcoSURF attached_surface;
    gctINT32 invalidate;
    gctBOOL locked;
 } gcsWL_EGL_BUFFER_INFO;
 
 typedef struct _gcsWL_EGL_BUFFER
 {
-   struct wl_buffer* wl_buffer;
+   gctUINT wl_signature;
    gcsWL_EGL_BUFFER_INFO info;
+   struct wl_buffer* wl_buffer;
    struct wl_callback* frame_callback;
+   struct wl_list link;
 } gcsWL_EGL_BUFFER;
 
 typedef struct _gcsWL_EGL_WINDOW_INFO
@@ -151,13 +164,17 @@ typedef struct _gcsWL_EGL_WINDOW_INFO
 
 struct wl_egl_window
 {
+   gctUINT wl_signature;
    gcsWL_EGL_DISPLAY* display;
    gcsWL_EGL_BUFFER **backbuffers;
    gcsWL_EGL_WINDOW_INFO* info;
    gctINT  noResolve;
    gctINT32 attached_width;
    gctINT32 attached_height;
+   gcsATOM_PTR reference;
+   pthread_mutex_t window_mutex;
    struct wl_surface* surface;
+   struct wl_list link;
 };
 
 typedef void*   HALNativeDisplayType;
@@ -677,8 +694,8 @@ gcoOS_ResizeWindow(
     IN gctPOINTER localDisplay,
     IN HALNativeWindowType Drawable,
     IN gctUINT Width,
-    IN gctUINT Height)
-    ;
+    IN gctUINT Height
+    );
 
 #ifdef USE_FREESCALE_EGL_ACCEL
 gceSTATUS
index 3a79ae4..d588cd3 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 220601a..e5adf8a 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 0c23be3..152cb9e 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index a6062df..cf85fdc 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -237,10 +237,14 @@ typedef enum _gceFEATURE
     gcvFEATURE_2D_OPF_YUV_OUTPUT,
     gcvFEATURE_2D_FILTERBLIT_A8_ALPHA,
     gcvFEATURE_2D_MULTI_SRC_BLT_TO_UNIFIED_DST_RECT,
+    gcvFEATURE_2D_MULTI_SRC_BLT_BILINEAR_FILTER,
     gcvFEATURE_V2_COMPRESSION_Z16_FIX,
 
     gcvFEATURE_VERTEX_INST_ID_AS_INTEGER,
     gcvFEATURE_2D_YUV_MODE,
+    gcvFEATURE_2D_CACHE_128B256BPERLINE,
+    gcvFEATURE_2D_MAJOR_SUPER_TILE,
+    gcvFEATURE_2D_V4COMPRESSION,
     gcvFEATURE_ACE,
     gcvFEATURE_COLOR_COMPRESSION,
 
@@ -315,6 +319,8 @@ typedef enum _gceFEATURE
     gcvFEATURE_MSAA_FRAGMENT_OPERATION,
     gcvFEATURE_ZERO_ATTRIB_SUPPORT,
     gcvFEATURE_TEX_CACHE_FLUSH_FIX,
+    gcvFEATURE_PE_DITHER_FIX2,
+    gcvFEATURE_LOD_FIX_FOR_BASELEVEL,
 
     /* Insert features above this comment only. */
     gcvFEATURE_COUNT                /* Not a feature. */
@@ -1093,6 +1099,19 @@ typedef enum _gce2D_YUV_COLOR_MODE
 }
 gce2D_YUV_COLOR_MODE;
 
+/* Nature rotation rules. */
+typedef enum _gce2D_NATURE_ROTATION
+{
+    gcvNR_0_DEGREE = 0,
+    gcvNR_LEFT_90_DEGREE,
+    gcvNR_RIGHT_90_DEGREE,
+    gcvNR_180_DEGREE,
+    gcvNR_FLIP_X,
+    gcvNR_FLIP_Y,
+    gcvNR_TOTAL_RULE,
+}
+gce2D_NATURE_ROTATION;
+
 typedef enum _gce2D_COMMAND
 {
     gcv2D_CLEAR = 0,
@@ -1119,6 +1138,9 @@ typedef enum _gce2D_TILE_STATUS_CONFIG
     gcv2D_TSC_DEC_TPC        = 0x00000040,
     gcv2D_TSC_DEC_TPC_COMPRESSED = 0x00000080,
 
+    gcv2D_TSC_V4_COMPRESSED      = 0x00000100,
+    gcv2D_TSC_V4_COMPRESSED_256B = 0x00000200 | gcv2D_TSC_V4_COMPRESSED,
+
     gcv2D_TSC_DEC_TPC_TILED  = gcv2D_TSC_DEC_COMPRESSED | gcv2D_TSC_DEC_TPC,
     gcv2D_TSC_DEC_TPC_TILED_COMPRESSED = gcv2D_TSC_DEC_TPC_TILED | gcv2D_TSC_DEC_TPC_COMPRESSED,
 }
@@ -1148,6 +1170,7 @@ typedef enum _gce2D_STATE
     gcv2D_STATE_EN_GAMMA,
     gcv2D_STATE_DE_GAMMA,
     gcv2D_STATE_MULTI_SRC_BLIT_UNIFIED_DST_RECT,
+    gcv2D_STATE_MULTI_SRC_BLIT_BILINEAR_FILTER,
     gcv2D_STATE_PROFILE_ENABLE,
     gcv2D_STATE_XRGB_ENABLE,
 
@@ -1259,6 +1282,7 @@ typedef enum _gceTILING
 
     /* Tiling special layouts. */
     gcvTILING_SPLIT_BUFFER = 0x100,
+    gcvTILING_Y_MAJOR      = 0x200,
 
     /* Tiling combination layouts. */
     gcvMULTI_TILED      = gcvTILED
@@ -1266,6 +1290,9 @@ typedef enum _gceTILING
 
     gcvMULTI_SUPERTILED = gcvSUPERTILED
                         | gcvTILING_SPLIT_BUFFER,
+
+    gcvYMAJOR_SUPERTILED = gcvSUPERTILED
+                        | gcvTILING_Y_MAJOR,
 }
 gceTILING;
 
index 8b71fc1..7ff9f63 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index ec6d0f3..4221f0e 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index a653d7d..3858b99 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
 #endif
 #endif
 
+#ifndef gcdGC355_VGMMU_MEMORY_SIZE_KB
+#   define gcdGC355_VGMMU_MEMORY_SIZE_KB   32
+#endif
+
 /*
     gcdSECURE_USER
 
 #ifndef gcdGPU_TIMEOUT
 #if gcdFPGA_BUILD
 #       define gcdGPU_TIMEOUT                   0
-#       define gcdGPU_2D_TIMEOUT                0
 #   else
 #       define gcdGPU_TIMEOUT                   20000
-#       define gcdGPU_2D_TIMEOUT                20000
 #   endif
 #endif
 
+/*
+    gcdGPU_2D_TIMEOUT
+
+        This define specified the number of milliseconds the system will wait
+        before it broadcasts the 2D GPU is stuck.  In other words, it will define
+        the timeout of any operation that needs to wait for the GPU.
+
+        If the value is 0, no timeout will be checked for.
+*/
+#ifndef gcdGPU_2D_TIMEOUT
+#if gcdFPGA_BUILD
+#       define gcdGPU_2D_TIMEOUT                0
+#   else
+#       define gcdGPU_2D_TIMEOUT                4000
+#   endif
+#endif
+
+
 /*
     gcdGPU_ADVANCETIMER
 
index fee3c31..c63a55a 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 03d170f..4b2fd54 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -1071,6 +1071,20 @@ gco2D_Commit(
     IN gctBOOL Stall
     );
 
+gceSTATUS
+gco2D_NatureRotateTranslation(
+    IN gctBOOL IsSrcRot,
+    IN gce2D_NATURE_ROTATION NatureRotation,
+    IN gctINT32 SrcSurfaceWidth,
+    IN gctINT32 SrcSurfaceHeight,
+    IN gctINT32 DstSurfaceWidth,
+    IN gctINT32 DstSurfaceHeight,
+    IN OUT gcsRECT_PTR SrcRect,
+    IN OUT gcsRECT_PTR DstRect,
+    OUT gceSURF_ROTATION * SrcRotation,
+    OUT gceSURF_ROTATION * DstRotation
+    );
+
 #ifdef __cplusplus
 }
 #endif
index 75c2658..66d1ef6 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 27f91f0..d7e54c9 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -71,12 +71,6 @@ typedef enum kernel_packet_command {
     KERNEL_EXECUTE,                       /* Execute a command buffer. */
 } kernel_packet_command_t;
 
-/*!
- @brief gckCOMMAND Object requests TrustZone to start FE.
- @discussion
- DMA enabled register can only be written in TrustZone to avoid GPU from jumping to a hacked code.
- Kernel module need use these command to ask TrustZone start command parser.
- */
 struct kernel_start_command {
     kernel_packet_command_t command;      /*! The command (always needs to be the first entry in a structure). */
     gctUINT8       gpu;                    /*! Which GPU. */
index 5611a8b..7deb736 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index f79f9ad..aa72880 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index ed77d1a..ee29658 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -62,8 +62,8 @@
 
 #define gcvVERSION_PATCH        11
 
-#define gcvVERSION_BUILD     33433
+#define gcvVERSION_BUILD     41671
 
-#define gcvVERSION_STRING    "5.0.11.p7.33433"
+#define gcvVERSION_STRING    "5.0.11.p8.pre.41671"
 
 #endif /* __gc_hal_version_h_ */
index e33d895..6a2c34f 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index b1df099..ab02c14 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 023ca2e..7e651b2 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 94ab3fa..3227524 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index ddb24c0..675d005 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -381,8 +381,8 @@ _CMAPhysical(
     )
 {
     struct mdl_cma_priv *mdl_priv=(struct mdl_cma_priv *)Mdl->priv;
-     gcmkASSERT(!Offset);
-    *Physical = mdl_priv->physical;
+
+    *Physical = mdl_priv->physical + Offset * PAGE_SIZE;
 
     return gcvSTATUS_OK;
 }
index 11c7add..4577247 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -725,8 +725,16 @@ _DefaultPhysical(
     OUT gctPHYS_ADDR_T * Physical
     )
 {
-    gcmkASSERT(Mdl->pagedMem && !Mdl->contiguous);
-    *Physical = _NonContiguousToPhys(Mdl->u.nonContiguousPages, Offset);
+    gcmkASSERT(Mdl->pagedMem);
+
+    if (Mdl->contiguous)
+    {
+        *Physical = page_to_phys(nth_page(Mdl->u.contiguousPages, Offset));
+    }
+    else
+    {
+        *Physical = _NonContiguousToPhys(Mdl->u.nonContiguousPages, Offset);
+    }
 
     return gcvSTATUS_OK;
 }
index 72f7c40..88ace8b 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 54782fd..8928cdf 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 4af6527..844152c 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -518,28 +518,15 @@ _DebugFSPrint (
  **                     LINUX SYSTEM FUNCTIONS (START)
  **
  *******************************************************************************/
-
-/*******************************************************************************
- **
- **  find the vivlog structure associated with an inode.
- **      returns a    pointer to the structure if found, NULL if not found
- **
- *******************************************************************************/
-static gcsDEBUGFS_Node*
-_GetNodeInfo (
-               IN struct inode *Inode
-               )
+static int
+_DebugFSOpen (
+    struct inode* inode,
+    struct file* filp
+    )
 {
-    gcsDEBUGFS_Node* node ;
+    filp->private_data = inode->i_private;
 
-    if ( Inode == NULL )
-        return NULL ;
-
-    for ( node = gc_dbgfs.linkedlist ; node != NULL ; node = node->next )
-        if ( node->filen->d_inode->i_ino == Inode->i_ino )
-            return node ;
-
-    return NULL ;
+    return 0;
 }
 
 /*******************************************************************************
@@ -557,13 +544,9 @@ _DebugFSRead (
 {
     int retval ;
     caddr_t data_to_return ;
-    gcsDEBUGFS_Node* node ;
-    /* get the metadata about this emlog */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
-    if ( ( node = _GetNodeInfo ( file->f_dentry->d_inode ) ) == NULL )
-#else
-    if ( ( node = _GetNodeInfo ( file_inode(file) ) ) == NULL )
-#endif
+    gcsDEBUGFS_Node* node = file->private_data;
+
+    if (node == NULL)
     {
         printk ( "debugfs_read: record not found\n" ) ;
         return - EIO ;
@@ -627,14 +610,10 @@ _DebugFSWrite (
 {
     caddr_t message = NULL ;
     int n ;
-    gcsDEBUGFS_Node*node ;
+    gcsDEBUGFS_Node* node = file->private_data;
 
     /* get the metadata about this log */
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
-    if ( ( node = _GetNodeInfo ( file->f_dentry->d_inode ) ) == NULL )
-#else
-    if ( ( node = _GetNodeInfo ( file_inode(file) ) ) == NULL )
-#endif    
+    if (node == NULL)
     {
         return - EIO ;
     }
@@ -902,6 +881,7 @@ vidmem_write(
  *******************************************************************************/
 static const struct file_operations debugfs_operations = {
                                                           .owner = THIS_MODULE ,
+                                                          .open = _DebugFSOpen ,
                                                           .read = _DebugFSRead ,
                                                           .write = _DebugFSWrite ,
 } ;
@@ -1051,7 +1031,7 @@ gckDEBUGFS_CreateNode (
         node->temp = NULL;
 
         /*creating the file*/
-        node->filen = debugfs_create_file(NodeName, S_IRUGO|S_IWUSR, node->parent, NULL,
+        node->filen = debugfs_create_file(NodeName, S_IRUGO|S_IWUSR, node->parent, node,
                                           &debugfs_operations);
     }
 
index 9a15d77..2a68aec 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index aae964e..d2f7797 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -2114,12 +2114,8 @@ gckGALDEVICE_Setup_ISR(
 #else
 #if gcdMULTI_GPU
     ret = request_irq(
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
-        Device->irqLine3D[gcvCORE_3D_0_ID], isrRoutine3D0, IRQF_DISABLED,
-#else
-        Device->irqLine3D[gcvCORE_3D_0_ID], isrRoutine3D0, 0x0,
-#endif
-       "galcore_3d_0", Device
+        Device->irqLine3D[gcvCORE_3D_0_ID], isrRoutine3D0, gcdIRQF_FLAG,
+        "galcore_3d_0", Device
         );
 
     if (ret != 0)
@@ -2139,11 +2135,7 @@ gckGALDEVICE_Setup_ISR(
 
 #if gcdMULTI_GPU > 1
     ret = request_irq(
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
-        Device->irqLine3D[gcvCORE_3D_1_ID], isrRoutine3D1, IRQF_DISABLED,
-#else
-        Device->irqLine3D[gcvCORE_3D_1_ID], isrRoutine3D1, 0x0,
-#endif
+        Device->irqLine3D[gcvCORE_3D_1_ID], isrRoutine3D1, gcdIRQF_FLAG,
         "galcore_3d_1", Device
         );
 
@@ -2164,12 +2156,8 @@ gckGALDEVICE_Setup_ISR(
 #endif
 #elif gcdMULTI_GPU_AFFINITY
     ret = request_irq(
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
-        Device->irqLines[gcvCORE_MAJOR], isrRoutine3D0, IRQF_DISABLED,
-#else
-        Device->irqLines[gcvCORE_MAJOR], isrRoutine3D0, 0x0,
-#endif
-       "galcore_3d_0", Device
+        Device->irqLines[gcvCORE_MAJOR], isrRoutine3D0, gcdIRQF_FLAG,
+        "galcore_3d_0", Device
         );
 
     if (ret != 0)
@@ -2188,11 +2176,7 @@ gckGALDEVICE_Setup_ISR(
     Device->isrInitializeds[gcvCORE_MAJOR] = gcvTRUE;
 
     ret = request_irq(
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
-        Device->irqLines[gcvCORE_OCL], isrRoutine3D1, IRQF_DISABLED,
-#else
-       Device->irqLines[gcvCORE_OCL], isrRoutine3D1, 0x0,
-#endif
+        Device->irqLines[gcvCORE_OCL], isrRoutine3D1, gcdIRQF_FLAG,
         "galcore_3d_1", Device
         );
 
@@ -2212,12 +2196,8 @@ gckGALDEVICE_Setup_ISR(
     Device->isrInitializeds[gcvCORE_OCL] = gcvTRUE;
 #else
     ret = request_irq(
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
-        Device->irqLines[gcvCORE_MAJOR], isrRoutine, IRQF_DISABLED,
-#else
-       Device->irqLines[gcvCORE_MAJOR], isrRoutine, 0x0,
-#endif
-       "galcore interrupt service", Device
+        Device->irqLines[gcvCORE_MAJOR], isrRoutine, gcdIRQF_FLAG,
+        "galcore interrupt service", Device
         );
 
     if (ret != 0)
@@ -2275,12 +2255,8 @@ gckGALDEVICE_Setup_ISR_2D(
         );
 #else
     ret = request_irq(
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
-        Device->irqLines[gcvCORE_2D], isrRoutine2D, IRQF_DISABLED,
-#else
-        Device->irqLines[gcvCORE_2D], isrRoutine2D, 0x0,
-#endif
-       "galcore interrupt service for 2D", Device
+        Device->irqLines[gcvCORE_2D], isrRoutine2D, gcdIRQF_FLAG,
+        "galcore interrupt service for 2D", Device
         );
 #endif
 
@@ -2337,12 +2313,8 @@ gckGALDEVICE_Setup_ISR_VG(
         );
 #else
     ret = request_irq(
-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
-        Device->irqLines[gcvCORE_VG], isrRoutineVG, IRQF_DISABLED,
-#else
-        Device->irqLines[gcvCORE_VG], isrRoutineVG, 0x0,
-#endif
-       "galcore interrupt service for 2D", Device
+        Device->irqLines[gcvCORE_VG], isrRoutineVG, gcdIRQF_FLAG,
+        "galcore interrupt service for 2D", Device
         );
 #endif
 
index 84c9704..c0d7574 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 843b7e1..86d628b 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index ad053af..f117bc4 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index d8b23fe..7688549 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
 #define gcdNOWARN 0
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION (4, 1, 0)
+#define gcdIRQF_FLAG   (0)
+#else
+#define gcdIRQF_FLAG   (IRQF_DISABLED)
+#endif
+
 /******************************************************************************\
 ********************************** Structures **********************************
 \******************************************************************************/
@@ -296,6 +302,7 @@ typedef struct _gcsPageInfo
 #if gcdPROCESS_ADDRESS_SPACE
     gckMMU mmu;
 #endif
+    gctBOOL *ref;
 }
 gcsPageInfo;
 
index ae3c8a7..d448450 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 7027d46..36f36f1 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 0d60dbe..ea98b52 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -175,7 +175,7 @@ _CreateMdlMap(
 
     gcmkHEADER_ARG("Mdl=0x%X ProcessID=%d", Mdl, ProcessID);
 
-    mdlMap = (PLINUX_MDL_MAP)kmalloc(sizeof(struct _LINUX_MDL_MAP), GFP_KERNEL | gcdNOWARN);
+    mdlMap = (PLINUX_MDL_MAP)kmalloc(sizeof(struct _LINUX_MDL_MAP), gcdNOWARN | GFP_ATOMIC);
     if (mdlMap == gcvNULL)
     {
         gcmkFOOTER_NO();
@@ -185,7 +185,8 @@ _CreateMdlMap(
     mdlMap->pid     = ProcessID;
     mdlMap->vmaAddr = gcvNULL;
     mdlMap->vma     = gcvNULL;
-    mdlMap->count   = 0;
+
+    atomic_set(&mdlMap->count, 0);
 
     mdlMap->next    = Mdl->maps;
     Mdl->maps       = mdlMap;
@@ -608,6 +609,7 @@ _ShrinkMemory(
     )
 {
     gcsPLATFORM * platform;
+    gceSTATUS status = gcvSTATUS_OK;
 
     gcmkHEADER_ARG("Os=0x%X", Os);
     gcmkVERIFY_OBJECT(Os, gcvOBJ_OS);
@@ -616,7 +618,7 @@ _ShrinkMemory(
 
     if (platform && platform->ops->shrinkMemory)
     {
-        platform->ops->shrinkMemory(platform);
+        status = platform->ops->shrinkMemory(platform);
     }
     else
     {
@@ -625,7 +627,7 @@ _ShrinkMemory(
     }
 
     gcmkFOOTER_NO();
-    return gcvSTATUS_OK;
+    return status;
 }
 
 /*******************************************************************************
@@ -1229,6 +1231,8 @@ gckOS_MapMemory(
         }
     }
 
+    MEMORY_UNLOCK(Os);
+
     if (mdlMap->vmaAddr == gcvNULL)
     {
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)
@@ -1269,8 +1273,6 @@ gckOS_MapMemory(
 
             mdlMap->vmaAddr = gcvNULL;
 
-            MEMORY_UNLOCK(Os);
-
             gcmkFOOTER_ARG("status=%d", gcvSTATUS_OUT_OF_MEMORY);
             return gcvSTATUS_OUT_OF_MEMORY;
         }
@@ -1291,8 +1293,6 @@ gckOS_MapMemory(
 
             up_write(&current->mm->mmap_sem);
 
-            MEMORY_UNLOCK(Os);
-
             gcmkFOOTER_ARG("status=%d", gcvSTATUS_OUT_OF_RESOURCES);
             return gcvSTATUS_OUT_OF_RESOURCES;
         }
@@ -1314,8 +1314,6 @@ gckOS_MapMemory(
 
             mdlMap->vmaAddr = gcvNULL;
 
-            MEMORY_UNLOCK(Os);
-
             gcmkFOOTER_ARG("status=%d", gcvSTATUS_OUT_OF_RESOURCES);
             return gcvSTATUS_OUT_OF_RESOURCES;
         }
@@ -1342,8 +1340,6 @@ gckOS_MapMemory(
 
             mdlMap->vmaAddr = gcvNULL;
 
-            MEMORY_UNLOCK(Os);
-
             gcmkFOOTER_ARG("status=%d", gcvSTATUS_OUT_OF_RESOURCES);
             return gcvSTATUS_OUT_OF_RESOURCES;
         }
@@ -1352,8 +1348,6 @@ gckOS_MapMemory(
         up_write(&current->mm->mmap_sem);
     }
 
-    MEMORY_UNLOCK(Os);
-
     *Logical = mdlMap->vmaAddr;
 
     gcmkFOOTER_ARG("*Logical=0x%X", *Logical);
@@ -1447,6 +1441,7 @@ gckOS_UnmapMemoryEx(
 {
     PLINUX_MDL_MAP          mdlMap;
     PLINUX_MDL              mdl = (PLINUX_MDL)Physical;
+    gctPOINTER              pointer = gcvNULL;
 
     gcmkHEADER_ARG("Os=0x%X Physical=0x%X Bytes=%lu Logical=0x%X PID=%d",
                    Os, Physical, Bytes, Logical, PID);
@@ -1472,13 +1467,18 @@ gckOS_UnmapMemoryEx(
             return gcvSTATUS_INVALID_ARGUMENT;
         }
 
-        _UnmapUserLogical(mdlMap->vmaAddr, mdl->numPages * PAGE_SIZE);
+        pointer = mdlMap->vmaAddr;
 
         gcmkVERIFY_OK(_DestroyMdlMap(mdl, mdlMap));
     }
 
     MEMORY_UNLOCK(Os);
 
+    if (pointer)
+    {
+        _UnmapUserLogical(pointer, mdl->numPages * PAGE_SIZE);
+    }
+
     /* Success. */
     gcmkFOOTER_NO();
     return gcvSTATUS_OK;
@@ -1583,7 +1583,6 @@ gckOS_AllocateNonPagedMemory(
     long size, order;
     gctPOINTER vaddr;
 #endif
-    gctBOOL locked = gcvFALSE;
     gceSTATUS status;
 
     gcmkHEADER_ARG("Os=0x%X InUserSpace=%d *Bytes=%lu",
@@ -1612,9 +1611,6 @@ gckOS_AllocateNonPagedMemory(
     mdl->pagedMem = 0;
     mdl->numPages = numPages;
 
-    MEMORY_LOCK(Os);
-    locked = gcvTRUE;
-
 #ifndef NO_DMA_COHERENT
 #ifdef CONFIG_ARM64
     addr = dma_alloc_coherent(gcvNULL,
@@ -1804,6 +1800,7 @@ gckOS_AllocateNonPagedMemory(
      * Will be used by get physical address
      * and mapuser pointer functions.
      */
+    MEMORY_LOCK(Os);
 
     if (!Os->mdlHead)
     {
@@ -1842,12 +1839,6 @@ OnError:
         gcmkVERIFY_OK(_DestroyMdl(mdl));
     }
 
-    if (locked)
-    {
-        /* Unlock memory. */
-        MEMORY_UNLOCK(Os);
-    }
-
     /* Return the status. */
     gcmkFOOTER();
     return status;
@@ -1903,8 +1894,6 @@ gceSTATUS gckOS_FreeNonPagedMemory(
     /* Convert physical address into a pointer to a MDL. */
     mdl = (PLINUX_MDL) Physical;
 
-    MEMORY_LOCK(Os);
-
 #ifndef NO_DMA_COHERENT
 #ifdef CONFIG_ARM64
     dma_free_coherent(gcvNULL,
@@ -1931,6 +1920,8 @@ gceSTATUS gckOS_FreeNonPagedMemory(
     _DestoryKernelVirtualMapping(mdl->addr);
 #endif /* NO_DMA_COHERENT */
 
+    MEMORY_LOCK(Os);
+
     mdlMap = mdl->maps;
 
     while (mdlMap != gcvNULL)
@@ -3883,21 +3874,21 @@ gckOS_LockPages(
         }
     }
 
-    if (mdlMap->vmaAddr == gcvNULL)
+    MEMORY_UNLOCK(Os);
+
+    if (atomic_inc_return(&mdlMap->count) == 1)
     {
+        gcmkASSERT(mdlMap->vmaAddr == gcvNULL);
+
         status = allocator->ops->MapUser(allocator, mdl, mdlMap, Cacheable);
 
         if (gcmIS_ERROR(status))
         {
-            MEMORY_UNLOCK(Os);
-
             gcmkFOOTER_ARG("*status=%d", status);
             return status;
         }
     }
 
-    mdlMap->count++;
-
     /* Convert pointer to MDL. */
     *Logical = mdlMap->vmaAddr;
 
@@ -3907,8 +3898,6 @@ gckOS_LockPages(
 
     *PageCount = mdl->numPages * (PAGE_SIZE / 4096);
 
-    MEMORY_UNLOCK(Os);
-
     gcmkVERIFY_OK(gckOS_CacheFlush(
         Os,
         _GetProcessID(),
@@ -4004,6 +3993,9 @@ gckOS_MapPagesEx(
 
     allocator = mdl->allocator;
 
+    /* Only support pagedMem, and pagedMem always has its allocator. */
+    gcmkASSERT(allocator != gcvNULL);
+
     gcmkTRACE_ZONE(
         gcvLEVEL_INFO, gcvZONE_OS,
         "%s(%d): Physical->0x%X PageCount->0x%X PagedMemory->?%d",
@@ -4035,23 +4027,7 @@ gckOS_MapPagesEx(
         gctUINT i;
         gctPHYS_ADDR_T phys = ~0U;
 
-        if (mdl->pagedMem && !mdl->contiguous)
-        {
-            allocator->ops->Physical(allocator, mdl, offset, &phys);
-        }
-        else
-        {
-            if (!mdl->pagedMem)
-            {
-                gcmkTRACE_ZONE(
-                    gcvLEVEL_INFO, gcvZONE_OS,
-                    "%s(%d): we should not get this call for Non Paged Memory!",
-                    __FUNCTION__, __LINE__
-                    );
-            }
-
-            phys = page_to_phys(nth_page(mdl->u.contiguousPages, offset));
-        }
+        allocator->ops->Physical(allocator, mdl, offset, &phys);
 
         gcmkVERIFY_OK(gckOS_CPUPhysicalToGPUPhysical(Os, phys, &phys));
 
@@ -4185,6 +4161,7 @@ gckOS_UnlockPages(
     PLINUX_MDL_MAP          mdlMap;
     PLINUX_MDL              mdl = (PLINUX_MDL)Physical;
     gckALLOCATOR            allocator = mdl->allocator;
+    gctPOINTER              pointer = gcvNULL;
 
     gcmkHEADER_ARG("Os=0x%X Physical=0x%X Bytes=%u Logical=0x%X",
                    Os, Physical, Bytes, Logical);
@@ -4202,15 +4179,15 @@ gckOS_UnlockPages(
     {
         if ((mdlMap->vmaAddr != gcvNULL) && (_GetProcessID() == mdlMap->pid))
         {
-            if (--mdlMap->count == 0)
+            if (atomic_dec_and_test(&mdlMap->count))
             {
-                allocator->ops->UnmapUser(
-                    allocator,
-                    mdlMap->vmaAddr,
-                    mdl->numPages * PAGE_SIZE);
-
+                /* User virtual address to be unmap. */
+                pointer = mdlMap->vmaAddr;
                 mdlMap->vmaAddr = gcvNULL;
             }
+
+            /* There is only one map for one process.*/
+            break;
         }
 
         mdlMap = mdlMap->next;
@@ -4218,6 +4195,11 @@ gckOS_UnlockPages(
 
     MEMORY_UNLOCK(Os);
 
+    if (pointer)
+    {
+        allocator->ops->UnmapUser(allocator, pointer, mdl->numPages * PAGE_SIZE);
+    }
+
     /* Success. */
     gcmkFOOTER_NO();
     return gcvSTATUS_OK;
@@ -4886,6 +4868,7 @@ OnError:
 
     gcsPageInfo_PTR info = gcvNULL;
     struct page **pages = gcvNULL;
+    gctBOOL *ref = gcvNULL;
 
     /* Verify the arguments. */
     gcmkVERIFY_OBJECT(Os, gcvOBJ_OS);
@@ -4949,6 +4932,14 @@ OnError:
             break;
         }
 
+        ref = (gctBOOL *)kzalloc((pageCount + extraPage) * sizeof(gctBOOL), GFP_KERNEL | gcdNOWARN);
+
+        if (ref == gcvNULL)
+        {
+            status = gcvSTATUS_OUT_OF_MEMORY;
+            break;
+        }
+
         if (Physical != ~0U)
         {
             for (i = 0; i < pageCount; i++)
@@ -4957,7 +4948,7 @@ OnError:
 
                 if (pfn_valid(page_to_pfn(pages[i])))
                 {
-                    get_page(pages[i]);
+                    ref[i] = get_page_unless_zero(pages[i]);
                 }
             }
         }
@@ -5084,10 +5075,18 @@ OnError:
                 {
                     if (pfn_valid(page_to_pfn(pages[i])))
                     {
-                        get_page(pages[i]);
+                        ref[i] = get_page_unless_zero(pages[i]);
                     }
                 }
             }
+            else
+            {
+                /* Mark feference when pages from get_user_pages. */
+                for (i = 0; i < pageCount; i++)
+                {
+                    ref[i] = gcvTRUE;
+                }
+            }
         }
 
         for (i = 0; i < pageCount; i++)
@@ -5275,6 +5274,7 @@ OnError:
         /* Save pointer to page table. */
         info->pageTable = pageTable;
         info->pages = pages;
+        info->ref   = ref;
 
         *Info = (gctPOINTER) info;
 
@@ -5349,6 +5349,13 @@ OnError:
             info->pages = gcvNULL;
         }
 
+        if (info!= gcvNULL && ref != gcvNULL)
+        {
+            /* Free the ref table. */
+            kfree(ref);
+            info->ref = gcvNULL;
+        }
+
         /* Release page info struct. */
         if (info != gcvNULL)
         {
@@ -5436,6 +5443,7 @@ OnError:
     gcsPageInfo_PTR info;
     gctSIZE_T pageCount, i;
     struct page **pages;
+    gctBOOL *ref;
 
     /* Verify the arguments. */
     gcmkVERIFY_OBJECT(Os, gcvOBJ_OS);
@@ -5449,6 +5457,8 @@ OnError:
 
         pages = info->pages;
 
+        ref = info->ref;
+
         gcmkTRACE_ZONE(
             gcvLEVEL_INFO, gcvZONE_OS,
             "%s(%d): info=0x%X, pages=0x%X.",
@@ -5566,7 +5576,7 @@ OnError:
                      SetPageDirty(pages[i]);
                 }
 
-                if (pfn_valid(page_to_pfn(pages[i])))
+                if (pfn_valid(page_to_pfn(pages[i])) && ref[i])
                 {
                     put_page(pages[i]);
                 }
@@ -5586,6 +5596,11 @@ OnError:
             kfree(info->pages);
         }
 
+        if (info->ref != gcvNULL)
+        {
+            kfree(info->ref);
+        }
+
         kfree(info);
     }
 
@@ -6870,8 +6885,12 @@ gckOS_QueryProfileTickRate(
 {
     struct timespec res;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
     res.tv_sec = 0;
     res.tv_nsec = hrtimer_resolution;
+#else
+    hrtimer_get_res(CLOCK_MONOTONIC, &res);
+#endif
 
     *TickRate = res.tv_nsec + res.tv_sec * 1000000000ULL;
 
@@ -8653,28 +8672,11 @@ gckOS_AllocatePageArray(
     {
         unsigned long phys = ~0;
 
-        if (mdl->pagedMem && !mdl->contiguous)
-        {
-            if (allocator)
-            {
-                gctPHYS_ADDR_T phys_addr;
-                allocator->ops->Physical(allocator, mdl, offset, &phys_addr);
-                phys = (unsigned long)phys_addr;
-            }
-        }
-        else
-        {
-            if (!mdl->pagedMem)
-            {
-                gcmkTRACE_ZONE(
-                    gcvLEVEL_INFO, gcvZONE_OS,
-                    "%s(%d): we should not get this call for Non Paged Memory!",
-                    __FUNCTION__, __LINE__
-                    );
-            }
+        gctPHYS_ADDR_T phys_addr;
 
-            phys = page_to_phys(nth_page(mdl->u.contiguousPages, offset));
-        }
+        allocator->ops->Physical(allocator, mdl, offset, &phys_addr);
+
+        phys = (unsigned long)phys_addr;
 
         table[offset] = phys;
 
index 692a5a8..162095f 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -60,7 +60,7 @@ typedef struct _LINUX_MDL_MAP
 {
     gctINT                  pid;
     gctPOINTER              vmaAddr;
-    gctUINT32               count;
+    atomic_t                count;
     struct vm_area_struct * vma;
     struct _LINUX_MDL_MAP * next;
 }
index bf19409..ba46f75 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 8e2f579..3ebdfc6 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 9dfb755..43b927d 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 3a0feac..26290ed 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 658b205..1ef76d4 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
index 10f571b..1c144e7 100644 (file)
@@ -2,7 +2,7 @@
 *
 *    The MIT License (MIT)
 *
-*    Copyright (c) 2014 Vivante Corporation
+*    Copyright (c) 2014 - 2015 Vivante Corporation
 *
 *    Permission is hereby granted, free of charge, to any person obtaining a
 *    copy of this software and associated documentation files (the "Software"),
@@ -26,7 +26,7 @@
 *
 *    The GPL License (GPL)
 *
-*    Copyright (C) 2014  Vivante Corporation
+*    Copyright (C) 2014 - 2015 Vivante Corporation
 *
 *    This program is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU General Public License
@@ -74,7 +74,7 @@
 #include <linux/pm_runtime.h>
 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
 #include <mach/busfreq.h>
-#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0)
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 29)
 #include <linux/busfreq-imx6.h>
 #include <linux/reset.h>
 #else
@@ -92,6 +92,7 @@
 
 #include <linux/regulator/consumer.h>
 
+#ifdef CONFIG_DEVICE_THERMAL
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)
 #include <linux/device_cooling.h>
 #define REG_THERMAL_NOTIFIER(a) register_devfreq_cooling_notifier(a);
@@ -102,6 +103,7 @@ extern int unregister_thermal_notifier(struct notifier_block *nb);
 #define REG_THERMAL_NOTIFIER(a) register_thermal_notifier(a);
 #define UNREG_THERMAL_NOTIFIER(a) unregister_thermal_notifier(a);
 #endif
+#endif
 
 #ifndef gcdDEFAULT_CONTIGUOUS_SIZE
 #define gcdDEFAULT_CONTIGUOUS_SIZE (4 << 20)
@@ -211,7 +213,7 @@ static int force_contiguous_lowmem_shrink(IN gckKERNEL Kernel)
                selected_tasksize = tasksize;
                selected_oom_adj = oom_adj;
        }
-       if (selected) {
+    if (selected && selected_oom_adj > 0) {
                gckOS_Print("<gpu> send sigkill to %d (%s), adj %d, size %d\n",
                             selected->pid, selected->comm,
                             selected_oom_adj, selected_tasksize);
@@ -237,6 +239,7 @@ _ShrinkMemory(
     struct platform_device *pdev;
     gckGALDEVICE galDevice;
     gckKERNEL kernel;
+    gceSTATUS status = gcvSTATUS_OK;
 
     pdev = Platform->device;
 
@@ -246,18 +249,19 @@ _ShrinkMemory(
 
     if (kernel != gcvNULL)
     {
-        force_contiguous_lowmem_shrink(kernel);
+        if (force_contiguous_lowmem_shrink(kernel) != 0)
+            status = gcvSTATUS_OUT_OF_MEMORY;
     }
     else
     {
         gcmkPRINT("%s(%d) can't find kernel! ", __FUNCTION__, __LINE__);
     }
 
-    return gcvSTATUS_OK;
+    return status;
 }
 #endif
 
-#if gcdENABLE_FSCALE_VAL_ADJUST
+#if gcdENABLE_FSCALE_VAL_ADJUST && defined(CONFIG_DEVICE_THERMAL)
 static int thermal_hot_pm_notify(struct notifier_block *nb, unsigned long event,
        void *dummy)
 {
index 5ba25b5..3adb9bf 100644 (file)
@@ -16,5 +16,7 @@ CUSTOMER_ALLOCATOR_OBJS := $(ALLOCATOR_ARRAY_H_LOCATION)/gc_hal_kernel_allocator
 
 EXTRA_CFLAGS += -DCLASS_NAME=\"gpu_class\"
 
+EXTRA_CFLAGS += -DgcdGPU_2D_TIMEOUT=20000
+
 EXTRA_CFLAGS += -DDISABLE_RECORD_ARRAY_SIZE_OPTIMIZATION