#
# 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"),
#
# 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
#
# Linux build file for kernel HAL driver.
#
-
AQROOT := $(srctree)/drivers/mxc/gpu-viv
include $(AQROOT)/config
# 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
EXTRA_CFLAGS += -DHOST=\"$(HOST)\"
-obj-$(CONFIG_MXC_GPU_VIV) += galcore.o
+obj-m = $(MODULE_NAME).o
-galcore-objs := $(OBJS)
+$(MODULE_NAME)-objs = $(OBJS)
endif
##############################################################################
#
-# 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.
#
##############################################################################
*
* 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"),
*
* The GPL License (GPL)
*
-* Copyright (C) 2014 Vivante Corporation
+* Copyright (C) 2014 - 2015 Vivante Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
index += _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);
/* 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)
{
#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));
}
= 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)
{
#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. */
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))
*
* 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"),
*
* 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
*
* 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"),
*
* 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
|| (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)))
? 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);
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));
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.");
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
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));
));
#endif
+#if gcdINTERRUPT_STATISTIC
+ gcmkVERIFY_OK(gckOS_AtomIncrement(
+ Event->os,
+ Event->interruptCount,
+ &oldValue
+ ));
+#endif
+
#if gcdSECURITY
gckKERNEL_SecurityExecute(
Event->kernel,
gcmkONERROR(gckCOMMAND_Execute(command, executeBytes));
#endif
#endif
-#if gcdINTERRUPT_STATISTIC
- gcmkVERIFY_OK(gckOS_AtomIncrement(
- Event->os,
- Event->interruptCount,
- &oldValue
- ));
-#endif
-
}
/* Release the command queue. */
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
/* 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;
sizeof(struct _gcsMirrorPageTable)));
gcmkONERROR(
- gckOS_CreateMutex(Kernel->os, &mirrorPageTableMutex));
+ gckOS_CreateMutex(Kernel->os, &mirrorPageTable->mutex));
}
gcmkONERROR(_Construct(Kernel, MmuSize, Mmu));
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);
{
#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);
#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
#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;
/* [39:32]. */
addressExt = (gctUINT32)((PageAddress >> 32) & 0xFF);
+#if gcdMIRROR_PAGETABLE
+ /* Set first mmu. */
+ Mmu = mmu;
+#endif
+
if (Mmu->hardware->mmuVersion == 0)
{
_WritePageEntry(PageEntry, address);
}
#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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
/* 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. */
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;
#endif
break;
+ case gcvHAL_EVENT_COMMIT:
+ gcmkERR_BREAK(gcvSTATUS_NOT_SUPPORTED);
+ break;
default:
/* Invalid command. */
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
}\
}
-#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 \
{ \
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(
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 ----------------------------------------------------------------*/
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(
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, ...) \
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
/* 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;
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;
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
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;
IN gctPOINTER localDisplay,
IN HALNativeWindowType Drawable,
IN gctUINT Width,
- IN gctUINT Height)
- ;
+ IN gctUINT Height
+ );
#ifdef USE_FREESCALE_EGL_ACCEL
gceSTATUS
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
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,
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. */
}
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,
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,
}
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,
/* Tiling special layouts. */
gcvTILING_SPLIT_BUFFER = 0x100,
+ gcvTILING_Y_MAJOR = 0x200,
/* Tiling combination layouts. */
gcvMULTI_TILED = gcvTILED
gcvMULTI_SUPERTILED = gcvSUPERTILED
| gcvTILING_SPLIT_BUFFER,
+
+ gcvYMAJOR_SUPERTILED = gcvSUPERTILED
+ | gcvTILING_Y_MAJOR,
}
gceTILING;
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* The GPL License (GPL)
*
-* Copyright (C) 2014 Vivante Corporation
+* Copyright (C) 2014 - 2015 Vivante Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
#endif
#endif
+#ifndef gcdGC355_VGMMU_MEMORY_SIZE_KB
+# define gcdGC355_VGMMU_MEMORY_SIZE_KB 32
+#endif
+
/*
gcdSECURE_USER
#ifndef gcdGPU_TIMEOUT
#if gcdFPGA_BUILD
# define gcdGPU_TIMEOUT 0
-# define gcdGPU_2D_TIMEOUT 0
# else
# define gcdGPU_TIMEOUT 20000
-# define gcdGPU_2D_TIMEOUT 20000
# endif
#endif
+/*
+ gcdGPU_2D_TIMEOUT
+
+ This define specified the number of milliseconds the system will wait
+ before it broadcasts the 2D GPU is stuck. In other words, it will define
+ the timeout of any operation that needs to wait for the GPU.
+
+ If the value is 0, no timeout will be checked for.
+*/
+#ifndef gcdGPU_2D_TIMEOUT
+#if gcdFPGA_BUILD
+# define gcdGPU_2D_TIMEOUT 0
+# else
+# define gcdGPU_2D_TIMEOUT 4000
+# endif
+#endif
+
+
/*
gcdGPU_ADVANCETIMER
*
* 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"),
*
* 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
*
* 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"),
*
* 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
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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
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. */
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* The GPL License (GPL)
*
-* Copyright (C) 2014 Vivante Corporation
+* Copyright (C) 2014 - 2015 Vivante Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
#define 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_ */
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
)
{
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;
}
*
* 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"),
*
* 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
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;
}
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
** 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;
}
/*******************************************************************************
{
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 ;
{
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 ;
}
*******************************************************************************/
static const struct file_operations debugfs_operations = {
.owner = THIS_MODULE ,
+ .open = _DebugFSOpen ,
.read = _DebugFSRead ,
.write = _DebugFSWrite ,
} ;
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);
}
*
* 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"),
*
* 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
*
* 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"),
*
* 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
#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)
#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
);
#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)
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
);
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)
);
#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
);
#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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* The GPL License (GPL)
*
-* Copyright (C) 2014 Vivante Corporation
+* Copyright (C) 2014 - 2015 Vivante Corporation
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
#define gcdNOWARN 0
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION (4, 1, 0)
+#define gcdIRQF_FLAG (0)
+#else
+#define gcdIRQF_FLAG (IRQF_DISABLED)
+#endif
+
/******************************************************************************\
********************************** Structures **********************************
\******************************************************************************/
#if gcdPROCESS_ADDRESS_SPACE
gckMMU mmu;
#endif
+ gctBOOL *ref;
}
gcsPageInfo;
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
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();
mdlMap->pid = ProcessID;
mdlMap->vmaAddr = gcvNULL;
mdlMap->vma = gcvNULL;
- mdlMap->count = 0;
+
+ atomic_set(&mdlMap->count, 0);
mdlMap->next = Mdl->maps;
Mdl->maps = mdlMap;
)
{
gcsPLATFORM * platform;
+ gceSTATUS status = gcvSTATUS_OK;
gcmkHEADER_ARG("Os=0x%X", Os);
gcmkVERIFY_OBJECT(Os, gcvOBJ_OS);
if (platform && platform->ops->shrinkMemory)
{
- platform->ops->shrinkMemory(platform);
+ status = platform->ops->shrinkMemory(platform);
}
else
{
}
gcmkFOOTER_NO();
- return gcvSTATUS_OK;
+ return status;
}
/*******************************************************************************
}
}
+ MEMORY_UNLOCK(Os);
+
if (mdlMap->vmaAddr == gcvNULL)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 4, 0)
mdlMap->vmaAddr = gcvNULL;
- MEMORY_UNLOCK(Os);
-
gcmkFOOTER_ARG("status=%d", gcvSTATUS_OUT_OF_MEMORY);
return gcvSTATUS_OUT_OF_MEMORY;
}
up_write(¤t->mm->mmap_sem);
- MEMORY_UNLOCK(Os);
-
gcmkFOOTER_ARG("status=%d", gcvSTATUS_OUT_OF_RESOURCES);
return gcvSTATUS_OUT_OF_RESOURCES;
}
mdlMap->vmaAddr = gcvNULL;
- MEMORY_UNLOCK(Os);
-
gcmkFOOTER_ARG("status=%d", gcvSTATUS_OUT_OF_RESOURCES);
return gcvSTATUS_OUT_OF_RESOURCES;
}
mdlMap->vmaAddr = gcvNULL;
- MEMORY_UNLOCK(Os);
-
gcmkFOOTER_ARG("status=%d", gcvSTATUS_OUT_OF_RESOURCES);
return gcvSTATUS_OUT_OF_RESOURCES;
}
up_write(¤t->mm->mmap_sem);
}
- MEMORY_UNLOCK(Os);
-
*Logical = mdlMap->vmaAddr;
gcmkFOOTER_ARG("*Logical=0x%X", *Logical);
{
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);
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;
long size, order;
gctPOINTER vaddr;
#endif
- gctBOOL locked = gcvFALSE;
gceSTATUS status;
gcmkHEADER_ARG("Os=0x%X InUserSpace=%d *Bytes=%lu",
mdl->pagedMem = 0;
mdl->numPages = numPages;
- MEMORY_LOCK(Os);
- locked = gcvTRUE;
-
#ifndef NO_DMA_COHERENT
#ifdef CONFIG_ARM64
addr = dma_alloc_coherent(gcvNULL,
* Will be used by get physical address
* and mapuser pointer functions.
*/
+ MEMORY_LOCK(Os);
if (!Os->mdlHead)
{
gcmkVERIFY_OK(_DestroyMdl(mdl));
}
- if (locked)
- {
- /* Unlock memory. */
- MEMORY_UNLOCK(Os);
- }
-
/* Return the status. */
gcmkFOOTER();
return status;
/* 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,
_DestoryKernelVirtualMapping(mdl->addr);
#endif /* NO_DMA_COHERENT */
+ MEMORY_LOCK(Os);
+
mdlMap = mdl->maps;
while (mdlMap != gcvNULL)
}
}
- 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;
*PageCount = mdl->numPages * (PAGE_SIZE / 4096);
- MEMORY_UNLOCK(Os);
-
gcmkVERIFY_OK(gckOS_CacheFlush(
Os,
_GetProcessID(),
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",
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));
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);
{
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;
MEMORY_UNLOCK(Os);
+ if (pointer)
+ {
+ allocator->ops->UnmapUser(allocator, pointer, mdl->numPages * PAGE_SIZE);
+ }
+
/* Success. */
gcmkFOOTER_NO();
return gcvSTATUS_OK;
gcsPageInfo_PTR info = gcvNULL;
struct page **pages = gcvNULL;
+ gctBOOL *ref = gcvNULL;
/* Verify the arguments. */
gcmkVERIFY_OBJECT(Os, gcvOBJ_OS);
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++)
if (pfn_valid(page_to_pfn(pages[i])))
{
- get_page(pages[i]);
+ ref[i] = get_page_unless_zero(pages[i]);
}
}
}
{
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++)
/* Save pointer to page table. */
info->pageTable = pageTable;
info->pages = pages;
+ info->ref = ref;
*Info = (gctPOINTER) info;
info->pages = gcvNULL;
}
+ if (info!= gcvNULL && ref != gcvNULL)
+ {
+ /* Free the ref table. */
+ kfree(ref);
+ info->ref = gcvNULL;
+ }
+
/* Release page info struct. */
if (info != gcvNULL)
{
gcsPageInfo_PTR info;
gctSIZE_T pageCount, i;
struct page **pages;
+ gctBOOL *ref;
/* Verify the arguments. */
gcmkVERIFY_OBJECT(Os, gcvOBJ_OS);
pages = info->pages;
+ ref = info->ref;
+
gcmkTRACE_ZONE(
gcvLEVEL_INFO, gcvZONE_OS,
"%s(%d): info=0x%X, pages=0x%X.",
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]);
}
kfree(info->pages);
}
+ if (info->ref != gcvNULL)
+ {
+ kfree(info->ref);
+ }
+
kfree(info);
}
{
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;
{
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;
*
* 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"),
*
* 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
{
gctINT pid;
gctPOINTER vmaAddr;
- gctUINT32 count;
+ atomic_t count;
struct vm_area_struct * vma;
struct _LINUX_MDL_MAP * next;
}
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
*
* 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"),
*
* 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
#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
#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);
#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)
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);
struct platform_device *pdev;
gckGALDEVICE galDevice;
gckKERNEL kernel;
+ gceSTATUS status = gcvSTATUS_OK;
pdev = Platform->device;
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)
{
EXTRA_CFLAGS += -DCLASS_NAME=\"gpu_class\"
+EXTRA_CFLAGS += -DgcdGPU_2D_TIMEOUT=20000
+
EXTRA_CFLAGS += -DDISABLE_RECORD_ARRAY_SIZE_OPTIMIZATION