backends/drm: don't test hardware rotation if not supported by the driver
This commit is contained in:
parent
d7b710a9a1
commit
420358709a
2 changed files with 14 additions and 0 deletions
|
@ -110,6 +110,7 @@ DrmPipeline::Error DrmPipeline::commitPipelinesAtomic(const QVector<DrmPipeline
|
||||||
return Error::OutofMemory;
|
return Error::OutofMemory;
|
||||||
}
|
}
|
||||||
for (const auto &pipeline : pipelines) {
|
for (const auto &pipeline : pipelines) {
|
||||||
|
pipeline->checkHardwareRotation();
|
||||||
if (pipeline->activePending()) {
|
if (pipeline->activePending()) {
|
||||||
if (!pipeline->m_pending.layer->checkTestBuffer()) {
|
if (!pipeline->m_pending.layer->checkTestBuffer()) {
|
||||||
qCWarning(KWIN_DRM) << "Checking test buffer failed for" << mode;
|
qCWarning(KWIN_DRM) << "Checking test buffer failed for" << mode;
|
||||||
|
@ -290,6 +291,18 @@ bool DrmPipeline::populateAtomicValues(drmModeAtomicReq *req)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DrmPipeline::checkHardwareRotation()
|
||||||
|
{
|
||||||
|
if (m_pending.crtc && m_pending.crtc->primaryPlane()) {
|
||||||
|
const bool supported = (m_pending.bufferOrientation & m_pending.crtc->primaryPlane()->supportedTransformations());
|
||||||
|
if (!supported) {
|
||||||
|
m_pending.bufferOrientation = DrmPlane::Transformations(DrmPlane::Transformation::Rotate0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
m_pending.bufferOrientation = DrmPlane::Transformation::Rotate0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t DrmPipeline::calculateUnderscan()
|
uint32_t DrmPipeline::calculateUnderscan()
|
||||||
{
|
{
|
||||||
const auto size = m_pending.mode->size();
|
const auto size = m_pending.mode->size();
|
||||||
|
|
|
@ -141,6 +141,7 @@ private:
|
||||||
bool isBufferForDirectScanout() const;
|
bool isBufferForDirectScanout() const;
|
||||||
uint32_t calculateUnderscan();
|
uint32_t calculateUnderscan();
|
||||||
static Error errnoToError();
|
static Error errnoToError();
|
||||||
|
void checkHardwareRotation();
|
||||||
|
|
||||||
// legacy only
|
// legacy only
|
||||||
Error presentLegacy();
|
Error presentLegacy();
|
||||||
|
|
Loading…
Reference in a new issue