media: s5p-jpeg: add RGB565 format to Exynos4 buffer size workaround
authorMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 16 Apr 2015 09:52:33 +0000 (11:52 +0200)
committerMarek Szyprowski <m.szyprowski@samsung.com>
Thu, 16 Apr 2015 09:52:33 +0000 (11:52 +0200)
JPEG HW can access buffer beyond the image data for images, which width
or height is not properly aligned. This patch adds RGB565 format to
workaround code to solve IOMMU page fault issue. The exact needed buffer
enlargement workaround need to be determined experimentally.

Reported-by: Inha Song <ideal.song@samsung.com>
Suggested-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
drivers/media/platform/s5p-jpeg/jpeg-core.c

index ca47d4395e61535f10fad6d3e9505a1431a01eb8..a1fb7e6a97c3996e06ff9fbecf02ecbb5a97f50b 100644 (file)
@@ -1300,7 +1300,8 @@ static int exynos4_jpeg_get_output_buffer_size(struct s5p_jpeg_ctx *ctx,
            pix_fmt == V4L2_PIX_FMT_NV42 ||
            pix_fmt == V4L2_PIX_FMT_NV12 ||
            pix_fmt == V4L2_PIX_FMT_NV21 ||
-           pix_fmt == V4L2_PIX_FMT_YUV420)
+           pix_fmt == V4L2_PIX_FMT_YUV420 ||
+           pix_fmt == V4L2_PIX_FMT_RGB565)
                wh_align = 4;
        else
                wh_align = 1;