aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-01-28xwayland: fix extraneous NET_WM_STATE log messagesSimon Ser
wlroots would log "Unhandled NET_WM_STATE property change" log messages for atoms we know about. Simplify the code structure and remove these extra messages.
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-27xwayland: drop unused enum net_wm_state_actionSimon Ser
2021-01-25xwayland/selection: rename Wayland-facing data and helpersTudor Brindus
Previously, wlr_xwm_selection_transfer.source_fd meant: - the source of data in a Wayland -> X11 copy (good) - the destination of data in a X11 -> Wayland copy (confusing) This made reading through xwayland/selection/incoming.c difficult: in many places, "source" actually means "destination".
2021-01-25examples/foreign-toplevel: Add documenation and output selectionfwsmit
2021-01-25xwayland/selection: prevent fd leak on unsupported MIME typeTudor Brindus
Since we never end up calling xcb_convert_selection, the file descriptor ends up getting leaked (i.e., not cleaned up within xwm_data_source_write).
2021-01-25xwayland: use wlr_log_errno instead of %mTudor Brindus
Previously, any error would be masked by an internal isatty call: 24:31:48.174 [DEBUG] [wlr] [xwayland/selection/incoming.c:386] XCB_SELECTION_NOTIFY (selection=277, property=278, target=256) 24:31:48.174 [ERROR] [wlr] [xwayland/selection/incoming.c:30] write error to target fd: Inappropriate ioctl for device
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-24backend/drm: document wlr_drm_plane surface fieldsSimon Ser
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-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-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-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-20Expose ICCCM input statusBrassyPanache
In certain situations windows can have their input field set to false but still expect to receive input focus by passively listening to key presses via a parent window. The ICCCM specification outlines how focus should be given to clients. Further reading: https://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7 Relates to #2604
2021-01-19xdg-output: destroy outputs before managerIsaac Freund
Since output_destroy() calls wl_list_remove() on the output's link, the manager must still be valid. This is the same bug fixed in bf926e3 but with a different interface.
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-17Free xwayland cursor in wlr_xwayland_destroyChris Chamberlain
One of many memory leaks detected by an asan build
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-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.
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: introduce private wlr_renderer_autocreate_with_drm_fdSimon Ser
2021-01-16render/egl: fix gbm_device use-after-freeSimon Ser
The GBM device needs to be destroyed after the EGL display. ==50931==ERROR: AddressSanitizer: SEGV on unknown address 0x7fe40a000049 (pc 0x7fe446121d30 bp 0x60400001bbd0 sp 0x7ffc99c774d0 T0) ==50931==The signal is caused by a READ memory access. #0 0x7fe446121d30 (/usr/lib/dri/radeonsi_dri.so+0x5f0d30) #1 0x7fe4474717bd (/usr/lib/../lib/libEGL_mesa.so.0+0x177bd) #2 0x7fe4474677d9 (/usr/lib/../lib/libEGL_mesa.so.0+0xd7d9) #3 0x7fe44cca7b6f in wlr_egl_destroy ../subprojects/wlroots/render/egl.c:379 #4 0x7fe44ccc2626 in gles2_destroy ../subprojects/wlroots/render/gles2/renderer.c:705 #5 0x7fe44ccb5041 in wlr_renderer_destroy ../subprojects/wlroots/render/wlr_renderer.c:37 #6 0x7fe44cd17850 in backend_destroy ../subprojects/wlroots/backend/wayland/backend.c:296 #7 0x7fe44ccca4de in wlr_backend_destroy ../subprojects/wlroots/backend/backend.c:48 #8 0x7fe44cd11b21 in multi_backend_destroy ../subprojects/wlroots/backend/multi/backend.c:58 #9 0x7fe44cd125b0 in handle_display_destroy ../subprojects/wlroots/backend/multi/backend.c:125 #10 0x7fe44c315e0e (/usr/lib/libwayland-server.so.0+0x8e0e) #11 0x7fe44c3165a6 in wl_display_destroy (/usr/lib/libwayland-server.so.0+0x95a6) #12 0x55a2c8870683 in server_fini ../sway/server.c:203 #13 0x55a2c886cbf2 in main ../sway/main.c:436 #14 0x7fe44b77c151 in __libc_start_main (/usr/lib/libc.so.6+0x28151) #15 0x55a2c883172d in _start (/home/simon/src/sway/build/sway/sway+0x33472d)
2021-01-16output: send commit event after pending state is clearedSimon Ser
References: https://github.com/swaywm/wlroots/issues/2098
2021-01-16output-damage: stop relying on output pending state on commitSimon Ser
References: https://github.com/swaywm/wlroots/issues/2098
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-15render: extract gles2 build files to subdirSimon Ser
This will make it easier to toggle when we make our GLES2 renderer optional.