Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Renderer v6, incremental version #2240

Merged
merged 14 commits into from
Nov 15, 2020
Merged

Renderer v6, incremental version #2240

merged 14 commits into from
Nov 15, 2020

Conversation

emersion
Copy link
Member

@emersion emersion commented Jun 1, 2020

This is an alternative to #1355. Instead of re-working the whole API, this PR just uses the new infrastructure inside the DRM backend.

The DRM backend used EGLSurface and gbm_surface until now. Stop using them and switch to wlr_allocator and wlr_swapchain. These new interfaces are mostly copied over from glider.

This PR doesn't break the wlroots API. For now the new APIs are not exposed in public header, once we add APIs that allow compositors to use it directly, we can easily move the headers to the public dir.

TODO:

References: #1352


Breaking changes: some implicit assumptions about wlr_renderer's EGL context no longer hold true. Compositors not using EGL directly shouldn't be affected.

  • wlroots' framebuffer no longer is the EGL default framebuffer
  • wlroots' framebuffer no longer has a depth attachment

render/gbm_allocator.c Show resolved Hide resolved
render/gbm_allocator.c Show resolved Hide resolved
@emersion emersion force-pushed the swapchain branch 8 times, most recently from 6229ac5 to a548b07 Compare June 9, 2020 15:31
render/gles2/renderer.c Outdated Show resolved Hide resolved
@emersion
Copy link
Member Author

emersion commented Jun 9, 2020

So, good news is that the current code works. Bad news is that everything is flipped + rotated by 180 degrees for some reason.

@any1
Copy link
Contributor

any1 commented Jun 9, 2020

So, good news is that the current code works. Bad news is that everything is flipped + rotated by 180 degrees for some reason.

Oh, yeah, I ran into that issue with #2268 too. Mesa bug or feature?

@emersion
Copy link
Member Author

OpenGL seems to expect (0, 0) to be the bottom-left corner when using EGLSurface, and the top-left corner when using FBOs. See my temporary "hack: fix y-inverted output" commit.

@emersion emersion force-pushed the swapchain branch 2 times, most recently from c723151 to 51fb54d Compare June 30, 2020 14:32
@emersion emersion force-pushed the swapchain branch 3 times, most recently from 5a5f384 to d0cbe18 Compare July 7, 2020 18:06
@emersion emersion force-pushed the swapchain branch 8 times, most recently from fa22f19 to 78bd87a Compare July 27, 2020 16:40
@ammen99
Copy link
Member

ammen99 commented Aug 25, 2020

@emersion Thanks for looking into it. I think it may have indeed been a driver bug. Since last time I reproduced, I have updated kernel + mesa-git, and now I can't reproduce anymore. I'll start using this as a daily driver to test it out more :)

@emersion
Copy link
Member Author

Fixed the screencopy issue when capturing a region of the screen. This PR doesn't have more known issues.

@ddevault Should we wait on the iris bugfix before merging this?

@ddevault
Copy link
Contributor

Should probably block the release but not necessarily the merge

@emersion
Copy link
Member Author

Agree. Then this is ready for another review round.

@emersion
Copy link
Member Author

emersion commented Nov 4, 2020

The iris bug has been fixed: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7384

The swapchain maximum capacity is set to 4, so that we have enough room
for:

- A buffer currently displayed on screen
- A buffer queued for display (e.g. to KMS)
- A pending buffer that'll be queued next commit
- An additional pending buffer in case we want to invalidate the
  currently pending one
Since all DRM FBs are backed by a wlr_buffer, there's no need for this
anymore.
This avoids hitting an assertion in drm_fb_lock_surface when
we failed to render a black frame.
@emersion
Copy link
Member Author

emersion commented Nov 15, 2020

All right, let's merge this. Thanks everyone for the feedback and testing!

@ddevault
Copy link
Contributor

Great work!

@emersion emersion mentioned this pull request Mar 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking Breaking change in public API
Development

Successfully merging this pull request may close these issues.

None yet

7 participants