<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/shm.c, branch 1.5.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.5.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.5.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2020-08-25T18:39:17Z</updated>
<entry>
<title>fix some buggy comparisons relating to signed/unsigned types</title>
<updated>2020-08-25T18:39:17Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-25T18:39:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f3acfea81565edf38ca7546fe4a351126d04442a'/>
<id>urn:sha1:f3acfea81565edf38ca7546fe4a351126d04442a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Cast printf formatter %p arguments to void*</title>
<updated>2020-08-23T08:07:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-08-23T05:50:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e32c0d9bf698782353bbe9e4348617523af473bd'/>
<id>urn:sha1:e32c0d9bf698782353bbe9e4348617523af473bd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: don't even try to punch a memfd hole in 32-bit</title>
<updated>2020-08-11T15:22:12Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-08-11T15:22:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=732e181b1d360425cf1b4853158e266ad4f07384'/>
<id>urn:sha1:732e181b1d360425cf1b4853158e266ad4f07384</id>
<content type='text'>
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.
</content>
</entry>
<entry>
<title>Convert most dynamic allocations to use functions from xmalloc.h</title>
<updated>2020-08-08T19:37:57Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-08T19:34:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7a77958ba20c2b344be5e66e69e2f212a4bbf6b3'/>
<id>urn:sha1:7a77958ba20c2b344be5e66e69e2f212a4bbf6b3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Replace GCC "unused" and "format" attributes with portable macros</title>
<updated>2020-08-07T19:42:34Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2020-08-07T19:42:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7eb70a453b4ea797d9e85017c6deab6a7bc903a6'/>
<id>urn:sha1:7eb70a453b4ea797d9e85017c6deab6a7bc903a6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>render: re-write cell clipping to use pixman destination clipping</title>
<updated>2020-06-04T13:39:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-06-04T13:39:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8b320ed29630e75c058bbf368ea5e2e9a68d0143'/>
<id>urn:sha1:8b320ed29630e75c058bbf368ea5e2e9a68d0143</id>
<content type='text'>
Our home rolled clip-to-cell code was, obviously, not correct.

The original problem was that we couldn't use pixman clipping since we
have multiple threads writing to the same pixman image, and thus there
would be races between the threads setting clipping.

The fix is actually simple - just instantiate one pixman
image (referencing the same backing image data) for each rendering
thread.
</content>
</entry>
<entry>
<title>shm: #ifdef conditional code to measure total size of SHM allocations</title>
<updated>2020-04-18T10:24:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-18T10:24:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4f145bed33d1de87993f947cb7fad31130fc868f'/>
<id>urn:sha1:4f145bed33d1de87993f947cb7fad31130fc868f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: memfd seal failures are not fatal errors</title>
<updated>2020-04-03T18:14:53Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-04-03T18:14:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a2081047432c58481592e3e8155017fbbdf6c1da'/>
<id>urn:sha1:a2081047432c58481592e3e8155017fbbdf6c1da</id>
<content type='text'>
</content>
</entry>
<entry>
<title>conf: max-shm-pool-size-mb=0 now disables SHM scrolling</title>
<updated>2020-03-26T17:04:30Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-26T17:04:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c4aaba6299b092cd8221fb6e8c301fe5bfd602a4'/>
<id>urn:sha1:c4aaba6299b092cd8221fb6e8c301fe5bfd602a4</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: make max pool size user configurable (via a 'tweak' setting)</title>
<updated>2020-03-25T19:48:02Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-25T19:48:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0baa249d8b59007913dbf7db8aa8d94e6c2b9d44'/>
<id>urn:sha1:0baa249d8b59007913dbf7db8aa8d94e6c2b9d44</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: handle ftruncate failure</title>
<updated>2020-03-25T17:32:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-25T17:32:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e9f1638750db342fbf26fc9477a970ab2e3e439d'/>
<id>urn:sha1:e9f1638750db342fbf26fc9477a970ab2e3e439d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: seal the memfd</title>
<updated>2020-03-25T17:30:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-25T17:30:21Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=dc42cc1d195a16683c45fc87eb2dc333087a90da'/>
<id>urn:sha1:dc42cc1d195a16683c45fc87eb2dc333087a90da</id>
<content type='text'>
This both prevents accidental resizing of the memfd, and allows the
Wayland server to optimze reads from the buffer - it no longer has to
setup SIGBUS handlers.
</content>
</entry>
<entry>
<title>shm: scroll: keep shm pool around, and fix its size at max allowed</title>
<updated>2020-03-25T17:26:58Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-25T17:26:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=03319560f5c7c908b1c1d229b3ba53ed1ac6b692'/>
<id>urn:sha1:03319560f5c7c908b1c1d229b3ba53ed1ac6b692</id>
<content type='text'>
This lessens the burden on (primarily) the compositor, since we no
longer tear down and re-create the SHM pool when scrolling.

The SHM pool is setup once, and its size is fixed at the maximum
allowed (512MB for now, 2GB would be possible).

This also allows us to mmap() the memfd once. The exposed raw pointer
is simply an offset from the memfd mmapping.

Note that this means e.g. rouge rendering code will be able to write
outside the buffer.

Finally, only do this if the caller explicitly wants to enable
scrolling. The memfd of other buffers are sized to the requested size.
</content>
</entry>
<entry>
<title>shm: scroll: implement offset wrap-around</title>
<updated>2020-03-24T16:46:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-24T16:46:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5c5f1d096c3a2a6cb8fb3dc5cb3efad5782c1d78'/>
<id>urn:sha1:5c5f1d096c3a2a6cb8fb3dc5cb3efad5782c1d78</id>
<content type='text'>
* Impose a maximum memfd size limit. In theory, this can be
  2GB (wl_shm_create_pool() is the limiting factor - its size argument
  is an int32_t). For now, use 256MB.

  This is mainly to reduce the amount of virtual address space used by
  the compositor, which keeps at least one mmapping (of the entire
  memfd) around. One mmapping *per terminal window* that is.

  Given that we have 128TB with 48-bit virtual addresses, we could
  probably bump this to 2GB without any issues. However, 256MB should
  be enough.

  TODO: check how much we typically move the offset when scrolling in
  a fullscreen window on a 4K monitor. 256MB may turn out to be too
  small.

  On 32-bit shm_scroll() is completely disabled. There simply isn't
  enough address space.

* Wrapping is done by moving the offset to "the other end" of the
  memfd, and copying the buffer contents to the new, wrapped offset.

  The "normal" scrolling code then does the actual scrolling. This
  means we'll re-instantiate all objects twice when wrapping.
</content>
</entry>
<entry>
<title>shm: shm_scroll(): initial implementation of reverse scrolling</title>
<updated>2020-03-23T20:14:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-23T20:14:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=759fd572e972eea24ccc864b22203b1b71030e0d'/>
<id>urn:sha1:759fd572e972eea24ccc864b22203b1b71030e0d</id>
<content type='text'>
Implemented by truncating the file size and moving the offset
backwards. This means we can only reverse scroll when we've previously
scrolled forward.

TODO: figure out if we can somehow do fast reverse scrolling even
though offset is 0 (or well, less than required for scrolling).
</content>
</entry>
<entry>
<title>shm: scroll: move top/bottom region handling from renderer into shm</title>
<updated>2020-03-23T19:45:27Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-23T19:45:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0de3701984ff3b09a804d8369dafc3cd5baefdcc'/>
<id>urn:sha1:0de3701984ff3b09a804d8369dafc3cd5baefdcc</id>
<content type='text'>
This allows us to restore the regions without copying the contents to
temporary memory.
</content>
</entry>
<entry>
<title>shm: add shm_can_scroll()</title>
<updated>2020-03-23T18:31:05Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-23T18:31:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5ffee087481ddf3ad6e3b8e74c6acd3f0d736d82'/>
<id>urn:sha1:5ffee087481ddf3ad6e3b8e74c6acd3f0d736d82</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: print performance warning when FALLOC_FL_PUNCH_HOLE isn't supported</title>
<updated>2020-03-22T20:05:05Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-22T20:04:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=795b0e7ea1cc7098fcbb76858014ffccffbf8624'/>
<id>urn:sha1:795b0e7ea1cc7098fcbb76858014ffccffbf8624</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: verify the system supports FALLOC_FL_PUNCH_HOLE</title>
<updated>2020-03-22T20:05:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-22T19:36:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7404ace40c1b54db14a95f3f64b9f92104e8024a'/>
<id>urn:sha1:7404ace40c1b54db14a95f3f64b9f92104e8024a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>shm: scroll: no need to instantiate a new buffer when ftruncate() fails</title>
<updated>2020-03-22T19:34:58Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2020-03-22T19:32:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3b9be09b065d50cc0d698faf6a855627b5cf86cc'/>
<id>urn:sha1:3b9be09b065d50cc0d698faf6a855627b5cf86cc</id>
<content type='text'>
</content>
</entry>
</feed>
