[PATCH v12 05/29] media: platform: Improve power on and power off flow

2020-08-14 Thread Xia Jiang
Call pm_runtime_get_sync() before starting a frame and then pm_runtime_put() after completing it. This can save power for the time between processing two frames. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 27

[PATCH v12 04/29] media: platform: Change the fixed device node number to unfixed value

2020-08-14 Thread Xia Jiang
The driver can be instantiated multiple times, e.g. for a decoder and an encoder. Moreover, other drivers could coexist on the same system. This makes the static video node number assignment pointless, so switch to automatic assignment instead. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang

[PATCH v12 09/29] media: platform: Add mechanism to handle jpeg hardware's locking up

2020-08-14 Thread Xia Jiang
There is a delayed work scheduled before starting the hardware and canceled in the interrupt handler. If the delayed work is executed, it resets the hardware and reports the failure to V4L2, so that the execution can continue from next frames. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang

[PATCH v12 02/29] media: platform: Improve queue set up flow for bug fixing

2020-08-14 Thread Xia Jiang
Add checking created buffer size follow in mtk_jpeg_queue_setup(). Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/platform/mtk-jpeg

[PATCH v12 08/29] media: platform: Improve the implementation of the system PM ops

2020-08-14 Thread Xia Jiang
Add v4l2_m2m_suspend() function call in mtk_jpeg_suspend() to make sure that the current frame is processed completely before suspend. Add v4l2_m2m_resume() function call in mtk_jpeg_resume() to unblock the driver from scheduling next frame. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang

[PATCH v12 00/29] Add support for mt2701 JPEG ENC support

2020-08-14 Thread Xia Jiang
): media: v4l2-mem2mem: add v4l2_m2m_suspend, v4l2_m2m_resume Xia Jiang (28): media: platform: Improve subscribe event flow for bug fixing media: platform: Improve queue set up flow for bug fixing media: platform: Improve getting and requesting irq flow for bug fixing media: platform

[PATCH v12 20/29] media: platform: Redefinition of mtk_jpeg_q_data structure

2020-08-14 Thread Xia Jiang
The standard v4l2_pix_format_mplane structure contains width/height/ sizeimage/bytesperline, so use v4l2_pix_format_mplane to replace them. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 101

[PATCH v12 22/29] media: platform: Refactor mtk_jpeg_set_default_params()

2020-08-14 Thread Xia Jiang
Call mtk_jpeg_try_fmt_mplane() to replace the original computation of sizeimage and bytesperline, because that mtk_jpeg_try_fmt_mplane() already did it. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 12

[PATCH v12 27/29] media: platform: Rename existing functions/defines/variables

2020-08-14 Thread Xia Jiang
Rename existing functions/defines/variables with a _dec prefix and without dec_ prefix to prepare for the addition of the jpeg encoder feature. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 172

[PATCH v12 16/29] media: platform: Delete vidioc_s_selection ioctl of jpeg dec

2020-08-14 Thread Xia Jiang
JPEG dec does't support setting a compose rectangle, so remove mtk_jpeg_dec_s_selection(). Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 22 --- 1 file changed, 22 deletions(-) diff --git a/dr

[PATCH v12 21/29] media: platform: Change the colorspace of jpeg to the fixed value

2020-08-14 Thread Xia Jiang
Jpeg doesn't support colorspace conversion, so it shouldn't accept any other colorspace in S_FMT. Change the colorspace of jpeg to the fixed value. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_cor

[PATCH v12 25/29] arm: dts: mt2701: Add jpeg enc device tree node

2020-08-14 Thread Xia Jiang
Add jpeg enc device tree node. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- arch/arm/boot/dts/mt2701.dtsi | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi index 8d43a502aada

[PATCH v12 23/29] media: platform: Change the call functions of getting/enable/disable the jpeg's clock

2020-08-14 Thread Xia Jiang
Use the generic clk_bulk_* helpers to enable and disable clocks. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 28 +-- .../media/platform/mtk-jpeg/mtk_jpeg_core.h | 8 +++--- 2 files changed, 23

[PATCH v12 19/29] media: platform: Refactor mtk_jpeg_find_format()

2020-08-14 Thread Xia Jiang
MTK_JPEG_FMT_FLAG_DEC_CAPTURE are enough. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 64 ++- .../media/platform/mtk-jpeg/mtk_jpeg_core.h | 3 - 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/drivers/media

