exynos_drm_hdmi.h 2.0 KB
Newer Older
1 2 3 4 5
/* exynos_drm_hdmi.h
 *
 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
 * Authoer: Inki Dae <inki.dae@samsung.com>
 *
6 7 8 9
 * This program is free software; you can redistribute  it and/or modify it
 * under  the terms of  the GNU General  Public License as published by the
 * Free Software Foundation;  either version 2 of the  License, or (at your
 * option) any later version.
10 11 12 13 14
 */

#ifndef _EXYNOS_DRM_HDMI_H_
#define _EXYNOS_DRM_HDMI_H_

J
Joonyoung Shim 已提交
15 16 17
#define MIXER_WIN_NR		3
#define MIXER_DEFAULT_WIN	0

18 19 20 21 22 23 24 25 26 27 28 29
/*
 * exynos hdmi common context structure.
 *
 * @drm_dev: pointer to drm_device.
 * @ctx: pointer to the context of specific device driver.
 *	this context should be hdmi_context or mixer_context.
 */
struct exynos_drm_hdmi_context {
	struct drm_device	*drm_dev;
	void			*ctx;
};

30 31
struct exynos_hdmi_ops {
	/* display */
32
	bool (*is_connected)(void *ctx);
33 34
	struct edid *(*get_edid)(void *ctx,
			struct drm_connector *connector);
35 36 37
	int (*check_timing)(void *ctx, void *timing);
	int (*power_on)(void *ctx, int mode);

38
	/* manager */
39
	void (*mode_fixup)(void *ctx, struct drm_connector *connector,
40
				const struct drm_display_mode *mode,
41
				struct drm_display_mode *adjusted_mode);
42
	void (*mode_set)(void *ctx, void *mode);
43 44
	void (*get_max_resol)(void *ctx, unsigned int *width,
				unsigned int *height);
45
	void (*commit)(void *ctx);
J
Joonyoung Shim 已提交
46
	void (*dpms)(void *ctx, int mode);
47 48
};

49 50
struct exynos_mixer_ops {
	/* manager */
51
	int (*iommu_on)(void *ctx, bool enable);
52 53
	int (*enable_vblank)(void *ctx, int pipe);
	void (*disable_vblank)(void *ctx);
54
	void (*wait_for_vblank)(void *ctx);
J
Joonyoung Shim 已提交
55
	void (*dpms)(void *ctx, int mode);
56 57

	/* overlay */
58 59 60 61 62
	void (*win_mode_set)(void *ctx, struct exynos_drm_overlay *overlay);
	void (*win_commit)(void *ctx, int zpos);
	void (*win_disable)(void *ctx, int zpos);
};

63 64
void exynos_hdmi_drv_attach(struct exynos_drm_hdmi_context *ctx);
void exynos_mixer_drv_attach(struct exynos_drm_hdmi_context *ctx);
65 66
void exynos_hdmi_ops_register(struct exynos_hdmi_ops *ops);
void exynos_mixer_ops_register(struct exynos_mixer_ops *ops);
67
#endif