broadcom-nvram-config: separate recipes to different chipsets
PATCH 1/4 broadcom-nvram-config: separate recipes to different chipsets
Upstream driver changes cause the driver to request firmware based on the device ID (e.g. 4329, 4330). This also applies to the nvram config file. Restructure the recipes and separate by chipset.
Modify conf/machine to use chipset-specific broadcom nvram packages
--- conf/machine/nitrogen6x-lite.conf | 2 +- conf/machine/wandboard-dual.conf | 5 +- conf/machine/wandboard-quad.conf | 5 +- .../broadcom-nvram-config/bcm4329-nvram-config.bb | 8 ++ .../broadcom-nvram-config/bcm4330-nvram-config.bb | 8 ++ .../broadcom-nvram-config/broadcom-nvram-config.bb | 31 ------ .../broadcom-nvram-config.inc | 31 ++++++ .../files/nitrogen6x-lite/brcmfmac4330-sdio.txt | 80 ++++++++++++++ .../files/nitrogen6x-lite/nvram.txt | 80 -------------- .../files/wandboard/brcmfmac4329-sdio.txt | 70 ++++++++++++ .../files/wandboard/brcmfmac4330-sdio.txt | 120 +++++++++++++++++++++ .../files/wandboard/nvram.txt | 70 ------------ 12 files changed, 326 insertions(+), 184 deletions(-) create mode 100644 recipes-bsp/broadcom-nvram-config/bcm4329-nvram-config.bb create mode 100644 recipes-bsp/broadcom-nvram-config/bcm4330-nvram-config.bb delete mode 100644 recipes-bsp/broadcom-nvram-config/broadcom-nvram-config.bb create mode 100644 recipes-bsp/broadcom-nvram-config/broadcom-nvram-config.inc create mode 100644 recipes-bsp/broadcom-nvram-config/files/nitrogen6x-lite/brcmfmac4330-sdio.txt delete mode 100644 recipes-bsp/broadcom-nvram-config/files/nitrogen6x-lite/nvram.txt create mode 100644 recipes-bsp/broadcom-nvram-config/files/wandboard/brcmfmac4329-sdio.txt create mode 100644 recipes-bsp/broadcom-nvram-config/files/wandboard/brcmfmac4330-sdio.txt delete mode 100644 recipes-bsp/broadcom-nvram-config/files/wandboard/nvram.txt
conf/machine/nitrogen6x-lite.conf +1 -1
@@ -28,5 +28,5 @@ UBOOT_MACHINE ?= "nit6xlite_config" SERIAL_CONSOLE = "115200 ttymxc1" -MACHINE_EXTRA_RRECOMMENDS += " broadcom-nvram-config" +MACHINE_EXTRA_RRECOMMENDS += " bcm4330-nvram-config" MACHINE_FEATURES += " pci wifi bluetooth"
conf/machine/wandboard-dual.conf +4 -1
@@ -14,4 +14,7 @@ KERNEL_DEVICETREE = "imx6dl-wandboard.dtb" MACHINE_FEATURES += "bluetooth wifi" -MACHINE_EXTRA_RRECOMMENDS += " broadcom-nvram-config" +MACHINE_EXTRA_RRECOMMENDS += " \ + bcm4329-nvram-config \ + bcm4330-nvram-config \ +"
conf/machine/wandboard-quad.conf +4 -1
@@ -14,4 +14,7 @@ KERNEL_DEVICETREE = "imx6q-wandboard.dtb" MACHINE_FEATURES += "bluetooth wifi" -MACHINE_EXTRA_RRECOMMENDS += " broadcom-nvram-config" +MACHINE_EXTRA_RRECOMMENDS += " \ + bcm4329-nvram-config \ + bcm4330-nvram-config \ +"
recipes-bsp/broadcom-nvram-config/bcm4329-nvram-config.bb new file +8 -0
@@ -0,0 +1,8 @@ +DESCRIPTION = "Nvram support for Broadcom BCM4329 wifi/bt device" +SECTION = "kernel" + +include broadcom-nvram-config.inc + +CHIP_MODEL = "4329" + +COMPATIBLE_MACHINE = "(wandboard-dual|wandboard-quad)"
recipes-bsp/broadcom-nvram-config/bcm4330-nvram-config.bb new file +8 -0
@@ -0,0 +1,8 @@ +DESCRIPTION = "Nvram support for Broadcom BCM4330 wifi/bt device" +SECTION = "kernel" + +include broadcom-nvram-config.inc + +CHIP_MODEL = "4330" + +COMPATIBLE_MACHINE = "(nitrogen6x-lite|wandboard-dual|wandboard-quad)"
recipes-bsp/broadcom-nvram-config/broadcom-nvram-config.bb deleted +0 -31
@@ -1,31 +0,0 @@ -DESCRIPTION = "Nvram support for Broadcom wifi chips" -SECTION = "kernel" - -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://LICENCE.broadcom_bcm43xx;md5=3160c14df7228891b868060e1951dfbc" - -SRC_URI = " \ - file://nvram.txt \ - file://LICENCE.broadcom_bcm43xx \ -" - -S="${WORKDIR}" - -do_install() { - install -d ${D}/lib/firmware/brcm - - cp -r ${WORKDIR}/nvram.txt \ - ${D}/lib/firmware/brcm/brcmfmac-sdio.txt -} - -FILES_${PN} = " \ - /lib/firmware/brcm/brcmfmac-sdio.txt \ -" -BROADCOM_FIRMWARE = "INVALID" -BROADCOM_FIRMWARE_nitrogen6x-lite = "bcm4330" -BROADCOM_FIRMWARE_wandboard-dual = "bcm4329" -BROADCOM_FIRMWARE_wandboard-quad = "bcm4329" - -RDEPENDS_${PN} = "linux-firmware-${BROADCOM_FIRMWARE}" - -COMPATIBLE_MACHINE = "(nitrogen6x-lite|wandboard-dual|wandboard-quad)"
recipes-bsp/broadcom-nvram-config/broadcom-nvram-config.inc new file +31 -0
@@ -0,0 +1,31 @@ +LICENSE = "Proprietary" +LIC_FILES_CHKSUM = "file://LICENCE.broadcom_bcm43xx;md5=3160c14df7228891b868060e1951dfbc" + +SRC_URI = " \ + file://LICENCE.broadcom_bcm43xx \ +" + +S = "${WORKDIR}" +BRCM_FWDIR = "/lib/firmware/brcm" +CHIP_MODEL ?= "Invalid" + +do_install() { + install -d ${D}${BRCM_FWDIR} + + cp -r ${WORKDIR}/brcmfmac${CHIP_MODEL}-sdio.txt \ + ${D}${BRCM_FWDIR} +} + +SRC_URI += " \ + file://brcmfmac${CHIP_MODEL}-sdio.txt \ +" + +FILES_${PN} = " \ + ${BRCM_FWDIR}/brcmfmac${CHIP_MODEL}-sdio.txt \ +" + +RDEPENDS_${PN} = " \ + linux-firmware-bcm${CHIP_MODEL} \ +" + +PACKAGE_ARCH = "${MACHINE_ARCH}"
recipes-bsp/broadcom-nvram-config/files/nitrogen6x-lite/brcmfmac4330-sdio.txt new file +80 -0
80 lines not on this page · raw message
recipes-bsp/broadcom-nvram-config/files/nitrogen6x-lite/nvram.txt deleted +0 -80
80 lines not on this page · raw message
recipes-bsp/broadcom-nvram-config/files/wandboard/brcmfmac4329-sdio.txt new file +70 -0
70 lines not on this page · raw message
recipes-bsp/broadcom-nvram-config/files/wandboard/brcmfmac4330-sdio.txt new file +120 -0
120 lines not on this page · raw message
recipes-bsp/broadcom-nvram-config/files/wandboard/nvram.txt deleted +0 -70
70 lines not on this page · raw message
Signature · 1 line
2.0.0
PATCH 2/4 linux-wandboard (3.10.17): Update SRCREV to 8e81319 and update defconfig
The update to the Wandboard Linux kernel includes the following changes:
- wandboard_defconfig: Enable CONFIG_USB_OTG
- wandboard/dts: Fix USB OTG
- wand-rfkill: Change gpio depending on wandboard revision
- wandboard: dts: Add alternate pin support for rev C1
- brcmfmac: Use fw filename and nvram based of devid for sdio.
- wandboard: add revision detect pin to rfkill driver
- wandboard/dts: change EDM gpio to open drain
- wandboard/dts: Enable lcdif in devicetree
- wandboard/dts: add fusion touchscreen to devicetree
- wandboard: Fix bluetooth
- wandboard_defconfig: Enable support for Fusion touchscreen, Sunplus keyboard, and some USB to serial devices.
--- .../linux/linux-wandboard-3.10.17/defconfig | 20 ++++++++++++++++++-- recipes-kernel/linux/linux-wandboard_3.10.17.bb | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-)
recipes-kernel/linux/linux-wandboard-3.10.17/defconfig +18 -2
@@ -66,6 +66,15 @@ CONFIG_NETFILTER=y CONFIG_VLAN_8021Q=y CONFIG_CAN=y CONFIG_CAN_FLEXCAN=y +CONFIG_BT=y +CONFIG_BT_RFCOMM=m +CONFIG_BT_RFCOMM_TTY=y +CONFIG_BT_BNEP=m +CONFIG_BT_BNEP_MC_FILTER=y +CONFIG_BT_BNEP_PROTO_FILTER=y +CONFIG_BT_HIDP=m +CONFIG_BT_HCIUART=m +CONFIG_BT_HCIUART_H4=y CONFIG_CFG80211=y CONFIG_CFG80211_WEXT=y CONFIG_MAC80211=y
@@ -141,6 +150,7 @@ CONFIG_TOUCHSCREEN_EGALAX=y CONFIG_TOUCHSCREEN_ELAN=y CONFIG_TOUCHSCREEN_MAX11801=y CONFIG_TOUCHSCREEN_MC13783=y +CONFIG_TOUCHSCREEN_FUSION=m CONFIG_INPUT_MISC=y CONFIG_INPUT_MMA8450=y CONFIG_INPUT_ISL29023=y
@@ -243,12 +253,19 @@ CONFIG_SND_SOC_IMX_SPDIF=y CONFIG_SND_SOC_IMX_MC13783=y CONFIG_SND_SOC_IMX_HDMI=y CONFIG_SND_SOC_IMX_SI476X=y +CONFIG_HID_SUNPLUS=m CONFIG_USB=y +CONFIG_USB_OTG=y +# CONFIG_USB_OTG_WHITELIST is not set CONFIG_USB_EHCI_HCD=y +CONFIG_USB_ACM=m CONFIG_USB_STORAGE=y CONFIG_USB_CHIPIDEA=y CONFIG_USB_CHIPIDEA_UDC=y CONFIG_USB_CHIPIDEA_HOST=y +CONFIG_USB_SERIAL=y +CONFIG_USB_SERIAL_FTDI_SIO=m +CONFIG_USB_SERIAL_KEYSPAN_PDA=y CONFIG_USB_PHY=y CONFIG_NOP_USB_XCEIV=y CONFIG_USB_MXS_PHY=y
@@ -256,6 +273,7 @@ CONFIG_USB_GADGET=y CONFIG_USB_ZERO=m CONFIG_USB_ETH=m CONFIG_USB_MASS_STORAGE=m +CONFIG_FSL_UTP=y CONFIG_USB_G_SERIAL=m CONFIG_MMC=y CONFIG_MMC_UNSAFE_RESUME=y
@@ -328,7 +346,6 @@ CONFIG_CRYPTO_CCM=y CONFIG_CRYPTO_GCM=y CONFIG_CRYPTO_CBC=y CONFIG_CRYPTO_CTS=y -CONFIG_CRYPTO_ECB=y CONFIG_CRYPTO_LRW=y CONFIG_CRYPTO_XTS=y CONFIG_CRYPTO_MD4=y
@@ -339,7 +356,6 @@ CONFIG_CRYPTO_RMD160=y CONFIG_CRYPTO_RMD256=y CONFIG_CRYPTO_RMD320=y CONFIG_CRYPTO_SHA1_ARM=y -CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y CONFIG_CRYPTO_TGR192=y CONFIG_CRYPTO_WP512=y
recipes-kernel/linux/linux-wandboard_3.10.17.bb +1 -1
@@ -8,7 +8,7 @@ DEPENDS += "lzop-native bc-native" # Wandboard branch - based on 3.10.17_1.0.0_ga from Freescale git SRCBRANCH = "wandboard_imx_3.10.17_1.0.0_ga" -SRCREV = "9d567e4f285e80bc332e79f0636259bc05a4ee3b" +SRCREV = "8e8131901542e472ac37eda811a4aa633a105fad" LOCALVERSION = "-1.0.0-wandboard"
Signature · 1 line
2.0.0
PATCH 3/4 linux-firmware: add bbappend to modify firmware file names
In reply to John WeberUpstream changes to the brcmfmac driver require a change to the firmware file names to match the devid and interface type of the Broadcom chipset. This also makes it easier for one machine to support multiple chipets in Yocto.
This patch has been changed to adapt to the linux-firmware version used in Daisy branch which is based on an older version of linux-firmware repository.
--- .../linux-firmware/linux-firmware_git.bbappend | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 recipes-kernel/linux-firmware/linux-firmware_git.bbappend
recipes-kernel/linux-firmware/linux-firmware_git.bbappend new file +31 -0
@@ -0,0 +1,31 @@ +BRCM_FWDIR = "/lib/firmware/brcm" + +do_install_append () { + # rename downloaded files so that we can create alternative + # links + + cd ${D}${BRCM_FWDIR} + + mv brcmfmac4329.bin brcmfmac4329-sta-sdio.bin + mv brcmfmac4330.bin brcmfmac4330-sta-sdio.bin + + # Create original file links, so that the base recipe sees the installed files + ln -sf brcmfmac4329-sta-sdio.bin brcmfmac4329-sdio.bin + ln -sf brcmfmac4330-sta-sdio.bin brcmfmac4330-sdio.bin +} + +FILES_${PN}-bcm4329 += " \ + ${BRCM_FWDIR}/brcmfmac4329-sta-sdio.bin \ +" + +FILES_${PN}-bcm4330 += " \ + ${BRCM_FWDIR}/brcmfmac4330-sta-sdio.bin \ +" + +ALTERNATIVE_linux-firmware-bcm4329 += " brcmfmac4329-sdio.bin" +ALTERNATIVE_LINK_NAME[brcmfmac4329-sdio.bin] = "${BRCM_FWDIR}/brcmfmac4329-sdio.bin" +ALTERNATIVE_TARGET_linux-firmware-bcm4329[brcmfmac4329-sdio.bin] = "${BRCM_FWDIR}/brcmfmac4329-sta-sdio.bin" + +ALTERNATIVE_linux-firmware-bcm4330 += " brcmfmac4330-sdio.bin" +ALTERNATIVE_LINK_NAME[brcmfmac4330-sdio.bin] = "${BRCM_FWDIR}/brcmfmac4330-sdio.bin" +ALTERNATIVE_TARGET_linux-firmware-bcm4330[brcmfmac4330-sdio.bin] = "${BRCM_FWDIR}/brcmfmac4330-sta-sdio.bin"
Signature · 1 line
2.0.0
PATCH 4/4 linux-wandboard (3.0.35): remove recipe and associated files
In reply to John WeberNow that kernel 3.0.35 is no longer being updated, and that 3.10.17 is now GA and supports current GPU libraries, remove linux-wandboard (3.0.35).
--- ...8-4.6.9p11.1-gpu-GPU-Kernel-driver-integr.patch | 1040 ---------- ...5-gpu-Add-global-value-for-minimum-3D-clo.patch | 62 - ...4-4-gpu-use-new-PU-power-on-off-interface.patch | 53 - ...8-1-GPU-Integrate-4.6.9p12-release-kernel.patch | 2006 -------------------- ...5-GPU-Correct-suspend-resume-calling-afte.patch | 61 - ...0-gpu-Correct-section-mismatch-in-gpu-ker.patch | 60 - .../linux/linux-wandboard-3.0.35/defconfig | 242 --- ...m-vivante-Add-00-sufix-in-returned-bus-Id.patch | 31 - recipes-kernel/linux/linux-wandboard_3.0.35.bb | 20 - 9 files changed, 3575 deletions(-) delete mode 100644 recipes-kernel/linux/linux-wandboard-3.0.35/0001-ENGR00255688-4.6.9p11.1-gpu-GPU-Kernel-driver-integr.patch delete mode 100644 recipes-kernel/linux/linux-wandboard-3.0.35/0002-ENGR00265465-gpu-Add-global-value-for-minimum-3D-clo.patch delete mode 100644 recipes-kernel/linux/linux-wandboard-3.0.35/0003-ENGR00261814-4-gpu-use-new-PU-power-on-off-interface.patch delete mode 100644 recipes-kernel/linux/linux-wandboard-3.0.35/0004-ENGR00264288-1-GPU-Integrate-4.6.9p12-release-kernel.patch delete mode 100644 recipes-kernel/linux/linux-wandboard-3.0.35/0005-ENGR00264275-GPU-Correct-suspend-resume-calling-afte.patch delete mode 100644 recipes-kernel/linux/linux-wandboard-3.0.35/0006-ENGR00265130-gpu-Correct-section-mismatch-in-gpu-ker.patch delete mode 100644 recipes-kernel/linux/linux-wandboard-3.0.35/defconfig delete mode 100644 recipes-kernel/linux/linux-wandboard-3.0.35/drm-vivante-Add-00-sufix-in-returned-bus-Id.patch delete mode 100644 recipes-kernel/linux/linux-wandboard_3.0.35.bb
recipes-kernel/linux/linux-wandboard-3.0.35/0001-ENGR00255688-4.6.9p11.1-gpu-GPU-Kernel-driver-integr.patch deleted +0 -1040
@@ -1,1040 +0,0 @@ -From 46e3a6de5adb9379f9d6eef2c038c2f18637d407 Mon Sep 17 00:00:00 2001 -From: Loren Huang <[email protected]> -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 <[email protected]> -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 modify - # it under the terms of the GNU General Public License as published by -diff --git 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 -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 += _SwitchPipe(Context, index, gcvPIPE_3D); - - /* Current context pointer. */ --#if gcdDEBUG -+#if gcdDEBUG - index += _State(Context, index, 0x03850 >> 2, 0x00000000, 1, gcvFALSE, gcvFALSE); - #endif - -diff --git 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 -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 == gcv1000) && (Identity->chipRevision == 0x5035)) -+ if (((Identity->chipModel == gcv1000) && ((Identity->chipRevision == 0x5035) -+ || (Identity->chipRevision == 0x5036))) - || ((Identity->chipModel == gcv800) && (Identity->chipRevision == 0x4612))) - { - Identity->superTileMode = 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) == 32) ? ~0 : (~(~0 << ((1 ? 21:21) - (0 ? 21:21) + 1)))))) == (0x1 & ((gctUINT32) ((((1 ? 21:21) - (0 ? 21:21) + 1) == 32) ? ~0 : (~(~0 << ((1 ? 21: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/drivers/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->list))) -+ - /******************************************************************************* - ** gckKERNEL_NewDatabase - ** -@@ -56,6 +59,7 @@ gckKERNEL_NewDatabase( - gcsDATABASE_PTR database; - gctBOOL acquired = gcvFALSE; - gctSIZE_T slot; -+ gcsDATABASE_PTR existingDatabase; - - gcmkHEADER_ARG("Kernel=0x%x ProcessID=%d", Kernel, ProcessID); - -@@ -63,6 +67,21 @@ gckKERNEL_NewDatabase( - gcmkONERROR(gckOS_AcquireMutex(Kernel->os, Kernel->db->dbMutex, gcvINFINITE)); - acquired = gcvTRUE; - -+ /* Compute the hash for the database. */ -+ slot = ProcessID % gcmCOUNTOF(Kernel->db->db); -+ -+ /* Walk the hash list. */ -+ for (existingDatabase = Kernel->db->db[slot]; -+ existingDatabase != gcvNULL; -+ existingDatabase = existingDatabase->next) -+ { -+ if (existingDatabase->processID == ProcessID) -+ { -+ /* One process can't be added twice. */ -+ gcmkONERROR(gcvSTATUS_NOT_SUPPORTED); -+ } -+ } -+ - if (Kernel->db->freeDatabase != gcvNULL) - { - /* Allocate a database from the free list. */ -@@ -81,9 +100,6 @@ gckKERNEL_NewDatabase( - database = pointer; - } - -- /* Compute the hash for the database. */ -- slot = ProcessID % gcmCOUNTOF(Kernel->db->db); -- - /* Insert the database into the hash. */ - database->next = Kernel->db->db[slot]; - Kernel->db->db[slot] = 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 = Database->list; -- Database->list = record; -+ record->next = Database->list[Slot]; -+ Database->list[Slot] = record; - - /* Release the database mutex. */ - gcmkONERROR(gckOS_ReleaseMutex(Kernel->os, Kernel->db->dbMutex)); -@@ -449,6 +466,7 @@ gckKERNEL_DeleteRecord( - gceSTATUS status; - gctBOOL acquired = gcvFALSE; - gcsDATABASE_RECORD_PTR record, previous; -+ gctUINT32 slot = _GetSlot(Database, Data); - - gcmkHEADER_ARG("Kernel=0x%x Database=0x%x Type=%d Data=0x%x", - Kernel, Database, Type, Data); -@@ -458,8 +476,9 @@ gckKERNEL_DeleteRecord( - gckOS_AcquireMutex(Kernel->os, Kernel->db->dbMutex, gcvINFINITE)); - acquired = gcvTRUE; - -+ - /* Scan the database for this record. */ -- for (record = Database->list, previous = gcvNULL; -+ for (record = Database->list[slot], previous = gcvNULL; - record != gcvNULL; - record = record->next - ) -@@ -490,7 +509,7 @@ gckKERNEL_DeleteRecord( - /* Remove record from database. */ - if (previous == gcvNULL) - { -- Database->list = record->next; -+ Database->list[slot] = record->next; - } - else - { -@@ -557,6 +576,7 @@ gckKERNEL_FindRecord( - gceSTATUS status; - gctBOOL acquired = gcvFALSE; - gcsDATABASE_RECORD_PTR record; -+ gctUINT32 slot = _GetSlot(Database, Data); - - gcmkHEADER_ARG("Kernel=0x%x Database=0x%x Type=%d Data=0x%x", - Kernel, Database, Type, Data); -@@ -567,7 +587,7 @@ gckKERNEL_FindRecord( - acquired = gcvTRUE; - - /* Scan the database for this record. */ -- for (record = Database->list; -+ for (record = Database->list[slot]; - record != gcvNULL; - record = record->next - ) -@@ -642,6 +662,7 @@ gckKERNEL_CreateProcessDB( - { - gceSTATUS status; - gcsDATABASE_PTR database = gcvNULL; -+ gctUINT32 i; - - gcmkHEADER_ARG("Kernel=0x%x ProcessID=%d", Kernel, ProcessID); - -@@ -668,7 +689,11 @@ gckKERNEL_CreateProcessDB( - database->mapUserMemory.bytes = 0; - database->mapUserMemory.maxBytes = 0; - database->mapUserMemory.totalBytes = 0; -- database->list = gcvNULL; -+ -+ for (i = 0; i < gcmCOUNTOF(database->list); i++) -+ { -+ database->list[i] = 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(database, Pointer), &record)); - - /* Initialize the record. */ - record->kernel = Kernel; -@@ -1086,6 +1111,7 @@ gckKERNEL_DestroyProcessDB( - gctPHYS_ADDR physical; - gcuVIDMEM_NODE_PTR node; - gckKERNEL kernel = Kernel; -+ gctUINT32 i; - - gcmkHEADER_ARG("Kernel=0x%x ProcessID=%d", Kernel, ProcessID); - -@@ -1126,8 +1152,11 @@ gckKERNEL_DestroyProcessDB( - ProcessID); - } - -+ for(i = 0; i < gcmCOUNTOF(database->list); i++) -+ { -+ - /* Walk all records. */ -- for (record = database->list; record != gcvNULL; record = next) -+ for (record = database->list[i]; record != gcvNULL; record = next) - { - /* Next next record. */ - next = 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/drivers/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 = Event->kernel; - #endif - -+ gcmkONERROR(__RemoveRecordFromProcessDB(Event, record)); -+ - /* Acquire the mutex. */ - gcmkONERROR(gckOS_AcquireMutex(Event->os, Event->eventListMutex, gcvINFINITE)); - acquired = gcvTRUE; -@@ -1539,9 +1541,6 @@ gckEVENT_Submit( - gcmkONERROR(gckOS_ReleaseMutex(Event->os, Event->eventListMutex)); - acquired = 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/drivers/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 = gcvNULL; - static gctPOINTER mirrorPageTableMutex = gcvNULL; - #endif - -+static void -+_WritePageEntry( -+ IN gctUINT32_PTR PageEntry, -+ IN gctUINT32 EntryValue -+ ) -+{ -+ static gctUINT16 data = 0xff00; -+ -+ if (*(gctUINT8 *)&data == 0xff) -+ { -+ *PageEntry = gcmSWAB32(EntryValue); -+ } -+ else -+ { -+ *PageEntry = EntryValue; -+ } -+} -+ -+static gctUINT32 -+_ReadPageEntry( -+ IN gctUINT32_PTR PageEntry -+ ) -+{ -+ static gctUINT16 data = 0xff00; -+ gctUINT32 entryValue; -+ -+ if (*(gctUINT8 *)&data == 0xff) -+ { -+ entryValue = *PageEntry; -+ return gcmSWAB32(entryValue); -+ } -+ else -+ { -+ return *PageEntry; -+ } -+} -+ - static gceSTATUS - _FillPageTable( - IN gctUINT32_PTR PageTable, -@@ -108,7 +145,7 @@ _FillPageTable( - - for (i = 0; i < PageCount; i++) - { -- PageTable[i] = EntryValue; -+ _WritePageEntry(PageTable + i, EntryValue); - } - - return gcvSTATUS_OK; -@@ -132,16 +169,16 @@ _Link( - gctUINT32_PTR pageTable = 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] = (Next << 8) | gcvMMU_SINGLE; -+ _WritePageEntry(&pageTable[Index], (Next << 8) | gcvMMU_SINGLE); - break; - - case gcvMMU_FREE: - /* Set index. */ -- pageTable[Index + 1] = Next; -+ _WritePageEntry(&pageTable[Index + 1], Next); - break; - - default: -@@ -167,13 +204,13 @@ _AddFree( - if (Count == 1) - { - /* Initialize a single page node. */ -- pageTable[Node] = (~((1U<<8)-1)) | gcvMMU_SINGLE; -+ _WritePageEntry(pageTable + Node, (~((1U<<8)-1)) | gcvMMU_SINGLE); - } - else - { - /* Initialize the node. */ -- pageTable[Node + 0] = (Count << 8) | gcvMMU_FREE; -- pageTable[Node + 1] = ~0U; -+ _WritePageEntry(pageTable + Node + 0, (Count << 8) | gcvMMU_FREE); -+ _WritePageEntry(pageTable + Node + 1, ~0U); - } - - /* Append the node. */ -@@ -196,7 +233,7 @@ _Collect( - for (i = 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 += pageTable[i] >> 8; -+ count += _ReadPageEntry(&pageTable[i]) >> 8; - - /* Advance the index into the page table. */ -- i += (pageTable[i] >> 8) - 1; -+ i += (_ReadPageEntry(&pageTable[i]) >> 8) - 1; - break; - - default: -@@ -341,19 +378,20 @@ _FillFlatMapping( - gcmkONERROR(gcvSTATUS_NOT_ALIGNED); - } - -- *(Mmu->mtlbLogical + mStart) -- = 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 = mStart; -@@ -368,12 +406,12 @@ _FillFlatMapping( - while (sStart <= last) - { - gcmkASSERT(!(start & gcdMMU_PAGE_64K_MASK)); -- *(stlb->logical + sStart) = _SetPage(start); -+ _WritePageEntry(stlb->logical + sStart, _SetPage(start)); - #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 += gcdMMU_PAGE_64K_SIZE; -@@ -428,7 +466,7 @@ OnError: - if (pre->mtlbEntryNum != 0) - { - gcmkASSERT(pre->mtlbEntryNum == 1); -- *(Mmu->mtlbLogical + pre->mtlbIndex) = 0; -+ _WritePageEntry(Mmu->mtlbLogical + pre->mtlbIndex, 0); - } - - gcmkVERIFY_OK(gcmkOS_SAFE_FREE(Mmu->os, pre)); -@@ -493,8 +531,8 @@ _SetupDynamicSpace( - - /* Initilization. */ - pageTable = Mmu->pageTableLogical; -- pageTable[0] = (Mmu->pageTableEntries << 8) | gcvMMU_FREE; -- pageTable[1] = ~0U; -+ _WritePageEntry(pageTable, (Mmu->pageTableEntries << 8) | gcvMMU_FREE); -+ _WritePageEntry(pageTable + 1, ~0U); - Mmu->heapList = 0; - Mmu->freeNodes = gcvFALSE; - -@@ -509,18 +547,20 @@ _SetupDynamicSpace( - /* Map to Master TLB. */ - for (; i < gcdMMU_MTLB_ENTRY_NUM; i++) - { -- Mmu->mtlbLogical[i] = 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 += gcdMMU_STLB_4K_SIZE; - } -@@ -645,18 +685,11 @@ _Construct( - pageTable = mmu->pageTableLogical; - - #if gcdMMU_CLEAR_VALUE -- { -- gctUINT32 i; -- -- for (i = 0; i < mmu->pageTableEntries; ++i) -- { -- pageTable[i] = gcdMMU_CLEAR_VALUE; -- } -- } -+ _FillPageTable(pageTable, mmu->pageTableEntries, gcdMMU_CLEAR_VALUE); - #endif - -- pageTable[0] = (mmu->pageTableEntries << 8) | gcvMMU_FREE; -- pageTable[1] = ~0U; -+ _WritePageEntry(pageTable, (mmu->pageTableEntries << 8) | gcvMMU_FREE); -+ _WritePageEntry(pageTable + 1, ~0U); - mmu->heapList = 0; - mmu->freeNodes = gcvFALSE; - -@@ -797,7 +830,7 @@ _Destroy( - if (pre->mtlbEntryNum != 0) - { - gcmkASSERT(pre->mtlbEntryNum == 1); -- *(Mmu->mtlbLogical + pre->mtlbIndex) = 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 = Mmu->heapList; !gotIt && (index < Mmu->pageTableEntries);) - { - /* 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 = index; -- index = pageTable[index] >> 8; -+ index = _ReadPageEntry(&pageTable[index]) >> 8; - } - break; - - case gcvMMU_FREE: - /* Test if the node has enough space. */ -- if (PageCount <= (pageTable[index] >> 8)) -+ if (PageCount <= (_ReadPageEntry(&pageTable[index]) >> 8)) - { - gotIt = gcvTRUE; - } -@@ -1070,7 +1103,7 @@ _AllocatePages( - { - /* Move to next node. */ - previous = index; -- index = pageTable[index + 1]; -+ index = _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 = (pageTable[index] >> 8) - PageCount; -+ left = (_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 node and - ** advance the index. */ -- pageTable[index] = (pageTable[index + 1] << 8) | gcvMMU_SINGLE; -+ _WritePageEntry(&pageTable[index], (_ReadPageEntry(&pageTable[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] = (left << 8) | gcvMMU_FREE; -+ _WritePageEntry(&pageTable[index], (left << 8) | gcvMMU_FREE); - index += left; - break; - } -@@ -1232,35 +1265,32 @@ _FreePages( - #if gcdMMU_CLEAR_VALUE - if (Mmu->hardware->mmuVersion == 0) - { -- gctUINT32 i; -- -- for (i = 0; i < PageCount; ++i) -- { -- pageTable[i] = gcdMMU_CLEAR_VALUE; -- } -+ _FillPageTable(pageTable, PageCount, gcdMMU_CLEAR_VALUE); - } - #endif - - if (PageCount == 1) - { - /* Single page node. */ -- pageTable[0] = (~((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] = (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] = ~0U; -+ ); -+ _WritePageEntry(pageTable + 1, ~0U); - - #if gcdUSE_MMU_EXCEPTION - /* Enable exception */ -@@ -1509,12 +1539,8 @@ gckMMU_SetPage( - data = _SetPage(PageAddress); - } - -- if (Mmu->hardware->bigEndian) -- { -- data = gcmSWAB32(data); -- } -+ _WritePageEntry(PageEntry, data); - -- *PageEntry = data; - #if gcdMIRROR_PAGETABLE - for (i = 0; i < mirrorPageTable->reference; i++) - { -@@ -1526,11 +1552,11 @@ gckMMU_SetPage( - - if (mmu->hardware->mmuVersion == 0) - { -- *pageEntry = PageAddress; -+ _WritePageEntry(pageEntry, PageAddress); - } - else - { -- *pageEntry = _SetPage(PageAddress); -+ _WritePageEntry(pageEntry, _SetPage(PageAddress)); - } - } - -@@ -1734,7 +1760,7 @@ gckMMU_DumpPageTableEntry( - * gcdMMU_STLB_4K_ENTRY_NUM - + stlb; - -- gcmkPRINT(" Page table entry = 0x%08X", pageTable[index]); -+ gcmkPRINT(" Page table entry = 0x%08X", _ReadPageEntry(pageTable + 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 = 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/drivers/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 = 0, -+ gcvForceMipEnable = 1, -+ gcvForceMipGenerated = 2, -+ gcvForceMipNever = 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/drivers/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/<pid>/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 sdcard. -+ 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 well as other -@@ -342,6 +366,17 @@ - #endif - - /* -+ gcdUSER_HEAP_ALLOCATOR -+ -+ Set to 1 to enable user mode heap allocator for fast memory allocation -+ and destroying. Otherwise, memory allocation/destroying in user 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/drivers/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_driver.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 = pgprot_writecombine(vma->vm_page_prot); -- vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND; -+ vma->vm_flags |= gcdVM_FLAGS; - #endif - vma->vm_pgoff = 0; - -diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_linux.h -index 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_CACHE_MASK)) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT) - -+#if LINUX_VERSION_CODE >= KERNEL_VERSION (3,7,0) -+#define gcdVM_FLAGS (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_DONTDUMP) -+#else -+#define gcdVM_FLAGS (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED) -+#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 = (gctUINTPTR_T)Logical; -+ pgd_t *pgd; -+ pud_t *pud; -+ pmd_t *pmd; -+ pte_t *pte; -+ -+ if (!current->mm) -+ { -+ return gcvSTATUS_NOT_FOUND; -+ } -+ -+ pgd = pgd_offset(current->mm, logical); -+ if (pgd_none(*pgd) || pgd_bad(*pgd)) -+ { -+ return gcvSTATUS_NOT_FOUND; -+ } -+ -+ pud = pud_offset(pgd, logical); -+ if (pud_none(*pud) || pud_bad(*pud)) -+ { -+ return gcvSTATUS_NOT_FOUND; -+ } -+ -+ pmd = pmd_offset(pud, logical); -+ if (pmd_none(*pmd) || pmd_bad(*pmd)) -+ { -+ return gcvSTATUS_NOT_FOUND; -+ } -+ -+ pte = 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 = (pte_pfn(*pte) << PAGE_SHIFT) | (logical & ~PAGE_MASK); -+ 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 = vmap(pages, numPages, 0, gcmkNONPAGED_MEMROY_PROT(PAGE_KERNEL)); - -+ /* 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 = gcmkPAGED_MEMROY_PROT(mdlMap->vma->vm_page_prot); -- mdlMap->vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED; -+ mdlMap->vma->vm_flags |= gcdVM_FLAGS; - # endif - mdlMap->vma->vm_pgoff = 0; - -@@ -1987,7 +2047,7 @@ gckOS_AllocateNonPagedMemory( - } - #else - mdlMap->vma->vm_page_prot = gcmkNONPAGED_MEMROY_PROT(mdlMap->vma->vm_page_prot); -- mdlMap->vma->vm_flags |= VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED; -+ mdlMap->vma->vm_flags |= gcdVM_FLAGS; - mdlMap->vma->vm_pgoff = 0; - - if (remap_pfn_range(mdlMap->vma, -@@ -2367,12 +2427,18 @@ gckOS_GetPhysicalAddress( - gcmkVERIFY_OBJECT(Os, gcvOBJ_OS); - gcmkVERIFY_ARGUMENT(Address != gcvNULL); - -- /* Get current process ID. */ -- processID = _GetProcessID(); -+ /* Query page table of current process first. */ -+ status = _QueryProcessPageTable(Logical, Address); - -- /* Route through other function. */ -- gcmkONERROR( -- gckOS_GetPhysicalAddressProcess(Os, Logical, processID, Address)); -+ if (gcmIS_ERROR(status)) -+ { -+ /* Get current process ID. */ -+ processID = _GetProcessID(); -+ -+ /* Route through other function. */ -+ gcmkONERROR( -+ gckOS_GetPhysicalAddressProcess(Os, Logical, processID, Address)); -+ } - - /* Success. */ - gcmkFOOTER_ARG("*Address=0x%08x", *Address); -@@ -4139,7 +4205,7 @@ gckOS_LockPages( - return gcvSTATUS_OUT_OF_RESOURCES; - } - -- mdlMap->vma->vm_flags |= VM_RESERVED; -+ mdlMap->vma->vm_flags |= gcdVM_FLAGS; - #if !gcdPAGED_MEMORY_CACHEABLE - if (Cacheable == gcvFALSE) - { --- -1.8.3.2 -
recipes-kernel/linux/linux-wandboard-3.0.35/0002-ENGR00265465-gpu-Add-global-value-for-minimum-3D-clo.patch deleted +0 -62
62 lines not on this page · raw message
recipes-kernel/linux/linux-wandboard-3.0.35/0003-ENGR00261814-4-gpu-use-new-PU-power-on-off-interface.patch deleted +0 -53
53 lines not on this page · raw message
recipes-kernel/linux/linux-wandboard-3.0.35/0004-ENGR00264288-1-GPU-Integrate-4.6.9p12-release-kernel.patch deleted +0 -2006
1,845 lines not on this page · raw message
recipes-kernel/linux/linux-wandboard-3.0.35/0005-ENGR00264275-GPU-Correct-suspend-resume-calling-afte.patch deleted +0 -61
61 lines not on this page · raw message
recipes-kernel/linux/linux-wandboard-3.0.35/0006-ENGR00265130-gpu-Correct-section-mismatch-in-gpu-ker.patch deleted +0 -60
60 lines not on this page · raw message
recipes-kernel/linux/linux-wandboard-3.0.35/defconfig deleted +0 -242
242 lines not on this page · raw message
recipes-kernel/linux/linux-wandboard-3.0.35/drm-vivante-Add-00-sufix-in-returned-bus-Id.patch deleted +0 -31
Lines of this file are not shown. View the raw message.
recipes-kernel/linux/linux-wandboard_3.0.35.bb deleted +0 -20
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.0.0
Part of the diff is not shown here. View the raw message.