Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1599585 > unrolled thread

[PATCH v7 0/9] Qualcomm video decoder/encoder driver

Started byStanimir Varbanov <stanimir.varbanov@linaro.org>
First post2017-03-13 17:40 +0100
Last post2017-03-25 23:50 +0100
Articles 8 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v7 0/9] Qualcomm video decoder/encoder driver Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2017-03-13 17:40 +0100
    [PATCH v7 2/9] doc: DT: venus: binding document for Qualcomm video driver Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2017-03-13 17:40 +0100
    [PATCH v7 9/9] media: venus: enable building of Venus video driver Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2017-03-13 17:50 +0100
      Re: [PATCH v7 9/9] media: venus: enable building of Venus video  driver Hans Verkuil <hverkuil@xs4all.nl> - 2017-03-24 16:00 +0100
        Re: [PATCH v7 9/9] media: venus: enable building of Venus video  driver Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2017-03-24 16:40 +0100
    Re: [PATCH v7 0/9] Qualcomm video decoder/encoder driver Hans Verkuil <hverkuil@xs4all.nl> - 2017-03-24 15:10 +0100
      Re: [PATCH v7 0/9] Qualcomm video decoder/encoder driver Hans Verkuil <hverkuil@xs4all.nl> - 2017-03-24 15:10 +0100
    Re: [PATCH v7 4/9] media: venus: adding core part and helper  functions Stanimir Varbanov <stanimir.varbanov@linaro.org> - 2017-03-25 23:50 +0100

#1599585 — [PATCH v7 0/9] Qualcomm video decoder/encoder driver

FromStanimir Varbanov <stanimir.varbanov@linaro.org>
Date2017-03-13 17:40 +0100
Subject[PATCH v7 0/9] Qualcomm video decoder/encoder driver
Message-ID<tkBaN-3bi-5@gated-at.bofh.it>
Hi all,

Here is seventh version of the patch-set - no functional changes in
v4l2 APIs.

The changes since v6 are.
  * changes in DT binding document - moved memory-region DT property
    in video-codec node - see 2/9.
  * improved recovery mechanism. 
  * fixed various issues found during testing.

Build dependencies:
  - qcom_scm_set_remote_state is merged in Linux 4.11-rc1
  - qcom mdt_loader is merged in Linux 4.11-rc1

regards,
Stan
  
Stanimir Varbanov (9):
  media: v4l2-mem2mem: extend m2m APIs for more accurate buffer
    management
  doc: DT: venus: binding document for Qualcomm video driver
  MAINTAINERS: Add Qualcomm Venus video accelerator driver
  media: venus: adding core part and helper functions
  media: venus: vdec: add video decoder files
  media: venus: venc: add video encoder files
  media: venus: hfi: add Host Firmware Interface (HFI)
  media: venus: hfi: add Venus HFI files
  media: venus: enable building of Venus video driver

 .../devicetree/bindings/media/qcom,venus.txt       |  107 ++
 MAINTAINERS                                        |    8 +
 drivers/media/platform/Kconfig                     |   14 +
 drivers/media/platform/Makefile                    |    2 +
 drivers/media/platform/qcom/venus/Makefile         |   11 +
 drivers/media/platform/qcom/venus/core.c           |  386 +++++
 drivers/media/platform/qcom/venus/core.h           |  306 ++++
 drivers/media/platform/qcom/venus/firmware.c       |  107 ++
 drivers/media/platform/qcom/venus/firmware.h       |   22 +
 drivers/media/platform/qcom/venus/helpers.c        |  632 ++++++++
 drivers/media/platform/qcom/venus/helpers.h        |   41 +
 drivers/media/platform/qcom/venus/hfi.c            |  520 +++++++
 drivers/media/platform/qcom/venus/hfi.h            |  174 +++
 drivers/media/platform/qcom/venus/hfi_cmds.c       | 1256 ++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_cmds.h       |  304 ++++
 drivers/media/platform/qcom/venus/hfi_helper.h     | 1050 +++++++++++++
 drivers/media/platform/qcom/venus/hfi_msgs.c       | 1058 +++++++++++++
 drivers/media/platform/qcom/venus/hfi_msgs.h       |  283 ++++
 drivers/media/platform/qcom/venus/hfi_venus.c      | 1570 ++++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_venus.h      |   23 +
 drivers/media/platform/qcom/venus/hfi_venus_io.h   |  113 ++
 drivers/media/platform/qcom/venus/vdec.c           | 1091 ++++++++++++++
 drivers/media/platform/qcom/venus/vdec.h           |   23 +
 drivers/media/platform/qcom/venus/vdec_ctrls.c     |  149 ++
 drivers/media/platform/qcom/venus/venc.c           | 1231 +++++++++++++++
 drivers/media/platform/qcom/venus/venc.h           |   23 +
 drivers/media/platform/qcom/venus/venc_ctrls.c     |  258 ++++
 drivers/media/v4l2-core/v4l2-mem2mem.c             |   37 +
 include/media/v4l2-mem2mem.h                       |   92 ++
 29 files changed, 10891 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/qcom,venus.txt
 create mode 100644 drivers/media/platform/qcom/venus/Makefile
 create mode 100644 drivers/media/platform/qcom/venus/core.c
 create mode 100644 drivers/media/platform/qcom/venus/core.h
 create mode 100644 drivers/media/platform/qcom/venus/firmware.c
 create mode 100644 drivers/media/platform/qcom/venus/firmware.h
 create mode 100644 drivers/media/platform/qcom/venus/helpers.c
 create mode 100644 drivers/media/platform/qcom/venus/helpers.h
 create mode 100644 drivers/media/platform/qcom/venus/hfi.c
 create mode 100644 drivers/media/platform/qcom/venus/hfi.h
 create mode 100644 drivers/media/platform/qcom/venus/hfi_cmds.c
 create mode 100644 drivers/media/platform/qcom/venus/hfi_cmds.h
 create mode 100644 drivers/media/platform/qcom/venus/hfi_helper.h
 create mode 100644 drivers/media/platform/qcom/venus/hfi_msgs.c
 create mode 100644 drivers/media/platform/qcom/venus/hfi_msgs.h
 create mode 100644 drivers/media/platform/qcom/venus/hfi_venus.c
 create mode 100644 drivers/media/platform/qcom/venus/hfi_venus.h
 create mode 100644 drivers/media/platform/qcom/venus/hfi_venus_io.h
 create mode 100644 drivers/media/platform/qcom/venus/vdec.c
 create mode 100644 drivers/media/platform/qcom/venus/vdec.h
 create mode 100644 drivers/media/platform/qcom/venus/vdec_ctrls.c
 create mode 100644 drivers/media/platform/qcom/venus/venc.c
 create mode 100644 drivers/media/platform/qcom/venus/venc.h
 create mode 100644 drivers/media/platform/qcom/venus/venc_ctrls.c

