summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Xiao <b49994@freescale.com>2015-12-11 16:51:47 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:20:42 +0300
commit19f152f96bdb32c8dfa17373769f60db795bf975 (patch)
tree04b72a3775bf4022f8d5acc9c1cd657703ceceeb
parent1028e09a9d672c5733964ed1f0104e676a80c0a5 (diff)
MGS-1274 gpu: Integrate 5.0.11.p8 driver
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>
-rw-r--r--drivers/mxc/gpu-viv/Kbuild14
-rw-r--r--drivers/mxc/gpu-viv/config50
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.c85
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware.c15
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_recorder.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_vg.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_vg.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_debug.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c28
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_heap.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_interrupt_vg.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c108
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu_vg.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_power.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_precomp.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_security.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c31
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h243
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver_vg.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_dump.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h29
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform_type.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine_vg.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h31
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_mem.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h28
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_profiler.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_raster.h18
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_rename.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_security_interface.h10
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_statistics.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_types.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h8
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_vg.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_array.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_array.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c8
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.c16
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debug.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c52
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c56
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_iommu.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h11
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_math.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_mutex.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c168
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h6
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_platform.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_probe.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_security_channel.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.c4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.h4
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c18
-rw-r--r--drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.config2
74 files changed, 570 insertions, 669 deletions
diff --git a/drivers/mxc/gpu-viv/Kbuild b/drivers/mxc/gpu-viv/Kbuild
index b651bbf577f1..485e7a3ab667 100644
--- a/drivers/mxc/gpu-viv/Kbuild
+++ b/drivers/mxc/gpu-viv/Kbuild
@@ -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
diff --git a/drivers/mxc/gpu-viv/config b/drivers/mxc/gpu-viv/config
index 94841414a07a..0eeffefbf48a 100644
--- a/drivers/mxc/gpu-viv/config
+++ b/drivers/mxc/gpu-viv/config
@@ -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.
#
##############################################################################
diff --git a/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.c b/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.c
index 04e669a36a74..f633db86b25c 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.c
@@ -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))
diff --git a/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.h b/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.h
index b02878b82339..1c84e0edc121 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_context.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware.c b/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware.c
index d672d859e2bd..3184eb56a447 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware.c
@@ -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.");
diff --git a/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware.h b/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware.h
index 3a5187058e7f..62faf5083162 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_hardware.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_recorder.c b/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_recorder.c
index 540d9e83b9b7..8f9f4c1c2fd1 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_recorder.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/arch/gc_hal_kernel_recorder.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.c b/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.c
index c111f98c8442..d726359d8b1b 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.h b/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.h
index 8f1185584340..ecfd1aba76ba 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_command_vg.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_vg.c b/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_vg.c
index d50c471c2ec5..6aeed612ff64 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_vg.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_vg.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_vg.h b/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_vg.h
index 1ab69db22b1d..aae638f7de0f 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_vg.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/archvg/gc_hal_kernel_hardware_vg.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
index 9fbfbf1d6847..0d9a990381ad 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h
index c04f1f849b6c..6f2b935dfe25 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c
index 2c322d153305..5d072ab584eb 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c
index 1ae1c62de2d3..99eee2725d1e 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
index be42946e5a2a..d363f24d2f61 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_debug.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_debug.c
index 7bd0c57c8e55..a35b05549ffb 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_debug.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_debug.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c
index b69e156cd847..f1e1a6d0f16f 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c
@@ -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. */
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_heap.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_heap.c
index 3d7da980b84b..16b46a39ecc4 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_heap.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_heap.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_interrupt_vg.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_interrupt_vg.c
index 3fed5af91bbd..cda9ccc84cd7 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_interrupt_vg.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_interrupt_vg.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c
index b6baf0aa0257..0b3784335e29 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu_vg.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu_vg.c
index 62f5c8a50499..8fc0049eb1f7 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu_vg.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu_vg.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_power.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_power.c
index 5246cfcab02c..c66ba040b757 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_power.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_power.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_precomp.h b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_precomp.h
index a2b5e771a15d..fe9b4f4f2b9f 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_precomp.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_precomp.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_security.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_security.c
index 8f738f166ef6..3ca9fe8cab90 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_security.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_security.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c
index f992faabe9ce..9ea18b813f2c 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.c
@@ -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. */
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.h b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.h
index 2ad509e442c0..3c810831341a 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_vg.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c
index 16fd872b312b..2504cc9935f2 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_video_memory.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h
index 5fcc4ae612b7..2800d420c5d8 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h
index 7a5cb12b5d18..0f8783533ef0 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h
@@ -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, ...) \
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver.h
index 8a4be08b8404..89a655836085 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver_vg.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver_vg.h
index f23139ced20f..2a8e798af101 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver_vg.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver_vg.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_dump.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_dump.h
index b203f8f7e309..17de8d5fd2f4 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_dump.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_dump.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h
index 5fdc54aa4e60..dc982c31e138 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform_type.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform_type.h
index 3a79ae4eb713..d588cd32b1fb 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform_type.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_eglplatform_type.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h
index 220601a54d90..e5adf8a09efe 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine_vg.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine_vg.h
index 0c23be36cd5b..152cb9e55fef 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine_vg.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine_vg.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h
index a6062dfb6db7..cf85fdca5e35 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h
@@ -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;
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h
index 8b71fc13e5cd..7ff9f637e960 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_kernel_buffer.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_mem.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_mem.h
index ec6d0f3bf501..4221f0ecadaa 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_mem.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_mem.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h
index a653d7d7042f..3858b999c9c9 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h
@@ -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
@@ -435,6 +435,10 @@
#endif
#endif
+#ifndef gcdGC355_VGMMU_MEMORY_SIZE_KB
+# define gcdGC355_VGMMU_MEMORY_SIZE_KB 32
+#endif
+
/*
gcdSECURE_USER
@@ -532,14 +536,30 @@
#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
it is advance timer.
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_profiler.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_profiler.h
index fee3c31b10c0..c63a55a372ef 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_profiler.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_profiler.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_raster.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_raster.h
index 03d170f509fd..4b2fd54b52f7 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_raster.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_raster.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_rename.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_rename.h
index 75c26589946e..66d1ef646ae9 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_rename.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_rename.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_security_interface.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_security_interface.h
index 27f91f0aec3a..d7e54c90ee89 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_security_interface.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_security_interface.h
@@ -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. */
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_statistics.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_statistics.h
index 5611a8bc214a..7deb736f7061 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_statistics.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_statistics.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_types.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_types.h
index f79f9ad57bde..aa72880a3a1c 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_types.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_types.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h
index ed77d1aa8cde..ee2965853842 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h
@@ -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_ */
diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_vg.h b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_vg.h
index e33d895d1ce2..6a2c34f74a87 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_vg.h
+++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_vg.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_array.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_array.h
index b1df099e7a34..ab02c1486f01 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_array.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_array.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c
index 023ca2e696ac..7e651b23127c 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/default/gc_hal_kernel_allocator_dmabuf.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_array.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_array.h
index 94ab3fa10b37..3227524e1390 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_array.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_array.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c
index ddb24c0ab84c..675d005dbbe9 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/allocator/freescale/gc_hal_kernel_allocator_cma.c
@@ -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;
}
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.c
index 11c7add772c4..457724773451 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.c
@@ -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;
}
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.h
index 72f7c40598d6..88ace8b9c5db 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_allocator.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debug.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debug.h
index 54782fd8ccc8..8928cdf80e86 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debug.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debug.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c
index 4af6527df705..844152cb8dc9 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c
@@ -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);
}
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.h
index 9a15d77747b8..2a68aec652cf 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
index aae964e9245b..d2f779782110 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.h
index 84c97048e85d..c0d757420793 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_iommu.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_iommu.c
index 843b7e14f0d9..86d628bfc32e 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_iommu.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_iommu.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.c
index ad053af14a67..f117bc49cc57 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
index d8b23fef90c3..76885496d7ff 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h
@@ -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
@@ -145,6 +145,12 @@
#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;
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_math.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_math.c
index ae3c8a79a946..d448450239a7 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_math.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_math.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_mutex.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_mutex.h
index 7027d464e11b..36f36f18b1a6 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_mutex.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_mutex.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
index 0d60dbe6bb63..ea98b5231ed1 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c
@@ -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;
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h
index 692a5a885355..162095f5e23b 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h
@@ -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;
}
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_platform.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_platform.h
index bf19409129ff..ba46f75f28aa 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_platform.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_platform.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_probe.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_probe.c
index 8e2f57954fe2..3ebdfc64da0f 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_probe.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_probe.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_security_channel.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_security_channel.c
index 9dfb755c0519..43b927df70ed 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_security_channel.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_security_channel.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.c
index 3a0feac03b69..26290ed15acf 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.c
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.h
index 658b205ecd54..1ef76d4a28c2 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.h
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_sync.h
@@ -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
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c
index 10f571bb57fa..1c144e70070f 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.c
@@ -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)
{
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.config b/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.config
index 5ba25b5de676..3adb9bf939e7 100644
--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.config
+++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/platform/freescale/gc_hal_kernel_platform_imx6q14.config
@@ -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