blob: 784a7e9a766c4a178e2f73e628e63adce5f6c364 [file] [log] [blame]
Seung-Woo Kimd8408322011-12-21 17:39:39 +09001/* exynos_drm_hdmi.h
2 *
3 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
4 * Authoer: Inki Dae <inki.dae@samsung.com>
5 *
Inki Daed81aecb2012-12-18 02:30:17 +09006 * 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 Kimd8408322011-12-21 17:39:39 +090010 */
11
12#ifndef _EXYNOS_DRM_HDMI_H_
13#define _EXYNOS_DRM_HDMI_H_
14
Joonyoung Shimcf8fc4f2012-04-23 19:35:50 +090015#define MIXER_WIN_NR 3
16#define MIXER_DEFAULT_WIN 0
17
Seung-Woo Kimd8408322011-12-21 17:39:39 +090018/*
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 */
25struct exynos_drm_hdmi_context {
26 struct drm_device *drm_dev;
27 void *ctx;
28};
29
Joonyoung Shim578b6062012-04-05 20:49:26 +090030struct exynos_hdmi_ops {
31 /* display */
Seung-Woo Kimd8408322011-12-21 17:39:39 +090032 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 Kimd8408322011-12-21 17:39:39 +090037
Joonyoung Shim578b6062012-04-05 20:49:26 +090038 /* manager */
Inki Dae1de425b2012-03-16 18:47:04 +090039 void (*mode_fixup)(void *ctx, struct drm_connector *connector,
Laurent Pincharte811f5a2012-07-17 17:56:50 +020040 const struct drm_display_mode *mode,
Inki Dae1de425b2012-03-16 18:47:04 +090041 struct drm_display_mode *adjusted_mode);
Seung-Woo Kimd8408322011-12-21 17:39:39 +090042 void (*mode_set)(void *ctx, void *mode);
Inki Dae1de425b2012-03-16 18:47:04 +090043 void (*get_max_resol)(void *ctx, unsigned int *width,
44 unsigned int *height);
Seung-Woo Kimd8408322011-12-21 17:39:39 +090045 void (*commit)(void *ctx);
Joonyoung Shimcf8fc4f2012-04-23 19:35:50 +090046 void (*dpms)(void *ctx, int mode);
Seung-Woo Kimd8408322011-12-21 17:39:39 +090047};
48
Joonyoung Shim578b6062012-04-05 20:49:26 +090049struct exynos_mixer_ops {
50 /* manager */
Inki Dae1055b392012-10-19 17:37:35 +090051 int (*iommu_on)(void *ctx, bool enable);
Seung-Woo Kimd8408322011-12-21 17:39:39 +090052 int (*enable_vblank)(void *ctx, int pipe);
53 void (*disable_vblank)(void *ctx);
Prathyush K8137a2e2012-12-06 20:16:01 +053054 void (*wait_for_vblank)(void *ctx);
Joonyoung Shimcf8fc4f2012-04-23 19:35:50 +090055 void (*dpms)(void *ctx, int mode);
Joonyoung Shim578b6062012-04-05 20:49:26 +090056
57 /* overlay */
Seung-Woo Kimd8408322011-12-21 17:39:39 +090058 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 Sharma768c3052012-10-04 20:48:56 +053063void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx);
64void exynos_mixer_drv_attach(struct exynos_drm_hdmi_context *ctx);
Joonyoung Shim578b6062012-04-05 20:49:26 +090065void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops);
66void exynos_mixer_ops_register(struct exynos_mixer_ops *ops);
Seung-Woo Kimd8408322011-12-21 17:39:39 +090067#endif