diff mbox

[v2,media] imx: csi: enable double write reduction

Message ID 20170719163420.27608-1-p.zabel@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Philipp Zabel July 19, 2017, 4:34 p.m. UTC
For 4:2:0 subsampled YUV formats, avoid chroma overdraw by only writing
chroma for even lines. Reduces necessary write memory bandwidth by 25%.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
Changes since v1:
 - Move odd row skipping setup into existing switch statement.
---
 drivers/staging/media/imx/imx-media-csi.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Steve Longerbeam July 19, 2017, 4:35 p.m. UTC | #1
Acked-by: Steve Longerbeam <steve_longerbeam@mentor.com>

On 07/19/2017 09:34 AM, Philipp Zabel wrote:
> For 4:2:0 subsampled YUV formats, avoid chroma overdraw by only writing
> chroma for even lines. Reduces necessary write memory bandwidth by 25%.
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
> Changes since v1:
>   - Move odd row skipping setup into existing switch statement.
> ---
>   drivers/staging/media/imx/imx-media-csi.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
> index a2d26693912ec..f2d64d1eeff80 100644
> --- a/drivers/staging/media/imx/imx-media-csi.c
> +++ b/drivers/staging/media/imx/imx-media-csi.c
> @@ -357,6 +357,8 @@ static int csi_idmac_setup_channel(struct csi_priv *priv)
>   		passthrough = (sensor_ep->bus_type != V4L2_MBUS_CSI2 &&
>   			       sensor_ep->bus.parallel.bus_width >= 16);
>   		passthrough_bits = 16;
> +		/* Skip writing U and V components to odd rows */
> +		ipu_cpmem_skip_odd_chroma_rows(priv->idmac_ch);
>   		break;
>   	case V4L2_PIX_FMT_YUYV:
>   	case V4L2_PIX_FMT_UYVY:
>
diff mbox

Patch

diff --git a/drivers/staging/media/imx/imx-media-csi.c b/drivers/staging/media/imx/imx-media-csi.c
index a2d26693912ec..f2d64d1eeff80 100644
--- a/drivers/staging/media/imx/imx-media-csi.c
+++ b/drivers/staging/media/imx/imx-media-csi.c
@@ -357,6 +357,8 @@  static int csi_idmac_setup_channel(struct csi_priv *priv)
 		passthrough = (sensor_ep->bus_type != V4L2_MBUS_CSI2 &&
 			       sensor_ep->bus.parallel.bus_width >= 16);
 		passthrough_bits = 16;
+		/* Skip writing U and V components to odd rows */
+		ipu_cpmem_skip_odd_chroma_rows(priv->idmac_ch);
 		break;
 	case V4L2_PIX_FMT_YUYV:
 	case V4L2_PIX_FMT_UYVY: