Commit Graph

893 Commits

Author SHA1 Message Date
Victor Brekenfeld bafc378181 wayland/dmabuf: Allow global creation with a client filter 2021-09-30 18:37:54 +02:00
Victor Berger 3842b78979 wayland.compositor: fix leak of surface data
The subsurface logic holds a self-reference to the WlSurface to
track stacking orders of the children relative to the parent. This
self-reference needs be dropped during cleanup to avoid reference
cycles.

This was not the case, and caused every surface user data to be
leaked as it kept a reference to itself (and all of its children).
2021-09-28 16:30:46 +02:00
Victor Brekenfeld 55eb73cb9e wayland/seat: add return value to `KeyboardHandle::input` 2021-09-19 17:10:08 +02:00
Victor Brekenfeld 90dd28c910 wayland/seat: Add `KeysymHandle` to allow for keycode conversions.
Currently keycodes are always converted using xkbcommons
`State::key_get_one_sym` function. This may be not what the compositor
wants, e.g. if it represents keybindings with explicit modifiers.
Applying Shift in this case changes the sym, making it necessary for
the compositor to *undo* this transformation, which is hard or even
impossible and very unnecessary, when we have all the necessary
information in smithay.

Therefor this commit replaces the `Keysym` argument of the filter
closure with a `KeysymHandle`, which allows for different variants of
keysyms to be received. Modified (as previously), unmodified or even
as a raw keycode.
2021-09-17 17:12:26 +02:00
Victor Berger d0ee7d831e
Merge pull request #367 from PolyMeilex/fix-2
backend.libseat: Fix dispatch double borrow
2021-08-31 10:34:24 +02:00
i509VCB b07f1af494
Implement Coordinate for all numerical types (#372)
This allows Size, Point and Rectangle to be made with any numeric type
2021-08-30 22:02:00 +02:00
Poly 10cab4eab9 backend.libseat: Fix dispatch double borrow 2021-08-26 01:00:31 +02:00
Christian Meissl 6d3d5f7933 implement popup protocol checks 2021-08-04 23:12:22 +02:00
Christian Meissl 477f737b95 filter tiled toplevel states if not supported 2021-08-04 23:12:16 +02:00
Christian Meissl b36cfbb392 add v3 positioner fields and handle requests
add support for xdg_popup reposition
increment supported wm_base version to 3
2021-08-03 15:57:22 +02:00
Poly ea59b2f522
wayland.xdg-activation: fix `retain_requests` typo
Co-authored-by: Victor Berger <vberger@users.noreply.github.com>
2021-07-31 22:38:42 +02:00
Poly f24332f4b4 wayland.xdg-activation: Initial implementaion 2021-07-31 21:16:39 +02:00
Poly 1c6db1e7ee wayland.shell.layer: change role static to constant 2021-07-31 13:45:57 +02:00
Poly 84d3d6e609 wayland.shell: implement wlr_layer_shell 2021-07-31 13:44:04 +02:00
i509VCB 23a8af399d xdg-foreign
This is very much incomplete, but it implements the import and export of surfaces. However functions related to setting and imported surface the parent of another surface is not done.

importer destructor destroys all imports made from the same client 


Implement SetParentOf, no undoing yet


Add inner import type


Destroy child surface relationships when importing


A note


move init function upwards


use 0.29.0 crate


Move role string constants into the public


Use toplevel_like for surface checks in foreign


add methods to get the parent surface


Make sure ZXDG roles are public api


Consistent ordering of parameters on xdg_foreign impl methods


Let's update the changelog


Document how to use xdg_foreign


wl_shell_surface is likely invalid, so it cannot be imported or exported


Changelog suggestions


remove redundant inner ref cell


Remove all uses of the refcell like behavior


Allow compositor to export surfaces on server



Appease new clippy lints


then


Use string references and iterate in reverse to simplify removals


heed request for order
2021-07-31 11:40:24 +02:00
Poly df9be985ca Fix Clippy 2021-07-30 18:10:48 +02:00
Poly e3522dfb34
backend.egl: Early return on dead buffers (#352) 2021-07-28 23:31:43 +02:00
Poly c136cd5f34 wayland.data_device: Early return on protocol error 2021-07-27 09:32:34 +02:00
Poly 6856ae891f wayland.data_device: Add None as a valid DND action 2021-07-27 09:32:34 +02:00
Victor Berger 07deba4c1b Documentation fixes in preparation for release 2021-07-25 11:19:09 +02:00
i509VCB 7e4eff529e Put smithay's docs through a spell checker.
I noticed quite a few spelling errors, so I fixed a whole bunch of them.
2021-07-25 09:09:56 +02:00
Victor Berger 5524f1f6bd Deny warnings in CI 2021-07-25 09:09:12 +02:00
Victor Berger 782b21f363 Update dependencies 2021-07-25 09:09:12 +02:00
Victor Brekenfeld 3cc89dcf6e gles2: expose texture id 2021-07-25 08:30:01 +02:00
Victor Brekenfeld 3e4d93dfff egl: Fix segfault in egl logging for empty command strings 2021-07-25 08:29:41 +02:00
Poly 7e4e78151a Implement XdgOutput protocol 2021-07-24 18:51:27 +02:00
Victor Brekenfeld 6933494b6a docs: some backend clarifications 2021-07-16 00:34:00 +02:00
Victor Brekenfeld 945d7128d8 Backend documentation fixes and additions 2021-07-15 20:53:05 +02:00
Victor Brekenfeld 1cf1d4739b buffer: use Size instead of width/height 2021-07-13 23:37:28 +02:00
Victor Brekenfeld 00fb4561b7 gles2: Enable scissor test for optimization.
Skips unnecessary drawcalls outside of the viewable area.
This may happen with textures rendered over the edges of our screen.
2021-07-13 23:28:11 +02:00
Victor Brekenfeld 8bd17d71d2 renderer: Support cropping and scaling 2021-07-13 23:28:07 +02:00
Victor Brekenfeld 56f5557f8c anvil: Move import_bitmap into anvil 2021-07-13 23:21:08 +02:00
Victor Brekenfeld a938c2874f gles2: Allow usage of raw-gl calls out-of-tree 2021-07-13 23:21:08 +02:00
Christian Meissl d09de13bfc use size for transformed functions 2021-07-13 22:38:32 +02:00
Christian Meissl 72e4d910fe implement fractional HiDPI scaling
expose output from output map and return a reference
in find

change scale with keyboard shortcut

scale input coordinates and render location
according to output_scale

scale buffers during rendering

adapt window locations on output scale
change to that the location will appear
to be stable

scale udev pointer location on output scale
change to make the pointer location appear stable

Use a UserDataMap to store the udev output id

Short names for udev outputs for easier output
scale configuration
2021-07-13 22:38:32 +02:00
Victor Berger e60374a459 Fix unused imports 2021-07-13 14:23:21 +02:00
Victor Berger 0bad0a4a62 move input.rs to input/mod.rs, same for libinput.rs 2021-07-13 14:23:21 +02:00
Victor Berger 54ea0d3a74 Introduce Logical/Physical Point/Rectangle 2021-07-13 13:58:06 +02:00
Victor Brekenfeld 510c0a5400 egl: Add debug logging
Add debug logging to egl via the `EGL_KHR_debug` extension similar to our
support for `GL_KHR_debug`. Sadly unlike the GL-extensions the EGL-extension
does not let us provide any user-data for the callback, so we fall back to
using `slog-stdlog`, when available.

Since we only want to initialize this once, when libEGL gets loaded and
not per display, but we need to query the list of supported extensions
first, some initialization steps where moved around.
2021-07-10 20:07:12 +02:00
Victor Brekenfeld 3e2f2afa28 egl: Let the native surface handle attributes
The required surface attributes for egl surface creation might be very
dependent on the used egl platform. Therefor let the native surface type
handle the attributes instead of deriving them from a set of properties.
2021-07-10 20:05:08 +02:00
Victor Brekenfeld d97a9f9970 egl: Fix egl display handle visibility
Currently there is no way to get the raw handle of an `EGLDisplay`, but
this can be necessary for implementing additional egl platforms out-of-tree.
2021-07-10 19:48:00 +02:00
Poly 07743faad2 Apply suggestions from code review & Rebase 2021-07-05 23:57:28 +02:00
Poly 90a62aeae7 wayland.tablet: Add tablet manager protocol 2021-07-05 22:36:32 +02:00
Poly 1c9e3fe903 input: Add tablet events 2021-07-05 22:36:32 +02:00
Victor Berger 1cdb55aee6 backend.session: review docs 2021-07-05 22:34:54 +02:00
Victor Berger e17bbe590a backend.winit: review docs 2021-07-05 22:34:54 +02:00
Victor Berger 1c59625a06 backend.udev: review docs 2021-07-05 22:34:54 +02:00
Victor Berger 468a3bb8dc doc: expand root documentation 2021-07-05 22:34:54 +02:00
Victor Berger 89079d6dd3 Fix unused import warning 2021-07-05 22:34:54 +02:00
Victor Berger d5b033f5b5 move signaling to utils::signaling 2021-07-05 22:34:54 +02:00
Victor Berger 0ac045eb17 wayland.data_device: review docs & API 2021-07-05 22:34:54 +02:00
Victor Berger 6454ebecf0 wayland.dmabuf: review docs & API 2021-07-05 22:34:54 +02:00
Victor Berger 694666b31f wayland.seat: review docs & API 2021-07-05 22:34:54 +02:00
Victor Berger e96272cae5 wayland.shell.xdg: review docs & API 2021-07-05 22:34:54 +02:00
Victor Berger ba6bef3e85 wayland.shell.legacy: review docs & API 2021-07-05 22:34:54 +02:00
Victor Berger 4214cb9fc5 wayland.shm: review docs 2021-07-05 22:34:54 +02:00
Victor Berger 7b3585ad36 xwayland: review documentation 2021-07-05 22:34:54 +02:00
Victor Berger 811df39214 Add all missing Debug implementations
Fixes #258
2021-07-05 21:40:50 +02:00
Victor Berger b1b025992f Update calloop to 0.9 2021-07-05 21:40:50 +02:00
i509VCB fb11dcb251
Winit: Share the resized size instead of using egl display field (#328) 2021-07-04 23:39:01 +02:00
Victor Berger f27658b759
Merge pull request #306 from cmeissl/feature/surface-enter-leave 2021-07-03 17:01:13 +02:00
Christian Meissl 6b2273235a fix popup geometry calculation and relative
placement to parent geometry
2021-07-01 23:52:40 +02:00
Poly c2457db8d1 Fix libseat build 2021-07-01 23:51:50 +02:00
Christian Meissl df208fa6c8 clamp cursor with current output height
move fullscreen output geometry calculation to
a helper function

rename with_outputs to with_client_outputs and
take client instead of generic resource
2021-06-30 23:56:01 +02:00
Christian Meissl 0d88a392fa add an output_map which handles...
the positioning of outputs, tracks
the surfaces on the outputs and
sends enter/leave for the surfaces

Additionally the output_map will
handle re-location of windows if
a output mode is changed, an output is
added or removed.

The shell has been updated to use the
primary output for the initial placement.
The fullscreen/maximize requests will now
handle the shell part correctly. For real
fullscreen output the rendering has to be
changed.

The output name is considered unique
and an output can be retrieved from
the map by location, output or name.
This can be used as the base for HiDPI
handling.
2021-06-30 18:24:51 +02:00
Victor Brekenfeld 616bacdff2
Merge pull request #318 from Smithay/refactor/input_backend
Rework `InputBackend` abstractions to track individual devices
2021-06-30 00:14:20 +02:00
Victor Brekenfeld 50741bc7bb Rework `InputBackend` abstractions to track individual devices
Removes the notion of Seats from `InputBackend` and replaces it with
`DeviceAdded` and `DeviceRemoved` events allowing compositors to
descriminate between single devices.

A new abstraction to model multiple seats on a single input backend
may be be added separately at a later time.
2021-06-30 00:06:59 +02:00
Victor Berger 3a0c631edd Rudimentary xdg_popup support 2021-06-29 23:59:55 +02:00
Victor Berger 47bc37c67b Disable pointer grab with dead starting surface 2021-06-29 23:27:23 +02:00
Christian Meissl 736eb11cd5 use platform specifc types for XlibWindow and gbm
this fixes compilation on 32bit targets like armv7
2021-06-29 18:46:00 +02:00
Victor Berger da5c814555 Clippy fixes 2021-06-29 18:03:44 +02:00
Victor Berger 053bc98faa Fix all CI warnings 2021-06-29 18:03:44 +02:00
Christian Meissl 453f33d5a4 add a environment variable to the direct session...
...that is used as a fallback if no explicit
tty is requested
2021-06-29 15:13:03 +02:00
Christian Meissl 3392c0c675 log the XWayland display 2021-06-29 15:12:24 +02:00
Christian Meissl 29c0620a58 test if xwayland is already shutting down on client_destroy 2021-06-29 15:12:24 +02:00
Victor Brekenfeld eb5e4bcf92 Fix wl_drm on winit backend 2021-06-27 22:19:12 +02:00
Victor Berger ad55ab71c9 compositor: Introduce transaction state tracking
This changes the state handling logic of wl_surface to automatically
track subsurface pending in the form of transactions. The role enum
(and the associated type parameter) is no more, and replaced by a
general-purpose typemap-like container on surfaces.

The new logic is introduced in the files:

- `src/wayland/compositor/cache.rs`
- `src/wayland/compositor/transaction.rs`

The rest of the PR is the fallout of these changes, as well as a few
trivial clippy fixes.
2021-06-26 21:52:38 +02:00
Victor Brekenfeld d17cd5326d Remove EGLBufferReader from buffer_type and buffer_dimensions api 2021-06-24 22:17:08 +02:00
Victor Brekenfeld c578a9e16c Move EGLBufferReader management into ImportEgl 2021-06-24 22:12:08 +02:00
Victor Brekenfeld 268ad95767 gles2: Fixup cleanup of unused dmabuf-bindings 2021-06-23 18:36:06 +02:00
Victor Brekenfeld ce3b2d1eab Rework `DrmRenderSurface` into `GbmBufferedSurface`.
Removes the renderer from the `DrmRenderSurface` allowing anvil
to use just one renderer per backend.

Since the old `DrmRenderSurface` was dependant on gbm anyway to import
buffers, the new `GbmBufferedSurface` does now only supports gbm as an allocator,
which hugely simplifies the code and also skips some unnecessary imports/exports.
2021-06-23 18:36:06 +02:00
Christian Meissl 6bd0d71ebc do not remove the surface focus during ungrap
fixes #163
2021-06-22 13:15:30 +02:00
Christian Meissl c4f2d34647 fix clippy unknown lint 2021-06-20 12:08:04 +02:00
Poly f9f77288c8
libseat support (#292) 2021-06-15 23:35:16 +02:00
cmeissl e9aef7caad
rework xdg_shell (#286)
* rework xdg_shell
use distinct surface roles for xdg_toplevel and
xdg_popup using a xdg_role! macro

* fix clippy warnings in shell

* added a generic DeadResource error and...
...added a result to xdg with_pending_state
Renamed the ToplevelState to ToplevelStateSet
2021-06-15 23:32:02 +02:00
Victor Berger 41c7b22cc4 doc: fix ci upload & broken links 2021-06-11 17:46:32 +02:00
Victor Berger 9ad0edd2a3 Fix several clippy lints 2021-06-10 22:01:10 +02:00
Victor Berger c630bd9086 cargo fmt 2021-06-10 22:01:10 +02:00
Victor Berger 671e2053e9 xwayland: rework as an EventSource
Reorganize the XWayland abstraction into a calloop EventLoop.

Fixes #245
Fixes #203
2021-06-10 21:52:08 +02:00
Stefan Schick b17b40c2bb
Use Default derive for ModifiersState and remove new() (#285) 2021-06-08 21:58:21 +02:00
Victor Berger ad444ead75 wayland.dmabuf: fix doctest 2021-06-08 21:57:35 +02:00
Victor Brekenfeld a38592bc92 dmabuf: Unify types of `wayland::dmabuf` and `allocator::dmabuf` 2021-06-08 21:57:35 +02:00
Victor Brekenfeld b6822becf6 egl: expose supported dmabuf formats 2021-06-08 21:57:35 +02:00
Victor Brekenfeld 969cdda85c renderer: Split Renderer trait into Import sub-traits 2021-06-08 21:47:05 +02:00
Victor Brekenfeld 2661b86019 renderer: Add a way to query the buffer *type* 2021-06-08 21:47:05 +02:00
Victor Berger 3f01f978f8 wayland.compositor: DispatchData available in the callback 2021-06-03 11:45:22 +02:00
Victor Berger aaa6e625e9 Update to calloop 0.8, DrmDevice as an EventSource 2021-06-03 11:45:22 +02:00
Victor Brekenfeld e008360bde allocator: Let the allocator select the best modifier out of a given set.
This change fixes modifier selection by delegating this to the allocators
and thus to libgbm, which can ask the driver for an appropriate modifier
for scanout, that results in the best possible performance.

We do not have this information, the order in which modifiers are returned
by EGL has no meaning and this is far better then testing modifiers
non-deterministically at random and choosing the first one, that does
not error out...
2021-06-03 11:19:22 +02:00
Christian Meissl 4f0161658f make the frame_callback a list 2021-05-30 15:40:35 +02:00
Victor Brekenfeld 87d33fc42e renderer: Document `Frame` Associated Type and Trait 2021-05-29 17:57:34 +02:00
Victor Brekenfeld 7aa0c43396 drm/atomic: workaround possible amdgpu bug 2021-05-29 17:53:08 +02:00
Victor Brekenfeld 3e984d5cf3 Remove unused imports 2021-05-27 17:35:28 +02:00
Victor Brekenfeld 25c61c7a73 Fixup import_buffer definition to account for subsurface damage 2021-05-27 17:35:28 +02:00
Victor Brekenfeld 12e80ca2c6 cargo fmt 2021-05-26 19:12:45 +02:00
Victor Brekenfeld 890a17189b
Merge pull request #279 from cmeissl/renderer/v4-fix-egl-y-invert
handle egl query with EGL_WAYLAND_Y_INVERTED_WL returning EGL_FALSE
2021-05-26 19:10:50 +02:00
Christian Meissl 730dbc896a handle egl query with EGL_WAYLAND_Y_INVERTED_WL...
...returning EGL_FALSE
2021-05-25 12:28:35 +02:00
Victor Brekenfeld 67a9478293 renderer: Properly cache shm-resource surface-global 2021-05-25 00:40:55 +02:00
Victor Berger 6bfe6e1f25 Fix damage handling to support multiple rectangles 2021-05-24 23:50:14 +02:00
Victor Brekenfeld 978ef1b393 renderer: Closure-based api 2021-05-24 23:46:03 +02:00
Victor Brekenfeld 73420b75bc renderer: Implementation comments 2021-05-24 19:28:21 +02:00
Victor Brekenfeld e696ce4c35 fix intra-doc links 2021-05-24 19:15:46 +02:00
Christian Meissl 0493215c8e disable texture cache for egl imports and...
...fix format in gles2 renderer
2021-05-23 17:54:12 +02:00
Victor Brekenfeld 2843c5c374 Address some review comments 2021-05-23 15:13:04 +02:00
Christian Meissl 26527a131f wait for the GL commands to finish...
...before submitting the buffer to the backend
2021-05-21 13:30:15 +02:00
Victor Brekenfeld a4f66da69f drm: Properly expose planes for surfaces 2021-05-20 01:06:16 +02:00
Victor Brekenfeld fd2703a57d fixup not working feature annotation 2021-05-19 16:40:08 +02:00
Victor Brekenfeld c88b14f725 fix compiling with limited feature sets 2021-05-18 21:17:33 +02:00
Victor Brekenfeld bbf0643272 renderer: import_buffer (sadly) depends on backend_egl 2021-05-18 21:02:27 +02:00
Victor Brekenfeld 918241eb31 gles2: Avoid reference cycle in buffer user_data 2021-05-17 19:17:43 +02:00
Victor Brekenfeld 50b1996d57 gles2: Add a proper logger to the renderer 2021-05-17 19:14:20 +02:00
Victor Brekenfeld ae6334d376 gles2: Fix `import_bitmap` resulting in black textures 2021-05-17 19:08:20 +02:00
Victor Brekenfeld 5e1128b973 gles2: Link texture in buffer for caching 2021-05-17 00:40:10 +02:00
Victor Brekenfeld b675b59e3b gles2: Use buffer damage to partially update texture 2021-05-16 23:07:48 +02:00
Victor Brekenfeld 2019be737f gles2: Respect shm buffer offset 2021-05-16 23:06:42 +02:00
Victor Brekenfeld 0025f13adc gles2: Make proper use of formats to avoid unnecessary shaders 2021-05-16 23:05:44 +02:00
Victor Brekenfeld c41cc9828f renderer: Cache textures in SurfaceAttributes 2021-05-16 20:00:45 +02:00
Victor Brekenfeld e4f72f7516
Merge pull request #272 from cmeissl/allow_multiple_egl_platforms
Dynamically select the EGL platform display
2021-05-16 15:27:16 +02:00
Christian Meissl f20ff8a178 reduce severity to error in case...
...no suitable egl platform could be selected
2021-05-16 10:58:29 +02:00
Victor Brekenfeld 62fcd84226 Reverse legacy check order 2021-05-15 23:38:24 +02:00
Christian Meissl 8dc94e0817 ignore eglplatform doc examples 2021-05-15 23:34:50 +02:00
Christian Meissl af66a9c152 add more supported egl platforms 2021-05-15 23:05:26 +02:00
Christian Meissl 2e55501dea dynamically select the EGL platform display 2021-05-15 23:05:26 +02:00
Victor Brekenfeld 5d6fadcea8 cargo fmt 2021-05-15 22:35:44 +02:00
Victor Brekenfeld 524057418e drm: Fixup tty switching 2021-05-15 22:28:39 +02:00
Victor Brekenfeld 3012e87e0e drm: Do support IN_FORMATS on legacy surfaces (mostly for nouveau) 2021-05-15 21:01:44 +02:00
Victor Brekenfeld 4e2afb0f1f drm render: Don't fallback to linear but implicit modifiers 2021-05-15 21:01:44 +02:00
Victor Brekenfeld 4ffa329fe9 drm render: Log Argb8888 formats of plane and renderer 2021-05-15 21:01:44 +02:00
Victor Brekenfeld cedc536033 drm: Do not spam ALL supported plane formats 2021-05-15 21:01:44 +02:00
Victor Brekenfeld beeb810edb egl display: do not spam ALL supported formats 2021-05-15 21:01:44 +02:00
Christian Meissl f7b58b146c fixed formatting in gles2 version.rs 2021-05-15 20:41:48 +02:00
Christian Meissl 3ceff8ec67 check for gl version in gles renderer...
...in case the version is greater or equal 3.0 the
check for GL_EXT_unpack_subimage is not needed
2021-05-15 20:41:44 +02:00
Victor Brekenfeld 149c923876 cargo fmt 2021-05-15 18:17:43 +02:00
Victor Brekenfeld f0e7ff3312 cleanup + docs 2021-05-15 16:12:13 +02:00
Victor Brekenfeld 0b0067a3fd egl: Make EGLBufferReader clonable 2021-05-15 16:12:13 +02:00
Victor Brekenfeld 75b2a2d801 renderer: allow caching resources on WlBuffer
- renderer: Change the renderer api to not import different buffer types directly,
but import any supported wl_buffer
- renderer: Remove destroy_texture call and move responsibility into implementation
- gles2: Cache egl images as well as textures on wl_buffer userdata
- gles2: Implement delayed destruction of textures to avoid leaking or changing global state on drop
2021-05-15 16:12:13 +02:00
Victor Brekenfeld 2200d09841 drm: adjust RenderSurface to swapchain changes and AsDmabuf 2021-05-15 16:12:13 +02:00
Victor Brekenfeld 5cf328a1b8 allocator: Introdce AsDmabuf 2021-05-15 16:12:13 +02:00
Victor Brekenfeld 378f826c26 swapchain: do not convert buffers automatically anymore 2021-05-15 16:12:13 +02:00
Christian Meissl 7016e82bed replace hardcoded type casts...
...with platform types in the gles2 renderer
2021-05-15 16:12:13 +02:00
Victor Brekenfeld 6c25dde36e Fix some missing Debug implementations 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 7e47d648d4 First pass of adding documentation 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 52c01535d0 rustfmt 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 36bf5618ed clippy fixes 2021-05-15 16:12:12 +02:00
Victor Brekenfeld e329adcbd8 fix warnings 2021-05-15 16:12:12 +02:00
Victor Brekenfeld ca6ed6b684 allocator: Expose dumb buffer handle 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 46462b20b6 drm: Fix unnecessary Clone requirement 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 85bef5fec6 renderer: rename Texture to TextureId to better convey nature of the handle 2021-05-15 16:12:12 +02:00
Victor Brekenfeld ab6dd61592 renderer: add destroy_texture function 2021-05-15 16:12:12 +02:00
Victor Brekenfeld cb8d637d38 drm: Fixup missing reexport 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 50b0083269 renderer: Implement import_egl for wl_drm 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 348c63b350 egl: EGLBuffer add accessor for EGLImages, remove old code 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 8e3b0c0b9b egl: Do not expose multi-planar buffers for now 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 1f70aa6a08 egl: Rename EGLImages to EGLBuffer 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 3d8cf0e458 renderer: Add importing bitmaps as textures 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 243afb1030 drm: Introduce RenderSurface for compatibility/ease-of-use 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 73554aaf7f reexports: fixup gbm, remove unused image dependency 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 2c9c150e5e renderer: Remove `Frame` trait and merge into `Renderer`
Tracking of Frames, so that only one unique one can exist at a time
(gles does not allow multiple frames being rendered in parallel)
lead to very unfriendly lifetime-heavy code. A renderer is already
*unique*, just move the code there and add an error variant to catch
misuses.
2021-05-15 16:12:12 +02:00
Victor Brekenfeld 66fbb3eb06 egl: less busy logging 2021-05-15 16:12:12 +02:00
Victor Brekenfeld cb825910a6 drm: fixup test_buffer 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 93edc842b2 drm: allow commit/page_flip calls to *not* trigger an event 2021-05-15 16:12:12 +02:00
Victor Brekenfeld c8b370a030 drm: change logger visibility 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 0414417f3c egl: Allow creation of shared contexts 2021-05-15 16:12:12 +02:00
Victor Brekenfeld c6df50cb67 egl: Rexport EGLContext on toplevel 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 347507fc92 drm/legacy: Assume Argb8888 is at least supported like we used to 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 1f86faf1e6 drm: re-add device_id() to DrmDevice 2021-05-15 16:12:12 +02:00
Victor Brekenfeld c05a7aafdf swapchain: export Error type 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 1bba21bf4f swapchain: allow slots to contain userdata 2021-05-15 16:12:12 +02:00
Victor Brekenfeld c107d42ced drm/renderer: Fixup convertion into SwapBuffersError 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 0180bb6ef5 drm: allow to test if scanning out a buffer would succeed 2021-05-15 16:12:12 +02:00
Victor Brekenfeld d042609dbd swapchain: increase cap for additional queuing (e.g. explicit synchronization) 2021-05-15 16:12:12 +02:00
Victor Brekenfeld bcf6a5c4b9 gbm: allow to import dmabufs 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 58f22afa40 dmabuf's take ownership over their contents -> do not reference original buffer 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 9d021d52a4 drm: expose supported plane formats 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 52d581371c renderer: Allow Bind implementations to expose supported formats 2021-05-15 16:12:12 +02:00
Victor Brekenfeld b7aa4c416b egl: enumerate supported dmabuf formats 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 4d8bd26131 egl: enumerate supported dmabuf formats 2021-05-15 16:12:12 +02:00
Victor Brekenfeld a74aa728f7 swapchain: handle buffer conversion for the user 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 84439e5400 swapchain: fix borked resize logic 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 3a2e4ddf61 Migrate the winit backend to the new egl and renderer apis. 2021-05-15 16:12:12 +02:00
Victor Brekenfeld f3f10242e9 Remove the generic "graphics" module.
- Cursor is not necessary anymore as rendering hardware vs software
  cursors just depends on "where" you render the cursor.
- Format is replaced by drm-fourcc and more related to buffers and
  therefor the allocator module anyway.
- GL/Glium are replaced by the renderer module.
- Software was unused and very small anyway and can be implemented
  with the new renderer api.
- SwapBuffersError is (for now) just moved into the top-level backend module.
2021-05-15 16:12:12 +02:00
Victor Brekenfeld 4d5d7afb5a Introduce a new OpenGL renderer
This pulls a lot of code from anvil/src/glium_drawer and replaces glium
as glium has too many assumptions about the backend.
(Mostly that a fixed framebuffer exists, see fix bullet point.)

Depending on how picky glium is, we could try to re-introduce glium support
later with a some workarounds, but for now this is actually more
straight-forward to support and test.

- Add a new GL renderer, that only depends on egl as an initialization platform.
  In particular do not depend on a surface being available.
  Renderers share some basic drawing functions and may bind objects to render upon.
  E.g. surfaces or buffers, textures, etc for the gles2 renderer.
- Be explicit about extensions we require and use. Use some very very common ones
  to make our lives easier (e.g. BGRA and unpack to read in manditory shm formats).
- Enable GL debug output
- Allow more flexible rendering (e.g. 3D compositors) by allowing user-provided
  projection matrices. Also provide helper functions to allow easy-ish handling
  of surface and output transformations.
- Add API for renderers to tell the wayland-frontend about supported buffer-types.
- Also incoperate code from anvil/src/shm_load to handle buffer loading in the renderer
  (as this is a renderer dependant operation).
2021-05-15 16:12:12 +02:00
Victor Brekenfeld d99108a8e6 Simplify egl platform code
- Remove EGLStream code, nvidia support will re-introduced,
  when 470 hopefully lands with GBM support this summer.
- Greately simplify the native code by setting exclusively on
  `EGL_EXT_platform_base` and its extensions for initialization.
- Remove generic parameters for the underlying objects on `EGLDisplay`
  and `EGLSurface` by using trait objects instead.
- Allow creation of `EGLContext`s without a config for surface-less usage.
2021-05-15 16:12:12 +02:00
Victor Brekenfeld d606165088 Restructure drm backend
- Remove the `Device`, `Surface`, `RawDevice` and `RawSurface` traits.
  We are not trying to merge the different responsibilities between...
  - Drm-Surfaces: crtcs and planes for displaying buffers
  - Gbm-Surfaces: allocating and managing front- and back-buffers
  - EGL-Surfaces: Load drawing apis.
  ..anymore.
- Instead unify the legacy and atomic backends into one `DrmDevice` and
  a `DrmSurface`, that under the hood dispatches onto the different modules.
- Do not keep a list of surfaces inside the devices. These are reference-counting
  nightmares and a frequent issue due to the read-only nature of `Rc` and `Arc` and
  thread-safety related problems.
- Surfaces are mostly doing state-tracking independently of each other
  and contain some more helper functions.
- Simplify session code, because we do not need to pass the events
  through three layers of devices and surfaces anymore.
- Each surface now represents a plane. Rendering to a plane is just like
  any other rendering step, including the Cursor-plane.
  (Legacy interfaces only have one to avoid dealing with short-comings of the api).
2021-05-15 16:12:12 +02:00
Victor Brekenfeld c388a502c4 Add allocator module
- Add module that deals with different kinds of buffers (memory and external),
  their allocation and usage for rendering. Also try to properly support modifiers this time.
- Describe gbm functionality as an allocator (instead of a rendering device/surface).
- Also create a quick-and-dirty dumb buffer allocator for tesing / simpler tasks.
- Add a (current untested) wrapper for dmabufs and some code for converting from gbm for now.
- (also untested) Swapchain helper to manage front/backbuffers for surfaceless rendering.
2021-05-15 16:12:12 +02:00
Benjamin Lee 5ac7f7c884 replaced usage of slog_or_stdlog with slog_or_fallback
I think this was missed on a previous refactoring pass, and never got
tested?
2021-05-04 20:24:28 +02:00
Victor Berger 243d2d8b38 libinput: add missing #[cfg()] 2021-04-11 12:59:54 +02:00
Poly d2373fdddd [Debug Trait] Remove unnecessary manual imps 2021-02-23 20:21:20 +01:00
Poly 804a6cb59f [Debug Trait] Add missing comment 2021-02-23 20:20:12 +01:00
Poly 6d76d1c1a2 [Debug Trait] Comments and Cleanup
.
2021-02-22 21:05:00 +01:00
Poly de3dfacee0 [Debug Trait] General cleanup and small fixes 2021-02-22 21:00:49 +01:00