platforms/drm: only allocate two dumb buffers for the swapchain

This commit is contained in:
Xaver Hugl 2021-06-08 21:11:39 +02:00
parent 35e37f7347
commit 4ee3f69dd5

View file

@ -17,7 +17,7 @@ namespace KWin
DumbSwapchain::DumbSwapchain(DrmGpu *gpu, const QSize &size)
: m_size(size)
{
for (int i = 0; i < 3; i++) {
for (int i = 0; i < 2; i++) {
auto buffer = QSharedPointer<DrmDumbBuffer>::create(gpu, size);
if (!buffer->bufferId()) {
break;
@ -28,7 +28,7 @@ DumbSwapchain::DumbSwapchain(DrmGpu *gpu, const QSize &size)
buffer->image()->fill(Qt::black);
m_buffers << buffer;
}
if (m_buffers.count() < 3) {
if (m_buffers.count() < 2) {
qCWarning(KWIN_DRM) << "Failed to create dumb buffers for swapchain!";
m_buffers.clear();
}