drm/meson: Support Overlay plane for video rendering
authorNeil Armstrong <narmstrong@baylibre.com>
Tue, 6 Nov 2018 09:40:00 +0000 (10:40 +0100)
committerNeil Armstrong <narmstrong@baylibre.com>
Tue, 13 Nov 2018 12:27:51 +0000 (13:27 +0100)
commitf9a2348196d1ab92e155bdba705db95d8177e886
tree5dd9bd3c0ac1c1e923fe7e694c812b2eb20895fa
parent9ef60bd673d1cd5bab882e0997cadc223670a801
drm/meson: Support Overlay plane for video rendering

The Amlogic Meson GX SoCs support an Overlay plane behind the primary
plane for video rendering.

This Overlay plane support various YUV layouts :
- YUYV
- NV12 / NV21
- YUV444 / 422 / 420 / 411 / 410

The scaler supports a wide range of scaling ratios, but for simplicity,
plane atomic check limits the scaling from x5 to /5 in vertical and
horizontal scaling.

The z-order is fixed and always behind the primary plane and cannot be changed.

The scaling parameter algorithm was taken from the Amlogic vendor kernel
code and rewritten to match the atomic universal plane requirements.

The video rendering using this overlay plane support has been tested using
the new Kodi DRM-KMS Prime rendering path along the in-review V4L2 Mem2Mem
Hardware Video Decoder up to 3840x2160 NV12 frames on various display modes.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: Maxime Jourdan <mjourdan@baylibre.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1541497202-20570-2-git-send-email-narmstrong@baylibre.com
drivers/gpu/drm/meson/Makefile
drivers/gpu/drm/meson/meson_canvas.c
drivers/gpu/drm/meson/meson_canvas.h
drivers/gpu/drm/meson/meson_crtc.c
drivers/gpu/drm/meson/meson_drv.c
drivers/gpu/drm/meson/meson_drv.h
drivers/gpu/drm/meson/meson_overlay.c [new file with mode: 0644]
drivers/gpu/drm/meson/meson_overlay.h [new file with mode: 0644]
drivers/gpu/drm/meson/meson_registers.h
drivers/gpu/drm/meson/meson_viu.c
drivers/gpu/drm/meson/meson_vpp.c