Commit Graph

2140 Commits

Author SHA1 Message Date
clement
39de1e49cf fixed window unmap crash 2024-01-26 11:51:53 +00:00
clement
fffc7ce535 Properly animates depending on wintype animation property in config 2024-01-26 09:54:28 +00:00
Arda Atci
fe5b416ed6 fixing old merge conflicts... sorry guys 2024-01-22 22:42:57 +03:00
Arda Atci
2417084628 Merge remote-tracking branch 'yshui/next' into next 2024-01-22 22:34:48 +03:00
Arda Atci
4299336146 Merge pull request #32 from JasonGrace2282/next
Add how to run section to README.md
2024-01-22 22:28:19 +03:00
Yuxuan Shui
702e30df4a Update nix flake
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-22 16:51:41 +00:00
Yuxuan Shui
d87dd41f4c win: make sure window's client_win can't be XCB_NONE
This is a follow up to 81d137a3cc and
bug #704. Basically a window will have a `XCB_NONE` as `client_win` if its
previous client_win detached and then the window itself is immediately
destroyed. Because the window is destroyed we couldn't call
`win_recheck_client` so its `client_win` will remain `XCB_NONE`.

However, it turns out we have a convention of setting `client_win` to
the window itself if windows that don't have a client window. So make
sure this convention is followed even for destroyed windows.

Doesn't really fix anything, just to make sure an invariant holds.

Related: #704

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-21 19:58:29 +00:00
Yuxuan Shui
ce205d1591 win: add more debug logs for window updates
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-21 19:26:20 +00:00
Yuxuan Shui
4c4df9b918 Update CHANGELOG.md
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-21 19:26:00 +00:00
Yuxuan Shui
56da153f1c Update copyright
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-21 17:35:18 +00:00
Yuxuan Shui
81d137a3cc core: fix debug window check in paint_preprocess
Fixes #704

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-21 17:27:05 +00:00
Yuxuan Shui
6e3c86226b core: improve debug log formatting around paint_preprocess
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-21 17:26:46 +00:00
Yuxuan Shui
197b4bd396 Update CHANGELOG.md for v11 release
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-20 17:12:34 +00:00
Jason Grace
a3f50e8a3b Add running section to README.md 2024-01-20 10:00:54 -05:00
Yuxuan Shui
4c34944d76 Update CHANGELOG.md
I forgot to mention the priviledge needed for real-time scheduling.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-18 14:18:58 +00:00
Yuxuan Shui
a73ca2dc8d Merge pull request #1162 from yshui/deprecations-11 2024-01-15 13:41:30 +00:00
Yuxuan Shui
1b8d321c45 Update CHANGELOG.md
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-14 22:51:09 +00:00
Yuxuan Shui
30e37dbf09 Update CHANGELOG.md
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-14 17:10:20 +00:00
Yuxuan Shui
dc2d7b2876 options: use of respect-prop-shadow is now an error
Deprecated in v8.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-14 17:06:34 +00:00
Yuxuan Shui
5e119123a7 options: use of sw-opti is now an error
Deprecated in v6, we forgot to remove it.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-14 17:04:58 +00:00
Yuxuan Shui
6d4eaec811 options: remove -F
Deprecated in compton, in distant history.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-14 16:58:56 +00:00
Yuxuan Shui
eb3a58a6b0 Add a CHANGELOG.md
The intention is we update this file as PRs are merged, so the workload
when making a new release is reduced.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-14 16:50:47 +00:00
Yuxuan Shui
3390494bfe Bump version number
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-14 15:53:31 +00:00
Yuxuan Shui
148e61a0b2 Merge pull request #1156 from yshui/pacing-fixes 2024-01-14 15:46:24 +00:00
Yuxuan Shui
d8f303761b core: reset msc counter if it went backwards
Otherwise we might be repeatedly hitting this condition and spam the
warning.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-14 15:41:41 +00:00
Arda Atci
217284642a Merge branch 'yshui:next' into next 2023-12-23 02:06:40 +03:00
Yuxuan Shui
496452cfce Merge pull request #1157 from absolutelynothelix/fix-segfaults-when-homeless 2023-12-22 10:59:55 +00:00
Maxim Solovyov
cacb45fbcd core: fix segfaults when the HOME environment variable is not set 2023-12-22 13:26:32 +03:00
Arda Atci
7336e4142b Merge branch 'yshui:next' into next 2023-12-20 22:34:54 +03:00
Yuxuan Shui
b368072e12 Merge pull request #1002 from tryone144/fix/use-effective-texture-size-for-corner-radius 2023-12-20 10:48:14 +00:00
Yuxuan Shui
359d004b99 core: disable frame pacing when vsync is disabled
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 23:27:19 +00:00
Yuxuan Shui
6e0bad0034 core: make missing dpms extension non-fatal
We are not using it for anything at the moment, and it is breaking CI.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 23:27:16 +00:00
Yuxuan Shui
a28e221b83 driver: choose sgi_video_sync scheduler for NVIDIA
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 23:27:15 +00:00
Yuxuan Shui
b582d2989e core: add debug options to override the vblank scheduler
Useful for debugging.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 23:27:14 +00:00
Yuxuan Shui
db9b808bfb vblank: add GLX_SGI_video_sync based scheduler
Present extension based scheduler doesn't work well on NVIDIA drivers.
GLX_SGI_video_sync is less accurate, but is rumoured to work. See
[kwin's usage](https://invent.kde.org/plasma/kwin/-/blob/master/src/
backends/x11/standalone/x11_standalone_sgivideosyncvsyncmonitor.cpp)

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 23:27:12 +00:00
Yuxuan Shui
db6ed75b60 core: don't always delay schedule_render to vblank
It's kind of dumb anyway. If we get damage event right after a vblank
event, we would waste the whole vblank.

Instead improve the frame scheduling logic to target the right vblank
interval. This only affects smart_frame_pacing anyway.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 23:27:11 +00:00
Yuxuan Shui
dd83f550e1 core: always check if render is finished at next vblank
Right now we rely on `reschedule_render_at_vblank` being scheduled for
the render finish check. Which means we will only know if a frame has
finished rendering the next time we queue a render. And we only check at
vblank boundary, which means when a render is queued we have to wait for
the next vblank, when had we checked earlier, we will be able to start
rendering immediately

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 23:27:10 +00:00
Yuxuan Shui
c42e6cef0a vblank: winding down vblank events instead of stopping immediately
I noticed sometimes full frame rate video is rendered at half frame rate
sometimes. That is because the damage notify is sent very close to
vblank, and since we request vblank events when we get the damage, we
miss the vblank event immediately after, despite the damage happening
before the vblank.

       request  next  ......  next next
damage  vblank vblank          vblank
   |    |       |     ......      |
   v    v       v                 v
---------------------->>>>>>---------

`request vblank` is triggered by `damage`, but because it's too close to
`next vblank`, that vblank is missed despite we requested before it
happening, and we only get `next next vblank`. The result is we will
drop every other frame.

The solution in this commit is that we will keep requesting vblank
events, right after we received a vblank event, even when nobody is
asking for them. We would do that for a set number of vblanks before
stopping (currently 4).

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 23:27:08 +00:00
Yuxuan Shui
25d16b0352 x: fix x_request_vblank_event
present_notify_msc with divisor == 0 has undocumented special meaning,
it means async present notify, which means we could receive MSC
notifications from the past.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 23:27:07 +00:00
Yuxuan Shui
3838b45e2c core: simplify pacing logic a bit more
Also, vblank event callback should call schedule_render to queue renders
instead of starting the draw timer directly, so that the CPU time
calculation will be correct.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 23:27:06 +00:00
Yuxuan Shui
4b57e3aa4c config: add debug options to enable timing based pacing
Disable timing estimation based pacing by default, as it might not work
well across drivers, and might have subtle bugs.

You can try setting `PICOM_DEBUG=smart_frame_pacing` if you want to try
it out.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 23:27:04 +00:00
Yuxuan Shui
1430d28116 core: refactor frame pacing
Factored out vblank event generation, add abstraction over how vblank
events are generated. The goal is so we can request vblank events in
different ways based on the driver we are running on.

Tried to simplify the frame scheduling logic, we will see if I succeeded
or not.

Also, the logic to exclude vblank events for vblank interval estimation
when the screen off is dropped. It's too hard to get right, we need to
find something robust.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 23:26:59 +00:00
Yuxuan Shui
147561a313 config: add a debug environment variable
This is where we keep temporary, short living, private debug options.

Adding and removing command line and config file options are
troublesome, and we don't want people adding these to their config
files.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 22:36:35 +00:00
Yuxuan Shui
23eb3d5f52 core: don't unredir when display is turned off
We unredirect because we receive bad vblank events, and also vblank
events at a different interval compared to when the screen is on. But it
is enough to just not record the vblank interval statistics when the
screen is off.

Although, unredirecting when display is off can also fix the problem
where use-damage causes the screen to flicker when the display is turned
off then back on. So we need something else for that.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 22:36:32 +00:00
Yuxuan Shui
2e1c4e51b3 core: don't request vblank events when we are not rendering
Previously everytime we receive a vblank event, we always request a new
one. This made the logic somewhat simpler. But this generated many
useless vblank events, and wasted power. We only need vblank events for
two things:

1. after we rendered a frame, we need to know when it has been displayed
   on the screen.
2. estimating the refresh rate.

This commit makes sure we only request vblank events when it's actually
needed.

Fixes #1079

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 22:36:31 +00:00
Yuxuan Shui
827380e1e3 core: simplify the pacing logic a little bit
Make it simpler to stop requesting PresentCompleteNotify when there is
nothing to render.

Related: #1079

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 22:36:28 +00:00
Yuxuan Shui
8d98b7d639 core: don't call schedule_render too early
I mistakenly assumed that PresentCompleteNotify event signifies the end
of a vblank (or the start of scanout). But actually this event can in
theory in sent at any point during a vblank, with its timestamp pointing
to when the end of vblank is. (that's why we often find the timestamp to
be in the future).

Add a delay so schedule_render is actually called at the end of vblank,
so it doesn't mistakenly think the render is too slow to complete.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 22:36:17 +00:00
Yuxuan Shui
e76cf43f02 backend: gl: adjust some log levels
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-12-19 11:30:42 +00:00
Arda Atci
c178be2874 Merge remote-tracking branch 'yshui/next' into next 2023-12-19 13:07:09 +03:00
Arda Atci
7da885e6c0 index on next: 5a8c61da revert opacity rule 2023-12-19 13:00:17 +03:00