1
0
mirror of https://github.com/jojo61/vdr-plugin-softhdcuvid.git synced 2023-10-10 13:37:41 +02:00

No root for softhddrm needed anymore

This commit is contained in:
jojo61 2020-05-07 10:53:51 +02:00
parent 3578e3212d
commit cb466dd894

22
drm.c
View File

@ -240,8 +240,28 @@ static int FindDevice(VideoRender * render)
fprintf(stderr, "FindDevice: cannot open /dev/dri/card0: %m\n");
return -errno;
}
drmSetMaster(render->fd_drm);
int ret = drmSetMaster(render->fd_drm);
if (ret < 0)
{
drm_magic_t magic;
ret = drmGetMagic(render->fd_drm, &magic);
if (ret < 0)
{
Debug(3, "drm:%s - failed to get drm magic: %s\n", __FUNCTION__, strerror(errno));
return -1;
}
ret = drmAuthMagic(render->fd_drm, magic);
if (ret < 0)
{
Debug(3, "drm:%s - failed to authorize drm magic: %s\n", __FUNCTION__, strerror(errno));
return -1;
}
}
version = drmGetVersion(render->fd_drm);
fprintf(stderr, "FindDevice: open /dev/dri/card0: %s\n", version->name);