Commit Graph

890 Commits

Author SHA1 Message Date
Victor Brekenfeld e329adcbd8 fix warnings 2021-05-15 16:12:12 +02:00
Victor Brekenfeld ccd86cd8c1 anvil: Do not throw rendering errors away 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 795903d7e0 anvil: Fixup compiling egl support 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 05f11cffeb examples: fix raw_drm 2021-05-15 16:12:12 +02:00
Victor Brekenfeld 0661ebebb8 anvil: Properly free textures 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 30a8693789 anvil: Reintroduce egl buffer support 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 45cd37373a anvil: Render software cursors again 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 43d3e9cd14 anvil: Fixup udev/tty backend, so that it runs at least 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 fb30c830d7 Fixup anvil for winit rendering
- Since a lot of functionality is now in smithay's rendering module
  we can get rid of shm_load, shaders and the glium dependency.
- glium_drawer becomes drawing and only features some code to get from surfaces
  to textures for any(!) renderer.
  (Should probably moved into smithay at some point as well.)
- buffer_utils is only necessary to query the buffer size anymore.
- disable egl-buffer support temporarily
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 0628a83ea4 Update build.rs to generate code for the actual extensions we are using now 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