aboutsummaryrefslogtreecommitdiff
path: root/pgo (follow)
Commit message (Collapse)AuthorAgeLines
* config: tweak.surface-bit-depth now defaults to 'auto'Daniel Eklöf2025-05-01-2/+3
| | | | | | | | | | | When set to 'auto', use 10-bit surfaces if gamma-correct blending is enabled, and 8-bit surfaces otherwise. Note that we may still fallback to 8-bit surfaces (without disabling gamma-correct blending) if the compositor does not support 10-bit surfaces. Closes #2082
* render: gamma-correct blendingDaniel Eklöf2025-03-05-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This implements gamma-correct blending, which mainly affects font rendering. The implementation requires compile-time availability of the new color-management protocol (available in wayland-protocols >= 1.41), and run-time support for the same in the compositor (specifically, the EXT_LINEAR TF function and sRGB primaries). How it works: all colors are decoded from sRGB to linear (using a lookup table, generated in the exact same way pixman generates it's internal conversion tables) before being used by pixman. The resulting image buffer is thus in decoded/linear format. We use the color-management protocol to inform the compositor of this, by tagging the wayland surfaces with the 'ext_linear' image attribute. Sixes: all colors are sRGB internally, and decoded to linear before being used in any sixels. Thus, the image buffers will contain linear colors. This is important, since otherwise there would be a decode/encode penalty every time a sixel is blended to the grid. Emojis: we require fcft >= 3.2, which adds support for sRGB decoding color glyphs. Meaning, the emoji pixman surfaces can be blended directly to the grid, just like sixels. Gamma-correct blending is enabled by default *when the compositor supports it*. There's a new option to explicitly enable/disable it: gamma-correct-blending=no|yes. If set to 'yes', and the compositor does not implement the required color-management features, warning logs are emitted. There's a loss of precision when storing linear pixels in 8-bit channels. For this reason, this patch also adds supports for 10-bit surfaces. For now, this is disabled by default since such surfaces only have 2 bits for alpha. It can be enabled with tweak.surface-bit-depth=10-bit. Perhaps, in the future, we can enable it by default if: * gamma-correct blending is enabled * the user has not enabled a transparent background
* Add support for the new Wayland protocol xdg-system-bellDaniel Eklöf2025-01-17-0/+1
| | | | | | | | | | | | | | | | | | | From the release notes: system bell - allowing e.g. terminal emulators to hand off system bell alerts to the compositor for among other things accessibility purposes The new protocol is used when the new config option bell.system=yes (and the compositor implements the protocol, obviously). The system bell is rung independent of whether the foot window has keyboard focus or not (thus relying on compositor configuration to determine whether anything should be done or not in response to the bell). The new option is enabled by default.
* render: Expose render_overlayAlexander Orzechowski2025-01-09-0/+2
| | | | | This function updates the overlay that foot uses. It will be used to update the overlay when the flash effect ends.
* pgo: prefer full-headless-sway over full-headless-cageheather72832024-12-08-5/+2
|
* pgo: explicitly set LLVM_PROFILE_FILE envvarheather72832024-12-08-0/+1
| | | | | | | | | When building foot with pgo under gentoo's portage, LLVM tried to generate profile data files directly under system root, triggering sandbox violation and causing build to fail. Setting this envvar fixes the issue by explicitly specifying profiling data location. Reference: https://clang.llvm.org/docs/UsersManual.html#profiling-with-instrumentation
* pgo: run sway with --unsupported-gpu flagheather72832024-12-08-1/+1
| | | | | | Sway refuses to run if it detects an nvidia GPU on the system, causing pgo build to fail. Adding --unsupported-gpu flag disables this behaviour.
* pgo: add missing stub for render_refresh_icon()Daniel Eklöf2024-09-13-0/+1
|
* pgo: add notify_close() stubDaniel Eklöf2024-07-25-0/+5
|
* pgo: updated stubs for notification functionsDaniel Eklöf2024-07-23-1/+17
|
* pgo: update notify_notify() prototype, add notify_free()Daniel Eklöf2024-07-23-3/+8
|
* pgo: update spawn() prototypeDaniel Eklöf2024-07-23-3/+3
|
* osc/notify: add support for OSC-99, kitty desktop notificationsDaniel Eklöf2024-07-23-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This adds limited support for OSC-99, kitty desktop notifications[^1]. We support everything defined by the "protocol", except: * 'a': action to perform on notification activation. Since we don't trigger the notification ourselves (over D-Bus), we don't know a) which ID the notification got, or b) when it is clicked. * ... and that's it. Everything else is supported To be explicit, we *do* support: * Chunked notifications (d=0|1), allowing the application to append data to a notification in chunks, before it's finally displayed. * Plain UTF-8, or base64-encoded UTF-8 payload (e=0|1). * Notification identifier (i=xyz). * Payload type (p=title|body). * When to honor the notification (o=always|unfocused|invisible), with the following quirks: - we don't know when the window is invisible, thus it's treated as 'unfocused'. - the foot option 'notify-focus-inhibit' overrides 'always' * Urgency (u=0|1|2) [^1]: https://sw.kovidgoyal.net/kitty/desktop-notifications/
* pgo: render_resize_force() has been removed, adjust stub accordinglyDaniel Eklöf2024-02-08-1/+2
| | | | Closes #1601
* pgo: add missing stub for render_refresh_app_id()Daniel Eklöf2024-02-06-0/+1
|
* pgo: fix function prototype for stub function get_current_modifiers()Daniel Eklöf2024-02-06-1/+2
|
* Don't use fancy Unicode quotes, stick to ASCIIDaniel Eklöf2024-02-06-5/+5
|
* add CCACHE_DISABLE=1 to pgo.sh to avoid errors when ccache is enabledFazzi2023-10-20-0/+1
|
* pgo: add stub for wayl_fractional_scaling()Daniel Eklöf2023-07-18-0/+1
|
* pgo: update xcursor stubs to use enum instead of char pointerDaniel Eklöf2023-07-03-3/+3
|
* osc: update font subpixel mode, and window opaque compositor hint, on alpha changesDaniel Eklöf2023-05-26-0/+1
| | | | | | | | | | | | | | | | | | | | | When background alpha is changed at runtime (using OSC-11), we (may) have to update the opaque hint we send to the compositor. We must also update the subpixel mode used when rendering font glyphs. Why? When the window is fully opaque, we use wl_surface_set_opaque_region() on the entire surface, to hint to the compositor that it doesn’t have to blend the window content with whatever is behind the window. Obviously, if alpha is changed from opaque, to transparent (or semi-transparent), that hint must be removed. Sub-pixel mode is harder to explain, but in short, we can’t do subpixel hinting with a (semi-)transparent background. Thus, similar to the opaque hint, subpixel antialiasing must be enabled/disabled when background alpha is changed.
* build: fix GCC detection in pgo.shAndrea Pappacoda2022-10-23-1/+1
| | | | | | | | | | | | | | | On my system, GCC doesn't output its name when passing the --version flag: $ cc --version cc (Debian 12.2.0-3) 12.2.0 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. As the Free Software Foundation is unlikely to write another compiler, I think that searching for the foundation's name instead of GCC is a good enough fix (and I'm almost sure we wouldn't be the first ones to do so).
* pgo: don’t re-use the rows between the ‘normal’ and ‘alt’ gridsDaniel Eklöf2022-10-18-10/+20
| | | | | | | | This used to work because we never free:d any of the rows. Now however, we do free (some of) them when reverse scrolling. This means we can no longer re-use the rows between the two screens. Closes #1196
* pgo: run xtgettcap without any argumentsDaniel Eklöf2022-10-10-2/+2
| | | | | | | | We execute xtgettcap in the parent terminal. Thus we don’t know if it implements XTGETTCAP, and thus it’s not guaranteed to exit - it may hang indefinitely waiting for a reply. Fix by not actually quering anything.
* pgo: execute xtgettcap utility, to get profiling dataDaniel Eklöf2022-10-07-0/+2
| | | | | | Fixes: ../utils/xtgettcap.c:175:1: error: ‘/home/daniel/src/foot/src/utils/xtgettcap.p/xtgettcap.c.gcda’ profile count data file not found [-Werror=missing-profile]
* terminal: don’t unref a not-yet-referenced key-binding setDaniel Eklöf2022-09-06-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Key-binding sets are bound to a seat/configuration pair. The conf reference is done when a new terminal instance is created. When that same terminal instance is destroyed, the key binding set is unref:ed. If the terminal instance is destroyed *before* the key binding set has been referenced, we’ll still unref it. This creates an imbalance. In particular, when the there is exactly one other terminal instance referencing that same key binding set, that terminal instance will trigger a foot server crash as soon as it receives a key press/release event. This happens because the next-to-last terminal instance brought the reference count of the binding set down to 0, causing it to be free:d. Thus, we *must* reference the binding set *before* we can error out (when instantiating a new terminal instance). At this point, we don’t yet have a valid terminal instance. But, that’s ok, because all the key_binding_new_for_term() did with the terminal instance was get the "struct wayland" and "struct config" pointers. So, rename the function and simply pass these pointers explicitly. Similarly, change key_binding_for() to take a "struct config" pointer, rather than a "struct terminal" pointer. Also rename key_binding_unref_term() -> key_binding_unref().
* pgo: slave_spawn(): sync function signatureDaniel Eklöf2022-06-13-1/+2
|
* pgo: add xdg_activation_token parameter to spawn() stubDaniel Eklöf2022-05-06-1/+2
|
* pgo: add missing stubs for key-binding functionsDaniel Eklöf2022-04-22-1/+11
| | | | | * key_binding_new_for_term() * key_binding_unref_term()
* wayland: remove selection_override_modmask memberDaniel Eklöf2022-04-19-0/+22
| | | | | This member is no longer valid - we need to use one from the current key-binding set.
* pgo: sync up stub version of slave_spawn()Daniel Eklöf2022-04-12-2/+2
|
* pgo: fix selection.{start,end} initializersDaniel Eklöf2022-04-10-2/+4
| | | | | This fixes a regression introduced in 5b1f1602bccfb7c37e50a8509f44b24e9aa3b5d1
* pgo: add stub for render_xcursor_is_validAshish SHUKLA2022-02-07-0/+6
|
* pgo: stub get_current_modifiers()Daniel Eklöf2021-12-04-0/+5
|
* pgo: add stub for xcursor_for_csd_border()Daniel Eklöf2021-11-30-0/+6
|
* foot/client: implement xdga client activationRonan Pigott2021-11-01-1/+1
| | | | | | | | | | | This is an application of the xdg activation protocol that will allow compositors to associate new foot toplevels with the command that launched them. footclient receives an activation token from the launcher which the compositor can use to track application startup. It passes the token to the foot server, which then activates the new window with the token to complete the startup sequence.
* pgo: full-inner: add --override tweak.grapheme-shaping=noDaniel Eklöf2021-10-16-0/+1
| | | | | | | | | Grapheme shaping is now enabled by default in foot. However, when generating the profiling data in PGO builds, this results in skewed optimizations. The end result is worse benchmark results regardless of whether grapheme-shaping is enabled or not (when running the benchmarks).
* pgo: Use pixman renderer by default for PGO buildsStanislav Ochotnický2021-10-08-2/+2
| | | | | | | | | | Without pixman renderer override pgo builds in cage/sway require access to actual render devices. In Gentoo's case the builds are run as ordinary user and within a "sandbox" which prevents and logs access outside of predefined places during build. So let's default to pixman renderer for the PGO builds. Hopefully that won't matter for the pgo optimizations to do the right thing within foot.
* pgo: verify source dir really is a foot source dir before proceedingDaniel Eklöf2021-10-06-0/+5
|
* pgo: full-inner: do not set LC_CTYPE=en_US.UTF-8Daniel Eklöf2021-10-02-4/+4
| | | | | | | That locale may not exist. Instead, require the user/build script to explicitly set an UTF-8 locale. Document this in INSTALL.md, and in the bundled PKGBUILD.
* pgo.sh: set -x *after* verifying inputDaniel Eklöf2021-09-12-1/+3
|
* pgo: pgo.sh: remove both gcc and clang generated profile statsDaniel Eklöf2021-09-12-1/+8
|
* pgo: pgo.sh: add meson bld/src dir arguments lastDaniel Eklöf2021-09-12-1/+1
|
* pgo: pgo.sh: run ‘find’ in the build-directory, not cwdDaniel Eklöf2021-09-12-1/+1
|
* pgo: pgo.sh: allow a pre-existing build directoryDaniel Eklöf2021-09-12-4/+4
|
* pgo: pgo.sh: auto: don’t use full-headless-swayDaniel Eklöf2021-09-12-2/+2
| | | | | | | This requires Sway >= 1.6.2, which hasn’t been released yet. Thus, don’t auto-use it. Users can still request it explicitly.
* pgo: add set -x to all PGO scriptsDaniel Eklöf2021-09-12-8/+8
| | | | | Without this, debugging error reports from users is going to be _very_ difficult...
* pgo: full-headless-cage: remove references to SwayDaniel Eklöf2021-09-12-1/+0
|
* pgo: full-headless-cage: new headless variantDaniel Eklöf2021-09-12-2/+19
| | | | | | | Appears to work, but cage spams a lot of 00:00:08.026 [types/wlr_output.c:720] Basic output test failed for HEADLESS-1 00:00:08.036 [types/wlr_output.c:720] Basic output test failed for HEADLESS-1
* pgo: full-inner: quote path in trap’s “rm” commandDaniel Eklöf2021-09-12-1/+1
|
* pgo: full-inner: remove -o tweak.render-timer=logDaniel Eklöf2021-09-12-1/+0
|
* pgo: replace meson-pgo.sh with several script primitivesDaniel Eklöf2021-09-12-0/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All scripts are in the ‘pgo’ directory: * options: command line options for generate-alt-random-writes.py, sourced by other scripts. * pgo.sh: top-level script, generates a meson build directory, selects a PGO method, generates the profiling data, re-configures the meson build directory and does the final build. This script is intended to be used by end-users, and shows _how_ to integrate the script primitives. Build servers will most likely *not* want to use this script as-is. * partial.sh: generates alt-random-write data and runs “foot{,client} --version”, and then feeds the alt-random data to the PGO helper binary. Does not require a running Wayland session. Touches $blddir/pgo-ok on success. * full-inner.sh: runs “footclient --version”, and then a complex “foot” command that first generates alt-random-write data, and then “cat’s” it. Requires a running Wayland session, *but*, this script is usually not called directly (see below). Touches $blddir/pgo-ok onsucces.. * full-current-session.sh: runs full-inner.sh. That is, it runs foot in the currently running Wayland session. Note that this will pop up a foot window. * full-headless-sway.sh: generates a custom Sway configuration that exec’s foot-headless-sway-inner.sh (see below), and then executes a headless Sway. In other words, this script does a *full* PGO build, but *without* requiring a running Wayland session. Requires Sway >= 1.6.2. * full-headless-sway.sh: runs full-inner.sh + “swaymsg exit”. To do a custom PGO build, without using pgo.sh, you’d need to: CFLAGS=”$CFLAGS -O3” meson --buildtype=release -Db_lto=true meson configure -Db_pgo=generate ninja ninja test (only needed if tllist+fcft are built as subprojects) Run *one* of: - partial.sh - full-current-session.sh - full-headless-sway.sh meson configure -D b_pgo=use ninja
* pgo: add stub for search_selection_cancelled()Daniel Eklöf2021-07-23-0/+2
| | | | | | | Fixes PGO build failures caused by 251545203baa65364e491ddbe71ab3f8080bfe25 Closes #648
* pgo: fix PGO builds with clangDaniel Eklöf2021-07-22-0/+10
| | | | | | | | Add stubs for shm_chain_new(), shm_chain_free() and shm_unref(). This fixes ‘pgo’ linking failures in the ‘generate’ phase when doing a PGO build with clang. Closes #642
* extract: move ‘strip_trailing_empty’ parameter from extra_finish() to extract_begin()Daniel Eklöf2021-05-17-1/+1
|
* pgo: add wayl_win_set_urgent() stubDaniel Eklöf2021-05-14-0/+1
|
* ime: move preedit state from terminal struct to the seat structDaniel Eklöf2021-03-25-0/+1
| | | | | | | | | | | | | | | | | This ensures different seat’s don’t step on each others IME pre-edit state. It also removes most dependencies on having a valid term pointer for many IME operations. We’re still not all the way, since we support disabling IME with a private mode, which is per terminal, not seat. Thus, we still require the seat to have keyboard focus on one of our windows. Closes #324. But note that *rendering* of multiple seat’s IME pre-edit strings is still broken.
* fdm: add support for managing signalsDaniel Eklöf2021-02-11-1/+1
| | | | | | | | | | | | | | | | | | Add fdm_signal_add() and fdm_signal_del(). Signals added to the fdm will be monitored, and the provided callback called as “soon as possible” from the main context (i.e not from the signal handler context). Monitored signals are *blocked* by default. We use epoll_pwait() to unblock them while we’re polling. This allows us to do race-free signal detection. We use a single handler for all monitored signals; the handler simply updates the signal’s slot in a global array (sized to fit SIGRTMAX signals). When epoll_pwait() returns EINTR, we loop the global array. The callback associated with each signal that fired is called.
* urls: initial support for detecting URLs and rendering jump-labelsDaniel Eklöf2021-02-07-0/+1
| | | | The jump labels work, but is currently hardcoded to use xdg-open
* shm: unbreak build without memfd_createJan Beich2021-01-23-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New FreeBSD versions have memfd_create but other BSDs don't. pgo/pgo.c:260:22: error: implicit declaration of function 'memfd_create' is invalid in C99 [-Werror,-Wimplicit-function-declaration] int mem_fd = memfd_create("foot-pgo-ptmx", MFD_CLOEXEC); ^ pgo/pgo.c:260:52: error: use of undeclared identifier 'MFD_CLOEXEC' int mem_fd = memfd_create("foot-pgo-ptmx", MFD_CLOEXEC); ^ shm.c:13:10: fatal error: 'linux/mman.h' file not found #include <linux/mman.h> ^~~~~~~~~~~~~~ shm.c:277:15: error: implicit declaration of function 'memfd_create' is invalid in C99 [-Werror,-Wimplicit-function-declaration] pool_fd = memfd_create("foot-wayland-shm-buffer-pool", MFD_CLOEXEC | MFD_ALLOW_SEALING); ^ shm.c:277:60: error: use of undeclared identifier 'MFD_CLOEXEC' pool_fd = memfd_create("foot-wayland-shm-buffer-pool", MFD_CLOEXEC | MFD_ALLOW_SEALING); ^ shm.c:277:74: error: use of undeclared identifier 'MFD_ALLOW_SEALING' pool_fd = memfd_create("foot-wayland-shm-buffer-pool", MFD_CLOEXEC | MFD_ALLOW_SEALING); ^ shm.c:339:15: error: use of undeclared identifier 'F_SEAL_GROW' F_SEAL_GROW | F_SEAL_SHRINK | /*F_SEAL_FUTURE_WRITE |*/ F_SEAL_SEAL) < 0) ^ shm.c:339:29: error: use of undeclared identifier 'F_SEAL_SHRINK' F_SEAL_GROW | F_SEAL_SHRINK | /*F_SEAL_FUTURE_WRITE |*/ F_SEAL_SEAL) < 0) ^ shm.c:339:71: error: use of undeclared identifier 'F_SEAL_SEAL' F_SEAL_GROW | F_SEAL_SHRINK | /*F_SEAL_FUTURE_WRITE |*/ F_SEAL_SEAL) < 0) ^ shm.c:338:24: error: use of undeclared identifier 'F_ADD_SEALS' if (fcntl(pool_fd, F_ADD_SEALS, ^
* pgo: stub implementation of reaper_del()Daniel Eklöf2021-01-12-0/+1
|
* terminal: shutdown (or --hold) when the client process terminatesDaniel Eklöf2020-12-26-0/+4
| | | | | | | | | Shutdown the terminal when the client process terminates, not when the ptmx file descriptor is closed. This fixes an issue where the terminal remains running after the client process has terminated, if it spawned child processes that inherited the ptmx file descriptor.
* notify: break out desktop notifications from osc.cDaniel Eklöf2020-12-10-0/+5
|
* ime: add functions to enable/disable IME, simplify code that enables IMEDaniel Eklöf2020-12-07-0/+3
| | | | | | | | | | | | | | | | | We may want to be able to enable/disable IME run-time, even though we have received an ‘enter’ IME event. This enables us to do that. Also add functions to enable/disable IME on a per-terminal instance basis. A terminal may have multiple seats focusing it, and enabling/disabling IME in a terminal instance enables/disables IME on all those seats. Finally, the code to enable IME is simplified; the *only* surface that can ever receive ‘enter’ IME events is the main grid. All other surfaces are sub-surfaces, without their own keyboard focus.
* sixel: change default max size to 10000x10000Daniel Eklöf2020-11-23-1/+7
| | | | | It used to be the size of the window. This caused images to be cropped when the application emitting them didn’t change the max size.
* pgo: feed VT data through fdm_ptmx(), not vt_from_slave()Daniel Eklöf2020-11-22-6/+61
| | | | | | | | | | | | | | | | | fdm_ptmx(), the FDM callback handler for ptmx data, is just as much in the hot path as vt_from_slave(). It is also slightly more complicated than a read() followed by a call to vt_from_slave(). As a result, some benchmarks performed significantly worse in a partial PGO build than in a full PGO build, since fdm_ptmx() wasn’t PGO:d. To be able to feed data through fdm_ptmx(), we need to set up the delayed rendering timer FDs, configure the timeout values, and provide a readable FD it can read the VT data from. The latter is done with a memory FD. This ensures *all* VT data is loaded into memory before we feed it to the parser.
* pgo: initialize (mouse) selectionDaniel Eklöf2020-11-22-0/+4
|
* pgo: initialize a dummy wayland backendDaniel Eklöf2020-11-22-0/+11
| | | | | | * Empty seat list * Empty monitor list * Add dummy terminal instance to terminal list
* remove pre-generated input corpus for PGODaniel Eklöf2020-11-22-1/+0
|
* pgo: updated stimuli (256-indexed colors)Daniel Eklöf2020-11-22-262144/+1
|
* pgo: pull in selection.c in pgolibDaniel Eklöf2020-11-22-63/+3
| | | | | Some of the selection functions are in the hot path, so this makes a huge difference!
* pgo: support for specifying multiple stimuli filesDaniel Eklöf2020-11-22-14/+56
|
* pgo: move pgo.c and pgo stimuli to pgo directoryDaniel Eklöf2020-11-22-0/+262377