Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796382683; b=jmAv8hNyHg7fEgYF5JyJ3M/30GB22PQUbkAynq48iLxBwehmBZSGw0lOIb9JGGtPEAUf /A7xyU2jYwZ1p7D7tG+DvdqbJpw0GtLiXY8uBAhQzO9SGxNXGZKnvNUkdU45AV9HkIGQu mdmqEjJ12FOzNlMH4WmAnncof7XLb+t68VGwTSEW9LQfpZ+oLD+sTQ12WrKkvoS+z82CW +0IamqAMUl72fDFicsXvlrEuDWDIFIJdoCeVg2iWJCvzaqvap3mrURVkzTc4+1bcc+zFA Ze5Y8puOovG6NpYn8JO0DJQ4NaZjYlOoBbHS9Z5PcSKya83Gg6n8ZCtCD6bOD7RyihA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382683; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=lv3nvzmfqx2cWdH7Do0e9mKFnnJZXWz3pLAl7oNMe00=; b=IqvbYATxw1vmCggpljYAveRrv1/+YErm/dD1aLNwdBCVnWWrgmNJYjpVDotUeEvasUvg uCADm3aOisRaQCJxwyRGg4oEqfqor7/cNQhtZnkhOG3SEQMn6VLIU6zMcDyQiUaGW8CPJ bcuVP9hQyujSyrHG3Z4BUX8P/YQD54hTXMaIK0ojjDQkOPZOy4AXYD0CoaWxJsrZ1rR0D ZxH/pf5eHZbNMN+7PQsEQarTR3mvxkJreb75R7rlfq8PIeuLxgXn2cDHqXPwb7CQB8FPl solP2i2i9EpJ8uoVNrmIjdlmO7qgOTEMNRXbYpv2fcOlb4GMUkujH5qbp5n3+4vUQPQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VcwGjTVy; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93B9A606A32D for ; Fri, 4 Dec 2026 11:11:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=VcwGjTVy Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EA191F000CE; Fri, 4 Dec 2026 11:11:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796382683; bh=lv3nvzmfqx2cWdH7Do0e9mKFnnJZXWz3pLAl7oNMe00=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=VcwGjTVyoOTcuRk/E0jotRugHrFcrz1bWmUwEC5ER6YYMh35xXSLxeuz1tbVjq63d WWePEgn9iZtbDQSBxKXA9xnol6+lF8MKg8SSuF1qU/kdDt4Y+kGPiwlWxbPbN06MOJ w4Btk283tKuo5p6Z6dB16Oy/x9/2fsCGUdZfwDpF+zIJFLL621G8tzKFRF5f+E5NuG 0W3aZl8w9noi92c04dPoW+3nEsbCd9c9ORNTb1475uaBQriq7cd17eMDPlF1FREYnR 04wxO7fKK4Z4Czepy29LBOc8sCM60o0+/XGQmEmweSq5hJRXcvDcStttYuZdihkBdM VXwYhLq17eXJg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v1 RESEND 1/3] media: sun6i-csi: capture: Align size to 16 for NV12_16L16 Reply-To: sashiko-reviews@lists.linux.dev To: "Arash Golgol" , linux-sunxi@lists.linux.dev Cc: media-ci@linuxtv.org In-Reply-To: <20261204105114.23758-2-arash.golgol@gmail.com> References: <20261204105114.23758-1-arash.golgol@gmail.com> <20261204105114.23758-2-arash.golgol@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 11:11:22 +0000 X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] media: sun6i-csi: NV12_16L16 height alignment leaves partial chroma tiles - [Low] media: sun6i-csi: missing Fixes trailer for NV12_16L16 alignment fix -- commit 4b8ff24cde9c84f3080742e2927f26041221e015 Author: Arash Golgol > media: sun6i-csi: capture: Align size to 16 for NV12_16L16 > > The NV12_16L16 format is made of 16x16 tiles, so both the width and > the height must be a multiple of 16. The format preparation always > aligned dimensions to 2 pixels, whatever the pixel format, which > allowed sizes covering partial tiles. > > Select the alignment from the pixel format, and do so after the > pixel format fallback so that the final format is the one used. > > Assisted-by: Claude:claude-sonnet-5-5 > Signed-off-by: Arash Golgol [Severity: Low] This looks like a bug fix for NV12_16L16 format alignment. Should this include: Fixes: 5cc7522d8965 ("media: sun6i: Add support for Allwinner CSI V3s") > diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c b= /drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c > index d90abba213098..f55edfd0b174a 100644 > --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c > +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c > @@ -41,6 +41,12 @@ void sun6i_csi_capture_format(struct sun6i_csi_device = *csi_dev, > *field =3D csi_dev->capture.format.fmt.pix.field; > } > > +static unsigned int sun6i_csi_capture_format_align(u32 pixelformat) > +{ > + /* Returns log2 of the required alignment. */ > + return pixelformat =3D=3D V4L2_PIX_FMT_NV12_16L16 ? 4 : 1; > +} > + > /* Format */ > > static const struct sun6i_csi_capture_format sun6i_csi_capture_formats[]= =3D { > @@ -665,17 +671,19 @@ static void sun6i_csi_capture_format_prepare(struct= v4l2_format *format) > { > struct v4l2_pix_format *pix_format =3D &format->fmt.pix; > const struct v4l2_format_info *info; > - unsigned int width, height; > - > - v4l_bound_align_image(&pix_format->width, SUN6I_CSI_CAPTURE_WIDTH_MIN, > - SUN6I_CSI_CAPTURE_WIDTH_MAX, 1, > - &pix_format->height, SUN6I_CSI_CAPTURE_HEIGHT_MIN, > - SUN6I_CSI_CAPTURE_HEIGHT_MAX, 1, 0); > + unsigned int width, height, align; > > if (!sun6i_csi_capture_format_find(pix_format->pixelformat)) > pix_format->pixelformat =3D > sun6i_csi_capture_formats[0].pixelformat; > > + align =3D sun6i_csi_capture_format_align(pix_format->pixelformat); > + > + v4l_bound_align_image(&pix_format->width, SUN6I_CSI_CAPTURE_WIDTH_MIN, > + SUN6I_CSI_CAPTURE_WIDTH_MAX, align, > + &pix_format->height, SUN6I_CSI_CAPTURE_HEIGHT_MIN, > + SUN6I_CSI_CAPTURE_HEIGHT_MAX, align, 0); > + > width =3D pix_format->width; > height =3D pix_format->height; [Severity: Medium] Does aligning height to 16 pixels still leave partial chroma tiles for V4L2_PIX_FMT_NV12_16L16? V4L2_PIX_FMT_NV12_16L16 is a 4:2:0 semi-planar format where both the luma and chroma planes use 16x16 tiles. Because the chroma plane has half as many lines as the luma plane, one row of chroma tiles spans 32 image lines. With 16-pixel height alignment, an odd multiple of 16 (such as 1280x720) leaves a half-row of chroma tiles, and sun6i_csi_capture_format_prepare() still computes sizeimage as (width * 12 / 8) * height. This leaves the buffer short by width * 8 bytes for consumers expecting full chroma tiles. Aligning height to 32 pixels (halign =3D 5), or padding the chroma plane in sizeimage to width * ALIGN(height, 32) / 2 if 16-pixel heights must be kept, would avoid partial chroma tiles. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204105114.2375= 8-1-arash.golgol@gmail.com?part=3D1