media: rzg2l-cru: Use v4l2_fill_pixfmt_aligned() for stride alignment

Replace the open-coded bytesperline/sizeimage rounding with the newly
added v4l2_fill_pixfmt_aligned().

No functional change intended.

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
This commit is contained in:
Tommaso Merciai 2026-08-19 12:28:08 +02:00 committed by Sakari Ailus
parent ef3081d495
commit 4bcf502545

View File

@ -849,12 +849,8 @@ static void rzg2l_cru_format_align(struct rzg2l_cru_dev *cru,
v4l_bound_align_image(&pix->width, 320, info->max_width, 1,
&pix->height, 240, info->max_height, 2, 0);
v4l2_fill_pixfmt(pix, pix->pixelformat, pix->width, pix->height);
if (info->has_stride) {
pix->bytesperline = ALIGN(pix->bytesperline, RZG2L_CRU_STRIDE_ALIGN);
pix->sizeimage = pix->bytesperline * pix->height;
}
v4l2_fill_pixfmt_aligned(pix, pix->pixelformat, pix->width, pix->height,
info->has_stride ? RZG2L_CRU_STRIDE_ALIGN : 1);
dev_dbg(cru->dev, "Format %ux%u bpl: %u size: %u\n",
pix->width, pix->height, pix->bytesperline, pix->sizeimage);