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

check-va-api: Add an option to do all checks


We cannot know whether we expect the VA-API implementation to support
H264, MPEG or only postprocessing, so when called from Steam's
diagnostic tools we only require one success, and stop after the
first success. However, during development and debugging it's helpful
to be able to try all of the possible code paths.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 9653b943
No related branches found
No related tags found
1 merge request!801check-va-api: Use supported surface format + opportunistic cleanup
......@@ -67,6 +67,7 @@ clear_surfaces (VADisplay va_display,
enum
{
OPTION_HELP = 1,
OPTION_ALL,
OPTION_VERBOSE,
OPTION_VERSION,
};
......@@ -74,6 +75,7 @@ enum
struct option long_options[] =
{
{ "help", no_argument, NULL, OPTION_HELP },
{ "all", no_argument, NULL, OPTION_ALL },
{ "verbose", no_argument, NULL, OPTION_VERBOSE },
{ "version", no_argument, NULL, OPTION_VERSION },
{ NULL, 0, NULL, 0 }
......@@ -550,6 +552,7 @@ main (int argc,
#define do_vaapi_or_exit(expr) if (! _do_vaapi (#expr, expr)) goto out;
bool try_all = false;
bool verbose = false;
int opt;
int surfaces_count = 2;
......@@ -575,6 +578,10 @@ main (int argc,
usage (0);
break;
case OPTION_ALL:
try_all = true;
break;
case OPTION_VERBOSE:
verbose = true;
break;
......@@ -650,14 +657,19 @@ main (int argc,
/* We assume to have at least one of VAProfileH264Main, VAProfileMPEG2Simple
* or VAProfileNone */
if (test_decode_capability (va_display, VAProfileH264Main, width, height,
input_region, output_region, surfaces, surfaces_count))
if ((ret != 0 || try_all)
&& test_decode_capability (va_display, VAProfileH264Main, width, height,
input_region, output_region, surfaces, surfaces_count))
ret = 0;
else if (test_decode_capability (va_display, VAProfileMPEG2Simple, width, height,
input_region, output_region, surfaces, surfaces_count))
if ((ret != 0 || try_all)
&& test_decode_capability (va_display, VAProfileMPEG2Simple, width, height,
input_region, output_region, surfaces, surfaces_count))
ret = 0;
else if (test_pp_capability (va_display, width, height, input_region,
output_region, surfaces, surfaces_count))
if ((ret != 0 || try_all)
&& test_pp_capability (va_display, width, height, input_region,
output_region, surfaces, surfaces_count))
ret = 0;
out:
......
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