Commit db1f7414 authored by Xaver Hugl's avatar Xaver Hugl
Browse files

backends/drm: add additional check for direct scanout buffers

While in principle Mesa should already check if the buffer can be scanned
out, this may not always work. If we can't create a framebuffer object for
the buffer, fall back to compositing.

CCBUG: 448818
parent c952c3a3
Pipeline #128278 passed with stage
in 14 minutes
......@@ -753,6 +753,12 @@ bool EglGbmBackend::scanout(AbstractOutput *drmOutput, SurfaceItem *surfaceItem)
damage = output.output->geometry();
auto bo = QSharedPointer<DrmGbmBuffer>::create(m_gpu, importedBuffer, buffer);
if (!bo->bufferId()) {
// buffer can't actually be scanned out. Mesa is supposed to prevent this from happening
// in gbm_bo_import but apparently that doesn't always work
return false;
// ensure that a context is current like with normal presentation
if (output.output->present(bo, damage)) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment