If scaling matrix control is present, VPU should not use default matrix.
Fix that.
Fixes: b3a23db0e2f8 ("media: cedrus: Use H264_SCALING_MATRIX only when
required")
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 2 +-
1 file changed, 1 inser
sible that bitstream
parsing functions set some internal VPU state, which is later necessary
for proper decoding. Biggest suspect is "VP8 probs update" trigger.
Signed-off-by: Jernej Skrabec
[addressed issues from reviewer]
Signed-off-by: Emmanuel Gil Peyrot
---
Changes in v3:
- add
it for all variants
except for V3s.
Signed-off-by: Jernej Skrabec
---
Note: this should be merged after both of these PRs:
https://patchwork.linuxtv.org/project/linux-media/patch/8cf5021f-559c-5ea8-f1f0-250c00bc1...@xs4all.nl/
https://patchwork.linuxtv.org/project/linux-media/patch/5dbd468d-1d10-e0c8-43f0
oving that mechanism.
Note that this mechanism with static required flag isn't very good
anyway because need for control is usually signaled in other controls.
Fixes: 50e761516f2b ("media: platform: Add Cedrus VPU decoder driver")
Signed-off-by: Jernej Skrabec
---
drivers/s
This short series fixes two issues:
1. conformance to v4l2 request api specifications
2. regression in h264 video decoding introduced during h264 api rework
Please take a look.
Best regards,
Jernej
Jernej Skrabec (2):
media: cedrus: Remove checking for required controls
media: cedrus: Fix
igure reference field")
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
index 781c84a9b1b7.
timestamps are different,
it's first slice and viceversa.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus.h | 1 +
drivers/staging/media/sunxi/cedrus/cedrus_dec.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus
ot (1):
media: docs-rst: Document m2m stateless video decoder interface
Hans Verkuil (2):
vb2: add V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF
videodev2.h: add V4L2_DEC_CMD_FLUSH
Jernej Skrabec (4):
media: cedrus: Detect first slice of a frame
media: cedrus: h264: Support multiple slices per
This command is useful for explicitly flushing last decoded frame.
Signed-off-by: Jernej Skrabec
---
.../staging/media/sunxi/cedrus/cedrus_video.c | 34 +++
1 file changed, 34 insertions(+)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
b/drivers/staging/media
From: Hans Verkuil
Add this new V4L2_DEC_CMD_FLUSH decoder command and document it.
Signed-off-by: Hans Verkuil
Signed-off-by: Jernej Skrabec
---
Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst | 11 ++-
Documentation/media/videodev2.h.rst.exceptions | 1 +
include/uapi
or coda.
The only thing missing was the real specification included as a part of
Linux Media documentation. Fix it now and document the encoder part of
the Codec API.
Signed-off-by: Tomasz Figa
Signed-off-by: Hans Verkuil
Signed-off-by: Jernej Skrabec
---
Documentation/media/uapi/v4l/dev
igned-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_dec.c | 9 +
drivers/staging/media/sunxi/cedrus/cedrus_hw.c| 8 +---
drivers/staging/media/sunxi/cedrus/cedrus_video.c | 1 +
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/
that do not support slicing (e.g. VP8), the FLUSH command
just does nothing.
Signed-off-by: Hans Verkuil
Tested-by: Boris Brezillon
Reviewed-by: Boris Brezillon
[Adjust example code]
Signed-off-by: Jernej Skrabec
---
Documentation/media/uapi/v4l/buffer.rst | 13 ++
.../media/uap
considered staging for a short while.
Signed-off-by: Alexandre Courbot
Signed-off-by: Jernej Skrabec
---
Documentation/media/uapi/v4l/dev-mem2mem.rst | 1 +
.../media/uapi/v4l/dev-stateless-decoder.rst | 424 ++
2 files changed, 425 insertions(+)
create mode 100644
With recent changes, support for decoding multi-slice frames can be
easily added now.
Signal VPU if current slice is first in frame or not and add information
about first macroblock coordinates.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 11
ormat
- added v4l m2m stateless_(try_)decoder_cmd ioctl helpers
Hans Verkuil (2):
vb2: add V4L2_BUF_FLAG_M2M_HOLD_CAPTURE_BUF
videodev2.h: add V4L2_DEC_CMD_FLUSH
Jernej Skrabec (4):
media: v4l2-mem2mem: add stateless_(try_)decoder_cmd ioctl helpers
media: cedrus: Detect first slice of a
From: Hans Verkuil
Add this new V4L2_DEC_CMD_FLUSH decoder command and document it.
Reviewed-by: Boris Brezillon
Reviewed-by: Alexandre Courbot
Signed-off-by: Hans Verkuil
[Adjusted description]
Signed-off-by: Jernej Skrabec
---
Documentation/media/uapi/v4l/vidioc-decoder-cmd.rst | 10
With recent changes, support for decoding multi-slice frames can be
easily added now.
Signal VPU if current slice is first in frame or not and add information
about first macroblock coordinates.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 11
that do not support slicing (e.g. VP8), the FLUSH command
just does nothing.
Signed-off-by: Hans Verkuil
Tested-by: Boris Brezillon
Reviewed-by: Boris Brezillon
[Adjust example code]
Signed-off-by: Jernej Skrabec
---
Documentation/media/uapi/v4l/buffer.rst | 13 ++
.../media/uap
timestamps are different,
it's first slice and viceversa.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus.h | 1 +
drivers/staging/media/sunxi/cedrus/cedrus_dec.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus
These helpers are used by stateless codecs when they support multiple
slices per frame and hold capture buffer flag is set. It's expected that
all such codecs will use this code.
Signed-off-by: Jernej Skrabec
---
drivers/media/v4l2-core/v4l2-mem2mem.c | 35 ++
in
igned-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_dec.c | 9 +
drivers/staging/media/sunxi/cedrus/cedrus_hw.c| 8 +---
drivers/staging/media/sunxi/cedrus/cedrus_video.c | 14 ++
3 files changed, 28 insertions(+), 3 deletions(-)
diff --
Accessing capture queue structue directly is not safe. Use helpers for
that.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus.h | 8 ++--
drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 8 ++--
2 files changed, 12 insertions(+), 4 deletions(-)
diff
-by: Jernej Skrabec
---
.../staging/media/sunxi/cedrus/cedrus_h264.c | 30 +--
.../staging/media/sunxi/cedrus/cedrus_regs.h | 3 ++
2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
b/drivers/staging/media/sunxi
Reference index count in VE_H264_PPS should come from PPS control.
However, this is not really important, because reference index count is
in our case always overridden by that from slice header.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 8 ++--
1
set to values from slice control.
Patch 3 replaces direct accesses to capture queue from m2m contex with
helpers which was designed exactly for that. It's also safer since
helpers do some checks.
Best regards,
Jernej
Jernej Skrabec (3):
media: cedrus: Fix decoding for some H264 videos
: Paul Kocialkowski
Signed-off-by: Jernej Skrabec
---
.../staging/media/sunxi/cedrus/cedrus_h264.c | 30 +--
.../staging/media/sunxi/cedrus/cedrus_regs.h | 3 ++
2 files changed, 30 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
b
designed exactly for that. It's also safer since
helpers do some checks.
Best regards,
Jernej
Changes from v2.
- Removed patch 2, because Paul plans to take different approach
- Rebased patch 1
Jernej Skrabec (2):
media: cedrus: Fix decoding for some H264 videos
media: cedrus: Use helpe
Accessing capture queue structue directly is not safe. Use helpers for
that.
Acked-by: Paul Kocialkowski
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus.h | 8 ++--
drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 8 ++--
2 files changed, 12
Mode register also holds information if video width is bigger than 2048
and if it is equal to 4096.
Rework cedrus_engine_enable() to properly signal this properties.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 2 +-
drivers/staging/media/sunxi/cedrus
There are few variations of 4k resolutions. The biggest one is
4096x2304 which is also supported by HW. It has also nice property that
both width and size are divisible by maximum HEVC CTB size, which is 64.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_video.c | 4
H264 decoder needs additional or bigger buffers in order to decode 4k
videos.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus.h | 7 ++
.../staging/media/sunxi/cedrus/cedrus_h264.c | 83 +--
.../staging/media/sunxi/cedrus/cedrus_regs.h | 11
12 MiB and add "vmalloc=512M" to kernel
arguments. Memory optimizations will be done later.
This series is based on top of https://patchwork.linuxtv.org/cover/59653/
Best regards,
Jernej
Jernej Skrabec (3):
media: cedrus: Properly signal size in mode register
media: cedrus: Fix H26
:
http://jernej.libreelec.tv/videos/h265/Dredd%20%E2%80%93%20DTS%20Sound%20Check%20DTS-HD%20MA%207.1.m2ts
Best regards,
Jernej
Jernej Skrabec (4):
media: uapi: hevc: Add scaling matrix control
media: cedrus: hevc: Add support for scaling matrix
media: uapi: hevc: Add segment address field
If HEVC frame consists of multiple slices, segment address has to be
known in order to properly decode it.
Add segment address field to slice parameters.
Signed-off-by: Jernej Skrabec
---
Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 5 -
include/media/hevc-ctrls.h
HEVC has a scaling matrix concept. Add support for it.
Signed-off-by: Jernej Skrabec
---
.../media/uapi/v4l/ext-ctrls-codec.rst| 41 +++
.../media/uapi/v4l/pixfmt-compressed.rst | 1 +
drivers/media/v4l2-core/v4l2-ctrls.c | 10 +
include/media/hevc
HEVC frames may use scaling list feature. Add support for it.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus.c | 7 ++
drivers/staging/media/sunxi/cedrus/cedrus.h | 1 +
.../staging/media/sunxi/cedrus/cedrus_dec.c | 2 +
.../staging/media/sunxi/cedrus
Now that segment address is available, support for multi-slice frames
can be easily added.
Signed-off-by: Jernej Skrabec
---
.../staging/media/sunxi/cedrus/cedrus_h265.c | 21 +++
.../staging/media/sunxi/cedrus/cedrus_video.c | 1 +
2 files changed, 18 insertions(+), 4
There are few variations of 4k resolutions. The biggest one is
4096x2304 which is also supported by HW. It has also nice property that
both width and size are divisible by maximum HEVC CTB size, which is 64.
Signed-off-by: Jernej Skrabec
Acked-by: Paul Kocialkowski
---
drivers/staging/media
Mode register also holds information if video width is bigger than 2048
and if it is equal to 4096.
Rework cedrus_engine_enable() to properly signal this properties.
Signed-off-by: Jernej Skrabec
Acked-by: Paul Kocialkowski
---
drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 2 +-
drivers
ns will be done later.
Best regards,
Jernej
Changes from v1:
- added Paul's acked-by
- added define for minimum pic info buf size
- added comments that formulas come from CedarX source
Jernej Skrabec (3):
media: cedrus: Properly signal size in mode register
media: cedrus: Fix H264 4k sup
H264 decoder needs additional or bigger buffers in order to decode 4k
videos.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus.h | 7 ++
.../staging/media/sunxi/cedrus/cedrus_h264.c | 91 +--
.../staging/media/sunxi/cedrus/cedrus_regs.h | 11
Currently, MEDIA_IOC_G_TOPOLOGY ioctl on cedrus fails due to incorrect
initialization order. Fix that by moving video_register_device() before
v4l2_m2m_register_media_controller() and while at it, fix error path.
Reported-by: Jonas Karlman
Signed-off-by: Jernej Skrabec
---
drivers/staging
Some VPU variants may run at higher clock speeds. They actually need
extra speed to be capable of decoding more complex codecs like HEVC or
bigger image sizes (4K).
Expand variant structure with mod_rate information.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus.c
that's not efficient. It's size in H264 depends on flags set in SPS, but
that information is not available in buffer init callback.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus.h | 4
.../staging/media/sunxi/cedrus/cedrus_video.c | 19
libvdpau-sunxi always disables engine after each decoded slice.
Do same in Cedrus driver.
Presumably this also lowers power consumption which is always nice.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 1 +
1 file changed, 1 insertion(+)
diff --git a
Scale and rotation are currently not implemented, so it makes no sense to
set chroma size for it.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_hw.c
b/drivers
Here is first batch of random Cedrus improvements/cleanups. Only patch 2
has a change which raises a question about H264 controls.
Changes were tested on H3 SoC using modified ffmpeg and Kodi.
Please take a look.
Best regards,
Jernej
Jernej Skrabec (7):
media: cedrus: Disable engine after
: Jernej Skrabec
---
We have to decide if we drop pps->num_ref_idx_l0_default_active_minus1
and pps->num_ref_idx_l1_default_active_minus1 fields or add
num_ref_idx_l0_active_override_flag and num_ref_idx_l0_active_override_flag
to slice control.
Current control doesn't have those two f
preparation for 4K video decoding support, which will be
implemented later.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus.h | 4 -
.../staging/media/sunxi/cedrus/cedrus_h264.c | 81 +++
2 files changed, 28 insertions(+), 57 deletions(-)
diff
-by: Jernej Skrabec
---
I have two samples which are fixed by this:
http://jernej.libreelec.tv/videos/h264/test.mkv
http://jernej.libreelec.tv/videos/h264/Dredd%20%E2%80%93%20DTS%20Sound%20Check%20DTS-HD%20MA%207.1.m2ts
Although second one also needs support for multi-slice frames, which is not yet
This array is just duplicated capture buffer queue. Remove it and adjust
code to look into capture buffer queue instead.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus.h | 4 +---
.../staging/media/sunxi/cedrus/cedrus_h264.c | 4 ++--
.../staging/media/sunxi
:
http://jernej.libreelec.tv/videos/h265/Dredd%20%E2%80%93%20DTS%20Sound%20Check%20DTS-HD%20MA%207.1.m2ts
Best regards,
Jernej
Changes from v1:
- always set CTB_ADDR_X and CTB_ADDR_Y (patch 4)
Jernej Skrabec (4):
media: uapi: hevc: Add scaling matrix control
media: cedrus: hevc: Add support for
HEVC frames may use scaling list feature. Add support for it.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus.c | 7 ++
drivers/staging/media/sunxi/cedrus/cedrus.h | 1 +
.../staging/media/sunxi/cedrus/cedrus_dec.c | 2 +
.../staging/media/sunxi/cedrus
HEVC has a scaling matrix concept. Add support for it.
Signed-off-by: Jernej Skrabec
---
.../media/uapi/v4l/ext-ctrls-codec.rst| 41 +++
.../media/uapi/v4l/pixfmt-compressed.rst | 1 +
drivers/media/v4l2-core/v4l2-ctrls.c | 10 +
include/media/hevc
Now that segment address is available, support for multi-slice frames
can be easily added.
Signed-off-by: Jernej Skrabec
---
.../staging/media/sunxi/cedrus/cedrus_h265.c | 26 ---
.../staging/media/sunxi/cedrus/cedrus_video.c | 1 +
2 files changed, 17 insertions(+), 10
If HEVC frame consists of multiple slices, segment address has to be
known in order to properly decode it.
Add segment address field to slice parameters.
Signed-off-by: Jernej Skrabec
---
Documentation/media/uapi/v4l/ext-ctrls-codec.rst | 5 -
include/media/hevc-ctrls.h
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_h265.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h265.c
b/drivers/staging/media/sunxi/cedrus/cedrus_h265.c
index 5a207f1e137c..13e58977309f 100644
--- a/drivers
fix, those same videos totally crash HEVC decoder (other
decoder engines are unaffected). After decoding those problematic
videos, HEVC decoder always returns only green image (all zeros).
Only complete HW reset helps.
This fix is similar to that for H264.
Signed-off-by: Jernej Skrabec
overlooked in initial HEVC driver.
This was developed on top of:
https://patchwork.linuxtv.org/cover/60729/
Best regards,
Jernej
Jernej Skrabec (2):
media: cedrus: Fix decoding for some HEVC videos
media: cedrus: hevc: Add luma bit depth
.../staging/media/sunxi/cedrus/cedrus_h265.c | 26
Due to unknown reason, H6 needs larger intraprediction buffer for 4K
videos than other SoCs. This was discovered by playing 4096x2304 video,
which is maximum what H6 VPU is supposed to support.
Fixes: 03e612e701a6 ("media: cedrus: Fix H264 4k support")
Signed-off-by: Jernej Skrabec
--
If VPU supports untiled output, it actually supports several different
YUV 4:2:0 layouts, namely NV12, NV21, YUV420 and YVU420.
Add support for all of them.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_hw.c | 18 +-
.../staging/media/sunxi/cedrus
sible that bitstream
parsing functions set some internal VPU state, which is later necessary
for proper decoding. Biggest suspect is "VP8 probs update" trigger.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/Makefile | 3 +-
drivers/staging/media/sunxi/cedrus/c
lists.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
index cce527bbdf86..c87717d17ec5
xtensively tested using Kodi on LibreELEC with A64,
H3, H5 and H6 SoCs in slightly different form (flags were transmitted
in MSB bits in index).
Note: I'm not 100% sure if flags for both, top and bottom fields are
needed. Any input here would be welcome.
Please take a look.
Best regards,
.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 15 +--
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c
index c87717d17ec5
. Flags will tell if reference is meant for top or
bottom field.
Currently the only user of these lists is Cedrus which is just compile
fixed here. Actual usage of newly introduced flags will come in
following commit.
Signed-off-by: Jernej Skrabec
---
.../media/v4l/ext-ctrls-codec.rst
sible that bitstream
parsing functions set some internal VPU state, which is later necessary
for proper decoding. Biggest suspect is "VP8 probs update" trigger.
Signed-off-by: Jernej Skrabec
---
Changes in v2:
- rebased on top of current linux-media master branch
drivers/staging/med
Allwinner R40 has system controller similar to that in A10.
Add compatibles for system controller and sram c1 region.
Signed-off-by: Jernej Skrabec
---
.../bindings/sram/allwinner,sun4i-a10-system-control.yaml | 6 ++
1 file changed, 6 insertions(+)
diff --git
a/Documentation
Allwinner R40 SoC has a video engine.
Add a node for it.
Signed-off-by: Jernej Skrabec
---
arch/arm/boot/dts/sun8i-r40.dtsi | 11 +++
1 file changed, 11 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi
index 0c7526365896..7907569e7b5c
Allwinner R40 SoC contains video engine. Add compatible for it.
Signed-off-by: Jernej Skrabec
---
.../bindings/media/allwinner,sun4i-a10-video-engine.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git
a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
Video engine in R40 is very similar to that in A33 but it runs on lower
speed, at least according to OS images released by board designer.
Signed-off-by: Jernej Skrabec
---
drivers/staging/media/sunxi/cedrus/cedrus.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/drivers/staging
Allwinner R40 SoC contains video engine very similar to that in A33.
First two patches add system controller nodes and the rest of them
add support for Cedrus VPU.
Please take a look.
Best regards,
Jernej
Jernej Skrabec (5):
dt-bindings: sram: allwinner,sun4i-a10-system-control: Add R40
Allwinner R40 has system controller and SRAM C1 region similar to that
in A10.
Add nodes for them.
Signed-off-by: Jernej Skrabec
---
arch/arm/boot/dts/sun8i-r40.dtsi | 23 +++
1 file changed, 23 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot
74 matches
Mail list logo