summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov <emil.l.velikov@gmail.com>2021-07-25 19:05:36 +0100
committersfan5 <sfan5@live.de>2021-10-15 19:00:34 +0200
commit0282196f4a3e8c6f0c6613cbd461fcc2f426dca5 (patch)
treee3bdef1f81f2a41e2656c1f0e4226ccf27bcfcdb
parent899dae41f3df6ef646cb7746bf9c9134410b19da (diff)
downloadmpv-0282196f4a3e8c6f0c6613cbd461fcc2f426dca5.tar.bz2
mpv-0282196f4a3e8c6f0c6613cbd461fcc2f426dca5.tar.xz
drm: 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/vo_drm.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/video/out/vo_drm.c b/video/out/vo_drm.c
index a2fada99d1..c0ce1707ff 100644
--- a/video/out/vo_drm.c
+++ b/video/out/vo_drm.c
@@ -45,7 +45,6 @@
#define BYTES_PER_PIXEL 4
#define BITS_PER_PIXEL 32
-#define USE_MASTER 0
struct framebuffer {
uint32_t width;
@@ -255,25 +254,19 @@ static void release_vt(void *data)
{
struct vo *vo = data;
crtc_release(vo);
- 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 = vo->priv;
- if (drmDropMaster(p->kms->fd)) {
- MP_WARN(vo, "Failed to drop DRM master: %s\n", mp_strerror(errno));
- }
+
+ const struct priv *p = vo->priv;
+ if (drmDropMaster(p->kms->fd)) {
+ MP_WARN(vo, "Failed to drop DRM master: %s\n", mp_strerror(errno));
}
}
static void acquire_vt(void *data)
{
struct vo *vo = data;
- if (USE_MASTER) {
- struct priv *p = vo->priv;
- if (drmSetMaster(p->kms->fd)) {
- MP_WARN(vo, "Failed to acquire DRM master: %s\n", mp_strerror(errno));
- }
+ const struct priv *p = vo->priv;
+ if (drmSetMaster(p->kms->fd)) {
+ MP_WARN(vo, "Failed to acquire DRM master: %s\n", mp_strerror(errno));
}
crtc_setup(vo);