-- 
2.7.4

[toc] | [next] | [standalone]


#1599586 — [PATCH v7 2/9] doc: DT: venus: binding document for Qualcomm video driver

FromStanimir Varbanov <stanimir.varbanov@linaro.org>
Date2017-03-13 17:40 +0100
Subject[PATCH v7 2/9] doc: DT: venus: binding document for Qualcomm video driver
Message-ID<tkBaO-3bi-25@gated-at.bofh.it>
In reply to#1599585
Add binding document for Venus video encoder/decoder driver

Cc: Rob Herring <robh+dt@kernel.org>
Cc: devicetree@vger.kernel.org
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
 .../devicetree/bindings/media/qcom,venus.txt       | 107 +++++++++++++++++++++
 1 file changed, 107 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/qcom,venus.txt

diff --git a/Documentation/devicetree/bindings/media/qcom,venus.txt b/Documentation/devicetree/bindings/media/qcom,venus.txt
new file mode 100644
index 000000000000..2693449daf73
--- /dev/null
+++ b/Documentation/devicetree/bindings/media/qcom,venus.txt
@@ -0,0 +1,107 @@
+* Qualcomm Venus video encoder/decoder accelerators
+
+- compatible:
+	Usage: required
+	Value type: <stringlist>
+	Definition: Value should contain one of:
+		- "qcom,msm8916-venus"
+		- "qcom,msm8996-venus"
+- reg:
+	Usage: required
+	Value type: <prop-encoded-array>
+	Definition: Register base address and length of the register map.
+- interrupts:
+	Usage: required
+	Value type: <prop-encoded-array>
+	Definition: Should contain interrupt line number.
+- clocks:
+	Usage: required
+	Value type: <prop-encoded-array>
+	Definition: A List of phandle and clock specifier pairs as listed
+		    in clock-names property.
+- clock-names:
+	Usage: required for msm8916
+	Value type: <stringlist>
+	Definition: Should contain the following entries:
+		- "core"	Core video accelerator clock
+		- "iface"	Video accelerator AHB clock
+		- "bus"		Video accelerator AXI clock
+- clock-names:
+	Usage: required for msm8996
+	Value type: <stringlist>
+	Definition: Should contain the following entries:
+		- "core"	Core video accelerator clock
+		- "iface"	Video accelerator AHB clock
+		- "bus"		Video accelerator AXI clock
+		- "mbus"	Video MAXI clock
+- power-domains:
+	Usage: required
+	Value type: <prop-encoded-array>
+	Definition: A phandle and power domain specifier pairs to the
+		    power domain which is responsible for collapsing
+		    and restoring power to the peripheral.
+- iommus:
+	Usage: required
+	Value type: <prop-encoded-array>
+	Definition: A list of phandle and IOMMU specifier pairs.
+- memory-region:
+	Usage: required
+	Value type: <phandle>
+	Definition: reference to the reserved-memory for the firmware
+		    memory region.
+
+* Subnodes
+The Venus video-codec node must contain two subnodes representing
+video-decoder and video-encoder.
+
+Every of video-encoder or video-decoder subnode should have:
+
+- compatible:
+	Usage: required
+	Value type: <stringlist>
+	Definition: Value should contain "venus-decoder" or "venus-encoder"
+- clocks:
+	Usage: required for msm8996
+	Value type: <prop-encoded-array>
+	Definition: A List of phandle and clock specifier pairs as listed
+		    in clock-names property.
+- clock-names:
+	Usage: required for msm8996
+	Value type: <stringlist>
+	Definition: Should contain the following entries:
+		- "core"	Subcore video accelerator clock
+
+- power-domains:
+	Usage: required for msm8996
+	Value type: <prop-encoded-array>
+	Definition: A phandle and power domain specifier pairs to the
+		    power domain which is responsible for collapsing
+		    and restoring power to the subcore.
+
+* An Example
+	video-codec@1d00000 {
+		compatible = "qcom,msm8916-venus";
+		reg = <0x01d00000 0xff000>;
+		interrupts = <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&gcc GCC_VENUS0_VCODEC0_CLK>,
+			 <&gcc GCC_VENUS0_AHB_CLK>,
+			 <&gcc GCC_VENUS0_AXI_CLK>;
+		clock-names = "core", "iface", "bus";
+		power-domains = <&gcc VENUS_GDSC>;
+		iommus = <&apps_iommu 5>;
+		memory-region = <&venus_mem>;
+
+		video-decoder {
+			compatible = "venus-decoder";
+			clocks = <&mmcc VIDEO_SUBCORE0_CLK>;
+			clock-names = "core";
+			power-domains = <&mmcc VENUS_CORE0_GDSC>;
+		};
+
+		video-encoder {
+			compatible = "venus-encoder";
+			clocks = <&mmcc VIDEO_SUBCORE1_CLK>;
+			clock-names = "core";
+			power-domains = <&mmcc VENUS_CORE1_GDSC>;
+		};
+	};
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1599599 — [PATCH v7 9/9] media: venus: enable building of Venus video driver

FromStanimir Varbanov <stanimir.varbanov@linaro.org>
Date2017-03-13 17:50 +0100
Subject[PATCH v7 9/9] media: venus: enable building of Venus video driver
Message-ID<tkBku-3fs-31@gated-at.bofh.it>
In reply to#1599585
This adds Venus driver Makefile and changes v4l2 platform
Makefile/Kconfig in order to enable building of the driver.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
 drivers/media/platform/Kconfig             | 14 ++++++++++++++
 drivers/media/platform/Makefile            |  2 ++
 drivers/media/platform/qcom/venus/Makefile | 11 +++++++++++
 3 files changed, 27 insertions(+)
 create mode 100644 drivers/media/platform/qcom/venus/Makefile

diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
index 53f6f12bff0d..8a6c3d664307 100644
--- a/drivers/media/platform/Kconfig
+++ b/drivers/media/platform/Kconfig
@@ -447,6 +447,20 @@ config VIDEO_TI_VPE_DEBUG
 	---help---
 	  Enable debug messages on VPE driver.
 
+config VIDEO_QCOM_VENUS
+	tristate "Qualcomm Venus V4L2 encoder/decoder driver"
+	depends on VIDEO_DEV && VIDEO_V4L2 && HAS_DMA
+	depends on ARCH_QCOM && OF
+	depends on IOMMU_DMA
+	select QCOM_MDT_LOADER
+	select VIDEOBUF2_DMA_SG
+	select V4L2_MEM2MEM_DEV
+	---help---
+	  This is a V4L2 driver for Qualcomm Venus video accelerator
+	  hardware. It accelerates encoding and decoding operations
+	  on various Qualcomm SoCs.
+	  To compile this driver as a module choose m here.
+
 endif # V4L_MEM2MEM_DRIVERS
 
 # TI VIDEO PORT Helper Modules
diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
index 8959f6e6692a..bd5cae68db8a 100644
--- a/drivers/media/platform/Makefile
+++ b/drivers/media/platform/Makefile
@@ -73,3 +73,5 @@ obj-$(CONFIG_VIDEO_MEDIATEK_VCODEC)	+= mtk-vcodec/
 obj-$(CONFIG_VIDEO_MEDIATEK_MDP)	+= mtk-mdp/
 
 obj-$(CONFIG_VIDEO_MEDIATEK_JPEG)	+= mtk-jpeg/
+
+obj-$(CONFIG_VIDEO_QCOM_VENUS)		+= qcom/venus/
diff --git a/drivers/media/platform/qcom/venus/Makefile b/drivers/media/platform/qcom/venus/Makefile
new file mode 100644
index 000000000000..0fe9afb83697
--- /dev/null
+++ b/drivers/media/platform/qcom/venus/Makefile
@@ -0,0 +1,11 @@
+# Makefile for Qualcomm Venus driver
+
+venus-core-objs += core.o helpers.o firmware.o \
+		   hfi_venus.o hfi_msgs.o hfi_cmds.o hfi.o
+
+venus-dec-objs += vdec.o vdec_ctrls.o
+venus-enc-objs += venc.o venc_ctrls.o
+
+obj-$(CONFIG_VIDEO_QCOM_VENUS) += venus-core.o
+obj-$(CONFIG_VIDEO_QCOM_VENUS) += venus-dec.o
+obj-$(CONFIG_VIDEO_QCOM_VENUS) += venus-enc.o
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1608518 — Re: [PATCH v7 9/9] media: venus: enable building of Venus video driver

FromHans Verkuil <hverkuil@xs4all.nl>
Date2017-03-24 16:00 +0100
SubjectRe: [PATCH v7 9/9] media: venus: enable building of Venus video driver
Message-ID<toyR3-34l-17@gated-at.bofh.it>
In reply to#1599599
On 03/13/17 17:37, Stanimir Varbanov wrote:
> This adds Venus driver Makefile and changes v4l2 platform
> Makefile/Kconfig in order to enable building of the driver.
> 
> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> ---
>  drivers/media/platform/Kconfig             | 14 ++++++++++++++
>  drivers/media/platform/Makefile            |  2 ++
>  drivers/media/platform/qcom/venus/Makefile | 11 +++++++++++
>  3 files changed, 27 insertions(+)
>  create mode 100644 drivers/media/platform/qcom/venus/Makefile
> 
> diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
> index 53f6f12bff0d..8a6c3d664307 100644
> --- a/drivers/media/platform/Kconfig
> +++ b/drivers/media/platform/Kconfig
> @@ -447,6 +447,20 @@ config VIDEO_TI_VPE_DEBUG
>  	---help---
>  	  Enable debug messages on VPE driver.
>  
> +config VIDEO_QCOM_VENUS
> +	tristate "Qualcomm Venus V4L2 encoder/decoder driver"
> +	depends on VIDEO_DEV && VIDEO_V4L2 && HAS_DMA

Can this also depend on COMPILE_TEST? And if so, please make sure it compile on both
a 32 and 64 bit environment to shake out any compiler warnings.

Regards,

	Hans