[PATCH v12 12/29] media: platform: Stylistic changes for improving code quality

2020-08-14 Thread Xia Jiang
Change register offset hex numerals from uppercase to lowercase. Change data type of max/min width/height from integer to unsigned integer. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.h| 8 drivers/media

[PATCH v12 11/29] media: platform: Delete zeroing the reserved fields

2020-08-14 Thread Xia Jiang
Delete zeroing the reserved fields because that the core already does it. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/media/platform/mtk-jpeg

[PATCH v12 10/29] media: platform: Cancel the last frame handling flow

2020-08-14 Thread Xia Jiang
There is no need to queue an empty buffer for signaling a last frame, because all frames are separate from each other in JPEG. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 46 +-- 1 file changed, 2

[PATCH v12 15/29] media: platform: Delete redundant code and add annotation for an enum

2020-08-14 Thread Xia Jiang
Delete unused member variables annotation. Delete unused variable definition. Delete redundant log print, because V4L2 debug logs already print it. Add annotation for enum mtk_jpeg_ctx_state. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- drivers/media/platform/mtk

[PATCH v12 29/29] media: platform: Add jpeg enc feature

2020-08-14 Thread Xia Jiang
Add mtk jpeg encode v4l2 driver based on jpeg decode, because that jpeg decode and encode have great similarities with function operation. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: fix the compile warnings --- drivers/media/platform/mtk-jpeg/Makefile | 5 +- .../media

[PATCH v12 24/29] media: dt-bindings: Add jpeg enc device tree node document

2020-08-14 Thread Xia Jiang
Add jpeg enc device tree node document. Reviewed-by: Rob Herring Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- .../bindings/media/mediatek-jpeg-encoder.txt | 35 +++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree

[PATCH v12 26/29] media: platform: Rename jpeg dec file name

2020-08-14 Thread Xia Jiang
Rename the files which are for decode feature. This is preparing path since the jpeg enc patch will be added later. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- drivers/media/platform/mtk-jpeg/Makefile | 2 +- drivers/media/platform/mtk-jpeg

[PATCH v12 28/29] media: platform: Using the variant structure to contain the varability between dec and enc

2020-08-14 Thread Xia Jiang
Add varability which would be used between jpeg dec and enc to a match data structure, it will make the code linear. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 113 +++--- .../media/platform/mtk-jpeg

[PATCH v12 03/29] media: platform: Improve getting and requesting irq flow for bug fixing

2020-08-14 Thread Xia Jiang
Delete platform_get_resource operation for irq. Return actual value rather than EINVAL when fail to get and request irq. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 7 ++- 1 file changed, 2 insertions(+), 5

[PATCH v12 01/29] media: platform: Improve subscribe event flow for bug fixing

2020-08-14 Thread Xia Jiang
Let v4l2_ctrl_subscribe_event() do the job for other types except V4L2_EVENT_SOURCE_CHANGE. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v12 06/29] media: platform: Delete the resetting hardware flow in the system PM ops

2020-08-14 Thread Xia Jiang
Delete the resetting hardware flow in suspend and resume function because that resetting operation will be done in device_run(). Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 2 -- 1 file changed, 2 deletions

[PATCH v12 13/29] media: platform: Use generic rounding helpers

2020-08-14 Thread Xia Jiang
Use clamp() to replace mtk_jpeg_bound_align_image() and round() to replace mtk_jpeg_align(). Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 41 +-- drivers/media/platform/mtk-jpeg/mtk_jpeg_hw.c | 8

[PATCH v12 18/29] media: platform: Refactor mtk_jpeg_try_fmt_mplane()

2020-08-14 Thread Xia Jiang
Figa Signed-off-by: Xia Jiang --- v12: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 49 ++- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c index

[PATCH v12 17/29] media: platform: Change the maximum width and height supported by JPEG dec

2020-08-14 Thread Xia Jiang
The maximum width and height supported by JPEG dec is 65535, so change them from 8192 to 65535. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[PATCH v12 14/29] media: platform: Change MTK_JPEG_COMP_MAX macro definition location

2020-08-14 Thread Xia Jiang
Move MTK_JPEG_COMP_MAX definition to mtk_jpeg_core.h file, because it is used by mtk_jpeg_core.c file. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v12: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 2 ++ drivers/media/platform/mtk-jpeg/mtk_jpeg_reg.h | 1 - 2

