#
29d3e0b8 |
| 11-Aug-2023 |
Ruan Jinjie <ruanjinjie@huawei.com> |
media: staging: media: sunxi: cedrus: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, it is not necessary to use of_match_ptr() here.
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.
media: staging: media: sunxi: cedrus: Remove redundant of_match_ptr()
The driver depends on CONFIG_OF, it is not necessary to use of_match_ptr() here.
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
#
62ee459f |
| 03-Apr-2023 |
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> |
media: staging: media: sunxi: cedrus: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it
media: staging: media: sunxi: cedrus: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void.
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
50d0a7ae |
| 13-Mar-2023 |
Zheng Wang <zyytlz.wz@163.com> |
media: cedrus: fix use after free bug in cedrus_remove due to race condition
In cedrus_probe, dev->watchdog_work is bound with cedrus_watchdog function. In cedrus_device_run, it will started by sche
media: cedrus: fix use after free bug in cedrus_remove due to race condition
In cedrus_probe, dev->watchdog_work is bound with cedrus_watchdog function. In cedrus_device_run, it will started by schedule_delayed_work. If there is an unfinished work in cedrus_remove, there may be a race condition and trigger UAF bug.
CPU0 CPU1
|cedrus_watchdog cedrus_remove | v4l2_m2m_release | kfree(m2m_dev) | | | v4l2_m2m_get_curr_priv | m2m_dev //use
Fix it by canceling the worker in cedrus_remove.
Fixes: 7c38a551bda1 ("media: cedrus: Add watchdog for job completion") Signed-off-by: Zheng Wang <zyytlz.wz@163.com> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
f9e02e9c |
| 09-Nov-2022 |
Jernej Skrabec <jernej.skrabec@gmail.com> |
media: cedrus: Relax HEVC SPS restrictions
Testing reference video TSUNEQBD_A_MAIN10_Technicolor_2 has show that Cedrus is capable of decoding frames with different chroma and luma bit depths.
Rela
media: cedrus: Relax HEVC SPS restrictions
Testing reference video TSUNEQBD_A_MAIN10_Technicolor_2 has show that Cedrus is capable of decoding frames with different chroma and luma bit depths.
Relax restrictions so only highest depth is checked.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
65429ba8 |
| 09-Nov-2022 |
Jernej Skrabec <jernej.skrabec@gmail.com> |
media: cedrus: h265: Support decoding 10-bit frames
10-bit frames needs extra buffer space when 8-bit capture format is used. Use previously prepared infrastructure to adjust buffer size.
Signed-of
media: cedrus: h265: Support decoding 10-bit frames
10-bit frames needs extra buffer space when 8-bit capture format is used. Use previously prepared infrastructure to adjust buffer size.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
3a04d986 |
| 02-Nov-2022 |
Jernej Skrabec <jernej.skrabec@gmail.com> |
media: cedrus: initialize controls a bit later
While it doesn't matter if controls are initialized before or after queues and formats from open handler standpoint, initializing them last helps keepi
media: cedrus: initialize controls a bit later
While it doesn't matter if controls are initialized before or after queues and formats from open handler standpoint, initializing them last helps keeping s_ctrl handler simpler, since everything has already valid values.
This is just preparation for follow up changes. No functional change is intended.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
#
4e161728 |
| 02-Nov-2022 |
Jernej Skrabec <jernej.skrabec@gmail.com> |
media: cedrus: set codec ops immediately
We'll need codec ops soon after output format is set in following commits. Let's move current codec setup to set output format callback. While at it, let's r
media: cedrus: set codec ops immediately
We'll need codec ops soon after output format is set in following commits. Let's move current codec setup to set output format callback. While at it, let's remove one level of indirection by changing current_codec to point to codec ops structure directly.
Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
#
05d13e27 |
| 02-Nov-2022 |
Jernej Skrabec <jernej.skrabec@gmail.com> |
media: cedrus: Filter controls based on capability
Because not all Cedrus variants supports all codecs, controls should be registered only if codec related to individual control is supported by Cedr
media: cedrus: Filter controls based on capability
Because not all Cedrus variants supports all codecs, controls should be registered only if codec related to individual control is supported by Cedrus.
Replace codec enum, which is not used at all, with capabilities flags and register control only if capabilities are met. We have to be careful though, controls have to be tightly packed in ctx->ctrls array. Otherwise functions cedrus_find_control_data() and cedrus_get_num_of_controls() won't work properly.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
#
bc603309 |
| 02-Nov-2022 |
Jernej Skrabec <jernej.skrabec@gmail.com> |
media: cedrus: use helper to set default formats
Now that set output format helper is available, let's use that for setting default values. Advantage of this is that values will be always valid. Cur
media: cedrus: use helper to set default formats
Now that set output format helper is available, let's use that for setting default values. Advantage of this is that values will be always valid. Current code produced invalid default values for V3s SoC, which doesn't support MPEG2 decoding.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
#
708938f8 |
| 18-Aug-2022 |
Dmitry Osipenko <dmitry.osipenko@collabora.com> |
media: cedrus: Set the platform driver data earlier
The cedrus_hw_resume() crashes with NULL deference on driver probe if runtime PM is disabled because it uses platform data that hasn't been set up
media: cedrus: Set the platform driver data earlier
The cedrus_hw_resume() crashes with NULL deference on driver probe if runtime PM is disabled because it uses platform data that hasn't been set up yet. Fix this by setting the platform data earlier during probe.
Cc: stable@vger.kernel.org Fixes: 50e761516f2b (media: platform: Add Cedrus VPU decoder driver) Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Samuel Holland <samuel@sholland.org> Acked-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
f0b4a9c4 |
| 20-Jun-2022 |
Jernej Skrabec <jernej.skrabec@gmail.com> |
media: cedrus: h265: Implement support for tiles
Tiles are last remaining unimplemented functionality for HEVC. Implement it.
[hverkuil: fix checkpatch warning, split long line in two]
Signed-off-
media: cedrus: h265: Implement support for tiles
Tiles are last remaining unimplemented functionality for HEVC. Implement it.
[hverkuil: fix checkpatch warning, split long line in two]
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
c6618d27 |
| 20-Jun-2022 |
Jernej Skrabec <jernej.skrabec@gmail.com> |
media: cedrus: Add helper for determining number of elements
Now that controls can be dynamic arrays, we need to know how many elements are in such array. Add a helper for that.
Signed-off-by: Jern
media: cedrus: Add helper for determining number of elements
Now that controls can be dynamic arrays, we need to know how many elements are in such array. Add a helper for that.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
1f258653 |
| 20-Jun-2022 |
Jernej Skrabec <jernej.skrabec@gmail.com> |
media: cedrus: Improve error messages for controls
Currently error messages when control creation fails are very sparse. Granted, user should never observe them. However, developer working on codecs
media: cedrus: Improve error messages for controls
Currently error messages when control creation fails are very sparse. Granted, user should never observe them. However, developer working on codecs can. In such cases additional information like which control creation failed and error number are very useful.
Expand error messages with additional info.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
869ba3c8 |
| 08-Jul-2022 |
Benjamin Gaignard <benjamin.gaignard@collabora.com> |
media: uapi: HEVC: Define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS as a dynamic array
Make explicit that V4L2_CID_STATELESS_HEVC_SLICE_PARAMS control is a dynamic array control type. Some drivers may be
media: uapi: HEVC: Define V4L2_CID_STATELESS_HEVC_SLICE_PARAMS as a dynamic array
Make explicit that V4L2_CID_STATELESS_HEVC_SLICE_PARAMS control is a dynamic array control type. Some drivers may be able to receive multiple slices in one control to improve decoding performance.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
b92de2f9 |
| 08-Jul-2022 |
Benjamin Gaignard <benjamin.gaignard@collabora.com> |
media: uapi: HEVC: Rename HEVC stateless controls with STATELESS prefix
Change HEVC stateless controls names to V4L2_CID_STATELESS_HEVC instead of V4L2_CID_MPEG_VIDEO_HEVC be coherent with v4l2 nam
media: uapi: HEVC: Rename HEVC stateless controls with STATELESS prefix
Change HEVC stateless controls names to V4L2_CID_STATELESS_HEVC instead of V4L2_CID_MPEG_VIDEO_HEVC be coherent with v4l2 naming convention.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Tested-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
show more ...
|
#
7c38a551 |
| 01-Feb-2022 |
Jernej Skrabec <jernej.skrabec@gmail.com> |
media: cedrus: Add watchdog for job completion
Currently, if job is not completed for whatever reason, userspace application can hang on ioctl and thus become unkillable.
In order to prevent that,
media: cedrus: Add watchdog for job completion
Currently, if job is not completed for whatever reason, userspace application can hang on ioctl and thus become unkillable.
In order to prevent that, implement watchdog, which will complete job after 2 seconds with error state.
Concept is borrowed from hantro driver.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
show more ...
|
#
8f852ab8 |
| 19-Nov-2021 |
Samuel Holland <samuel@sholland.org> |
media: cedrus: Add support for the D1 variant
D1 has a unique variant of the video engine, which appears to drop the VP8 support found on most earlier variants.
Signed-off-by: Samuel Holland <samue
media: cedrus: Add support for the D1 variant
D1 has a unique variant of the video engine, which appears to drop the VP8 support found on most earlier variants.
Signed-off-by: Samuel Holland <samuel@sholland.org> Acked-by: Maxime Ripard <maxime@cerno.tech> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
fe47b6d7 |
| 02-Jul-2021 |
Daniel Almeida <daniel.almeida@collabora.com> |
media: cedrus: fix double free
If v4l2_ctrl_new_custom fails in cedrus_init_ctrls the error path will free ctx->ctrls, which is also freed in cedrus release. Fix this by setting ctx->ctrls to NULL i
media: cedrus: fix double free
If v4l2_ctrl_new_custom fails in cedrus_init_ctrls the error path will free ctx->ctrls, which is also freed in cedrus release. Fix this by setting ctx->ctrls to NULL instead of inadvertently removing kfree calls.
Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
83ffdc32 |
| 12-Sep-2021 |
Jernej Skrabec <jernej.skrabec@gmail.com> |
media: cedrus: add check for H264 and H265 limitations
Cedrus supports only YUV420 H264/H265 content and mostly only 8-bit colours (except on H6, where 10-bit are also supported).
Add validation ca
media: cedrus: add check for H264 and H265 limitations
Cedrus supports only YUV420 H264/H265 content and mostly only 8-bit colours (except on H6, where 10-bit are also supported).
Add validation callback to SPS controls, which will reject unsupported combinations.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
a240a464 |
| 12-Sep-2021 |
Jernej Skrabec <jernej.skrabec@gmail.com> |
media: cedrus: Add H265 10-bit capability flag
Currently only H6 variant supports decoding 10-bit H265 videos.
Add a capability flag, so driver could determine if 10-bit H265 slices should be allow
media: cedrus: Add H265 10-bit capability flag
Currently only H6 variant supports decoding 10-bit H265 videos.
Add a capability flag, so driver could determine if 10-bit H265 slices should be allowed or not.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
b84f60a3 |
| 05-Aug-2021 |
Ezequiel Garcia <ezequiel@collabora.com> |
media: Rename V4L2_PIX_FMT_SUNXI_TILED_NV12 to V4L2_PIX_FMT_NV12_32L32
The V4L2_PIX_FMT_SUNXI_TILED_NV12 format is actually a fairly common NV12 tiled format, with 32x32 linear tiles. Rename the for
media: Rename V4L2_PIX_FMT_SUNXI_TILED_NV12 to V4L2_PIX_FMT_NV12_32L32
The V4L2_PIX_FMT_SUNXI_TILED_NV12 format is actually a fairly common NV12 tiled format, with 32x32 linear tiles. Rename the format and move its documentation together with the other tiled NV12 formats.
Keep V4L2_PIX_FMT_SUNXI_TILED_NV12 for application compatibility.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
2845d9d6 |
| 06-Jun-2021 |
Jernej Skrabec <jernej.skrabec@gmail.com> |
media: cedrus: hevc: Add support for scaling lists
HEVC frames may use scaling list feature. Add support for it.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil
media: cedrus: hevc: Add support for scaling lists
HEVC frames may use scaling list feature. Add support for it.
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
d395a78d |
| 03-Jun-2021 |
Benjamin Gaignard <benjamin.gaignard@collabora.com> |
media: hevc: Add decode params control
Add decode params control and the associated structure to group all the information that are needed to decode a reference frame as is described in ITU-T Rec. H
media: hevc: Add decode params control
Add decode params control and the associated structure to group all the information that are needed to decode a reference frame as is described in ITU-T Rec. H.265 section "8.3.2 Decoding process for reference picture set".
Adapt Cedrus driver to these changes.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
f4815b39 |
| 29-Apr-2021 |
Ezequiel Garcia <ezequiel@collabora.com> |
media: uapi: move MPEG-2 stateless controls out of staging
Until now, the MPEG-2 V4L2 API was not exported as a public API, and only defined in a private media header (media/mpeg2-ctrls.h).
After r
media: uapi: move MPEG-2 stateless controls out of staging
Until now, the MPEG-2 V4L2 API was not exported as a public API, and only defined in a private media header (media/mpeg2-ctrls.h).
After reviewing the MPEG-2 specification in detail, and reworking the controls so they match the MPEG-2 semantics properly, we can consider it ready.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Tested-by: Jernej Skrabec <jernej.skrabec@siol.net> Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net> Tested-by: Daniel Almeida <daniel.almeida@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|
#
45f97ba1 |
| 29-Apr-2021 |
Ezequiel Garcia <ezequiel@collabora.com> |
media: uapi: mpeg2: Remove V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS
The Hantro and Cedrus drivers work in frame-mode, meaning they expect all the slices in a picture (either frame or field structure)
media: uapi: mpeg2: Remove V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS
The Hantro and Cedrus drivers work in frame-mode, meaning they expect all the slices in a picture (either frame or field structure) to be passed in each OUTPUT buffer.
These two are the only V4L2 MPEG-2 stateless decoders currently supported. Given the VA-API drivers also work per-frame, coalescing all the MPEG-2 slices in a buffer before the decoding operation, it makes sense to not expect slice-mode drivers and therefore remove V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS.
This is done to avoid carrying an unused interface. If needed, this control can be added without breaking backwards compatibility. Note that this would mean introducing a enumerator control to specify the decoding mode (see V4L2_CID_STATELESS_H264_DECODE_MODE).
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Co-developed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Tested-by: Jernej Skrabec <jernej.skrabec@siol.net> Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net> Tested-by: Daniel Almeida <daniel.almeida@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
show more ...
|