Commit Graph

560 Commits

Author SHA1 Message Date
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 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 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
Poly c2457db8d1 Fix libseat build 2021-07-01 23:51:50 +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
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
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
Poly f9f77288c8
libseat support (#292) 2021-06-15 23:35:16 +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 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 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
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