Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Michael Fischer <mf@go-sys.de>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [Buildroot] [PATCH 3/3] package/sdl2: rework KMS/DRM video driver dependencies
Date: Fri,  5 Aug 2022 00:15:59 +0200	[thread overview]
Message-ID: <20220804221559.46394-3-thomas.petazzoni@bootlin.com> (raw)
In-Reply-To: <20220804221559.46394-1-thomas.petazzoni@bootlin.com>

The KMS/DRM video driver of SDL2 can currently only be enabled when
mesa3d is the OpenGL provider, as the option has a dependency on
BR2_PACKAGE_MESA3D_GBM. Now that we have a libgbm virtual package and
BR2_PACKAGE_HAS_LIBGBM, we can do better.

However, this has uncovered a number of additional related issues that
are resolved at the same time. Here are some details:

 * the 'depends on BR2_PACKAGE_LIBDRM' is changed to a select, as we
   normally do for library dependencies. Due to this, we inherit a
   BR2_TOOLCHAIN_HAS_THREADS dependency.

 * the 'depends on BR2_PACKAGE_MESA3D_GBM' is changed to 'depends on
   BR2_PACKAGE_HAS_LIBGBM', and the 'mesa3d' dependency is changed to
   'libgbm'.

 * the KMS/DRM video driver in SDL2 needs EGL (hence the additional
   'depends on BR2_PACKAGE_HAS_LIBEGL' and the libegbl dependency is
   added in the .mk file). But in turn, EGL support is only checked
   when either OpenGL or OpenGLES support is enabled in SDL2, which is
   why we add logic to select the appropriate options.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
 package/sdl2/Config.in | 17 ++++++++++-------
 package/sdl2/sdl2.mk   |  2 +-
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/package/sdl2/Config.in b/package/sdl2/Config.in
index 2ad45e4d00..bce7d4e272 100644
--- a/package/sdl2/Config.in
+++ b/package/sdl2/Config.in
@@ -31,14 +31,17 @@ comment "X11 video driver needs X.org"
 
 config BR2_PACKAGE_SDL2_KMSDRM
 	bool "KMS/DRM video driver"
-	depends on BR2_PACKAGE_LIBDRM
-	depends on BR2_PACKAGE_MESA3D_GBM
+	depends on BR2_PACKAGE_HAS_LIBGBM
+	depends on BR2_PACKAGE_SDL2_OPENGL || BR2_PACKAGE_SDL2_OPENGLES
+	depends on BR2_PACKAGE_HAS_LIBEGL
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	select BR2_PACKAGE_LIBDRM
 
-comment "KMS/DRM video driver needs libdrm"
-	depends on !BR2_PACKAGE_LIBDRM
-
-comment "KMS/DRM video driver needs mesa3d w/ GBM"
-	depends on !BR2_PACKAGE_MESA3D_GBM
+comment "KMS/DRM video driver needs a GBM provider, OpenGL or OpenGLES support, toolchain w/threads"
+	depends on !BR2_PACKAGE_HAS_LIBGBM || \
+		!(BR2_PACKAGE_SDL2_OPENGL || BR2_PACKAGE_SDL2_OPENGLES) || \
+		BR2_PACKAGE_HAS_LIBEGL || \
+		BR2_TOOLCHAIN_HAS_THREADS
 
 config BR2_PACKAGE_SDL2_OPENGL
 	bool "OpenGL (GLX)"
diff --git a/package/sdl2/sdl2.mk b/package/sdl2/sdl2.mk
index c5e7968cec..b5e09b6078 100644
--- a/package/sdl2/sdl2.mk
+++ b/package/sdl2/sdl2.mk
@@ -169,7 +169,7 @@ SDL2_CONF_OPTS += --disable-alsa
 endif
 
 ifeq ($(BR2_PACKAGE_SDL2_KMSDRM),y)
-SDL2_DEPENDENCIES += libdrm mesa3d
+SDL2_DEPENDENCIES += libdrm libgbm libegl
 SDL2_CONF_OPTS += --enable-video-kmsdrm
 else
 SDL2_CONF_OPTS += --disable-video-kmsdrm
-- 
2.37.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2022-08-04 22:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04 22:15 [Buildroot] [PATCH 1/3] package/sdl2: be more explicit in disabling optional features Thomas Petazzoni via buildroot
2022-08-04 22:15 ` [Buildroot] [PATCH 2/3] package/sdl2: be explicit about OpenGL ES options Thomas Petazzoni via buildroot
2022-08-20  8:10   ` Yann E. MORIN
2022-08-04 22:15 ` Thomas Petazzoni via buildroot [this message]
2022-08-20  8:12   ` [Buildroot] [PATCH 3/3] package/sdl2: rework KMS/DRM video driver dependencies Yann E. MORIN
2022-08-22 15:01   ` Yann E. MORIN
2022-08-20  8:10 ` [Buildroot] [PATCH 1/3] package/sdl2: be more explicit in disabling optional features Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220804221559.46394-3-thomas.petazzoni@bootlin.com \
    --to=buildroot@buildroot.org \
    --cc=mf@go-sys.de \
    --cc=thomas.petazzoni@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox