]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
media: v4l2-tpg: add Z16 support
authorHans Verkuil <hans.verkuil@cisco.com>
Sat, 11 Aug 2018 11:07:15 +0000 (07:07 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Tue, 11 Sep 2018 12:36:51 +0000 (08:36 -0400)
Z16 support is identical to Y16, so that's easy to add.

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 e6d13c4fb7b71aae923e553515d2cd06ccff48c6..f3d9c1140ffa77c7126ef82c9e2bd633b46d3dd6 100644 (file)
@@ -235,6 +235,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
        case V4L2_PIX_FMT_Y12:
        case V4L2_PIX_FMT_Y16:
        case V4L2_PIX_FMT_Y16_BE:
+       case V4L2_PIX_FMT_Z16:
                tpg->color_enc = TGP_COLOR_ENC_LUMA;
                break;
        case V4L2_PIX_FMT_YUV444:
@@ -351,6 +352,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
        case V4L2_PIX_FMT_Y12:
        case V4L2_PIX_FMT_Y16:
        case V4L2_PIX_FMT_Y16_BE:
+       case V4L2_PIX_FMT_Z16:
                tpg->twopixelsize[0] = 2 * 2;
                break;
        case V4L2_PIX_FMT_RGB24:
@@ -1062,6 +1064,7 @@ static void gen_twopix(struct tpg_data *tpg,
                buf[0][offset+1] = r_y_h >> 4;
                break;
        case V4L2_PIX_FMT_Y16:
+       case V4L2_PIX_FMT_Z16:
                /*
                 * Ideally both bytes should be set to r_y_h, but then you won't
                 * be able to detect endian problems. So keep it 0 except for