Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bypass only works with DMABufBuffer #2818

Closed
AlanGriffiths opened this issue Jan 31, 2023 · 1 comment
Closed

bypass only works with DMABufBuffer #2818

AlanGriffiths opened this issue Jan 31, 2023 · 1 comment

Comments

@AlanGriffiths
Copy link
Contributor

It would be more useful if it worked with ShmBuffer (e.g. glmark2-wayland uses shm)

            auto dmabuf_image = dynamic_cast<mg::DMABufBuffer*>(bypass_buffer->native_buffer_base());
            if (dmabuf_image &&
                bypass_buffer->size() == surface.size())

Is there a technical limitation here? Or just legacy?

@RAOF
Copy link
Contributor

RAOF commented Jan 31, 2023

Kind of a bit of both?

DMABufBuffers are easy to bypass with - they're already handles to GPU memory, we just need to get the driver to associate a framebuffer handle with them in order to submit them to scanout.

ShmBuffers aren't in GPU memory. To scanout of them we'd need to create a DRM dumb buffer, map it, memcpy the content of the ShmBuffer into the dumb buffer, then get the driver to associate a fb handle with it.

This is absolutely possible, and it's probably still faster than GL compositing, but it's not a clear win - when using GL the driver can plausibly use GPU hardware resources for memcpy, will likely be able to handle cache invalidation better, and so on.

@AlanGriffiths AlanGriffiths closed this as not planned Won't fix, can't repro, duplicate, stale Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants