From patchwork Sun Apr 12 12:05:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11484515 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 39EA013B2 for ; Sun, 12 Apr 2020 12:05:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0109520708 for ; Sun, 12 Apr 2020 12:05:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VCG1RtuH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0109520708 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KUazU1p/timtgNgrd42s7IPSvv7Oi8lFP2Ks9cXQp1U=; b=VCG1RtuHZlhSn7 FQKUr7JXUzCfA/5lBo5B4oFEYwqMSHH7HjtECTURwRybE7skWFP4x+hbr3lVFtQeECSdDE48qsO1V F/1cpLWp3n9RjeCMmoBCehA2qz132Gfjwum2QtLnTP3//vDhSaIgCMGJuU7/geN+PwGoKYwI9fw8c rCt8TsIyaku1pAhou9J9K4GB++IyXDxFEwuuI2k5tO1SoCs9icOGxtHrVIc6Udad43g9V8+iURGWJ D2UYHSZxNlV5nASPX7nI+2k9W815+yQac0mWkSgcOkZZyccqgeDcWuJTfO5qOq4U6IK0tfAhMSrKZ eUrnr3iAM31XB4ZjIfug==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jNbMY-0007AF-8u; Sun, 12 Apr 2020 12:05:22 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jNbMV-00078l-GD for linux-rockchip@lists.infradead.org; Sun, 12 Apr 2020 12:05:21 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dafna) with ESMTPSA id A2F682A0713 From: Dafna Hirschfeld To: linux-media@vger.kernel.org, dafna.hirschfeld@collabora.com, helen.koike@collabora.com, ezequiel@collabora.com, hverkuil@xs4all.nl, kernel@collabora.com, dafna3@gmail.com, laurent.pinchart@ideasonboard.com, linux-rockchip@lists.infradead.org, sakari.ailus@linux.intel.com Subject: [PATCH v2 1/4] media: staging: rkisp1: rsz: get the capture format info from the capture struct Date: Sun, 12 Apr 2020 14:05:01 +0200 Message-Id: <20200412120504.6536-2-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200412120504.6536-1-dafna.hirschfeld@collabora.com> References: <20200412120504.6536-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200412_050519_763700_B0B72657 X-CRM114-Status: UNSURE ( 8.66 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org Currently the format info of the capture is retrieved by calling the function v4l2_format_info. This is not needed since it is already save in the capture object. Signed-off-by: Dafna Hirschfeld --- drivers/staging/media/rkisp1/rkisp1-resizer.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-resizer.c b/drivers/staging/media/rkisp1/rkisp1-resizer.c index 7b6b7ddd4169..84f23a91b0a0 100644 --- a/drivers/staging/media/rkisp1/rkisp1-resizer.c +++ b/drivers/staging/media/rkisp1/rkisp1-resizer.c @@ -387,11 +387,9 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz, if (rsz->pixel_enc == V4L2_PIXEL_ENC_YUV) { struct rkisp1_capture *cap = &rsz->rkisp1->capture_devs[rsz->id]; - const struct v4l2_format_info *pixfmt_info = - v4l2_format_info(cap->pix.fmt.pixelformat); - hdiv = pixfmt_info->hdiv; - vdiv = pixfmt_info->vdiv; + hdiv = cap->pix.info->hdiv; + vdiv = cap->pix.info->vdiv; } src_c.width = src_y.width / hdiv; src_c.height = src_y.height / vdiv; From patchwork Sun Apr 12 12:05:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11484523 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B10711871 for ; Sun, 12 Apr 2020 12:05:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8F34A206E9 for ; Sun, 12 Apr 2020 12:05:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="saRiY2tV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8F34A206E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rS71/H0YWd4PIJLG5oKYaYQndgCTD/iVsLtQlqcSneM=; b=saRiY2tVfWZjh1 vaGaf8wlCAc8gbX8NhOF4Qsmr6GpUr/j0uSZCSasUoixwjeY3EgcWMEvw0FyABKE27IHcjY0MPu51 VIElITxrjfgtwEFr6wSPREh3oGWNpRs+ezHbie13SJUufExSGgy1C86MrPSxors5Xt9oTwSxqtIYz D8my+yx1iI/RIGSIs/6mTukYU8SUGMqaXxXDYkBM/HDJoDW1SwRouvxk2qpr6ggaTUhYfU+H/ORnl l4cNwLoBJRAmfUOB4seWfuQhWknGCXs9CQgZ9Y0BmtYIKPNC9YRu0r6X/4QLymsu/GG3XepS7ZIvN eWS0HBShwmA3sYcu0qRA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jNbMc-0007Dw-G4; Sun, 12 Apr 2020 12:05:26 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jNbMV-00078p-GA for linux-rockchip@lists.infradead.org; Sun, 12 Apr 2020 12:05:22 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dafna) with ESMTPSA id 25E4E2A079A From: Dafna Hirschfeld To: linux-media@vger.kernel.org, dafna.hirschfeld@collabora.com, helen.koike@collabora.com, ezequiel@collabora.com, hverkuil@xs4all.nl, kernel@collabora.com, dafna3@gmail.com, laurent.pinchart@ideasonboard.com, linux-rockchip@lists.infradead.org, sakari.ailus@linux.intel.com Subject: [PATCH v2 2/4] media: staging: rkisp1: rsz: remove redundant if statement and add inline doc Date: Sun, 12 Apr 2020 14:05:02 +0200 Message-Id: <20200412120504.6536-3-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200412120504.6536-1-dafna.hirschfeld@collabora.com> References: <20200412120504.6536-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200412_050519_772619_260D91DC X-CRM114-Status: GOOD ( 11.47 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org The statement "if (rsz->fmt_type == V4L2_PIXEL_ENC_YUV)" can be removed since the value of rsz->fmt_type is either V4L2_PIXEL_ENC_YUV or V4L2_PIXEL_ENC_BAYER and the function returns if it is bayer. In addition some doc with clarification is added. Signed-off-by: Dafna Hirschfeld --- drivers/staging/media/rkisp1/rkisp1-resizer.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-resizer.c b/drivers/staging/media/rkisp1/rkisp1-resizer.c index 84f23a91b0a0..c28919b9af44 100644 --- a/drivers/staging/media/rkisp1/rkisp1-resizer.c +++ b/drivers/staging/media/rkisp1/rkisp1-resizer.c @@ -365,12 +365,17 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz, struct v4l2_rect sink_y, sink_c, src_y, src_c; struct v4l2_mbus_framefmt *src_fmt; struct v4l2_rect *sink_crop; + struct rkisp1_capture *cap = &rsz->rkisp1->capture_devs[rsz->id]; sink_crop = rkisp1_rsz_get_pad_crop(rsz, NULL, RKISP1_RSZ_PAD_SINK, V4L2_SUBDEV_FORMAT_ACTIVE); src_fmt = rkisp1_rsz_get_pad_fmt(rsz, NULL, RKISP1_RSZ_PAD_SRC, V4L2_SUBDEV_FORMAT_ACTIVE); + /* + * The resizer only works on yuv formats, + * so return if it is bayer format. + */ if (rsz->pixel_enc == V4L2_PIXEL_ENC_BAYER) { rkisp1_rsz_disable(rsz, when); return; @@ -384,13 +389,15 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz, sink_c.width = sink_y.width / RKISP1_MBUS_FMT_HDIV; sink_c.height = sink_y.height / RKISP1_MBUS_FMT_VDIV; - if (rsz->pixel_enc == V4L2_PIXEL_ENC_YUV) { - struct rkisp1_capture *cap = - &rsz->rkisp1->capture_devs[rsz->id]; + /* + * The resizer is used not only to change the dimensions of the frame + * but also to change the scale for YUV formats, + * (4:2:2 -> 4:2:0 for example). So the width/height of the CbCr + * streams should be set according to the pixel format in the capture. + */ + hdiv = cap->pix.info->hdiv; + vdiv = cap->pix.info->vdiv; - hdiv = cap->pix.info->hdiv; - vdiv = cap->pix.info->vdiv; - } src_c.width = src_y.width / hdiv; src_c.height = src_y.height / vdiv; From patchwork Sun Apr 12 12:05:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11484517 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3CC51174A for ; Sun, 12 Apr 2020 12:05:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0104D206E9 for ; Sun, 12 Apr 2020 12:05:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b4ILEfT5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0104D206E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RYvEhR7uRpRrFem2M8z5ofFPQqGccDyZfjH+GRYucfg=; b=b4ILEfT5Ds2Cnv 35K/goZHVKCiCgF/wlouH0QP5jXZIfHVNKJasCBBuswCU4krn36maqyPCPi7L8RG+Y+5IXFnpFSIl dfu9wX6vtctxLbqOdLXAy0bkIb7UlNZjaKBNunxSj7+eBVV9yS3l5vAow4nZ+i1gK2LbKEamJIT4r +wovQ7wY25+XJc6SM/gqosOGtVxOvoYUPJpXsvKRdL8rAJCAN8lZYSnwYmJis+zjOP5V2lOZEs68O zCw0z1u4Qg75RqeuPfIFP8/4gB3IitnS27UM3PWjERKgNOJh++lPaNjVgA+izZGlWPtrXS5764QF8 ggom3fRob4fwxXp4Ipfw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jNbMb-0007Cf-E0; Sun, 12 Apr 2020 12:05:25 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jNbMV-00078m-GD for linux-rockchip@lists.infradead.org; Sun, 12 Apr 2020 12:05:22 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dafna) with ESMTPSA id 9ECBA2A07A7 From: Dafna Hirschfeld To: linux-media@vger.kernel.org, dafna.hirschfeld@collabora.com, helen.koike@collabora.com, ezequiel@collabora.com, hverkuil@xs4all.nl, kernel@collabora.com, dafna3@gmail.com, laurent.pinchart@ideasonboard.com, linux-rockchip@lists.infradead.org, sakari.ailus@linux.intel.com Subject: [PATCH v2 3/4] media: staging: rkisp1: rsz: change (hv)div only if capture format is YUV Date: Sun, 12 Apr 2020 14:05:03 +0200 Message-Id: <20200412120504.6536-4-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200412120504.6536-1-dafna.hirschfeld@collabora.com> References: <20200412120504.6536-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200412_050519_768440_21772A76 X-CRM114-Status: GOOD ( 11.16 ) X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org RGB formats in selfpath should receive input format as YUV422. The resizer input format is always YUV422 and therefore if the capture format is RGB, the resizer should not change the YUV rations. Signed-off-by: Dafna Hirschfeld --- drivers/staging/media/rkisp1/rkisp1-resizer.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-resizer.c b/drivers/staging/media/rkisp1/rkisp1-resizer.c index c28919b9af44..d049374413dc 100644 --- a/drivers/staging/media/rkisp1/rkisp1-resizer.c +++ b/drivers/staging/media/rkisp1/rkisp1-resizer.c @@ -394,9 +394,14 @@ static void rkisp1_rsz_config(struct rkisp1_resizer *rsz, * but also to change the scale for YUV formats, * (4:2:2 -> 4:2:0 for example). So the width/height of the CbCr * streams should be set according to the pixel format in the capture. + * The resizer always gets the input as YUV422. If the capture format + * is RGB then the memory input should be YUV422 so we don't change the + * default hdiv, vdiv in that case. */ - hdiv = cap->pix.info->hdiv; - vdiv = cap->pix.info->vdiv; + if (v4l2_is_format_yuv(cap->pix.info)) { + hdiv = cap->pix.info->hdiv; + vdiv = cap->pix.info->vdiv; + } src_c.width = src_y.width / hdiv; src_c.height = src_y.height / vdiv; From patchwork Sun Apr 12 12:05:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 11484519 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 41C9118E8 for ; Sun, 12 Apr 2020 12:05:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 016922072D for ; Sun, 12 Apr 2020 12:05:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZkCsan1Q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 016922072D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Uafv7ktC49Yujm630sBCBQmCm8dxygEzJRvRAB4ime8=; b=ZkCsan1QkxdAiJ vKvwEKfxjS/w3zpRa7qClxYy8ZxthBGDSsHTSGQRua7xhXD5T3nb2Z7sxfHLwHclXFzV/XVGMVd1W kkpYK6RYW/p7ICc0zHNd9pW4q60gEkv4SjeUq5yoKNPQF+WeTYHayHvuLYXOCq06kcB4I4J5RLGlL mggnDrZSyednESTM3kp/6P4/dJGstAzbtKui5KL82VIffyK09lp3Cs5rY3RnjDa1QR1n0mFcLuTdp w3C0TlFQnNZJOuEkHqdDhVGFVfAO7ClnXJvs0ydS9So4EdDTVeFZaU2UpniIqCh5SxbsmKnpOAosU EPbSQ++fEp9x/xQJlKoA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jNbMa-0007Bd-IU; Sun, 12 Apr 2020 12:05:24 +0000 Received: from bhuna.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e3e3]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jNbMV-00078n-GB for linux-rockchip@lists.infradead.org; Sun, 12 Apr 2020 12:05:22 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dafna) with ESMTPSA id 24C352A0849 From: Dafna Hirschfeld To: linux-media@vger.kernel.org, dafna.hirschfeld@collabora.com, helen.koike@collabora.com, ezequiel@collabora.com, hverkuil@xs4all.nl, kernel@collabora.com, dafna3@gmail.com, laurent.pinchart@ideasonboard.com, linux-rockchip@lists.infradead.org, sakari.ailus@linux.intel.com Subject: [PATCH v2 4/4] media: staging: rkisp1: cap: enable RGB capture format with YUV media bus Date: Sun, 12 Apr 2020 14:05:04 +0200 Message-Id: <20200412120504.6536-5-dafna.hirschfeld@collabora.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200412120504.6536-1-dafna.hirschfeld@collabora.com> References: <20200412120504.6536-1-dafna.hirschfeld@collabora.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200412_050519_777678_0EBD4506 X-CRM114-Status: UNSURE ( 8.56 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org In selfpath, RGB capture formats are received in the sink pad as YUV and are converted to RGB only when writing to memory. So the validation function should accept YUV bus formats with RGB capture encoding. Signed-off-by: Dafna Hirschfeld --- drivers/staging/media/rkisp1/rkisp1-capture.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c index fbf62399fe3d..a94483170e9c 100644 --- a/drivers/staging/media/rkisp1/rkisp1-capture.c +++ b/drivers/staging/media/rkisp1/rkisp1-capture.c @@ -1208,6 +1208,8 @@ static int rkisp1_capture_link_validate(struct media_link *link) media_entity_to_v4l2_subdev(link->source->entity); struct rkisp1_capture *cap = video_get_drvdata(vdev); struct rkisp1_isp *isp = &cap->rkisp1->isp; + u8 isp_pix_enc = isp->src_fmt->pixel_enc; + u8 cap_pix_enc = cap->pix.info->pixel_enc; struct v4l2_subdev_format sd_fmt; int ret; @@ -1218,7 +1220,9 @@ static int rkisp1_capture_link_validate(struct media_link *link) return -EPIPE; } - if (cap->pix.info->pixel_enc != isp->src_fmt->pixel_enc) { + if (cap_pix_enc != isp_pix_enc && + !(isp_pix_enc == V4L2_PIXEL_ENC_YUV && + cap_pix_enc == V4L2_PIXEL_ENC_RGB)) { dev_err(cap->rkisp1->dev, "format type mismatch in link '%s:%d->%s:%d'\n", link->source->entity->name, link->source->index,