Commit 06d1f0c2 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] vivid-tpg: separate planes and buffers

Add a new field that contains the number of buffers. This may be
less than the number of planes in case multiple planes are combined
into one buffer.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent ba24b442
...@@ -170,7 +170,9 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) ...@@ -170,7 +170,9 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
{ {
tpg->fourcc = fourcc; tpg->fourcc = fourcc;
tpg->planes = 1; tpg->planes = 1;
tpg->buffers = 1;
tpg->recalc_colors = true; tpg->recalc_colors = true;
switch (fourcc) { switch (fourcc) {
case V4L2_PIX_FMT_RGB565: case V4L2_PIX_FMT_RGB565:
case V4L2_PIX_FMT_RGB565X: case V4L2_PIX_FMT_RGB565X:
...@@ -190,6 +192,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc) ...@@ -190,6 +192,7 @@ bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
break; break;
case V4L2_PIX_FMT_NV16M: case V4L2_PIX_FMT_NV16M:
case V4L2_PIX_FMT_NV61M: case V4L2_PIX_FMT_NV61M:
tpg->buffers = 2;
tpg->planes = 2; tpg->planes = 2;
/* fall-through */ /* fall-through */
case V4L2_PIX_FMT_YUYV: case V4L2_PIX_FMT_YUYV:
......
...@@ -138,6 +138,7 @@ struct tpg_data { ...@@ -138,6 +138,7 @@ struct tpg_data {
enum tpg_pixel_aspect pix_aspect; enum tpg_pixel_aspect pix_aspect;
unsigned rgb_range; unsigned rgb_range;
unsigned real_rgb_range; unsigned real_rgb_range;
unsigned buffers;
unsigned planes; unsigned planes;
/* Used to store the colors in native format, either RGB or YUV */ /* Used to store the colors in native format, either RGB or YUV */
u8 colors[TPG_COLOR_MAX][3]; u8 colors[TPG_COLOR_MAX][3];
...@@ -327,6 +328,11 @@ static inline u32 tpg_g_quantization(const struct tpg_data *tpg) ...@@ -327,6 +328,11 @@ static inline u32 tpg_g_quantization(const struct tpg_data *tpg)
return tpg->quantization; return tpg->quantization;
} }
static inline unsigned tpg_g_buffers(const struct tpg_data *tpg)
{
return tpg->buffers;
}
static inline unsigned tpg_g_planes(const struct tpg_data *tpg) static inline unsigned tpg_g_planes(const struct tpg_data *tpg)
{ {
return tpg->planes; return tpg->planes;
......
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