Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion arch/arm/configs/lenovo-blade_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y
## Video Accelerator

## GPU
#CONFIG_SGX=y # not ported
CONFIG_PVR_SGX_MT6589=y
CONFIG_PREEMPT=y

## Networking
CONFIG_NET=y
Expand Down
5 changes: 5 additions & 0 deletions drivers/misc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,11 @@ config MCHP_LAN966X_PCI
- lan966x-miim (MDIO_MSCC_MIIM)
- lan966x-switch (LAN966X_SWITCH)

config PVR_SGX_MT6589
tristate "MediaTek MT6589 GPU Driver"
help
WIP

source "drivers/misc/c2port/Kconfig"
source "drivers/misc/eeprom/Kconfig"
source "drivers/misc/cb710/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/misc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ lan966x-pci-objs += lan966x_pci.dtbo.o
obj-$(CONFIG_MCHP_LAN966X_PCI) += lan966x-pci.o
obj-y += keba/
obj-y += amd-sbi/
obj-$(CONFIG_PVR_SGX_MT6589) += pvrsgx-mt6589/
351 changes: 351 additions & 0 deletions drivers/misc/pvrsgx-mt6589/COPYING

Large diffs are not rendered by default.

117 changes: 117 additions & 0 deletions drivers/misc/pvrsgx-mt6589/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
OPTIM = -Os
VER:=eng

ccflags-y := \
-I$(src)/include4 \
-I$(src)/services4/include \
-I$(src)/services4/system/include \
-I$(src)/services4/srvkm/hwdefs \
-I$(src)/services4/srvkm/bridged \
-I$(src)/services4/srvkm/bridged/sgx \
-I$(src)/services4/srvkm/common \
-I$(src)/services4/srvkm/devices/sgx \
-I$(src)/services4/srvkm/env/linux \
-I$(src)/services4/srvkm/include \
-I$(src)/services4/3rdparty/mtklfb \
-I$(src)/services4/3rdparty/mtkbc \
-I$(src)/services4/system/mt6589 \
-I$(src)/services4/system/mtk_common

ccflags-y += \
-fno-strict-aliasing \
-W -Wall \
-Wno-missing-field-initializers \
-Wmissing-format-attribute \
-Wdeclaration-after-statement \
-Wno-format-zero-length \
-Wmissing-prototypes \
-Wstrict-prototypes \
-Wno-unused-parameter \
-Wno-sign-compare \
-Wno-type-limits

ccflags-y += \
-D__linux__ $(OPTIM) -g

ccflags-y += -Wno-declaration-after-statement

ifneq ($(strip $(TARGET_BUILD_VARIANT)),)
ifneq ($(strip $(TARGET_BUILD_VARIANT)),eng)
ifneq ($(strip $(MTK_3D_DEBUG_FOR_USER_VERSION)),yes)
VER:=user
endif
endif
endif

ccflags-y += \
-include $(src)/include4/config_kernel_$(VER).h

