From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECA3C11707 for ; Mon, 21 Aug 2023 19:52:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F556C433C7; Mon, 21 Aug 2023 19:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1692647521; bh=CmpB6cEBszMcoyanE+N/NDAV7iJwsghK7u6ame+zcA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SQ+qawuDeELJnkb29exHVLccNFgmGm5cH3NXgHZ5gZDNL23XnV5LHXZCaWxefCK2+ 9UAT1uCXyxVxzyh53Qg7G1eQFBrSAVood8KmK5C8UqK5bjpVfzFKYuSBMuvyjy8+fm Ys5uXrM3ocfvxGfWMobut39YZqRgEbf9Knd6xt/o= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Andrey Konovalov , Bryan ODonoghue , Hans Verkuil , Sasha Levin Subject: [PATCH 6.1 044/194] media: camss: set VFE bpl_alignment to 16 for sdm845 and sm8250 Date: Mon, 21 Aug 2023 21:40:23 +0200 Message-ID: <20230821194124.739713324@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230821194122.695845670@linuxfoundation.org> References: <20230821194122.695845670@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 a26e4a5d87b6b..d8cd9b09c20de 100644 --- a/drivers/media/platform/qcom/camss/camss-vfe.c +++ b/drivers/media/platform/qcom/camss/camss-vfe.c @@ -1540,7 +1540,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.40.1