mbox series

[v8,00/10] Qualcomm video decoder/encoder driver

Message ID 1493370837-19793-1-git-send-email-stanimir.varbanov@linaro.org
Headers show
Series Qualcomm video decoder/encoder driver | expand

Message

Stanimir Varbanov April 28, 2017, 9:13 a.m. UTC
Hi everyone,

The changes since v7 are:
  * fixed error path in recovery handler.
  * fixed the logic in helper_vb2_buf_prepare.
  * added comments over venus_format arrays why MPLANE formats are used.
  * added sequence for output queue as well.
  * added COMPILE_TEST Kconfig option for the venus driver. To make
  compile testing of the venus driver possible I had to create a patch
  01/10 which fixing the qcom SCM driver.

I have made various fixes and improvements of the decoder and encoder
to make them work on Venus hw versions 1xx & 3xx (Venus hw v.1xx is found
on SoC apq8016 / db410c SBC board, and Venus hw v.3xx on apq8096).
A brief of the changes:
  * implemented buffer reference handling. This is adding delayed process
  of the newly queued buffers until the firmware release them completely.
  With this in place now vidioc_create_bufs op works properly.
  * implemented vidioc_try_decoder_cmd and vidioc_decoder_cmd v4l2 ioctl
  ops.
  * cleanups and run checkpatch --strict

The patchset is based on next-20170426 and applies cleanly on media_tree
as well.

The report of v4l2-compliance is below patchset diff status.

regards,
Stan
  
Stanimir Varbanov (10):
  firmware: qcom_scm: Fix to allow COMPILE_TEST-ing
  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/firmware/Kconfig                           |    2 +-
 drivers/firmware/qcom_scm.h                        |   72 +-
 drivers/media/platform/Kconfig                     |   13 +
 drivers/media/platform/Makefile                    |    2 +
 drivers/media/platform/qcom/venus/Makefile         |   11 +
 drivers/media/platform/qcom/venus/core.c           |  388 +++++
 drivers/media/platform/qcom/venus/core.h           |  323 ++++
 drivers/media/platform/qcom/venus/firmware.c       |  107 ++
 drivers/media/platform/qcom/venus/firmware.h       |   22 +
 drivers/media/platform/qcom/venus/helpers.c        |  725 +++++++++
 drivers/media/platform/qcom/venus/helpers.h        |   44 +
 drivers/media/platform/qcom/venus/hfi.c            |  522 +++++++
 drivers/media/platform/qcom/venus/hfi.h            |  175 +++
 drivers/media/platform/qcom/venus/hfi_cmds.c       | 1255 ++++++++++++++++
 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       | 1056 +++++++++++++
 drivers/media/platform/qcom/venus/hfi_msgs.h       |  283 ++++
 drivers/media/platform/qcom/venus/hfi_venus.c      | 1571 ++++++++++++++++++++
 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           | 1152 ++++++++++++++
 drivers/media/platform/qcom/venus/vdec.h           |   23 +
 drivers/media/platform/qcom/venus/vdec_ctrls.c     |  149 ++
 drivers/media/platform/qcom/venus/venc.c           | 1281 ++++++++++++++++
 drivers/media/platform/qcom/venus/venc.h           |   23 +
 drivers/media/platform/qcom/venus/venc_ctrls.c     |  269 ++++
 drivers/media/v4l2-core/v4l2-mem2mem.c             |   37 +
 include/linux/qcom_scm.h                           |   32 -
 include/media/v4l2-mem2mem.h                       |   92 ++
 32 files changed, 11190 insertions(+), 44 deletions(-)
 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

dragonboard-410c:~$ ./v4l2-compliance -d /dev/video0
v4l2-compliance SHA   : 8fc88615b49843acb82cd8316d0bc4ab8474cba2

Driver Info:
        Driver name   : qcom-venus
        Card type     : Qualcomm Venus video decoder
        Bus info      : platform:qcom-venus
        Driver version: 4.9.0
        Capabilities  : 0x84204000
                Video Memory-to-Memory Multiplanar
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps   : 0x04204000
                Video Memory-to-Memory Multiplanar
                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
                test VIDIOC_QUERYCTRL: OK
                test VIDIOC_G/S_CTRL: OK
                test VIDIOC_G/S/TRY_EXT_CTRLS: OK
                test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
                test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
                Standard Controls: 7 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
                test VIDIOC_TRY_FMT: OK
                test VIDIOC_S_FMT: OK
                test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
                test Cropping: OK (Not Supported)
                test Composing: OK (Not Supported)
                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: 43, Failed: 0, Warnings: 0



dragonboard-410c:~$ ./v4l2-compliance -d /dev/video1
v4l2-compliance SHA   : 8fc88615b49843acb82cd8316d0bc4ab8474cba2

