drm/fourcc: Add modifier definitions for describing Amlogic Video Framebuffer Compression
authorNeil Armstrong <narmstrong@baylibre.com>
Fri, 3 Jul 2020 08:07:23 +0000 (10:07 +0200)
committerNeil Armstrong <narmstrong@baylibre.com>
Fri, 3 Jul 2020 08:12:27 +0000 (10:12 +0200)
commitd6528ec883096e7ccdb08257bcc45670bc878519
tree5eedd8dfc821dfa89349a8d05b1bf70af6b71c81
parentf2230d1313c63b638ff8af782c4c202307c5d6fc
drm/fourcc: Add modifier definitions for describing Amlogic Video Framebuffer Compression

Amlogic uses a proprietary lossless image compression protocol and format
for their hardware video codec accelerators, either video decoders or
video input encoders.

It considerably reduces memory bandwidth while writing and reading
frames in memory.

The underlying storage is considered to be 3 components, 8bit or 10-bit
per component, YCbCr 420, single plane :
- DRM_FORMAT_YUV420_8BIT
- DRM_FORMAT_YUV420_10BIT

This modifier will be notably added to DMA-BUF frames imported from the V4L2
Amlogic VDEC decoder.

This introduces the basic layout composed of:
- a body content organized in 64x32 superblocks with 4096 bytes per
  superblock in default mode.
- a 32 bytes per 128x64 header block

This layout is tranferrable between Amlogic SoCs supporting this modifier.

The Memory Saving option exist changing the layout superblock size to save memory when
using 8bit components pixels size.

Finally is also adds the Scatter Memory layout, meaning the header contains IOMMU
references to the compressed frames content to optimize memory access
and layout.

In this mode, only the header memory address is needed, thus the content
memory organization is tied to the current producer execution and cannot
be saved/dumped neither transferrable between Amlogic SoCs supporting this
modifier.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Tested-by: Kevin Hilman <khilman@baylibre.com>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200703080728.25207-2-narmstrong@baylibre.com
include/uapi/drm/drm_fourcc.h