mbox series

[00/20] Add MFC v12 support.

Message ID 20220517125548.14746-1-smitha.t@samsung.com
Headers show
Series Add MFC v12 support. | expand

Message

Smitha T Murthy May 17, 2022, 12:55 p.m. UTC
This patch series adds MFC v12 support. MFC v12 is used in
Tesla FSD SoC.

This adds support for following:

* Add support for VP9 encoder
* Add support for YV12 and I420 format (3-plane)
* Add support for Rate Control, UHD and DMABUF for encoder
* Add support for DPB buffers allocation based on MFC requirement
* Fix to handle reference queue at MFCINST_FINISHING state.
* Fix to handle error scenario on CLOSE_INSTANCE command.
* Fix for register read and write for H264 codec encoding.
* Update Documentation for control id definitions

Smitha T Murthy (20):
  MAINTAINERS: Add git repo path for MFC
  dt-bindings: media: s5p-mfc: Convert s5p-mfc.txt to new DT schema
  dt-bindings: media: s5p-mfc: Add mfcv12 variant
  media: s5p-mfc: Rename IS_MFCV10 macro
  media: s5p-mfc: Add initial support for MFCv12
  Documention: v4l: Documentation for VP9 CIDs.
  media: v4l2: Add v4l2 control IDs for VP9 encoder.
  media: s5p-mfc: Add support for VP9 encoder.
  media: s5p-mfc: Add YV12 and I420 multiplanar format support
  media: s5p-mfc: Add support for rate controls in MFCv12
  media: s5p-mfc: Add support for UHD encoding.
  media: s5p-mfc: Add support for DMABUF for encoder
  media: s5p-mfc: Set context for valid case before calling try_run
  media: s5p-mfc: Load firmware for each run in MFCv12.
  media: s5p-mfc: DPB Count Independent of VIDIOC_REQBUF
  media: s5p-mfc: Fix to handle reference queue during finishing
  media: s5p-mfc: Clear workbit to handle error condition
  media: s5p-mfc: Correction in register read and write for H264
  arm64: dts: fsd: Add MFC related DT enteries
  arm64 defconfig: Add MFC in defconfig

 .../devicetree/bindings/media/s5p-mfc.txt     |  77 +--
 .../devicetree/bindings/media/s5p-mfc.yaml    |  99 ++++
 .../media/v4l/ext-ctrls-codec.rst             | 167 +++++++
 MAINTAINERS                                   |   1 +
 arch/arm64/boot/dts/tesla/fsd-evb.dts         |   8 +
 arch/arm64/boot/dts/tesla/fsd.dtsi            |  22 +
 arch/arm64/configs/defconfig                  |   4 +-
 .../platform/samsung/s5p-mfc/regs-mfc-v12.h   |  60 +++
 .../platform/samsung/s5p-mfc/regs-mfc-v7.h    |   1 +
 .../platform/samsung/s5p-mfc/regs-mfc-v8.h    |   3 +
 .../media/platform/samsung/s5p-mfc/s5p_mfc.c  |  36 +-
 .../platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c |   3 +
 .../platform/samsung/s5p-mfc/s5p_mfc_common.h |  48 +-
 .../platform/samsung/s5p-mfc/s5p_mfc_ctrl.c   |  13 +-
 .../platform/samsung/s5p-mfc/s5p_mfc_dec.c    |  51 +-
 .../platform/samsung/s5p-mfc/s5p_mfc_enc.c    | 417 ++++++++++++++--
 .../platform/samsung/s5p-mfc/s5p_mfc_opr.h    |  16 +-
 .../platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c |  12 +-
 .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 446 ++++++++++++++++--
 .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h |   3 +
 drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  44 ++
 include/uapi/linux/v4l2-controls.h            |  33 ++
 22 files changed, 1362 insertions(+), 202 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/media/s5p-mfc.yaml
 create mode 100644 drivers/media/platform/samsung/s5p-mfc/regs-mfc-v12.h


base-commit: 3ae87d2f25c0e998da2721ce332e2b80d3d53c39

Comments

