aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorSteve Longerbeam <slongerbeam@gmail.com>2014-06-25 21:05:52 -0400
committerPhilipp Zabel <p.zabel@pengutronix.de>2014-09-02 08:55:54 -0400
commit2094b603ae59be6785e52a00d09b47b6ae910154 (patch)
tree3d81e8539269ee774bc19e4f6f218b2a59403d68 /drivers/gpu
parentc42d37ca421aa222e8f27744d4129bce726a3724 (diff)
gpu: ipu-cpmem: Add second buffer support to ipu_cpmem_set_image()
Add a second buffer physaddr to struct ipu_image, for double-buffering support. Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/ipu-v3/ipu-cpmem.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/gpu/ipu-v3/ipu-cpmem.c b/drivers/gpu/ipu-v3/ipu-cpmem.c
index f52e4b4e172f..cfe2f53f2c17 100644
--- a/drivers/gpu/ipu-v3/ipu-cpmem.c
+++ b/drivers/gpu/ipu-v3/ipu-cpmem.c
@@ -538,7 +538,7 @@ EXPORT_SYMBOL_GPL(ipu_cpmem_set_fmt);
538int ipu_cpmem_set_image(struct ipuv3_channel *ch, struct ipu_image *image) 538int ipu_cpmem_set_image(struct ipuv3_channel *ch, struct ipu_image *image)
539{ 539{
540 struct v4l2_pix_format *pix = &image->pix; 540 struct v4l2_pix_format *pix = &image->pix;
541 int y_offset, u_offset, v_offset; 541 int offset, y_offset, u_offset, v_offset;
542 542
543 pr_debug("%s: resolution: %dx%d stride: %d\n", 543 pr_debug("%s: resolution: %dx%d stride: %d\n",
544 __func__, pix->width, pix->height, 544 __func__, pix->width, pix->height,
@@ -560,30 +560,30 @@ int ipu_cpmem_set_image(struct ipuv3_channel *ch, struct ipu_image *image)
560 560
561 ipu_cpmem_set_yuv_planar_full(ch, pix->pixelformat, 561 ipu_cpmem_set_yuv_planar_full(ch, pix->pixelformat,
562 pix->bytesperline, u_offset, v_offset); 562 pix->bytesperline, u_offset, v_offset);
563 ipu_cpmem_set_buffer(ch, 0, image->phys + y_offset); 563 ipu_cpmem_set_buffer(ch, 0, image->phys0 + y_offset);
564 ipu_cpmem_set_buffer(ch, 1, image->phys1 + y_offset);
564 break; 565 break;
565 case V4L2_PIX_FMT_UYVY: 566 case V4L2_PIX_FMT_UYVY:
566 case V4L2_PIX_FMT_YUYV: 567 case V4L2_PIX_FMT_YUYV:
567 ipu_cpmem_set_buffer(ch, 0, image->phys + 568 case V4L2_PIX_FMT_RGB565:
568 image->rect.left * 2 + 569 offset = image->rect.left * 2 +
569 image->rect.top * image->pix.bytesperline); 570 image->rect.top * pix->bytesperline;
571 ipu_cpmem_set_buffer(ch, 0, image->phys0 + offset);
572 ipu_cpmem_set_buffer(ch, 1, image->phys1 + offset);
570 break; 573 break;
571 case V4L2_PIX_FMT_RGB32: 574 case V4L2_PIX_FMT_RGB32:
572 case V4L2_PIX_FMT_BGR32: 575 case V4L2_PIX_FMT_BGR32:
573 ipu_cpmem_set_buffer(ch, 0, image->phys + 576 offset = image->rect.left * 4 +
574 image->rect.left * 4 + 577 image->rect.top * pix->bytesperline;
575 image->rect.top * image->pix.bytesperline); 578 ipu_cpmem_set_buffer(ch, 0, image->phys0 + offset);
576 break; 579 ipu_cpmem_set_buffer(ch, 1, image->phys1 + offset);
577 case V4L2_PIX_FMT_RGB565:
578 ipu_cpmem_set_buffer(ch, 0, image->phys +
579 image->rect.left * 2 +
580 image->rect.top * image->pix.bytesperline);
581 break; 580 break;
582 case V4L2_PIX_FMT_RGB24: 581 case V4L2_PIX_FMT_RGB24:
583 case V4L2_PIX_FMT_BGR24: 582 case V4L2_PIX_FMT_BGR24:
584 ipu_cpmem_set_buffer(ch, 0, image->phys + 583 offset = image->rect.left * 3 +
585 image->rect.left * 3 + 584 image->rect.top * pix->bytesperline;
586 image->rect.top * image->pix.bytesperline); 585 ipu_cpmem_set_buffer(ch, 0, image->phys0 + offset);
586 ipu_cpmem_set_buffer(ch, 1, image->phys1 + offset);
587 break; 587 break;
588 default: 588 default:
589 return -EINVAL; 589 return -EINVAL;