meson_venc.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * Copyright (C) 2016 BayLibre, SAS
  3. * Author: Neil Armstrong <narmstrong@baylibre.com>
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation; either version 2 of the
  8. * License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /*
  19. * Video Encoders
  20. * - ENCI : Interlace Video Encoder
  21. * - ENCI_DVI : Interlace Video Encoder for DVI/HDMI
  22. * - ENCP : Progressive Video Encoder
  23. */
  24. #ifndef __MESON_VENC_H
  25. #define __MESON_VENC_H
  26. enum {
  27. MESON_VENC_MODE_NONE = 0,
  28. MESON_VENC_MODE_CVBS_PAL,
  29. MESON_VENC_MODE_CVBS_NTSC,
  30. MESON_VENC_MODE_HDMI,
  31. };
  32. struct meson_cvbs_enci_mode {
  33. unsigned int mode_tag;
  34. unsigned int hso_begin; /* HSO begin position */
  35. unsigned int hso_end; /* HSO end position */
  36. unsigned int vso_even; /* VSO even line */
  37. unsigned int vso_odd; /* VSO odd line */
  38. unsigned int macv_max_amp; /* Macrovision max amplitude */
  39. unsigned int video_prog_mode;
  40. unsigned int video_mode;
  41. unsigned int sch_adjust;
  42. unsigned int yc_delay;
  43. unsigned int pixel_start;
  44. unsigned int pixel_end;
  45. unsigned int top_field_line_start;
  46. unsigned int top_field_line_end;
  47. unsigned int bottom_field_line_start;
  48. unsigned int bottom_field_line_end;
  49. unsigned int video_saturation;
  50. unsigned int video_contrast;
  51. unsigned int video_brightness;
  52. unsigned int video_hue;
  53. unsigned int analog_sync_adj;
  54. };
  55. /* HDMI Clock parameters */
  56. enum drm_mode_status
  57. meson_venc_hdmi_supported_mode(const struct drm_display_mode *mode);
  58. bool meson_venc_hdmi_supported_vic(int vic);
  59. bool meson_venc_hdmi_venc_repeat(int vic);
  60. /* CVBS Timings and Parameters */
  61. extern struct meson_cvbs_enci_mode meson_cvbs_enci_pal;
  62. extern struct meson_cvbs_enci_mode meson_cvbs_enci_ntsc;
  63. void meson_venci_cvbs_mode_set(struct meson_drm *priv,
  64. struct meson_cvbs_enci_mode *mode);
  65. void meson_venc_hdmi_mode_set(struct meson_drm *priv, int vic,
  66. struct drm_display_mode *mode);
  67. unsigned int meson_venci_get_field(struct meson_drm *priv);
  68. void meson_venc_enable_vsync(struct meson_drm *priv);
  69. void meson_venc_disable_vsync(struct meson_drm *priv);
  70. void meson_venc_init(struct meson_drm *priv);
  71. #endif /* __MESON_VENC_H */