aboutsummaryrefslogtreecommitdiff
path: root/backend/x11/output.c
AgeCommit message (Collapse)Author
2022-08-18Use wl_signal_emit_mutableAlexander Orzechowski
2022-05-30output: pass wlr_output_state to backendSimon Ser
Groundwork for the following commits. The goal is to allow users to specify their own wlr_output_state instead of wlr_output.pending.
2022-05-27backend/x11: fix output model strdup callSimon Ser
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3434#note_1401193 Fixes: be86145322e6 ("output: turn make/model/serial into char *")
2022-05-26output: turn make/model/serial into char *Simon Ser
This allows the make/model/serial to be NULL when unset, and allows them to be longer than the hardcoded array length. This is a breaking change: compositors need to handle the new NULL case, and we stop setting make/model to useless "headless" or "wayland" strings.
2022-03-17types/wlr_input_device: move output_name field to wlr_pointer and wlr_touchSimon Zeni
2022-03-07interface/wlr_touch: rework destroy sequenceSimon Zeni
The destroy callback in wlr_touch_impl has been removed. The function `wlr_touch_finish` has been introduced to clean up the resources owned by a wlr_touch. `wlr_input_device_destroy` no longer destroys the wlr_touch, attempting to destroy a wlr_touch will result in a no-op. The field `name` has been added to the wlr_touch_impl to be able to identify a given wlr_touch device.
2022-03-07interface/wlr_pointer: rework destroy sequenceSimon Zeni
The destroy callback in wlr_pointer_impl has been removed. The function `wlr_pointer_finish` has been introduced to clean up the resources owned by a wlr_pointer. `wlr_input_device_destroy` no longer destroys the wlr_pointer, attempting to destroy a wlr_pointer will result in a no-op. The field `name` has been added to the wlr_pointer_impl to be able to identify a given wlr_pointer device.
2022-02-21backend/x11: remove wlr_input_device_implSimon Zeni
2022-02-21types/wlr_touch: add base wlr_input_deviceSimon Zeni
wlr_touch now owns its wlr_input_device. It will be initialized when the tablet tool is initialized, and finished when the touch is destroyed.
2022-02-21types/wlr_pointer: add base wlr_input_deviceSimon Zeni
wlr_pointer owns its wlr_input_device. It will be initialized when the pointer is initialized, and finished when the pointer is destroyed.
2022-02-21types/wlr_input_device: default vendor and product id to 0Simon Zeni
vendor and product id are set when needed by the libinput backend
2021-12-09Fix incorrect %zd formatting directivesSimon Ser
%zd is for ssize_t. For size_t we should use %zu.
2021-12-09output: introduce wlr_output_set_nameSimon Ser
wlroots picks names for all outputs, but it might be desirable for compositor to override it. For instance, Sway will use a headless output as a fallback in case no outputs are connected. Sway wants to clearly label the fallback output as such and label "real" headless outputs starting from HEADLESS-1.
2021-11-18backend/x11: get renderer from wlr_x11_outputSimon Zeni
2021-11-17Remove support for DMA-BUF flagsSimon Ser
They are never used in practice, which makes all of our flag handling effectively dead code. Also, APIs such as KMS don't provide a good way to deal with the flags. Let's just fail the DMA-BUF import when clients provide flags.
2021-10-15output: add presented flag to presentation eventKirill Primak
2021-07-29output: drop wlr_output_state.buffer_typeSimon Ser
This is now unconditionally set to WLR_OUTPUT_STATE_BUFFER_SCANOUT.
2021-07-01buffer: make enum wlr_buffer_cap publicSimon Ser
Custom backends and renderers need to implement wlr_backend_impl.get_buffer_caps and wlr_renderer_impl.get_render_buffer_caps. They can't if enum wlr_buffer_cap isn't made public.
2021-06-20backend: add output state allow-listsSimon Ser
Right now, when a new output state field is added, all backends by default won't reject it. This means we need to add new checks to each and every backend when we introduce a new state field. Instead, introduce a bitmask of supported output state fields in each backend, and error out if the user has submitted an unknown field. Some fields don't need any backend involvment to work. These are listed in WLR_OUTPUT_STATE_BACKEND_OPTIONAL as a convenience.
2021-06-09backend/x11: use wlr_renderer_begin_with_buffer for cursorSimon Ser
2021-06-07backend/x11: remove swapchainSimon Ser
Rely on wlr_output's generic swapchain handling. We still need a renderer for cursor readback, sadly.
2021-06-07backend/x11: implement get_dmabuf_primary_formatsSimon Ser
2021-06-02output: take a wlr_buffer in set_cursorSimon Ser
Instead of passing a wlr_texture to the backend, directly pass a wlr_buffer. Use get_cursor_size and get_cursor_formats to create a wlr_buffer that can be used as a cursor. We don't want to pass a wlr_texture because we want to remove as many rendering bits from the backend as possible.
2021-05-21backend/x11: use common renderer and allocatorSimon Ser
Instead of managing our own renderer and allocator, let the common code do it.
2021-04-20backend/x11: add support for shm buffersTadeo Kondrak
2021-04-06backend/x11: reject DMA-BUFs with flagsSimon Ser
We cannot scan-out DMA-BUFs with any flag right now.
2021-03-11output: fix transform matrix for 90/270 rotationsSimon Ser
We need to adjust the second translation depending on the transform we applied. Fixes: 9601a2abf024 ("output: improve transform matrix calculation" Closes: https://github.com/swaywm/wlroots/issues/2774
2021-03-10output: improve transform matrix calculationSimon Zeni
Compute only the transform matrix in the output. The projection matrix will be calculated inside the gles2 renderer when we start rendering. The goal is to help the pixman rendering process.
2021-03-09backend/x11: clamp hotspot to texture boundsIlia Mirkin
When a new texture is set, the hotspot may actually belong to the previous texture and be out of bounds. Rather than incur X errors for these, clamp the hotspot to be inside of the texture. This fixes weston examples updating their cursors (e.g. weston-eventdemo).
2021-02-23render: use DRM formats in wlr_renderer_read_pixelsSimon Ser
2021-02-18backend: add error messages in attach_render implsSimon Ser
2021-02-05backend/x11: use native cursorsIlia Mirkin
Fixes #2659
2021-01-28backend/x11: remove output_set_refreshSimon Ser
The X11 backend uses the Present extension to schedule frames. The refresh rate is unused.
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: add support for scanout modeIlia Mirkin
This makes full-screen with weston-terminal work.
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-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/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-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-12render/egl: remove surface and buffer age args from make_currentSimon Ser
These aren't used anymore.
2021-01-07backend: remove wlr_egl from all backendsSimon Zeni
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-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-21backend/x11: destroy buffers when destroying outputSimon Ser
2020-12-21backend/x11: re-use pixmapsSimon Ser
Instead of re-importing a buffer each time we submit a frame, re-use the pixmaps if possible.
2020-12-18backend/x11: send more precise output present eventsSimon Ser
Instead of sending dummy output present events, use the X11 Present extension to send more precise events.
2020-12-13backend/x11: fix xinput mask mixed up with presentSimon Ser
Don't mix xinput and present flags. Fixes: d79a00bf0208 ("backend/x11: switch to wlr_swapchain")