meson_venc.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. MESON_VENC_MODE_MIPI_DSI,
  21. };
  22. struct meson_cvbs_enci_mode {
  23. unsigned int mode_tag;
  24. unsigned int hso_begin; /* HSO begin position */
  25. unsigned int hso_end; /* HSO end position */
  26. unsigned int vso_even; /* VSO even line */
  27. unsigned int vso_odd; /* VSO odd line */
  28. unsigned int macv_max_amp; /* Macrovision max amplitude */
  29. unsigned int video_prog_mode;
  30. unsigned int video_mode;
  31. unsigned int sch_adjust;
  32. unsigned int yc_delay;
  33. unsigned int pixel_start;
  34. unsigned int pixel_end;
  35. unsigned int top_field_line_start;
  36. unsigned int top_field_line_end;
  37. unsigned int bottom_field_line_start;
  38. unsigned int bottom_field_line_end;
  39. unsigned int video_saturation;
  40. unsigned int video_contrast;
  41. unsigned int video_brightness;
  42. unsigned int video_hue;
  43. unsigned int analog_sync_adj;
  44. };
  45. /* LCD Encoder gamma setup */
  46. void meson_encl_load_gamma(struct meson_drm *priv);
  47. /* HDMI Clock parameters */
  48. enum drm_mode_status
  49. meson_venc_hdmi_supported_mode(const struct drm_display_mode *mode);
  50. bool meson_venc_hdmi_supported_vic(int vic);
  51. bool meson_venc_hdmi_venc_repeat(int vic);
  52. /* CVBS Timings and Parameters */
  53. extern struct meson_cvbs_enci_mode meson_cvbs_enci_pal;
  54. extern struct meson_cvbs_enci_mode meson_cvbs_enci_ntsc;
  55. void meson_venci_cvbs_mode_set(struct meson_drm *priv,
  56. struct meson_cvbs_enci_mode *mode);
  57. void meson_venc_hdmi_mode_set(struct meson_drm *priv, int vic,
  58. unsigned int ycrcb_map,
  59. bool yuv420_mode,
  60. const struct drm_display_mode *mode);
  61. void meson_venc_mipi_dsi_mode_set(struct meson_drm *priv,
  62. const struct drm_display_mode *mode);
  63. unsigned int meson_venci_get_field(struct meson_drm *priv);
  64. void meson_venc_enable_vsync(struct meson_drm *priv);
  65. void meson_venc_disable_vsync(struct meson_drm *priv);
  66. void meson_venc_init(struct meson_drm *priv);
  67. #endif /* __MESON_VENC_H */