Commit 5c3edcb2 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] sh-vou: fix bytesperline

The bytesperline values were wrong for planar formats where bytesperline is
the line length for the first plane.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 66853ec4
...@@ -133,6 +133,7 @@ struct sh_vou_fmt { ...@@ -133,6 +133,7 @@ struct sh_vou_fmt {
u32 pfmt; u32 pfmt;
char *desc; char *desc;
unsigned char bpp; unsigned char bpp;
unsigned char bpl;
unsigned char rgb; unsigned char rgb;
unsigned char yf; unsigned char yf;
unsigned char pkf; unsigned char pkf;
...@@ -143,6 +144,7 @@ static struct sh_vou_fmt vou_fmt[] = { ...@@ -143,6 +144,7 @@ static struct sh_vou_fmt vou_fmt[] = {
{ {
.pfmt = V4L2_PIX_FMT_NV12, .pfmt = V4L2_PIX_FMT_NV12,
.bpp = 12, .bpp = 12,
.bpl = 1,
.desc = "YVU420 planar", .desc = "YVU420 planar",
.yf = 0, .yf = 0,
.rgb = 0, .rgb = 0,
...@@ -150,6 +152,7 @@ static struct sh_vou_fmt vou_fmt[] = { ...@@ -150,6 +152,7 @@ static struct sh_vou_fmt vou_fmt[] = {
{ {
.pfmt = V4L2_PIX_FMT_NV16, .pfmt = V4L2_PIX_FMT_NV16,
.bpp = 16, .bpp = 16,
.bpl = 1,
.desc = "YVYU planar", .desc = "YVYU planar",
.yf = 1, .yf = 1,
.rgb = 0, .rgb = 0,
...@@ -157,6 +160,7 @@ static struct sh_vou_fmt vou_fmt[] = { ...@@ -157,6 +160,7 @@ static struct sh_vou_fmt vou_fmt[] = {
{ {
.pfmt = V4L2_PIX_FMT_RGB24, .pfmt = V4L2_PIX_FMT_RGB24,
.bpp = 24, .bpp = 24,
.bpl = 3,
.desc = "RGB24", .desc = "RGB24",
.pkf = 2, .pkf = 2,
.rgb = 1, .rgb = 1,
...@@ -164,6 +168,7 @@ static struct sh_vou_fmt vou_fmt[] = { ...@@ -164,6 +168,7 @@ static struct sh_vou_fmt vou_fmt[] = {
{ {
.pfmt = V4L2_PIX_FMT_RGB565, .pfmt = V4L2_PIX_FMT_RGB565,
.bpp = 16, .bpp = 16,
.bpl = 2,
.desc = "RGB565", .desc = "RGB565",
.pkf = 3, .pkf = 3,
.rgb = 1, .rgb = 1,
...@@ -171,6 +176,7 @@ static struct sh_vou_fmt vou_fmt[] = { ...@@ -171,6 +176,7 @@ static struct sh_vou_fmt vou_fmt[] = {
{ {
.pfmt = V4L2_PIX_FMT_RGB565X, .pfmt = V4L2_PIX_FMT_RGB565X,
.bpp = 16, .bpp = 16,
.bpl = 2,
.desc = "RGB565 byteswapped", .desc = "RGB565 byteswapped",
.pkf = 3, .pkf = 3,
.rgb = 1, .rgb = 1,
...@@ -701,7 +707,8 @@ static int sh_vou_try_fmt_vid_out(struct file *file, void *priv, ...@@ -701,7 +707,8 @@ static int sh_vou_try_fmt_vid_out(struct file *file, void *priv,
v4l_bound_align_image(&pix->width, 0, VOU_MAX_IMAGE_WIDTH, 2, v4l_bound_align_image(&pix->width, 0, VOU_MAX_IMAGE_WIDTH, 2,
&pix->height, 0, img_height_max, 1, 0); &pix->height, 0, img_height_max, 1, 0);
pix->bytesperline = pix->width * 2; pix->bytesperline = pix->width * vou_fmt[pix_idx].bpl;
pix->sizeimage = pix->height * ((pix->width * vou_fmt[pix_idx].bpp) >> 3);
return 0; return 0;
} }
...@@ -1343,7 +1350,7 @@ static int sh_vou_probe(struct platform_device *pdev) ...@@ -1343,7 +1350,7 @@ static int sh_vou_probe(struct platform_device *pdev)
pix->height = 480; pix->height = 480;
pix->pixelformat = V4L2_PIX_FMT_NV16; pix->pixelformat = V4L2_PIX_FMT_NV16;
pix->field = V4L2_FIELD_NONE; pix->field = V4L2_FIELD_NONE;
pix->bytesperline = VOU_MAX_IMAGE_WIDTH * 2; pix->bytesperline = VOU_MAX_IMAGE_WIDTH;
pix->sizeimage = VOU_MAX_IMAGE_WIDTH * 2 * 480; pix->sizeimage = VOU_MAX_IMAGE_WIDTH * 2 * 480;
pix->colorspace = V4L2_COLORSPACE_SMPTE170M; pix->colorspace = V4L2_COLORSPACE_SMPTE170M;
......
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