summary refs log tree commit diff
path: root/drivers
AgeCommit message (Collapse)Author
2022-03-14media: Makefiles: sort entries where it fitsMauro Carvalho Chehab
Alphabetically sort entries at the Makefiles per group, in ASCII order, e. g., using the output of: $ LC_ALL=C sort Makefile |grep obj-y ... $ LC_ALL=C sort Makefile |grep obj.*CONFIG ... Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-12media: Makefiles: remove extra spacesMauro Carvalho Chehab
It is hard to keep all those options aligned as newer config changes get added, and we really don't want to have patches adding new options also touching already existing entries. So, drop the extra spaces. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-12media: xc2028: rename the driver from tuner-xc2028Mauro Carvalho Chehab
This is the only tuner driver that has "tuner-" on its name. Rename it, in order to match all the other tuner drivers. Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07Merge tag 'br-v5.18s' of git://linuxtv.org/hverkuil/media_tree into media_stageMauro Carvalho Chehab
Tag branch * tag 'br-v5.18s' of git://linuxtv.org/hverkuil/media_tree: ivtv: fix incorrect device_caps for ivtvfb media: rcar-csi2: Drop comma after SoC match table sentinel media: camss: Replace hard coded value with parameter media: saa7134: fix incorrect use to determine if list is empty media: MAINTAINERS: update rksip1 maintainers info MAINTAINERS: update media vimc driver maintainers media: i2c: max2175: Use rbtree rather than flat register cache Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07ivtv: fix incorrect device_caps for ivtvfbHans Verkuil
The VIDIOC_G_FBUF and related overlay ioctls no longer worked (-ENOTTY was returned). The root cause was the introduction of the caps field in ivtv-driver.h. While loading the ivtvfb module would update the video_device device_caps field with V4L2_CAP_VIDEO_OUTPUT_OVERLAY it would not update that caps field, and that's what the overlay ioctls would look at. It's a bad idea to keep information in two places, so drop the caps field and only use vdev.device_caps. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: Martin Dauskardt <martin.dauskardt@gmx.de> Fixes: 2161536516ed (media: media/pci: set device_caps in struct video_device)
2022-03-07media: rcar-csi2: Drop comma after SoC match table sentinelGeert Uytterhoeven
It does not make sense to have a comma after a sentinel, as any new elements must be added before the sentinel. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-03-07media: camss: Replace hard coded value with parameterSouptick Joarder (HPE)
Kernel test robot reported below warning -> drivers/media/platform/qcom/camss/camss-csid-gen2.c:407:3: warning: Value stored to 'val' is never read [clang-analyzer-deadcode.DeadStores] Replace hard coded value with val. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Souptick Joarder (HPE) <jrdr.linux@gmail.com> Reviewed-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-03-07media: saa7134: fix incorrect use to determine if list is emptyJakob Koschel
'dev' will *always* be set by list_for_each_entry(). It is incorrect to assume that the iterator value will be NULL if the list is empty. Instead of checking the pointer it should be checked if the list is empty. Fixes: 79dd0c69f05f ("V4L: 925: saa7134 alsa is now a standalone module") Signed-off-by: Jakob Koschel <jakobkoschel@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-03-07media: i2c: max2175: Use rbtree rather than flat register cacheMark Brown
The max2175 uses a flat register cache but supplies only a single default value and has many volatile registers. This is a poor fit for a flat cache since the cache will assume a default of zero for any register not yet written which can lead to bugs for example when regmap_update_bits() suppresses a noop write. A rbtree cache is a much better fit, this will only cache default values and values that have been written to the device with any reads of uncached values going to the hardware. Convert the driver to use a rbtree cache. Since the device is controlled via I2C the cost of manging the rbtree should be immaterial compared to the cost of accessing the device. Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-03-07media: amphion: add amphion vpu entry in Kconfig and MakefileMing Qian
Add V4L2 driver entry for the amphion vpu encoder/decoder. Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-03-07media: amphion: implement malone decoder rpc interfaceMing Qian
This part implements the malone decoder rpc interface. Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Signed-off-by: Zhou Peng <eagle.zhou@nxp.com> Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-03-07media: amphion: implement windsor encoder rpc interfaceMing Qian
This part implements the windsor encoder rpc interface. Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Signed-off-by: Zhou Peng <eagle.zhou@nxp.com> Reported-by: kernel test robot <lkp@intel.com> Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-03-07media: amphion: add v4l2 m2m vpu decoder stateful driverMing Qian
This consists of video decoder implementation plus decoder controls. Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Signed-off-by: Zhou Peng <eagle.zhou@nxp.com> Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-03-07media: amphion: add v4l2 m2m vpu encoder stateful driverMing Qian
This consists of video encoder implementation plus encoder controls. Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Signed-off-by: Zhou Peng <eagle.zhou@nxp.com> Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-03-07media: amphion: add vpu v4l2 m2m supportMing Qian
vpu_v4l2.c implements the v4l2 m2m driver methods. vpu_helpers.c implements the common helper functions vpu_color.c converts the v4l2 colorspace with the VUI parameters that specified by ITU-T | ISO/IEC Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Signed-off-by: Zhou Peng <eagle.zhou@nxp.com> Reported-by: kernel test robot <lkp@intel.com> Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-03-07media: amphion: implement vpu core communication based on mailboxMing Qian
driver use mailbox to communicate with vpu core. and there are a command buffer and a message buffer. driver will write commands to the command buffer, then trigger a vpu core interrupt vpu core will write messages to the message buffer, then trigger a cpu interrupt. Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Signed-off-by: Zhou Peng <eagle.zhou@nxp.com> Reported-by: kernel test robot <lkp@intel.com> Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-03-07media: amphion: add vpu core driverMing Qian
The vpu supports encoder and decoder. it needs vpu core to handle it. core will run either encoder or decoder firmware. This driver is for support the vpu core. Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Signed-off-by: Zhou Peng <eagle.zhou@nxp.com> Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-03-07media: amphion: add amphion vpu device driverMing Qian
The amphion vpu codec ip contains encoder and decoder. Windsor is the encoder, it supports to encode H.264. Malone is the decoder, it features a powerful video processing unit able to decode many formats, such as H.264, HEVC, and other formats. This Driver is for this IP that is based on the v4l2 mem2mem framework. Supported SoCs are: IMX8QXP, IMX8QM Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Signed-off-by: Zhou Peng <eagle.zhou@nxp.com> Reported-by: kernel test robot <lkp@intel.com> Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-03-07media: add nv12m_8l128 and nv12m_10be_8l128 video format.Ming Qian
nv12m_8l128 is 8-bit tiled nv12 format used by amphion decoder. nv12m_10be_8l128 is 10-bit tiled format used by amphion decoder. The tile size is 8x128 Signed-off-by: Ming Qian <ming.qian@nxp.com> Signed-off-by: Shijie Qin <shijie.qin@nxp.com> Signed-off-by: Zhou Peng <eagle.zhou@nxp.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
2022-03-07Merge tag 'for-5.18-2.6-signed' of git://linuxtv.org/sailus/media_tree into ↵Mauro Carvalho Chehab
media_stage Even yet more V4L2 patches for 5.18 * tag 'for-5.18-2.6-signed' of git://linuxtv.org/sailus/media_tree: media: i2c: Fix pixel array positions in ov8865 media: adv7183: Convert to GPIO descriptors media: m5mols: Convert to use GPIO descriptors media: noon010p30: Convert to use GPIO descriptors media: mt9m111: Drop unused include media: adv7511: Drop unused include media: i2c: isl7998x: Add driver for Intersil ISL7998x media: dt-bindings: Add Intersil ISL79987 DT bindings media: media-entity: Clarify media_entity_cleanup() usage media: i2c: imx274: Drop surplus includes media: i2c: ccs: Drop unused include v4l: fwnode: Remove now-redundant loop from v4l2_fwnode_parse_reference() v4l: fwnode: Drop redunant -ENODATA check in property reference parsing media: media-entity: Simplify media_pipeline_start() media: media-entity: Add media_pad_is_streaming() helper function media: Add a driver for the og01a1b camera sensor media: i2c: ov5648: Fix lockdep error media: ov5640: Fix set format, v4l2_mbus_pixelcode not updated Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: gpio-ir-tx: fix transmit with long spaces on Orange Pi PCSean Young
Calling udelay for than 1000us does not always yield the correct results. Cc: stable@vger.kernel.org Reported-by: Михаил <vrserver1@gmail.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07Merge tag 'br-v5.18q' of git://linuxtv.org/hverkuil/media_tree into media_stageMauro Carvalho Chehab
Tag branch * tag 'br-v5.18q' of git://linuxtv.org/hverkuil/media_tree: media: cec: seco: Drop pointless include media: hantro: sunxi: Fix VP9 steps media: imx: csis: Store pads format separately doc: media: Document VP9 reference_mode miss-placement doc: media: Document MM21 tiled format media: imx: imx8mq-mipi-csi2: Remove YUV422 2X8 media: v4l2-core: Initialize h264 scaling matrix media: imx: imx-mipi-csis: Add output format media: imx: imx-mipi-csis: Add BGR888 media: imx: imx-mipi-csis: Add RGB565_1X16 media: imx: imx-mipi-csis: Set PIXEL_MODE for YUV422 media: imx: imx7-media-csi: Use dual sampling for YUV 1X16 media: imx: Rename imx7-mipi-csis.c to imx-mipi-csis.c media: imx: De-stage imx7-mipi-csis Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07Merge tag 'br-v5.18l' of git://linuxtv.org/hverkuil/media_tree into media_stageMauro Carvalho Chehab
Tag branch * tag 'br-v5.18l' of git://linuxtv.org/hverkuil/media_tree: (39 commits) media: imx-jpeg: Set V4L2_BUF_FLAG_LAST at eos media: meson-ir-tx: remove incorrect doc comment media: vivid: use time_is_after_jiffies() instead of open coding it media: wl128x: use time_is_before_jiffies() instead of open coding it media: tda8083: use time_is_after_jiffies() instead of open coding it media: stv0299: use time_is_before_jiffies() instead of open coding it media: si21xx: use time_is_before_jiffies() instead of open coding it media: cedrus: h264: Fix neighbour info buffer size media: cx88-mpeg: clear interrupt status register before streaming video media: cedrus: H265: Fix neighbour info buffer size media: fsl-viu: use GFP_KERNEL media: cx18: use GFP_KERNEL drivers: meson: vdec: add VP9 support to GXM stkwebcam: add new Asus laptop to upside_down table media: imx-jpeg: fix a bug of accessing array out of bounds media: sun6i-csi: fix colorspace in sun6i_video_try_fmt() media: usb: go7007: s2250-board: fix leak in probe() media: cedrus: Add watchdog for job completion pixfmt-yuv-planar.rst: fix typo: 'Cr, Cr' -> 'Cr, Cb' media: imx-jpeg: Remove unnecessary print function dev_err() ... Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: staging: tegra-vde: De-stage driverDmitry Osipenko
The TODO of tegra-vde driver has been completed, driver now supports V4L2 stateless video decoding API. Relocate driver to drivers/media. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: staging: tegra-vde: Bump BSEV DMA timeoutDmitry Osipenko
BSEV DMA timeouts if VDE is downclocked by x10. Bump the timeout to allow DMA to complete. We don't support freq scaling yet, this is just a minor improvement which may become useful sometime later. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: staging: tegra-vde: Remove legacy UAPI supportDmitry Osipenko
The legacy UAPI became unnecessary with the V4L stateless decoder API support addition to the Tegra decoder driver. Remove legacy UAPI support. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: staging: tegra-vde: Support V4L stateless video decoder APIDmitry Osipenko
Expose Tegra video decoder as a generic V4L M2M stateless video decoder. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: staging: tegra-vde: Factor out H.264 codeDmitry Osipenko
Factor out H.264 hardware programming code into separate source file in a preparation to support V4L API by the Tegra video decoder driver. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: imx: imx8mq-mipi_csi2: Remove unneeded codeMuhammad Usama Anjum
ret is constant in imx8mq_mipi_csi_pm_suspend(). This function cannot return error. Remove the return variable. Simplify other functions which are using this function. Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: dvb_frontends: make static read-only array fec_tab constColin Ian King
The static array fec_tab is read-only so it make sense to make it const. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: dib7000p: make static read-only arrays notch and sine constColin Ian King
The static arrays notch and sine are read-only so it make sense to make them const. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: dvb_frontend: make static read-only array DIB3000MC_I2C_ADDRESS constColin Ian King
The static array DIB3000MC_I2C_ADDRESS is read-only so it make sense to make it const. Also add spaces to clean up checkpatch warnings. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: Remove usage of the deprecated "pci-dma-compat.h" APIChristophe JAILLET
In [1], Christoph Hellwig has proposed to remove the wrappers in include/linux/pci-dma-compat.h. Some reasons why this API should be removed have been given by Julia Lawall in [2]. A coccinelle script has been used to perform the needed transformation. It can be found in [3]. [1]: https://lore.kernel.org/kernel-janitors/20200421081257.GA131897@infradead.org/ [2]: https://lore.kernel.org/kernel-janitors/alpine.DEB.2.22.394.2007120902170.2424@hadrien/ [3]: https://lore.kernel.org/kernel-janitors/20200716192821.321233-1-christophe.jaillet@wanadoo.fr/ Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Mauro Carvalho Chehab <mchehab@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: mtk-vcodec: Remove duplicated include in mtk_vcodec_enc_drv.cYang Li
Fix following includecheck warning: ./drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c: linux/pm_runtime.h is included more than once. 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@kernel.org>
2022-03-07media: hdpvr: initialize dev->worker at hdpvr_register_videodevDongliang Mu
hdpvr_register_videodev is responsible to initialize a worker in hdpvr_device. However, the worker is only initialized at hdpvr_start_streaming other than hdpvr_register_videodev. When hdpvr_probe does not initialize its worker, the hdpvr_disconnect will encounter one WARN in flush_work.The stack trace is as follows: hdpvr_disconnect+0xb8/0xf2 drivers/media/usb/hdpvr/hdpvr-core.c:425 usb_unbind_interface+0xbf/0x3a0 drivers/usb/core/driver.c:458 __device_release_driver drivers/base/dd.c:1206 [inline] device_release_driver_internal+0x22a/0x230 drivers/base/dd.c:1237 bus_remove_device+0x108/0x160 drivers/base/bus.c:529 device_del+0x1fe/0x510 drivers/base/core.c:3592 usb_disable_device+0xd1/0x1d0 drivers/usb/core/message.c:1419 usb_disconnect+0x109/0x330 drivers/usb/core/hub.c:2228 Fix this by moving the initialization of dev->worker to the starting of hdpvr_register_videodev Reported-by: syzkaller <syzkaller@googlegroups.com> Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: camss: Point sm8250 at the correct vdda regulatorsBryan O'Donoghue
Reviewing the RB5 schematic its clear that we have missed out on defining both of the power-rails associated with the CSI PHY. Other PHYs such as the UFS, PCIe and USB connect to these rails and define each regulator individually. This means if we were to switch off the other various PHYs which enable these rails, the CAMSS would not appropriately power-on the CSI PHY. Reviewed-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: camss: Point sdm845 at the correct vdda regulatorsBryan O'Donoghue
Reviewing the RB3 schematic its clear that we have missed out on defining one of the power-rails associated with the CSI PHY. Other PHYs such as the UFS, PCIe and USB connect to these rails and define each regulator individually. This means if we were to switch off the other various PHYs which enable these rails, the CAMSS would not appropriately power-on the CSI PHY. Reviewed-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: camss: Set unused regulators to the empty setBryan O'Donoghue
If a CAMSS block has no regulator set the regulator array to the empty set as opposed to setting the first element of the array to NULL. Suggested-by: Bjorn Andersson <bjorn.andersson@linaro.org> Reviewed-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: camss: Add regulator_bulk supportBryan O'Donoghue
Add the ability to enable or disable multiple regulators in bulk with camss. This is useful for sm8250, sdm845 and it looks like sdm660 where we have more than one CSI regulator to do at once. It should just work for standalone existing vdda regulators and parts which don't have an explicitly defined CSI regulator. [hverkuil: fix camss-csid.c:163:13: warning: 'ret' may be used uninitialized in this function] Reported-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: davinci: vpif: Use platform_get_irq_optional() to get the interruptLad Prabhakar
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional(). While at it, propagate error code in case devm_request_irq() fails instead of returning -EINVAL. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: vidtv: Check for null return of vzallocJiasheng Jiang
As the possible failure of the vzalloc(), e->encoder_buf might be NULL. Therefore, it should be better to check it in order to guarantee the success of the initialization. If fails, we need to free not only 'e' but also 'e->name'. Also, if the allocation for ctx fails, we need to free 'e->encoder_buf' else. Fixes: f90cf6079bf6 ("media: vidtv: add a bridge driver") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: mtk-mdp: Remove redundant 'flush_workqueue()' callsXu Wang
'destroy_workqueue()' already drains the queue before destroying it, so there is no need to flush it explicitly. Remove the redundant 'flush_workqueue()' calls. Signed-off-by: Xu Wang <vulab@iscas.ac.cn> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: videobuf2-dma-contig: Invalidate vmap range before DMA rangeSergey Senozhatsky
Christoph suggests [1] that invalidating vmap range before direct mapping range makes more sense. [1]: https://lore.kernel.org/all/20220111085958.GA22795@lst.de/ Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: stk1160: use dma_alloc_noncontiguous APIDafna Hirschfeld
Replace the urb buffers allocation to use the noncontiguous API. This improves performance on ARM platforms where DMA coherent allocations produce uncached mappings. Note that the noncontiguous API requires the driver to handle synchronization. This commit is similar to this one for the uvc driver: https://lkml.org/lkml/2021/3/12/1506 Performance tests on rock-pi4 (Arm64) shows about 15x improvements: == DMA NONCONTIGUOUS == total durations: 20.63678480 sec urb processing durations: 0.286864889 sec uS/qty: 286864/2508 avg: 114.379 min: 0.583 max: 155.461 (uS) FPS: 24.92 lost: 0 done: 500 raw decode speed: 11.603 Gbits/s bytes 414831228.000 bytes/urb: 165403 == DMA COHERENT == total durations: 20.73551767 sec urb processing durations: 4.541559160 sec uS/qty: 4541559/2509 avg: 1810.107 min: 0.583 max: 2113.163 (uS) FPS: 24.90 lost: 0 done: 500 raw decode speed: 730.738 Mbits/s bytes 414785444.000 bytes/urb: 165319 Performance tests on x86 laptop show no significant difference: == DMA NONCONTIGUOUS == total durations: 20.220590102 sec urb processing durations: 0.63021818 sec uS/qty: 63021/2512 avg: 25.088 min: 0.138 max: 146.750 (uS) FPS: 24.72 lost: 0 done: 500 raw decode speed: 52.751 Gbits/s bytes 415421032.000 bytes/urb: 165374 == DMA COHERENT == total durations: 20.220475614 sec urb processing durations: 0.64751972 sec uS/qty: 64751/2512 avg: 25.777 min: 0.168 max: 132.250 (uS) FPS: 24.72 lost: 0 done: 500 raw decode speed: 51.927 Gbits/s bytes 415422794.000 bytes/urb: 165375 [hverkuil: incorporated Ezequiel's suggestions from his review] Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: stk1160: move transfer_buffer and urb to same struct 'stk1160_urb'Dafna Hirschfeld
Instead of having two separated arrays, one for the urbs and one for their buffers, have one array of a struct containing both. In addition, the array is just 16 pointers, no need to dynamically allocate it. Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: stk1160: If start stream fails, return buffers with VB2_BUF_STATE_QUEUEDDafna Hirschfeld
If the callback 'start_streaming' fails, then all queued buffers in the driver should be returned with state 'VB2_BUF_STATE_QUEUED'. Currently, they are returned with 'VB2_BUF_STATE_ERROR' which is wrong. Fix this. This also fixes the warning: [ 65.583633] WARNING: CPU: 5 PID: 593 at drivers/media/common/videobuf2/videobuf2-core.c:1612 vb2_start_streaming+0xd4/0x160 [videobuf2_common] [ 65.585027] Modules linked in: snd_usb_audio snd_hwdep snd_usbmidi_lib snd_rawmidi snd_soc_hdmi_codec dw_hdmi_i2s_audio saa7115 stk1160 videobuf2_vmalloc videobuf2_memops videobuf2_v4l2 videobuf2_common videodev mc crct10dif_ce panfrost snd_soc_simple_card snd_soc_audio_graph_card snd_soc_spdif_tx snd_soc_simple_card_utils gpu_sched phy_rockchip_pcie snd_soc_rockchip_i2s rockchipdrm analogix_dp dw_mipi_dsi dw_hdmi cec drm_kms_helper drm rtc_rk808 rockchip_saradc industrialio_triggered_buffer kfifo_buf rockchip_thermal pcie_rockchip_host ip_tables x_tables ipv6 [ 65.589383] CPU: 5 PID: 593 Comm: v4l2src0:src Tainted: G W 5.16.0-rc4-62408-g32447129cb30-dirty #14 [ 65.590293] Hardware name: Radxa ROCK Pi 4B (DT) [ 65.590696] pstate: 80000005 (Nzcv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 65.591304] pc : vb2_start_streaming+0xd4/0x160 [videobuf2_common] [ 65.591850] lr : vb2_start_streaming+0x6c/0x160 [videobuf2_common] [ 65.592395] sp : ffff800012bc3ad0 [ 65.592685] x29: ffff800012bc3ad0 x28: 0000000000000000 x27: ffff800012bc3cd8 [ 65.593312] x26: 0000000000000000 x25: ffff00000d8a7800 x24: 0000000040045612 [ 65.593938] x23: ffff800011323000 x22: ffff800012bc3cd8 x21: ffff00000908a8b0 [ 65.594562] x20: ffff00000908a8c8 x19: 00000000fffffff4 x18: ffffffffffffffff [ 65.595188] x17: 000000040044ffff x16: 00400034b5503510 x15: ffff800011323f78 [ 65.595813] x14: ffff000013163886 x13: ffff000013163885 x12: 00000000000002ce [ 65.596439] x11: 0000000000000028 x10: 0000000000000001 x9 : 0000000000000228 [ 65.597064] x8 : 0101010101010101 x7 : 7f7f7f7f7f7f7f7f x6 : fefefeff726c5e78 [ 65.597690] x5 : ffff800012bc3990 x4 : 0000000000000000 x3 : ffff000009a34880 [ 65.598315] x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff000007cd99f0 [ 65.598940] Call trace: [ 65.599155] vb2_start_streaming+0xd4/0x160 [videobuf2_common] [ 65.599672] vb2_core_streamon+0x17c/0x1a8 [videobuf2_common] [ 65.600179] vb2_streamon+0x54/0x88 [videobuf2_v4l2] [ 65.600619] vb2_ioctl_streamon+0x54/0x60 [videobuf2_v4l2] [ 65.601103] v4l_streamon+0x3c/0x50 [videodev] [ 65.601521] __video_do_ioctl+0x1a4/0x428 [videodev] [ 65.601977] video_usercopy+0x320/0x828 [videodev] [ 65.602419] video_ioctl2+0x3c/0x58 [videodev] [ 65.602830] v4l2_ioctl+0x60/0x90 [videodev] [ 65.603227] __arm64_sys_ioctl+0xa8/0xe0 [ 65.603576] invoke_syscall+0x54/0x118 [ 65.603911] el0_svc_common.constprop.3+0x84/0x100 [ 65.604332] do_el0_svc+0x34/0xa0 [ 65.604625] el0_svc+0x1c/0x50 [ 65.604897] el0t_64_sync_handler+0x88/0xb0 [ 65.605264] el0t_64_sync+0x16c/0x170 [ 65.605587] ---[ end trace 578e0ba07742170d ]--- Fixes: 8ac456495a33d ("[media] stk1160: Stop device and unqueue buffers when start_streaming() fails") Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: stk1160: fix number of buffers in case not all buffers are createdDafna Hirschfeld
In case we fail to allocate a transfer_buffer then we break the buffers creation loop and update the number of buffers to the number of successfully allocated which should be 'i' and not 'i - 1' nor 'i + 1' Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: hantro: Add support for i.MX8MM Hantro-G1Adam Ford
The i.MX8MM has a Hantro G1 video decoder similar to the imx8mq but lacks the post-processor present in the imx8mq. Add support in the driver for it with the post-processing removed. Signed-off-by: Adam Ford <aford173@gmail.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: hantro: Allow i.MX8MQ G1 and G2 to run independentlyAdam Ford
The VPU in the i.MX8MQ is really the combination of Hantro G1 and Hantro G2. With the updated vpu-blk-ctrl, the power domains system can enable and disable them separately as well as pull them out of reset. This simplifies the code and lets them run independently while still retaining backwards compatibility with older device trees for those using G1. Signed-off-by: Adam Ford <aford173@gmail.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: cec: seco: add newlines in debug messagesEttore Chimenti
Newlines were missing in almost all regular and debug printk. Signed-off-by: Ettore Chimenti <ek5.chimenti@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>