Use extension for Lima X.Org serverflags

* Remove create_desktop_package.sh for rk3318 board from
   config/optional, clearing the whole directory tree
 * Add an extension to implement serverflags workaround
   for X.Org and Lima driver not being autodetected
 * Fix rk3318-box and rk322x family to use extension in place
   of 40-serverflags.conf bsp file
This commit is contained in:
Paolo Sabatino
2023-12-08 23:26:49 +01:00
committed by Paolo
parent 5599e234ba
commit f6baa4c2f2
6 changed files with 40 additions and 39 deletions

View File

@@ -10,6 +10,8 @@ BOOT_SCENARIO="tpl-blob-atf-mainline"
DDR_BLOB="rk33/rk3318_ddr_333Mhz_v1.16.bin"
BOOT_SOC="rk3328"
enable_extension xorg-lima-serverflags
function post_family_tweaks_bsp__rk3318-box() {
display_alert "Installing BSP firmware and fixups"

View File

@@ -1,7 +0,0 @@
# Fix for bad device detection for x.org when lima driver is in use
if [[ "$BRANCH" != "legacy" ]]; then
mkdir -p $destination/etc/X11/xorg.conf.d
cp $SRC/packages/bsp/rk3328/40-serverflags.conf $destination/etc/X11/xorg.conf.d
fi
# @TODO: @paolosabatino: this is no longer included in aggregation; it will have to be handled in some kind of extension

View File

@@ -16,6 +16,10 @@ BOOTPATCHDIR='v2022.04'
ARCH=armhf
SERIALCON=ttyS2
# enable extension to fix autodetection for Lima driver and x.org
# on non-legacy kernels
enable_extension xorg-lima-serverflags
case $BRANCH in
legacy)
@@ -173,10 +177,4 @@ family_tweaks_bsp() {
# Board selection script
install -m 755 $SRC/packages/bsp/rk322x/rk322x-config $destination/usr/sbin
# Fix for bad device detection for x.org when lima driver is in use
if [[ "$BRANCH" != "legacy" ]]; then
mkdir -p $destination/etc/X11/xorg.conf.d
cp $SRC/packages/bsp/rk322x/40-serverflags.conf $destination/etc/X11/xorg.conf.d
fi
}

View File

@@ -0,0 +1,34 @@
#
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2023 Armbian
# This file is a part of the Armbian Build Framework https://github.com/armbian/build/
#
# Install 40-serverflags.conf in xorg.conf.d directory because autodetection
# may be faulty on some x.org revisions.
function post_family_tweaks_bsp__install_lima_serverflags() {
display_alert "${EXTENSION} ${BOARD}" "adding lima x.org serverflags workaround to BSP" "info"
declare xorg_conf_dir="/etc/X11/xorg.conf.d"
declare conf_lima_file="40-serverflags.conf"
run_host_command_logged mkdir -pv "${destination}${xorg_conf_dir}"
cat <<- LIMA_SERVERFLAGS > "${destination}${xorg_conf_dir}/${conf_lima_file}"
Section "ServerFlags"
Option "AutoAddGPU" "off"
Option "Debug" "dmabuf_capable"
EndSection
Section "OutputClass"
Identifier "Lima"
Driver "modesetting"
MatchDriver "rockchip"
Option "AccelMethod" "glamor"
Option "PrimaryGPU" "true"
EndSection
LIMA_SERVERFLAGS
return 0
}

View File

@@ -1,13 +0,0 @@
Section "ServerFlags"
Option "AutoAddGPU" "off"
Option "Debug" "dmabuf_capable"
EndSection
Section "OutputClass"
Identifier "Lima"
Driver "modesetting"
MatchDriver "rockchip"
Option "AccelMethod" "glamor"
Option "PrimaryGPU" "true"
EndSection

View File

@@ -1,13 +0,0 @@
Section "ServerFlags"
Option "AutoAddGPU" "off"
Option "Debug" "dmabuf_capable"
EndSection
Section "OutputClass"
Identifier "Lima"
Driver "modesetting"
MatchDriver "rockchip"
Option "AccelMethod" "glamor"
Option "PrimaryGPU" "true"
EndSection