Add support for Exynos3250 SoC to the s5p-jpeg driver
Subsystems (3)
PATCH v2 8/9 Documentation: devicetree: Document sclk-jpeg clock for exynos3250 SoC
In reply to Jacek AnaszewskiJPEG IP on Exynos3250 SoC requires enabling two clock gates for its operation. This patch documents this requirement.
--- .../bindings/media/exynos-jpeg-codec.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt +6 -3
@@ -3,9 +3,12 @@ Samsung S5P/EXYNOS SoC series JPEG codec Required properties: - compatible : should be one of: - "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg"; + "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg", + "samsung,exynos3250-jpeg"; - reg : address and length of the JPEG codec IP register set; - interrupts : specifies the JPEG codec IP interrupt; -- clocks : should contain the JPEG codec IP gate clock specifier, from the +- clocks : should contain the JPEG codec IP gate clock specifier and + for the Exynos3250 SoC additionally the SCLK_JPEG entry; from the common clock bindings; -- clock-names : should contain "jpeg" entry. +- clock-names : should contain "jpeg" entry and additionally "sclk-jpeg" entry + for Exynos3250 SoC
Signature · 1 line
1.7.9.5
v2 cover Add support for Exynos3250 SoC to the s5p-jpeg driver
This is the second version of the patch series adding support for jpeg codec on Exynos3250 SoC to the s5p-jpeg driver (Sylwester - thanks for a review). Supported raw formats are: YUYV, YVYU, UYVY, VYUY, RGB565, RGB565X, RGB32, NV12, NV21. The support includes also scaling and cropping features.
=================
Changes since v1:
=================
- added default case to the switch statement in the function exynos3250_jpeg_dec_scaling_ratiofunction
- removed not supported DT properties
- improved DT documentation
- updated Kconfig entry
- corrected DTS maintainer email in the commit message
Thanks,
Jacek Anaszewski
Jacek Anaszewski (9):
s5p-jpeg: Add support for Exynos3250 SoC
s5p-jpeg: return error immediately after get_byte fails
s5p-jpeg: Adjust jpeg_bound_align_image to Exynos3250 needs
s5p-jpeg: fix g_selection op
s5p-jpeg: Assure proper crop rectangle initialization
s5p-jpeg: Prevent erroneous downscaling for Exynos3250 SoC
s5p-jpeg: add chroma subsampling adjustment for Exynos3250
Documentation: devicetree: Document sclk-jpeg clock for exynos3250
SoC
ARM: dts: exynos3250: add JPEG codec device node
.../bindings/media/exynos-jpeg-codec.txt | 9 +- arch/arm/boot/dts/exynos3250.dtsi | 9 + drivers/media/platform/Kconfig | 5 +- drivers/media/platform/s5p-jpeg/Makefile | 2 +- drivers/media/platform/s5p-jpeg/jpeg-core.c | 666 ++++++++++++++++++-- drivers/media/platform/s5p-jpeg/jpeg-core.h | 33 +- .../media/platform/s5p-jpeg/jpeg-hw-exynos3250.c | 489 ++++++++++++++ .../media/platform/s5p-jpeg/jpeg-hw-exynos3250.h | 60 ++ drivers/media/platform/s5p-jpeg/jpeg-regs.h | 247 +++++++- 9 files changed, 1462 insertions(+), 58 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
Signature · 1 line
1.7.9.5
PATCH v2 1/9 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.
--- drivers/media/platform/Kconfig | 5 +- 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 | 489 ++++++++++++++++++ .../media/platform/s5p-jpeg/jpeg-hw-exynos3250.h | 60 +++ drivers/media/platform/s5p-jpeg/jpeg-regs.h | 247 ++++++++- 7 files changed, 1347 insertions(+), 22 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
drivers/media/platform/Kconfig +3 -2
@@ -165,12 +165,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"
drivers/media/platform/s5p-jpeg/Makefile +1 -1
@@ -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
drivers/media/platform/s5p-jpeg/jpeg-core.c +521 -12
709 lines not on this page · raw message
drivers/media/platform/s5p-jpeg/jpeg-core.h +27 -6
@@ -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
@@ -65,8 +68,9 @@/* Version numbers */ -#define SJPEG_S5P 1 -#define SJPEG_EXYNOS4 2 +#define SJPEG_S5P 1 +#define SJPEG_EXYNOS3250 2 +#define SJPEG_EXYNOS4 3enum 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 {
@@ -121,6 +132,7 @@ struct s5p_jpeg_variant {unsigned int fmt_ver_flag;struct v4l2_m2m_ops *m2m_ops;irqreturn_t (*jpeg_irq)(int irq,void *priv); + unsigned int has_sclk:1; };/**
@@ -164,9 +176,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 +195,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; };
drivers/media/platform/s5p-jpeg/jpeg-hw-exynos3250.c new file +489 -0
489 lines not on this page · raw message
drivers/media/platform/s5p-jpeg/jpeg-hw-exynos3250.h new file +60 -0
60 lines not on this page · raw message
drivers/media/platform/s5p-jpeg/jpeg-regs.h +246 -1
258 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v2 2/9 s5p-jpeg: return error immediately after get_byte fails
In reply to Jacek AnaszewskiWhen parsing JPEG header s5p_jpeg_parse_hdr function should return immediately in case there was an error while reading a byte.
--- drivers/media/platform/s5p-jpeg/jpeg-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/s5p-jpeg/jpeg-core.c +2 -2
@@ -906,14 +906,14 @@ static bool s5p_jpeg_parse_hdr(struct s5p_jpeg_q_data *result,while (notfound) { c =get_byte (&jpeg_buffer);if (c ==-1 ) -break ; +return false;if (c !=0xff )continue ;do c =get_byte (&jpeg_buffer);while (c ==0xff );if (c ==-1 ) -break ; +return false;if (c ==0 )continue ; length =0 ;
Signature · 1 line
1.7.9.5
PATCH v2 3/9 s5p-jpeg: Adjust jpeg_bound_align_image to Exynos3250 needs
In reply to Jacek AnaszewskiThe jpeg_bound_align_image function needs to know the context in which it is called, as it needs to align image dimensions in a slight different manner for Exynos3250, which crops pixels for specific values in case the format is RGB.
--- drivers/media/platform/s5p-jpeg/jpeg-core.c | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-)
drivers/media/platform/s5p-jpeg/jpeg-core.c +20 -5
@@ -1133,7 +1133,8 @@ static struct s5p_jpeg_fmt *s5p_jpeg_find_format(struct s5p_jpeg_ctx *ctx,return NULL ; } -static void jpeg_bound_align_image (u32 *w,unsigned int wmin,unsigned int wmax, +static void jpeg_bound_align_image (struct s5p_jpeg_ctx *ctx, +u32 *w,unsigned int wmin,unsigned int wmax,unsigned int walign,u32 *h,unsigned int hmin,unsigned int hmax,unsigned int halign)
@@ -1145,13 +1146,27 @@ static void jpeg_bound_align_image(u32 *w, unsigned int wmin, unsigned int wmax, w_step =1 << walign; h_step =1 << halign; + +if (ctx->jpeg->variant->version ==SJPEG_EXYNOS3250 ) { +/* +* Rightmost and bottommost pixels are cropped by the +* Exynos3250 JPEG IP for RGB formats, for the specific +* width and height values respectively. This assignment +* will result in v4l_bound_align_image returning dimensions +* reduced by 1 for the aforementioned cases. +*/ +if (w_step ==4 && ((width &3 ) ==1 )) { + wmax = width; + hmax = height; + } + } +v4l_bound_align_image (w, wmin, wmax, walign, h, hmin, hmax, halign,0 );if (*w < width && (*w + w_step) < wmax) *w += w_step;if (*h < height && (*h + h_step) < hmax) *h += h_step; - } static int vidioc_try_fmt(struct v4l2_format *f, struct s5p_jpeg_fmt *fmt,
@@ -1167,12 +1182,12 @@ static int vidioc_try_fmt(struct v4l2_format *f, struct s5p_jpeg_fmt *fmt,/* V4L2 specification suggests the driver corrects the format struct * if any of the dimensions is unsupported */ if (q_type ==FMT_TYPE_OUTPUT ) -jpeg_bound_align_image (&pix->width,S5P_JPEG_MIN_WIDTH , +jpeg_bound_align_image (ctx, &pix->width,S5P_JPEG_MIN_WIDTH ,S5P_JPEG_MAX_WIDTH ,0 , &pix->height,S5P_JPEG_MIN_HEIGHT ,S5P_JPEG_MAX_HEIGHT ,0 );else -jpeg_bound_align_image (&pix->width,S5P_JPEG_MIN_WIDTH , +jpeg_bound_align_image (ctx, &pix->width,S5P_JPEG_MIN_WIDTH ,S5P_JPEG_MAX_WIDTH , fmt->h_align, &pix->height,S5P_JPEG_MIN_HEIGHT ,S5P_JPEG_MAX_HEIGHT , fmt->v_align);
@@ -1294,7 +1309,7 @@ static int exynos4_jpeg_get_output_buffer_size(struct s5p_jpeg_ctx *ctx,else wh_align =1 ; -jpeg_bound_align_image (&w,S5P_JPEG_MIN_WIDTH , +jpeg_bound_align_image (ctx, &w,S5P_JPEG_MIN_WIDTH ,S5P_JPEG_MAX_WIDTH , wh_align, &h,S5P_JPEG_MIN_HEIGHT ,S5P_JPEG_MAX_HEIGHT , wh_align);
Signature · 1 line
1.7.9.5
PATCH v2 4/9 s5p-jpeg: fix g_selection op
In reply to Jacek AnaszewskiV4L2_SEL_TGT_COMPOSE_DEFAULT switch case should select whole available area of the image and V4L2_SEL_TGT_COMPOSE should apply user settings.
--- drivers/media/platform/s5p-jpeg/jpeg-core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
drivers/media/platform/s5p-jpeg/jpeg-core.c +7 -5
@@ -1505,21 +1505,23 @@ static int s5p_jpeg_g_selection(struct file *file, void *priv,case V4L2_SEL_TGT_CROP :case V4L2_SEL_TGT_CROP_BOUNDS :case V4L2_SEL_TGT_CROP_DEFAULT : -case V4L2_SEL_TGT_COMPOSE :case V4L2_SEL_TGT_COMPOSE_DEFAULT : s->r.width = ctx->out_q.w; s->r.height = ctx->out_q.h; + s->r.left =0 ; + s->r.top =0 ;break ; +case V4L2_SEL_TGT_COMPOSE :case V4L2_SEL_TGT_COMPOSE_BOUNDS :case V4L2_SEL_TGT_COMPOSE_PADDED : - s->r.width = ctx->cap_q.w; - s->r.height = ctx->cap_q.h; + s->r.width = ctx->crop_rect.width; + s->r.height = ctx->crop_rect.height; + s->r.left = ctx->crop_rect.left; + s->r.top = ctx->crop_rect.top;break ;default :return -EINVAL ; } - s->r.left =0 ; - s->r.top =0 ;return 0 ; }
Signature · 1 line
1.7.9.5
PATCH v2 5/9 s5p-jpeg: Assure proper crop rectangle initialization
In reply to Jacek AnaszewskiAssure proper crop_rect initialization in case
the user space doesn't call S_SELECTION ioctl.
--- drivers/media/platform/s5p-jpeg/jpeg-core.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/media/platform/s5p-jpeg/jpeg-core.c +15 -0
@@ -1367,6 +1367,21 @@ static int s5p_jpeg_s_fmt(struct s5p_jpeg_ctx *ct, struct v4l2_format *f) V4L2_CID_JPEG_CHROMA_SUBSAMPLING);if (ctrl_subs)v4l2_ctrl_s_ctrl (ctrl_subs, q_data->fmt->subsampling); + ct->crop_altered = false; + } + +/* +* For decoding init crop_rect with capture buffer dimmensions which +* contain aligned dimensions of the input JPEG image and do it only +* if crop rectangle hasn't been altered by the user space e.g. with +* S_SELECTION ioctl. For encoding assign output buffer dimensions. +*/ +if (!ct->crop_altered && + ((ct->mode ==S5P_JPEG_DECODE && f_type ==FMT_TYPE_CAPTURE ) || + (ct->mode ==S5P_JPEG_ENCODE && f_type ==FMT_TYPE_OUTPUT ))) { + ct->crop_rect.width = pix->width; + ct->crop_rect.height = pix->height; + } }return 0 ;
Signature · 1 line
1.7.9.5
PATCH v2 6/9 s5p-jpeg: Prevent erroneous downscaling for Exynos3250 SoC
In reply to Jacek AnaszewskiJPEG codec on Exynos3250 SoC produces broken raw image if a JPEG is decoded to YUV420 format and downscaling by more then 2 is applied. Prevent this by asserting downscale ratio to 2.
--- drivers/media/platform/s5p-jpeg/jpeg-core.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/media/platform/s5p-jpeg/jpeg-core.c +18 -0
@@ -1317,12 +1317,16 @@ static int exynos4_jpeg_get_output_buffer_size(struct s5p_jpeg_ctx *ctx,return w * h * fmt_depth >>3 ; } +static int exynos3250_jpeg_try_downscale (struct s5p_jpeg_ctx *ctx, +struct v4l2_rect *r); +static int s5p_jpeg_s_fmt (struct s5p_jpeg_ctx *ct,struct v4l2_format *f) {struct vb2_queue *vq;struct s5p_jpeg_q_data *q_data =NULL ;struct v4l2_pix_format *pix = &f->fmt.pix;struct v4l2_ctrl *ctrl_subs; +struct v4l2_rect scale_rect;unsigned int f_type; vq =v4l2_m2m_get_vq (ct->fh.m2m_ctx, f->type);
@@ -1382,6 +1386,20 @@ static int s5p_jpeg_s_fmt(struct s5p_jpeg_ctx *ct, struct v4l2_format *f) ct->crop_rect.width = pix->width; ct->crop_rect.height = pix->height; } + +/* +* Prevent downscaling to YUV420 format by more than 2 +* for Exynos3250 SoC as it produces broken raw image +* in such cases. +*/ +if (ct->mode ==S5P_JPEG_DECODE && + f_type ==FMT_TYPE_CAPTURE && + ct->jpeg->variant->version ==SJPEG_EXYNOS3250 && + pix->pixelformat ==V4L2_PIX_FMT_YUV420 && + ct->scale_factor >2 ) { + scale_rect.width = ct->out_q.w /2 ; + scale_rect.height = ct->out_q.h /2 ; +exynos3250_jpeg_try_downscale (ct, &scale_rect); }return 0 ;
Signature · 1 line
1.7.9.5
PATCH v2 7/9 s5p-jpeg: add chroma subsampling adjustment for Exynos3250
In reply to Jacek AnaszewskiTake into account limitations specific to the Exynos3250 SoC, regarding setting chroma subsampling control value.
--- drivers/media/platform/s5p-jpeg/jpeg-core.c | 59 +++++++++++++++++---------- 1 file changed, 38 insertions(+), 21 deletions(-)
drivers/media/platform/s5p-jpeg/jpeg-core.c +38 -21
@@ -1603,36 +1603,53 @@ static int s5p_jpeg_g_volatile_ctrl(struct v4l2_ctrl *ctrl)return 0 ; } -static int s5p_jpeg_try_ctrl (struct v4l2_ctrl *ctrl) +static int s5p_jpeg_adjust_subs_ctrl (struct s5p_jpeg_ctx *ctx,int *ctrl_val) { -struct s5p_jpeg_ctx *ctx =ctrl_to_ctx (ctrl); -unsigned long flags; -int ret =0 ; - -spin_lock_irqsave (&ctx->jpeg->slock, flags); - -if (ctrl->id ==V4L2_CID_JPEG_CHROMA_SUBSAMPLING ) { -if (ctx->jpeg->variant->version ==SJPEG_S5P ) - goto error_free; +switch (ctx->jpeg->variant->version) { +case SJPEG_S5P : +return 0 ; +case SJPEG_EXYNOS3250 : +/* +* The exynos3250 device can produce JPEG image only +* of 4:4:4 subsampling when given RGB32 source image. +*/ +if (ctx->out_q.fmt->fourcc ==V4L2_PIX_FMT_RGB32 ) + *ctrl_val =0 ; +break ; +case SJPEG_EXYNOS4 :/* * The exynos4x12 device requires input raw image fourcc * to be V4L2_PIX_FMT_GREY if gray jpeg format * is to be set. */ if (ctx->out_q.fmt->fourcc !=V4L2_PIX_FMT_GREY && - ctrl->val ==V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY ) { - ret = -EINVAL ; - goto error_free; - } -/* -* The exynos4x12 device requires resulting jpeg subsampling -* not to be lower than the input raw image subsampling. -*/ -if (ctx->out_q.fmt->subsampling > ctrl->val) - ctrl->val = ctx->out_q.fmt->subsampling; + *ctrl_val ==V4L2_JPEG_CHROMA_SUBSAMPLING_GRAY ) +return -EINVAL ; +break ; } -error_free: +/* +* The exynos4x12 and exynos3250 devices require resulting +* jpeg subsampling not to be lower than the input raw image +* subsampling. +*/ +if (ctx->out_q.fmt->subsampling > *ctrl_val) + *ctrl_val = ctx->out_q.fmt->subsampling; + +return 0 ; +} + +static int s5p_jpeg_try_ctrl (struct v4l2_ctrl *ctrl) +{ +struct s5p_jpeg_ctx *ctx =ctrl_to_ctx (ctrl); +unsigned long flags; +int ret =0 ; + +spin_lock_irqsave (&ctx->jpeg->slock, flags); + +if (ctrl->id ==V4L2_CID_JPEG_CHROMA_SUBSAMPLING ) + ret =s5p_jpeg_adjust_subs_ctrl (ctx, &ctrl->val); +spin_unlock_irqrestore (&ctx->jpeg->slock, flags);return ret; }
Signature · 1 line
1.7.9.5
PATCH v2 9/9 ARM: dts: exynos3250: add JPEG codec device node
In reply to Jacek Anaszewski--- arch/arm/boot/dts/exynos3250.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm/boot/dts/exynos3250.dtsi +9 -0
@@ -206,6 +206,15 @@ interrupts = <0 240 0>; }; + jpeg-codec@11830000 { + compatible = "samsung,exynos3250-jpeg"; + reg = <0x11830000 0x1000>; + interrupts = <0 171 0>; + clocks = <&cmu CLK_JPEG>, <&cmu CLK_SCLK_JPEG>; + clock-names = "jpeg", "sclk-jpeg"; + samsung,power-domain = <&pd_cam>; + }; + mshc_0: mshc@12510000 { compatible = "samsung,exynos5250-dw-mshc"; reg = <0x12510000 0x1000>;
Signature · 1 line
1.7.9.5
Hi Jacek,
Quoted 12 lines · Jacek Anaszewski
Jacek Anaszewski (9):
s5p-jpeg: Add support for Exynos3250 SoC
s5p-jpeg: return error immediately afterget_bytefails
s5p-jpeg: Adjustjpeg_bound_align_imageto Exynos3250 needs
s5p-jpeg: fixg_selectionop
s5p-jpeg: Assure proper crop rectangle initialization
s5p-jpeg: Prevent erroneous downscaling for Exynos3250 SoC
s5p-jpeg: add chroma subsampling adjustment for Exynos3250
Documentation: devicetree: Document sclk-jpeg clock for exynos3250
SoC
ARM: dts: exynos3250: add JPEG codec device node
I've applied all patches from this series except the last one into my tree.
Signature · 2 lines
Thanks, Sylwester
Re: [PATCH v2 8/9] Documentation: devicetree: Document sclk-jpeg clock for exynos3250 SoC
In reply to Jacek AnaszewskiQuoted 26 lines · Jacek Anaszewski
JPEG IP on Exynos3250 SoC requires enabling two clock gates for its operation. This patch documents this requirement.
Signed-off-by Jacek Anaszewski <[email protected]>Signed-off-by Kyungmin Park <[email protected]>Cc Rob Herring <[email protected]>Cc Pawel Moll <[email protected]>Cc Mark Rutland <[email protected]>Cc Ian Campbell <[email protected]>Cc Kumar Gala <[email protected]>--- .../bindings/media/exynos-jpeg-codec.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt +1
-1@@ -3,9 +3,12 @@ Samsung S5P/EXYNOS SoC series JPEG codec Required properties: - compatible : should be one of: - "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg"; + "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg",
Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt Samsung S5P/EXYNOS SoC series JPEG codec · line 14
Quoted 10 lines
Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt +5
-2+ "samsung,exynos3250-jpeg"; - reg : address and length of the JPEG codec IP register set; - interrupts : specifies the JPEG codec IP interrupt; -- clocks : should contain the JPEG codec IP gate clock specifier, from the +- clocks : should contain the JPEG codec IP gate clock specifier and + for the Exynos3250 SoC additionally the SCLK_JPEG entry; from the common clock bindings; -- clock-names : should contain "jpeg" entry. +- clock-names : should contain "jpeg" entry and additionally "sclk-jpeg" entry + for Exynos3250 SoC
Please turn this into a list for easier reading, e.g.
- clock-names: should contain:
* "jpeg" for the gate clock.
* "sclk-jpeg" for the SCLK_JPEG clock (only for Exynos3250).
You could also define clocks in terms of clock-names to avoid redundancy.
The SCLK_JPEG name sounds like a global name for the clock. Is there a name for the input line on the JPEG block this is plugged into?
Thanks,
Mark.
Re: [PATCH v2 8/9] Documentation: devicetree: Document sclk-jpeg clock for exynos3250 SoC
Quoted 27 lines · Mark Rutland
Quoted 7 lines
Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt +0
-0Quoted 6 lines
index 937b755..3142745 100644
Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt +0
-0@@ -3,9 +3,12 @@ Samsung S5P/EXYNOS SoC series JPEG codec Required properties:Quoted 13 lines
Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt Samsung S5P/EXYNOS SoC series JPEG codec · line 14
Quoted 13 lines
Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt +6
-3- compatible : should be one of: - "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg"; + "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg", + "samsung,exynos3250-jpeg"; - reg : address and length of the JPEG codec IP register set; - interrupts : specifies the JPEG codec IP interrupt; -- clocks : should contain the JPEG codec IP gate clock specifier, from the +- clocks : should contain the JPEG codec IP gate clock specifier and + for the Exynos3250 SoC additionally the SCLK_JPEG entry; from the common clock bindings; -- clock-names : should contain "jpeg" entry. +- clock-names : should contain "jpeg" entry and additionally "sclk-jpeg" entry + for Exynos3250 SoCPlease turn this into a list for easier reading, e.g.
- clock-names: should contain:
* "jpeg" for the gate clock.
* "sclk-jpeg" for theSCLK_JPEGclock (only for Exynos3250).
Quoted 5 lines
You could also define clocks in terms of clock-names to avoid redundancy.
The
SCLK_JPEGname sounds like a global name for the clock. Is there a name for the input line on the JPEG block this is plugged into?
There is unfortunately no such name for SCLK_JPEG clock in the IP's block documentation. For most of the multimedia IPs clocks are documented only in the clock controller chapter, hence the names may appear global. Probably "gate", "sclk" would be good names, rather than "<IP_NAME>", "<IP_NAME>-sclk". But people kept using the latter convention and now it's spread all over and it's hard to change it.
Since now we can't rename "jpeg" and other IPs I'd assume it's best to stay with "jpeg", "sclk-jpeg".
--
Regards,
Sylwester
Re: [PATCH v2 8/9] Documentation: devicetree: Document sclk-jpeg clock for exynos3250 SoC
Quoted 34 lines · On Tuesday 22 July 2014 13:42:00 Sylwester Nawrocki wrote:
Quoted 27 lines · Mark Rutland
Quoted 7 lines
Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt +0
-0Quoted 6 lines
index 937b755..3142745 100644
Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt +0
-0@@ -3,9 +3,12 @@ Samsung S5P/EXYNOS SoC series JPEG codec Required properties:Quoted 13 lines
Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt Samsung S5P/EXYNOS SoC series JPEG codec · line 14
Quoted 13 lines
Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt +6
-3- compatible : should be one of: - "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg"; + "samsung,s5pv210-jpeg", "samsung,exynos4210-jpeg", + "samsung,exynos3250-jpeg"; - reg : address and length of the JPEG codec IP register set; - interrupts : specifies the JPEG codec IP interrupt; -- clocks : should contain the JPEG codec IP gate clock specifier, from the +- clocks : should contain the JPEG codec IP gate clock specifier and + for the Exynos3250 SoC additionally the SCLK_JPEG entry; from the common clock bindings; -- clock-names : should contain "jpeg" entry. +- clock-names : should contain "jpeg" entry and additionally "sclk-jpeg" entry + for Exynos3250 SoCPlease turn this into a list for easier reading, e.g.
- clock-names: should contain:
* "jpeg" for the gate clock.
* "sclk-jpeg" for theSCLK_JPEGclock (only for Exynos3250).Quoted 5 lines
You could also define clocks in terms of clock-names to avoid redundancy.
The
SCLK_JPEGname sounds like a global name for the clock. Is there a name for the input line on the JPEG block this is plugged into?
Quoted 8 lines
There is unfortunately no such name for
SCLK_JPEGclock in the IP's block documentation. For most of the multimedia IPs clocks are documented only in the clock controller chapter, hence the names may appear global. Probably "gate", "sclk" would be good names, rather than "<IP_NAME>", "<IP_NAME>-sclk". But people kept using the latter convention and now it's spread all over and it's hard to change it.
Since now we can't rename "jpeg" and other IPs I'd assume it's best to stay with "jpeg", "sclk-jpeg".
We just had the exact same discussion about the addition of the sclk for the adc in exynos3250 and ended up calling it just "sclk" instead of "sclk-adc" there. I think it would be best to do the same here and use "sclk" instead of "sclk-jpeg".
Arnd
Re: [PATCH v2 8/9] Documentation: devicetree: Document sclk-jpeg clock for exynos3250 SoC
Quoted 29 lines · Arnd Bergmann
Quoted 20 lines
Quoted 20 lines
Quoted 19 lines
Quoted 19 lines
-- clocks : should contain the JPEG codec IP gate clock specifier, from the
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt Samsung S5P/EXYNOS SoC series JPEG codec · line 14
Quoted 6 lines
+- clocks : should contain the JPEG codec IP gate clock specifier and
Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt +3
-1+ for the Exynos3250 SoC additionally the SCLK_JPEG entry; from the common clock bindings; -- clock-names : should contain "jpeg" entry. +- clock-names : should contain "jpeg" entry and additionally "sclk-jpeg" entry + for Exynos3250 SoCPlease turn this into a list for easier reading, e.g.
- clock-names: should contain:
* "jpeg" for the gate clock.
* "sclk-jpeg" for theSCLK_JPEGclock (only for Exynos3250).You could also define clocks in terms of clock-names to avoid redundancy.
The
SCLK_JPEGname sounds like a global name for the clock. Is there a name for the input line on the JPEG block this is plugged into?Quoted 8 lines
Quoted 8 lines
There is unfortunately no such name for
SCLK_JPEGclock in the IP's block documentation. For most of the multimedia IPs clocks are documented only in the clock controller chapter, hence the names may appear global. Probably "gate", "sclk" would be good names, rather than "<IP_NAME>", "<IP_NAME>-sclk". But people kept using the latter convention and now it's spread all over and it's hard to change it.
Since now we can't rename "jpeg" and other IPs I'd assume it's best to stay with "jpeg", "sclk-jpeg".
Quoted 4 lines
We just had the exact same discussion about the addition of the sclk for the adc in exynos3250 and ended up calling it just "sclk" instead of "sclk-adc" there. I think it would be best to do the same here and use "sclk" instead of "sclk-jpeg".
All right, then I would rephrase it to:
- clock-names : should contain:
- "jpeg" for the common gate clock,
- "sclk" for the special clock (only for Exynos3250).
- clocks : should contain the clock specifier and clock ID list
matching entries in the clock-names property, according to the common clock bindings.
I went through documentation of these clocks in various SoCs' datasheets:
exynos4210, exynos4212/4412, exynos3250, exynos5250 and I think for all SoCs the "jpeg" clock can be referred as "gating all clocks for the IP". That means there is a single bit in a CMU register masking all the clocks for the IP, I suppose this includes the control bus (APB) clock and the IP functional ("special") clock.
It looks like e.g. exynos4412 also has the SCLK clock, after muxes and a divider, so rate can be configured for this clock. However there is no separate gate for SCLK as in case of exynos3250. Thus there is no need to to enable/disable the second clock on anything except exynos3250 currently.
I think ideally sclk should also be defined for SoCs like exynos4x12, exynos5250, even if now drivers are not touching sclk. All in all the IP functional clock frequency should be normally set to some known value, now we rely on the default divider value which results in divider ratio = 1.
It would break backward compatibility though if we now made sclk mandatory. I'm inclined to also specify sclk for exynos4x12, just not sure if it should be optional or mandatory.
Signature · 2 lines
Regards, Sylwester
Re: [PATCH v2 8/9] Documentation: devicetree: Document sclk-jpeg clock for exynos3250 SoC
Quoted 23 lines · On Tuesday 22 July 2014 16:18:25 Sylwester Nawrocki wrote:
All right, then I would rephrase it to:
- clock-names : should contain:
- "jpeg" for the common gate clock,
- "sclk" for the special clock (only for Exynos3250).
- clocks : should contain the clock specifier and clock ID list
matching entries in the clock-names property, according to the common clock bindings.I went through documentation of these clocks in various SoCs' datasheets:
exynos4210, exynos4212/4412, exynos3250, exynos5250 and I think for all SoCs the "jpeg" clock can be referred as "gating all clocks for the IP". That means there is a single bit in a CMU register masking all the clocks for the IP, I suppose this includes the control bus (APB) clock and the IP functional ("special") clock.It looks like e.g. exynos4412 also has the SCLK clock, after muxes and a divider, so rate can be configured for this clock. However there is no separate gate for SCLK as in case of exynos3250. Thus there is no need to to enable/disable the second clock on anything except exynos3250 currently.
Quoted 8 lines
I think ideally sclk should also be defined for SoCs like exynos4x12, exynos5250, even if now drivers are not touching sclk. All in all the IP functional clock frequency should be normally set to some known value, now we rely on the default divider value which results in divider ratio = 1.
It would break backward compatibility though if we now made sclk mandatory. I'm inclined to also specify sclk for exynos4x12, just not sure if it should be optional or mandatory.
I'd vote for listing it as an optional clock independent of the compatible string and changing the driver to just use it when it's provided.
Arnd
Re: [PATCH v2 8/9] Documentation: devicetree: Document sclk-jpeg clock for exynos3250 SoC
Quoted 2 lines · Arnd Bergmann
I'd vote for listing it as an optional clock independent of the compatible string and changing the driver to just use it when it's provided.
That sounds good to me, thanks for the suggestion.
Signature · 2 lines
Regards, Sylwester