Driver Info:
        Driver name   : qcom-venus
        Card type     : Qualcomm Venus video encoder
        Bus info      : platform:qcom-venus
        Driver version: 4.9.0
        Capabilities  : 0x84204000
                Video Memory-to-Memory Multiplanar
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps   : 0x04204000
                Video Memory-to-Memory Multiplanar
                Streaming
                Extended Pix Format

Compliance test for device /dev/video1 (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
                test VIDIOC_QUERYCTRL: OK
                test VIDIOC_G/S_CTRL: OK
                test VIDIOC_G/S/TRY_EXT_CTRLS: OK
                test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
                test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
                Standard Controls: 28 Private Controls: 0

        Format ioctls:
                test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
                test VIDIOC_G/S_PARM: OK
                test VIDIOC_G_FBUF: OK (Not Supported)
                test VIDIOC_G_FMT: OK
                test VIDIOC_TRY_FMT: OK
                test VIDIOC_S_FMT: OK
                test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
                test Cropping: OK
                test Composing: OK (Not Supported)
                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 (Not Supported)

        Buffer ioctls:
                test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
                test VIDIOC_EXPBUF: OK

Test input 0:


Total: 43, Succeeded: 43, Failed: 0, Warnings: 0
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Bjorn Andersson May 2, 2017, 7:22 p.m. UTC | #1
On Fri 28 Apr 02:13 PDT 2017, Stanimir Varbanov wrote:

> Unfortunatly previous attempt to allow consumer drivers to

> use COMPILE_TEST option in Kconfig is not enough, because in the

> past the consumer drivers used 'depends on' Kconfig option but

> now they are using 'select' Kconfig option which means on non ARM

> arch'es compilation is triggered. Thus we need to move the ifdefery

> one level below by touching the private qcom_scm.h header.

> 

> To: Andy Gross <andy.gross@linaro.org>


"To" should not be listed in the commit message and "Cc" means that you
really do expect Stephen and myself to say something - i.e. it's not the
same as To and Cc in the email header.

> Cc: Stephen Boyd <sboyd@codeaurora.org>

> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>

> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

> ---

>  drivers/firmware/Kconfig    |  2 +-

>  drivers/firmware/qcom_scm.h | 72 ++++++++++++++++++++++++++++++++++++++-------

>  include/linux/qcom_scm.h    | 32 --------------------

>  3 files changed, 62 insertions(+), 44 deletions(-)

> 

> diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig

> index 6e4ed5a9c6fd..480578c3691a 100644

> --- a/drivers/firmware/Kconfig

> +++ b/drivers/firmware/Kconfig

> @@ -204,7 +204,7 @@ config FW_CFG_SYSFS_CMDLINE

>  

>  config QCOM_SCM

>  	bool

> -	depends on ARM || ARM64

> +	depends on ARM || ARM64 || COMPILE_TEST

>  	select RESET_CONTROLLER

>  

>  config QCOM_SCM_32

> diff --git a/drivers/firmware/qcom_scm.h b/drivers/firmware/qcom_scm.h

> index 9bea691f30fb..d2b5723afb3f 100644

> --- a/drivers/firmware/qcom_scm.h

> +++ b/drivers/firmware/qcom_scm.h

> @@ -12,6 +12,7 @@

>  #ifndef __QCOM_SCM_INT_H

>  #define __QCOM_SCM_INT_H

>  

> +#if IS_ENABLED(CONFIG_ARM) || IS_ENABLED(CONFIG_ARM64)

>  #define QCOM_SCM_SVC_BOOT		0x1

>  #define QCOM_SCM_BOOT_ADDR		0x1

>  #define QCOM_SCM_BOOT_ADDR_MC		0x11

> @@ -58,6 +59,66 @@ extern int  __qcom_scm_pas_auth_and_reset(struct device *dev, u32 peripheral);

>  extern int  __qcom_scm_pas_shutdown(struct device *dev, u32 peripheral);

>  extern int  __qcom_scm_pas_mss_reset(struct device *dev, bool reset);

>  

> +#define QCOM_SCM_SVC_MP			0xc

> +#define QCOM_SCM_RESTORE_SEC_CFG	2

> +extern int __qcom_scm_restore_sec_cfg(struct device *dev, u32 device_id,

> +				      u32 spare);

> +#define QCOM_SCM_IOMMU_SECURE_PTBL_SIZE	3

> +#define QCOM_SCM_IOMMU_SECURE_PTBL_INIT	4


Don't you need these constants in the COMPILE_TEST case?

> +extern int __qcom_scm_iommu_secure_ptbl_size(struct device *dev, u32 spare,

> +					     size_t *size);

> +extern int __qcom_scm_iommu_secure_ptbl_init(struct device *dev, u64 addr,

> +					     u32 size, u32 spare);

> +#else

> +static inline int __qcom_scm_set_remote_state(struct device *dev, u32 state,

> +					      u32 id)

> +{ return -ENODEV; }


Please space this out over 3 lines with proper indentation.

> +static inline int __qcom_scm_set_warm_boot_addr(struct device *dev, void *entry,

> +						const cpumask_t *cpus)

> +{ return -ENODEV; }

> +static inline int __qcom_scm_set_cold_boot_addr(void *entry,

> +						const cpumask_t *cpus)

> +{ return -ENODEV; }

> +static inline void __qcom_scm_cpu_power_down(u32 flags) {}

> +static inline int __qcom_scm_is_call_available(struct device *dev, u32 svc_id,

> +					       u32 cmd_id)

> +{ return -ENODEV; }

> +#define QCOM_SCM_SVC_HDCP		0x11

> +#define QCOM_SCM_CMD_HDCP		0x01

> +static inline int __qcom_scm_hdcp_req(struct device *dev,

> +				      struct qcom_scm_hdcp_req *req,

> +				      u32 req_cnt, u32 *resp)

> +{ return -ENODEV; }

> +static inline void __qcom_scm_init(void) {}

> +#define QCOM_SCM_SVC_PIL		0x2

> +#define QCOM_SCM_PAS_IS_SUPPORTED_CMD	0x7


Do we only need 4 service-related defines in the COMPILE_TEST case?


I don't think we want to duplicate all the defines, so please prepend a
separate patch grouping them at the top.

Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hans Verkuil May 5, 2017, 11:34 a.m. UTC | #2
On 04/28/17 11:13, Stanimir Varbanov wrote:
> Unfortunatly previous attempt to allow consumer drivers to

> use COMPILE_TEST option in Kconfig is not enough, because in the

> past the consumer drivers used 'depends on' Kconfig option but

> now they are using 'select' Kconfig option which means on non ARM

> arch'es compilation is triggered. Thus we need to move the ifdefery

> one level below by touching the private qcom_scm.h header.

> 

> To: Andy Gross <andy.gross@linaro.org>

> Cc: Stephen Boyd <sboyd@codeaurora.org>

> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>

> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

> ---

>  drivers/firmware/Kconfig    |  2 +-

>  drivers/firmware/qcom_scm.h | 72 ++++++++++++++++++++++++++++++++++++++-------

>  include/linux/qcom_scm.h    | 32 --------------------

>  3 files changed, 62 insertions(+), 44 deletions(-)

> 

> diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig

> index 6e4ed5a9c6fd..480578c3691a 100644

> --- a/drivers/firmware/Kconfig

> +++ b/drivers/firmware/Kconfig

> @@ -204,7 +204,7 @@ config FW_CFG_SYSFS_CMDLINE

>  

>  config QCOM_SCM

>  	bool

> -	depends on ARM || ARM64

> +	depends on ARM || ARM64 || COMPILE_TEST

>  	select RESET_CONTROLLER

>  

>  config QCOM_SCM_32

> diff --git a/drivers/firmware/qcom_scm.h b/drivers/firmware/qcom_scm.h

> index 9bea691f30fb..d2b5723afb3f 100644

> --- a/drivers/firmware/qcom_scm.h

> +++ b/drivers/firmware/qcom_scm.h

> @@ -12,6 +12,7 @@

>  #ifndef __QCOM_SCM_INT_H

>  #define __QCOM_SCM_INT_H

>  

> +#if IS_ENABLED(CONFIG_ARM) || IS_ENABLED(CONFIG_ARM64)


This is weird. Shouldn't this be:

#if IS_ENABLED(CONFIG_QCOM_SCM)

If the code in the actual source only works for ARM, then that should be
handled in that source code, and not in this header IMHO.

Regards,

	Hans

>  #define QCOM_SCM_SVC_BOOT		0x1

>  #define QCOM_SCM_BOOT_ADDR		0x1

>  #define QCOM_SCM_BOOT_ADDR_MC		0x11

> @@ -58,6 +59,66 @@ extern int  __qcom_scm_pas_auth_and_reset(struct device *dev, u32 peripheral);

>  extern int  __qcom_scm_pas_shutdown(struct device *dev, u32 peripheral);

>  extern int  __qcom_scm_pas_mss_reset(struct device *dev, bool reset);

>  

> +#define QCOM_SCM_SVC_MP			0xc

> +#define QCOM_SCM_RESTORE_SEC_CFG	2

> +extern int __qcom_scm_restore_sec_cfg(struct device *dev, u32 device_id,

> +				      u32 spare);

> +#define QCOM_SCM_IOMMU_SECURE_PTBL_SIZE	3

> +#define QCOM_SCM_IOMMU_SECURE_PTBL_INIT	4

> +extern int __qcom_scm_iommu_secure_ptbl_size(struct device *dev, u32 spare,

> +					     size_t *size);

> +extern int __qcom_scm_iommu_secure_ptbl_init(struct device *dev, u64 addr,

> +					     u32 size, u32 spare);

> +#else

> +static inline int __qcom_scm_set_remote_state(struct device *dev, u32 state,

> +					      u32 id)

> +{ return -ENODEV; }

> +static inline int __qcom_scm_set_warm_boot_addr(struct device *dev, void *entry,

> +						const cpumask_t *cpus)

> +{ return -ENODEV; }

> +static inline int __qcom_scm_set_cold_boot_addr(void *entry,

> +						const cpumask_t *cpus)

> +{ return -ENODEV; }

> +static inline void __qcom_scm_cpu_power_down(u32 flags) {}

> +static inline int __qcom_scm_is_call_available(struct device *dev, u32 svc_id,

> +					       u32 cmd_id)

> +{ return -ENODEV; }

> +#define QCOM_SCM_SVC_HDCP		0x11

> +#define QCOM_SCM_CMD_HDCP		0x01

> +static inline int __qcom_scm_hdcp_req(struct device *dev,

> +				      struct qcom_scm_hdcp_req *req,

> +				      u32 req_cnt, u32 *resp)

> +{ return -ENODEV; }

> +static inline void __qcom_scm_init(void) {}

> +#define QCOM_SCM_SVC_PIL		0x2

> +#define QCOM_SCM_PAS_IS_SUPPORTED_CMD	0x7

> +static inline bool __qcom_scm_pas_supported(struct device *dev, u32 peripheral)

> +{ return false; }

> +static inline int  __qcom_scm_pas_init_image(struct device *dev, u32 peripheral,

> +					     dma_addr_t metadata_phys)

> +{ return -ENODEV; }

> +static inline int  __qcom_scm_pas_mem_setup(struct device *dev, u32 peripheral,

> +					    phys_addr_t addr, phys_addr_t size)

> +{ return -ENODEV; }

> +static inline int  __qcom_scm_pas_auth_and_reset(struct device *dev,

> +						 u32 peripheral)

> +{ return -ENODEV; }

> +static inline int  __qcom_scm_pas_shutdown(struct device *dev, u32 peripheral)

> +{ return -ENODEV; }

> +static inline int  __qcom_scm_pas_mss_reset(struct device *dev, bool reset)

> +{ return -ENODEV; }

> +static inline int __qcom_scm_restore_sec_cfg(struct device *dev, u32 device_id,

> +					     u32 spare)

> +{ return -ENODEV; }

> +extern int __qcom_scm_iommu_secure_ptbl_size(struct device *dev, u32 spare,

> +					     size_t *size)

> +{ return -ENODEV; }

> +static inline int __qcom_scm_iommu_secure_ptbl_init(struct device *dev,

> +						    u64 addr, u32 size,

> +						    u32 spare)

> +{ return -ENODEV; }

> +#endif

> +

>  /* common error codes */

>  #define QCOM_SCM_V2_EBUSY	-12

>  #define QCOM_SCM_ENOMEM		-5

> @@ -85,15 +146,4 @@ static inline int qcom_scm_remap_error(int err)

>  	return -EINVAL;

>  }

