From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E95EC41513 for ; Mon, 24 Jul 2023 01:44:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232416AbjGXBol (ORCPT ); Sun, 23 Jul 2023 21:44:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231327AbjGXBmz (ORCPT ); Sun, 23 Jul 2023 21:42:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE2D61FD0; Sun, 23 Jul 2023 18:37:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4C76F60FEB; Mon, 24 Jul 2023 01:33:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 060D5C433CA; Mon, 24 Jul 2023 01:33:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690162409; bh=Jvoyff3+lkkFDN9MNw04Er4FwMpJ+BwfhJF/72Rgq9I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bib44dlqG/6UOsvFgpUKas/JDwqJI7BMP8CyWep0+dIBQStOmPawX9nEmSAYR1cx3 Zplh+50PjxvRmo1RTZ5vb2nDhLGhmynpL2/W/3bRhhEkipA9kEN82royI7rKzwCUAq GCRb6JrR2gN6VoM6eEkF+a9wMeBTzjLAlA7GiO57DlUwWbBY1I9oFbaBa8rUtLe/// J5TJUvCfHHcajJxpXKEcAHRCPLjgdRTtoTh7njqUJgLl/MJT2PP2oTyIKrXwtGG86Q X17z8pjGVz7N1o0TM4mhYkuF6F63eWMAFQ3iymEtIKWaAKXGkYINgujWwG30bvi2kr asu2nXj+FItjQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Andrey Konovalov , Bryan O'Donoghue , Hans Verkuil , Sasha Levin , linux-media@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 02/24] media: camss: set VFE bpl_alignment to 16 for sdm845 and sm8250 Date: Sun, 23 Jul 2023 21:33:03 -0400 Message-Id: <20230724013325.2332084-2-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230724013325.2332084-1-sashal@kernel.org> References: <20230724013325.2332084-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.15.121 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Konovalov [ Upstream commit d5b7eb477c286f6ceccbb38704136eea0e6b09ca ] >From the experiments with camera sensors using SGRBG10_1X10/3280x2464 and SRGGB10_1X10/3280x2464 formats, it becomes clear that on sdm845 and sm8250 VFE outputs the lines padded to a length multiple of 16 bytes. As in the current driver the value of the bpl_alignment is set to 8 bytes, the frames captured in formats with the bytes-per-line value being not a multiple of 16 get corrupted. Set the bpl_alignment of the camss video output device to 16 for sdm845 and sm8250 to fix that. Signed-off-by: Andrey Konovalov Tested-by: Bryan O'Donoghue Acked-by: Bryan O'Donoghue Signed-off-by: Hans Verkuil Signed-off-by: Sasha Levin --- drivers/media/platform/qcom/camss/camss-vfe.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c index e0f3a36f3f3f9..2cfd1edc53956 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -1573,7 +1573,11 @@ int msm_vfe_register_entities(struct vfe_device *vfe, } video_out->ops = &vfe->video_ops; - video_out->bpl_alignment = 8; + if (vfe->camss->version == CAMSS_845 || + vfe->camss->version == CAMSS_8250) + video_out->bpl_alignment = 16; + else + video_out->bpl_alignment = 8; video_out->line_based = 0; if (i == VFE_LINE_PIX) { video_out->bpl_alignment = 16; -- 2.39.2