Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add glenfly arise1 series GPU DRM kernel driver(V33) #333

Merged
Merged
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
2 changes: 2 additions & 0 deletions drivers/gpu/drm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,8 @@ source "drivers/gpu/drm/sprd/Kconfig"

source "drivers/gpu/drm/phytium/Kconfig"

source "drivers/gpu/drm/arise/Kconfig"

config DRM_HYPERV
tristate "DRM Support for Hyper-V synthetic video device"
depends on DRM && PCI && MMU && HYPERV
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,4 @@ obj-y += solomon/
obj-$(CONFIG_DRM_SPRD) += sprd/
obj-$(CONFIG_DRM_LOONGSON) += loongson/
obj-$(CONFIG_DRM_PHYTIUM) += phytium/
obj-$(CONFIG_DRM_ARISE) += arise/
8 changes: 8 additions & 0 deletions drivers/gpu/drm/arise/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
config DRM_ARISE
tristate "Arise DRM"
default m
depends on DRM
select DRM_KMS_HELPER
help
Choose this option if you have an Glenfly Arise GPU. If M is selected
the module will be called arise.
83 changes: 83 additions & 0 deletions drivers/gpu/drm/arise/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
CHIP?=E3k
DRIVER_NAME?=arise
PRO_DRIVER_NAME=$(DRIVER_NAME)
TARGET_ARCH?=x86_64
DEBUG?=0
VIDEO_ONLY_FPGA?=0
RUN_HW_NULL?=0
HW_NULL?=0
CONFIG-GFGPU=m
ifeq ("$(M)", "")
CHECK_GCC_VERSION?=0
else
CHECK_GCC_VERSION?=1
endif

ccflags-y := -D__LINUX__ -DKERNEL_BUILD
ccflags-y += -Wno-undef -Wno-unused -Wno-missing-braces -Wno-missing-attributes -Wno-overflow -Wno-missing-prototypes -Wno-missing-declarations

ifeq ($(CHECK_GCC_VERSION), 1)

KERNEL_UNAME?=$(shell uname -r)
KERNEL_MODLIB:=/lib/modules/$(KERNEL_UNAME)
KERNEL_SOURCES:=$(shell test -d $(KERNEL_MODLIB)/source && echo $(KERNEL_MODLIB)/source || echo $(KERNEL_MODLIB)/build)
KERNEL_COMPILE_H=$(KERNEL_SOURCES)/include/generated/compile.h
KERNEL_COMPILE_H_EXIT=$(shell if [ -f $(KERNEL_COMPILE_H) ]; then echo 1; else echo 0; fi)

ifeq ($(KERNEL_COMPILE_H_EXIT), 1)

KERNEL_BUILT_GCC_STRING=$(shell cat ${KERNEL_COMPILE_H} | grep LINUX_COMPILER | cut -f 2 -d '"')
KERNEL_BUILT_GCC_VERSION=$(shell echo "${KERNEL_BUILT_GCC_STRING}" | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -n 1)
ifeq ("$(KERNEL_BUILT_GCC_VERSION)", "")
KERNEL_BUILT_GCC_VERSION=$(shell echo "${KERNEL_BUILT_GCC_STRING}" | grep -o '[0-9]\+\.[0-9]\+' | head -n 1)
endif

SYSTEM_GCC_VERSION=$(shell $(CC) -v 2>&1 | awk 'END{print}' | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -n 1)
ifeq ("$(SYSTEM_GCC_VERSION)", "")
SYSTEM_GCC_VERSION=$(shell $(CC) -v 2>&1 | awk 'END{print}' | grep -o '[0-9]\+\.[0-9]\+' | head -n 1)
endif

ifneq ("$(KERNEL_BUILT_GCC_VERSION)", "$(SYSTEM_GCC_VERSION)")
$(warning "Kernel Built GCC Version ($(KERNEL_BUILT_GCC_VERSION)) Are Differ From System GCC Version($(SYSTEM_GCC_VERSION))!!")
$(warning "System GCC Version Must Match To Kernel Built GCC Version!!")
$(warning "Please Check GCC Version!!")
endif

else
$(warning "$(KERNEL_COMPILE_H) not exist,can not do gcc version check,skip")
endif

endif

ifeq ($(DEBUG), 1)
ccflags-y += -ggdb3 -O2 -D_DEBUG_ -DGF_TRACE_EVENT=1
else
ccflags-y += -O2 -fno-strict-aliasing -fno-stack-protector -DGF_TRACE_EVENT=1
endif

ifeq ($(VIDEO_ONLY_FPGA), 1)
ccflags-y += -DVIDEO_ONLY_FPGA
endif

ifeq ($(RUN_HW_NULL), 1)
ccflags-y += -DGF_HW_NULL
else
ccflags-y += -DGF_PCIE_BUS
endif

ccflags-y += -I$(src)

ifeq ("$(M)", "")
ifeq ("$(O)", "")
GFGPU_FULL_PATH=$(src)
else
GFGPU_FULL_PATH=$(srctree)/$(src)
endif
else
GFGPU_FULL_PATH=$(src)
endif

include $(GFGPU_FULL_PATH)/core/Makefile
include $(GFGPU_FULL_PATH)/cbios/cbios.mk
include $(GFGPU_FULL_PATH)/linux/Makefile
obj-$(CONFIG_DRM_ARISE) := $(PRO_DRIVER_NAME).o
Loading
Loading