aboutsummaryrefslogtreecommitdiff
path: root/backend
AgeCommit message (Collapse)Author
2019-02-18backend/drm: fix NULL dereference when unsetting cursoremersion
This segfault happens on multi-GPU systems. Fixes https://github.com/swaywm/sway/issues/3717
2019-02-15Merge pull request #1537 from VincentVanlaer/cursor-dmabuf-nouveauDrew DeVault
Add workaround for hardware cursors on nouveau
2019-02-15Add workaround for hardware cursors on nouveauVincent Vanlaer
2019-02-15Revert "drm: do not modeset to current mode"Drew DeVault
This reverts commit 72c76b128e562c482868b42b1945ed49cbd44353.
2019-02-14Copy cursor surface to secondary gpu if necessaryVincent Vanlaer
2019-02-14drm: do not modeset to current modeBrian Ashworth
There is no point in modesetting an output to a mode that it is already set to. Modesetting will cause the output to briefly flicker which is undesirable for a noop. This returns early in `drm_connector_set_mode` when attempting to modeset to the current mode.
2019-02-04Merge pull request #1526 from VincentVanlaer/cursor-dmabufScott Anderson
Allow cursor render surface to be used as fb
2019-02-04Allow cursor render surface to be used as fbVincent Vanlaer
In order for a surface to be used as a cursor plane framebuffer, it appears that requiring the buffer to be linear is sufficient. GBM_BO_USE_SCANOUT is added in case GBM_BO_USE_LINEAR isn't sufficient on untested hardware. Fixes #1323 Removed wlr_drm_plane.cursor_bo as it does not serve any purpose anymore. Relevant analysis (taken from the PR description): While trying to implement a fix for #1323, I found that when exporting the rendered surface into a DMA-BUF and reimporting it with `GBM_BO_USE_CURSOR`, the resulting object does not appear to be valid. After some digging (turning on drm-kms debugging and switching to legacy mode), I managed to extract the following error: ``` [drm:__setplane_check.isra.1 [drm]] Invalid pixel format AR24 little-endian (0x34325241), modifier 0x100000000000001 ``` The format itself refers to ARGB8888 which is the same format as `renderer->gbm_format` used in master to create the cursor bo. However, using `gbm_bo_create` with `GBM_BO_USE_CURSOR` results in a modifier of 0. A modifier of zero represents a linear buffer while the modifier of the surface that is rendered to is `I915_FORMAT_MOD_X_TILED` (see https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/uapi/drm/drm_fourcc.h?h=v4.20.6#n263). In order to fix this mismatch in modifier, I added the `GBM_BO_USE_LINEAR` to the render surface and everything started to work just fine. I wondered however, whether the export and import is really necessary. I then decided to test if the back buffer of the render surface works as well, and at least on my hardware (Intel HD 530 and Intel UHD 620) it does. This is the patch in this PR and this requires no exporting and importing. I have to note that I cheated in order to import DMA_BUFs into a cursor bo when doing the first tests, since on import the Intel drivers check that the cursor is 64x64. This is strange since cursor sizes other than 64x64 have been around for quite some time now (https://lists.freedesktop.org/archives/mesa-commit/2014-June/050268.html). Removing this check made everything work fine. I later (while writing this PR) found out that `__DRI_IMAGE_USE_CURSOR` (to which `GBM_BO_USE_CURSOR` translates) has been deprecated in mesa (https://gitlab.freedesktop.org/mesa/mesa/blob/master/include/GL/internal/dri_interface.h#L1296), which makes me wonder what the usecase of `GBM_BO_USE_CURSOR` is. The reason we never encountered this is that when specifying `GBM_BO_USE_WRITE`, a dumb buffer is created trough DRM and the usage flag never reaches the Intel driver directly. The relevant code is in https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/gbm/backends/dri/gbm_dri.c#L1011-1089 . From this it seems that as long as the size, format and modifiers are right, any surface can be used as a cursor.
2019-02-03Allow compositors to run as systemd user unitsmnussbaum
When a wlroots compositor runs as a systemd user unit there is no session associated with the compositor process. Instead we need to attach to an active and graphical user session. This change first looks for an available session for the process, and if there isn't one falls back to display in the oldest available graphical session. This work was modeled after a similar change to mutter - https://gitlab.gnome.org/GNOME/mutter/merge_requests/150.
2019-01-31backend/session/logind: dup FD with CLOEXECemersion
2019-01-29Require libdrm >= 2.4.95emersion
2019-01-29Merge pull request #1509 from emersion/gbm-fmt-mismatchDrew DeVault
backend/drm: fix GBM format mismatch
2019-01-29backend/drm: fix GBM format mismatchemersion
We create the EGL config with GBM_FORMAT_ARGB8888, but then initialize GBM BOs with GBM_FORMAT_XRGB8888. This mismatch confuses Mesa. Instead, we can always use GBM_FORMAT_ARGB8888, and use DRM_FORMAT_XRGB8888 when calling drmModeAddFB2. Fixes https://github.com/swaywm/wlroots/issues/1438
2019-01-28Implement the pointer-gestures-unstable-v1 protocolGreg V
This protocol relays touchpad gesture events produced by libinput to supporting clients (e.g. Evince, Eye of GNOME).
2019-01-26backend/wayland: handle wl_pointer.axis_stopemersion
2019-01-26pointer: add a frame eventemersion
Frame events group logically connected pointer events. It makes sense to make the backend responsible for sending frame events, since once the events are split (ie. once the frame events are stripped) it's not easy to figure out which events belongs to which frame again. This is also how Weston handles frame events. Fixes https://github.com/swaywm/wlroots/issues/1468
2019-01-24backend/x11 & backend/wayland: make set_title NULL-safeJente Hidskes
Set the default "wlroots - " title when the title argument to the set_title functions is NULL. Otherwise, for at least the Wayland backend, we'd crash because xdg_toplevel_set_title doesn't handle a NULL pointer.
2019-01-22backend/wayland: fix resizingBrian Ashworth
Before resizing the egl window, the buffers must be swapped
2019-01-20Add wlr_x11_output_set_titleJente Hidskes
2019-01-19backend/drm: fix state for outputs loosing their CRTCemersion
When there aren't enough CRTCs for all outputs, we try to move a CRTC from a disabled output to an enabled one. When this happens, the old output's state wasn't changed, so the compositor thought it was still enabled and rendering. This commit marks the old output as WLR_DRM_CONN_NEEDS_MODESET and sets its current mode to NULL.
2019-01-17Introduce noop backendRyan Dwyer
The noop backend is similar to headless, but it doesn't contain a renderer. It can be used as a place to stash views for when there's no physical outputs connected.
2019-01-10Add wlr_wl_output_set_titleDrew DeVault
2019-01-10Update Wayland backend to xdg-shell stableDrew DeVault
2019-01-07Simplify evdev includes on FreeBSD by relying on up-to-date packageJan Beich
As evdev-proto is installed by CI some files have been missed: ../examples/pointer-constraints.c:2:10: fatal error: 'linux/input-event-codes.h' file not found #include <linux/input-event-codes.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~ ../examples/relative-pointer-unstable-v1.c:5:10: fatal error: 'linux/input-event-codes.h' file not found #include <linux/input-event-codes.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~
2019-01-04Merge pull request #1432 from ForTheReallys/relative-pointersemersion
Relative pointers
2018-12-23backend/drm: get physical size from libdrmemersion
Values from libdrm are likely more reliable than raw values from the EDID. We were already using values from libdrm, but they were overwritten by parse_edid. See drm.c: wlr_conn->output.phys_width = drm_conn->mmWidth; wlr_conn->output.phys_height = drm_conn->mmHeight;
2018-12-21Standardize the wlr_box input paramatersTimidger
Fixes #1094
2018-12-21Add unaccelerated pointer values to wlr_event_pointer_motion eventsAlex Maese
2018-12-16backend/drm: don't insert duplicate custom modes, fix refresh rateemersion
2018-12-15[WIP][DONTMERGE]Add support for libinput_switch input devicesRyan Walklin
These are used primarily by laptops to signal the state of the lid (open/closed) and tablet mode if supported, based on ACPI events.
2018-12-09backend/drm: Fix uninitialized variableScott Anderson
2018-12-09backend/drm: Improve encoder logicScott Anderson
This fixes an issue that can occur with DP MST connectors not reporting any encoders.
2018-12-09backend/drm: fix disappeared output indicesemersion
This commit changes `scan_drm_connectors` to add new outputs to the end of the list. That way, it's easier to understand what's going on with indices. When we need to destroy outputs, we now walk the list in reverse order. This ensures indices remain correct while iterating and removing items from the list. We now also make outputs without a CRTC disappear (those are in WLR_DRM_CONN_NEEDS_MODESET state).
2018-12-06Merge pull request #1413 from emersion/logind-session-logsDrew DeVault
backend/session/logind: improve logging
2018-12-06backend/session/logind: improve loggingemersion
2018-12-04backend/drm: fix VLA overflowemersion
2018-11-27backend/wayland: fix zero-length VLAemersion
2018-11-22Fix interlaced mode rejectionRostislav Pehlivanov
2018-11-21Skip interlaced modes during drm mode detectionRostislav Pehlivanov
Fixes #3167 A better solution could be made if there's a need to.
2018-11-13backend/x11: Hide cursor with XfixesScott Anderson
2018-11-13backend/x11: Remove old input functionsScott Anderson
This also allows us to remove xcb-xkb, since Xinput will now give us the appropriate XKB modifiers with each event.
2018-11-13backend/x11: Add new Xinput eventsScott Anderson
2018-11-13backend/x11: Check for xinput extensionScott Anderson
2018-11-13backend/x11: Move atom initilisation earlierScott Anderson
There isn't any real reason to delay this until the backend is started.
2018-11-13backend/x11: Make header order consistentScott Anderson
2018-11-13backend/x11: Rename xcb_conn to xcbScott Anderson
When the Xlib connection is removed, this _conn suffix is going to be pointless. I'm removing this preemtively for that.
2018-11-12Merge pull request #1372 from emersion/config10Drew DeVault
Use #if instead of #ifdef for wlroots config data
2018-11-12Use #if instead of #ifdef for wlroots config dataemersion
This prevents some annoying issues when e.g. not including wlr/config.h or making a typo in the guard name.
2018-11-11backend/wayland: handle WL_EVENT_WRITABLE for Wayland socketemersion
We need to flush when the connection is writable again. This is important in case the write buffer becomes full. This is also what Weston does [1]. [1]: https://gitlab.freedesktop.org/wayland/weston/blob/master/libweston/compositor-wayland.c#L2593
2018-11-11backend/wayland: Make header order consistentScott Anderson