Skip to content

Commit

Permalink
drm/arise: Add glenfly arise1 series GPU DRM kernel driver
Browse files Browse the repository at this point in the history
[Glenfly]:
This version driver is the initial version for linux kernel 6.6,
and added basic arch support for amd64/arm64/loongarch64.

Test pass on deepin V23.

Version: 25.00.36.

Link: deepin-community/kernel#333
Link: https://gitee.com/openkylin/linux/pulls/241
Link: deepin-community/kernel#390
Link: deepin-community/kernel#490
Link: deepin-community/kernel#496
Link: deepin-community/kernel#509
Co-developed-by: WangYuli <[email protected]>
Signed-off-by: WangYuli <[email protected]>
Signed-off-by: brightyi <[email protected]>
Signed-off-by: WangYuli <[email protected]>
  • Loading branch information
brightyi authored and Avenger-285714 committed Dec 29, 2024
1 parent e7b8564 commit 88ccee2
Show file tree
Hide file tree
Showing 281 changed files with 166,283 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ source "drivers/gpu/drm/solomon/Kconfig"

source "drivers/gpu/drm/sprd/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 @@ -199,3 +199,4 @@ obj-$(CONFIG_DRM_HYPERV) += hyperv/
obj-y += solomon/
obj-$(CONFIG_DRM_SPRD) += sprd/
obj-$(CONFIG_DRM_LOONGSON) += loongson/
obj-$(CONFIG_DRM_ARISE) += arise/
7 changes: 7 additions & 0 deletions drivers/gpu/drm/arise/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
config DRM_ARISE
tristate "Arise DRM"
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
TARGET_ARCH?=x86_64
DEBUG?=0
VIDEO_ONLY_FPGA?=0
RUN_HW_NULL?=0
HW_NULL?=0
CONFIG_DRM_ARISE?=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-overflow -Wno-missing-prototypes -Wno-missing-declarations
ccflags-y += $(call cc-option, -Wno-missing-attributes)

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) := $(DRIVER_NAME).o
Loading

0 comments on commit 88ccee2

Please sign in to comment.