1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00
Commit graph

13 commits

Author SHA1 Message Date
Yuxuan Shui
fdbcd15975
backend: fix clang warning
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-29 23:57:11 +00:00
Yuxuan Shui
1bfb129985
backend: don't choose SGI_video_sync vblank if opengl is not enabled
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2024-01-29 21:02:36 +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
86d3739374
core: frame pacing
Use frame timing and render time statistic to pace frames.

Right now the criteria are simple:

* Don't render multiple frames in one vblank cycle. Otherwise the
  rendered frame will be delay multiple cycles, which isn't ideal.
* Start rendering as late as possible while still hitting vblank.

Refresh rate is estimated from a rolling average of frame timing. Render
time is predicted from the rolling maximum of past 128 frames. The
window size still needs to be investigated.

Remove glFinish calls and GL_MaxFramesAllowed=1, frame pacing superseeds
them.

Professionals might laugh at how rudimentary this is, but hopefully this
is better than what we had before. Which is absolutely nothing at all.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-06-08 20:35:24 +01:00
Daniel Kwan
e8147e0658 Set GL_MaxFramesAllowed=1 instead of GL_YIELD=usleep 2021-07-10 18:14:20 -04:00
Yuxuan Shui
30dfc8e0ac
driver: enable xrender-sync-fence on NVIDIA driver
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-22 20:20:22 +01:00
Yuxuan Shui
adeb09b775
driver: allow apply_driver_workaround to set options
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-22 20:13:18 +01:00
Yuxuan Shui
0efdb6c2d9
backend: glx: tentatively enable glFinish for NVIDIA
We use the __GL_YIELD=usleep workaround when we detect the NVIDIA
driver, so we could use glFinish without the NVIDIA driver taking all
the CPU.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-22 18:05:04 +01:00
Tomas Janousek
a7170cef81 backend: driver: fix memory leak (r2 not freed)
Fixes the following memory leaks reported by valgrind:

    96 bytes in 1 blocks are definitely lost in loss record 54 of 111
       at 0x483577F: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
       by 0x49DB0DD: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x49D8FB4: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x49DA63E: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x49DA751: xcb_wait_for_reply (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x14B266: detect_driver (driver.c:34)
       by 0x119949: session_init (compton.c:1879)
       by 0x11AEF0: main (compton.c:2285)

    96 bytes in 1 blocks are definitely lost in loss record 55 of 111
       at 0x483577F: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
       by 0x49DB0DD: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x49D8FB4: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x49DA63E: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x49DA751: xcb_wait_for_reply (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x14B266: detect_driver (driver.c:34)
       by 0x11795E: redir_start (compton.c:1202)
       by 0x115C76: paint_preprocess (compton.c:629)
       by 0x1182BD: _draw_callback (compton.c:1380)
       by 0x1184D0: draw_callback (compton.c:1426)
       by 0x49BF292: ev_invoke_pending (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
       by 0x49C3344: ev_run (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
2019-09-20 10:15:59 +02:00
Tomas Janousek
bd122c738d backend: driver: fix memory leak (randr_version not freed)
Fixes the following memory leaks reported by valgrind:

    32 bytes in 1 blocks are definitely lost in loss record 15 of 111
       at 0x483577F: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
       by 0x49DB0DD: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x49D8FB4: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x49DA63E: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x49DA751: xcb_wait_for_reply (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x14B16F: detect_driver (driver.c:20)
       by 0x119949: session_init (compton.c:1879)
       by 0x11AEF0: main (compton.c:2285)

    32 bytes in 1 blocks are definitely lost in loss record 16 of 111
       at 0x483577F: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
       by 0x49DB0DD: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x49D8FB4: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x49DA63E: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x49DA751: xcb_wait_for_reply (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
       by 0x14B16F: detect_driver (driver.c:20)
       by 0x11795E: redir_start (compton.c:1202)
       by 0x115C76: paint_preprocess (compton.c:629)
       by 0x1182BD: _draw_callback (compton.c:1380)
       by 0x1184D0: draw_callback (compton.c:1426)
       by 0x49BF292: ev_invoke_pending (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)
       by 0x49C3344: ev_run (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0)

Also, free(randr_version) in the error path as well.
2019-09-20 10:15:59 +02:00
Yuxuan Shui
0ba7761bd5
Untangle headers
Thanks, clang -fmodules.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-08-10 00:56:26 +01:00
Yuxuan Shui
b35bfd07d1
backend: driver: fix string out-of-bound read
libxcb doesn't null terminate strings.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:31 +01:00
Yuxuan Shui
685a583f84
backend: add preliminary support for driver detection
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2019-05-21 20:15:31 +01:00