Krzysztof Kozlowski May 17, 2022, 1:35 p.m. UTC | #1
On 17/05/2022 14:55, Smitha T Murthy wrote:
> Add git repo path for MFC.
> 
> Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
> ---
>  MAINTAINERS | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index fd768d43e048..e53c7333562b 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -2703,6 +2703,7 @@ M:	Andrzej Hajda <andrzej.hajda@intel.com>
>  L:	linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
>  L:	linux-media@vger.kernel.org
>  S:	Maintained
> +T:	git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media.git

This is not a MFC repo, but a repo of media drivers. There is no need to
add to every driver repo of the subsystem. It should be in subsystem
instead.


Best regards,
Krzysztof
Krzysztof Kozlowski May 17, 2022, 2:02 p.m. UTC | #2
On 17/05/2022 14:55, Smitha T Murthy wrote:
> Add MFC DT node and reserve memory node for MFC usage.
> 
> Cc: linux-fsd@tesla.com
> Signed-off-by: Smitha T Murthy <smitha.t@samsung.com>
> ---
>  arch/arm64/boot/dts/tesla/fsd-evb.dts |  8 ++++++++
>  arch/arm64/boot/dts/tesla/fsd.dtsi    | 22 ++++++++++++++++++++++
>  2 files changed, 30 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/tesla/fsd-evb.dts b/arch/arm64/boot/dts/tesla/fsd-evb.dts
> index 5af560c1b5e6..36f6b013ce99 100644
> --- a/arch/arm64/boot/dts/tesla/fsd-evb.dts
> +++ b/arch/arm64/boot/dts/tesla/fsd-evb.dts
> @@ -37,3 +37,11 @@
>  &serial_0 {
>  	status = "okay";
>  };
> +
> +&clock_mfc {
> +	status = "okay";
> +};
> +
> +&mfc_0 {
> +	status = "okay";
> +};

Labels are ordered by name.

> diff --git a/arch/arm64/boot/dts/tesla/fsd.dtsi b/arch/arm64/boot/dts/tesla/fsd.dtsi
> index 9a652abcbcac..434ae75421d8 100644
> --- a/arch/arm64/boot/dts/tesla/fsd.dtsi
> +++ b/arch/arm64/boot/dts/tesla/fsd.dtsi
> @@ -249,6 +249,18 @@
>  		#clock-cells = <0>;
>  	};
>  
> +	reserved-memory {
> +		#address-cells = <2>;
> +		#size-cells = <2>;
> +		ranges;
> +
> +		mfc_left: region@84000000 {
> +			compatible = "shared-dma-pool";
> +			no-map;
> +			reg = <0 0x84000000 0 0x8000000>;
> +		};
> +	};
> +
>  	soc: soc@0 {
>  		compatible = "simple-bus";
>  		#address-cells = <2>;
> @@ -748,6 +760,16 @@
>  			clocks = <&fin_pll>, <&clock_imem IMEM_MCT_PCLK>;
>  			clock-names = "fin_pll", "mct";
>  		};
> +
> +		mfc_0: mfc0@12880000 {

Generic node names, so mfc.

> +			compatible = "samsung,mfc-v12";
> +			reg = <0x0 0x12880000 0x0 0x10000>;
> +			interrupts = <GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>;
> +			clock-names = "mfc";
> +			clocks = <&clock_mfc MFC_MFC_IPCLKPORT_ACLK>;
> +			memory-region = <&mfc_left>;
> +			status = "disabled";

Why exactly this is disabled? Usually we disable nodes which needs
resources from the boards, but this is not the case here. Unless it is?

> +		};
>  	};
>  };
>  


Best regards,
Krzysztof
Hans Verkuil May 18, 2022, 9:42 a.m. UTC | #3
Hi Smitha,

