From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mailout2.w1.samsung.com ([210.118.77.12]:19876 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933445AbbDJOWK (ORCPT ); Fri, 10 Apr 2015 10:22:10 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NML000AMHFGFTA0@mailout2.w1.samsung.com> for linux-media@vger.kernel.org; Fri, 10 Apr 2015 15:26:05 +0100 (BST) From: Kamil Debski To: 'Philipp Zabel' , linux-media@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, 'David Airlie' , 'Mauro Carvalho Chehab' , 'Steve Longerbeam' , 'Hans Verkuil' , 'Ian Molton' , 'Jean-Michel Hautbois' , kernel@pengutronix.de, 'Sascha Hauer' , 'Michael Olbrich' References: <1426607290-13380-1-git-send-email-p.zabel@pengutronix.de> <1426607290-13380-6-git-send-email-p.zabel@pengutronix.de> In-reply-to: <1426607290-13380-6-git-send-email-p.zabel@pengutronix.de> Subject: RE: [PATCH 5/5] [media] imx-ipu: Add i.MX IPUv3 scaler driver Date: Fri, 10 Apr 2015 16:22:05 +0200 Message-id: <03ba01d07399$b929f6b0$2b7de410$%debski@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit Content-language: pl Sender: linux-media-owner@vger.kernel.org List-ID: From: linux-media-owner@vger.kernel.org [mailto:linux-media- owner@vger.kernel.org] On Behalf Of Philipp Zabel Sent: Tuesday, March 17, 2015 4:48 PM > > From: Sascha Hauer > > This patch adds support for hardware accelerated scaling and color > space conversion between memory buffers using the IPUv3 IC. > Since the maximum output size of the IC unit is 1024x1024 pixels, > multiple IC tasks with overlapping tiles are used internally to scale > and convert larger frames. > > The IC operates with a burst size of at least 8 pixels. Depending on > the frame width and scaling factor, up to 7 junk pixels may be written > after the end of the frame. The sizeimage is increased accordingly. > > Signed-off-by: Sascha Hauer > Signed-off-by: Michael Olbrich > Signed-off-by: Philipp Zabel Acked-by: Kamil Debski > --- > drivers/gpu/ipu-v3/ipu-ic.c | 28 +- > drivers/media/platform/imx/Kconfig | 9 + > drivers/media/platform/imx/Makefile | 1 + > drivers/media/platform/imx/imx-ipu-scaler.c | 869 > ++++++++++++++++++++++++++++ > drivers/media/platform/imx/imx-ipu.c | 2 +- > drivers/media/platform/imx/imx-ipu.h | 1 + > 6 files changed, 882 insertions(+), 28 deletions(-) create mode > 100644 drivers/media/platform/imx/imx-ipu-scaler.c > > diff --git a/drivers/gpu/ipu-v3/ipu-ic.c b/drivers/gpu/ipu-v3/ipu-ic.c > index 39ee388..984f68f 100644 > --- a/drivers/gpu/ipu-v3/ipu-ic.c > +++ b/drivers/gpu/ipu-v3/ipu-ic.c > @@ -701,7 +701,6 @@ static struct image_convert_ctx > *ipu_image_convert_next(struct ipu_ic *ic) { > struct ipu_ic_priv *priv = ic->priv; > struct ipuv3_channel *ch_in = ic->input_channel; > - struct ipuv3_channel *ch_in_p, *ch_in_n; > struct ipuv3_channel *ch_out = ic->output_channel; > struct image_convert_ctx *ctx; > struct ipu_image *in_p, *in, *in_n; > @@ -748,32 +747,7 @@ static struct image_convert_ctx > *ipu_image_convert_next(struct ipu_ic *ic) > ipu_cpmem_set_burstsize(ch_in, inburst); > ipu_cpmem_set_burstsize(ch_out, outburst); > > - if (ctx->deinterlace) { > - ch_in_p = ic->input_channel_p; > - ch_in_n = ic->input_channel_n; > - > - ipu_cpmem_zero(ch_in_p); > - ipu_cpmem_zero(ch_in_n); > - > - ipu_ic_task_idma_init(ic, ic->input_channel_p, > - in_p->rect.width, in_p->rect.height, > - inburst, IPU_ROTATE_NONE); > - ipu_ic_task_idma_init(ic, ic->input_channel_n, > - in_n->rect.width, in_n->rect.height, > - inburst, IPU_ROTATE_NONE); > - > - ipu_cpmem_set_image(ch_in_p, &ctx->in_p); > - ipu_cpmem_set_image(ch_in_n, &ctx->in_n); > - > - ipu_cpmem_set_burstsize(ch_in_p, inburst); > - ipu_cpmem_set_burstsize(ch_in_n, inburst); > - } > - > - > - if (ctx->deinterlace) > - in_height = in->rect.height * 2; > - else > - in_height = in->rect.height; > + in_height = in->rect.height; > > dev_dbg(priv->ipu->dev, "%s: %dx%d(%dx%d@%d,%d) - > > %dx%d(%dx%d@%d,%d)\n", > __func__, in->pix.width, in->pix.height, diff --git > a/drivers/media/platform/imx/Kconfig > b/drivers/media/platform/imx/Kconfig > index a90c973..4694367 100644 > --- a/drivers/media/platform/imx/Kconfig > +++ b/drivers/media/platform/imx/Kconfig > @@ -1,2 +1,11 @@ > config VIDEO_IMX_IPU_COMMON > tristate > + > +config VIDEO_IMX_IPU_SCALER > + tristate "i.MX5/6 IPUv3 based image scaler driver" > + depends on VIDEO_DEV && IMX_IPUV3_CORE > + select VIDEOBUF2_DMA_CONTIG > + select VIDEO_IMX_IPU_COMMON > + select V4L2_MEM2MEM_DEV > + ---help--- > + This is a v4l2 scaler video driver for the IPUv3 on i.MX5/6. > diff --git a/drivers/media/platform/imx/Makefile > b/drivers/media/platform/imx/Makefile > index 5de119c..f20aa0b 100644 > --- a/drivers/media/platform/imx/Makefile > +++ b/drivers/media/platform/imx/Makefile > @@ -1 +1,2 @@ > obj-$(CONFIG_VIDEO_IMX_IPU_COMMON) += imx-ipu.o > +obj-$(CONFIG_VIDEO_IMX_IPU_SCALER) += imx-ipu-scaler.o > diff --git a/drivers/media/platform/imx/imx-ipu-scaler.c > b/drivers/media/platform/imx/imx-ipu-scaler.c > new file mode 100644 > index 0000000..9cf8a70 > --- /dev/null > +++ b/drivers/media/platform/imx/imx-ipu-scaler.c > @@ -0,0 +1,869 @@ > +/* > + * i.MX IPUv3 scaler driver > + * > + * Copyright (C) 2011 Sascha Hauer, Pengutronix > + * > + * based on the mem2mem test driver > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License > + * as published by the Free Software Foundation; either version 2 > + * of the License, or (at your option) any later version. > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + */ > +#include > +#include > +#include > +#include > +#include > +#include > +#include