Commit b366888a authored by archit taneja's avatar archit taneja Committed by Mauro Carvalho Chehab

[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: default avatarArchit Taneja <archit@ti.com>
Signed-off-by: default avatarVaibhav Hiremath <hvaibhav@ti.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent a137ac87
...@@ -343,7 +343,7 @@ static int omap_vout_vrfb_buffer_setup(struct omap_vout_device *vout, ...@@ -343,7 +343,7 @@ static int omap_vout_vrfb_buffer_setup(struct omap_vout_device *vout,
/* Allocate the VRFB buffers only if the buffers are not /* Allocate the VRFB buffers only if the buffers are not
* allocated during init time. * allocated during init time.
*/ */
if ((rotation_enabled(vout)) && !vout->vrfb_static_allocation) if ((is_rotation_enabled(vout)) && !vout->vrfb_static_allocation)
if (omap_vout_allocate_vrfb_buffers(vout, count, startindex)) if (omap_vout_allocate_vrfb_buffers(vout, count, startindex))
return -ENOMEM; return -ENOMEM;
...@@ -419,7 +419,7 @@ static int omap_vout_calculate_offset(struct omap_vout_device *vout) ...@@ -419,7 +419,7 @@ static int omap_vout_calculate_offset(struct omap_vout_device *vout)
if (V4L2_PIX_FMT_YUYV == pix->pixelformat || if (V4L2_PIX_FMT_YUYV == pix->pixelformat ||
V4L2_PIX_FMT_UYVY == pix->pixelformat) { V4L2_PIX_FMT_UYVY == pix->pixelformat) {
if (rotation_enabled(vout)) { if (is_rotation_enabled(vout)) {
/* /*
* ps - Actual pixel size for YUYV/UYVY for * ps - Actual pixel size for YUYV/UYVY for
* VRFB/Mirroring is 4 bytes * VRFB/Mirroring is 4 bytes
...@@ -439,7 +439,7 @@ static int omap_vout_calculate_offset(struct omap_vout_device *vout) ...@@ -439,7 +439,7 @@ static int omap_vout_calculate_offset(struct omap_vout_device *vout)
vout->ps = ps; vout->ps = ps;
vout->vr_ps = vr_ps; vout->vr_ps = vr_ps;
if (rotation_enabled(vout)) { if (is_rotation_enabled(vout)) {
line_length = MAX_PIXELS_PER_LINE; line_length = MAX_PIXELS_PER_LINE;
ctop = (pix->height - crop->height) - crop->top; ctop = (pix->height - crop->height) - crop->top;
cleft = (pix->width - crop->width) - crop->left; cleft = (pix->width - crop->width) - crop->left;
...@@ -578,7 +578,7 @@ static int omapvid_setup_overlay(struct omap_vout_device *vout, ...@@ -578,7 +578,7 @@ static int omapvid_setup_overlay(struct omap_vout_device *vout,
/* Setup the input plane parameters according to /* Setup the input plane parameters according to
* rotation value selected. * rotation value selected.
*/ */
if (rotate_90_or_270(vout)) { if (is_rotation_90_or_270(vout)) {
cropheight = vout->crop.width; cropheight = vout->crop.width;
cropwidth = vout->crop.height; cropwidth = vout->crop.height;
pixheight = vout->pix.width; pixheight = vout->pix.width;
...@@ -602,7 +602,7 @@ static int omapvid_setup_overlay(struct omap_vout_device *vout, ...@@ -602,7 +602,7 @@ static int omapvid_setup_overlay(struct omap_vout_device *vout,
info.out_width = outw; info.out_width = outw;
info.out_height = outh; info.out_height = outh;
info.global_alpha = vout->win.global_alpha; info.global_alpha = vout->win.global_alpha;
if (!rotation_enabled(vout)) { if (!is_rotation_enabled(vout)) {
info.rotation = 0; info.rotation = 0;
info.rotation_type = OMAP_DSS_ROT_DMA; info.rotation_type = OMAP_DSS_ROT_DMA;
info.screen_width = pixwidth; info.screen_width = pixwidth;
...@@ -857,11 +857,11 @@ static int omap_vout_buffer_setup(struct videobuf_queue *q, unsigned int *count, ...@@ -857,11 +857,11 @@ static int omap_vout_buffer_setup(struct videobuf_queue *q, unsigned int *count,
if (V4L2_MEMORY_MMAP == vout->memory && *count < startindex) if (V4L2_MEMORY_MMAP == vout->memory && *count < startindex)
*count = startindex; *count = startindex;
if ((rotation_enabled(vout)) && *count > VRFB_NUM_BUFS) if ((is_rotation_enabled(vout)) && *count > VRFB_NUM_BUFS)
*count = VRFB_NUM_BUFS; *count = VRFB_NUM_BUFS;
/* If rotation is enabled, allocate memory for VRFB space also */ /* If rotation is enabled, allocate memory for VRFB space also */
if (rotation_enabled(vout)) if (is_rotation_enabled(vout))
if (omap_vout_vrfb_buffer_setup(vout, count, startindex)) if (omap_vout_vrfb_buffer_setup(vout, count, startindex))
return -ENOMEM; return -ENOMEM;
...@@ -887,7 +887,7 @@ static int omap_vout_buffer_setup(struct videobuf_queue *q, unsigned int *count, ...@@ -887,7 +887,7 @@ static int omap_vout_buffer_setup(struct videobuf_queue *q, unsigned int *count,
virt_addr = omap_vout_alloc_buffer(vout->buffer_size, virt_addr = omap_vout_alloc_buffer(vout->buffer_size,
&phy_addr); &phy_addr);
if (!virt_addr) { if (!virt_addr) {
if (!rotation_enabled(vout)) if (!is_rotation_enabled(vout))
break; break;
/* Free the VRFB buffers if no space for V4L2 buffers */ /* Free the VRFB buffers if no space for V4L2 buffers */
for (j = i; j < *count; j++) { for (j = i; j < *count; j++) {
...@@ -981,7 +981,7 @@ static int omap_vout_buffer_prepare(struct videobuf_queue *q, ...@@ -981,7 +981,7 @@ static int omap_vout_buffer_prepare(struct videobuf_queue *q,
vout->queued_buf_addr[vb->i] = (u8 *)vout->buf_phy_addr[vb->i]; vout->queued_buf_addr[vb->i] = (u8 *)vout->buf_phy_addr[vb->i];
} }
if (!rotation_enabled(vout)) if (!is_rotation_enabled(vout))
return 0; return 0;
dmabuf = vout->buf_phy_addr[vb->i]; dmabuf = vout->buf_phy_addr[vb->i];
...@@ -1348,7 +1348,7 @@ static int vidioc_s_fmt_vid_out(struct file *file, void *fh, ...@@ -1348,7 +1348,7 @@ static int vidioc_s_fmt_vid_out(struct file *file, void *fh,
/* We dont support RGB24-packed mode if vrfb rotation /* We dont support RGB24-packed mode if vrfb rotation
* is enabled*/ * is enabled*/
if ((rotation_enabled(vout)) && if ((is_rotation_enabled(vout)) &&
f->fmt.pix.pixelformat == V4L2_PIX_FMT_RGB24) { f->fmt.pix.pixelformat == V4L2_PIX_FMT_RGB24) {
ret = -EINVAL; ret = -EINVAL;
goto s_fmt_vid_out_exit; goto s_fmt_vid_out_exit;
...@@ -1356,7 +1356,7 @@ static int vidioc_s_fmt_vid_out(struct file *file, void *fh, ...@@ -1356,7 +1356,7 @@ static int vidioc_s_fmt_vid_out(struct file *file, void *fh,
/* get the framebuffer parameters */ /* get the framebuffer parameters */
if (rotate_90_or_270(vout)) { if (is_rotation_90_or_270(vout)) {
vout->fbuf.fmt.height = timing->x_res; vout->fbuf.fmt.height = timing->x_res;
vout->fbuf.fmt.width = timing->y_res; vout->fbuf.fmt.width = timing->y_res;
} else { } else {
...@@ -1536,7 +1536,7 @@ static int vidioc_s_crop(struct file *file, void *fh, struct v4l2_crop *crop) ...@@ -1536,7 +1536,7 @@ static int vidioc_s_crop(struct file *file, void *fh, struct v4l2_crop *crop)
/* get the display device attached to the overlay */ /* get the display device attached to the overlay */
timing = &ovl->manager->device->panel.timings; timing = &ovl->manager->device->panel.timings;
if (rotate_90_or_270(vout)) { if (is_rotation_90_or_270(vout)) {
vout->fbuf.fmt.height = timing->x_res; vout->fbuf.fmt.height = timing->x_res;
vout->fbuf.fmt.width = timing->y_res; vout->fbuf.fmt.width = timing->y_res;
} else { } else {
...@@ -1784,7 +1784,7 @@ static int vidioc_qbuf(struct file *file, void *fh, ...@@ -1784,7 +1784,7 @@ static int vidioc_qbuf(struct file *file, void *fh,
} }
} }
if ((rotation_enabled(vout)) && if ((is_rotation_enabled(vout)) &&
vout->vrfb_dma_tx.req_status == DMA_CHAN_NOT_ALLOTED) { vout->vrfb_dma_tx.req_status == DMA_CHAN_NOT_ALLOTED) {
v4l2_warn(&vout->vid_dev->v4l2_dev, v4l2_warn(&vout->vid_dev->v4l2_dev,
"DMA Channel not allocated for Rotation\n"); "DMA Channel not allocated for Rotation\n");
......
...@@ -173,7 +173,7 @@ struct omap_vout_device { ...@@ -173,7 +173,7 @@ struct omap_vout_device {
/* /*
* Return true if rotation is 90 or 270 * Return true if rotation is 90 or 270
*/ */
static inline int rotate_90_or_270(const struct omap_vout_device *vout) static inline int is_rotation_90_or_270(const struct omap_vout_device *vout)
{ {
return (vout->rotation == dss_rotation_90_degree || return (vout->rotation == dss_rotation_90_degree ||
vout->rotation == dss_rotation_270_degree); vout->rotation == dss_rotation_270_degree);
...@@ -182,7 +182,7 @@ static inline int rotate_90_or_270(const struct omap_vout_device *vout) ...@@ -182,7 +182,7 @@ static inline int rotate_90_or_270(const struct omap_vout_device *vout)
/* /*
* Return true if rotation is enabled * Return true if rotation is enabled
*/ */
static inline int rotation_enabled(const struct omap_vout_device *vout) static inline int is_rotation_enabled(const struct omap_vout_device *vout)
{ {
return vout->rotation || vout->mirror; return vout->rotation || vout->mirror;
} }
......
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