summaryrefslogtreecommitdiffstats
path: root/video/out/gpu/context.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/out/gpu/context.c')
-rw-r--r--video/out/gpu/context.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/video/out/gpu/context.c b/video/out/gpu/context.c
index 8be0b2fc90..8dc8a5c71f 100644
--- a/video/out/gpu/context.c
+++ b/video/out/gpu/context.c
@@ -111,24 +111,16 @@ static const struct ra_ctx_fns *contexts[] = {
#endif
};
-static bool get_help(struct mp_log *log, struct bstr param)
+int ra_ctx_validate_api(struct mp_log *log, const struct m_option *opt,
+ struct bstr name, struct bstr param)
{
if (bstr_equals0(param, "help")) {
- mp_info(log, "GPU contexts / APIs:\n");
+ mp_info(log, "GPU APIs (contexts):\n");
mp_info(log, " auto (autodetect)\n");
for (int n = 0; n < MP_ARRAY_SIZE(contexts); n++)
- mp_info(log, " %s (%s)\n", contexts[n]->name, contexts[n]->type);
- return true;
- }
-
- return false;
-}
-
-int ra_ctx_validate_api(struct mp_log *log, const struct m_option *opt,
- struct bstr name, struct bstr param)
-{
- if (get_help(log, param))
+ mp_info(log, " %s (%s)\n", contexts[n]->type, contexts[n]->name);
return M_OPT_EXIT;
+ }
if (bstr_equals0(param, "auto"))
return 1;
for (int i = 0; i < MP_ARRAY_SIZE(contexts); i++) {
@@ -141,8 +133,13 @@ int ra_ctx_validate_api(struct mp_log *log, const struct m_option *opt,
int ra_ctx_validate_context(struct mp_log *log, const struct m_option *opt,
struct bstr name, struct bstr param)
{
- if (get_help(log, param))
+ if (bstr_equals0(param, "help")) {
+ mp_info(log, "GPU contexts (APIs):\n");
+ mp_info(log, " auto (autodetect)\n");
+ for (int n = 0; n < MP_ARRAY_SIZE(contexts); n++)
+ mp_info(log, " %s (%s)\n", contexts[n]->name, contexts[n]->type);
return M_OPT_EXIT;
+ }
if (bstr_equals0(param, "auto"))
return 1;
for (int i = 0; i < MP_ARRAY_SIZE(contexts); i++) {