Commit graph

29 commits

Author SHA1 Message Date
Daniel Eklöf
e907ec209c
pgo: pgo.sh: allow a pre-existing build directory 2021-09-12 10:39:45 +02:00
Daniel Eklöf
cf7c5050f6
pgo: pgo.sh: auto: don’t use full-headless-sway
This requires Sway >= 1.6.2, which hasn’t been released yet. Thus,
don’t auto-use it.

Users can still request it explicitly.
2021-09-12 10:39:44 +02:00
Daniel Eklöf
99c4e51e19
pgo: add set -x to all PGO scripts
Without this, debugging error reports from users is going to be _very_
difficult...
2021-09-12 10:39:44 +02:00
Daniel Eklöf
f25055f101
pgo: full-headless-cage: remove references to Sway 2021-09-12 10:39:44 +02:00
Daniel Eklöf
801bce335b
pgo: full-headless-cage: new headless variant
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
2021-09-12 10:39:44 +02:00
Daniel Eklöf
3a34b94f2e
pgo: full-inner: quote path in trap’s “rm” command 2021-09-12 10:39:44 +02:00
Daniel Eklöf
aeb510182b
pgo: full-inner: remove -o tweak.render-timer=log 2021-09-12 10:39:44 +02:00
Daniel Eklöf
a43ae0d098
pgo: replace meson-pgo.sh with several script primitives
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
2021-09-12 10:39:43 +02:00
Daniel Eklöf
f281937335
pgo: add stub for search_selection_cancelled()
Fixes PGO build failures caused by
251545203b

Closes #648
2021-07-23 10:15:35 +02:00
Daniel Eklöf
2acd4b34c5
pgo: fix PGO builds with clang
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
2021-07-22 10:02:52 +02:00
Daniel Eklöf
a6d9f01c0d
extract: move ‘strip_trailing_empty’ parameter from extra_finish() to extract_begin() 2021-05-17 18:14:10 +02:00
Daniel Eklöf
bf44f3f594
pgo: add wayl_win_set_urgent() stub 2021-05-14 13:26:13 +02:00
Daniel Eklöf
e8ffb05bc7
ime: move preedit state from terminal struct to the seat struct
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.
2021-03-25 09:36:07 +01:00
Daniel Eklöf
863ae1143f
fdm: add support for managing signals
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.
2021-02-11 18:55:21 +01:00
Daniel Eklöf
2cc84db979
urls: initial support for detecting URLs and rendering jump-labels
The jump labels work, but is currently hardcoded to use xdg-open
2021-02-07 16:33:31 +01:00
Jan Beich
db9dc7e908
shm: unbreak build without memfd_create
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,
                       ^
2021-01-23 09:52:40 +01:00
Daniel Eklöf
fe12c54d35
pgo: stub implementation of reaper_del() 2021-01-12 09:20:54 +01:00
Daniel Eklöf
8b0ef6aa85
terminal: shutdown (or --hold) when the client process terminates
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.
2020-12-26 01:29:40 +01:00
Daniel Eklöf
03cbb6ad90
notify: break out desktop notifications from osc.c 2020-12-10 18:06:24 +01:00
Daniel Eklöf
b59d695b2b
ime: add functions to enable/disable IME, simplify code that enables IME
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.
2020-12-07 20:44:11 +01:00
Daniel Eklöf
ba8b15d675
sixel: change default max size to 10000x10000
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.
2020-11-23 20:10:55 +01:00
Daniel Eklöf
daa8d129c1
pgo: feed VT data through fdm_ptmx(), not vt_from_slave()
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.
2020-11-22 19:29:44 +01:00
Daniel Eklöf
cf398df62e
pgo: initialize (mouse) selection 2020-11-22 19:29:43 +01:00
Daniel Eklöf
4cd1d35c1e
pgo: initialize a dummy wayland backend
* Empty seat list
* Empty monitor list
* Add dummy terminal instance to terminal list
2020-11-22 19:29:43 +01:00
Daniel Eklöf
e1bde0b0e7
remove pre-generated input corpus for PGO 2020-11-22 19:29:43 +01:00
Daniel Eklöf
001d309b81
pgo: updated stimuli (256-indexed colors) 2020-11-22 19:29:42 +01:00
Daniel Eklöf
cc850ed012
pgo: pull in selection.c in pgolib
Some of the selection functions are in the hot path, so this makes a
huge difference!
2020-11-22 19:29:40 +01:00
Daniel Eklöf
8619ebd778
pgo: support for specifying multiple stimuli files 2020-11-22 19:28:55 +01:00
Daniel Eklöf
5a1273eb5b
pgo: move pgo.c and pgo stimuli to pgo directory 2020-11-22 19:28:54 +01:00