Skip to content

Commit 88ccee2

Browse files
brightyiWangYuli
authored andcommitted
drm/arise: Add glenfly arise1 series GPU DRM kernel driver
[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]>
1 parent e7b8564 commit 88ccee2

File tree

281 files changed

+166283
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

281 files changed

+166283
-0
lines changed

drivers/gpu/drm/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ source "drivers/gpu/drm/solomon/Kconfig"
390390

391391
source "drivers/gpu/drm/sprd/Kconfig"
392392

393+
source "drivers/gpu/drm/arise/Kconfig"
394+
393395
config DRM_HYPERV
394396
tristate "DRM Support for Hyper-V synthetic video device"
395397
depends on DRM && PCI && MMU && HYPERV

drivers/gpu/drm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,4 @@ obj-$(CONFIG_DRM_HYPERV) += hyperv/
199199
obj-y += solomon/
200200
obj-$(CONFIG_DRM_SPRD) += sprd/
201201
obj-$(CONFIG_DRM_LOONGSON) += loongson/
202+
obj-$(CONFIG_DRM_ARISE) += arise/

drivers/gpu/drm/arise/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
config DRM_ARISE
2+
tristate "Arise DRM"
3+
depends on DRM
4+
select DRM_KMS_HELPER
5+
help
6+
Choose this option if you have an Glenfly Arise GPU. If M is selected
7+
the module will be called arise.

drivers/gpu/drm/arise/Makefile

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
CHIP?=E3k
2+
DRIVER_NAME?=arise
3+
TARGET_ARCH?=x86_64
4+
DEBUG?=0
5+
VIDEO_ONLY_FPGA?=0
6+
RUN_HW_NULL?=0
7+
HW_NULL?=0
8+
CONFIG_DRM_ARISE?=m
9+
ifeq ("$(M)", "")
10+
CHECK_GCC_VERSION?=0
11+
else
12+
CHECK_GCC_VERSION?=1
13+
endif
14+
15+
ccflags-y := -D__LINUX__ -DKERNEL_BUILD
16+
ccflags-y += -Wno-undef -Wno-unused -Wno-missing-braces -Wno-overflow -Wno-missing-prototypes -Wno-missing-declarations
17+
ccflags-y += $(call cc-option, -Wno-missing-attributes)
18+
19+
ifeq ($(CHECK_GCC_VERSION), 1)
20+
21+
KERNEL_UNAME?=$(shell uname -r)
22+
KERNEL_MODLIB:=/lib/modules/$(KERNEL_UNAME)
23+
KERNEL_SOURCES:=$(shell test -d $(KERNEL_MODLIB)/source && echo $(KERNEL_MODLIB)/source || echo $(KERNEL_MODLIB)/build)
24+
KERNEL_COMPILE_H=$(KERNEL_SOURCES)/include/generated/compile.h
25+
KERNEL_COMPILE_H_EXIT=$(shell if [ -f $(KERNEL_COMPILE_H) ]; then echo 1; else echo 0; fi)
26+
27+
ifeq ($(KERNEL_COMPILE_H_EXIT), 1)
28+
29+
KERNEL_BUILT_GCC_STRING=$(shell cat ${KERNEL_COMPILE_H} | grep LINUX_COMPILER | cut -f 2 -d '"')
30+
KERNEL_BUILT_GCC_VERSION=$(shell echo "${KERNEL_BUILT_GCC_STRING}" | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -n 1)
31+
ifeq ("$(KERNEL_BUILT_GCC_VERSION)", "")
32+
KERNEL_BUILT_GCC_VERSION=$(shell echo "${KERNEL_BUILT_GCC_STRING}" | grep -o '[0-9]\+\.[0-9]\+' | head -n 1)
33+
endif
34+
35+
SYSTEM_GCC_VERSION=$(shell $(CC) -v 2>&1 | awk 'END{print}' | grep -o '[0-9]\+\.[0-9]\+\.[0-9]\+' | head -n 1)
36+
ifeq ("$(SYSTEM_GCC_VERSION)", "")
37+
SYSTEM_GCC_VERSION=$(shell $(CC) -v 2>&1 | awk 'END{print}' | grep -o '[0-9]\+\.[0-9]\+' | head -n 1)
38+
endif
39+
40+
ifneq ("$(KERNEL_BUILT_GCC_VERSION)", "$(SYSTEM_GCC_VERSION)")
41+
$(warning "Kernel Built GCC Version ($(KERNEL_BUILT_GCC_VERSION)) Are Differ From System GCC Version($(SYSTEM_GCC_VERSION))!!")
42+
$(warning "System GCC Version Must Match To Kernel Built GCC Version!!")
43+
$(warning "Please Check GCC Version!!")
44+
endif
45+
46+
else
47+
$(warning "$(KERNEL_COMPILE_H) not exist,can not do gcc version check,skip")
48+
endif
49+
50+
endif
51+
52+
ifeq ($(DEBUG), 1)
53+
ccflags-y += -ggdb3 -O2 -D_DEBUG_ -DGF_TRACE_EVENT=1
54+
else
55+
ccflags-y += -O2 -fno-strict-aliasing -fno-stack-protector -DGF_TRACE_EVENT=1
56+
endif
57+
58+
ifeq ($(VIDEO_ONLY_FPGA), 1)
59+
ccflags-y += -DVIDEO_ONLY_FPGA
60+
endif
61+
62+
ifeq ($(RUN_HW_NULL), 1)
63+
ccflags-y += -DGF_HW_NULL
64+
else
65+
ccflags-y += -DGF_PCIE_BUS
66+
endif
67+
68+
ccflags-y += -I$(src)
69+
70+
ifeq ("$(M)", "")
71+
ifeq ("$(O)", "")
72+
GFGPU_FULL_PATH=$(src)
73+
else
74+
GFGPU_FULL_PATH=$(srctree)/$(src)
75+
endif
76+
else
77+
GFGPU_FULL_PATH=$(src)
78+
endif
79+
80+
include $(GFGPU_FULL_PATH)/core/Makefile
81+
include $(GFGPU_FULL_PATH)/cbios/cbios.mk
82+
include $(GFGPU_FULL_PATH)/linux/Makefile
83+
obj-$(CONFIG_DRM_ARISE) := $(DRIVER_NAME).o

0 commit comments

Comments
 (0)