Skip to content
Snippets Groups Projects
Commit 88d67714 authored by Simon McVittie's avatar Simon McVittie
Browse files

check-va-api: Create context before trying to use it


In principle the context is a required parameter for vaCreateBuffer(),
but in practice Mesa doesn't do anything with it, not even a validity
check for it not being VA_INVALID_ID. Non-Mesa drivers, like the one
from Intel and the unofficial one for Nvidia hardware via nvdec and cuda,
do check for this.

Thanks: Emil Velikov
Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 00260703
No related branches found
No related tags found
1 merge request!587check-va-api: Don't claim to have provided a reference frame
Pipeline #59567 passed
...@@ -262,6 +262,10 @@ test_decode_capability (VADisplay va_display, ...@@ -262,6 +262,10 @@ test_decode_capability (VADisplay va_display,
do_vaapi_or_exit (vaCreateConfig (va_display, profile, VAEntrypointVLD, do_vaapi_or_exit (vaCreateConfig (va_display, profile, VAEntrypointVLD,
NULL, 0, &config)); NULL, 0, &config));
do_vaapi_or_exit (vaCreateContext (va_display, config, width, height,
VA_PROGRESSIVE, surfaces,
surfaces_count, &context));
do_vaapi_or_exit (vaCreateBuffer (va_display, context, do_vaapi_or_exit (vaCreateBuffer (va_display, context,
VAPictureParameterBufferType, VAPictureParameterBufferType,
in_pic_param_size, 1, in_pic_param, in_pic_param_size, 1, in_pic_param,
...@@ -282,10 +286,6 @@ test_decode_capability (VADisplay va_display, ...@@ -282,10 +286,6 @@ test_decode_capability (VADisplay va_display,
in_clip_size, 1, in_clip, in_clip_size, 1, in_clip,
&slice_data_buf)); &slice_data_buf));
do_vaapi_or_exit (vaCreateContext (va_display, config, width, height,
VA_PROGRESSIVE, surfaces,
surfaces_count, &context));
do_vaapi_or_exit (vaBeginPicture (va_display, context, surfaces[1])); do_vaapi_or_exit (vaBeginPicture (va_display, context, surfaces[1]));
/* Send the buffers to the server */ /* Send the buffers to the server */
do_vaapi_or_exit (vaRenderPicture (va_display, context, &pic_param_buf, 1)); do_vaapi_or_exit (vaRenderPicture (va_display, context, &pic_param_buf, 1));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment