Skip to content

Re-enable and fix GL window system cleanup#961

Merged
jrfonseca merged 2 commits into
apitrace:masterfrom
anholt:cleanup
Sep 24, 2025
Merged

Re-enable and fix GL window system cleanup#961
jrfonseca merged 2 commits into
apitrace:masterfrom
anholt:cleanup

Conversation

@anholt

@anholt anholt commented Sep 23, 2025

Copy link
Copy Markdown
Contributor

We have a number of apitraces that we'd like to use for driver performance work with perfetto or MESA_GPU_TRACES=print_*, but we can't because a lack of cleanup of the window system means that the output gets arbitrarily truncated.

I've now confirmed that my screen gets destroyed on an EGL and a GLX trace from traces-db, with and without waffle. TBD: d3d.

This reverts commit f9e11f9.

I expect that XCloseDisplay is just fine with Mesa as of some point in
the last 13 years.  Regardless, if there's a problem with either GLX
or EGL then we'd want to disable cleanup in the specific WS backend,
not the frontend.

With this, glws::cleanupX() gets called again, destroying our contexts
and screen in Mesa, which means that utrace events get properly
collected and flushed so that we can do performance analysis of
apitrace replays.
eglTerminate() doesn't free a context until it's also not current.

With this, our contexts and screen get destroyed in Mesa which means
that utrace events get properly collected and flushed so that we
can do performance analysis of apitrace replays.
@jrfonseca

Copy link
Copy Markdown
Member

Makes sense. Thanks

@jrfonseca jrfonseca merged commit af81c3b into apitrace:master Sep 24, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants