platforms/drm: allow overriding eglstream choice

Add a new environment variable KWIN_DRM_FORCE_EGL_STREAMS that, when set
to an integer value other than 0, makes KWin prefer EglStreams over gbm.
This commit is contained in:
Xaver Hugl 2021-10-17 03:21:44 +02:00
parent d257850bd1
commit ebaf2e61fc

View file

@ -83,7 +83,11 @@ DrmGpu::DrmGpu(DrmBackend *backend, const QString &devNode, int fd, dev_t device
m_useEglStreams = m_isNVidia;
#if HAVE_GBM
m_gbmDevice = gbm_create_device(m_fd);
if (m_gbmDevice) {
bool envVarIsSet = false;
bool value = qEnvironmentVariableIntValue("KWIN_DRM_FORCE_EGL_STREAMS", &envVarIsSet) != 0;
if (envVarIsSet) {
m_useEglStreams = m_isNVidia && value;
} else if (m_gbmDevice) {
m_useEglStreams = m_isNVidia && strcmp(gbm_device_get_backend_name(m_gbmDevice), "nvidia") != 0;
}
#endif