> +	depends on ARCH_QCOM && OF
> +	depends on IOMMU_DMA
> +	select QCOM_MDT_LOADER
> +	select VIDEOBUF2_DMA_SG
> +	select V4L2_MEM2MEM_DEV
> +	---help---
> +	  This is a V4L2 driver for Qualcomm Venus video accelerator
> +	  hardware. It accelerates encoding and decoding operations
> +	  on various Qualcomm SoCs.
> +	  To compile this driver as a module choose m here.
> +
>  endif # V4L_MEM2MEM_DRIVERS
>  
>  # TI VIDEO PORT Helper Modules
> diff --git a/drivers/media/platform/Makefile b/drivers/media/platform/Makefile
> index 8959f6e6692a..bd5cae68db8a 100644
> --- a/drivers/media/platform/Makefile
> +++ b/drivers/media/platform/Makefile
> @@ -73,3 +73,5 @@ obj-$(CONFIG_VIDEO_MEDIATEK_VCODEC)	+= mtk-vcodec/
>  obj-$(CONFIG_VIDEO_MEDIATEK_MDP)	+= mtk-mdp/
>  
>  obj-$(CONFIG_VIDEO_MEDIATEK_JPEG)	+= mtk-jpeg/
> +
> +obj-$(CONFIG_VIDEO_QCOM_VENUS)		+= qcom/venus/
> diff --git a/drivers/media/platform/qcom/venus/Makefile b/drivers/media/platform/qcom/venus/Makefile
> new file mode 100644
> index 000000000000..0fe9afb83697
> --- /dev/null
> +++ b/drivers/media/platform/qcom/venus/Makefile
> @@ -0,0 +1,11 @@
> +# Makefile for Qualcomm Venus driver
> +
> +venus-core-objs += core.o helpers.o firmware.o \
> +		   hfi_venus.o hfi_msgs.o hfi_cmds.o hfi.o
> +
> +venus-dec-objs += vdec.o vdec_ctrls.o
> +venus-enc-objs += venc.o venc_ctrls.o
> +
> +obj-$(CONFIG_VIDEO_QCOM_VENUS) += venus-core.o
> +obj-$(CONFIG_VIDEO_QCOM_VENUS) += venus-dec.o
> +obj-$(CONFIG_VIDEO_QCOM_VENUS) += venus-enc.o
> 

[toc] | [prev] | [next] | [standalone]


#1608564 — Re: [PATCH v7 9/9] media: venus: enable building of Venus video driver

FromStanimir Varbanov <stanimir.varbanov@linaro.org>
Date2017-03-24 16:40 +0100
SubjectRe: [PATCH v7 9/9] media: venus: enable building of Venus video driver
Message-ID<toztM-3Ao-15@gated-at.bofh.it>
In reply to#1608518
Thanks for the comments!

On 03/24/2017 04:49 PM, Hans Verkuil wrote:
> On 03/13/17 17:37, Stanimir Varbanov wrote:
>> This adds Venus driver Makefile and changes v4l2 platform
>> Makefile/Kconfig in order to enable building of the driver.
>>
>> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
>> ---
>>  drivers/media/platform/Kconfig             | 14 ++++++++++++++
>>  drivers/media/platform/Makefile            |  2 ++
>>  drivers/media/platform/qcom/venus/Makefile | 11 +++++++++++
>>  3 files changed, 27 insertions(+)
>>  create mode 100644 drivers/media/platform/qcom/venus/Makefile
>>
>> diff --git a/drivers/media/platform/Kconfig b/drivers/media/platform/Kconfig
>> index 53f6f12bff0d..8a6c3d664307 100644
>> --- a/drivers/media/platform/Kconfig
>> +++ b/drivers/media/platform/Kconfig
>> @@ -447,6 +447,20 @@ config VIDEO_TI_VPE_DEBUG
>>  	---help---
>>  	  Enable debug messages on VPE driver.
>>  
>> +config VIDEO_QCOM_VENUS
>> +	tristate "Qualcomm Venus V4L2 encoder/decoder driver"
>> +	depends on VIDEO_DEV && VIDEO_V4L2 && HAS_DMA
> 
> Can this also depend on COMPILE_TEST? And if so, please make sure it compile on both
> a 32 and 64 bit environment to shake out any compiler warnings.
> 

yes I can add COMPILE_TEST, at least on -next it should be fine.

-- 
regards,
Stan

[toc] | [prev] | [next] | [standalone]


#1608421

FromHans Verkuil <hverkuil@xs4all.nl>
Date2017-03-24 15:10 +0100
Message-ID<toy4F-2Fu-17@gated-at.bofh.it>
In reply to#1599585
On 03/13/17 17:37, Stanimir Varbanov wrote:
> Hi all,
> 
> Here is seventh version of the patch-set - no functional changes in
> v4l2 APIs.
> 
> The changes since v6 are.
>   * changes in DT binding document - moved memory-region DT property
>     in video-codec node - see 2/9.
>   * improved recovery mechanism. 
>   * fixed various issues found during testing.
> 
> Build dependencies:
>   - qcom_scm_set_remote_state is merged in Linux 4.11-rc1
>   - qcom mdt_loader is merged in Linux 4.11-rc1
> 
> regards,
> Stan
>   
> Stanimir Varbanov (9):
>   media: v4l2-mem2mem: extend m2m APIs for more accurate buffer
>     management

I don't see this patch on linux-media. Can you post that one again?

Can you also post the v4l2-compliance test results? Make sure you compile
v4l2-compliance straight from the git repo to avoid testing with an old
version.

Thanks!

	Hans

