Commit | Line | Data |
---|---|---|
e2842570 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
e21e2193 BG |
2 | /* |
3 | * Copyright (C) STMicroelectronics SA 2014 | |
4 | * Authors: Benjamin Gaignard <benjamin.gaignard@st.com> | |
5 | * Fabien Dessenne <fabien.dessenne@st.com> | |
6 | * for STMicroelectronics. | |
e21e2193 BG |
7 | */ |
8 | ||
9 | #ifndef _STI_MIXER_H_ | |
10 | #define _STI_MIXER_H_ | |
11 | ||
5e2f97a9 SR |
12 | #include <drm/drm_crtc.h> |
13 | ||
14 | #include <drm/drm_debugfs.h> | |
15 | #include <drm/drm_file.h> | |
e21e2193 | 16 | |
9e1f05b2 | 17 | #include "sti_plane.h" |
e21e2193 | 18 | |
5e2f97a9 SR |
19 | struct device; |
20 | ||
e21e2193 BG |
21 | #define to_sti_mixer(x) container_of(x, struct sti_mixer, drm_crtc) |
22 | ||
29d1dc62 VA |
23 | enum sti_mixer_status { |
24 | STI_MIXER_READY, | |
25 | STI_MIXER_DISABLING, | |
26 | STI_MIXER_DISABLED, | |
27 | }; | |
28 | ||
e21e2193 BG |
29 | /** |
30 | * STI Mixer subdevice structure | |
31 | * | |
32 | * @dev: driver device | |
33 | * @regs: mixer registers | |
34 | * @id: id of the mixer | |
35 | * @drm_crtc: crtc object link to the mixer | |
29d1dc62 | 36 | * @status: to know the status of the mixer |
e21e2193 BG |
37 | */ |
38 | struct sti_mixer { | |
39 | struct device *dev; | |
40 | void __iomem *regs; | |
41 | int id; | |
871bcdfe | 42 | struct drm_crtc drm_crtc; |
29d1dc62 | 43 | enum sti_mixer_status status; |
e21e2193 BG |
44 | }; |
45 | ||
46 | const char *sti_mixer_to_str(struct sti_mixer *mixer); | |
47 | ||
a5f81078 VA |
48 | struct sti_mixer *sti_mixer_create(struct device *dev, |
49 | struct drm_device *drm_dev, | |
50 | int id, | |
871bcdfe | 51 | void __iomem *baseaddr); |
e21e2193 | 52 | |
871bcdfe VA |
53 | int sti_mixer_set_plane_status(struct sti_mixer *mixer, |
54 | struct sti_plane *plane, bool status); | |
871bcdfe | 55 | int sti_mixer_set_plane_depth(struct sti_mixer *mixer, struct sti_plane *plane); |
e21e2193 | 56 | int sti_mixer_active_video_area(struct sti_mixer *mixer, |
871bcdfe | 57 | struct drm_display_mode *mode); |
e21e2193 BG |
58 | |
59 | void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable); | |
60 | ||
54ac836b | 61 | void sti_mixer_debugfs_init(struct sti_mixer *mixer, struct drm_minor *minor); |
83af0a48 | 62 | |
e21e2193 | 63 | /* depth in Cross-bar control = z order */ |
bf60b29f | 64 | #define GAM_MIXER_NB_DEPTH_LEVEL 6 |
e21e2193 BG |
65 | |
66 | #define STI_MIXER_MAIN 0 | |
67 | #define STI_MIXER_AUX 1 | |
68 | ||
69 | #endif |