Add support for DELTA video decoder of STMicroelectronics STiH4xx SoC series
Subsystems (3)
v3 cover Add support for DELTA video decoder of STMicroelectronics STiH4xx SoC series
This patchset introduces a basic support for DELTA multi-format video decoder of STMicroelectronics STiH4xx SoC series.
DELTA hardware IP is controlled by a remote firmware loaded in a ST231 coprocessor. Communication with firmware is done within an IPC layer using rpmsg kernel framework and a shared memory for messages handling. This driver is compatible with firmware version 21.1-3. While a single firmware is loaded in ST231 coprocessor, it is composed of several firmwares, one per video format family.
This DELTA V4L2 driver is designed around files:
- delta-v4l2.c : handles V4L2 APIs using M2M framework and calls decoder ops
- delta-<codec>* : implements <codec> decoder calling its associated video firmware (for ex. MJPEG) using IPC layer
- delta-ipc.c : IPC layer which handles communication with firmware using rpmsg
This first basic support implements only MJPEG hardware acceleration but the driver structure is in place to support all the features of the DELTA video decoder hardware IP.
This driver depends on:
- ST remoteproc/rpmsg: patchset posted at https://lkml.org/lkml/2016/9/6/77
- ST DELTA firmware: its license is under review. When available, pull request will be done on linux-firmware.
===========
= history =
===========
version 3
- update after v2 review:
- fixed m2m_buf_done missing on start_streaming error case
- fixed q->dev missing in queue_init()
- removed unsupported s_selection
- refactored string namings in delta-debug.c
- fixed space before comment
- all commits have commit messages
- reword memory allocator helper commit
version 2
- update after v1 review:
- simplified tracing
- G_/S_SELECTION reworked to fit COMPOSE(CAPTURE)
- fixed m2m_buf_done missing on start_streaming error case
- fixed q->dev missing in queue_init()
- switch to kernel-4.9 rpmsg API
- DELTA support added in multi_v7_defconfig
- minor typo fixes & code cleanup
version 1:
- Initial submission
===================
= v4l2-compliance =
===================
Below is the v4l2-compliance report for the version 3 of the DELTA video
decoder driver. v4l2-compliance has been build from SHA1:600492351ddf40cc524aab73802153674d7d287b (libdvb5: Fix multiple definition of dvb_dev_remote_init linking error)
root@sti-4:~# v4l2-compliance -d /dev/video0 v4l2-compliance SHA : 600492351ddf40cc524aab73802153674d7d287b
Driver Info:
Driver name : st-delta Card type : st-delta-21.1-3 Bus info : platform:soc:delta0 Driver version: 4.9.0 Capabilities : 0x84208000 Video Memory-to-Memory Streaming Extended Pix Format Device Capabilities Device Caps : 0x04208000 Video Memory-to-Memory Streaming Extended Pix Format
Compliance test for device /dev/video0 (not using libv4l2):
Required ioctls:
test VIDIOC_QUERYCAP: OK
Allow for multiple opens:
test second video open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK
Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported) test VIDIOC_LOG_STATUS: OK (Not Supported)
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported) test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported) test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported) test VIDIOC_G/S_FREQUENCY: OK (Not Supported) test VIDIOC_ENUMAUDOUT: OK (Not Supported) test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported) test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported) test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported) test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported) test VIDIOC_G/S_EDID: OK (Not Supported)
Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported) test VIDIOC_QUERYCTRL: OK (Not Supported)
test VIDIOC_G/S_CTRL: OK (Not Supported)
test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported) test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported) test VIDIOC_G/S_JPEGCOMP: OK (Not Supported) Standard Controls: 0 Private Controls: 0
Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK
warn: sources/v4l-utils/utils/v4l2-compliance/v4l2-test-formats.cpp(717): TRY_FMT cannot handle an invalid pixelformat.
warn: sources/v4l-utils/utils/v4l2-compliance/v4l2-test-formats.cpp(718): This may or may not be a problem. For more information see:
warn: sources/v4l-utils/utils/v4l2-compliance/v4l2-test-formats.cpp(719): http://www.mail-archive.com/[email protected]/msg56550.html
test VIDIOC_TRY_FMT: OK
warn: sources/v4l-utils/utils/v4l2-compliance/v4l2-test-formats.cpp(977): S_FMT cannot handle an invalid pixelformat.
warn: sources/v4l-utils/utils/v4l2-compliance/v4l2-test-formats.cpp(978): This may or may not be a problem. For more information see:
warn: sources/v4l-utils/utils/v4l2-compliance/v4l2-test-formats.cpp(979): http://www.mail-archive.com/[email protected]/msg56550.html
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
fail: sources/v4l-utils/utils/v4l2-compliance/v4l2-test-formats.cpp(1457): doioctl(node, VIDIOC_S_SELECTION, &sel_compose) != EINVAL
fail: sources/v4l-utils/utils/v4l2-compliance/v4l2-test-formats.cpp(1501): testBasicCompose(node, V4L2_BUF_TYPE_VIDEO_CAPTURE) test Composing: FAIL
test Scaling: OK
Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported) test VIDIOC_G_ENC_INDEX: OK (Not Supported) test VIDIOC_(TRY_)DECODER_CMD: OK
Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK test VIDIOC_EXPBUF: OK
Test input 0:
Total: 43, Succeeded: 42, Failed: 1, Warnings: 6
Hugues Fruchet (10):
Documentation: DT: add bindings for ST DELTA
ARM: dts: STiH410: add DELTA dt node
ARM: multi_v7_defconfig: enable STMicroelectronics DELTA Support [media] MAINTAINERS: add st-delta driver
[media] st-delta: STiH4xx multi-format video decoder v4l2 driver [media] st-delta: add memory allocator helper functions [media] st-delta: rpmsg ipc support
[media] st-delta: EOS (End Of Stream) support
[media] st-delta: add mjpeg support
[media] st-delta: debug: trace stream/frame information & summary
.../devicetree/bindings/media/st,st-delta.txt | 17 + MAINTAINERS | 8 + arch/arm/boot/dts/stih410.dtsi | 10 + arch/arm/configs/multi_v7_defconfig | 1 + drivers/media/platform/Kconfig | 27 + drivers/media/platform/Makefile | 2 + drivers/media/platform/sti/delta/Makefile | 6 + drivers/media/platform/sti/delta/delta-cfg.h | 63 + drivers/media/platform/sti/delta/delta-debug.c | 72 + drivers/media/platform/sti/delta/delta-debug.h | 18 + drivers/media/platform/sti/delta/delta-ipc.c | 590 ++++++ drivers/media/platform/sti/delta/delta-ipc.h | 76 + drivers/media/platform/sti/delta/delta-mem.c | 51 + drivers/media/platform/sti/delta/delta-mem.h | 14 + drivers/media/platform/sti/delta/delta-mjpeg-dec.c | 454 +++++ drivers/media/platform/sti/delta/delta-mjpeg-fw.h | 221 +++ drivers/media/platform/sti/delta/delta-mjpeg-hdr.c | 150 ++ drivers/media/platform/sti/delta/delta-mjpeg.h | 35 + drivers/media/platform/sti/delta/delta-v4l2.c | 1973 ++++++++++++++++++++ drivers/media/platform/sti/delta/delta.h | 566 ++++++ 20 files changed, 4354 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/st,st-delta.txt create mode 100644 drivers/media/platform/sti/delta/Makefile create mode 100644 drivers/media/platform/sti/delta/delta-cfg.h create mode 100644 drivers/media/platform/sti/delta/delta-debug.c create mode 100644 drivers/media/platform/sti/delta/delta-debug.h create mode 100644 drivers/media/platform/sti/delta/delta-ipc.c create mode 100644 drivers/media/platform/sti/delta/delta-ipc.h create mode 100644 drivers/media/platform/sti/delta/delta-mem.c create mode 100644 drivers/media/platform/sti/delta/delta-mem.h create mode 100644 drivers/media/platform/sti/delta/delta-mjpeg-dec.c create mode 100644 drivers/media/platform/sti/delta/delta-mjpeg-fw.h create mode 100644 drivers/media/platform/sti/delta/delta-mjpeg-hdr.c create mode 100644 drivers/media/platform/sti/delta/delta-mjpeg.h create mode 100644 drivers/media/platform/sti/delta/delta-v4l2.c create mode 100644 drivers/media/platform/sti/delta/delta.h
Signature · 1 line
1.9.1
PATCH v3 1/10 Documentation: DT: add bindings for ST DELTA
This patch adds DT binding documentation for STMicroelectronics DELTA V4L2 video decoder.
--- Documentation/devicetree/bindings/media/st,st-delta.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/media/st,st-delta.txt
Documentation/devicetree/bindings/media/st,st-delta.txt new file +17 -0
@@ -0,0 +1,17 @@ +* STMicroelectronics DELTA multi-format video decoder + +Required properties: +- compatible: should be "st,st-delta". +- clocks: from common clock binding: handle hardware IP needed clocks, the + number of clocks may depend on the SoC type. + See ../clock/clock-bindings.txt for details. +- clock-names: names of the clocks listed in clocks property in the same order. + +Example: + delta0 { + compatible = "st,st-delta"; + clock-names = "delta", "delta-st231", "delta-flash-promip"; + clocks = <&clk_s_c0_flexgen CLK_VID_DMU>, + <&clk_s_c0_flexgen CLK_ST231_DMU>, + <&clk_s_c0_flexgen CLK_FLASH_PROMIP>; + };
Signature · 1 line
1.9.1
PATCH v3 2/10 ARM: dts: STiH410: add DELTA dt node
In reply to Hugues FruchetThis patch adds DT node for STMicroelectronics
DELTA V4L2 video decoder
--- arch/arm/boot/dts/stih410.dtsi | 10 ++++++++++ 1 file changed, 10 insertions(+)
arch/arm/boot/dts/stih410.dtsi +10 -0
@@ -259,5 +259,15 @@ clocks = <&clk_sysin>; interrupts = <GIC_SPI 205 IRQ_TYPE_EDGE_RISING>; }; + delta0 { + compatible = "st,st-delta"; + clock-names = "delta", + "delta-st231", + "delta-flash-promip"; + clocks = <&clk_s_c0_flexgen CLK_VID_DMU>, + <&clk_s_c0_flexgen CLK_ST231_DMU>, + <&clk_s_c0_flexgen CLK_FLASH_PROMIP>; + }; + }; };
Signature · 1 line
1.9.1
PATCH v3 3/10 ARM: multi_v7_defconfig: enable STMicroelectronics DELTA Support
In reply to Hugues FruchetEnables support of STMicroelectronics STiH4xx SoC series DELTA multi-format video decoder V4L2 driver.
--- arch/arm/configs/multi_v7_defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/configs/multi_v7_defconfig +1 -0
@@ -562,6 +562,7 @@ CONFIG_V4L_MEM2MEM_DRIVERS=y CONFIG_VIDEO_SAMSUNG_S5P_JPEG=m CONFIG_VIDEO_SAMSUNG_S5P_MFC=m CONFIG_VIDEO_STI_BDISP=m +CONFIG_VIDEO_STI_DELTA=m CONFIG_VIDEO_RENESAS_JPU=m CONFIG_VIDEO_RENESAS_VSP1=m CONFIG_V4L_TEST_DRIVERS=y
Signature · 1 line
1.9.1
PATCH v3 4/10 MAINTAINERS: add st-delta driver
In reply to Hugues FruchetAdd entry for the STMicroelectronics DELTA driver.
--- MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
@@ -2394,6 +2394,14 @@ W: https://linuxtv.org S: Supported F: drivers/media/platform/sti/bdisp +DELTA ST MEDIA DRIVER +M: Hugues Fruchet <[email protected]> +L: [email protected] +T: git git://linuxtv.org/media_tree.git +W: https://linuxtv.org +S: Supported +F: drivers/media/platform/sti/delta + BEFS FILE SYSTEM M: Luis de Bethencourt <[email protected]> M: Salah Triki <[email protected]>
Signature · 1 line
1.9.1
PATCH v3 6/10 st-delta: add memory allocator helper functions
In reply to Hugues FruchetHelper functions used by decoder back-ends to allocate physically contiguous memory required by hardware video decoder.
--- drivers/media/platform/sti/delta/Makefile | 2 +- drivers/media/platform/sti/delta/delta-mem.c | 51 ++++++++++++++++++++++++++++ drivers/media/platform/sti/delta/delta-mem.h | 14 ++++++++ drivers/media/platform/sti/delta/delta.h | 8 +++++ 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 drivers/media/platform/sti/delta/delta-mem.c create mode 100644 drivers/media/platform/sti/delta/delta-mem.h
drivers/media/platform/sti/delta/Makefile +1 -1
@@ -1,2 +1,2 @@ obj-$(CONFIG_VIDEO_STI_DELTA) := st-delta.o -st-delta-y := delta-v4l2.o +st-delta-y := delta-v4l2.o delta-mem.o
drivers/media/platform/sti/delta/delta-mem.c new file +51 -0
51 lines not on this page · raw message
drivers/media/platform/sti/delta/delta-mem.h new file +14 -0
@@ -0,0 +1,14 @@ +/* +* Copyright (C) STMicroelectronics SA 2015 +* Author: Hugues Fruchet <[email protected]> for STMicroelectronics. +* License terms: GNU General Public License (GPL), version 2 +*/ + +#ifndef DELTA_MEM_H +#define DELTA_MEM_H + +int hw_alloc (struct delta_ctx *ctx,u32 size,const char *name, +struct delta_buf *buf); +void hw_free (struct delta_ctx *ctx,struct delta_buf *buf); + +#endif /* DELTA_MEM_H */
drivers/media/platform/sti/delta/delta.h +8 -0
@@ -191,6 +191,14 @@ struct delta_dts {u64 val; }; +struct delta_buf { +u32 size; +void *vaddr; +dma_addr_t paddr; +const char *name; +unsigned long attrs; +}; +struct delta_ctx ;/*
Signature · 1 line
1.9.1
PATCH v3 5/10 st-delta: STiH4xx multi-format video decoder v4l2 driver
In reply to Hugues FruchetThis V4L2 driver enables DELTA multi-format video decoder of STMicroelectronics STiH4xx SoC series.
--- drivers/media/platform/Kconfig | 20 + drivers/media/platform/Makefile | 2 + drivers/media/platform/sti/delta/Makefile | 2 + drivers/media/platform/sti/delta/delta-cfg.h | 60 + drivers/media/platform/sti/delta/delta-v4l2.c | 1797 +++++++++++++++++++++++++ drivers/media/platform/sti/delta/delta.h | 514 +++++++ 6 files changed, 2395 insertions(+) create mode 100644 drivers/media/platform/sti/delta/Makefile create mode 100644 drivers/media/platform/sti/delta/delta-cfg.h create mode 100644 drivers/media/platform/sti/delta/delta-v4l2.c create mode 100644 drivers/media/platform/sti/delta/delta.h
drivers/media/platform/Kconfig +20 -0
@@ -298,6 +298,26 @@ config VIDEO_STI_HVA To compile this driver as a module, choose M here: the module will be called st-hva. +config VIDEO_STI_DELTA + tristate "STMicroelectronics STiH4xx DELTA multi-format video decoder V4L2 driver" + depends on VIDEO_DEV && VIDEO_V4L2 + depends on ARCH_STI || COMPILE_TEST + depends on HAS_DMA + select VIDEOBUF2_DMA_CONTIG + select V4L2_MEM2MEM_DEV + help + This V4L2 driver enables DELTA multi-format video decoder + of STMicroelectronics STiH4xx SoC series allowing hardware + decoding of various compressed video bitstream format in + raw uncompressed format. + + To compile this driver as a module, choose M here: + the module will be called st-delta. + +if VIDEO_STI_DELTA + +endif # VIDEO_STI_DELTA + config VIDEO_SH_VEU tristate "SuperH VEU mem2mem video processing driver" depends on VIDEO_DEV && VIDEO_V4L2 && HAS_DMA
drivers/media/platform/Makefile +2 -0
@@ -39,6 +39,8 @@ obj-$(CONFIG_VIDEO_STI_BDISP) += sti/bdisp/ obj-$(CONFIG_VIDEO_STI_HVA) += sti/hva/ obj-$(CONFIG_DVB_C8SECTPFE) += sti/c8sectpfe/ +obj-$(CONFIG_VIDEO_STI_DELTA) += sti/delta/ + obj-$(CONFIG_BLACKFIN) += blackfin/ obj-$(CONFIG_ARCH_DAVINCI) += davinci/
drivers/media/platform/sti/delta/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +obj-$(CONFIG_VIDEO_STI_DELTA) := st-delta.o +st-delta-y := delta-v4l2.o
drivers/media/platform/sti/delta/delta-cfg.h new file +60 -0
60 lines not on this page · raw message
drivers/media/platform/sti/delta/delta-v4l2.c new file +1797 -0
1,797 lines not on this page · raw message
drivers/media/platform/sti/delta/delta.h new file +514 -0
514 lines not on this page · raw message
Signature · 1 line
1.9.1
PATCH v3 7/10 st-delta: rpmsg ipc support
In reply to Hugues FruchetIPC (Inter Process Communication) support for communication with DELTA coprocessor firmware using rpmsg kernel framework.
Based on 4 services open/set_stream/decode/close and their associated rpmsg messages.
The messages structures are duplicated on both host and firmware side and are packed (use only of 32 bits size fields in messages structures to ensure packing).
Each service is synchronous; service returns only when firmware acknowledges the associated command message.
Due to significant parameters size exchanged from host to copro, parameters are not inserted in rpmsg messages. Instead, parameters are stored in physical memory shared between host and coprocessor. Memory is non-cacheable, so no special operation is required to ensure memory coherency on host and on coprocessor side. Multi-instance support and re-entrance are ensured using host_hdl and copro_hdl in message header exchanged between both host and coprocessor. This avoids to manage tables on both sides to get back the running context of each instance.
--- drivers/media/platform/Kconfig | 1 + drivers/media/platform/sti/delta/Makefile | 2 +- drivers/media/platform/sti/delta/delta-ipc.c | 590 ++++++++++++++++++++++++++ drivers/media/platform/sti/delta/delta-ipc.h | 76 ++++ drivers/media/platform/sti/delta/delta-v4l2.c | 11 + drivers/media/platform/sti/delta/delta.h | 21 + 6 files changed, 700 insertions(+), 1 deletion(-) create mode 100644 drivers/media/platform/sti/delta/delta-ipc.c create mode 100644 drivers/media/platform/sti/delta/delta-ipc.h
drivers/media/platform/Kconfig +1 -0
@@ -303,6 +303,7 @@ config VIDEO_STI_DELTA depends on VIDEO_DEV && VIDEO_V4L2 depends on ARCH_STI || COMPILE_TEST depends on HAS_DMA + depends on RPMSG select VIDEOBUF2_DMA_CONTIG select V4L2_MEM2MEM_DEV help
drivers/media/platform/sti/delta/Makefile +1 -1
@@ -1,2 +1,2 @@ obj-$(CONFIG_VIDEO_STI_DELTA) := st-delta.o -st-delta-y := delta-v4l2.o delta-mem.o +st-delta-y := delta-v4l2.o delta-mem.o delta-ipc.o
drivers/media/platform/sti/delta/delta-ipc.c new file +590 -0
590 lines not on this page · raw message
drivers/media/platform/sti/delta/delta-ipc.h new file +76 -0
76 lines not on this page · raw message
drivers/media/platform/sti/delta/delta-v4l2.c +11 -0
@@ -17,6 +17,7 @@#include <media/videobuf2-dma-contig.h> #include "delta.h" +#include "delta-ipc.h" #define DELTA_NAME "st-delta"
@@ -1687,6 +1688,14 @@ static int delta_probe(struct platform_device *pdev)pm_runtime_set_suspended (dev);pm_runtime_enable (dev); +/* init firmware ipc channel */ + ret =delta_ipc_init (delta); +if (ret) { +dev_err (delta->dev,"%s failed to initialize firmware ipc channel\n" , +DELTA_PREFIX ); + goto err; + } +/* register all available decoders */ register_decoders (delta);
@@ -1731,6 +1740,8 @@ static int delta_remove(struct platform_device *pdev) {struct delta_dev *delta =platform_get_drvdata (pdev); +delta_ipc_exit (delta); +delta_unregister_device (delta);destroy_workqueue (delta->work_queue);
drivers/media/platform/sti/delta/delta.h +21 -0
@@ -7,6 +7,7 @@#ifndef DELTA_H #define DELTA_H +#include <linux/rpmsg.h> #include <media/v4l2-device.h> #include <media/v4l2-mem2mem.h>
@@ -199,6 +200,19 @@ struct delta_buf {unsigned long attrs; }; +struct delta_ipc_ctx { +int cb_err; +u32 copro_hdl; +struct completion done; +struct delta_buf ipc_buf_struct; +struct delta_buf *ipc_buf; +}; + +struct delta_ipc_param { +u32 size; +void *data; +}; +struct delta_ctx ;/*
@@ -368,6 +382,7 @@ struct delta_dec {* @fh: V4L2 file handle * @dev: device context * @dec: selected decoder context for this instance +* @ipc_ctx: context of IPC communication with firmware * @state: instance state * @frame_num: frame number * @au_num: access unit number
@@ -399,6 +414,8 @@ struct delta_ctx {struct v4l2_fh fh;struct delta_dev *dev;const struct delta_dec *dec; +struct delta_ipc_ctx ipc_ctx; +enum delta_state state;u32 frame_num;u32 au_num;
@@ -447,6 +464,8 @@ struct delta_ctx {* @nb_of_streamformats:number of supported compressed video formats * @instance_id: rolling counter identifying an instance (debug purpose) * @work_queue: decoding job work queue +* @rpmsg_driver: rpmsg IPC driver +* @rpmsg_device: rpmsg IPC device */ struct delta_dev {struct v4l2_device v4l2_dev;
@@ -466,6 +485,8 @@ struct delta_dev {u32 nb_of_streamformats;u8 instance_id;struct workqueue_struct *work_queue; +struct rpmsg_driver rpmsg_driver; +struct rpmsg_device *rpmsg_device; };static inline char *frame_type_str (u32 flags)
Signature · 1 line
1.9.1
PATCH v3 8/10 st-delta: EOS (End Of Stream) support
In reply to Hugues FruchetEOS (End Of Stream) support allows user to get all the potential decoded frames remaining in decoder pipeline after having reached the end of video bitstream. To do so, user calls VIDIOC_DECODER_CMD(V4L2_DEC_CMD_STOP) which will drain the decoder and get the drained frames that are then returned to user.
User is informed of EOS completion in two ways:
- dequeue of an empty frame flagged to V4L2_BUF_FLAG_LAST
- reception of a V4L2_EVENT_EOS event.
If, unfortunately, no buffer is available on CAPTURE queue to return the empty frame, EOS is delayed till user queue one CAPTURE buffer.
--- drivers/media/platform/sti/delta/delta-v4l2.c | 143 +++++++++++++++++++++++++- drivers/media/platform/sti/delta/delta.h | 23 +++++ 2 files changed, 165 insertions(+), 1 deletion(-)
drivers/media/platform/sti/delta/delta-v4l2.c +142 -1
@@ -106,7 +106,8 @@ static void delta_frame_done(struct delta_ctx *ctx, struct delta_frame *frame, vbuf->sequence = ctx->frame_num++;v4l2_m2m_buf_done (vbuf, err ?VB2_BUF_STATE_ERROR :VB2_BUF_STATE_DONE ); - ctx->output_frames++; +if (frame->info.size)/* ignore EOS */ + ctx->output_frames++; }static void requeue_free_frames (struct delta_ctx *ctx)
@@ -756,6 +757,132 @@ static int delta_g_selection(struct file *file, void *fh,return 0 ; } +static void delta_complete_eos (struct delta_ctx *ctx, +struct delta_frame *frame) +{ +struct delta_dev *delta = ctx->dev; +const struct v4l2_event ev = {.type =V4L2_EVENT_EOS }; + +/* Send EOS to user: +* - by returning an empty frame flagged to V4L2_BUF_FLAG_LAST +* - and then send EOS event +*/ + +/* empty frame */ + frame->info.size =0 ; + +/* set the last buffer flag */ + frame->flags |=V4L2_BUF_FLAG_LAST ; + +/* release frame to user */ +delta_frame_done (ctx, frame,0 ); + +/* send EOS event */ +v4l2_event_queue_fh (&ctx->fh, &ev); + +dev_dbg (delta->dev,"%s EOS completed\n" , ctx->name); +} + +static int delta_try_decoder_cmd (struct file *file,void *fh, +struct v4l2_decoder_cmd *cmd) +{ +if (cmd->cmd !=V4L2_DEC_CMD_STOP ) +return -EINVAL ; + +if (cmd->flags &V4L2_DEC_CMD_STOP_TO_BLACK ) +return -EINVAL ; + +if (!(cmd->flags &V4L2_DEC_CMD_STOP_IMMEDIATELY ) && + (cmd->stop.pts !=0 )) +return -EINVAL ; + +return 0 ; +} + +static int delta_decoder_stop_cmd (struct delta_ctx *ctx,void *fh) +{ +const struct delta_dec *dec = ctx->dec; +struct delta_dev *delta = ctx->dev; +struct delta_frame *frame =NULL ; +int ret =0 ; + +dev_dbg (delta->dev,"%s EOS received\n" , ctx->name); + +if (ctx->state !=DELTA_STATE_READY ) +return 0 ; + +/* drain the decoder */ +call_dec_op (dec, drain, ctx); + +/* release to user drained frames */ +while (1 ) { + frame =NULL ; + ret =call_dec_op (dec, get_frame, ctx, &frame); +if (ret == -ENODATA ) { +/* no more decoded frames */ +break ; + } +if (frame) { +dev_dbg (delta->dev,"%s drain frame[%d]\n" , + ctx->name, frame->index); + +/* pop timestamp and mark frame with it */ +delta_pop_dts (ctx, &frame->dts); + +/* release decoded frame to user */ +delta_frame_done (ctx, frame,0 ); + } + } + +/* try to complete EOS */ + ret =delta_get_free_frame (ctx, &frame); +if (ret) + goto delay_eos; + +/* new frame available, EOS can now be completed */ +delta_complete_eos (ctx, frame); + + ctx->state =DELTA_STATE_EOS ; + +return 0 ; + +delay_eos: +/* EOS completion from driver is delayed because +* we don't have a free empty frame available. +* EOS completion is so delayed till next frame_queue() call +* to be sure to have a free empty frame available. +*/ + ctx->state =DELTA_STATE_WF_EOS ; +dev_dbg (delta->dev,"%s EOS delayed\n" , ctx->name); + +return 0 ; +} + +int delta_decoder_cmd (struct file *file,void *fh,struct v4l2_decoder_cmd *cmd) +{ +struct delta_ctx *ctx =to_ctx (fh); +int ret =0 ; + + ret =delta_try_decoder_cmd (file, fh, cmd); +if (ret) +return ret; + +return delta_decoder_stop_cmd (ctx, fh); +} + +static int delta_subscribe_event (struct v4l2_fh *fh, +const struct v4l2_event_subscription *sub) +{ +switch (sub->type) { +case V4L2_EVENT_EOS : +return v4l2_event_subscribe (fh, sub,2 ,NULL ); +default : +return -EINVAL ; + } + +return 0 ; +} +/* v4l2 ioctl ops */ static const struct v4l2_ioctl_ops delta_ioctl_ops = { .vidioc_querycap = delta_querycap,
@@ -776,6 +903,10 @@ static int delta_g_selection(struct file *file, void *fh, .vidioc_streamon = v4l2_m2m_ioctl_streamon, .vidioc_streamoff = v4l2_m2m_ioctl_streamoff, .vidioc_g_selection = delta_g_selection, + .vidioc_try_decoder_cmd = delta_try_decoder_cmd, + .vidioc_decoder_cmd = delta_decoder_cmd, + .vidioc_subscribe_event = delta_subscribe_event, + .vidioc_unsubscribe_event = v4l2_event_unsubscribe, };/*
@@ -1362,6 +1493,16 @@ static void delta_vb2_frame_queue(struct vb2_buffer *vb)struct vb2_v4l2_buffer *vbuf =to_vb2_v4l2_buffer (vb);struct delta_frame *frame =to_frame (vbuf); +if (ctx->state ==DELTA_STATE_WF_EOS ) { +/* new frame available, EOS can now be completed */ +delta_complete_eos (ctx, frame); + + ctx->state =DELTA_STATE_EOS ; + +/* return, no need to recycle this buffer to decoder */ +return ; + } +/* recycle this frame */ delta_recycle (ctx, frame); }
drivers/media/platform/sti/delta/delta.h +23 -0
@@ -27,11 +27,19 @@*@DELTA_STATE_READY: * Decoding instance is ready to decode compressed access unit. * +*@DELTA_STATE_WF_EOS: +* Decoding instance is waiting for EOS (End Of Stream) completion. +* +*@DELTA_STATE_EOS: +* EOS (End Of Stream) is completed (signaled to user). Decoding instance +* should then be closed. */ enum delta_state {DELTA_STATE_WF_FORMAT ,DELTA_STATE_WF_STREAMINFO ,DELTA_STATE_READY , +DELTA_STATE_WF_EOS , +DELTA_STATE_EOS };/*
@@ -237,6 +245,7 @@ struct delta_ipc_param {* @get_frame: get the next decoded frame available, see below * @recycle: recycle the given frame, see below * @flush: (optional) flush decoder, see below +* @drain: (optional) drain decoder, see below */ struct delta_dec {const char *name;
@@ -371,6 +380,18 @@ struct delta_dec {* decoding logic. */ void (*flush)(struct delta_ctx *ctx); + +/* +* drain() - drain decoder +* @ctx: (in) instance +* +* Optional. +* Mark decoder pending frames (decoded but not yet output) as ready +* so that they can be output to client at EOS (End Of Stream). +* get_frame() is to be called in a loop right after drain() to +* get all those pending frames. +*/ +void (*drain)(struct delta_ctx *ctx); };struct delta_dev ;
@@ -497,6 +518,8 @@ static inline char *frame_type_str(u32 flags)return "P" ;if (flags &V4L2_BUF_FLAG_BFRAME )return "B" ; +if (flags &V4L2_BUF_FLAG_LAST ) +return "EOS" ;return "?" ; }
Signature · 1 line
1.9.1
PATCH v3 9/10 st-delta: add mjpeg support
In reply to Hugues FruchetAdds support of DELTA MJPEG video decoder back-end, implemented by calling JPEG_DECODER_HW0 firmware using RPMSG IPC communication layer.
--- drivers/media/platform/Kconfig | 6 + drivers/media/platform/sti/delta/Makefile | 4 + drivers/media/platform/sti/delta/delta-cfg.h | 3 + drivers/media/platform/sti/delta/delta-mjpeg-dec.c | 454 +++++++++++++++++++++ drivers/media/platform/sti/delta/delta-mjpeg-fw.h | 221 ++++++++++ drivers/media/platform/sti/delta/delta-mjpeg-hdr.c | 150 +++++++ drivers/media/platform/sti/delta/delta-mjpeg.h | 35 ++ drivers/media/platform/sti/delta/delta-v4l2.c | 3 + 8 files changed, 876 insertions(+) create mode 100644 drivers/media/platform/sti/delta/delta-mjpeg-dec.c create mode 100644 drivers/media/platform/sti/delta/delta-mjpeg-fw.h create mode 100644 drivers/media/platform/sti/delta/delta-mjpeg-hdr.c create mode 100644 drivers/media/platform/sti/delta/delta-mjpeg.h
drivers/media/platform/Kconfig +6 -0
@@ -317,6 +317,12 @@ config VIDEO_STI_DELTA if VIDEO_STI_DELTA +config VIDEO_STI_DELTA_MJPEG + bool "STMicroelectronics DELTA MJPEG support" + default y + help + Enables DELTA MJPEG hardware support. + endif # VIDEO_STI_DELTA config VIDEO_SH_VEU
drivers/media/platform/sti/delta/Makefile +4 -0
@@ -1,2 +1,6 @@ obj-$(CONFIG_VIDEO_STI_DELTA) := st-delta.o st-delta-y := delta-v4l2.o delta-mem.o delta-ipc.o + +# MJPEG support +st-delta-$(CONFIG_VIDEO_STI_DELTA_MJPEG) += delta-mjpeg-hdr.o +st-delta-$(CONFIG_VIDEO_STI_DELTA_MJPEG) += delta-mjpeg-dec.o
drivers/media/platform/sti/delta/delta-cfg.h +3 -0
@@ -56,5 +56,8 @@#define DELTA_HW_AUTOSUSPEND_DELAY_MS 5#define DELTA_MAX_DECODERS 10 +#ifdef CONFIG_VIDEO_STI_DELTA_MJPEG +extern const struct delta_dec mjpegdec; +#endif #endif /* DELTA_CFG_H */
drivers/media/platform/sti/delta/delta-mjpeg-dec.c new file +454 -0
454 lines not on this page · raw message
drivers/media/platform/sti/delta/delta-mjpeg-fw.h new file +221 -0
221 lines not on this page · raw message
drivers/media/platform/sti/delta/delta-mjpeg-hdr.c new file +150 -0
150 lines not on this page · raw message
drivers/media/platform/sti/delta/delta-mjpeg.h new file +35 -0
@@ -0,0 +1,35 @@ +/* +* Copyright (C) STMicroelectronics SA 2013 +* Author: Hugues Fruchet <[email protected]> for STMicroelectronics. +* License terms: GNU General Public License (GPL), version 2 +*/ + +#ifndef DELTA_MJPEG_H +#define DELTA_MJPEG_H + +#include "delta.h" + +struct mjpeg_component { +unsigned int id;/* 1=Y, 2=Cb, 3=Cr, 4=L, 5=Q */ +unsigned int h_sampling_factor; +unsigned int v_sampling_factor; +unsigned int quant_table_index; +}; + +#define MJPEG_MAX_COMPONENTS 5 + +struct mjpeg_header { +unsigned int length; +unsigned int sample_precision; +unsigned int frame_width; +unsigned int frame_height; +unsigned int nb_of_components; +struct mjpeg_component components[MJPEG_MAX_COMPONENTS ]; +}; + +int delta_mjpeg_read_header (struct delta_ctx *pctx, +unsigned char *data,unsigned int size, +struct mjpeg_header *header, +unsigned int *data_offset); + +#endif /* DELTA_MJPEG_H */
drivers/media/platform/sti/delta/delta-v4l2.c +3 -0
@@ -32,6 +32,9 @@/* registry of available decoders */ static const struct delta_dec *delta_decoders[] = { +#ifdef CONFIG_VIDEO_STI_DELTA_MJPEG + &mjpegdec, +#endif };static inline int frame_size (u32 w,u32 h,u32 fmt)
Signature · 1 line
1.9.1
PATCH v3 10/10 st-delta: debug: trace stream/frame information & summary
In reply to Hugues FruchetAdds some trace points showing input compressed stream or output decoded frame information.
Adds an unconditional trace point when streaming starts showing the compressed stream and the decoded frame information. Adds an unconditional trace point at instance closure summarizing into a single line the decoding process (stream information, decoded and output frames number, potential errors observed).
--- drivers/media/platform/sti/delta/Makefile | 2 +- drivers/media/platform/sti/delta/delta-debug.c | 72 ++++++++++++++++++++++++++ drivers/media/platform/sti/delta/delta-debug.h | 18 +++++++ drivers/media/platform/sti/delta/delta-v4l2.c | 29 +++++++++-- 4 files changed, 116 insertions(+), 5 deletions(-) create mode 100644 drivers/media/platform/sti/delta/delta-debug.c create mode 100644 drivers/media/platform/sti/delta/delta-debug.h
drivers/media/platform/sti/delta/Makefile +1 -1
@@ -1,5 +1,5 @@ obj-$(CONFIG_VIDEO_STI_DELTA) := st-delta.o -st-delta-y := delta-v4l2.o delta-mem.o delta-ipc.o +st-delta-y := delta-v4l2.o delta-mem.o delta-ipc.o delta-debug.o # MJPEG support st-delta-$(CONFIG_VIDEO_STI_DELTA_MJPEG) += delta-mjpeg-hdr.o
drivers/media/platform/sti/delta/delta-debug.c new file +72 -0
72 lines not on this page · raw message
drivers/media/platform/sti/delta/delta-debug.h new file +18 -0
@@ -0,0 +1,18 @@ +/* +* Copyright (C) STMicroelectronics SA 2015 +* Authors: Hugues Fruchet <[email protected]> +* Fabrice Lecoultre <[email protected]> +* for STMicroelectronics. +* License terms: GNU General Public License (GPL), version 2 +*/ + +#ifndef DELTA_DEBUG_H +#define DELTA_DEBUG_H + +char *delta_streaminfo_str (struct delta_streaminfo *s,char *str, +unsigned int len); +char *delta_frameinfo_str (struct delta_frameinfo *f,char *str, +unsigned int len); +void delta_trace_summary (struct delta_ctx *ctx); + +#endif /* DELTA_DEBUG_H */
drivers/media/platform/sti/delta/delta-v4l2.c +25 -4
@@ -17,6 +17,7 @@#include <media/videobuf2-dma-contig.h> #include "delta.h" +#include "delta-debug.h" #include "delta-ipc.h" #define DELTA_NAME "st-delta"
@@ -438,11 +439,13 @@ static int delta_g_fmt_stream(struct file *file, void *fh,struct delta_dev *delta = ctx->dev;struct v4l2_pix_format *pix = &f->fmt.pix;struct delta_streaminfo *streaminfo = &ctx->streaminfo; +unsigned char str[100 ] ="" ;if (!(ctx->flags &DELTA_FLAG_STREAMINFO ))dev_dbg (delta->dev, -"%s V4L2 GET_FMT (OUTPUT): no stream information available, using default\n" , - ctx->name); +"%s V4L2 GET_FMT (OUTPUT): no stream information available, default to %s\n" , + ctx->name, +delta_streaminfo_str (streaminfo, str,sizeof (str))); pix->pixelformat = streaminfo->streamformat; pix->width = streaminfo->width;
@@ -465,11 +468,13 @@ static int delta_g_fmt_frame(struct file *file, void *fh, struct v4l2_format *f)struct v4l2_pix_format *pix = &f->fmt.pix;struct delta_frameinfo *frameinfo = &ctx->frameinfo;struct delta_streaminfo *streaminfo = &ctx->streaminfo; +unsigned char str[100 ] ="" ;if (!(ctx->flags &DELTA_FLAG_FRAMEINFO ))dev_dbg (delta->dev, -"%s V4L2 GET_FMT (CAPTURE): no frame information available, using default\n" , - ctx->name); +"%s V4L2 GET_FMT (CAPTURE): no frame information available, default to %s\n" , + ctx->name, +delta_frameinfo_str (frameinfo, str,sizeof (str))); pix->pixelformat = frameinfo->pixelformat; pix->width = frameinfo->aligned_width;
@@ -652,6 +657,7 @@ static int delta_s_fmt_frame(struct file *file, void *fh, struct v4l2_format *f)const struct delta_dec *dec = ctx->dec;struct v4l2_pix_format *pix = &f->fmt.pix;struct delta_frameinfo frameinfo; +unsigned char str[100 ] ="" ;struct vb2_queue *vq;int ret;
@@ -703,6 +709,10 @@ static int delta_s_fmt_frame(struct file *file, void *fh, struct v4l2_format *f) ctx->flags |=DELTA_FLAG_FRAMEINFO ; ctx->frameinfo = frameinfo; +dev_dbg (delta->dev, +"%s V4L2 SET_FMT (CAPTURE): frameinfo updated to %s\n" , + ctx->name, +delta_frameinfo_str (&frameinfo, str,sizeof (str))); pix->pixelformat = frameinfo.pixelformat; pix->width = frameinfo.aligned_width;
@@ -1306,6 +1316,8 @@ static int delta_vb2_au_start_streaming(struct vb2_queue *q,struct vb2_v4l2_buffer *vbuf =NULL ;struct delta_streaminfo *streaminfo = &ctx->streaminfo;struct delta_frameinfo *frameinfo = &ctx->frameinfo; +unsigned char str1[100 ] ="" ; +unsigned char str2[100 ] ="" ;if ((ctx->state !=DELTA_STATE_WF_FORMAT ) && (ctx->state !=DELTA_STATE_WF_STREAMINFO ))
@@ -1366,6 +1378,10 @@ static int delta_vb2_au_start_streaming(struct vb2_queue *q, ctx->state =DELTA_STATE_READY ; +dev_info (delta->dev,"%s %s => %s\n" , ctx->name, +delta_streaminfo_str (streaminfo, str1,sizeof (str1)), +delta_frameinfo_str (frameinfo, str2,sizeof (str2))); +delta_au_done (ctx, au, ret);return 0 ;
@@ -1689,6 +1705,11 @@ static int delta_release(struct file *file)/* close decoder */ call_dec_op (dec, close, ctx); +/* trace a summary of instance +* before closing (debug purpose) +*/ +delta_trace_summary (ctx); +v4l2_m2m_ctx_release (ctx->fh.m2m_ctx);v4l2_fh_del (&ctx->fh);
Signature · 1 line
1.9.1
Hi Hugues,
Quoted 51 lines · Hugues Fruchet
This patchset introduces a basic support for DELTA multi-format video decoder of STMicroelectronics STiH4xx SoC series.
DELTA hardware IP is controlled by a remote firmware loaded in a ST231 coprocessor. Communication with firmware is done within an IPC layer using rpmsg kernel framework and a shared memory for messages handling. This driver is compatible with firmware version 21.1-3. While a single firmware is loaded in ST231 coprocessor, it is composed of several firmwares, one per video format family.
This DELTA V4L2 driver is designed around files:
-delta-v4l2.c: handles V4L2 APIs using M2M framework and calls decoder ops
- delta-<codec>* : implements <codec> decoder calling its associated video firmware (for ex. MJPEG) using IPC layer
-delta-ipc.c: IPC layer which handles communication with firmware using rpmsgThis first basic support implements only MJPEG hardware acceleration but the driver structure is in place to support all the features of the DELTA video decoder hardware IP.
This driver depends on:
- ST remoteproc/rpmsg: patchset posted at https://lkml.org/lkml/2016/9/6/77
- ST DELTA firmware: its license is under review. When available, pull request will be done on linux-firmware.===========
= history =
===========
version 3
- update after v2 review:
- fixedm2m_buf_donemissing onstart_streamingerror case
- fixedq->devmissing inqueue_init()
- removed unsupporteds_selection
- refactored string namings indelta-debug.c
- fixed space before comment
- all commits have commit messages
- reword memory allocator helper commitversion 2
- update after v1 review:
- simplified tracing
- G_/S_SELECTION reworked to fit COMPOSE(CAPTURE)
- fixedm2m_buf_donemissing onstart_streamingerror case
- fixedq->devmissing inqueue_init()
- switch to kernel-4.9 rpmsg API
- DELTA support added inmulti_v7_defconfig
- minor typo fixes & code cleanupversion 1:
- Initial submission
Quoted 6 lines
===================
= v4l2-compliance =
===================
Below is the v4l2-compliance report for the version 3 of the DELTA video
decoder driver. v4l2-compliance has been build from SHA1:600492351ddf40cc524aab73802153674d7d287b(libdvb5: Fix multiple definition ofdvb_dev_remote_initlinking error)
Can you update v4l-utils and run this test again? The S_SELECTION compliance test has been fixed to allow for ENOTTY as the error code.
If the output looks good, then I'll merge this driver (will be for 4.11).
Regards,
Hans
Re: [PATCH v3 07/10] [media] st-delta: rpmsg ipc support
In reply to Hugues FruchetQuoted 36 lines · Hugues Fruchet
IPC (Inter Process Communication) support for communication with DELTA coprocessor firmware using rpmsg kernel framework.
Based on 4 services open/set_stream/decode/close and their associated rpmsg messages.
The messages structures are duplicated on both host and firmware side and are packed (use only of 32 bits size fields in messages structures to ensure packing).
Each service is synchronous; service returns only when firmware acknowledges the associated command message.
Due to significant parameters size exchanged from host to copro, parameters are not inserted in rpmsg messages. Instead, parameters are stored in physical memory shared between host and coprocessor. Memory is non-cacheable, so no special operation is required to ensure memory coherency on host and on coprocessor side. Multi-instance support and re-entrance are ensured usinghost_hdlandcopro_hdlin message header exchanged between both host and coprocessor. This avoids to manage tables on both sides to get back the running context of each instance.Signed-off-by Hugues Fruchet <[email protected]>--- drivers/media/platform/Kconfig | 1 + drivers/media/platform/sti/delta/Makefile | 2 +- drivers/media/platform/sti/delta/delta-ipc.c | 590 ++++++++++++++++++++++++++ drivers/media/platform/sti/delta/delta-ipc.h | 76 ++++ drivers/media/platform/sti/delta/delta-v4l2.c | 11 + drivers/media/platform/sti/delta/delta.h | 21 + 6 files changed, 700 insertions(+), 1 deletion(-) create mode 100644 drivers/media/platform/sti/delta/delta-ipc.c create mode 100644 drivers/media/platform/sti/delta/delta-ipc.hdrivers/media/platform/Kconfig +0
-0
drivers/media/platform/Kconfig config VIDEO_STI_DELTA · line 306
Quoted 4 lines
drivers/media/platform/Kconfig +1
-0@@ -303,6 +303,7 @@ config VIDEO_STI_DELTA depends on VIDEO_DEV && VIDEO_V4L2 depends on ARCH_STI || COMPILE_TEST depends on HAS_DMA + depends on RPMSG
This should be 'select', not 'depends on'.
drivers/media/platform/Kconfig config VIDEO_STI_DELTA · line 309
Quoted 3 lines
drivers/media/platform/Kconfig +0
-0select VIDEOBUF2_DMA_CONTIG select V4L2_MEM2MEM_DEV help
Can you make a v3.1 of this patch correcting this?
Regards,
Hans
Thanks Hans, I will test with new compliance.
BR,
Hugues.
Quoted 70 lines · Hans Verkuil
Hi Hugues,
Quoted 51 lines · Hugues Fruchet
This patchset introduces a basic support for DELTA multi-format video decoder of STMicroelectronics STiH4xx SoC series.
DELTA hardware IP is controlled by a remote firmware loaded in a ST231 coprocessor. Communication with firmware is done within an IPC layer using rpmsg kernel framework and a shared memory for messages handling. This driver is compatible with firmware version 21.1-3. While a single firmware is loaded in ST231 coprocessor, it is composed of several firmwares, one per video format family.
This DELTA V4L2 driver is designed around files:
-delta-v4l2.c: handles V4L2 APIs using M2M framework and calls decoder ops
- delta-<codec>* : implements <codec> decoder calling its associated video firmware (for ex. MJPEG) using IPC layer
-delta-ipc.c: IPC layer which handles communication with firmware using rpmsgThis first basic support implements only MJPEG hardware acceleration but the driver structure is in place to support all the features of the DELTA video decoder hardware IP.
This driver depends on:
- ST remoteproc/rpmsg: patchset posted at https://lkml.org/lkml/2016/9/6/77
- ST DELTA firmware: its license is under review. When available, pull request will be done on linux-firmware.===========
= history =
===========
version 3
- update after v2 review:
- fixedm2m_buf_donemissing onstart_streamingerror case
- fixedq->devmissing inqueue_init()
- removed unsupporteds_selection
- refactored string namings indelta-debug.c
- fixed space before comment
- all commits have commit messages
- reword memory allocator helper commitversion 2
- update after v1 review:
- simplified tracing
- G_/S_SELECTION reworked to fit COMPOSE(CAPTURE)
- fixedm2m_buf_donemissing onstart_streamingerror case
- fixedq->devmissing inqueue_init()
- switch to kernel-4.9 rpmsg API
- DELTA support added inmulti_v7_defconfig
- minor typo fixes & code cleanupversion 1:
- Initial submissionQuoted 6 lines
===================
= v4l2-compliance =
===================
Below is the v4l2-compliance report for the version 3 of the DELTA video
decoder driver. v4l2-compliance has been build from SHA1:600492351ddf40cc524aab73802153674d7d287b(libdvb5: Fix multiple definition ofdvb_dev_remote_initlinking error)Can you update v4l-utils and run this test again? The
S_SELECTIONcompliance test has been fixed to allow for ENOTTY as the error code.If the output looks good, then I'll merge this driver (will be for 4.11).
Regards,
Hans
Re: [PATCH v3 07/10] [media] st-delta: rpmsg ipc support
In reply to Hans VerkuilThanks Hans, I will change depends to select.
BR,
Hugues.
Quoted 54 lines · Hans Verkuil
Quoted 36 lines · Hugues Fruchet
IPC (Inter Process Communication) support for communication with DELTA coprocessor firmware using rpmsg kernel framework.
Based on 4 services open/set_stream/decode/close and their associated rpmsg messages.
The messages structures are duplicated on both host and firmware side and are packed (use only of 32 bits size fields in messages structures to ensure packing).
Each service is synchronous; service returns only when firmware acknowledges the associated command message.
Due to significant parameters size exchanged from host to copro, parameters are not inserted in rpmsg messages. Instead, parameters are stored in physical memory shared between host and coprocessor. Memory is non-cacheable, so no special operation is required to ensure memory coherency on host and on coprocessor side. Multi-instance support and re-entrance are ensured usinghost_hdlandcopro_hdlin message header exchanged between both host and coprocessor. This avoids to manage tables on both sides to get back the running context of each instance.Signed-off-by Hugues Fruchet <[email protected]>--- drivers/media/platform/Kconfig | 1 + drivers/media/platform/sti/delta/Makefile | 2 +- drivers/media/platform/sti/delta/delta-ipc.c | 590 ++++++++++++++++++++++++++ drivers/media/platform/sti/delta/delta-ipc.h | 76 ++++ drivers/media/platform/sti/delta/delta-v4l2.c | 11 + drivers/media/platform/sti/delta/delta.h | 21 + 6 files changed, 700 insertions(+), 1 deletion(-) create mode 100644 drivers/media/platform/sti/delta/delta-ipc.c create mode 100644 drivers/media/platform/sti/delta/delta-ipc.hdrivers/media/platform/Kconfig +0
-0drivers/media/platform/Kconfig config VIDEO_STI_DELTA · line 306
Quoted 4 lines
drivers/media/platform/Kconfig +1
-0@@ -303,6 +303,7 @@ config VIDEO_STI_DELTA depends on VIDEO_DEV && VIDEO_V4L2 depends on ARCH_STI || COMPILE_TEST depends on HAS_DMA + depends on RPMSGThis should be 'select', not 'depends on'.
drivers/media/platform/Kconfig config VIDEO_STI_DELTA · line 309
Quoted 3 lines
drivers/media/platform/Kconfig +0
-0select VIDEOBUF2_DMA_CONTIG select V4L2_MEM2MEM_DEV helpCan you make a v3.1 of this patch correcting this?
Regards,
Hans