Re: [PATCH 1/9] s5p-jpeg: Add support for Exynos3250 SoC

2014-07-11 Thread Sylwester Nawrocki
On 07/07/14 18:32, Jacek Anaszewski wrote:
 +void exynos3250_jpeg_dec_scaling_ratio(void __iomem *regs,
 + unsigned int sratio)
 +{
 + switch (sratio) {
 + case 1:
 + sratio = EXYNOS3250_DEC_SCALE_FACTOR_8_8;
 + break;
 + case 2:
 + sratio = EXYNOS3250_DEC_SCALE_FACTOR_4_8;
 + break;
 + case 4:
 + sratio = EXYNOS3250_DEC_SCALE_FACTOR_2_8;
 + break;
 + case 8:
 + sratio = EXYNOS3250_DEC_SCALE_FACTOR_1_8;
 + break;
 + }

Missing the 'default' case ?

 + writel(sratio  EXYNOS3250_DEC_SCALE_FACTOR_MASK,
 + regs + EXYNOS3250_DEC_SCALING_RATIO);
 +}

--
Regards,
Sylwester
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/9] s5p-jpeg: Add support for Exynos3250 SoC

2014-07-07 Thread Jacek Anaszewski
This patch adds support for jpeg codec on Exynos3250 SoC to
the s5p-jpeg driver. Supported raw formats are: YUYV, YVYU, UYVY,
VYUY, RGB565, RGB565X, RGB32, NV12, NV21. The support includes
also scaling and cropping features.

Signed-off-by: Jacek Anaszewski j.anaszew...@samsung.com
Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com
---
 drivers/media/platform/s5p-jpeg/Makefile   |2 +-
 drivers/media/platform/s5p-jpeg/jpeg-core.c|  533 +++-
 drivers/media/platform/s5p-jpeg/jpeg-core.h|   33 +-
 .../media/platform/s5p-jpeg/jpeg-hw-exynos3250.c   |  486 ++
 .../media/platform/s5p-jpeg/jpeg-hw-exynos3250.h   |   60 +++
 drivers/media/platform/s5p-jpeg/jpeg-regs.h|  247 -
 6 files changed, 1341 insertions(+), 20 deletions(-)
 create mode 100644 drivers/media/platform/s5p-jpeg/jpeg-hw-exynos3250.c
 create mode 100644 drivers/media/platform/s5p-jpeg/jpeg-hw-exynos3250.h

diff --git a/drivers/media/platform/s5p-jpeg/Makefile 
b/drivers/media/platform/s5p-jpeg/Makefile
index a1a9169..9e5f214 100644
--- a/drivers/media/platform/s5p-jpeg/Makefile
+++ b/drivers/media/platform/s5p-jpeg/Makefile
@@ -1,2 +1,2 @@
-s5p-jpeg-objs := jpeg-core.o jpeg-hw-exynos4.o jpeg-hw-s5p.o
+s5p-jpeg-objs := jpeg-core.o jpeg-hw-exynos3250.o jpeg-hw-exynos4.o 
jpeg-hw-s5p.o
 obj-$(CONFIG_VIDEO_SAMSUNG_S5P_JPEG) += s5p-jpeg.o
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c 
b/drivers/media/platform/s5p-jpeg/jpeg-core.c
index 0dcb796..7d604f2 100644
--- a/drivers/media/platform/s5p-jpeg/jpeg-core.c
+++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c
@@ -1,6 +1,6 @@
 /* linux/drivers/media/platform/s5p-jpeg/jpeg-core.c
  *
- * Copyright (c) 2011-2013 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2011-2014 Samsung Electronics Co., Ltd.
  * http://www.samsung.com
  *
  * Author: Andrzej Pietrasiewicz andrze...@samsung.com
@@ -32,6 +32,7 @@
 #include jpeg-core.h
 #include jpeg-hw-s5p.h
 #include jpeg-hw-exynos4.h
+#include jpeg-hw-exynos3250.h
 #include jpeg-regs.h
 
 static struct s5p_jpeg_fmt sjpeg_formats[] = {
@@ -41,6 +42,7 @@ static struct s5p_jpeg_fmt sjpeg_formats[] = {
.flags  = SJPEG_FMT_FLAG_ENC_CAPTURE |
  SJPEG_FMT_FLAG_DEC_OUTPUT |
  SJPEG_FMT_FLAG_S5P |
+ SJPEG_FMT_FLAG_EXYNOS3250 |
  SJPEG_FMT_FLAG_EXYNOS4,
},
{
@@ -70,6 +72,19 @@ static struct s5p_jpeg_fmt sjpeg_formats[] = {
.subsampling= V4L2_JPEG_CHROMA_SUBSAMPLING_422,
},
{
+   .name   = YUV 4:2:2 packed, YCbYCr,
+   .fourcc = V4L2_PIX_FMT_YUYV,
+   .depth  = 16,
+   .colplanes  = 1,
+   .h_align= 2,
+   .v_align= 0,
+   .flags  = SJPEG_FMT_FLAG_ENC_OUTPUT |
+ SJPEG_FMT_FLAG_DEC_CAPTURE |
+ SJPEG_FMT_FLAG_EXYNOS3250 |
+ SJPEG_FMT_NON_RGB,
+   .subsampling= V4L2_JPEG_CHROMA_SUBSAMPLING_422,
+   },
+   {
.name   = YUV 4:2:2 packed, YCrYCb,
.fourcc = V4L2_PIX_FMT_YVYU,
.depth  = 16,
@@ -83,6 +98,45 @@ static struct s5p_jpeg_fmt sjpeg_formats[] = {
.subsampling= V4L2_JPEG_CHROMA_SUBSAMPLING_422,
},
{
+   .name   = YUV 4:2:2 packed, YCrYCb,
+   .fourcc = V4L2_PIX_FMT_YVYU,
+   .depth  = 16,
+   .colplanes  = 1,
+   .h_align= 2,
+   .v_align= 0,
+   .flags  = SJPEG_FMT_FLAG_ENC_OUTPUT |
+ SJPEG_FMT_FLAG_DEC_CAPTURE |
+ SJPEG_FMT_FLAG_EXYNOS3250 |
+ SJPEG_FMT_NON_RGB,
+   .subsampling= V4L2_JPEG_CHROMA_SUBSAMPLING_422,
+   },
+   {
+   .name   = YUV 4:2:2 packed, YCrYCb,
+   .fourcc = V4L2_PIX_FMT_UYVY,
+   .depth  = 16,
+   .colplanes  = 1,
+   .h_align= 2,
+   .v_align= 0,
+   .flags  = SJPEG_FMT_FLAG_ENC_OUTPUT |
+ SJPEG_FMT_FLAG_DEC_CAPTURE |
+ SJPEG_FMT_FLAG_EXYNOS3250 |
+ SJPEG_FMT_NON_RGB,
+   .subsampling= V4L2_JPEG_CHROMA_SUBSAMPLING_422,
+   },
+   {
+   .name   = YUV 4:2:2 packed, YCrYCb,
+   .fourcc = V4L2_PIX_FMT_VYUY,
+   .depth  = 16,
+   .colplanes  = 1,
+   .h_align= 2,
+   .v_align= 0,
+