OSDN Git Service

media: v4l2-tpg: show either Y'CbCr or HSV encoding
authorHans Verkuil <hans.verkuil@cisco.com>
Sat, 11 Aug 2018 11:07:14 +0000 (07:07 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 11 Sep 2018 12:34:45 +0000 (08:34 -0400)
When logging the current TPG state detect if we are generating
a Y'CbCr or HSV pattern and report one or the other instead of
both, which is confusing.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/common/v4l2-tpg/v4l2-tpg-core.c

index abd4c78..e6d13c4 100644 (file)
@@ -2038,8 +2038,12 @@ void tpg_log_status(struct tpg_data *tpg)
                        tpg->compose.left, tpg->compose.top);
        pr_info("tpg colorspace: %d\n", tpg->colorspace);
        pr_info("tpg transfer function: %d/%d\n", tpg->xfer_func, tpg->real_xfer_func);
-       pr_info("tpg Y'CbCr encoding: %d/%d\n", tpg->ycbcr_enc, tpg->real_ycbcr_enc);
-       pr_info("tpg HSV encoding: %d/%d\n", tpg->hsv_enc, tpg->real_hsv_enc);
+       if (tpg->color_enc == TGP_COLOR_ENC_HSV)
+               pr_info("tpg HSV encoding: %d/%d\n",
+                       tpg->hsv_enc, tpg->real_hsv_enc);
+       else if (tpg->color_enc == TGP_COLOR_ENC_YCBCR)
+               pr_info("tpg Y'CbCr encoding: %d/%d\n",
+                       tpg->ycbcr_enc, tpg->real_ycbcr_enc);
        pr_info("tpg quantization: %d/%d\n", tpg->quantization, tpg->real_quantization);
        pr_info("tpg RGB range: %d/%d\n", tpg->rgb_range, tpg->real_rgb_range);
 }