diff options
author | Emil Velikov <emil.l.velikov@gmail.com> | 2021-07-25 19:05:36 +0100 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2021-10-15 19:00:34 +0200 |
commit | 899dae41f3df6ef646cb7746bf9c9134410b19da (patch) | |
tree | 537dff61a66d95e95b505b2db59f4210b3a993f4 | |
parent | e16d0dd15d447921c34528df2a363e6afbb8288b (diff) | |
download | mpv-899dae41f3df6ef646cb7746bf9c9134410b19da.tar.bz2 mpv-899dae41f3df6ef646cb7746bf9c9134410b19da.tar.xz |
context_drm_egl: re-enable drmSet/DropMaster calls
The ioctls were disabled a while back since they error out and allegedly
cause problem with X running in another VT.
Omitting the ioctls is not cool, even as a workaround.
If they fail, the user is supposed to fallback appropriately - use a suid
wrapper, logind-like daemon or otherwise.
As of kernel 5.10, they should just work in nearly all cases, so let's
just reinstate the calls.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
-rw-r--r-- | video/out/opengl/context_drm_egl.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/video/out/opengl/context_drm_egl.c b/video/out/opengl/context_drm_egl.c index 6a74a841da..fe87f5ccc4 100644 --- a/video/out/opengl/context_drm_egl.c +++ b/video/out/opengl/context_drm_egl.c @@ -44,8 +44,6 @@ #define EGL_PLATFORM_GBM_KHR 0x31D7 #endif -#define USE_MASTER 0 - #ifndef EGL_EXT_platform_base typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list); @@ -423,15 +421,11 @@ static void release_vt(void *data) struct ra_ctx *ctx = data; MP_VERBOSE(ctx->vo, "Releasing VT\n"); crtc_release(ctx); - if (USE_MASTER) { - //this function enables support for switching to x, weston etc. - //however, for whatever reason, it can be called only by root users. - //until things change, this is commented. - struct priv *p = ctx->priv; - if (drmDropMaster(p->kms->fd)) { - MP_WARN(ctx->vo, "Failed to drop DRM master: %s\n", - mp_strerror(errno)); - } + + const struct priv *p = ctx->priv; + if (drmDropMaster(p->kms->fd)) { + MP_WARN(ctx->vo, "Failed to drop DRM master: %s\n", + mp_strerror(errno)); } } @@ -439,12 +433,11 @@ static void acquire_vt(void *data) { struct ra_ctx *ctx = data; MP_VERBOSE(ctx->vo, "Acquiring VT\n"); - if (USE_MASTER) { - struct priv *p = ctx->priv; - if (drmSetMaster(p->kms->fd)) { - MP_WARN(ctx->vo, "Failed to acquire DRM master: %s\n", - mp_strerror(errno)); - } + + const struct priv *p = ctx->priv; + if (drmSetMaster(p->kms->fd)) { + MP_WARN(ctx->vo, "Failed to acquire DRM master: %s\n", + mp_strerror(errno)); } crtc_setup(ctx); |