mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
[media] exynos4-is: fimc: Roundup imagesize to row size for tiled formats
For tiled format, we need to allocated a multiple of the row size. A good example is for 1280x720, wich get adjusted to 1280x736. In tiles, this mean Y plane is 20x23 and UV plane 20x12. Because of the rounding, the previous code would only have enough space to fit half of the last row. [mchehab@s-opensource.com: fix coding style] Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
This commit is contained in:
parent
4710b752e0
commit
90b4c9c65a
1 changed files with 12 additions and 2 deletions
|
@ -736,6 +736,7 @@ void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height,
|
|||
for (i = 0; i < pix->num_planes; ++i) {
|
||||
struct v4l2_plane_pix_format *plane_fmt = &pix->plane_fmt[i];
|
||||
u32 bpl = plane_fmt->bytesperline;
|
||||
u32 sizeimage;
|
||||
|
||||
if (fmt->colplanes > 1 && (bpl == 0 || bpl < pix->width))
|
||||
bpl = pix->width; /* Planar */
|
||||
|
@ -755,8 +756,17 @@ void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height,
|
|||
bytesperline /= 2;
|
||||
|
||||
plane_fmt->bytesperline = bytesperline;
|
||||
plane_fmt->sizeimage = max((pix->width * pix->height *
|
||||
fmt->depth[i]) / 8, plane_fmt->sizeimage);
|
||||
sizeimage = pix->width * pix->height * fmt->depth[i] / 8;
|
||||
|
||||
/* Ensure full last row for tiled formats */
|
||||
if (tiled_fmt(fmt)) {
|
||||
/* 64 * 32 * plane_fmt->bytesperline / 64 */
|
||||
u32 row_size = plane_fmt->bytesperline * 32;
|
||||
|
||||
sizeimage = roundup(sizeimage, row_size);
|
||||
}
|
||||
|
||||
plane_fmt->sizeimage = max(sizeimage, plane_fmt->sizeimage);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue