aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mx3_camera.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-08-25 10:46:17 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-18 23:18:43 -0400
commita0705b07f1816ae2b85388fcda71de69c221b4b8 (patch)
tree7406da18408564e38645eeaa22ea49324fd1ca6a /drivers/media/video/mx3_camera.c
parent4a6110bc50da9a1883bf45614ac1d591253f0457 (diff)
V4L/DVB (12515): soc-camera: use struct v4l2_rect in struct soc_camera_device
Switch to using struct v4l2_rect in struct soc_camera_device for uniformity and simplicity. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/mx3_camera.c')
-rw-r--r--drivers/media/video/mx3_camera.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
index 677d355be8fc..6c3b7f9b906f 100644
--- a/drivers/media/video/mx3_camera.c
+++ b/drivers/media/video/mx3_camera.c
@@ -220,7 +220,7 @@ static int mx3_videobuf_setup(struct videobuf_queue *vq, unsigned int *count,
220 if (!mx3_cam->idmac_channel[0]) 220 if (!mx3_cam->idmac_channel[0])
221 return -EINVAL; 221 return -EINVAL;
222 222
223 *size = icd->width * icd->height * bpp; 223 *size = icd->rect_current.width * icd->rect_current.height * bpp;
224 224
225 if (!*count) 225 if (!*count)
226 *count = 32; 226 *count = 32;
@@ -241,7 +241,7 @@ static int mx3_videobuf_prepare(struct videobuf_queue *vq,
241 struct mx3_camera_buffer *buf = 241 struct mx3_camera_buffer *buf =
242 container_of(vb, struct mx3_camera_buffer, vb); 242 container_of(vb, struct mx3_camera_buffer, vb);
243 /* current_fmt _must_ always be set */ 243 /* current_fmt _must_ always be set */
244 size_t new_size = icd->width * icd->height * 244 size_t new_size = icd->rect_current.width * icd->rect_current.height *
245 ((icd->current_fmt->depth + 7) >> 3); 245 ((icd->current_fmt->depth + 7) >> 3);
246 int ret; 246 int ret;
247 247
@@ -251,12 +251,12 @@ static int mx3_videobuf_prepare(struct videobuf_queue *vq,
251 */ 251 */
252 252
253 if (buf->fmt != icd->current_fmt || 253 if (buf->fmt != icd->current_fmt ||
254 vb->width != icd->width || 254 vb->width != icd->rect_current.width ||
255 vb->height != icd->height || 255 vb->height != icd->rect_current.height ||
256 vb->field != field) { 256 vb->field != field) {
257 buf->fmt = icd->current_fmt; 257 buf->fmt = icd->current_fmt;
258 vb->width = icd->width; 258 vb->width = icd->rect_current.width;
259 vb->height = icd->height; 259 vb->height = icd->rect_current.height;
260 vb->field = field; 260 vb->field = field;
261 if (vb->state != VIDEOBUF_NEEDS_INIT) 261 if (vb->state != VIDEOBUF_NEEDS_INIT)
262 free_buffer(vq, buf); 262 free_buffer(vq, buf);
@@ -354,9 +354,9 @@ static void mx3_videobuf_queue(struct videobuf_queue *vq,
354 354
355 /* This is the configuration of one sg-element */ 355 /* This is the configuration of one sg-element */
356 video->out_pixel_fmt = fourcc_to_ipu_pix(data_fmt->fourcc); 356 video->out_pixel_fmt = fourcc_to_ipu_pix(data_fmt->fourcc);
357 video->out_width = icd->width; 357 video->out_width = icd->rect_current.width;
358 video->out_height = icd->height; 358 video->out_height = icd->rect_current.height;
359 video->out_stride = icd->width; 359 video->out_stride = icd->rect_current.width;
360 360
361#ifdef DEBUG 361#ifdef DEBUG
362 /* helps to see what DMA actually has written */ 362 /* helps to see what DMA actually has written */
@@ -538,7 +538,8 @@ static bool channel_change_requested(struct soc_camera_device *icd,
538 struct idmac_channel *ichan = mx3_cam->idmac_channel[0]; 538 struct idmac_channel *ichan = mx3_cam->idmac_channel[0];
539 539
540 /* Do buffers have to be re-allocated or channel re-configured? */ 540 /* Do buffers have to be re-allocated or channel re-configured? */
541 return ichan && rect->width * rect->height > icd->width * icd->height; 541 return ichan && rect->width * rect->height >
542 icd->rect_current.width * icd->rect_current.height;
542} 543}
543 544
544static int test_platform_param(struct mx3_camera_dev *mx3_cam, 545static int test_platform_param(struct mx3_camera_dev *mx3_cam,
@@ -808,8 +809,8 @@ static int mx3_camera_set_fmt(struct soc_camera_device *icd,
808 const struct soc_camera_format_xlate *xlate; 809 const struct soc_camera_format_xlate *xlate;
809 struct v4l2_pix_format *pix = &f->fmt.pix; 810 struct v4l2_pix_format *pix = &f->fmt.pix;
810 struct v4l2_rect rect = { 811 struct v4l2_rect rect = {
811 .left = icd->x_current, 812 .left = icd->rect_current.left,
812 .top = icd->y_current, 813 .top = icd->rect_current.top,
813 .width = pix->width, 814 .width = pix->width,
814 .height = pix->height, 815 .height = pix->height,
815 }; 816 };