package/cog: support choosing either DRM or FDO platform
authorCharlie Turner <cturner@igalia.com>
Mon, 6 Apr 2020 17:42:05 +0000 (18:42 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Mon, 6 Apr 2020 19:35:54 +0000 (21:35 +0200)
A new DRM platform has landed, now you can choose to build with the
DRM or FDO platform, or neither. If neither are selected, Cog will
fallback to a simple WPE backend like WPEBackend-rdk
(https://github.com/WebPlatformForEmbedded/WPEBackend-rdk).

Don't be confused that in both cases the *wpebackend-fdo* package is
required. This is an unfortunate naming issue.

Signed-off-by: Charlie Turner <cturner@igalia.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/cog/Config.in
package/cog/cog.mk

index c20ee868278e02a77b8e2dcc2a5ed2b994b510ae..a9ca7473a9ab51e73108fc3d23928a1f43dd5113 100644 (file)
@@ -8,9 +8,7 @@ config BR2_PACKAGE_COG
        depends on BR2_TOOLCHAIN_HAS_THREADS # dbus
        depends on BR2_USE_MMU # dbus
        select BR2_PACKAGE_DBUS
-       select BR2_PACKAGE_LIBXKBCOMMON
        select BR2_PACKAGE_WAYLAND
-       select BR2_PACKAGE_WAYLAND_PROTOCOLS
        help
          Single "window" launcher for the WebKit WPE port, and
          helper library for implementing WPE launcher. It does
@@ -29,4 +27,27 @@ config BR2_PACKAGE_COG_PROGRAMS_HOME_URI
          string is used, there is no default and the URI to open
          must be always specified in the command line.
 
+config BR2_PACKAGE_COG_PLATFORM_FDO
+       bool "FreeDesktop.org backend"
+       default y
+       select BR2_PACKAGE_LIBXKBCOMMON
+       select BR2_PACKAGE_WAYLAND_PROTOCOLS
+       help
+         Enable the FreeDesktop.org backend. Cog will interface with
+         a compositor over the Wayland protocol.
+
+config BR2_PACKAGE_COG_PLATFORM_DRM
+       bool "DRM backend"
+       depends on BR2_PACKAGE_HAS_UDEV # libinput
+       depends on BR2_PACKAGE_MESA3D_OPENGL_EGL # gbm
+       select BR2_PACKAGE_LIBDRM
+       select BR2_PACKAGE_LIBINPUT
+       help
+         Enable the DRM platform backend. Cog will interface directly
+         with video drivers that support kernel mode-setting (KMS)
+         via the DRM user-space API.
+
+comment "DRM platform needs mesa3d w/ EGL driver and GBM"
+       depends on !BR2_PACKAGE_MESA3D_OPENGL_EGL
+
 endif
index c6fae34a652fd74c08bc6e9406f9293b7b28722e..a826252829a0160de1ef41cf14fb64ba511dad22 100644 (file)
@@ -8,15 +8,27 @@ COG_VERSION = 0.6.0
 COG_SITE = https://wpewebkit.org/releases
 COG_SOURCE = cog-$(COG_VERSION).tar.xz
 COG_INSTALL_STAGING = YES
-COG_DEPENDENCIES = dbus wpewebkit wpebackend-fdo libxkbcommon wayland wayland-protocols
+COG_DEPENDENCIES = dbus wpewebkit wpebackend-fdo wayland
 COG_LICENSE = MIT
 COG_LICENSE_FILES = COPYING
 COG_CONF_OPTS = \
        -DCOG_BUILD_PROGRAMS=ON \
-       -DCOG_PLATFORM_FDO=ON \
-       -DCOG_PLATFORM_DRM=OFF \
        -DCOG_WESTON_DIRECT_DISPLAY=OFF \
        -DINSTALL_MAN_PAGES=OFF \
        -DCOG_HOME_URI='$(call qstrip,$(BR2_PACKAGE_COG_PROGRAMS_HOME_URI))'
 
+ifeq ($(BR2_PACKAGE_COG_PLATFORM_FDO),y)
+COG_CONF_OPTS += -DCOG_PLATFORM_FDO=ON
+COG_DEPENDENCIES += libxkbcommon wayland-protocols
+else
+COG_CONF_OPTS += -DCOG_PLATFORM_FDO=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_COG_PLATFORM_DRM),y)
+COG_CONF_OPTS += -DCOG_PLATFORM_DRM=ON
+COG_DEPENDENCIES += libdrm libinput
+else
+COG_CONF_OPTS += -DCOG_PLATFORM_DRM=OFF
+endif
+
 $(eval $(cmake-package))