[PATCH v12 00/29] Add support for mt2701 JPEG ENC support

2020-08-14 Thread Xia Jiang
): media: v4l2-mem2mem: add v4l2_m2m_suspend, v4l2_m2m_resume Xia Jiang (28): media: platform: Improve subscribe event flow for bug fixing media: platform: Improve queue set up flow for bug fixing media: platform: Improve getting and requesting irq flow for bug fixing media: platform

[PATCH v12 07/29] media: v4l2-mem2mem: add v4l2_m2m_suspend, v4l2_m2m_resume

2020-08-14 Thread Xia Jiang
From: Pi-Hsun Shih Add two functions that can be used to stop new jobs from being queued / continue running queued job. This can be used while a driver using m2m helper is going to suspend / wake up from resume, and can ensure that there's no job running in suspend process. BUG=b:143046833 TEST=

[PATCH v11 12/28] media: platform: Use generic rounding helpers

2020-08-03 Thread Xia Jiang
Use clamp() to replace mtk_jpeg_bound_align_image() and round() to replace mtk_jpeg_align(). Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 41 +-- drivers/media/platform/mtk-jpeg/mtk_jpeg_hw.c | 8

[PATCH v11 09/28] media: platform: Cancel the last frame handling flow

2020-08-03 Thread Xia Jiang
There is no need to queue an empty buffer for signaling a last frame, because all frames are separate from each other in JPEG. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 46 +-- 1 file changed, 2

[PATCH v11 13/28] media: platform: Change MTK_JPEG_COMP_MAX macro definition location

2020-08-03 Thread Xia Jiang
Move MTK_JPEG_COMP_MAX definition to mtk_jpeg_core.h file, because it is used by mtk_jpeg_core.c file. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 2 ++ drivers/media/platform/mtk-jpeg/mtk_jpeg_reg.h | 1 - 2

[PATCH v11 11/28] media: platform: Stylistic changes for improving code quality

2020-08-03 Thread Xia Jiang
Change register offset hex numerals from uppercase to lowercase. Change data type of max/min width/height from integer to unsigned integer. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.h| 8 drivers/media

[PATCH v11 00/28] Add support for mt2701 JPEG ENC support

2020-08-03 Thread Xia Jiang
Change compared to v10: -specify the names of the clocks in the driver of patch 22/28 Xia Jiang (28): media: platform: Improve subscribe event flow for bug fixing media: platform: Improve queue set up flow for bug

[PATCH v11 06/28] media: platform: Delete the resetting hardware flow in the system PM ops

2020-08-03 Thread Xia Jiang
Delete the resetting hardware flow in suspend and resume function because that resetting operation will be done in device_run(). Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 2 -- 1 file changed, 2 deletions

[PATCH v11 28/28] media: platform: Add jpeg enc feature

2020-08-03 Thread Xia Jiang
Add mtk jpeg encode v4l2 driver based on jpeg decode, because that jpeg decode and encode have great similarities with function operation. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- drivers/media/platform/mtk-jpeg/Makefile | 5 +- .../media/platform/mtk

[PATCH v11 27/28] media: platform: Using the variant structure to contain the varability between dec and enc

2020-08-03 Thread Xia Jiang
Add varability which would be used between jpeg dec and enc to a match data structure, it will make the code linear. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 113 +++--- .../media/platform/mtk-jpeg

[PATCH v11 19/28] media: platform: Redefinition of mtk_jpeg_q_data structure

2020-08-03 Thread Xia Jiang
The standard v4l2_pix_format_mplane structure contains width/height/ sizeimage/bytesperline, so use v4l2_pix_format_mplane to replace them. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 101

[PATCH v11 26/28] media: platform: Rename existing functions/defines/variables

2020-08-03 Thread Xia Jiang
Rename existing functions/defines/variables with a _dec prefix and without dec_ prefix to prepare for the addition of the jpeg encoder feature. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 172

[PATCH v11 15/28] media: platform: Delete vidioc_s_selection ioctl of jpeg dec

2020-08-03 Thread Xia Jiang
JPEG dec does't support setting a compose rectangle, so remove mtk_jpeg_dec_s_selection(). Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 22 --- 1 file changed, 22 deletions(-) diff --git a/dr

