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 | * |
| 6 | * Permission is hereby granted, free of charge, to any person obtaining a |
| 7 | * copy of this software and associated documentation files (the "Software"), |
| 8 | * to deal in the Software without restriction, including without limitation |
| 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 10 | * and/or sell copies of the Software, and to permit persons to whom the |
| 11 | * Software is furnished to do so, subject to the following conditions: |
| 12 | * |
| 13 | * The above copyright notice and this permission notice (including the next |
| 14 | * paragraph) shall be included in all copies or substantial portions of the |
| 15 | * Software. |
| 16 | * |
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 20 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 21 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 22 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 23 | * OTHER DEALINGS IN THE SOFTWARE. |
| 24 | */ |
| 25 | |
| 26 | #ifndef _EXYNOS_DRM_HDMI_H_ |
| 27 | #define _EXYNOS_DRM_HDMI_H_ |
| 28 | |
Joonyoung Shim | cf8fc4f | 2012-04-23 19:35:50 +0900 | [diff] [blame] | 29 | #define MIXER_WIN_NR 3 |
| 30 | #define MIXER_DEFAULT_WIN 0 |
| 31 | |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 32 | /* |
| 33 | * exynos hdmi common context structure. |
| 34 | * |
| 35 | * @drm_dev: pointer to drm_device. |
| 36 | * @ctx: pointer to the context of specific device driver. |
| 37 | * this context should be hdmi_context or mixer_context. |
| 38 | */ |
| 39 | struct exynos_drm_hdmi_context { |
| 40 | struct drm_device *drm_dev; |
| 41 | void *ctx; |
| 42 | }; |
| 43 | |
Joonyoung Shim | 578b606 | 2012-04-05 20:49:26 +0900 | [diff] [blame] | 44 | struct exynos_hdmi_ops { |
| 45 | /* display */ |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 46 | bool (*is_connected)(void *ctx); |
| 47 | int (*get_edid)(void *ctx, struct drm_connector *connector, |
| 48 | u8 *edid, int len); |
| 49 | int (*check_timing)(void *ctx, void *timing); |
| 50 | int (*power_on)(void *ctx, int mode); |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 51 | |
Joonyoung Shim | 578b606 | 2012-04-05 20:49:26 +0900 | [diff] [blame] | 52 | /* manager */ |
Inki Dae | 1de425b | 2012-03-16 18:47:04 +0900 | [diff] [blame] | 53 | void (*mode_fixup)(void *ctx, struct drm_connector *connector, |
Laurent Pinchart | e811f5a | 2012-07-17 17:56:50 +0200 | [diff] [blame] | 54 | const struct drm_display_mode *mode, |
Inki Dae | 1de425b | 2012-03-16 18:47:04 +0900 | [diff] [blame] | 55 | struct drm_display_mode *adjusted_mode); |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 56 | void (*mode_set)(void *ctx, void *mode); |
Inki Dae | 1de425b | 2012-03-16 18:47:04 +0900 | [diff] [blame] | 57 | void (*get_max_resol)(void *ctx, unsigned int *width, |
| 58 | unsigned int *height); |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 59 | void (*commit)(void *ctx); |
Joonyoung Shim | cf8fc4f | 2012-04-23 19:35:50 +0900 | [diff] [blame] | 60 | void (*dpms)(void *ctx, int mode); |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 61 | }; |
| 62 | |
Joonyoung Shim | 578b606 | 2012-04-05 20:49:26 +0900 | [diff] [blame] | 63 | struct exynos_mixer_ops { |
| 64 | /* manager */ |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 65 | int (*enable_vblank)(void *ctx, int pipe); |
| 66 | void (*disable_vblank)(void *ctx); |
Joonyoung Shim | cf8fc4f | 2012-04-23 19:35:50 +0900 | [diff] [blame] | 67 | void (*dpms)(void *ctx, int mode); |
Joonyoung Shim | 578b606 | 2012-04-05 20:49:26 +0900 | [diff] [blame] | 68 | |
| 69 | /* overlay */ |
Inki Dae | 3d05859 | 2012-08-17 18:35:47 +0900 | [diff] [blame] | 70 | void (*wait_for_vblank)(void *ctx); |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 71 | void (*win_mode_set)(void *ctx, struct exynos_drm_overlay *overlay); |
| 72 | void (*win_commit)(void *ctx, int zpos); |
| 73 | void (*win_disable)(void *ctx, int zpos); |
| 74 | }; |
| 75 | |
Joonyoung Shim | 578b606 | 2012-04-05 20:49:26 +0900 | [diff] [blame] | 76 | void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops); |
| 77 | void exynos_mixer_ops_register(struct exynos_mixer_ops *ops); |
Seung-Woo Kim | d840832 | 2011-12-21 17:39:39 +0900 | [diff] [blame] | 78 | #endif |