Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 1 | /* exynos_drm_hdmi.h |
| 2 | * |
| 3 | * Copyright (c) 2011 Samsung Electronics Co., Ltd. |
| 4 | * Authoer: Inki Dae <inki.dae@samsung.com> |
| 5 | * |
Inki Dae | d81aecb | 2012-12-18 02:30:17 +0900 | [diff] [blame] | 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. |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 10 | */ |
| 11 | |
| 12 | #ifndef _EXYNOS_DRM_HDMI_H_ |
| 13 | #define _EXYNOS_DRM_HDMI_H_ |
| 14 | |
Joonyoung Shim | cf8fc4f | 2012-04-23 19:35:50 +0900 | [diff] [blame] | 15 | #define MIXER_WIN_NR 3 |
| 16 | #define MIXER_DEFAULT_WIN 0 |
| 17 | |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 18 | /* |
| 19 | * exynos hdmi common context structure. |
| 20 | * |
| 21 | * @drm_dev: pointer to drm_device. |
| 22 | * @ctx: pointer to the context of specific device driver. |
| 23 | * this context should be hdmi_context or mixer_context. |
| 24 | */ |
| 25 | struct exynos_drm_hdmi_context { |
| 26 | struct drm_device *drm_dev; |
| 27 | void *ctx; |
| 28 | }; |
| 29 | |
Joonyoung Shim | 578b606 | 2012-04-05 20:49:26 +0900 | [diff] [blame] | 30 | struct exynos_hdmi_ops { |
| 31 | /* display */ |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 32 | bool (*is_connected)(void *ctx); |
| 33 | int (*get_edid)(void *ctx, struct drm_connector *connector, |
| 34 | u8 *edid, int len); |
| 35 | int (*check_timing)(void *ctx, void *timing); |
| 36 | int (*power_on)(void *ctx, int mode); |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 37 | |
Joonyoung Shim | 578b606 | 2012-04-05 20:49:26 +0900 | [diff] [blame] | 38 | /* manager */ |
Inki Dae | 1de425b | 2012-03-16 18:47:04 +0900 | [diff] [blame] | 39 | void (*mode_fixup)(void *ctx, struct drm_connector *connector, |
Laurent Pinchart | e811f5a | 2012-07-17 17:56:50 +0200 | [diff] [blame] | 40 | const struct drm_display_mode *mode, |
Inki Dae | 1de425b | 2012-03-16 18:47:04 +0900 | [diff] [blame] | 41 | struct drm_display_mode *adjusted_mode); |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 42 | void (*mode_set)(void *ctx, void *mode); |
Inki Dae | 1de425b | 2012-03-16 18:47:04 +0900 | [diff] [blame] | 43 | void (*get_max_resol)(void *ctx, unsigned int *width, |
| 44 | unsigned int *height); |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 45 | void (*commit)(void *ctx); |
Joonyoung Shim | cf8fc4f | 2012-04-23 19:35:50 +0900 | [diff] [blame] | 46 | void (*dpms)(void *ctx, int mode); |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 47 | }; |
| 48 | |
Joonyoung Shim | 578b606 | 2012-04-05 20:49:26 +0900 | [diff] [blame] | 49 | struct exynos_mixer_ops { |
| 50 | /* manager */ |
Inki Dae | 1055b39 | 2012-10-19 17:37:35 +0900 | [diff] [blame] | 51 | int (*iommu_on)(void *ctx, bool enable); |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 52 | int (*enable_vblank)(void *ctx, int pipe); |
| 53 | void (*disable_vblank)(void *ctx); |
Prathyush K | 8137a2e | 2012-12-06 20:16:01 +0530 | [diff] [blame] | 54 | void (*wait_for_vblank)(void *ctx); |
Joonyoung Shim | cf8fc4f | 2012-04-23 19:35:50 +0900 | [diff] [blame] | 55 | void (*dpms)(void *ctx, int mode); |
Joonyoung Shim | 578b606 | 2012-04-05 20:49:26 +0900 | [diff] [blame] | 56 | |
| 57 | /* overlay */ |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 58 | void (*win_mode_set)(void *ctx, struct exynos_drm_overlay *overlay); |
| 59 | void (*win_commit)(void *ctx, int zpos); |
| 60 | void (*win_disable)(void *ctx, int zpos); |
| 61 | }; |
| 62 | |
Rahul Sharma | 768c305 | 2012-10-04 20:48:56 +0530 | [diff] [blame] | 63 | void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx); |
| 64 | void exynos_mixer_drv_attach(struct exynos_drm_hdmi_context *ctx); |
Joonyoung Shim | 578b606 | 2012-04-05 20:49:26 +0900 | [diff] [blame] | 65 | void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops); |
| 66 | void exynos_mixer_ops_register(struct exynos_mixer_ops *ops); |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 67 | #endif |