ARM Chromebook의 panfrost 드라이버를 커널 5.15에서 커널 5.4로 백포트하는 방법

ARM Chromebook의 panfrost 드라이버를 커널 5.15에서 커널 5.4로 백포트하는 방법

ARM Chromebook에서 qemu-kvm을 사용하여 Linux에서 FreeBSD를 가상화하는 프로젝트를 거의 완료했습니다.

모두 괜찮습니다. 가상 머신에서의 네트워킹도 가능합니다. 마지막 작업 하나를 완료해야 합니다.

Linux 배포판에서 panfrost 그래픽 드라이버를 사용할 수 있도록 모든 것을 선택하고 구성했습니다: Devuan 5.

ARM Chromebook에서 panfrost 드라이버를 1.1에서 1.2로 업그레이드하는 전체 프로세스가 무엇인지 알고 싶습니다.

지금 내가 한 일은 내가 사용하고 있는 커널(버전 5.4.257)에 대해 활성화하는 것입니다.

나에게 묻고 싶다면, 나는 더 높은 커널 버전을 사용하지 않기 때문에 대답은 버전 5.7부터 kvm이 arm 32비트용 메인라인 커널에서 제거되었지만 커널 버전에서는 제거되었다는 것입니다. 5.4는 아직 부분적으로 지원되고 있어서 이를 사용하기로 결정했습니다. 따라서 최신 커널을 사용하는 것은 여기서 해결책이 아닙니다.

이를 활성화하기 위해 커널 구성 파일에서 다음 매개변수를 활성화했습니다.

# Graphics support

CONFIG_VGA_ARB=y
CONFIG_VGA_ARB_MAX_GPUS=16
CONFIG_DRM=y
CONFIG_DRM_MIPI_DSI=y
CONFIG_DRM_DP_AUX_CHARDEV=y 
CONFIG_DRM_KMS_HELPER=y 
CONFIG_DRM_KMS_FB_HELPER=y 
CONFIG_DRM_FBDEV_EMULATION=y 
CONFIG_DRM_FBDEV_OVERALLOC=100 
CONFIG_DRM_LOAD_EDID_FIRMWARE=y 
CONFIG_DRM_TTM=y 
CONFIG_DRM_VRAM_HELPER=y 
CONFIG_DRM_GEM_CMA_HELPER=y 
CONFIG_DRM_KMS_CMA_HELPER=y 
CONFIG_DRM_GEM_SHMEM_HELPER=y 
CONFIG_DRM_SCHED=y
#I2C encoder or helper chips

CONFIG_DRM_I2C_NXP_TDA998X=y
#end of I2C encoder or helper chips

CONFIG_DRM_VGEM=m CONFIG_DRM_EXYNOS=y

#CRTCs

CONFIG_DRM_EXYNOS_FIMD=y
CONFIG_DRM_EXYNOS_MIXER=y

#Encoders and Bridges

CONFIG_DRM_EXYNOS_DPI=y
CONFIG_DRM_EXYNOS_DSI=y 
CONFIG_DRM_EXYNOS_DP=y 
CONFIG_DRM_EXYNOS_HDMI=y

#Sub-drivers

CONFIG_DRM_CIRRUS_QEMU=m 
CONFIG_DRM_RCAR_LVDS=m 
CONFIG_DRM_QXL=y 
ONFIG_DRM_BOCHS=y 
CONFIG_DRM_VIRTIO_GPU=m 
CONFIG_DRM_PANEL=y

#Display Panels

CONFIG_DRM_PANEL_LVDS=m 
CONFIG_DRM_PANEL_SIMPLE=y
#end of Display Panels

CONFIG_DRM_BRIDGE=y 
CONFIG_DRM_PANEL_BRIDGE=y

#Display Interface Bridges

CONFIG_DRM_NXP_PTN3460=y 
CONFIG_DRM_PARADE_PS8622=m 
CONFIG_DRM_ANALOGIX_DP=y
#end of Display Interface Bridges

CONFIG_DRM_PL111=m 
CONFIG_DRM_PANFROST=y 
CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y

#Frame buffer Devices
CONFIG_FB_CMDLINE=y 
CONFIG_FB_NOTIFY=y 
CONFIG_FB=y 
CONFIG_FIRMWARE_EDID=y 
CONFIG_FB_CFB_FILLRECT=y 
CONFIG_FB_CFB_COPYAREA=y 
CONFIG_FB_CFB_IMAGEBLIT=y 
CONFIG_FB_CFB_REV_PIXELS_IN_BYTE=y 
CONFIG_FB_SYS_FILLRECT=y 
CONFIG_FB_SYS_COPYAREA=y 
CONFIG_FB_SYS_IMAGEBLIT=y 
CONFIG_FB_SYS_FOPS=y 
CONFIG_FB_DEFERRED_IO=y 
CONFIG_FB_BACKLIGHT=y 
CONFIG_FB_MODE_HELPERS=y 
CONFIG_FB_TILEBLITTING=y
#Frame buffer hardware drivers

CONFIG_FB_DA8XX=y 
CONFIG_FB_SIMPLE=y 
CONFIG_FB_SSD1307=y
#end of Frame buffer Devices

#Backlight & LCD device support
CONFIG_LCD_CLASS_DEVICE=y 
CONFIG_LCD_PLATFORM=y 
CONFIG_BACKLIGHT_CLASS_DEVICE=y 
CONFIG_BACKLIGHT_PWM=y 
CONFIG_VIDEOMODE_HELPERS=y 
CONFIG_HDMI=y

일부 GPU 튜너 버그에도 불구하고 작동하는 것 같습니다.

# dmesg | grep panfrost

[0.378992] panfrost 11800000.gpu: clock rate = 533000000
[0.379769] panfrost 11800000.gpu: failed to get regulator: -517
[0.380517] panfrost 11800000.gpu: regulator init failed -517
[1.149575] panfrost 11800000.gpu: clock rate = 533000000
[1.150987] panfrost 11800000.gpu: mali-t600 id 0x600 major 0x0 minor 0x0 status 0x1
[1.152132] panfrost 11800000.gpu: features: 00000000,10206000, issues: 00000000,31b4dfff
[1.153271] panfrost 11800000.gpu: Features: L2:0x07110206 Shader:0x00000000 Tiler:0x00000809 Mem:0x1 MMU:0x00002830 AS:0xf JS:0x7
[1.154476] panfrost 11800000.gpu: shader_present=0xf l2_present=0x1
[1.158799] [drm] Initialized panfrost 1.1.0 20180908 for 11800000.gpu on minor 0

그렇다면 문제는 무엇입니까? 드라이버는 아래와 같이 사용된 커널이 5.15.120인 경우 1.1과 1.2를 고집합니다. 불행히도 커널 5.15를 사용할 수 없지만 동시에 panfrost 드라이버 버전 1.2를 원합니다 :P

# dmesg | grep panfrost

[3.352617] panfrost 11800000.gpu: clock rate = 533000000
[3.354011] panfrost 11800000.gpu: mali-t600 id 0x600 major 0x0 minor 0x0 status 0x1
[3.354020] panfrost 11800000.gpu: features: 00000000,10206000, issues: 00000000,31b4dfff
[3.354027] panfrost 11800000.gpu: Features: L2:0x07110206 Shader:0x00000000 Tiler:0x00000809 Mem:0x1 MMU:0x00002830 AS:0xf JS:0x7
[3.354035] panfrost 11800000.gpu: shader_present=0xf l2_present=0x1
[3.355009] [drm] Initialized panfrost 1.2.0 20180908 for 11800000.gpu on minor 1

아마도 아래 튜토리얼을 기반으로 업그레이드할 수 있을 것입니다: (또는 적어도 희망합니다)

https://gist.github.com/tstellanova/6f7844379e358ee81b89cf6937ea8139

보시다시피 권장 매개변수는 다음과 같습니다.

# meson build/ -Dgallium-drivers=lima,panfrost,kmsro,swrast
-Dplatforms=x11,drm,surfaceless -Dvulkan-drivers= -Ddri-drivers= -Dllvm=false

하지만 다음 오류가 발생하기 때문에 내 시스템에서는 작동하지 않습니다.

