From patchwork Tue Apr 18 07:14:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13215116 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 65BA9C77B7E for ; Tue, 18 Apr 2023 07:15:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=rZkG62F2gudG83tiVGK5KxjIA1gJLMD+K2x48RTraFM=; b=HXYhe7kF0cdNzN dl+vedNIpvIBeA1ghcRr3at9U+Vv2scYhSXXCne9eFjf5uKjCk4pbENeadkGn06d9dyKopHvGaEPF AzVs1Ng9RZbyDpIMi3YPSucfWz+F0KvE1YbRXizQU7Vr1LEpZ/KLEbdl+2tTPxabm5kgTotX8mQMN 8S1WQ3MJqcbgdJCWoTRb3M8ZM7ND4nlB0H1Ba++grApvgJbDujh3SxTxxn8OnakwLDkwkCm7PtOZI uptzhBFVKwPTp3jFGvHJAoMmoB718laFtRjXYP3azsnjRUa9nkU9lzqecTb2FcalMKtW3s183eWnt 6Syd4rOk6zL981wU2iBw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pofYM-0015MV-0A; Tue, 18 Apr 2023 07:15:02 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pofYE-0015Hs-0z for linux-arm-kernel@lists.infradead.org; Tue, 18 Apr 2023 07:14:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1681802094; x=1713338094; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1LBMrWhnNp6GUM6Z+YxFtJgIM77IK2VB5D8IaBgDDtc=; b=m5lVVp4cQkWQ1c4/InTJuWChlPXMCmJIQYSt6GP9m2JGOm6/PWFRoUN3 /wUeSSJEEx51qGYejaF8hbLqp6SdchnqNge83OCwYm9Nwknk3knQ5jcQl 0fIF+bLy5sUSd/nL2Jj5/MyYmS1UJeSbn78T/zZSt5DI+hUfka0FOPeFN dVsYpIj5oX+RE5bZp4cQ7gYrdMsl/xWde12+GeHZ65OPuhJD8eWHEFuYe qP/6pfAnFIpjkEeN+25FuPFg9NIqElUZxzosGQdLugIMlMDKTOWQ7SQ14 lBZ8CKvQl8mNqMAyzH7O6ZYKbkRn724WI6lJCWS8x3raxKM6XbVokd1XU w==; X-IronPort-AV: E=Sophos;i="5.99,206,1677538800"; d="scan'208";a="30385553" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 18 Apr 2023 09:14:46 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Tue, 18 Apr 2023 09:14:47 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Tue, 18 Apr 2023 09:14:47 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1681802086; x=1713338086; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=1LBMrWhnNp6GUM6Z+YxFtJgIM77IK2VB5D8IaBgDDtc=; b=di5EfUCIWmp3wqPRtOdf0ivso9vRA3948K+suBhs+ZgcH2JCTRTx+fEe IdXjtERUMxOdeP/MYgJ3aANIUcSmemXKgKqGXjeTkwlIksc4td3nzNwCb ETbzA0l7mSkkKnel91hckEZhSMSVX0Nd0meODDd9QPbdb3cKEnOQH53vE tmoWdTmAW19OF5/JRjivLt1KIyATa5YFeaGrj4hi7wN8k7zo8B/KwXr/R b71y5SIZ/baOgLQ4nYDTsiqttB8IknckHHEVWW51IMy6eCQ9xxmBCa9uU /JVP+5e0hCqBR3Z48EtTKIatmi/IPXD/QvhxcwZf9Y3Vk7h4Kx93be4zo Q==; X-IronPort-AV: E=Sophos;i="5.99,206,1677538800"; d="scan'208";a="30385551" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 18 Apr 2023 09:14:46 +0200 Received: from steina-w.tq-net.de (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 98C66280072; Tue, 18 Apr 2023 09:14:46 +0200 (CEST) From: Alexander Stein To: Rui Miguel Silva , Laurent Pinchart , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Alexander Stein , Pengutronix Kernel Team , NXP Linux Team , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 1/3] media: imx: imx7-media-csi: Get rid of superfluous call to imx7_csi_mbus_fmt_to_pix_fmt Date: Tue, 18 Apr 2023 09:14:37 +0200 Message-Id: <20230418071439.197735-2-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230418071439.197735-1-alexander.stein@ew.tq-group.com> References: <20230418071439.197735-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230418_001454_651693_3173C33D X-CRM114-Status: GOOD ( 14.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There is no need to convert input pixformat to mbus_framefmt and back again. Instead apply pixformat width contrains directly. Signed-off-by: Alexander Stein --- drivers/media/platform/nxp/imx7-media-csi.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c index b701e823436a8..bd649fd9166fd 100644 --- a/drivers/media/platform/nxp/imx7-media-csi.c +++ b/drivers/media/platform/nxp/imx7-media-csi.c @@ -1145,8 +1145,8 @@ static const struct imx7_csi_pixfmt * __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt, struct v4l2_rect *compose) { - struct v4l2_mbus_framefmt fmt_src; const struct imx7_csi_pixfmt *cc; + u32 stride; /* * Find the pixel format, default to the first supported format if not @@ -1172,12 +1172,16 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt, } } - v4l2_fill_mbus_format(&fmt_src, pixfmt, 0); - imx7_csi_mbus_fmt_to_pix_fmt(pixfmt, &fmt_src, cc); + v4l_bound_align_image(&pixfmt->width, 1, 0xffff, 8, + &pixfmt->height, 1, 0xffff, 1, 0); + + stride = round_up((pixfmt->width * cc->bpp) / 8, 8); + pixfmt->bytesperline = stride; + pixfmt->sizeimage = stride * pixfmt->height; if (compose) { - compose->width = fmt_src.width; - compose->height = fmt_src.height; + compose->width = pixfmt->width; + compose->height = pixfmt->height; } return cc; From patchwork Tue Apr 18 07:14:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13215115 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 8A863C77B75 for ; Tue, 18 Apr 2023 07:15:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=iEyqa3Cql4E2k+mILRGhDqDK+aZMUWCKPViuOdMy/Ug=; b=QyllQYghrYoHAS i8vpS7K2zlsVZ8LTMMAKbQgrXL+pC45YRQMs86SmHb5ITJInfGVCnxM845GdPSaPLmblYcBV/gIhx 94vxNTWAcTFRv2luB+HQO5DGmrAexx2g677OwvEaUmUkSEgMlxK7Ts0fbUmacOjHZicf1Hp4INd8q hPG0JIYyhzYwH0lTJ8+slQV5KvJ3GyOBQWFsqkNPjcT5IfhwVgZfeImFgACQwzx8dS5bf5eer6Z+a 4ip1OrPlfFvC4GDHUq1zMHzqLWg6a+T6gEVryKqk1+fZnT/xyzeLZVJpcbZ5GToNgiRtg4fvpJU5U R7x7Ds6E/K3m/DiOQyLw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pofYN-0015Mx-0G; Tue, 18 Apr 2023 07:15:03 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pofYF-0015JN-1V for linux-arm-kernel@lists.infradead.org; Tue, 18 Apr 2023 07:14:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1681802095; x=1713338095; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2EYb/WP0dlj6VHt6K2PVtPnez7y5ZDVOsDqBPCYyofs=; b=lzQtOLJRfJI+ScnbdGI7hRclzZN2wgbgelmFIhYEohCCDPgIbeJirfsl Z8GQ4LwEMfyhLpujJFmIhuq+VZtsDSUNiqdR7qWDQQy2COZzk5xSoFrAt TkxV+Xx4v1K51PoCpaAntQxXhTB7X7xQVoC9JzJpmlP9mRM8qCZBi30nj DPX8DlyO1fGHhCcwdMX9WAWftCm7RYyWEkXtIwZt8ESgY2UIYT0JQoMxf zBlETvAer9CGUEgomGx2Ek2bqjsP1Pxa/4DUgcQPBo3kR04A3E1uLiALl Ez4OkNfW+TqGY4U9X6gdJ2xecJFayEWZTqa7OWtQeyCNoDACObt4+F7r6 A==; X-IronPort-AV: E=Sophos;i="5.99,206,1677538800"; d="scan'208";a="30385556" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 18 Apr 2023 09:14:47 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Tue, 18 Apr 2023 09:14:47 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Tue, 18 Apr 2023 09:14:47 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1681802087; x=1713338087; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2EYb/WP0dlj6VHt6K2PVtPnez7y5ZDVOsDqBPCYyofs=; b=bTA0rAlLgYMqtpqCACot7AYTUVAHnMw0sSFLlA0acHgrIPguaZV1TJeU tNVhdKUPDQsJyr4X9Yuc60l9DVluLmZFXNkhZE12aTZu2hy9s0E+T/3AW jMNqHkgfAJ2xC+jjyyuYGCQAU7Iw60d3JZX4OP+UGz3FdBtcIzOZD9rcc jQ6W34tjSe2nO4QA7iCXVo7rRBccbNWes1hd0uoJ0uABvEFfU3EAB+P9o g/5sBUGyb1iKTREcTWwyjTzMMkfJfx/bSYfPz565tu0vKqZhC+YfpNb5V SuK9pPjaz2/aDgBakaup2ltFO4po97MyMIn6rx+5+xe99wyk/Op2Mi2Aq A==; X-IronPort-AV: E=Sophos;i="5.99,206,1677538800"; d="scan'208";a="30385555" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 18 Apr 2023 09:14:47 +0200 Received: from steina-w.tq-net.de (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id C809E280073; Tue, 18 Apr 2023 09:14:46 +0200 (CEST) From: Alexander Stein To: Rui Miguel Silva , Laurent Pinchart , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Alexander Stein , Pengutronix Kernel Team , NXP Linux Team , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/3] media: imx: imx7-media-csi: Remove interlave fields Date: Tue, 18 Apr 2023 09:14:38 +0200 Message-Id: <20230418071439.197735-3-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230418071439.197735-1-alexander.stein@ew.tq-group.com> References: <20230418071439.197735-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230418_001455_809204_09600092 X-CRM114-Status: GOOD ( 11.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Interlaced mode is currently not supported, so disable fields in try_fmt. Signed-off-by: Alexander Stein --- drivers/media/platform/nxp/imx7-media-csi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c index bd649fd9166fd..1508f6ba20e91 100644 --- a/drivers/media/platform/nxp/imx7-media-csi.c +++ b/drivers/media/platform/nxp/imx7-media-csi.c @@ -1178,6 +1178,7 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt, stride = round_up((pixfmt->width * cc->bpp) / 8, 8); pixfmt->bytesperline = stride; pixfmt->sizeimage = stride * pixfmt->height; + pixfmt->field = V4L2_FIELD_NONE; if (compose) { compose->width = pixfmt->width; From patchwork Tue Apr 18 07:14:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13215117 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 43B80C77B7C for ; Tue, 18 Apr 2023 07:15:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qTjstxchVm6XzXmcUG2hKktr/Ueh6hO+lJIJklfmIY8=; b=UDaEYgRyuwRMUw JOgFTG1YRjtmmqOYfx4puVohBpoQX92WjDtj/6Ycbj32f73Xtm0jI8DHb13iEcE7Aih/UnKrPR+sO hiuSzcEZ/BUYZyfaSkZCZlXw2eJ4Czu1bbmVcjX3x5NRbTl6xaEB4x0xJkFruRRvwB/qJFVafbksL yn1ROJ7+VFtKmZpROKvR5wgnu/l1gq92Q1fni6ycYlx5gQ1RjF/iH8x8U0zt2u/b86EMszDlT2eCO liv66rdDy1/GgHQwpEfBeRuM8DLfDnhLZBabDVMfukG6KRw8YvcAlMs/PVZKxYtZV02D49lkxwHHq 04RNFb5EV1rp9IgKwoYQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pofYO-0015Nz-1W; Tue, 18 Apr 2023 07:15:04 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pofYG-0015Hs-1O for linux-arm-kernel@lists.infradead.org; Tue, 18 Apr 2023 07:14:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1681802096; x=1713338096; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=edaL6dP8udaoBENjAOXy9u4eKuGvdt1NYMIa3nDzb9Q=; b=JEjlZEWe9iv1TlriRAk5Q9MVO7gmb+5jgXNCf/tmrcEk7HSBO5BLSXHb /lx2ThE9V8XYGHft79KpOQ2H2qoUqexsxRbYtKAmxTsFWjgSnqNI39+9V Vr9SVGptoSJZR6GCF60uG5p3WaUTRjaMuhy8AJrAx20vqDYWJwf/8oqlm 11t9/U2LNHWnxvjJ1Srbpa3t9GMn8G86Vt+bKCYErHWhsDm8uabdCgGUu sD/hgo1m7VgmHP/klnPfgtTdBt+TvUL1PYtRhABUA3BdgKP9JFkl/JUXV 6PMYHBAB0AOsfQgKgEoV71Kh5/ZxsssVk0VPlzydirb3t93qU8hgw5qKn A==; X-IronPort-AV: E=Sophos;i="5.99,206,1677538800"; d="scan'208";a="30385558" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 18 Apr 2023 09:14:47 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Tue, 18 Apr 2023 09:14:47 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Tue, 18 Apr 2023 09:14:47 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1681802087; x=1713338087; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=edaL6dP8udaoBENjAOXy9u4eKuGvdt1NYMIa3nDzb9Q=; b=l6XcpwZaYyDwzkEE71WvcRI6G29deS/DKUHq/w9v/4PLC8FwLMaNpj6y ya3d22G7+Vz+hygEA0jnztKByExWgLjkT1lL+6KwEkIF0iQPsWCGQ2gFA /ZW8ZpJTZkc0guHvVOXU8ggY1TsJDFicHvvXdwEVm/AztIyBK+03Fdujt ubJ2Kgq9oHXHuTNVGAjn+GXKQXQXaI35yED9Y8TUI4dOwUgUlujNt4ep3 6KVT1Zj9361oL1otLRUUwxH3bpbWe0Bn+MAIpKgIfsLBbWsc9QtQoS7SK veylED7rPUFR4kfJKs2uIcVHUdkEiSjf+k6Qi1X0xSgqxwL7zk9MwOvXv Q==; X-IronPort-AV: E=Sophos;i="5.99,206,1677538800"; d="scan'208";a="30385557" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 18 Apr 2023 09:14:47 +0200 Received: from steina-w.tq-net.de (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 3AA40280074; Tue, 18 Apr 2023 09:14:47 +0200 (CEST) From: Alexander Stein To: Rui Miguel Silva , Laurent Pinchart , Mauro Carvalho Chehab , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Alexander Stein , Pengutronix Kernel Team , NXP Linux Team , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 3/3] media: imx: imx7-media-csi: Lift width constraints for 8bpp formats Date: Tue, 18 Apr 2023 09:14:39 +0200 Message-Id: <20230418071439.197735-4-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230418071439.197735-1-alexander.stein@ew.tq-group.com> References: <20230418071439.197735-1-alexander.stein@ew.tq-group.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230418_001456_787807_F5823D86 X-CRM114-Status: GOOD ( 14.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org For 8-bit formats the image_width just needs to be a multiple of 4 pixels. Signed-off-by: Alexander Stein --- drivers/media/platform/nxp/imx7-media-csi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/nxp/imx7-media-csi.c b/drivers/media/platform/nxp/imx7-media-csi.c index 1508f6ba20e91..5240670476b2b 100644 --- a/drivers/media/platform/nxp/imx7-media-csi.c +++ b/drivers/media/platform/nxp/imx7-media-csi.c @@ -1147,6 +1147,7 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt, { const struct imx7_csi_pixfmt *cc; u32 stride; + u32 walign; /* * Find the pixel format, default to the first supported format if not @@ -1172,7 +1173,13 @@ __imx7_csi_video_try_fmt(struct v4l2_pix_format *pixfmt, } } - v4l_bound_align_image(&pixfmt->width, 1, 0xffff, 8, + /* Refer to CSI_IMAG_PARA.IMAGE_WIDTH description */ + if (cc->bpp == 8) + walign = 8; + else + walign = 4; + + v4l_bound_align_image(&pixfmt->width, 1, 0xffff, walign, &pixfmt->height, 1, 0xffff, 1, 0); stride = round_up((pixfmt->width * cc->bpp) / 8, 8);