meson_venc.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (C) 2016 BayLibre, SAS
  4. * Author: Neil Armstrong <narmstrong@baylibre.com>
  5. */
  6. /*
  7. * Video Encoders
  8. * - ENCI : Interlace Video Encoder
  9. * - ENCI_DVI : Interlace Video Encoder for DVI/HDMI
  10. * - ENCP : Progressive Video Encoder
  11. */
  12. #ifndef __MESON_VENC_H
  13. #define __MESON_VENC_H
  14. struct drm_display_mode;
  15. enum {
  16. MESON_VENC_MODE_NONE = 0,
  17. MESON_VENC_MODE_CVBS_PAL,
  18. MESON_VENC_MODE_CVBS_NTSC,
  19. MESON_VENC_MODE_HDMI,
  20. };
  21. struct meson_cvbs_enci_mode {
  22. unsigned int mode_tag;
  23. unsigned int hso_begin; /* HSO begin position */
  24. unsigned int hso_end; /* HSO end position */
  25. unsigned int vso_even; /* VSO even line */
  26. unsigned int vso_odd; /* VSO odd line */
  27. unsigned int macv_max_amp; /* Macrovision max amplitude */
  28. unsigned int video_prog_mode;
  29. unsigned int video_mode;
  30. unsigned int sch_adjust;
  31. unsigned int yc_delay;
  32. unsigned int pixel_start;
  33. unsigned int pixel_end;
  34. unsigned int top_field_line_start;
  35. unsigned int top_field_line_end;
  36. unsigned int bottom_field_line_start;
  37. unsigned int bottom_field_line_end;
  38. unsigned int video_saturation;
  39. unsigned int video_contrast;
  40. unsigned int video_brightness;
  41. unsigned int video_hue;
  42. unsigned int analog_sync_adj;
  43. };
  44. /* HDMI Clock parameters */
  45. enum drm_mode_status
  46. meson_venc_hdmi_supported_mode(const struct drm_display_mode *mode);
  47. bool meson_venc_hdmi_supported_vic(int vic);
  48. bool meson_venc_hdmi_venc_repeat(int vic);
  49. /* CVBS Timings and Parameters */
  50. extern struct meson_cvbs_enci_mode meson_cvbs_enci_pal;
  51. extern struct meson_cvbs_enci_mode meson_cvbs_enci_ntsc;
  52. void meson_venci_cvbs_mode_set(struct meson_drm *priv,
  53. struct meson_cvbs_enci_mode *mode);
  54. void meson_venc_hdmi_mode_set(struct meson_drm *priv, int vic,
  55. unsigned int ycrcb_map,
  56. bool yuv420_mode,
  57. const struct drm_display_mode *mode);
  58. unsigned int meson_venci_get_field(struct meson_drm *priv);
  59. void meson_venc_enable_vsync(struct meson_drm *priv);
  60. void meson_venc_disable_vsync(struct meson_drm *priv);
  61. void meson_venc_init(struct meson_drm *priv);
  62. #endif /* __MESON_VENC_H */