From patchwork Mon Jul 17 10:33:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todor Tomov X-Patchwork-Id: 107883 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp4340164qge; Mon, 17 Jul 2017 03:35:02 -0700 (PDT) X-Received: by 10.84.201.6 with SMTP id u6mr29689566pld.251.1500287702164; Mon, 17 Jul 2017 03:35:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500287702; cv=none; d=google.com; s=arc-20160816; b=NxtLswECBsvICFIh6JcCFb4cQ1+AcCopp0bki6LMBiWEklDSEmS+ufmZz/4qnO3pBc JDSS/u9EYqTABbTe10t0FckEQduFpij0vQHJqdS53mroYhjTyz+ViXtZOuB4QK5gcx1b ckiJEpuYqVVhvQo67pYcROINsz0dmqUxd1rC0pndHFrbiKxdLvsnEzfysLHTkEepPAGq sgrNOpDwvWcnqV8IBqBdx34/FKZLOpntdxzYy+jOVybTPd0M7DqMy6agrv4pRWm2tKhT qSf3T/i2d6NrM5QQ7GTw0Va/gLiFWO0gA+FGS4VwI87szqlvkPqYxJsK5wAGk890Mv/z Oy2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=9tHYUP4fLYFnr7UM2nSe7iGRBUXzhBcRJJ7RcBNAs1g=; b=fxg7DNKgQMc4xJFHXVzxkSyVzzj2XsnTcuH7w2mZ5RRUDY95YwQAxSBmYkTsGq2Zuw 8akPkHN3qWmHjH35PQJ4TmSPi1e887EOe3HcLPK+Ac7hsU7osQbdMoBdVtUwx24lCCTO 7X/5zwd/N4PoJ2vVfXdlngTpTaRvsU117EMozs/mHLnatgnNBTYNgU5o6SECAw65pWAb IQocrMYhxEO7U3gGSLI3AOeVZIBDubTBc+mJr4xzgGD0ASab1VQ3pmSnEzmw0cMtmOj6 sbt/znfu7aUHIOui/ooDCqBTsNxGiUBHIr5TBxysnJn0q9wPwD/2GcH8x4JF/XipOzn+ rgjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si12931161pll.211.2017.07.17.03.35.01; Mon, 17 Jul 2017 03:35:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751312AbdGQKfA (ORCPT + 10 others); Mon, 17 Jul 2017 06:35:00 -0400 Received: from ns.mm-sol.com ([37.157.136.199]:36026 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751294AbdGQKe7 (ORCPT ); Mon, 17 Jul 2017 06:34:59 -0400 Received: from mms-0439.qualcomm.mm-sol.com (unknown [37.157.136.206]) by extserv.mm-sol.com (Postfix) with ESMTPSA id D5438CBB8; Mon, 17 Jul 2017 13:34:57 +0300 (EEST) From: Todor Tomov To: mchehab@kernel.org, hans.verkuil@cisco.com, javier@osg.samsung.com, s.nawrocki@samsung.com, sakari.ailus@iki.fi, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Todor Tomov Subject: [PATCH v3 01/23] [media] media: Make parameter of media_entity_remote_pad() const Date: Mon, 17 Jul 2017 13:33:27 +0300 Message-Id: <1500287629-23703-2-git-send-email-todor.tomov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500287629-23703-1-git-send-email-todor.tomov@linaro.org> References: <1500287629-23703-1-git-send-email-todor.tomov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The local pad parameter in media_entity_remote_pad() is not modified. Make that explicit by adding a const modifier. Signed-off-by: Todor Tomov Acked-by: Sakari Ailus --- drivers/media/media-entity.c | 2 +- include/media/media-entity.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index dd0f0ea..2ace041 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -917,7 +917,7 @@ media_entity_find_link(struct media_pad *source, struct media_pad *sink) } EXPORT_SYMBOL_GPL(media_entity_find_link); -struct media_pad *media_entity_remote_pad(struct media_pad *pad) +struct media_pad *media_entity_remote_pad(const struct media_pad *pad) { struct media_link *link; diff --git a/include/media/media-entity.h b/include/media/media-entity.h index 754182d..222d379 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -805,7 +805,7 @@ struct media_link *media_entity_find_link(struct media_pad *source, * Return: returns a pointer to the pad at the remote end of the first found * enabled link, or %NULL if no enabled link has been found. */ -struct media_pad *media_entity_remote_pad(struct media_pad *pad); +struct media_pad *media_entity_remote_pad(const struct media_pad *pad); /** * media_entity_get - Get a reference to the parent module From patchwork Mon Jul 17 10:33:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todor Tomov X-Patchwork-Id: 107885 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp4340343qge; Mon, 17 Jul 2017 03:35:12 -0700 (PDT) X-Received: by 10.98.139.11 with SMTP id j11mr18558603pfe.18.1500287712704; Mon, 17 Jul 2017 03:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500287712; cv=none; d=google.com; s=arc-20160816; b=zsejphmGj6TVNN51olIxvmjp+ghYyxDkoqFW/D6qd8Xggpv8qUH0ql6qfpBe8dW3vI ukSBBYQlHzCan7Mcl4B/zPwN2M2Bc+r5FtjV3atAhBZOOWGLD1S1Cb3G+DSZyWuwucHS F5//4VDudzv9FZvm8jcAYVH/nOpihLZpgp0yKTNDZwi7k9XzYfwazzwjG76y922CoS57 lQ07PYFhjuF79ypNcMQfD2JJdn5kXilm/3zO2YpTWanhkBOn6Jsfobiq7KPmEK3zPrS6 HOMiSLkHQbZ0/sQ7f/92qBgIUYN/1M0KJVGC8DKxa7ejUkhZTcp/ZJwANBim3M3/SKN/ u9yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=7rV0wP+yEV0n0L4OOFQhGzfK+bdTg4cffy/7vEywrB8=; b=M77dV/Np+ASC1+B5wbEXMw+XpRZhsrgIkaFFCtsesoNSBvDlJW+57EhrHSkE1oe3ZJ nvPqCppBO3keLDBWJ2dd77PTQ5L5sb92fqElRP2P7JkXHkUkdNsLkJz8Eo3WbBQLK1BN d78NiqIV7Po4gdYcnMuVxk8gfg9mA0reJxu1ftcuW20sbL+/hFWjZ5+WG9vE690mFfQ5 1tWIpJG8Rxa+yhnPrWviqs/kIke82M3UGrXeI/mvJgrQUAxOY0x+Qb6C84qOEAR0ctgz Q3LShd1g4FrYZ/Tbi4YD1qZ0nM9qh/4ymJM7wLKKirh6qca9yCzBpo76FjBlJFxh1OR7 NBQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g5si12751517pgk.185.2017.07.17.03.35.12; Mon, 17 Jul 2017 03:35:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751410AbdGQKfK (ORCPT + 10 others); Mon, 17 Jul 2017 06:35:10 -0400 Received: from ns.mm-sol.com ([37.157.136.199]:36144 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751383AbdGQKfE (ORCPT ); Mon, 17 Jul 2017 06:35:04 -0400 Received: from mms-0439.qualcomm.mm-sol.com (unknown [37.157.136.206]) by extserv.mm-sol.com (Postfix) with ESMTPSA id DAEBBCBED; Mon, 17 Jul 2017 13:34:58 +0300 (EEST) From: Todor Tomov To: mchehab@kernel.org, hans.verkuil@cisco.com, javier@osg.samsung.com, s.nawrocki@samsung.com, sakari.ailus@iki.fi, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Todor Tomov Subject: [PATCH v3 13/23] media: camss: Enable building Date: Mon, 17 Jul 2017 13:33:39 +0300 Message-Id: <1500287629-23703-14-git-send-email-todor.tomov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500287629-23703-1-git-send-email-todor.tomov@linaro.org> References: <1500287629-23703-1-git-send-email-todor.tomov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Add Makefile and update platform/Kconfig and platform/Makefile to enable building of the QCom CAMSS driver. Signed-off-by: Todor Tomov --- drivers/media/platform/Kconfig | 7 +++++++ drivers/media/platform/Makefile | 2 ++ drivers/media/platform/qcom/camss-8x16/Makefile | 11 +++++++++++ 3 files changed, 20 insertions(+) create mode 100644 drivers/media/platform/qcom/camss-8x16/Makefile -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig index 1313cd5..87be341 100644 --- a/drivers/media/platform/Kconfig +++ b/drivers/media/platform/Kconfig @@ -109,6 +109,13 @@ config VIDEO_PXA27x ---help--- This is a v4l2 driver for the PXA27x Quick Capture Interface +config VIDEO_QCOM_CAMSS + tristate "Qualcomm 8x16 V4L2 Camera Subsystem driver" + depends on VIDEO_V4L2 && VIDEO_V4L2_SUBDEV_API + depends on (ARCH_QCOM && IOMMU_DMA) || COMPILE_TEST + select VIDEOBUF2_DMA_SG + select V4L2_FWNODE + config VIDEO_S3C_CAMIF tristate "Samsung S3C24XX/S3C64XX SoC Camera Interface driver" depends on VIDEO_V4L2 && I2C && VIDEO_V4L2_SUBDEV_API diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile index 9beadc7..10c099c 100644 --- a/drivers/media/platform/Makefile +++ b/drivers/media/platform/Makefile @@ -85,4 +85,6 @@ obj-$(CONFIG_VIDEO_MEDIATEK_MDP) += mtk-mdp/ obj-$(CONFIG_VIDEO_MEDIATEK_JPEG) += mtk-jpeg/ +obj-$(CONFIG_VIDEO_QCOM_CAMSS) += qcom/camss-8x16/ + obj-$(CONFIG_VIDEO_QCOM_VENUS) += qcom/venus/ diff --git a/drivers/media/platform/qcom/camss-8x16/Makefile b/drivers/media/platform/qcom/camss-8x16/Makefile new file mode 100644 index 0000000..3c4024f --- /dev/null +++ b/drivers/media/platform/qcom/camss-8x16/Makefile @@ -0,0 +1,11 @@ +# Makefile for Qualcomm CAMSS driver + +qcom-camss-objs += \ + camss.o \ + camss-csid.o \ + camss-csiphy.o \ + camss-ispif.o \ + camss-vfe.o \ + camss-video.o \ + +obj-$(CONFIG_VIDEO_QCOM_CAMSS) += qcom-camss.o From patchwork Mon Jul 17 10:33:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todor Tomov X-Patchwork-Id: 107889 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp4341985qge; Mon, 17 Jul 2017 03:36:55 -0700 (PDT) X-Received: by 10.101.91.203 with SMTP id o11mr28289671pgr.206.1500287814901; Mon, 17 Jul 2017 03:36:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500287814; cv=none; d=google.com; s=arc-20160816; b=ICQZm2bnwNXjARxG/O/CPcSTwVE0aK1muYtclqkmCkk/VoOaRcRdgh0jCh7T6yCn3E rC5MsTRp/DM0sJeqghqJzpLCmyL/p3/gnw2ppVrzV+l5/qI0ULqFHOjomf/3n6T8l326 dZbzUgk+FoAnDDnfAC2JUoWA5SAa3fdgkDJ600B9EYhdbQZ0WEU2nakJ8iG/71VlsqbQ F4ZWLqjHQYBMkxVwM5R87Om6ht0ZxeeVmlMD+7m7yKgkPX+URnSkm/mbTTw2gTZmQSbB ZWWXcbyxF8MBJrlp8mGMo3NyGz/lkRvvuOkProYumko6cqexpYVIlAzscDnwTZStC8W5 eEEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=wxkMfUvuMemsOLwl6xu86jDAIkJloTmFef3/UGbjth4=; b=uJ/QVCmIiZVrUoNrRxeO8AHJ3ZyyNr4tB6kKsHpkGjYeoUj5pLCmHeB61hkYj6GejR HoB1hJoJKO0vnifigkrJnhKD9orOBztX5ZRA9G1T+ltg7tDJRicGznq4nwy6Ad26LsCA hOX8o8oWd4kxdkQFhO8uXPON4MEZi5SqwrkhJT2QuIYVuSaVwLQf2R5bdUjBZ0kwkc/z 4raQ8sHZo+2s22r9izz27AJlHdon+ednk3oXYhBCSlShYsO7o2acLAZ62GA9R9gC7xtp jWFdrfRJe/v69Pp7KLuFfystwsckdVaFBoJDzQ4R4wjHRX4W9GwMR/bfHYG2QWl/XfUS KfRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si1070572pln.417.2017.07.17.03.36.54; Mon, 17 Jul 2017 03:36:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751541AbdGQKgx (ORCPT + 10 others); Mon, 17 Jul 2017 06:36:53 -0400 Received: from ns.mm-sol.com ([37.157.136.199]:36083 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751300AbdGQKfH (ORCPT ); Mon, 17 Jul 2017 06:35:07 -0400 Received: from mms-0439.qualcomm.mm-sol.com (unknown [37.157.136.206]) by extserv.mm-sol.com (Postfix) with ESMTPSA id 4FD08CBF3; Mon, 17 Jul 2017 13:34:59 +0300 (EEST) From: Todor Tomov To: mchehab@kernel.org, hans.verkuil@cisco.com, javier@osg.samsung.com, s.nawrocki@samsung.com, sakari.ailus@iki.fi, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Todor Tomov Subject: [PATCH v3 19/23] camss: vfe: Add interface for cropping Date: Mon, 17 Jul 2017 13:33:45 +0300 Message-Id: <1500287629-23703-20-git-send-email-todor.tomov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500287629-23703-1-git-send-email-todor.tomov@linaro.org> References: <1500287629-23703-1-git-send-email-todor.tomov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Extend selection ioctls to handle cropping configuration. Signed-off-by: Todor Tomov --- drivers/media/platform/qcom/camss-8x16/camss-vfe.c | 191 ++++++++++++++++----- drivers/media/platform/qcom/camss-8x16/camss-vfe.h | 1 + 2 files changed, 150 insertions(+), 42 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/platform/qcom/camss-8x16/camss-vfe.c b/drivers/media/platform/qcom/camss-8x16/camss-vfe.c index f994b35..17617c0 100644 --- a/drivers/media/platform/qcom/camss-8x16/camss-vfe.c +++ b/drivers/media/platform/qcom/camss-8x16/camss-vfe.c @@ -1961,6 +1961,26 @@ __vfe_get_compose(struct vfe_line *line, } /* + * __vfe_get_crop - Get pointer to crop selection structure + * @line: VFE line + * @cfg: V4L2 subdev pad configuration + * @which: TRY or ACTIVE format + * + * Return pointer to TRY or ACTIVE crop rectangle structure + */ +static struct v4l2_rect * +__vfe_get_crop(struct vfe_line *line, + struct v4l2_subdev_pad_config *cfg, + enum v4l2_subdev_format_whence which) +{ + if (which == V4L2_SUBDEV_FORMAT_TRY) + return v4l2_subdev_get_try_crop(&line->subdev, cfg, + MSM_VFE_PAD_SRC); + + return &line->crop; +} + +/* * vfe_try_format - Handle try format by pad subdev method * @line: VFE line * @cfg: V4L2 subdev pad configuration @@ -2008,7 +2028,7 @@ static void vfe_try_format(struct vfe_line *line, if (line->id == VFE_LINE_PIX) { struct v4l2_rect *rect; - rect = __vfe_get_compose(line, cfg, which); + rect = __vfe_get_crop(line, cfg, which); fmt->width = rect->width; fmt->height = rect->height; @@ -2093,6 +2113,49 @@ static void vfe_try_compose(struct vfe_line *line, } /* + * vfe_try_crop - Handle try crop selection by pad subdev method + * @line: VFE line + * @cfg: V4L2 subdev pad configuration + * @rect: pointer to v4l2 rect structure + * @which: wanted subdev format + */ +static void vfe_try_crop(struct vfe_line *line, + struct v4l2_subdev_pad_config *cfg, + struct v4l2_rect *rect, + enum v4l2_subdev_format_whence which) +{ + struct v4l2_rect *compose; + + compose = __vfe_get_compose(line, cfg, which); + + if (rect->width > compose->width) + rect->width = compose->width; + + if (rect->width + rect->left > compose->width) + rect->left = compose->width - rect->width; + + if (rect->height > compose->height) + rect->height = compose->height; + + if (rect->height + rect->top > compose->height) + rect->top = compose->height - rect->height; + + /* wm in line based mode writes multiple of 16 horizontally */ + rect->left += (rect->width & 0xf) >> 1; + rect->width &= ~0xf; + + if (rect->width < 16) { + rect->left = 0; + rect->width = 16; + } + + if (rect->height < 4) { + rect->top = 0; + rect->height = 4; + } +} + +/* * vfe_enum_mbus_code - Handle pixel format enumeration * @sd: VFE V4L2 subdevice * @cfg: V4L2 subdev pad configuration @@ -2256,34 +2319,58 @@ static int vfe_get_selection(struct v4l2_subdev *sd, { struct vfe_line *line = v4l2_get_subdevdata(sd); struct v4l2_subdev_format fmt = { 0 }; - struct v4l2_rect *compose; + struct v4l2_rect *rect; int ret; - if (line->id != VFE_LINE_PIX || sel->pad != MSM_VFE_PAD_SINK) + if (line->id != VFE_LINE_PIX) return -EINVAL; - switch (sel->target) { - case V4L2_SEL_TGT_COMPOSE_BOUNDS: - fmt.pad = sel->pad; - fmt.which = sel->which; - ret = vfe_get_format(sd, cfg, &fmt); - if (ret < 0) - return ret; - sel->r.left = 0; - sel->r.top = 0; - sel->r.width = fmt.format.width; - sel->r.height = fmt.format.height; - break; - case V4L2_SEL_TGT_COMPOSE: - compose = __vfe_get_compose(line, cfg, sel->which); - if (compose == NULL) + if (sel->pad == MSM_VFE_PAD_SINK) + switch (sel->target) { + case V4L2_SEL_TGT_COMPOSE_BOUNDS: + fmt.pad = sel->pad; + fmt.which = sel->which; + ret = vfe_get_format(sd, cfg, &fmt); + if (ret < 0) + return ret; + + sel->r.left = 0; + sel->r.top = 0; + sel->r.width = fmt.format.width; + sel->r.height = fmt.format.height; + break; + case V4L2_SEL_TGT_COMPOSE: + rect = __vfe_get_compose(line, cfg, sel->which); + if (rect == NULL) + return -EINVAL; + + sel->r = *rect; + break; + default: return -EINVAL; + } + else if (sel->pad == MSM_VFE_PAD_SRC) + switch (sel->target) { + case V4L2_SEL_TGT_CROP_BOUNDS: + rect = __vfe_get_compose(line, cfg, sel->which); + if (rect == NULL) + return -EINVAL; - sel->r = *compose; - break; - default: - return -EINVAL; - } + sel->r.left = rect->left; + sel->r.top = rect->top; + sel->r.width = rect->width; + sel->r.height = rect->height; + break; + case V4L2_SEL_TGT_CROP: + rect = __vfe_get_crop(line, cfg, sel->which); + if (rect == NULL) + return -EINVAL; + + sel->r = *rect; + break; + default: + return -EINVAL; + } return 0; } @@ -2301,33 +2388,53 @@ int vfe_set_selection(struct v4l2_subdev *sd, struct v4l2_subdev_selection *sel) { struct vfe_line *line = v4l2_get_subdevdata(sd); - struct v4l2_rect *compose; - struct v4l2_subdev_format fmt = { 0 }; + struct v4l2_rect *rect; int ret; - if (line->id != VFE_LINE_PIX || sel->pad != MSM_VFE_PAD_SINK) + if (line->id != VFE_LINE_PIX) return -EINVAL; - if (sel->target != V4L2_SEL_TGT_COMPOSE) - return -EINVAL; + if (sel->target == V4L2_SEL_TGT_COMPOSE && + sel->pad == MSM_VFE_PAD_SINK) { + struct v4l2_subdev_selection crop = { 0 }; - compose = __vfe_get_compose(line, cfg, sel->which); - if (compose == NULL) - return -EINVAL; + rect = __vfe_get_compose(line, cfg, sel->which); + if (rect == NULL) + return -EINVAL; + + vfe_try_compose(line, cfg, &sel->r, sel->which); + *rect = sel->r; + + /* Reset source crop selection */ + crop.which = sel->which; + crop.pad = MSM_VFE_PAD_SRC; + crop.target = V4L2_SEL_TGT_CROP; + crop.r = *rect; + ret = vfe_set_selection(sd, cfg, &crop); + } else if (sel->target == V4L2_SEL_TGT_CROP && + sel->pad == MSM_VFE_PAD_SRC) { + struct v4l2_subdev_format fmt = { 0 }; + + rect = __vfe_get_crop(line, cfg, sel->which); + if (rect == NULL) + return -EINVAL; - vfe_try_compose(line, cfg, &sel->r, sel->which); - *compose = sel->r; + vfe_try_crop(line, cfg, &sel->r, sel->which); + *rect = sel->r; - /* Reset source pad format width and height */ - fmt.which = sel->which; - fmt.pad = MSM_VFE_PAD_SRC; - ret = vfe_get_format(sd, cfg, &fmt); - if (ret < 0) - return ret; + /* Reset source pad format width and height */ + fmt.which = sel->which; + fmt.pad = MSM_VFE_PAD_SRC; + ret = vfe_get_format(sd, cfg, &fmt); + if (ret < 0) + return ret; - fmt.format.width = compose->width; - fmt.format.height = compose->height; - ret = vfe_set_format(sd, cfg, &fmt); + fmt.format.width = rect->width; + fmt.format.height = rect->height; + ret = vfe_set_format(sd, cfg, &fmt); + } else { + ret = -EINVAL; + } return ret; } diff --git a/drivers/media/platform/qcom/camss-8x16/camss-vfe.h b/drivers/media/platform/qcom/camss-8x16/camss-vfe.h index 6518c7a..3651ece 100644 --- a/drivers/media/platform/qcom/camss-8x16/camss-vfe.h +++ b/drivers/media/platform/qcom/camss-8x16/camss-vfe.h @@ -81,6 +81,7 @@ struct vfe_line { struct media_pad pads[MSM_VFE_PADS_NUM]; struct v4l2_mbus_framefmt fmt[MSM_VFE_PADS_NUM]; struct v4l2_rect compose; + struct v4l2_rect crop; struct camss_video video_out; struct vfe_output output; }; From patchwork Mon Jul 17 10:33:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todor Tomov X-Patchwork-Id: 107888 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp4341949qge; Mon, 17 Jul 2017 03:36:53 -0700 (PDT) X-Received: by 10.99.96.193 with SMTP id u184mr8312237pgb.125.1500287813472; Mon, 17 Jul 2017 03:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500287813; cv=none; d=google.com; s=arc-20160816; b=gfGwgQCcmHjgVRUYCQidxqOHrZMhdL4Jn+53oCfMaLwHQuvXn61JtoeqvERKh12LCL eYMur9z0uMyj1he2AQdXiZRcncL5rhXSPHlXoJ4bQE476F7b5MGuq76MOnitTC/06veR DBLyaZWcmBSek56jotRLbz90rYgZ763XVoJpS/ZtJAw65qeo5sThNvWv7kwdr7B0L4Zk YchM6/CtJpY9nbtZXs8TL8CPmv3IAlJ8ygb/rXuGHygYFfxdp+iO4HVQtAqSjgKywUxP ZWFoALHK9QkCBQDkXO4ATGW36n9UGpnClBgGjYRxCHilIMrwU5sl9oKhW15PMcandn4S AF4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=IKqZpue/q7a7H7kO6USrkXb2NpNPaXPYP+o0OOXYtAk=; b=MKGQFSeRlZhr1h0PF+pGGMkWVJC2Yo/WtVpabtM9z+2WMVPp1k5+NuDLzp03/Yl8Gx v7lmypgLMolYBHzl+q/PAOWFKD1VRNs2mpYm2hfhQK7ObR7gKWRmB3t2TaYgXbR19hEb k3mojZLImuSwHvxS6JVs2YVc8oV/biLUaOWe5MsZY3DfQh6KRbAosX2v+wZH8VamN1gq rmaANqWpz+BvxD5xbtNFR9oDrGEFXFoN39YKck6l3fsJjTEEE45K0oRfnKwZ8HUo721z YmLrBDZtF3d691CgN7N8ZUM/mWddrGIposZJZIphK0ToFGX2FDiN2GmvVdQgrLhy2zYF 0YzA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8si1070572pln.417.2017.07.17.03.36.53; Mon, 17 Jul 2017 03:36:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751313AbdGQKgv (ORCPT + 10 others); Mon, 17 Jul 2017 06:36:51 -0400 Received: from ns.mm-sol.com ([37.157.136.199]:36098 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751408AbdGQKfI (ORCPT ); Mon, 17 Jul 2017 06:35:08 -0400 Received: from mms-0439.qualcomm.mm-sol.com (unknown [37.157.136.206]) by extserv.mm-sol.com (Postfix) with ESMTPSA id 95CE2CBF7; Mon, 17 Jul 2017 13:34:59 +0300 (EEST) From: Todor Tomov To: mchehab@kernel.org, hans.verkuil@cisco.com, javier@osg.samsung.com, s.nawrocki@samsung.com, sakari.ailus@iki.fi, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Cc: Todor Tomov Subject: [PATCH v3 23/23] doc: media/v4l-drivers: Qualcomm Camera Subsystem - Media graph Date: Mon, 17 Jul 2017 13:33:49 +0300 Message-Id: <1500287629-23703-24-git-send-email-todor.tomov@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500287629-23703-1-git-send-email-todor.tomov@linaro.org> References: <1500287629-23703-1-git-send-email-todor.tomov@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Update the Qualcomm Camera Subsystem driver document with a media controller pipeline graph diagram. Signed-off-by: Todor Tomov --- Documentation/media/v4l-drivers/qcom_camss.rst | 27 ++++++-------- .../media/v4l-drivers/qcom_camss_graph.dot | 41 ++++++++++++++++++++++ 2 files changed, 51 insertions(+), 17 deletions(-) create mode 100644 Documentation/media/v4l-drivers/qcom_camss_graph.dot -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/media/v4l-drivers/qcom_camss.rst b/Documentation/media/v4l-drivers/qcom_camss.rst index 7e4ab6e..7ae4a45 100644 --- a/Documentation/media/v4l-drivers/qcom_camss.rst +++ b/Documentation/media/v4l-drivers/qcom_camss.rst @@ -109,23 +109,16 @@ The considerations to split the driver in this particular way are as follows: Each VFE sub-device is linked to a separate video device node. -The complete list of the media entities (V4L2 sub-devices and video device -nodes) is as follows: - -- msm_csiphy0 -- msm_csiphy1 -- msm_csid0 -- msm_csid1 -- msm_ispif0 -- msm_ispif1 -- msm_vfe0_rdi0 -- msm_vfe0_video0 -- msm_vfe0_rdi1 -- msm_vfe0_video1 -- msm_vfe0_rdi2 -- msm_vfe0_video2 -- msm_vfe0_pix -- msm_vfe0_video3 +The media controller pipeline graph is as follows (with connected two OV5645 +camera sensors): + +.. _qcom_camss_graph: + +.. kernel-figure:: qcom_camss_graph.dot + :alt: qcom_camss_graph.dot + :align: center + + Media pipeline graph Implementation diff --git a/Documentation/media/v4l-drivers/qcom_camss_graph.dot b/Documentation/media/v4l-drivers/qcom_camss_graph.dot new file mode 100644 index 0000000..827fc71 --- /dev/null +++ b/Documentation/media/v4l-drivers/qcom_camss_graph.dot @@ -0,0 +1,41 @@ +digraph board { + rankdir=TB + n00000001 [label="{{ 0} | msm_csiphy0\n/dev/v4l-subdev0 | { 1}}", shape=Mrecord, style=filled, fillcolor=green] + n00000001:port1 -> n00000007:port0 [style=dashed] + n00000001:port1 -> n0000000a:port0 [style=dashed] + n00000004 [label="{{ 0} | msm_csiphy1\n/dev/v4l-subdev1 | { 1}}", shape=Mrecord, style=filled, fillcolor=green] + n00000004:port1 -> n00000007:port0 [style=dashed] + n00000004:port1 -> n0000000a:port0 [style=dashed] + n00000007 [label="{{ 0} | msm_csid0\n/dev/v4l-subdev2 | { 1}}", shape=Mrecord, style=filled, fillcolor=green] + n00000007:port1 -> n0000000d:port0 [style=dashed] + n00000007:port1 -> n00000010:port0 [style=dashed] + n0000000a [label="{{ 0} | msm_csid1\n/dev/v4l-subdev3 | { 1}}", shape=Mrecord, style=filled, fillcolor=green] + n0000000a:port1 -> n0000000d:port0 [style=dashed] + n0000000a:port1 -> n00000010:port0 [style=dashed] + n0000000d [label="{{ 0} | msm_ispif0\n/dev/v4l-subdev4 | { 1}}", shape=Mrecord, style=filled, fillcolor=green] + n0000000d:port1 -> n00000013:port0 [style=dashed] + n0000000d:port1 -> n0000001c:port0 [style=dashed] + n0000000d:port1 -> n00000025:port0 [style=dashed] + n0000000d:port1 -> n0000002e:port0 [style=dashed] + n00000010 [label="{{ 0} | msm_ispif1\n/dev/v4l-subdev5 | { 1}}", shape=Mrecord, style=filled, fillcolor=green] + n00000010:port1 -> n00000013:port0 [style=dashed] + n00000010:port1 -> n0000001c:port0 [style=dashed] + n00000010:port1 -> n00000025:port0 [style=dashed] + n00000010:port1 -> n0000002e:port0 [style=dashed] + n00000013 [label="{{ 0} | msm_vfe0_rdi0\n/dev/v4l-subdev6 | { 1}}", shape=Mrecord, style=filled, fillcolor=green] + n00000013:port1 -> n00000016 [style=bold] + n00000016 [label="msm_vfe0_video0\n/dev/video0", shape=box, style=filled, fillcolor=yellow] + n0000001c [label="{{ 0} | msm_vfe0_rdi1\n/dev/v4l-subdev7 | { 1}}", shape=Mrecord, style=filled, fillcolor=green] + n0000001c:port1 -> n0000001f [style=bold] + n0000001f [label="msm_vfe0_video1\n/dev/video1", shape=box, style=filled, fillcolor=yellow] + n00000025 [label="{{ 0} | msm_vfe0_rdi2\n/dev/v4l-subdev8 | { 1}}", shape=Mrecord, style=filled, fillcolor=green] + n00000025:port1 -> n00000028 [style=bold] + n00000028 [label="msm_vfe0_video2\n/dev/video2", shape=box, style=filled, fillcolor=yellow] + n0000002e [label="{{ 0} | msm_vfe0_pix\n/dev/v4l-subdev9 | { 1}}", shape=Mrecord, style=filled, fillcolor=green] + n0000002e:port1 -> n00000031 [style=bold] + n00000031 [label="msm_vfe0_video3\n/dev/video3", shape=box, style=filled, fillcolor=yellow] + n00000057 [label="{{} | ov5645 1-0076\n/dev/v4l-subdev10 | { 0}}", shape=Mrecord, style=filled, fillcolor=green] + n00000057:port0 -> n00000001:port0 [style=bold] + n00000059 [label="{{} | ov5645 1-0074\n/dev/v4l-subdev11 | { 0}}", shape=Mrecord, style=filled, fillcolor=green] + n00000059:port0 -> n00000004:port0 [style=bold] +}