aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2012-03-21 07:03:22 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-15 15:09:02 -0400
commit1c0f95eec6d6c4cedfbead8eade7d879534da651 (patch)
tree9309f6aa3ba753556ad8d5e4050bed757b99eba8 /drivers/media
parent2b61d46e2c44568886bc099f8085aefc7107e372 (diff)
[media] soc_camera: Use soc_camera_device::bytesperline to compute line sizes
Instead of computing the line sizes, use the previously negotiated soc_camera_device::bytesperline value. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/mx3_camera.c7
-rw-r--r--drivers/media/video/sh_mobile_ceu_camera.c4
2 files changed, 3 insertions, 8 deletions
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
index b3016adb0f4f..6c87d966a554 100644
--- a/drivers/media/video/mx3_camera.c
+++ b/drivers/media/video/mx3_camera.c
@@ -265,13 +265,10 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb)
265 struct idmac_channel *ichan = mx3_cam->idmac_channel[0]; 265 struct idmac_channel *ichan = mx3_cam->idmac_channel[0];
266 struct idmac_video_param *video = &ichan->params.video; 266 struct idmac_video_param *video = &ichan->params.video;
267 const struct soc_mbus_pixelfmt *host_fmt = icd->current_fmt->host_fmt; 267 const struct soc_mbus_pixelfmt *host_fmt = icd->current_fmt->host_fmt;
268 int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, host_fmt);
269 unsigned long flags; 268 unsigned long flags;
270 dma_cookie_t cookie; 269 dma_cookie_t cookie;
271 size_t new_size; 270 size_t new_size;
272 271
273 BUG_ON(bytes_per_line <= 0);
274
275 new_size = icd->sizeimage; 272 new_size = icd->sizeimage;
276 273
277 if (vb2_plane_size(vb, 0) < new_size) { 274 if (vb2_plane_size(vb, 0) < new_size) {
@@ -312,9 +309,9 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb)
312 * horizontal parameters in this case are expressed in bytes, 309 * horizontal parameters in this case are expressed in bytes,
313 * not in pixels. 310 * not in pixels.
314 */ 311 */
315 video->out_width = bytes_per_line; 312 video->out_width = icd->bytesperline;
316 video->out_height = icd->user_height; 313 video->out_height = icd->user_height;
317 video->out_stride = bytes_per_line; 314 video->out_stride = icd->bytesperline;
318 } else { 315 } else {
319 /* 316 /*
320 * For IPU known formats the pixel unit will be managed 317 * For IPU known formats the pixel unit will be managed
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c
index 8c6dc242ede2..3d28c9c7a2c1 100644
--- a/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/drivers/media/video/sh_mobile_ceu_camera.c
@@ -337,9 +337,7 @@ static int sh_mobile_ceu_capture(struct sh_mobile_ceu_dev *pcdev)
337 if (planar) 337 if (planar)
338 phys_addr_bottom = phys_addr_top + icd->user_width; 338 phys_addr_bottom = phys_addr_top + icd->user_width;
339 else 339 else
340 phys_addr_bottom = phys_addr_top + 340 phys_addr_bottom = phys_addr_top + icd->bytesperline;
341 soc_mbus_bytes_per_line(icd->user_width,
342 icd->current_fmt->host_fmt);
343 ceu_write(pcdev, bottom1, phys_addr_bottom); 341 ceu_write(pcdev, bottom1, phys_addr_bottom);
344 } 342 }
345 343