Skip to content
Snippets Groups Projects
Commit 1735bf9d authored by Alexandre Janniaux's avatar Alexandre Janniaux Committed by Rémi Denis-Courmont
Browse files

opengl: egl_gbm: use DRM_DIR_NAME for path

DRM_DIR_NAME can be different, for instance on OpenBSD, and the correct
location is defined by the xf86drm.h header.

This is commit 6218609a resent after
revert from 0b8ce0dd and a design
preventing failure if headers are missing or broken.
parent 9de43f94
No related branches found
No related tags found
1 merge request!1197opengl: egl_gbm: use DRM_DIR_NAME for path
Pipeline #182386 failed with stage
in 1 hour, 24 minutes, and 45 seconds
......@@ -165,6 +165,10 @@ 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
# DRM headers are bringing defines useful for opening DRM devices
libegl_display_gbm_plugin_la_CPPFLAGS += $(KMS_CFLAGS) -DHAVE_KMS=1
endif
if HAVE_EGL
if HAVE_GBM
vout_LTLIBRARIES += libegl_display_gbm_plugin.la
......
......@@ -31,8 +31,13 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <gbm.h>
#ifdef HAVE_KMS
#include <xf86drm.h>
#endif
#include "egl_display.h"
struct sys
......@@ -57,11 +62,22 @@ static void Close(struct vlc_egl_display *display)
static int
OpenDeviceFd(const char **out_path)
{
/* Usually, /dev/dri/renderD* or /dev/dri/card* on Linux */
static const char *default_drm_device_paths[] = {
#if defined(HAVE_KMS)
/* OpenBSD has moved to Linux file path for DRM. libdrm defines will
* provide the correct path, but otherwise we'll always fallback to
* the standard path for Linux. */
DRM_DIR_NAME "/" DRM_RENDER_MINOR_NAME "128",
DRM_DIR_NAME "/" DRM_PRIMARY_MINOR_NAME "0",
DRM_DIR_NAME "/" DRM_RENDER_MINOR_NAME "129",
DRM_DIR_NAME "/" DRM_PRIMARY_MINOR_NAME "1",
#else
"/dev/dri/renderD128",
"/dev/dri/card0",
"/dev/dri/renderD129",
"/dev/dri/card1",
#endif
};
for (size_t i = 0; i < ARRAY_SIZE(default_drm_device_paths); ++i)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment