Skip to content

Commit b1e0d3b

Browse files
committed
refactor(linux): source display backend from libvirtualdisplay
Remove the duplicated DRM, broker, installer, and test sources from Vibeshine; consume the libvirtualdisplay Linux assets and public control client through the pinned submodule instead.
1 parent b48894d commit b1e0d3b

45 files changed

Lines changed: 70 additions & 8889 deletions

Some content is hidden

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

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ include(${CMAKE_MODULE_PATH}/prep/options.cmake)
5959
# initial prep
6060
include(${CMAKE_MODULE_PATH}/prep/init.cmake)
6161

62+
# Resolve libvirtualdisplay before platform package templates consume its
63+
# driver-owned assets. The dependency target itself is added later.
64+
include(${CMAKE_MODULE_PATH}/dependencies/libvirtualdisplay_source.cmake)
65+
6266
# configure special package files, such as sunshine.desktop, Flatpak manifest, Portfile , etc.
6367
include(${CMAKE_MODULE_PATH}/prep/special_package_configuration.cmake)
6468

cmake/dependencies/common.cmake

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,7 @@ add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/Simple-Web-Server")
2020
add_subdirectory("${CMAKE_SOURCE_DIR}/third-party/libdisplaydevice")
2121

2222
# libvirtualdisplay
23-
set(SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR "" CACHE PATH "Path to libvirtualdisplay source")
24-
if(NOT SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR)
25-
if(EXISTS "${CMAKE_SOURCE_DIR}/third-party/libvirtualdisplay/CMakeLists.txt")
26-
set(SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR "${CMAKE_SOURCE_DIR}/third-party/libvirtualdisplay")
27-
elseif(EXISTS "${CMAKE_SOURCE_DIR}/../libvirtualdisplay/CMakeLists.txt")
28-
set(SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR "${CMAKE_SOURCE_DIR}/../libvirtualdisplay")
29-
endif()
30-
endif()
31-
32-
if(NOT SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR OR NOT EXISTS "${SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR}/CMakeLists.txt")
33-
message(FATAL_ERROR "libvirtualdisplay source not found. Set SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR.")
34-
endif()
35-
23+
include(dependencies/libvirtualdisplay_source)
3624
add_subdirectory("${SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR}" "${CMAKE_BINARY_DIR}/third-party/libvirtualdisplay")
3725

3826
# common dependencies
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
include_guard(GLOBAL)
2+
3+
set(SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR "" CACHE PATH "Path to libvirtualdisplay source")
4+
if(NOT SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR)
5+
if(EXISTS "${CMAKE_SOURCE_DIR}/third-party/libvirtualdisplay/CMakeLists.txt")
6+
set(SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR "${CMAKE_SOURCE_DIR}/third-party/libvirtualdisplay")
7+
elseif(EXISTS "${CMAKE_SOURCE_DIR}/../libvirtualdisplay/CMakeLists.txt")
8+
set(SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR "${CMAKE_SOURCE_DIR}/../libvirtualdisplay")
9+
endif()
10+
endif()
11+
12+
if(NOT SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR OR
13+
NOT EXISTS "${SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR}/CMakeLists.txt")
14+
message(FATAL_ERROR "libvirtualdisplay source not found. Set SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR.")
15+
endif()
16+
17+
set(LIBVIRTUALDISPLAY_LINUX_ROOT "${SUNSHINE_LIBVIRTUALDISPLAY_SOURCE_DIR}/linux")

cmake/packaging/linux.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ else()
2424

2525
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
2626
install(PROGRAMS
27-
"${CMAKE_SOURCE_DIR}/packaging/linux/vibeshine-vkms"
27+
"${LIBVIRTUALDISPLAY_LINUX_ROOT}/packaging/vibeshine-vkms"
2828
"${CMAKE_CURRENT_BINARY_DIR}/vibeshine-drm-install"
2929
DESTINATION "${VIBESHINE_PRIVILEGED_LIBEXEC_INSTALL_DIR}")
30-
install(DIRECTORY "${CMAKE_SOURCE_DIR}/packaging/linux/vibeshine-drm/"
30+
install(DIRECTORY "${LIBVIRTUALDISPLAY_LINUX_ROOT}/vibeshine-drm/"
3131
DESTINATION "${VIBESHINE_DRM_SOURCE_INSTALL_DIR}"
3232
FILES_MATCHING
3333
PATTERN "*.c"
@@ -36,7 +36,7 @@ else()
3636
PATTERN "Makefile"
3737
PATTERN "README*"
3838
PATTERN "LICENSE*")
39-
install(PROGRAMS "${CMAKE_SOURCE_DIR}/packaging/linux/vibeshine-drm/build-module"
39+
install(PROGRAMS "${LIBVIRTUALDISPLAY_LINUX_ROOT}/vibeshine-drm/build-module"
4040
DESTINATION "${VIBESHINE_DRM_SOURCE_INSTALL_DIR}")
4141
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/vibeshine-drm-dkms.conf"
4242
DESTINATION "${VIBESHINE_DRM_SOURCE_INSTALL_DIR}"

cmake/prep/special_package_configuration.cmake

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,35 @@ elseif(UNIX)
3131
set(VIBESHINE_PRIVILEGED_LIBEXEC_INSTALL_DIR "/usr/libexec/vibeshine")
3232
set(VIBESHINE_DRM_SOURCE_INSTALL_DIR "/usr/src/vibeshine-drm-${PROJECT_VERSION_NUMERIC}")
3333
set(VIBESHINE_SYSTEM_UNIT_INSTALL_DIR "/usr/lib/systemd/system")
34+
if(NOT LIBVIRTUALDISPLAY_LINUX_ROOT OR NOT EXISTS "${LIBVIRTUALDISPLAY_LINUX_ROOT}/vibeshine-drm/Makefile")
35+
message(FATAL_ERROR "libvirtualdisplay Linux assets are unavailable")
36+
endif()
3437
file(GLOB VIBESHINE_DRM_HASH_INPUTS CONFIGURE_DEPENDS
35-
"${CMAKE_SOURCE_DIR}/packaging/linux/vibeshine-drm/*.c"
36-
"${CMAKE_SOURCE_DIR}/packaging/linux/vibeshine-drm/*.h")
38+
"${LIBVIRTUALDISPLAY_LINUX_ROOT}/vibeshine-drm/*.c"
39+
"${LIBVIRTUALDISPLAY_LINUX_ROOT}/vibeshine-drm/*.h")
3740
list(APPEND VIBESHINE_DRM_HASH_INPUTS
38-
"${CMAKE_SOURCE_DIR}/packaging/linux/vibeshine-drm/Makefile"
39-
"${CMAKE_SOURCE_DIR}/packaging/linux/vibeshine-drm/build-module"
40-
"${CMAKE_SOURCE_DIR}/packaging/linux/vibeshine-drm/dkms.conf.in")
41+
"${LIBVIRTUALDISPLAY_LINUX_ROOT}/vibeshine-drm/Makefile"
42+
"${LIBVIRTUALDISPLAY_LINUX_ROOT}/vibeshine-drm/build-module"
43+
"${LIBVIRTUALDISPLAY_LINUX_ROOT}/vibeshine-drm/dkms.conf.in")
4144
list(SORT VIBESHINE_DRM_HASH_INPUTS)
4245
set(VIBESHINE_DRM_HASH_MATERIAL "")
4346
foreach(VIBESHINE_DRM_HASH_INPUT IN LISTS VIBESHINE_DRM_HASH_INPUTS)
4447
file(SHA256 "${VIBESHINE_DRM_HASH_INPUT}" VIBESHINE_DRM_INPUT_HASH)
4548
file(RELATIVE_PATH VIBESHINE_DRM_INPUT_NAME
46-
"${CMAKE_SOURCE_DIR}/packaging/linux/vibeshine-drm"
49+
"${LIBVIRTUALDISPLAY_LINUX_ROOT}/vibeshine-drm"
4750
"${VIBESHINE_DRM_HASH_INPUT}")
4851
string(APPEND VIBESHINE_DRM_HASH_MATERIAL
4952
"${VIBESHINE_DRM_INPUT_NAME}:${VIBESHINE_DRM_INPUT_HASH}\n")
5053
endforeach()
5154
string(SHA256 VIBESHINE_DRM_SOURCE_ID "${VIBESHINE_DRM_HASH_MATERIAL}")
5255
# Privileged services that build and provision Vibeshine's virtual
5356
# display outputs before the display manager enumerates DRM devices.
54-
configure_file(packaging/linux/vibeshine-vkms.service.in vibeshine-vkms.service @ONLY)
55-
configure_file(packaging/linux/vibeshine-vkms-control.socket.in vibeshine-vkms-control.socket @ONLY)
56-
configure_file(packaging/linux/vibeshine-vkms-control@.service.in vibeshine-vkms-control@.service @ONLY)
57-
configure_file(packaging/linux/vibeshine-drm-setup.service.in vibeshine-drm-setup.service @ONLY)
58-
configure_file(packaging/linux/vibeshine-drm-install.in vibeshine-drm-install @ONLY)
59-
configure_file(packaging/linux/vibeshine-drm/dkms.conf.in vibeshine-drm-dkms.conf @ONLY)
57+
configure_file("${LIBVIRTUALDISPLAY_LINUX_ROOT}/packaging/vibeshine-vkms.service.in" vibeshine-vkms.service @ONLY)
58+
configure_file("${LIBVIRTUALDISPLAY_LINUX_ROOT}/packaging/vibeshine-vkms-control.socket.in" vibeshine-vkms-control.socket @ONLY)
59+
configure_file("${LIBVIRTUALDISPLAY_LINUX_ROOT}/packaging/vibeshine-vkms-control@.service.in" vibeshine-vkms-control@.service @ONLY)
60+
configure_file("${LIBVIRTUALDISPLAY_LINUX_ROOT}/packaging/vibeshine-drm-setup.service.in" vibeshine-drm-setup.service @ONLY)
61+
configure_file("${LIBVIRTUALDISPLAY_LINUX_ROOT}/packaging/vibeshine-drm-install.in" vibeshine-drm-install @ONLY)
62+
configure_file("${LIBVIRTUALDISPLAY_LINUX_ROOT}/vibeshine-drm/dkms.conf.in" vibeshine-drm-dkms.conf @ONLY)
6063
file(READ "${CMAKE_SOURCE_DIR}/src_assets/linux/misc/postinst" VIBESHINE_BASE_POSTINST)
6164
configure_file(packaging/linux/vibeshine-postinst.in postinst @ONLY)
6265
configure_file(packaging/linux/vibeshine-prerm.in prerm @ONLY)

