aboutsummaryrefslogtreecommitdiffstats
path: root/samples/mei (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2018-12-03media: v4l: ioctl: Allow drivers to fill in the format descriptionSakari Ailus1-1/+1
The v4l_fill_fmtdesc() function does a good job in filling in pixelformat description. While generally all drivers should depend on this function doing the job, staging drivers that use their own formats may not. Allow staging drivers to fill in their own formats by checking whether the description begins with a non-nil character before issuing the warning. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Suggested-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: v4l: Fix MPEG-2 slice Intra DC Precision validationJonas Karlman1-1/+2
intra_dc_precision is a 2-bit integer [1] allow use of all valid options, 8 - 11 bits precision [1] ISO/IEC 13818-2 Table 6-13 Fixes: c27bb30e7b6d ("media: v4l: Add definitions for MPEG-2 slice format and metadata") Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: DaVinci-VPBE: fix error handling in vpbe_initialize()Alexey Khoroshilov1-2/+5
If vpbe_set_default_output() or vpbe_set_default_mode() fails, vpbe_initialize() returns error code without releasing resources. The patch adds error handling for that case. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: vivid: fix smatch warningsHans Verkuil2-6/+19
Reorganize code to fix two smatch warnings: drivers/media/platform/vivid/vivid-core.c: drivers/media/platform/vivid/vivid-core.c:889 vivid_create_instance() warn: potentially one past the end of array 'dev->query_dv_timings_qmenu[dev->query_dv_timings_size]' drivers/media/platform/vivid/vivid-core.c: drivers/media/platform/vivid/vivid-core.c:889 vivid_create_instance() warn: potentially one past the end of array 'dev->query_dv_timings_qmenu[dev->query_dv_timings_size]' Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: mtk-vcodec: Remove VA from encoder frame buffersTomasz Figa3-6/+7
The encoder driver has no need to do any CPU access to the source frame buffers. Use a separate structure for holding DMA addresses and sizes for those and remove, so we do not end up introducing any erroneous dereferences of those VAs. This fixes DMA-buf import from exporters that do not provide contiguous kernel mappings, which includes the MTK DRM driver. Signed-off-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: camss: Take in account sensor skip framesTodor Tomov3-6/+20
When streaming is starting ask the sensor for its skip frames value. Max supported frame skip is 29 frames, so clip it if it is higher. Signed-off-by: Todor Tomov <todor.tomov@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: adv7180: add g_skip_frames supportTim Harvey1-0/+15
The adv7180 produces 1 to 2 frames of garbage before proper sync is established. This allows V4L2 drivers and apps to skip those. Signed-off-by: Tim Harvey <tharvey@gateworks.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: em28xx: fix spelling mistake, "Cinnergy" -> "Cinergy"Colin Ian King2-2/+2
Fix name of the Hybrid T USB XS em28xx card, should be Cinergy. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: exynos4-is: fix spelling mistake ACTURATOR -> ACTUATORColin Ian King2-3/+3
Trivial fix to spelling mistake in macro name and text string ERROR_SENSOR_ACTURATOR_INIT_FAIL -> ERROR_SENSOR_ACTUATOR_INIT_FAIL Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: i2c: TDA1997x: select CONFIG_HDMIArnd Bergmann1-0/+1
Without CONFIG_HDMI, we get a link error for this driver: drivers/media/i2c/tda1997x.o: In function `tda1997x_parse_infoframe': tda1997x.c:(.text+0x2195): undefined reference to `hdmi_infoframe_unpack' tda1997x.c:(.text+0x21b6): undefined reference to `hdmi_infoframe_log' drivers/media/i2c/tda1997x.o: In function `tda1997x_log_infoframe': tda1997x.c:(.text.unlikely+0x13d3): undefined reference to `hdmi_infoframe_unpack' tda1997x.c:(.text.unlikely+0x1426): undefined reference to `hdmi_infoframe_log' All other drivers in this directory that use HDMI select CONFIG_HDMI, so do the same here: Fixes: 9ac0038db9a7 ("media: i2c: Add TDA1997x HDMI receiver driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: uvcvideo: Refactor teardown of uvc on USB disconnectDaniel Axtens3-8/+18
Currently, disconnecting a USB webcam while it is in use prints out a number of warnings, such as: WARNING: CPU: 2 PID: 3118 at /build/linux-ezBi1T/linux-4.8.0/fs/sysfs/group.c:237 sysfs_remove_group+0x8b/0x90 sysfs group ffffffffa7cd0780 not found for kobject 'event13' This has been noticed before. [0] This is because of the order in which things are torn down. If there are no streams active during a USB disconnect: - uvc_disconnect() is invoked via device_del() through the bus notifier mechanism. - this calls uvc_unregister_video(). - uvc_unregister_video() unregisters the video device for each stream, - because there are no streams open, it calls uvc_delete() - uvc_delete() calls uvc_status_cleanup(), which cleans up the status input device. - uvc_delete() calls media_device_unregister(), which cleans up the media device - uvc_delete(), uvc_unregister_video() and uvc_disconnect() all return, and we end up back in device_del(). - device_del() then cleans up the sysfs folder for the camera with dpm_sysfs_remove(). Because uvc_status_cleanup() and media_device_unregister() have already been called, this all works nicely. If, on the other hand, there *are* streams active during a USB disconnect: - uvc_disconnect() is invoked - this calls uvc_unregister_video() - uvc_unregister_video() unregisters the video device for each stream, - uvc_unregister_video() and uvc_disconnect() return, and we end up back in device_del(). - device_del() then cleans up the sysfs folder for the camera with dpm_sysfs_remove(). Because the status input device and the media device are children of the USB device, this also deletes their sysfs folders. - Sometime later, the final stream is closed, invoking uvc_release(). - uvc_release() calls uvc_delete() - uvc_delete() calls uvc_status_cleanup(), which cleans up the status input device. Because the sysfs directory has already been removed, this causes a WARNing. - uvc_delete() calls media_device_unregister(), which cleans up the media device. Because the sysfs directory has already been removed, this causes another WARNing. To fix this, we need to make sure the devices are always unregistered before the end of uvc_disconnect(). To this, move the unregistration into the disconnect path: - split uvc_status_cleanup() into two parts, one on disconnect that unregisters and one on delete that frees. - move v4l2_device_unregister() and media_device_unregister() into the disconnect path. [0]: https://lkml.org/lkml/2016/12/8/657 [Renamed uvc_input_cleanup() to uvc_input_unregister()] Signed-off-by: Daniel Axtens <dja@axtens.net> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: uvcvideo: Add support for the CNF4 formatSergey Dorodnicov2-0/+8
Register the GUID used by Intel RealSense cameras with fourcc CNF4, encoding depth sensor confidence information for every pixel. Signed-off-by: Sergey Dorodnicov <sergey.dorodnicov@intel.com> Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: v4l: Add 4bpp packed depth confidence format CNF4Sergey Dorodnicov4-0/+34
Adding new fourcc CNF4 for 4 bit-per-pixel packed depth confidence information provided by Intel RealSense cameras. Every two consecutive pixels are packed into a single byte. Signed-off-by: Sergey Dorodnicov <sergey.dorodnicov@intel.com> Signed-off-by: Evgeni Raikhel <evgeni.raikhel@intel.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: xilinx: fix typo in formats tableAndrea Merello1-1/+1
In formats table the entry for CFA pattern "rggb" has GRBG fourcc. This patch fixes it. Signed-off-by: Mirco Di Salvo <mirco.disalvo@iit.it> Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: xilinx: Use SPDX-License-IdentifierDhaval Shah12-40/+14
SPDX-License-Identifier is used for the Xilinx Video IP and related drivers. [Added drivers/media/platform/xilinx/Kconfig] [Added drivers/media/platform/xilinx/Makefile] [Added include/dt-bindings/media/xilinx-vip.h] Signed-off-by: Dhaval Shah <dhaval23031987@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Michal Simek <michal.simek@xilinx.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: sony-cxd2880: add optional vcc regulator to bindingsNeil Armstrong1-0/+4
This patchset adds an optional VCC regulator to the bindings of the Sony CXD2880 DVB-T2/T tuner + demodulator adapter. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: cxd2880-spi: Add optional vcc regulatorNeil Armstrong1-0/+16
This patchset adds an optional VCC regulator to the driver probe function to make sure power is enabled to the module before starting attaching to the device. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: dib0900: fix smatch warningsHans Verkuil1-16/+16
drivers/media/dvb-frontends/dib0090.c: drivers/media/dvb-frontends/dib0090.c:1075 dib0090_pwm_gain_reset() warn: '*&bb_ramp_pwm_normal' 2590696709486571520 can't fit into 65535 '*bb_ramp' drivers/media/dvb-frontends/dib0090.c: drivers/media/dvb-frontends/dib0090.c:1083 dib0090_pwm_gain_reset() warn: '*&bb_ramp_pwm_normal_socs' 2590696709486571520 can't fit into 65535 '*bb_ramp' drivers/media/dvb-frontends/dib0090.c: drivers/media/dvb-frontends/dib0090.c:1085 dib0090_pwm_gain_reset() warn: '*&rf_ramp_pwm_cband_8090' 2590696709486571520 can't fit into 65535 '*rf_ramp' drivers/media/dvb-frontends/dib0090.c: drivers/media/dvb-frontends/dib0090.c:1089 dib0090_pwm_gain_reset() warn: '*&rf_ramp_pwm_cband_7090e_sensitivity' 2590696709486571520 can't fit into 65535 '*rf_ramp' drivers/media/dvb-frontends/dib0090.c: drivers/media/dvb-frontends/dib0090.c:1093 dib0090_pwm_gain_reset() warn: '*&rf_ramp_pwm_cband_7090p' 2590696709486571520 can't fit into 65535 '*rf_ramp' drivers/media/dvb-frontends/dib0090.c: drivers/media/dvb-frontends/dib0090.c:1096 dib0090_pwm_gain_reset() warn: '*&rf_ramp_pwm_cband' 2590696709486571520 can't fit into 65535 '*rf_ramp' drivers/media/dvb-frontends/dib0090.c: drivers/media/dvb-frontends/dib0090.c:1101 dib0090_pwm_gain_reset() warn: '*&bb_ramp_pwm_normal_socs' 2590696709486571520 can't fit into 65535 '*bb_ramp' drivers/media/dvb-frontends/dib0090.c: drivers/media/dvb-frontends/dib0090.c:1104 dib0090_pwm_gain_reset() warn: '*&rf_ramp_pwm_vhf' 2590696709486571520 can't fit into 65535 '*rf_ramp' drivers/media/dvb-frontends/dib0090.c: drivers/media/dvb-frontends/dib0090.c:1107 dib0090_pwm_gain_reset() warn: '*&bb_ramp_pwm_normal_socs' 2590696709486571520 can't fit into 65535 '*bb_ramp' drivers/media/dvb-frontends/dib0090.c: drivers/media/dvb-frontends/dib0090.c:1109 dib0090_pwm_gain_reset() warn: '*&rf_ramp_pwm_uhf_8090' 2590696709486571520 can't fit into 65535 '*rf_ramp' drivers/media/dvb-frontends/dib0090.c: drivers/media/dvb-frontends/dib0090.c:1111 dib0090_pwm_gain_reset() warn: '*&rf_ramp_pwm_uhf_7090' 2590696709486571520 can't fit into 65535 '*rf_ramp' drivers/media/dvb-frontends/dib0090.c: drivers/media/dvb-frontends/dib0090.c:1113 dib0090_pwm_gain_reset() warn: '*&rf_ramp_pwm_uhf' 2590696709486571520 can't fit into 65535 '*rf_ramp' drivers/media/dvb-frontends/dib0090.c: drivers/media/dvb-frontends/dib0090.c:1419 dib0090_update_rframp_7090() warn: '*&rf_ramp_pwm_cband_7090e_sensitivity' 2590696709486571520 can't fit into 65535 '*state->rf_ramp' drivers/media/dvb-frontends/dib0090.c: drivers/media/dvb-frontends/dib0090.c:1421 dib0090_update_rframp_7090() warn: '*&rf_ramp_pwm_cband_7090e_aci' 2590696709486571520 can't fit into 65535 '*state->rf_ramp' For no apparent reason this code casts away the const of the const u16 arrays, and it also takes the address of an array. While that's ignored in C I think smatch gets confused by it. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: mxl5xx: constify dvb_frontend_ops structureJulia Lawall1-1/+1
The dvb_frontend_ops structure is only copied into the ops field of a dvb_frontend structure, so it can be const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: dvb-frontends: Use kmemdup instead of duplicating its functionzhong jiang1-4/+2
kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: usb: Use kmemdup instead of duplicating its function.zhong jiang1-2/+1
kmemdup has implemented the function that kmalloc() + memcpy(). We prefer to kmemdup rather than code opened implementation. Signed-off-by: zhong jiang <zhongjiang@huawei.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: cxd2880-spi: fix probe when dvb_attach failsNeil Armstrong1-0/+1
When dvb_attach fails, probe returns 0, and remove crashes afterwards. This patch sets the return value to -ENODEV when attach fails. Fixes: bd24fcddf6b8 ("media: cxd2880-spi: Add support for CXD2880 SPI interface") Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: dvb: Use WARM definition from identify_state()Victor Toso1-4/+2
Device should be either COLD or WARM. This change only make usage of the existing definition. Signed-off-by: Victor Toso <me@victortoso.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: af9033: Remove duplicated switch statementVictor Toso1-10/+2
The switch before set is_af9035 or is_it9135 which makes the second switch redundant. Keeping the comment as to avoid sleep on IT9135. Signed-off-by: Victor Toso <me@victortoso.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: dib0700: fix spelling mistake "Amplifyer" -> "Amplifier"Colin Ian King1-1/+1
There is a spelling mistake in the MODULE_PARM_DESC text, fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: dvb-usb-v2: Fix incorrect use of transfer_flags URB_FREE_BUFFERMalcolm Priestley1-3/+2
commit 1a0c10ed7bb1 ("media: dvb-usb-v2: stop using coherent memory for URBs") incorrectly adds URB_FREE_BUFFER after every urb transfer. It cannot use this flag because it reconfigures the URBs accordingly to suit connected devices. In doing a call to usb_free_urb is made and invertedly frees the buffers. The stream buffer should remain constant while driver is up. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> CC: stable@vger.kernel.org # v4.18+ Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: saa7134: rc-core maintains users count, no need to duplicateSean Young3-67/+18
This simplifies the code a little. Tested with suspend and resume. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: venus: fix reported size of 0-length buffersAlexandre Courbot1-3/+1
The last buffer is often signaled by an empty buffer with the V4L2_BUF_FLAG_LAST flag set. Such buffers were returned with the bytesused field set to the full size of the OPB, which leads user-space to believe that the buffer actually contains useful data. Fix this by passing the number of bytes reported used by the firmware. Signed-off-by: Alexandre Courbot <acourbot@chromium.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-12-03media: venus: dynamic handling of bitrateMalathi Gottam1-0/+15
Any request for a change in bitrate after both planes are streamed on is handled by setting the target bitrate property to hardware. Signed-off-by: Malathi Gottam <mgottam@codeaurora.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-27media: venus: handle peak bitrate set propertyMalathi Gottam2-1/+3
Max bitrate property is not supported for venus version 4xx. Return unsupported from packetization layer. Handle it in hfi_venus layer to exit gracefully to venc layer. Signed-off-by: Malathi Gottam <mgottam@codeaurora.org> Tested-by: Alexandre Courbot <acourbot@chromium.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-27media: venus: add support for USERPTR to queueMalathi Gottam1-2/+2
Add USERPTR to queue access methods by adding this support to io_modes on both the planes. Signed-off-by: Malathi Gottam <mgottam@codeaurora.org> Tested-by: Alexandre Courbot <acourbot@chromium.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: dvb-pll: don't re-validate tuner frequenciesMauro Carvalho Chehab1-3/+0
The dvb_frontend core already checks for the frequencies. No need for any additional check inside the driver. It is part of the fixes for the following bug: https://bugzilla.opensuse.org/show_bug.cgi?id=1116374 Fixes: a3f90c75b833 ("media: dvb: convert tuner_info frequencies to Hz") Reported-by: Stakanov Schufter <stakanov@eclipso.eu> Reported-by: Takashi Iwai <tiwai@suse.de> Cc: stable@vger.kernel.org # For 4.19 Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: dvb-pll: fix tuner frequency rangesMauro Carvalho Chehab1-55/+48
Tuners should report frequencies in Hz. That works fine on most drivers, but, in the case of dvb-pll, some settings are for satellite tuners, while others are for terrestrial/cable ones. The code was trying to solve it at probing time, but that doesn't work, as, when _attach is called, the delivery system may be wrong. Fix it by ensuring that all frequencies are in Hz at the per-tuner max/min values. While here, add a debug message, as this would help to debug any issues there. It partially fixes the following bug: https://bugzilla.opensuse.org/show_bug.cgi?id=1116374 Fixes: a3f90c75b833 ("media: dvb: convert tuner_info frequencies to Hz") Reported-by: Stakanov Schufter <stakanov@eclipso.eu> Reported-by: Takashi Iwai <tiwai@suse.de> Cc: stable@vger.kernel.org # For 4.19 Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: dvb_frontend: add debug message for frequency intervalsMauro Carvalho Chehab1-0/+3
As we did an internal change inside the subsystem to always represent min/max frequencies in Hz, add a debug message, as this would help to discover bugs on drivers, if any. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: dvb_frontend: don't print function names twiceMauro Carvalho Chehab1-4/+4
The dvb_frontend dprintk() macro already prints __func__. So, we don't need to add it again at the printed message. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: vb2: be sure to unlock mutex on errorsMauro Carvalho Chehab1-1/+2
As reported by smatch: drivers/media/common/videobuf2/videobuf2-core.c: drivers/media/common/videobuf2/videobuf2-core.c:2159 vb2_mmap() warn: inconsistent returns 'mutex:&q->mmap_lock'. Locked on: line 2148 Unlocked on: line 2100 line 2108 line 2113 line 2118 line 2156 line 2159 There is one error condition that doesn't unlock a mutex. Fixes: cd26d1c4d1bc ("media: vb2: vb2_mmap: move lock up") Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: seco-cec: declare ops as static constMauro Carvalho Chehab1-1/+1
As warned by smatch: drivers/media/platform/seco-cec/seco-cec.c:338:21: warning: symbol 'secocec_cec_adap_ops' was not declared. Should it be static? This struct should be static. Also, it is const, so declare it as such. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: seco-cec: fix MakefileHans Verkuil1-1/+1
Fix the incorrect obj-y. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: videobuf2-v4l2: drop WARN_ON in vb2_warn_zero_bytesused()Hans Verkuil1-1/+0
Userspace shouldn't set bytesused to 0 for output buffers. vb2_warn_zero_bytesused() warns about this (only once!), but it also calls WARN_ON(1), which is confusing since it is not immediately clear that it warns about a 0 value for bytesused. Just drop the WARN_ON as it serves no purpose. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: vb2: Allow reqbufs(0) with "in use" MMAP buffersJohn Sheu4-9/+19
Videobuf2 presently does not allow VIDIOC_REQBUFS to destroy outstanding buffers if the queue is of type V4L2_MEMORY_MMAP, and if the buffers are considered "in use". This is different behavior than for other memory types and prevents us from deallocating buffers in following two cases: 1) There are outstanding mmap()ed views on the buffer. However even if we put the buffer in reqbufs(0), there will be remaining references, due to vma .open/close() adjusting vb2 buffer refcount appropriately. This means that the buffer will be in fact freed only when the last mmap()ed view is unmapped. 2) Buffer has been exported as a DMABUF. Refcount of the vb2 buffer is managed properly by VB2 DMABUF ops, i.e. incremented on DMABUF get and decremented on DMABUF release. This means that the buffer will be alive until all importers release it. Considering both cases above, there does not seem to be any need to prevent reqbufs(0) operation, because buffer lifetime is already properly managed by both mmap() and DMABUF code paths. Let's remove it and allow userspace freeing the queue (and potentially allocating a new one) even though old buffers might be still in processing. To let userspace know that the kernel now supports orphaning buffers that are still in use, add a new V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS to be set by reqbufs and create_bufs. [p.zabel@pengutronix.de: added V4L2_BUF_CAP_SUPPORTS_ORPHANED_BUFS, updated documentation, and added back debug message] Signed-off-by: John Sheu <sheu@chromium.org> Reviewed-by: Pawel Osciak <posciak@chromium.org> Signed-off-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: added V4L2-BUF-CAP-SUPPORTS-ORPHANED-BUFS ref] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: cedrus: Get rid of interrupt bottom-halfEzequiel Garcia1-21/+5
Now that the mem2mem framework guarantees that .device_run won't be called from interrupt context, it is safe to call v4l2_m2m_job_finish directly in the top-half. So this means the bottom-half is no longer needed and we can get rid of it. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: v4l2-mem2mem: Avoid calling .device_run in v4l2_m2m_job_finishEzequiel Garcia1-1/+24
v4l2_m2m_job_finish() is typically called when DMA operations complete, in interrupt handlers or DMA completion callbacks. Calling .device_run from v4l2_m2m_job_finish creates a nasty re-entrancy path into the driver. Moreover, some implementation of .device_run might need to sleep, as is the case for drivers supporting the Request API, where controls are applied via v4l2_ctrl_request_setup, which takes the ctrl handler mutex. This commit adds a deferred context that calls v4l2_m2m_try_run, and gets scheduled by v4l2_m2m_job_finish(). Before this change, device_run would be called from these paths: vb2_m2m_request_queue, or v4l2_m2m_streamon, or v4l2_m2m_qbuf v4l2_m2m_try_schedule v4l2_m2m_try_run .device_run v4l2_m2m_job_finish v4l2_m2m_try_run .device_run After this change, the latter is now gone and instead: v4l2_m2m_device_run_work v4l2_m2m_try_run .device_run Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: v4l2-mem2mem: Simplify exiting the function in __v4l2_m2m_try_scheduleSakari Ailus1-16/+13
The __v4l2_m2m_try_schedule function acquires and releases multiple spinlocks. Simplify unlocking the job lock by adding labels to unlock the lock and exit the function. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: v4l2-ioctl.c: Simplify locking for m2m devicesEzequiel Garcia1-45/+2
Now that the mutexes for output and capture vb2 queues match, it is possible to refer to the context q_lock as the m2m lock for a given m2m context. Remove the output/capture lock selection. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: mem2mem: Require capture and output mutexes to matchEzequiel Garcia1-5/+7
Currently, all the mem2mem driver either use a single mutex to lock the capture and output videobuf2 queues, or don't set any mutex. This means the mutexes match, and so the mem2mem framework is able to set the m2m context lock. Enforce this by making it mandatory for drivers to set the same capture and output mutex, or not set any mutex at all. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: dt-bindings: media: Document bindings for venus firmware deviceVikash Garodia1-1/+13
Add devicetree binding documentation for firmware loader for video hardware running on qualcomm chip. Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org> Reviewed-by: Rob Herring <robh@kernel.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Tested-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: venus: firmware: add no TZ boot and shutdown routineVikash Garodia5-7/+97
Video hardware is mainly comprised of vcodec subsystem and video control subsystem. Video control has ARM9 which executes the video firmware instructions whereas vcodec does the video frame processing. This change adds support to load the video firmware and bring ARM9 out of reset for platforms which does not have trustzone. An iommu domain is associated and managed with the firmware device. Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Tested-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: venus: firmware: register separate platform_device for firmware loaderStanimir Varbanov4-4/+70
This registers a firmware platform_device and associate it with video-firmware DT subnode. Then calls dma configure to initialize dma and iommu. Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Tested-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: venus: firmware: move load firmware in a separate functionVikash Garodia3-23/+38
Separate firmware loading part into a new function. Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Tested-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: venus: firmware: add routine to reset ARM9Vikash Garodia5-9/+57
Add routine to reset the ARM9 and brings it out of reset. Also abstract the Venus CPU state handling with a new function. This is in preparation to add PIL functionality in venus driver. Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org> Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org> Reviewed-by: Alexandre Courbot <acourbot@chromium.org> Tested-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>