From c239b7de7efbe3e87a9c09922c88e6a88777fb80 Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 27 Sep 2016 16:29:22 +0200 Subject: vo_opengl: deprecate 'drm-egl' backend and introduce 'drm' instead Just a name change. Requested. --- DOCS/man/options.rst | 4 ++-- video/out/opengl/context.c | 2 ++ video/out/opengl/context_drm_egl.c | 20 +++++++++++++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index 41c3f78085..eecf48a636 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -4244,8 +4244,8 @@ The following video options are currently all specific to ``--vo=opengl`` and X11/GLX wayland Wayland/EGL - drm-egl - DRM/EGL + drm + DRM/EGL (``drm-egl`` is a deprecated alias) x11egl X11/EGL mali-fbdev diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c index 32e7c4a3d6..0f5b61e37c 100644 --- a/video/out/opengl/context.c +++ b/video/out/opengl/context.c @@ -38,6 +38,7 @@ extern const struct mpgl_driver mpgl_driver_x11; extern const struct mpgl_driver mpgl_driver_x11egl; extern const struct mpgl_driver mpgl_driver_x11_probe; extern const struct mpgl_driver mpgl_driver_drm_egl; +extern const struct mpgl_driver mpgl_driver_drm; extern const struct mpgl_driver mpgl_driver_cocoa; extern const struct mpgl_driver mpgl_driver_wayland; extern const struct mpgl_driver mpgl_driver_w32; @@ -77,6 +78,7 @@ static const struct mpgl_driver *const backends[] = { &mpgl_driver_x11, #endif #if HAVE_EGL_DRM + &mpgl_driver_drm, &mpgl_driver_drm_egl, #endif #if HAVE_MALI_FBDEV diff --git a/video/out/opengl/context_drm_egl.c b/video/out/opengl/context_drm_egl.c index 07624ccaf3..ef7a0b598b 100644 --- a/video/out/opengl/context_drm_egl.c +++ b/video/out/opengl/context_drm_egl.c @@ -348,6 +348,14 @@ static int drm_egl_init(struct MPGLContext *ctx, int flags) return 0; } +static int drm_egl_init_deprecated(struct MPGLContext *ctx, int flags) +{ + if (ctx->vo->probing) + return -1; + MP_WARN(ctx->vo, "'drm-egl' is deprecated, use 'drm' instead.\n"); + return drm_egl_init(ctx, flags); +} + static int drm_egl_reconfig(struct MPGLContext *ctx) { struct priv *p = ctx->priv; @@ -405,10 +413,20 @@ static void drm_egl_swap_buffers(MPGLContext *ctx) p->gbm.bo = p->gbm.next_bo; } +const struct mpgl_driver mpgl_driver_drm = { + .name = "drm", + .priv_size = sizeof(struct priv), + .init = drm_egl_init, + .reconfig = drm_egl_reconfig, + .swap_buffers = drm_egl_swap_buffers, + .control = drm_egl_control, + .uninit = drm_egl_uninit, +}; + const struct mpgl_driver mpgl_driver_drm_egl = { .name = "drm-egl", .priv_size = sizeof(struct priv), - .init = drm_egl_init, + .init = drm_egl_init_deprecated, .reconfig = drm_egl_reconfig, .swap_buffers = drm_egl_swap_buffers, .control = drm_egl_control, -- cgit v1.2.3