>  

> -#define QCOM_SCM_SVC_MP			0xc

> -#define QCOM_SCM_RESTORE_SEC_CFG	2

> -extern int __qcom_scm_restore_sec_cfg(struct device *dev, u32 device_id,

> -				      u32 spare);

> -#define QCOM_SCM_IOMMU_SECURE_PTBL_SIZE	3

> -#define QCOM_SCM_IOMMU_SECURE_PTBL_INIT	4

> -extern int __qcom_scm_iommu_secure_ptbl_size(struct device *dev, u32 spare,

> -					     size_t *size);

> -extern int __qcom_scm_iommu_secure_ptbl_init(struct device *dev, u64 addr,

> -					     u32 size, u32 spare);

> -

>  #endif

> diff --git a/include/linux/qcom_scm.h b/include/linux/qcom_scm.h

> index e5380471c2cd..b628f735f355 100644

> --- a/include/linux/qcom_scm.h

> +++ b/include/linux/qcom_scm.h

> @@ -23,7 +23,6 @@ struct qcom_scm_hdcp_req {

>  	u32 val;

>  };

>  

> -#if IS_ENABLED(CONFIG_QCOM_SCM)

>  extern int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus);

>  extern int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus);

>  extern bool qcom_scm_is_available(void);

> @@ -43,35 +42,4 @@ extern int qcom_scm_set_remote_state(u32 state, u32 id);

>  extern int qcom_scm_restore_sec_cfg(u32 device_id, u32 spare);

>  extern int qcom_scm_iommu_secure_ptbl_size(u32 spare, size_t *size);

>  extern int qcom_scm_iommu_secure_ptbl_init(u64 addr, u32 size, u32 spare);

> -#else

> -static inline

> -int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus)

> -{

> -	return -ENODEV;

> -}

> -static inline

> -int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus)

> -{

> -	return -ENODEV;

> -}

> -static inline bool qcom_scm_is_available(void) { return false; }

> -static inline bool qcom_scm_hdcp_available(void) { return false; }

> -static inline int qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt,

> -				    u32 *resp) { return -ENODEV; }

> -static inline bool qcom_scm_pas_supported(u32 peripheral) { return false; }

> -static inline int qcom_scm_pas_init_image(u32 peripheral, const void *metadata,

> -					  size_t size) { return -ENODEV; }

> -static inline int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr,

> -					 phys_addr_t size) { return -ENODEV; }

> -static inline int

> -qcom_scm_pas_auth_and_reset(u32 peripheral) { return -ENODEV; }

> -static inline int qcom_scm_pas_shutdown(u32 peripheral) { return -ENODEV; }

> -static inline void qcom_scm_cpu_power_down(u32 flags) {}

