mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-18 20:36:04 +00:00
session: run as a game — game category + game_mode_config, sustained performance mode, fastest display mode, ADPF hint session on the compositor thread, 16 KB-aligned libraries
The manifest now declares the app a game (appCategory, isGame) with a game_mode_config that welcomes Performance mode and refuses the OS-side FPS cap and resolution downgrade — the interventions that make a regular flagship's Big Picture crawl while a gaming phone's does not. The session window asks for sustained performance mode and the panel's fastest mode at its size, tells GameManager it is in gameplay, and opens a PerformanceHintManager session over the compositor thread fed with each presented frame's interval against the panel's period. All version-guarded (6/7/12/13); the session log carries one 'perf:' line saying what took. The app's own libraries link with 16 KB-aligned LOAD segments (loads unchanged on 4 KB kernels). Six prebuilt PulseAudio libraries under jniLibs are still 4 KB-only and need a rebuild.
This commit is contained in:
1 parent
7ddfb57610
commit
06e67cd7d5
8 files changed
+216
-1
No files matched your search
@@ -38,6 +38,7 @@ extern volatile int g_output_w, g_output_h;
|
||||
#define TAG "BannerWayland"
|
||||
|
||||
static JavaVM *g_jvm;
|
||||
static volatile pid_t g_comp_tid; /* the compositor thread, for the app's ADPF hint session */
|
||||
static jclass g_compositor_cls; /* global ref */
|
||||
static jmethodID g_on_first_frame; /* static void onFirstFramePresented() */
|
||||
static jmethodID g_on_game_surface; /* static void onGameSurface(String, String) */
|
||||
@@ -183,6 +184,7 @@ static void *comp_thread(void *arg) {
|
||||
* thread that started it had. Never lowered: a thread that already runs hotter keeps its value. */
|
||||
pthread_setname_np(pthread_self(), "wl-compositor");
|
||||
const id_t tid = (id_t)gettid();
|
||||
g_comp_tid = (pid_t)tid;
|
||||
errno = 0;
|
||||
const int before = getpriority(PRIO_PROCESS, tid);
|
||||
int refused = 0;
|
||||
@@ -217,6 +219,14 @@ static void start_thread(void) {
|
||||
__android_log_print(ANDROID_LOG_ERROR, TAG, "pthread_create failed");
|
||||
}
|
||||
|
||||
/* The compositor thread's tid, or 0 before it starts. The app opens a PerformanceHintManager session
|
||||
* on it and reports each presented frame's interval, so the governor sees a frame that ran long. */
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_steamdeck_launcher_wayland_WaylandCompositor_nativeCompositorTid(JNIEnv *env, jclass clazz) {
|
||||
(void)env; (void)clazz;
|
||||
return (jint)g_comp_tid;
|
||||
}
|
||||
|
||||
/* Headless start (no output window) — used for bring-up tests. */
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_steamdeck_launcher_wayland_WaylandCompositor_nativeStart(JNIEnv *env, jclass clazz,
|
||||
|
||||
Reference in new issue
Block a user