exynos_drm_hdmi.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* exynos_drm_hdmi.h
  2. *
  3. * Copyright (c) 2011 Samsung Electronics Co., Ltd.
  4. * Authoer: Inki Dae <inki.dae@samsung.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. */
  11. #ifndef _EXYNOS_DRM_HDMI_H_
  12. #define _EXYNOS_DRM_HDMI_H_
  13. #define MIXER_WIN_NR 3
  14. #define MIXER_DEFAULT_WIN 0
  15. /*
  16. * exynos hdmi common context structure.
  17. *
  18. * @drm_dev: pointer to drm_device.
  19. * @ctx: pointer to the context of specific device driver.
  20. * this context should be hdmi_context or mixer_context.
  21. */
  22. struct exynos_drm_hdmi_context {
  23. struct drm_device *drm_dev;
  24. void *ctx;
  25. };
  26. struct exynos_hdmi_ops {
  27. /* display */
  28. bool (*is_connected)(void *ctx);
  29. struct edid *(*get_edid)(void *ctx,
  30. struct drm_connector *connector);
  31. int (*check_timing)(void *ctx, struct fb_videomode *timing);
  32. int (*power_on)(void *ctx, int mode);
  33. /* manager */
  34. void (*mode_fixup)(void *ctx, struct drm_connector *connector,
  35. const struct drm_display_mode *mode,
  36. struct drm_display_mode *adjusted_mode);
  37. void (*mode_set)(void *ctx, void *mode);
  38. void (*get_max_resol)(void *ctx, unsigned int *width,
  39. unsigned int *height);
  40. void (*commit)(void *ctx);
  41. void (*dpms)(void *ctx, int mode);
  42. };
  43. struct exynos_mixer_ops {
  44. /* manager */
  45. int (*iommu_on)(void *ctx, bool enable);
  46. int (*enable_vblank)(void *ctx, int pipe);
  47. void (*disable_vblank)(void *ctx);
  48. void (*wait_for_vblank)(void *ctx);
  49. void (*dpms)(void *ctx, int mode);
  50. /* overlay */
  51. void (*win_mode_set)(void *ctx, struct exynos_drm_overlay *overlay);
  52. void (*win_commit)(void *ctx, int zpos);
  53. void (*win_disable)(void *ctx, int zpos);
  54. /* display */
  55. int (*check_timing)(void *ctx, struct fb_videomode *timing);
  56. };
  57. void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx);
  58. void exynos_mixer_drv_attach(struct exynos_drm_hdmi_context *ctx);
  59. void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops);
  60. void exynos_mixer_ops_register(struct exynos_mixer_ops *ops);
  61. #endif