> -static inline u32 qcom_scm_get_version(void) { return 0; }

> -static inline u32

> -qcom_scm_set_remote_state(u32 state,u32 id) { return -ENODEV; }

> -static inline int qcom_scm_restore_sec_cfg(u32 device_id, u32 spare) { return -ENODEV; }

> -static inline int qcom_scm_iommu_secure_ptbl_size(u32 spare, size_t *size) { return -ENODEV; }

> -static inline int qcom_scm_iommu_secure_ptbl_init(u64 addr, u32 size, u32 spare) { return -ENODEV; }

> -#endif

>  #endif

> 


--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hans Verkuil May 5, 2017, 12:44 p.m. UTC | #3
Hi Stanimir,

It looks good to me. I do think that patch 01/10 shouldn't go through
media. This might mean that we have to drop the COMPILE_TEST dependency
on the media driver until this firmware driver patch gets merged, which
is fine with me as long as this is clearly stated in the commit log for
the media Kconfig. Let me know what you want to do with this.

I also saw some comments for patch 05/10, but I'm not sure if that would
block merging this driver or can be fixed afterwards.

Regards,

	Hans

On 04/28/17 11:13, Stanimir Varbanov wrote:
> Hi everyone,

> 

> The changes since v7 are:

>   * fixed error path in recovery handler.

>   * fixed the logic in helper_vb2_buf_prepare.

>   * added comments over venus_format arrays why MPLANE formats are used.

>   * added sequence for output queue as well.

>   * added COMPILE_TEST Kconfig option for the venus driver. To make

>   compile testing of the venus driver possible I had to create a patch

>   01/10 which fixing the qcom SCM driver.

> 

> I have made various fixes and improvements of the decoder and encoder

> to make them work on Venus hw versions 1xx & 3xx (Venus hw v.1xx is found

> on SoC apq8016 / db410c SBC board, and Venus hw v.3xx on apq8096).

> A brief of the changes:

>   * implemented buffer reference handling. This is adding delayed process

>   of the newly queued buffers until the firmware release them completely.

>   With this in place now vidioc_create_bufs op works properly.

>   * implemented vidioc_try_decoder_cmd and vidioc_decoder_cmd v4l2 ioctl

>   ops.

>   * cleanups and run checkpatch --strict

> 

> The patchset is based on next-20170426 and applies cleanly on media_tree

> as well.

> 

> The report of v4l2-compliance is below patchset diff status.

> 

> regards,

> Stan

>   

> Stanimir Varbanov (10):

>   firmware: qcom_scm: Fix to allow COMPILE_TEST-ing

>   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/firmware/Kconfig                           |    2 +-

>  drivers/firmware/qcom_scm.h                        |   72 +-

>  drivers/media/platform/Kconfig                     |   13 +

>  drivers/media/platform/Makefile                    |    2 +

>  drivers/media/platform/qcom/venus/Makefile         |   11 +

>  drivers/media/platform/qcom/venus/core.c           |  388 +++++

>  drivers/media/platform/qcom/venus/core.h           |  323 ++++

>  drivers/media/platform/qcom/venus/firmware.c       |  107 ++

>  drivers/media/platform/qcom/venus/firmware.h       |   22 +

>  drivers/media/platform/qcom/venus/helpers.c        |  725 +++++++++

>  drivers/media/platform/qcom/venus/helpers.h        |   44 +

>  drivers/media/platform/qcom/venus/hfi.c            |  522 +++++++

>  drivers/media/platform/qcom/venus/hfi.h            |  175 +++

>  drivers/media/platform/qcom/venus/hfi_cmds.c       | 1255 ++++++++++++++++

>  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       | 1056 +++++++++++++

>  drivers/media/platform/qcom/venus/hfi_msgs.h       |  283 ++++

>  drivers/media/platform/qcom/venus/hfi_venus.c      | 1571 ++++++++++++++++++++

>  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           | 1152 ++++++++++++++

>  drivers/media/platform/qcom/venus/vdec.h           |   23 +

>  drivers/media/platform/qcom/venus/vdec_ctrls.c     |  149 ++