meson.build:21:0: ERROR: Options "drm and surfaceless" are not in allowed 
choices: "auto, x11, wayland, haiku, android, windows"

"-Dvulkan-drivers=enabled"를 활성화하면 다음 오류가 발생합니다.

meson.build:21:0: ERROR: Options "enabled" are not in allowed choices:
"auto, amd, broadcom, freedreno, intel, intel_hasvk, panfrost, swrast, virtio, imagination-experimental, microsoft-experimental, nouveau-experimental"

그래서 나는 그것들을 약간 수정했고 최소한 어떤 오류도 발생하지 않는 다음 매개변수를 발견했습니다.

# apt install libxcb-glx0-dev libx11-xcb-dev libxcb-present-dev libxshmfence-dev libxxf86vm-dev 

# git clone https://gitlab.freedesktop.org/mesa/mesa

# cd mesa

meson setup build/ -Dgallium-drivers=lima,panfrost,kmsro,swrast -Dplatforms=x11 -Dvulkan-drivers= -Dllvm=disabled

The Meson build system Version: 1.0.1 
Source dir: /Dati/mesa 
Build dir: /Dati/mesa/build 
Build type: native build 
Project name: mesa 
Project version: 23.3.0-devel

C compiler for the host machine: cc (gcc 12.2.0 "cc (Debian 12.2.0-14) 12.2.0")

C linker for the host machine: cc ld.bfd 2.40

C++ compiler for the host machine: c++ (gcc 12.2.0 "c++ (Debian 12.2.0-14) 12.2.0")

C++ linker for the host machine: c++ ld.bfd 2.40

Host machine cpu family: arm

Host machine cpu: armv7l

Checking if "-mtls-dialect=gnu2" runs: YES

Dependency vdpau skipped: feature gallium-vdpau disabled

Program glslangValidator found: NO

Dependency libva skipped: feature gallium-va disabled

Program python3 found: YES (/usr/bin/python3)

Fetching value of define "ETIME" : 62

Checking for function "bswap32" : YES

Checking for function "bswap64" : YES

Checking for function "clz" : YES

Checking for function "clzll" : YES

Checking for function "ctz" : YES

Checking for function "expect" : YES

Checking for function "ffs" : YES

Checking for function "ffsll" : YES

Checking for function "popcount" : YES

Checking for function "popcountll" : YES

Checking for function "unreachable" : YES
Checking for function "types_compatible_p" : YES
Compiler for C supports function attribute const: YES
Compiler for C supports function attribute flatten: YES
Compiler for C supports function attribute malloc: YES
Compiler for C supports function attribute pure: YES
Compiler for C supports function attribute unused: YES
Compiler for C supports function attribute warn_unused_result: YES
Compiler for C supports function attribute weak: YES
Compiler for C supports function attribute format: YES
Compiler for C supports function attribute packed: YES
Compiler for C supports function attribute returns_nonnull: YES
Compiler for C supports function attribute alias: YES
Compiler for C supports function attribute noreturn: YES
Compiler for C supports function attribute visibility:hidden: YES
Checking if "__uint128_t" compiles: NO
Checking for function "reallocarray" : YES
Checking for function "fmemopen" : YES
Checking if "gc-sections" : links: YES
Compiler for C supports arguments -Werror=implicit-function-declaration: YES
Compiler for C supports arguments -Werror=missing-prototypes: YES
Compiler for C supports arguments -Werror=return-type: YES
Compiler for C supports arguments -Werror=empty-body: YES
Compiler for C supports arguments -Werror=incompatible-pointer-types: YES
Compiler for C supports arguments -Werror=int-conversion: YES
Compiler for C supports arguments -Wimplicit-fallthrough: YES
Compiler for C supports arguments -Wmisleading-indentation: YES
Compiler for C supports arguments -Wno-missing-field-initializers: YES
Compiler for C supports arguments -Wno-format-truncation: YES
Compiler for C supports arguments -Wno-nonnull-compare: YES
Compiler for C supports arguments -fno-math-errno: YES
Compiler for C supports arguments -fno-trapping-math: YES
Compiler for C supports arguments -Qunused-arguments: NO
Compiler for C supports arguments -fno-common: YES
Compiler for C supports arguments -Wno-microsoft-enum-value: NO
Compiler for C supports arguments -Wno-unused-function: YES
Compiler for C supports arguments -Werror=format: YES
Compiler for C supports arguments -Wformat-security: YES
Compiler for C supports arguments -Werror=thread-safety: NO
Compiler for C supports arguments -ffunction-sections: YES
Compiler for C supports arguments -fdata-sections: YES
Compiler for C++ supports arguments -Werror=return-type: YES
Compiler for C++ supports arguments -Werror=empty-body: YES
Compiler for C++ supports arguments -Wmisleading-indentation: YES
Compiler for C++ supports arguments -Wno-non-virtual-dtor: YES
Compiler for C++ supports arguments -Wno-missing-field-initializers: YES
Compiler for C++ supports arguments -Wno-format-truncation: YES
Compiler for C++ supports arguments -fno-math-errno: YES
Compiler for C++ supports arguments -fno-trapping-math: YES
Compiler for C++ supports arguments -Qunused-arguments: NO
Compiler for C++ supports arguments -flifetime-dse=1: YES
Compiler for C++ supports arguments -Wno-microsoft-enum-value: NO
Compiler for C++ supports arguments -Werror=format: YES
Compiler for C++ supports arguments -Wformat-security: YES
Compiler for C++ supports arguments -ffunction-sections: YES
Compiler for C++ supports arguments -fdata-sections: YES
Compiler for C supports arguments -Wno-override-init: YES
Compiler for C supports arguments -Wno-initializer-overrides: NO
Compiler for C supports arguments -Werror=pointer-arith: YES
Compiler for C supports arguments -Werror=vla: YES
Compiler for C supports arguments -Werror=gnu-empty-initializer: NO
Compiler for C++ supports arguments -Werror=pointer-arith: YES
Compiler for C++ supports arguments -Werror=vla: YES
Compiler for C++ supports arguments -Werror=gnu-empty-initializer: NO
Checking for function "__builtin_ia32_clflushopt" : NO
Checking if "GCC atomic builtins" compiles: YES
Checking if "GCC atomic builtins required -latomic" : links: YES
Checking if "GCC 64bit atomics" with dependency : links: YES
Library ws2_32 found: NO
Header "sys/sysmacros.h" has symbol "major" : YES
Header "sys/sysmacros.h" has symbol "minor" : YES
Header "sys/sysmacros.h" has symbol "makedev" : YES
Header "sys/mkdev.h" has symbol "major" : NO
Check usable header "sched.h" : YES
Checking for function "sched_getaffinity" : YES
Check usable header "xlocale.h" : NO
Check usable header "linux/futex.h" : YES
Check usable header "endian.h" : YES
Check usable header "dlfcn.h" : YES
Check usable header "sys/shm.h" : YES
Check usable header "cet.h" : NO
Check usable header "pthread_np.h" : NO
Check usable header "renderdoc_app.h" : NO
Check usable header "sys/inotify.h" : YES
Checking for function "strtof" : YES
Checking for function "mkostemp" : YES
Checking for function "memfd_create" : YES
Checking for function "random_r" : YES
Checking for function "flock" : YES
Checking for function "strtok_r" : YES
Checking for function "getrandom" : YES
Checking for function "qsort_s" : NO
Checking for function "posix_fallocate" : YES
Checking if "GNU qsort_r" : links: YES
Header "time.h" has symbol "struct timespec" : YES
Checking for function "thrd_create" : YES
Header "errno.h" has symbol "program_invocation_name" : YES
Header "math.h" has symbol "issignaling" : YES
Checking for function "posix_memalign" : YES
Checking whether type "struct dirent" has member "d_type" : YES
Checking if "strtod has locale support" : links: YES
Checking if "Bsymbolic" : links: YES
Checking if "version-script" : links: YES
Checking if "dynamic-list" : links: YES
Compiler for C supports link arguments -Wl,--build-id=sha1: YES
Checking for function "dlopen" : YES
Checking for function "dladdr" with dependency : YES
Checking for function "dl_iterate_phdr" : YES
Checking for function "clock_gettime" : YES
Found pkg-config: /usr/bin/pkg-config (1.8.1)
Run-time dependency zlib found: YES 1.2.13
Run-time dependency libzstd found: YES 1.5.4
Run-time dependency threads found: YES
Checking for function "pthread_setaffinity_np" with dependency threads: YES
Run-time dependency expat found: YES 2.5.0
Library m found: YES
Run-time dependency libdrm found: YES 2.4.114
Run-time dependency libudev found: YES 251
Run-time dependency libelf found: YES 0.188
Run-time dependency valgrind found: NO (tried pkgconfig)
Program bison found: YES (/usr/bin/bison)
Program bison found: YES 3.8.2 (/usr/bin/bison)
Program flex found: YES (/usr/bin/flex)
Run-time dependency libunwind found: YES 1.6.2
Run-time dependency x11 found: YES 1.8.4
Run-time dependency xext found: YES 1.3.4
Run-time dependency xfixes found: YES 6.0.0
Run-time dependency xcb-glx found: YES 1.15
Run-time dependency xcb-shm found: YES 1.15
Run-time dependency xcb found: YES 1.15
Found CMake: /usr/bin/cmake (3.25.1)
Run-time dependency xcb-keysyms found: NO (tried pkgconfig and cmake)
Run-time dependency x11-xcb found: YES 1.8.4
Run-time dependency xcb-dri2 found: YES 1.15
Run-time dependency xcb-dri3 found: YES 1.15
Run-time dependency xcb-present found: YES 1.15
Dependency xcb-shm found: YES 1.15 (cached)
Run-time dependency xcb-sync found: YES 1.15
Run-time dependency xshmfence found: YES 1.3
Run-time dependency glproto found: YES 1.4.17
Run-time dependency dri2proto found: YES 2.8
Run-time dependency xxf86vm found: YES 1.1.4
Run-time dependency xcb-xfixes found: YES 1.15
Run-time dependency xcb-randr found: YES 1.15
Run-time dependency xrandr found: YES 1.5.2

