Commit 1c0f95ee authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 2b61d46e
...@@ -265,13 +265,10 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb) ...@@ -265,13 +265,10 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb)
struct idmac_channel *ichan = mx3_cam->idmac_channel[0]; struct idmac_channel *ichan = mx3_cam->idmac_channel[0];
struct idmac_video_param *video = &ichan->params.video; struct idmac_video_param *video = &ichan->params.video;
const struct soc_mbus_pixelfmt *host_fmt = icd->current_fmt->host_fmt; const struct soc_mbus_pixelfmt *host_fmt = icd->current_fmt->host_fmt;
int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, host_fmt);
unsigned long flags; unsigned long flags;
dma_cookie_t cookie; dma_cookie_t cookie;
size_t new_size; size_t new_size;
BUG_ON(bytes_per_line <= 0);
new_size = icd->sizeimage; new_size = icd->sizeimage;
if (vb2_plane_size(vb, 0) < new_size) { if (vb2_plane_size(vb, 0) < new_size) {
...@@ -312,9 +309,9 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb) ...@@ -312,9 +309,9 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb)
* horizontal parameters in this case are expressed in bytes, * horizontal parameters in this case are expressed in bytes,
* not in pixels. * not in pixels.
*/ */
video->out_width = bytes_per_line; video->out_width = icd->bytesperline;
video->out_height = icd->user_height; video->out_height = icd->user_height;
video->out_stride = bytes_per_line; video->out_stride = icd->bytesperline;
} else { } else {
/* /*
* For IPU known formats the pixel unit will be managed * For IPU known formats the pixel unit will be managed
......
...@@ -337,9 +337,7 @@ static int sh_mobile_ceu_capture(struct sh_mobile_ceu_dev *pcdev) ...@@ -337,9 +337,7 @@ static int sh_mobile_ceu_capture(struct sh_mobile_ceu_dev *pcdev)
if (planar) if (planar)
phys_addr_bottom = phys_addr_top + icd->user_width; phys_addr_bottom = phys_addr_top + icd->user_width;
else else
phys_addr_bottom = phys_addr_top + phys_addr_bottom = phys_addr_top + icd->bytesperline;
soc_mbus_bytes_per_line(icd->user_width,
icd->current_fmt->host_fmt);
ceu_write(pcdev, bottom1, phys_addr_bottom); ceu_write(pcdev, bottom1, phys_addr_bottom);
} }
......
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