>  drivers/media/platform/qcom/venus/venc.c           | 1281 ++++++++++++++++

>  drivers/media/platform/qcom/venus/venc.h           |   23 +

>  drivers/media/platform/qcom/venus/venc_ctrls.c     |  269 ++++

>  drivers/media/v4l2-core/v4l2-mem2mem.c             |   37 +

>  include/linux/qcom_scm.h                           |   32 -

>  include/media/v4l2-mem2mem.h                       |   92 ++

>  32 files changed, 11190 insertions(+), 44 deletions(-)

>  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

> 

> dragonboard-410c:~$ ./v4l2-compliance -d /dev/video0

> v4l2-compliance SHA   : 8fc88615b49843acb82cd8316d0bc4ab8474cba2

> 

> Driver Info:

>         Driver name   : qcom-venus

>         Card type     : Qualcomm Venus video decoder

>         Bus info      : platform:qcom-venus

>         Driver version: 4.9.0

>         Capabilities  : 0x84204000

>                 Video Memory-to-Memory Multiplanar

>                 Streaming

>                 Extended Pix Format

>                 Device Capabilities

>         Device Caps   : 0x04204000

>                 Video Memory-to-Memory Multiplanar

>                 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

>                 test VIDIOC_QUERYCTRL: OK

>                 test VIDIOC_G/S_CTRL: OK

>                 test VIDIOC_G/S/TRY_EXT_CTRLS: OK

>                 test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK

>                 test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)

>                 Standard Controls: 7 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

>                 test VIDIOC_TRY_FMT: OK

>                 test VIDIOC_S_FMT: OK

>                 test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)

>                 test Cropping: OK (Not Supported)

>                 test Composing: OK (Not Supported)

>                 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: 43, Failed: 0, Warnings: 0

> 

> 

> 

> dragonboard-410c:~$ ./v4l2-compliance -d /dev/video1

> v4l2-compliance SHA   : 8fc88615b49843acb82cd8316d0bc4ab8474cba2

> 

> Driver Info:

>         Driver name   : qcom-venus

>         Card type     : Qualcomm Venus video encoder

>         Bus info      : platform:qcom-venus

>         Driver version: 4.9.0

>         Capabilities  : 0x84204000

>                 Video Memory-to-Memory Multiplanar

>                 Streaming

>                 Extended Pix Format

>                 Device Capabilities

>         Device Caps   : 0x04204000

>                 Video Memory-to-Memory Multiplanar

>                 Streaming

>                 Extended Pix Format

> 

> Compliance test for device /dev/video1 (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

>                 test VIDIOC_QUERYCTRL: OK

>                 test VIDIOC_G/S_CTRL: OK

>                 test VIDIOC_G/S/TRY_EXT_CTRLS: OK

>                 test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK

>                 test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)

>                 Standard Controls: 28 Private Controls: 0

> 

>         Format ioctls:

>                 test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK

>                 test VIDIOC_G/S_PARM: OK

>                 test VIDIOC_G_FBUF: OK (Not Supported)

>                 test VIDIOC_G_FMT: OK

>                 test VIDIOC_TRY_FMT: OK

>                 test VIDIOC_S_FMT: OK

>                 test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)

>                 test Cropping: OK

>                 test Composing: OK (Not Supported)

>                 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 (Not Supported)

> 

>         Buffer ioctls:

>                 test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK

>                 test VIDIOC_EXPBUF: OK

> 

> Test input 0:

> 

> 

> Total: 43, Succeeded: 43, Failed: 0, Warnings: 0

>  

> 


--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Stanimir Varbanov May 5, 2017, 1:23 p.m. UTC | #4
Hi Hans,

On 05/05/2017 02:34 PM, Hans Verkuil wrote:
> On 04/28/17 11:13, Stanimir Varbanov wrote:

>> Unfortunatly previous attempt to allow consumer drivers to

>> use COMPILE_TEST option in Kconfig is not enough, because in the

>> past the consumer drivers used 'depends on' Kconfig option but

>> now they are using 'select' Kconfig option which means on non ARM

>> arch'es compilation is triggered. Thus we need to move the ifdefery

>> one level below by touching the private qcom_scm.h header.

>>

>> To: Andy Gross <andy.gross@linaro.org>

>> Cc: Stephen Boyd <sboyd@codeaurora.org>

>> Cc: Bjorn Andersson <bjorn.andersson@linaro.org>

>> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

>> ---

>>  drivers/firmware/Kconfig    |  2 +-

>>  drivers/firmware/qcom_scm.h | 72 ++++++++++++++++++++++++++++++++++++++-------

>>  include/linux/qcom_scm.h    | 32 --------------------

>>  3 files changed, 62 insertions(+), 44 deletions(-)

>>

>> diff --git a/drivers/firmware/Kconfig b/drivers/firmware/Kconfig

>> index 6e4ed5a9c6fd..480578c3691a 100644

>> --- a/drivers/firmware/Kconfig

>> +++ b/drivers/firmware/Kconfig

>> @@ -204,7 +204,7 @@ config FW_CFG_SYSFS_CMDLINE

>>  

>>  config QCOM_SCM

>>  	bool

>> -	depends on ARM || ARM64

>> +	depends on ARM || ARM64 || COMPILE_TEST

>>  	select RESET_CONTROLLER

>>  

>>  config QCOM_SCM_32

>> diff --git a/drivers/firmware/qcom_scm.h b/drivers/firmware/qcom_scm.h

>> index 9bea691f30fb..d2b5723afb3f 100644

>> --- a/drivers/firmware/qcom_scm.h

>> +++ b/drivers/firmware/qcom_scm.h

>> @@ -12,6 +12,7 @@

>>  #ifndef __QCOM_SCM_INT_H

>>  #define __QCOM_SCM_INT_H

>>  

>> +#if IS_ENABLED(CONFIG_ARM) || IS_ENABLED(CONFIG_ARM64)

> 

> This is weird. Shouldn't this be:

> 

> #if IS_ENABLED(CONFIG_QCOM_SCM)


I think no, because if you take a look in the above hunk which adding
COMPILE_TEST in the QCOM_SCM config the CONFIG_QCOM_SCM will be enabled
if compile testing is selected for example on x86 build target.

> 

> If the code in the actual source only works for ARM, then that should be

> handled in that source code, and not in this header IMHO.


Do you mean adding #ifdef in the source file? IMO this will become a
bigger mess.

> 

> Regards,

> 

> 	Hans

> 

>>  #define QCOM_SCM_SVC_BOOT		0x1

>>  #define QCOM_SCM_BOOT_ADDR		0x1

>>  #define QCOM_SCM_BOOT_ADDR_MC		0x11

>> @@ -58,6 +59,66 @@ extern int  __qcom_scm_pas_auth_and_reset(struct device *dev, u32 peripheral);

>>  extern int  __qcom_scm_pas_shutdown(struct device *dev, u32 peripheral);

>>  extern int  __qcom_scm_pas_mss_reset(struct device *dev, bool reset);

>>  

>> +#define QCOM_SCM_SVC_MP			0xc

>> +#define QCOM_SCM_RESTORE_SEC_CFG	2

>> +extern int __qcom_scm_restore_sec_cfg(struct device *dev, u32 device_id,

>> +				      u32 spare);

>> +#define QCOM_SCM_IOMMU_SECURE_PTBL_SIZE	3

>> +#define QCOM_SCM_IOMMU_SECURE_PTBL_INIT	4

>> +extern int __qcom_scm_iommu_secure_ptbl_size(struct device *dev, u32 spare,

>> +					     size_t *size);

>> +extern int __qcom_scm_iommu_secure_ptbl_init(struct device *dev, u64 addr,

>> +					     u32 size, u32 spare);

>> +#else

>> +static inline int __qcom_scm_set_remote_state(struct device *dev, u32 state,

>> +					      u32 id)

>> +{ return -ENODEV; }

>> +static inline int __qcom_scm_set_warm_boot_addr(struct device *dev, void *entry,

>> +						const cpumask_t *cpus)

>> +{ return -ENODEV; }

>> +static inline int __qcom_scm_set_cold_boot_addr(void *entry,

>> +						const cpumask_t *cpus)

>> +{ return -ENODEV; }

>> +static inline void __qcom_scm_cpu_power_down(u32 flags) {}

>> +static inline int __qcom_scm_is_call_available(struct device *dev, u32 svc_id,

>> +					       u32 cmd_id)

>> +{ return -ENODEV; }

>> +#define QCOM_SCM_SVC_HDCP		0x11

>> +#define QCOM_SCM_CMD_HDCP		0x01

>> +static inline int __qcom_scm_hdcp_req(struct device *dev,

>> +				      struct qcom_scm_hdcp_req *req,

>> +				      u32 req_cnt, u32 *resp)

>> +{ return -ENODEV; }

>> +static inline void __qcom_scm_init(void) {}

>> +#define QCOM_SCM_SVC_PIL		0x2

>> +#define QCOM_SCM_PAS_IS_SUPPORTED_CMD	0x7

>> +static inline bool __qcom_scm_pas_supported(struct device *dev, u32 peripheral)

>> +{ return false; }

>> +static inline int  __qcom_scm_pas_init_image(struct device *dev, u32 peripheral,

>> +					     dma_addr_t metadata_phys)

>> +{ return -ENODEV; }

>> +static inline int  __qcom_scm_pas_mem_setup(struct device *dev, u32 peripheral,

>> +					    phys_addr_t addr, phys_addr_t size)

>> +{ return -ENODEV; }

>> +static inline int  __qcom_scm_pas_auth_and_reset(struct device *dev,

>> +						 u32 peripheral)

>> +{ return -ENODEV; }

