mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-02 07:15:31 -04:00
shm: don't even try to punch a memfd hole in 32-bit
This ensures we don't issue a warning if we fail, something that will just confuse users, as SHM scrolling is disabled in 32-bit anyway.
This commit is contained in:
parent
828a57c201
commit
732e181b1d
1 changed files with 6 additions and 0 deletions
6
shm.c
6
shm.c
|
|
@ -291,6 +291,7 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie,
|
||||||
|
|
||||||
if (!can_punch_hole_initialized) {
|
if (!can_punch_hole_initialized) {
|
||||||
can_punch_hole_initialized = true;
|
can_punch_hole_initialized = true;
|
||||||
|
#if defined(__x86_64__)
|
||||||
can_punch_hole = fallocate(
|
can_punch_hole = fallocate(
|
||||||
pool_fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 1) == 0;
|
pool_fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, 0, 1) == 0;
|
||||||
|
|
||||||
|
|
@ -299,6 +300,11 @@ shm_get_buffer(struct wl_shm *shm, int width, int height, unsigned long cookie,
|
||||||
"fallocate(FALLOC_FL_PUNCH_HOLE) not "
|
"fallocate(FALLOC_FL_PUNCH_HOLE) not "
|
||||||
"supported (%s): expect lower performance", strerror(errno));
|
"supported (%s): expect lower performance", strerror(errno));
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
/* This is mostly to make sure we skip the warning issued
|
||||||
|
* above */
|
||||||
|
can_punch_hole = false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scrollable && !can_punch_hole) {
|
if (scrollable && !can_punch_hole) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue