summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* media: firmware: qcom_scm: Add memory protect virtual address rangesStanimir Varbanov2020-09-143-0/+32
| | | | | | | | | This adds a new SCM memprotect command to set virtual address ranges. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Reviewed-by: Elliot Berman <eberman@codeaurora.org> Acked-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: venus: venc: Use helper to set profile and levelStanimir Varbanov2020-09-143-180/+6
| | | | | | | | We have a new helper to set profile and level use it instead. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: venus: vdec: Use helper to get profile and levelStanimir Varbanov2020-09-141-6/+5
| | | | | | | | | Currently the returned profile and level is not aligned with v4l2 ctrl id. Correct that by use the helpers which translate the v4l2 <-> hfi mapping internally. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: venus: vdec: Set/Get VP9 profile/levelStanimir Varbanov2020-09-141-1/+19
| | | | | | | Get and set VP9 codec profile and levels. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: venus: helpers: Add a helper to map v4l2 ids to HFI idsStanimir Varbanov2020-09-142-0/+241
| | | | | | | | | Introduce a helper to set and get profile and levels which includes the translation between v4l2 ctrl ids and HFI ids. The input arguments are always in v4l2 ids space. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: venus: hfi_helper: Add VP9 profile and levelsStanimir Varbanov2020-09-141-0/+18
| | | | | | | Add HFI defines for VP9 codec profile and levels. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: v4l2-ctrl: Add VP9 codec levelsStanimir Varbanov2020-09-143-0/+81
| | | | | | | | | | | | | | | | Add menu control for VP9 codec levels. A total of 14 levels are defined for Profile 0 (8bit) and Profile 2 (10bit). Each level is a set of constrained bitstreams coded with targeted resolutions, frame rates, and bitrates. The definitions have been taken from webm project [1]. [1] https://www.webmproject.org/vp9/levels/ Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: venus: core: Drop local dma_parmsRobin Murphy2020-09-141-9/+1
| | | | | | | | | | | | Since commit 9495b7e92f71 ("driver core: platform: Initialize dma_parms for platform devices"), struct platform_device already provides a dma_parms structure, so we can save allocating another one. Also the DMA segment size is simply a size, not a bitmask. Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: media/test-drivers/Kconfig: fix broken KconfigHans Verkuil2020-09-121-10/+10
| | | | | | | | | menuconfig DVB_TEST_DRIVERS should be added after the V4L_TEST_DRIVERS, otherwise there are no drivers listed in these two menus. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Fixes: 24fb190e92e0 ("media: vidtv: implement a tuner driver") Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: vidtv: fix driver unbind/removeMauro Carvalho Chehab2020-09-123-22/+3
| | | | | | | | The current remove logic is broken and causes an OOPS. Fix it. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: Documentation: vidtv: Add ReST documentation for vidtvDaniel W. S. Almeida2020-09-122-0/+418
| | | | | | | | | | | | | | | | | | Add documentation for the Virtual Digital TV driver (vidtv) in the Restructured Text (ReST) format. This discusses: - What is vidtv - Why vidtv is needed - How to build and run vidtv - How vidtv is structured - How to test vidtv - How to improve vidtv [mchehab: fixed bad whitespaces] Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: vidtv: add a bridge driverDaniel W. S. Almeida2020-09-1218-1/+5290
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Digital TV devices consist of several independent hardware components which are controlled by different drivers. Each media device is controlled by a group of cooperating drivers with the bridge driver as the main driver. This patch adds a bridge driver for the Virtual Digital TV driver [vidtv]. The bridge driver binds to the other drivers, that is, vidtv_tuner and vidtv_demod and implements the digital demux logic, providing userspace with a MPEG Transport Stream. The MPEG related code is split in the following way: - vidtv_ts: code to work with MPEG TS packets, such as TS headers, adaptation fields, PCR packets and NULL packets. - vidtv_psi: this is the PSI generator. PSI packets contain general information about a MPEG Transport Stream. A PSI generator is needed so userspace apps can retrieve information about the Transport Stream and eventually tune into a (dummy) channel. Because the generator is implemented in a separate file, it can be reused elsewhere in the media subsystem. Currently vidtv supports working with 3 PSI tables: PAT, PMT and SDT. - vidtv_pes: implements the PES logic to convert encoder data into MPEG TS packets. These can then be fed into a TS multiplexer and eventually into userspace. - vidtv_s302m: implements a S302M encoder to make it possible to insert PCM audio data in the generated MPEG Transport Stream. This shall enable passing an audio signal into userspace so it can be decoded and played by media software. - vidtv_channels: Implements a 'channel' abstraction When vidtv boots, it will create some hardcoded channels: Their services will be concatenated to populate the SDT. Their programs will be concatenated to populate the PAT For each program in the PAT, a PMT section will be created The PMT section for a channel will be assigned its streams. Every stream will have its corresponding encoder polled to produce TS packets These packets may be interleaved by the mux and then delivered to the bridge - vidtv_mux - Implements a MPEG TS mux, loosely based on the ffmpeg implementation The multiplexer is responsible for polling encoders, interleaving packets, padding the resulting stream with NULL packets if necessary and then delivering the resulting TS packets to the bridge driver so it can feed the demux. Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: vidtv: implement a demodulator driverDaniel W. S. Almeida2020-09-123-1/+515
| | | | | | | | | | | | Implement a I2C demodulator driver, simulating support for DVB-T, DVB-C and DVB-S. This demodulator will periodically check the signal quality against a table and drop the TS lock if it drops below a threshold value, regaining it in the event that the signal improves. Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: vidtv: implement a tuner driverDaniel W. S. Almeida2020-09-127-0/+511
| | | | | | | | | | | | The virtual DVB test driver serves as a reference DVB driver and helps validate the existing APIs in the media subsystem. It can also aid developers working on userspace applications. This dummy tuner should support common TV standards such as DVB-T/T2/S/S2, ISDB-T and ATSC when completed. Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: av7110: don't do float point mathMauro Carvalho Chehab2020-09-121-2/+2
| | | | | | | | | | | | | | | | | | | | It sounds that earlier versions of GCC have troubles when doing const math at compile time, if no typecast is used: on i386: ERROR: modpost: "__floatunsidf" [drivers/media/pci/ttpci/dvb-ttpci.ko] undefined! ERROR: modpost: "__ltdf2" [drivers/media/pci/ttpci/dvb-ttpci.ko] undefined! The warning was generated on gcc (SUSE Linux) 7.5.0. Gcc 9.2 compiles it fine. As an added bonus, it also fixes this objtool warning: drivers/media/pci/ttpci/av7110_v4l.c:163:11: error: SSE register return with SSE disabled Reported-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: ov8856: Add support for 3264x2448 modeRobert Foss2020-09-101-0/+215
| | | | | | | | | OV8856 supports 3264x2448 @ 30 FPS, which is added in this commit. Signed-off-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: ov8856: Add support for 1632x1224 modeRobert Foss2020-09-101-0/+215
| | | | | | | | | OV8856 supports 1632x1224 @ 60 FPS, which is added in this commit. Signed-off-by: Robert Foss <robert.foss@linaro.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: v4l2-fwnode: Document new usage patterns of v4l2_fwnode_endpoint_parseSakari Ailus2020-09-101-10/+8
| | | | | | | | | | | | | Document that it is possible to provide defaults for multiple bus types to v4l2_fwnode_endpoint_parse and v4l2_fwnode_endpoint_alloc_parse. Also underline the fact that detecting the bus type without bus-type property is only for the old drivers. Also correct capitalisation of BT.656. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: v4l2-fwnode: Make bus configuration a structSakari Ailus2020-09-101-2/+2
| | | | | | | | | | | | The bus specific parameters were a union. This made providing bus specific defaults impossible as the memory used to store the defaults for multiple different busses was the same. Make it struct instead. It's not large so the size isn't really an issue. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: v4l2-fwnode: Make number of data lanes a characterSakari Ailus2020-09-101-1/+1
| | | | | | | | The maximum is currently four (4). No short is needed. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: i2c: max9286: Allocate v4l2_async_subdev dynamicallyLaurent Pinchart2020-09-101-19/+21
| | | | | | | | | | | | | | | | | | | | | | | | v4l2_async_notifier_add_subdev() requires the asd to be allocated dynamically, but the max9286 driver embeds it in the max9286_source structure. This causes memory corruption when the notifier is destroyed at remove time with v4l2_async_notifier_cleanup(). Fix this issue by registering the asd with v4l2_async_notifier_add_fwnode_subdev(), which allocates it dynamically internally. A new max9286_asd structure is introduced, to store a pointer to the corresonding max9286_source that needs to be accessed from bound and unbind callbacks. There's no need to take an extra explicit reference to the fwnode anymore as v4l2_async_notifier_add_fwnode_subdev() does so internally. While at it, use %u instead of %d to print the unsigned index in the error message from the v4l2_async_notifier_add_fwnode_subdev() error path. Fixes: 66d8c9d2422d ("media: i2c: Add MAX9286 driver") Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: rcar-csi2: Allocate v4l2_async_subdev dynamicallyLaurent Pinchart2020-09-101-14/+10
| | | | | | | | | | | | | | | | v4l2_async_notifier_add_subdev() requires the asd to be allocated dynamically, but the rcar-csi2 driver embeds it in the rcar_csi2 structure. This causes memory corruption when the notifier is destroyed at remove time with v4l2_async_notifier_cleanup(). Fix this issue by registering the asd with v4l2_async_notifier_add_fwnode_subdev(), which allocates it dynamically internally. Fixes: 769afd212b16 ("media: rcar-csi2: add Renesas R-Car MIPI CSI-2 receiver driver") Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: rcar_drif: Allocate v4l2_async_subdev dynamicallyLaurent Pinchart2020-09-101-12/+6
| | | | | | | | | | | | | | | | v4l2_async_notifier_add_subdev() requires the asd to be allocated dynamically, but the rcar-drif driver embeds it in the rcar_drif_graph_ep structure. This causes memory corruption when the notifier is destroyed at remove time with v4l2_async_notifier_cleanup(). Fix this issue by registering the asd with v4l2_async_notifier_add_fwnode_subdev(), which allocates it dynamically internally. Fixes: d079f94c9046 ("media: platform: Switch to v4l2_async_notifier_add_subdev") Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: rcar_drif: Fix fwnode reference leak when parsing DTLaurent Pinchart2020-09-101-11/+5
| | | | | | | | | | | The fwnode reference corresponding to the endpoint is leaked in an error path of the rcar_drif_parse_subdevs() function. Fix it, and reorganize fwnode reference handling in the function to release references early, simplifying error paths. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: v4l2-async: Document asd allocation requirementsLaurent Pinchart2020-09-101-2/+3
| | | | | | | | | | | | | | | | | The v4l2_async_notifier_add_subdev() function requires the asd pointer it receives to be allocated dynamically, but doesn't explicitly say so. Only one driver out of 13 get its right (atmel-sama5d2-isc.c, but with memory leaks in the error paths), clearly showing we have an issue. Update the v4l2_async_notifier_add_subdev() documentation to clearly state the allocation requirement. Whether this will be enough to avoid new offending code isn't certain, but it's a good first step nonetheless. Fixes: 9ca465312132 ("media: v4l: fwnode: Support generic parsing of graph endpoints in a device") Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: i2c: ov5640: Fail probe on unsupported bus_typeLad Prabhakar2020-09-101-0/+7
| | | | | | | | | Fail probe if unsupported bus_type is detected. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: i2c: ov5640: Add support for BT656 modeLad Prabhakar2020-09-101-12/+34
| | | | | | | | | | Enable support for BT656 mode. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: i2c: ov5640: Configure HVP lines in s_power callbackLad Prabhakar2020-09-101-65/+58
| | | | | | | | | | | | | Configure HVP lines in s_power callback instead of configuring everytime in ov5640_set_stream_dvp(). Alongside also disable MIPI in DVP mode. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Tested-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: i2c: ov5640: Enable data pins on poweron for DVP modeLad Prabhakar2020-09-101-33/+40
| | | | | | | | | | | | | | | | | | | | | During testing this sensor on iW-RainboW-G21D-Qseven platform in 8-bit DVP mode with rcar-vin bridge noticed the capture worked fine for the first run (with yavta), but for subsequent runs the bridge driver waited for the frame to be captured. Debugging further noticed the data lines were enabled/disabled in stream on/off callback and dumping the register contents 0x3017/0x3018 in ov5640_set_stream_dvp() reported the correct values, but yet frame capturing failed. To get around this issue data lines are enabled in s_power callback. (Also the sensor remains in power down mode if not streaming so power consumption shouldn't be affected) Fixes: f22996db44e2d ("media: ov5640: add support of DVP parallel interface") Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Tested-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: i2c: ov5640: Separate out mipi configuration from s_powerLad Prabhakar2020-09-101-56/+60
| | | | | | | | | | | In preparation for adding DVP configuration in s_power callback move mipi configuration into separate function Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Tested-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: i2c: ov5640: Remain in power down for DVP mode unless streamingLad Prabhakar2020-09-101-3/+16
| | | | | | | | | | | Keep the sensor in software power down mode and wake up only in ov5640_set_stream_dvp() callback. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com> Tested-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: v4l2-fwnode: Use debug level for printing link frequenciesSakari Ailus2020-09-101-2/+2
| | | | | | | | | pr_info() was accidentally used to print the link frequencies whereas the rest of the information is printed on debug level. Fix that by using pr_debug() also for link frequencies. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: i2c: Remove Alan Chiang's e-mail addressSakari Ailus2020-09-102-2/+2
| | | | | | | Alan Chiang's e-mail address no longer works. Remove it. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: ipu3-cio2: Update Copyright year and fix indentation issuesAndy Shevchenko2020-09-101-4/+3
| | | | | | | | | Update Copyright year to cover the previous changes and at the same time address indentation issues. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: ipu3-cio2: Drop useless assignmentsAndy Shevchenko2020-09-101-2/+2
| | | | | | | | | There are assignments inside the functions which are useless. Drop them for good. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: ipu3-cio2: Drop bogus check and error messageAndy Shevchenko2020-09-101-8/+1
| | | | | | | | | | pcim_iomap_table() won't fail if previous pcim_iomap_regions() hasn't. Since we check pcim_iomap_regions() for failure the check close to pcim_iomap_table() is bogus and not needed. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: ipu3-cio2: Get rid of pci_set_master() duplicationAndy Shevchenko2020-09-101-21/+5
| | | | | | | | | It's unclear why driver repeats the code from PCI core. Drop it for good. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: ipu3-cio2: Use readl_poll_timeout() helperAndy Shevchenko2020-09-101-9/+9
| | | | | | | | | We may use special helper macro to poll IO till condition or timeout occurs. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: ipu3-cio2: Replace infinite loop by one with clear exit conditionAndy Shevchenko2020-09-101-13/+11
| | | | | | | | | | Refactor cio2_buffer_done() to get rid of infinite loop by replacing it by one with clear exit condition. This change also allows to check for an error ahead. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: ipu3-cio2: Use macros from pfn.hAndy Shevchenko2020-09-101-11/+10
| | | | | | | | There are few nice macros in pfn.h, some of which we may use here. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: ipu2-cio2: Replace custom definition with PAGE_SIZEAndy Shevchenko2020-09-102-18/+13
| | | | | | | | | | | | It's quite unlikely that another page size will be supported, but in any case there is still an inconsistency between custom page size definition and generic macros used in the driver. Switch over to the generic PAGE_SIZE for sake of the consistency. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: ipu3-cio2: Introduce CIO2_LOP_ENTRIES constantAndy Shevchenko2020-09-102-8/+8
| | | | | | | | | This constant is used in several places in the code, define it for better maintenance. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: ipu3-cio2: Simplify cleanup codeAndy Shevchenko2020-09-101-2/+2
| | | | | | | | | | | | | The code looks more nicer if we use: while (i--) instead: for (i = i - 1; i >= 0; i--) This would also allow making 'i' unsigned again. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: omap3isp: Fix memleak in isp_probeDinghao Liu2020-09-101-2/+4
| | | | | | | | | | When devm_ioremap_resource() fails, isp should be freed just like other error paths in isp_probe. Fixes: 8644cdf972dd6 ("[media] omap3isp: Replace many MMIO regions by two") Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: staging/intel-ipu3: css: Correctly reset some memoryChristophe JAILLET2020-09-101-1/+1
| | | | | | | | | | | The intent here is to reset the whole 'scaler_coeffs_luma' array, not just the first element. Fixes: e11110a5b744 ("media: staging/intel-ipu3: css: Compute and program ccs") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Bingbu Cao <bingbu.cao@intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: uvcvideo: Convey full colorspace information to V4L2Adam Goode2020-09-103-5/+67
| | | | | | | | | | | | | | | The Color Matching Descriptor has been present in USB cameras since the original version of UVC, but it has never been fully exposed in Linux. This change informs V4L2 of all of the UVC colorspace parameters: color primaries, transfer characteristics, and YCbCr encoding. videodev2.h doesn't have values for all the possible UVC color settings, so it is mapped as closely as possible. Signed-off-by: Adam Goode <agoode@google.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: uvcvideo: Ensure all probed info is returned to v4l2Adam Goode2020-09-101-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | bFrameIndex and bFormatIndex can be negotiated by the camera during probing, resulting in the camera choosing a different format than expected. v4l2 can already accommodate such changes, but the code was not updating the proper fields. Without such a change, v4l2 would potentially interpret the payload incorrectly, causing corrupted output. This was happening on the Elgato HD60 S+, which currently always renegotiates to format 1. As an aside, the Elgato firmware is buggy and should not be renegotating, but it is still a valid thing for the camera to do. Both macOS and Windows will properly probe and read uncorrupted images from this camera. With this change, both qv4l2 and chromium can now read uncorrupted video from the Elgato HD60 S+. [Add blank lines, remove periods at the of messages] Signed-off-by: Adam Goode <agoode@google.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: uvcvideo: Silence shift-out-of-bounds warningLaurent Pinchart2020-09-101-1/+5
| | | | | | | | | | | | | | | | | | UBSAN reports a shift-out-of-bounds warning in uvc_get_le_value(). The report is correct, but the issue should be harmless as the computed value isn't used when the shift is negative. This may however cause incorrect behaviour if a negative shift could generate adverse side effects (such as a trap on some architectures for instance). Regardless of whether that may happen or not, silence the warning as a full WARN backtrace isn't nice. Reported-by: Bart Van Assche <bvanassche@acm.org> Fixes: c0efd232929c ("V4L/DVB (8145a): USB Video Class driver") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Tested-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: uvcvideo: Fix dereference of out-of-bound list iteratorDaniel W. S. Almeida2020-09-101-4/+9
| | | | | | | | | | | | | | | | | Fixes the following coccinelle report: drivers/media/usb/uvc/uvc_ctrl.c:1860:5-11: ERROR: invalid reference to the index variable of the iterator on line 1854 by adding a boolean variable to check if the loop has found the Found using - Coccinelle (http://coccinelle.lip6.fr) [Replace cursor variable with bool found] Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
* media: uvcvideo: Replace HTTP links with HTTPS onesAlexander A. Klimov2020-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>