Commit 10a2bc7e authored by Vivek Kasireddy's avatar Vivek Kasireddy Committed by Mauro Carvalho Chehab

media: v4l2-tpg-core: Add support for 32-bit packed YUV formats (v2)

Add support for the following formats to tpg:
 V4L2_PIX_FMT_AYUV32
 V4L2_PIX_FMT_XYUV32
 V4L2_PIX_FMT_VUYA32
 V4L2_PIX_FMT_VUYX32

Changes from v1:
Remove the duplicate case value
Signed-off-by: default avatarVivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent a7fe4ca7
...@@ -246,6 +246,10 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) ...@@ -246,6 +246,10 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
case V4L2_PIX_FMT_YUV555: case V4L2_PIX_FMT_YUV555:
case V4L2_PIX_FMT_YUV565: case V4L2_PIX_FMT_YUV565:
case V4L2_PIX_FMT_YUV32: case V4L2_PIX_FMT_YUV32:
case V4L2_PIX_FMT_AYUV32:
case V4L2_PIX_FMT_XYUV32:
case V4L2_PIX_FMT_VUYA32:
case V4L2_PIX_FMT_VUYX32:
tpg->color_enc = TGP_COLOR_ENC_YCBCR; tpg->color_enc = TGP_COLOR_ENC_YCBCR;
break; break;
case V4L2_PIX_FMT_YUV420M: case V4L2_PIX_FMT_YUV420M:
...@@ -372,6 +376,10 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) ...@@ -372,6 +376,10 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
case V4L2_PIX_FMT_ARGB32: case V4L2_PIX_FMT_ARGB32:
case V4L2_PIX_FMT_ABGR32: case V4L2_PIX_FMT_ABGR32:
case V4L2_PIX_FMT_YUV32: case V4L2_PIX_FMT_YUV32:
case V4L2_PIX_FMT_AYUV32:
case V4L2_PIX_FMT_XYUV32:
case V4L2_PIX_FMT_VUYA32:
case V4L2_PIX_FMT_VUYX32:
case V4L2_PIX_FMT_HSV32: case V4L2_PIX_FMT_HSV32:
tpg->twopixelsize[0] = 2 * 4; tpg->twopixelsize[0] = 2 * 4;
break; break;
...@@ -1267,10 +1275,12 @@ static void gen_twopix(struct tpg_data *tpg, ...@@ -1267,10 +1275,12 @@ static void gen_twopix(struct tpg_data *tpg,
case V4L2_PIX_FMT_RGB32: case V4L2_PIX_FMT_RGB32:
case V4L2_PIX_FMT_XRGB32: case V4L2_PIX_FMT_XRGB32:
case V4L2_PIX_FMT_HSV32: case V4L2_PIX_FMT_HSV32:
case V4L2_PIX_FMT_XYUV32:
alpha = 0; alpha = 0;
/* fall through */ /* fall through */
case V4L2_PIX_FMT_YUV32: case V4L2_PIX_FMT_YUV32:
case V4L2_PIX_FMT_ARGB32: case V4L2_PIX_FMT_ARGB32:
case V4L2_PIX_FMT_AYUV32:
buf[0][offset] = alpha; buf[0][offset] = alpha;
buf[0][offset + 1] = r_y_h; buf[0][offset + 1] = r_y_h;
buf[0][offset + 2] = g_u_s; buf[0][offset + 2] = g_u_s;
...@@ -1278,9 +1288,11 @@ static void gen_twopix(struct tpg_data *tpg, ...@@ -1278,9 +1288,11 @@ static void gen_twopix(struct tpg_data *tpg,
break; break;
case V4L2_PIX_FMT_BGR32: case V4L2_PIX_FMT_BGR32:
case V4L2_PIX_FMT_XBGR32: case V4L2_PIX_FMT_XBGR32:
case V4L2_PIX_FMT_VUYX32:
alpha = 0; alpha = 0;
/* fall through */ /* fall through */
case V4L2_PIX_FMT_ABGR32: case V4L2_PIX_FMT_ABGR32:
case V4L2_PIX_FMT_VUYA32:
buf[0][offset] = b_v; buf[0][offset] = b_v;
buf[0][offset + 1] = g_u_s; buf[0][offset + 1] = g_u_s;
buf[0][offset + 2] = r_y_h; buf[0][offset + 2] = r_y_h;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment