From: Emil Velikov <[email protected]>

Since the VAAPI provides distinction between generic failure and
UNIMPLEMENTED we need to add a bit of ifdef guards through the code.

Note: current wayland support is partial (it does not implement
va_GetSurfaceBufferWl and va_GetImageBufferWl) thus effectively it is
identical to the DRM one.

Cc: Leo Liu <[email protected]>
Cc: "Guttula, Suresh" <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
---
Note: we _must_ keep the build specifics separate as a follow-up
otherwise we'll break the other VL based targets.

Not too happy with the ifdef spagetti and the whole thing overall, so
any suggestions will be greatly appreciated.
---
 src/gallium/state_trackers/va/context.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/gallium/state_trackers/va/context.c 
b/src/gallium/state_trackers/va/context.c
index d52f95e..0f18399 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -117,6 +117,10 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
       return VA_STATUS_ERROR_UNIMPLEMENTED;
    case VA_DISPLAY_GLX:
    case VA_DISPLAY_X11:
+#ifndef HAVE_PLATFORM_X11
+      FREE(drv);
+      return VA_STATUS_ERROR_UNIMPLEMENTED;
+#endif
 #if defined(HAVE_DRI3)
       drv->vscreen = vl_dri3_screen_create(ctx->native_dpy, ctx->x11_screen);
 #endif
@@ -128,6 +132,10 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
    case VA_DISPLAY_WAYLAND:
    case VA_DISPLAY_DRM:
    case VA_DISPLAY_DRM_RENDERNODES: {
+#if !defined(HAVE_PLATFORM_WAYLAND) && !defined(HAVE_PLATFORM_DRM)
+      FREE(drv);
+      return VA_STATUS_ERROR_UNIMPLEMENTED;
+#endif
       const struct drm_state *drm_info = (struct drm_state *) ctx->drm_state;
 
       if (!drm_info || drm_info->fd < 0) {
-- 
2.10.2

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to