Library sensors found: NO
Program nm found: YES (/usr/bin/nm)

Program symbols-check.py found: YES (/usr/bin/python3 /Dati/mesa/bin/symbols- check.py)

Program install_megadrivers.py found: YES (/usr/bin/python3 /Dati/mesa /bin/install_megadrivers.py)

Program decode.py found: YES (/Dati/mesa/src/compiler/isaspec/decode.py)

Program encode.py found: YES (/Dati/mesa/src/compiler/isaspec/encode.py)

Program ln found: YES (/bin/ln) Checking for function "mincore" : YES

Build targets in project: 214

mesa 23.3.0-devel

Directories 
prefix                       : /usr/local 
libdir                       : lib/arm-linux-gnueabihf 
includedir                   : include 
Common C and C++ arguments
c_cpp_args                   : -mtls-dialect=gnu2


OpenGL

OpenGL                       : YES 
ES1                          : YES 
ES2                          : YES 
Shared glapi                 : YES 
GLVND                        : NO

DRI 

Platform                     : drm 
Driver dir                   : /usr/local/lib/arm-linux-gnueabihf/dri

GLX 

Enabled                      : YES 
Provider                     : dri

EGL Enabled                  : YES 
Drivers                      : builtin:egl_dri2 builtin:egl_dri3 
Platforms                    : x11 surfaceless drm xcb

GBM 

Enabled                      : YES 
Backends path                : /usr/local/lib/arm-linux-gnueabihf/gbm
Vulkan Drivers               : NO 
Video Codecs                 : NO 
APIs                         : NO
LLVM Enabled                 : NO 
Gallium Enabled              : YES 
Drivers                      : lima panfrost kmsro swrast 
Platforms                    : x11 surfaceless drm xcb 
Frontends                    : mesa 
Off-screen rendering (OSMesa): NO 
HUD lm-sensors               : NO
Perfetto Enabled             : NO

User defined options

gallium-drivers              : lima,panfrost,kmsro,swrast 
llvm                         : disabled 
platforms                    : x11 
vulkan-drivers               :

Found ninja-1.11.1 at /usr/bin/ninja

그러나 panfrost 드라이버는 여전히 버전 1.1에서 멈춰 있습니다.

[drm] Initialized panfrost 1.1.0 20180908 for 11800000.gpu on minor 0

Panfrost 드라이버를 커널 5.4로 백포트하려고 했습니다(커널 5.15에 panfrost 소스 코드가 있는 폴더를 커널 5.4에 panfrost 소스 코드가 있는 폴더로 복사하고 다음 명령을 실행했습니다).

make zImage modules dtbs uImage LOADADDR=0x42004000

불행하게도 C++ 코드에는 수정 방법을 모르는 몇 가지 버그가 있습니다.

............
CC [M]  drivers/gpu/drm/panfrost/panfrost_drv.o
drivers/gpu/drm/panfrost/panfrost_drv.c: In function ‘panfrost_ioctl_get_param’:
drivers/gpu/drm/panfrost/panfrost_drv.c:35:14: error:
‘DRM_PANFROST_PARAM_AFBC_FEATURES’ undeclared (first use in this function); did y
ou mean ‘DRM_PANFROST_PARAM_MMU_FEATURES’?
  35 |         case DRM_PANFROST_PARAM_ ## name:               \
     |              ^~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/panfrost/panfrost_drv.c:66:17: note: in expansion of macro
‘PANFROST_FEATURE’
  66 |                 PANFROST_FEATURE(AFBC_FEATURES, afbc_features);
     |                 ^~~~~~~~~~~~~~~~
drivers/gpu/drm/panfrost/panfrost_drv.c:35:14: note: each undeclared identifier is
reported only once for each function it appears in
  35 |         case DRM_PANFROST_PARAM_ ## name:               \
     |              ^~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/panfrost/panfrost_drv.c:66:17: note: in expansion of macro
‘PANFROST_FEATURE’
  66 |                 PANFROST_FEATURE(AFBC_FEATURES, afbc_features);
     |                 ^~~~~~~~~~~~~~~~
drivers/gpu/drm/panfrost/panfrost_drv.c: In function ‘panfrost_ioctl_wait_bo’:
drivers/gpu/drm/panfrost/panfrost_drv.c:319:15: error: implicit declaration of
function ‘dma_resv_wait_timeout’; did you mean ‘dma_resv
_wait_timeout_rcu’? [-Werror=implicit-function-declaration]
 319 |         ret = dma_resv_wait_timeout(gem_obj->resv, true, true, timeout);
     |               ^~~~~~~~~~~~~~~~~~~~~
     |               dma_resv_wait_timeout_rcu
drivers/gpu/drm/panfrost/panfrost_drv.c: In function ‘panfrost_ioctl_madvise’:
drivers/gpu/drm/panfrost/panfrost_drv.c:430:48: error: passing argument 1 of
‘drm_gem_shmem_madvise’ from incompatible pointer type [-Werror=incompatible-
pointer-types]
 430 |         args->retained = drm_gem_shmem_madvise(&bo->base, args->madv);
     |                                                ^~~~~~~~~
     |                                                |
     |                                                struct drm_gem_shmem_object *
In file included from drivers/gpu/drm/panfrost/panfrost_gem.h:7,
                from drivers/gpu/drm/panfrost/panfrost_drv.c:17:
./include/drm/drm_gem_shmem_helper.h:140:50: note: expected ‘struct drm_gem_object
*’ but argument is of type ‘struct drm_gem_shmem_obj
ect *’
 140 | int drm_gem_shmem_madvise(struct drm_gem_object *obj, int madv);
     |                           ~~~~~~~~~~~~~~~~~~~~~~~^~~
drivers/gpu/drm/panfrost/panfrost_drv.c: In function ‘panfrost_probe’:
drivers/gpu/drm/panfrost/panfrost_drv.c:566:30: warning: passing argument 1 of
‘drm_dev_alloc’ discards ‘const’ qualifier from pointer
target type [-Wdiscarded-qualifiers]
 566 |         ddev = drm_dev_alloc(&panfrost_drm_driver, &pdev->dev);
     |                              ^~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/panfrost/panfrost_drv.c:11:
