platforms/drm: use correct size for soft rotation

This commit is contained in:
Xaver Hugl 2021-06-25 00:46:32 +02:00
parent 3427143017
commit 7e96f09670

View file

@ -300,8 +300,9 @@ bool EglStreamBackend::initRenderingContext()
bool EglStreamBackend::resetOutput(Output &o, DrmOutput *drmOutput) bool EglStreamBackend::resetOutput(Output &o, DrmOutput *drmOutput)
{ {
o.output = drmOutput; o.output = drmOutput;
QSize sourceSize = drmOutput->hardwareTransforms() ? drmOutput->pixelSize() : drmOutput->modeSize();
// dumb buffer used for modesetting // dumb buffer used for modesetting
o.buffer = QSharedPointer<DrmDumbBuffer>::create(m_gpu, drmOutput->pixelSize()); o.buffer = QSharedPointer<DrmDumbBuffer>::create(m_gpu, sourceSize);
if (isPrimary()) { if (isPrimary()) {
EGLAttrib streamAttribs[] = { EGLAttrib streamAttribs[] = {
@ -334,8 +335,8 @@ bool EglStreamBackend::resetOutput(Output &o, DrmOutput *drmOutput)
pEglStreamConsumerOutputEXT(eglDisplay(), stream, outputLayer); pEglStreamConsumerOutputEXT(eglDisplay(), stream, outputLayer);
EGLint streamProducerAttribs[] = { EGLint streamProducerAttribs[] = {
EGL_WIDTH, drmOutput->pixelSize().width(), EGL_WIDTH, sourceSize.width(),
EGL_HEIGHT, drmOutput->pixelSize().height(), EGL_HEIGHT, sourceSize.height(),
EGL_NONE EGL_NONE
}; };
EGLSurface eglSurface = pEglCreateStreamProducerSurfaceKHR(eglDisplay(), config(), stream, EGLSurface eglSurface = pEglCreateStreamProducerSurfaceKHR(eglDisplay(), config(), stream,
@ -368,8 +369,7 @@ bool EglStreamBackend::resetOutput(Output &o, DrmOutput *drmOutput)
} }
} }
} else { } else {
QSize size = drmOutput->hardwareTransforms() ? drmOutput->pixelSize() : drmOutput->modeSize(); o.dumbSwapchain = QSharedPointer<DumbSwapchain>::create(m_gpu, sourceSize);
o.dumbSwapchain = QSharedPointer<DumbSwapchain>::create(m_gpu, size);
if (o.dumbSwapchain->isEmpty()) { if (o.dumbSwapchain->isEmpty()) {
return false; return false;
} }