[backends/drm] Set mode when changing from/to a gbm buffer
Tiling configurations of DRM and GBM buffers differ, so we need to explicitly set the mode when it changes. BUG: 357543 FIXED-IN: 5.5.4icc-effect-5.14.5
parent
096b61ee44
commit
a18177cc24
|
@ -614,7 +614,7 @@ bool DrmOutput::present(DrmBuffer *buffer)
|
|||
if (m_currentBuffer) {
|
||||
return false;
|
||||
}
|
||||
if (m_lastStride != buffer->stride()) {
|
||||
if (m_lastStride != buffer->stride() || m_lastGbm != buffer->isGbm()) {
|
||||
// need to set a new mode first
|
||||
if (!setMode(buffer)) {
|
||||
return false;
|
||||
|
@ -811,6 +811,7 @@ bool DrmOutput::setMode(DrmBuffer *buffer)
|
|||
{
|
||||
if (drmModeSetCrtc(m_backend->fd(), m_crtcId, buffer->bufferId(), 0, 0, &m_connector, 1, &m_mode) == 0) {
|
||||
m_lastStride = buffer->stride();
|
||||
m_lastGbm = buffer->isGbm();
|
||||
return true;
|
||||
} else {
|
||||
qCWarning(KWIN_DRM) << "Mode setting failed";
|
||||
|
|
|
@ -181,6 +181,7 @@ private:
|
|||
quint32 m_crtcId = 0;
|
||||
quint32 m_connector = 0;
|
||||
quint32 m_lastStride = 0;
|
||||
bool m_lastGbm = false;
|
||||
drmModeModeInfo m_mode;
|
||||
DrmBuffer *m_currentBuffer = nullptr;
|
||||
DrmBuffer *m_blackBuffer = nullptr;
|
||||
|
@ -221,6 +222,9 @@ public:
|
|||
gbm_bo *gbm() const {
|
||||
return m_bo;
|
||||
}
|
||||
bool isGbm() const {
|
||||
return m_bo != nullptr;
|
||||
}
|
||||
void releaseGbm();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue