OSDN Git Service

uclinux-h8/linux.git
3 years agomedia: videobuf2: Exit promptly if size = 0
Ricardo Ribalda [Tue, 9 Mar 2021 20:51:08 +0000 (21:51 +0100)]
media: videobuf2: Exit promptly if size = 0

Exit as soon as possible if a driver wants to allocate a buffer of
size 0, and print a warning to help fixing the issue.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l2-ctrls: Fix h264 hierarchical coding type menu ctrl
Stanimir Varbanov [Tue, 2 Mar 2021 22:42:06 +0000 (23:42 +0100)]
media: v4l2-ctrls: Fix h264 hierarchical coding type menu ctrl

Add a name of the menu and fill control type.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: i2c: adv7842: remove open coded version of SMBus block write
Wolfram Sang [Tue, 19 Jan 2021 09:39:08 +0000 (10:39 +0100)]
media: i2c: adv7842: remove open coded version of SMBus block write

The version here is identical to the one in the I2C core, so use the
latter version directly.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: mtk-vpu/mtk_vpu.h: fix kernel-doc warnings
Hans Verkuil [Thu, 11 Mar 2021 10:20:22 +0000 (11:20 +0100)]
media: mtk-vpu/mtk_vpu.h: fix kernel-doc warnings

A top-level documentation block was missing 'DOC:'.

Fix typos in vpu_wdt_reg_handler() and vpu_mapping_dm_addr().

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Irui Wang <irui.wang@mediatek.com>
Cc: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: mtk-vcodec: fix kernel-doc warnings
Hans Verkuil [Thu, 11 Mar 2021 10:20:21 +0000 (11:20 +0100)]
media: mtk-vcodec: fix kernel-doc warnings

mtk_vcodec_drv.h:
It's '@var:', not '@var - '.
In two places 'struct' was used instead of 'enum'.

vdec_drv_if.h:
It's '@var:', not '@var :'.
In one place 'struct' was used instead of 'enum'.

venc_ipi_msg.h:
It's '@data:', not '@data[8]:', i.e. arrays do not include the
size in kernel-doc.
It's '@var:', not 'var:'.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Alexandre Courbot <acourbot@chromium.org>
Cc: Tiffany Lin <tiffany.lin@mediatek.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: mtk-mdp: fix kernel-doc warnings
Hans Verkuil [Thu, 11 Mar 2021 10:20:20 +0000 (11:20 +0100)]
media: mtk-mdp: fix kernel-doc warnings

mtk_mdp_comp.h: MTK_MDP_COMP_TYPE_MAX was undocumented, but it
is also unused, so just remove it.

mtk_mdp_core.h: add missing '*' inside comment blocks, add a
missing : after '@ctrls' and add a missing struct keyword.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Eizan Miyamoto <eizan@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: mtk-jpeg/mtk_jpeg_core.h: fix kernel-doc warnings
Hans Verkuil [Thu, 11 Mar 2021 10:20:19 +0000 (11:20 +0100)]
media: mtk-jpeg/mtk_jpeg_core.h: fix kernel-doc warnings

Add missing 'struct' keywords and fix typos in two struct member
names.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Xia Jiang <xia.jiang@mediatek.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: meson: vdec: fix kernel-doc warning
Hans Verkuil [Thu, 11 Mar 2021 10:20:18 +0000 (11:20 +0100)]
media: staging: media: meson: vdec: fix kernel-doc warning

One comment used /** instead of /*, so it caused kernel-doc
warnings. Just turn it into a regular comment.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: ipu3: add missing kernel-doc 'struct' keywords
Hans Verkuil [Thu, 11 Mar 2021 10:20:17 +0000 (11:20 +0100)]
media: staging: media: ipu3: add missing kernel-doc 'struct' keywords

Two structs where missing the kernel-doc 'struct' keyword
in their kernel-doc documentation.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: staging: media: hantro: fix kernel-doc formatting
Hans Verkuil [Thu, 11 Mar 2021 10:20:16 +0000 (11:20 +0100)]
media: staging: media: hantro: fix kernel-doc formatting

- @h264_dec was not documented, add that trivial change
- it is not possible to document a global variable in kernel-doc,
  change to use 'DOC:' instead
- fix mismatched struct name (hantro_vp8d_hw_ctx -> hantro_vp8_dec_hw_ctx)

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: vsp1/vsp1_drm.h: add missing 'struct' kernel-doc keyword
Hans Verkuil [Thu, 11 Mar 2021 10:20:15 +0000 (11:20 +0100)]
media: vsp1/vsp1_drm.h: add missing 'struct' kernel-doc keyword

The kernel-doc documentation for two structs was missing the
'struct' keyword.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/platform/sti: fix kernel-doc formatting
Hans Verkuil [Thu, 11 Mar 2021 10:20:14 +0000 (11:20 +0100)]
media: media/platform/sti: fix kernel-doc formatting

bdisp/bdisp-filter.h: coef: -> @coef:  (missing @)
c8sectpfe/c8sectpfe-debugfs.h: /** -> /* (wasn't a kernel-doc comment)
sti/hva/hva.h: @v4l2: -> @vbuf:  (wrong name)

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Jean-Christophe Trotin <jean-christophe.trotin@st.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: rcar-vin/rcar-vin.h: fix kernel-doc formatting
Hans Verkuil [Thu, 11 Mar 2021 10:20:13 +0000 (11:20 +0100)]
media: rcar-vin/rcar-vin.h: fix kernel-doc formatting

Fix formatting of two enums and one struct.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ti-vpe/cal.h: fix kernel-doc formatting
Hans Verkuil [Thu, 11 Mar 2021 10:20:12 +0000 (11:20 +0100)]
media: ti-vpe/cal.h: fix kernel-doc formatting

Fix inline struct member documentation, was missing the
'@memb:' prefix.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: s5p-jpeg: fix kernel-doc warnings
Hans Verkuil [Thu, 11 Mar 2021 10:20:11 +0000 (11:20 +0100)]
media: s5p-jpeg: fix kernel-doc warnings

- added missing 'struct' kernel-doc keywords
- add missing '*' in kernel-doc comment blocks

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: exynos-gsc/exynos4-is: add missing 'struct' to kerneldoc
Hans Verkuil [Thu, 11 Mar 2021 10:20:10 +0000 (11:20 +0100)]
media: exynos-gsc/exynos4-is: add missing 'struct' to kerneldoc

Fix kernel-doc warnings due to missing 'struct' keyword.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: tegra-video/csi.h: fix kernel-doc mistake
Hans Verkuil [Tue, 9 Mar 2021 14:35:46 +0000 (15:35 +0100)]
media: tegra-video/csi.h: fix kernel-doc mistake

Fixes this kernel-doc warning:

drivers/staging/media/tegra-video/csi.h:152: warning: Function parameter or member 'csi_chans' not described in 'tegra_csi'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/usb: fix kernel-doc header issues
Hans Verkuil [Tue, 9 Mar 2021 13:03:36 +0000 (14:03 +0100)]
media: media/usb: fix kernel-doc header issues

Fix the following kernel-doc warnings:

drivers/media/usb/dvb-usb-v2/dvb_usb.h:109: warning: cannot understand function prototype: 'struct dvb_usb_driver_info '
drivers/media/usb/dvb-usb-v2/dvb_usb.h:126: warning: cannot understand function prototype: 'struct dvb_usb_rc '
drivers/media/usb/dvb-usb-v2/dvb_usb.h:143: warning: cannot understand function prototype: 'struct usb_data_stream_properties '
drivers/media/usb/dvb-usb-v2/dvb_usb.h:170: warning: expecting prototype for properties of dvb usb device adapter(). Prototype was for
MAX_NO_OF_FE_PER_ADAP() instead
drivers/media/usb/dvb-usb-v2/dvb_usb.h:221: error: Cannot parse struct or union!
drivers/media/usb/dvb-usb-v2/dvb_usb.h:277: warning: expecting prototype for generic object of an usb stream(). Prototype was for
MAX_NO_URBS_FOR_DATA_STREAM() instead
drivers/media/usb/dvb-usb-v2/dvb_usb.h:319: warning: cannot understand function prototype: 'struct dvb_usb_adapter '
drivers/media/usb/dvb-usb-v2/dvb_usb.h:363: warning: cannot understand function prototype: 'struct dvb_usb_device '
drivers/media/usb/dvb-usb/dvb-usb.h:104: warning: cannot understand function prototype: 'struct usb_data_stream_properties '
drivers/media/usb/dvb-usb/dvb-usb.h:163: warning: expecting prototype for struct dvb_usb_adapter_properties. Prototype was for struct
dvb_usb_adapter_fe_properties instead
drivers/media/usb/dvb-usb/dvb-usb.h:205: warning: cannot understand function prototype: 'struct dvb_rc '
drivers/media/usb/dvb-usb/dvb-usb.h:227: warning: Enum value 'DVB_RC_LEGACY' not described in enum 'dvb_usb_mode'
drivers/media/usb/dvb-usb/dvb-usb.h:227: warning: Enum value 'DVB_RC_CORE' not described in enum 'dvb_usb_mode'
drivers/media/usb/dvb-usb/dvb-usb.h:271: error: Cannot parse struct or union!
drivers/media/usb/dvb-usb/dvb-usb.h:325: error: Cannot parse struct or union!
drivers/media/usb/dvb-usb/dvb-usb.h:385: warning: expecting prototype for struct dvb_usb_adapter. Prototype was for struct
dvb_usb_fe_adapter instead
drivers/media/usb/dvb-usb/dvb-usb.h:476: warning: Function parameter or member 'num_adapters_initialized' not described in 'dvb_usb_device'
drivers/media/usb/dvb-usb/dvb-usb.h:476: warning: Function parameter or member 'adapter' not described in 'dvb_usb_device'
drivers/media/usb/dvb-usb/dvb-usb.h:476: warning: Function parameter or member 'rc_phys' not described in 'dvb_usb_device'
drivers/media/usb/em28xx/em28xx.h:377: warning: cannot understand function prototype: 'enum em28xx_amux '

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: Remove qcom,camss documentation
Robert Foss [Tue, 16 Mar 2021 17:19:28 +0000 (18:19 +0100)]
media: dt-bindings: media: Remove qcom,camss documentation

This documentation has been incorporated in dtschema dt-bindings
for the devices supported by CAMSS and is no longer helpful.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: MAINTAINERS: Change CAMSS documentation to use dtschema bindings
Robert Foss [Tue, 16 Mar 2021 17:19:27 +0000 (18:19 +0100)]
media: MAINTAINERS: Change CAMSS documentation to use dtschema bindings

Due to the complexity of describing multiple hardware generations
in one document, switch to using separate dt-bindings.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: camss: Add qcom,sdm845-camss binding
Robert Foss [Tue, 16 Mar 2021 17:19:26 +0000 (18:19 +0100)]
media: dt-bindings: media: camss: Add qcom,sdm845-camss binding

Add bindings for qcom,sdm845-camss in order to support the camera
subsystem for SDM845.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: camss: Add qcom,sdm660-camss binding
Robert Foss [Tue, 16 Mar 2021 17:19:25 +0000 (18:19 +0100)]
media: dt-bindings: media: camss: Add qcom,sdm660-camss binding

Add bindings for qcom,sdm660-camss in order to support the camera
subsystem on SDM630/660 and SDA variants.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: camss: Add qcom,msm8996-camss binding
Robert Foss [Tue, 16 Mar 2021 17:19:24 +0000 (18:19 +0100)]
media: dt-bindings: media: camss: Add qcom,msm8996-camss binding

Add bindings for qcom,msm8996-camss in order to support the camera
subsystem on MSM8996.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: media: camss: Add qcom,msm8916-camss binding
Robert Foss [Tue, 16 Mar 2021 17:19:23 +0000 (18:19 +0100)]
media: dt-bindings: media: camss: Add qcom,msm8916-camss binding

Add bindings for qcom,msm8916-camss in order to support the camera
subsystem on MSM8916.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Enable SDM845
Robert Foss [Tue, 16 Mar 2021 17:19:22 +0000 (18:19 +0100)]
media: camss: Enable SDM845

Enable support for SDM845 based Titan 170 ISPs.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Refactor VFE power domain toggling
Robert Foss [Tue, 16 Mar 2021 17:19:21 +0000 (18:19 +0100)]
media: camss: Refactor VFE power domain toggling

For Titan ISPs clocks fail to re-enable during vfe_get()
after any vfe has been halted and its corresponding power
domain power has been detached.

Since all of the clocks depend on all of the PDs, per
VFE PD detaching is no option for Gen2 HW.

In order to not have regressions on for Gen1 HW, refactor
the power domain management into hardware version specific
code paths.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Add support for CSIPHY hardware version Titan 170
Robert Foss [Tue, 16 Mar 2021 17:19:20 +0000 (18:19 +0100)]
media: camss: Add support for CSIPHY hardware version Titan 170

Add register definitions for version 170 of the Titan architecture
and implement support for the CSIPHY subdevice.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Add support for CSID hardware version Titan 170
Robert Foss [Tue, 16 Mar 2021 17:19:19 +0000 (18:19 +0100)]
media: camss: Add support for CSID hardware version Titan 170

Add register definitions for version 170 of the Titan architecture
and implement support for the CSID subdevice.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Refactor CSID HW version support
Robert Foss [Tue, 16 Mar 2021 17:19:18 +0000 (18:19 +0100)]
media: camss: Refactor CSID HW version support

In order to support Qualcomm ISP hardware architectures that diverge
from older architectures, the CSID subdevice drivers needs to be refactored
to better abstract the different ISP hardware architectures.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Add missing format identifiers
Robert Foss [Tue, 16 Mar 2021 17:19:17 +0000 (18:19 +0100)]
media: camss: Add missing format identifiers

The CSI-2 spec defines format identifier for Data Type (DT),
and how the Decode Format (DF) & Encode Format (EF) are implemented.
The spec does however not define the DF, EF or Plain Format (PF)
identifiers, as those are vendor specific.

Plain formats describe the size of the pixels written by the RDI
units to memory. PLAIN8 for example has the size 8 bits, and
PLAIN32 32 bits. The appropriate Plain Format is determined by
the Decode Format used. The smallest Plain Format that is able
to contain a pixel of the used Decode Format is the appropriate
one to use.

As the vendor specific identifiers differ between hardware
generations, split them out into separate headers.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Add support for VFE hardware version Titan 170
Robert Foss [Tue, 16 Mar 2021 17:19:16 +0000 (18:19 +0100)]
media: camss: Add support for VFE hardware version Titan 170

Add register definitions for version 170 of the Titan architecture
and implement support for the RDI output mode.

The RDI mode as opposed to the PIX output mode for the VFE unit does
not support any ISP functionality. This means essentially only
supporting dumping the output of the whatever the CSI decoder receives
from the sensor.

For example will a sensor outputting YUV pixel format frames, only
allow the VFE to dump those frames as they are received by the ISP
to memory through the RDI interface.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Refactor VFE HW version support
Robert Foss [Tue, 16 Mar 2021 17:19:15 +0000 (18:19 +0100)]
media: camss: Refactor VFE HW version support

In order to support Qualcomm ISP hardware architectures that diverge
from older architectures, the VFE subdevice driver needs to be refactored
to better abstract the different ISP architectures.

Gen1 represents the CAMSS ISP architecture. The ISP architecture developed
after CAMSS, Titan, will be referred to as Gen2.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Make ISPIF subdevice optional
Robert Foss [Tue, 16 Mar 2021 17:19:14 +0000 (18:19 +0100)]
media: camss: Make ISPIF subdevice optional

This driver supports multiple architecture versions of the Qualcomm ISP.
The CAMSS architecure which this driver is name after, and with the
introduction of this series, the Titan architecture.

The ISPIF is an IP-block that is only present in the CAMSS generation of
the architecture. In order to support the Titan generation, make the
ISPIF an optional subdevice.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Add CAMSS_845 camss version
Robert Foss [Tue, 16 Mar 2021 17:19:13 +0000 (18:19 +0100)]
media: camss: Add CAMSS_845 camss version

Add enum representing the SDM845 SOC, which incorporates version
170 of the Titan architecture ISP.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Replace trace_printk() with dev_dbg()
Robert Foss [Tue, 16 Mar 2021 17:19:12 +0000 (18:19 +0100)]
media: camss: Replace trace_printk() with dev_dbg()

trace_printk() should not be used in production code,
since extra memory is used for special buffers whenever
trace_puts() is used.

Replace it with dev_dbg() which provides all of the desired
debugging functionality.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Suggested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Fix vfe_isr comment typo
Robert Foss [Tue, 16 Mar 2021 17:19:11 +0000 (18:19 +0100)]
media: camss: Fix vfe_isr comment typo

Comment refers to ISPIF, but this is incorrect. Only
the VFE interrupts are handled by this function.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camss: Fix vfe_isr_comp_done() documentation
Robert Foss [Tue, 16 Mar 2021 17:19:10 +0000 (18:19 +0100)]
media: camss: Fix vfe_isr_comp_done() documentation

Function name in comment is wrong, and was changed to be
the same as the actual function name.

The comment was changed to kerneldoc format.

Signed-off-by: Robert Foss <robert.foss@linaro.org>
Reviewed-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: radio-si476x: rectify spelling and grammar
Xiaofeng Cao [Thu, 11 Mar 2021 07:20:44 +0000 (08:20 +0100)]
media: radio-si476x: rectify spelling and grammar

Change 'inaccesable' to 'inaccessible'
Change 'detrmine' to 'determine'
Delete 'in' grammatically

Signed-off-by: Xiaofeng Cao <caoxiaofeng@yulong.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camera-mx3: Remove unused header file
Fabio Estevam [Mon, 15 Mar 2021 19:44:46 +0000 (20:44 +0100)]
media: camera-mx3: Remove unused header file

The imx3 camera driver has been removed a long time ago, so get
rid of this unused header file.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: camera-mx2: Remove unused header file
Fabio Estevam [Mon, 15 Mar 2021 19:44:45 +0000 (20:44 +0100)]
media: camera-mx2: Remove unused header file

The imx27/imx25 camera driver has been removed a long time ago,
so get rid of this unused header file.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: pci: saa7164: Rudimentary spelling fixes in the file saa7164-types.h
Bhaskar Chowdhury [Mon, 15 Mar 2021 01:39:58 +0000 (02:39 +0100)]
media: pci: saa7164: Rudimentary spelling fixes in the file saa7164-types.h

s/structues/structures/
s/decies/decides/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ext-ctrls-codec.rst: fix typos
Hans Verkuil [Sat, 13 Mar 2021 12:51:19 +0000 (13:51 +0100)]
media: ext-ctrls-codec.rst: fix typos

The _FRAME_SKIP_ enums were missing the _VIDEO prefix.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l2-ctrls.c: initialize flags field of p_fwht_params
Hans Verkuil [Fri, 12 Mar 2021 08:49:55 +0000 (09:49 +0100)]
media: v4l2-ctrls.c: initialize flags field of p_fwht_params

The V4L2_CID_STATELESS_FWHT_PARAMS compound control was missing a
proper initialization of the flags field, so after loading the vicodec
module for the first time, running v4l2-compliance for the stateless
decoder would fail on this control because the initial control value
was considered invalid by the vicodec driver.

Initializing the flags field to sane values fixes this.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: gspca/sq905.c: fix uninitialized variable
Hans Verkuil [Thu, 11 Mar 2021 14:46:40 +0000 (15:46 +0100)]
media: gspca/sq905.c: fix uninitialized variable

act_len can be uninitialized if usb_bulk_msg() returns an error.
Set it to 0 to avoid a KMSAN error.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reported-by: syzbot+a4e309017a5f3a24c7b3@syzkaller.appspotmail.com
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l2-ioctl.c: fix timestamp format
Hans Verkuil [Thu, 11 Mar 2021 13:07:10 +0000 (14:07 +0100)]
media: v4l2-ioctl.c: fix timestamp format

The timestamp uses microseconds, not nanoseconds, so use %06ld instead
of %09ld.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l2-dev.c: show which events are requested by poll()
Hans Verkuil [Thu, 11 Mar 2021 13:05:38 +0000 (14:05 +0100)]
media: v4l2-dev.c: show which events are requested by poll()

This helps debugging poll problems.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/usb/gspca/w996Xcf.c: /** -> /*
Hans Verkuil [Thu, 11 Mar 2021 11:20:18 +0000 (12:20 +0100)]
media: media/usb/gspca/w996Xcf.c: /** -> /*

The copyright text is just a comment, not kernel-doc documentation.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: docs: Fix data organization of MEDIA_BUS_FMT_RGB101010_1X30
Liu Ying [Thu, 11 Mar 2021 05:53:47 +0000 (06:53 +0100)]
media: docs: Fix data organization of MEDIA_BUS_FMT_RGB101010_1X30

The media bus bit width of MEDIA_BUS_FMT_RGB101010_1X30 is 30.
So, 'Bit31' and 'Bit30' cells for the 'MEDIA_BUS_FMT_RGB101010_1X30'
row should be spaces instead of '0's.

Fixes: 54f38fcae536 ("media: docs: move uAPI book to userspace-api/media")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/saa7164: fix saa7164_encoder_register() memory leak bugs
Daniel Niv [Thu, 11 Mar 2021 02:53:00 +0000 (03:53 +0100)]
media: media/saa7164: fix saa7164_encoder_register() memory leak bugs

Add a fix for the memory leak bugs that can occur when the
saa7164_encoder_register() function fails.
The function allocates memory without explicitly freeing
it when errors occur.
Add a better error handling that deallocate the unused buffers before the
function exits during a fail.

Signed-off-by: Daniel Niv <danielniv3@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: Correct 'so'
Xiaofeng Cao [Wed, 10 Mar 2021 14:58:16 +0000 (15:58 +0100)]
media: Correct 'so'

In Kconfig it should be 'to'
In c8sectpfe-core.c it should be 'do'

Signed-off-by: Xiaofeng Cao <cxfcosmos@gmail.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: videobuf2: Explicitly state max size of planes
Ricardo Ribalda [Wed, 10 Mar 2021 10:46:39 +0000 (11:46 +0100)]
media: videobuf2: Explicitly state max size of planes

The plane size needs to be PAGE_ALIGNED, so it is not possible to have
sizes bigger than MAX_INT - PAGE_SIZE.

We already check for overflows when that happen:
 if (size < vb->planes[plane].length)
goto free;

But it is good to explicitly state our max allowed value, in order to
align with the driver expectations.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: Add maintainer for IMX jpeg v4l2 driver
Mirela Rabulea [Thu, 11 Mar 2021 00:28:54 +0000 (01:28 +0100)]
media: Add maintainer for IMX jpeg v4l2 driver

The driver is located in drivers/media/platform/imx-jpeg,
and it applies to the JPEG decoder from i.MX QXP and QM.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder
Mirela Rabulea [Thu, 11 Mar 2021 08:53:17 +0000 (09:53 +0100)]
media: imx-jpeg: Add V4L2 driver for i.MX8 JPEG Encoder/Decoder

V4L2 driver for the JPEG encoder/decoder from i.MX8QXP/i.MX8QM application
processors.
The multi-planar buffers API is used.

Baseline and extended sequential jpeg decoding is supported.
Progressive jpeg decoding is not supported by the IP.
Supports encode and decode of various formats:
     YUV444, YUV422, YUV420, RGB, ARGB, Gray
YUV420 is the only multi-planar format supported.
Minimum resolution is 64 x 64, maximum 8192 x 8192.
The alignment requirements for the resolution depend on the format,
multiple of 16 resolutions should work for all formats.

v4l2-compliance tests are passing, including the
streaming tests, "v4l2-compliance -s"

[hverkuil: fix kernel-doc typos]

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: Avoid parsing quantization and huffman tables
Mirela Rabulea [Thu, 11 Mar 2021 00:28:51 +0000 (01:28 +0100)]
media: Avoid parsing quantization and huffman tables

These are optional in struct v4l2_jpeg_header, so skip DHT/DQT segment
parsing if huffman_tables/quantization_tables were not requested by user,
to save time.
However, do count them (num_dht/num_dqt).

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: Quit parsing stream if doesn't start with SOI
Mirela Rabulea [Thu, 11 Mar 2021 00:28:50 +0000 (01:28 +0100)]
media: Quit parsing stream if doesn't start with SOI

In the case we get an invalid stream, such as from v4l2-compliance
streaming test, jpeg_next_marker will end up parsing the entire
stream. The standard describes the high level syntax of a jpeg
as starting with SOI, ending with EOI, so return error if the very
first 2 bytes are not SOI.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: Add parsing for APP14 data segment in jpeg helpers
Mirela Rabulea [Thu, 11 Mar 2021 00:28:49 +0000 (01:28 +0100)]
media: Add parsing for APP14 data segment in jpeg helpers

According to Rec. ITU-T T.872 (06/2012) 6.5.3
APP14 segment is for color encoding, it contains a transform flag, which
may have values of 0, 1 and 2 and are interpreted as follows:
0 - CMYK for images that are encoded with four components
  - RGB for images that are encoded with three components
1 - An image encoded with three components using YCbCr colour encoding.
2 - An image encoded with four components using YCCK colour encoding.

This is used in imx-jpeg decoder, to distinguish between
YUV444 and RGB24.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: dt-bindings: Add bindings for i.MX8QXP/QM JPEG driver
Mirela Rabulea [Thu, 11 Mar 2021 00:28:48 +0000 (01:28 +0100)]
media: dt-bindings: Add bindings for i.MX8QXP/QM JPEG driver

Add bindings documentation for i.MX8QXP/QM JPEG decoder & encoder driver.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l: Add packed YUV444 24bpp pixel format
Mirela Rabulea [Thu, 11 Mar 2021 00:28:47 +0000 (01:28 +0100)]
media: v4l: Add packed YUV444 24bpp pixel format

The added format is V4L2_PIX_FMT_YUV24, this is a packed
YUV 4:4:4 format, with 8 bits for each component, 24 bits
per sample.

This format is used by the i.MX 8QuadMax and i.MX 8DualXPlus/8QuadXPlus
JPEG encoder/decoder.

Signed-off-by: Mirela Rabulea <mirela.rabulea@nxp.com>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: cec/core/cec-notifier: use IS_REACHABLE(CONFIG_I2C)
Hans Verkuil [Wed, 10 Mar 2021 08:21:32 +0000 (09:21 +0100)]
media: cec/core/cec-notifier: use IS_REACHABLE(CONFIG_I2C)

If CONFIG_I2C=m and CONFIG_CEC_CORE=y then of_find_i2c_device_by_node()
is not reachable. So use IS_REACHABLE instead of IS_ENABLED.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Fixes: a62943c145c1 ("media: cec-notifier: also search for HDMI devices on I2C")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media tuner headers: fix kernel-doc warnings
Hans Verkuil [Tue, 9 Mar 2021 12:28:11 +0000 (13:28 +0100)]
media: media tuner headers: fix kernel-doc warnings

Fix the following kernel-doc warnings:

drivers/media/tuners/it913x.h:28: warning: Function parameter or member 'fe' not described in 'it913x_platform_data'
drivers/media/tuners/tda827x.h:34: warning: wrong kernel-doc identifier on line:
 * Attach a tda827x tuner to the supplied frontend structure.
drivers/media/tuners/qt1010.h:20: warning: wrong kernel-doc identifier on line:
 * Attach a qt1010 tuner to the supplied frontend structure.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: vpbe_osd.h/uvcvideo.h includes: fix trivial kernel-doc warnings
Hans Verkuil [Tue, 9 Mar 2021 12:22:37 +0000 (13:22 +0100)]
media: vpbe_osd.h/uvcvideo.h includes: fix trivial kernel-doc warnings

Fix these kernel-doc warnings:

include/media/davinci/vpbe_osd.h:77: warning: Enum value 'PIXFMT_YCBCRI' not described in enum 'osd_pix_format'
include/media/davinci/vpbe_osd.h:77: warning: Enum value 'PIXFMT_YCRCBI' not described in enum 'osd_pix_format'
include/media/davinci/vpbe_osd.h:77: warning: Excess enum value 'PIXFMT_YCrCbI' description in 'osd_pix_format'
include/media/davinci/vpbe_osd.h:77: warning: Excess enum value 'PIXFMT_YCbCrI' description in 'osd_pix_format'
include/media/davinci/vpbe_osd.h:232: warning: expecting prototype for enum davinci_cursor_v_width. Prototype was for enum
osd_cursor_v_width instead
include/uapi/linux/uvcvideo.h:98: warning: Function parameter or member 'ns' not described in 'uvc_meta_buf'
include/uapi/linux/uvcvideo.h:98: warning: Function parameter or member 'sof' not described in 'uvc_meta_buf'
include/uapi/linux/uvcvideo.h:98: warning: Function parameter or member 'length' not described in 'uvc_meta_buf'
include/uapi/linux/uvcvideo.h:98: warning: Function parameter or member 'flags' not described in 'uvc_meta_buf'
include/uapi/linux/uvcvideo.h:98: warning: Function parameter or member 'buf' not described in 'uvc_meta_buf'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/i2c: fix kerneldoc issues for media i2c headers
Hans Verkuil [Tue, 9 Mar 2021 12:17:10 +0000 (13:17 +0100)]
media: media/i2c: fix kerneldoc issues for media i2c headers

This fixes these kernel-doc warnings:

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI1A' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI1B' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI1C' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI2A' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI2B' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI2C' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI3A' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI3B' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI3C' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_CVBS_VI4A' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI2A_VI1A' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI2B_VI1B' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI2C_VI1C' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI2A_VI3A' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI2B_VI3B' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI2C_VI3C' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI4A_VI1A' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI4A_VI1B' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI4A_VI1C' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI4A_VI3A' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI4A_VI3B' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_SVIDEO_VI4A_VI3C' not described in enum 'tvp514x_input'

include/media/i2c/tvp514x.h:70: warning: Enum value 'INPUT_INVALID' not described in enum 'tvp514x_input'
include/media/i2c/tvp514x.h:82: warning: Enum value 'OUTPUT_10BIT_422_EMBEDDED_SYNC' not described in enum 'tvp514x_output'
include/media/i2c/tvp514x.h:82: warning: Enum value 'OUTPUT_20BIT_422_SEPERATE_SYNC' not described in enum 'tvp514x_output'
include/media/i2c/tvp514x.h:82: warning: Enum value 'OUTPUT_10BIT_422_SEPERATE_SYNC' not described in enum 'tvp514x_output'
include/media/i2c/tvp514x.h:82: warning: Enum value 'OUTPUT_INVALID' not described in enum 'tvp514x_output'
include/media/i2c/adv7343.h:38: warning: cannot understand function prototype: 'struct adv7343_power_mode '
include/media/i2c/s5k4ecgx.h:31: warning: expecting prototype for struct ss5k4ecgx_platform_data. Prototype was for struct
s5k4ecgx_platform_data instead
include/media/i2c/mt9t112.h:21: warning: cannot understand function prototype: 'struct mt9t112_platform_data '
include/media/i2c/noon010pc30.h:13: warning: Cannot understand  * @clk_rate: the clock frequency in Hz
include/media/i2c/s5k6aa.h:45: warning: Function parameter or member 'bus_type' not described in 's5k6aa_platform_data'
include/media/i2c/tw9910.h:19: warning: cannot understand function prototype: 'enum tw9910_mpout_pin '
include/media/i2c/tw9910.h:36: warning: cannot understand function prototype: 'struct tw9910_video_info '
include/media/i2c/ov772x.h:53: warning: cannot understand function prototype: 'struct ov772x_camera_info '
include/media/i2c/s5c73m3.h:53: warning: Function parameter or member 'bus_type' not described in 's5c73m3_platform_data'
drivers/media/i2c/ccs/ccs-quirk.h:50: warning: Function parameter or member 'post_streamoff' not described in 'ccs_quirk'
drivers/media/i2c/ccs/ccs-quirk.h:50: warning: Function parameter or member 'flags' not described in 'ccs_quirk'
drivers/media/i2c/ccs/ccs-data.h:144: warning: expecting prototype for struct ccs_pdaf_pix_loc_block_desc. Prototype was for struct
ccs_pdaf_pix_loc_pixel_desc instead
drivers/media/i2c/tvp514x_regs.h:272: warning: Function parameter or member 'token' not described in 'tvp514x_reg'
drivers/media/i2c/tvp514x_regs.h:272: warning: Function parameter or member 'reg' not described in 'tvp514x_reg'
drivers/media/i2c/tvp514x_regs.h:272: warning: Function parameter or member 'val' not described in 'tvp514x_reg'
drivers/media/i2c/m5mols/m5mols.h:69: warning: Function parameter or member 'brightness' not described in 'm5mols_exif'
drivers/media/i2c/m5mols/m5mols.h:147: error: Cannot parse struct or union!
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN0' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN1' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN2' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN3' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN4' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN5' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN6' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_AIN7' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_HDMI' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_TTL' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_TXA' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_TXB' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:65: warning: Enum value 'ADV748X_PORT_MAX' not described in enum 'adv748x_ports'
drivers/media/i2c/adv748x/adv748x.h:199: warning: Function parameter or member 'i2c_clients' not described in 'adv748x_state'
drivers/media/i2c/adv748x/adv748x.h:199: warning: Function parameter or member 'regmap' not described in 'adv748x_state'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: media/pci: fix kerneldoc issues in two headers
Hans Verkuil [Tue, 9 Mar 2021 12:15:36 +0000 (13:15 +0100)]
media: media/pci: fix kerneldoc issues in two headers

This fixes these kerneldoc warnings:

drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'v4l2_dev' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'snd_card' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'name' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'type' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'dma_mode' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'pci_dev' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'mmio' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'dma_ops' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'video_channels' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'audio_channels' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'audio_rate' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'period_size' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'audio_enabled' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'dma_delay_timer' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'pending_dma_en' not described in 'tw686x_dev'
drivers/media/pci/tw686x/tw686x.h:143: warning: Function parameter or member 'pending_dma_cmd' not described in 'tw686x_dev'
drivers/media/pci/sta2x11/sta2x11_vip.h:25: warning: Function parameter or member 'i2c_id' not described in 'vip_config'
drivers/media/pci/sta2x11/sta2x11_vip.h:25: warning: Function parameter or member 'i2c_addr' not described in 'vip_config'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: core headers: fix kernel-doc warnings
Hans Verkuil [Tue, 9 Mar 2021 11:48:20 +0000 (12:48 +0100)]
media: core headers: fix kernel-doc warnings

This patch fixes the following kernel-doc warnings:

include/uapi/linux/videodev2.h:996: warning: Function parameter or member 'm' not described in 'v4l2_plane'
include/uapi/linux/videodev2.h:996: warning: Function parameter or member 'reserved' not described in 'v4l2_plane'
include/uapi/linux/videodev2.h:1057: warning: Function parameter or member 'm' not described in 'v4l2_buffer'
include/uapi/linux/videodev2.h:1057: warning: Function parameter or member 'reserved2' not described in 'v4l2_buffer'
include/uapi/linux/videodev2.h:1057: warning: Function parameter or member 'reserved' not described in 'v4l2_buffer'
include/uapi/linux/videodev2.h:1068: warning: Function parameter or member 'tv' not described in 'v4l2_timeval_to_ns'
include/uapi/linux/videodev2.h:1068: warning: Excess function parameter 'ts' description in 'v4l2_timeval_to_ns'
include/uapi/linux/videodev2.h:1138: warning: Function parameter or member 'reserved' not described in 'v4l2_exportbuffer'
include/uapi/linux/videodev2.h:2237: warning: Function parameter or member 'reserved' not described in 'v4l2_plane_pix_format'
include/uapi/linux/videodev2.h:2270: warning: Function parameter or member 'hsv_enc' not described in 'v4l2_pix_format_mplane'
include/uapi/linux/videodev2.h:2270: warning: Function parameter or member 'reserved' not described in 'v4l2_pix_format_mplane'
include/uapi/linux/videodev2.h:2281: warning: Function parameter or member 'reserved' not described in 'v4l2_sdr_format'
include/uapi/linux/videodev2.h:2315: warning: Function parameter or member 'fmt' not described in 'v4l2_format'

include/uapi/linux/v4l2-subdev.h:53: warning: Function parameter or member 'reserved' not described in 'v4l2_subdev_format'
include/uapi/linux/v4l2-subdev.h:66: warning: Function parameter or member 'reserved' not described in 'v4l2_subdev_crop'
include/uapi/linux/v4l2-subdev.h:89: warning: Function parameter or member 'reserved' not described in 'v4l2_subdev_mbus_code_enum'
include/uapi/linux/v4l2-subdev.h:108: warning: Function parameter or member 'min_width' not described in 'v4l2_subdev_frame_size_enum'
include/uapi/linux/v4l2-subdev.h:108: warning: Function parameter or member 'max_width' not described in 'v4l2_subdev_frame_size_enum'
include/uapi/linux/v4l2-subdev.h:108: warning: Function parameter or member 'min_height' not described in 'v4l2_subdev_frame_size_enum'
include/uapi/linux/v4l2-subdev.h:108: warning: Function parameter or member 'max_height' not described in 'v4l2_subdev_frame_size_enum'
include/uapi/linux/v4l2-subdev.h:108: warning: Function parameter or member 'reserved' not described in 'v4l2_subdev_frame_size_enum'
include/uapi/linux/v4l2-subdev.h:119: warning: Function parameter or member 'reserved' not described in 'v4l2_subdev_frame_interval'
include/uapi/linux/v4l2-subdev.h:140: warning: Function parameter or member 'reserved' not described in 'v4l2_subdev_frame_interval_enum'

include/uapi/linux/cec.h:406: warning: Function parameter or member 'raw' not described in 'cec_connector_info'
include/uapi/linux/cec.h:470: warning: Function parameter or member 'flags' not described in 'cec_event'

include/media/v4l2-h264.h:82: warning: Function parameter or member 'reflist' not described in 'v4l2_h264_build_p_ref_list'
include/media/v4l2-h264.h:82: warning: expecting prototype for v4l2_h264_build_b_ref_lists(). Prototype was for v4l2_h264_build_p_ref_list()
instead

include/media/cec.h:50: warning: Function parameter or member 'lock' not described in 'cec_devnode'

include/media/v4l2-jpeg.h:122: warning: Function parameter or member 'num_dht' not described in 'v4l2_jpeg_header'
include/media/v4l2-jpeg.h:122: warning: Function parameter or member 'num_dqt' not described in 'v4l2_jpeg_header'

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ext-ctrls-codec.rst: clarify V4L2_CID_MPEG_VIDEO_BITRATE
Hans Verkuil [Tue, 9 Mar 2021 07:43:33 +0000 (08:43 +0100)]
media: ext-ctrls-codec.rst: clarify V4L2_CID_MPEG_VIDEO_BITRATE

The documentation for V4L2_CID_MPEG_VIDEO_BITRATE was missing the word
'Average': this is the average video bitrate.

The V4L2_CID_MPEG_VIDEO_BITRATE_PEAK documentation *does* refer to
V4L2_CID_MPEG_VIDEO_BITRATE as the average video bitrate.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: m88ds3103: fix return value check in m88ds3103_probe()
Wei Yongjun [Mon, 8 Mar 2021 12:28:02 +0000 (13:28 +0100)]
media: m88ds3103: fix return value check in m88ds3103_probe()

In case of error, the function i2c_new_dummy_device() returns
ERR_PTR() and never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Fixes: e6089feca460 ("media: m88ds3103: Add support for ds3103b demod")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: tuners: fix error return code of hybrid_tuner_request_state()
Jia-Ju Bai [Sat, 6 Mar 2021 14:30:28 +0000 (15:30 +0100)]
media: tuners: fix error return code of hybrid_tuner_request_state()

When kzalloc() fails and state is NULL, no error return code is
assigned.
To fix this bug, __ret is assigned with -ENOMEM in this case.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: platform: sunxi: sun6i-csi: fix error return code of sun6i_video_start_streaming()
Jia-Ju Bai [Sat, 6 Mar 2021 14:15:28 +0000 (15:15 +0100)]
media: platform: sunxi: sun6i-csi: fix error return code of sun6i_video_start_streaming()

When sun6i_video_remote_subdev() returns NULL to subdev, no error return
code of sun6i_video_start_streaming() is assigned.
To fix this bug, ret is assigned with -EINVAL in this case.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Fixes: 5cc7522d8965 ("media: sun6i: Add support for Allwinner CSI V3s")
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: flexcop-usb: delete unneeded return
Julia Lawall [Sat, 6 Mar 2021 13:42:25 +0000 (14:42 +0100)]
media: flexcop-usb: delete unneeded return

No need for a return after a break;

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: vidtv: remove duplicate include in vidtv_psi
Zhang Yunkai [Sat, 6 Mar 2021 11:32:55 +0000 (12:32 +0100)]
media: vidtv: remove duplicate include in vidtv_psi

'string.h' included in 'vidtv_psi.c' is duplicated.

Signed-off-by: Zhang Yunkai <zhang.yunkai@zte.com.cn>
Acked-by: Daniel Almeida <dwlsalmeida@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: platform: xilinx: fix error return code of xvip_graph_init()
Jia-Ju Bai [Fri, 5 Mar 2021 09:48:19 +0000 (10:48 +0100)]
media: platform: xilinx: fix error return code of xvip_graph_init()

When the list of xdev->notifier.asd_list is empty, no error return code
of xvip_graph_init() is assigned.
To fix this bug, ret is assigned with -ENOENT as error return code.

Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Reviewed-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ti-vpe: cal: Implement media controller centric API
Laurent Pinchart [Thu, 4 Mar 2021 13:45:21 +0000 (14:45 +0100)]
media: ti-vpe: cal: Implement media controller centric API

The CAL driver is video node centric, it controls the whole device
through the video device nodes. This limits the possible use cases as it
can't support sources that are more complex than a single subdev. To
support more complex hardware pipelines, implement support for the media
controller centric API. The exposed API can be selected through a module
parameter.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ti-vpe: cal: fix subdev mbus_code enumeration
Tomi Valkeinen [Thu, 4 Mar 2021 13:45:20 +0000 (14:45 +0100)]
media: ti-vpe: cal: fix subdev mbus_code enumeration

The cal_ctx_v4l2_init_formats() function does not handle error values
correctly when calling enum_mbus_code in subdevs, causing an infinite
loop if the subdev's enum_mbus_code returns some other error than EINVAL.

Fix the error handling.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: ti-vpe: cal: remove unneeded assignment
Tomi Valkeinen [Thu, 4 Mar 2021 13:45:19 +0000 (14:45 +0100)]
media: ti-vpe: cal: remove unneeded assignment

v4l2_fill_pix_format() already copies mbus_fmt.field, so no need to do
it again.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: exynos4-is: add missing call to of_node_put()
Yang Li [Fri, 26 Feb 2021 01:28:40 +0000 (02:28 +0100)]
media: exynos4-is: add missing call to of_node_put()

In one of the error paths of the for_each_child_of_node() loop in
fimc_md_parse_one_endpoint, add missing call to of_node_put().

Fix the following coccicheck warning:
./drivers/media/platform/exynos4-is/media-dev.c:489:1-23: WARNING:
Function "for_each_child_of_node" should have of_node_put() before
return around line 492.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: vim2m: initialize the media device earlier
Hans Verkuil [Tue, 2 Feb 2021 14:49:23 +0000 (15:49 +0100)]
media: vim2m: initialize the media device earlier

Before the video device node is registered, the v4l2_dev.mdev
pointer must be set in order to correctly associate the video
device with the media device. Move the initialization of the
media device up.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: uapi: vp8: Fix kernel-doc warnings
Ezequiel Garcia [Sat, 6 Mar 2021 19:07:49 +0000 (20:07 +0100)]
media: uapi: vp8: Fix kernel-doc warnings

Fix following warnings:

./scripts/kernel-doc --none include/uapi/linux/v4l2-controls.h

        include/uapi/linux/v4l2-controls.h:1727: warning: bad line:
        include/uapi/linux/v4l2-controls.h:1853: warning: expecting prototype for struct v4l2_vp8_frame. Prototype was for struct v4l2_ctrl_vp8_frame instead
        include/uapi/linux/v4l2-controls.h:1853: warning: Function parameter or member 'segment' not described in 'v4l2_ctrl_vp8_frame'
        include/uapi/linux/v4l2-controls.h:1853: warning: Function parameter or member 'entropy' not described in 'v4l2_ctrl_vp8_frame'
        include/uapi/linux/v4l2-controls.h:1853: warning: Function parameter or member 'coder_state' not described in 'v4l2_ctrl_vp8_frame'

Reported-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: uapi: move VP8 stateless controls out of staging
Ezequiel Garcia [Thu, 4 Mar 2021 14:07:55 +0000 (15:07 +0100)]
media: uapi: move VP8 stateless controls out of staging

Until now, the VP8 V4L2 API was not exported as a public API,
and only defined in a private media header (media/vp8-ctrls.h).

The reason for this was a concern about the API not complete
and ready to support VP8 decoding hardware accelerators.

After reviewing the VP8 specification in detail, and now
that the API is able to support Cedrus and Hantro G1,
we can consider this ready.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: vp8: Rename V4L2 VP8 specific macro to V4L2_VP8_
Ezequiel Garcia [Thu, 4 Mar 2021 14:07:54 +0000 (15:07 +0100)]
media: vp8: Rename V4L2 VP8 specific macro to V4L2_VP8_

Before we move the VP8 controls to a stable public header,
rename this macro so it's clearly V4L2-specific.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: controls: Log VP8 stateless control in .std_log
Ezequiel Garcia [Thu, 4 Mar 2021 14:07:53 +0000 (15:07 +0100)]
media: controls: Log VP8 stateless control in .std_log

Simply print the type of the control.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: uapi: Move the VP8 stateless control type out of staging
Ezequiel Garcia [Thu, 4 Mar 2021 14:07:52 +0000 (15:07 +0100)]
media: uapi: Move the VP8 stateless control type out of staging

Move the VP8 stateless control types out of staging,
and re-number it to avoid any confusion.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: uapi: Move parsed VP8 pixel format out of staging
Ezequiel Garcia [Thu, 4 Mar 2021 14:07:51 +0000 (15:07 +0100)]
media: uapi: Move parsed VP8 pixel format out of staging

Since we are ready to stabilize the VP8 stateless API,
move the parsed VP8 pixel format.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: uapi: vp8: Add proper kernel-doc documentation
Ezequiel Garcia [Thu, 4 Mar 2021 14:07:50 +0000 (15:07 +0100)]
media: uapi: vp8: Add proper kernel-doc documentation

In preparation for making the interface public,
document all the structures.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: uapi: vp8: Rename v4l2_vp8_loopfilter to v4l2_vp8_loop_filter
Ezequiel Garcia [Thu, 4 Mar 2021 14:07:49 +0000 (15:07 +0100)]
media: uapi: vp8: Rename v4l2_vp8_loopfilter to v4l2_vp8_loop_filter

Rename to struct v4l2_vp8_loop_filter, which is closer to the
VP8 syntax. This change is only cosmetics, but since this API
is exposed to userspace, it's worth the trouble to get it consistent.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: uapi: vp8: Remove "header" from symbol names and macros
Ezequiel Garcia [Thu, 4 Mar 2021 14:07:48 +0000 (15:07 +0100)]
media: uapi: vp8: Remove "header" from symbol names and macros

It doesn't seem to add any clarity to have a "header" suffix in controls,
struct names and flags.

Since this just makes names too long without any benefit, just drop it.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: venus: core: Parse firmware-name DT property
Stanimir Varbanov [Tue, 26 Jan 2021 08:42:52 +0000 (09:42 +0100)]
media: venus: core: Parse firmware-name DT property

On production devices the firmware could be located on different
places, this path could be provided by special firmware-name DT
property.

Here we check for existence of such DT property and if it exist
take the firmware path from there. Otherwise, if the property
is missing we fallback to the predefined path from driver resource
structure.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: venus: Include io.h for memremap()
Stephen Boyd [Tue, 2 Feb 2021 19:47:52 +0000 (20:47 +0100)]
media: venus: Include io.h for memremap()

This file uses memremap() now, so we should include io.h instead of
relying on any sort of implicit include elsewhere.

Cc: Dikshita Agarwal <dikshita@codeaurora.org>
Fixes: 0ca0ca980505 ("media: venus: core: add support to dump FW region")
Signed-off-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Fritz Koenig <frkoenig@chromium.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: venus: core, venc, vdec: Fix probe dependency error
Bryan O'Donoghue [Fri, 5 Feb 2021 18:11:49 +0000 (19:11 +0100)]
media: venus: core, venc, vdec: Fix probe dependency error

Commit aaaa93eda64b ("media] media: venus: venc: add video encoder files")
is the last in a series of three commits to add core.c vdec.c and venc.c
adding core, encoder and decoder.

The encoder and decoder check for core drvdata as set and return -EPROBE_DEFER
if it has not been set, however both the encoder and decoder rely on
core.v4l2_dev as valid.

core.v4l2_dev will not be valid until v4l2_device_register() has completed
in core.c's probe().

Normally this is never seen however, Dmitry reported the following
backtrace when compiling drivers and firmware directly into a kernel image.

[    5.259968] Hardware name: Qualcomm Technologies, Inc. Robotics RB5 (DT)
[    5.269850] sd 0:0:0:3: [sdd] Optimal transfer size 524288 bytes
[    5.275505] Workqueue: events deferred_probe_work_func
[    5.275513] pstate: 60400005 (nZCv daif +PAN -UAO -TCO BTYPE=--)
[    5.441211] usb 2-1: new SuperSpeedPlus Gen 2 USB device number 2 using xhci-hcd
[    5.442486] pc : refcount_warn_saturate+0x140/0x148
[    5.493756] hub 2-1:1.0: USB hub found
[    5.496266] lr : refcount_warn_saturate+0x140/0x148
[    5.500982] hub 2-1:1.0: 4 ports detected
[    5.503440] sp : ffff80001067b730
[    5.503442] x29: ffff80001067b730
[    5.592660] usb 1-1: new high-speed USB device number 2 using xhci-hcd
[    5.598478] x28: ffff6c6bc1c379b8
[    5.598480] x27: ffffa5c673852960 x26: ffffa5c673852000
[    5.598484] x25: ffff6c6bc1c37800 x24: 0000000000000001
[    5.810652] x23: 0000000000000000 x22: ffffa5c673bc7118
[    5.813777] hub 1-1:1.0: USB hub found
[    5.816108] x21: ffffa5c674440000 x20: 0000000000000001
[    5.820846] hub 1-1:1.0: 4 ports detected
[    5.825415] x19: ffffa5c6744f4000 x18: ffffffffffffffff
[    5.825418] x17: 0000000000000000 x16: 0000000000000000
[    5.825421] x15: 00000a4810c193ba x14: 0000000000000000
[    5.825424] x13: 00000000000002b8 x12: 000000000000f20a
[    5.825427] x11: 000000000000f20a x10: 0000000000000038
[    5.845447] usb 2-1.1: new SuperSpeed Gen 1 USB device number 3 using xhci-hcd
[    5.845904]
[    5.845905] x9 : 0000000000000000 x8 : ffff6c6d36fae780
[    5.871208] x7 : ffff6c6d36faf240 x6 : 0000000000000000
[    5.876664] x5 : 0000000000000004 x4 : 0000000000000085
[    5.882121] x3 : 0000000000000119 x2 : ffffa5c6741ef478
[    5.887578] x1 : 3acbb3926faf5f00 x0 : 0000000000000000
[    5.893036] Call trace:
[    5.895551]  refcount_warn_saturate+0x140/0x148
[    5.900202]  __video_register_device+0x64c/0xd10
[    5.904944]  venc_probe+0xc4/0x148
[    5.908444]  platform_probe+0x68/0xe0
[    5.912210]  really_probe+0x118/0x3e0
[    5.915977]  driver_probe_device+0x5c/0xc0
[    5.920187]  __device_attach_driver+0x98/0xb8
[    5.924661]  bus_for_each_drv+0x68/0xd0
[    5.928604]  __device_attach+0xec/0x148
[    5.932547]  device_initial_probe+0x14/0x20
[    5.936845]  bus_probe_device+0x9c/0xa8
[    5.940788]  device_add+0x3e8/0x7c8
[    5.944376]  of_device_add+0x4c/0x60
[    5.948056]  of_platform_device_create_pdata+0xbc/0x140
[    5.953425]  of_platform_bus_create+0x17c/0x3c0
[    5.958078]  of_platform_populate+0x80/0x110
[    5.962463]  venus_probe+0x2ec/0x4d8
[    5.966143]  platform_probe+0x68/0xe0
[    5.969907]  really_probe+0x118/0x3e0
[    5.973674]  driver_probe_device+0x5c/0xc0
[    5.977882]  __device_attach_driver+0x98/0xb8
[    5.982356]  bus_for_each_drv+0x68/0xd0
[    5.986298]  __device_attach+0xec/0x148
[    5.990242]  device_initial_probe+0x14/0x20
[    5.994539]  bus_probe_device+0x9c/0xa8
[    5.998481]  deferred_probe_work_func+0x74/0xb0
[    6.003132]  process_one_work+0x1e8/0x360
[    6.007254]  worker_thread+0x208/0x478
[    6.011106]  kthread+0x150/0x158
[    6.014431]  ret_from_fork+0x10/0x30
[    6.018111] ---[ end trace f074246b1ecdb466 ]---

This patch fixes by

- Only setting drvdata after v4l2_device_register() completes
- Moving v4l2_device_register() so that suspend/reume in core::probe()
  stays as-is
- Changes pm_ops->core_function() to take struct venus_core not struct
  device
- Minimal rework of v4l2_device_*register in probe/remove

Reported-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: venus: core: Fix some resource leaks in the error path of 'venus_probe()'
Christophe JAILLET [Thu, 28 Jan 2021 20:22:34 +0000 (21:22 +0100)]
media: venus: core: Fix some resource leaks in the error path of 'venus_probe()'

If an error occurs after a successful 'of_icc_get()' call, it must be
undone.

Use 'devm_of_icc_get()' instead of 'of_icc_get()' to avoid the leak.
Update the remove function accordingly and axe the now unneeded
'icc_put()' calls.

Fixes: 32f0a6ddc8c9 ("media: venus: Use on-chip interconnect API")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: venus: venc: Add support for AUD NALU control
Stanimir Varbanov [Tue, 24 Nov 2020 00:40:12 +0000 (01:40 +0100)]
media: venus: venc: Add support for AUD NALU control

Add support for Access Unit Delimiter control into encoder.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l2-ctrls: Add control for AUD generation
Stanimir Varbanov [Tue, 24 Nov 2020 00:01:37 +0000 (01:01 +0100)]
media: v4l2-ctrls: Add control for AUD generation

Add a control to enable inserting of AUD NALU into encoded
bitstream.

Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: docs: Deprecate mfc display delay controls
Stanimir Varbanov [Mon, 9 Nov 2020 17:35:41 +0000 (18:35 +0100)]
media: docs: Deprecate mfc display delay controls

Deprecate mfc private display delay and display enable controls for
new clients and use the standard controls instead.

Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: s5p-mfc: Use display delay and display enable std controls
Stanimir Varbanov [Mon, 9 Nov 2020 17:35:40 +0000 (18:35 +0100)]
media: s5p-mfc: Use display delay and display enable std controls

Use the standard display_delay and display_delay_enable controls,
the legacy private MFC controls are kept for backward compatibility.

Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: venus: vdec: Add support for display delay and delay enable controls
Stanimir Varbanov [Mon, 9 Nov 2020 17:35:39 +0000 (18:35 +0100)]
media: venus: vdec: Add support for display delay and delay enable controls

Add support for display delay and display delay enable std controls.
With this we implement decoder decode output order (decode vs display).
Once firmware implement few new features the controls will be used
for other use-cases.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: v4l2-ctrl: Make display delay and display enable std controls
Stanimir Varbanov [Mon, 9 Nov 2020 17:35:38 +0000 (18:35 +0100)]
media: v4l2-ctrl: Make display delay and display enable std controls

Make display delay and display delay enable MFC controls standard v4l
controls. This will allow reuse of the controls for other decoder
drivers. Also the new proposed controls are now codec agnostic because
they could be used for any codec.

Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: add a subsystem profile documentation
Mauro Carvalho Chehab [Wed, 18 Sep 2019 13:59:44 +0000 (10:59 -0300)]
media: add a subsystem profile documentation

Document the basic policies of the media subsystem profile.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agoatomisp: don't let it go past pipes array
Mauro Carvalho Chehab [Fri, 12 Mar 2021 07:16:03 +0000 (08:16 +0100)]
atomisp: don't let it go past pipes array

In practice, IA_CSS_PIPE_ID_NUM should never be used when
calling atomisp_q_video_buffers_to_css(), as the driver should
discover the right pipe before calling it.

Yet, if some pipe parsing issue happens, it could end using
it.

So, add a WARN_ON() to prevent such case.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: imx: imx7_mipi_csis: Print shadow registers in mipi_csis_dump_regs()
Laurent Pinchart [Mon, 15 Feb 2021 04:27:41 +0000 (05:27 +0100)]
media: imx: imx7_mipi_csis: Print shadow registers in mipi_csis_dump_regs()

Print the value of the ISP shadow registers in mipi_csis_dump_regs() as
this can help debugging.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: imx: imx7_mipi_csis: Use register macros in mipi_csis_dump_regs()
Laurent Pinchart [Mon, 15 Feb 2021 04:27:40 +0000 (05:27 +0100)]
media: imx: imx7_mipi_csis: Use register macros in mipi_csis_dump_regs()

Replace hardcoded register addresses in the MIPI_CSIS_DBG_CTRL()
function with macros. While at it, update the printed name of the
registers to match the datasheet, and short them by address.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
3 years agomedia: imx: imx7_mipi_csis: Rename register macros to match datasheet
Laurent Pinchart [Mon, 1 Mar 2021 16:41:23 +0000 (17:41 +0100)]
media: imx: imx7_mipi_csis: Rename register macros to match datasheet

Rename several register macros to match the names from the
documentation.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>