>   doc: DT: venus: binding document for Qualcomm video driver
>   MAINTAINERS: Add Qualcomm Venus video accelerator driver
>   media: venus: adding core part and helper functions
>   media: venus: vdec: add video decoder files
>   media: venus: venc: add video encoder files
>   media: venus: hfi: add Host Firmware Interface (HFI)
>   media: venus: hfi: add Venus HFI files
>   media: venus: enable building of Venus video driver
> 
>  .../devicetree/bindings/media/qcom,venus.txt       |  107 ++
>  MAINTAINERS                                        |    8 +
>  drivers/media/platform/Kconfig                     |   14 +
>  drivers/media/platform/Makefile                    |    2 +
>  drivers/media/platform/qcom/venus/Makefile         |   11 +
>  drivers/media/platform/qcom/venus/core.c           |  386 +++++
>  drivers/media/platform/qcom/venus/core.h           |  306 ++++
>  drivers/media/platform/qcom/venus/firmware.c       |  107 ++
>  drivers/media/platform/qcom/venus/firmware.h       |   22 +
>  drivers/media/platform/qcom/venus/helpers.c        |  632 ++++++++
>  drivers/media/platform/qcom/venus/helpers.h        |   41 +
>  drivers/media/platform/qcom/venus/hfi.c            |  520 +++++++
>  drivers/media/platform/qcom/venus/hfi.h            |  174 +++
>  drivers/media/platform/qcom/venus/hfi_cmds.c       | 1256 ++++++++++++++++
>  drivers/media/platform/qcom/venus/hfi_cmds.h       |  304 ++++
>  drivers/media/platform/qcom/venus/hfi_helper.h     | 1050 +++++++++++++
>  drivers/media/platform/qcom/venus/hfi_msgs.c       | 1058 +++++++++++++
>  drivers/media/platform/qcom/venus/hfi_msgs.h       |  283 ++++
>  drivers/media/platform/qcom/venus/hfi_venus.c      | 1570 ++++++++++++++++++++
>  drivers/media/platform/qcom/venus/hfi_venus.h      |   23 +
>  drivers/media/platform/qcom/venus/hfi_venus_io.h   |  113 ++
>  drivers/media/platform/qcom/venus/vdec.c           | 1091 ++++++++++++++
>  drivers/media/platform/qcom/venus/vdec.h           |   23 +
>  drivers/media/platform/qcom/venus/vdec_ctrls.c     |  149 ++
>  drivers/media/platform/qcom/venus/venc.c           | 1231 +++++++++++++++
>  drivers/media/platform/qcom/venus/venc.h           |   23 +
>  drivers/media/platform/qcom/venus/venc_ctrls.c     |  258 ++++
>  drivers/media/v4l2-core/v4l2-mem2mem.c             |   37 +
>  include/media/v4l2-mem2mem.h                       |   92 ++
>  29 files changed, 10891 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/media/qcom,venus.txt
>  create mode 100644 drivers/media/platform/qcom/venus/Makefile
>  create mode 100644 drivers/media/platform/qcom/venus/core.c
>  create mode 100644 drivers/media/platform/qcom/venus/core.h
>  create mode 100644 drivers/media/platform/qcom/venus/firmware.c
>  create mode 100644 drivers/media/platform/qcom/venus/firmware.h
>  create mode 100644 drivers/media/platform/qcom/venus/helpers.c
>  create mode 100644 drivers/media/platform/qcom/venus/helpers.h
>  create mode 100644 drivers/media/platform/qcom/venus/hfi.c
>  create mode 100644 drivers/media/platform/qcom/venus/hfi.h
>  create mode 100644 drivers/media/platform/qcom/venus/hfi_cmds.c
>  create mode 100644 drivers/media/platform/qcom/venus/hfi_cmds.h
>  create mode 100644 drivers/media/platform/qcom/venus/hfi_helper.h
>  create mode 100644 drivers/media/platform/qcom/venus/hfi_msgs.c
>  create mode 100644 drivers/media/platform/qcom/venus/hfi_msgs.h
>  create mode 100644 drivers/media/platform/qcom/venus/hfi_venus.c
>  create mode 100644 drivers/media/platform/qcom/venus/hfi_venus.h
>  create mode 100644 drivers/media/platform/qcom/venus/hfi_venus_io.h
>  create mode 100644 drivers/media/platform/qcom/venus/vdec.c
>  create mode 100644 drivers/media/platform/qcom/venus/vdec.h
>  create mode 100644 drivers/media/platform/qcom/venus/vdec_ctrls.c
>  create mode 100644 drivers/media/platform/qcom/venus/venc.c
>  create mode 100644 drivers/media/platform/qcom/venus/venc.h
>  create mode 100644 drivers/media/platform/qcom/venus/venc_ctrls.c
> 

[toc] | [prev] | [next] | [standalone]


#1608429

FromHans Verkuil <hverkuil@xs4all.nl>
Date2017-03-24 15:10 +0100
Message-ID<toy4G-2Fu-33@gated-at.bofh.it>
In reply to#1608421
On 03/24/17 15:06, Hans Verkuil wrote:
> On 03/13/17 17:37, Stanimir Varbanov wrote:
>> Hi all,
>>
>> Here is seventh version of the patch-set - no functional changes in
>> v4l2 APIs.
>>
>> The changes since v6 are.
>>   * changes in DT binding document - moved memory-region DT property
>>     in video-codec node - see 2/9.
>>   * improved recovery mechanism. 
>>   * fixed various issues found during testing.
>>
>> Build dependencies:
>>   - qcom_scm_set_remote_state is merged in Linux 4.11-rc1
>>   - qcom mdt_loader is merged in Linux 4.11-rc1
>>
>> regards,
>> Stan
>>   
>> Stanimir Varbanov (9):
>>   media: v4l2-mem2mem: extend m2m APIs for more accurate buffer
>>     management
> 
> I don't see this patch on linux-media. Can you post that one again?

