diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2021-03-04 11:23:01 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2021-04-02 14:29:06 -0700 |
commit | bb74ede045391506877ab7b7196bd87df81c75c6 (patch) | |
tree | 43bbc165769e2bb697ea125121147ceb43267bf5 | |
parent | 7172ce24f7655fccd2828efbddd90e325450ad8f (diff) |
ext_image_dma_buf_import/sample_rgb/yuv: Print usage
It's a little annoying to have to look at the source code to see how to
run the test. Help a person out!
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/501>
4 files changed, 19 insertions, 0 deletions
diff --git a/tests/spec/ext_image_dma_buf_import/sample_common.c b/tests/spec/ext_image_dma_buf_import/sample_common.c index 249840f01..ea5fa30f1 100644 --- a/tests/spec/ext_image_dma_buf_import/sample_common.c +++ b/tests/spec/ext_image_dma_buf_import/sample_common.c @@ -242,3 +242,14 @@ dma_buf_create_and_sample_32bpp(unsigned w, unsigned h, return sample_buffer(buf, fourcc); } + +void +usage(const char *name, const char *color_space) +{ + fprintf(stderr, + "Usage:\n" + " %s -fmt=<format>\n" + "\n" + "Where <format> is a fourCC code for a %s format.\n", + name, color_space); +} diff --git a/tests/spec/ext_image_dma_buf_import/sample_common.h b/tests/spec/ext_image_dma_buf_import/sample_common.h index 155301250..f02e1e0e3 100644 --- a/tests/spec/ext_image_dma_buf_import/sample_common.h +++ b/tests/spec/ext_image_dma_buf_import/sample_common.h @@ -45,4 +45,7 @@ texture_for_egl_image(EGLImageKHR img, GLuint *out_tex); void sample_tex(GLuint tex, unsigned x, unsigned y, unsigned w, unsigned h); +void +usage(const char *name, const char *color_space); + #endif /* SAMPLE_COMMON_H */ diff --git a/tests/spec/ext_image_dma_buf_import/sample_rgb.c b/tests/spec/ext_image_dma_buf_import/sample_rgb.c index b659717fc..3ef6a1492 100644 --- a/tests/spec/ext_image_dma_buf_import/sample_rgb.c +++ b/tests/spec/ext_image_dma_buf_import/sample_rgb.c @@ -105,12 +105,14 @@ piglit_init(int argc, char **argv) fourcc = parse_format(argv[i] + sizeof(fmt) - 1); if (fourcc == -1) { fprintf(stderr, "invalid format: %s\n", argv[i]); + usage(argv[0], "RGB"); piglit_report_result(PIGLIT_SKIP); } } if (fourcc == -1) { fprintf(stderr, "format not specified\n"); + usage(argv[0], "RGB"); piglit_report_result(PIGLIT_SKIP); } } diff --git a/tests/spec/ext_image_dma_buf_import/sample_yuv.c b/tests/spec/ext_image_dma_buf_import/sample_yuv.c index b80b58f4b..ce64f4715 100644 --- a/tests/spec/ext_image_dma_buf_import/sample_yuv.c +++ b/tests/spec/ext_image_dma_buf_import/sample_yuv.c @@ -202,6 +202,7 @@ piglit_display(void) t = uyvy; break; default: + fprintf(stderr, "invalid fourcc: %.4s\n", (char *)&fourcc); return PIGLIT_SKIP; } @@ -260,12 +261,14 @@ piglit_init(int argc, char **argv) fourcc = parse_format(argv[i] + sizeof(fmt) - 1); if (fourcc == -1) { fprintf(stderr, "invalid format: %s\n", argv[i]); + usage(argv[0], "YUV"); piglit_report_result(PIGLIT_SKIP); } } if (fourcc == -1) { fprintf(stderr, "format not specified\n"); + usage(argv[0], "YUV"); piglit_report_result(PIGLIT_SKIP); } } |