On 5/17/22 14:55, Smitha T Murthy wrote:
> This patch series adds MFC v12 support. MFC v12 is used in
> Tesla FSD SoC.
> 
> This adds support for following:
> 
> * Add support for VP9 encoder
> * Add support for YV12 and I420 format (3-plane)
> * Add support for Rate Control, UHD and DMABUF for encoder
> * Add support for DPB buffers allocation based on MFC requirement
> * Fix to handle reference queue at MFCINST_FINISHING state.
> * Fix to handle error scenario on CLOSE_INSTANCE command.
> * Fix for register read and write for H264 codec encoding.
> * Update Documentation for control id definitions

Nice addition. Can you provide the v4l2-compliance output for this
driver? Make sure you build v4l2-compliance from the latest v4l-utils
git repo code.

Regards,

	Hans

> 
> Smitha T Murthy (20):
>   MAINTAINERS: Add git repo path for MFC
>   dt-bindings: media: s5p-mfc: Convert s5p-mfc.txt to new DT schema
>   dt-bindings: media: s5p-mfc: Add mfcv12 variant
>   media: s5p-mfc: Rename IS_MFCV10 macro
>   media: s5p-mfc: Add initial support for MFCv12
>   Documention: v4l: Documentation for VP9 CIDs.
>   media: v4l2: Add v4l2 control IDs for VP9 encoder.
>   media: s5p-mfc: Add support for VP9 encoder.
>   media: s5p-mfc: Add YV12 and I420 multiplanar format support
>   media: s5p-mfc: Add support for rate controls in MFCv12
>   media: s5p-mfc: Add support for UHD encoding.
>   media: s5p-mfc: Add support for DMABUF for encoder
>   media: s5p-mfc: Set context for valid case before calling try_run
>   media: s5p-mfc: Load firmware for each run in MFCv12.
>   media: s5p-mfc: DPB Count Independent of VIDIOC_REQBUF
>   media: s5p-mfc: Fix to handle reference queue during finishing
>   media: s5p-mfc: Clear workbit to handle error condition
>   media: s5p-mfc: Correction in register read and write for H264
>   arm64: dts: fsd: Add MFC related DT enteries
>   arm64 defconfig: Add MFC in defconfig
> 
>  .../devicetree/bindings/media/s5p-mfc.txt     |  77 +--
>  .../devicetree/bindings/media/s5p-mfc.yaml    |  99 ++++
>  .../media/v4l/ext-ctrls-codec.rst             | 167 +++++++
>  MAINTAINERS                                   |   1 +
>  arch/arm64/boot/dts/tesla/fsd-evb.dts         |   8 +
>  arch/arm64/boot/dts/tesla/fsd.dtsi            |  22 +
>  arch/arm64/configs/defconfig                  |   4 +-
>  .../platform/samsung/s5p-mfc/regs-mfc-v12.h   |  60 +++
>  .../platform/samsung/s5p-mfc/regs-mfc-v7.h    |   1 +
>  .../platform/samsung/s5p-mfc/regs-mfc-v8.h    |   3 +
>  .../media/platform/samsung/s5p-mfc/s5p_mfc.c  |  36 +-
>  .../platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c |   3 +
>  .../platform/samsung/s5p-mfc/s5p_mfc_common.h |  48 +-
>  .../platform/samsung/s5p-mfc/s5p_mfc_ctrl.c   |  13 +-
>  .../platform/samsung/s5p-mfc/s5p_mfc_dec.c    |  51 +-
>  .../platform/samsung/s5p-mfc/s5p_mfc_enc.c    | 417 ++++++++++++++--
>  .../platform/samsung/s5p-mfc/s5p_mfc_opr.h    |  16 +-
>  .../platform/samsung/s5p-mfc/s5p_mfc_opr_v5.c |  12 +-
>  .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 446 ++++++++++++++++--
>  .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.h |   3 +
>  drivers/media/v4l2-core/v4l2-ctrls-defs.c     |  44 ++
>  include/uapi/linux/v4l2-controls.h            |  33 ++
>  22 files changed, 1362 insertions(+), 202 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/media/s5p-mfc.yaml
>  create mode 100644 drivers/media/platform/samsung/s5p-mfc/regs-mfc-v12.h
> 
> 
> base-commit: 3ae87d2f25c0e998da2721ce332e2b80d3d53c39