summaryrefslogtreecommitdiffstats
path: root/drivers/staging
AgeCommit message (Collapse)Author
2019-06-24media: staging: media: fix style problemAliasgar Surti
checkpatch reported "WARNING: line over 80 characters". This patch fixes the warning for file soc_camera/soc_ov5642.c Signed-off-by: Aliasgar Surti <aliasgar.surti500@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-24media: staging: media: soc_camera: soc_mt9v022: simplify getting the adapter ↵Wolfram Sang
of a client We have a dedicated pointer for that, so use it. Much easier to read and less computation involved. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-24media: staging: media: soc_camera: mt9t031: simplify getting the adapter of ↵Wolfram Sang
a client We have a dedicated pointer for that, so use it. Much easier to read and less computation involved. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-24media: staging: media: soc_camera: imx074: simplify getting the adapter of a ↵Wolfram Sang
client We have a dedicated pointer for that, so use it. Much easier to read and less computation involved. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-21media: staging: media: tegra-vde: Manually pack UAPI structuresDmitry Osipenko
The __packed macro isn't available in userspace with the kernel headers. Checkpatch asks to use the macro, which is unwanted in a case of a UAPI header. There is no much benefit in a tight packing of the structures, hence let's pack them manually to cleanup things a tad. Note that there is no old-stable userspace that will suffer from this change, hence it's fine to change the ABI. In a result also more space is reserved for a possible future expansion of the UAPI as it was already shown that more fields will be needed for a later SoC generations. Suggested-by: Thierry Reding <thierry.reding@gmail.com> Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-21media: staging: media: tegra-vde: Remove BIT() macro from UAPI headerDmitry Osipenko
The BIT macro isn't available in userspace. Checkpatch complains about shifts being used instead of the macro and people are starting to send patches without realizing that it's a UAPI header file. Hence let's replace the BIT macro with a hex values to make everyone happy. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-21media: staging: media: meson: remove redundant initialization of mpeg12Colin Ian King
The pointer mpeg12 is being initialized however that value is never read and mpeg12 is being re-assigned almost immediately afterwards. Remove the redundant initialization. Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Maxime Jourdan <mjourdan@baylibre.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-21media: imx7-media-csi: get csi upstream endpointRui Miguel Silva
When the upstream endpoint is neither a mux nor a CSI2 module, just get the source pad directly upstream from the CSI. Reported-by: Sebastien Szymanski <sebastien.szymanski@armadeus.com> Signed-off-by: Rui Miguel Silva <rui.silva@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-21media: staging: davinci: fix memory leaks and check for allocation failureColin Ian King
There are three error return paths that don't kfree params causing a memory leak. Fix this by adding an error return path that kfree's params before returning. Also add a check to see params failed to be allocated. 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>
2019-06-21media: hantro: remove an unnecessary NULL checkDan Carpenter
Thus the address of "&ctx->dev->variant->codec_ops[codec_mode]" can't possibly be NULL. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> [hverkuil-cisco@xs4all.nl: rebased after rockchip/vpu -> hantro rename] Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-12media: meson: vdec: Add missing kthread.hYueHaibing
Fix building error: of function kthread_should_stop; did you mean thread_saved_sp? [-Werror=implicit-function-declaration] Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Maxime Jourdan <mjourdan@baylibre.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-12media: hantro: allow arbitrary number of clocksPhilipp Zabel
Dynamically allocate clocks and move clock names out of struct hantro_variant. This lifts the four clock limit and allows to use ARRAY_SIZE() to fill .num_clocks to reduce the risk of mismatches. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-12media: hantro: add support for separate control blockPhilipp Zabel
On i.MX8MQ/MM a separate control block contains registers for per-core resets, clock gating, and fuse register control. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-12media: hantro: add support for named register rangesPhilipp Zabel
Add support for multiple register ranges with SoC specific names. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-12media: hantro: make irq names configurablePhilipp Zabel
The i.MX8MQ bindings will use different IRQ names ("g1" instead of "vdpu", and "g2"), so make them configurable. This also allows to register more than two IRQs, which will be required for i.MX8MM support later (it will add "h1" instead of "vepu"). Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-12media: hantro: add PM runtime resume callbackPhilipp Zabel
It seems that on i.MX8MQ the power domain controller does not propagate resets to the VPU cores on resume. Add a callback to allow implementing manual reset of the VPU cores after ungating the power domain. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-12media: hantro: print video device name in addition to device nodePhilipp Zabel
It can be helpful to know which video device was registered at which device node. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-12media: rockchip/vpu: rename from rockchip to hantroPhilipp Zabel
Rename the driver and all relevant identifiers from Rockchip to Hantro, as other Hantro IP based VPU implementations can be supported by the same driver. The RK3288 decoder is Hantro G1 based, the encoder is Hantro H1. This patch just renames, no functional changes. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-11Merge tag 'v5.2-rc4' into media/masterMauro Carvalho Chehab
There are some conflicts due to SPDX changes. We also have more patches being merged via media tree touching them. So, let's merge back from upstream and address those. Linux 5.2-rc4 * tag 'v5.2-rc4': (767 commits) Linux 5.2-rc4 MAINTAINERS: Karthikeyan Ramasubramanian is MIA i2c: xiic: Add max_read_len quirk lockref: Limit number of cmpxchg loop retries uaccess: add noop untagged_addr definition x86/insn-eval: Fix use-after-free access to LDT entry kbuild: use more portable 'command -v' for cc-cross-prefix s390/unwind: correct stack switching during unwind block, bfq: add weight symlink to the bfq.weight cgroup parameter cgroup: let a symlink too be created with a cftype file drm/nouveau/secboot/gp10[2467]: support newer FW to fix SEC2 failures on some boards drm/nouveau/secboot: enable loading of versioned LS PMU/SEC2 ACR msgqueue FW drm/nouveau/secboot: split out FW version-specific LS function pointers drm/nouveau/secboot: pass max supported FW version to LS load funcs drm/nouveau/core: support versioned firmware loading drm/nouveau/core: pass subdev into nvkm_firmware_get, rather than device block: free sched's request pool in blk_cleanup_queue pktgen: do not sleep with the thread lock held. net: mvpp2: Use strscpy to handle stat strings net: rds: fix memory leak in rds_ib_flush_mr_pool ... Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-11media: meson: add v4l2 m2m video decoder driverMaxime Jourdan
Amlogic SoCs feature a powerful video decoder unit able to decode many formats, with a performance of usually up to 4k60. This is a driver for this IP that is based around the v4l2 m2m framework. It features decoding for: - MPEG 1 - MPEG 2 Supported SoCs are: GXBB (S905), GXL (S905X/W/D), GXM (S912) There is also a hardware bitstream parser (ESPARSER) that is handled here. Signed-off-by: Maxime Jourdan <mjourdan@baylibre.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-10media: Revert "media: staging/imx: Allow driver to build if COMPILE_TEST is ↵Fabio Estevam
enabled" Commit 020bc7354a6e ("media: staging/imx: Allow driver to build if COMPILE_TEST is enabled") incorrectly assumed that the imx media driver had no build time dependency with IMX_IPUV3_CORE. Building on x86_64 without IMX_IPUV3_CORE causes lots of build errors such as: All these definitions come from the imx ipu3 core driver, so make sure that imx media depends on IMX_IPUV3_CORE. This reverts commit 020bc7354a6ebec980e0aedf5bedf57b42f93aca. Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Fabio Estevam <festevam@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-05media: imx7-media-csi: Remove unneeded error messageFabio Estevam
In case of ioremap failure, the core code will take care of printing the error message, so there is no need for having a local error message in the driver. Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-05media: imx7-media-csi: Use u32 for storing register readsFabio Estevam
The CSI registers are 32-bit, so using u32 type is more suitable for storing the values from register reads. Switch from 'unsigned long' to 'u32' type. Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-05media: imx7-media-csi: Use functions instead of macrosFabio Estevam
Currently there is a macro for reading and another macro for writing to the CSI registers. Functions can do parameter type checking, which leads to a safer code, so switch from macro to function implementation. Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-05media: imx7-mipi-csis: Remove extra blank lineFabio Estevam
Checkpatch reports an extra blank line, so remove such unneeded line. Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-05media: imx7-mipi-csis: Remove unneeded 'ret' initializationFabio Estevam
There is no need for initializing the 'ret' variable as it will be assigned at: ret = mipi_csis_parse_dt(pdev, state); Remove the unneeded initialization. Signed-off-by: Fabio Estevam <festevam@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-05media: imx7-mipi-csis: Propagate the error if clock enabling failsFabio Estevam
Currently the return value from clk_bulk_prepare_enable() is checked, but it is not propagate it in the case of failure. Fix it and also move the error message to the caller of mipi_csis_clk_enable(). Signed-off-by: Fabio Estevam <festevam@gmail.com> Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-05media: staging/media: set device_caps in struct video_deviceHans Verkuil
Instead of filling in the struct v4l2_capability device_caps field, fill in the struct video_device device_caps field. That way the V4L2 core knows what the capabilities of the video device are. But this only really works if all drivers use this, so convert all staging/media drivers in this patch. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-05media: vc04_services/bcm2835-camera: set device_caps in struct video_deviceHans Verkuil
Instead of filling in the struct v4l2_capability device_caps field, fill in the struct video_device device_caps field. That way the V4L2 core knows what the capabilities of the video device are. But this only really works if all drivers use this, so convert this driver accordingly. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-05media: v4l2: Get rid of ->vidioc_enum_fmt_vid_{cap, out}_mplaneBoris Brezillon
Support for multiplanar and singleplanar formats is mutually exclusive, at least in practice. In our attempt to unify support for support for mplane and !mplane in v4l, let's get rid of the ->vidioc_enum_fmt_{vid,out}_cap_mplane() hooks and call ->vidioc_enum_fmt_{vid,out}_cap() instead. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com> [hverkuil-cisco@xs4all.nl: fix typos: pirv -> priv and prov -> priv] Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-03media: staging/imx: fix two NULL vs IS_ERR() bugsDan Carpenter
The imx_media_pipeline_pad() function return NULL pointers on error, it never returns error pointers. Fixes: 3ef46bc97ca2 ("media: staging/imx: Improve pipeline searching") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-31Merge tag 'staging-5.2-rc3' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging and IIO driver fixes from Greg KH: "Here are some Staging and IIO driver fixes to resolve some reported problems for 5.2-rc3. Nothing major here, just some tiny changes, full details are in the shortlog. All have been in linux-next for a while with no reported issues" * tag 'staging-5.2-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: staging: kpc2000: Add dependency on MFD_CORE to kconfig symbol 'KPC2000' staging: wilc1000: Fix some double unlock bugs in wilc_wlan_cleanup() staging: vc04_services: prevent integer overflow in create_pagelist() Staging: vc04_services: Fix a couple error codes staging: wlan-ng: fix adapter initialization failure staging: kpc2000: double unlock in error handling in kpc_dma_transfer() staging: kpc2000: Fix build error without CONFIG_UIO staging: kpc2000: fix build error on xtensa staging: erofs: set sb->s_root to NULL when failing from __getname() iio: adc: ti-ads8688: fix timestamp is not updated in buffer iio: dac: ds4422/ds4424 fix chip verification iio: imu: mpu6050: Fix FIFO layout for ICM20602 iio: adc: ads124: avoid buffer overflow iio: adc: modify NPCM ADC read reference voltage
2019-05-29media: Staging: media: Release the correct resource in an error handling pathChristophe JAILLET
'res' is reassigned several times in the function and if we 'goto error_unmap', its value is not the returned value of 'request_mem_region()' anymore. Introduce a new 'struct resource *' variable (i.e. res2) to keep a pointer to the right resource, if needed in the error handling path. Fixes: 4b4eda001704 ("Staging: media: Unmap and release region obtained by ioremap_nocache") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: staging: media: davinci_vpfe: use __func__ for function namesDiwakar Sharma
Checkpatch reported warnings for use of embedded function names. Use __func__ instead of embedded function names. [mchehab+samsung@kernel.org: rebased on the top of upstream] Signed-off-by: Diwakar Sharma <sharmalxmail@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: staging: media: davinci_vpfe: Replace a bit shiftArushi Singhal
This patch replaces bit shifting on 1 with the BIT(x) macro. This was done with coccinelle: @@ constant c; @@ -1 << c +BIT(c) [mchehab+samsung@kernel.org: rebase on the top of upstream] Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: staging: media: davinci_vpfe: - Fix for memory leak if decoder ↵Shailendra Verma
initialization fails. Fix to avoid possible memory leak if the decoder initialization got failed.Free the allocated memory for file handle object before return in case decoder initialization fails. Signed-off-by: Shailendra Verma <shailendra.v@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: staging: imgu: Drop support for other page sizesSakari Ailus
The hardware only supports 4ki pages; drop support for other sizes. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by: Rajmohan Mani <rajmohan.mani@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: staging: imgu: Address compiler / checker warnings in MMU codeSakari Ailus
Address C compiler, sparse and smatch warnings and little style issues in the IMGU MMU code. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by: Rajmohan Mani <rajmohan.mani@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: staging: imgu: Remove redundant checksSakari Ailus
Remove redundant checks for less than zero on unsigned variables. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by: Rajmohan Mani <rajmohan.mani@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: staging: imgu: Address a compiler warning on alignmentSakari Ailus
Address a compiler warnings on alignment of struct ipu3_uapi_awb_fr_config_s by adding __attribute__((aligned(32))) to a struct member of that type as well. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by: Rajmohan Mani <rajmohan.mani@intel.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: rockchip/vpu: Add support for MPEG-2 decoding on RK3288Jonas Karlman
Add necessary bits to support MPEG2 decoding on RK3288. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: rockchip/vpu: Add MPEG2 decoding support to RK3399Jonas Karlman
Add the necessary bits to support MPEG2 decoding on RK3399. Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: rockchip/vpu: Add infra to support MPEG-2 decodingJonas Karlman
Only adds structs and helpers to allow supporting MPEG-2 decoding on rockchip SoCs. Support for RK3399 and RK3288 will be added in separate commits Signed-off-by: Jonas Karlman <jonas@kwiboo.se> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: rockchip/vpu: Add support for non-standard controlsEzequiel Garcia
Rework the way controls are registered by the driver, so it can support non-standard controls, such as those used by stateless codecs. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: rockchip/vpu: Add decoder boilerplateEzequiel Garcia
This commit adds the needed boilerplate code to support the VPU in decoding operation. Two v4l2 interfaces are exposed, one for encoding and one for decoding, but a single m2m device is shared by them, so jobs are properly serialized. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: rockchip/vpu: Prepare things to support decodersBoris Brezillon
The code in rockchip_vpu_v4l2 was hardcoded for encoder support. Modify it more generic to support the decoder case so that we can re-use the same vb2/v4l2 ops for both devices. Co-developed-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: rockchip/vpu: Provide a helper to reset both src and dst formatsBoris Brezillon
When initializing a context, the core wants to reset both src and dst formats. Right now the order doesn't matter, but if we want to have a valid default width/height on the non-coded/raw format side (src in case of encoders, dst in case of decoders), we need to reset those formats in the right order: first the coded-format side, then the other, such that width and height on the raw format side can be taken from the coded format. Let's provide a helper that will reset both formats and make sure this is done in the right order. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: rockchip/vpu: Move encoder logic to a common placeBoris Brezillon
The V4L2/VB2 implementation for the encoder and decoder logic are very similar, so let's rename rockchip_vpu_enc.c file into rockchip_vpu_v4l2.c and remove the _enc_ part in objects/functions exposed in rockchip_vpu_v4l2.h. We also rename the enc_queue_init() function (in rockchip_vpu_drv.c) queue_init() since it will be used to initialize both type of queues. The implementation itself will be patched to support the decoding case when decoder support is added. Suggested-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: rockchip/vpu: Rename rockchip_vpu_common.h into rockchip_vpu_v4l2.hBoris Brezillon
We're about to add prototypes for the vb2/v4l2 helpers shared by the encoder/decoder logic in this file, so let's pick a name that reflects that (rockchip_vpu_common.h was a bit to generic). Suggested-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-29media: rockchip/vpu: Support the Request APIEzequiel Garcia
Introduce support for the Request API. Although the JPEG encoder does not mandate using the Request API, it's perfectly possible to use it, if the application wants to. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>