drm/meson: venc: add support for YUV420 setup
This patch adds encoding support for the YUV420 output from the Amlogic Meson SoCs Video Processing Unit to the HDMI Controller. The YUV420 is obtained by generating a YUV444 pixel stream like the classic HDMI display modes, but then the Video Encoder output can be configured to down-sample the YUV444 pixel stream to a YUV420 stream. In addition if pixel stream down-sampling, the Y Cb Cr components must also be mapped differently to align with the HDMI2.0 specifications. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Jernej Škrabec <jernej.skrabec@siol.net> Link: https://patchwork.freedesktop.org/patch/msgid/20200304104052.17196-10-narmstrong@baylibre.com
This commit is contained in:
@@ -946,6 +946,8 @@ bool meson_venc_hdmi_venc_repeat(int vic)
|
||||
EXPORT_SYMBOL_GPL(meson_venc_hdmi_venc_repeat);
|
||||
|
||||
void meson_venc_hdmi_mode_set(struct meson_drm *priv, int vic,
|
||||
unsigned int ycrcb_map,
|
||||
bool yuv420_mode,
|
||||
const struct drm_display_mode *mode)
|
||||
{
|
||||
union meson_hdmi_venc_mode *vmode = NULL;
|
||||
@@ -1528,14 +1530,14 @@ void meson_venc_hdmi_mode_set(struct meson_drm *priv, int vic,
|
||||
if (mode->flags & DRM_MODE_FLAG_PVSYNC)
|
||||
reg |= VPU_HDMI_INV_VSYNC;
|
||||
|
||||
/* Output data format: CbYCr */
|
||||
reg |= VPU_HDMI_OUTPUT_CBYCR;
|
||||
/* Output data format */
|
||||
reg |= ycrcb_map;
|
||||
|
||||
/*
|
||||
* Write rate to the async FIFO between VENC and HDMI.
|
||||
* One write every 2 wr_clk.
|
||||
*/
|
||||
if (venc_repeat)
|
||||
if (venc_repeat || yuv420_mode)
|
||||
reg |= VPU_HDMI_WR_RATE(2);
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user