Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport HEVC decoder as submitted to linux-media as v2 #6666

Open
wants to merge 20 commits into
base: rpi-6.12.y
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
2e11ea7
Revert "staging: media: rpivid: Add Raspberry Pi V4L2 H265 decoder"
6by9 Dec 5, 2024
7a6aaae
Revert "media: videodev2.h: Add a format for column YUV4:2:0 modes"
6by9 Dec 12, 2024
2652c76
Revert "RFC: media: Add media_request_{pin,unpin} API"
6by9 Feb 12, 2025
edea94c
media: mc: add manual request completion
Aug 29, 2024
9590d8a
media: vicodec: add support for manual completion
Aug 29, 2024
c3e1a94
media: mc: add debugfs node to keep track of requests
Aug 29, 2024
90df4ee
docs: uapi: media: Document Raspberry Pi NV12 column format
6by9 Feb 6, 2025
ce7d26e
media: ioctl: Add pixel formats NV12MT_COL128 and NV12MT_10_COL128
6by9 Feb 6, 2025
cc305a4
media: dt-bindings: media: Add binding for the Raspberry Pi HEVC decoder
6by9 Feb 6, 2025
258bbdb
media: platform: Add Raspberry Pi HEVC decoder driver
Feb 6, 2025
cfa42b2
arm: dts: bcm2711-rpi: Add HEVC decoder node
6by9 Feb 6, 2025
afc5507
arm: dt: broadcom: fixup downstream dts for HEVC decoder
6by9 Dec 5, 2024
959efed
dts: bcm2712: Fixup HEVC decoder nodes for new driver.
6by9 Jan 14, 2025
fc5d2fb
media: v4l2: Add single planar NV12 column formats
6by9 Dec 12, 2024
1715772
media: hevc_dec: Add in downstream single planar SAND variant
6by9 Feb 11, 2025
42c7448
drm/vc4: Add algorithmic handling for SAND
6by9 Nov 13, 2024
acdef23
arm: defconfig: Replace VIDEO_RPIVID with VIDEO_RPI_HEVC_DEC
6by9 Nov 14, 2024
5bb76a3
arm64: defconfig: Replace VIDEO_RPIVID with VIDEO_RPI_HEVC_DEC
6by9 Nov 14, 2024
9e9c92b
media: hevc_dec: Add module parameter for video_nr
6by9 Jan 16, 2025
a4a537b
media: hevc_dec: Drop the new image formats until we have Mesa 24
6by9 Feb 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions Documentation/devicetree/bindings/media/raspberrypi,hevc-dec.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/media/raspberrypi,hevc-dec.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Raspberry Pi HEVC Decoder

maintainers:
- John Cox <john.cox@raspberrypi.com>
- Dom Cobley <dom@raspberrypi.com>
- Dave Stevenson <dave.stevenson@raspberrypi.com>
- Raspberry Pi internal review list <kernel-list@raspberrypi.com>

description:
The Raspberry Pi HEVC decoder is a hardware video decode accelerator block
found in the BCM2711 and BCM2712 processors used on Raspberry Pi 4 and 5
boards respectively.

properties:
compatible:
items:
- enum:
- brcm,bcm2711-hevc-dec
- brcm,bcm2712-hevc-dec
- const: raspberrypi,hevc-dec

reg:
items:
- description: The HEVC main register region
- description: The Interrupt control register region

reg-names:
items:
- const: hevc
- const: intc

interrupts:
maxItems: 1

clocks:
items:
- description: The HEVC block clock

required:
- compatible
- reg
- reg-names
- interrupts
- clocks

additionalProperties: false

examples:
- |
#include <dt-bindings/interrupt-controller/arm-gic.h>

video-codec@7eb10000 {
compatible = "brcm,bcm2711-hevc-dec", "raspberrypi,hevc-dec";
reg = <0x7eb00000 0x10000>, /* HEVC */
<0x7eb10000 0x1000>; /* INTC */
reg-names = "hevc",
"intc";

interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>;

clocks = <&clk 0>;
};

...
215 changes: 0 additions & 215 deletions Documentation/userspace-api/media/v4l/pixfmt-nv12-col128.rst

This file was deleted.

48 changes: 39 additions & 9 deletions Documentation/userspace-api/media/v4l/pixfmt-yuv-planar.rst
Original file line number Diff line number Diff line change
Expand Up @@ -827,17 +827,47 @@ Data in the 12 high bits, zeros in the 4 low bits, arranged in little endian ord
- Cb\ :sub:`11`
- Cr\ :sub:`11`

