uterm: drm: fix device-detection if no master is active
If we try to detect a device name if no master is active, the drmGetBusid() call will always return an empty string. Therefore, try to become drm-master and set the correct interface version before doing this. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
parent
150f976b64
commit
0eb8d17590
@ -422,9 +422,18 @@ static inline int video_do_use(struct uterm_video *video)
|
||||
|
||||
static inline char *video_drm_get_id(int fd)
|
||||
{
|
||||
drmSetVersion v = {
|
||||
.drm_di_major = 1,
|
||||
.drm_di_minor = 4,
|
||||
.drm_dd_major = -1,
|
||||
.drm_dd_minor = -1,
|
||||
};
|
||||
|
||||
if (fd < 0)
|
||||
return NULL;
|
||||
|
||||
drmSetMaster(fd);
|
||||
drmSetInterfaceVersion(fd, &v);
|
||||
return drmGetBusid(fd);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user