Urgh, never mind. It's there, my mistake.

> 
> Can you also post the v4l2-compliance test results? Make sure you compile
> v4l2-compliance straight from the git repo to avoid testing with an old
> version.

This I'd still like to see.

	Hans

> 
> Thanks!
> 
> 	Hans
> 
>>   doc: DT: venus: binding document for Qualcomm video driver
>>   MAINTAINERS: Add Qualcomm Venus video accelerator driver
>>   media: venus: adding core part and helper functions
>>   media: venus: vdec: add video decoder files
>>   media: venus: venc: add video encoder files
>>   media: venus: hfi: add Host Firmware Interface (HFI)
>>   media: venus: hfi: add Venus HFI files
>>   media: venus: enable building of Venus video driver
>>
>>  .../devicetree/bindings/media/qcom,venus.txt       |  107 ++
>>  MAINTAINERS                                        |    8 +
>>  drivers/media/platform/Kconfig                     |   14 +
>>  drivers/media/platform/Makefile                    |    2 +
>>  drivers/media/platform/qcom/venus/Makefile         |   11 +
>>  drivers/media/platform/qcom/venus/core.c           |  386 +++++
>>  drivers/media/platform/qcom/venus/core.h           |  306 ++++
>>  drivers/media/platform/qcom/venus/firmware.c       |  107 ++
>>  drivers/media/platform/qcom/venus/firmware.h       |   22 +
>>  drivers/media/platform/qcom/venus/helpers.c        |  632 ++++++++
>>  drivers/media/platform/qcom/venus/helpers.h        |   41 +
>>  drivers/media/platform/qcom/venus/hfi.c            |  520 +++++++
>>  drivers/media/platform/qcom/venus/hfi.h            |  174 +++
>>  drivers/media/platform/qcom/venus/hfi_cmds.c       | 1256 ++++++++++++++++
>>  drivers/media/platform/qcom/venus/hfi_cmds.h       |  304 ++++
>>  drivers/media/platform/qcom/venus/hfi_helper.h     | 1050 +++++++++++++
>>  drivers/media/platform/qcom/venus/hfi_msgs.c       | 1058 +++++++++++++
>>  drivers/media/platform/qcom/venus/hfi_msgs.h       |  283 ++++
>>  drivers/media/platform/qcom/venus/hfi_venus.c      | 1570 ++++++++++++++++++++
>>  drivers/media/platform/qcom/venus/hfi_venus.h      |   23 +
>>  drivers/media/platform/qcom/venus/hfi_venus_io.h   |  113 ++
>>  drivers/media/platform/qcom/venus/vdec.c           | 1091 ++++++++++++++
>>  drivers/media/platform/qcom/venus/vdec.h           |   23 +
>>  drivers/media/platform/qcom/venus/vdec_ctrls.c     |  149 ++
>>  drivers/media/platform/qcom/venus/venc.c           | 1231 +++++++++++++++
>>  drivers/media/platform/qcom/venus/venc.h           |   23 +
>>  drivers/media/platform/qcom/venus/venc_ctrls.c     |  258 ++++
>>  drivers/media/v4l2-core/v4l2-mem2mem.c             |   37 +
>>  include/media/v4l2-mem2mem.h                       |   92 ++
>>  29 files changed, 10891 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/media/qcom,venus.txt
>>  create mode 100644 drivers/media/platform/qcom/venus/Makefile
>>  create mode 100644 drivers/media/platform/qcom/venus/core.c
>>  create mode 100644 drivers/media/platform/qcom/venus/core.h
>>  create mode 100644 drivers/media/platform/qcom/venus/firmware.c
>>  create mode 100644 drivers/media/platform/qcom/venus/firmware.h
>>  create mode 100644 drivers/media/platform/qcom/venus/helpers.c
>>  create mode 100644 drivers/media/platform/qcom/venus/helpers.h
>>  create mode 100644 drivers/media/platform/qcom/venus/hfi.c
>>  create mode 100644 drivers/media/platform/qcom/venus/hfi.h
>>  create mode 100644 drivers/media/platform/qcom/venus/hfi_cmds.c
>>  create mode 100644 drivers/media/platform/qcom/venus/hfi_cmds.h
>>  create mode 100644 drivers/media/platform/qcom/venus/hfi_helper.h
>>  create mode 100644 drivers/media/platform/qcom/venus/hfi_msgs.c
>>  create mode 100644 drivers/media/platform/qcom/venus/hfi_msgs.h
>>  create mode 100644 drivers/media/platform/qcom/venus/hfi_venus.c
>>  create mode 100644 drivers/media/platform/qcom/venus/hfi_venus.h
>>  create mode 100644 drivers/media/platform/qcom/venus/hfi_venus_io.h
>>  create mode 100644 drivers/media/platform/qcom/venus/vdec.c
>>  create mode 100644 drivers/media/platform/qcom/venus/vdec.h
>>  create mode 100644 drivers/media/platform/qcom/venus/vdec_ctrls.c
>>  create mode 100644 drivers/media/platform/qcom/venus/venc.c
>>  create mode 100644 drivers/media/platform/qcom/venus/venc.h
>>  create mode 100644 drivers/media/platform/qcom/venus/venc_ctrls.c
>>
> 

[toc] | [prev] | [next] | [standalone]


#1609256 — Re: [PATCH v7 4/9] media: venus: adding core part and helper functions

FromStanimir Varbanov <stanimir.varbanov@linaro.org>
Date2017-03-25 23:50 +0100
SubjectRe: [PATCH v7 4/9] media: venus: adding core part and helper functions
Message-ID<tp2Fr-7mu-5@gated-at.bofh.it>
In reply to#1599585
Hi Hans,