[PATCH v11 20/28] media: platform: Change the colorspace of jpeg to the fixed value

2020-08-03 Thread Xia Jiang
Jpeg doesn't support colorspace conversion, so it shouldn't accept any other colorspace in S_FMT. Change the colorspace of jpeg to the fixed value. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_cor

[PATCH v11 21/28] media: platform: Refactor mtk_jpeg_set_default_params()

2020-08-03 Thread Xia Jiang
Call mtk_jpeg_try_fmt_mplane() to replace the original computation of sizeimage and bytesperline, because that mtk_jpeg_try_fmt_mplane() already did it. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 12

[PATCH v11 16/28] media: platform: Change the maximum width and height supported by JPEG dec

2020-08-03 Thread Xia Jiang
The maximum width and height supported by JPEG dec is 65535, so change them from 8192 to 65535. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[PATCH v11 17/28] media: platform: Refactor mtk_jpeg_try_fmt_mplane()

2020-08-03 Thread Xia Jiang
Figa Signed-off-by: Xia Jiang --- v11: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 49 ++- 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c index

[PATCH v11 08/28] media: platform: Add mechanism to handle jpeg hardware's locking up

2020-08-03 Thread Xia Jiang
There is a delayed work scheduled before starting the hardware and canceled in the interrupt handler. If the delayed work is executed, it resets the hardware and reports the failure to V4L2, so that the execution can continue from next frames. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang

[PATCH v11 24/28] arm: dts: mt2701: Add jpeg enc device tree node

2020-08-03 Thread Xia Jiang
Add jpeg enc device tree node. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- arch/arm/boot/dts/mt2701.dtsi | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi index 8d43a502aada

[PATCH v11 10/28] media: platform: Delete zeroing the reserved fields

2020-08-03 Thread Xia Jiang
Delete zeroing the reserved fields because that the core already does it. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/media/platform/mtk-jpeg

[PATCH v11 14/28] media: platform: Delete redundant code and add annotation for an enum

2020-08-03 Thread Xia Jiang
Delete unused member variables annotation. Delete unused variable definition. Delete redundant log print, because V4L2 debug logs already print it. Add annotation for enum mtk_jpeg_ctx_state. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- drivers/media/platform/mtk

[PATCH v11 25/28] media: platform: Rename jpeg dec file name

2020-08-03 Thread Xia Jiang
Rename the files which are for decode feature. This is preparing path since the jpeg enc patch will be added later. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- drivers/media/platform/mtk-jpeg/Makefile | 2 +- drivers/media/platform/mtk-jpeg

[PATCH v11 22/28] media: platform: Change the call functions of getting/enable/disable the jpeg's clock

2020-08-03 Thread Xia Jiang
Use the generic clk_bulk_* helpers to enable and disable clocks. Signed-off-by: Xia Jiang --- v11: specify the names of the clocks in the driver --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 28 +-- .../media/platform/mtk-jpeg/mtk_jpeg_core.h | 8 +++--- 2 files changed

[PATCH v11 18/28] media: platform: Refactor mtk_jpeg_find_format()

2020-08-03 Thread Xia Jiang
MTK_JPEG_FMT_FLAG_DEC_CAPTURE are enough. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 64 ++- .../media/platform/mtk-jpeg/mtk_jpeg_core.h | 3 - 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/drivers/media

[PATCH v11 23/28] media: dt-bindings: Add jpeg enc device tree node document

2020-08-03 Thread Xia Jiang
Add jpeg enc device tree node document. Reviewed-by: Rob Herring Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- .../bindings/media/mediatek-jpeg-encoder.txt | 35 +++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree

[PATCH v11 07/28] media: platform: Improve the implementation of the system PM ops

2020-08-03 Thread Xia Jiang
Add v4l2_m2m_suspend() function call in mtk_jpeg_suspend() to make sure that the current frame is processed completely before suspend. Add v4l2_m2m_resume() function call in mtk_jpeg_resume() to unblock the driver from scheduling next frame. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang

[PATCH v11 01/28] media: platform: Improve subscribe event flow for bug fixing

2020-08-03 Thread Xia Jiang
Let v4l2_ctrl_subscribe_event() do the job for other types except V4L2_EVENT_SOURCE_CHANGE. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v11 03/28] media: platform: Improve getting and requesting irq flow for bug fixing

2020-08-03 Thread Xia Jiang
Delete platform_get_resource operation for irq. Return actual value rather than EINVAL when fail to get and request irq. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 7 ++- 1 file changed, 2 insertions(+), 5

[PATCH v11 02/28] media: platform: Improve queue set up flow for bug fixing

2020-08-03 Thread Xia Jiang
Add checking created buffer size follow in mtk_jpeg_queue_setup(). Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/platform/mtk-jpeg

[PATCH v11 04/28] media: platform: Change the fixed device node number to unfixed value

2020-08-03 Thread Xia Jiang
The driver can be instantiated multiple times, e.g. for a decoder and an encoder. Moreover, other drivers could coexist on the same system. This makes the static video node number assignment pointless, so switch to automatic assignment instead. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang

[PATCH v11 05/28] media: platform: Improve power on and power off flow

2020-08-03 Thread Xia Jiang
Call pm_runtime_get_sync() before starting a frame and then pm_runtime_put() after completing it. This can save power for the time between processing two frames. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v11: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 27

Re: [PATCH v10 22/28] media: platform: Change the call functions of getting/enable/disable the jpeg's clock

2020-07-30 Thread Xia Jiang
On Thu, 2020-07-30 at 16:34 +, Tomasz Figa wrote: > Hi Xia, > > On Thu, Jul 23, 2020 at 11:04:45AM +0800, Xia Jiang wrote: > > Use the generic of_property_* helpers to get the clock_nums and clocks > > from device tree. > > Use the generic clk_bulk_* helpers t

Re: [PATCH RESEND v9 18/18] media: platform: Add jpeg enc feature

2020-07-24 Thread Xia Jiang
On Thu, 2020-06-11 at 18:46 +, Tomasz Figa wrote: > Hi Xia, > > On Thu, Jun 04, 2020 at 05:05:53PM +0800, Xia Jiang wrote: > > Add mtk jpeg encode v4l2 driver based on jpeg decode, because that jpeg > > decode and encode have great similarities with function operation. &

Re: [PATCH RESEND v9 18/18] media: platform: Add jpeg enc feature

2020-07-24 Thread Xia Jiang
On Mon, 2020-06-08 at 12:54 +0200, Hans Verkuil wrote: > On 04/06/2020 11:05, Xia Jiang wrote: > > Add mtk jpeg encode v4l2 driver based on jpeg decode, because that jpeg > > decode and encode have great similarities with function operation. > > > > Signed-off-by: Xia

Re: [PATCH RESEND v9 18/18] media: platform: Add jpeg enc feature

2020-07-24 Thread Xia Jiang
On Mon, 2020-06-08 at 07:36 +0800, Chun-Kuang Hu wrote: > Hi, Xia: > > Xia Jiang 於 2020年6月4日 週四 下午5:21寫道: > > > > Add mtk jpeg encode v4l2 driver based on jpeg decode, because that jpeg > > decode and encode have great similarities with function operation. >

[PATCH v10 00/28] Add support for mt2701 JPEG ENC support

2020-07-22 Thread Xia Jiang
r for jpeg dec - add the mechanism to ensure that the buffer is enough to hold the EXIF data in .buf_prepare callback Xia Jiang (28): media: platform: Improve subscribe event flow for bug fixing media: platform: Improve queue set up flow for bug fixing media: platform: Improve getting and

[PATCH v10 03/28] media: platform: Improve getting and requesting irq flow for bug fixing

2020-07-22 Thread Xia Jiang
Delete platform_get_resource operation for irq. Return actual value rather than EINVAL when fail to get and request irq. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v10: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 7 ++- 1 file changed, 2 insertions(+), 5

[PATCH v10 13/28] media: platform: Change MTK_JPEG_COMP_MAX macro definition location

2020-07-22 Thread Xia Jiang
Move MTK_JPEG_COMP_MAX definition to mtk_jpeg_core.h file, because it is used by mtk_jpeg_core.c file. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v10: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 2 ++ drivers/media/platform/mtk-jpeg/mtk_jpeg_reg.h | 1 - 2

[PATCH v10 11/28] media: platform: Stylistic changes for improving code quality

2020-07-22 Thread Xia Jiang
Change register offset hex numerals from uppercase to lowercase. Change data type of max/min width/height from integer to unsigned integer. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v10: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.h| 8 drivers/media

[PATCH v10 05/28] media: platform: Improve power on and power off flow

2020-07-22 Thread Xia Jiang
Call pm_runtime_get_sync() before starting a frame and then pm_runtime_put() after completing it. This can save power for the time between processing two frames. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v10: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 27

[PATCH v10 15/28] media: platform: Delete vidioc_s_selection ioctl of jpeg dec

2020-07-22 Thread Xia Jiang
JPEG dec does't support setting a compose rectangle, so remove mtk_jpeg_dec_s_selection(). Signed-off-by: Xia Jiang --- v10: new add patch --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 22 --- 1 file changed, 22 deletions(-) diff --git a/drivers/media/platform/mtk

[PATCH v10 20/28] media: platform: Change the colorspace of jpeg to the fixed value

2020-07-22 Thread Xia Jiang
Jpeg doesn't support colorspace conversion, so it shouldn't accept any other colorspace in S_FMT. Change the colorspace of jpeg to the fixed value. Signed-off-by: Xia Jiang --- v10: new add patch --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 24 +-- 1 file c

[PATCH v10 04/28] media: platform: Change the fixed device node number to unfixed value

2020-07-22 Thread Xia Jiang
The driver can be instantiated multiple times, e.g. for a decoder and an encoder. Moreover, other drivers could coexist on the same system. This makes the static video node number assignment pointless, so switch to automatic assignment instead. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang

[PATCH v10 12/28] media: platform: Use generic rounding helpers

2020-07-22 Thread Xia Jiang
Use clamp() to replace mtk_jpeg_bound_align_image() and round() to replace mtk_jpeg_align(). Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v10: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 41 +-- drivers/media/platform/mtk-jpeg/mtk_jpeg_hw.c | 8

[PATCH v10 14/28] media: platform: Delete redundant code and add annotation for an enum

2020-07-22 Thread Xia Jiang
Delete unused member variables annotation. Delete unused variable definition. Delete redundant log print, because V4L2 debug logs already print it. Add annotation for enum mtk_jpeg_ctx_state. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v10: no changes --- drivers/media/platform/mtk

[PATCH v10 23/28] media: dt-bindings: Add jpeg enc device tree node document

2020-07-22 Thread Xia Jiang
Add jpeg enc device tree node document. Reviewed-by: Rob Herring Signed-off-by: Xia Jiang --- v10: no changes --- .../bindings/media/mediatek-jpeg-encoder.txt | 35 +++ 1 file changed, 35 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/mediatek-jpeg

[PATCH v10 10/28] media: platform: Delete zeroing the reserved fields

2020-07-22 Thread Xia Jiang
Delete zeroing the reserved fields because that the core already does it. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v10: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 5 - 1 file changed, 5 deletions(-) diff --git a/drivers/media/platform/mtk-jpeg

[PATCH v10 21/28] media: platform: Refactor mtk_jpeg_set_default_params()

2020-07-22 Thread Xia Jiang
Call mtk_jpeg_try_fmt_mplane() to replace the original computation of sizeimage and bytesperline, because that mtk_jpeg_try_fmt_mplane() already did it. Signed-off-by: Xia Jiang --- v10: new add patch --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 12 ++-- 1 file changed, 2

[PATCH v10 27/28] media: platform: Using the variant structure to contain the varability between dec and enc

2020-07-22 Thread Xia Jiang
Add varability which would be used between jpeg dec and enc to a match data structure, it will make the code linear. Signed-off-by: Xia Jiang --- v10: new add patch --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 100 +++--- .../media/platform/mtk-jpeg/mtk_jpeg_core.h | 28

[PATCH v10 28/28] media: platform: Add jpeg enc feature

2020-07-22 Thread Xia Jiang
Add mtk jpeg encode v4l2 driver based on jpeg decode, because that jpeg decode and encode have great similarities with function operation. Signed-off-by: Xia Jiang --- v10: cancel mtk_jpeg_enc_bs structure. refactor the setting hardware register functions in mtk_jpeg_enc_hw.c. remove

[PATCH v10 17/28] media: platform: Refactor mtk_jpeg_try_fmt_mplane()

2020-07-22 Thread Xia Jiang
The function of mtk_jpeg_adjust_fmt_mplane() equals mtk_jpeg_g_fmt_vid_mplane(), so use mtk_jpeg_g_fmt_vid_mplane() to replace it . Delete the unused ctx parameter. Using fourcc to distinguish between different formats is more generic, because that jpeg enc will also use it. Signed-off-by: Xia

[PATCH v10 19/28] media: platform: Redefinition of mtk_jpeg_q_data structure

2020-07-22 Thread Xia Jiang
The standard v4l2_pix_format_mplane structure contains width/height/ sizeimage/bytesperline, so use v4l2_pix_format_mplane to replace them. Signed-off-by: Xia Jiang --- v10: new add patch --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 101 ++ .../media/platform/mtk-jpeg

[PATCH v10 26/28] media: platform: Rename existing functions/defines/variables

2020-07-22 Thread Xia Jiang
Rename existing functions/defines/variables with a _dec prefix and without dec_ prefix to prepare for the addition of the jpeg encoder feature. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v10: no changes --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 172

[PATCH v10 25/28] media: platform: Rename jpeg dec file name

2020-07-22 Thread Xia Jiang
Rename the files which are for decode feature. This is preparing path since the jpeg enc patch will be added later. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v10: no changes --- drivers/media/platform/mtk-jpeg/Makefile | 2 +- drivers/media/platform/mtk-jpeg

[PATCH v10 22/28] media: platform: Change the call functions of getting/enable/disable the jpeg's clock

2020-07-22 Thread Xia Jiang
Use the generic of_property_* helpers to get the clock_nums and clocks from device tree. Use the generic clk_bulk_* helpers to enable and disable clocks. Signed-off-by: Xia Jiang --- v10: new add patch --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 47 +++ .../media

[PATCH v10 18/28] media: platform: Refactor mtk_jpeg_find_format()

2020-07-22 Thread Xia Jiang
MTK_JPEG_FMT_FLAG_DEC_CAPTURE are enough. Signed-off-by: Xia Jiang --- v10: new add patch --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 64 ++- .../media/platform/mtk-jpeg/mtk_jpeg_core.h | 3 - 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/drivers/media/platform/mtk-jpeg

[PATCH v10 24/28] arm: dts: mt2701: Add jpeg enc device tree node

2020-07-22 Thread Xia Jiang
Add jpeg enc device tree node. Signed-off-by: Xia Jiang --- v10: no changes --- arch/arm/boot/dts/mt2701.dtsi | 13 + 1 file changed, 13 insertions(+) diff --git a/arch/arm/boot/dts/mt2701.dtsi b/arch/arm/boot/dts/mt2701.dtsi index 8d43a502aada..1c1c2132234f 100644 --- a/arch/arm

[PATCH v10 02/28] media: platform: Improve queue set up flow for bug fixing

2020-07-22 Thread Xia Jiang
Add checking created buffer size follow in mtk_jpeg_queue_setup(). Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v10: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/media/platform/mtk-jpeg

[PATCH v10 06/28] media: platform: Delete the resetting hardware flow in the system PM ops

2020-07-22 Thread Xia Jiang
Delete the resetting hardware flow in suspend and resume function because that resetting operation will be done in device_run(). Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v10: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 2 -- 1 file changed, 2 deletions

[PATCH v10 16/28] media: platform: Change the maximum width and height supported by JPEG dec

2020-07-22 Thread Xia Jiang
The maximum width and height supported by JPEG dec is 65535, so change them from 8192 to 65535. Signed-off-by: Xia Jiang --- v10: new add patch --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/mtk

[PATCH v10 09/28] media: platform: Cancel the last frame handling flow

2020-07-22 Thread Xia Jiang
There is no need to queue an empty buffer for signaling a last frame, because all frames are separate from each other in JPEG. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v10: delete mtk_jpeg_qbuf() --- .../media/platform/mtk-jpeg/mtk_jpeg_core.c | 46 +-- 1 file

[PATCH v10 07/28] media: platform: Improve the implementation of the system PM ops

2020-07-22 Thread Xia Jiang
Add v4l2_m2m_suspend() function call in mtk_jpeg_suspend() to make sure that the current frame is processed completely before suspend. Add v4l2_m2m_resume() function call in mtk_jpeg_resume() to unblock the driver from scheduling next frame. Signed-off-by: Xia Jiang --- v10: use

