Re: [PATCH v2 2/2] [media] s5p-jpeg: Adding Exynos7 JPEG variant
Hi Tony, On 12/19/2014 08:38 AM, Tony K Nadackal wrote: Fimp_jpeg used in Exynos7 is a revised version. Some register configurations are slightly different from JPEG in Exynos4. Added one more variant SJPEG_EXYNOS7 to handle these differences. Signed-off-by: Tony K Nadackal tony...@samsung.com --- .../bindings/media/exynos-jpeg-codec.txt | 2 +- drivers/media/platform/s5p-jpeg/jpeg-core.c| 61 ++ drivers/media/platform/s5p-jpeg/jpeg-core.h| 10 ++-- drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c | 32 ++-- drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.h | 8 +-- drivers/media/platform/s5p-jpeg/jpeg-regs.h| 17 -- 6 files changed, 93 insertions(+), 37 deletions(-) diff --git a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt index bf52ed4..cd19417 100644 --- a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt +++ b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt @@ -4,7 +4,7 @@ Required properties: - compatible : should be one of: samsung,s5pv210-jpeg, samsung,exynos4210-jpeg, - samsung,exynos3250-jpeg; + samsung,exynos3250-jpeg, samsung,exynos7-jpeg; - reg : address and length of the JPEG codec IP register set; - interrupts : specifies the JPEG codec IP interrupt; - clock-names : should contain: This should be put in a separate patch. diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index 54fa5d9..204013e 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c @@ -1225,8 +1225,9 @@ static int s5p_jpeg_try_fmt_vid_cap(struct file *file, void *priv, return -EINVAL; } - if ((ctx-jpeg-variant-version != SJPEG_EXYNOS4) || - (ctx-mode != S5P_JPEG_DECODE)) + if (((ctx-jpeg-variant-version != SJPEG_EXYNOS4) + (ctx-jpeg-variant-version != SJPEG_EXYNOS7)) || + (ctx-mode != S5P_JPEG_DECODE)) goto exit; /* @@ -1349,7 +1350,8 @@ static int s5p_jpeg_s_fmt(struct s5p_jpeg_ctx *ct, struct v4l2_format *f) * the JPEG_IMAGE_SIZE register. In order to avoid sysmmu * page fault calculate proper buffer size in such a case. */ - if (ct-jpeg-variant-version == SJPEG_EXYNOS4 + if (((ct-jpeg-variant-version == SJPEG_EXYNOS4) || + (ct-jpeg-variant-version == SJPEG_EXYNOS7)) f_type == FMT_TYPE_OUTPUT ct-mode == S5P_JPEG_ENCODE) q_data-size = exynos4_jpeg_get_output_buffer_size(ct, f, @@ -1901,7 +1903,8 @@ static void exynos4_jpeg_device_run(void *priv) if (ctx-mode == S5P_JPEG_ENCODE) { exynos4_jpeg_sw_reset(jpeg-regs); - exynos4_jpeg_set_interrupt(jpeg-regs); + exynos4_jpeg_set_interrupt(jpeg-regs, + ctx-jpeg-variant-version); exynos4_jpeg_set_huf_table_enable(jpeg-regs, 1); exynos4_jpeg_set_huff_tbl(jpeg-regs); @@ -1918,20 +1921,50 @@ static void exynos4_jpeg_device_run(void *priv) exynos4_jpeg_set_stream_size(jpeg-regs, ctx-cap_q.w, ctx-cap_q.h); - exynos4_jpeg_set_enc_out_fmt(jpeg-regs, ctx-subsampling); - exynos4_jpeg_set_img_fmt(jpeg-regs, ctx-out_q.fmt-fourcc); + exynos4_jpeg_set_enc_out_fmt(jpeg-regs, ctx-subsampling, + (ctx-jpeg-variant-version == SJPEG_EXYNOS4) ? + EXYNOS4_ENC_FMT_MASK : + EXYNOS7_ENC_FMT_MASK); + exynos4_jpeg_set_img_fmt(jpeg-regs, ctx-out_q.fmt-fourcc, + (ctx-jpeg-variant-version == SJPEG_EXYNOS4) ? + EXYNOS4_SWAP_CHROMA_SHIFT : + EXYNOS7_SWAP_CHROMA_SHIFT); exynos4_jpeg_set_img_addr(ctx); exynos4_jpeg_set_jpeg_addr(ctx); exynos4_jpeg_set_encode_hoff_cnt(jpeg-regs, ctx-out_q.fmt-fourcc); } else { exynos4_jpeg_sw_reset(jpeg-regs); - exynos4_jpeg_set_interrupt(jpeg-regs); + exynos4_jpeg_set_interrupt(jpeg-regs, + ctx-jpeg-variant-version); exynos4_jpeg_set_img_addr(ctx); exynos4_jpeg_set_jpeg_addr(ctx); - exynos4_jpeg_set_img_fmt(jpeg-regs, ctx-cap_q.fmt-fourcc); - bitstream_size = DIV_ROUND_UP(ctx-out_q.size, 32); +
RE: [PATCH v2 2/2] [media] s5p-jpeg: Adding Exynos7 JPEG variant
Hi Jacek, On Wednesday, January 07, 2015 3:43 PM : Jacek Anaszewski wrote, Hi Tony, On 12/19/2014 08:38 AM, Tony K Nadackal wrote: Fimp_jpeg used in Exynos7 is a revised version. Some register configurations are slightly different from JPEG in Exynos4. Added one more variant SJPEG_EXYNOS7 to handle these differences. Signed-off-by: Tony K Nadackal tony...@samsung.com --- .../bindings/media/exynos-jpeg-codec.txt | 2 +- drivers/media/platform/s5p-jpeg/jpeg-core.c| 61 ++- --- drivers/media/platform/s5p-jpeg/jpeg-core.h| 10 ++-- drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c | 32 ++-- drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.h | 8 +-- drivers/media/platform/s5p-jpeg/jpeg-regs.h| 17 -- 6 files changed, 93 insertions(+), 37 deletions(-) diff --git a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt index bf52ed4..cd19417 100644 --- a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt +++ b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt @@ -4,7 +4,7 @@ Required properties: - compatible : should be one of: samsung,s5pv210-jpeg, samsung,exynos4210-jpeg, - samsung,exynos3250-jpeg; + samsung,exynos3250-jpeg, samsung,exynos7-jpeg; - reg : address and length of the JPEG codec IP register set; - interrupts : specifies the JPEG codec IP interrupt; - clock-names : should contain: This should be put in a separate patch. Checkpatch gives warning if this change is not there. If that is ok with you, I will make this change a separate patch. [snip] -- Best Regards, Jacek Anaszewski Thanks and Regards, Tony -- 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
Re: [PATCH v2 2/2] [media] s5p-jpeg: Adding Exynos7 JPEG variant
Hi Tony, On 01/07/2015 12:22 PM, Tony K Nadackal wrote: Hi Jacek, On Wednesday, January 07, 2015 3:43 PM : Jacek Anaszewski wrote, Hi Tony, On 12/19/2014 08:38 AM, Tony K Nadackal wrote: Fimp_jpeg used in Exynos7 is a revised version. Some register configurations are slightly different from JPEG in Exynos4. Added one more variant SJPEG_EXYNOS7 to handle these differences. Signed-off-by: Tony K Nadackal tony...@samsung.com --- .../bindings/media/exynos-jpeg-codec.txt | 2 +- drivers/media/platform/s5p-jpeg/jpeg-core.c| 61 ++- --- drivers/media/platform/s5p-jpeg/jpeg-core.h| 10 ++-- drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.c | 32 ++-- drivers/media/platform/s5p-jpeg/jpeg-hw-exynos4.h | 8 +-- drivers/media/platform/s5p-jpeg/jpeg-regs.h| 17 -- 6 files changed, 93 insertions(+), 37 deletions(-) diff --git a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt index bf52ed4..cd19417 100644 --- a/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt +++ b/Documentation/devicetree/bindings/media/exynos-jpeg-codec.txt @@ -4,7 +4,7 @@ Required properties: - compatible : should be one of: samsung,s5pv210-jpeg, samsung,exynos4210-jpeg, - samsung,exynos3250-jpeg; + samsung,exynos3250-jpeg, samsung,exynos7-jpeg; - reg: address and length of the JPEG codec IP register set; - interrupts : specifies the JPEG codec IP interrupt; - clock-names : should contain: This should be put in a separate patch. Checkpatch gives warning if this change is not there. If that is ok with you, I will make this change a separate patch. If the patch updating the DT documentation will go first, then checkpatch shouldn't raise a warning. -- Best Regards, Jacek Anaszewski -- 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