1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 #ifndef __MESON_VENC_H
  15 #define __MESON_VENC_H
  16 
  17 struct drm_display_mode;
  18 
  19 enum {
  20         MESON_VENC_MODE_NONE = 0,
  21         MESON_VENC_MODE_CVBS_PAL,
  22         MESON_VENC_MODE_CVBS_NTSC,
  23         MESON_VENC_MODE_HDMI,
  24 };
  25 
  26 struct meson_cvbs_enci_mode {
  27         unsigned int mode_tag;
  28         unsigned int hso_begin; 
  29         unsigned int hso_end; 
  30         unsigned int vso_even; 
  31         unsigned int vso_odd; 
  32         unsigned int macv_max_amp; 
  33         unsigned int video_prog_mode;
  34         unsigned int video_mode;
  35         unsigned int sch_adjust;
  36         unsigned int yc_delay;
  37         unsigned int pixel_start;
  38         unsigned int pixel_end;
  39         unsigned int top_field_line_start;
  40         unsigned int top_field_line_end;
  41         unsigned int bottom_field_line_start;
  42         unsigned int bottom_field_line_end;
  43         unsigned int video_saturation;
  44         unsigned int video_contrast;
  45         unsigned int video_brightness;
  46         unsigned int video_hue;
  47         unsigned int analog_sync_adj;
  48 };
  49 
  50 
  51 enum drm_mode_status
  52 meson_venc_hdmi_supported_mode(const struct drm_display_mode *mode);
  53 bool meson_venc_hdmi_supported_vic(int vic);
  54 bool meson_venc_hdmi_venc_repeat(int vic);
  55 
  56 
  57 extern struct meson_cvbs_enci_mode meson_cvbs_enci_pal;
  58 extern struct meson_cvbs_enci_mode meson_cvbs_enci_ntsc;
  59 
  60 void meson_venci_cvbs_mode_set(struct meson_drm *priv,
  61                                struct meson_cvbs_enci_mode *mode);
  62 void meson_venc_hdmi_mode_set(struct meson_drm *priv, int vic,
  63                               struct drm_display_mode *mode);
  64 unsigned int meson_venci_get_field(struct meson_drm *priv);
  65 
  66 void meson_venc_enable_vsync(struct meson_drm *priv);
  67 void meson_venc_disable_vsync(struct meson_drm *priv);
  68 
  69 void meson_venc_init(struct meson_drm *priv);
  70 
  71 #endif