aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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-01Merge pull request #1523 from emersion/set-same-selection-crashDrew DeVault
data-device: fix crash when setting the same selection twice
2019-02-01Merge pull request #1519 from emersion/dedup-source-mime-typeDrew DeVault
De-duplicate data source MIME types
2019-02-01Merge pull request #1522 from emersion/logind-no-dup-leakDrew DeVault
backend/session/logind: dup FD with CLOEXEC
2019-02-01Merge pull request #1518 from emersion/relative-pointer-usecDrew DeVault
relative-pointer-v1: time is in usec, not msec
2019-01-31data-device: fix crash when setting the same selection twiceemersion
2019-01-31backend/session/logind: dup FD with CLOEXECemersion
2019-01-30De-duplicate data source MIME typesemersion
2019-01-30relative-pointer-v1: time is in usec, not msecemersion
2019-01-30Merge pull request #1513 from emersion/fix-dndDrew DeVault
data-device: fix drag-and-drop
2019-01-30data-device: only allow one drag at a timeemersion
2019-01-30rootston: only allow one drag icon per seatemersion
2019-01-30seat: don't send motion if pointer hasn't movedemersion
2019-01-30data-device: fix use-after-free on dropemersion
2019-01-30Merge pull request #1515 from emersion/shell-grab-frameDrew DeVault
Add missing frame events to shell pointer grabs
2019-01-30Add missing frame events to shell pointer grabsemersion
2019-01-29meson: remove b_lundef=false on FreeBSDemersion
2019-01-29Merge pull request #1511 from emersion/scan-build-fixesDrew DeVault
Fix two issues found with Clang's static analyzer
2019-01-29Fix two issues found with Clang's static analyzeremersion
2019-01-29Merge pull request #1510 from emersion/libdrm-versionDrew DeVault
Require libdrm >= 2.4.95
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-27Merge pull request #1503 from emersion/pointer-frameDrew DeVault
pointer: add a frame event
2019-01-27Merge pull request #1505 from emersion/data-control-unsetDrew DeVault
data-control-v1: handle NULL sources in set_selection
2019-01-27tinywl/README: Fix misspelling.Yong Joseph Bakos
2019-01-26data-control-v1: handle NULL sources in set_selectionemersion
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-25Merge pull request #1498 from emersion/editorconfig-indent-sizeDrew DeVault
Set .editorconfig ident_size
2019-01-25Set .editorconfig ident_sizeemersion
2019-01-24Merge pull request #1427 from emersion/refactor-data-deviceDrew DeVault
Refactor data-device
2019-01-24Merge pull request #1494 from emersion/wayland-protocols-text-inputDrew DeVault
text-input-v3: use protocol from wayland-protocols
2019-01-24Merge pull request #1495 from Hjdskes/safe_set_titleDrew DeVault
backend/x11 & backend/wayland: make set_title NULL-safe
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-24data-device: keep track of wlr_data_offer in wlr_seat listsemersion
2019-01-24data-device: add wlr_data_offer.typeemersion
2019-01-24data-device: make device inert when seat is destroyedemersion
2019-01-24seat: simplify data source destroyemersion
2019-01-24data-device: fix missing listener removalemersion
2019-01-24data-control-v1: use new wlr_data_source APIemersion
2019-01-24data-device: unexport wlr_seat_client_send_selectionemersion
2019-01-24data-device: send offer on get_data_deviceemersion
2019-01-24data-device: remove data_source_send_offeremersion
2019-01-24data-device: make sources inert, rename cancel to destroyemersion
2019-01-24text-input-v3: use protocol from wayland-protocolsemersion
2019-01-24data-device, primary-selection: add request_set_selectionemersion
This makes compositors able to block and/or customize set_selection requests coming from clients. For instance, it's possible for a compositor to disable rich selection content (by removing all MIME types except text/plain). This commit implements the design proposed in [1]. Two new events are added to wlr_seat: request_set_selection and request_set_primary_selection. Compositors need to listen to these events and either destroy the source or effectively set the selection. Fixes https://github.com/swaywm/wlroots/issues/1138 [1]: https://github.com/swaywm/wlroots/issues/1367#issuecomment-442403454
2019-01-22wlr_xdg_output_v1: move where name & description are sentIan Fan
2019-01-22wlr_xdg_output_v1: only send name/description onceBrian Ashworth
The xdg-output protocol states that name and description should only be sent once per output since they do not change.