[Mesa-dev] [PATCH 12/28] st/va: honor the platform selection at configure time
Emil Velikov
emil.l.velikov at gmail.com
Thu Dec 8 20:00:01 UTC 2016
From: Emil Velikov <emil.velikov at collabora.com>
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 <leo.liu at amd.com>
Cc: "Guttula, Suresh" <Suresh.Guttula at amd.com>
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
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
More information about the mesa-dev
mailing list