Skip to content

Commit

Permalink
vo_opengl: add DRM EGL backend
Browse files Browse the repository at this point in the history
Notes:

- Unfortunately the only way to talk to EGL from within DRM I could find
  involves linking with GBM (generic buffer management for Mesa.)
  Because of this, I'm pretty sure it won't work with proprietary NVidia
  drivers, but then again, last time I checked NVidia didn't offer
  proper screen resolution for VT.

- VT switching doesn't seem to work at all. It's worth mentioning that
  using vo_drm before introduction of VT switcher had an anomaly where
  user could switch to another VT and input text to it, while video
  played on top of that VT. However, that isn't the case with drm_egl:
  I can't switch to other VT during playback like this. This makes me
  think that it's either a limitation coming from my firmware or from
  EGL/KMS itself rather than a bug with my code. Nonetheless, I still
  left (untestable) VT switching code in place, in case it's useful to
  someone else.

- The mode_id, connector_id and device_path should be configurable for
  power users and people who wish to watch videos on nonprimary screen.
  Unfortunately I didn't see anything that would allow OpenGL backends
  to register their own set of options. At the same time, adding them to
  global namespace is pointless.

- A few dozens of lines could be shared with vo_drm (setting up VT
  switching, most of code behind page flipping). I don't have any strong
  opinion on this.

- Sometimes I get minor visual glitches. I'm not sure if there's a race
  condition of some sort, unitialized variable (doubtful), or if it's
  buggy driver. (I'm using integrated Intel HD Graphics 4400 with Mesa)

- .config and .control are very minimal.

Signed-off-by: wm4 <wm4@nowhere>
  • Loading branch information
rr- authored and wm4 committed Nov 8, 2015
1 parent 67caea3 commit c3f2ef5
Show file tree
Hide file tree
Showing 6 changed files with 467 additions and 8 deletions.
7 changes: 5 additions & 2 deletions DOCS/man/vo.rst
Expand Up @@ -778,6 +778,8 @@ Available video output drivers are:
X11/GLX
wayland
Wayland/EGL
drm_egl
DRM/EGL
x11egl
X11/EGL

Expand Down Expand Up @@ -1134,8 +1136,9 @@ Available video output drivers are:

``drm`` (Direct Rendering Manager)
Video output driver using Kernel Mode Setting / Direct Rendering Manager.
Does not support hardware acceleration. Should be used when one doesn't
want to install full-blown graphical environment (e.g. no X).
Should be used when one doesn't want to install full-blown graphical
environment (e.g. no X). Does not support hardware acceleration (if you
need this, check ``drm_egl`` backend for ``opengl`` VO).

``connector=<number>``
Select the connector to use (usually this is a monitor.) If set to -1,
Expand Down
1 change: 1 addition & 0 deletions TOOLS/old-configure
Expand Up @@ -970,6 +970,7 @@ cat > $TMPC << EOF
#define HAVE_RPI_GLES 0
#define HAVE_AV_PIX_FMT_MMAL 0
#define HAVE_DRM 0
#define HAVE_EGL_DRM 0
#define HAVE_VIDEOTOOLBOX_HWACCEL 0
#define HAVE_VIDEOTOOLBOX_GL 0
#define HAVE_SSE4_INTRINSICS 1
Expand Down
4 changes: 4 additions & 0 deletions video/out/opengl/common.c
Expand Up @@ -507,6 +507,7 @@ void mpgl_load_functions(GL *gl, void *(*getProcAddress)(const GLubyte *),

extern const struct mpgl_driver mpgl_driver_x11;
extern const struct mpgl_driver mpgl_driver_x11egl;
extern const struct mpgl_driver mpgl_driver_drm_egl;
extern const struct mpgl_driver mpgl_driver_cocoa;
extern const struct mpgl_driver mpgl_driver_wayland;
extern const struct mpgl_driver mpgl_driver_w32;
Expand All @@ -528,6 +529,9 @@ static const struct mpgl_driver *const backends[] = {
#if HAVE_EGL_X11
&mpgl_driver_x11egl,
#endif
#if HAVE_EGL_DRM
&mpgl_driver_drm_egl,
#endif
#if HAVE_GL_X11
&mpgl_driver_x11,
#endif
Expand Down

0 comments on commit c3f2ef5

Please sign in to comment.