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 111281171A for ; Mon, 21 Aug 2023 20:01:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8710CC433C8; Mon, 21 Aug 2023 20:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1692648085; bh=/XVswPKIq5ZACMzR36SY539qXiooozv0CKygIgVf4To=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b7P1ainhgRk6N5kQFsD//GSSe9WOM5sbhgpdrBFVu1Dmadd2xOdZx38E5v/zACB5W 3c5HMZcxR4609U4bOwEVy6H33VcdP0JRCJj9GEbqD0/zI3KzinWNSyOQHW4TZdylCF MU0RZ7HaBP4jPl1m1zr36XS0e2rZEnL7svLl+XVs= 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.4 049/234] media: camss: set VFE bpl_alignment to 16 for sdm845 and sm8250 Date: Mon, 21 Aug 2023 21:40:12 +0200 Message-ID: <20230821194130.902812728@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230821194128.754601642@linuxfoundation.org> References: <20230821194128.754601642@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 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.40.1