The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] media: imx: prpencvf: enable double write reduction
@ 2017-07-22 21:21 Steve Longerbeam
  2017-07-22 22:04 ` Steve Longerbeam
  2017-07-24  7:21 ` Philipp Zabel
  0 siblings, 2 replies; 4+ messages in thread
From: Steve Longerbeam @ 2017-07-22 21:21 UTC (permalink / raw)
  To: Philipp Zabel, Mauro Carvalho Chehab, Greg Kroah-Hartman
  Cc: linux-media, devel, linux-kernel, Steve Longerbeam

For the write channels with 4:2:0 subsampled YUV formats, avoid chroma
overdraw by only writing chroma for even lines. Reduces necessary write
memory bandwidth by at least 25% (more with rotation enabled).

Signed-off-by: Steve Longerbeam <steve_longerbeam@mentor.com>
---
 drivers/staging/media/imx/imx-ic-prpencvf.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/staging/media/imx/imx-ic-prpencvf.c b/drivers/staging/media/imx/imx-ic-prpencvf.c
index ed363fe..42c5045 100644
--- a/drivers/staging/media/imx/imx-ic-prpencvf.c
+++ b/drivers/staging/media/imx/imx-ic-prpencvf.c
@@ -374,6 +374,17 @@ static int prp_setup_channel(struct prp_priv *priv,
 	image.phys0 = addr0;
 	image.phys1 = addr1;
 
+	if (channel == priv->out_ch || channel == priv->rot_out_ch) {
+		switch (image.pix.pixelformat) {
+		case V4L2_PIX_FMT_YUV420:
+		case V4L2_PIX_FMT_YVU420:
+		case V4L2_PIX_FMT_NV12:
+			/* Skip writing U and V components to odd rows */
+			ipu_cpmem_skip_odd_chroma_rows(channel);
+			break;
+		}
+	}
+
 	ret = ipu_cpmem_set_image(channel, &image);
 	if (ret)
 		return ret;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-24  7:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-22 21:21 [PATCH] media: imx: prpencvf: enable double write reduction Steve Longerbeam
2017-07-22 22:04 ` Steve Longerbeam
2017-07-24  7:21   ` Philipp Zabel
2017-07-24  7:21 ` Philipp Zabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox