From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from co9outboundpool.messaging.microsoft.com (co9ehsobe004.messaging.microsoft.com [207.46.163.27]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 24EB8E00324 for ; Mon, 16 Dec 2013 04:18:47 -0800 (PST) Received: from mail154-co9-R.bigfish.com (10.236.132.235) by CO9EHSOBE017.bigfish.com (10.236.130.80) with Microsoft SMTP Server id 14.1.225.22; Mon, 16 Dec 2013 12:18:45 +0000 Received: from mail154-co9 (localhost [127.0.0.1]) by mail154-co9-R.bigfish.com (Postfix) with ESMTP id 04C4C3E0EEC; Mon, 16 Dec 2013 12:18:46 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(z579ehz98dIc89bh936eI1432Ic8kzz1f42h2148h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h2189h1d1ah1d2ah1fc6hzz1de098h17326ah8275bh8275dh1de097h186068hz2dh2a8h839h93fhd25he5bhf0ah1288h12a5h12a9h12bdh137ah13b6h1441h1504h1537h153bh162dh1631h1758h1765h18e1h190ch1946h19b4h19c3h1ad9h1b0ah1b2fh2222h224fh1fb3h1d0ch1d2eh1d3fh1dfeh1dffh1f5fh1fe8h1ff5h209eh22d0h2336h1155h) Received: from mail154-co9 (localhost.localdomain [127.0.0.1]) by mail154-co9 (MessageSwitch) id 1387196319890124_1007; Mon, 16 Dec 2013 12:18:39 +0000 (UTC) Received: from CO9EHSMHS027.bigfish.com (unknown [10.236.132.236]) by mail154-co9.bigfish.com (Postfix) with ESMTP id D0EE2360041; Mon, 16 Dec 2013 12:18:39 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO9EHSMHS027.bigfish.com (10.236.130.37) with Microsoft SMTP Server (TLS) id 14.16.227.3; Mon, 16 Dec 2013 12:18:39 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.3.158.2; Mon, 16 Dec 2013 12:18:38 +0000 Received: from [10.29.244.56] ([10.29.244.56]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id rBGCIYER007005; Mon, 16 Dec 2013 05:18:35 -0700 Message-ID: <52AEEE71.2070703@freescale.com> Date: Mon, 16 Dec 2013 10:13:37 -0200 From: Daiane Angolini Organization: Freescale Semiconductor User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Luca Simone Ronga , References: <1387186267-14384-1-git-send-email-luca.simone.ronga@gmail.com> In-Reply-To: <1387186267-14384-1-git-send-email-luca.simone.ronga@gmail.com> X-OriginatorOrg: freescale.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% Cc: Luca Simone Ronga Subject: Re: [meta-fsl-arm-extra][PATCH] UDOO board support, recipe for UDOO KernelUnico 2013 maintaned by UDOO manufacturer X-BeenThere: meta-freescale@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Usage and development list for the meta-fsl-* layers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Dec 2013 12:18:48 -0000 Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable On 16-12-2013 07:31, Luca Simone Ronga wrote: > From: Luca Simone Ronga > > Dear Freescale community, > here is the kernel recipe for the UDOO Board kernel branch maintained b= y SECO > (KernelUnico 2013). > I wish to thank John Weber and Otavio Salvador for their useful comment= s. > L. > > Could you, please, format your commit log and commit subject? You can use other commits to get the format. Please, let me know if you need help I have not participated on discussion about these new recipes, but it=20 looks like so much patch added in SRC_URI. Was new git repository suggest= ed? Please, see more comments inline, in linux bb file > > Signed-off-by: Luca Simone Ronga > --- > ...8-4.6.9p11.1-gpu-GPU-Kernel-driver-integr.patch | 1040 ++++++++++ > ...Fix-getrusage-related-build-failure-on-gl.patch | 43 + > ...fix-memset-related-crashes-caused-by-rece.patch | 259 +++ > ...5-gpu-Add-global-value-for-minimum-3D-clo.patch | 62 + > .../0003-ARM-7670-1-fix-the-memset-fix.patch | 87 + > ...4-4-gpu-use-new-PU-power-on-off-interface.patch | 53 + > ...8-1-GPU-Integrate-4.6.9p12-release-kernel.patch | 2006 +++++++++++= +++++++++ > ...6-Fix-build-break-when-CONFIG_CLK_DEBUG-i.patch | 43 + > ...5-GPU-Correct-suspend-resume-calling-afte.patch | 61 + > ...0005-ENGR00271359-Add-Multi-touch-support.patch | 98 + > .../0006-Add-support-for-DVI-monitors.patch | 227 +++ > ...0-gpu-Correct-section-mismatch-in-gpu-ker.patch | 60 + > ...6-board-mx6q_sabresd-Register-SDHC3-first.patch | 38 + > recipes-kernel/linux/linux-udoo-3.0.35/defconfig | 246 +++ > ...m-vivante-Add-00-sufix-in-returned-bus-Id.patch | 31 + > ...-Rename-mxcfb_epdc_kernel.h-to-mxc_epdc.h.patch | 143 ++ > recipes-kernel/linux/linux-udoo.inc | 17 + > recipes-kernel/linux/linux-udoo_3.0.35.bb | 26 + > 18 files changed, 4540 insertions(+) > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/0001-ENGR00= 255688-4.6.9p11.1-gpu-GPU-Kernel-driver-integr.patch > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/0001-perf-t= ools-Fix-getrusage-related-build-failure-on-gl.patch > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/0002-ARM-76= 68-1-fix-memset-related-crashes-caused-by-rece.patch > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/0002-ENGR00= 265465-gpu-Add-global-value-for-minimum-3D-clo.patch > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/0003-ARM-76= 70-1-fix-the-memset-fix.patch > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/0003-ENGR00= 261814-4-gpu-use-new-PU-power-on-off-interface.patch > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/0004-ENGR00= 264288-1-GPU-Integrate-4.6.9p12-release-kernel.patch > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/0004-ENGR00= 271136-Fix-build-break-when-CONFIG_CLK_DEBUG-i.patch > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/0005-ENGR00= 264275-GPU-Correct-suspend-resume-calling-afte.patch > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/0005-ENGR00= 271359-Add-Multi-touch-support.patch > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/0006-Add-su= pport-for-DVI-monitors.patch > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/0006-ENGR00= 265130-gpu-Correct-section-mismatch-in-gpu-ker.patch > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/0007-ARM-ma= ch-mx6-board-mx6q_sabresd-Register-SDHC3-first.patch > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/defconfig > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/drm-vivante= -Add-00-sufix-in-returned-bus-Id.patch > create mode 100644 recipes-kernel/linux/linux-udoo-3.0.35/epdc-Rename= -mxcfb_epdc_kernel.h-to-mxc_epdc.h.patch > create mode 100644 recipes-kernel/linux/linux-udoo.inc > create mode 100644 recipes-kernel/linux/linux-udoo_3.0.35.bb > > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/0001-ENGR00255688-4= .6.9p11.1-gpu-GPU-Kernel-driver-integr.patch b/recipes-kernel/linux/linux= -udoo-3.0.35/0001-ENGR00255688-4.6.9p11.1-gpu-GPU-Kernel-driver-integr.pa= tch > new file mode 100644 > index 0000000..9c7cd44 > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/0001-ENGR00255688-4.6.9p11= .1-gpu-GPU-Kernel-driver-integr.patch > @@ -0,0 +1,1040 @@ > +From 46e3a6de5adb9379f9d6eef2c038c2f18637d407 Mon Sep 17 00:00:00 2001 > +From: Loren Huang > +Date: Mon, 25 Mar 2013 15:43:57 +0800 > +Subject: [PATCH 1/6] ENGR00255688 4.6.9p11.1 [gpu]GPU Kernel driver > + integration > + > +4.6.9p11.1 GPU kernel driver integration > +Cherry pick from imx_3.0.35 > + > +Upstream-Status: Backport [3.5.7-1.0.0] > + > +Signed-off-by: Loren Huang > +Acked-by: Lily Zhang > +--- > + drivers/mxc/gpu-viv/Kbuild | 2 +- > + .../arch/XAQ2/hal/kernel/gc_hal_kernel_context.c | 2 +- > + .../arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c | 7 +- > + drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h | 2 +- > + drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c | 53 ++++-- > + .../mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c | 5 +- > + drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c | 178 ++++++++++++= --------- > + .../hal/kernel/gc_hal_kernel_video_memory.c | 3 +- > + .../gpu-viv/hal/kernel/inc/gc_hal_eglplatform.h | 13 +- > + drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h | 25 +++ > + .../mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h | 35 ++++ > + .../mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h | 2 +- > + .../hal/os/linux/kernel/gc_hal_kernel_driver.c | 2 +- > + .../hal/os/linux/kernel/gc_hal_kernel_linux.h | 6 + > + .../gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c | 82 +++++++++- > + 15 files changed, 304 insertions(+), 113 deletions(-) > + > +diff --git a/drivers/mxc/gpu-viv/Kbuild b/drivers/mxc/gpu-viv/Kbuild > +index 0b18a7b..93b1259 100644 > +--- a/drivers/mxc/gpu-viv/Kbuild > ++++ b/drivers/mxc/gpu-viv/Kbuild > +@@ -1,6 +1,6 @@ > + #####################################################################= ######### > + # > +-# Copyright (C) 2005 - 2012 by Vivante Corp. > ++# Copyright (C) 2005 - 2013 by Vivante Corp. > + # > + # This program is free software; you can redistribute it and/or mo= dify > + # it under the terms of the GNU General Public License as publishe= d by > +diff --git a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_co= ntext.c b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_context.= c > +index 22e1f27..24003e7 100644 > +--- a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_context.c > ++++ b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_context.c > +@@ -471,7 +471,7 @@ _InitializeContextBuffer( > + index +=3D _SwitchPipe(Context, index, gcvPIPE_3D); > + > + /* Current context pointer. */ > +-#if gcdDEBUG > ++#if gcdDEBUG > + index +=3D _State(Context, index, 0x03850 >> 2, 0x00000000, 1, gc= vFALSE, gcvFALSE); > + #endif > + > +diff --git a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_ha= rdware.c b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardwar= e.c > +index a87259e..3829999 100644 > +--- a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.= c > ++++ b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.= c > +@@ -232,7 +232,8 @@ _IdentifyHardware( > + } > + > + /* Exception for GC1000, revision 5035 & GC800, revision 4612 */ > +- if (((Identity->chipModel =3D=3D gcv1000) && (Identity->chipRevis= ion =3D=3D 0x5035)) > ++ if (((Identity->chipModel =3D=3D gcv1000) && ((Identity->chipRevi= sion =3D=3D 0x5035) > ++ || (Identity->chipRevision= =3D=3D 0x5036))) > + || ((Identity->chipModel =3D=3D gcv800) && (Identity->chipRevision = =3D=3D 0x4612))) > + { > + Identity->superTileMode =3D 1; > +@@ -751,7 +752,7 @@ gckHARDWARE_Construct( > + /* Initialize the fast clear. */ > + gcmkONERROR(gckHARDWARE_SetFastClear(hardware, -1, -1)); > + > +-#if !gcdENABLE_128B_MERGE > ++#if !gcdENABLE_128B_MERGE > + > + if (((((gctUINT32) (hardware->identity.chipMinorFeatures2)) >> (0= ? 21:21) & ((gctUINT32) ((((1 ? 21:21) - (0 ? 21:21) + 1) =3D=3D 32) ? ~= 0 : (~(~0 << ((1 ? 21:21) - (0 ? 21:21) + 1)))))) =3D=3D (0x1 & ((gctUIN= T32) ((((1 ? 21:21) - (0 ? 21:21) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 2= 1:21) - (0 ? 21:21) + 1)))))))) > + { > +@@ -1027,7 +1028,7 @@ gckHARDWARE_InitializeHardware( > + 0x00424, > + baseAddress)); > + > +-#if !VIVANTE_PROFILER > ++#if !VIVANTE_PROFILER > + { > + gctUINT32 data; > + > +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 1da80b7..5896e93 100644 > +--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h > ++++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.h > +@@ -186,7 +186,7 @@ typedef struct _gcsDATABASE > + gctUINT64 idle; > + > + /* Pointer to database. */ > +- gcsDATABASE_RECORD_PTR list; > ++ gcsDATABASE_RECORD_PTR list[48]; > + > + #if gcdSECURE_USER > + /* Secure cache. */ > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c b/drive= rs/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c > +index 1fb18fb..bc5f083 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 > +@@ -26,6 +26,9 @@ > + /********************************************************************= *********** > + ***** Private fuctions **********************************************= **********/ > + > ++#define _GetSlot(database, x) \ > ++ (gctUINT32)(((gcmPTR_TO_UINT64(x) >> 7) % gcmCOUNTOF(database->li= st))) > ++ > + /********************************************************************= *********** > + ** gckKERNEL_NewDatabase > + ** > +@@ -56,6 +59,7 @@ gckKERNEL_NewDatabase( > + gcsDATABASE_PTR database; > + gctBOOL acquired =3D gcvFALSE; > + gctSIZE_T slot; > ++ gcsDATABASE_PTR existingDatabase; > + > + gcmkHEADER_ARG("Kernel=3D0x%x ProcessID=3D%d", Kernel, ProcessID)= ; > + > +@@ -63,6 +67,21 @@ gckKERNEL_NewDatabase( > + gcmkONERROR(gckOS_AcquireMutex(Kernel->os, Kernel->db->dbMutex, g= cvINFINITE)); > + acquired =3D gcvTRUE; > + > ++ /* Compute the hash for the database. */ > ++ slot =3D ProcessID % gcmCOUNTOF(Kernel->db->db); > ++ > ++ /* Walk the hash list. */ > ++ for (existingDatabase =3D Kernel->db->db[slot]; > ++ existingDatabase !=3D gcvNULL; > ++ existingDatabase =3D existingDatabase->next) > ++ { > ++ if (existingDatabase->processID =3D=3D ProcessID) > ++ { > ++ /* One process can't be added twice. */ > ++ gcmkONERROR(gcvSTATUS_NOT_SUPPORTED); > ++ } > ++ } > ++ > + if (Kernel->db->freeDatabase !=3D gcvNULL) > + { > + /* Allocate a database from the free list. */ > +@@ -81,9 +100,6 @@ gckKERNEL_NewDatabase( > + database =3D pointer; > + } > + > +- /* Compute the hash for the database. */ > +- slot =3D ProcessID % gcmCOUNTOF(Kernel->db->db); > +- > + /* Insert the database into the hash. */ > + database->next =3D Kernel->db->db[slot]; > + Kernel->db->db[slot] =3D database; > +@@ -350,6 +366,7 @@ static gceSTATUS > + gckKERNEL_NewRecord( > + IN gckKERNEL Kernel, > + IN gcsDATABASE_PTR Database, > ++ IN gctUINT32 Slot, > + OUT gcsDATABASE_RECORD_PTR * Record > + ) > + { > +@@ -383,8 +400,8 @@ gckKERNEL_NewRecord( > + } > + > + /* Insert the record in the database. */ > +- record->next =3D Database->list; > +- Database->list =3D record; > ++ record->next =3D Database->list[Slot]; > ++ Database->list[Slot] =3D record; > + > + /* Release the database mutex. */ > + gcmkONERROR(gckOS_ReleaseMutex(Kernel->os, Kernel->db->dbMutex)); > +@@ -449,6 +466,7 @@ gckKERNEL_DeleteRecord( > + gceSTATUS status; > + gctBOOL acquired =3D gcvFALSE; > + gcsDATABASE_RECORD_PTR record, previous; > ++ gctUINT32 slot =3D _GetSlot(Database, Data); > + > + gcmkHEADER_ARG("Kernel=3D0x%x Database=3D0x%x Type=3D%d Data=3D0x= %x", > + Kernel, Database, Type, Data); > +@@ -458,8 +476,9 @@ gckKERNEL_DeleteRecord( > + gckOS_AcquireMutex(Kernel->os, Kernel->db->dbMutex, gcvINFINI= TE)); > + acquired =3D gcvTRUE; > + > ++ > + /* Scan the database for this record. */ > +- for (record =3D Database->list, previous =3D gcvNULL; > ++ for (record =3D Database->list[slot], previous =3D gcvNULL; > + record !=3D gcvNULL; > + record =3D record->next > + ) > +@@ -490,7 +509,7 @@ gckKERNEL_DeleteRecord( > + /* Remove record from database. */ > + if (previous =3D=3D gcvNULL) > + { > +- Database->list =3D record->next; > ++ Database->list[slot] =3D record->next; > + } > + else > + { > +@@ -557,6 +576,7 @@ gckKERNEL_FindRecord( > + gceSTATUS status; > + gctBOOL acquired =3D gcvFALSE; > + gcsDATABASE_RECORD_PTR record; > ++ gctUINT32 slot =3D _GetSlot(Database, Data); > + > + gcmkHEADER_ARG("Kernel=3D0x%x Database=3D0x%x Type=3D%d Data=3D0x= %x", > + Kernel, Database, Type, Data); > +@@ -567,7 +587,7 @@ gckKERNEL_FindRecord( > + acquired =3D gcvTRUE; > + > + /* Scan the database for this record. */ > +- for (record =3D Database->list; > ++ for (record =3D Database->list[slot]; > + record !=3D gcvNULL; > + record =3D record->next > + ) > +@@ -642,6 +662,7 @@ gckKERNEL_CreateProcessDB( > + { > + gceSTATUS status; > + gcsDATABASE_PTR database =3D gcvNULL; > ++ gctUINT32 i; > + > + gcmkHEADER_ARG("Kernel=3D0x%x ProcessID=3D%d", Kernel, ProcessID)= ; > + > +@@ -668,7 +689,11 @@ gckKERNEL_CreateProcessDB( > + database->mapUserMemory.bytes =3D 0; > + database->mapUserMemory.maxBytes =3D 0; > + database->mapUserMemory.totalBytes =3D 0; > +- database->list =3D gcvNULL; > ++ > ++ for (i =3D 0; i < gcmCOUNTOF(database->list); i++) > ++ { > ++ database->list[i] =3D gcvNULL; > ++ } > + > + #if gcdSECURE_USER > + { > +@@ -848,7 +873,7 @@ gckKERNEL_AddProcessDB( > + gcmkONERROR(gckKERNEL_FindDatabase(Kernel, ProcessID, gcvFALSE, &= database)); > + > + /* Create a new record in the database. */ > +- gcmkONERROR(gckKERNEL_NewRecord(Kernel, database, &record)); > ++ gcmkONERROR(gckKERNEL_NewRecord(Kernel, database, _GetSlot(databa= se, Pointer), &record)); > + > + /* Initialize the record. */ > + record->kernel =3D Kernel; > +@@ -1086,6 +1111,7 @@ gckKERNEL_DestroyProcessDB( > + gctPHYS_ADDR physical; > + gcuVIDMEM_NODE_PTR node; > + gckKERNEL kernel =3D Kernel; > ++ gctUINT32 i; > + > + gcmkHEADER_ARG("Kernel=3D0x%x ProcessID=3D%d", Kernel, ProcessID)= ; > + > +@@ -1126,8 +1152,11 @@ gckKERNEL_DestroyProcessDB( > + ProcessID); > + } > + > ++ for(i =3D 0; i < gcmCOUNTOF(database->list); i++) > ++ { > ++ > + /* Walk all records. */ > +- for (record =3D database->list; record !=3D gcvNULL; record =3D n= ext) > ++ for (record =3D database->list[i]; record !=3D gcvNULL; record =3D= next) > + { > + /* Next next record. */ > + next =3D record->next; > +@@ -1293,6 +1322,8 @@ gckKERNEL_DestroyProcessDB( > + gcvNULL)); > + } > + > ++ } > ++ > + /* Delete the database. */ > + gcmkONERROR(gckKERNEL_DeleteDatabase(Kernel, database)); > + > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c b/dr= ivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_event.c > +index f78d096..217f7f1 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 > +@@ -959,6 +959,8 @@ gckEVENT_AddList( > + record->kernel =3D Event->kernel; > + #endif > + > ++ gcmkONERROR(__RemoveRecordFromProcessDB(Event, record)); > ++ > + /* Acquire the mutex. */ > + gcmkONERROR(gckOS_AcquireMutex(Event->os, Event->eventListMutex, = gcvINFINITE)); > + acquired =3D gcvTRUE; > +@@ -1539,9 +1541,6 @@ gckEVENT_Submit( > + gcmkONERROR(gckOS_ReleaseMutex(Event->os, Event->eventLis= tMutex)); > + acquired =3D gcvFALSE; > + > +- gcmkONERROR(__RemoveRecordFromProcessDB(Event, > +- Event->queues[id].head)); > +- > + #if gcdNULL_DRIVER > + /* Notify immediately on infinite hardware. */ > + gcmkONERROR(gckEVENT_Interrupt(Event, 1 << id)); > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c b/driv= ers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c > +index 0c71e28..43c9297 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 > +@@ -97,6 +97,43 @@ static gcsMirrorPageTable_PTR mirrorPageTable =3D g= cvNULL; > + static gctPOINTER mirrorPageTableMutex =3D gcvNULL; > + #endif > + > ++static void > ++_WritePageEntry( > ++ IN gctUINT32_PTR PageEntry, > ++ IN gctUINT32 EntryValue > ++ ) > ++{ > ++ static gctUINT16 data =3D 0xff00; > ++ > ++ if (*(gctUINT8 *)&data =3D=3D 0xff) > ++ { > ++ *PageEntry =3D gcmSWAB32(EntryValue); > ++ } > ++ else > ++ { > ++ *PageEntry =3D EntryValue; > ++ } > ++} > ++ > ++static gctUINT32 > ++_ReadPageEntry( > ++ IN gctUINT32_PTR PageEntry > ++ ) > ++{ > ++ static gctUINT16 data =3D 0xff00; > ++ gctUINT32 entryValue; > ++ > ++ if (*(gctUINT8 *)&data =3D=3D 0xff) > ++ { > ++ entryValue =3D *PageEntry; > ++ return gcmSWAB32(entryValue); > ++ } > ++ else > ++ { > ++ return *PageEntry; > ++ } > ++} > ++ > + static gceSTATUS > + _FillPageTable( > + IN gctUINT32_PTR PageTable, > +@@ -108,7 +145,7 @@ _FillPageTable( > + > + for (i =3D 0; i < PageCount; i++) > + { > +- PageTable[i] =3D EntryValue; > ++ _WritePageEntry(PageTable + i, EntryValue); > + } > + > + return gcvSTATUS_OK; > +@@ -132,16 +169,16 @@ _Link( > + gctUINT32_PTR pageTable =3D Mmu->pageTableLogical; > + > + /* Dispatch on node type. */ > +- switch (gcmENTRY_TYPE(pageTable[Index])) > ++ switch (gcmENTRY_TYPE(_ReadPageEntry(&pageTable[Index]))) > + { > + case gcvMMU_SINGLE: > + /* Set single index. */ > +- pageTable[Index] =3D (Next << 8) | gcvMMU_SINGLE; > ++ _WritePageEntry(&pageTable[Index], (Next << 8) | gcvMMU_S= INGLE); > + break; > + > + case gcvMMU_FREE: > + /* Set index. */ > +- pageTable[Index + 1] =3D Next; > ++ _WritePageEntry(&pageTable[Index + 1], Next); > + break; > + > + default: > +@@ -167,13 +204,13 @@ _AddFree( > + if (Count =3D=3D 1) > + { > + /* Initialize a single page node. */ > +- pageTable[Node] =3D (~((1U<<8)-1)) | gcvMMU_SINGLE; > ++ _WritePageEntry(pageTable + Node, (~((1U<<8)-1)) | gcvMMU_SIN= GLE); > + } > + else > + { > + /* Initialize the node. */ > +- pageTable[Node + 0] =3D (Count << 8) | gcvMMU_FREE; > +- pageTable[Node + 1] =3D ~0U; > ++ _WritePageEntry(pageTable + Node + 0, (Count << 8) | gcvMMU_F= REE); > ++ _WritePageEntry(pageTable + Node + 1, ~0U); > + } > + > + /* Append the node. */ > +@@ -196,7 +233,7 @@ _Collect( > + for (i =3D 0; i < Mmu->pageTableEntries; ++i) > + { > + /* Dispatch based on type of page. */ > +- switch (gcmENTRY_TYPE(pageTable[i])) > ++ switch (gcmENTRY_TYPE(_ReadPageEntry(&pageTable[i]))) > + { > + case gcvMMU_USED: > + /* Used page, so close any open node. */ > +@@ -229,10 +266,10 @@ _Collect( > + } > + > + /* Advance the count. */ > +- count +=3D pageTable[i] >> 8; > ++ count +=3D _ReadPageEntry(&pageTable[i]) >> 8; > + > + /* Advance the index into the page table. */ > +- i +=3D (pageTable[i] >> 8) - 1; > ++ i +=3D (_ReadPageEntry(&pageTable[i]) >> 8) - 1; > + break; > + > + default: > +@@ -341,19 +378,20 @@ _FillFlatMapping( > + gcmkONERROR(gcvSTATUS_NOT_ALIGNED); > + } > + > +- *(Mmu->mtlbLogical + mStart) > +- =3D stlb->physBase > +- /* 64KB page size */ > +- | (1 << 2) > +- /* Ignore exception */ > +- | (0 << 1) > +- /* Present */ > +- | (1 << 0); > ++ _WritePageEntry(Mmu->mtlbLogical + mStart, > ++ stlb->physBase > ++ /* 64KB page size */ > ++ | (1 << 2) > ++ /* Ignore exception */ > ++ | (0 << 1) > ++ /* Present */ > ++ | (1 << 0) > ++ ); > + #if gcdMMU_TABLE_DUMP > + gckOS_Print("%s(%d): insert MTLB[%d]: %08x\n", > + __FUNCTION__, __LINE__, > + mStart, > +- *(Mmu->mtlbLogical + mStart)); > ++ _ReadPageEntry(Mmu->mtlbLogical + mStart)); > + #endif > + > + stlb->mtlbIndex =3D mStart; > +@@ -368,12 +406,12 @@ _FillFlatMapping( > + while (sStart <=3D last) > + { > + gcmkASSERT(!(start & gcdMMU_PAGE_64K_MASK)); > +- *(stlb->logical + sStart) =3D _SetPage(start); > ++ _WritePageEntry(stlb->logical + sStart, _SetPage(star= t)); > + #if gcdMMU_TABLE_DUMP > + gckOS_Print("%s(%d): insert STLB[%d]: %08x\n", > + __FUNCTION__, __LINE__, > + sStart, > +- *(stlb->logical + sStart)); > ++ _ReadPageEntry(stlb->logical + sStart)); > + #endif > + /* next page. */ > + start +=3D gcdMMU_PAGE_64K_SIZE; > +@@ -428,7 +466,7 @@ OnError: > + if (pre->mtlbEntryNum !=3D 0) > + { > + gcmkASSERT(pre->mtlbEntryNum =3D=3D 1); > +- *(Mmu->mtlbLogical + pre->mtlbIndex) =3D 0; > ++ _WritePageEntry(Mmu->mtlbLogical + pre->mtlbIndex, 0); > + } > + > + gcmkVERIFY_OK(gcmkOS_SAFE_FREE(Mmu->os, pre)); > +@@ -493,8 +531,8 @@ _SetupDynamicSpace( > + > + /* Initilization. */ > + pageTable =3D Mmu->pageTableLogical; > +- pageTable[0] =3D (Mmu->pageTableEntries << 8) | gcvMMU_FREE; > +- pageTable[1] =3D ~0U; > ++ _WritePageEntry(pageTable, (Mmu->pageTableEntries << 8) | gcv= MMU_FREE); > ++ _WritePageEntry(pageTable + 1, ~0U); > + Mmu->heapList =3D 0; > + Mmu->freeNodes =3D gcvFALSE; > + > +@@ -509,18 +547,20 @@ _SetupDynamicSpace( > + /* Map to Master TLB. */ > + for (; i < gcdMMU_MTLB_ENTRY_NUM; i++) > + { > +- Mmu->mtlbLogical[i] =3D physical > +- /* 4KB page size */ > +- | (0 << 2) > +- /* Ignore exception */ > +- | (0 << 1) > +- /* Present */ > +- | (1 << 0); > ++ _WritePageEntry(Mmu->mtlbLogical + i, > ++ physical > ++ /* 4KB page size */ > ++ | (0 << 2) > ++ /* Ignore exception */ > ++ | (0 << 1) > ++ /* Present */ > ++ | (1 << 0) > ++ ); > + #if gcdMMU_TABLE_DUMP > + gckOS_Print("%s(%d): insert MTLB[%d]: %08x\n", > + __FUNCTION__, __LINE__, > + i, > +- *(Mmu->mtlbLogical + i)); > ++ _ReadPageEntry(Mmu->mtlbLogical + i)); > + #endif > + physical +=3D gcdMMU_STLB_4K_SIZE; > + } > +@@ -645,18 +685,11 @@ _Construct( > + pageTable =3D mmu->pageTableLogical; > + > + #if gcdMMU_CLEAR_VALUE > +- { > +- gctUINT32 i; > +- > +- for (i =3D 0; i < mmu->pageTableEntries; ++i) > +- { > +- pageTable[i] =3D gcdMMU_CLEAR_VALUE; > +- } > +- } > ++ _FillPageTable(pageTable, mmu->pageTableEntries, gcdMMU_CLEAR= _VALUE); > + #endif > + > +- pageTable[0] =3D (mmu->pageTableEntries << 8) | gcvMMU_FREE= ; > +- pageTable[1] =3D ~0U; > ++ _WritePageEntry(pageTable, (mmu->pageTableEntries << 8) |= gcvMMU_FREE); > ++ _WritePageEntry(pageTable + 1, ~0U); > + mmu->heapList =3D 0; > + mmu->freeNodes =3D gcvFALSE; > + > +@@ -797,7 +830,7 @@ _Destroy( > + if (pre->mtlbEntryNum !=3D 0) > + { > + gcmkASSERT(pre->mtlbEntryNum =3D=3D 1); > +- *(Mmu->mtlbLogical + pre->mtlbIndex) =3D 0; > ++ _WritePageEntry(Mmu->mtlbLogical + pre->mtlbIndex, 0); > + #if gcdMMU_TABLE_DUMP > + gckOS_Print("%s(%d): clean MTLB[%d]\n", > + __FUNCTION__, __LINE__, > +@@ -1044,7 +1077,7 @@ _AllocatePages( > + for (index =3D Mmu->heapList; !gotIt && (index < Mmu->pageTab= leEntries);) > + { > + /* Check the node type. */ > +- switch (gcmENTRY_TYPE(pageTable[index])) > ++ switch (gcmENTRY_TYPE(_ReadPageEntry(&pageTable[index]))) > + { > + case gcvMMU_SINGLE: > + /* Single odes are valid if we only need 1 page. */ > +@@ -1056,13 +1089,13 @@ _AllocatePages( > + { > + /* Move to next node. */ > + previous =3D index; > +- index =3D pageTable[index] >> 8; > ++ index =3D _ReadPageEntry(&pageTable[index]) >>= 8; > + } > + break; > + > + case gcvMMU_FREE: > + /* Test if the node has enough space. */ > +- if (PageCount <=3D (pageTable[index] >> 8)) > ++ if (PageCount <=3D (_ReadPageEntry(&pageTable[index])= >> 8)) > + { > + gotIt =3D gcvTRUE; > + } > +@@ -1070,7 +1103,7 @@ _AllocatePages( > + { > + /* Move to next node. */ > + previous =3D index; > +- index =3D pageTable[index + 1]; > ++ index =3D _ReadPageEntry(&pageTable[index + 1]= ); > + } > + break; > + > +@@ -1099,36 +1132,36 @@ _AllocatePages( > + } > + } > + > +- switch (gcmENTRY_TYPE(pageTable[index])) > ++ switch (gcmENTRY_TYPE(_ReadPageEntry(&pageTable[index]))) > + { > + case gcvMMU_SINGLE: > + /* Unlink single node from free list. */ > + gcmkONERROR( > +- _Link(Mmu, previous, pageTable[index] >> 8)); > ++ _Link(Mmu, previous, _ReadPageEntry(&pageTable[index]) >>= 8)); > + break; > + > + case gcvMMU_FREE: > + /* Check how many pages will be left. */ > +- left =3D (pageTable[index] >> 8) - PageCount; > ++ left =3D (_ReadPageEntry(&pageTable[index]) >> 8) - PageCount= ; > + switch (left) > + { > + case 0: > + /* The entire node is consumed, just unlink it. */ > + gcmkONERROR( > +- _Link(Mmu, previous, pageTable[index + 1])); > ++ _Link(Mmu, previous, _ReadPageEntry(&pageTable[index = + 1]))); > + break; > + > + case 1: > + /* One page will remain. Convert the node to a single no= de and > + ** advance the index. */ > +- pageTable[index] =3D (pageTable[index + 1] << 8) | gcvMMU= _SINGLE; > ++ _WritePageEntry(&pageTable[index], (_ReadPageEntry(&pageT= able[index + 1]) << 8) | gcvMMU_SINGLE); > + index ++; > + break; > + > + default: > + /* Enough pages remain for a new node. However, we will = just adjust > + ** the size of the current node and advance the index. */ > +- pageTable[index] =3D (left << 8) | gcvMMU_FREE; > ++ _WritePageEntry(&pageTable[index], (left << 8) | gcvMMU_F= REE); > + index +=3D left; > + break; > + } > +@@ -1232,35 +1265,32 @@ _FreePages( > + #if gcdMMU_CLEAR_VALUE > + if (Mmu->hardware->mmuVersion =3D=3D 0) > + { > +- gctUINT32 i; > +- > +- for (i =3D 0; i < PageCount; ++i) > +- { > +- pageTable[i] =3D gcdMMU_CLEAR_VALUE; > +- } > ++ _FillPageTable(pageTable, PageCount, gcdMMU_CLEAR_VALUE); > + } > + #endif > + > + if (PageCount =3D=3D 1) > + { > + /* Single page node. */ > +- pageTable[0] =3D (~((1U<<8)-1)) | gcvMMU_SINGLE > ++ _WritePageEntry(pageTable, > ++ (~((1U<<8)-1)) | gcvMMU_SINGLE > + #if gcdUSE_MMU_EXCEPTION > +- /* Enable exception */ > +- | (1 << 1) > ++ /* Enable exception */ > ++ | 1 << 1 > + #endif > +- ; > ++ ); > + } > + else > + { > + /* Mark the node as free. */ > +- pageTable[0] =3D (PageCount << 8) | gcvMMU_FREE > ++ _WritePageEntry(pageTable, > ++ (PageCount << 8) | gcvMMU_FREE > + #if gcdUSE_MMU_EXCEPTION > +- /* Enable exception */ > +- | (1 << 1) > ++ /* Enable exception */ > ++ | 1 << 1 > + #endif > +- ; > +- pageTable[1] =3D ~0U; > ++ ); > ++ _WritePageEntry(pageTable + 1, ~0U); > + > + #if gcdUSE_MMU_EXCEPTION > + /* Enable exception */ > +@@ -1509,12 +1539,8 @@ gckMMU_SetPage( > + data =3D _SetPage(PageAddress); > + } > + > +- if (Mmu->hardware->bigEndian) > +- { > +- data =3D gcmSWAB32(data); > +- } > ++ _WritePageEntry(PageEntry, data); > + > +- *PageEntry =3D data; > + #if gcdMIRROR_PAGETABLE > + for (i =3D 0; i < mirrorPageTable->reference; i++) > + { > +@@ -1526,11 +1552,11 @@ gckMMU_SetPage( > + > + if (mmu->hardware->mmuVersion =3D=3D 0) > + { > +- *pageEntry =3D PageAddress; > ++ _WritePageEntry(pageEntry, PageAddress); > + } > + else > + { > +- *pageEntry =3D _SetPage(PageAddress); > ++ _WritePageEntry(pageEntry, _SetPage(PageAddress)); > + } > + } > + > +@@ -1734,7 +1760,7 @@ gckMMU_DumpPageTableEntry( > + * gcdMMU_STLB_4K_ENTRY_NUM > + + stlb; > + > +- gcmkPRINT(" Page table entry =3D 0x%08X", pageTable[index]= ); > ++ gcmkPRINT(" Page table entry =3D 0x%08X", _ReadPageEntry(p= ageTable + index)); > + } > + > + gcmkFOOTER_NO(); > +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 d49aa64..8a442a2 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 > +@@ -1027,7 +1027,8 @@ gckVIDMEM_AllocateLinear( > + ) > + { > + /* The left memory is for small memory.*/ > +- gcmkONERROR(gcvSTATUS_OUT_OF_MEMORY); > ++ status =3D gcvSTATUS_OUT_OF_MEMORY; > ++ goto OnError; > + } > + #endif > + > +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 496276e..06eea79 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 > +@@ -227,7 +227,8 @@ gcoOS_GetDisplayInfoEx( > + ); > + > + gceSTATUS > +-gcoOS_GetNextDisplayInfoEx( > ++gcoOS_GetNextDisplayInfoExByIndex( > ++ IN gctINT Index, > + IN HALNativeDisplayType Display, > + IN HALNativeWindowType Window, > + IN gctUINT DisplayInfoSize, > +@@ -274,15 +275,15 @@ gcoOS_SetDisplayVirtualEx( > + > + gceSTATUS > + gcoOS_SetSwapInterval( > +- IN HALNativeDisplayType Display, > +- IN gctINT Interval > ++ IN HALNativeDisplayType Display, > ++ IN gctINT Interval > + ); > + > + gceSTATUS > + gcoOS_GetSwapInterval( > +- IN HALNativeDisplayType Display, > +- IN gctINT_PTR Min, > +- IN gctINT_PTR Max > ++ IN HALNativeDisplayType Display, > ++ IN gctINT_PTR Min, > ++ IN gctINT_PTR Max > + ); > + > + gceSTATUS > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h b/driv= ers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h > +index d441d1d..249b61b 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 > +@@ -1430,6 +1430,16 @@ typedef enum _gceTEXTURE_FACE > + } > + gceTEXTURE_FACE; > + > ++#if gcdFORCE_MIPMAP > ++typedef enum > ++{ > ++ gcvForceMipDisabled =3D 0, > ++ gcvForceMipEnable =3D 1, > ++ gcvForceMipGenerated =3D 2, > ++ gcvForceMipNever =3D 3, > ++}gceFORCE_MIPMAP; > ++#endif > ++ > + typedef struct _gcsTEXTURE > + { > + /* Addressing modes. */ > +@@ -1446,6 +1456,10 @@ typedef struct _gcsTEXTURE > + gceTEXTURE_FILTER mipFilter; > + gctUINT anisoFilter; > + gctBOOL forceTopLevel; > ++ gctBOOL autoMipmap; > ++#if gcdFORCE_MIPMAP > ++ gceFORCE_MIPMAP forceMipmap; > ++#endif > + /* Level of detail. */ > + gctFIXED_POINT lodBias; > + gctFIXED_POINT lodMin; > +@@ -1479,7 +1493,18 @@ gceSTATUS > + gcoTEXTURE_Destroy( > + IN gcoTEXTURE Texture > + ); > ++#if gcdFORCE_MIPMAP > ++gceSTATUS > ++gcoTEXTURE_DestroyForceMipmap( > ++ IN gcoTEXTURE Texture > ++ ); > + > ++gceSTATUS > ++gcoTEXTURE_GetMipLevels( > ++ IN gcoTEXTURE Texture, > ++ OUT gctINT * levels > ++ ); > ++#endif > + /* Replace a mipmap in gcoTEXTURE object. */ > + gceSTATUS > + gcoTEXTURE_ReplaceMipMap( > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h b/dri= vers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h > +index 86e9133..afe83d0 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 > +@@ -114,6 +114,30 @@ > + #define COMMAND_PROCESSOR_VERSION 1 > + > + /* > ++ gcdDUMP_KEY > ++ > ++ Set this to a string that appears in 'cat /proc//cmdline= '. E.g. 'camera'. > ++ HAL will create dumps for the processes matching this key. > ++*/ > ++#ifndef gcdDUMP_KEY > ++# define gcdDUMP_KEY "process" > ++#endif > ++ > ++/* > ++ gcdDUMP_PATH > ++ > ++ The dump file location. Some processes cannot write to the sd= card. > ++ Try apps' data dir, e.g. /data/data/com.android.launcher > ++*/ > ++#ifndef gcdDUMP_PATH > ++#if defined(ANDROID) > ++# define gcdDUMP_PATH "/mnt/sdcard/" > ++#else > ++# define gcdDUMP_PATH "./" > ++#endif > ++#endif > ++ > ++/* > + gcdDUMP > + > + When set to 1, a dump of all states and memory uploads, as we= ll as other > +@@ -342,6 +366,17 @@ > + #endif > + > + /* > ++ gcdUSER_HEAP_ALLOCATOR > ++ > ++ Set to 1 to enable user mode heap allocator for fast memory a= llocation > ++ and destroying. Otherwise, memory allocation/destroying in us= er mode > ++ will be directly managed by system. Only for linux for now. > ++*/ > ++#ifndef gcdUSER_HEAP_ALLOCATOR > ++# define gcdUSER_HEAP_ALLOCATOR 1 > ++#endif > ++ > ++/* > + gcdHEAP_SIZE > + > + Set the allocation size for the internal heaps. Each time a = heap is > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h b/dri= vers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h > +index 2881604..808fde0 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 > +@@ -28,7 +28,7 @@ > + > + #define gcvVERSION_PATCH 9 > + > +-#define gcvVERSION_BUILD 1210 > ++#define gcvVERSION_BUILD 4651 > + > + #define gcvVERSION_DATE __DATE__ > + > +diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_dri= ver.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > +index 4e3819c..2ed3d0e 100644 > +--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > ++++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > +@@ -663,7 +663,7 @@ static int drv_mmap( > + > + #if !gcdPAGED_MEMORY_CACHEABLE > + vma->vm_page_prot =3D pgprot_writecombine(vma->vm_page_prot); > +- vma->vm_flags |=3D VM_IO | VM_DONTCOPY | VM_DONTEXPAND; > ++ vma->vm_flags |=3D gcdVM_FLAGS; > + #endif > + vma->vm_pgoff =3D 0; > + > +diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_lin= ux.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h > +index 9c0bcd5..3c148f6 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 > +@@ -73,6 +73,12 @@ > + > + #define GetPageCount(size, offset) ((((size) + ((offset) & ~PAGE_CAC= HE_MASK)) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT) > + > ++#if LINUX_VERSION_CODE >=3D KERNEL_VERSION (3,7,0) > ++#define gcdVM_FLAGS (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_DONTDUM= P) > ++#else > ++#define gcdVM_FLAGS (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVE= D) > ++#endif > ++ > + static inline gctINT > + GetOrder( > + IN gctINT numPages > +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 c07ded8..9c2bae6 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 > +@@ -869,6 +869,60 @@ _UnmapUserLogical( > + #endif > + } > + > ++gceSTATUS > ++_QueryProcessPageTable( > ++ IN gctPOINTER Logical, > ++ OUT gctUINT32 * Address > ++ ) > ++{ > ++ spinlock_t *lock; > ++ gctUINTPTR_T logical =3D (gctUINTPTR_T)Logical; > ++ pgd_t *pgd; > ++ pud_t *pud; > ++ pmd_t *pmd; > ++ pte_t *pte; > ++ > ++ if (!current->mm) > ++ { > ++ return gcvSTATUS_NOT_FOUND; > ++ } > ++ > ++ pgd =3D pgd_offset(current->mm, logical); > ++ if (pgd_none(*pgd) || pgd_bad(*pgd)) > ++ { > ++ return gcvSTATUS_NOT_FOUND; > ++ } > ++ > ++ pud =3D pud_offset(pgd, logical); > ++ if (pud_none(*pud) || pud_bad(*pud)) > ++ { > ++ return gcvSTATUS_NOT_FOUND; > ++ } > ++ > ++ pmd =3D pmd_offset(pud, logical); > ++ if (pmd_none(*pmd) || pmd_bad(*pmd)) > ++ { > ++ return gcvSTATUS_NOT_FOUND; > ++ } > ++ > ++ pte =3D pte_offset_map_lock(current->mm, pmd, logical, &lock); > ++ if (!pte) > ++ { > ++ return gcvSTATUS_NOT_FOUND; > ++ } > ++ > ++ if (!pte_present(*pte)) > ++ { > ++ pte_unmap_unlock(pte, lock); > ++ return gcvSTATUS_NOT_FOUND; > ++ } > ++ > ++ *Address =3D (pte_pfn(*pte) << PAGE_SHIFT) | (logical & ~PAGE_MAS= K); > ++ pte_unmap_unlock(pte, lock); > ++ > ++ return gcvSTATUS_OK; > ++} > ++ > + /********************************************************************= *********** > + ** > + ** gckOS_Construct > +@@ -1106,6 +1160,9 @@ _CreateKernelVirtualMapping( > + numPages, > + 0, > + PAGE_KERNEL); > ++ > ++ /* Trigger a page fault. */ > ++ memset(addr, 0, numPages * PAGE_SIZE); > + } > + #else > + struct page ** pages; > +@@ -1136,6 +1193,9 @@ _CreateKernelVirtualMapping( > + /* ioremap() can't work on system memory since 2.6.38. */ > + addr =3D vmap(pages, numPages, 0, gcmkNONPAGED_MEMROY_PROT(PAGE_K= ERNEL)); > + > ++ /* Trigger a page fault. */ > ++ memset(addr, 0, numPages * PAGE_SIZE); > ++ > + if (free) > + { > + kfree(pages); > +@@ -1540,7 +1600,7 @@ gckOS_MapMemory( > + #else > + #if !gcdPAGED_MEMORY_CACHEABLE > + mdlMap->vma->vm_page_prot =3D gcmkPAGED_MEMROY_PROT(mdlMap->v= ma->vm_page_prot); > +- mdlMap->vma->vm_flags |=3D VM_IO | VM_DONTCOPY | VM_DONTEXPAN= D | VM_RESERVED; > ++ mdlMap->vma->vm_flags |=3D gcdVM_FLAGS; > + # endif > + mdlMap->vma->vm_pgoff =3D 0; > + > +@@ -1987,7 +2047,7 @@ gckOS_AllocateNonPagedMemory( > + } > + #else > + mdlMap->vma->vm_page_prot =3D gcmkNONPAGED_MEMROY_PROT(mdlMap= ->vma->vm_page_prot); > +- mdlMap->vma->vm_flags |=3D VM_IO | VM_DONTCOPY | VM_DONTEXPAN= D | VM_RESERVED; > ++ mdlMap->vma->vm_flags |=3D gcdVM_FLAGS; > + mdlMap->vma->vm_pgoff =3D 0; > + > + if (remap_pfn_range(mdlMap->vma, > +@@ -2367,12 +2427,18 @@ gckOS_GetPhysicalAddress( > + gcmkVERIFY_OBJECT(Os, gcvOBJ_OS); > + gcmkVERIFY_ARGUMENT(Address !=3D gcvNULL); > + > +- /* Get current process ID. */ > +- processID =3D _GetProcessID(); > ++ /* Query page table of current process first. */ > ++ status =3D _QueryProcessPageTable(Logical, Address); > + > +- /* Route through other function. */ > +- gcmkONERROR( > +- gckOS_GetPhysicalAddressProcess(Os, Logical, processID, Addre= ss)); > ++ if (gcmIS_ERROR(status)) > ++ { > ++ /* Get current process ID. */ > ++ processID =3D _GetProcessID(); > ++ > ++ /* Route through other function. */ > ++ gcmkONERROR( > ++ gckOS_GetPhysicalAddressProcess(Os, Logical, processID, A= ddress)); > ++ } > + > + /* Success. */ > + gcmkFOOTER_ARG("*Address=3D0x%08x", *Address); > +@@ -4139,7 +4205,7 @@ gckOS_LockPages( > + return gcvSTATUS_OUT_OF_RESOURCES; > + } > + > +- mdlMap->vma->vm_flags |=3D VM_RESERVED; > ++ mdlMap->vma->vm_flags |=3D gcdVM_FLAGS; > + #if !gcdPAGED_MEMORY_CACHEABLE > + if (Cacheable =3D=3D gcvFALSE) > + { > +-- > +1.8.3.2 > + > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/0001-perf-tools-Fix= -getrusage-related-build-failure-on-gl.patch b/recipes-kernel/linux/linux= -udoo-3.0.35/0001-perf-tools-Fix-getrusage-related-build-failure-on-gl.pa= tch > new file mode 100644 > index 0000000..abc02c9 > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/0001-perf-tools-Fix-getrus= age-related-build-failure-on-gl.patch > @@ -0,0 +1,43 @@ > +From 503daf4789dd23e4dc1e16c256de0c163fc2bf87 Mon Sep 17 00:00:00 2001 > +From: Markus Trippelsdorf > +Date: Wed, 4 Apr 2012 10:45:27 +0200 > +Subject: [PATCH] perf tools: Fix getrusage() related build failure on = glibc > + trunk > +MIME-Version: 1.0 > +Content-Type: text/plain; charset=3DUTF-8 > +Content-Transfer-Encoding: 8bit > +Organization: O.S. Systems Software LTDA. > + > +On a system running glibc trunk perf doesn't build: > + > + CC builtin-sched.o > +builtin-sched.c: In function =E2=80=98get_cpu_usage_nsec_parent=E2=80=99= : builtin-sched.c:399:16: error: storage size of =E2=80=98ru=E2=80=99 isn= =E2=80=99t known builtin-sched.c:403:2: error: implicit declaration of fu= nction =E2=80=98getrusage=E2=80=99 [-Werror=3Dimplicit-function-declarati= on] > + [...] > + > +Fix it by including sys/resource.h. > + > +Upstream-Status: Pending > + > +Signed-off-by: Markus Trippelsdorf > +Cc: Peter Zijlstra > +Link: http://lkml.kernel.org/r/20120404084527.GA294@x4 > +Signed-off-by: Ingo Molnar > +--- > + tools/perf/builtin-sched.c | 1 + > + 1 file changed, 1 insertion(+) > + > +diff --git a/tools/perf/builtin-sched.c b/tools/perf/builtin-sched.c > +index dcfe887..3632c2f 100644 > +--- a/tools/perf/builtin-sched.c > ++++ b/tools/perf/builtin-sched.c > +@@ -14,6 +14,7 @@ > + #include "util/debug.h" > + > + #include > ++#include > + > + #include > + #include > +-- > +1.8.4.rc3 > + > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/0002-ARM-7668-1-fix= -memset-related-crashes-caused-by-rece.patch b/recipes-kernel/linux/linux= -udoo-3.0.35/0002-ARM-7668-1-fix-memset-related-crashes-caused-by-rece.pa= tch > new file mode 100644 > index 0000000..4c31e74 > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/0002-ARM-7668-1-fix-memset= -related-crashes-caused-by-rece.patch > @@ -0,0 +1,259 @@ > +From 2235b85f1c76d98b5f1e160cbd0a61a84c15e125 Mon Sep 17 00:00:00 2001 > +From: Ivan Djelic > +Date: Wed, 6 Mar 2013 20:09:27 +0100 > +Subject: [PATCH] ARM: 7668/1: fix memset-related crashes caused by rec= ent GCC > + (4.7.2) optimizations > +Organization: O.S. Systems Software LTDA. > + > +Recent GCC versions (e.g. GCC-4.7.2) perform optimizations based on > +assumptions about the implementation of memset and similar functions. > +The current ARM optimized memset code does not return the value of > +its first argument, as is usually expected from standard implementatio= ns. > + > +For instance in the following function: > + > +void debug_mutex_lock_common(struct mutex *lock, struct mutex_waiter *= waiter) > +{ > + memset(waiter, MUTEX_DEBUG_INIT, sizeof(*waiter)); > + waiter->magic =3D waiter; > + INIT_LIST_HEAD(&waiter->list); > +} > + > +compiled as: > + > +800554d0 : > +800554d0: e92d4008 push {r3, lr} > +800554d4: e1a00001 mov r0, r1 > +800554d8: e3a02010 mov r2, #16 ; 0x10 > +800554dc: e3a01011 mov r1, #17 ; 0x11 > +800554e0: eb04426e bl 80165ea0 > +800554e4: e1a03000 mov r3, r0 > +800554e8: e583000c str r0, [r3, #12] > +800554ec: e5830000 str r0, [r3] > +800554f0: e5830004 str r0, [r3, #4] > +800554f4: e8bd8008 pop {r3, pc} > + > +GCC assumes memset returns the value of pointer 'waiter' in register r= 0; causing > +register/memory corruptions. > + > +This patch fixes the return value of the assembly version of memset. > +It adds a 'mov' instruction and merges an additional load+store into > +existing load/store instructions. > +For ease of review, here is a breakdown of the patch into 4 simple ste= ps: > + > +Step 1 > +=3D=3D=3D=3D=3D=3D > +Perform the following substitutions: > +ip -> r8, then > +r0 -> ip, > +and insert 'mov ip, r0' as the first statement of the function. > +At this point, we have a memset() implementation returning the proper = result, > +but corrupting r8 on some paths (the ones that were using ip). > + > +Step 2 > +=3D=3D=3D=3D=3D=3D > +Make sure r8 is saved and restored when (! CALGN(1)+0) =3D=3D 1: > + > +save r8: > +- str lr, [sp, #-4]! > ++ stmfd sp!, {r8, lr} > + > +and restore r8 on both exit paths: > +- ldmeqfd sp!, {pc} @ Now <64 bytes to go. > ++ ldmeqfd sp!, {r8, pc} @ Now <64 bytes to go. > +(...) > + tst r2, #16 > + stmneia ip!, {r1, r3, r8, lr} > +- ldr lr, [sp], #4 > ++ ldmfd sp!, {r8, lr} > + > +Step 3 > +=3D=3D=3D=3D=3D=3D > +Make sure r8 is saved and restored when (! CALGN(1)+0) =3D=3D 0: > + > +save r8: > +- stmfd sp!, {r4-r7, lr} > ++ stmfd sp!, {r4-r8, lr} > + > +and restore r8 on both exit paths: > + bgt 3b > +- ldmeqfd sp!, {r4-r7, pc} > ++ ldmeqfd sp!, {r4-r8, pc} > +(...) > + tst r2, #16 > + stmneia ip!, {r4-r7} > +- ldmfd sp!, {r4-r7, lr} > ++ ldmfd sp!, {r4-r8, lr} > + > +Step 4 > +=3D=3D=3D=3D=3D=3D > +Rewrite register list "r4-r7, r8" as "r4-r8". > + > +Upstream-Status: Pending > + > +Signed-off-by: Ivan Djelic > +Reviewed-by: Nicolas Pitre > +Signed-off-by: Dirk Behme > +Signed-off-by: Russell King > +(cherry picked from commit 455bd4c430b0c0a361f38e8658a0d6cb469942b5) > +--- > + arch/arm/lib/memset.S | 85 ++++++++++++++++++++++++++----------------= --------- > + 1 file changed, 44 insertions(+), 41 deletions(-) > + > +diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S > +index 650d592..d912e73 100644 > +--- a/arch/arm/lib/memset.S > ++++ b/arch/arm/lib/memset.S > +@@ -19,9 +19,9 @@ > + 1: subs r2, r2, #4 @ 1 do we have enough > + blt 5f @ 1 bytes to align with? > + cmp r3, #2 @ 1 > +- strltb r1, [r0], #1 @ 1 > +- strleb r1, [r0], #1 @ 1 > +- strb r1, [r0], #1 @ 1 > ++ strltb r1, [ip], #1 @ 1 > ++ strleb r1, [ip], #1 @ 1 > ++ strb r1, [ip], #1 @ 1 > + add r2, r2, r3 @ 1 (r2 =3D r2 - (4 - r3)) > + /* > + * The pointer is now aligned and the length is adjusted. Try doing = the > +@@ -29,10 +29,14 @@ > + */ > + > + ENTRY(memset) > +- ands r3, r0, #3 @ 1 unaligned? > ++/* > ++ * Preserve the contents of r0 for the return value. > ++ */ > ++ mov ip, r0 > ++ ands r3, ip, #3 @ 1 unaligned? > + bne 1b @ 1 > + /* > +- * we know that the pointer in r0 is aligned to a word boundary. > ++ * we know that the pointer in ip is aligned to a word boundary. > + */ > + orr r1, r1, r1, lsl #8 > + orr r1, r1, r1, lsl #16 > +@@ -43,29 +47,28 @@ ENTRY(memset) > + #if ! CALGN(1)+0 > + > + /* > +- * We need an extra register for this loop - save the return address = and > +- * use the LR > ++ * We need 2 extra registers for this loop - use r8 and the LR > + */ > +- str lr, [sp, #-4]! > +- mov ip, r1 > ++ stmfd sp!, {r8, lr} > ++ mov r8, r1 > + mov lr, r1 > + > + 2: subs r2, r2, #64 > +- stmgeia r0!, {r1, r3, ip, lr} @ 64 bytes at a time. > +- stmgeia r0!, {r1, r3, ip, lr} > +- stmgeia r0!, {r1, r3, ip, lr} > +- stmgeia r0!, {r1, r3, ip, lr} > ++ stmgeia ip!, {r1, r3, r8, lr} @ 64 bytes at a time. > ++ stmgeia ip!, {r1, r3, r8, lr} > ++ stmgeia ip!, {r1, r3, r8, lr} > ++ stmgeia ip!, {r1, r3, r8, lr} > + bgt 2b > +- ldmeqfd sp!, {pc} @ Now <64 bytes to go. > ++ ldmeqfd sp!, {r8, pc} @ Now <64 bytes to go. > + /* > + * No need to correct the count; we're only testing bits from now on > + */ > + tst r2, #32 > +- stmneia r0!, {r1, r3, ip, lr} > +- stmneia r0!, {r1, r3, ip, lr} > ++ stmneia ip!, {r1, r3, r8, lr} > ++ stmneia ip!, {r1, r3, r8, lr} > + tst r2, #16 > +- stmneia r0!, {r1, r3, ip, lr} > +- ldr lr, [sp], #4 > ++ stmneia ip!, {r1, r3, r8, lr} > ++ ldmfd sp!, {r8, lr} > + > + #else > + > +@@ -74,54 +77,54 @@ ENTRY(memset) > + * whole cache lines at once. > + */ > + > +- stmfd sp!, {r4-r7, lr} > ++ stmfd sp!, {r4-r8, lr} > + mov r4, r1 > + mov r5, r1 > + mov r6, r1 > + mov r7, r1 > +- mov ip, r1 > ++ mov r8, r1 > + mov lr, r1 > + > + cmp r2, #96 > +- tstgt r0, #31 > ++ tstgt ip, #31 > + ble 3f > + > +- and ip, r0, #31 > +- rsb ip, ip, #32 > +- sub r2, r2, ip > +- movs ip, ip, lsl #(32 - 4) > +- stmcsia r0!, {r4, r5, r6, r7} > +- stmmiia r0!, {r4, r5} > +- tst ip, #(1 << 30) > +- mov ip, r1 > +- strne r1, [r0], #4 > ++ and r8, ip, #31 > ++ rsb r8, r8, #32 > ++ sub r2, r2, r8 > ++ movs r8, r8, lsl #(32 - 4) > ++ stmcsia ip!, {r4, r5, r6, r7} > ++ stmmiia ip!, {r4, r5} > ++ tst r8, #(1 << 30) > ++ mov r8, r1 > ++ strne r1, [ip], #4 > + > + 3: subs r2, r2, #64 > +- stmgeia r0!, {r1, r3-r7, ip, lr} > +- stmgeia r0!, {r1, r3-r7, ip, lr} > ++ stmgeia ip!, {r1, r3-r8, lr} > ++ stmgeia ip!, {r1, r3-r8, lr} > + bgt 3b > +- ldmeqfd sp!, {r4-r7, pc} > ++ ldmeqfd sp!, {r4-r8, pc} > + > + tst r2, #32 > +- stmneia r0!, {r1, r3-r7, ip, lr} > ++ stmneia ip!, {r1, r3-r8, lr} > + tst r2, #16 > +- stmneia r0!, {r4-r7} > +- ldmfd sp!, {r4-r7, lr} > ++ stmneia ip!, {r4-r7} > ++ ldmfd sp!, {r4-r8, lr} > + > + #endif > + > + 4: tst r2, #8 > +- stmneia r0!, {r1, r3} > ++ stmneia ip!, {r1, r3} > + tst r2, #4 > +- strne r1, [r0], #4 > ++ strne r1, [ip], #4 > + /* > + * When we get here, we've got less than 4 bytes to zero. We > + * may have an unaligned pointer as well. > + */ > + 5: tst r2, #2 > +- strneb r1, [r0], #1 > +- strneb r1, [r0], #1 > ++ strneb r1, [ip], #1 > ++ strneb r1, [ip], #1 > + tst r2, #1 > +- strneb r1, [r0], #1 > ++ strneb r1, [ip], #1 > + mov pc, lr > + ENDPROC(memset) > +-- > +1.8.4.rc3 > + > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/0002-ENGR00265465-g= pu-Add-global-value-for-minimum-3D-clo.patch b/recipes-kernel/linux/linux= -udoo-3.0.35/0002-ENGR00265465-gpu-Add-global-value-for-minimum-3D-clo.pa= tch > new file mode 100644 > index 0000000..5725ab7 > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/0002-ENGR00265465-gpu-Add-= global-value-for-minimum-3D-clo.patch > @@ -0,0 +1,62 @@ > +From 2df4dba8faa9a781a5a1c6c09d646d2b692c9a0c Mon Sep 17 00:00:00 2001 > +From: Loren Huang > +Date: Tue, 4 Jun 2013 15:08:15 +0800 > +Subject: [PATCH 2/6] ENGR00265465 gpu:Add global value for minimum 3D = clock > + export > + > +Add global value gpu3DMinClock so that minimum 3D clock can be change = by user. > +When gpu min clock is too low, it may cause IPU starvation issue in ce= rtain case. > +Use echo x > /sys/module/galcore/parameters/gpu3DMinClock to change it= . > + > +Cherry-pick from 3.0.35 branch. > + > +Upstream-Status: Backport [3.5.7-1.0.0] > + > +Signed-off-by: Loren Huang > +Acked-by: Lily Zhang > +--- > + drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c | 6= +++++- > + drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c | 3= +++ > + 2 files changed, 8 insertions(+), 1 deletion(-) > + > +diff --git a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_ha= rdware.c b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardwar= e.c > +index 3829999..ebd36fe 100644 > +--- a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.= c > ++++ b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.= c > +@@ -36,6 +36,7 @@ typedef struct _gcsiDEBUG_REGISTERS > + } > + gcsiDEBUG_REGISTERS; > + > ++extern int gpu3DMinClock; > + /********************************************************************= **********\ > + ********************************* Support Code **********************= *********** > + \********************************************************************= **********/ > +@@ -4630,7 +4631,10 @@ gckHARDWARE_GetFscaleValue( > + ) > + { > + *FscaleValue =3D Hardware->powerOnFscaleVal; > +- *MinFscaleValue =3D 1; > ++ if ((gpu3DMinClock > 0) && (gpu3DMinClock <=3D 64) && (Hardware->= core =3D=3D gcvCORE_MAJOR)) > ++ *MinFscaleValue =3D gpu3DMinClock; > ++ else > ++ *MinFscaleValue =3D 1; > + *MaxFscaleValue =3D 64; > + > + return gcvSTATUS_OK; > +diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_dri= ver.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > +index 2ed3d0e..64cace1 100644 > +--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > ++++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > +@@ -146,6 +146,9 @@ module_param(logFileSize,uint, 0644); > + static int showArgs =3D 0; > + module_param(showArgs, int, 0644); > + > ++int gpu3DMinClock =3D 0; > ++module_param(gpu3DMinClock, int, 0644); > ++ > + #if ENABLE_GPU_CLOCK_BY_DRIVER > + unsigned long coreClock =3D 156000000; > + module_param(coreClock, ulong, 0644); > +-- > +1.8.3.2 > + > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/0003-ARM-7670-1-fix= -the-memset-fix.patch b/recipes-kernel/linux/linux-udoo-3.0.35/0003-ARM-7= 670-1-fix-the-memset-fix.patch > new file mode 100644 > index 0000000..b8d6f53 > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/0003-ARM-7670-1-fix-the-me= mset-fix.patch > @@ -0,0 +1,87 @@ > +From 2ba23fa6c4128febaaf57fe184420a7111caa237 Mon Sep 17 00:00:00 2001 > +From: Nicolas Pitre > +Date: Tue, 12 Mar 2013 13:00:42 +0100 > +Subject: [PATCH] ARM: 7670/1: fix the memset fix > +Organization: O.S. Systems Software LTDA. > + > +Commit 455bd4c430b0 ("ARM: 7668/1: fix memset-related crashes caused b= y > +recent GCC (4.7.2) optimizations") attempted to fix a compliance issue > +with the memset return value. However the memset itself became broken > +by that patch for misaligned pointers. > + > +This fixes the above by branching over the entry code from the > +misaligned fixup code to avoid reloading the original pointer. > + > +Also, because the function entry alignment is wrong in the Thumb mode > +compilation, that fixup code is moved to the end. > + > +While at it, the entry instructions are slightly reworked to help dual > +issue pipelines. > + > +Upstream-Status: Pending > + > +Signed-off-by: Nicolas Pitre > +Tested-by: Alexander Holler > +Signed-off-by: Russell King > +(cherry picked from commit 418df63adac56841ef6b0f1fcf435bc64d4ed177) > +--- > + arch/arm/lib/memset.S | 33 +++++++++++++-------------------- > + 1 file changed, 13 insertions(+), 20 deletions(-) > + > +diff --git a/arch/arm/lib/memset.S b/arch/arm/lib/memset.S > +index d912e73..94b0650 100644 > +--- a/arch/arm/lib/memset.S > ++++ b/arch/arm/lib/memset.S > +@@ -14,31 +14,15 @@ > + > + .text > + .align 5 > +- .word 0 > +- > +-1: subs r2, r2, #4 @ 1 do we have enough > +- blt 5f @ 1 bytes to align with? > +- cmp r3, #2 @ 1 > +- strltb r1, [ip], #1 @ 1 > +- strleb r1, [ip], #1 @ 1 > +- strb r1, [ip], #1 @ 1 > +- add r2, r2, r3 @ 1 (r2 =3D r2 - (4 - r3)) > +-/* > +- * The pointer is now aligned and the length is adjusted. Try doing = the > +- * memset again. > +- */ > + > + ENTRY(memset) > +-/* > +- * Preserve the contents of r0 for the return value. > +- */ > +- mov ip, r0 > +- ands r3, ip, #3 @ 1 unaligned? > +- bne 1b @ 1 > ++ ands r3, r0, #3 @ 1 unaligned? > ++ mov ip, r0 @ preserve r0 as return value > ++ bne 6f @ 1 > + /* > + * we know that the pointer in ip is aligned to a word boundary. > + */ > +- orr r1, r1, r1, lsl #8 > ++1: orr r1, r1, r1, lsl #8 > + orr r1, r1, r1, lsl #16 > + mov r3, r1 > + cmp r2, #16 > +@@ -127,4 +111,13 @@ ENTRY(memset) > + tst r2, #1 > + strneb r1, [ip], #1 > + mov pc, lr > ++ > ++6: subs r2, r2, #4 @ 1 do we have enough > ++ blt 5b @ 1 bytes to align with? > ++ cmp r3, #2 @ 1 > ++ strltb r1, [ip], #1 @ 1 > ++ strleb r1, [ip], #1 @ 1 > ++ strb r1, [ip], #1 @ 1 > ++ add r2, r2, r3 @ 1 (r2 =3D r2 - (4 - r3)) > ++ b 1b > + ENDPROC(memset) > +-- > +1.8.4.rc3 > + > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/0003-ENGR00261814-4= -gpu-use-new-PU-power-on-off-interface.patch b/recipes-kernel/linux/linux= -udoo-3.0.35/0003-ENGR00261814-4-gpu-use-new-PU-power-on-off-interface.pa= tch > new file mode 100644 > index 0000000..23a415d > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/0003-ENGR00261814-4-gpu-us= e-new-PU-power-on-off-interface.patch > @@ -0,0 +1,53 @@ > +From 1579de9397783ab5321c80f1e76661653ef38ccd Mon Sep 17 00:00:00 2001 > +From: Robin Gong > +Date: Thu, 9 May 2013 11:45:55 +0800 > +Subject: [PATCH 3/6] ENGR00261814-4 gpu: use new PU power on/off inter= face > + > +use new PU power on/off interface in GPU driver > + > +Upstream-Status: Backport [3.5.7-1.0.0] > + > +Signed-off-by: Robin Gong > +Acked-by: Lily Zhang > +--- > + .../mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c | 16 +++++++= ++++++--- > + 1 file changed, 13 insertions(+), 3 deletions(-) > + > +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 9c2bae6..dfbc699 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 > +@@ -6819,8 +6819,13 @@ gckOS_SetGPUPower( > + } > + if((Power =3D=3D gcvTRUE) && (oldPowerState =3D=3D gcvFALSE)) > + { > +- if(!IS_ERR(Os->device->gpu_regulator)) > +- regulator_enable(Os->device->gpu_regulator); > ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) =09 > ++ if(!IS_ERR(Os->device->gpu_regulator)) > ++ regulator_enable(Os->device->gpu_regulator); > ++#else > ++ imx_gpc_power_up_pu(true); > ++#endif > ++ > + #ifdef CONFIG_PM > + pm_runtime_get_sync(Os->device->pmdev); > + #endif > +@@ -6930,8 +6935,13 @@ gckOS_SetGPUPower( > + #ifdef CONFIG_PM > + pm_runtime_put_sync(Os->device->pmdev); > + #endif > ++ > ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0) =09 > + if(!IS_ERR(Os->device->gpu_regulator)) > +- regulator_disable(Os->device->gpu_regulator); > ++ regulator_disable(Os->device->gpu_regulator); > ++#else > ++ imx_gpc_power_up_pu(false); > ++#endif > + } > + /* TODO: Put your code here. */ > + gcmkFOOTER_NO(); > +-- > +1.8.3.2 > + > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/0004-ENGR00264288-1= -GPU-Integrate-4.6.9p12-release-kernel.patch b/recipes-kernel/linux/linux= -udoo-3.0.35/0004-ENGR00264288-1-GPU-Integrate-4.6.9p12-release-kernel.pa= tch > new file mode 100644 > index 0000000..08ca88a > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/0004-ENGR00264288-1-GPU-In= tegrate-4.6.9p12-release-kernel.patch > @@ -0,0 +1,2006 @@ > +From c090a0238315094d245de2503b6f9a5bce0bda03 Mon Sep 17 00:00:00 2001 > +From: Loren Huang > +Date: Mon, 27 May 2013 17:45:48 +0800 > +Subject: [PATCH 4/6] ENGR00264288-1 [GPU]Integrate 4.6.9p12 release ke= rnel > + part code > + > +Integrate 4.6.9p12 release kernel part code. > +Cherry-pick from 3.0.35 branch. > + > +Upstream-Status: Backport [3.5.7-1.0.0] > + > +Signed-off-by: Loren Huang > +Acked-by: Lily Zhang > +--- > + .../GC350/hal/kernel/gc_hal_kernel_hardware_vg.c | 63 +++- > + .../GC350/hal/kernel/gc_hal_kernel_hardware_vg.h | 2 + > + .../arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.c | 174 ++++++++--- > + .../arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.h | 2 + > + drivers/mxc/gpu-viv/config | 1 - > + drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c | 329 +++++++-----= --------- > + .../mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c | 6 +- > + .../gpu-viv/hal/kernel/gc_hal_kernel_command_vg.c | 14 +- > + drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c | 6 +- > + drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c | 119 +++++++- > + .../hal/kernel/gc_hal_kernel_video_memory.c | 3 + > + drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h | 6 + > + drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h | 34 +-- > + .../mxc/gpu-viv/hal/kernel/inc/gc_hal_compiler.h | 20 +- > + drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver.h | 35 ++- > + drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h | 62 +--- > + drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h | 7 - > + .../mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h | 31 +- > + .../mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h | 2 +- > + drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_vg.h | 6 + > + .../hal/os/linux/kernel/gc_hal_kernel_device.c | 13 + > + .../hal/os/linux/kernel/gc_hal_kernel_device.h | 1 + > + .../hal/os/linux/kernel/gc_hal_kernel_driver.c | 10 +- > + .../gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.c | 74 +++-- > + .../gpu-viv/hal/os/linux/kernel/gc_hal_kernel_os.h | 3 + > + 25 files changed, 574 insertions(+), 449 deletions(-) > + > +diff --git a/drivers/mxc/gpu-viv/arch/GC350/hal/kernel/gc_hal_kernel_h= ardware_vg.c b/drivers/mxc/gpu-viv/arch/GC350/hal/kernel/gc_hal_kernel_ha= rdware_vg.c > +index 4a6010d..70c2cd6 100644 > +--- a/drivers/mxc/gpu-viv/arch/GC350/hal/kernel/gc_hal_kernel_hardware= _vg.c > ++++ b/drivers/mxc/gpu-viv/arch/GC350/hal/kernel/gc_hal_kernel_hardware= _vg.c > +@@ -217,7 +217,6 @@ _IdentifyHardware( > + return status; > + } > + > +-#if gcdPOWER_MANAGEMENT > + static gctTHREADFUNCRESULT gctTHREADFUNCTYPE > + _TimeIdleThread( > + gctTHREADFUNCPARAMETER ThreadParameter > +@@ -262,8 +261,6 @@ _TimeIdleThread( > + } > + return 0; > + } > +-#endif > +- > + > + /********************************************************************= **********\ > + ****************************** gckVGHARDWARE API code ***************= ************** > +@@ -309,6 +306,7 @@ gckVGHARDWARE_Construct( > + do > + { > + gcmkERR_BREAK(gckOS_SetGPUPower(Os, gcvCORE_VG, gcvTRUE, gcvT= RUE)); > ++ > + status =3D _ResetGPU(Os); > + > + if (status !=3D gcvSTATUS_OK) > +@@ -368,14 +366,17 @@ gckVGHARDWARE_Construct( > + > + gcmkERR_BREAK(gckOS_CreateMutex(Os, &hardware->powerMutex)); > + gcmkERR_BREAK(gckOS_CreateSignal(Os, gcvFALSE, &hardware->idl= eSignal)); > +-#if gcdPOWER_MANAGEMENT > ++ > ++ /* Enable power management by default. */ > ++ hardware->powerManagement =3D gcvTRUE; > ++ > + gcmkERR_BREAK(gckOS_StartThread( > + hardware->os, > + _TimeIdleThread, > + hardware, > + &hardware->timeIdleThread > + )); > +-#endif > ++ > + /* Return pointer to the gckVGHARDWARE object. */ > + *Hardware =3D hardware; > + > +@@ -395,6 +396,8 @@ gckVGHARDWARE_Construct( > + gcmkVERIFY_OK(gckOS_Free(Os, hardware)); > + } > + > ++ gcmkVERIFY_OK(gckOS_SetGPUPower(Os, gcvCORE_VG, gcvFALSE, gcvFALS= E)); > ++ > + gcmkFOOTER(); > + /* Return the status. */ > + return status; > +@@ -425,11 +428,10 @@ gckVGHARDWARE_Destroy( > + /* Verify the arguments. */ > + gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE); > + > +-#if gcdPOWER_MANAGEMENT > + Hardware->killThread =3D gcvTRUE; > + gcmkVERIFY_OK(gckOS_Signal(Hardware->os, Hardware->idleSignal, gc= vTRUE)); > + gcmkVERIFY_OK(gckOS_StopThread(Hardware->os, Hardware->timeIdleTh= read)); > +-#endif > ++ > + /* Mark the object as unknown. */ > + Hardware->object.type =3D gcvOBJ_UNKNOWN; > + > +@@ -1432,7 +1434,6 @@ gckVGHARDWARE_ReadInterrupt( > + return status; > + } > + > +-#if gcdPOWER_MANAGEMENT > + static gceSTATUS _CommandStall( > + gckVGHARDWARE Hardware) > + { > +@@ -1477,7 +1478,6 @@ static gceSTATUS _CommandStall( > + /* Return the status. */ > + return status; > + } > +-#endif > + > + /********************************************************************= *********** > + ** > +@@ -1500,7 +1500,6 @@ gckVGHARDWARE_SetPowerManagementState( > + IN gceCHIPPOWERSTATE State > + ) > + { > +-#if gcdPOWER_MANAGEMENT > + gceSTATUS status; > + gckVGCOMMAND command =3D gcvNULL; > + gckOS os; > +@@ -1600,6 +1599,12 @@ gckVGHARDWARE_SetPowerManagementState( > + command =3D Hardware->kernel->command; > + gcmkVERIFY_OBJECT(command, gcvOBJ_COMMAND); > + > ++ if (Hardware->powerManagement =3D=3D gcvFALSE) > ++ { > ++ gcmkFOOTER_NO(); > ++ return gcvSTATUS_OK; > ++ } > ++ > + /* Start profiler. */ > + gcmkPROFILE_INIT(freq, time); > + > +@@ -1914,10 +1919,6 @@ OnError: > + /* Return the status. */ > + gcmkFOOTER(); > + return status; > +-#else /* gcdPOWER_MANAGEMENT */ > +- /* Do nothing */ > +- return gcvSTATUS_OK; > +-#endif > + } > + > + /********************************************************************= *********** > +@@ -1955,6 +1956,40 @@ gckVGHARDWARE_QueryPowerManagementState( > + return gcvSTATUS_OK; > + } > + > ++/********************************************************************= *********** > ++** > ++** gckVGHARDWARE_SetPowerManagement > ++** > ++** Configure GPU power management function. > ++** Only used in driver initialization stage. > ++** > ++** INPUT: > ++** > ++** gckVGHARDWARE Harwdare > ++** Pointer to an gckHARDWARE object. > ++** > ++** gctBOOL PowerManagement > ++** Power Mangement State. > ++** > ++*/ > ++gceSTATUS > ++gckVGHARDWARE_SetPowerManagement( > ++ IN gckVGHARDWARE Hardware, > ++ IN gctBOOL PowerManagement > ++ ) > ++{ > ++ gcmkHEADER_ARG("Hardware=3D0x%x", Hardware); > ++ > ++ /* Verify the arguments. */ > ++ gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE); > ++ > ++ Hardware->powerManagement =3D PowerManagement; > ++ > ++ /* Success. */ > ++ gcmkFOOTER_NO(); > ++ return gcvSTATUS_OK; > ++} > ++ > + gceSTATUS > + gckVGHARDWARE_SetPowerOffTimeout( > + IN gckVGHARDWARE Hardware, > +diff --git a/drivers/mxc/gpu-viv/arch/GC350/hal/kernel/gc_hal_kernel_h= ardware_vg.h b/drivers/mxc/gpu-viv/arch/GC350/hal/kernel/gc_hal_kernel_ha= rdware_vg.h > +index 83a603e..16b81ae 100644 > +--- a/drivers/mxc/gpu-viv/arch/GC350/hal/kernel/gc_hal_kernel_hardware= _vg.h > ++++ b/drivers/mxc/gpu-viv/arch/GC350/hal/kernel/gc_hal_kernel_hardware= _vg.h > +@@ -66,6 +66,8 @@ struct _gckVGHARDWARE > + gctTHREAD timeIdleThread; > + gctBOOL killThread; > + gctPOINTER pageTableDirty; > ++ > ++ gctBOOL powerManagement; > + }; > + > + #endif /* __gc_hal_kernel_hardware_h_ */ > +diff --git a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_ha= rdware.c b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardwar= e.c > +index ebd36fe..00f3839 100644 > +--- a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.= c > ++++ b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.= c > +@@ -176,6 +176,7 @@ _IdentifyHardware( > + Identity->chipMinorFeatures1 =3D 0; > + Identity->chipMinorFeatures2 =3D 0; > + Identity->chipMinorFeatures3 =3D 0; > ++ Identity->chipMinorFeatures4 =3D 0; > + } > + else > + { > +@@ -207,13 +208,20 @@ _IdentifyHardware( > + gckOS_ReadRegisterEx(Os, Core, > + 0x00088, > + &Identity->chipMinorFeatures3)); > ++ > ++ /* Read chip minor featuress register #4. */ > ++ gcmkONERROR( > ++ gckOS_ReadRegisterEx(Os, Core, > ++ 0x00094, > ++ &Identity->chipMinorFeatures4)); > + } > + else > + { > +- /* Chip doesn't has minor features register #1 or 2 or 3.= */ > ++ /* Chip doesn't has minor features register #1 or 2 or 3 = or 4. */ > + Identity->chipMinorFeatures1 =3D 0; > + Identity->chipMinorFeatures2 =3D 0; > + Identity->chipMinorFeatures3 =3D 0; > ++ Identity->chipMinorFeatures4 =3D 0; > + } > + } > + > +@@ -234,14 +242,14 @@ _IdentifyHardware( > + > + /* Exception for GC1000, revision 5035 & GC800, revision 4612 */ > + if (((Identity->chipModel =3D=3D gcv1000) && ((Identity->chipRevi= sion =3D=3D 0x5035) > +- || (Identity->chipRevision= =3D=3D 0x5036))) > ++ || (Identity->chipRevision= =3D=3D 0x5036) > ++ || (Identity->chipRevision= =3D=3D 0x5037))) > + || ((Identity->chipModel =3D=3D gcv800) && (Identity->chipRevision = =3D=3D 0x4612))) > + { > + Identity->superTileMode =3D 1; > + } > + > + > +- > + /* Disable HZ when EZ is present for older chips. */ > + if (!((((gctUINT32) (Identity->chipFeatures)) >> (0 ? 16:16) & ((gct= UINT32) ((((1 ? 16:16) - (0 ? 16:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 = ? 16:16) - (0 ? 16:16) + 1)))))) =3D=3D (0x1 & ((gctUINT32) ((((1 ? 16:16= ) - (0 ? 16:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 16:16) - (0 ? 16:16= ) + 1)))))))) > + { > +@@ -285,6 +293,10 @@ _IdentifyHardware( > + "Identity: chipMinorFeatures3=3D0x%08X", > + Identity->chipMinorFeatures3); > + > ++ gcmkTRACE_ZONE(gcvLEVEL_INFO, gcvZONE_HARDWARE, > ++ "Identity: chipMinorFeatures4=3D0x%08X", > ++ Identity->chipMinorFeatures4); > ++ > + /****************************************************************= *********** > + ** Get chip specs. > + */ > +@@ -576,7 +588,6 @@ OnError: > + return status; > + } > + > +-#if gcdPOWER_MANAGEMENT > + static gceSTATUS > + _IsGPUPresent( > + IN gckHARDWARE Hardware > +@@ -631,7 +642,6 @@ OnError: > + gcmkFOOTER(); > + return status; > + } > +-#endif > + > + /********************************************************************= **********\ > + ****************************** gckHARDWARE API code *****************= ************ > +@@ -708,6 +718,7 @@ gckHARDWARE_Construct( > + > + case gcv300: > + case gcv320: > ++ case gcv420: > + hardware->type =3D gcvHARDWARE_2D; > + /*set outstanding limit*/ > + gcmkONERROR(gckOS_ReadRegisterEx(Os, Core, 0x00414, &axi_ot))= ; > +@@ -795,6 +806,9 @@ gckHARDWARE_Construct( > + hardware->linkQueue.count =3D 0; > + #endif > + > ++ /* Enable power management by default. */ > ++ hardware->powerManagement =3D gcvTRUE; > ++ > + /* Return pointer to the gckHARDWARE object. */ > + *Hardware =3D hardware; > + > +@@ -1404,6 +1418,7 @@ gckHARDWARE_QueryChipIdentity( > + Identity->chipMinorFeatures1 =3D Hardware->identity.chipMinorFeat= ures1; > + Identity->chipMinorFeatures2 =3D Hardware->identity.chipMinorFeat= ures2; > + Identity->chipMinorFeatures3 =3D Hardware->identity.chipMinorFeat= ures3; > ++ Identity->chipMinorFeatures4 =3D Hardware->identity.chipMinorFeat= ures4; > + > + /* Return chip specs. */ > + Identity->streamCount =3D Hardware->identity.streamCou= nt; > +@@ -3129,7 +3144,7 @@ gckHARDWARE_FlushMMU( > + | ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((= 1 ? 25:16) - (0 ? 25:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 25:16) - (= 0 ? 25:16) + 1))))))) << (0 ? 25:16))) | (((gctUINT32) ((gctUINT32) (1) &= ((gctUINT32) ((((1 ? 25:16) - (0 ? 25:16) + 1) =3D=3D 32) ? ~0 : (~(~0 <= < ((1 ? 25:16) - (0 ? 25:16) + 1))))))) << (0 ? 25:16))); > + > + buffer[9] > +- =3D (((((gctUINT32) (~0)) & ~(((gctUINT32) (((gctUINT32) = ((((1 ? 4:4) - (0 ? 4:4) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 4:4) - (0 = ? 4:4) + 1))))))) << (0 ? 4:4))) | (((gctUINT32) (0x1 & ((gctUINT32) ((((= 1 ? 4:4) - (0 ? 4:4) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 4:4) - (0 ? 4:= 4) + 1))))))) << (0 ? 4:4))) & ((((gctUINT32) (~0)) & ~(((gctUINT32) (((= gctUINT32) ((((1 ? 7:7) - (0 ? 7:7) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ?= 7:7) - (0 ? 7:7) + 1))))))) << (0 ? 7:7))) | (((gctUINT32) (0x0 & ((gctU= INT32) ((((1 ? 7:7) - (0 ? 7:7) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 7:7= ) - (0 ? 7:7) + 1))))))) << (0 ? 7:7))) ); > ++ =3D (((((gctUINT32) (~0)) & ~(((gctUINT32) (((gctUINT32) = ((((1 ? 4:4) - (0 ? 4:4) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 4:4) - (0 = ? 4:4) + 1))))))) << (0 ? 4:4))) | (((gctUINT32) (0x1 & ((gctUINT32) ((((= 1 ? 4:4) - (0 ? 4:4) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 4:4) - (0 ? 4:= 4) + 1))))))) << (0 ? 4:4))) & ((((gctUINT32) (~0)) & ~(((gctUINT32) (((= gctUINT32) ((((1 ? 7:7) - (0 ? 7:7) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ?= 7:7) - (0 ? 7:7) + 1))))))) << (0 ? 7:7))) | (((gctUINT32) (0x0 & ((gctU= INT32) ((((1 ? 7:7) - (0 ? 7:7) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 7:7= ) - (0 ? 7:7) + 1))))))) << (0 ? 7:7)))); > + > + /* Arm the PE-FE Semaphore. */ > + buffer[10] > +@@ -3660,7 +3675,7 @@ typedef enum > + } > + gcePOWER_FLAGS; > + > +-#if gcmIS_DEBUG(gcdDEBUG_TRACE) && gcdPOWER_MANAGEMENT > ++#if gcmIS_DEBUG(gcdDEBUG_TRACE) > + static gctCONST_STRING > + _PowerEnum(gceCHIPPOWERSTATE State) > + { > +@@ -3709,7 +3724,6 @@ gckHARDWARE_SetPowerManagementState( > + IN gceCHIPPOWERSTATE State > + ) > + { > +-#if gcdPOWER_MANAGEMENT > + gceSTATUS status; > + gckCOMMAND command =3D gcvNULL; > + gckOS os; > +@@ -3841,6 +3855,12 @@ gckHARDWARE_SetPowerManagementState( > + command =3D Hardware->kernel->command; > + gcmkVERIFY_OBJECT(command, gcvOBJ_COMMAND); > + > ++ if (Hardware->powerManagement =3D=3D gcvFALSE) > ++ { > ++ gcmkFOOTER_NO(); > ++ return gcvSTATUS_OK; > ++ } > ++ > + /* Start profiler. */ > + gcmkPROFILE_INIT(freq, time); > + > +@@ -4491,10 +4511,6 @@ OnError: > + /* Return the status. */ > + gcmkFOOTER(); > + return status; > +-#else /* gcdPOWER_MANAGEMENT */ > +- /* Do nothing */ > +- return gcvSTATUS_OK; > +-#endif > + } > + > + /********************************************************************= *********** > +@@ -4532,6 +4548,40 @@ gckHARDWARE_QueryPowerManagementState( > + return gcvSTATUS_OK; > + } > + > ++/********************************************************************= *********** > ++** > ++** gckHARDWARE_SetPowerManagement > ++** > ++** Configure GPU power management function. > ++** Only used in driver initialization stage. > ++** > ++** INPUT: > ++** > ++** gckHARDWARE Harwdare > ++** Pointer to an gckHARDWARE object. > ++** > ++** gctBOOL PowerManagement > ++** Power Mangement State. > ++** > ++*/ > ++gceSTATUS > ++gckHARDWARE_SetPowerManagement( > ++ IN gckHARDWARE Hardware, > ++ IN gctBOOL PowerManagement > ++ ) > ++{ > ++ gcmkHEADER_ARG("Hardware=3D0x%x", Hardware); > ++ > ++ /* Verify the arguments. */ > ++ gcmkVERIFY_OBJECT(Hardware, gcvOBJ_HARDWARE); > ++ > ++ Hardware->powerManagement =3D PowerManagement; > ++ > ++ /* Success. */ > ++ gcmkFOOTER_NO(); > ++ return gcvSTATUS_OK; > ++} > ++ > + #if gcdENABLE_FSCALE_VAL_ADJUST > + gceSTATUS > + gckHARDWARE_SetFscaleValue( > +@@ -4767,6 +4817,21 @@ OnError: > + GC_DEBUG_SIGNALS_##block##_Address, \ > + &profiler->data)) > + > ++#define gcmkREAD_DEBUG_REGISTER_N(control, block, index, data) \ > ++ gcmkONERROR(\ > ++ gckOS_WriteRegisterEx(Hardware->os, \ > ++ Hardware->core, \ > ++ GC_DEBUG_CONTROL##control##_Address, \ > ++ gcmSETFIELD(0, \ > ++ GC_DEBUG_CONTROL##control, = \ > ++ block, \ > ++ index))); \ > ++ gcmkONERROR(\ > ++ gckOS_ReadRegisterEx(Hardware->os, \ > ++ Hardware->core, \ > ++ GC_DEBUG_SIGNALS_##block##_Address, \ > ++ &data)) > ++ > + #define gcmkRESET_DEBUG_REGISTER(control, block) \ > + gcmkONERROR(\ > + gckOS_WriteRegisterEx(Hardware->os, \ > +@@ -4857,6 +4922,9 @@ gckHARDWARE_QueryProfileRegisters( > + { > + gceSTATUS status; > + gcsPROFILER_COUNTERS * profiler =3D Counters; > ++ gctUINT i, clock; > ++ gctUINT32 colorKilled, colorDrawn, depthKilled, depthDrawn; > ++ gctUINT32 totalRead, totalWrite; > + > + gcmkHEADER_ARG("Hardware=3D0x%x Counters=3D0x%x", Hardware, Count= ers); > + > +@@ -4867,16 +4935,6 @@ gckHARDWARE_QueryProfileRegisters( > + gcmkONERROR( > + gckOS_ReadRegisterEx(Hardware->os, > + Hardware->core, > +- 0x00040, > +- &profiler->gpuTotalRead64BytesPerFrame))= ; > +- gcmkONERROR( > +- gckOS_ReadRegisterEx(Hardware->os, > +- Hardware->core, > +- 0x00044, > +- &profiler->gpuTotalWrite64BytesPerFrame)= ); > +- gcmkONERROR( > +- gckOS_ReadRegisterEx(Hardware->os, > +- Hardware->core, > + 0x00438, > + &profiler->gpuCyclesCounter)); > + > +@@ -4892,8 +4950,63 @@ gckHARDWARE_QueryProfileRegisters( > + 0x0007C, > + &profiler->gpuIdleCyclesCounter)); > + > +- if(Reset){ > + > ++ /* Read clock control register. */ > ++ gcmkONERROR(gckOS_ReadRegisterEx(Hardware->os, > ++ Hardware->core, > ++ 0x00000, > ++ &clock)); > ++ > ++ profiler->gpuTotalRead64BytesPerFrame =3D 0; > ++ profiler->gpuTotalWrite64BytesPerFrame =3D 0; > ++ profiler->pe_pixel_count_killed_by_color_pipe =3D 0; > ++ profiler->pe_pixel_count_killed_by_depth_pipe =3D 0; > ++ profiler->pe_pixel_count_drawn_by_color_pipe =3D 0; > ++ profiler->pe_pixel_count_drawn_by_depth_pipe =3D 0; > ++ > ++ /* Walk through all avaiable pixel pipes. */ > ++ for (i =3D 0; i < Hardware->identity.pixelPipes; ++i) > ++ { > ++ /* Select proper pipe. */ > ++ gcmkONERROR(gckOS_WriteRegisterEx(Hardware->os, > ++ Hardware->core, > ++ 0x00000, > ++ ((((gctUINT32) (clock)) & = ~(((gctUINT32) (((gctUINT32) ((((1 ? 23:20) - (0 ? 23:20) + 1) =3D=3D 32)= ? ~0 : (~(~0 << ((1 ? 23:20) - (0 ? 23:20) + 1))))))) << (0 ? 23:20))) |= (((gctUINT32) ((gctUINT32) (i) & ((gctUINT32) ((((1 ? 23:20) - (0 ? 23:2= 0) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 23:20) - (0 ? 23:20) + 1))))))) = << (0 ? 23:20))))); > ++ > ++ /* BW */ > ++ gcmkONERROR( > ++ gckOS_ReadRegisterEx(Hardware->os, > ++ Hardware->core, > ++ 0x00040, > ++ &totalRead)); > ++ gcmkONERROR( > ++ gckOS_ReadRegisterEx(Hardware->os, > ++ Hardware->core, > ++ 0x00044, > ++ &totalWrite)); > ++ > ++ profiler->gpuTotalRead64BytesPerFrame +=3D totalRead; > ++ profiler->gpuTotalWrite64BytesPerFrame +=3D totalWrite; > ++ > ++ /* PE */ > ++ gcmkONERROR(gckOS_WriteRegisterEx(Hardware->os, Hardware->cor= e, 0x00470, ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 23= :16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 23:16) - (0 ? 23= :16) + 1))))))) << (0 ? 23:16))) | (((gctUINT32) ((gctUINT32) (0) & ((gct= UINT32) ((((1 ? 23:16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 = ? 23:16) - (0 ? 23:16) + 1))))))) << (0 ? 23:16)))));gcmkONERROR(gckOS_Re= adRegisterEx(Hardware->os, Hardware->core, 0x00454, &colorKilled)); > ++ gcmkONERROR(gckOS_WriteRegisterEx(Hardware->os, Hardware->cor= e, 0x00470, ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 23= :16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 23:16) - (0 ? 23= :16) + 1))))))) << (0 ? 23:16))) | (((gctUINT32) ((gctUINT32) (1) & ((gct= UINT32) ((((1 ? 23:16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 = ? 23:16) - (0 ? 23:16) + 1))))))) << (0 ? 23:16)))));gcmkONERROR(gckOS_Re= adRegisterEx(Hardware->os, Hardware->core, 0x00454, &depthKilled)); > ++ gcmkONERROR(gckOS_WriteRegisterEx(Hardware->os, Hardware->cor= e, 0x00470, ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 23= :16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 23:16) - (0 ? 23= :16) + 1))))))) << (0 ? 23:16))) | (((gctUINT32) ((gctUINT32) (2) & ((gct= UINT32) ((((1 ? 23:16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 = ? 23:16) - (0 ? 23:16) + 1))))))) << (0 ? 23:16)))));gcmkONERROR(gckOS_Re= adRegisterEx(Hardware->os, Hardware->core, 0x00454, &colorDrawn)); > ++ gcmkONERROR(gckOS_WriteRegisterEx(Hardware->os, Hardware->cor= e, 0x00470, ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 23= :16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 23:16) - (0 ? 23= :16) + 1))))))) << (0 ? 23:16))) | (((gctUINT32) ((gctUINT32) (3) & ((gct= UINT32) ((((1 ? 23:16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 = ? 23:16) - (0 ? 23:16) + 1))))))) << (0 ? 23:16)))));gcmkONERROR(gckOS_Re= adRegisterEx(Hardware->os, Hardware->core, 0x00454, &depthDrawn)); > ++ > ++ profiler->pe_pixel_count_killed_by_color_pipe +=3D colorKille= d; > ++ profiler->pe_pixel_count_killed_by_depth_pipe +=3D depthKille= d; > ++ profiler->pe_pixel_count_drawn_by_color_pipe +=3D colorDrawn; > ++ profiler->pe_pixel_count_drawn_by_depth_pipe +=3D depthDrawn; > ++ } > ++ > ++ /* Reset clock control register. */ > ++ gcmkONERROR(gckOS_WriteRegisterEx(Hardware->os, > ++ Hardware->core, > ++ 0x00000, > ++ clock)); > ++ > ++ if(Reset){ > + /* Reset counters. */ > + gcmkONERROR( > + gckOS_WriteRegisterEx(Hardware->os, Hardware->core, 0= x0003C, 1)); > +@@ -4903,19 +5016,10 @@ gckHARDWARE_QueryProfileRegisters( > + gckOS_WriteRegisterEx(Hardware->os, Hardware->core, 0= x00438, 0)); > + gcmkONERROR( > + gckOS_WriteRegisterEx(Hardware->os, Hardware->core, 0= x00078, 0)); > +- } > +- /* PE */ > +- gcmkONERROR(gckOS_WriteRegisterEx(Hardware->os, Hardware->core, 0= x00470, ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 23:1= 6) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 23:16) - (0 ? 23:1= 6) + 1))))))) << (0 ? 23:16))) | (((gctUINT32) ((gctUINT32) (0) & ((gctUI= NT32) ((((1 ? 23:16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? = 23:16) - (0 ? 23:16) + 1))))))) << (0 ? 23:16))) )); > +-gcmkONERROR(gckOS_ReadRegisterEx(Hardware->os, Hardware->core, 0x0045= 4, &profiler->pe_pixel_count_killed_by_color_pipe)); > +- gcmkONERROR(gckOS_WriteRegisterEx(Hardware->os, Hardware->core, 0= x00470, ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 23:1= 6) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 23:16) - (0 ? 23:1= 6) + 1))))))) << (0 ? 23:16))) | (((gctUINT32) ((gctUINT32) (1) & ((gctUI= NT32) ((((1 ? 23:16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? = 23:16) - (0 ? 23:16) + 1))))))) << (0 ? 23:16))) )); > +-gcmkONERROR(gckOS_ReadRegisterEx(Hardware->os, Hardware->core, 0x0045= 4, &profiler->pe_pixel_count_killed_by_depth_pipe)); > +- gcmkONERROR(gckOS_WriteRegisterEx(Hardware->os, Hardware->core, 0= x00470, ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 23:1= 6) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 23:16) - (0 ? 23:1= 6) + 1))))))) << (0 ? 23:16))) | (((gctUINT32) ((gctUINT32) (2) & ((gctUI= NT32) ((((1 ? 23:16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? = 23:16) - (0 ? 23:16) + 1))))))) << (0 ? 23:16))) )); > +-gcmkONERROR(gckOS_ReadRegisterEx(Hardware->os, Hardware->core, 0x0045= 4, &profiler->pe_pixel_count_drawn_by_color_pipe)); > +- gcmkONERROR(gckOS_WriteRegisterEx(Hardware->os, Hardware->core, 0= x00470, ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 23:1= 6) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 23:16) - (0 ? 23:1= 6) + 1))))))) << (0 ? 23:16))) | (((gctUINT32) ((gctUINT32) (3) & ((gctUI= NT32) ((((1 ? 23:16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? = 23:16) - (0 ? 23:16) + 1))))))) << (0 ? 23:16))) )); > +-gcmkONERROR(gckOS_ReadRegisterEx(Hardware->os, Hardware->core, 0x0045= 4, &profiler->pe_pixel_count_drawn_by_depth_pipe)); > +- if(Reset){ gcmkONERROR(gckOS_WriteRegisterEx(Hardware->os, Ha= rdware->core, 0x00470, ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT3= 2) ((((1 ? 23:16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 23:= 16) - (0 ? 23:16) + 1))))))) << (0 ? 23:16))) | (((gctUINT32) ((gctUINT32= ) (15) & ((gctUINT32) ((((1 ? 23:16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 := (~(~0 << ((1 ? 23:16) - (0 ? 23:16) + 1))))))) << (0 ? 23:16))) )); > ++ gcmkONERROR(gckOS_WriteRegisterEx(Hardware->os, Hardware-= >core, 0x00470, ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((= 1 ? 23:16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 23:16) - (= 0 ? 23:16) + 1))))))) << (0 ? 23:16))) | (((gctUINT32) ((gctUINT32) (15) = & ((gctUINT32) ((((1 ? 23:16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 = << ((1 ? 23:16) - (0 ? 23:16) + 1))))))) << (0 ? 23:16))) )); > + gcmkONERROR(gckOS_WriteRegisterEx(Hardware->os, Hardware->core, 0x004= 70, ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 23:16) -= (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 23:16) - (0 ? 23:16) += 1))))))) << (0 ? 23:16))) | (((gctUINT32) ((gctUINT32) (0) & ((gctUINT32= ) ((((1 ? 23:16) - (0 ? 23:16) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 23:1= 6) - (0 ? 23:16) + 1))))))) << (0 ? 23:16))) > +-)); } > ++)); > ++ } > + > + /* SH */ > + gcmkONERROR(gckOS_WriteRegisterEx(Hardware->os, Hardware->core, 0= x00470, ((((gctUINT32) (0)) & ~(((gctUINT32) (((gctUINT32) ((((1 ? 31:2= 4) - (0 ? 31:24) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? 31:24) - (0 ? 31:2= 4) + 1))))))) << (0 ? 31:24))) | (((gctUINT32) ((gctUINT32) (7) & ((gctUI= NT32) ((((1 ? 31:24) - (0 ? 31:24) + 1) =3D=3D 32) ? ~0 : (~(~0 << ((1 ? = 31:24) - (0 ? 31:24) + 1))))))) << (0 ? 31:24))) )); > +diff --git a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_ha= rdware.h b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardwar= e.h > +index 517b35c..37226b7 100644 > +--- a/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.= h > ++++ b/drivers/mxc/gpu-viv/arch/XAQ2/hal/kernel/gc_hal_kernel_hardware.= h > +@@ -90,6 +90,8 @@ struct _gckHARDWARE > + #if gcdLINK_QUEUE_SIZE > + struct _gckLINKQUEUE linkQueue; > + #endif > ++ > ++ gctBOOL powerManagement; > + }; > + > + gceSTATUS > +diff --git a/drivers/mxc/gpu-viv/config b/drivers/mxc/gpu-viv/config > +index 1196efa..cdd143e 100644 > +--- a/drivers/mxc/gpu-viv/config > ++++ b/drivers/mxc/gpu-viv/config > +@@ -22,7 +22,6 @@ > + ARCH_TYPE ?=3D arm > + SDK_DIR ?=3D $(AQROOT)/build/sdk > + USE_3D_VG ?=3D 1 > +-USE_POWER_MANAGEMENT ?=3D 1 > + FORCE_ALL_VIDEO_MEMORY_CACHED ?=3D 0 > + NONPAGED_MEMORY_CACHEABLE ?=3D 0 > + NONPAGED_MEMORY_BUFFERABLE ?=3D 1 > +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 7964585..b7b0d28 100644 > +--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c > ++++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c > +@@ -904,9 +904,6 @@ gckKERNEL_Dispatch( > + gctSIGNAL signal; > + #endif > + > +- gcsDATABASE_RECORD record; > +- gctPOINTER data; > +- > + gcmkHEADER_ARG("Kernel=3D0x%x FromUser=3D%d Interface=3D0x%x", > + Kernel, FromUser, Interface); > + > +@@ -1940,249 +1937,133 @@ gckKERNEL_Dispatch( > + #endif > + > + case gcvHAL_GET_SHARED_INFO: > +- bytes =3D (gctSIZE_T) Interface->u.GetSharedInfo.size; > +- > +- if (Interface->u.GetSharedInfo.dataId !=3D 0) > ++ if (Interface->u.GetSharedInfo.data =3D=3D gcvNULL) > + { > +- gcmkONERROR(gckKERNEL_FindProcessDB(Kernel, > +- Interface->u.GetSharedInfo.pid, > +- 0, > +- gcvDB_SHARED_INFO, > +- gcmINT2PTR(Interface->u.GetSharedInfo.dataId)= , > +- &record)); > +- > +- /* find a record in db, check size */ > +- if (record.bytes !=3D bytes) > +- { > +- /* Size change is not allowed */ > +- gcmkONERROR(gcvSTATUS_INVALID_DATA); > +- } > +- > +- /* fetch data */ > +- gcmkONERROR(gckOS_CopyToUserData( > +- Kernel->os, > +- record.physical, > +- gcmUINT64_TO_PTR(Interface->u.GetSharedInfo.data), > +- bytes > +- )); > +- > ++ gcmkONERROR(gcvSTATUS_INVALID_ARGUMENT); > + } > +- > +- if ((node =3D gcmUINT64_TO_PTR(Interface->u.GetSharedInfo.nod= e)) !=3D gcvNULL) > ++ else > + { > +- switch (Interface->u.GetSharedInfo.infoType) > +- { > +- case gcvVIDMEM_INFO_GENERIC: > +- { /* Generic data stored */ > +- if (node->VidMem.memory->object.type =3D=3D g= cvOBJ_VIDMEM) > +- { > +- data =3D &node->VidMem.sharedInfo; > +- > +- } > +- else > +- { > +- data =3D &node->Virtual.sharedInfo; > +- } > ++ gctUINT32 pid =3D Interface->u.GetSharedInfo.pid; > ++ gctUINT32 dataId =3D Interface->u.GetSharedInfo.dataId; > ++ gctSIZE_T bytes =3D Interface->u.GetSharedInfo.bytes; > ++ gctPOINTER data =3D Interface->u.GetSharedInfo.data; > ++ gcsDATABASE_RECORD record; > + > +- gcmkONERROR(gckOS_CopyToUserData( > +- Kernel->os, > +- data, > +- gcmUINT64_TO_PTR(Interface->u.GetSharedI= nfo.nodeData), > +- sizeof(gcsVIDMEM_NODE_SHARED_INFO) > +- )); > +- } > +- break; > +- > +- case gcvVIDMEM_INFO_DIRTY_RECTANGLE: > +- { /* Dirty rectangle stored */ > +- gcsVIDMEM_NODE_SHARED_INFO *storedSharedInfo; > +- gcsVIDMEM_NODE_SHARED_INFO alignedSharedInfo; > +- > +- if (node->VidMem.memory->object.type =3D=3D g= cvOBJ_VIDMEM) > +- { > +- storedSharedInfo =3D &node->VidMem.shared= Info; > +- } > +- else > +- { > +- storedSharedInfo =3D &node->Virtual.share= dInfo; > +- } > +- > +- /* Stored shared info holds the unaligned dir= ty rectangle. > +- Align it first. = */ > +- > +- /* Hardware requires 64-byte aligned address,= and 16x4 pixel aligned rectsize. > +- We simply align to 32 pixels which covers = both 16- and 32-bpp formats. */ > +- > +- /* Make sure we have a legit rectangle. */ > +- gcmkASSERT((storedSharedInfo->RectSize.width = !=3D 0) && (storedSharedInfo->RectSize.height !=3D 0)); > +- > +- alignedSharedInfo.SrcOrigin.x =3D gcmALIGN_BA= SE(storedSharedInfo->SrcOrigin.x, 32); > +- alignedSharedInfo.RectSize.width =3D gcmALIGN= ((storedSharedInfo->RectSize.width + (storedSharedInfo->SrcOrigin.x - ali= gnedSharedInfo.SrcOrigin.x)), 16); > +- > +- alignedSharedInfo.SrcOrigin.y =3D gcmALIGN_BA= SE(storedSharedInfo->SrcOrigin.y, 4); > +- alignedSharedInfo.RectSize.height =3D gcmALIG= N((storedSharedInfo->RectSize.height + (storedSharedInfo->SrcOrigin.y - a= lignedSharedInfo.SrcOrigin.y)), 4); > +- > +- gcmkONERROR(gckOS_CopyToUserData( > +- Kernel->os, > +- &alignedSharedInfo, > +- gcmUINT64_TO_PTR(Interface->u.GetSharedIn= fo.nodeData), > +- sizeof(gcsVIDMEM_NODE_SHARED_INFO) > +- )); > +- > +- gcmkTRACE_ZONE(gcvLEVEL_VERBOSE, gcvZONE_KERN= EL, > +- "Node =3D %p, unaligned recta= ngle (l=3D%d, t=3D%d, w=3D%d, h=3D%d) aligned to (l=3D%d, t=3D%d, w=3D%d,= h=3D%d)", node, > +- storedSharedInfo->SrcOrigin.x= , storedSharedInfo->SrcOrigin.y, > +- storedSharedInfo->RectSize.wi= dth, storedSharedInfo->RectSize.height, > +- alignedSharedInfo.SrcOrigin.x= , alignedSharedInfo.SrcOrigin.y, > +- alignedSharedInfo.RectSize.wi= dth, alignedSharedInfo.RectSize.height); > ++ /* Find record. */ > ++ gcmkONERROR( > ++ gckKERNEL_FindProcessDB(Kernel, > ++ pid, > ++ 0, > ++ gcvDB_SHARED_INFO, > ++ gcmINT2PTR(dataId), > ++ &record)); > ++ > ++ /* Check memory size. */ > ++ if (bytes < record.bytes) > ++ { > ++ /* Insufficient memory to hold shared data. */ > ++ gcmkONERROR(gcvSTATUS_INVALID_ARGUMENT); > ++ } > + > +- /* Rectangle */ > +- storedSharedInfo->SrcOrigin.x =3D > +- storedSharedInfo->SrcOrigin.y =3D > +- storedSharedInfo->RectSize.width =3D > +- storedSharedInfo->RectSize.height =3D 0; > +- } > +- break; > +- } > ++ /* Copy to user. */ > ++ status =3D gckOS_CopyToUserData(Kernel->os, > ++ record.physical, > ++ data, > ++ record.bytes); > ++ > ++ /* > ++ * Remove from process db. > ++ * Every time when shared info is taken, the record is er= ased in > ++ * kernel side. > ++ */ > ++ gcmkVERIFY_OK( > ++ gckKERNEL_RemoveProcessDB(Kernel, > ++ pid, > ++ gcvDB_SHARED_INFO, > ++ gcmINT2PTR(dataId))); > ++ /* Free existed data. */ > ++ gcmkVERIFY_OK( > ++ gckOS_FreeMemory(Kernel->os, record.physical)); > + } > + break; > + > + case gcvHAL_SET_SHARED_INFO: > +- bytes =3D (gctSIZE_T) Interface->u.SetSharedInfo.size; > +- > +- if (Interface->u.SetSharedInfo.dataId !=3D 0) > + { > +- status =3D gckKERNEL_FindProcessDB(Kernel, processID, 0, > +- gcvDB_SHARED_INFO, > +- gcmINT2PTR(Interface->u.SetSharedInfo.dataId)= , > +- &record); > +- > +- if (status =3D=3D gcvSTATUS_INVALID_DATA) > +- { > +- /* private data has not been created yet */ > +- /* Note: we count on DestoryProcessDB to free it */ > +- gcmkONERROR(gckOS_AllocateMemory( > +- Kernel->os, > +- bytes, > +- &data > +- )); > +- > +- gcmkONERROR( > +- gckKERNEL_AddProcessDB(Kernel, processID, > +- gcvDB_SHARED_INFO, > +- gcmINT2PTR(Interface->u.SetSharedInfo.dataId)= , > +- data, > +- bytes > +- )); > +- } > +- else > ++ gctUINT32 dataId =3D Interface->u.SetSharedInfo.dataId; > ++ gctPOINTER data =3D Interface->u.SetSharedInfo.data; > ++ gctUINT32 bytes =3D Interface->u.SetSharedInfo.bytes; > ++ gctPOINTER memory =3D gcvNULL; > ++ gcsDATABASE_RECORD record; > ++ > ++ if (gcmIS_SUCCESS(gckKERNEL_FindProcessDB(Kernel, > ++ processID, > ++ 0, > ++ gcvDB_SHARED_INF= O, > ++ gcmINT2PTR(dataI= d), > ++ &record))) > + { > +- /* bail on other errors */ > +- gcmkONERROR(status); > +- > +- /* find a record in db, check size */ > +- if (record.bytes !=3D bytes) > ++ /* Find a record with the same id. */ > ++ if (bytes !=3D record.bytes) > + { > +- /* Size change is not allowed */ > +- gcmkONERROR(gcvSTATUS_INVALID_DATA); > ++ /* Remove from process db. */ > ++ gcmkVERIFY_OK( > ++ gckKERNEL_RemoveProcessDB(Kernel, > ++ processID, > ++ gcvDB_SHARED_INFO, > ++ gcmINT2PTR(dataId))= ); > ++ > ++ /* Free existed data. */ > ++ gcmkVERIFY_OK( > ++ gckOS_FreeMemory(Kernel->os, record.physical)= ); > + } > +- > +- /* get storage address */ > +- data =3D record.physical; > +- } > +- > +- gcmkONERROR(gckOS_CopyFromUserData( > +- Kernel->os, > +- data, > +- gcmUINT64_TO_PTR(Interface->u.SetSharedInfo.data), > +- bytes > +- )); > +- } > +- > +- if ((node =3D gcmUINT64_TO_PTR(Interface->u.SetSharedInfo.nod= e)) !=3D gcvNULL) > +- { > +- switch (Interface->u.SetSharedInfo.infoType) > ++ else > + { > +- case gcvVIDMEM_INFO_GENERIC: > +- { /* Generic data stored */ > +- if (node->VidMem.memory->object.type =3D=3D g= cvOBJ_VIDMEM) > +- { > +- data =3D &node->VidMem.sharedInfo; > +- } > +- else > +- { > +- data =3D &node->Virtual.sharedInfo; > +- } > +- > +- gcmkONERROR(gckOS_CopyFromUserData( > +- Kernel->os, > +- data, > +- gcmUINT64_TO_PTR(Interface->u.SetSharedIn= fo.nodeData), > +- sizeof(gcsVIDMEM_NODE_SHARED_INFO) > +- )); > +- } > +- break; > ++ /* Re-use allocated memory. */ > ++ memory =3D record.physical; > ++ } > ++ } > + > +- case gcvVIDMEM_INFO_DIRTY_RECTANGLE: > +- { /* Dirty rectangle stored */ > +- gcsVIDMEM_NODE_SHARED_INFO newSharedInfo; > +- gcsVIDMEM_NODE_SHARED_INFO *currentSharedInfo= ; > +- gctINT dirtyX, dirtyY, right, bottom; > +- > +- /* Expand the dirty rectangle stored in the n= ode to include the rectangle passed in. */ > +- gcmkONERROR(gckOS_CopyFromUserData( > +- Kernel->os, > +- &newSharedInfo, > +- gcmUINT64_TO_PTR(Interface->u.SetSharedIn= fo.nodeData), > +- gcmSIZEOF(gcsVIDMEM_NODE_SHARED_INFO) > +- )); > +- > +- if (node->VidMem.memory->object.type =3D=3D g= cvOBJ_VIDMEM) > +- { > +- currentSharedInfo =3D &node->VidMem.share= dInfo; > +- } > +- else > +- { > +- currentSharedInfo =3D &node->Virtual.shar= edInfo; > +- } > ++ if ((data =3D=3D gcvNULL) || (bytes =3D=3D 0)) > ++ { > ++ /* Nothing to record. */ > ++ break; > ++ } > + > +- gcmkTRACE_ZONE(gcvLEVEL_VERBOSE, gcvZONE_KERN= EL, "Node =3D %p Stored rectangle (l=3D%d, t=3D%d, w=3D%d, h=3D%d)", node= , > +- currentSharedInfo->SrcOrigin.= x, currentSharedInfo->SrcOrigin.y, > +- currentSharedInfo->RectSize.w= idth, currentSharedInfo->RectSize.height); > ++ if (bytes > 1024) > ++ { > ++ /* Limite data size. */ > ++ gcmkONERROR(gcvSTATUS_TOO_COMPLEX); > ++ } > + > +- gcmkTRACE_ZONE(gcvLEVEL_VERBOSE, gcvZONE_KERN= EL, "To combine with (l=3D%d, t=3D%d, w=3D%d, h=3D%d)", > +- newSharedInfo.SrcOrigin.x, ne= wSharedInfo.SrcOrigin.y, > +- newSharedInfo.RectSize.width,= newSharedInfo.RectSize.height); > ++ if (memory =3D=3D gcvNULL) > ++ { > ++ /* Allocate memory for holding shared data. */ > ++ gcmkONERROR( > ++ gckOS_AllocateMemory(Kernel->os, bytes, &memory))= ; > + > +- if ((currentSharedInfo->RectSize.width =3D=3D= 0) || (currentSharedInfo->RectSize.height =3D=3D 0)) > +- { /* Setting it for the first time */ > +- currentSharedInfo->SrcOrigin.x =3D newSha= redInfo.SrcOrigin.x; > +- currentSharedInfo->SrcOrigin.y =3D newSha= redInfo.SrcOrigin.y; > +- currentSharedInfo->RectSize.width =3D new= SharedInfo.RectSize.width; > +- currentSharedInfo->RectSize.height =3D ne= wSharedInfo.RectSize.height; > +- } > +- else > +- { > +- /* Expand the stored rectangle to include= newly locked rectangle */ > +- dirtyX =3D (newSharedInfo.SrcOrigin.x < c= urrentSharedInfo->SrcOrigin.x) ? newSharedInfo.SrcOrigin.x : currentShare= dInfo->SrcOrigin.x; > +- right =3D gcmMAX((currentSharedInfo->SrcO= rigin.x + currentSharedInfo->RectSize.width), (newSharedInfo.SrcOrigin.x = + newSharedInfo.RectSize.width)); > +- currentSharedInfo->RectSize.width =3D rig= ht - dirtyX; > +- currentSharedInfo->SrcOrigin.x =3D dirtyX= ; > +- > +- dirtyY =3D (newSharedInfo.SrcOrigin.y < c= urrentSharedInfo->SrcOrigin.y) ? newSharedInfo.SrcOrigin.y : currentShare= dInfo->SrcOrigin.y; > +- bottom =3D gcmMAX((currentSharedInfo->Src= Origin.y + currentSharedInfo->RectSize.height), (newSharedInfo.SrcOrigin.= y + newSharedInfo.RectSize.height)); > +- currentSharedInfo->RectSize.height =3D bo= ttom - dirtyY; > +- currentSharedInfo->SrcOrigin.y =3D dirtyY= ; > +- } > ++ /* Add to process db. */ > ++ status =3D gckKERNEL_AddProcessDB(Kernel, > ++ processID, > ++ gcvDB_SHARED_INFO, > ++ gcmINT2PTR(dataId), > ++ memory, > ++ bytes); > + > +- gcmkTRACE_ZONE(gcvLEVEL_VERBOSE, gcvZONE_KERN= EL, "Combined rectangle (l=3D%d, t=3D%d, w=3D%d, h=3D%d)", > +- currentSharedInfo->SrcOrigin.x= , currentSharedInfo->SrcOrigin.y, > +- currentSharedInfo->RectSize.wi= dth, currentSharedInfo->RectSize.height); > +- } > ++ if (gcmIS_ERROR(status)) > ++ { > ++ /* Failed to add process db. Free allocated memor= y. */ > ++ gcmkVERIFY_OK(gckOS_FreeMemory(Kernel->os, memory= )); > + break; > + } > +- } > ++ } > + > ++ /* Copy shared data to kernel memory. */ > ++ gcmkONERROR( > ++ gckOS_CopyFromUserData(Kernel->os, > ++ memory, > ++ data, > ++ bytes)); > ++ } > + break; > + > + case gcvHAL_SET_FSCALE_VALUE: > +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 66ce0d1..9ee9ea1 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 > +@@ -2047,14 +2047,14 @@ gckCOMMAND_Commit( > + EventQueue =3D nextEventRecord; > + } > + > +-#if gcdPOWER_MANAGEMENT > +- if (Command->kernel->eventObj->queueHead =3D=3D gcvNULL) > ++ if (Command->kernel->eventObj->queueHead =3D=3D gcvNULL > ++ && Command->kernel->hardware->powerManagement =3D=3D gcvTRUE > ++ ) > + { > + /* Commit done event by which work thread knows all jobs done= . */ > + gcmkVERIFY_OK( > + gckEVENT_CommitDone(Command->kernel->eventObj, gcvKERNEL_= PIXEL)); > + } > +-#endif > + > + /* Submit events. */ > + status =3D gckEVENT_Submit(Command->kernel->eventObj, gcvTRUE, gc= vFALSE); > +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 9685a5d..76c1c10 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 > +@@ -1234,7 +1234,6 @@ _EventHandler_BusError( > + return gcvSTATUS_OK; > + } > + > +-#if gcdPOWER_MANAGEMENT > + /********************************************************************= **********\ > + ****************************** Power Stall Handler ******************= ************* > + \********************************************************************= **********/ > +@@ -1250,7 +1249,6 @@ _EventHandler_PowerStall( > + Kernel->command->powerStallSignal, > + gcvTRUE); > + } > +-#endif > + > + /********************************************************************= **********\ > + ******************************** Task Routines **********************= *********** > +@@ -1965,15 +1963,12 @@ gcmDECLARE_INTERRUPT_HANDLER(COMMAND, 0) > + ); > + } > + } > +-#if gcdPOWER_MANAGEMENT > + else > + { > +- > + status =3D gckVGHARDWARE_SetPowerManagementState( > + Kernel->command->hardware, gcvPOWER_I= DLE_BROADCAST > + ); > + } > +-#endif > + > + /* Break out of the loop. */ > + break; > +@@ -2848,7 +2843,7 @@ gckVGCOMMAND_Construct( > + _EventHandler_BusError > + )); > + > +-#if gcdPOWER_MANAGEMENT > ++ > + command->powerStallInt =3D 30; > + /* Enable the interrupt. */ > + gcmkERR_BREAK(gckVGINTERRUPT_Enable( > +@@ -2856,7 +2851,6 @@ gckVGCOMMAND_Construct( > + &command->powerStallInt, > + _EventHandler_PowerStall > + )); > +-#endif > + > + /************************************************************= *********** > + ** Task management initialization. > +@@ -3419,7 +3413,6 @@ gckVGCOMMAND_Commit( > + gcvINFINITE > + )); > + > +-#if gcdPOWER_MANAGEMENT > + status =3D gckVGHARDWARE_SetPowerManagementState( > + Command->hardware, gcvPOWER_ON_AUTO); > + > +@@ -3447,7 +3440,7 @@ gckVGCOMMAND_Commit( > + > + break; > + } > +-#endif > ++ > + gcmkERR_BREAK(_FlushMMU(Command)); > + > + do > +@@ -3676,10 +3669,9 @@ gckVGCOMMAND_Commit( > + } > + while (gcvFALSE); > + > +-#if gcdPOWER_MANAGEMENT > + gcmkVERIFY_OK(gckOS_ReleaseSemaphore( > + Command->os, Command->powerSemaphore)); > +-#endif > ++ > + /* Release the mutex. */ > + gcmkCHECK_STATUS(gckOS_ReleaseMutex( > + Command->os, > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c b/drive= rs/mxc/gpu-viv/hal/kernel/gc_hal_kernel_db.c > +index bc5f083..673d4f7 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 > +@@ -1303,9 +1303,9 @@ gckKERNEL_DestroyProcessDB( > + gcmPTR2INT(record->data), status); > + break; > + > +- case gcvDB_SHARED_INFO: > +- status =3D gckOS_FreeMemory(Kernel->os, recor= d->physical); > +- break; > ++ case gcvDB_SHARED_INFO: > ++ status =3D gckOS_FreeMemory(Kernel->os, record->physical)= ; > ++ break; > + > + default: > + gcmkTRACE_ZONE(gcvLEVEL_ERROR, gcvZONE_DATABASE, > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c b/driv= ers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_mmu.c > +index 43c9297..c7f67c7 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 > +@@ -97,6 +97,14 @@ static gcsMirrorPageTable_PTR mirrorPageTable =3D g= cvNULL; > + static gctPOINTER mirrorPageTableMutex =3D gcvNULL; > + #endif > + > ++typedef struct _gcsDynamicSpaceNode * gcsDynamicSpaceNode_PTR; > ++typedef struct _gcsDynamicSpaceNode > ++{ > ++ gctUINT32 start; > ++ gctINT32 entries; > ++} > ++gcsDynamicSpaceNode; > ++ > + static void > + _WritePageEntry( > + IN gctUINT32_PTR PageEntry, > +@@ -482,30 +490,117 @@ OnError: > + } > + > + static gceSTATUS > ++_FindDynamicSpace( > ++ IN gckMMU Mmu, > ++ OUT gcsDynamicSpaceNode_PTR *Array, > ++ OUT gctINT * Size > ++ ) > ++{ > ++ gceSTATUS status =3D gcvSTATUS_OK; > ++ gctPOINTER pointer =3D gcvNULL; > ++ gcsDynamicSpaceNode_PTR array =3D gcvNULL; > ++ gctINT size =3D 0; > ++ gctINT i =3D 0, nodeStart =3D -1, nodeEntries =3D 0; > ++ > ++ /* Allocate memory for the array. */ > ++ gcmkONERROR(gckOS_Allocate(Mmu->os, > ++ gcmSIZEOF(*array) * (gcdMMU_MTLB_ENTRY= _NUM / 2), > ++ &pointer)); > ++ > ++ array =3D (gcsDynamicSpaceNode_PTR)pointer; > ++ > ++ /* Loop all the entries. */ > ++ while (i < gcdMMU_MTLB_ENTRY_NUM) > ++ { > ++ if (!Mmu->mtlbLogical[i]) > ++ { > ++ if (nodeStart < 0) > ++ { > ++ /* This is the first entry of the dynamic space. */ > ++ nodeStart =3D i; > ++ nodeEntries =3D 1; > ++ } > ++ else > ++ { > ++ /* Other entries of the dynamic space. */ > ++ nodeEntries++; > ++ } > ++ } > ++ else if (nodeStart >=3D 0) > ++ { > ++ /* Save the previous node. */ > ++ array[size].start =3D nodeStart; > ++ array[size].entries =3D nodeEntries; > ++ size++; > ++ > ++ /* Reset the start. */ > ++ nodeStart =3D -1; > ++ nodeEntries =3D 0; > ++ } > ++ > ++ i++; > ++ } > ++ > ++ /* Save the previous node. */ > ++ if (nodeStart >=3D 0) > ++ { > ++ array[size].start =3D nodeStart; > ++ array[size].entries =3D nodeEntries; > ++ size++; > ++ } > ++ > ++#if gcdMMU_TABLE_DUMP > ++ for (i =3D 0; i < size; i++) > ++ { > ++ gckOS_Print("%s(%d): [%d]: start=3D%d, entries=3D%d.\n", > ++ __FUNCTION__, __LINE__, > ++ i, > ++ array[i].start, > ++ array[i].entries); > ++ } > ++#endif > ++ > ++ *Array =3D array; > ++ *Size =3D size; > ++ > ++ return gcvSTATUS_OK; > ++ > ++OnError: > ++ if (pointer !=3D gcvNULL) > ++ { > ++ gckOS_Free(Mmu->os, pointer); > ++ } > ++ > ++ return status; > ++} > ++ > ++static gceSTATUS > + _SetupDynamicSpace( > + IN gckMMU Mmu > + ) > + { > + gceSTATUS status; > +- gctINT i; > ++ gcsDynamicSpaceNode_PTR nodeArray =3D gcvNULL; > ++ gctINT i, nodeArraySize =3D 0; > + gctUINT32 physical; > +- gctINT numEntries; > ++ gctINT numEntries =3D 0; > + gctUINT32_PTR pageTable; > + gctBOOL acquired =3D gcvFALSE; > + > +- /* find the start of dynamic address space. */ > +- for (i =3D 0; i < gcdMMU_MTLB_ENTRY_NUM; i++) > ++ /* Find all the dynamic address space. */ > ++ gcmkONERROR(_FindDynamicSpace(Mmu, &nodeArray, &nodeArraySize)); > ++ > ++ /* TODO: We only use the largest one for now. */ > ++ for (i =3D 0; i < nodeArraySize; i++) > + { > +- if (!Mmu->mtlbLogical[i]) > ++ if (nodeArray[i].entries > numEntries) > + { > +- break; > ++ Mmu->dynamicMappingStart =3D nodeArray[i].start; > ++ numEntries =3D nodeArray[i].entries; > + } > + } > + > +- Mmu->dynamicMappingStart =3D i; > +- > +- /* Number of entries in Master TLB for dynamic mapping. */ > +- numEntries =3D gcdMMU_MTLB_ENTRY_NUM - i; > ++ gckOS_Free(Mmu->os, (gctPOINTER)nodeArray); > + > + Mmu->pageTableSize =3D numEntries * 4096; > + > +@@ -545,7 +640,9 @@ _SetupDynamicSpace( > + acquired =3D gcvTRUE; > + > + /* Map to Master TLB. */ > +- for (; i < gcdMMU_MTLB_ENTRY_NUM; i++) > ++ for (i =3D (gctINT)Mmu->dynamicMappingStart; > ++ i < (gctINT)Mmu->dynamicMappingStart + numEntries; > ++ i++) > + { > + _WritePageEntry(Mmu->mtlbLogical + i, > + physical > +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 8a442a2..8b8bbdc 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 > +@@ -2144,6 +2144,9 @@ gckVIDMEM_Unlock( > + > + if (!Node->Virtual.contiguous > + && (Node->Virtual.lockeds[Kernel->core] =3D=3D 1) > ++#if gcdENABLE_VG > ++ && (Kernel->vg =3D=3D gcvNULL) > ++#endif > + ) > + { > + if (Type =3D=3D gcvSURF_BITMAP) > +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 7077412..4406d7e 100644 > +--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h > ++++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal.h > +@@ -2072,6 +2072,12 @@ gckHARDWARE_QueryPowerManagementState( > + OUT gceCHIPPOWERSTATE* State > + ); > + > ++gceSTATUS > ++gckHARDWARE_SetPowerManagement( > ++ IN gckHARDWARE Hardware, > ++ IN gctBOOL PowerManagement > ++ ); > ++ > + #if gcdENABLE_FSCALE_VAL_ADJUST > + gceSTATUS > + gckHARDWARE_SetFscaleValue( > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h b/driver= s/mxc/gpu-viv/hal/kernel/inc/gc_hal_base.h > +index ac86399..44689b0 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 > +@@ -74,7 +74,6 @@ typedef struct _gcsSYNC_CONTEXT * gcsSYNC_CONT= EXT_PTR; > + /********************************************************************= **********\ > + ******************************* Process local storage ***************= ********** > + \********************************************************************= **********/ > +- > + typedef struct _gcsPLS * gcsPLS_PTR; > + typedef struct _gcsPLS > + { > +@@ -107,6 +106,7 @@ typedef struct _gcsPLS > + > + /* Reference count for destructor. */ > + gcsATOM_PTR reference; > ++ gctBOOL bKFS; > + #if gcdUSE_NPOT_PATCH > + gctBOOL bNeedSupportNP2Texture; > + #endif > +@@ -123,7 +123,7 @@ extern gcsPLS gcPLS; > + typedef struct _gcsTLS * gcsTLS_PTR; > + > + typedef void (* gctTLS_DESTRUCTOR) ( > +- gcsTLS_PTR TLS > ++ gcsTLS_PTR > + ); > + > + typedef struct _gcsTLS > +@@ -658,8 +658,6 @@ gcoHAL_QueryChipFeature( > + IN gceFEATURE Feature); > + > + #endif > +- > +- > + /********************************************************************= **********\ > + ********************************** gcoOS Object *********************= ************ > + \********************************************************************= **********/ > +@@ -1775,20 +1773,6 @@ gcoSURF_QueryVidMemNode( > + OUT gctUINT_PTR Bytes > + ); > + > +-/* Set usage attribute of a surface. */ > +-gceSTATUS > +-gcoSURF_SetUsage( > +- IN gcoSURF Surface, > +- IN gceSURF_USAGE Usage > +- ); > +- > +-/* Return usage attribute of a surface. */ > +-gceSTATUS > +-gcoSURF_QueryUsage( > +- IN gcoSURF Surface, > +- OUT gceSURF_USAGE *Usage > +- ); > +- > + /* Set the color type of the surface. */ > + gceSTATUS > + gcoSURF_SetColorType( > +@@ -1975,6 +1959,14 @@ gcoSURF_SetWindow( > + IN gctUINT Height > + ); > + > ++/* Set width/height alignment of the surface directly and calculate s= tride/size. This is only for dri backend now. Please be careful before us= e. */ > ++gceSTATUS > ++gcoSURF_SetAlignment( > ++ IN gcoSURF Surface, > ++ IN gctUINT Width, > ++ IN gctUINT Height > ++ ); > ++ > + /* Increase reference count of the surface. */ > + gceSTATUS > + gcoSURF_ReferenceSurface( > +@@ -2009,6 +2001,12 @@ gcoSURF_SetOffset( > + ); > + > + gceSTATUS > ++gcoSURF_GetOffset( > ++ IN gcoSURF Surface, > ++ OUT gctUINT *Offset > ++ ); > ++ > ++gceSTATUS > + gcoSURF_NODE_Cache( > + IN gcsSURF_NODE_PTR Node, > + IN gctPOINTER Logical, > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_compiler.h b/dr= ivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_compiler.h > +index 4a0870f..8693c37 100644 > +--- a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_compiler.h > ++++ b/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_compiler.h > +@@ -36,12 +36,16 @@ extern "C" { > + #endif > + > + #ifndef GC_ENABLE_LOADTIME_OPT > +-#define GC_ENABLE_LOADTIME_OPT 1 > ++#define GC_ENABLE_LOADTIME_OPT 1 > + #endif > + > + #define TEMP_OPT_CONSTANT_TEXLD_COORD 1 > + > +-#define TEMP_SHADER_PATCH 1 > ++#define TEMP_SHADER_PATCH 1 > ++ > ++#define ADD_PRE_ROTATION_TO_VS 0 > ++ > ++#define TEMP_INLINE_ALL_EXPANSION 1 > + /******************************* IR VERSION ******************/ > + #define gcdSL_IR_VERSION gcmCC('\0','\0','\0','\1') > + > +@@ -683,6 +687,13 @@ typedef enum _gceSHADER_FLAGS > + gcvSHADER_USE_ALPHA_KILL =3D 0x100, > + #endif > + > ++#if ADD_PRE_ROTATION_TO_VS > ++ gcvSHADER_VS_PRE_ROTATION =3D 0x200, > ++#endif > ++ > ++#if TEMP_INLINE_ALL_EXPANSION > ++ gcvSHADER_INLINE_ALL_EXPANSION =3D 0x200, > ++#endif > + } > + gceSHADER_FLAGS; > + > +@@ -771,10 +782,15 @@ typedef enum _gceSHADER_OPTIMIZATION > + /* optimize varying packing */ > + gcvOPTIMIZATION_VARYINGPACKING =3D 1 << 22, > + > ++#if TEMP_INLINE_ALL_EXPANSION > ++ gcvOPTIMIZATION_INLINE_ALL_EXPANSION =3D 1 << 23, > ++#endif > ++ > + /* Full optimization. */ > + /* Note that gcvOPTIMIZATION_LOAD_SW_WORKAROUND is off. */ > + gcvOPTIMIZATION_FULL =3D 0x7FFFFFFF & > + ~gcvOPTIMIZATION_LO= AD_SW_WORKAROUND & > ++ ~gcvOPTIMIZATION_IN= LINE_ALL_EXPANSION & > + ~gcvOPTIMIZATION_PO= WER_OPTIMIZATION, > + > + /* Optimization Unit Test flag. */ > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver.h b/driv= ers/mxc/gpu-viv/hal/kernel/inc/gc_hal_driver.h > +index 028bbd1..b056c52 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 > +@@ -210,6 +210,9 @@ typedef struct _gcsHAL_QUERY_CHIP_IDENTITY > + /* Supported minor feature 3 fields. */ > + gctUINT32 chipMinorFeatures3; > + > ++ /* Supported minor feature 4 fields. */ > ++ gctUINT32 chipMinorFeatures4; > ++ > + /* Number of streams supported. */ > + gctUINT32 streamCount; > + > +@@ -929,30 +932,30 @@ typedef struct _gcsHAL_INTERFACE > + > + struct _gcsHAL_GET_SHARED_INFO > + { > ++ /* Process id. */ > + IN gctUINT32 pid; > ++ > ++ /* Data id. */ > + IN gctUINT32 dataId; > +- /* gcuVIDMEM_NODE_PTR */ > +- IN gctUINT64 node; > +- /* gctUINT8_PTR */ > +- OUT gctUINT64 data; > +- /* fix size. gctUINT8_PTR*/ > +- OUT gctUINT64 nodeData; > +- gctUINT64 size; > +- IN gceVIDMEM_NODE_SHARED_INFO_TYPE infoType; > ++ > ++ /* Data size. */ > ++ IN gctSIZE_T bytes; > ++ > ++ /* Pointer to save the shared data. */ > ++ OUT gctPOINTER data; > + } > + GetSharedInfo; > + > + struct _gcsHAL_SET_SHARED_INFO > + { > ++ /* Data id. */ > + IN gctUINT32 dataId; > +- /* gcuVIDMEM_NODE_PTR */ > +- IN gctUINT64 node; > +- /* gctUINT8_PTR */ > +- IN gctUINT64 data; > +- /* gctUINT8_PTR */ > +- IN gctUINT64 nodeData; > +- IN gctUINT64 size; > +- IN gceVIDMEM_NODE_SHARED_INFO_TYPE infoType; > ++ > ++ /* Data to be shared. */ > ++ IN gctPOINTER data; > ++ > ++ /* Data size. */ > ++ IN gctSIZE_T bytes; > + } > + SetSharedInfo; > + > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h b/driv= ers/mxc/gpu-viv/hal/kernel/inc/gc_hal_engine.h > +index 249b61b..8481375 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 > +@@ -323,50 +323,6 @@ gcoSURF_Resolve( > + IN gcoSURF DestSurface > + ); > + > +-/* Export the render target. */ > +-gceSTATUS > +-gcoSURF_ExportRenderTarget( > +- IN gcoSURF SrcSurface > +-); > +- > +-/* Import the render target. */ > +-gceSTATUS > +-gcoSURF_ImportRenderTarget( > +- IN gctUINT32 Pid, > +- IN gcoSURF SrcSurface > +-); > +- > +-/* Save the Resolve info to kernel. */ > +-gceSTATUS > +-gcoSURF_PrepareRemoteResolveRect( > +- IN gcoSURF SrcSurface, > +- IN gcsPOINT_PTR SrcOrigin, > +- IN gcsPOINT_PTR DestOrigin, > +- IN gcsPOINT_PTR RectSize > +- ); > +- > +-/* Resolve using the rectangle info previously saved in the vid mem n= ode. */ > +-gceSTATUS > +-gcoSURF_ResolveFromStoredRect( > +- IN gcoSURF SrcSurface, > +- IN gcoSURF DestSurface > +- ); > +- > +-/* Using the info that Process Pid saved to do resolve. */ > +-gceSTATUS > +-gcoSURF_RemoteResolveRect( > +- IN gcoSURF SrcSurface, > +- IN gcoSURF DestSurface, > +- IN gctBOOL *resolveDiscarded > +- ); > +- > +-/* Return the "resolve submitted indicator" signal. */ > +-gceSTATUS > +-gcoSURF_GetRTSignal( > +- IN gcoSURF RTSurface, > +- OUT gctSIGNAL * resolveSubmittedSignal > +- ); > +- > + /* Resolve rectangular area of a surface. */ > + gceSTATUS > + gcoSURF_ResolveRect( > +@@ -1684,6 +1640,12 @@ gcoTEXTURE_IsRenderable( > + ); > + > + gceSTATUS > ++gcoTEXTURE_IsRenderableEx( > ++ IN gcoTEXTURE Texture, > ++ IN gctUINT Level > ++ ); > ++ > ++gceSTATUS > + gcoTEXTURE_IsComplete( > + IN gcoTEXTURE Texture, > + IN gctINT MaxLevel > +@@ -2028,21 +1990,15 @@ gceSTATUS > + gcoHAL_GetSharedInfo( > + IN gctUINT32 Pid, > + IN gctUINT32 DataId, > +- OUT gctUINT8_PTR Data, > + IN gctSIZE_T Bytes, > +- IN gctUINT64 Node, > +- OUT gctUINT8_PTR NodeData, > +- IN gceVIDMEM_NODE_SHARED_INFO_TYPE SharedInfoType > ++ OUT gctPOINTER Data > + ); > + > + gceSTATUS > + gcoHAL_SetSharedInfo( > + IN gctUINT32 DataId, > +- IN gctUINT8_PTR Data, > +- IN gctSIZE_T Bytes, > +- IN gctUINT64 Node, > +- IN gctUINT8_PTR NodeData, > +- IN gceVIDMEM_NODE_SHARED_INFO_TYPE SharedInfoType > ++ IN gctPOINTER Data, > ++ IN gctSIZE_T Bytes > + ); > + > + #ifdef __cplusplus > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h b/driver= s/mxc/gpu-viv/hal/kernel/inc/gc_hal_enum.h > +index cf6b425..a1d9ae5 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 > +@@ -181,13 +181,6 @@ typedef enum _gceCACHEOPERATION > + } > + gceCACHEOPERATION; > + > +-typedef enum _gceVIDMEM_NODE_SHARED_INFO_TYPE > +-{ > +- gcvVIDMEM_INFO_GENERIC, > +- gcvVIDMEM_INFO_DIRTY_RECTANGLE > +-} > +-gceVIDMEM_NODE_SHARED_INFO_TYPE; > +- > + /* Surface types. */ > + typedef enum _gceSURF_TYPE > + { > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h b/dri= vers/mxc/gpu-viv/hal/kernel/inc/gc_hal_options.h > +index afe83d0..9e2a8db 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 > +@@ -391,15 +391,6 @@ > + #endif > + > + /* > +- gcdPOWER_MANAGEMENT > +- > +- This define enables the power management code. > +-*/ > +-#ifndef gcdPOWER_MANAGEMENT > +-# define gcdPOWER_MANAGEMENT 1 > +-#endif > +- > +-/* > + gcdPOWER_SUSNPEND_WHEN_IDLE > + > + Set to 1 to make GPU enter gcvPOWER_SUSPEND when idle detecte= d, > +@@ -428,7 +419,7 @@ > + If the value is 0, no timeout will be checked for. > + */ > + #ifndef gcdGPU_TIMEOUT > +-# if gcdFPGA_BUILD > ++#if gcdFPGA_BUILD > + # define gcdGPU_TIMEOUT 0 > + # else > + # define gcdGPU_TIMEOUT 20000 > +@@ -726,31 +717,13 @@ > + > + Support swap with a specific rectangle. > + > +- Set the rectangle with eglSetSwapRectangleANDROID api. > ++ Set the rectangle with eglSetSwapRectangleVIV api. > + */ > + #ifndef gcdSUPPORT_SWAP_RECTANGLE > + # define gcdSUPPORT_SWAP_RECTANGLE 0 > + #endif > + > + /* > +- gcdDEFER_RESOLVES > +- > +- Support deferred resolves for 3D apps. > +-*/ > +-#ifndef gcdDEFER_RESOLVES > +-# define gcdDEFER_RESOLVES 0 > +-#endif > +- > +-/* > +- gcdCOPYBLT_OPTIMIZATION > +- > +- Combine dirty areas resulting from Android's copyBlt. > +-*/ > +-#ifndef gcdCOPYBLT_OPTIMIZATION > +-# define gcdCOPYBLT_OPTIMIZATION 0 > +-#endif > +- > +-/* > + gcdGPU_LINEAR_BUFFER_ENABLED > + > + Use linear buffer for GPU apps so HWC can do 2D composition. > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h b/dri= vers/mxc/gpu-viv/hal/kernel/inc/gc_hal_version.h > +index 808fde0..03cb4d6 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 > +@@ -28,7 +28,7 @@ > + > + #define gcvVERSION_PATCH 9 > + > +-#define gcvVERSION_BUILD 4651 > ++#define gcvVERSION_BUILD 6622 > + > + #define gcvVERSION_DATE __DATE__ > + > +diff --git a/drivers/mxc/gpu-viv/hal/kernel/inc/gc_hal_vg.h b/drivers/= mxc/gpu-viv/hal/kernel/inc/gc_hal_vg.h > +index 5ff0281..2a910e8 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 > +@@ -552,6 +552,12 @@ gckVGHARDWARE_QueryPowerManagementState( > + ); > + > + gceSTATUS > ++gckVGHARDWARE_SetPowerManagement( > ++ IN gckVGHARDWARE Hardware, > ++ IN gctBOOL PowerManagement > ++ ); > ++ > ++gceSTATUS > + gckVGHARDWARE_SetPowerOffTimeout( > + IN gckVGHARDWARE Hardware, > + IN gctUINT32 Timeout > +diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_dev= ice.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.c > +index 7168f0e..168987a 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 > +@@ -304,6 +304,7 @@ gckGALDEVICE_Construct( > + IN gctINT Signal, > + IN gctUINT LogFileSize, > + IN struct device *pdev, > ++ IN gctINT PowerManagement, > + OUT gckGALDEVICE *Device > + ) > + { > +@@ -538,6 +539,9 @@ gckGALDEVICE_Construct( > + device->kernels[gcvCORE_MAJOR]->hardware, FastClear, Comp= ression > + )); > + > ++ gcmkONERROR(gckHARDWARE_SetPowerManagement( > ++ device->kernels[gcvCORE_MAJOR]->hardware, PowerManagement > ++ )); > + > + #if COMMAND_PROCESSOR_VERSION =3D=3D 1 > + /* Start the command queue. */ > +@@ -593,6 +597,10 @@ gckGALDEVICE_Construct( > + device > + )); > + > ++ gcmkONERROR(gckHARDWARE_SetPowerManagement( > ++ device->kernels[gcvCORE_2D]->hardware, PowerManagement > ++ )); > ++ > + #if COMMAND_PROCESSOR_VERSION =3D=3D 1 > + /* Start the command queue. */ > + gcmkONERROR(gckCOMMAND_Start(device->kernels[gcvCORE_2D]->com= mand)); > +@@ -624,6 +632,11 @@ gckGALDEVICE_Construct( > + device->coreMapping[gcvHARDWARE_VG] =3D gcvCORE_VG; > + } > + > ++ > ++ gcmkONERROR(gckVGHARDWARE_SetPowerManagement( > ++ device->kernels[gcvCORE_VG]->vg->hardware, > ++ PowerManagement > ++ )); > + #endif > + } > + else > +diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_dev= ice.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_device.h > +index 460f022..d488fc8 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 > +@@ -169,6 +169,7 @@ gceSTATUS gckGALDEVICE_Construct( > + IN gctINT Signal, > + IN gctUINT LogFileSize, > + IN struct device *pdev, > ++ IN gctINT PowerManagement, > + OUT gckGALDEVICE *Device > + ); > + > +diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_dri= ver.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > +index 64cace1..183000d 100644 > +--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > ++++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > +@@ -131,6 +131,9 @@ module_param(fastClear, int, 0644); > + static int compression =3D -1; > + module_param(compression, int, 0644); > + > ++static int powerManagement =3D 1; > ++module_param(powerManagement, int, 0644); > ++ > + static int signal =3D 48; > + module_param(signal, int, 0644); > + > +@@ -781,6 +784,9 @@ static int drv_init(struct device *pdev) > + } > + #endif > + > ++ printk(KERN_INFO "Galcore version %d.%d.%d.%d\n", > ++ gcvVERSION_MAJOR, gcvVERSION_MINOR, gcvVERSION_PATCH, gcvVERS= ION_BUILD); > ++ > + if (showArgs) > + { > + printk("galcore options:\n"); > +@@ -810,7 +816,8 @@ static int drv_init(struct device *pdev) > + printk(" signal =3D %d\n", signal); > + printk(" baseAddress =3D 0x%08lX\n", baseAddress); > + printk(" physSize =3D 0x%08lX\n", physSize); > +- printk(" logFileSize =3D %d KB \n", logFileSize); > ++ printk(" logFileSize =3D %d KB \n", logFileSize); > ++ printk(" powerManagement =3D %d\n", powerManagement); > + #if ENABLE_GPU_CLOCK_BY_DRIVER > + printk(" coreClock =3D %lu\n", coreClock); > + #endif > +@@ -833,6 +840,7 @@ static int drv_init(struct device *pdev) > + bankSize, fastClear, compression, baseAddress, physSize, sign= al, > + logFileSize, > + pdev, > ++ powerManagement, > + &device > + )); > + > +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 dfbc699..6a0295d 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 > +@@ -55,6 +55,7 @@ const char * _PLATFORM =3D "\n\0$PLATFORM$Linux$\n"; > + #endif > + > + #define USER_SIGNAL_TABLE_LEN_INIT 64 > ++#define gcdSUPPRESS_OOM_MESSAGE 1 > + > + #define MEMORY_LOCK(os) \ > + gcmkVERIFY_OK(gckOS_AcquireMutex( \ > +@@ -85,6 +86,12 @@ const char * _PLATFORM =3D "\n\0$PLATFORM$Linux$\n"= ; > + #define gcmkNONPAGED_MEMROY_PROT(x) pgprot_noncached(x) > + #endif > + > ++#if gcdSUPPRESS_OOM_MESSAGE > ++#define gcdNOWARN __GFP_NOWARN > ++#else > ++#define gcdNOWARN 0 > ++#endif > ++ > + #define gcdINFINITE_TIMEOUT (60 * 1000) > + #define gcdDETECT_TIMEOUT 0 > + #define gcdDETECT_DMA_ADDRESS 1 > +@@ -261,7 +268,7 @@ _CreateMdl( > + > + gcmkHEADER_ARG("ProcessID=3D%d", ProcessID); > + > +- mdl =3D (PLINUX_MDL)kzalloc(sizeof(struct _LINUX_MDL), GFP_KERNEL= | __GFP_NOWARN); > ++ mdl =3D (PLINUX_MDL)kzalloc(sizeof(struct _LINUX_MDL), GFP_KERNEL= | gcdNOWARN); > + if (mdl =3D=3D gcvNULL) > + { > + gcmkFOOTER_NO(); > +@@ -322,7 +329,7 @@ _CreateMdlMap( > + > + gcmkHEADER_ARG("Mdl=3D0x%X ProcessID=3D%d", Mdl, ProcessID); > + > +- mdlMap =3D (PLINUX_MDL_MAP)kmalloc(sizeof(struct _LINUX_MDL_MAP),= GFP_KERNEL | __GFP_NOWARN); > ++ mdlMap =3D (PLINUX_MDL_MAP)kmalloc(sizeof(struct _LINUX_MDL_MAP),= GFP_KERNEL | gcdNOWARN); > + if (mdlMap =3D=3D gcvNULL) > + { > + gcmkFOOTER_NO(); > +@@ -481,7 +488,7 @@ _NonContiguousAlloc( > + > + size =3D NumPages * sizeof(struct page *); > + > +- pages =3D kmalloc(size, GFP_KERNEL | __GFP_NOWARN); > ++ pages =3D kmalloc(size, GFP_KERNEL | gcdNOWARN); > + > + if (!pages) > + { > +@@ -496,7 +503,7 @@ _NonContiguousAlloc( > + > + for (i =3D 0; i < NumPages; i++) > + { > +- p =3D alloc_page(GFP_KERNEL | __GFP_HIGHMEM | __GFP_NOWARN); > ++ p =3D alloc_page(GFP_KERNEL | __GFP_HIGHMEM | gcdNOWARN); > + > + if (!p) > + { > +@@ -762,7 +769,7 @@ _AllocateIntegerId( > + int result; > + > + again: > +- if (idr_pre_get(&Database->idr, GFP_KERNEL | __GFP_NOWARN) =3D=3D= 0) > ++ if (idr_pre_get(&Database->idr, GFP_KERNEL | gcdNOWARN) =3D=3D 0) > + { > + return gcvSTATUS_OUT_OF_MEMORY; > + } > +@@ -954,7 +961,7 @@ gckOS_Construct( > + gcmkVERIFY_ARGUMENT(Os !=3D gcvNULL); > + > + /* Allocate the gckOS object. */ > +- os =3D (gckOS) kmalloc(gcmSIZEOF(struct _gckOS), GFP_KERNEL | __G= FP_NOWARN); > ++ os =3D (gckOS) kmalloc(gcmSIZEOF(struct _gckOS), GFP_KERNEL | gcd= NOWARN); > + > + if (os =3D=3D gcvNULL) > + { > +@@ -1171,7 +1178,7 @@ _CreateKernelVirtualMapping( > + > + if (Mdl->contiguous) > + { > +- pages =3D kmalloc(sizeof(struct page *) * numPages, GFP_KERNE= L | __GFP_NOWARN); > ++ pages =3D kmalloc(sizeof(struct page *) * numPages, GFP_KERNE= L | gcdNOWARN); > + > + if (!pages) > + { > +@@ -1385,7 +1392,7 @@ gckOS_AllocateMemory( > + } > + else > + { > +- memory =3D (gctPOINTER) kmalloc(Bytes, GFP_KERNEL | __GFP_NOW= ARN); > ++ memory =3D (gctPOINTER) kmalloc(Bytes, GFP_KERNEL | gcdNOWARN= ); > + } > + > + if (memory =3D=3D gcvNULL) > +@@ -1904,7 +1911,7 @@ gckOS_AllocateNonPagedMemory( > + addr =3D dma_alloc_coherent(gcvNULL, > + mdl->numPages * PAGE_SIZE, > + &mdl->dmaHandle, > +- GFP_KERNEL | __GFP_NOWARN); > ++ GFP_KERNEL | gcdNOWARN); > + } > + #else > + size =3D mdl->numPages * PAGE_SIZE; > +@@ -1915,7 +1922,7 @@ gckOS_AllocateNonPagedMemory( > + if (page =3D=3D gcvNULL) > + #endif > + { > +- page =3D alloc_pages(GFP_KERNEL | __GFP_NOWARN, order); > ++ page =3D alloc_pages(GFP_KERNEL | gcdNOWARN, order); > + } > + > + if (page =3D=3D gcvNULL) > +@@ -3848,6 +3855,9 @@ gckOS_AllocatePagedMemoryEx( > + gctSIZE_T bytes; > + gctBOOL locked =3D gcvFALSE; > + gceSTATUS status; > ++#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2, 6, 27) > ++ gctPOINTER addr =3D gcvNULL; > ++#endif > + > + gcmkHEADER_ARG("Os=3D0x%X Contiguous=3D%d Bytes=3D%lu", Os, Conti= guous, Bytes); > + > +@@ -3873,13 +3883,27 @@ gckOS_AllocatePagedMemoryEx( > + { > + /* Get contiguous pages, and suppress warning (stack dump) fr= om kernel when > + we run out of memory. */ > +- mdl->u.contiguousPages =3D > +- alloc_pages(GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY, Ge= tOrder(numPages)); > ++#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2, 6, 27) > ++ addr =3D > ++ alloc_pages_exact(numPages * PAGE_SIZE, GFP_KERNEL | gcdN= OWARN | __GFP_NORETRY); > + > ++ mdl->u.contiguousPages =3D addr > ++ ? virt_to_page(addr) > ++ : gcvNULL; > ++ > ++ mdl->exact =3D gcvTRUE; > ++#else > ++ mdl->u.contiguousPages =3D > ++ alloc_pages(GFP_KERNEL | gcdNOWARN | __GFP_NORETRY, GetOr= der(numPages)); > ++#endif > + if (mdl->u.contiguousPages =3D=3D gcvNULL) > + { > + mdl->u.contiguousPages =3D > +- alloc_pages(GFP_KERNEL | __GFP_HIGHMEM | __GFP_NOWARN= , GetOrder(numPages)); > ++ alloc_pages(GFP_KERNEL | __GFP_HIGHMEM | gcdNOWARN, G= etOrder(numPages)); > ++ > ++#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2, 6, 27) > ++ mdl->exact =3D gcvFALSE; > ++#endif > + } > + } > + else > +@@ -4024,7 +4048,16 @@ gckOS_FreePagedMemory( > + > + if (mdl->contiguous) > + { > +- __free_pages(mdl->u.contiguousPages, GetOrder(mdl->numPages))= ; > ++#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2, 6, 27) > ++ if (mdl->exact =3D=3D gcvTRUE) > ++ { > ++ free_pages_exact(page_address(mdl->u.contiguousPages), md= l->numPages * PAGE_SIZE); > ++ } > ++ else > ++#endif > ++ { > ++ __free_pages(mdl->u.contiguousPages, GetOrder(mdl->numPag= es)); > ++ } > + } > + else > + { > +@@ -4859,7 +4892,7 @@ gckOS_MapUserPointer( > + gcmkVERIFY_ARGUMENT(Size > 0); > + gcmkVERIFY_ARGUMENT(KernelPointer !=3D gcvNULL); > + > +- buf =3D kmalloc(Size, GFP_KERNEL | __GFP_NOWARN); > ++ buf =3D kmalloc(Size, GFP_KERNEL | gcdNOWARN); > + if (buf =3D=3D gcvNULL) > + { > + gcmkTRACE( > +@@ -5274,7 +5307,7 @@ OnError: > + MEMORY_MAP_LOCK(Os); > + > + /* Allocate the Info struct. */ > +- info =3D (gcsPageInfo_PTR)kmalloc(sizeof(gcsPageInfo), GFP_KE= RNEL | __GFP_NOWARN); > ++ info =3D (gcsPageInfo_PTR)kmalloc(sizeof(gcsPageInfo), GFP_KE= RNEL | gcdNOWARN); > + > + if (info =3D=3D gcvNULL) > + { > +@@ -5283,7 +5316,7 @@ OnError: > + } > + > + /* Allocate the array of page addresses. */ > +- pages =3D (struct page **)kmalloc(pageCount * sizeof(struct p= age *), GFP_KERNEL | __GFP_NOWARN); > ++ pages =3D (struct page **)kmalloc(pageCount * sizeof(struct p= age *), GFP_KERNEL | gcdNOWARN); > + > + if (pages =3D=3D gcvNULL) > + { > +@@ -6502,7 +6535,7 @@ gckOS_CreateSemaphore( > + gcmkVERIFY_ARGUMENT(Semaphore !=3D gcvNULL); > + > + /* Allocate the semaphore structure. */ > +- sem =3D (struct semaphore *)kmalloc(gcmSIZEOF(struct semaphore), = GFP_KERNEL | __GFP_NOWARN); > ++ sem =3D (struct semaphore *)kmalloc(gcmSIZEOF(struct semaphore), = GFP_KERNEL | gcdNOWARN); > + if (sem =3D=3D gcvNULL) > + { > + gcmkONERROR(gcvSTATUS_OUT_OF_MEMORY); > +@@ -6942,6 +6975,7 @@ gckOS_SetGPUPower( > + #else > + imx_gpc_power_up_pu(false); > + #endif > ++ > + } > + /* TODO: Put your code here. */ > + gcmkFOOTER_NO(); > +@@ -7255,7 +7289,7 @@ gckOS_CreateSignal( > + gcmkVERIFY_ARGUMENT(Signal !=3D gcvNULL); > + > + /* Create an event structure. */ > +- signal =3D (gcsSIGNAL_PTR) kmalloc(sizeof(gcsSIGNAL), GFP_KERNEL = | __GFP_NOWARN); > ++ signal =3D (gcsSIGNAL_PTR) kmalloc(sizeof(gcsSIGNAL), GFP_KERNEL = | gcdNOWARN); > + > + if (signal =3D=3D gcvNULL) > + { > +@@ -8000,7 +8034,7 @@ gckOS_CreateSemaphoreVG( > + do > + { > + /* Allocate the semaphore structure. */ > +- newSemaphore =3D (struct semaphore *)kmalloc(gcmSIZEOF(struct se= maphore), GFP_KERNEL | __GFP_NOWARN); > ++ newSemaphore =3D (struct semaphore *)kmalloc(gcmSIZEOF(struct se= maphore), GFP_KERNEL | gcdNOWARN); > + if (newSemaphore =3D=3D gcvNULL) > + { > + gcmkERR_BREAK(gcvSTATUS_OUT_OF_MEMORY); > +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 e970477..006632c 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 > +@@ -54,6 +54,9 @@ typedef struct _LINUX_MDL > + gctINT numPages; > + gctINT pagedMem; > + gctBOOL contiguous; > ++#if LINUX_VERSION_CODE >=3D KERNEL_VERSION(2, 6, 27) > ++ gctBOOL exact; > ++#endif > + dma_addr_t dmaHandle; > + PLINUX_MDL_MAP maps; > + struct _LINUX_MDL * prev; > +-- > +1.8.3.2 > + > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/0004-ENGR00271136-F= ix-build-break-when-CONFIG_CLK_DEBUG-i.patch b/recipes-kernel/linux/linux= -udoo-3.0.35/0004-ENGR00271136-Fix-build-break-when-CONFIG_CLK_DEBUG-i.pa= tch > new file mode 100644 > index 0000000..7316351 > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/0004-ENGR00271136-Fix-buil= d-break-when-CONFIG_CLK_DEBUG-i.patch > @@ -0,0 +1,43 @@ > +From d8601292ae25e0af47aa4486055221ab44113f0e Mon Sep 17 00:00:00 2001 > +From: Mahesh Mahadevan > +Date: Mon, 15 Jul 2013 15:34:54 -0500 > +Subject: [PATCH] ENGR00271136 Fix build break when CONFIG_CLK_DEBUG is > + disabled > +Organization: O.S. Systems Software LTDA. > + > +clk structure member name is defined only when CONFIG_CLK_DEBUG is ena= bled. > +Hence need to encapsulate the code with this config. > + > +Patch received from imx community: > +https://community.freescale.com/thread/308482 > + > +Upstream-Status: Pending > + > +Signed-off-by: xiongweihuang > +Signed-off-by: Mahesh Mahadevan > +--- > + arch/arm/plat-mxc/clock.c | 4 ++-- > + 1 file changed, 2 insertions(+), 2 deletions(-) > + > +diff --git a/arch/arm/plat-mxc/clock.c b/arch/arm/plat-mxc/clock.c > +index 93347eb..1aa2664 100755 > +--- a/arch/arm/plat-mxc/clock.c > ++++ b/arch/arm/plat-mxc/clock.c > +@@ -58,12 +58,12 @@ static void __clk_disable(struct clk *clk) > + { > + if (clk =3D=3D NULL || IS_ERR(clk)) > + return; > +- > ++#ifdef CONFIG_CLK_DEBUG > + if (!clk->usecount) { > + WARN(1, "clock enable/disable mismatch! clk %s\n", clk->name); > + return; > + } > +- > ++#endif > + if (!(--clk->usecount)) { > + if (clk->disable) > + clk->disable(clk); > +-- > +1.8.4.rc3 > + > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/0005-ENGR00264275-G= PU-Correct-suspend-resume-calling-afte.patch b/recipes-kernel/linux/linux= -udoo-3.0.35/0005-ENGR00264275-GPU-Correct-suspend-resume-calling-afte.pa= tch > new file mode 100644 > index 0000000..fa937e4 > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/0005-ENGR00264275-GPU-Corr= ect-suspend-resume-calling-afte.patch > @@ -0,0 +1,61 @@ > +From a845abe4589366d3e37b5a646be6337984074b28 Mon Sep 17 00:00:00 2001 > +From: Loren HUANG > +Date: Wed, 22 May 2013 17:21:30 +0800 > +Subject: [PATCH 5/6] ENGR00264275 [GPU]Correct suspend/resume calling = after > + adding runtime pm. > + > +After enabling runtime pm the suspend/resume entry is changed. > + > +-Add new entry for suspend/resume in runtime pm frame work. > +-Add static define for all runtime pm function. > + > +Upstream-Status: Backport [3.5.7-1.0.0] > + > +Signed-off-by: Loren HUANG > +Acked-by: Lily Zhang > +--- > + .../gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c | 16 +++++++= +++++++-- > + 1 file changed, 14 insertions(+), 2 deletions(-) > + > +diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_dri= ver.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > +index 183000d..3632a6c 100644 > +--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > ++++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > +@@ -1252,20 +1252,32 @@ static const struct of_device_id mxs_gpu_dt_id= s[] =3D { > + MODULE_DEVICE_TABLE(of, mxs_gpu_dt_ids); > + > + #ifdef CONFIG_PM > +-int gpu_runtime_suspend(struct device *dev) > ++static int gpu_runtime_suspend(struct device *dev) > + { > + release_bus_freq(BUS_FREQ_HIGH); > + return 0; > + } > + > +-int gpu_runtime_resume(struct device *dev) > ++static int gpu_runtime_resume(struct device *dev) > + { > + request_bus_freq(BUS_FREQ_HIGH); > + return 0; > + } > + > ++static int gpu_system_suspend(struct device *dev) > ++{ > ++ pm_message_t state=3D{0}; > ++ return gpu_suspend(to_platform_device(dev), state); > ++} > ++ > ++static int gpu_system_resume(struct device *dev) > ++{ > ++ return gpu_resume(to_platform_device(dev)); > ++} > ++ > + static const struct dev_pm_ops gpu_pm_ops =3D { > + SET_RUNTIME_PM_OPS(gpu_runtime_suspend, gpu_runtime_resume, NULL) > ++ SET_SYSTEM_SLEEP_PM_OPS(gpu_system_suspend, gpu_system_resume) > + }; > + #endif > + #endif > +-- > +1.8.3.2 > + > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/0005-ENGR00271359-A= dd-Multi-touch-support.patch b/recipes-kernel/linux/linux-udoo-3.0.35/000= 5-ENGR00271359-Add-Multi-touch-support.patch > new file mode 100644 > index 0000000..cb20198 > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/0005-ENGR00271359-Add-Mult= i-touch-support.patch > @@ -0,0 +1,98 @@ > +From 538f4bb2f7a51f267395550a5be9f0ab2e426712 Mon Sep 17 00:00:00 2001 > +From: Erik Boto > +Date: Tue, 16 Jul 2013 12:06:05 -0500 > +Subject: [PATCH] ENGR00271359 Add Multi-touch support > +Organization: O.S. Systems Software LTDA. > + > +The previous behavior of the driver did not work properly with Qt5 > +QtQuick multi touch-point gestures, due to how touch-points are > +reported when removing a touch-point. My interpretation of the > +available documentation [1] was that the driver should report all > +touch-points between SYN_REPORTs, but it is not explicitly stated so. > +I've found another mail-thread [2] where the creator of the protocol > +states: > + > +"The protocol defines a generic way of sending a variable amount of > +contacts. The contact count is obtained by counting the number of > +non-empty finger packets between SYN_REPORT events."-Henrik Rydberg > + > +I think this verifies my assumption that all touch-points should be > +reported between SYN_REPORTs, otherwise it can not be used to obtain > +the count. > + > +[1] https://www.kernel.org/doc/Documentation/input/multi-touch-protoco= l.txt > +[2] http://lists.x.org/archives/xorg-devel/2010-March/006466.html > + > +Upstream-Status: Pending > + > +Signed-off-by: Erik Boto > +Signed-off-by: Mahesh Mahadevan > +(cherry picked from commit 7cba001c5a502680f6dbf902821726779a9c9287) > +--- > + drivers/input/touchscreen/egalax_ts.c | 36 +++++++++++++++++---------= --------- > + 1 file changed, 18 insertions(+), 18 deletions(-) > + > +diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/tou= chscreen/egalax_ts.c > +index 0b6cde7..271f820 100644 > +--- a/drivers/input/touchscreen/egalax_ts.c > ++++ b/drivers/input/touchscreen/egalax_ts.c > +@@ -133,7 +133,6 @@ retry: > + } > + > + if (down) { > +- /* should also report old pointers */ > + events[id].valid =3D valid; > + events[id].status =3D down; > + events[id].x =3D x; > +@@ -144,23 +143,6 @@ retry: > + input_report_abs(input_dev, ABS_Y, y); > + input_event(data->input_dev, EV_KEY, BTN_TOUCH, 1); > + input_report_abs(input_dev, ABS_PRESSURE, 1); > +-#else > +- for (i =3D 0; i < MAX_SUPPORT_POINTS; i++) { > +- if (!events[i].valid) > +- continue; > +- dev_dbg(&client->dev, "report id:%d valid:%d x:%d y:%d", > +- i, valid, x, y); > +- > +- input_report_abs(input_dev, > +- ABS_MT_TRACKING_ID, i); > +- input_report_abs(input_dev, > +- ABS_MT_TOUCH_MAJOR, 1); > +- input_report_abs(input_dev, > +- ABS_MT_POSITION_X, events[i].x); > +- input_report_abs(input_dev, > +- ABS_MT_POSITION_Y, events[i].y); > +- input_mt_sync(input_dev); > +- } > + #endif > + } else { > + dev_dbg(&client->dev, "release id:%d\n", id); > +@@ -176,6 +158,24 @@ retry: > + #endif > + } > + > ++#ifndef CONFIG_TOUCHSCREEN_EGALAX_SINGLE_TOUCH > ++ /* report all pointers */ > ++ for (i =3D 0; i < MAX_SUPPORT_POINTS; i++) { > ++ if (!events[i].valid) > ++ continue; > ++ dev_dbg(&client->dev, "report id:%d valid:%d x:%d y:%d", > ++ i, valid, x, y); > ++ input_report_abs(input_dev, > ++ ABS_MT_TRACKING_ID, i); > ++ input_report_abs(input_dev, > ++ ABS_MT_TOUCH_MAJOR, 1); > ++ input_report_abs(input_dev, > ++ ABS_MT_POSITION_X, events[i].x); > ++ input_report_abs(input_dev, > ++ ABS_MT_POSITION_Y, events[i].y); > ++ input_mt_sync(input_dev); > ++ } > ++#endif > + input_sync(input_dev); > + return IRQ_HANDLED; > + } > +-- > +1.8.4.rc3 > + > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/0006-Add-support-fo= r-DVI-monitors.patch b/recipes-kernel/linux/linux-udoo-3.0.35/0006-Add-su= pport-for-DVI-monitors.patch > new file mode 100644 > index 0000000..00a6b5c > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/0006-Add-support-for-DVI-m= onitors.patch > @@ -0,0 +1,227 @@ > +From 3e6441d113f72b412081a2c87f39011e4c253a35 Mon Sep 17 00:00:00 2001 > +From: Robert Winkler > +Date: Fri, 19 Jul 2013 19:00:41 -0700 > +Subject: [PATCH] Add support for DVI monitors > +Organization: O.S. Systems Software LTDA. > + > +Upstream-Status: Pending > + > +Signed-off-by: Robert Winkler > +--- > + arch/arm/plat-mxc/include/mach/mxc_hdmi.h | 7 +++ > + drivers/video/mxc_hdmi.c | 98 +++++++++++++---------= --------- > + 2 files changed, 49 insertions(+), 56 deletions(-) > + > +diff --git a/arch/arm/plat-mxc/include/mach/mxc_hdmi.h b/arch/arm/plat= -mxc/include/mach/mxc_hdmi.h > +index 94f7638..af59c62 100644 > +--- a/arch/arm/plat-mxc/include/mach/mxc_hdmi.h > ++++ b/arch/arm/plat-mxc/include/mach/mxc_hdmi.h > +@@ -605,6 +605,10 @@ enum { > + HDMI_IH_MUTE_PHY_STAT0_TX_PHY_LOCK =3D 0x2, > + HDMI_IH_MUTE_PHY_STAT0_HPD =3D 0x1, > + > ++/* IH and IH_MUTE convenience macro RX_SENSE | HPD*/ > ++ HDMI_DVI_IH_STAT =3D 0x3D, > ++ > ++ > + /* IH_AHBDMAAUD_STAT0 field values */ > + HDMI_IH_AHBDMAAUD_STAT0_ERROR =3D 0x20, > + HDMI_IH_AHBDMAAUD_STAT0_LOST =3D 0x10, > +@@ -903,6 +907,9 @@ enum { > + HDMI_PHY_HPD =3D 0x02, > + HDMI_PHY_TX_PHY_LOCK =3D 0x01, > + > ++/* HDMI STAT convenience RX_SENSE | HPD */ > ++ HDMI_DVI_STAT =3D 0xF2, > ++ > + /* PHY_I2CM_SLAVE_ADDR field values */ > + HDMI_PHY_I2CM_SLAVE_ADDR_PHY_GEN2 =3D 0x69, > + HDMI_PHY_I2CM_SLAVE_ADDR_HEAC_PHY =3D 0x49, > +diff --git a/drivers/video/mxc_hdmi.c b/drivers/video/mxc_hdmi.c > +index c5069aa..544f352 100644 > +--- a/drivers/video/mxc_hdmi.c > ++++ b/drivers/video/mxc_hdmi.c > +@@ -180,7 +180,6 @@ struct mxc_hdmi { > + bool dft_mode_set; > + char *dft_mode_str; > + int default_bpp; > +- u8 latest_intr_stat; > + bool irq_enabled; > + spinlock_t irq_lock; > + bool phy_enabled; > +@@ -1996,58 +1995,48 @@ static void hotplug_worker(struct work_struct = *work) > + struct delayed_work *delay_work =3D to_delayed_work(work); > + struct mxc_hdmi *hdmi =3D > + container_of(delay_work, struct mxc_hdmi, hotplug_work); > +- u32 phy_int_stat, phy_int_pol, phy_int_mask; > +- u8 val; > ++ u32 hdmi_phy_stat0, hdmi_phy_pol0, hdmi_phy_mask0; > + unsigned long flags; > + char event_string[32]; > + char *envp[] =3D { event_string, NULL }; > + > +- phy_int_stat =3D hdmi->latest_intr_stat; > +- phy_int_pol =3D hdmi_readb(HDMI_PHY_POL0); > + > +- dev_dbg(&hdmi->pdev->dev, "phy_int_stat=3D0x%x, phy_int_pol=3D0x%x\n= ", > +- phy_int_stat, phy_int_pol); > ++ hdmi_phy_stat0 =3D hdmi_readb(HDMI_PHY_STAT0); > ++ hdmi_phy_pol0 =3D hdmi_readb(HDMI_PHY_POL0); > ++ > ++ dev_dbg(&hdmi->pdev->dev, "hdmi_phy_stat0=3D0x%x, hdmi_phy_pol0=3D0x= %x\n", > ++ hdmi_phy_stat0, hdmi_phy_pol0); > ++ > ++ /* Make HPD intr active low to capture unplug event or > ++ * active high to capture plugin event */ > ++ hdmi_writeb((HDMI_DVI_STAT & ~hdmi_phy_stat0), HDMI_PHY_POL0); > + > + /* check cable status */ > +- if (phy_int_stat & HDMI_IH_PHY_STAT0_HPD) { > +- /* cable connection changes */ > +- if (phy_int_pol & HDMI_PHY_HPD) { > +- /* Plugin event */ > +- dev_dbg(&hdmi->pdev->dev, "EVENT=3Dplugin\n"); > +- mxc_hdmi_cable_connected(hdmi); > +- > +- /* Make HPD intr active low to capture unplug event */ > +- val =3D hdmi_readb(HDMI_PHY_POL0); > +- val &=3D ~HDMI_PHY_HPD; > +- hdmi_writeb(val, HDMI_PHY_POL0); > +- > +- sprintf(event_string, "EVENT=3Dplugin"); > +- kobject_uevent_env(&hdmi->pdev->dev.kobj, KOBJ_CHANGE, envp); > ++ if (hdmi_phy_stat0 & HDMI_DVI_STAT) { > ++ /* Plugin event */ > ++ dev_dbg(&hdmi->pdev->dev, "EVENT=3Dplugin\n"); > ++ mxc_hdmi_cable_connected(hdmi); > ++ > ++ sprintf(event_string, "EVENT=3Dplugin"); > ++ kobject_uevent_env(&hdmi->pdev->dev.kobj, KOBJ_CHANGE, envp); > + #ifdef CONFIG_MXC_HDMI_CEC > +- mxc_hdmi_cec_handle(0x80); > ++ mxc_hdmi_cec_handle(0x80); > + #endif > +- hdmi_set_cable_state(1); > +- > +- } else if (!(phy_int_pol & HDMI_PHY_HPD)) { > +- /* Plugout event */ > +- dev_dbg(&hdmi->pdev->dev, "EVENT=3Dplugout\n"); > +- hdmi_set_cable_state(0); > +- mxc_hdmi_abort_stream(); > +- mxc_hdmi_cable_disconnected(hdmi); > ++ hdmi_set_cable_state(1); > + > +- /* Make HPD intr active high to capture plugin event */ > +- val =3D hdmi_readb(HDMI_PHY_POL0); > +- val |=3D HDMI_PHY_HPD; > +- hdmi_writeb(val, HDMI_PHY_POL0); > ++ } else { > ++ /* Plugout event */ > ++ dev_dbg(&hdmi->pdev->dev, "EVENT=3Dplugout\n"); > ++ hdmi_set_cable_state(0); > ++ mxc_hdmi_abort_stream(); > ++ mxc_hdmi_cable_disconnected(hdmi); > + > +- sprintf(event_string, "EVENT=3Dplugout"); > +- kobject_uevent_env(&hdmi->pdev->dev.kobj, KOBJ_CHANGE, envp); > ++ sprintf(event_string, "EVENT=3Dplugout"); > ++ kobject_uevent_env(&hdmi->pdev->dev.kobj, KOBJ_CHANGE, envp); > + #ifdef CONFIG_MXC_HDMI_CEC > +- mxc_hdmi_cec_handle(0x100); > ++ mxc_hdmi_cec_handle(0x100); > + #endif > + > +- } else > +- dev_dbg(&hdmi->pdev->dev, "EVENT=3Dnone?\n"); > + } > + > + /* Lock here to ensure full powerdown sequence > +@@ -2055,12 +2044,12 @@ static void hotplug_worker(struct work_struct = *work) > + spin_lock_irqsave(&hdmi->irq_lock, flags); > + > + /* Re-enable HPD interrupts */ > +- phy_int_mask =3D hdmi_readb(HDMI_PHY_MASK0); > +- phy_int_mask &=3D ~HDMI_PHY_HPD; > +- hdmi_writeb(phy_int_mask, HDMI_PHY_MASK0); > ++ hdmi_phy_mask0 =3D hdmi_readb(HDMI_PHY_MASK0); > ++ hdmi_phy_mask0 &=3D ~HDMI_DVI_STAT; > ++ hdmi_writeb(hdmi_phy_mask0, HDMI_PHY_MASK0); > + > + /* Unmute interrupts */ > +- hdmi_writeb(~HDMI_IH_MUTE_PHY_STAT0_HPD, HDMI_IH_MUTE_PHY_STAT0); > ++ hdmi_writeb(~HDMI_DVI_IH_STAT, HDMI_IH_MUTE_PHY_STAT0); > + > + if (hdmi_readb(HDMI_IH_FC_STAT2) & HDMI_IH_FC_STAT2_OVERFLOW_MASK) > + mxc_hdmi_clear_overflow(); > +@@ -2086,7 +2075,7 @@ static void hdcp_hdp_worker(struct work_struct *= work) > + static irqreturn_t mxc_hdmi_hotplug(int irq, void *data) > + { > + struct mxc_hdmi *hdmi =3D data; > +- u8 val, intr_stat; > ++ u8 val; > + unsigned long flags; > + > + spin_lock_irqsave(&hdmi->irq_lock, flags); > +@@ -2108,25 +2097,22 @@ static irqreturn_t mxc_hdmi_hotplug(int irq, v= oid *data) > + * HDMI registers. > + */ > + /* Capture status - used in hotplug_worker ISR */ > +- intr_stat =3D hdmi_readb(HDMI_IH_PHY_STAT0); > +- > +- if (intr_stat & HDMI_IH_PHY_STAT0_HPD) { > ++ if (hdmi_readb(HDMI_IH_PHY_STAT0) & HDMI_DVI_IH_STAT) { > + > + dev_dbg(&hdmi->pdev->dev, "Hotplug interrupt received\n"); > +- hdmi->latest_intr_stat =3D intr_stat; > + > + /* Mute interrupts until handled */ > + > + val =3D hdmi_readb(HDMI_IH_MUTE_PHY_STAT0); > +- val |=3D HDMI_IH_MUTE_PHY_STAT0_HPD; > ++ val |=3D HDMI_DVI_IH_STAT; > + hdmi_writeb(val, HDMI_IH_MUTE_PHY_STAT0); > + > + val =3D hdmi_readb(HDMI_PHY_MASK0); > +- val |=3D HDMI_PHY_HPD; > ++ val |=3D HDMI_DVI_STAT; > + hdmi_writeb(val, HDMI_PHY_MASK0); > + > + /* Clear Hotplug interrupts */ > +- hdmi_writeb(HDMI_IH_PHY_STAT0_HPD, HDMI_IH_PHY_STAT0); > ++ hdmi_writeb(HDMI_DVI_IH_STAT, HDMI_IH_PHY_STAT0); > + > + schedule_delayed_work(&(hdmi->hotplug_work), msecs_to_jiffies(20)); > + } > +@@ -2282,13 +2268,13 @@ static void mxc_hdmi_fb_registered(struct mxc_= hdmi *hdmi) > + HDMI_PHY_I2CM_CTLINT_ADDR); > + > + /* enable cable hot plug irq */ > +- hdmi_writeb((u8)~HDMI_PHY_HPD, HDMI_PHY_MASK0); > ++ hdmi_writeb((u8)~HDMI_DVI_STAT, HDMI_PHY_MASK0); > + > + /* Clear Hotplug interrupts */ > +- hdmi_writeb(HDMI_IH_PHY_STAT0_HPD, HDMI_IH_PHY_STAT0); > ++ hdmi_writeb(HDMI_DVI_IH_STAT, HDMI_IH_PHY_STAT0); > + > + /* Unmute interrupts */ > +- hdmi_writeb(~HDMI_IH_MUTE_PHY_STAT0_HPD, HDMI_IH_MUTE_PHY_STAT0); > ++ hdmi_writeb(~HDMI_DVI_IH_STAT, HDMI_IH_MUTE_PHY_STAT0); > + > + hdmi->fb_reg =3D true; > + > +@@ -2522,10 +2508,10 @@ static int mxc_hdmi_disp_init(struct mxc_dispd= rv_handle *disp, > + > + /* Configure registers related to HDMI interrupt > + * generation before registering IRQ. */ > +- hdmi_writeb(HDMI_PHY_HPD, HDMI_PHY_POL0); > ++ hdmi_writeb(HDMI_DVI_STAT, HDMI_PHY_POL0); > + > + /* Clear Hotplug interrupts */ > +- hdmi_writeb(HDMI_IH_PHY_STAT0_HPD, HDMI_IH_PHY_STAT0); > ++ hdmi_writeb(HDMI_DVI_IH_STAT, HDMI_IH_PHY_STAT0); > + > + hdmi->nb.notifier_call =3D mxc_hdmi_fb_event; > + ret =3D fb_register_client(&hdmi->nb); > +-- > +1.8.4.rc3 > + > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/0006-ENGR00265130-g= pu-Correct-section-mismatch-in-gpu-ker.patch b/recipes-kernel/linux/linux= -udoo-3.0.35/0006-ENGR00265130-gpu-Correct-section-mismatch-in-gpu-ker.pa= tch > new file mode 100644 > index 0000000..43407a1 > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/0006-ENGR00265130-gpu-Corr= ect-section-mismatch-in-gpu-ker.patch > @@ -0,0 +1,60 @@ > +From 376d63e9b981118f83646a836ce6626e541de1a3 Mon Sep 17 00:00:00 2001 > +From: Loren HUANG > +Date: Fri, 31 May 2013 18:29:58 +0800 > +Subject: [PATCH 6/6] ENGR00265130 gpu:Correct section mismatch in gpu = kernel > + driver > + > +-Remove the __devinit for suspend/resume function. > +-Replace __devinit to __devexit for remove function. > + > +Upstream-Status: Backport [3.5.7-1.0.0] > + > +Signed-off-by: Loren HUANG > +Acked-by: Lily Zhang > +--- > + drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c | 8 ++= ++---- > + 1 file changed, 4 insertions(+), 4 deletions(-) > + > +diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_dri= ver.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > +index 3632a6c..9d9dc57 100644 > +--- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > ++++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_driver.c > +@@ -1111,7 +1111,7 @@ static int __devinit gpu_probe(struct platform_d= evice *pdev) > + return ret; > + } > + > +-static int __devinit gpu_remove(struct platform_device *pdev) > ++static int __devexit gpu_remove(struct platform_device *pdev) > + { > + gcmkHEADER(); > + #if gcdENABLE_FSCALE_VAL_ADJUST > +@@ -1123,7 +1123,7 @@ static int __devinit gpu_remove(struct platform_= device *pdev) > + return 0; > + } > + > +-static int __devinit gpu_suspend(struct platform_device *dev, pm_mess= age_t state) > ++static int gpu_suspend(struct platform_device *dev, pm_message_t stat= e) > + { > + gceSTATUS status; > + gckGALDEVICE device; > +@@ -1173,7 +1173,7 @@ static int __devinit gpu_suspend(struct platform= _device *dev, pm_message_t state > + return 0; > + } > + > +-static int __devinit gpu_resume(struct platform_device *dev) > ++static int gpu_resume(struct platform_device *dev) > + { > + gceSTATUS status; > + gckGALDEVICE device; > +@@ -1284,7 +1284,7 @@ static const struct dev_pm_ops gpu_pm_ops =3D { > + > + static struct platform_driver gpu_driver =3D { > + .probe =3D gpu_probe, > +- .remove =3D gpu_remove, > ++ .remove =3D __devexit_p(gpu_remove), > + > + .suspend =3D gpu_suspend, > + .resume =3D gpu_resume, > +-- > +1.8.3.2 > + > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/0007-ARM-mach-mx6-b= oard-mx6q_sabresd-Register-SDHC3-first.patch b/recipes-kernel/linux/linux= -udoo-3.0.35/0007-ARM-mach-mx6-board-mx6q_sabresd-Register-SDHC3-first.pa= tch > new file mode 100644 > index 0000000..d02aa40 > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/0007-ARM-mach-mx6-board-mx= 6q_sabresd-Register-SDHC3-first.patch > @@ -0,0 +1,38 @@ > +From cd31abbe08372fa870fac78ae845edd4859f8835 Mon Sep 17 00:00:00 2001 > +From: Fabio Estevam > +Date: Sat, 28 Sep 2013 18:46:18 -0300 > +Subject: [PATCH] ARM: mach-mx6: board-mx6q_sabresd: Register SDHC3 fir= st > +Organization: O.S. Systems Software LTDA. > + > +On sabresd boards we boot from SDHC3, so let's register it as mmc0. > + > +Currently eMMC is mmc0 and mmc1 can be SDHC3 or SDHC2 (if present). > + > +Registering SDHC3 is safer as we can always find the rootfs. > + > +Signed-off-by: Fabio Estevam > +--- > + arch/arm/mach-mx6/board-mx6q_sabresd.c | 5 +---- > + 1 file changed, 1 insertion(+), 4 deletions(-) > + > +diff --git a/arch/arm/mach-mx6/board-mx6q_sabresd.c b/arch/arm/mach-mx= 6/board-mx6q_sabresd.c > +index 3f9a845..4e6b323 100644 > +--- a/arch/arm/mach-mx6/board-mx6q_sabresd.c > ++++ b/arch/arm/mach-mx6/board-mx6q_sabresd.c > +@@ -1847,12 +1847,9 @@ static void __init mx6_sabresd_board_init(void) > + > + imx6q_add_pm_imx(0, &mx6q_sabresd_pm_data); > + > +- /* Move sd4 to first because sd4 connect to emmc. > +- Mfgtools want emmc is mmcblk0 and other sd card is mmcblk1. > +- */ > ++ imx6q_add_sdhci_usdhc_imx(2, &mx6q_sabresd_sd3_data); > + imx6q_add_sdhci_usdhc_imx(3, &mx6q_sabresd_sd4_data); > + imx6q_add_sdhci_usdhc_imx(1, &mx6q_sabresd_sd2_data); > +- imx6q_add_sdhci_usdhc_imx(2, &mx6q_sabresd_sd3_data); > + imx_add_viv_gpu(&imx6_gpu_data, &imx6q_gpu_pdata); > + imx6q_sabresd_init_usb(); > + /* SATA is not supported by MX6DL/Solo */ > +-- > +1.8.4.rc3 > + > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/defconfig b/recipes= -kernel/linux/linux-udoo-3.0.35/defconfig > new file mode 100644 > index 0000000..6eb1443 > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/defconfig > @@ -0,0 +1,246 @@ > +CONFIG_EXPERIMENTAL=3Dy > +CONFIG_LOCALVERSION=3D"-3.0.35-unico" > +CONFIG_SYSVIPC=3Dy > +CONFIG_RCU_FANOUT=3D32 > +CONFIG_IKCONFIG=3Dy > +CONFIG_IKCONFIG_PROC=3Dy > +CONFIG_LOG_BUF_SHIFT=3D14 > +CONFIG_EMBEDDED=3Dy > +CONFIG_MODULES=3Dy > +CONFIG_MODULE_UNLOAD=3Dy > +CONFIG_MODULE_FORCE_UNLOAD=3Dy > +CONFIG_MODVERSIONS=3Dy > +# CONFIG_BLK_DEV_BSG is not set > +CONFIG_NO_HZ=3Dy > +CONFIG_HIGH_RES_TIMERS=3Dy > +CONFIG_SMP=3Dy > +CONFIG_NR_CPUS=3D4 > +CONFIG_PREEMPT=3Dy > +CONFIG_COMPACTION=3Dy > +CONFIG_KSM=3Dy > +# CONFIG_SECCOMP is not set > +CONFIG_SUSPEND_DEVICE_TIME_DEBUG=3Dy > +CONFIG_PM_RUNTIME=3Dy > +CONFIG_PM_DEBUG=3Dy > +CONFIG_CPU_FREQ=3Dy > +CONFIG_CPU_FREQ_DEFAULT_GOV_INTERACTIVE=3Dy > +CONFIG_CPU_FREQ_GOV_PERFORMANCE=3Dy > +CONFIG_CPU_FREQ_GOV_POWERSAVE=3Dy > +CONFIG_CPU_FREQ_GOV_USERSPACE=3Dy > +CONFIG_CPU_FREQ_GOV_ONDEMAND=3Dy > +CONFIG_CPU_FREQ_GOV_CONSERVATIVE=3Dy > +# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set > +CONFIG_NET=3Dy > +CONFIG_PACKET=3Dy > +CONFIG_UNIX=3Dy > +CONFIG_INET=3Dy > +CONFIG_IP_MULTICAST=3Dy > +CONFIG_IP_PNP=3Dy > +CONFIG_IP_PNP_DHCP=3Dy > +CONFIG_IP_PNP_BOOTP=3Dy > +# CONFIG_INET_LRO is not set > +# CONFIG_IPV6 is not set > +CONFIG_LLC2=3Dy > +CONFIG_CAN=3Dy > +CONFIG_CAN_RAW=3Dy > +CONFIG_CAN_BCM=3Dy > +CONFIG_CAN_VCAN=3Dy > +CONFIG_BT=3Dy > +CONFIG_BT_L2CAP=3Dy > +CONFIG_BT_SCO=3Dy > +CONFIG_BT_RFCOMM=3Dy > +CONFIG_BT_RFCOMM_TTY=3Dy > +CONFIG_BT_BNEP=3Dy > +CONFIG_BT_BNEP_MC_FILTER=3Dy > +CONFIG_BT_BNEP_PROTO_FILTER=3Dy > +CONFIG_BT_HIDP=3Dy > +CONFIG_BT_HCIBTUSB=3Dy > +CONFIG_BT_HCIUART=3Dy > +CONFIG_BT_HCIUART_ATH3K=3Dy > +CONFIG_BT_HCIVHCI=3Dy > +CONFIG_CFG80211=3Dy > +CONFIG_MAC80211=3Dy > +CONFIG_RFKILL=3Dy > +CONFIG_RFKILL_INPUT=3Dy > +CONFIG_UEVENT_HELPER_PATH=3D"/sbin/hotplug" > +CONFIG_DEVTMPFS=3Dy > +CONFIG_DEVTMPFS_MOUNT=3Dy > +CONFIG_CONNECTOR=3Dy > +CONFIG_MTD=3Dy > +CONFIG_MTD_CMDLINE_PARTS=3Dy > +CONFIG_MTD_CHAR=3Dy > +CONFIG_MTD_BLOCK=3Dy > +CONFIG_MTD_CFI=3Dy > +CONFIG_MTD_CFI_AMDSTD=3Dy > +CONFIG_MTD_PHYSMAP=3Dy > +CONFIG_MTD_M25P80=3Dy > +CONFIG_MTD_NAND=3Dy > +CONFIG_MTD_UBI=3Dy > +CONFIG_BLK_DEV_LOOP=3Dy > +CONFIG_MISC_DEVICES=3Dy > +CONFIG_BLK_DEV_SD=3Dy > +CONFIG_SCSI_MULTI_LUN=3Dy > +CONFIG_ATA=3Dy > +# CONFIG_SATA_PMP is not set > +CONFIG_SATA_AHCI=3Dy > +CONFIG_SATA_AHCI_PLATFORM=3Dy > +CONFIG_NETDEVICES=3Dy > +CONFIG_MII=3Dy > +CONFIG_PHYLIB=3Dy > +CONFIG_MICREL_PHY=3Dy > +CONFIG_NET_ETHERNET=3Dy > +# CONFIG_NETDEV_1000 is not set > +# CONFIG_NETDEV_10000 is not set > +CONFIG_ATH_COMMON=3Dm > +CONFIG_ATH6KL=3Dm > +CONFIG_HOSTAP=3Dy > +CONFIG_RT2X00=3Dy > +CONFIG_RT2800USB=3Dy > +CONFIG_RT2800USB_RT35XX=3Dy > +CONFIG_RT2800USB_RT53XX=3Dy > +CONFIG_RT2800USB_UNKNOWN=3Dy > +CONFIG_INPUT_POLLDEV=3Dy > +CONFIG_INPUT_EVDEV=3Dy > +CONFIG_KEYBOARD_GPIO=3Dy > +# CONFIG_INPUT_MOUSE is not set > +CONFIG_INPUT_TOUCHSCREEN=3Dy > +CONFIG_TOUCHSCREEN_EGALAX=3Dy > +CONFIG_TOUCHSCREEN_ELAN=3Dy > +CONFIG_TOUCHSCREEN_MAX11801=3Dy > +CONFIG_TOUCHSCREEN_TSC2006=3Dy > +CONFIG_INPUT_MISC=3Dy > +CONFIG_INPUT_UINPUT=3Dy > +CONFIG_INPUT_ISL29023=3Dy > +CONFIG_VT_HW_CONSOLE_BINDING=3Dy > +CONFIG_HW_RANDOM=3Dy > +CONFIG_I2C=3Dy > +CONFIG_I2C_CHARDEV=3Dy > +CONFIG_SPI=3Dy > +CONFIG_SPI_BITBANG=3Dy > +CONFIG_GPIOLIB=3Dy > +CONFIG_GPIO_SYSFS=3Dy > +CONFIG_GPIO_PCA953X=3Dy > +CONFIG_SABRESD_MAX8903=3Dy > +CONFIG_SENSORS_MAX17135=3Dy > +CONFIG_SENSORS_MAG3110=3Dy > +# CONFIG_MXC_MMA8450 is not set > +CONFIG_WATCHDOG=3Dy > +CONFIG_WATCHDOG_NOWAYOUT=3Dy > +CONFIG_MFD_WM8994=3Dy > +CONFIG_MFD_PFUZE=3Dy > +CONFIG_MFD_MAX17135=3Dy > +CONFIG_REGULATOR=3Dy > +CONFIG_REGULATOR_FIXED_VOLTAGE=3Dy > +CONFIG_REGULATOR_PFUZE100=3Dy > +CONFIG_REGULATOR_MAX17135=3Dy > +CONFIG_MEDIA_SUPPORT=3Dy > +CONFIG_VIDEO_DEV=3Dy > +# CONFIG_RC_CORE is not set > +# CONFIG_MEDIA_TUNER_CUSTOMISE is not set > +CONFIG_VIDEO_VIVI=3Dy > +CONFIG_USB_VIDEO_CLASS=3Dy > +# CONFIG_USB_GSPCA is not set > +# CONFIG_RADIO_ADAPTERS is not set > +CONFIG_DRM=3Dm > +CONFIG_DRM_VIVANTE=3Dm > +CONFIG_FB=3Dy > +CONFIG_FB_MODE_HELPERS=3Dy > +CONFIG_BACKLIGHT_LCD_SUPPORT=3Dy > +# CONFIG_LCD_CLASS_DEVICE is not set > +CONFIG_BACKLIGHT_CLASS_DEVICE=3Dy > +# CONFIG_BACKLIGHT_GENERIC is not set > +CONFIG_FRAMEBUFFER_CONSOLE=3Dy > +CONFIG_FONTS=3Dy > +CONFIG_LOGO=3Dy > +CONFIG_SOUND=3Dy > +CONFIG_SND=3Dy > +CONFIG_SND_USB_AUDIO=3Dy > +CONFIG_SND_SOC=3Dy > +CONFIG_HIDRAW=3Dy > +CONFIG_HID_A4TECH=3Dy > +CONFIG_HID_APPLE=3Dy > +CONFIG_HID_BELKIN=3Dy > +CONFIG_HID_CHERRY=3Dy > +CONFIG_HID_CHICONY=3Dy > +CONFIG_HID_CYPRESS=3Dy > +CONFIG_HID_EZKEY=3Dy > +CONFIG_HID_GYRATION=3Dy > +CONFIG_HID_LOGITECH=3Dy > +CONFIG_HID_MICROSOFT=3Dy > +CONFIG_HID_MONTEREY=3Dy > +CONFIG_HID_PANTHERLORD=3Dy > +CONFIG_HID_PETALYNX=3Dy > +CONFIG_HID_SAMSUNG=3Dy > +CONFIG_HID_SONY=3Dy > +CONFIG_HID_SUNPLUS=3Dy > +CONFIG_USB=3Dy > +# CONFIG_USB_DEVICE_CLASS is not set > +CONFIG_USB_SUSPEND=3Dy > +CONFIG_USB_OTG=3Dy > +# CONFIG_USB_OTG_WHITELIST is not set > +CONFIG_USB_EHCI_HCD=3Dy > +CONFIG_USB_EHCI_ROOT_HUB_TT=3Dy > +# CONFIG_USB_EHCI_TT_NEWSCHED is not set > +CONFIG_USB_STORAGE=3Dy > +CONFIG_USB_SERIAL=3Dy > +CONFIG_USB_SERIAL_CONSOLE=3Dy > +CONFIG_USB_SERIAL_GENERIC=3Dy > +CONFIG_USB_SERIAL_FTDI_SIO=3Dm > +CONFIG_USB_SERIAL_DEBUG=3Dy > +CONFIG_USB_GADGET=3Dy > +CONFIG_USB_ETH=3Dy > +CONFIG_MMC=3Dy > +CONFIG_MMC_UNSAFE_RESUME=3Dy > +CONFIG_MMC_SDHCI=3Dy > +CONFIG_MMC_SDHCI_PLTFM=3Dy > +CONFIG_NEW_LEDS=3Dy > +CONFIG_LEDS_CLASS=3Dy > +CONFIG_LEDS_GPIO=3Dy > +CONFIG_LEDS_TRIGGERS=3Dy > +CONFIG_LEDS_TRIGGER_GPIO=3Dy > +CONFIG_LEDS_TRIGGER_DEFAULT_ON=3Dy > +CONFIG_RTC_CLASS=3Dy > +CONFIG_RTC_INTF_DEV_UIE_EMUL=3Dy > +CONFIG_RTC_DRV_PCF2123=3Dy > +# CONFIG_RTC_DRV_CMOS is not set > +CONFIG_DMADEVICES=3Dy > +CONFIG_EXT2_FS=3Dy > +CONFIG_EXT3_FS=3Dy > +# CONFIG_EXT3_DEFAULTS_TO_ORDERED is not set > +CONFIG_EXT4_FS=3Dy > +CONFIG_AUTOFS4_FS=3Dy > +CONFIG_MSDOS_FS=3Dy > +CONFIG_VFAT_FS=3Dy > +CONFIG_TMPFS=3Dy > +CONFIG_JFFS2_FS=3Dy > +CONFIG_UBIFS_FS=3Dy > +CONFIG_CRAMFS=3Dy > +CONFIG_NFS_FS=3Dy > +CONFIG_NFS_V3=3Dy > +CONFIG_ROOT_NFS=3Dy > +CONFIG_PARTITION_ADVANCED=3Dy > +CONFIG_EFI_PARTITION=3Dy > +CONFIG_NLS_CODEPAGE_437=3Dy > +CONFIG_NLS_ASCII=3Dm > +CONFIG_NLS_ISO8859_1=3Dy > +CONFIG_NLS_UTF8=3Dm > +CONFIG_PRINTK_TIME=3Dy > +CONFIG_FRAME_WARN=3D1024 > +CONFIG_MAGIC_SYSRQ=3Dy > +# CONFIG_UNUSED_SYMBOLS is not set > +CONFIG_DEBUG_FS=3Dy > +CONFIG_SYSCTL_SYSCALL_CHECK=3Dy > +# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set > +CONFIG_CRYPTO_AUTHENC=3Dy > +CONFIG_CRYPTO_TEST=3Dm > +CONFIG_CRYPTO_CCM=3Dy > +CONFIG_CRYPTO_GCM=3Dy > +CONFIG_CRYPTO_CBC=3Dy > +CONFIG_CRYPTO_CTS=3Dy > +CONFIG_CRYPTO_LRW=3Dy > +CONFIG_CRYPTO_PCBC=3Dy > +CONFIG_CRYPTO_XTS=3Dy > +CONFIG_CRYPTO_DES=3Dy > +# CONFIG_CRYPTO_ANSI_CPRNG is not set > +CONFIG_CRYPTO_DEV_FSL_CAAM_SM=3Dy > +CONFIG_CRYPTO_DEV_FSL_CAAM_SM_TEST=3Dy > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/drm-vivante-Add-00-= sufix-in-returned-bus-Id.patch b/recipes-kernel/linux/linux-udoo-3.0.35/d= rm-vivante-Add-00-sufix-in-returned-bus-Id.patch > new file mode 100644 > index 0000000..815d02c > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/drm-vivante-Add-00-sufix-i= n-returned-bus-Id.patch > @@ -0,0 +1,31 @@ > +From b37a944f55a5010bd08297a63db0275540922f32 Mon Sep 17 00:00:00 2001 > +From: Otavio Salvador > +Date: Thu, 22 Aug 2013 16:31:29 -0300 > +Subject: [PATCH] drm/vivante: Add ":00" sufix in returned bus Id > + > +This makes the 3.0.35 compatible with a Xorg driver build for 3.5.7 or > +newer kernels. > + > +Upstream-Status: Inapropriate [embedded specific] > + > +Signed-off-by: Otavio Salvador > +--- > + drivers/gpu/drm/vivante/vivante_drv.c | 2 +- > + 1 file changed, 1 insertion(+), 1 deletion(-) > + > +diff --git a/drivers/gpu/drm/vivante/vivante_drv.c b/drivers/gpu/drm/v= ivante/vivante_drv.c > +index 4224608..cea360d 100644 > +--- a/drivers/gpu/drm/vivante/vivante_drv.c > ++++ b/drivers/gpu/drm/vivante/vivante_drv.c > +@@ -55,7 +55,7 @@ > + > + #include "drm_pciids.h" > + > +-static char platformdevicename[] =3D "Vivante GCCore"; > ++static char platformdevicename[] =3D "Vivante GCCore:00"; > + static struct platform_device *pplatformdev; > + > + static struct drm_driver driver =3D { > +-- > +1.8.4.rc1 > + > diff --git a/recipes-kernel/linux/linux-udoo-3.0.35/epdc-Rename-mxcfb_e= pdc_kernel.h-to-mxc_epdc.h.patch b/recipes-kernel/linux/linux-udoo-3.0.35= /epdc-Rename-mxcfb_epdc_kernel.h-to-mxc_epdc.h.patch > new file mode 100644 > index 0000000..0a20b3f > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo-3.0.35/epdc-Rename-mxcfb_epdc_ker= nel.h-to-mxc_epdc.h.patch > @@ -0,0 +1,143 @@ > +From 149545df26169d257b144ff78934ce9cb5b6818b Mon Sep 17 00:00:00 2001 > +From: Otavio Salvador > +Date: Sat, 19 Oct 2013 10:55:11 -0300 > +Subject: [PATCH] epdc: Rename mxcfb_epdc_kernel.h to mxc_epdc.h > +Organization: O.S. Systems Software LTDA. > + > +This allow for forward compatibility with imx-test >=3D 3.10.9-1.0.0. > + > +Signed-off-by: Otavio Salvador > +--- > + drivers/video/mxc/mxc_epdc_fb.c | 2 +- > + include/linux/mxcfb_epdc.h | 49 ++++++++++++++++++++++++++++++= +++++++++ > + include/linux/mxcfb_epdc_kernel.h | 49 ------------------------------= --------- > + 3 files changed, 50 insertions(+), 50 deletions(-) > + create mode 100644 include/linux/mxcfb_epdc.h > + delete mode 100644 include/linux/mxcfb_epdc_kernel.h > + > +diff --git a/drivers/video/mxc/mxc_epdc_fb.c b/drivers/video/mxc/mxc_e= pdc_fb.c > +index 4103498..b3ef8ea 100644 > +--- a/drivers/video/mxc/mxc_epdc_fb.c > ++++ b/drivers/video/mxc/mxc_epdc_fb.c > +@@ -43,7 +43,7 @@ > + #include > + #include > + #include > +-#include > ++#include > + #include > + #include > + #include > +diff --git a/include/linux/mxcfb_epdc.h b/include/linux/mxcfb_epdc.h > +new file mode 100644 > +index 0000000..06fea6f > +--- /dev/null > ++++ b/include/linux/mxcfb_epdc.h > +@@ -0,0 +1,49 @@ > ++/* > ++ * Copyright (C) 2010-2012 Freescale Semiconductor, Inc. All Rights R= eserved. > ++ * > ++ * This program is free software; you can redistribute it and/or modi= fy > ++ * it under the terms of the GNU General Public License as published = by > ++ * the Free Software Foundation; either version 2 of the License, or > ++ * (at your option) any later version. > ++ * > ++ * This program is distributed in the hope that it will be useful, > ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of > ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > ++ * GNU General Public License for more details. > ++ * > ++ * You should have received a copy of the GNU General Public License > ++ * along with this program; if not, write to the Free Software > ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-13= 07 USA > ++ * > ++ */ > ++#ifndef _MXCFB_EPDC_KERNEL > ++#define _MXCFB_EPDC_KERNEL > ++ > ++void mxc_epdc_fb_set_waveform_modes(struct mxcfb_waveform_modes *mode= s, > ++ struct fb_info *info); > ++int mxc_epdc_fb_set_temperature(int temperature, struct fb_info *info= ); > ++int mxc_epdc_fb_set_auto_update(u32 auto_mode, struct fb_info *info); > ++int mxc_epdc_fb_send_update(struct mxcfb_update_data *upd_data, > ++ struct fb_info *info); > ++int mxc_epdc_fb_wait_update_complete( > ++ struct mxcfb_update_marker_data *marker_data, > ++ struct fb_info *info); > ++int mxc_epdc_fb_set_pwrdown_delay(u32 pwrdown_delay, > ++ struct fb_info *info); > ++int mxc_epdc_get_pwrdown_delay(struct fb_info *info); > ++int mxc_epdc_fb_set_upd_scheme(u32 upd_scheme, struct fb_info *info); > ++ > ++void mxc_spdc_fb_set_waveform_modes(struct mxcfb_waveform_modes *mode= s, > ++ struct fb_info *info); > ++int mxc_spdc_fb_set_temperature(int temperature, struct fb_info *info= ); > ++int mxc_spdc_fb_set_auto_update(u32 auto_mode, struct fb_info *info); > ++int mxc_spdc_fb_send_update(struct mxcfb_update_data *upd_data, > ++ struct fb_info *info); > ++int mxc_spdc_fb_wait_update_complete( > ++ struct mxcfb_update_marker_data *marker_data, > ++ struct fb_info *info); > ++int mxc_spdc_fb_set_pwrdown_delay(u32 pwrdown_delay, > ++ struct fb_info *info); > ++int mxc_spdc_get_pwrdown_delay(struct fb_info *info); > ++int mxc_spdc_fb_set_upd_scheme(u32 upd_scheme, struct fb_info *info); > ++#endif > +diff --git a/include/linux/mxcfb_epdc_kernel.h b/include/linux/mxcfb_e= pdc_kernel.h > +deleted file mode 100644 > +index 06fea6f..0000000 > +--- a/include/linux/mxcfb_epdc_kernel.h > ++++ /dev/null > +@@ -1,49 +0,0 @@ > +-/* > +- * Copyright (C) 2010-2012 Freescale Semiconductor, Inc. All Rights R= eserved. > +- * > +- * This program is free software; you can redistribute it and/or modi= fy > +- * it under the terms of the GNU General Public License as published = by > +- * the Free Software Foundation; either version 2 of the License, or > +- * (at your option) any later version. > +- * > +- * This program is distributed in the hope that it will be useful, > +- * but WITHOUT ANY WARRANTY; without even the implied warranty of > +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +- * GNU General Public License for more details. > +- * > +- * You should have received a copy of the GNU General Public License > +- * along with this program; if not, write to the Free Software > +- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-13= 07 USA > +- * > +- */ > +-#ifndef _MXCFB_EPDC_KERNEL > +-#define _MXCFB_EPDC_KERNEL > +- > +-void mxc_epdc_fb_set_waveform_modes(struct mxcfb_waveform_modes *mode= s, > +- struct fb_info *info); > +-int mxc_epdc_fb_set_temperature(int temperature, struct fb_info *info= ); > +-int mxc_epdc_fb_set_auto_update(u32 auto_mode, struct fb_info *info); > +-int mxc_epdc_fb_send_update(struct mxcfb_update_data *upd_data, > +- struct fb_info *info); > +-int mxc_epdc_fb_wait_update_complete( > +- struct mxcfb_update_marker_data *marker_data, > +- struct fb_info *info); > +-int mxc_epdc_fb_set_pwrdown_delay(u32 pwrdown_delay, > +- struct fb_info *info); > +-int mxc_epdc_get_pwrdown_delay(struct fb_info *info); > +-int mxc_epdc_fb_set_upd_scheme(u32 upd_scheme, struct fb_info *info); > +- > +-void mxc_spdc_fb_set_waveform_modes(struct mxcfb_waveform_modes *mode= s, > +- struct fb_info *info); > +-int mxc_spdc_fb_set_temperature(int temperature, struct fb_info *info= ); > +-int mxc_spdc_fb_set_auto_update(u32 auto_mode, struct fb_info *info); > +-int mxc_spdc_fb_send_update(struct mxcfb_update_data *upd_data, > +- struct fb_info *info); > +-int mxc_spdc_fb_wait_update_complete( > +- struct mxcfb_update_marker_data *marker_data, > +- struct fb_info *info); > +-int mxc_spdc_fb_set_pwrdown_delay(u32 pwrdown_delay, > +- struct fb_info *info); > +-int mxc_spdc_get_pwrdown_delay(struct fb_info *info); > +-int mxc_spdc_fb_set_upd_scheme(u32 upd_scheme, struct fb_info *info); > +-#endif > +-- > +1.8.4.rc3 > + > diff --git a/recipes-kernel/linux/linux-udoo.inc b/recipes-kernel/linux= /linux-udoo.inc > new file mode 100644 > index 0000000..9fb946a > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo.inc > @@ -0,0 +1,17 @@ > +# Adapted from linux-imx.inc, copyright (C) 2012, 2013 O.S. Systems So= ftware LTDA > +# Released under the MIT license (see COPYING.MIT for the terms) > + > +DESCRIPTION =3D "Linux kernel UNICO 2013 for UDOO" > +LICENSE =3D "GPLv2" > +LIC_FILES_CHKSUM =3D "file://COPYING;md5=3Dd7810fab7487fb0aad327b76f1b= e7cd7" > + > +require recipes-kernel/linux/linux-imx.inc > + > +# Put a local version until we have a true SRCREV to point to > +LOCALVERSION ?=3D "+yocto" > +SCMVERSION ?=3D "y" > + > +# SRC_URI for wandboard kernel > +SRC_URI =3D "git://github.com/UDOOboard/Kernel_Unico.git \ > + file://defconfig \ > +" > diff --git a/recipes-kernel/linux/linux-udoo_3.0.35.bb b/recipes-kernel= /linux/linux-udoo_3.0.35.bb > new file mode 100644 > index 0000000..6a412eb > --- /dev/null > +++ b/recipes-kernel/linux/linux-udoo_3.0.35.bb > @@ -0,0 +1,26 @@ > +# Adapted from linux-imx.inc, copyright (C) 2012, 2013 O.S. Systems So= ftware LTDA I'm not sure it was adapted from linux-imx.inc, or from=20 linux-imx_${PV}.bb instead. Copyright here should be 2013 only, it's a new file being created. > +# Released under the MIT license (see COPYING.MIT for the terms) > + > +include linux-udoo.inc > + > +# Kernel_Unico is a branch from 3.0.35 so we apply the 3.0.35 patches > +SRCREV =3D "029e85168c08c8c9a8a6dd308b388599be608948" > +LOCALVERSION =3D "-3.0.35-udoo" > + > +# Patches need for Yocto and not applied by Freescale when doing 4.1.0= branch > +SRC_URI +=3D "file://drm-vivante-Add-00-sufix-in-returned-bus-Id.patch= \ > + file://epdc-Rename-mxcfb_epdc_kernel.h-to-mxc_epdc.h.patch= \ > + file://0001-perf-tools-Fix-getrusage-related-build-failure-on-gl.= patch \ > + file://0002-ARM-7668-1-fix-memset-related-crashes-caused-b= y-rece.patch \ > + file://0003-ARM-7670-1-fix-the-memset-fix.patch \ > + file://0004-ENGR00271136-Fix-build-break-when-CONFIG_CLK_D= EBUG-i.patch \ > + file://0005-ENGR00271359-Add-Multi-touch-support.patch \ > + file://0007-ARM-mach-mx6-board-mx6q_sabresd-Register-SDHC3= -first.patch\ > + file://0001-ENGR00255688-4.6.9p11.1-gpu-GPU-Kernel-driver-= integr.patch \ > + file://0002-ENGR00265465-gpu-Add-global-value-for-minimum-= 3D-clo.patch \ > + file://0003-ENGR00261814-4-gpu-use-new-PU-power-on-off-int= erface.patch \ > + file://0004-ENGR00264288-1-GPU-Integrate-4.6.9p12-release-= kernel.patch \ > + file://0005-ENGR00264275-GPU-Correct-suspend-resume-callin= g-afte.patch \ > + file://0006-ENGR00265130-gpu-Correct-section-mismatch-in-g= pu-ker.patch" > + > +COMPATIBLE_MACHINE =3D "(mx6)" > --=20 Daiane