Files
DroidDeck/tools/gamescope/patches/0124-commit-done-at-import.patch
MaxsTechReview c5577478ca chore: remove source comments and unused code, translate every missing string (#1965)
* chore(i18n): translate every missing string in all locales

Adds the 87 strings the bottom-screen Dashboard and in-game stats pages
introduced to all 32 locales, plus the 51 older settings strings Japanese
and the 50 Chinese locales were still missing. Every locale now has all
3456 translatable strings with the same placeholders as English.

Also translates 36 entries that were still English where the language
does not use the English word, and makes es-419 touch_app_id use the same
%1$s placeholder as English.

* chore(patches): drop comments from the lines downstream patches add

Removes comment lines and trailing comments from lines our patches add,
with hunk headers recounted. Lines that a later patch uses as context
and the upstream backport 0123 are left as they are.

The gamescope, FEX, proot and xodus series still apply to their pinned
sources, and the patched trees differ only in those comments.
test_hud_frames now finds the HUD writer by its first declaration.

* docs: credit Greenlight, Better xCloud, viture-v2, GameNative and DiRTTelemetryErrorFix

These were credited only in source headers and NOTICE files.

* chore: remove source comments and unused functions

Removes explanatory comments from first-party Kotlin, Java, C, C++,
Rust, TypeScript, Python, shell, Gradle, CMake and workflow files.
License and attribution headers stay, and vendored third-party trees,
generated files and license files are untouched. A shellcheck directive
is kept, and udevmon's fallthrough comments became fallthrough attributes.

Syntax trees and token streams match the previous sources apart from the
comments and Python docstrings. Module docstrings that argparse prints
are kept, and device-smoke.sh prints the same --help text from a heredoc.

Also removes 37 functions and 4 fields that nothing referenced.

* chore: remove comments from the Syncthing integration and the latest main sources

* docs: credit Syncthing and the syncthing-android fork

* chore(i18n): translate the Syncthing strings in all locales

The 107 strings the Syncthing integration added are now in all 32 locales.
sync_web_path_locked names the Syncthing tab by its label.

* docs: credit @xXJSONDeruloXx for the HUD metric readers

The CPU, GPU load, thermal and battery readers come from their
PerformanceHudView pull requests #777, #877, #991, #1406 and #1573.
The FusionHUD credit line is unchanged.

* docs: credit the HUD metric readers to @xXJSONDeruloXx's work
2026-11-01 16:27:27 -05:00

101 lines
3.6 KiB
Diff

diff --git a/src/steamcompmgr.cpp b/src/steamcompmgr.cpp
index 22aa907..0aef598 100644
--- a/src/steamcompmgr.cpp
+++ b/src/steamcompmgr.cpp
@@ -8359,6 +8359,33 @@ static TempUpscaleImage_t *GetTempUpscaleImage( global_focus_t *pFocus, uint32_t
gamescope::ConVar<bool> cv_surface_update_force_only_current_surface( "surface_update_force_only_current_surface", false, "Force updates to apply only to the current surface, ignoring commits for other surfaces." );
+gamescope::ConVar<bool> cv_commit_ready_check( "commit_ready_check", true, "Check a new commit's fence at import; a finished frame is marked done in the same pass instead of through the image waiter." );
+
+// Set when update_wayland_res marks a commit done itself, so the main loop handles it in the same pass.
+static bool s_bXwaylandCommitsDoneAtImport = false;
+static bool s_bXdgCommitsDoneAtImport = false;
+
+static bool commit_fence_ready_now( int nFd )
+{
+ struct pollfd pfd = { .fd = nFd, .events = POLLIN, .revents = 0 };
+ return poll( &pfd, 1, 0 ) == 1 && ( pfd.revents & POLLIN );
+}
+
+static void note_commit_fence( bool bReadyAtImport )
+{
+ static uint64_t s_ulReady = 0, s_ulWaited = 0, s_ulLastLog = 0;
+ ( bReadyAtImport ? s_ulReady : s_ulWaited )++;
+ uint64_t now = get_time_in_nanos();
+ if ( !s_ulLastLog )
+ s_ulLastLog = now;
+ if ( now - s_ulLastLog >= 10'000'000'000ul )
+ {
+ xwm_log.infof( "commit fences, last 10 s: %lu ready at import, %lu waited for", s_ulReady, s_ulWaited );
+ s_ulReady = s_ulWaited = 0;
+ s_ulLastLog = now;
+ }
+}
+
void update_wayland_res(const std::shared_ptr<CommitDoneList_t> &doneCommits, steamcompmgr_win_t *w, ResListEntry_t& reslistentry)
{
struct wlr_buffer *buf = reslistentry.buf;
@@ -8602,7 +8629,10 @@ void update_wayland_res(const std::shared_ptr<CommitDoneList_t> &doneCommits, st
struct wlr_dmabuf_attributes dmabuf = {0};
if ( wlr_buffer_get_dmabuf( buf, &dmabuf ) )
{
- fence = dup( dmabuf.fd[0] );
+ if ( cv_commit_ready_check && commit_fence_ready_now( dmabuf.fd[0] ) )
+ bKnownReady = true;
+ else
+ fence = dup( dmabuf.fd[0] );
}
else
{
@@ -8610,11 +8640,22 @@ void update_wayland_res(const std::shared_ptr<CommitDoneList_t> &doneCommits, st
}
}
+ if ( cv_commit_ready_check )
+ {
+ if ( !bKnownReady && fence >= 0 && commit_fence_ready_now( fence ) )
+ bKnownReady = true;
+ note_commit_fence( bKnownReady );
+ }
+
gpuvis_trace_printf( "pushing wait for commit %lu win %lx", newCommit->commitID, w->type == steamcompmgr_win_type_t::XWAYLAND ? w->xwayland().id : 0 );
{
newCommit->SetFence( fence, mango_nudge, uMangoMsgType, doneCommits );
if ( bKnownReady )
+ {
newCommit->Signal();
+ if ( cv_commit_ready_check )
+ ( w->type == steamcompmgr_win_type_t::XWAYLAND ? s_bXwaylandCommitsDoneAtImport : s_bXdgCommitsDoneAtImport ) = true;
+ }
else
g_ImageWaiter.AddWaitable( newCommit.get() );
}
@@ -9400,6 +9441,12 @@ void steamcompmgr_check_xdg(bool vblank, uint64_t vblank_idx)
}
check_new_xdg_res();
+
+ if ( s_bXdgCommitsDoneAtImport )
+ {
+ s_bXdgCommitsDoneAtImport = false;
+ handle_done_commits_xdg( false, vblank_idx );
+ }
}
void update_edid_prop()
@@ -10512,6 +10559,13 @@ steamcompmgr_main(int argc, char **argv)
gamescope_xwayland_server_t *server = NULL;
for (size_t i = 0; (server = wlserver_get_xwayland_server(i)); i++)
check_new_xwayland_res(server->ctx.get());
+
+ if ( s_bXwaylandCommitsDoneAtImport )
+ {
+ s_bXwaylandCommitsDoneAtImport = false;
+ for (size_t i = 0; (server = wlserver_get_xwayland_server(i)); i++)
+ handle_done_commits_xwayland(server->ctx.get(), false, vblank_idx);
+ }
}