>> +static inline int  __qcom_scm_pas_shutdown(struct device *dev, u32 peripheral)

>> +{ return -ENODEV; }

>> +static inline int  __qcom_scm_pas_mss_reset(struct device *dev, bool reset)

>> +{ return -ENODEV; }

>> +static inline int __qcom_scm_restore_sec_cfg(struct device *dev, u32 device_id,

>> +					     u32 spare)

>> +{ return -ENODEV; }

>> +extern int __qcom_scm_iommu_secure_ptbl_size(struct device *dev, u32 spare,

>> +					     size_t *size)

>> +{ return -ENODEV; }

>> +static inline int __qcom_scm_iommu_secure_ptbl_init(struct device *dev,

>> +						    u64 addr, u32 size,

>> +						    u32 spare)

>> +{ return -ENODEV; }

>> +#endif

>> +

>>  /* common error codes */

>>  #define QCOM_SCM_V2_EBUSY	-12

>>  #define QCOM_SCM_ENOMEM		-5

>> @@ -85,15 +146,4 @@ static inline int qcom_scm_remap_error(int err)

>>  	return -EINVAL;

>>  }

>>  

>> -#define QCOM_SCM_SVC_MP			0xc

>> -#define QCOM_SCM_RESTORE_SEC_CFG	2

>> -extern int __qcom_scm_restore_sec_cfg(struct device *dev, u32 device_id,

>> -				      u32 spare);

>> -#define QCOM_SCM_IOMMU_SECURE_PTBL_SIZE	3

>> -#define QCOM_SCM_IOMMU_SECURE_PTBL_INIT	4

>> -extern int __qcom_scm_iommu_secure_ptbl_size(struct device *dev, u32 spare,

>> -					     size_t *size);

>> -extern int __qcom_scm_iommu_secure_ptbl_init(struct device *dev, u64 addr,

>> -					     u32 size, u32 spare);

>> -

>>  #endif

>> diff --git a/include/linux/qcom_scm.h b/include/linux/qcom_scm.h

>> index e5380471c2cd..b628f735f355 100644

>> --- a/include/linux/qcom_scm.h

>> +++ b/include/linux/qcom_scm.h

>> @@ -23,7 +23,6 @@ struct qcom_scm_hdcp_req {

>>  	u32 val;

>>  };

>>  

>> -#if IS_ENABLED(CONFIG_QCOM_SCM)

>>  extern int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus);

>>  extern int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus);

>>  extern bool qcom_scm_is_available(void);

>> @@ -43,35 +42,4 @@ extern int qcom_scm_set_remote_state(u32 state, u32 id);

>>  extern int qcom_scm_restore_sec_cfg(u32 device_id, u32 spare);

>>  extern int qcom_scm_iommu_secure_ptbl_size(u32 spare, size_t *size);

>>  extern int qcom_scm_iommu_secure_ptbl_init(u64 addr, u32 size, u32 spare);

>> -#else

>> -static inline

>> -int qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus)

>> -{

>> -	return -ENODEV;

>> -}

>> -static inline

>> -int qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus)

>> -{

>> -	return -ENODEV;

>> -}

>> -static inline bool qcom_scm_is_available(void) { return false; }

>> -static inline bool qcom_scm_hdcp_available(void) { return false; }

>> -static inline int qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt,

>> -				    u32 *resp) { return -ENODEV; }

>> -static inline bool qcom_scm_pas_supported(u32 peripheral) { return false; }

>> -static inline int qcom_scm_pas_init_image(u32 peripheral, const void *metadata,

>> -					  size_t size) { return -ENODEV; }

>> -static inline int qcom_scm_pas_mem_setup(u32 peripheral, phys_addr_t addr,

>> -					 phys_addr_t size) { return -ENODEV; }

>> -static inline int

>> -qcom_scm_pas_auth_and_reset(u32 peripheral) { return -ENODEV; }

>> -static inline int qcom_scm_pas_shutdown(u32 peripheral) { return -ENODEV; }

>> -static inline void qcom_scm_cpu_power_down(u32 flags) {}

>> -static inline u32 qcom_scm_get_version(void) { return 0; }

>> -static inline u32

>> -qcom_scm_set_remote_state(u32 state,u32 id) { return -ENODEV; }

>> -static inline int qcom_scm_restore_sec_cfg(u32 device_id, u32 spare) { return -ENODEV; }

>> -static inline int qcom_scm_iommu_secure_ptbl_size(u32 spare, size_t *size) { return -ENODEV; }

>> -static inline int qcom_scm_iommu_secure_ptbl_init(u64 addr, u32 size, u32 spare) { return -ENODEV; }

>> -#endif

>>  #endif

>>

> 

> --

> To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in

> the body of a message to majordomo@vger.kernel.org

> More majordomo info at  http://vger.kernel.org/majordomo-info.html

> 


-- 
regards,
Stan
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html