linux_dsm_epyc7002/drivers/media/platform
Shuah Khan f13d5f3619 media: vimc: Collapse component structure into a single monolithic driver
vimc uses Component API to split the driver into functional components.
The real hardware resembles a monolith structure than component and
component structure added a level of complexity making it hard to
maintain without adding any real benefit.

The sensor is one vimc component that would makes sense to be a separate
module to closely align with the real hardware. It would be easier to
collapse vimc into single monolithic driver first and then split the
sensor off as a separate module.

Collapse it into a single monolithic driver removing the Component API.
This patch removes the component API and makes minimal changes to the
code base preserving the functional division of the code structure.
Preserving the functional structure allows us to split the sensor off
as a separate module in the future.

Major design elements in this change are:
- Use existing struct vimc_ent_config and struct vimc_pipeline_config
  to drive the initialization of the functional components.
- Make vimc_device and vimc_ent_config global by moving them to
  vimc-common.h
- Add two new hooks add and rm to initialize and register, unregister
  and free subdevs.
- All component API is now gone and bind and unbind hooks are modified
  to do "add" and "rm" with minimal changes to just add and rm subdevs.
- vimc-core's bind and unbind are now register and unregister.
- Add a new field to vimc_device structure for saving the pointers to
  struct vimc_ent_device(s) subdevs create in their "add" hooks. These
  get used to create links and removing the subdevs. vimc-core allocates
  this array which sized to number of entries in the topology defined in
  the vimc_pipeline_config structure.
- vimc-core invokes "add" hooks from its vimc_register_devices().
  The "add" hooks remain the same and register subdevs. They don't
  create platform devices of their own and use vimc's pdev.dev as
  their reference device. Each "add" hook returns pointer to its struct
  vimc_ent_device. This is saved in the vimc_device ent_devs array.
- vimc-core invokes "rm" hooks from its unregister to unregister subdevs
  and cleanup.
- vimc-core invokes "add" and "rm" hooks with pointer to struct vimc_device
  and the corresponding vimc_ent_device saved in the ent_devs.

The following configure and stream test works on all devices.

media-ctl -d platform:vimc -V '"Sensor A":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Debayer A":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Sensor B":0[fmt:SBGGR8_1X8/640x480]'
media-ctl -d platform:vimc -V '"Debayer B":0[fmt:SBGGR8_1X8/640x480]'

v4l2-ctl -z platform:vimc -d "RGB/YUV Capture" -v width=1920,height=1440
v4l2-ctl -z platform:vimc -d "Raw Capture 0" -v pixelformat=BA81
v4l2-ctl -z platform:vimc -d "Raw Capture 1" -v pixelformat=BA81

v4l2-ctl --stream-mmap --stream-count=100 -d /dev/video1
v4l2-ctl --stream-mmap --stream-count=100 -d /dev/video2
v4l2-ctl --stream-mmap --stream-count=100 -d /dev/video3

Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-10-01 12:34:13 -03:00
..
am437x media: use the BIT() macro 2019-08-26 14:08:50 -03:00
atmel media: atmel: atmel-isi: fix timeout value for stop streaming 2019-08-23 07:27:55 -03:00
cadence media: Add support for Cadence CSI2TX 2.1 2019-07-25 06:44:17 -04:00
cec-gpio Linux 5.2-rc2 2019-05-28 11:21:51 -04:00
coda media: coda: set device_caps in struct video_device 2019-07-22 14:45:10 -04:00
cros-ec-cec chrome platform changes for v5.4 2019-09-19 14:14:28 -07:00
davinci media: use the BIT() macro 2019-08-26 14:08:50 -03:00
exynos4-is media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
exynos-gsc media: media/platform: don't set description in ENUM_FMT 2019-07-22 14:43:59 -04:00
marvell-ccic media: marvell-ccic: mmp: add MODULE_DEVICE_TABLE 2019-07-25 06:27:14 -04:00
meson media: platform: meson-ao-cec-g12a: add support for SM1 2019-07-23 08:51:50 -04:00
mtk-jpeg media: mtk-jpeg: Use vb2_get_buffer 2019-06-21 16:22:02 -04:00
mtk-mdp media: platform: mtk-mdp: mtk_mdp_core: Add of_node_put() before goto 2019-08-13 11:49:46 -03:00
mtk-vcodec media: mtk-vcodec: flag OUTPUT formats with V4L2_FMT_FLAG_DYN_RESOLUTION 2019-08-19 14:57:40 -03:00
mtk-vpu Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
omap media updates for v5.4-rc1 2019-09-17 17:55:23 -07:00
omap3isp media: use the BIT() macro 2019-08-26 14:08:50 -03:00
qcom media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
rcar-vin media: rcar-vin: Report correct image stride 2019-08-13 11:39:02 -03:00
rockchip/rga media: Remove dev_err() usage after platform_get_irq() 2019-08-07 17:08:33 -03:00
s3c-camif media: use the BIT() macro 2019-08-26 14:08:50 -03:00
s5p-cec media: s5p-cec: use cec_notifier_cec_adap_(un)register 2019-07-23 08:39:27 -04:00
s5p-g2d media: s3c-camif/s5p-g2d/s5p-jpeg: set device_caps in struct video_device 2019-07-22 14:45:40 -04:00
s5p-jpeg media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
s5p-mfc media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
seco-cec media: seco-cec: use cec_notifier_cec_adap_(un)register 2019-07-23 08:38:56 -04:00
sti media: Remove dev_err() usage after platform_get_irq() 2019-08-07 17:08:33 -03:00
stm32 media: stm32-dcmi: Delete an unnecessary of_node_put() call in dcmi_probe() 2019-08-29 10:23:02 -03:00
sunxi media: sun4i: Make sun4i_csi_formats static 2019-08-30 14:44:17 -03:00
tegra-cec media: use the BIT() macro 2019-08-26 14:08:50 -03:00
ti-vpe media: use the BIT() macro 2019-08-26 14:08:50 -03:00
vicodec media: vicodec: make life easier for static analyzers 2019-08-26 14:02:22 -03:00
vimc media: vimc: Collapse component structure into a single monolithic driver 2019-10-01 12:34:13 -03:00
vivid Linux 5.3-rc4 2019-08-12 13:22:54 -03:00
vsp1 media: use the BIT() macro 2019-08-26 14:08:50 -03:00
xilinx media: use the BIT() macro 2019-08-26 14:08:50 -03:00
aspeed-video.c media: aspeed-video: address a protential usage of an unitialized var 2019-08-26 14:03:39 -03:00
fsl-viu.c media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
imx-pxp.c media: Remove dev_err() usage after platform_get_irq() 2019-08-07 17:08:33 -03:00
imx-pxp.h media: imx-pxp: add i.MX Pixel Pipeline driver 2018-09-11 13:32:17 -04:00
Kconfig chrome platform changes for v5.4 2019-09-19 14:14:28 -07:00
m2m-deinterlace.c media: m2m-deinterlace: use struct v4l2_fh 2019-07-23 11:49:41 -04:00
Makefile media: sunxi: Refactor the Makefile and Kconfig 2019-08-23 07:29:05 -03:00
mx2_emmaprp.c media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
pxa_camera.c media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
rcar_drif.c media: rcar_drif: Remove devm_ioremap_resource() error printing 2019-03-19 13:44:38 -04:00
rcar_fdp1.c media: fdp1: Fix a memory leak bug 2019-08-26 10:41:17 -03:00
rcar_jpu.c media: v4l2: Get rid of ->vidioc_enum_fmt_vid_{cap, out}_mplane 2019-06-05 07:48:32 -04:00
rcar-fcp.c Char/Misc driver patches for 4.19-rc1 2018-08-18 11:04:51 -07:00
renesas-ceu.c media: Remove dev_err() usage after platform_get_irq() 2019-08-07 17:08:33 -03:00
sh_veu.c media: sh_veu: convert to struct v4l2_fh 2019-07-25 06:29:26 -04:00
sh_vou.c media: sh_veu/sh_vou: set device_caps in struct video_device 2019-07-22 15:09:06 -04:00
via-camera.c media: via-camera: convert to the vb2 framework 2019-07-30 12:18:34 -04:00
via-camera.h media: fix usage of whitespaces and on indentation 2018-01-04 13:12:01 -05:00
video-mux.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
vim2m.c media: vim2m: fix two double-free issues 2019-05-28 12:49:42 -04:00