Skip to content

libs: display: drm: fix set_device_path_from_fd

Haihao Xiang requested to merge haihao/gstreamer-vaapi:fix-drm-display into master

drmGetBusid() (GET_UNIQUE ioctl) won't return a valid bus id when drmSetInterfaceVersion() (SET_VERSION ioctl) hasn't been called(see[1]), so we can't get the right device path. Running test-display will get the error below:

** (test-display:18630): ERROR **: 10:26:00.434: could not create Gst/VA display

Calling drmSetInterfaceVersion() before drmGetBusid() can't fix this issue because a special permission is required for SET_VERSION ioctl.

This patch retrieves the device path from file descriptor via g_file_read_link()

[1] https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/drm_ioctl.c#L48-L104

Edited by Haihao Xiang

Merge request reports