[vlc-commits] [Git][videolan/vlc][master] 2 commits: configure: rename KMS to LIBDRM

Rémi Denis-Courmont (@Courmisch) gitlab at videolan.org
Thu Jun 2 15:46:11 UTC 2022



Rémi Denis-Courmont pushed to branch master at VideoLAN / VLC


Commits:
5ec6bca0 by Rémi Denis-Courmont at 2022-06-02T15:19:11+00:00
configure: rename KMS to LIBDRM

KMS is a subset of kernel interface. What is tested there is the
presence of libdrm development files.

- - - - -
17db49c1 by Rémi Denis-Courmont at 2022-06-02T15:19:11+00:00
drm: fix build without libdrm

The display module does not actually depend on libdrm in any way.
It can be compiled with just the Linux kernel headers, so do just that.

- - - - -


7 changed files:

- configure.ac
- modules/video_output/Makefile.am
- modules/video_output/drm/buffers.c
- modules/video_output/drm/display.c
- modules/video_output/drm/fourcc.c
- modules/video_output/drm/planes.c
- modules/video_output/opengl/Makefile.am


Changes:

=====================================
configure.ac
=====================================
@@ -3526,9 +3526,16 @@ AC_CHECK_HEADER([linux/fb.h], [
 ])
 
 dnl
-dnl  Linux kernel mode setting module
+dnl  Direct Rendering Manager (DRM) plugins
 dnl
-PKG_HAVE_WITH_MODULES([KMS], [libdrm >= 2.4.83], [Linux kernel mode setting output], [auto])
+AC_CHECK_HEADER([drm/drm_mode.h], [
+  have_drm="yes"
+], [
+  have_drm="no"
+])
+AM_CONDITIONAL([HAVE_DRM], [test "$have_drm" = "yes"])
+
+PKG_HAVE_WITH_MODULES([LIBDRM], [libdrm >= 2.4.83], [Linux kernel mode setting output], [auto])
 
 dnl
 dnl  libcaca plugin


=====================================
modules/video_output/Makefile.am
=====================================
@@ -312,11 +312,11 @@ EXTRA_LTLIBRARIES += libfb_plugin.la
 vout_LTLIBRARIES += $(LTLIBfb)
 
 
-### Kernel Mode Setting ###
+### Direct Rendering Manager (DRM) ###
 
 libkms_plugin_la_SOURCES = video_output/kms.c
-libkms_plugin_la_CFLAGS = $(AM_CFLAGS) $(KMS_CFLAGS)
-libkms_plugin_la_LIBADD = $(KMS_LIBS)
+libkms_plugin_la_CFLAGS = $(AM_CFLAGS) $(LIBDRM_CFLAGS)
+libkms_plugin_la_LIBADD = $(LIBDRM_LIBS)
 
 libdrm_display_plugin_la_SOURCES = \
 	video_output/drm/vlc_drm.h \
@@ -324,8 +324,12 @@ libdrm_display_plugin_la_SOURCES = \
 	video_output/drm/buffers.c \
 	video_output/drm/planes.c \
 	video_output/drm/display.c
-libdrm_display_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(KMS_CFLAGS)
-if HAVE_KMS
+libdrm_display_plugin_la_CPPFLAGS = $(AM_CPPFLAGS)
+if HAVE_DRM
+vout_LTLIBRARIES += libdrm_display_plugin.la
+endif
+if HAVE_LIBDRM
+libdrm_display_plugin_la_CPPFLAGS += $(LIBDRM_CFLAGS) -DHAVE_LIBDRM
 vout_LTLIBRARIES += libkms_plugin.la libdrm_display_plugin.la
 endif
 


=====================================
modules/video_output/drm/buffers.c
=====================================
@@ -27,8 +27,13 @@
 #include <assert.h>
 #include <stdlib.h>
 #include <sys/mman.h>
-#include <drm_fourcc.h>
-#include <drm_mode.h>
+#ifndef HAVE_LIBDRM
+# include <drm/drm_fourcc.h>
+# include <drm/drm_mode.h>
+#else
+# include <drm_fourcc.h>
+# include <drm_mode.h>
+#endif
 #include <vlc_common.h>
 #include <vlc_picture.h>
 #include "vlc_drm.h"


=====================================
modules/video_output/drm/display.c
=====================================
@@ -33,7 +33,11 @@
 # include "config.h"
 #endif
 
-#include <drm_mode.h>
+#ifndef HAVE_LIBDRM
+# include <drm/drm_mode.h>
+#else
+# include <drm_mode.h>
+#endif
 
 #include <vlc_common.h>
 #include <vlc_plugin.h>


=====================================
modules/video_output/drm/fourcc.c
=====================================
@@ -25,7 +25,11 @@
 #endif
 
 #include <stdint.h>
-#include <drm_fourcc.h>
+#ifndef HAVE_LIBDRM
+# include <drm/drm_fourcc.h>
+#else
+# include <drm_fourcc.h>
+#endif
 #include <vlc_common.h>
 #include <vlc_es.h>
 #include "vlc_drm.h"


=====================================
modules/video_output/drm/planes.c
=====================================
@@ -28,7 +28,11 @@
 #include <errno.h>
 #include <stdlib.h>
 #include <string.h>
-#include <drm_mode.h>
+#ifndef HAVE_LIBDRM
+# include <drm/drm_mode.h>
+#else
+# include <drm_mode.h>
+#endif
 #include <vlc_common.h>
 #include <vlc_fourcc.h>
 #include "vlc_drm.h"


=====================================
modules/video_output/opengl/Makefile.am
=====================================
@@ -165,9 +165,9 @@ endif
 libegl_display_gbm_plugin_la_SOURCES = video_output/opengl/egl_display_gbm.c
 libegl_display_gbm_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(EGL_FLAGS) $(GBM_CFLAGS)
 libegl_display_gbm_plugin_la_LIBADD = $(EGL_LIBS) $(GBM_LIBS)
-if HAVE_KMS
+if HAVE_LIBDRM
 # DRM headers are bringing defines useful for opening DRM devices
-libegl_display_gbm_plugin_la_CPPFLAGS += $(KMS_CFLAGS) -DHAVE_KMS=1
+libegl_display_gbm_plugin_la_CPPFLAGS += $(LIBDRM_CFLAGS) -DHAVE_KMS=1
 endif
 if HAVE_EGL
 if HAVE_GBM



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1e9613f8eaf9cf17010d035d58e91eee6a3f771c...17db49c1bce462a97ad342d0b3dcc61ded258fe1

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/1e9613f8eaf9cf17010d035d58e91eee6a3f771c...17db49c1bce462a97ad342d0b3dcc61ded258fe1
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list