mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-05 12:35:42 +00:00
fix(desktop): Venus render node only in Desktop sessions
This commit is contained in:
1 parent
c6cec01b1d
commit
fceaaf5aa9
4 files changed
+32
-3
No files matched your search
@@ -364,11 +364,16 @@ public final class LinuxRuntime {
|
||||
|
||||
public static String gpuStandIn(Context context) {
|
||||
return gpuStandIn(path -> new File(path).exists(),
|
||||
() -> com.droiddeck.launcher.core.DeviceSupport.INSTANCE.openDriverActive(context)
|
||||
|| com.droiddeck.launcher.session.VenusComponent.wanted(context),
|
||||
() -> maliGuestDriver(com.droiddeck.launcher.core.DeviceSupport.INSTANCE.openDriverActive(context),
|
||||
() -> com.droiddeck.launcher.session.VenusComponent.wanted(context),
|
||||
com.droiddeck.launcher.session.SessionState.INSTANCE.getMode()),
|
||||
() -> com.droiddeck.launcher.core.DeviceSupport.INSTANCE.vkBridge(context));
|
||||
}
|
||||
|
||||
static boolean maliGuestDriver(boolean openDriver, java.util.function.BooleanSupplier venus, String sessionMode) {
|
||||
return openDriver || (com.droiddeck.launcher.session.SessionService.MODE_DESKTOP.equals(sessionMode) && venus.getAsBoolean());
|
||||
}
|
||||
|
||||
static String gpuStandIn(java.util.function.Predicate<String> exists, java.util.function.BooleanSupplier maliGuestDriver,
|
||||
java.util.function.BooleanSupplier bridge) {
|
||||
if (exists.test(KGSL_DEVICE)) return KGSL_DEVICE;
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.droiddeck.launcher.runtime
|
||||
|
||||
import android.app.Application
|
||||
import com.droiddeck.launcher.session.SessionService
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertNull
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
@@ -43,4 +46,23 @@ class LinuxRuntimeGpuStandInTest {
|
||||
LinuxRuntime.gpuStandIn({ it == kgsl }, { asked = true; true }, { asked = true; true })
|
||||
assertEquals(false, asked)
|
||||
}
|
||||
|
||||
@Test fun venusGetsTheMaliNodeOnlyOnDesktop() {
|
||||
assertTrue(LinuxRuntime.maliGuestDriver(false, { true }, SessionService.MODE_DESKTOP))
|
||||
assertFalse(LinuxRuntime.maliGuestDriver(false, { true }, SessionService.MODE_STEAM))
|
||||
assertFalse(LinuxRuntime.maliGuestDriver(false, { true }, SessionService.MODE_RUN))
|
||||
assertFalse(LinuxRuntime.maliGuestDriver(false, { false }, SessionService.MODE_DESKTOP))
|
||||
}
|
||||
|
||||
@Test fun openDriverPairGetsTheMaliNodeInEveryMode() {
|
||||
for (mode in listOf(SessionService.MODE_STEAM, SessionService.MODE_DESKTOP, SessionService.MODE_RUN)) {
|
||||
assertTrue(LinuxRuntime.maliGuestDriver(true, { false }, mode))
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun venusIsNotAskedOutsideDesktop() {
|
||||
var asked = false
|
||||
LinuxRuntime.maliGuestDriver(false, { asked = true; true }, SessionService.MODE_STEAM)
|
||||
assertFalse(asked)
|
||||
}
|
||||
}
|
||||
@@ -155,6 +155,8 @@ The SPIR-V version the driver gets:
|
||||
When the driver reports no render node, the layer reports the stand-in node's numbers
|
||||
(`DD_DRM_STANDIN=/dev/mali0`, bound into the guest as `/dev/dri/renderD<minor>`). The
|
||||
extension stays unlisted, and the layer is off in gamescope, so gamescope keeps its no-DRM path.
|
||||
Venus gets the stand-in node only in Desktop sessions. Steam and program sessions keep running
|
||||
without one, so their Xwayland, Zink and gamescope paths stay as they were.
|
||||
|
||||
Files:
|
||||
- `layer.c`: loader plumbing, feature and limit reporting, device creation, the hook table.
|
||||
|
||||
@@ -45,7 +45,7 @@ Zink for KWin 6.8, which removed QPainter. Older packages retain their software
|
||||
KWin runs without Gallium's threaded context and without overlay layers. With the threaded context, KWin crashed
|
||||
uploading windows' shared-memory buffers by reading past their end, and the host shows only a single buffer.
|
||||
On Android the launcher explicitly selects the GPU's render node (KGSL, or `/dev/mali0` as a
|
||||
stand-in for the Mali open driver and Venus); the nested backend can use it when the host's dmabuf
|
||||
stand-in for the Mali open driver, and for Venus in Desktop sessions); the nested backend can use it when the host's dmabuf
|
||||
feedback cannot name a DRM device. Without one, KWin 6.8 has no compositor and the desktop stays black. Games and emulators from the menu go
|
||||
through `droiddeck-gpu`, and Steam goes back to the app as a Steam session.
|
||||
|
||||
|
||||
Reference in new issue
Block a user