[<prev] [next>] [day] [month] [year] [list]
Message-Id: <5682e37ff93ec19c0fbc5dd6614d6f57281ea663.1635839008.git.mchehab+huawei@kernel.org>
Date: Tue, 2 Nov 2021 07:43:31 +0000
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: unlisted-recipients:; (no To-header on input)
Cc: linuxarm@...wei.com, mauro.chehab@...wei.com,
Mauro Carvalho Chehab <mchehab+huawei@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Arnd Bergmann <arnd@...db.de>,
Dan Carpenter <dan.carpenter@...cle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ingo Molnar <mingo@...nel.org>,
Kaixu Xia <kaixuxia@...cent.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Tsuchiya Yuto <kitakar@...il.com>,
linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
linux-staging@...ts.linux.dev
Subject: [PATCH] media: atomisp: align sizes returned by g_fmt
Repeat the same round logic used inside s_fmt here, for the sake
of sanity.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
---
drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
index 936516daec7d..8df052f6190d 100644
--- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
+++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c
@@ -892,8 +892,8 @@ static int atomisp_g_fmt_cap(struct file *file, void *fh,
}
depth = atomisp_get_pixel_depth(f->fmt.pix.pixelformat);
- f->fmt.pix.bytesperline = (f->fmt.pix.width * depth) >> 3;
- f->fmt.pix.sizeimage = f->fmt.pix.height * f->fmt.pix.bytesperline;
+ f->fmt.pix.bytesperline = DIV_ROUND_UP(f->fmt.pix.width * depth, 8);
+ f->fmt.pix.sizeimage = PAGE_ALIGN(f->fmt.pix.height * f->fmt.pix.bytesperline);
/*
* FIXME: do we need to setup this differently, depending on the
--
2.31.1
Powered by blists - more mailing lists