- 15 Nov, 2021 40 commits
-
-
Andrzej Pietrasiewicz authored
The G2 decoder block produces NV12 4x4 tiled format (NV12_4L4). Enable the G2 post-processor block, in order to produce regular NV12. The logic in hantro_postproc.c is leveraged to take care of allocating the extra buffers and configure the post-processor, which is significantly simpler than the one on the G1. Signed-off-by:
Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by:
Andrzej Pietrasiewicz <andrzej.p@collabora.com>
-
Andrzej Pietrasiewicz authored
VeriSilicon Hantro G2 core supports VP9 codec. Signed-off-by:
Andrzej Pietrasiewicz <andrzej.p@collabora.com> Reviewed-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Andrzej Pietrasiewicz authored
VeriSilicon Hantro G2 core supports other codecs besides hevc. Factor out some common code in preparation for vp9 support. Signed-off-by:
Andrzej Pietrasiewicz <andrzej.p@collabora.com> Reviewed-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
Andrzej Pietrasiewicz authored
Add more consistency in the way registers are named. Signed-off-by:
Andrzej Pietrasiewicz <andrzej.p@collabora.com>
-
Andrzej Pietrasiewicz authored
The Rockchip VDEC supports VP9 profile 0 up to 4096x2304@30fps. Add a backend for this new format. Signed-off-by:
Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by:
Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by:
Adrian Ratiu <adrian.ratiu@collabora.com> Co-developed-by:
Andrzej Pietrasiewicz <andrzej.p@collabora.com> Signed-off-by:
Andrzej Pietrasiewicz <andrzej.p@collabora.com>
-
Andrzej Pietrasiewicz authored
Provide code common to vp9 drivers in one central location. Signed-off-by:
Andrzej Pietrasiewicz <andrzej.p@collabora.com> Signed-off-by:
Ezequiel Garcia <ezequiel@collabora.com>
-
Andrzej Pietrasiewicz authored
Add the VP9 stateless decoder controls plus the documentation that goes with it. Signed-off-by:
Boris Brezillon <boris.brezillon@collabora.com> Co-developed-by:
Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by:
Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by:
Adrian Ratiu <adrian.ratiu@collabora.com> Signed-off-by:
Andrzej Pietrasiewicz <andrzej.p@collabora.com> Co-developed-by:
Daniel Almeida <daniel.almeida@collabora.com> Signed-off-by:
Daniel Almeida <daniel.almeida@collabora.com>
-
The G2 core decoder engine produces NV12_4L4 format, which is a simple NV12 4x4 tiled format. The driver currently hides this format by always enabling the post-processor engine, and therefore offering NV12 directly. This is done without using the logic in hantro_postproc.c and therefore makes it difficult to add VP9 cleanly. Since fixing this is not easy, add a small quirk to force NV12 if HEVC was configured, but otherwise declare NV12_4L4 as the pixel format in imx8mq_vpu_g2_variant.dec_fmts. This will be used by the VP9 decoder which will be added soon. Signed-off-by:
Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by:
Andrzej Pietrasiewicz <andrzej.p@collabora.com>
-
Add a 'postprocessed' boolean property to struct hantro_fmt to signal that a format is produced by the post-processor. This will allow to introduce the G2 post-processor in a simple way. Signed-off-by:
Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by:
Andrzej Pietrasiewicz <andrzej.p@collabora.com>
-
Turns out the post-processor block on the G2 core is substantially different from the one on the G1 core. Introduce hantro_postproc_ops with .enable and .disable methods, which will allow to support the G2 post-processor cleanly. Signed-off-by:
Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by:
Andrzej Pietrasiewicz <andrzej.p@collabora.com> Reviewed-by:
Benjamin Gaignard <benjamin.gaignard@collabora.com>
-
When the post-processor hardware block is enabled, the driver allocates an internal queue of buffers for the decoder enginer, and uses the vb2 queue for the post-processor engine. For instance, on a G1 core, the decoder engine produces NV12 buffers and the post-processor engine can produce YUY2 buffers. The decoder engine expects motion vectors to be appended to the NV12 buffers, but this is only required for CODECs that need motion vectors, such as H.264. Fix the post-processor logic accordingly. Signed-off-by:
Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by:
Andrzej Pietrasiewicz <andrzej.p@collabora.com>
-
Cai Huoqing authored
The helper function devm_platform_ioremap_resource() needs HAS_IOMEM enabled, so add the dependency on HAS_IOMEM. Signed-off-by:
Cai Huoqing <caihuoqing@baidu.com> Signed-off-by:
Sean Young <sean@mess.org> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Maíra Canal authored
Remove legacy PWM interface (pwm_config, pwm_enable, pwm_disable) and replace it for the atomic PWM API. Signed-off-by:
Maíra Canal <maira.canal@usp.br> Reviewed-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Sean Young <sean@mess.org> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Maíra Canal authored
Remove legacy PWM interface (pwm_config, pwm_enable, pwm_disable) and replace it for the atomic PWM API. Signed-off-by:
Maíra Canal <maira.canal@usp.br> Acked-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by:
Sean Young <sean@mess.org> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Uwe Kleine-König authored
A driver with a remove callback that just returns 0 behaves identically to a driver with no remove callback at all. So simplify accordingly. Signed-off-by:
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by:
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by:
Sean Young <sean@mess.org> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Christophe JAILLET authored
'destroy_workqueue()' already drains the queue before destroying it, so there is no need to flush it explicitly. Remove the redundant 'flush_workqueue()' calls. This was generated with coccinelle: @@ expression E; @@ - flush_workqueue(E); destroy_workqueue(E); Signed-off-by:
Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Christophe JAILLET authored
'destroy_workqueue()' already drains the queue before destroying it, so there is no need to flush it explicitly. Remove the redundant 'flush_workqueue()' calls. This was generated with coccinelle: @@ expression E; @@ - flush_workqueue(E); destroy_workqueue(E); Signed-off-by:
Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Randy Dunlap authored
Fix grammar/wording in the help text for MEDIA_TEST_SUPPORT. Fixes: 4b32216a ("media: split test drivers from platform directory") Signed-off-by:
Randy Dunlap <rdunlap@infradead.org> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Tzung-Bi Shih authored
A clang-analyzer warning was reported. >> drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_stateless.c:133:18: warning: Value stored to 'pfb' during its initialization is never read [clang-analyzer-deadcode.DeadStores] struct vdec_fb *pfb = &framebuf->frame_buffer; ^~~ ~~~~~~~~~~~~~~~~~~~~~~~ Removes the redundant 'pfb' assignment to fix. Reported-by:
kernel test robot <lkp@intel.com> Signed-off-by:
Tzung-Bi Shih <tzungbi@google.com> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Dillon Min authored
get compile-test failed report from lkp@intel.com after the driver submitted. "ld.lld: error: undefined symbol: v4l2_fh_init" so, make CONFIG_STM32_DMA2D depends on CONFIG_VIDEO_DEV and CONFIG_VIDEO_V4L2 to fix this compile error. Fixes: bff6e3e2 ("media: stm32-dma2d: STM32 DMA2D driver") Reported-by:
kernel test robot <lkp@intel.com> Signed-off-by:
Dillon Min <dillon.minfei@gmail.com> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Dillon Min authored
remove unused functions to avoid compile errors when W=1. >> drivers/media/platform/stm32/dma2d/dma2d-hw.c:29:20: error: unused function 'reg_set' [-Werror,-Wunused-function] static inline void reg_set(void __iomem *base, u32 reg, u32 mask) >> drivers/media/platform/stm32/dma2d/dma2d-hw.c:34:20: error: unused function 'reg_clear' [-Werror,-Wunused-function] static inline void reg_clear(void __iomem *base, u32 reg, u32 mask) Fixes: bff6e3e2 ("media: stm32-dma2d: STM32 DMA2D driver") Reported-by:
kernel test robot <lkp@intel.com> Signed-off-by:
Dillon Min <dillon.minfei@gmail.com> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Jammy Huang authored
If res-chg, VE_INTERRUPT_MODE_DETECT_WD irq will be raised. But v4l2_input_status won't be updated to no-signal immediately until aspeed_video_get_resolution() in aspeed_video_resolution_work(). During the period of time, aspeed_video_start_frame() could be called because it doesn't know signal becomes unstable now. If it goes with aspeed_video_init_regs() of aspeed_video_irq_res_change() simultaneously, it will mess up hw state. To fix this problem, v4l2_input_status is updated to no-signal immediately for VE_INTERRUPT_MODE_DETECT_WD irq. Fixes: d2b4387f ("media: platform: Add Aspeed Video Engine driver") Signed-off-by:
Jammy Huang <jammy_huang@aspeedtech.com> Acked-by:
Paul Menzel <pmenzel@molgen.mpg.de> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Hans Verkuil authored
The Documentation/driver-api/media/drivers/rkisp1.rst file wasn't referenced in the index.rst file, so it was never included. Add it. Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Yunfei Dong authored
Width and height need to 64 bytes aligned when setting the format. Need to make sure all is 64 bytes align when use width and height to calculate buffer size. Signed-off-by:
Yunfei Dong <yunfei.dong@mediatek.com> Acked-by:
Nicolas Dufresne <nicolas.dufresne@collabora.com> Tested-by:
Steve Cho <stevecho@chromium.org> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Hans Verkuil authored
If V4L2_CAP_READWRITE is not set, then readbuffers must be set to 0, otherwise v4l2-compliance will complain. A note on the Fixes tag below: this patch does not really fix that commit, but it can be applied from that commit onwards. For older code there is no guarantee that device_caps is set, so even though this patch would apply, it will not work reliably. Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Fixes: 049e684f (media: v4l2-dev: fix WARN_ON(!vdev->device_caps)) Cc: <stable@vger.kernel.org> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Hans Verkuil authored
Improve the documentation for CEC_RECEIVE/TRANSMIT w.r.t. the sequence and tx/rx_status fields. Also remove a duplicate tx_status description. Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Kwang Son authored
Fix example code which has missing or double backslash typo. Signed-off-by:
Kwang Son <dev.kwang.son@gmail.com> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Dongliang Mu authored
In the em28xx_init_rev, if em28xx_audio_setup fails, this function fails to deallocate the media_dev allocated in the em28xx_media_device_init. Fix this by adding em28xx_unregister_media_device to free media_dev. BTW, this patch is tested in my local syzkaller instance, and it can prevent the memory leak from occurring again. CC: Pavel Skripkin <paskripkin@gmail.com> Fixes: 37ecc7b1 ("[media] em28xx: add media controller support") Signed-off-by:
Dongliang Mu <mudongliangabcd@gmail.com> Reported-by:
syzkaller <syzkaller@googlegroups.com> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Niklas Söderlund authored
Convert ADV748X analog video decoder documentation to json-schema. While converting the bindings extend it to enforce that all port@n nodes shall be encapsulated inside a ports node. This change does not have an effect on drivers parsing the ports@n nodes. Signed-off-by:
Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by:
Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by:
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by:
Rob Herring <robh@kernel.org> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Christophe JAILLET authored
'mfc_dev->mem_bitmap' is a bitmap. So use 'bitmap_zalloc()' to simplify code and improve the semantic. Also change the corresponding 'kfree()' into 'bitmap_free()' to keep consistency. Signed-off-by:
Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Kieran Bingham authored
The cleanup in tw5864_finidev() neglected to disable the PCI device after enabling it in tw5864_initdev(). Call pci_disable_device() after releasing the associated resources. Signed-off-by:
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Christophe JAILLET authored
Some resources are allocated with 'pci_request_regions()', so use 'pci_release_regions()' to free them, instead of a verbose 'release_mem_region()'. There is no point in calling 'devm_kfree()'. The corresponding resource is managed, so it will be fried automatically. Signed-off-by:
Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by:
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Cai Huoqing authored
Repalce kthread_create/wake_up_process() with kthread_run() to simplify the code. Signed-off-by:
Cai Huoqing <caihuoqing@baidu.com> Reviewed-by:
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Jammy Huang authored
aspeed_video_get_resolution() will try to do res-detect again if the timing got in last try is invalid. But it will always time out because VE_SEQ_CTRL_TRIG_MODE_DET is only cleared after 1st mode-detect. To fix the problem, just clear VE_SEQ_CTRL_TRIG_MODE_DET before setting it in aspeed_video_enable_mode_detect(). Fixes: d2b4387f ("media: platform: Add Aspeed Video Engine driver") Signed-off-by:
Jammy Huang <jammy_huang@aspeedtech.com> Acked-by:
Paul Menzel <pmenzel@molgen.mpg.de> Reviewed-by:
Joel Stanley <joel@jms.id.au> Signed-off-by:
Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Xu Wang authored
In ia_css_frame_map, the check of 'err' is unneeded to be done twice. Link: https://lore.kernel.org/linux-media/20211110094910.67951-1-vulab@iscas.ac.cn Signed-off-by:
Xu Wang <vulab@iscas.ac.cn> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Mauro Carvalho Chehab authored
Simplify the code by getting rid of this function, as it ends being just a single line of code. Link: https://lore.kernel.org/linux-media/80ea920d14379124ba92aab2e6a6d12a92d79b2b.1636544620.git.mchehab+huawei@kernel.org Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Mauro Carvalho Chehab authored
The open() fops support two types of devices: "acc" and normal ones. the acc works on a different way, using a different pipe struct. Not sure yet if it would make sense to setup a run_mode there. Also, As default_run_mode exists only on normal modes, we can simplify the logic to check if the device is in normal mode. That solves this warning: ../drivers/staging/media/atomisp/pci/atomisp_fops.c:904 atomisp_open() warn: variable dereferenced before check 'asd' (see line 807) Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Mauro Carvalho Chehab authored
The asd->isp was referenced before checking if asd is not NULL. This fixes this warning: ../drivers/staging/media/atomisp/pci/atomisp_cmd.c:5548 atomisp_set_fmt_to_snr() warn: variable dereferenced before check 'asd' (see line 5540) While here, avoid getting the pipe pointer twice. Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Mauro Carvalho Chehab authored
During atomisp register, udev tries to open all devices. For some, pipe is NULL, at least during register time, causing the driver to try to access a NULL pointer. So, add an extra check to avoid such condition. Link: https://lore.kernel.org/linux-media/6406265f2d5f3791d5c7cbd1364186217f19524c.1636364423.git.mchehab+huawei@kernel.org Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-
Dan Carpenter authored
The "power" pointer is not initialized on the else path and that would lead to an Oops. Link: https://lore.kernel.org/linux-media/20211012082150.GA31086@kili Fixes: c30f4cb2 ("media: atomisp: Refactor PMIC detection to a separate function") Signed-off-by:
Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by:
Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by:
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-