Repository navigation
Conversation
If the OSD shm pool could not be allocated, osd_buffer_create() passed a NULL pool to wl_shm_pool_create_buffer(). If a pool already existed, the old pool and its buffers were kept, and draw_osd() copied the OSD for the new size into the smaller mapping. Destroy the old pool before allocating the new one, and don't create OSD buffers without a pool. A failed allocation now leaves no OSD until a later resize allocates the pool. Not compiled or tested. The error paths need a failing memfd, mmap or wl_shm_create_pool and were checked by reading the code.
Dudemanguy
reviewed
Oct 25, 2026
|
|
||
| if (p->osd_shm_pool && p->osd_shm_width == vo->dwidth && | ||
| p->osd_shm_height == vo->dheight) | ||
| return; |
Member
There was a problem hiding this comment.
This check should be in resize.
Author
There was a problem hiding this comment.
Thanks for your advice. I'll change it.
Contributor
Then what motivated this PR? |
Author
I spotted an opportunity for improvement while reading the code. I鈥檝e been using it for a long time, so I decided to contribute. |
resize() also runs when the window size did not change, e.g. on VOCTRL_SET_PANSCAN. create_shm_pool() then allocated a new pool of the same size and destroyed all OSD buffers. Keep the existing pool instead. Not compiled or tested.
enchan087
force-pushed
the
dmabuf-osd-pool
branch
from
October 26, 2026 03:18
055f6a1 to
ac578f3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If the OSD shm pool allocation in
create_shm_pool()fails,osd_buffer_create()passes a NULL pool towl_shm_pool_create_buffer(). After a resize, the old pool is kept instead, anddraw_osd()writes the OSD for the new size into the smaller mapping.vo_dmabuf_wayland: handle a failed OSD shm pool allocationvo_dmabuf_wayland: keep the OSD shm pool if the size is unchanged:VOCTRL_SET_PANSCANreallocated a pool of the same size.Not compiled or tested, I have no Linux/Wayland setup. The error paths need a failing memfd, mmap or
wl_shm_create_pooland were checked by reading the code.Written with Claude Opus 5.5 in Claude Code.