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

backends/drm: suppress logging for direct scanout

BUG: 456089


(cherry picked from commit ef97158f)
parent 34e14bb1
Pipeline #196942 passed with stage
in 29 minutes and 15 seconds
......@@ -150,7 +150,6 @@ std::shared_ptr<DrmFramebuffer> DrmFramebuffer::createFramebuffer(const std::sha
if (ret == 0) {
return std::make_shared<DrmFramebuffer>(buffer, framebufferId);
} else {
qCWarning(KWIN_DRM) << "Could not create drm framebuffer!" << strerror(errno);
return nullptr;
}
}
......
......@@ -47,6 +47,9 @@ bool DrmLeaseEglGbmLayer::checkTestBuffer()
}
if (newBo) {
m_framebuffer = DrmFramebuffer::createFramebuffer(std::make_shared<GbmBuffer>(m_pipeline->gpu(), newBo));
if (!m_framebuffer) {
qCWarning(KWIN_DRM, "Failed to create gbm framebuffer for lease output: %s", strerror(errno));
}
} else {
qCWarning(KWIN_DRM) << "Failed to create gbm_bo for lease output";
}
......
......@@ -16,6 +16,7 @@
#include "drm_pipeline.h"
#include "drm_virtual_output.h"
#include "dumb_swapchain.h"
#include "logging.h"
#include "scene_qpainter_drm_backend.h"
#include <drm_fourcc.h>
......@@ -49,6 +50,9 @@ bool DrmQPainterLayer::endFrame(const QRegion &renderedRegion, const QRegion &da
m_currentDamage = damagedRegion;
m_swapchain->releaseBuffer(m_swapchain->currentBuffer(), damagedRegion);
m_currentFramebuffer = DrmFramebuffer::createFramebuffer(m_swapchain->currentBuffer());
if (!m_currentFramebuffer) {
qCWarning(KWIN_DRM, "Failed to create dumb framebuffer: %s", strerror(errno));
}
return m_currentFramebuffer != nullptr;
}
......@@ -58,6 +62,9 @@ bool DrmQPainterLayer::checkTestBuffer()
m_swapchain = std::make_shared<DumbSwapchain>(m_pipeline->gpu(), m_pipeline->bufferSize(), DRM_FORMAT_XRGB8888);
if (!m_swapchain->isEmpty()) {
m_currentFramebuffer = DrmFramebuffer::createFramebuffer(m_swapchain->currentBuffer());
if (!m_currentFramebuffer) {
qCWarning(KWIN_DRM, "Failed to create dumb framebuffer: %s", strerror(errno));
}
} else {
m_currentFramebuffer.reset();
}
......@@ -110,6 +117,9 @@ bool DrmCursorQPainterLayer::endFrame(const QRegion &damagedRegion, const QRegio
Q_UNUSED(renderedRegion)
m_swapchain->releaseBuffer(m_swapchain->currentBuffer(), damagedRegion);
m_currentFramebuffer = DrmFramebuffer::createFramebuffer(m_swapchain->currentBuffer());
if (!m_currentFramebuffer) {
qCWarning(KWIN_DRM, "Failed to create dumb framebuffer for the cursor: %s", strerror(errno));
}
return m_currentFramebuffer != nullptr;
}
......@@ -177,6 +187,9 @@ bool DrmLeaseQPainterLayer::checkTestBuffer()
m_buffer = DrmDumbBuffer::createDumbBuffer(m_pipeline->gpu(), size, DRM_FORMAT_XRGB8888);
if (m_buffer) {
m_framebuffer = DrmFramebuffer::createFramebuffer(m_buffer);
if (!m_framebuffer) {
qCWarning(KWIN_DRM, "Failed to create dumb framebuffer for lease output: %s", strerror(errno));
}
} else {
m_framebuffer.reset();
}
......
......@@ -129,7 +129,11 @@ std::optional<std::tuple<std::shared_ptr<DrmFramebuffer>, QRegion>> EglGbmLayerS
if (m_gpu == m_eglBackend->gpu()) {
if (const auto buffer = m_gbmSurface->swapBuffers(damagedRegion)) {
m_currentBuffer = buffer;
return std::tuple(DrmFramebuffer::createFramebuffer(buffer), damagedRegion);
auto ret = DrmFramebuffer::createFramebuffer(buffer);
if (!ret) {
qCWarning(KWIN_DRM, "Failed to create framebuffer for EglGbmLayerSurface: %s", strerror(errno));
}
return std::tuple(ret, damagedRegion);
}
} else {
if (const auto gbmBuffer = m_gbmSurface->swapBuffers(damagedRegion)) {
......@@ -282,7 +286,11 @@ std::shared_ptr<DrmFramebuffer> EglGbmLayerSurface::importDmabuf()
qCWarning(KWIN_DRM, "failed to import gbm_bo for multi-gpu usage: %s", strerror(errno));
return nullptr;
}
return DrmFramebuffer::createFramebuffer(imported);
const auto ret = DrmFramebuffer::createFramebuffer(imported);
if (!ret) {
qCWarning(KWIN_DRM, "Failed to create framebuffer for multi-gpu: %s", strerror(errno));
}
return ret;
}
std::shared_ptr<DrmFramebuffer> EglGbmLayerSurface::importWithCpu()
......@@ -313,7 +321,11 @@ std::shared_ptr<DrmFramebuffer> EglGbmLayerSurface::importWithCpu()
if (!memcpy(importBuffer->data(), m_currentBuffer->mappedData(), importBuffer->size().height() * importBuffer->strides()[0])) {
return nullptr;
}
return DrmFramebuffer::createFramebuffer(importBuffer);
const auto ret = DrmFramebuffer::createFramebuffer(importBuffer);
if (!ret) {
qCWarning(KWIN_DRM, "Failed to create framebuffer for CPU import: %s", strerror(errno));
}
return ret;
}
bool EglGbmLayerSurface::doesSwapchainFit(DumbSwapchain *swapchain) const
......@@ -364,7 +376,11 @@ std::shared_ptr<DrmFramebuffer> EglGbmLayerSurface::renderTestBuffer(const QSize
return nullptr;
}
}
return DrmFramebuffer::createFramebuffer(m_currentBuffer);
const auto ret = DrmFramebuffer::createFramebuffer(m_currentBuffer);
if (!ret) {
qCWarning(KWIN_DRM, "Failed to create framebuffer for testing: %s", strerror(errno));
}
return ret;
} else {
return nullptr;
}
......
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