gpu: ipu-v3: image-convert: Enable double write reduction
authorSteve Longerbeam <slongerbeam@gmail.com>
Fri, 14 Jun 2019 01:02:55 +0000 (18:02 -0700)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Fri, 14 Jun 2019 13:33:02 +0000 (15:33 +0200)
For the write channels with 4:2:0 subsampled YUV formats, avoid chroma
overdraw by only writing chroma for even lines (skip odd chroma rows).
This reduces necessary write memory bandwidth by at least 25% (more
with rotation enabled).

Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
drivers/gpu/ipu-v3/ipu-image-convert.c

index d2457fde25fab2bf2c488cf823646d1d61ee0d63..61643382bbde57dc62fe40ecf01bb85dc14a92bb 100644 (file)
@@ -1280,6 +1280,15 @@ static void init_idmac_channel(struct ipu_image_convert_ctx *ctx,
        if (rot_mode)
                ipu_cpmem_set_rotation(channel, rot_mode);
 
+       /*
+        * Skip writing U and V components to odd rows in the output
+        * channels for planar 4:2:0.
+        */
+       if ((channel == chan->out_chan ||
+            channel == chan->rotation_out_chan) &&
+           image->fmt->planar && image->fmt->uv_height_dec == 2)
+               ipu_cpmem_skip_odd_chroma_rows(channel);
+
        if (channel == chan->rotation_in_chan ||
            channel == chan->rotation_out_chan) {
                burst_size = 8;