[PATCH 5/5] media: platform: s5p-jpeg: directly use parsed subsampling on 5433

Andrzej Pietrasiewicz andrzej.p at samsung.com
Tue Aug 8 04:27:08 PDT 2017


On 5433 variant JPEG data is parsed by hardware only from SOS marker,
so subsampling is parsed by software. As such, its value need not be
translated from hardware-specific encoding to V4L2 encoding.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p at samsung.com>
---
 drivers/media/platform/s5p-jpeg/jpeg-core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 492fab1..0225c82 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -627,10 +627,11 @@ static int s5p_jpeg_to_user_subsampling(struct s5p_jpeg_ctx *ctx)
 			return V4L2_JPEG_CHROMA_SUBSAMPLING_411;
 		return exynos3250_decoded_subsampling[ctx->subsampling];
 	case SJPEG_EXYNOS4:
-	case SJPEG_EXYNOS5433:
 		if (ctx->subsampling > 2)
 			return V4L2_JPEG_CHROMA_SUBSAMPLING_420;
 		return exynos4x12_decoded_subsampling[ctx->subsampling];
+	case SJPEG_EXYNOS5433:
+		return ctx->subsampling; /* parsed from header */
 	default:
 		return V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY;
 	}
-- 
1.9.1




More information about the linux-arm-kernel mailing list