From b4e18fb188cb30bc506b2e426e6e17c75ca3ec8b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 18 Oct 2024 09:03:00 -0400 Subject: [PATCH] vdpau: fail context create if driver does not support video not all drivers support this, and forcing them to implement stubs is not how gallium works cc: mesa-stable Reviewed-by: David Rosca Part-of: --- src/gallium/frontends/vdpau/device.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/frontends/vdpau/device.c b/src/gallium/frontends/vdpau/device.c index 886bab3dc82..a791c67b981 100644 --- a/src/gallium/frontends/vdpau/device.c +++ b/src/gallium/frontends/vdpau/device.c @@ -76,6 +76,12 @@ vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device, } pscreen = dev->vscreen->pscreen; + /* video cannot work if these are not supported */ + if (!pscreen->get_video_param || !pscreen->is_video_format_supported) { + ret = VDP_STATUS_RESOURCES; + goto no_vscreen; + } + dev->context = pipe_create_multimedia_context(pscreen); if (!dev->context) { ret = VDP_STATUS_RESOURCES;