Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp727404pxu; Thu, 3 Dec 2020 11:03:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxf16Az/xe0IL/VZLpHVnMklUWUzR6CXGG5vN64GOAVDoldzMEUY7UgMjIwH4Ip3lskKNuE X-Received: by 2002:a17:906:d10f:: with SMTP id b15mr3720689ejz.268.1607022232361; Thu, 03 Dec 2020 11:03:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607022232; cv=none; d=google.com; s=arc-20160816; b=td00cffCYYR4d4hlocWQRCXpOD0xHEwByf7eCEoCnfVqIsKTE+Q6+xTPG7UpW+b7Iy SoFLWp083+cOt0ZHwIoaJ/t4/7KXFX0vkImHN1ff0K9yO806A+0vftV48RlLF5L56QxN NOqLnKXczVZ9uFQSZB8OY84bqsiQ/Z5Q9E7uzrET01ZOCoB8Nb3BvqJRt2VVKrhySNJ+ LNxbWHjaK6TuTdnLae0afd+Dbt+IKrsWJlDx8D9DrEKt2t4r0veNdoClegvpvbxPuRgo lNGF4WKnbJ4japI+GgfRotkDQ85oUaxKJFIUcOmKtSSg8t9a+XF33Jx5+BRQxfsV8bzu Px8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=3KvReLIRXcuW/kRnBsqtVyD+GiWXJeSQRRku54/yeMg=; b=GO3rIOloHvhQHElcH1QcN9l1LSWLqKK6JwzZ+JR6defwPBD3946qrEBIhT9cuCgkkY 0YzQacsc1nwHBoVCIzpTwXKWyjdCJtSzL9PeBN0Q5WDYq2Een5hx5iv8ni5ORaih7h3B Lr+xjsD5jjSGhg2LQkPqkNfTbW54uTOHp9bovr1zR2WF0nqEC5yHkTRJa2O6B6Odd4pS YAO3haYqUwfl8P7KuPlfv2etRkiYxRcvsD1zXsvI9/ZdwzM906wBoq4MG+JlTKgvnES9 d5LIUN46GcCCKPOpGnrEoj8bytQaaa2P6c2vxnhcbRoWNSWLpJxVhTtJe4369Tlv4GOT /vwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=qpY7VaVJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l9si1459021edi.199.2020.12.03.11.03.28; Thu, 03 Dec 2020 11:03:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=qpY7VaVJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728941AbgLCTAr (ORCPT + 99 others); Thu, 3 Dec 2020 14:00:47 -0500 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:18301 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727010AbgLCTAq (ORCPT ); Thu, 3 Dec 2020 14:00:46 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 03 Dec 2020 11:00:06 -0800 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 3 Dec 2020 19:00:02 +0000 Received: from skomatineni-linux.nvidia.com (172.20.13.39) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 3 Dec 2020 19:00:01 +0000 From: Sowjanya Komatineni To: , , , , , CC: , , , , , Subject: [PATCH v3 02/13] media: tegra-video: Enable VI pixel transform for YUV and RGB formats Date: Thu, 3 Dec 2020 10:59:51 -0800 Message-ID: <1607022002-26575-3-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607022002-26575-1-git-send-email-skomatineni@nvidia.com> References: <1607022002-26575-1-git-send-email-skomatineni@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1607022006; bh=3KvReLIRXcuW/kRnBsqtVyD+GiWXJeSQRRku54/yeMg=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:X-NVConfidentiality:MIME-Version:Content-Type; b=qpY7VaVJB1mUY6k5CwE8i2LCBqJjlP7r0PwhCy4qgEhEBOL4nMvEeBfSDZ9KZeQ15 1b+xPZHpTPzK4xBTtAZZXAk+YSjb4FeqbDPsGS4gIYeyO6FJrT1Ql6IG6unlP+uWRq GRM+9rsElqAxnuXzmEsDQnFd73KFZ1sN4sADjGuJWHQSLdC1OFBI1lWGaXTwSDhNtF PW1OFLPhqdluRMv85HAi82IZgQQFvT1UqwZd+/4146Yr4FasBF9CESfUHG+8Q2SNAY s/Lg75xNCIUzeTq6pNLgDSduhkOFrC/T9t5IZiHswec0YZPPQfYsffXnOVb4+/sDCw 8pZrJOU6PuX7A== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VI Pixel transforms converts source pixel data to selected destination pixel formats in memory and aligns properly. YUV and RGB formats need this pixel transform to be enabled. RAW formats use T_R16_I destination pixel format in memory and does not need pixel transform as they support direct write to memory. So, this patch enables pixel transform for YUV and RGB and keeps it bypass for RAW formats. Signed-off-by: Sowjanya Komatineni --- drivers/staging/media/tegra-video/tegra210.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/tegra-video/tegra210.c b/drivers/staging/media/tegra-video/tegra210.c index ac066c0..6b23aa7 100644 --- a/drivers/staging/media/tegra-video/tegra210.c +++ b/drivers/staging/media/tegra-video/tegra210.c @@ -178,10 +178,23 @@ static int tegra_channel_capture_setup(struct tegra_vi_channel *chan) u32 format = chan->fmtinfo->img_fmt; u32 data_type = chan->fmtinfo->img_dt; u32 word_count = (width * chan->fmtinfo->bit_width) / 8; + u32 bypass_pixel_transform = BIT(BYPASS_PXL_TRANSFORM_OFFSET); + + /* + * VI Pixel transformation unit converts source pixels data format + * into selected destination pixel format and aligns properly while + * interfacing with memory packer. + * This pixel transformation should be enabled for YUV and RGB + * formats and should be bypassed for RAW formats as RAW formats + * only support direct to memory. + */ + if (chan->pg_mode || data_type == TEGRA_IMAGE_DT_YUV422_8 || + data_type == TEGRA_IMAGE_DT_RGB888) + bypass_pixel_transform = 0; vi_csi_write(chan, TEGRA_VI_CSI_ERROR_STATUS, 0xffffffff); vi_csi_write(chan, TEGRA_VI_CSI_IMAGE_DEF, - ((chan->pg_mode ? 0 : 1) << BYPASS_PXL_TRANSFORM_OFFSET) | + bypass_pixel_transform | (format << IMAGE_DEF_FORMAT_OFFSET) | IMAGE_DEF_DEST_MEM); vi_csi_write(chan, TEGRA_VI_CSI_IMAGE_DT, data_type); -- 2.7.4