pvrsrvkm-y := \
services4/srvkm/env/linux/osfunc.o \
services4/srvkm/env/linux/mutils.o \
services4/srvkm/env/linux/mmap.o \
services4/srvkm/env/linux/module.o \
services4/srvkm/env/linux/pdump.o \
services4/srvkm/env/linux/proc.o \
services4/srvkm/env/linux/pvr_bridge_k.o \
services4/srvkm/env/linux/pvr_debug.o \
services4/srvkm/env/linux/pvr_sync.o \
services4/srvkm/env/linux/mm.o \
services4/srvkm/env/linux/mutex.o \
services4/srvkm/env/linux/event.o \
services4/srvkm/env/linux/osperproc.o \
services4/srvkm/env/linux/systrace.o \
services4/srvkm/common/buffer_manager.o \
services4/srvkm/common/devicemem.o \
services4/srvkm/common/deviceclass.o \
services4/srvkm/common/handle.o \
services4/srvkm/common/hash.o \
services4/srvkm/common/metrics.o \
services4/srvkm/common/pvrsrv.o \
services4/srvkm/common/queue.o \
services4/srvkm/common/ra.o \
services4/srvkm/common/resman.o \
services4/srvkm/common/power.o \
services4/srvkm/common/mem.o \
services4/srvkm/common/pdump_common.o \
services4/srvkm/bridged/bridged_support.o \
services4/srvkm/bridged/bridged_pvr_bridge.o \
services4/srvkm/common/perproc.o \
services4/srvkm/common/lists.o \
services4/srvkm/common/mem_debug.o \
services4/srvkm/common/osfunc_common.o \
services4/srvkm/bridged/sgx/bridged_sgx_bridge.o \
services4/srvkm/devices/sgx/sgxinit.o \
services4/srvkm/devices/sgx/sgxpower.o \
services4/srvkm/devices/sgx/sgxreset.o \
services4/srvkm/devices/sgx/sgxutils.o \
services4/srvkm/devices/sgx/sgxkick.o \
services4/srvkm/devices/sgx/sgxtransfer.o \
services4/srvkm/devices/sgx/mmu.o \
services4/srvkm/devices/sgx/pb.o \
services4/system/mt6589/sysconfig.o \
services4/system/mt6589/sysutils.o \
services4/srvkm/env/linux/mtk_debug.o \
services4/srvkm/env/linux/mtk_pp.o \
services4/srvkm/env/linux/mtk_hal_mm.o \
services4/srvkm/common/ttrace.o \
services4/system/mt6589/mtk_sysfreq.o \
services4/system/mtk_common/mtk_gpu_hal.o

pvrsrvkm-$(CONFIG_ION_MTK) += \
services4/srvkm/env/linux/ion.o

ifeq ($(SUPPORT_ION),1)
pvrsrvkm-y += \
services4/srvkm/env/linux/ion.o
endif

mtklfb-y := \
services4/3rdparty/mtklfb/mtklfb_displayclass.o \
services4/3rdparty/mtklfb/mtklfb_linux.o \
services4/3rdparty/mtklfb/mtklfb_debug.o

obj-$(CONFIG_PVR_SGX_MT6589) += pvrsrvkm.o
obj-$(CONFIG_PVR_SGX_MT6589) += mtklfb.o


61 changes: 61 additions & 0 deletions drivers/misc/pvrsgx-mt6589/include4/config_kernel_eng.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#define SGX_FEATURE_MP_CORE_COUNT 1
#define LINUX
#define PVR_BUILD_DIR "mt6589"
#define PVR_BUILD_TYPE "release"
#define PVRSRV_MODNAME "pvrsrvkm"
#define SGXCORE 544
#define SGX544
#define SUPPORT_SGX544
#define SUPPORT_SGX
#define SGX_CORE_REV 115
#define TRANSFER_QUEUE
#define PVR_SECURE_HANDLES
#define SUPPORT_LISR_MISR_SYNC
#define DISPLAY_CONTROLLER mtklfb
#define PVR_LINUX_MEM_AREA_POOL_MAX_PAGES 5400
#define PVR_LINUX_MEM_AREA_USE_VMAP
#define PVR_LINUX_MEM_AREA_POOL_ALLOW_SHRINK
#define RELEASE
#define DEBUG_LINUX_MEMORY_ALLOCATIONS
#define SUPPORT_PERCONTEXT_PB
#define SUPPORT_HW_RECOVERY
#define SUPPORT_ACTIVE_POWER_MANAGEMENT
#define SUPPORT_SGX_HWPERF
#define SUPPORT_SGX_LOW_LATENCY_SCHEDULING
#define SUPPORT_MEMINFO_IDS
#define SUPPORT_SGX_NEW_STATUS_VALS
#define SUPPORT_DBGDRV_EVENT_OBJECTS
#define SGX_FEATURE_SYSTEM_CACHE
#define SGX_FEATURE_MP
#define PVRSRV_USSE_EDM_STATUS_DEBUG
#define SYS_USING_INTERRUPTS
#define PVRSRV_NEW_PVR_DPF
#define PVRSRV_NEED_PVR_DPF
//#define SUPPORT_ION
#define SUPPORT_PVRSRV_DEVICE_CLASS
#define IMG_ADDRSPACE_PHYSADDR_BITS 32
#define SUPPORT_LINUX_X86_WRITECOMBINE
#define SUPPORT_LINUX_X86_PAT
#define SGX_DYNAMIC_TIMING_INFO
#define SYS_CUSTOM_POWERLOCK_WRAP
#define PVR_LINUX_USING_WORKQUEUES
#define PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE
#define PVR_LINUX_TIMERS_USING_WORKQUEUES
#define LDM_PLATFORM
#define PVR_LDM_DRIVER_REGISTRATION_NAME "pvrsrvkm"
#define PVRSRV_DUMP_MK_TRACE
#define SUPPORT_LARGE_GENERAL_HEAP
#define TTRACE
#define ANDROID
#define SUPPORT_PVRSRV_ANDROID_SYSTRACE
#define PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC
//#define SUPPORT_ION_HEADER "linux/ion.h"
//#define SUPPORT_ION_PRIV_HEADER "../drivers/gpu/ion/ion_priv.h"
#define USE_RGBA_8888_FB
#define MTK_DEBUG_LFB
#define MTK_DEBUG_TIMER_MONITOR
#define MTK_DEBUG_MSG_LENGTH 512
#define MTK_DEBUG_PROC_PRINT
#define MTK_DEBUG
#define MTK_HAL_MM_STATISTIC
#define MTK_FREQ_OD_INIT
54 changes: 54 additions & 0 deletions drivers/misc/pvrsgx-mt6589/include4/config_kernel_user.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
#define SGX_FEATURE_MP_CORE_COUNT 1
#define LINUX
#define PVR_BUILD_DIR "mt6589"
#define PVR_BUILD_TYPE "release"
#define PVRSRV_MODNAME "pvrsrvkm"
#define SGXCORE 544
#define SGX544
#define SUPPORT_SGX544
#define SUPPORT_SGX
#define SGX_CORE_REV 115
#define TRANSFER_QUEUE
#define PVR_SECURE_HANDLES
#define SUPPORT_LISR_MISR_SYNC
#define DISPLAY_CONTROLLER mtklfb
#define PVR_LINUX_MEM_AREA_POOL_MAX_PAGES 5400
#define PVR_LINUX_MEM_AREA_USE_VMAP
#define PVR_LINUX_MEM_AREA_POOL_ALLOW_SHRINK
#define RELEASE
#define SUPPORT_PERCONTEXT_PB
#define SUPPORT_HW_RECOVERY
#define SUPPORT_ACTIVE_POWER_MANAGEMENT
#define SUPPORT_SGX_HWPERF
#define SUPPORT_SGX_LOW_LATENCY_SCHEDULING
#define SUPPORT_MEMINFO_IDS
#define SUPPORT_SGX_NEW_STATUS_VALS
#define SUPPORT_DBGDRV_EVENT_OBJECTS
#define SGX_FEATURE_SYSTEM_CACHE
#define SGX_FEATURE_MP
#define SYS_USING_INTERRUPTS
#define PVRSRV_NEW_PVR_DPF
#define PVRSRV_NEED_PVR_DPF
//#define SUPPORT_ION
#define SUPPORT_PVRSRV_DEVICE_CLASS
#define IMG_ADDRSPACE_PHYSADDR_BITS 32
#define SUPPORT_LINUX_X86_WRITECOMBINE
#define SUPPORT_LINUX_X86_PAT
#define SGX_DYNAMIC_TIMING_INFO
#define SYS_CUSTOM_POWERLOCK_WRAP
#define PVR_LINUX_USING_WORKQUEUES
#define PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE
#define PVR_LINUX_TIMERS_USING_WORKQUEUES
#define LDM_PLATFORM
#define PVR_LDM_DRIVER_REGISTRATION_NAME "pvrsrvkm"
#define SUPPORT_LARGE_GENERAL_HEAP
#define ANDROID
#define SUPPORT_PVRSRV_ANDROID_SYSTRACE
#define PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC
//#define SUPPORT_ION_HEADER "linux/ion.h"
//#define SUPPORT_ION_PRIV_HEADER "../drivers/gpu/ion/ion_priv.h"
#define USE_RGBA_8888_FB
#define MTK_DEBUG_LFB
#define MTK_DEBUG_TIMER_MONITOR
#define MTK_HAL_MM_STATISTIC
#define MTK_FREQ_OD_INIT
Loading