V4L2_PIX_FMT_NV12MT_COL128 and V4L2_PIX_FMT_NV12MT_10_COL128
------------------------------------------------------------

V4L2_PIX_FMT_NV12_COL128
------------------------
``V4L2_PIX_FMT_NV12MT_COL128`` is a tiled version of
``V4L2_PIX_FMT_NV12M`` where the two planes are split into 128 byte wide columns
of Y or interleaved CbCr.

``V4L2_PIX_FMT_NV12_COL128`` is the tiled version of
``V4L2_PIX_FMT_NV12`` with the image broken down into 128 pixel wide columns of
Y followed by the associated combined CbCr plane.
The normal bytesperline is effectively fixed at 128. However the format
requires knowledge of the stride between columns, therefore the bytesperline
value has been repurposed to denote the number of 128 byte long lines between
the start of each column.
V4L2_PIX_FMT_NV12MT_10_COL128 expands that as a 10 bit format where 3 10 bit
values are packed into a 32bit word. A 128 byte wide column therefore holds 96
samples (either Y or interleaved CrCb). That effectively makes it 6 values in a
64 bit word for the CbCr plane, as the values always go in pairs.

Bit-packed representation.

.. tabularcolumns:: |p{1.2cm}||p{1.2cm}||p{1.2cm}||p{1.2cm}|p{3.2cm}|p{3.2cm}|

.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 8 8 8 8

* - Y'\ :sub:`00[7:0]`
- Y'\ :sub:`01[5:0] (bits 7--2)` Y'\ :sub:`00[9:8]`\ (bits 1--0)
- Y'\ :sub:`02[3:0] (bits 7--4)` Y'\ :sub:`01[9:6]`\ (bits 3--0)
- unused (bits 7--6)` Y'\ :sub:`02[9:4]`\ (bits 5--0)

.. tabularcolumns:: |p{1.2cm}||p{1.2cm}||p{1.2cm}||p{1.2cm}|p{3.2cm}|p{3.2cm}|

.. flat-table::
:header-rows: 0
:stub-columns: 0
:widths: 12 12 12 12 12 12 12 12

* - Cb\ :sub:`00[7:0]`
- Cr\ :sub:`00[5:0]`\ (bits 7--2) Cb\ :sub:`00[9:8]`\ (bits 1--0)
- Cb\ :sub:`01[3:0]`\ (bits 7--4) Cr\ :sub:`00[9:6]`\ (bits 3--0)
- unused (bits 7--6) Cb\ :sub:`02[9:4]`\ (bits 5--0)
- Cr\ :sub:`01[7:0]`
- Cb\ :sub:`02[5:0]`\ (bits 7--2) Cr\ :sub:`01[9:8]`\ (bits 1--0)
- Cr\ :sub:`02[3:0]`\ (bits 7--4) Cb\ :sub:`02[9:6]`\ (bits 3--0)
- unused (bits 7--6) Cr\ :sub:`02[9:4]`\ (bits 5--0)


Fully Planar YUV Formats
Expand Down
19 changes: 0 additions & 19 deletions Documentation/userspace-api/media/v4l/yuv-formats.rst
Original file line number Diff line number Diff line change
Expand Up @@ -270,23 +270,4 @@ image.
pixfmt-y8i
pixfmt-y12i
pixfmt-uv8
pixfmt-yuyv
pixfmt-uyvy
pixfmt-yvyu
pixfmt-vyuy
pixfmt-y41p
pixfmt-yuv420
pixfmt-yuv420m
pixfmt-yuv422m
pixfmt-yuv444m
pixfmt-yuv410
pixfmt-yuv422p
pixfmt-yuv411p
pixfmt-nv12
pixfmt-nv12m
pixfmt-nv12mt
pixfmt-nv12-col128
pixfmt-nv16
pixfmt-nv16m
pixfmt-nv24
pixfmt-m420
10 changes: 10 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -19357,6 +19357,16 @@ S: Maintained
F: Documentation/devicetree/bindings/spi/raspberrypi,rp2040-gpio-bridge.yaml
F: drivers/spi/spi-rp2040-gpio-bridge.c

RASPBERRY PI HEVC DECODER
M: John Cox <john.cox@raspberrypi.com>
M: Dom Cobley <dom@raspberrypi.com>
M: Dave Stevenson <dave.stevenson@raspberrypi.com>
M: Raspberry Pi Internal Kernel List <kernel-list@raspberrypi.com>
L: linux-media@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/media/raspberrypi,rpi_hevc_dec.yaml
F: drivers/media/platform/raspberrypi/hevc_dec

RASPBERRY PI PISP BACK END
M: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
L: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>
Expand Down
Loading
Loading