linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Escande <thierry.escande@collabora.com>
To: Andrzej Pietrasiewicz <andrzej.p@samsung.com>,
	Jacek Anaszewski <jacek.anaszewski@gmail.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 6/8] [media] s5p-jpeg: Decode 4:1:1 chroma subsampling format
Date: Tue, 27 Jun 2017 18:08:52 +0200	[thread overview]
Message-ID: <1498579734-1594-7-git-send-email-thierry.escande@collabora.com> (raw)
In-Reply-To: <1498579734-1594-1-git-send-email-thierry.escande@collabora.com>

From: Tony K Nadackal <tony.kn@samsung.com>

This patch adds support for decoding 4:1:1 chroma subsampling in the
jpeg header parsing function.

Signed-off-by: Tony K Nadackal <tony.kn@samsung.com>
Signed-off-by: Thierry Escande <thierry.escande@collabora.com>
---
 drivers/media/platform/s5p-jpeg/jpeg-core.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 0783809..cca0fb8 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1099,6 +1099,8 @@ static void skip(struct s5p_jpeg_buffer *buf, long len)
 static bool s5p_jpeg_subsampling_decode(struct s5p_jpeg_ctx *ctx,
 					unsigned int subsampling)
 {
+	unsigned int version;
+
 	switch (subsampling) {
 	case 0x11:
 		ctx->subsampling = V4L2_JPEG_CHROMA_SUBSAMPLING_444;
@@ -1112,6 +1114,19 @@ static bool s5p_jpeg_subsampling_decode(struct s5p_jpeg_ctx *ctx,
 	case 0x33:
 		ctx->subsampling = V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY;
 		break;
+	case 0x41:
+		/*
+		 * 4:1:1 subsampling only supported by 3250, 5420, and 5433
+		 * variants
+		 */
+		version = ctx->jpeg->variant->version;
+		if (version != SJPEG_EXYNOS3250 &&
+		    version != SJPEG_EXYNOS5420 &&
+		    version != SJPEG_EXYNOS5433)
+			return false;
+
+		ctx->subsampling = V4L2_JPEG_CHROMA_SUBSAMPLING_411;
+		break;
 	default:
 		return false;
 	}
-- 
2.7.4

  parent reply	other threads:[~2017-06-27 16:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170627160906epcas4p369a67fdb1b8f6898a1f1b4ddb7927995@epcas4p3.samsung.com>
2017-06-27 16:08 ` [PATCH v3 0/8] [media] s5p-jpeg: Various fixes and improvements Thierry Escande
2017-06-27 16:08   ` [PATCH v3 1/8] [media] s5p-jpeg: Call jpeg_bound_align_image after qbuf Thierry Escande
2017-06-29 12:03     ` Andrzej Pietrasiewicz
2017-06-27 16:08   ` [PATCH v3 2/8] [media] s5p-jpeg: Correct WARN_ON statement for checking subsampling Thierry Escande
2017-06-29 12:03     ` Andrzej Pietrasiewicz
2017-06-27 16:08   ` [PATCH v3 3/8] [media] s5p-jpeg: Handle parsing error in s5p_jpeg_parse_hdr() Thierry Escande
2017-06-29 12:04     ` Andrzej Pietrasiewicz
2017-06-27 16:08   ` [PATCH v3 4/8] [media] s5p-jpeg: Don't use temporary structure in s5p_jpeg_buf_queue Thierry Escande
2017-06-29 12:04     ` Andrzej Pietrasiewicz
2017-06-29 20:12     ` Jacek Anaszewski
2017-06-27 16:08   ` [PATCH v3 5/8] [media] s5p-jpeg: Split s5p_jpeg_parse_hdr() Thierry Escande
2017-06-29 12:04     ` Andrzej Pietrasiewicz
2017-06-27 16:08   ` Thierry Escande [this message]
2017-06-29 12:04     ` [PATCH v3 6/8] [media] s5p-jpeg: Decode 4:1:1 chroma subsampling format Andrzej Pietrasiewicz
2017-06-27 16:08   ` [PATCH v3 7/8] [media] s5p-jpeg: Add support for resolution change event Thierry Escande
2017-06-29 12:04     ` Andrzej Pietrasiewicz
2017-06-27 16:08   ` [PATCH v3 8/8] [media] s5p-jpeg: Add stream error handling for Exynos5420 Thierry Escande
2017-06-29 12:05     ` Andrzej Pietrasiewicz
2017-06-29 12:02   ` [PATCH v3 0/8] [media] s5p-jpeg: Various fixes and improvements Andrzej Pietrasiewicz
2017-06-29 20:13   ` Jacek Anaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1498579734-1594-7-git-send-email-thierry.escande@collabora.com \
    --to=thierry.escande@collabora.com \
    --cc=andrzej.p@samsung.com \
    --cc=jacek.anaszewski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).