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 C3771C001E0 for ; Mon, 24 Jul 2023 01:39:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232021AbjGXBjT (ORCPT ); Sun, 23 Jul 2023 21:39:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232016AbjGXBip (ORCPT ); Sun, 23 Jul 2023 21:38:45 -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 75F644C1C; Sun, 23 Jul 2023 18:34:36 -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 57C1160F9C; Mon, 24 Jul 2023 01:31:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 14823C433C8; Mon, 24 Jul 2023 01:31:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690162307; bh=S15+AbMxQ5Xyr3RT5XwQiLJB6O9wdJaVQ9670ztnQZc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q9x6vPIozLixGVYXxp5RRTcHkrgB508BEBtQEwS7QMjJoviyCkLvK383eqM/YdhDv ZrGblNDrw1E67M0PXx3ZfxC3QhPnYHE/m/V/frNi0CsgCfY5ZAHWA53WKRIBDK6Isr khHypyVkCCaWqFXU6hNI6rf8qs0WNzyJsqfWiZfbNOawXoBczqCx50RNtEzU7H1gdS gZ9NjKDNQjKL68Rrob0Efax0L6Jyt4vz0DmLu15IZsbw0sFmtLb58lguoWXr06Z9tD rjfJeqntYgHt4dGhI/PNjaVzdU8IX0VwJsbuP0LT4P7ed34EXK5Yl76NwkSLap+WiK VD+ik2zqdjfRg== 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 6.4 04/40] media: camss: set VFE bpl_alignment to 16 for sdm845 and sm8250 Date: Sun, 23 Jul 2023 21:31:04 -0400 Message-Id: <20230724013140.2327815-4-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230724013140.2327815-1-sashal@kernel.org> References: <20230724013140.2327815-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.4.5 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 e0832f3f4f25c..06c95568e5af4 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -1541,7 +1541,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