aboutsummaryrefslogtreecommitdiff
path: root/backend
AgeCommit message (Collapse)Author
2021-02-08backend/x11: drop x11-xcb dependencySimon Ser
We don't need it anymore now that we've stopped using the EGL Xlib platform.
2021-02-05backend/x11: use native cursorsIlia Mirkin
Fixes #2659
2021-02-05Make implementation function lists static constManuel Stoeckl
This requires a change to the type of `struct wlr_tablet` and `wlr_tablet_init` signature, both of which are part of the unstable API.
2021-02-03backend/wayland: flush remote displaySimon Ser
It turns out wl_event_source_check is not enough to guarantee that the remote wl_display will be flushed after we queue requests. We need to explicitly flush, just like we do in our X11 code. References: https://gitlab.freedesktop.org/wayland/wayland/-/issues/187
2021-01-29backend/wayland: remove unnecessary castSimon Ser
2021-01-28backend/x11: remove output_set_refreshSimon Ser
The X11 backend uses the Present extension to schedule frames. The refresh rate is unused.
2021-01-24backend/drm: don't blit in drm_fb_importSimon Ser
Instead blit in drm_plane_lock_surface. This makes drm_fb_import simpler and better fits its name.
2021-01-24backend/drm: simplify drm_fb_lock_surfaceSimon Ser
Make it take a plane instead, and rename to drm_plane_lock_surface.
2021-01-21backend/x11: keep track of exposed rects, add them to damage regionsIlia Mirkin
When we receive an Expose event, that means that we must redraw that region of the X11 window. Keep track of these regions with pixman regions, and merge them with the additional output damaged regions. Fixes #2670
2021-01-21backend/x11: skip events we don't care aboutIlia Mirkin
These are ones I see log messages about in my setup.
2021-01-21backend/x11: add support for scanout modeIlia Mirkin
This makes full-screen with weston-terminal work.
2021-01-20backend/x11: make sure output transform matrix is initializedIlia Mirkin
The transform matrix was all 0's, which meant that effectively nothing got rendered other than the clear color.
2021-01-18backend/x11: fix region not being actually usedSimon Ser
The region variable was shadowed in an if block. As a result, in the outer block region was always XCB_NONE and was never destroyed (causing a memory leak on the server). Reported-by: Ilia Mirkin <imirkin@alum.mit.edu>
2021-01-18backend/x11: set a blank cursor rather than hiding globallyIlia Mirkin
This actually simplifies the logic since we no longer have to wait for enter/leave events, and also improves the UX when e.g. handling a crash with gdb attached. See #2659
2021-01-17backend/drm: fix modifiers for cursor plane buffersSimon Ser
In 93cd3a79b26c ("backend/drm: stop using GBM flags"), we stopped using the GBM_BO_USE_LINEAR flag in favor of a modifier list set to { DRM_FORMAT_MOD_LINEAR }. However, the last argument of drm_plane_init_surface disables modifiers -- so the buffer will just get allocated with an implicit modifier, without necessarily being LINEAR. To fix this, allow modifiers when allocating the cursor buffers. wlr_drm_plane.formats should already have the necessary LINEAR restrictions. Fixes: 93cd3a79b26c ("backend/drm: stop using GBM flags")
2021-01-17backend/drm: add wlr_drm_connector_get_idSimon Ser
This allows a compositor to get a KMS connector object ID from a wlr_output. The compositor can then query more information about the connector via libdrm. This gives more freedom to compositors and allows them to read KMS properties that wlroots doesn't know about. For instance, they could read the EDID or the suggested_{X,Y} properties and change their output configuration based on that.
2021-01-17backend/drm: add support for the subconnector propertySimon Ser
The subconnector property indicates the connector sub-type. This is useful because that usually indicates what kind of connector the user has plugged in to their monitor, e.g. a DisplayPort-to-DVI cable will indicate a DVI subconnector. Also some laptops have non-DP connectors that are internally linked to a DP port on the GPU. Set the output description accordingly. See https://drmdb.emersion.fr/properties/3233857728/subconnector
2021-01-17backend/x11: add xcb_dri3_pixmap_from_buffers check for n_planesSimon Ser
Just in case.
2021-01-17backend/x11: add support for DRI3 1.0Simon Ser
Add fallbacks when DRI3 1.2 isn't supported. Closes: https://github.com/swaywm/wlroots/issues/2586
2021-01-17backend/x11: log DRM node nameSimon Ser
2021-01-17backend/x11: log when creating X11 backendSimon Ser
2021-01-17backend/headless: create renderer after wlr_backend_initSimon Ser
We were calling wlr_renderer_autocreate before wlr_backend_init, which caused a NULL dereference on wlr_backend.impl.
2021-01-16backend/drm: use local DRM FD for wlr_rendSimon Ser
The new wlr_renderer_autocreate API is great for compositors, however it causes some issues with DRM multi-GPU support. A DRM child backend wants the compositor to use the parent GPU, so it exposes the parent's DRM FD in get_drm_fd. However, in order to be able to perform multi-GPU buffer copies, the child DRM backend still needs to create a local renderer. Use the new private wlr_renderer_autocreate_with_drm_fd function to avoid creating a renderer for the parent GPU. Fixes: e128e6c08dc0 ("render: drop egl parameters from wlr_renderer_autocreate")
2021-01-16render/gles2: make EGL context current in bind_bufferSimon Ser
Instead of requiring callers to manually make the EGL context current before binding a buffer and unsetting it after unbinding a buffer, do it inside wlr_renderer_bind_buffer. This hides renderer-specific implementation details inside the wlr_renderer interface. Non-GLES2 renderers may not use EGL. This removes all EGL dependencies from the backends. References: https://github.com/swaywm/wlroots/issues/2618 References: https://github.com/swaywm/wlroots/pull/2615#issuecomment-756687006
2021-01-16render: remove egl include from wlr_rendererSimon Zeni
2021-01-16render: drop egl parameters from wlr_renderer_autocreateSimon Zeni
2021-01-16backend/headless: implement get_drm_fdSimon Ser
2021-01-16backend/x11: implement get_drm_fdSimon Ser
2021-01-16backend/drm: implement get_drm_fdSimon Ser
2021-01-16backend/wayland: implement get_drm_fdSimon Ser
2021-01-16backend/multi: implement get_drm_fdSimon Ser
Just like get_renderer, iterate over all sub-backends until we find one that implements get_drm_fd.
2021-01-16backend: add get_drm_fd to interfaceSimon Ser
This function allows backends to return the DRM FD they are using. This will allow the allocator and the renderer to use the right device.
2021-01-14backend: remove unnecessary GLES2 includesSimon Ser
2021-01-13backend/drm: remove unnecessary wlr_drm_fb.wlr_buf checkSimon Ser
We don't need this check, wlr_buf is guaranteed not to be NULL.
2021-01-12backend/drm: fix segfault in page_flip_handlerSimon Ser
Since 5b1b43c68c7a ("backend/drm: make wlr_drm_plane.{pending,queued,current}_fb pointers"), current_fb can be NULL if there's no buffer. If current_fb is not NULL, current_fb->wlr_buf is guaranteed to not be NULL. Closes: https://github.com/swaywm/wlroots/issues/2634
2021-01-12render/egl: remove surface and buffer age args from make_currentSimon Ser
These aren't used anymore.
2021-01-10backend/wayland: use the EGL GBM platformSimon Ser
Just like other backends, use the EGL GBM platform. This will make it easier to move the allocator and renderer initialization out of the backends.
2021-01-10backend/drm: stop using surface size for BOSimon Ser
Stop using wlr_drm_surface.{width,height} to figure out the size of a gbm_bo. In the future we'll stop using wlr_drm_plane.surf, so these will be zero. Instead, rely on gbm_bo_get_{width,height}.
2021-01-10backend/drm: re-use FBsSimon Ser
Instead of importing buffers to GBM and KMS at each frame, cache them and re-use them while the wlr_buffer is alive. This is the same as [1] and [2] but for the DRM backend. [1]: https://github.com/swaywm/wlroots/pull/2538 [2]: https://github.com/swaywm/wlroots/pull/2539
2021-01-10backend/drm: only keep track of local bufferSimon Ser
Stop keeping track of buffers on the parent GPU when multi-GPU is used. This removes support for export_dmabuf on secondary GPUs, but renderer v6 will bring this back by managing the swapchains in wlr_output instead of the backends.
2021-01-10backend/drm: add wlr_drm_buf.local_wlr_bufSimon Ser
2021-01-10backend/drm: introduce drm_fb_createSimon Ser
2021-01-10backend/drm: make wlr_drm_plane.{pending,queued,current}_fb pointersSimon Ser
This will be useful once we start re-using wlr_drm_fb.
2021-01-07remove unnecessary egl includesSimon Zeni
2021-01-07backend: remove wlr_egl from all backendsSimon Zeni
2021-01-07backend/drm: don't log errno on plane_get_next_fb failureSimon Ser
errno isn't guaranteed to be set after a plane_get_next_fb failure, so we were printing garbage.
2021-01-06render: remove EGL config and visual from wlr_renderer_autocreateSimon Ser
This isn't used anymore by any backend. Some examples still provide an EGL config to wlr_egl_init, so we can't drop it yet there.
2021-01-05backend/wayland: remove unnecessary flags from event sourceSimon Ser
wl_event_loop_add_fd only accepts READABLE and WRITABLE. ERROR and HANGUP are always implicitly enabled.
2021-01-05backend/wayland: Avoid uninitialized readKenny Levinsen
keyboard_handle_leave would always process 1 keycode more than was pending, which meant reading uninitialized memory from the "pressed" array. Found by valgrind.
2021-01-04backend/session: allow wlr_session_find_gpus to return an errorSimon Ser
Sometimes wlr_session_find_gpus will encounter an error. This is different from finding zero GPUs. On error, wlr_session_find_gpus already returns -1. However, this is casted to size_t, so callers uncorrectly assume this is a success. Instead, make wlr_session_find_gpus return a ssize_t and allow callers to handle the error accordingly.