mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-02-16 02:30:52 +00:00
Allow plane selection overrides using environment variables
This commit is contained in:
@@ -654,6 +654,15 @@ bool DrmRenderer::initialize(PDECODER_PARAMETERS params)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// Allow the user to override the plane selection logic
|
||||||
|
uint32_t userPlane;
|
||||||
|
if (Utils::getEnvironmentVariableOverride("DRM_VIDEO_PLANE", &userPlane) && userPlane != planeRes->planes[i]) {
|
||||||
|
drmModeFreePlane(plane);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// We don't check plane->crtc_id here because we want to be able to reuse the primary plane
|
// We don't check plane->crtc_id here because we want to be able to reuse the primary plane
|
||||||
// that may owned by Qt and in use on a CRTC prior to us taking over DRM master. When we give
|
// that may owned by Qt and in use on a CRTC prior to us taking over DRM master. When we give
|
||||||
// control back to Qt, it will repopulate the plane with the FB it owns and render as normal.
|
// control back to Qt, it will repopulate the plane with the FB it owns and render as normal.
|
||||||
@@ -756,6 +765,16 @@ bool DrmRenderer::initialize(PDECODER_PARAMETERS params)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
// Allow the user to override the plane selection logic
|
||||||
|
uint32_t userPlane;
|
||||||
|
QString optionVarName = QString("DRM_OVERLAY_PLANE%1").arg(overlayIndex);
|
||||||
|
if (Utils::getEnvironmentVariableOverride(optionVarName.toUtf8(), &userPlane) && userPlane != planeRes->planes[i]) {
|
||||||
|
drmModeFreePlane(plane);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DrmPropertyMap props { m_DrmFd, planeRes->planes[i], DRM_MODE_OBJECT_PLANE };
|
DrmPropertyMap props { m_DrmFd, planeRes->planes[i], DRM_MODE_OBJECT_PLANE };
|
||||||
// Only consider overlay planes as valid targets
|
// Only consider overlay planes as valid targets
|
||||||
if (auto type = props.property("type"); type->initialValue() != DRM_PLANE_TYPE_OVERLAY) {
|
if (auto type = props.property("type"); type->initialValue() != DRM_PLANE_TYPE_OVERLAY) {
|
||||||
|
|||||||
Reference in New Issue
Block a user