Make libdrm required dependency

As is, kwin with the drm backend results in the most pleasant user
experience on Wayland. Given that and the fbdev being about to be
dropped, making libdrm a required dependency seems a reasonable decision.
This commit is contained in:
Vlad Zahorodnii 2021-05-14 12:57:54 +03:00
parent 3b05823f1f
commit 77a9d38166
5 changed files with 4 additions and 30 deletions

View file

@ -203,21 +203,14 @@ set_package_properties(UDev PROPERTIES
)
find_package(Libdrm 2.4.62)
set_package_properties(Libdrm PROPERTIES TYPE OPTIONAL PURPOSE "Required for drm output on Wayland.")
set(HAVE_DRM FALSE)
if (Libdrm_FOUND)
set(HAVE_DRM TRUE)
endif()
set_package_properties(Libdrm PROPERTIES TYPE REQUIRED PURPOSE "Required for drm output on Wayland.")
find_package(gbm)
set_package_properties(gbm PROPERTIES TYPE OPTIONAL PURPOSE "Required for egl output of drm backend.")
set(HAVE_GBM FALSE)
if (HAVE_DRM AND gbm_FOUND)
set(HAVE_GBM TRUE)
endif()
set(HAVE_GBM ${gbm_FOUND})
option(KWIN_BUILD_EGL_STREAM_BACKEND "Enable building of EGLStream based DRM backend" ON)
if (HAVE_DRM AND KWIN_BUILD_EGL_STREAM_BACKEND)
if (KWIN_BUILD_EGL_STREAM_BACKEND)
set(HAVE_EGL_STREAMS TRUE)
endif()

View file

@ -16,7 +16,6 @@
#define KWIN_XCLIPBOARD_SYNC_BIN "${CMAKE_INSTALL_FULL_LIBEXECDIR}/org_kde_kwin_xclipboard_syncer"
#cmakedefine01 HAVE_X11_XCB
#cmakedefine01 HAVE_X11_XINPUT
#cmakedefine01 HAVE_DRM
#cmakedefine01 HAVE_GBM
#cmakedefine01 HAVE_EGL_STREAMS
#cmakedefine01 HAVE_WAYLAND_EGL

View file

@ -289,9 +289,7 @@ void ApplicationWayland::startSession()
static const QString s_waylandPlugin = QStringLiteral("KWinWaylandWaylandBackend");
static const QString s_x11Plugin = QStringLiteral("KWinWaylandX11Backend");
static const QString s_fbdevPlugin = QStringLiteral("KWinWaylandFbdevBackend");
#if HAVE_DRM
static const QString s_drmPlugin = QStringLiteral("KWinWaylandDrmBackend");
#endif
static const QString s_virtualPlugin = QStringLiteral("KWinWaylandVirtualBackend");
@ -312,13 +310,11 @@ static QString automaticBackendSelection(SpawnMode spawnMode)
if (qEnvironmentVariableIsSet("DISPLAY")) {
return s_x11Plugin;
}
#if HAVE_DRM
// Only default to drm when there's dri drivers. This way fbdev will be
// used when running using nomodeset
if (QFileInfo::exists("/dev/dri")) {
return s_drmPlugin;
}
#endif
return s_fbdevPlugin;
}
@ -439,9 +435,7 @@ int main(int argc, char * argv[])
const bool hasVirtualOption = hasPlugin(KWin::s_virtualPlugin);
const bool hasWaylandOption = hasPlugin(KWin::s_waylandPlugin);
const bool hasFramebufferOption = hasPlugin(KWin::s_fbdevPlugin);
#if HAVE_DRM
const bool hasDrmOption = hasPlugin(KWin::s_drmPlugin);
#endif
QCommandLineOption xwaylandOption(QStringLiteral("xwayland"),
i18n("Start a rootless Xwayland server."));
@ -517,12 +511,10 @@ int main(int argc, char * argv[])
QCommandLineOption libinputOption(QStringLiteral("libinput"),
i18n("Enable libinput support for input events processing. Note: never use in a nested session. (deprecated)"));
parser.addOption(libinputOption);
#if HAVE_DRM
QCommandLineOption drmOption(QStringLiteral("drm"), i18n("Render through drm node."));
if (hasDrmOption) {
parser.addOption(drmOption);
}
#endif
QCommandLineOption inputMethodOption(QStringLiteral("inputmethod"),
i18n("Input method that KWin starts."),
@ -594,11 +586,9 @@ int main(int argc, char * argv[])
int outputCount = 1;
qreal outputScale = 1;
#if HAVE_DRM
if (hasDrmOption && parser.isSet(drmOption)) {
pluginName = KWin::s_drmPlugin;
}
#endif
if (hasSizeOption) {
bool ok = false;

View file

@ -1,6 +1,4 @@
if (HAVE_DRM)
add_subdirectory(drm)
endif()
add_subdirectory(drm)
if (HAVE_LINUX_FB_H)
add_subdirectory(fbdev)
endif()

View file

@ -1508,12 +1508,6 @@ QString Workspace::supportInformation() const
support.append(yes);
#else
support.append(no);
#endif
support.append(QStringLiteral("HAVE_DRM: "));
#if HAVE_DRM
support.append(yes);
#else
support.append(no);
#endif
support.append(QStringLiteral("HAVE_GBM: "));
#if HAVE_GBM