aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorarchit taneja <archit@ti.com>2011-06-14 02:54:46 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:56:05 -0400
commitb366888a9020f933bdab8f15f8d4a63e988ce6b3 (patch)
treeb5d1962ed15d962f502c7f693f890432fe5be7fc /drivers/media
parenta137ac870ba7df53e0c68cf2af2c79a71a2050c0 (diff)
[media] OMAP_VOUT: CLEANUP: Make rotation related helper functions more descriptive
Rename rotation_enabled() and rotate_90_or_270() to is_rotation_enabled() and is_rotation_90_or_270() to make them more descriptive. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/omap/omap_vout.c26
-rw-r--r--drivers/media/video/omap/omap_voutdef.h4
2 files changed, 15 insertions, 15 deletions
diff --git a/drivers/media/video/omap/omap_vout.c b/drivers/media/video/omap/omap_vout.c
index 131aff634580..8d69f287ad08 100644
--- a/drivers/media/video/omap/omap_vout.c
+++ b/drivers/media/video/omap/omap_vout.c
@@ -343,7 +343,7 @@ static int omap_vout_vrfb_buffer_setup(struct omap_vout_device *vout,
343 /* Allocate the VRFB buffers only if the buffers are not 343 /* Allocate the VRFB buffers only if the buffers are not
344 * allocated during init time. 344 * allocated during init time.
345 */ 345 */
346 if ((rotation_enabled(vout)) && !vout->vrfb_static_allocation) 346 if ((is_rotation_enabled(vout)) && !vout->vrfb_static_allocation)
347 if (omap_vout_allocate_vrfb_buffers(vout, count, startindex)) 347 if (omap_vout_allocate_vrfb_buffers(vout, count, startindex))
348 return -ENOMEM; 348 return -ENOMEM;
349 349
@@ -419,7 +419,7 @@ static int omap_vout_calculate_offset(struct omap_vout_device *vout)
419 419
420 if (V4L2_PIX_FMT_YUYV == pix->pixelformat || 420 if (V4L2_PIX_FMT_YUYV == pix->pixelformat ||
421 V4L2_PIX_FMT_UYVY == pix->pixelformat) { 421 V4L2_PIX_FMT_UYVY == pix->pixelformat) {
422 if (rotation_enabled(vout)) { 422 if (is_rotation_enabled(vout)) {
423 /* 423 /*
424 * ps - Actual pixel size for YUYV/UYVY for 424 * ps - Actual pixel size for YUYV/UYVY for
425 * VRFB/Mirroring is 4 bytes 425 * VRFB/Mirroring is 4 bytes
@@ -439,7 +439,7 @@ static int omap_vout_calculate_offset(struct omap_vout_device *vout)
439 vout->ps = ps; 439 vout->ps = ps;
440 vout->vr_ps = vr_ps; 440 vout->vr_ps = vr_ps;
441 441
442 if (rotation_enabled(vout)) { 442 if (is_rotation_enabled(vout)) {
443 line_length = MAX_PIXELS_PER_LINE; 443 line_length = MAX_PIXELS_PER_LINE;
444 ctop = (pix->height - crop->height) - crop->top; 444 ctop = (pix->height - crop->height) - crop->top;
445 cleft = (pix->width - crop->width) - crop->left; 445 cleft = (pix->width - crop->width) - crop->left;
@@ -578,7 +578,7 @@ static int omapvid_setup_overlay(struct omap_vout_device *vout,
578 /* Setup the input plane parameters according to 578 /* Setup the input plane parameters according to
579 * rotation value selected. 579 * rotation value selected.
580 */ 580 */
581 if (rotate_90_or_270(vout)) { 581 if (is_rotation_90_or_270(vout)) {
582 cropheight = vout->crop.width; 582 cropheight = vout->crop.width;
583 cropwidth = vout->crop.height; 583 cropwidth = vout->crop.height;
584 pixheight = vout->pix.width; 584 pixheight = vout->pix.width;
@@ -602,7 +602,7 @@ static int omapvid_setup_overlay(struct omap_vout_device *vout,
602 info.out_width = outw; 602 info.out_width = outw;
603 info.out_height = outh; 603 info.out_height = outh;
604 info.global_alpha = vout->win.global_alpha; 604 info.global_alpha = vout->win.global_alpha;
605 if (!rotation_enabled(vout)) { 605 if (!is_rotation_enabled(vout)) {
606 info.rotation = 0; 606 info.rotation = 0;
607 info.rotation_type = OMAP_DSS_ROT_DMA; 607 info.rotation_type = OMAP_DSS_ROT_DMA;
608 info.screen_width = pixwidth; 608 info.screen_width = pixwidth;
@@ -857,11 +857,11 @@ static int omap_vout_buffer_setup(struct videobuf_queue *q, unsigned int *count,
857 if (V4L2_MEMORY_MMAP == vout->memory && *count < startindex) 857 if (V4L2_MEMORY_MMAP == vout->memory && *count < startindex)
858 *count = startindex; 858 *count = startindex;
859 859
860 if ((rotation_enabled(vout)) && *count > VRFB_NUM_BUFS) 860 if ((is_rotation_enabled(vout)) && *count > VRFB_NUM_BUFS)
861 *count = VRFB_NUM_BUFS; 861 *count = VRFB_NUM_BUFS;
862 862
863 /* If rotation is enabled, allocate memory for VRFB space also */ 863 /* If rotation is enabled, allocate memory for VRFB space also */
864 if (rotation_enabled(vout)) 864 if (is_rotation_enabled(vout))
865 if (omap_vout_vrfb_buffer_setup(vout, count, startindex)) 865 if (omap_vout_vrfb_buffer_setup(vout, count, startindex))
866 return -ENOMEM; 866 return -ENOMEM;
867 867
@@ -887,7 +887,7 @@ static int omap_vout_buffer_setup(struct videobuf_queue *q, unsigned int *count,
887 virt_addr = omap_vout_alloc_buffer(vout->buffer_size, 887 virt_addr = omap_vout_alloc_buffer(vout->buffer_size,
888 &phy_addr); 888 &phy_addr);
889 if (!virt_addr) { 889 if (!virt_addr) {
890 if (!rotation_enabled(vout)) 890 if (!is_rotation_enabled(vout))
891 break; 891 break;
892 /* Free the VRFB buffers if no space for V4L2 buffers */ 892 /* Free the VRFB buffers if no space for V4L2 buffers */
893 for (j = i; j < *count; j++) { 893 for (j = i; j < *count; j++) {
@@ -981,7 +981,7 @@ static int omap_vout_buffer_prepare(struct videobuf_queue *q,
981 vout->queued_buf_addr[vb->i] = (u8 *)vout->buf_phy_addr[vb->i]; 981 vout->queued_buf_addr[vb->i] = (u8 *)vout->buf_phy_addr[vb->i];
982 } 982 }
983 983
984 if (!rotation_enabled(vout)) 984 if (!is_rotation_enabled(vout))
985 return 0; 985 return 0;
986 986
987 dmabuf = vout->buf_phy_addr[vb->i]; 987 dmabuf = vout->buf_phy_addr[vb->i];
@@ -1348,7 +1348,7 @@ static int vidioc_s_fmt_vid_out(struct file *file, void *fh,
1348 1348
1349 /* We dont support RGB24-packed mode if vrfb rotation 1349 /* We dont support RGB24-packed mode if vrfb rotation
1350 * is enabled*/ 1350 * is enabled*/
1351 if ((rotation_enabled(vout)) && 1351 if ((is_rotation_enabled(vout)) &&
1352 f->fmt.pix.pixelformat == V4L2_PIX_FMT_RGB24) { 1352 f->fmt.pix.pixelformat == V4L2_PIX_FMT_RGB24) {
1353 ret = -EINVAL; 1353 ret = -EINVAL;
1354 goto s_fmt_vid_out_exit; 1354 goto s_fmt_vid_out_exit;
@@ -1356,7 +1356,7 @@ static int vidioc_s_fmt_vid_out(struct file *file, void *fh,
1356 1356
1357 /* get the framebuffer parameters */ 1357 /* get the framebuffer parameters */
1358 1358
1359 if (rotate_90_or_270(vout)) { 1359 if (is_rotation_90_or_270(vout)) {
1360 vout->fbuf.fmt.height = timing->x_res; 1360 vout->fbuf.fmt.height = timing->x_res;
1361 vout->fbuf.fmt.width = timing->y_res; 1361 vout->fbuf.fmt.width = timing->y_res;
1362 } else { 1362 } else {
@@ -1536,7 +1536,7 @@ static int vidioc_s_crop(struct file *file, void *fh, struct v4l2_crop *crop)
1536 /* get the display device attached to the overlay */ 1536 /* get the display device attached to the overlay */
1537 timing = &ovl->manager->device->panel.timings; 1537 timing = &ovl->manager->device->panel.timings;
1538 1538
1539 if (rotate_90_or_270(vout)) { 1539 if (is_rotation_90_or_270(vout)) {
1540 vout->fbuf.fmt.height = timing->x_res; 1540 vout->fbuf.fmt.height = timing->x_res;
1541 vout->fbuf.fmt.width = timing->y_res; 1541 vout->fbuf.fmt.width = timing->y_res;
1542 } else { 1542 } else {
@@ -1784,7 +1784,7 @@ static int vidioc_qbuf(struct file *file, void *fh,
1784 } 1784 }
1785 } 1785 }
1786 1786
1787 if ((rotation_enabled(vout)) && 1787 if ((is_rotation_enabled(vout)) &&
1788 vout->vrfb_dma_tx.req_status == DMA_CHAN_NOT_ALLOTED) { 1788 vout->vrfb_dma_tx.req_status == DMA_CHAN_NOT_ALLOTED) {
1789 v4l2_warn(&vout->vid_dev->v4l2_dev, 1789 v4l2_warn(&vout->vid_dev->v4l2_dev,
1790 "DMA Channel not allocated for Rotation\n"); 1790 "DMA Channel not allocated for Rotation\n");
diff --git a/drivers/media/video/omap/omap_voutdef.h b/drivers/media/video/omap/omap_voutdef.h
index 31e6261b2c49..1ef3ed22660c 100644
--- a/drivers/media/video/omap/omap_voutdef.h
+++ b/drivers/media/video/omap/omap_voutdef.h
@@ -173,7 +173,7 @@ struct omap_vout_device {
173/* 173/*
174 * Return true if rotation is 90 or 270 174 * Return true if rotation is 90 or 270
175 */ 175 */
176static inline int rotate_90_or_270(const struct omap_vout_device *vout) 176static inline int is_rotation_90_or_270(const struct omap_vout_device *vout)
177{ 177{
178 return (vout->rotation == dss_rotation_90_degree || 178 return (vout->rotation == dss_rotation_90_degree ||
179 vout->rotation == dss_rotation_270_degree); 179 vout->rotation == dss_rotation_270_degree);
@@ -182,7 +182,7 @@ static inline int rotate_90_or_270(const struct omap_vout_device *vout)
182/* 182/*
183 * Return true if rotation is enabled 183 * Return true if rotation is enabled
184 */ 184 */
185static inline int rotation_enabled(const struct omap_vout_device *vout) 185static inline int is_rotation_enabled(const struct omap_vout_device *vout)
186{ 186{
187 return vout->rotation || vout->mirror; 187 return vout->rotation || vout->mirror;
188} 188}