<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/pgo, branch osc-5522</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=osc-5522</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=osc-5522'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2025-10-10T08:23:17Z</updated>
<entry>
<title>render: when double-buffering, pre-apply previous frame's damage early</title>
<updated>2025-10-10T08:23:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-10-05T08:48:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=299186a6547f6e038ee6f3822caf9a0fdfabceef'/>
<id>urn:sha1:299186a6547f6e038ee6f3822caf9a0fdfabceef</id>
<content type='text'>
Foot likes it when compositor releases buffer immediately, as that
means we only have to re-render the cells that have changed since the
last frame.

For various reasons, not all compositors do this. In this case, foot
is typically forced to switch between two buffers, i.e. double-buffer.

In this case, each frame starts with copying over the damage from the
previous frame, to the new frame. Then we start rendering the updated
cells.

Bringing over the previous frame's damage can be slow, if the changed
area was large (e.g. when scrolling one or a few lines, or on full
screen updates). It's also done single-threaded. Thus it not only
slows down frame rendering, but pauses everything else (i.e. input
processing). All in all, it reduces performance and increases input
latency.

But we don't have to wait until it's time to render a frame to copy
over the previous frame's damage. We can do that as soon as the
compositor has released the buffer (for the frame _before_ the
previous frame). And we can do this in a thread.

This frees up foot to continue processing input, and reduces frame
rendering time since we can now start rendering the modified cells
immediately, without first doing a large memcpy(3).

In worst case scenarios (or perhaps we should consider them best case
scenarios...), I've seen up to a 10x performance increase in frame
rendering times (this obviously does *not* include the time it takes
to copy over the previous frame's damage, since that doesn't affect
neither input processing nor frame rendering).

Implemented by adding a callback mechanism to the shm abstraction
layer. Use it for the grid buffers, and kick off a thread that copies
the previous frame's damage, and resets the buffers age to 0 (so that
foot understands it can start render to it immediately when it later
needs to render a frame).

Since we have certain way of knowing if a compositor releases buffers
immediately or not, use a bit of heuristics; if we see 10 consecutive
non-immediate releases (that is, we reset the counter as soon as we do
see an immediate release), this new "pre-apply damage" logic is
enabled. It can be force-disabled with tweak.pre-apply-damage=no.

We also need to take care to wait for the thread before resetting the
render's "last_buf" pointer (or we'll SEGFAULT in the thread...).

We must also ensure we wait for the thread to finish before we start
rendering a new frame. Under normal circumstances, the wait time is
always 0, the thread has almost always finished long before we need to
render the next frame. But it _can_ happen.

Closes #2188
</content>
</entry>
<entry>
<title>config: tweak.surface-bit-depth now defaults to 'auto'</title>
<updated>2025-05-01T06:54:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-05-01T06:34:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e5a0755451b736c635be58764799ef8d7b536e8d'/>
<id>urn:sha1:e5a0755451b736c635be58764799ef8d7b536e8d</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>render: gamma-correct blending</title>
<updated>2025-03-05T17:45:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-21T10:01:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ccf625b9914917e131beb83379c526bab1927edc'/>
<id>urn:sha1:ccf625b9914917e131beb83379c526bab1927edc</id>
<content type='text'>
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 &gt;= 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 &gt;= 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
</content>
</entry>
<entry>
<title>Add support for the new Wayland protocol xdg-system-bell</title>
<updated>2025-01-17T09:21:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-17T09:10:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2a07a2e6b9a9565287996c51ceb2824b37d3fba7'/>
<id>urn:sha1:2a07a2e6b9a9565287996c51ceb2824b37d3fba7</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>render: Expose render_overlay</title>
<updated>2025-01-09T06:53:50Z</updated>
<author>
<name>Alexander Orzechowski</name>
<email>alex@ozal.ski</email>
</author>
<published>2025-01-05T03:26:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f0253633d3cdde994b48c25692707e1df2f1e1e7'/>
<id>urn:sha1:f0253633d3cdde994b48c25692707e1df2f1e1e7</id>
<content type='text'>
This function updates the overlay that foot uses. It will be used to
update the overlay when the flash effect ends.
</content>
</entry>
<entry>
<title>pgo: prefer full-headless-sway over full-headless-cage</title>
<updated>2024-12-08T10:02:11Z</updated>
<author>
<name>heather7283</name>
<email>heather7283@protonmail.com</email>
</author>
<published>2024-12-08T09:54:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=768f254286cf1c2b447efc59cf99fabcd940ac48'/>
<id>urn:sha1:768f254286cf1c2b447efc59cf99fabcd940ac48</id>
<content type='text'>
</content>
</entry>
<entry>
<title>pgo: explicitly set LLVM_PROFILE_FILE envvar</title>
<updated>2024-12-08T08:10:43Z</updated>
<author>
<name>heather7283</name>
<email>heather7283@protonmail.com</email>
</author>
<published>2024-11-19T16:06:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7e88e0bfdc3b0659bb763fde2cc11726f5b1132d'/>
<id>urn:sha1:7e88e0bfdc3b0659bb763fde2cc11726f5b1132d</id>
<content type='text'>
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
</content>
</entry>
<entry>
<title>pgo: run sway with --unsupported-gpu flag</title>
<updated>2024-12-08T08:10:43Z</updated>
<author>
<name>heather7283</name>
<email>heather7283@protonmail.com</email>
</author>
<published>2024-11-19T15:59:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=de305a7e58950d243b1e170cbb3df4ddbc8202e0'/>
<id>urn:sha1:de305a7e58950d243b1e170cbb3df4ddbc8202e0</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>pgo: add missing stub for render_refresh_icon()</title>
<updated>2024-09-13T07:04:18Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-09-10T17:13:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f5caa2d265f347183864b20929be7f74fcef4da8'/>
<id>urn:sha1:f5caa2d265f347183864b20929be7f74fcef4da8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>pgo: add notify_close() stub</title>
<updated>2024-07-25T17:31:27Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-25T17:31:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8f16fe54d3cbe2417a0edf9bde585d2844ea4bda'/>
<id>urn:sha1:8f16fe54d3cbe2417a0edf9bde585d2844ea4bda</id>
<content type='text'>
</content>
</entry>
<entry>
<title>pgo: updated stubs for notification functions</title>
<updated>2024-07-23T10:15:50Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-23T10:15:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=50efd9726d041b00d3966431b8e6957a3739b33c'/>
<id>urn:sha1:50efd9726d041b00d3966431b8e6957a3739b33c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>pgo: update notify_notify() prototype, add notify_free()</title>
<updated>2024-07-23T05:43:56Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-23T05:43:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e88ec86c9337b0a2e1b9d3d1d207005a4c084a79'/>
<id>urn:sha1:e88ec86c9337b0a2e1b9d3d1d207005a4c084a79</id>
<content type='text'>
</content>
</entry>
<entry>
<title>pgo: update spawn() prototype</title>
<updated>2024-07-23T05:43:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-23T05:43:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7268ee9078e8c0ce4b7cdaa479b67ea34aa8e88f'/>
<id>urn:sha1:7268ee9078e8c0ce4b7cdaa479b67ea34aa8e88f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>osc/notify: add support for OSC-99, kitty desktop notifications</title>
<updated>2024-07-23T05:17:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-19T13:04:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b0bf8ca5f7034f6d95bc3b58082e719a81d99859'/>
<id>urn:sha1:b0bf8ca5f7034f6d95bc3b58082e719a81d99859</id>
<content type='text'>
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/
</content>
</entry>
<entry>
<title>pgo: render_resize_force() has been removed, adjust stub accordingly</title>
<updated>2024-02-08T15:44:55Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-02-08T15:44:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9d9690410a72e03511bcc19e6f4a848d450fd0cc'/>
<id>urn:sha1:9d9690410a72e03511bcc19e6f4a848d450fd0cc</id>
<content type='text'>
Closes #1601
</content>
</entry>
<entry>
<title>pgo: add missing stub for render_refresh_app_id()</title>
<updated>2024-02-06T13:04:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-02-06T13:04:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3b5d83a3ec0b0bba3a8e56d97aaa6d14c46417f1'/>
<id>urn:sha1:3b5d83a3ec0b0bba3a8e56d97aaa6d14c46417f1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>pgo: fix function prototype for stub function get_current_modifiers()</title>
<updated>2024-02-06T13:03:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-02-06T13:03:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=af114f81a0cef1d789c354c4d05140400210b136'/>
<id>urn:sha1:af114f81a0cef1d789c354c4d05140400210b136</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Don't use fancy Unicode quotes, stick to ASCII</title>
<updated>2024-02-06T11:36:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-02-06T11:36:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7999975016a57cc0a2c2e20bc55f29de32df7044'/>
<id>urn:sha1:7999975016a57cc0a2c2e20bc55f29de32df7044</id>
<content type='text'>
</content>
</entry>
<entry>
<title>add CCACHE_DISABLE=1 to pgo.sh to avoid errors when ccache is enabled</title>
<updated>2023-10-20T09:06:05Z</updated>
<author>
<name>Fazzi</name>
<email>faaris.ansari@proton.me</email>
</author>
<published>2023-10-20T09:06:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=85a4e4ccc15089b58ad8ce4aaec3b301e9025369'/>
<id>urn:sha1:85a4e4ccc15089b58ad8ce4aaec3b301e9025369</id>
<content type='text'>
</content>
</entry>
<entry>
<title>pgo: add stub for wayl_fractional_scaling()</title>
<updated>2023-07-18T03:48:22Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-07-17T18:13:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4a4f2b5dae6f7303e27d45a1d60aaefb7be2d7ba'/>
<id>urn:sha1:4a4f2b5dae6f7303e27d45a1d60aaefb7be2d7ba</id>
<content type='text'>
</content>
</entry>
</feed>
