diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2015-03-07 21:04:49 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-03 02:50:14 +0300 |
commit | 96c76efae3211c7b798553602d3165b4ea34aa95 (patch) | |
tree | bc0fa36c32fd11a6cc8aadb2486606b8a52d688a /drivers/media/platform/vivid/vivid-vid-cap.c | |
parent | ecb9e91b2dfa3ef69c17c03b2e73ce935254fa65 (diff) | |
download | linux-96c76efae3211c7b798553602d3165b4ea34aa95.tar.xz |
[media] vivid: add new format fields
These fields are necessary to handle the new planar formats.
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-vid-cap.c')
-rw-r--r-- | drivers/media/platform/vivid/vivid-vid-cap.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/media/platform/vivid/vivid-vid-cap.c b/drivers/media/platform/vivid/vivid-vid-cap.c index d41ac4475317..4d50961f35c2 100644 --- a/drivers/media/platform/vivid/vivid-vid-cap.c +++ b/drivers/media/platform/vivid/vivid-vid-cap.c @@ -42,20 +42,26 @@ static const struct vivid_fmt formats_ovl[] = { { .name = "RGB565 (LE)", .fourcc = V4L2_PIX_FMT_RGB565, /* gggbbbbb rrrrrggg */ - .depth = 16, + .vdownsampling = { 1 }, + .bit_depth = { 16 }, .planes = 1, + .buffers = 1, }, { .name = "XRGB555 (LE)", .fourcc = V4L2_PIX_FMT_XRGB555, /* gggbbbbb arrrrrgg */ - .depth = 16, + .vdownsampling = { 1 }, + .bit_depth = { 16 }, .planes = 1, + .buffers = 1, }, { .name = "ARGB555 (LE)", .fourcc = V4L2_PIX_FMT_ARGB555, /* gggbbbbb arrrrrgg */ - .depth = 16, + .vdownsampling = { 1 }, + .bit_depth = { 16 }, .planes = 1, + .buffers = 1, }, }; @@ -597,9 +603,9 @@ int vivid_try_fmt_vid_cap(struct file *file, void *priv, /* This driver supports custom bytesperline values */ /* Calculate the minimum supported bytesperline value */ - bytesperline = (mp->width * fmt->depth) >> 3; + bytesperline = (mp->width * fmt->bit_depth[0]) >> 3; /* Calculate the maximum supported bytesperline value */ - max_bpl = (MAX_ZOOM * MAX_WIDTH * fmt->depth) >> 3; + max_bpl = (MAX_ZOOM * MAX_WIDTH * fmt->bit_depth[0]) >> 3; mp->num_planes = fmt->planes; for (p = 0; p < mp->num_planes; p++) { if (pfmt[p].bytesperline > max_bpl) @@ -1224,7 +1230,7 @@ int vivid_vid_cap_s_fbuf(struct file *file, void *fh, fmt = vivid_get_format(dev, a->fmt.pixelformat); if (!fmt || !fmt->can_do_overlay) return -EINVAL; - if (a->fmt.bytesperline < (a->fmt.width * fmt->depth) / 8) + if (a->fmt.bytesperline < (a->fmt.width * fmt->bit_depth[0]) / 8) return -EINVAL; if (a->fmt.height * a->fmt.bytesperline < a->fmt.sizeimage) return -EINVAL; |