./include/drm/drm_drv.h:791:53: note: expected ‘struct drm_driver *’ but argument is
of type ‘const struct drm_driver *’
 791 | struct drm_device *drm_dev_alloc(struct drm_driver *driver,
     |                                  ~~~~~~~~~~~~~~~~~~~^~~~~~
cc1: some warnings being treated as errors
make[4]: *** [scripts/Makefile.build:262: drivers/gpu/drm/panfrost/panfrost_drv.o]
Errore 1
make[3]: *** [scripts/Makefile.build:497: drivers/gpu/drm/panfrost] Errore 2
make[2]: *** [scripts/Makefile.build:497: drivers/gpu/drm] Errore 2
make[1]: *** [scripts/Makefile.build:497: drivers/gpu] Errore 2
make: *** [Makefile:1750: drivers] Errore 2

답변1

음. 여기에 표시되는 내용은 두 가지입니다.

  1. 이전 커널에 복사해야 할 부분을 복사했습니다. 아직 존재하지 않는 기호를 얻으려고 합니다.
rivers/gpu/drm/panfrost/panfrost_drv.c: In function ‘panfrost_ioctl_get_param’:
drivers/gpu/drm/panfrost/panfrost_drv.c:35:14: error:
‘DRM_PANFROST_PARAM_AFBC_FEATURES’ undeclared (first use in this function); did y
ou mean ‘DRM_PANFROST_PARAM_MMU_FEATURES’?
  35 |         case DRM_PANFROST_PARAM_ ## name:               \
     |              ^~~~~~~~~~~~~~~~~~~
  1. 5.4 및 5.15에서 다른 API를 사용하려고 합니다.
drivers/gpu/drm/panfrost/panfrost_drv.c: In function ‘panfrost_ioctl_madvise’:
drivers/gpu/drm/panfrost/panfrost_drv.c:430:48: error: passing argument 1 of
‘drm_gem_shmem_madvise’ from incompatible pointer type [-Werror=incompatible-
pointer-types]
 430 |         args->retained = drm_gem_shmem_madvise(&bo->base, args->madv);
     |                                                ^~~~~~~~~
     |                                                |
     |                                                struct drm_gem_shmem_object *
In file included from drivers/gpu/drm/panfrost/panfrost_gem.h:7,
                from drivers/gpu/drm/panfrost/panfrost_drv.c:17:
./include/drm/drm_gem_shmem_helper.h:140:50: note: expected ‘struct drm_gem_object
*’ but argument is of type ‘struct drm_gem_shmem_obj
ect *’

둘 다 "방금 이 하위 폴더를 복사했습니다"가 일반적으로 백포트로 이동하는 방법이 아닌 이유를 보여주는 좋은 예입니다. 필요한 모든 것을 얻지 못하고 사용 중인 내부 API가 변경되지 않았다는 보장이 없습니다. 작동하지 않지만 디버깅하기가 어렵습니다)

당신이 해야 할 일은 먼저 원하는 panfrost 드라이버를 최종적으로 추가한 git 기록에서 변경 세트를 찾는 것입니다. 두 번째로 현재 커널과 해당 커널 사이의 공통 조상을 찾은 다음 DRM 드라이버를 체리 선택하는 것입니다. 모든 관련 변경 사항 분기점에서 커널 헤드까지 인프라에 연결됩니다.

여기서 정직한 질문은 왜 이전 커널을 사용하는가입니다. 솔직히 말해서 5.4를 사용하게 만드는 것이 무엇이든 아마도 더 쉬울 것입니다.그리고5.15 포워드 포팅은 최신 DRM 드라이버 중 하나를 백포팅하는 것보다 더 유용합니다.

좋은 소식은 그렇지 않을 수도 있다는 것입니다저것무서운. OFTC의 #panfrost IRC 채널에 접속하여 물어보세요. 당신의현재 작동 중인 LTS 버전이므로 이미 누군가 갖고 있을 수도 있습니다.가지다대부분의 작업이 완료되었습니다.

관련 정보