aboutsummaryrefslogtreecommitdiff
path: root/render
AgeCommit message (Collapse)Author
2021-04-21render/gles2: log when creating rendererSimon Ser
Make it clear GLES2 is being used. Before this commit, various GL-related information was printed, but not an easy-to-find line about which renderer is being picked up.
2021-04-20render: introduce WLR_RENDERER in wlr_renderer_autocreate_with_drm_fdSimon Zeni
This env var forces the creation of a specific renderer. If no renderer is specified, the function will try to create all of the renderers one by one until one is created successfuly.
2021-04-20render/gles2: introduce wlr_gles2_renderer_create_with_drm_fdSimon Zeni
2021-04-20render: Assert that texture dimensions are > 0nyorain
2021-04-17render: make GLES2 renderer optionalayaka
Allow selecting whether the GLES2 renderer gets enabled. Co-authored-by: Simon Ser <contact@emersion.fr>
2021-04-17renderer: create pixman renderer if getting drm fd failedSimon Zeni
2021-04-17render: introduce pixman rendererSimon Zeni
2021-04-17render: introduce shared memory allocatorSimon Ser
It allocates in local main memory via shm_open, and provides a FD to allow sharing with other processes. This is suitable for software rendering under the Wayland and X11 backends.
2021-04-15render: rename get_dmabuf_render_formats into get_render_formatsSimon Zeni
2021-04-15render/gles2: prevent imported DMA-BUF textures from being mutatedSimon Ser
The compositor shouldn't write to client buffers if the client attaches a DMA-BUF to a wl_surface, then attaches a shm buffer. Make gles2_texture_write_pixels return an error to prevent this from happening.
2021-04-12backend: move get_drm_fd to public interfaceRoman Gilg
The get_drm_fd was made available in an internal header with a53ab146f. Move it now to the public header so consumers opting in to the unstable interfaces can make use of it.
2021-04-10drm: check for PRIME supportStephan Hilb
PRIME support for buffer sharing has become mandatory since the renderer rewrite. Make sure we check for the appropriate capabilities in backend, allocator and renderer. See also #2819.
2021-04-08render: drop support for ellipsesSimon Ser
For anything more complicated than quads, compositors can easily ship their own shaders. Closes: https://github.com/swaywm/wlroots/issues/2759
2021-04-08render: remove wlr_texture_to_dmabufSimon Ser
This is unused in wlroots, and the use-cases for compositors are pretty niche since they can access the original DMA-BUF via the wlr_buffer.
2021-04-08render: drop wlr_renderer_blit_dmabufSimon Ser
It can be replaced with wlr_renderer_bind_buffer. blit_dmabuf is broken as-is (dies on an assertion).
2021-04-07render/egl: check "EGL_KHR_platform_gbm" for EGL gbm platformzccrs
See the https://www.khronos.org/registry/EGL/extensions/KHR/EGL_KHR_platform_gbm.txt example code. On EGL_PLATFORM_GBM_KHR platform, we should be check the "EGL_KHR_platform_gbm" extension. Change-Id: Icf11c07c2949841a80b10527fb09987257fbd63b
2021-04-06render/egl: stop relying on platform for high prioritySimon Ser
All backends use the GBM platform. We can't use it to figure out whether the DRM backend is used anymore. Let's just try to always request a high-priority EGL context. Failing to do so is not fatal.
2021-03-27render/egl, backend/wayland: add workaround for split render/display setupsSimon Ser
Split render/display setups have two separate devices: one display-only with a primary node, and one render-only with a render node. However in these cases the EGL implementation and the Wayland compositor will advertise the display device instead of the render device [1]. The EGL implementation will magically open the render device when the display device is passed in. So just pass the display device as if it were a render device. Maybe in the future Mesa will advertise the render device instead and we'll be able to remove this workaround. [1]: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4178
2021-03-25render/gles2: remove depth and bpp gles2_pixel_format, use drm pixel formatSimon Zeni
2021-03-25render/pixel_format: add XBGR8888 and ABGR8888 formatSimon Zeni
2021-03-25Move render/shm_format functions to render/pixel_formatSimon Zeni
2021-03-25render/pixel_format: introduce pixel format info tableSimon Zeni
2021-03-15render/egl: don't fail on EGL_MESA_device_softwareSimon Ser
Mesa may advertise EGL_MESA_device_software even when hardware drivers are in use [1]. Demote the error to a warning until the Mesa bug is fixed. [1]: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4178 References: https://github.com/swaywm/wlroots/pull/2689
2021-03-10output: improve transform matrix calculationSimon Zeni
Compute only the transform matrix in the output. The projection matrix will be calculated inside the gles2 renderer when we start rendering. The goal is to help the pixman rendering process.
2021-02-23render: use DRM formats in wlr_texture_from_pixelsSimon Ser
2021-02-23render: use DRM formats in wlr_renderer_read_pixelsSimon Ser
2021-02-23output: use DRM format in wlr_output_preferred_read_formatSimon Ser
2021-02-23render: use DRM formats in wlr_renderer_get_shm_texture_formatsSimon Ser
2021-02-23render/gles2: replace wlr_gles2_texture.wl_format with drm_formatSimon Ser
2021-02-23render/gles2: convert format table to DRM formatsSimon Ser
2021-02-23render/shm_format: add wl_shm_format conversion helpersSimon Ser
2021-02-19render/gles2: remove current_buffer checksSimon Ser
All backends now use wlr_swapchain. This means the renderer is guaranteed to have a current_buffer bound. Remove the legacy code used for EGLSurface.
2021-02-19render/gles2: check buffer stride when uploading textureSimon Ser
If the stride is too small, the driver could end up segfaulting (e.g. radeonsi segfaults in __memmove_sse2_unaligned_erms).
2021-02-05render/gles2: remove YUV blocklistSimon Ser
Mesa provides YUV shaders, and can import multi-planar YUV DMA-BUFs as a single EGLImage. Remove the arbitrary limitation. If the driver doesn't support importing YUV as a single EGLImage, the import will fail and the result will be the same anyways.
2021-02-02render/dmabuf: make src arg const in wlr_dmabuf_attributes_copySimon Ser
2021-02-02render/dmabuf: cleanup on wlr_dmabuf_attributes_copy errorSimon Ser
2021-02-01render/wlr_texture: clamp texture coordinates to edge by defaultQuantum
Clamping texture coordinates prevents OpenGL from blending the left and right edge (or top and bottom edge) when scaling textures with GL_LINEAR filtering. This prevents visual artifacts like swaywm/sway#5809. Per discussion on IRC, this behaviour is made default. Compositors that want the wrapping behaviour (e.g. for tiled patterns) can override this by doing: struct wlr_gles2_texture_attribs attribs; wlr_gles2_texture_get_attribs(texture, &attribs); glBindTexture(attribs.target, attribs.tex); glTexParameteri(attribs.target, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(attribs.target, GL_TEXTURE_WRAP_T, GL_REPEAT); glBindTexture(attribs.target, 0);
2021-02-01render/egl: log whether DMA-BUF modifiers are supportedSimon Ser
2021-02-01render/egl: add check for EGL_KHR_surfaceless_contextBrandon Dowdy
As surfaces are no longer going to be used for wlr_egl, I may as well just go and add this check as it is needed for safety whenever surface-less rendering is being used.
2021-01-29render/egl: remove *config_attribs and wlr_egl->configBrandon Dowdy
Breaking changes: Both "EGLint *config_attribs" and "wlr_egl->config" no longer exist.
2021-01-29render/egl: remove wlr_egl_{create,destroy}_surfaceBrandon Dowdy
Breaking changes: wlr_egl_create_surface and wlr_egl_destroy_surface have been removed and no longer exist.
2021-01-27render/egl: fix NULL dereference when using llvmpipeSimon Ser
Fixes: 6becc69ec90c ("render/egl: fail to create wlr_egl on software renderer")
2021-01-27render/egl: fail to create wlr_egl on software rendererSimon Zeni
The creation of `wlr_egl` will fail is the device extension EGL_MESA_device_software is defined. The creation process is allowed to continue only if the environment variable `WLR_RENDERER_ALLOW_SOFTWARE` is defined to the value 1.
2021-01-23render/gbm_allocator: avoid drmPrimeHandleToFDSimon Ser
Some drivers (e.g. nouveau) need to do some book-keeping when exporting a BO handle to a DMA-BUF [1]. Using drmPrimeHandleToFD directly hides the export from the user-space drivers and causes some ref'counting issues. So we can't properly handle BOs with a different handle for each plane until [2] lands. [1]: https://gitlab.freedesktop.org/drm/nouveau/-/issues/43#note_772661 [2]: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5442 Suggested-by: Ilia Mirkin <imirkin@alum.mit.edu>
2021-01-20Revert "render: add wlr_egl_create_from_drm_fd function"Simon Ser
This reverts commit ee31be167b4e2c4682f3da6f22bddc23796f213d.
2021-01-20Revert "render/egl: remove unused gbm_device member"Simon Ser
This reverts commit 306cf11d8702c82be61e027a9bb76e27e89b34d3.
2021-01-20render/egl: remove unused gbm_device memberSimon Zeni
2021-01-20render: add wlr_egl_create_from_drm_fd functionSimon Zeni
2021-01-17render/gbm_allocator: set modifier to INVALID if implicitSimon Ser
When gbm_bo_create is used and the GBM implementation does support modifiers, gbm_bo_get_modifier may return something other than DRM_FORMAT_MOD_INVALID. This can cause issues with the rest of the stack (e.g. EGL or KMS) in case these don't support modifiers. Instead, force the modifier to INVALID, to make sure no one uses modifiers.
2021-01-17render/gbm_allocator: export to DMA-BUF on initSimon Ser
Instead of lazily exporting BOs to DMA-BUFs, do it on init. This is the only way to use the buffer, so there's no point in deferring that work. This is preparatory work for the next commit.