mesa/st/vdpau: direct call the vdpau functions.

This provides versions when vdpau is turned off, removes dd.h entries

Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14632>
This commit is contained in:
Dave Airlie
2021-12-20 14:37:08 +10:00
committed by Marge Bot
parent 0f8a3a7175
commit a64e5c02bd
5 changed files with 30 additions and 36 deletions
-14
View File
@@ -236,20 +236,6 @@ struct dd_function_table {
/**@}*/
/**
* \name NV_vdpau_interop interface
*/
void (*VDPAUMapSurface)(struct gl_context *ctx, GLenum target,
GLenum access, GLboolean output,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
const GLvoid *vdpSurface, GLuint index);
void (*VDPAUUnmapSurface)(struct gl_context *ctx, GLenum target,
GLenum access, GLboolean output,
struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
const GLvoid *vdpSurface, GLuint index);
/**
* Query reset status for GL_ARB_robustness
*
+7 -6
View File
@@ -42,6 +42,7 @@
#include "api_exec_decl.h"
#include "state_tracker/st_cb_texture.h"
#include "state_tracker/st_vdpau.h"
#define MAX_TEXTURES 4
@@ -381,9 +382,9 @@ _mesa_VDPAUMapSurfacesNV(GLsizei numSurfaces, const GLintptr *surfaces)
st_FreeTextureImageBuffer(ctx, image);
ctx->Driver.VDPAUMapSurface(ctx, surf->target, surf->access,
surf->output, tex, image,
surf->vdpSurface, j);
st_vdpau_map_surface(ctx, surf->target, surf->access,
surf->output, tex, image,
surf->vdpSurface, j);
_mesa_unlock_texture(ctx, tex);
}
@@ -429,9 +430,9 @@ _mesa_VDPAUUnmapSurfacesNV(GLsizei numSurfaces, const GLintptr *surfaces)
image = _mesa_select_tex_image(tex, surf->target, 0);
ctx->Driver.VDPAUUnmapSurface(ctx, surf->target, surf->access,
surf->output, tex, image,
surf->vdpSurface, j);
st_vdpau_unmap_surface(ctx, surf->target, surf->access,
surf->output, tex, image,
surf->vdpSurface, j);
if (image)
st_FreeTextureImageBuffer(ctx, image);
-3
View File
@@ -57,7 +57,6 @@
#include "st_program.h"
#include "st_sampler_view.h"
#include "st_shader_cache.h"
#include "st_vdpau.h"
#include "st_texture.h"
#include "st_util.h"
#include "pipe/p_context.h"
@@ -834,8 +833,6 @@ st_init_driver_functions(struct pipe_screen *screen,
st_init_program_functions(functions);
st_init_flush_functions(screen, functions);
st_init_vdpau_functions(functions);
/* GL_ARB_get_program_binary */
enum pipe_shader_ir preferred_ir = (enum pipe_shader_ir)
screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
+2 -8
View File
@@ -181,7 +181,7 @@ st_vdpau_video_surface_dma_buf(struct gl_context *ctx, const void *vdpSurface,
return st_vdpau_resource_from_description(ctx, &desc);
}
static void
void
st_vdpau_map_surface(struct gl_context *ctx, GLenum target, GLenum access,
GLboolean output, struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
@@ -257,7 +257,7 @@ st_vdpau_map_surface(struct gl_context *ctx, GLenum target, GLenum access,
pipe_resource_reference(&res, NULL);
}
static void
void
st_vdpau_unmap_surface(struct gl_context *ctx, GLenum target, GLenum access,
GLboolean output, struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
@@ -280,10 +280,4 @@ st_vdpau_unmap_surface(struct gl_context *ctx, GLenum target, GLenum access,
st_flush(st, NULL, 0);
}
void
st_init_vdpau_functions(struct dd_function_table *functions)
{
functions->VDPAUMapSurface = st_vdpau_map_surface;
functions->VDPAUUnmapSurface = st_vdpau_unmap_surface;
}
#endif
+21 -5
View File
@@ -34,14 +34,30 @@
#ifndef ST_VDPAU_H
#define ST_VDPAU_H
struct dd_function_table;
#ifdef HAVE_ST_VDPAU
extern void
st_init_vdpau_functions(struct dd_function_table *functions);
void
st_vdpau_map_surface(struct gl_context *ctx, GLenum target, GLenum access,
GLboolean output, struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
const void *vdpSurface, GLuint index);
void
st_vdpau_unmap_surface(struct gl_context *ctx, GLenum target, GLenum access,
GLboolean output, struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
const void *vdpSurface, GLuint index);
#else
static inline void
st_init_vdpau_functions(struct dd_function_table *functions) {}
st_vdpau_map_surface(struct gl_context *ctx, GLenum target, GLenum access,
GLboolean output, struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
const void *vdpSurface, GLuint index) {}
static inline void
st_vdpau_unmap_surface(struct gl_context *ctx, GLenum target, GLenum access,
GLboolean output, struct gl_texture_object *texObj,
struct gl_texture_image *texImage,
const void *vdpSurface, GLuint index) {}
#endif
#endif /* ST_VDPAU_H */