aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/pci
diff options
context:
space:
mode:
authorSimon Farnsworth <simon.farnsworth@onelan.co.uk>2015-02-25 11:47:34 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-03-03 09:24:34 -0500
commit48ab45adcccc0835ac2a09805f3f9dff6b073b6c (patch)
tree74a59e153827bf00ac84ef261314d3fc9a022197 /drivers/media/pci
parentac0b2b3072bf81c2047beb39f1db7a7d745f2f99 (diff)
[media] cx18: Fix bytes_per_line
Current GStreamer userspace respects the bytes_per_line from the driver. Set it to something reasonable for the format chosen. Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r--drivers/media/pci/cx18/cx18-driver.h1
-rw-r--r--drivers/media/pci/cx18/cx18-ioctl.c9
2 files changed, 7 insertions, 3 deletions
diff --git a/drivers/media/pci/cx18/cx18-driver.h b/drivers/media/pci/cx18/cx18-driver.h
index 207d6e82403b..ec40f2db4e39 100644
--- a/drivers/media/pci/cx18/cx18-driver.h
+++ b/drivers/media/pci/cx18/cx18-driver.h
@@ -409,6 +409,7 @@ struct cx18_stream {
409 /* Videobuf for YUV video */ 409 /* Videobuf for YUV video */
410 u32 pixelformat; 410 u32 pixelformat;
411 u32 vb_bytes_per_frame; 411 u32 vb_bytes_per_frame;
412 u32 vb_bytes_per_line;
412 struct list_head vb_capture; /* video capture queue */ 413 struct list_head vb_capture; /* video capture queue */
413 spinlock_t vb_lock; 414 spinlock_t vb_lock;
414 struct timer_list vb_timeout; 415 struct timer_list vb_timeout;
diff --git a/drivers/media/pci/cx18/cx18-ioctl.c b/drivers/media/pci/cx18/cx18-ioctl.c
index b8e4b68a9196..c2e0093a5f6a 100644
--- a/drivers/media/pci/cx18/cx18-ioctl.c
+++ b/drivers/media/pci/cx18/cx18-ioctl.c
@@ -159,7 +159,7 @@ static int cx18_g_fmt_vid_cap(struct file *file, void *fh,
159 if (id->type == CX18_ENC_STREAM_TYPE_YUV) { 159 if (id->type == CX18_ENC_STREAM_TYPE_YUV) {
160 pixfmt->pixelformat = s->pixelformat; 160 pixfmt->pixelformat = s->pixelformat;
161 pixfmt->sizeimage = s->vb_bytes_per_frame; 161 pixfmt->sizeimage = s->vb_bytes_per_frame;
162 pixfmt->bytesperline = 720; 162 pixfmt->bytesperline = s->vb_bytes_per_line;
163 } else { 163 } else {
164 pixfmt->pixelformat = V4L2_PIX_FMT_MPEG; 164 pixfmt->pixelformat = V4L2_PIX_FMT_MPEG;
165 pixfmt->sizeimage = 128 * 1024; 165 pixfmt->sizeimage = 128 * 1024;
@@ -287,10 +287,13 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
287 s->pixelformat = fmt->fmt.pix.pixelformat; 287 s->pixelformat = fmt->fmt.pix.pixelformat;
288 /* HM12 YUV size is (Y=(h*720) + UV=(h*(720/2))) 288 /* HM12 YUV size is (Y=(h*720) + UV=(h*(720/2)))
289 UYUV YUV size is (Y=(h*720) + UV=(h*(720))) */ 289 UYUV YUV size is (Y=(h*720) + UV=(h*(720))) */
290 if (s->pixelformat == V4L2_PIX_FMT_HM12) 290 if (s->pixelformat == V4L2_PIX_FMT_HM12) {
291 s->vb_bytes_per_frame = h * 720 * 3 / 2; 291 s->vb_bytes_per_frame = h * 720 * 3 / 2;
292 else 292 s->vb_bytes_per_line = 720; /* First plane */
293 } else {
293 s->vb_bytes_per_frame = h * 720 * 2; 294 s->vb_bytes_per_frame = h * 720 * 2;
295 s->vb_bytes_per_line = 1440; /* Packed */
296 }
294 297
295 mbus_fmt.width = cx->cxhdl.width = w; 298 mbus_fmt.width = cx->cxhdl.width = w;
296 mbus_fmt.height = cx->cxhdl.height = h; 299 mbus_fmt.height = cx->cxhdl.height = h;