summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vivid/vivid-tpg.c
diff options
context:
space:
mode:
authorHans Verkuil2015-03-09 15:07:23 +0100
committerMauro Carvalho Chehab2015-04-03 01:46:45 +0200
commite76036d8507ca8568661e5c4f5010219d7097497 (patch)
tree69a519a5d2a490c693729c9c09147980675b152f /drivers/media/platform/vivid/vivid-tpg.c
parent[media] vivid-tpg: add const where appropriate (diff)
downloadkernel-qcow2-linux-e76036d8507ca8568661e5c4f5010219d7097497.tar.gz
kernel-qcow2-linux-e76036d8507ca8568661e5c4f5010219d7097497.tar.xz
kernel-qcow2-linux-e76036d8507ca8568661e5c4f5010219d7097497.zip
[media] vivid-tpg: add a new tpg_draw_params structure
This is needed to refactor the drawing function which is much too big. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/vivid/vivid-tpg.c')
-rw-r--r--drivers/media/platform/vivid/vivid-tpg.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/media/platform/vivid/vivid-tpg.c b/drivers/media/platform/vivid/vivid-tpg.c
index 2b7362d4b618..c04c45868793 100644
--- a/drivers/media/platform/vivid/vivid-tpg.c
+++ b/drivers/media/platform/vivid/vivid-tpg.c
@@ -1514,6 +1514,35 @@ static int tpg_pattern_avg(const struct tpg_data *tpg,
return -1;
}
+/*
+ * This struct contains common parameters used by both the drawing of the
+ * test pattern and the drawing of the extras (borders, square, etc.)
+ */
+struct tpg_draw_params {
+ /* common data */
+ bool is_tv;
+ bool is_60hz;
+ unsigned twopixsize;
+ unsigned img_width;
+ unsigned stride;
+ unsigned hmax;
+ unsigned frame_line;
+ unsigned frame_line_next;
+
+ /* test pattern */
+ unsigned mv_hor_old;
+ unsigned mv_hor_new;
+ unsigned mv_vert_old;
+ unsigned mv_vert_new;
+
+ /* extras */
+ unsigned wss_width;
+ unsigned wss_random_offset;
+ unsigned sav_eav_f;
+ unsigned left_pillar_width;
+ unsigned right_pillar_start;
+};
+
void tpg_fill_plane_buffer(struct tpg_data *tpg, v4l2_std_id std, unsigned p, u8 *vbuf)
{
bool is_tv = std;