diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2015-03-07 19:39:01 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-03 02:37:26 +0300 |
commit | 4db22041892946348f98672a5524bdf2f18f66f5 (patch) | |
tree | 67ede93888cb269852bda43537b1dd1b51c6b304 /drivers/media/platform/vivid/vivid-tpg.c | |
parent | 06d1f0c2eaaebe04fa3ea780ca37dcd6e05ade16 (diff) | |
download | linux-4db22041892946348f98672a5524bdf2f18f66f5.tar.xz |
[media] vivid-tpg: add helper functions for single buffer planar formats
Add helpers functions to determine the line widths and image sizes
for planar formats that are stores in a single buffer.
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.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/media/platform/vivid/vivid-tpg.c b/drivers/media/platform/vivid/vivid-tpg.c index d7f55d437f91..66df19d02b34 100644 --- a/drivers/media/platform/vivid/vivid-tpg.c +++ b/drivers/media/platform/vivid/vivid-tpg.c @@ -1321,7 +1321,7 @@ void tpg_calc_text_basep(struct tpg_data *tpg, basep[p][0] += tpg->buf_height * stride / 2; } -void tpg_fillbuffer(struct tpg_data *tpg, v4l2_std_id std, unsigned p, u8 *vbuf) +void tpg_fill_plane_buffer(struct tpg_data *tpg, v4l2_std_id std, unsigned p, u8 *vbuf) { bool is_tv = std; bool is_60hz = is_tv && (std & V4L2_STD_525_60); @@ -1581,3 +1581,19 @@ void tpg_fillbuffer(struct tpg_data *tpg, v4l2_std_id std, unsigned p, u8 *vbuf) } } } + +void tpg_fillbuffer(struct tpg_data *tpg, v4l2_std_id std, unsigned p, u8 *vbuf) +{ + unsigned offset = 0; + unsigned i; + + if (tpg->buffers > 1) { + tpg_fill_plane_buffer(tpg, std, p, vbuf); + return; + } + + for (i = 0; i < tpg->planes; i++) { + tpg_fill_plane_buffer(tpg, std, i, vbuf + offset); + offset += tpg_calc_plane_size(tpg, i); + } +} |