Thanks for the comments!

On 03/24/2017 04:23 PM, Hans Verkuil wrote:
> Some review comments below:
>
> On 03/13/17 17:37, Stanimir Varbanov wrote:
>>  * core.c has implemented the platform dirver methods, file
>
> dirver -> driver
>
>> operations and v4l2 registration.
>>
>>  * helpers.c has implemented common helper functions for:
>>    - buffer management
>>
>>    - vb2_ops and functions for format propagation,
>>
>>    - functions for allocating and freeing buffers for
>>    internal usage. The buffer parameters describing internal
>>    buffers depends on current format, resolution and codec.
>>
>>    - functions for calculation of current load of the
>>    hardware. Depending on the count of instances and
>>    resolutions it selects the best clock rate for the video
>>    core.
>>
>>  * firmware loader
>>
>> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
>> ---
>>  drivers/media/platform/qcom/venus/core.c     | 386 ++++++++++++++++
>>  drivers/media/platform/qcom/venus/core.h     | 306 +++++++++++++
>>  drivers/media/platform/qcom/venus/firmware.c | 107 +++++
>>  drivers/media/platform/qcom/venus/firmware.h |  22 +
>>  drivers/media/platform/qcom/venus/helpers.c  | 632 +++++++++++++++++++++++++++
>>  drivers/media/platform/qcom/venus/helpers.h  |  41 ++
>>  6 files changed, 1494 insertions(+)
>>  create mode 100644 drivers/media/platform/qcom/venus/core.c
>>  create mode 100644 drivers/media/platform/qcom/venus/core.h
>>  create mode 100644 drivers/media/platform/qcom/venus/firmware.c
>>  create mode 100644 drivers/media/platform/qcom/venus/firmware.h
>>  create mode 100644 drivers/media/platform/qcom/venus/helpers.c
>>  create mode 100644 drivers/media/platform/qcom/venus/helpers.h
>>
>> diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
>> new file mode 100644
>> index 000000000000..557b6ec4cc48
>> --- /dev/null
>> +++ b/drivers/media/platform/qcom/venus/core.c
>> @@ -0,0 +1,386 @@
>> +/*
>> + * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
>> + * Copyright (C) 2017 Linaro Ltd.
>> + *
>> + * This program is free software; you can redistribute it and/or modify
>> + * it under the terms of the GNU General Public License version 2 and
>> + * only version 2 as published by the Free Software Foundation.
>> + *
>> + * This program is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + *
>> + */
>> +#include <linux/clk.h>
>> +#include <linux/init.h>
>> +#include <linux/ioctl.h>
>> +#include <linux/list.h>
>> +#include <linux/module.h>
>> +#include <linux/of_device.h>
>> +#include <linux/platform_device.h>
>> +#include <linux/slab.h>
>> +#include <linux/types.h>
>> +#include <linux/pm_runtime.h>
>> +#include <media/videobuf2-v4l2.h>
>> +#include <media/v4l2-mem2mem.h>
>> +#include <media/v4l2-ioctl.h>
>> +
>> +#include "core.h"
>> +#include "vdec.h"
>> +#include "venc.h"
>> +#include "firmware.h"
>> +
>> +static const struct hfi_core_ops venus_core_ops;
>> +
>> +static void venus_sys_error_handler(struct work_struct *work)
>> +{
>> +	struct venus_core *core =
>> +			container_of(work, struct venus_core, work.work);
>> +	int ret;
>> +
>> +	dev_warn(core->dev, "system error occurred, starting recovery!\n");
>> +
>> +	pm_runtime_get_sync(core->dev);
>> +
>> +	hfi_core_deinit(core, true);
>> +
>> +	hfi_destroy(core);
>> +
>> +	mutex_lock(&core->lock);
>> +
>> +	venus_shutdown(&core->dev_fw);
>> +
>> +	pm_runtime_put_sync(core->dev);
>> +
>> +	ret = hfi_create(core, &venus_core_ops);
>> +
>> +	pm_runtime_get_sync(core->dev);
>> +
>> +	ret = venus_boot(core->dev, &core->dev_fw);
>> +
>> +	ret = hfi_core_resume(core, true);
>
> Why assign to ret if you're going to ignore it anyway? Either drop the assignment
> or do something with it.

Since this is on the recovery path I'm not sure how to proceed on error 
path. Delay the workqueue and try again later? Whatever, I can rework 
this to print the errors instead of ignoring them.

>
>> +
>> +	enable_irq(core->irq);
>> +
>> +	mutex_unlock(&core->lock);
>> +
>> +	ret = hfi_core_init(core);
>> +	if (ret)
>> +		dev_err(core->dev, "hfi_core_init (%d)\n", ret);
>> +
>> +	pm_runtime_put_sync(core->dev);
>> +
>> +	core->sys_error = false;
>> +}
>> +

<snip>

>> +/**
>> + * struct venus_inst - holds per instance paramerters
>> + *
>> + * @list:	used for attach an instance to the core
>> + * @lock:	instance lock
>> + * @core:	a reference to the core struct
>> + * @internalbufs:	a list of internal bufferes
>> + * @registeredbufs:	a list of registered capture bufferes
>> + * @ctrl_handler:	v4l control handler
>> + * @controls:	an union of decoder and encoder control parameters
>> + * @fh:	 a holder of v4l file handle structure
>> + * @width:	current capture width
>> + * @height:	current capture height
>> + * @out_width:	current output width
>> + * @out_height:	current output height
>> + * @colorspace:	current color space
>> + * @quantization:	current quantization
>> + * @xfer_func:	current xfer function
>> + * @fps:		holds current FPS
>> + * @timeperframe:	holds current time per frame structure
>> + * @fmt_out:	a reference to output format structure
>> + * @fmt_cap:	a reference to capture format structure
>> + * @num_input_bufs:	holds number of input buffers
>> + * @num_output_bufs:	holds number of output buffers
>> + * @input_buf_size	holds input buffer size
>> + * @output_buf_size:	holds output buffer size
>> + * @reconfig:	a flag raised by decoder when the stream resolution changed
>> + * @reconfig_width:	holds the new width
>> + * @reconfig_height:	holds the new height
>> + * @sequence:		a sequence counter
>> + * @codec_cfg:	a flag used to annonce a codec configuration
>> + * @m2m_dev:	a reference to m2m device structure
>> + * @m2m_ctx:	a reference to m2m context structure
>> + * @state:	current state of the instance
>> + * @done:	a completion for sync HFI operation
>> + * @error:	an error returned during last HFI sync operation
>> + * @session_error:	a flag rised by HFI interface in case of session error
>> + * @ops:		HFI operations
>> + * @priv:	a private for HFI operations callbacks
>> + * @session_type:	the type of the session (decoder or encoder)
>> + * @hprop:	an union used as a holder by get property
>> + * @cap_width:	width capability
>> + * @cap_height:	height capability
>> + * @cap_mbs_per_frame:	macroblocks per frame capability
>> + * @cap_mbs_per_sec:	macroblocks per second capability
>> + * @cap_framerate:	framerate capability
>> + * @cap_scale_x:		horizontal scaling capability
>> + * @cap_scale_y:		vertical scaling capability
>> + * @cap_bitrate:		bitrate capability
>> + * @cap_hier_p:		hier capability
>> + * @cap_ltr_count:	LTR count capability
>> + * @cap_secure_output2_threshold: secure OUTPUT2 threshold capability
>> + * @cap_bufs_mode_static:	buffers allocation mode capability
>> + * @cap_bufs_mode_dynamic:	buffers allocation mode capability
>> + * @pl_count:	count of supported profiles/levels
>> + * @pl:		supported profiles/levels
>> + * @bufreq:	holds buffer requirements
>> + */
>> +struct venus_inst {
>> +	struct list_head list;
>> +	struct mutex lock;
>> +	struct venus_core *core;
>> +	struct list_head internalbufs;
>> +	struct list_head registeredbufs;
>> +
>> +	struct v4l2_ctrl_handler ctrl_handler;
>> +	union {
>> +		struct vdec_controls dec;
>> +		struct venc_controls enc;
>> +	} controls;
>> +	struct v4l2_fh fh;
>> +	unsigned int streamon_cap, streamon_out;
>> +	u32 width;
>> +	u32 height;
>> +	u32 out_width;
>> +	u32 out_height;
>> +	u32 colorspace;
>> +	u8 ycbcr_enc;
>> +	u8 quantization;
>> +	u8 xfer_func;
>> +	u64 fps;
>> +	struct v4l2_fract timeperframe;
>> +	const struct venus_format *fmt_out;
>> +	const struct venus_format *fmt_cap;
>> +	unsigned int num_input_bufs;
>> +	unsigned int num_output_bufs;
>> +	unsigned int input_buf_size;
>> +	unsigned int output_buf_size;
>> +	bool reconfig;
>> +	u32 reconfig_width;
>> +	u32 reconfig_height;
>> +	u64 sequence;
>> +	bool codec_cfg;
>> +	struct v4l2_m2m_dev *m2m_dev;
>> +	struct v4l2_m2m_ctx *m2m_ctx;
>> +	unsigned int state;
>> +	struct completion done;
>> +	unsigned int error;
>> +	bool session_error;
>> +	const struct hfi_inst_ops *ops;
>> +	u32 session_type;
>> +	union hfi_get_property hprop;
>> +	struct hfi_capability cap_width;
>> +	struct hfi_capability cap_height;
>> +	struct hfi_capability cap_mbs_per_frame;
>> +	struct hfi_capability cap_mbs_per_sec;
>> +	struct hfi_capability cap_framerate;
>> +	struct hfi_capability cap_scale_x;
>> +	struct hfi_capability cap_scale_y;
>> +	struct hfi_capability cap_bitrate;
>> +	struct hfi_capability cap_hier_p;
>> +	struct hfi_capability cap_ltr_count;
>> +	struct hfi_capability cap_secure_output2_threshold;
>> +	bool cap_bufs_mode_static;
>> +	bool cap_bufs_mode_dynamic;
>> +	unsigned int pl_count;
>> +	struct hfi_profile_level pl[HFI_MAX_PROFILE_COUNT];
>> +	struct hfi_buffer_requirements bufreq[HFI_BUFFER_TYPE_MAX];
>
> Just a suggestion: this might work better if you split it in groups of
> related fields with a comment above each group that gives an indication
> of what it is for. It's a solid block of fields right now and I think
> it can be made a bit easier to read that way.
>

I agree, it will look better. Will try to restructure it.

<snip>

>> +
>> +int helper_vb2_buf_prepare(struct vb2_buffer *vb)
>> +{
>> +	struct venus_inst *inst = vb2_get_drv_priv(vb->vb2_queue);
>> +
>> +	if (vb->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE &&
>> +	    vb2_plane_size(vb, 0) < inst->output_buf_size)
>> +		return -EINVAL;
>> +	else if (vb2_plane_size(vb, 0) < inst->input_buf_size)
>
> This logic can't be right: if type == CAPTURE and the plane_size
>> = output_buf_size, then it will fall into the 'else' and check
> the same plane_size against the input_buf_size, which is clearly
> wrong for a CAPTURE buffer.

Obviously this is wrong, will correct.

<snip>

-- 
regards,
Stan

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web