docs/configuration.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,8 @@ editing the `conf` file in a text editor. Use the examples as reference.
11981198
Linux-only list of DRM connector names reserved for private streaming displays.
11991199
Separate names with commas, or provide a JSON string array. Leave this empty to
12001200
auto-discover outputs created by the packaged <code>vibeshine-vkms.service</code>.
1201+
The Linux DRM driver, connector broker, and service assets are supplied by the
1202+
bundled <code>libvirtualdisplay</code> dependency.
12011203
Explicit connector names are useful for a forced-EDID or hardware dummy output.
12021204
</td>
12031205
</tr>

docs/linux/LEARNINGS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ groups $USER | grep -E "input|video|render"
259259
> then run `sudo systemctl enable --now vibeshine-vkms.service` to provision four dormant managed
260260
> private outputs. The privileged helper always remains under the fixed, root-owned
261261
> `/usr/libexec/vibeshine` path, independent of the application install prefix.
262+
> The reusable DRM source, installer, connector broker, and systemd templates are owned by the
263+
> `third-party/libvirtualdisplay` submodule. Vibeshine owns the package wiring and its
264+
> KScreen/session/capture policy; do not duplicate the driver under `packaging/linux`.
262265
> These outputs advertise HDR10 (BT.2020, PQ, and static HDR metadata) and expose 10-bit connector
263266
> and plane support. Managed HDR capture uses direct DRM/KMS so the 10-bit scanout reaches the
264267
> encoder; KWin ScreenCast remains the recommended SDR path. If the module cannot be built or

packaging/linux/tests/test-vibeshine-drm-build-module.sh

Lines changed: 0 additions & 55 deletions
This file was deleted.

packaging/linux/tests/test-vibeshine-drm-contract.py

Lines changed: 0 additions & 147 deletions
This file was deleted.

0 commit comments

Comments
 (0)