<div dir="ltr"><div>Hi,<br><br></div>Thx for your review. I'll submit a new version of the patch. Just replying here first to answer your questions:<div class="gmail_extra"><br><div class="gmail_quote">On 19 October 2015 at 18:10, Emil Velikov <span dir="ltr"><<a href="mailto:emil.l.velikov@gmail.com" target="_blank">emil.l.velikov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span>On 17 October 2015 at 00:14, Julien Isorce <<a href="mailto:julien.isorce@gmail.com" target="_blank">julien.isorce@gmail.com</a>> wrote:<br>
> Improve following functions to support VA_PROFILE_NONE profile (vpp):<br>
> vlVaQueryConfigProfiles<br>
> vlVaQueryConfigEntrypoints<br>
> vlVaCreateConfig<br>
> vlVaQueryConfigAttributes<br>
><br>
> Add VADriverVTableVPP and improve following functions to support vpp:<br>
> vlVaCreateContext<br>
> vlVaDestroyContext<br>
> vlVaBeginPicture<br>
> vlVaRenderPicture<br>
> vlVaEndPicture<br>
><br>
</span>Please split into two patches - roughly as per above grouping or<br>
otherwise you feel is appropriate.<br></blockquote><div>oki I'll split as above. <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div><br>
> Add handleVAProcPipelineParameterBufferType helper.<br>
><br>
> One of the application is:<br>
> VASurfaceNV12 -> gstvaapipostproc -> VASurfaceRGBA<br>
><br>
> Signed-off-by: Julien Isorce <<a href="mailto:j.isorce@samsung.com" target="_blank">j.isorce@samsung.com</a>><br>
> ---<br>
> src/gallium/state_trackers/va/config.c | 20 +++++++<br>
> src/gallium/state_trackers/va/context.c | 94 +++++++++++++++++++-----------<br>
> src/gallium/state_trackers/va/picture.c | 89 +++++++++++++++++++++++++++-<br>
> src/gallium/state_trackers/va/surface.c | 73 +++++++++++++++++++++++<br>
> src/gallium/state_trackers/va/va_private.h | 13 ++++-<br>
> 5 files changed, 254 insertions(+), 35 deletions(-)<br>
><br>
> diff --git a/src/gallium/state_trackers/va/config.c b/src/gallium/state_trackers/va/config.c<br>
> index cfb0b25..bde6615 100644<br>
> --- a/src/gallium/state_trackers/va/config.c<br>
> +++ b/src/gallium/state_trackers/va/config.c<br>
> @@ -52,6 +52,9 @@ vlVaQueryConfigProfiles(VADriverContextP ctx, VAProfile *profile_list, int *num_<br>
> profile_list[(*num_profiles)++] = vap;<br>
> }<br>
><br>
> + /* Support postprocessing through vl_compositor */<br>
> + profile_list[(*num_profiles)++] = VAProfileNone;<br>
> +<br>
> return VA_STATUS_SUCCESS;<br>
> }<br>
><br>
> @@ -67,6 +70,11 @@ vlVaQueryConfigEntrypoints(VADriverContextP ctx, VAProfile profile,<br>
><br>
> *num_entrypoints = 0;<br>
><br>
> + if (profile == VAProfileNone) {<br>
> + entrypoint_list[(*num_entrypoints)++] = VAEntrypointVideoProc;<br>
> + return VA_STATUS_SUCCESS;<br>
> + }<br>
> +<br>
> p = ProfileToPipe(profile);<br>
> if (p == PIPE_VIDEO_PROFILE_UNKNOWN)<br>
> return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;<br>
> @@ -118,6 +126,11 @@ vlVaCreateConfig(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoin<br>
> if (!ctx)<br>
> return VA_STATUS_ERROR_INVALID_CONTEXT;<br>
><br>
> + if (profile == VAProfileNone && entrypoint == VAEntrypointVideoProc) {<br>
> + *config_id = PIPE_VIDEO_PROFILE_UNKNOWN;<br>
> + return VA_STATUS_SUCCESS;<br>
> + }<br>
> +<br>
> p = ProfileToPipe(profile);<br>
> if (p == PIPE_VIDEO_PROFILE_UNKNOWN)<br>
> return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;<br>
> @@ -151,6 +164,13 @@ vlVaQueryConfigAttributes(VADriverContextP ctx, VAConfigID config_id, VAProfile<br>
> return VA_STATUS_ERROR_INVALID_CONTEXT;<br>
><br>
> *profile = PipeToProfile(config_id);<br>
> +<br>
> + if (config_id == PIPE_VIDEO_PROFILE_UNKNOWN) {<br>
> + *entrypoint = VAEntrypointVideoProc;<br>
> + *num_attribs = 0;<br>
> + return VA_STATUS_SUCCESS;<br>
> + }<br>
> +<br>
> *entrypoint = VAEntrypointVLD;<br>
><br>
> *num_attribs = 1;<br>
> diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c<br>
> index 8949d42..ddc863b 100644<br>
> --- a/src/gallium/state_trackers/va/context.c<br>
> +++ b/src/gallium/state_trackers/va/context.c<br>
> @@ -87,6 +87,14 @@ static struct VADriverVTable vtable =<br>
> &vlVaQuerySurfaceAttributes<br>
> };<br>
><br>
> +static struct VADriverVTableVPP vtable_vpp =<br>
> +{<br>
> + VA_DRIVER_VTABLE_VPP_VERSION,<br>
</div></div>Please _never_ do such a thing. Afaict the define provides the VERSION<br>
currently defined in the API, rather than the one implemented here.<br>
They might align now, but things will break badly as the API gets<br>
updated.<br></blockquote><div> </div><div>oki I'll put just 1 then. <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span><br>
> + &vlVaQueryVideoProcFilters,<br>
> + &vlVaQueryVideoProcFilterCaps,<br>
> + &vlVaQueryVideoProcPipelineCaps<br>
> +};<br>
> +<br>
> PUBLIC VAStatus<br>
> VA_DRIVER_INIT_FUNC(VADriverContextP ctx)<br>
> {<br>
> @@ -122,6 +130,7 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)<br>
> ctx->version_major = 0;<br>
> ctx->version_minor = 1;<br>
> *ctx->vtable = vtable;<br>
> + *ctx->vtable_vpp = vtable_vpp;<br>
> ctx->max_profiles = PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH - PIPE_VIDEO_PROFILE_UNKNOWN;<br>
> ctx->max_entrypoints = 1;<br>
> ctx->max_attributes = 1;<br>
> @@ -151,11 +160,16 @@ vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width,<br>
> struct pipe_video_codec templat = {};<br>
> vlVaDriver *drv;<br>
> vlVaContext *context;<br>
> + int is_vpp = 0;<br>
</span>Drop the = 0 part.<br>
<span><br>
><br>
> if (!ctx)<br>
> return VA_STATUS_ERROR_INVALID_CONTEXT;<br>
><br>
> - if (!(picture_width && picture_height))<br>
> + is_vpp = config_id == PIPE_VIDEO_PROFILE_UNKNOWN &&<br>
> + picture_width == 0 && picture_height == 0 && flag ==0 && !render_targets<br>
> + && num_render_targets == 0;<br>
</span>Please indent - all the conditionals should start at the same column<br>
and nuke the == 0.<br>
<div><div><br>
> +<br>
> + if (!(picture_width && picture_height) && !is_vpp)<br>
> return VA_STATUS_ERROR_INVALID_IMAGE_FORMAT;<br>
><br>
> drv = VL_VA_DRIVER(ctx);<br>
> @@ -163,38 +177,48 @@ vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width,<br>
> if (!context)<br>
> return VA_STATUS_ERROR_ALLOCATION_FAILED;<br>
><br>
> - templat.profile = config_id;<br>
> - templat.entrypoint = PIPE_VIDEO_ENTRYPOINT_BITSTREAM;<br>
> - templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;<br>
> - templat.width = picture_width;<br>
> - templat.height = picture_height;<br>
> - templat.max_references = num_render_targets;<br>
> - templat.expect_chunked_decode = true;<br>
> -<br>
> - if (u_reduce_video_profile(templat.profile) ==<br>
> - PIPE_VIDEO_FORMAT_MPEG4_AVC)<br>
> - templat.level = u_get_h264_level(templat.width, templat.height,<br>
> - &templat.max_references);<br>
> -<br>
> - context->decoder = drv->pipe->create_video_codec(drv->pipe, &templat);<br>
> - if (!context->decoder) {<br>
> - FREE(context);<br>
> - return VA_STATUS_ERROR_ALLOCATION_FAILED;<br>
> - }<br>
> -<br>
> - if (u_reduce_video_profile(context->decoder->profile) ==<br>
> - PIPE_VIDEO_FORMAT_MPEG4_AVC) {<br>
> - context->desc.h264.pps = CALLOC_STRUCT(pipe_h264_pps);<br>
> - if (!context->desc.h264.pps) {<br>
> + if (is_vpp) {<br>
> + context->decoder = NULL;<br>
> + if (!drv->compositor.upload) {<br>
> FREE(context);<br>
> - return VA_STATUS_ERROR_ALLOCATION_FAILED;<br>
> + return VA_STATUS_ERROR_INVALID_CONTEXT;<br>
> }<br>
> - context->desc.h264.pps->sps = CALLOC_STRUCT(pipe_h264_sps);<br>
> - if (!context->desc.h264.pps->sps) {<br>
> - FREE(context->desc.h264.pps);<br>
> + } else {<br>
> + templat.profile = config_id;<br>
> + templat.entrypoint = PIPE_VIDEO_ENTRYPOINT_BITSTREAM;<br>
> + templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;<br>
> + templat.width = picture_width;<br>
> + templat.height = picture_height;<br>
> + templat.max_references = 2;<br>
> + templat.expect_chunked_decode = true;<br>
> +<br>
> + if (u_reduce_video_profile(templat.profile) ==<br>
> + PIPE_VIDEO_FORMAT_MPEG4_AVC) {<br>
> + templat.max_references = 16;<br>
> + templat.level = u_get_h264_level(templat.width, templat.height,<br>
> + &templat.max_references);<br>
> + }<br>
> +<br>
</div></div>Why the max_references changes ? Shouldn't those be a separate patch ?<br>
<span><br>
> + context->decoder = drv->pipe->create_video_codec(drv->pipe, &templat);<br>
> + if (!context->decoder) {<br>
> FREE(context);<br>
> return VA_STATUS_ERROR_ALLOCATION_FAILED;<br>
> }<br>
> +<br>
> + if (u_reduce_video_profile(context->decoder->profile) ==<br>
> + PIPE_VIDEO_FORMAT_MPEG4_AVC) {<br>
> + context->desc.h264.pps = CALLOC_STRUCT(pipe_h264_pps);<br>
> + if (!context->desc.h264.pps) {<br>
> + FREE(context);<br>
> + return VA_STATUS_ERROR_ALLOCATION_FAILED;<br>
> + }<br>
> + context->desc.h264.pps->sps = CALLOC_STRUCT(pipe_h264_sps);<br>
> + if (!context->desc.h264.pps->sps) {<br>
> + FREE(context->desc.h264.pps);<br>
> + FREE(context);<br>
</span>(Mildly related) Keeping track of all these might not fair well. Most<br>
of st/va and other video st do this, yet (iirc) Christian did not see<br>
any issues with opting for goto statements.<br></blockquote><div>Do you want me to do something here ? Not sure to follow, it is just indenting existing code. I'll prefer not to change anything here just in case :) <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div><br>
> + return VA_STATUS_ERROR_ALLOCATION_FAILED;<br>
> + }<br>
> + }<br>
> }<br>
><br>
> context->desc.base.profile = config_id;<br>
> @@ -214,12 +238,16 @@ vlVaDestroyContext(VADriverContextP ctx, VAContextID context_id)<br>
><br>
> drv = VL_VA_DRIVER(ctx);<br>
> context = handle_table_get(drv->htab, context_id);<br>
> - if (u_reduce_video_profile(context->decoder->profile) ==<br>
> - PIPE_VIDEO_FORMAT_MPEG4_AVC) {<br>
> - FREE(context->desc.h264.pps->sps);<br>
> - FREE(context->desc.h264.pps);<br>
> +<br>
> + if (context->decoder) {<br>
> + if (u_reduce_video_profile(context->decoder->profile) ==<br>
> + PIPE_VIDEO_FORMAT_MPEG4_AVC) {<br>
> + FREE(context->desc.h264.pps->sps);<br>
> + FREE(context->desc.h264.pps);<br>
> + }<br>
> + context->decoder->destroy(context->decoder);<br>
> }<br>
> - context->decoder->destroy(context->decoder);<br>
> +<br>
> FREE(context);<br>
> handle_table_remove(drv->htab, context_id);<br>
><br>
> diff --git a/src/gallium/state_trackers/va/picture.c b/src/gallium/state_trackers/va/picture.c<br>
> index 9b94b39..0b42afe 100644<br>
> --- a/src/gallium/state_trackers/va/picture.c<br>
> +++ b/src/gallium/state_trackers/va/picture.c<br>
> @@ -32,6 +32,7 @@<br>
> #include "util/u_video.h"<br>
><br>
> #include "vl/vl_vlc.h"<br>
> +#include "vl/vl_winsys.h"<br>
><br>
> #include "va_private.h"<br>
><br>
> @@ -58,6 +59,16 @@ vlVaBeginPicture(VADriverContextP ctx, VAContextID context_id, VASurfaceID rende<br>
> return VA_STATUS_ERROR_INVALID_SURFACE;<br>
><br>
> context->target = surf->buffer;<br>
> +<br>
> + if (!context->decoder) {<br>
> + /* VPP */<br>
> + if ((context->target->buffer_format != PIPE_FORMAT_B8G8R8A8_UNORM &&<br>
> + context->target->buffer_format != PIPE_FORMAT_R8G8B8A8_UNORM) ||<br>
> + context->target->interlaced)<br>
> + return VA_STATUS_ERROR_UNIMPLEMENTED;<br>
> + return VA_STATUS_SUCCESS;<br>
> + }<br>
> +<br>
> context->decoder->begin_frame(context->decoder, context->target, NULL);<br>
><br>
> return VA_STATUS_SUCCESS;<br>
> @@ -521,11 +532,79 @@ handleVASliceDataBufferType(vlVaContext *context, vlVaBuffer *buf)<br>
> num_buffers, (const void * const*)buffers, sizes);<br>
> }<br>
><br>
> +static VAStatus<br>
> +handleVAProcPipelineParameterBufferType(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *buf)<br>
> +{<br>
> + struct u_rect src_rect = {0};<br>
> + struct u_rect dst_rect = {0};<br>
> + struct u_rect *dirty_area = NULL;<br>
> + vlVaSurface *src_surface = NULL;<br>
> + VAProcPipelineParameterBuffer *pipeline_param = NULL;<br>
> + struct pipe_surface **surfaces = NULL;<br>
> + struct pipe_screen *screen = NULL;<br>
> + struct pipe_surface *psurf = NULL;<br>
</div></div>Cough :)<br>
<div><div><br>
> +<br>
> + if (!drv || !context)<br>
> + return VA_STATUS_ERROR_INVALID_CONTEXT;<br>
> +<br>
> + if (!buf || !buf->data)<br>
> + return VA_STATUS_ERROR_INVALID_BUFFER;<br>
> +<br>
> + if (!context->target)<br>
> + return VA_STATUS_ERROR_INVALID_SURFACE;<br>
> +<br>
> + pipeline_param = buf->data; // cast<br>
> +<br>
> + src_surface = handle_table_get(drv->htab, pipeline_param->surface);<br>
> + if (!src_surface || !src_surface->buffer)<br>
> + return VA_STATUS_ERROR_INVALID_SURFACE;<br>
> +<br>
> + screen = drv->pipe->screen;<br>
> +<br>
> + if(src_surface->fence) {<br>
> + screen->fence_finish(screen, src_surface->fence, PIPE_TIMEOUT_INFINITE);<br>
> + screen->fence_reference(screen, &src_surface->fence, NULL);<br>
> + }<br>
> +<br>
> + surfaces = context->target->get_surfaces(context->target);<br>
> +<br>
> + if (!surfaces)<br>
</div></div>if (!surfaces || !surfaces[0]) ?<br>
<div><div><br></div></div></blockquote><div>oki, it will save some lines.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>
> + return VA_STATUS_ERROR_INVALID_SURFACE;<br>
> +<br>
> + psurf = surfaces[0];<br>
> +<br>
> + if (!psurf)<br>
> + return VA_STATUS_ERROR_INVALID_SURFACE;<br>
> +<br>
> + src_rect.x0 = pipeline_param->surface_region->x;<br>
> + src_rect.y0 = pipeline_param->surface_region->y;<br>
> + src_rect.x1 = pipeline_param->surface_region->x + pipeline_param->surface_region->width;<br>
> + src_rect.y1 = pipeline_param->surface_region->y + pipeline_param->surface_region->height;<br>
> +<br>
> + dst_rect.x0 = pipeline_param->output_region->x;<br>
> + dst_rect.y0 = pipeline_param->output_region->y;<br>
> + dst_rect.x1 = pipeline_param->output_region->x + pipeline_param->output_region->width;<br>
> + dst_rect.y1 = pipeline_param->output_region->y + pipeline_param->output_region->height;<br>
> +<br>
> + dirty_area = vl_screen_get_dirty_area(drv->vscreen);<br>
> +<br>
> + vl_compositor_clear_layers(&drv->cstate);<br>
> + vl_compositor_set_buffer_layer(&drv->cstate, &drv->compositor, 0, src_surface->buffer, &src_rect, NULL, VL_COMPOSITOR_WEAVE);<br>
> + vl_compositor_set_layer_dst_area(&drv->cstate, 0, &dst_rect);<br>
> + vl_compositor_render(&drv->cstate, &drv->compositor, psurf, dirty_area, true);<br>
> +<br>
> + screen->fence_reference(screen, &src_surface->fence, NULL);<br>
> + drv->pipe->flush(drv->pipe, &src_surface->fence, 0);<br>
> +<br>
> + return VA_STATUS_SUCCESS;<br>
> +}<br>
> +<br>
> VAStatus<br>
> vlVaRenderPicture(VADriverContextP ctx, VAContextID context_id, VABufferID *buffers, int num_buffers)<br>
> {<br>
> vlVaDriver *drv;<br>
> vlVaContext *context;<br>
> + VAStatus vaStatus = VA_STATUS_SUCCESS;<br>
><br>
> unsigned i;<br>
><br>
> @@ -561,13 +640,16 @@ vlVaRenderPicture(VADriverContextP ctx, VAContextID context_id, VABufferID *buff<br>
> case VASliceDataBufferType:<br>
> handleVASliceDataBufferType(context, buf);<br>
> break;<br>
> + case VAProcPipelineParameterBufferType:<br>
> + vaStatus = handleVAProcPipelineParameterBufferType(drv, context, buf);<br>
> + break;<br>
><br>
> default:<br>
> break;<br>
> }<br>
> }<br>
><br>
> - return VA_STATUS_SUCCESS;<br>
> + return vaStatus;<br>
> }<br>
><br>
> VAStatus<br>
> @@ -587,6 +669,11 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)<br>
> if (!context)<br>
> return VA_STATUS_ERROR_INVALID_CONTEXT;<br>
><br>
> + if (!context->decoder) {<br>
> + /* VPP */<br>
> + return VA_STATUS_SUCCESS;<br>
> + }<br>
> +<br>
> context->mpeg4.frame_num++;<br>
> context->decoder->end_frame(context->decoder, context->target, &context->desc.base);<br>
><br>
> diff --git a/src/gallium/state_trackers/va/surface.c b/src/gallium/state_trackers/va/surface.c<br>
> index eb5b8ca..bfa4803 100644<br>
> --- a/src/gallium/state_trackers/va/surface.c<br>
> +++ b/src/gallium/state_trackers/va/surface.c<br>
> @@ -625,3 +625,76 @@ no_res:<br>
><br>
> return VA_STATUS_ERROR_ALLOCATION_FAILED;<br>
> }<br>
> +<br>
> +VAStatus<br>
> +vlVaQueryVideoProcFilters(VADriverContextP ctx, VAContextID context,<br>
> + VAProcFilterType *filters, unsigned int *num_filters)<br>
> +{<br>
> + unsigned int num = 0;<br>
> +<br>
> + if (!ctx)<br>
> + return VA_STATUS_ERROR_INVALID_CONTEXT;<br>
> +<br>
> + if (!num_filters || !filters)<br>
> + return VA_STATUS_ERROR_INVALID_PARAMETER;<br>
> +<br>
> + filters[num++] = VAProcFilterNone;<br>
> +<br>
> + *num_filters = num;<br>
> +<br>
> + return VA_STATUS_SUCCESS;<br>
> +}<br>
> +<br>
> +VAStatus<br>
> +vlVaQueryVideoProcFilterCaps(VADriverContextP ctx, VAContextID context,<br>
> + VAProcFilterType type, void *filter_caps,<br>
> + unsigned int *num_filter_caps)<br>
> +{<br>
> + if (!ctx)<br>
> + return VA_STATUS_ERROR_INVALID_CONTEXT;<br>
> +<br>
> + return VA_STATUS_ERROR_UNIMPLEMENTED;<br>
</div></div>Something looks fishy here. Shouldn't one return SUCCESS or ENOTSUPP<br>
like error, when we have FilterNone ?<br></blockquote><div>Your are right, I was only testing with gstreamer-vaapi and it seems to really this function only for other VPP than VAProcFilterNone. But I am going to provide a minimal impl just to handle FilterNone.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div><br>
> +}<br>
> +<br>
> +static VAProcColorStandardType vpp_input_color_standards[VAProcColorStandardCount] = {<br>
> + VAProcColorStandardBT601<br>
> +};<br>
> +<br>
> +static VAProcColorStandardType vpp_output_color_standards[VAProcColorStandardCount] = {<br>
> + VAProcColorStandardBT601<br>
> +};<br>
> +<br>
> +VAStatus<br>
> +vlVaQueryVideoProcPipelineCaps(VADriverContextP ctx, VAContextID context,<br>
> + VABufferID *filters, unsigned int num_filters,<br>
> + VAProcPipelineCaps *pipeline_cap)<br>
> +{<br>
> + unsigned int i = 0;<br>
> +<br>
> + if (!ctx)<br>
> + return VA_STATUS_ERROR_INVALID_CONTEXT;<br>
> +<br>
> + if (!pipeline_cap)<br>
> + return VA_STATUS_ERROR_INVALID_PARAMETER;<br>
> +<br>
> + if (num_filters && !filters)<br>
> + return VA_STATUS_ERROR_INVALID_PARAMETER;<br>
> +<br>
> + pipeline_cap->pipeline_flags = 0;<br>
> + pipeline_cap->filter_flags = 0;<br>
> + pipeline_cap->num_forward_references = 0;<br>
> + pipeline_cap->num_backward_references = 0;<br>
> + pipeline_cap->num_input_color_standards = 1;<br>
> + pipeline_cap->input_color_standards = vpp_input_color_standards;<br>
> + pipeline_cap->num_output_color_standards = 1;<br>
> + pipeline_cap->output_color_standards = vpp_output_color_standards;<br>
> +<br>
> + for (i = 0; i < num_filters; i++) {<br>
> + vlVaBuffer *buf = handle_table_get(VL_VA_DRIVER(ctx)->htab, filters[i]);<br>
> +<br>
> + if (!buf || buf->type >= VABufferTypeMax)<br>
> + return VA_STATUS_ERROR_INVALID_BUFFER;<br>
> + }<br>
> +<br>
> + return VA_STATUS_SUCCESS;<br>
> +}<br>
> diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h<br>
> index 2cdd787..d3a29bc 100644<br>
> --- a/src/gallium/state_trackers/va/va_private.h<br>
> +++ b/src/gallium/state_trackers/va/va_private.h<br>
> @@ -33,6 +33,7 @@<br>
><br>
> #include <va/va.h><br>
> #include <va/va_backend.h><br>
> +#include <va/va_backend_vpp.h><br>
> #include <va/va_drmcommon.h><br>
><br>
> #include "pipe/p_video_enums.h"<br>
> @@ -148,7 +149,8 @@ PipeToProfile(enum pipe_video_profile profile)<br>
> case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH:<br>
> return VAProfileH264High;<br>
> case PIPE_VIDEO_PROFILE_MPEG4_AVC_EXTENDED:<br>
> - return VAProfileNone;<br>
> + case PIPE_VIDEO_PROFILE_UNKNOWN:<br>
> + return VAProfileNone;<br>
> default:<br>
> assert(0);<br>
> return -1;<br>
> @@ -179,6 +181,8 @@ ProfileToPipe(VAProfile profile)<br>
> return PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN;<br>
> case VAProfileH264High:<br>
> return PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH;<br>
> + case VAProfileNone:<br>
> + return PIPE_VIDEO_PROFILE_UNKNOWN;<br>
</div></div>Mapping ProfileNone to PROFILE_UNKNOW and vice versa (incl. all the<br>
uses above) seems like an abuse ?<br></blockquote><div> </div><div>Yeah I have not found a better solution. There is no PIPE_VIDEO_PROFILE_NONE so I picked PIPE_VIDEO_PROFILE_UNKNOWN. <br></div><div>At least vlVaCreateConfig returns PIPE_VIDEO_PROFILE_UNKNOWN only for VAEntrypointVideoProc.<br></div><div><br></div><div>Cheers<br></div><div>Julien <br></div> <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Cheers<br>
<span><font color="#888888">Emil<br>
</font></span></blockquote></div><br></div></div>