summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* media: i2c: Remove common dependencies from sensor driversSakari Ailus2023-08-103-222/+10
| | | | | | | | | | | | | | | As selecting V4L2_FWNODE, MEDIA_CONTROLLER and VIDEO_V4L2_SUBDEV_API are now selected by the top level menu, they can be dropped from the individual drivers. Also dropped selecting V4L2_ASYNC for a single driver as this is already implied by V4L2_FWNODE. Similarly, the I2C dependency is now also in the top level menu, so remove it, as well as VIDEO_DEV which isn't needed by camera sensor drivers. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
* media: i2c: Add a camera sensor top level menuSakari Ailus2023-08-101-3/+10
| | | | | | | | | | | | | | | | | | | | Select V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API for all sensor drivers. This also adds the options to drivers that don't specifically need them, these are still seldom used drivers using old APIs. The upside is that these should now all compile --- many drivers have had missing dependencies. The "menu" is replaced by selectable "menuconfig" to select the needed V4L2_FWNODE and VIDEO_V4L2_SUBDEV_API options. Also select MEDIA_CONTROLLER which VIDEO_V4L2_SUBDEV_API effectively depends on, and add the I2C dependency to the menu. Reported-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: stable@vger.kernel.org # for >= 6.1 Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
* media: imx: imx7-media-csi: Fix frame sizes enumerationLaurent Pinchart2023-08-101-6/+8
| | | | | | | | | Enumeration of the minimum, maximum and step values for the image width does not take hardware constraints into account. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: nxp: imx8-isi: Add ISI support for i.MX93Guoniu.zhou2023-08-103-0/+48
| | | | | | | | | | | i.MX93 uses a different gasket which has different register definitions compared with i.MX8. Hence implement the gasket callbacks in order to add ISI support for i.MX93. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: nxp: imx8-isi: Move i.MX8 gasket configuration to an ops structureGuoniu.zhou2023-08-105-36/+76
| | | | | | | | | | | The i.MX93 includes an ISI instance compatible with the imx8-isi driver, but with a different gasket. To prepare for this, make the gasket configuration modular by moving the code to an ops structure. Signed-off-by: Guoniu.zhou <guoniu.zhou@nxp.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: nxp: Fix wrong return pointer check in mxc_isi_crossbar_init()Yang Yingliang2023-08-101-1/+1
| | | | | | | | | | | | It should check 'xbar->inputs', when allocate memory for it. Cc: stable@vger.kernel.org Fixes: cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* staging: media: imx: Merge VIDEO_IMX_CSI into VIDEO_IMX_MEDIALaurent Pinchart2023-08-102-18/+6
| | | | | | | | | | | | The VIDEO_IMX_MEDIA Kconfig symbol used to select helpers shared between independent drivers for different i.MX SoCs, and VIDEO_IMX_MEDIA then selects drivers specific to the i.MX5 and i.MX6. Now that i.MX7 and i.MX8 support has moved to drivers/media/ and doesn't depend on VIDEO_IMX_CSI, there's no need to have separate Kconfig options. Merge VIDEO_IMX_CSI into VIDEO_IMX_MEDIA. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: ds90ub960: Rename RXPORT_MODE_CSI2_ASYNC to RXPORT_MODE_CSI2_NONSYNCTomi Valkeinen2023-08-101-11/+11
| | | | | | | | | | | | | FPD-Link has an operating mode that used to be called "asynchronous" in the hardware documentation, but that has been changed to non-synchronous already quite a while back. The ub960 driver still had one instance of the old naming, so let's rename it. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: ds90ub953: Support non-sync modeTomi Valkeinen2023-08-101-8/+28
| | | | | | | | | | | Add support for FPD-Link non-sync mode with external clock. The only thing that needs to be added is the calculation for the clkout. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: ds90ub953: Restructure clkout managementTomi Valkeinen2023-08-101-65/+76
| | | | | | | | | | | | | Separate clkout calculations and register writes into two functions: ub953_calc_clkout_params and ub953_write_clkout_regs, and add a struct ub953_clkout_data that is used to store the clkout parameters. This simplifies the clkout management. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: ds90ub960: Allow FPD-Link async modeTomi Valkeinen2023-08-101-1/+0
| | | | | | | | | | | | Allow using FPD-Link in async mode. The driver handles it correctly, but the mode was blocked at probe time as there wasn't HW to test this with. Now the mode has been tested, and it works. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: ds90ub953: Handle V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCKTomi Valkeinen2023-08-101-1/+5
| | | | | | | | | | | Handle V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK flag to configure the CSI-2 RX continuous/non-continuous clock register. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: ds90ub913: Use v4l2_fwnode_endpoint_parse()Tomi Valkeinen2023-08-101-12/+21
| | | | | | | | | | Use v4l2_fwnode_endpoint_parse() to parse the sink endpoint parameters. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: ds90ub953: Use v4l2_fwnode_endpoint_parse()Tomi Valkeinen2023-08-101-6/+13
| | | | | | | | | | Use v4l2_fwnode_endpoint_parse() to parse the sink endpoint parameters. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: ds90ub960: Configure CSI-2 continuous clockTomi Valkeinen2023-08-101-0/+8
| | | | | | | | | | | Use 'clock-noncontinuous' from DT to configure the continuous/non-continuous clock setting for the TX ports. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: ds90ub9x3: Fix sub-device matchingTomi Valkeinen2023-08-102-25/+2
| | | | | | | | | | | | | Commit 1029939b3782 ("media: v4l: async: Simplify async sub-device fwnode matching") recently changed how async sub-device matching works. This breaks the UB9x3 drivers, as they set the subdev.fwnode to an endpoint. Afaiu, the fix is simply to not set subdev.fwnode at all. Fixes: 1029939b3782 ("media: v4l: async: Simplify async sub-device fwnode matching") Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Cc: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: firewire: firedtv-avc.c: replace BUG with proper, error returnHans Verkuil2023-08-101-1/+3
| | | | | | | | This resolves this smatch error: drivers/media/firewire/firedtv-avc.c:602 avc_tuner_dsd() error: uninitialized symbol 'pos'. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: usb: pvrusb2: fix inconsistent indentingHans Verkuil2023-08-101-2/+4
| | | | | | | | This resolves a new smatch warning; drivers/media/usb/pvrusb2/pvrusb2-hdw.c:3293 pvr2_hdw_get_tuner_status() warn: inconsistent indenting Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: tegra_cec: fix the return value handle for platform_get_irq()Ruan Jinjie2023-08-101-2/+2
| | | | | | | | | There is no possible for platform_get_irq() to return 0, and the return value of platform_get_irq() is more sensible to show the error reason. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: cx23885: debug cosmeticsMariusz Bialonczyk2023-08-101-3/+3
| | | | | | | | This commit is fixing the module in a way that trailing spaces at the end of the line in the debug/dmesg are gone. Signed-off-by: Mariusz Bialonczyk <manio@skyboo.net> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: nxp: Remove redundant dev_err()Ruan Jinjie2023-08-102-2/+0
| | | | | | | | | | There is no need to call the dev_err() function directly to print a custom message when handling an error from platform_get_irq() function as it is going to display an appropriate error message in case of a failure. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: rcar_jpu: Remove redundant dev_err()Ruan Jinjie2023-08-101-3/+1
| | | | | | | | | | There is no need to call the dev_err() function directly to print a custom message when handling an error from platform_get_irq() function as it is going to display an appropriate error message in case of a failure. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: jpeg-core: Remove redundant dev_err()Ruan Jinjie2023-08-101-3/+1
| | | | | | | | | | There is no need to call the dev_err() function directly to print a custom message when handling an error from platform_get_irq() function as it is going to display an appropriate error message in case of a failure. Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Acked-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: dvb: mb86a16: check the return value of mb86a16_read()Yuanjun Gong2023-08-101-4/+6
| | | | | | | | | return an error code if mb86a16_read() gets an unexpected return value. Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil: add {} around the else statement]
* media: stm32: dcmi: only call s_stream on the source subdevAlain Volmat2023-08-101-49/+14
| | | | | | | | | | Avoid calling s_stream on each subdev until reaching the sensor and instead call s_stream on the source subdev only (which will in turn do whatever needed to start the stream). Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> Reviewed-by: Hugues FRUCHET <hugues.fruchet@foss.st.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: i2c: st_mipid02: cascade s_stream call to the source subdevAlain Volmat2023-08-101-1/+12
| | | | | | | | | Cascade the s_stream call to the source subdev whenever the bridge streaming is enable / disabled. Signed-off-by: Alain Volmat <alain.volmat@foss.st.com> Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: Fix firmware path for sm8250Patrick Whewell2023-08-101-1/+1
| | | | | | | | | The firmware path for the sm8250 resources is incorrect. This fixes the path to address the firmware correctly. Signed-off-by: Patrick Whewell <patrick.whewell@sightlineapplications.com> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: firmware: Use of_reserved_mem_lookup()Stephan Gerhold2023-08-101-11/+13
| | | | | | | | | | | | | | | | | | Reserved memory can be either looked up using the generic function of_address_to_resource() or using the special of_reserved_mem_lookup(). The latter has the advantage that it ensures that the referenced memory region was really reserved and is not e.g. status = "disabled". of_reserved_mem also supports allocating reserved memory dynamically at boot time. This works only when using of_reserved_mem_lookup() since there won't be a fixed address in the device tree. Switch the code to use of_reserved_mem_lookup(). There is no functional difference for static reserved memory allocations. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: core: Set up secure memory ranges for SC7180Konrad Dybcio2023-08-101-0/+4
| | | | | | | | | | | Not all SC7180 devices ship with ChromeOS firmware. WoA devices use Android-like TZ, which uses PAS for image authentication. That requires the predefined virtual address ranges to be passed via scm calls. Define them to enable Venus on non-CrOS SC7180 devices. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: hfi_venus: Restrict writing SCIACMDARG3 to Venus V1/V2Konrad Dybcio2023-08-101-1/+2
| | | | | | | | | | | This write was last present on msm-3.10, which means before HFI3XX platforms were introduced. Guard it with an appropriate if condition. Does not seem to have any adverse effects on at least SM8250. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: Use newly-introduced hfi_buffer_requirements accessorsKonrad Dybcio2023-08-102-13/+14
| | | | | | | | | Now that we have a way which is independent of the HFI version to set the correct fields in hfi_buffer_requirements, use it! Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: Introduce accessors for remapped hfi_buffer_reqs membersKonrad Dybcio2023-08-107-18/+63
| | | | | | | | | | | Currently we have macros to access these, but they don't provide a way to override the remapped fields. Replace the macros with actual get/set pairs to fix that. Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: vdec: Sanitize vdec_set_work_route() per-VPU-versionKonrad Dybcio2023-08-101-1/+1
| | | | | | | | | Replace the general IS_V6 checks with more specific VPU version checks. Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: hfi_platform: Check vpu_version instead of device compatibleKonrad Dybcio2023-08-101-1/+1
| | | | | | | | | | This is not a matter of the host SoC, but the VPU chip in Venus. Fix it. Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: firmware: Sanitize per-VPU-versionKonrad Dybcio2023-08-101-4/+4
| | | | | | | | Replace the general IS_V6 checks with more specific VPU version checks. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: hfi_venus: Sanitize venus_cpu_idle_and_pc_ready() per-VPU-versionKonrad Dybcio2023-08-101-1/+1
| | | | | | | | Replace the general IS_V6 checks with more specific VPU version checks. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: hfi_venus: Sanitize venus_cpu_and_video_core_idle() ↵Konrad Dybcio2023-08-101-1/+1
| | | | | | | | | | per-VPU-version Replace the general IS_V6 checks with more specific VPU version checks. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: hfi_venus: Sanitize venus_isr() per-VPU-versionKonrad Dybcio2023-08-101-2/+2
| | | | | | | | | Replace the general IS_V6 checks with more specific VPU version checks. Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: hfi_venus: Sanitize venus_halt_axi() per-VPU-versionKonrad Dybcio2023-08-101-2/+2
| | | | | | | | | | | Only IRIS2(_1) should enter the until-now-IS_V6() path and IRIS2_1 can be used instead of openly checking the number of VPP pipes. Use VPU version comparison in both of these cases instead. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: core: Assign registers based on VPU versionKonrad Dybcio2023-08-101-1/+1
| | | | | | | | | The current assumption of IS_V6 is overgeneralized. Adjust the logic to take the VPU hardware version into account. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: hfi_venus: Sanitize venus_boot_core() per-VPU-versionKonrad Dybcio2023-08-101-3/+4
| | | | | | | | | The current assumption of IS_V6 is overgeneralized. Adjust the logic to take the VPU hardware version into account. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: firmware: Leave a clue about obtaining CP VARsKonrad Dybcio2023-08-101-0/+10
| | | | | | | | | | | | | | | | The qcom_scm_mem_protect_video_var accepts two sets of <addr size> pairs as arguments. They describe the virtual address ranges of the CP (Content Protection) and CP_NONPIXEL regions. It is however not immediately obvious how to obtain these values. Leave a comment explaining how one can translate the vendor device tree properties for use with the mainline driver. Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com> Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: Add vpu_version to most SoCsKonrad Dybcio2023-08-101-0/+5
| | | | | | | | | | | Add vpu_version where I was able to retrieve the information to allow for more precise hardware-specific code path matching. Reviewed-by: Dikshita Agarwal <quic_dikshita@quicinc.com> Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: Introduce VPU version distinctionKonrad Dybcio2023-08-101-0/+15
| | | | | | | | | | | | | | | The Video Processing Unit hardware version is the differentiator, based on which the video driver should decide which code paths to take. Up until now, we've relied on HFI versions instead, but that was just a happy accident between recent SoCs. Add a field in the res struct and add correlated definitions that will be used to account for the aforementioned differences. Reviewed-by: Vikash Garodia <quic_vgarodia@quicinc.com> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: hfi_venus: Write to VIDC_CTRL_INIT after unmasking interruptsKonrad Dybcio2023-08-101-1/+1
| | | | | | | | | | | | | The startup procedure shouldn't be started with interrupts masked, as that may entail silent failures. Kick off initialization only after the interrupts are unmasked. Cc: stable@vger.kernel.org # v4.12+ Fixes: d96d3f30c0f2 ("[media] media: venus: hfi: add Venus HFI files") Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: venus: hfi_venus: Only consider sys_idle_indicator on V1Konrad Dybcio2023-08-101-12/+6
| | | | | | | | | | | | | | | | | | | As per information from Qualcomm [1], this property is not really supported beyond msm8916 (HFI V1) and some newer HFI versions really dislike receiving it, going as far as crashing the device. Only consider toggling it (via the module option) on HFIV1. While at it, get rid of the global static variable (which defaulted to zero) which was never explicitly assigned to for V1. Note: [1] is a reply to the actual message in question, as lore did not properly receive some of the emails.. [1] https://lore.kernel.org/lkml/955cd520-3881-0c22-d818-13fe9a47e124@linaro.org/ Fixes: 7ed9e0b3393c ("media: venus: hfi, vdec: v6 Add IS_V6() to existing IS_V4() if locations") Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: mediatek: vcodec: Fix possible invalid memory access for encoderYunfei Dong2023-08-102-4/+37
| | | | | | | | | | | The vpu maybe null pointer or unreasonable value when scp crash, need to validate that the vpu pointer and the vpu instance within this context is valid in case of leading to kernel reboot. Fixes: 27a274db6b4c ("[media] vcodec: mediatek: Add Mediatek VP8 Video Encoder Driver") Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Reported-by: Steve Cho <stevecho@google.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: mediatek: vcodec: Fix possible invalid memory access for decoderYunfei Dong2023-08-102-28/+53
| | | | | | | | | | | | The vpu maybe null pointer or unreasonable value when scp crash, need to validate that the vpu pointer and the vpu instance within this context is valid in case of leading to kernel reboot. Fixes: 590577a4e525 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver") Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Reported-by: Steve Cho <stevecho@google.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: mediatek: vcodec: Add driver to support 10bitMingjia Zhang2023-08-103-4/+167
| | | | | | | | | | | | | | | Adding to support capture formats V4L2_PIX_FMT_MT2110T and V4L2_PIX_FMT_MT2110R for 10bit playback. Need to get the size of each plane again when user space setting syntax to get 10bit information. V4L2_PIX_FMT_MT2110T for AV1/VP9/HEVC. V4L2_PIX_FMT_MT2110R for H264. Signed-off-by: Mingjia Zhang <mingjia.zhang@mediatek.com> Co-developed-by: Yunfei Dong <yunfei.dong@mediatek.com> Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
* media: mediatek: vcodec: Add capture format to support 10bit raster modeMingjia Zhang2023-08-102-0/+3
| | | | | | | | | | Define one uncompressed capture format V4L2_PIX_FMT_MT2110R in order to support 10bit for H264 in mt8195. Signed-off-by: Mingjia Zhang <mingjia.zhang@mediatek.com> Co-developed-by: Yunfei Dong <yunfei.dong@mediatek.com> Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>