[PATCH v10 08/28] media: platform: Add mechanism to handle jpeg hardware's locking up

2020-07-22 Thread Xia Jiang
There is a delayed work scheduled before starting the hardware and canceled in the interrupt handler. If the delayed work is executed, it resets the hardware and reports the failure to V4L2, so that the execution can continue from next frames. Signed-off-by: Xia Jiang --- v10: new add patch

[PATCH v10 01/28] media: platform: Improve subscribe event flow for bug fixing

2020-07-22 Thread Xia Jiang
Let v4l2_ctrl_subscribe_event() do the job for other types except V4L2_EVENT_SOURCE_CHANGE. Reviewed-by: Tomasz Figa Signed-off-by: Xia Jiang --- v10: no changes --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers

Re: [PATCH RESEND v9 18/18] media: platform: Add jpeg enc feature

2020-07-08 Thread Xia Jiang
On Tue, 2020-07-07 at 15:35 +0200, Tomasz Figa wrote: > On Tue, Jul 7, 2020 at 8:47 AM Xia Jiang wrote: > > > > On Tue, 2020-06-30 at 16:53 +, Tomasz Figa wrote: > > > Hi Xia, > > > > > > On Tue, Jun 30, 2020 at 10:56:21AM +0800, Xia Jiang wrote:

Re: [PATCH RESEND v9 18/18] media: platform: Add jpeg enc feature

2020-07-06 Thread Xia Jiang
On Tue, 2020-06-30 at 16:53 +, Tomasz Figa wrote: > Hi Xia, > > On Tue, Jun 30, 2020 at 10:56:21AM +0800, Xia Jiang wrote: > > On Thu, 2020-06-11 at 18:46 +, Tomasz Figa wrote: > > > Hi Xia, > > > > > > On Thu, Jun 04, 2020 at 05:05:53PM +0800,

Re: [PATCH RESEND v9 18/18] media: platform: Add jpeg enc feature

2020-07-01 Thread Xia Jiang
On Tue, 2020-06-30 at 16:53 +, Tomasz Figa wrote: > Hi Xia, > > On Tue, Jun 30, 2020 at 10:56:21AM +0800, Xia Jiang wrote: > > On Thu, 2020-06-11 at 18:46 +, Tomasz Figa wrote: > > > Hi Xia, > > > > > > On Thu, Jun 04, 2020 at 05:05:53PM +0800,

Re: [PATCH RESEND v9 18/18] media: platform: Add jpeg enc feature

2020-06-29 Thread Xia Jiang
On Thu, 2020-06-11 at 18:46 +, Tomasz Figa wrote: > Hi Xia, > > On Thu, Jun 04, 2020 at 05:05:53PM +0800, Xia Jiang wrote: > > Add mtk jpeg encode v4l2 driver based on jpeg decode, because that jpeg > > decode and encode have great similarities with function operation. &

Re: [PATCH v8 11/14] media: dt-bindings: Add jpeg enc device tree node document

2020-06-17 Thread Xia Jiang
On Thu, 2020-05-21 at 16:00 +, Tomasz Figa wrote: > Hi Xia, > > On Fri, Apr 03, 2020 at 05:40:30PM +0800, Xia Jiang wrote: > > Add jpeg enc device tree node document > > > > Reviewed-by: Rob Herring > > Signed-off-by: Xia Jiang > > --- > > v8: n

Re: [PATCH v8 14/14] media: platform: Add jpeg dec/enc feature

2020-06-05 Thread Xia Jiang
On Mon, 2020-05-11 at 11:04 +0200, Hans Verkuil wrote: > On 03/04/2020 11:40, Xia Jiang wrote: > > Add mtk jpeg encode v4l2 driver based on jpeg decode, because that jpeg > > decode and encode have great similarities with function operation. > > > > Signed-off-by: Xia

Re: [PATCH v8 08/14] media: platform: Change case for improving code quality

2020-06-05 Thread Xia Jiang
On Mon, 2020-05-11 at 10:37 +0200, Hans Verkuil wrote: > On 03/04/2020 11:40, Xia Jiang wrote: > > Change register offset hex numberals from upercase to lowercase. > > Typos: > > numberals -> numerals > > upercase -> uppercase Done. > > Regards, > &

  1   2   >