Commit Graph

45 Commits

Author SHA1 Message Date
Ivan Molodetskikh f625dede1a Extract niri.clear_color() 2023-10-13 13:30:36 +04:00
Ivan Molodetskikh 15b6c84af0 tty: Start new tracy frame only when queueing redraw 2023-10-11 09:02:55 +04:00
Ivan Molodetskikh 082d734b2a Make zbus optional under "dbus" feature 2023-10-10 10:25:33 +04:00
Ivan Molodetskikh 189d1bd97b Add power-off-monitors bind
Implements https://github.com/YaLTeR/niri/issues/24
2023-10-09 18:37:43 +04:00
Ivan Molodetskikh bb3fbe2e83 Make output modes configurable 2023-10-03 08:35:24 +04:00
Ivan Molodetskikh 2d3d0ce165 tty: Remove assert on needs_sync
cosmic-comp doesn't do anything with it.
2023-10-02 10:54:05 +04:00
Ivan Molodetskikh 5b6b3fcfbe Avoid sending frame callbacks to invisible surfaces 2023-10-01 19:41:42 +04:00
Ivan Molodetskikh a3aa5fca12 Refactor frame scheduling
Combine the redraw state variables into one enum, and refactor to get
rid of the requirement that a VBlank must queue a subsequent redraw.
Also fix the bug where ongoing animations that produced no damage could
stall the redrawing.
2023-09-30 17:13:56 +04:00
Ivan Molodetskikh f381db8354 Make pipewire / xdp-gnome-screencast optional 2023-09-30 09:58:34 +04:00
Ivan Molodetskikh 404661ed8d Throttle frame callbacks to once per monitor refresh
Under some circumstances, the compositor can get into a commit-frame
callback busy loop with a client. For example, if a client redraws on
frame callbacks, but the resulting frame has empty damage (e.g. the
damaged part of the client is outside the monitor). Or if the client
simply commits with empty damage (looking at you, Firefox).

This behavior is compliant with the Wayland specification and with the
intended idea of frame callbacks, but causes a lot of unnecessary CPU
usage in the client and the compositor.

To solve this problem, this commit introduces frame callback throttling.

Every surface may only receive a single frame callback in one
monitor refresh cycle. If a surface commits resulting in no KMS frame
submission, a timer is created, that will fire at the predicted would-
be-VBlank time, and send the accumulated frame callbacks.

This way, a surface that redraws on frame callbacks will not notice
any change in frame callback delivery, if its commits suddenly stop
producing KMS updates.
2023-09-29 13:12:50 +04:00
Kirill Chibisov 804e064826 shell: add support for kde server decorations
This should provide server side decorations for the gtk3 applications,
like firefox.
2023-09-27 18:38:38 +04:00
Ivan Molodetskikh dc10e464ad tty: Take metadata by value 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh 906ee36a93 Skip rendering when backend is inactive 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh ac16717f4e Avoid unwraps in more places 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh 52aee11aa5 tty: Add more trace spans 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh e299328741 tty: Extract other event handlers into functions 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh 0f43e90b2a tty: Avoid panicks in the vblank callback 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh bbf707367a tty: Extract on_vblank() 2023-09-26 13:45:03 +04:00
Ivan Molodetskikh cfe80574df Use new tracy-client new_leak() methods
I added them to avoid the use of internal module and leaks when tracing
is disabled.
2023-09-26 13:45:03 +04:00
Ivan Molodetskikh cd4f7c0378 Remove LoopData
The calloop Smithay update finally lets me do this.
2023-09-26 13:45:03 +04:00
Ivan Molodetskikh 109668fa30 Add output configuration & integer scaling support 2023-09-21 13:48:50 +04:00
Ivan Molodetskikh 9fc731c115 Plot target presentation time offset 2023-09-20 11:51:25 +04:00
Ivan Molodetskikh 361b34f460 tty: Pass output name to tracy span 2023-09-19 07:39:21 +04:00
Ivan Molodetskikh 94da8b1e3e tty: Try to create context with high priority 2023-09-18 20:09:57 +04:00
Ivan Molodetskikh ddbc455bb8 Add debug flag to enable overlay planes 2023-09-14 22:43:24 +04:00
Ivan Molodetskikh 3d6bc996ca Disable ColorTransformations, add debug flag to enable
Speeds up the rendering slightly, doesn't seem to cause issues?
2023-09-14 22:43:24 +04:00
Ivan Molodetskikh 89f9e11f65 Store Config as Rc<RefCell<>> field 2023-09-14 22:43:24 +04:00
Ivan Molodetskikh 092095ead0 Add debug flag to wait for frame completion 2023-09-14 09:33:42 +04:00
Ivan Molodetskikh ef11975ec5 tty: Plot vblank dispatch offsets 2023-09-14 09:19:20 +04:00
Ivan Molodetskikh d52ca23caa Add initial monitor screencast portal impl
DmaBuf monitor screencasting through xdg-dekstop-portal-gnome!

Somewhat limited currently, e.g. the cursor is always embedded. But gets
most of the job done.
2023-09-08 23:53:56 +04:00
Ivan Molodetskikh 682182f363 Update Smithay and fix winit presentation time 2023-09-04 15:09:58 +04:00
Ivan Molodetskikh 59a6119f46 Fix refresh passed to presentation feedback 2023-09-04 14:26:55 +04:00
Ivan Molodetskikh 786e0fa4f0 Re-enable dmabufs but without overlay planes 2023-09-04 10:24:23 +04:00
Ivan Molodetskikh 8df48c05ca tty: Add commented-out wait-for-sync span 2023-09-04 09:56:28 +04:00
Ivan Molodetskikh 66467c8add tty: Add commented-out no-color-transformation renderer 2023-09-04 09:55:53 +04:00
Ivan Molodetskikh 14bafdf202 tty: Add Tracy vblank frame events 2023-09-04 08:57:11 +04:00
Ivan Molodetskikh acb9376d05 tty: Add name and presentation to vblank mark 2023-09-04 08:02:24 +04:00
Ivan Molodetskikh acf3016bce tty: Store surface name 2023-09-04 08:01:50 +04:00
Ivan Molodetskikh b54e1522ff tty: Add Surface state struct 2023-09-04 07:49:50 +04:00
Ivan Molodetskikh ff4b3b0532 Disable dmabufs for now
For some reason they cause big rendering performance problems.
2023-09-03 15:55:36 +04:00
Ivan Molodetskikh 95cbe2a636 Send scanout feedbacks to surfaces 2023-09-03 15:15:55 +04:00
Ivan Molodetskikh cc1c9d9325 Add initial dmabuf feedback implementation 2023-09-03 14:22:04 +04:00
Ivan Molodetskikh 03a9fd8af3 Move all traits one layer up 2023-09-03 14:10:02 +04:00
Ivan Molodetskikh dcc6a55777 Move LoopData into niri file 2023-09-03 13:25:43 +04:00
Ivan Molodetskikh a8f581a506 Move backends to subfolder 2023-09-03 13:07:16 +04:00