Commit ef1df630 authored by Emil Velikov's avatar Emil Velikov Committed by Emil Velikov

st/mesa: provide static inline st_init_vdpau_functions

The ifdef spaghetty in st_vdpau.c is rather confusing and misleading.
Simplily it by introducing a static inline helper noop (when
HAVE_ST_VDPAU is not defined) in the header.
Signed-off-by: default avatarEmil Velikov <emil.velikov@collabora.com>
Acked-by: Christian König's avatarChristian König <christian.koenig@amd.com>
parent 33e6e5e6
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
* *
*/ */
#ifdef HAVE_ST_VDPAU
#include "main/texobj.h" #include "main/texobj.h"
#include "main/teximage.h" #include "main/teximage.h"
#include "main/errors.h" #include "main/errors.h"
...@@ -48,8 +50,6 @@ ...@@ -48,8 +50,6 @@
#include "st_format.h" #include "st_format.h"
#include "st_cb_flush.h" #include "st_cb_flush.h"
#ifdef HAVE_ST_VDPAU
#include "state_tracker/vdpau_interop.h" #include "state_tracker/vdpau_interop.h"
#include "state_tracker/vdpau_dmabuf.h" #include "state_tracker/vdpau_dmabuf.h"
#include "state_tracker/vdpau_funcs.h" #include "state_tracker/vdpau_funcs.h"
...@@ -268,13 +268,10 @@ st_vdpau_unmap_surface(struct gl_context *ctx, GLenum target, GLenum access, ...@@ -268,13 +268,10 @@ st_vdpau_unmap_surface(struct gl_context *ctx, GLenum target, GLenum access,
st_flush(st, NULL, 0); st_flush(st, NULL, 0);
} }
#endif
void void
st_init_vdpau_functions(struct dd_function_table *functions) st_init_vdpau_functions(struct dd_function_table *functions)
{ {
#ifdef HAVE_ST_VDPAU
functions->VDPAUMapSurface = st_vdpau_map_surface; functions->VDPAUMapSurface = st_vdpau_map_surface;
functions->VDPAUUnmapSurface = st_vdpau_unmap_surface; functions->VDPAUUnmapSurface = st_vdpau_unmap_surface;
#endif
} }
#endif
...@@ -36,7 +36,12 @@ ...@@ -36,7 +36,12 @@
struct dd_function_table; struct dd_function_table;
#ifdef HAVE_ST_VDPAU
extern void extern void
st_init_vdpau_functions(struct dd_function_table *functions); st_init_vdpau_functions(struct dd_function_table *functions);
#else
static inline void
st_init_vdpau_functions(struct dd_function_table *functions) {}
#endif
#endif /* ST_VDPAU_H */ #endif /* ST_VDPAU_H */
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