From 4cbb20c59c5fcf56e2aa57e960dcd2a61cc7af5d Mon Sep 17 00:00:00 2001 From: Thong Thai Date: Thu, 19 Mar 2026 18:23:49 +0000 Subject: [PATCH] frontends/va: decode only stubs Stub VA functions to allow for code for different encode/decode codecs to be excluded from the build, along with for allowing to build without shader code. Signed-off-by: Thong Thai Reviewed-by: David Rosca Part-of: --- src/gallium/frontends/va/meson.build | 25 ++- src/gallium/frontends/va/subpicture.c | 213 ++++++++++++++++++ src/gallium/frontends/va/surface.c | 213 ------------------ src/gallium/frontends/va/va_private.h | 303 +++++++++++--------------- 4 files changed, 355 insertions(+), 399 deletions(-) diff --git a/src/gallium/frontends/va/meson.build b/src/gallium/frontends/va/meson.build index dab8fd99db5..eb0e4f1f17e 100644 --- a/src/gallium/frontends/va/meson.build +++ b/src/gallium/frontends/va/meson.build @@ -1,12 +1,21 @@ # Copyright © 2017-2019 Intel Corporation # SPDX-License-Identifier: MIT +libva_c_args = [ + '-DVA_DRIVER_INIT_FUNC=__vaDriverInit_@0@_@1@'.format( + libva_version[0], libva_version[1] + ) +] + libva_files = files( 'buffer.c', 'config.c', 'context.c', 'display.c', - 'picture.c', 'surface.c', 'decode.c', - 'image.c', 'postproc.c', 'subpicture.c' + 'picture.c', 'surface.c', 'decode.c', 'image.c' ) +if with_gfx_compute + libva_files += files('postproc.c', 'subpicture.c') +endif + if _codecs.contains('jpegdec') libva_files += files('picture_mjpeg.c') endif @@ -32,31 +41,23 @@ if _codecs.contains('av1dec') libva_files += files('picture_av1.c') endif -has_encode = false if _codecs.contains('h264enc') libva_files += files('picture_h264_enc.c') - has_encode = true endif if _codecs.contains('h265enc') libva_files += files('picture_hevc_enc.c') - has_encode = true endif if _codecs.contains('av1enc') libva_files += files('picture_av1_enc.c') - has_encode = true endif -if has_encode +if with_video_encode libva_files += files('encode.c') endif libva_st = static_library( 'va_st', libva_files, - c_args : [ - '-DVA_DRIVER_INIT_FUNC=__vaDriverInit_@0@_@1@'.format( - libva_version[0], libva_version[1] - ), - ], + c_args : libva_c_args, gnu_symbol_visibility : 'hidden', include_directories : [inc_include, inc_src, inc_gallium, inc_gallium_aux], dependencies : [ diff --git a/src/gallium/frontends/va/subpicture.c b/src/gallium/frontends/va/subpicture.c index 06898966411..11cecfa08c1 100644 --- a/src/gallium/frontends/va/subpicture.c +++ b/src/gallium/frontends/va/subpicture.c @@ -29,6 +29,8 @@ #include "util/u_memory.h" #include "util/u_handle_table.h" #include "util/u_sampler.h" +#include "util/u_surface.h" +#include "vl/vl_winsys.h" #include "va_private.h" @@ -61,6 +63,217 @@ vlVaQuerySubpictureFormats(VADriverContextP ctx, VAImageFormat *format_list, return VA_STATUS_SUCCESS; } +static void +upload_sampler(struct pipe_context *pipe, struct pipe_sampler_view *dst, + const struct pipe_box *dst_box, const void *src, unsigned src_stride, + unsigned src_x, unsigned src_y) +{ + struct pipe_transfer *transfer; + void *map; + + map = pipe->texture_map(pipe, dst->texture, 0, PIPE_MAP_WRITE, + dst_box, &transfer); + if (!map) + return; + + util_copy_rect(map, dst->texture->format, transfer->stride, 0, 0, + dst_box->width, dst_box->height, + src, src_stride, src_x, src_y); + + pipe->texture_unmap(pipe, transfer); +} + +static VAStatus +vlVaPutSubpictures(vlVaSurface *surf, vlVaDriver *drv, + struct pipe_surface *surf_draw, struct u_rect *dirty_area, + struct u_rect *src_rect, struct u_rect *dst_rect) +{ + vlVaSubpicture *sub; + int i; + + for (i = 0; i < surf->subpics.size/sizeof(vlVaSubpicture *); i++) { + struct pipe_blend_state blend; + void *blend_state = NULL; + vlVaBuffer *buf; + struct pipe_box box; + struct u_rect *s, *d, sr, dr, c; + int sw, sh, dw, dh; + + sub = ((vlVaSubpicture **)surf->subpics.data)[i]; + if (!sub) + continue; + + buf = handle_table_get(drv->htab, sub->image->buf); + if (!buf) + return VA_STATUS_ERROR_INVALID_IMAGE; + + box.x = 0; + box.y = 0; + box.z = 0; + box.width = sub->dst_rect.x1 - sub->dst_rect.x0; + box.height = sub->dst_rect.y1 - sub->dst_rect.y0; + box.depth = 1; + + s = &sub->src_rect; + d = &sub->dst_rect; + sw = s->x1 - s->x0; + sh = s->y1 - s->y0; + dw = d->x1 - d->x0; + dh = d->y1 - d->y0; + c.x0 = MAX2(d->x0, s->x0); + c.y0 = MAX2(d->y0, s->y0); + c.x1 = MIN2(d->x0 + dw, src_rect->x1); + c.y1 = MIN2(d->y0 + dh, src_rect->y1); + sr.x0 = s->x0 + (c.x0 - d->x0)*(sw/(float)dw); + sr.y0 = s->y0 + (c.y0 - d->y0)*(sh/(float)dh); + sr.x1 = s->x0 + (c.x1 - d->x0)*(sw/(float)dw); + sr.y1 = s->y0 + (c.y1 - d->y0)*(sh/(float)dh); + + s = src_rect; + d = dst_rect; + sw = s->x1 - s->x0; + sh = s->y1 - s->y0; + dw = d->x1 - d->x0; + dh = d->y1 - d->y0; + dr.x0 = d->x0 + c.x0*(dw/(float)sw); + dr.y0 = d->y0 + c.y0*(dh/(float)sh); + dr.x1 = d->x0 + c.x1*(dw/(float)sw); + dr.y1 = d->y0 + c.y1*(dh/(float)sh); + + vl_compositor_clear_layers(&drv->cstate); + if (drv->pipe->create_blend_state) { + memset(&blend, 0, sizeof(blend)); + blend.independent_blend_enable = 0; + blend.rt[0].blend_enable = 1; + blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_SRC_ALPHA; + blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA; + blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ZERO; + blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO; + blend.rt[0].rgb_func = PIPE_BLEND_ADD; + blend.rt[0].alpha_func = PIPE_BLEND_ADD; + blend.rt[0].colormask = PIPE_MASK_RGBA; + blend.logicop_enable = 0; + blend.logicop_func = PIPE_LOGICOP_CLEAR; + blend.dither = 0; + blend_state = drv->pipe->create_blend_state(drv->pipe, &blend); + vl_compositor_set_layer_blend(&drv->cstate, 0, blend_state, false); + } + upload_sampler(drv->pipe, sub->sampler, &box, buf->data, + sub->image->pitches[0], 0, 0); + vl_compositor_set_rgba_layer(&drv->cstate, &drv->compositor, 0, sub->sampler, + &sr, NULL, NULL); + vl_compositor_set_layer_dst_area(&drv->cstate, 0, &dr); + vl_compositor_render(&drv->cstate, &drv->compositor, surf_draw, dirty_area, false); + if (blend_state) + drv->pipe->delete_blend_state(drv->pipe, blend_state); + } + return VA_STATUS_SUCCESS; +} + +VAStatus +vlVaPutSurface(VADriverContextP ctx, VASurfaceID surface_id, void* draw, short srcx, short srcy, + unsigned short srcw, unsigned short srch, short destx, short desty, + unsigned short destw, unsigned short desth, VARectangle *cliprects, + unsigned int number_cliprects, unsigned int flags) +{ + vlVaDriver *drv; + vlVaSurface *surf; + struct pipe_screen *screen; + struct pipe_resource *tex; + struct pipe_surface surf_templ; + struct vl_screen *vscreen; + struct u_rect src_rect, *dirty_area; + struct u_rect dst_rect = {destx, destx + destw, desty, desty + desth}; + enum pipe_format format; + VAStatus status; + enum pipe_video_vpp_matrix_coefficients coeffs; + enum pipe_video_vpp_color_primaries primaries; + + if (!ctx) + return VA_STATUS_ERROR_INVALID_CONTEXT; + + drv = VL_VA_DRIVER(ctx); + mtx_lock(&drv->mutex); + surf = handle_table_get(drv->htab, surface_id); + if (!surf || !surf->buffer) { + mtx_unlock(&drv->mutex); + return VA_STATUS_ERROR_INVALID_SURFACE; + } + vlVaGetSurfaceBuffer(drv, surf); + + screen = drv->pipe->screen; + vscreen = drv->vscreen; + + tex = vscreen->texture_from_drawable(vscreen, draw); + if (!tex) { + mtx_unlock(&drv->mutex); + return VA_STATUS_ERROR_INVALID_DISPLAY; + } + + dirty_area = vscreen->get_dirty_area(vscreen); + + u_surface_default_template(&surf_templ, tex); + + src_rect.x0 = srcx; + src_rect.y0 = srcy; + src_rect.x1 = srcw + srcx; + src_rect.y1 = srch + srcy; + + format = surf->buffer->buffer_format; + + if (flags & VA_SRC_BT601) { + coeffs = PIPE_VIDEO_VPP_MCF_SMPTE170M; + primaries = PIPE_VIDEO_VPP_PRI_SMPTE170M; + } else { + coeffs = PIPE_VIDEO_VPP_MCF_BT709; + primaries = PIPE_VIDEO_VPP_PRI_BT709; + } + + vl_csc_get_rgbyuv_matrix(coeffs, format, surf_templ.format, + PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_REDUCED, + PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_FULL, &drv->cstate.yuv2rgb); + vl_csc_get_primaries_matrix(primaries, PIPE_VIDEO_VPP_PRI_BT709, &drv->cstate.primaries); + drv->cstate.in_transfer_characteristic = PIPE_VIDEO_VPP_TRC_BT709; + drv->cstate.out_transfer_characteristic = PIPE_VIDEO_VPP_TRC_BT709; + drv->cstate.chroma_location = + VL_COMPOSITOR_LOCATION_HORIZONTAL_LEFT | VL_COMPOSITOR_LOCATION_VERTICAL_CENTER; + + vl_compositor_clear_layers(&drv->cstate); + + if (!util_format_is_yuv(format)) { + struct pipe_sampler_view **views; + + views = surf->buffer->get_sampler_view_planes(surf->buffer); + vl_compositor_set_rgba_layer(&drv->cstate, &drv->compositor, 0, views[0], &src_rect, NULL, NULL); + } else + vl_compositor_set_buffer_layer(&drv->cstate, &drv->compositor, 0, surf->buffer, &src_rect, NULL, VL_COMPOSITOR_WEAVE); + + vl_compositor_set_layer_dst_area(&drv->cstate, 0, &dst_rect); + vl_compositor_render(&drv->cstate, &drv->compositor, &surf_templ, dirty_area, true); + + status = vlVaPutSubpictures(surf, drv, &surf_templ, dirty_area, &src_rect, &dst_rect); + if (status) { + mtx_unlock(&drv->mutex); + return status; + } + + if (drv->pipe->flush_resource) + drv->pipe->flush_resource(drv->pipe, tex); + + /* flush before calling flush_frontbuffer so that rendering is flushed + * to back buffer so the texture can be copied in flush_frontbuffer + */ + vlVaSurfaceFlush(drv, surf); + + screen->flush_frontbuffer(screen, drv->pipe, tex, 0, 0, + vscreen->get_private(vscreen), 0, NULL); + + + pipe_resource_reference(&tex, NULL); + mtx_unlock(&drv->mutex); + return VA_STATUS_SUCCESS; +} + VAStatus vlVaCreateSubpicture(VADriverContextP ctx, VAImageID image, VASubpictureID *subpicture) diff --git a/src/gallium/frontends/va/surface.c b/src/gallium/frontends/va/surface.c index d5293eb168f..fc5ff368e35 100644 --- a/src/gallium/frontends/va/surface.c +++ b/src/gallium/frontends/va/surface.c @@ -33,7 +33,6 @@ #include "util/u_handle_table.h" #include "util/u_rect.h" #include "util/u_sampler.h" -#include "util/u_surface.h" #include "util/u_video.h" #include "util/set.h" @@ -235,218 +234,6 @@ vlVaQuerySurfaceError(VADriverContextP ctx, VASurfaceID render_target, VAStatus return VA_STATUS_ERROR_UNIMPLEMENTED; } -static void -upload_sampler(struct pipe_context *pipe, struct pipe_sampler_view *dst, - const struct pipe_box *dst_box, const void *src, unsigned src_stride, - unsigned src_x, unsigned src_y) -{ - struct pipe_transfer *transfer; - void *map; - - map = pipe->texture_map(pipe, dst->texture, 0, PIPE_MAP_WRITE, - dst_box, &transfer); - if (!map) - return; - - util_copy_rect(map, dst->texture->format, transfer->stride, 0, 0, - dst_box->width, dst_box->height, - src, src_stride, src_x, src_y); - - pipe->texture_unmap(pipe, transfer); -} - -static VAStatus -vlVaPutSubpictures(vlVaSurface *surf, vlVaDriver *drv, - struct pipe_surface *surf_draw, struct u_rect *dirty_area, - struct u_rect *src_rect, struct u_rect *dst_rect) -{ - vlVaSubpicture *sub; - int i; - - for (i = 0; i < surf->subpics.size/sizeof(vlVaSubpicture *); i++) { - struct pipe_blend_state blend; - void *blend_state = NULL; - vlVaBuffer *buf; - struct pipe_box box; - struct u_rect *s, *d, sr, dr, c; - int sw, sh, dw, dh; - - sub = ((vlVaSubpicture **)surf->subpics.data)[i]; - if (!sub) - continue; - - buf = handle_table_get(drv->htab, sub->image->buf); - if (!buf) - return VA_STATUS_ERROR_INVALID_IMAGE; - - box.x = 0; - box.y = 0; - box.z = 0; - box.width = sub->dst_rect.x1 - sub->dst_rect.x0; - box.height = sub->dst_rect.y1 - sub->dst_rect.y0; - box.depth = 1; - - s = &sub->src_rect; - d = &sub->dst_rect; - sw = s->x1 - s->x0; - sh = s->y1 - s->y0; - dw = d->x1 - d->x0; - dh = d->y1 - d->y0; - c.x0 = MAX2(d->x0, s->x0); - c.y0 = MAX2(d->y0, s->y0); - c.x1 = MIN2(d->x0 + dw, src_rect->x1); - c.y1 = MIN2(d->y0 + dh, src_rect->y1); - sr.x0 = s->x0 + (c.x0 - d->x0)*(sw/(float)dw); - sr.y0 = s->y0 + (c.y0 - d->y0)*(sh/(float)dh); - sr.x1 = s->x0 + (c.x1 - d->x0)*(sw/(float)dw); - sr.y1 = s->y0 + (c.y1 - d->y0)*(sh/(float)dh); - - s = src_rect; - d = dst_rect; - sw = s->x1 - s->x0; - sh = s->y1 - s->y0; - dw = d->x1 - d->x0; - dh = d->y1 - d->y0; - dr.x0 = d->x0 + c.x0*(dw/(float)sw); - dr.y0 = d->y0 + c.y0*(dh/(float)sh); - dr.x1 = d->x0 + c.x1*(dw/(float)sw); - dr.y1 = d->y0 + c.y1*(dh/(float)sh); - - vl_compositor_clear_layers(&drv->cstate); - if (drv->pipe->create_blend_state) { - memset(&blend, 0, sizeof(blend)); - blend.independent_blend_enable = 0; - blend.rt[0].blend_enable = 1; - blend.rt[0].rgb_src_factor = PIPE_BLENDFACTOR_SRC_ALPHA; - blend.rt[0].rgb_dst_factor = PIPE_BLENDFACTOR_INV_SRC_ALPHA; - blend.rt[0].alpha_src_factor = PIPE_BLENDFACTOR_ZERO; - blend.rt[0].alpha_dst_factor = PIPE_BLENDFACTOR_ZERO; - blend.rt[0].rgb_func = PIPE_BLEND_ADD; - blend.rt[0].alpha_func = PIPE_BLEND_ADD; - blend.rt[0].colormask = PIPE_MASK_RGBA; - blend.logicop_enable = 0; - blend.logicop_func = PIPE_LOGICOP_CLEAR; - blend.dither = 0; - blend_state = drv->pipe->create_blend_state(drv->pipe, &blend); - vl_compositor_set_layer_blend(&drv->cstate, 0, blend_state, false); - } - upload_sampler(drv->pipe, sub->sampler, &box, buf->data, - sub->image->pitches[0], 0, 0); - vl_compositor_set_rgba_layer(&drv->cstate, &drv->compositor, 0, sub->sampler, - &sr, NULL, NULL); - vl_compositor_set_layer_dst_area(&drv->cstate, 0, &dr); - vl_compositor_render(&drv->cstate, &drv->compositor, surf_draw, dirty_area, false); - if (blend_state) - drv->pipe->delete_blend_state(drv->pipe, blend_state); - } - - return VA_STATUS_SUCCESS; -} - -VAStatus -vlVaPutSurface(VADriverContextP ctx, VASurfaceID surface_id, void* draw, short srcx, short srcy, - unsigned short srcw, unsigned short srch, short destx, short desty, - unsigned short destw, unsigned short desth, VARectangle *cliprects, - unsigned int number_cliprects, unsigned int flags) -{ - vlVaDriver *drv; - vlVaSurface *surf; - struct pipe_screen *screen; - struct pipe_resource *tex; - struct pipe_surface surf_templ; - struct vl_screen *vscreen; - struct u_rect src_rect, *dirty_area; - struct u_rect dst_rect = {destx, destx + destw, desty, desty + desth}; - enum pipe_format format; - VAStatus status; - enum pipe_video_vpp_matrix_coefficients coeffs; - enum pipe_video_vpp_color_primaries primaries; - - if (!ctx) - return VA_STATUS_ERROR_INVALID_CONTEXT; - - drv = VL_VA_DRIVER(ctx); - mtx_lock(&drv->mutex); - surf = handle_table_get(drv->htab, surface_id); - vlVaGetSurfaceBuffer(drv, surf); - if (!surf || !surf->buffer) { - mtx_unlock(&drv->mutex); - return VA_STATUS_ERROR_INVALID_SURFACE; - } - - screen = drv->pipe->screen; - vscreen = drv->vscreen; - - tex = vscreen->texture_from_drawable(vscreen, draw); - if (!tex) { - mtx_unlock(&drv->mutex); - return VA_STATUS_ERROR_INVALID_DISPLAY; - } - - dirty_area = vscreen->get_dirty_area(vscreen); - - u_surface_default_template(&surf_templ, tex); - - src_rect.x0 = srcx; - src_rect.y0 = srcy; - src_rect.x1 = srcw + srcx; - src_rect.y1 = srch + srcy; - - format = surf->buffer->buffer_format; - - if (flags & VA_SRC_BT601) { - coeffs = PIPE_VIDEO_VPP_MCF_SMPTE170M; - primaries = PIPE_VIDEO_VPP_PRI_SMPTE170M; - } else { - coeffs = PIPE_VIDEO_VPP_MCF_BT709; - primaries = PIPE_VIDEO_VPP_PRI_BT709; - } - - vl_csc_get_rgbyuv_matrix(coeffs, format, surf_templ.format, - PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_REDUCED, - PIPE_VIDEO_VPP_CHROMA_COLOR_RANGE_FULL, &drv->cstate.yuv2rgb); - vl_csc_get_primaries_matrix(primaries, PIPE_VIDEO_VPP_PRI_BT709, &drv->cstate.primaries); - drv->cstate.in_transfer_characteristic = PIPE_VIDEO_VPP_TRC_BT709; - drv->cstate.out_transfer_characteristic = PIPE_VIDEO_VPP_TRC_BT709; - drv->cstate.chroma_location = - VL_COMPOSITOR_LOCATION_HORIZONTAL_LEFT | VL_COMPOSITOR_LOCATION_VERTICAL_CENTER; - - vl_compositor_clear_layers(&drv->cstate); - - if (!util_format_is_yuv(format)) { - struct pipe_sampler_view **views; - - views = surf->buffer->get_sampler_view_planes(surf->buffer); - vl_compositor_set_rgba_layer(&drv->cstate, &drv->compositor, 0, views[0], &src_rect, NULL, NULL); - } else - vl_compositor_set_buffer_layer(&drv->cstate, &drv->compositor, 0, surf->buffer, &src_rect, NULL, VL_COMPOSITOR_WEAVE); - - vl_compositor_set_layer_dst_area(&drv->cstate, 0, &dst_rect); - vl_compositor_render(&drv->cstate, &drv->compositor, &surf_templ, dirty_area, true); - - status = vlVaPutSubpictures(surf, drv, &surf_templ, dirty_area, &src_rect, &dst_rect); - if (status) { - mtx_unlock(&drv->mutex); - return status; - } - - if (drv->pipe->flush_resource) - drv->pipe->flush_resource(drv->pipe, tex); - - /* flush before calling flush_frontbuffer so that rendering is flushed - * to back buffer so the texture can be copied in flush_frontbuffer - */ - vlVaSurfaceFlush(drv, surf); - - screen->flush_frontbuffer(screen, drv->pipe, tex, 0, 0, - vscreen->get_private(vscreen), 0, NULL); - - - pipe_resource_reference(&tex, NULL); - mtx_unlock(&drv->mutex); - - return VA_STATUS_SUCCESS; -} VAStatus vlVaLockSurface(VADriverContextP ctx, VASurfaceID surface, unsigned int *fourcc, diff --git a/src/gallium/frontends/va/va_private.h b/src/gallium/frontends/va/va_private.h index 79437a296e2..11186c821ed 100644 --- a/src/gallium/frontends/va/va_private.h +++ b/src/gallium/frontends/va/va_private.h @@ -459,6 +459,12 @@ typedef struct { // Public functions: VAStatus VA_DRIVER_INIT_FUNC(VADriverContextP ctx); +#define __U_STUB__TAIL { return VA_STATUS_ERROR_UNIMPLEMENTED; } + +#ifndef HAVE_GFX_COMPUTE +#define __U_STUB__ +#endif +#include "util/u_stub.h" // vtable functions: VAStatus vlVaTerminate(VADriverContextP ctx); VAStatus vlVaQueryConfigProfiles(VADriverContextP ctx, VAProfile *profile_list,int *num_profiles); @@ -493,13 +499,11 @@ VAStatus vlVaSyncSurface2(VADriverContextP ctx, VASurfaceID surface, uint64_t ti VAStatus vlVaQuerySurfaceStatus(VADriverContextP ctx, VASurfaceID render_target, VASurfaceStatus *status); VAStatus vlVaQuerySurfaceError(VADriverContextP ctx, VASurfaceID render_target, VAStatus error_status, void **error_info); -VAStatus vlVaPutSurface(VADriverContextP ctx, VASurfaceID surface, void* draw, short srcx, short srcy, +MESAPROC VAStatus vlVaPutSurface(VADriverContextP ctx, VASurfaceID surface, void* draw, short srcx, short srcy, unsigned short srcw, unsigned short srch, short destx, short desty, unsigned short destw, unsigned short desth, VARectangle *cliprects, unsigned int number_cliprects, - unsigned int flags); + unsigned int flags) TAIL; VAStatus vlVaQueryImageFormats(VADriverContextP ctx, VAImageFormat *format_list, int *num_formats); -VAStatus vlVaQuerySubpictureFormats(VADriverContextP ctx, VAImageFormat *format_list, - unsigned int *flags, unsigned int *num_formats); VAStatus vlVaCreateImage(VADriverContextP ctx, VAImageFormat *format, int width, int height, VAImage *image); VAStatus vlVaDeriveImage(VADriverContextP ctx, VASurfaceID surface, VAImage *image); VAStatus vlVaDestroyImage(VADriverContextP ctx, VAImageID image); @@ -509,22 +513,22 @@ VAStatus vlVaGetImage(VADriverContextP ctx, VASurfaceID surface, int x, int y, VAStatus vlVaPutImage(VADriverContextP ctx, VASurfaceID surface, VAImageID image, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y, unsigned int dest_width, unsigned int dest_height); -VAStatus vlVaQuerySubpictureFormats(VADriverContextP ctx, VAImageFormat *format_list, - unsigned int *flags, unsigned int *num_formats); -VAStatus vlVaCreateSubpicture(VADriverContextP ctx, VAImageID image, VASubpictureID *subpicture); -VAStatus vlVaDestroySubpicture(VADriverContextP ctx, VASubpictureID subpicture); -VAStatus vlVaSubpictureImage(VADriverContextP ctx, VASubpictureID subpicture, VAImageID image); -VAStatus vlVaSetSubpictureChromakey(VADriverContextP ctx, VASubpictureID subpicture, +MESAPROC VAStatus vlVaQuerySubpictureFormats(VADriverContextP ctx, VAImageFormat *format_list, + unsigned int *flags, unsigned int *num_formats) TAIL; +MESAPROC VAStatus vlVaCreateSubpicture(VADriverContextP ctx, VAImageID image, VASubpictureID *subpicture) TAIL; +MESAPROC VAStatus vlVaDestroySubpicture(VADriverContextP ctx, VASubpictureID subpicture) TAIL; +MESAPROC VAStatus vlVaSubpictureImage(VADriverContextP ctx, VASubpictureID subpicture, VAImageID image) TAIL; +MESAPROC VAStatus vlVaSetSubpictureChromakey(VADriverContextP ctx, VASubpictureID subpicture, unsigned int chromakey_min, unsigned int chromakey_max, - unsigned int chromakey_mask); -VAStatus vlVaSetSubpictureGlobalAlpha(VADriverContextP ctx, VASubpictureID subpicture, float global_alpha); -VAStatus vlVaAssociateSubpicture(VADriverContextP ctx, VASubpictureID subpicture, VASurfaceID *target_surfaces, - int num_surfaces, short src_x, short src_y, - unsigned short src_width, unsigned short src_height, - short dest_x, short dest_y, unsigned short dest_width, unsigned short dest_height, - unsigned int flags); -VAStatus vlVaDeassociateSubpicture(VADriverContextP ctx, VASubpictureID subpicture, - VASurfaceID *target_surfaces, int num_surfaces); + unsigned int chromakey_mask) TAIL; +MESAPROC VAStatus vlVaSetSubpictureGlobalAlpha(VADriverContextP ctx, VASubpictureID subpicture, float global_alpha) TAIL; +MESAPROC VAStatus vlVaAssociateSubpicture(VADriverContextP ctx, VASubpictureID subpicture, VASurfaceID *target_surfaces, + int num_surfaces, short src_x, short src_y, + unsigned short src_width, unsigned short src_height, + short dest_x, short dest_y, unsigned short dest_width, unsigned short dest_height, + unsigned int flags) TAIL; +MESAPROC VAStatus vlVaDeassociateSubpicture(VADriverContextP ctx, VASubpictureID subpicture, + VASurfaceID *target_surfaces, int num_surfaces) TAIL; VAStatus vlVaQueryDisplayAttributes(VADriverContextP ctx, VADisplayAttribute *attr_list, int *num_attributes); VAStatus vlVaGetDisplayAttributes(VADriverContextP ctx, VADisplayAttribute *attr_list, int num_attributes); VAStatus vlVaSetDisplayAttributes(VADriverContextP ctx, VADisplayAttribute *attr_list, int num_attributes); @@ -545,17 +549,17 @@ VAStatus vlVaAcquireBufferHandle(VADriverContextP ctx, VABufferID buf_id, VABuff VAStatus vlVaReleaseBufferHandle(VADriverContextP ctx, VABufferID buf_id); VAStatus vlVaExportSurfaceHandle(VADriverContextP ctx, VASurfaceID surface_id, uint32_t mem_type, uint32_t flags, void *descriptor); -VAStatus vlVaQueryVideoProcFilters(VADriverContextP ctx, VAContextID context, VAProcFilterType *filters, - unsigned int *num_filters); -VAStatus vlVaQueryVideoProcFilterCaps(VADriverContextP ctx, VAContextID context, VAProcFilterType type, - void *filter_caps, unsigned int *num_filter_caps); -VAStatus vlVaQueryVideoProcPipelineCaps(VADriverContextP ctx, VAContextID context, VABufferID *filters, - unsigned int num_filters, VAProcPipelineCaps *pipeline_cap); +MESAPROC VAStatus vlVaQueryVideoProcFilters(VADriverContextP ctx, VAContextID context, VAProcFilterType *filters, + unsigned int *num_filters) TAIL; +MESAPROC VAStatus vlVaQueryVideoProcFilterCaps(VADriverContextP ctx, VAContextID context, VAProcFilterType type, + void *filter_caps, unsigned int *num_filter_caps) TAIL; +MESAPROC VAStatus vlVaQueryVideoProcPipelineCaps(VADriverContextP ctx, VAContextID context, VABufferID *filters, + unsigned int num_filters, VAProcPipelineCaps *pipeline_cap) TAIL; VAStatus vlVaSyncBuffer(VADriverContextP ctx, VABufferID buf_id, uint64_t timeout_ns); VAStatus vlVaMapBuffer2(VADriverContextP ctx, VABufferID buf_id, void **pbuf, uint32_t flags); // internal functions -VAStatus vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf); +MESAPROC VAStatus vlVaHandleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; VAStatus vlVaHandleSurfaceAllocate(vlVaDriver *drv, vlVaSurface *surface, struct pipe_video_buffer *templat, const uint64_t *modifiers, unsigned int modifiers_count); struct pipe_video_buffer *vlVaGetSurfaceBuffer(vlVaDriver *drv, vlVaSurface *surface); @@ -564,180 +568,131 @@ void vlVaAddRawHeader(struct util_dynarray *headers, uint8_t type, uint32_t size bool is_slice, uint32_t emulation_bytes_start); void vlVaGetBufferFeedback(vlVaBuffer *buf); void vlVaSetSurfaceContext(vlVaDriver *drv, vlVaSurface *surf, vlVaContext *context); -VAStatus vlVaPostProcCompositor(vlVaDriver *drv, struct pipe_video_buffer *src, struct pipe_video_buffer *dst, - enum vl_compositor_deinterlace deinterlace, struct pipe_vpp_desc *param); +MESAPROC VAStatus vlVaPostProcCompositor(vlVaDriver *drv, struct pipe_video_buffer *src, struct pipe_video_buffer *dst, + enum vl_compositor_deinterlace deinterlace, struct pipe_vpp_desc *param) TAIL; void vlVaGetReferenceFrame(vlVaDriver *drv, VASurfaceID surface_id, struct pipe_video_buffer **ref_frame); VAStatus vlVaHandleDecBufferType(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf); +#undef _U_STUB__ -#if VIDEO_CODEC_MPEG12DEC -#define PROC -#define TAIL -#else -#define PROC static inline -#define TAIL {} +#if !VIDEO_CODEC_MPEG12DEC +#define __U_STUB__ #endif -PROC void vlVaHandlePictureParameterBufferMPEG12(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC void vlVaHandleIQMatrixBufferMPEG12(vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC void vlVaHandleSliceParameterBufferMPEG12(vlVaContext *context, vlVaBuffer *buf) TAIL; -#undef PROC -#undef TAIL +#include "util/u_stub.h" +MESAPROC void vlVaHandlePictureParameterBufferMPEG12(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAILV; +MESAPROC void vlVaHandleIQMatrixBufferMPEG12(vlVaContext *context, vlVaBuffer *buf) TAILV; +MESAPROC void vlVaHandleSliceParameterBufferMPEG12(vlVaContext *context, vlVaBuffer *buf) TAILV; +#undef __U_STUB__ -#if VIDEO_CODEC_JPEGDEC -#define PROC -#define TAIL -#else -#define PROC static inline -#define TAIL {} +#if !VIDEO_CODEC_JPEGDEC +#define __U_STUB__ #endif -PROC void vlVaHandlePictureParameterBufferMJPEG(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC void vlVaHandleIQMatrixBufferMJPEG(vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC void vlVaHandleHuffmanTableBufferType(vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC void vlVaHandleSliceParameterBufferMJPEG(vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC void vlVaGetJpegSliceHeader(vlVaContext *context) TAIL; -#undef PROC -#undef TAIL +#include "util/u_stub.h" +MESAPROC void vlVaHandlePictureParameterBufferMJPEG(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAILV; +MESAPROC void vlVaHandleIQMatrixBufferMJPEG(vlVaContext *context, vlVaBuffer *buf) TAILV; +MESAPROC void vlVaHandleHuffmanTableBufferType(vlVaContext *context, vlVaBuffer *buf) TAILV; +MESAPROC void vlVaHandleSliceParameterBufferMJPEG(vlVaContext *context, vlVaBuffer *buf) TAILV; +MESAPROC void vlVaGetJpegSliceHeader(vlVaContext *context) TAILV; +#undef __U_STUB__ -#if VIDEO_CODEC_VC1DEC -#define PROC -#define TAIL -#else -#define PROC static inline -#define TAIL {} +#if !VIDEO_CODEC_VC1DEC +#define __U_STUB__ #endif -PROC void vlVaHandlePictureParameterBufferVC1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC void vlVaHandleSliceParameterBufferVC1(vlVaContext *context, vlVaBuffer *buf) TAIL; -#undef PROC -#undef TAIL +#include "util/u_stub.h" +MESAPROC void vlVaHandlePictureParameterBufferVC1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAILV; +MESAPROC void vlVaHandleSliceParameterBufferVC1(vlVaContext *context, vlVaBuffer *buf) TAILV; +#undef __U_STUB__ -#if VIDEO_CODEC_VP9DEC -#define PROC -#define TAIL -#else -#define PROC static inline -#define TAIL {} +#if !VIDEO_CODEC_VP9DEC +#define __U_STUB__ #endif -PROC void vlVaHandlePictureParameterBufferVP9(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC void vlVaHandleSliceParameterBufferVP9(vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC void vlVaDecoderVP9BitstreamHeader(vlVaContext *context, vlVaBuffer *buf) TAIL; -#undef PROC -#undef TAIL +#include "util/u_stub.h" +MESAPROC void vlVaHandlePictureParameterBufferVP9(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAILV; +MESAPROC void vlVaHandleSliceParameterBufferVP9(vlVaContext *context, vlVaBuffer *buf) TAILV; +MESAPROC void vlVaDecoderVP9BitstreamHeader(vlVaContext *context, vlVaBuffer *buf) TAILV; +#undef __U_STUB__ -#if VIDEO_CODEC_H264DEC -#define PROC -#define TAIL -#else -#define PROC static inline -#define TAIL {} +#if !VIDEO_CODEC_H264DEC +#define __U_STUB__ #endif -PROC void vlVaHandlePictureParameterBufferH264(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC void vlVaHandleIQMatrixBufferH264(vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC void vlVaHandleSliceParameterBufferH264(vlVaContext *context, vlVaBuffer *buf) TAIL; -#undef PROC -#undef TAIL +#include "util/u_stub.h" +MESAPROC void vlVaHandlePictureParameterBufferH264(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAILV; +MESAPROC void vlVaHandleIQMatrixBufferH264(vlVaContext *context, vlVaBuffer *buf) TAILV; +MESAPROC void vlVaHandleSliceParameterBufferH264(vlVaContext *context, vlVaBuffer *buf) TAILV; +#undef __U_STUB__ -#if VIDEO_CODEC_H265DEC -#define PROC -#define TAIL -#else -#define PROC static inline -#define TAIL {} +#if !VIDEO_CODEC_H265DEC +#define __U_STUB__ #endif -PROC void vlVaHandlePictureParameterBufferHEVC(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC void vlVaHandleIQMatrixBufferHEVC(vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC void vlVaHandleSliceParameterBufferHEVC(vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC void vlVaDecoderHEVCBitstreamHeader(vlVaContext *context, vlVaBuffer *buf) TAIL; -#undef PROC -#undef TAIL +#include "util/u_stub.h" +MESAPROC void vlVaHandlePictureParameterBufferHEVC(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAILV; +MESAPROC void vlVaHandleIQMatrixBufferHEVC(vlVaContext *context, vlVaBuffer *buf) TAILV; +MESAPROC void vlVaHandleSliceParameterBufferHEVC(vlVaContext *context, vlVaBuffer *buf) TAILV; +MESAPROC void vlVaDecoderHEVCBitstreamHeader(vlVaContext *context, vlVaBuffer *buf) TAILV; +#undef __U_STUB__ -#if VIDEO_CODEC_AV1DEC -#define PROC -#define TAIL -#define TAIL_S -#else -#define PROC static inline -#define TAIL {} -#define TAIL_S {return VA_STATUS_ERROR_UNIMPLEMENTED;} +#if !VIDEO_CODEC_AV1DEC +#define __U_STUB__ #endif -PROC VAStatus vlVaHandlePictureParameterBufferAV1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL_S; -PROC void vlVaHandleSliceParameterBufferAV1(vlVaContext *context, vlVaBuffer *buf) TAIL; -#undef PROC -#undef TAIL -#undef TAIL_S +#include "util/u_stub.h" +MESAPROC VAStatus vlVaHandlePictureParameterBufferAV1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; +MESAPROC void vlVaHandleSliceParameterBufferAV1(vlVaContext *context, vlVaBuffer *buf) TAILV; +#undef __U_STUB__ -#if VIDEO_CODEC_H264ENC -#define HAS_ENCODE -#define PROC -#define TAIL -#else -#define PROC static inline -#define TAIL {return VA_STATUS_ERROR_UNIMPLEMENTED;} +#if !VIDEO_CODEC_H264ENC +#define __U_STUB__ #endif -PROC VAStatus vlVaHandleVAEncPictureParameterBufferTypeH264(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncSliceParameterBufferTypeH264(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncSequenceParameterBufferTypeH264(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeRateControlH264(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeFrameRateH264(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncPackedHeaderDataBufferTypeH264(vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeTemporalLayerH264(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeQualityLevelH264(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeMaxFrameSizeH264(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeHRDH264(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -#undef PROC -#undef TAIL +#include "util/u_stub.h" +MESAPROC VAStatus vlVaHandleVAEncPictureParameterBufferTypeH264(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncSliceParameterBufferTypeH264(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncSequenceParameterBufferTypeH264(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeRateControlH264(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeFrameRateH264(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncPackedHeaderDataBufferTypeH264(vlVaContext *context, vlVaBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeTemporalLayerH264(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeQualityLevelH264(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeMaxFrameSizeH264(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeHRDH264(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +#undef __U_STUB__ -#if VIDEO_CODEC_H265ENC -#define HAS_ENCODE -#define PROC -#define TAIL -#else -#define PROC static inline -#define TAIL {return VA_STATUS_ERROR_UNIMPLEMENTED;} +#if !VIDEO_CODEC_H265ENC +#define __U_STUB__ #endif -PROC VAStatus vlVaHandleVAEncPictureParameterBufferTypeHEVC(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncSliceParameterBufferTypeHEVC(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncSequenceParameterBufferTypeHEVC(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeRateControlHEVC(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeFrameRateHEVC(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncPackedHeaderDataBufferTypeHEVC(vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeQualityLevelHEVC(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeMaxFrameSizeHEVC(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeHRDHEVC(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeTemporalLayerHEVC(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -#undef PROC -#undef TAIL +#include "util/u_stub.h" +MESAPROC VAStatus vlVaHandleVAEncPictureParameterBufferTypeHEVC(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncSliceParameterBufferTypeHEVC(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncSequenceParameterBufferTypeHEVC(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeRateControlHEVC(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeFrameRateHEVC(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncPackedHeaderDataBufferTypeHEVC(vlVaContext *context, vlVaBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeQualityLevelHEVC(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeMaxFrameSizeHEVC(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeHRDHEVC(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeTemporalLayerHEVC(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +#undef __U_STUB__ #if VA_CHECK_VERSION(1, 16, 0) -#if VIDEO_CODEC_AV1ENC -#define HAS_ENCODE -#define PROC -#define TAIL -#else -#define PROC static inline -#define TAIL {return VA_STATUS_ERROR_UNIMPLEMENTED;} +#if !VIDEO_CODEC_AV1ENC +#define __U_STUB__ #endif -PROC VAStatus vlVaHandleVAEncSequenceParameterBufferTypeAV1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncPictureParameterBufferTypeAV1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeRateControlAV1(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncPackedHeaderDataBufferTypeAV1(vlVaContext *context, vlVaBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeFrameRateAV1(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeQualityLevelAV1(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeMaxFrameSizeAV1(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncMiscParameterTypeHRDAV1(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; -PROC VAStatus vlVaHandleVAEncSliceParameterBufferTypeAV1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -#undef PROC -#undef TAIL +#include "util/u_stub.h" +MESAPROC VAStatus vlVaHandleVAEncSequenceParameterBufferTypeAV1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncPictureParameterBufferTypeAV1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeRateControlAV1(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncPackedHeaderDataBufferTypeAV1(vlVaContext *context, vlVaBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeFrameRateAV1(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeQualityLevelAV1(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeMaxFrameSizeAV1(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncMiscParameterTypeHRDAV1(vlVaContext *context, VAEncMiscParameterBuffer *buf) TAIL; +MESAPROC VAStatus vlVaHandleVAEncSliceParameterBufferTypeAV1(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; +#undef __U_STUB__ #endif -#ifdef HAS_ENCODE -#define PROC -#define TAIL -#else -#define PROC static inline -#define TAIL {return VA_STATUS_ERROR_UNIMPLEMENTED;} +#if !(VIDEO_CODEC_H264ENC || VIDEO_CODEC_H265ENC || VIDEO_CODEC_AV1ENC) +#define __U_STUB__ #endif -PROC VAStatus vlVaHandleEncBufferType(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; -#undef PROC -#undef TAIL +#include "util/u_stub.h" +MESAPROC VAStatus vlVaHandleEncBufferType(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf) TAIL; +#undef __U_STUB__ void vlVaHandleVAEncMiscParameterTypeQualityLevel(struct pipe_enc_quality_modes *p, vlVaQualityBits *in);