162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * Copyright (C) 2016 BayLibre, SAS 462306a36Sopenharmony_ci * Author: Neil Armstrong <narmstrong@baylibre.com> 562306a36Sopenharmony_ci */ 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci/* 862306a36Sopenharmony_ci * Video Encoders 962306a36Sopenharmony_ci * - ENCI : Interlace Video Encoder 1062306a36Sopenharmony_ci * - ENCI_DVI : Interlace Video Encoder for DVI/HDMI 1162306a36Sopenharmony_ci * - ENCP : Progressive Video Encoder 1262306a36Sopenharmony_ci */ 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci#ifndef __MESON_VENC_H 1562306a36Sopenharmony_ci#define __MESON_VENC_H 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_cistruct drm_display_mode; 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_cienum { 2062306a36Sopenharmony_ci MESON_VENC_MODE_NONE = 0, 2162306a36Sopenharmony_ci MESON_VENC_MODE_CVBS_PAL, 2262306a36Sopenharmony_ci MESON_VENC_MODE_CVBS_NTSC, 2362306a36Sopenharmony_ci MESON_VENC_MODE_HDMI, 2462306a36Sopenharmony_ci MESON_VENC_MODE_MIPI_DSI, 2562306a36Sopenharmony_ci}; 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_cistruct meson_cvbs_enci_mode { 2862306a36Sopenharmony_ci unsigned int mode_tag; 2962306a36Sopenharmony_ci unsigned int hso_begin; /* HSO begin position */ 3062306a36Sopenharmony_ci unsigned int hso_end; /* HSO end position */ 3162306a36Sopenharmony_ci unsigned int vso_even; /* VSO even line */ 3262306a36Sopenharmony_ci unsigned int vso_odd; /* VSO odd line */ 3362306a36Sopenharmony_ci unsigned int macv_max_amp; /* Macrovision max amplitude */ 3462306a36Sopenharmony_ci unsigned int video_prog_mode; 3562306a36Sopenharmony_ci unsigned int video_mode; 3662306a36Sopenharmony_ci unsigned int sch_adjust; 3762306a36Sopenharmony_ci unsigned int yc_delay; 3862306a36Sopenharmony_ci unsigned int pixel_start; 3962306a36Sopenharmony_ci unsigned int pixel_end; 4062306a36Sopenharmony_ci unsigned int top_field_line_start; 4162306a36Sopenharmony_ci unsigned int top_field_line_end; 4262306a36Sopenharmony_ci unsigned int bottom_field_line_start; 4362306a36Sopenharmony_ci unsigned int bottom_field_line_end; 4462306a36Sopenharmony_ci unsigned int video_saturation; 4562306a36Sopenharmony_ci unsigned int video_contrast; 4662306a36Sopenharmony_ci unsigned int video_brightness; 4762306a36Sopenharmony_ci unsigned int video_hue; 4862306a36Sopenharmony_ci unsigned int analog_sync_adj; 4962306a36Sopenharmony_ci}; 5062306a36Sopenharmony_ci 5162306a36Sopenharmony_ci/* LCD Encoder gamma setup */ 5262306a36Sopenharmony_civoid meson_encl_load_gamma(struct meson_drm *priv); 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci/* HDMI Clock parameters */ 5562306a36Sopenharmony_cienum drm_mode_status 5662306a36Sopenharmony_cimeson_venc_hdmi_supported_mode(const struct drm_display_mode *mode); 5762306a36Sopenharmony_cibool meson_venc_hdmi_supported_vic(int vic); 5862306a36Sopenharmony_cibool meson_venc_hdmi_venc_repeat(int vic); 5962306a36Sopenharmony_ci 6062306a36Sopenharmony_ci/* CVBS Timings and Parameters */ 6162306a36Sopenharmony_ciextern struct meson_cvbs_enci_mode meson_cvbs_enci_pal; 6262306a36Sopenharmony_ciextern struct meson_cvbs_enci_mode meson_cvbs_enci_ntsc; 6362306a36Sopenharmony_ci 6462306a36Sopenharmony_civoid meson_venci_cvbs_mode_set(struct meson_drm *priv, 6562306a36Sopenharmony_ci struct meson_cvbs_enci_mode *mode); 6662306a36Sopenharmony_civoid meson_venc_hdmi_mode_set(struct meson_drm *priv, int vic, 6762306a36Sopenharmony_ci unsigned int ycrcb_map, 6862306a36Sopenharmony_ci bool yuv420_mode, 6962306a36Sopenharmony_ci const struct drm_display_mode *mode); 7062306a36Sopenharmony_civoid meson_venc_mipi_dsi_mode_set(struct meson_drm *priv, 7162306a36Sopenharmony_ci const struct drm_display_mode *mode); 7262306a36Sopenharmony_ciunsigned int meson_venci_get_field(struct meson_drm *priv); 7362306a36Sopenharmony_ci 7462306a36Sopenharmony_civoid meson_venc_enable_vsync(struct meson_drm *priv); 7562306a36Sopenharmony_civoid meson_venc_disable_vsync(struct meson_drm *priv); 7662306a36Sopenharmony_ci 7762306a36Sopenharmony_civoid meson_venc_init(struct meson_drm *priv); 7862306a36Sopenharmony_ci 7962306a36Sopenharmony_ci#endif /* __MESON_VENC_H */ 80