aboutsummaryrefslogtreecommitdiff
path: root/render
AgeCommit message (Collapse)Author
2021-11-02render: completely disable gles2 if requested but libEGL is foundJan Beich
For `required` to disable search the value needs to be of `feature` type. Checking `gles2` via `in` keyword returns a `bool` but `required: false` makes the dependency optional instead of disabled.
2021-10-27render/egl.c: Fix memory leaks in egl_createHaelwenn (lanodan) Monnier
calloc is moved to right before egl is called to avoid requiring to free() unused memory. Found via scan-build
2021-10-27render/pixman/renderer.c: Fix memory-leak in create_bufferHaelwenn (lanodan) Monnier
Found via scan-build
2021-10-19render/vulkan: check vulkan-headers dependencySimon Ser
There's no pkg-config file we can check for sadly, so check vulkan/vulkan.h as a fallback. Closes: https://github.com/swaywm/wlroots/issues/3272
2021-10-18render/vulkan: Use image view swizzles instead of shader hackJoshua Ashton
Signed-off-by: Joshua Ashton <joshua@froggi.es>
2021-10-18render/vulkan: add Vulkan renderernyorain
This new renderer is implemented with the existing wlr_renderer API (which is known to be sub-optimal for some operations). It's not used by default, but users can opt-in by setting WLR_RENDERER=vulkan. The renderer depends on VK_EXT_image_drm_format_modifier and VK_EXT_physical_device_drm. Co-authored-by: Simon Ser <contact@emersion.fr> Co-authored-by: Jan Beich <jbeich@FreeBSD.org>
2021-10-14render/allocator: use empty DRM lease to re-open nodeSimon Ser
This allows us to obtain a new DRM file description without relying on filesystem permissions.
2021-10-04render/allocator: use render node if available in reopen_drm_nodeSimon Ser
If we aren't trying to create a dumb buffer allocator, and if the DRM device has a render node (ie, not a split render/display SoC), then we can use the render node instead of the primary node. This should allow wlroots to run under seatd when the current user doesn't have the permission to open primary nodes (logind has a quirk to allow physically logged in users to open primary nodes).
2021-10-01Revert "render/drm_format_set: add wlr_drm_format_has"Simon Ser
This reverts commit 833437d5921339f2862ccfb0493617630ea3937d.
2021-10-01Revert "Require INVALID for implicit format modifiers"Simon Ser
This reverts commit ea7357b70366588069c83f158e6a4eb2d3a702b3.
2021-10-01Revert "render/egl: always add LINEAR to supported modifiers"Simon Ser
This reverts commit 780052d4da0c93f9210dd87d2100b116af7ff308.
2021-10-01Revert "render/drm_format_set: remove special LINEAR case"Simon Ser
This reverts commit 6d281d96cb93b8de972039d5cb00bfce49d9a58c.
2021-10-01render/drm_format_set: remove special LINEAR caseSimon Ser
This was used to make the intersection of INVALID and LINEAR result in LINEAR. We can now just require LINEAR to be in both lists.
2021-10-01render/egl: always add LINEAR to supported modifiersSimon Ser
2021-10-01Require INVALID for implicit format modifiersSimon Ser
See [1] for the motivation. [1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/75
2021-10-01render/drm_format_set: add wlr_drm_format_hasSimon Ser
2021-09-15types/buffer: make {begin,end}_data_ptr_access part of the public APISimon Zeni
2021-09-10buffer: add data_ptr access flagsSimon Ser
This allows callers to specify the operations they'll perform on the returned data pointer. The motivations for this are: - The upcoming Linux MAP_NOSIGBUS flag may only be usable on read-only mappings. - gbm_bo_map with GBM_BO_TRANSFER_READ hurts performance.
2021-09-03render/allocator/gbm: add log message for gbm_bo_get_fd_for_planeSimon Ser
Makes it easier to find out which branch is taken when debugging issues like [1]. [1]: https://github.com/swaywm/wlroots/issues/3156
2021-09-03render/allocator: use legacy authentication for primary nodesSimon Ser
Closes: https://github.com/swaywm/wlroots/issues/3156
2021-09-01render/allocator: re-open GBM FDSimon Ser
Using the same DRM file description for the DRM backend and for the GBM allocator will result in GEM handle ref'counting issues [1]. Re-open the DRM FD to fix these issues. [1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/110
2021-08-25render/egl: reopen DRM node for GBMSimon Ser
This will be necessary for the next patch, to avoid messing up BO handles shared between the GL implementation and the DRM backend.
2021-08-25Move allocator stuff into new directorySimon Ser
Add render/allocator/ and include/render/allocator/ to hold everything allocator-related.
2021-08-12render/gles2: make wlr_gles2_texture a wlr_buffer addonSimon Ser
2021-08-12render/gles2: make wlr_gles2_buffer an addonSimon Ser
Saves us from walking a list.
2021-08-03render/pixman/pixel_format: add more formatsSimon Ser
Add a bunch of new formats for Pixman: a few missing 32-bit ones, some 16-bit and 32-bit formats as well. Mostly based on a Weston patch [1]. [1]: https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/664
2021-08-03render/pixel_format: add more formats for PixmanSimon Ser
These will be added to Pixman in the next commit.
2021-07-30render/gles2: add a few 10-bit and FP16 formatsManuel Stoeckl
The half-float formats depend on GL_OES_texture_half_float_linear, not just the GL_OES_texture_half_float extension, because the latter does not include support for linear magni/minification filters. The new 2101010 and 16161616F formats are only available on little- endian builds, since their gl_types are larger than a byte and thus endianness dependent.
2021-07-30render/gles2: hide shm formats without GL supportManuel Stoeckl
This change introduces a new function to check whether the renderer has the needed GL extensions to read a given pixel format.
2021-07-30render/pixel-format: add a few 10-bit and FP16 formatsManuel Stoeckl
2021-07-29render/gles2: add support for some 24 and 16-bit formatsSimon Ser
On little-endian, we can enable pixel formats which don't use gl_type = GL_UNSIGNED_BYTE. See [1]. [1]: https://afrantzis.com/pixel-format-guide/
2021-07-29render/pixel-format: add some 24 and 16-bit formatsSimon Ser
2021-07-27render/egl: initialize wlr_egl with EGL_PLATFORM_DEVICE_EXTSimon Zeni
Uses the EXT_device_query extension to get the EGL device matching the requested DRM file descriptor. If the extension is not supported or no device is found, the EGL device will be retrieved using GBM. Depends on the EGL_EXT_device_enumeration to get the list of EGL devices.
2021-07-27render/egl: fix typoyuiiio
2021-07-26render/egl: add support for EGL_EXT_device_drm_render_nodeSimon Ser
This EGL extension has been added in [1]. The upsides are: - We directly get a render node, instead of having to convert the primary node name to a render node name. - If EGL_DRM_RENDER_NODE_FILE_EXT returns NULL, that means there is no render node being used by the driver. [1]: https://github.com/KhronosGroup/EGL-Registry/pull/127
2021-07-23render/egl: set EGL_IMAGE_PRESERVED_KHRSimon Ser
Without setting this the EGL implementation is allowed to perform destructive actions on the buffer when imported: its contents become undefined. This is mostly a pedantic change, because Mesa processes the attrib and does absolutely nothing with it.
2021-07-22render/wlr_texture: put wlr_texture_from_buffer into the public APISimon Zeni
2021-07-22render: drop wlr_renderer_impl.init_wl_displaySimon Ser
Now that we have our own wl_drm implementation, there's no reason to provide custom renderer hooks to init a wl_display in the interface. We can just initialize the wl_display generically, depending on the renderer capabilities.
2021-07-12render/gles2: disable blending opportunisticallySimon Ser
We don't always need to enable blending: when the texture doesn't have alpha or when the color is opaque, we can disable it.
2021-07-12render/gles2: set has_alpha for DMA-BUFsSimon Ser
Use our internal pixel format table to figure out whether an imported DMA-BUF has alpha.
2021-07-12render/gles2: rename wlr_egl.exts to better match KhronosSimon Ser
Khronos refers to extensions with their namespace as a prefix in uppercase. Change our naming to align with Khronos conventions. This also makes grepping easier.
2021-07-12render/egl: rename wlr_egl.exts to better match KhronosSimon Ser
Khronos refers to extensions with their namespace as a prefix in uppercase. Change our naming to align with Khronos conventions. This also makes grepping easier.
2021-07-09render/pixman: fix texture_is_opaque()Vyivel
A texture is opaque when it does *not* have alpha. Fixes https://github.com/swaywm/wlroots/issues/2907
2021-07-06move wlr_box from /types to /utilSimon Zeni
2021-07-05render/egl: remove EGL_WL_bind_wayland_display supportSimon Ser
Our GLES2 renderer doesn't use it anymore, so we can drop it.
2021-07-05render: remove wl_drm support from wlr_rendererSimon Ser
Everything needs to go through the unified wlr_buffer interface now. If necessary, there are two ways support for EGL_WL_bind_wayland_display could be restored by compositors: - Either by using GBM to convert back EGL Wayland buffers to DMA-BUFs, then wrap the DMA-BUF into a wlr_buffer. - Or by wrapping the EGL Wayland buffer into a special wlr_buffer that doesn't implement any wlr_buffer_impl hook, and special-case that buffer type in the renderer.
2021-07-05render/gles2: use wlr_drm for wl_drm implementationSimon Ser
This allows use to remove all of our special wl_drm support code.
2021-07-01buffer: make enum wlr_buffer_cap publicSimon Ser
Custom backends and renderers need to implement wlr_backend_impl.get_buffer_caps and wlr_renderer_impl.get_render_buffer_caps. They can't if enum wlr_buffer_cap isn't made public.
2021-07-01render: drop wlr_renderer_impl.texture_from_dmabufSimon Ser
2021-07-01render: use wlr_dmabuf_buffer in wlr_texture_from_dmabufSimon Ser