aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-08-10backend/drm: add proper error handling to wlr_drm_backend_createSimon Ser
Some listeners weren't removed and caused a use-after-free with e.g. vkms when used as a secondary GPU.
2021-08-08ci: add smoke testSimon Ser
Add a very basic smoke test which uses VKMS to fire up the DRM backend.
2021-08-07input/pointer: try harder to not send duplicate motion eventsTudor Brindus
wl_fixed_t is a 32-bit data type, but our doubles are 64-bit. This meant that two doubles that would map to the same wl_fixed_t could compare unequal, and send a duplicate motion event. Refs swaywm/sway#4632.
2021-08-06seat: allow compositors to not load a keymapSimon Ser
The protocol allows compositors to not send any keymap to Wayland clients. Handle a keymap-less keyboard correctly by sending WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP instead of erroring out in the mmap call.
2021-08-06build: remove "." from include dirsSimon Ser
2021-08-06examples/fullscreen-shell: remove unused render_data.view fieldSimon Ser
2021-08-04backend/drm: require buffer on modeset in drm_connector_testSimon Ser
When testing a modeset, make sure the caller has also provided a buffer. This allows df0e75ba05e2 ("output: try skipping buffer allocation if the backend allows it") to work as expected with the DRM backend. Closes: https://github.com/swaywm/wlroots/issues/3086
2021-08-04output: try skipping buffer allocation if the backend allows itSimon Ser
When enabling an output, skip the empty buffer allocation if the backend accepts modesets without a buffer. This fixes mode-setting with the noop backend.
2021-08-03render/pixman/pixel_format: add more formatsSimon Ser
Add a bunch of new formats for Pixman: a few missing 32-bit ones, some 16-bit and 32-bit formats as well. Mostly based on a Weston patch [1]. [1]: https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/664
2021-08-03render/pixel_format: add more formats for PixmanSimon Ser
These will be added to Pixman in the next commit.
2021-08-02backend/drm: preserve mode order from kernelSimon Ser
The kernel orders the mode list from highest to lowest. Preserve this ordering in the wlr_output.modes list.
2021-08-02surface: don't cache frame callback listsKirill Primak
2021-08-02viewporter: remove crop and scale state upon destructionQuantum
According to the viewport protocol, upon wp_viewport::destroy(): > The associated wl_surface's crop and scale state is removed. > The change is applied on the next wl_surface.commit. Therefore, wp_viewport_destroy(viewport) should remove all viewport state. Currently, wlroots does not remove the crop and scale state. Instead, a client must do: wl_fixed_t clear = wl_fixed_from_int(-1); wp_viewport_set_source(viewport, clear, clear, clear, clear); wp_viewport_set_destination(viewport, -1, -1); wp_viewport_destroy(viewport); This commit adds the necessary logic into viewport_destroy and makes wlroots comply with the protocol.
2021-07-30render/gles2: add a few 10-bit and FP16 formatsManuel Stoeckl
The half-float formats depend on GL_OES_texture_half_float_linear, not just the GL_OES_texture_half_float extension, because the latter does not include support for linear magni/minification filters. The new 2101010 and 16161616F formats are only available on little- endian builds, since their gl_types are larger than a byte and thus endianness dependent.
2021-07-30render/gles2: hide shm formats without GL supportManuel Stoeckl
This change introduces a new function to check whether the renderer has the needed GL extensions to read a given pixel format.
2021-07-30render/pixel-format: add a few 10-bit and FP16 formatsManuel Stoeckl
2021-07-29render/gles2: add support for some 24 and 16-bit formatsSimon Ser
On little-endian, we can enable pixel formats which don't use gl_type = GL_UNSIGNED_BYTE. See [1]. [1]: https://afrantzis.com/pixel-format-guide/
2021-07-29render/pixel-format: add some 24 and 16-bit formatsSimon Ser
2021-07-29output: drop wlr_output_state.buffer_typeSimon Ser
This is now unconditionally set to WLR_OUTPUT_STATE_BUFFER_SCANOUT.
2021-07-29output-damage: stop using enum wlr_output_state_buffer_typeSimon Ser
This enum will get dropped in the next commit.
2021-07-29output: drop wlr_output_impl.{attach,rollback}_renderSimon Ser
No backend uses these anymore.
2021-07-29backend/noop: drop attach_render/rollback_renderSimon Ser
We no longer require wlr_output_impl.{attach,rollback}_render to be populated.
2021-07-28backend/drm: fix wrong type for get_cursor_format return valuesSimon Ser
These are bools but should be pointers.
2021-07-28backend/drm: stop initializing renderer for parent backendSimon Ser
Unless we're dealing with a multi-GPU setup and the backend being initialized is secondary, we don't need a renderer nor an allocator. Stop initializing these.
2021-07-28backend/drm: drop get_renderer implementationSimon Ser
We can now just rely on the common code for this.
2021-07-28backend/drm: drop drm_surface_{make,unset}_currentSimon Ser
2021-07-28backend/drm: remove SCANOUT check in drm_connector_testSimon Ser
We only accept SCANOUT, the buffer type should never be set to RENDER.
2021-07-28backend/drm: remove primary swapchainSimon Ser
We can't nuke it completely, we still need it for multi-GPU.
2021-07-28backend/drm: allow legacy scan-out if FB props matchSimon Ser
Historically we haven't allowed direct scan-out for legacy KMS, because legacy misses the functionality to make sure a buffer can be scanned out. However with renderer v6 the backend can't figure out anymore whether the buffer comes from its internal swap-chain, because the backend doesn't have an internal swap-chain. The legacy KMS API guarantees that the driver won't reject a buffer as long as it's been allocated with the same parameters as the previous one. Let's check this in legacy_crtc_test.
2021-07-28output: fallback to modifier-less allocation on modeset test failureSimon Ser
Sometimes we allocate a buffer with modifiers but then fail to perform a modeset with it. This can happen on Intel because of bandwidth limitations. To mitigate this issue, it's possible to re-allocate the buffer with modifiers. Add the logic to do so in wlr_output.
2021-07-28output: allocate and attach empty buffer on modesetSimon Ser
Some backends need a buffer in order to be able to perform a modeset.
2021-07-28output: use pending resolution when allocating swapchainSimon Ser
This allows the swapchain to be created with the correct resolution during a mode change.
2021-07-28backend/drm: implement get_primary_formatsSimon Ser
2021-07-28output: fallback to XRGB in output_pick_formatSimon Ser
This will be necessary for the primary buffer.
2021-07-28util/time: make NSEC_PER_SEC staticDylan Araps
This fixes static linking with libseat. Closes #3072
2021-07-27render/egl: initialize wlr_egl with EGL_PLATFORM_DEVICE_EXTSimon Zeni
Uses the EXT_device_query extension to get the EGL device matching the requested DRM file descriptor. If the extension is not supported or no device is found, the EGL device will be retrieved using GBM. Depends on the EGL_EXT_device_enumeration to get the list of EGL devices.
2021-07-27render/egl: fix typoyuiiio
2021-07-27xwayland: embed wlr_xwayland_server_options in server structSimon Ser
As more options are added, more fields will be duplicated. Let's just embed the struct in wlr_xwayland_server so that we don't need to keep both in sync.
2021-07-27xwayland: simplify argv filling logicSimon Ser
Remove fill_arg and replace it with stack-allocations and simple array-filling.
2021-07-26render/egl: add support for EGL_EXT_device_drm_render_nodeSimon Ser
This EGL extension has been added in [1]. The upsides are: - We directly get a render node, instead of having to convert the primary node name to a render node name. - If EGL_DRM_RENDER_NODE_FILE_EXT returns NULL, that means there is no render node being used by the driver. [1]: https://github.com/KhronosGroup/EGL-Registry/pull/127
2021-07-23render/egl: set EGL_IMAGE_PRESERVED_KHRSimon Ser
Without setting this the EGL implementation is allowed to perform destructive actions on the buffer when imported: its contents become undefined. This is mostly a pedantic change, because Mesa processes the attrib and does absolutely nothing with it.
2021-07-22render/wlr_texture: put wlr_texture_from_buffer into the public APISimon Zeni
2021-07-22types/wlr_buffer: create custom wlr_buffer from wl_resourceSimon Zeni
2021-07-22types/wlr_buffer: introduce wlr_buffer_resource_interfaceSimon Zeni
Adds `wlr_buffer_resource_interface` and `wlr_buffer_register_resource_interface`, which allows a user to register a way to create a wlr_buffer from a specific wl_resource.
2021-07-22types/wlr_buffer: remove wlr_renderer argument from wlr_buffer_from_resourceSimon Zeni
2021-07-22render: drop wlr_renderer_impl.init_wl_displaySimon Ser
Now that we have our own wl_drm implementation, there's no reason to provide custom renderer hooks to init a wl_display in the interface. We can just initialize the wl_display generically, depending on the renderer capabilities.
2021-07-22backend: make DRM and libinput backends optionalayaka
Co-authored-by: Simon Ser <contact@emersion.fr>
2021-07-21backend/drm: add DRM_MODE_CONNECTOR_USB to conn_get_nameSimon Ser
See 757e26712337 ("drm/uapi: Add USB connector type") in the kernel tree.
2021-07-20backend/drm: stop restoring CRTCs on exitSimon Ser
This is the cause of the spurious "drmHandleEvent failed" messages at exit. restore_drm_outputs calls handle_drm_event in a loop without checking whether the FD is readable, so drmHandleEvent ends up with a short read (0 bytes) and returns an error. The loop's goal is to wait for all queued page-flip events to complete, to allow drmModeSetCrtc calls to succeed without EBUSY. The drmModeSetCrtc calls are supposed to restore whatever KMS state we were started with. But it's not clear from my PoV that restoring the KMS state on exit is desirable. KMS clients are supposed to save and restore the (full) KMS state on VT switch, but not on exit. Leaving our KMS state on exit avoids unnecessary modesets and allows flicker-free transitions between clients. See [1] for more details, and note that with Pekka we've concluded that a new flag to reset some KMS props to their default value on compositor start-up is the best way forward. As a side note, Weston doesn't restore the CRTC by does disable the cursor plane on exit (see drm_output_deinit_planes, I still think disabling the cursor plane shouldn't be necessary on exit). Additionally, restore_drm_outputs only a subset of the KMS state. Gamma and other atomic properties aren't accounted for. If the previous KMS client had some outputs disabled, restore_drm_outputs would restore a garbage mode. [1]: https://blog.ffwll.ch/2016/01/vt-switching-with-atomic-modeset.html
2021-07-19buffer: re-use wlr_shm_client_bufferSimon Ser
The first time wlr_buffer_from_resource is called with a wl_buffer resource that originates from wl_shm, create a new wlr_shm_client_buffer as usual. If wlr_buffer_from_resource is called multiple times, re-use the existing wlr_shm_client_buffer. This commit changes how the wlr_shm_client_buffer lifetime is managed: previously it was destroyed as soon as the wlr_buffer was released. With this commit it's destroyed when the wl_buffer resource is. Apart from de-duplicating wlr_shm_client_buffer creations, this allows to easily track when a wlr_shm_client_buffer is re-used. This is useful for the renderer and the backends, e.g. the Pixman renderer can keep using the same Pixman image if the buffer is re-used. In the future, this will also allow to re-use resources in the Wayland and X11 backends (remote wl_buffer objects for Wayland, pixmaps for X11).