Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3246fdaa authored by Jacek Anaszewski's avatar Jacek Anaszewski Committed by Mauro Carvalho Chehab
Browse files

[media] s5p-jpeg: Add support for Exynos3250 SoC



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: default avatarJacek Anaszewski <j.anaszewski@samsung.com>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 1774afe7
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -167,12 +167,13 @@ config VIDEO_SAMSUNG_S5P_G2D
	  2d graphics accelerator.

config VIDEO_SAMSUNG_S5P_JPEG
	tristate "Samsung S5P/Exynos4 JPEG codec driver"
	tristate "Samsung S5P/Exynos3250/Exynos4 JPEG codec driver"
	depends on VIDEO_DEV && VIDEO_V4L2 && (PLAT_S5P || ARCH_EXYNOS)
	select VIDEOBUF2_DMA_CONTIG
	select V4L2_MEM2MEM_DEV
	---help---
	  This is a v4l2 driver for Samsung S5P and EXYNOS4 JPEG codec
	  This is a v4l2 driver for Samsung S5P, EXYNOS3250
	  and EXYNOS4 JPEG codec

config VIDEO_SAMSUNG_S5P_MFC
	tristate "Samsung S5P MFC Video Codec"
+1 −1
Original line number Diff line number Diff line
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
+515 −12

File changed.

Preview size limit exceeded, changes collapsed.

+26 −6
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@
#define S5P_JPEG_COEF32			0x6e
#define S5P_JPEG_COEF33			0x13

#define EXYNOS3250_IRQ_TIMEOUT		0x10000000

/* a selection of JPEG markers */
#define TEM				0x01
#define SOF0				0xc0
@@ -49,9 +51,10 @@
#define SJPEG_FMT_FLAG_DEC_CAPTURE	(1 << 2)
#define SJPEG_FMT_FLAG_DEC_OUTPUT	(1 << 3)
#define SJPEG_FMT_FLAG_S5P		(1 << 4)
#define SJPEG_FMT_FLAG_EXYNOS4		(1 << 5)
#define SJPEG_FMT_RGB			(1 << 6)
#define SJPEG_FMT_NON_RGB		(1 << 7)
#define SJPEG_FMT_FLAG_EXYNOS3250	(1 << 5)
#define SJPEG_FMT_FLAG_EXYNOS4		(1 << 6)
#define SJPEG_FMT_RGB			(1 << 7)
#define SJPEG_FMT_NON_RGB		(1 << 8)

#define S5P_JPEG_ENCODE		0
#define S5P_JPEG_DECODE		1
@@ -66,7 +69,8 @@
/* Version numbers */

#define SJPEG_S5P		1
#define SJPEG_EXYNOS4	2
#define SJPEG_EXYNOS3250	2
#define SJPEG_EXYNOS4		3

enum exynos4_jpeg_result {
	OK_ENC_OR_DEC,
@@ -95,8 +99,13 @@ enum exynos4_jpeg_img_quality_level {
 * @regs:		JPEG IP registers mapping
 * @irq:		JPEG IP irq
 * @clk:		JPEG IP clock
 * @sclk:		Exynos3250 JPEG IP special clock
 * @dev:		JPEG IP struct device
 * @alloc_ctx:		videobuf2 memory allocator's context
 * @variant:		driver variant to be used
 * @irq_status		interrupt flags set during single encode/decode
			operation

 */
struct s5p_jpeg {
	struct mutex		lock;
@@ -111,9 +120,11 @@ struct s5p_jpeg {
	unsigned int		irq;
	enum exynos4_jpeg_result irq_ret;
	struct clk		*clk;
	struct clk		*sclk;
	struct device		*dev;
	void			*alloc_ctx;
	struct s5p_jpeg_variant *variant;
	u32			irq_status;
};

struct s5p_jpeg_variant {
@@ -164,9 +175,15 @@ struct s5p_jpeg_q_data {
 * @jpeg:		JPEG IP device for this context
 * @mode:		compression (encode) operation or decompression (decode)
 * @compr_quality:	destination image quality in compression (encode) mode
 * @restart_interval:	JPEG restart interval for JPEG encoding
 * @subsampling:	subsampling of a raw format or a JPEG
 * @out_q:		source (output) queue information
 * @cap_fmt:		destination (capture) queue queue information
 * @cap_q:		destination (capture) queue queue information
 * @scale_factor:	scale factor for JPEG decoding
 * @crop_rect:		a rectangle representing crop area of the output buffer
 * @fh:			V4L2 file handle
 * @hdr_parsed:		set if header has been parsed during decompression
 * @crop_altered:	set if crop rectangle has been altered by the user space
 * @ctrl_handler:	controls handler
 */
struct s5p_jpeg_ctx {
@@ -177,8 +194,11 @@ struct s5p_jpeg_ctx {
	unsigned short		subsampling;
	struct s5p_jpeg_q_data	out_q;
	struct s5p_jpeg_q_data	cap_q;
	unsigned int		scale_factor;
	struct v4l2_rect	crop_rect;
	struct v4l2_fh		fh;
	bool			hdr_parsed;
	bool			crop_altered;
	struct v4l2_ctrl_handler ctrl_handler;
};

+487 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading