backends/drm: set hdr metadata to 0

Otherwise we might have broken colors from leftover state of other compositors
This commit is contained in:
Xaver Hugl 2022-11-22 13:35:36 +01:00
parent af24f5b011
commit 6bb4ebdf04
3 changed files with 6 additions and 1 deletions

View file

@ -113,7 +113,8 @@ DrmConnector::DrmConnector(DrmGpu *gpu, uint32_t connectorId)
{QByteArrayLiteral("Good"), QByteArrayLiteral("Bad")}),
PropertyDefinition(QByteArrayLiteral("content type"), Requirement::Optional,
{QByteArrayLiteral("No Data"), QByteArrayLiteral("Graphics"), QByteArrayLiteral("Photo"), QByteArrayLiteral("Cinema"), QByteArrayLiteral("Game")}),
PropertyDefinition(QByteArrayLiteral("panel orientation"), Requirement::Optional, {QByteArrayLiteral("Normal"), QByteArrayLiteral("Upside Down"), QByteArrayLiteral("Left Side Up"), QByteArrayLiteral("Right Side Up")})},
PropertyDefinition(QByteArrayLiteral("panel orientation"), Requirement::Optional, {QByteArrayLiteral("Normal"), QByteArrayLiteral("Upside Down"), QByteArrayLiteral("Left Side Up"), QByteArrayLiteral("Right Side Up")}),
PropertyDefinition(QByteArrayLiteral("HDR_OUTPUT_METADATA"), Requirement::Optional)},
DRM_MODE_OBJECT_CONNECTOR)
, m_pipeline(std::make_unique<DrmPipeline>(this))
, m_conn(drmModeGetConnector(gpu->fd(), connectorId))

View file

@ -66,6 +66,7 @@ public:
LinkStatus = 11,
ContentType = 12,
PanelOrientation = 13,
HdrMetadata = 14,
Count
};

View file

@ -261,6 +261,9 @@ void DrmPipeline::prepareAtomicModeset()
}
bpc->setPending(std::min(bpc->maxValue(), preferred));
}
if (const auto hdr = m_connector->getProp(DrmConnector::PropertyIndex::HdrMetadata)) {
hdr->setPending(0);
}
m_pending.crtc->setPending(DrmCrtc::PropertyIndex::Active, 1);
m_pending.crtc->setPending(DrmCrtc::PropertyIndex::ModeId, m_pending.mode->blobId());