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

14 commits

Author SHA1 Message Date
Maxim Solovyov
249f681857
backend: make target window a parameter of the init backend operation
to address a todo
2023-09-24 01:14:55 +03:00
Yuxuan Shui
1307d9ec70
core: isolate X connection with error handling into a struct
Part of the long running effort to reduce the prevalence of `session_t`.
After this, functions that communicate with X can make use of the error
handling machinary (set_ignore_cookie, set_cant_fail_cookie) without
needing to take a `session_t` parameter.

This commit converts everything to use the new struct `x_connection`,
most of the conversions are mechanical.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-07-04 16:24:53 +01:00
Maxim Solovyov
689321419b
backend: egl: remove references to the glx backend 2023-06-18 19:30:01 +03:00
Yuxuan Shui
5b6f6ecbf5
backend: egl: print egl error when eglCreateImage failed
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-06-12 12:03:37 +01: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
Yuxuan Shui
2a4e32babf
backend: add last_render_time interface.
Used for querying how long render takes to complete, used for frame
pacing.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2023-06-08 20:35:23 +01:00
Yuxuan Shui
766f9f996f
Merge pull request #986 from absolutelynothelix/fix-creating-eglpixmap
fixes https://github.com/yshui/picom/issues/981
2023-01-13 16:55:06 +00:00
Maxim Solovyov
0ecfd9fd32
backend: egl: fix creating eglpixmap
according to the specification of the EGL_KHR_image_pixmap extension,
if target is EGL_NATIVE_PIXMAP_KHR then ctx must be EGL_NO_CONTEXT,
otherwise, the EGL_BAD_PARAMETER error is generated. source:
https://registry.khronos.org/EGL/extensions/KHR/EGL_KHR_image_pixmap.txt

fixes #981
2023-01-11 13:36:18 +03:00
Maxim Solovyov
29342e7cea
backend: egl: simplify getting a framebuffer configuration
we're using the first available framebuffer configuration that
meets our needs so there is no need to ask for more than one
2023-01-09 04:25:59 +03:00
Yuxuan Shui
19a24ada9d
backend: egl: fix warning 2022-11-27 18:07:05 +00:00
Yuxuan Shui
552bf77d0e
backend: egl: fix undefined symbols on old systems
Users with an old EGL version won't be able to use the egl backend. OTOH
we shouldn't prevent them from running picom because of a feature they
won't even use.

Don't assume the existence of EGL 1.5 symbols.

Fixes #945

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-11-27 18:03:25 +00:00
Omar Polo
2d35f78dc3
backend: egl: don't assume glEGLImageTargetTexStorage exists
Use eglGetProcAddress instead.

Fixes #932
2022-11-22 15:07:09 +00:00
Yuxuan Shui
c1dc11f59c
backend: egl: fix resource leak
Destroy context and surface as well in egl_deinit.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-09-29 19:09:59 +01:00
Yuxuan Shui
5a72b5755d
backends: add egl backend
This needs the EGL_KHR_image_pixmap and the GL_EXT_EGL_image_storage
extensions, which unfortunately aren't available on NVIDIA cards.

Don't add documentation for these, for now.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2022-09-29 08:03:12 +01:00