Commit a3797ea8 authored by Mathieu Velten's avatar Mathieu Velten Committed by Rémi Denis-Courmont

vaapi-drm: try the render node before the card node

This patch make it work with Wayland on Fedora 25.
Signed-off-by: Rémi Denis-Courmont's avatarRémi Denis-Courmont <remi@remlab.net>
parent 2570c6ce
......@@ -356,14 +356,23 @@ static int Create( vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
sys->hw_ctx.display = vaGetDisplay(sys->p_display_x11);
#endif
#ifdef VLC_VA_BACKEND_DRM
sys->drm_fd = vlc_open("/dev/dri/card0", O_RDWR);
if( sys->drm_fd == -1 )
{
msg_Err( va, "Could not access rendering device: %m" );
goto error;
}
static const char const *drm_device_paths[] = {
"/dev/dri/renderD128",
"/dev/dri/card0"
};
for (int i = 0; ARRAY_SIZE(drm_device_paths); i++) {
sys->drm_fd = vlc_open(drm_device_paths[i], O_RDWR);
if (sys->drm_fd < 0)
continue;
sys->hw_ctx.display = vaGetDisplayDRM(sys->drm_fd);
sys->hw_ctx.display = vaGetDisplayDRM(sys->drm_fd);
if (sys->hw_ctx.display)
break;
vlc_close(sys->drm_fd);
sys->drm_fd = -1;
}
#endif
if (sys->hw_ctx.display == NULL)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment