aboutsummaryrefslogtreecommitdiff
path: root/backend
AgeCommit message (Collapse)Author
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.
2021-01-04backend/wayland: re-use cursor wl_buffersSimon Ser
We were importing cursor buffers as wl_buffers over and over again. Instead, only import these once.
2021-01-03backend/drm: stash pending page-flip CRTCSimon Ser
wlr_drm_connector.crtc may be updated by the DRM backend while a page-flip is pending. In this case, the page-flip handler won't be able to find the right wlr_drm_connector from the CRTC ID. Save the CRTC when performing a page-flip to ensure we always find the right connector when we get the event.
2021-01-03backend/drm: ignore hotplug events while inactiveSimon Ser
When the session is inactive, we can't change the KMS state. Ignore hotplug events so that compositors don't try to perform a modeset when a connector is plugged in. We already re-scan connectors when the session becomes active. To test, run a wlroots compositor on VT 1, switch to VT 2, unplug a connector, re-plug it, switch back to VT 1. Without this patch the screen is black on VT 1. References: https://github.com/swaywm/wlroots/issues/2370
2020-12-31noop: listen to display destroy and destroy the backendIlia Bozhinov
2020-12-31backend/x11: print version on extension errorSimon Ser
2020-12-30backend/x11: always open render nodeSimon Ser
If we get an authenticated primary node from the X11 server, don't use it because we can't authenticate our Wayland clients with it. Instead, open a render node. Closes: https://github.com/swaywm/wlroots/issues/2576
2020-12-30Remove wlr_create_renderer_func_tSimon Ser
This callback allowed compositors to customize the EGL config used by the renderer. However with renderer v6 EGL configs aren't used anymore. Instead, buffers are allocated via GBM and GL FBOs are rendered to. So customizing the EGL config is a no-op.
2020-12-30backend/drm: remove special linear case for cursor planeSimon Ser
We now properly mark the cursor plane's formats as linear-only, and we now have a version of wlr_drm_format_intersect that handles the case of linear-only formats and implicit modifiers. We can remove the special drm_plane_init_surface flag we had for cursor planes. This also allows us to use a non-linear layout for cursor planes on drivers that support it. Tested on amdgpu GFX9.
2020-12-30backend/drm: extract linear format creation into functionSimon Ser
Simplifies error handling.
2020-12-30backend/drm: force LINEAR for cursor plane formatsSimon Ser
If the kernel driver doesn't support modifiers, it still expects cursor FBs to have a LINEAR layout. See [1] for expectations for framebuffers attached to the cursor plane. [1]: https://patchwork.freedesktop.org/patch/408512/
2020-12-28backend/x11: create per-window present event contextsSimon Ser
The Present protocol states: > An event context is associated with a specific window; using an existing > event context with a different window generates a Match error. Instead of a global event context, use a per-window event context to fix this error: [backend/x11/backend.c:608] X11 error: op Present (SelectInput), code Match (no extension), sequence 63, value 4194307 Closes: https://github.com/swaywm/wlroots/issues/2577
2020-12-28drm: add fallback drmModeAddFB for drivers which do not support drmModeAddFB2Ariadne Conill
This makes wlroots able to run on some big-endian machines like G4 and G5 systems with ATI Radeon 7500 AGP graphics.
2020-12-27backend/x11: implement a real rendering loopSimon Ser
Instead of using a timer, rely on X11 Present events and send a new frame event when the parent compositor displays a new frame on screen. The previous attempt at doing this [1] hit issues with EGLSurface, but we don't use that anymore. [1]: https://github.com/swaywm/wlroots/pull/1894
2020-12-25backend/drm: make listener names more idiomaticSimon Ser
Use the "<object>_<event>" notation for listeners, use "handle_<listener>" for handlers.
2020-12-25Stop using wlr_texture_get_sizeSimon Ser
Just use wlr_texture.{width,height} directly.
2020-12-24backend/drm: use connector log helpers in atomic backendSimon Ser
2020-12-24backend/drm: make drmModePlane arg in add_plane constSimon Ser
Make it clearer it'll be free'd after add_plane returns.
2020-12-24backend/drm: add special case for cursor in add_planeSimon Ser
The code calling add_plane now makes sure not to add a cursor plane to a CRTC which already has one.
2020-12-24backend/drm: log whether ADDFB2 modifiers are supportedSimon Ser
2020-12-23backend/drm: don't retry page-flip when modifiers are unsupportedSimon Ser
Parse WLR_DRM_NO_MODIFIERS at startup. Don't parse IN_FORMATS when WLR_DRM_NO_MODIFIERS is set, so that the legacy behaviour is better reproduced. When modifiers aren't supported, try the initial page-flip once only.
2020-12-23backend/drm: use plural form for possible_crtcsSimon Ser
Make it clearer that this is a bitmask of CRTC indices.
2020-12-22backend/drm: assert connector state after wlr_output_destroySimon Ser
2020-12-22backend/drm: destroy DRM connectors that disappearSimon Ser
This was lost during the refactoring. We were previously calling wlr_output_destroy, which destroyed the connector as well. Fixes: 248c7787c7b4 ("backend/drm: refactor wlr_output destruction")