gpu: ipu-v3: image-convert: allow three rows or columns
authorPhilipp Zabel <p.zabel@pengutronix.de>
Tue, 18 Sep 2018 09:34:21 +0000 (11:34 +0200)
committerPhilipp Zabel <p.zabel@pengutronix.de>
Mon, 5 Nov 2018 13:40:08 +0000 (14:40 +0100)
If width or height are in the [2049, 3072] range, allow to
use just three tiles in this dimension, instead of four.

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

index 3e73494..13103ab 100644 (file)
@@ -379,12 +379,7 @@ static int alloc_dma_buf(struct ipu_image_convert_priv *priv,
 
 static inline int num_stripes(int dim)
 {
-       if (dim <= 1024)
-               return 1;
-       else if (dim <= 2048)
-               return 2;
-       else
-               return 4;
+       return (dim - 1) / 1024 + 1;
 }
 
 /*