Commit | Line | Data |
---|---|---|
e21e2193 BG |
1 | /* |
2 | * Copyright (C) STMicroelectronics SA 2014 | |
3 | * Authors: Benjamin Gaignard <benjamin.gaignard@st.com> | |
4 | * Fabien Dessenne <fabien.dessenne@st.com> | |
5 | * for STMicroelectronics. | |
6 | * License terms: GNU General Public License (GPL), version 2 | |
7 | */ | |
8 | ||
9 | #ifndef _STI_MIXER_H_ | |
10 | #define _STI_MIXER_H_ | |
11 | ||
12 | #include <drm/drmP.h> | |
13 | ||
871bcdfe | 14 | #include "sti_drm_plane.h" |
e21e2193 BG |
15 | |
16 | #define to_sti_mixer(x) container_of(x, struct sti_mixer, drm_crtc) | |
17 | ||
18 | /** | |
19 | * STI Mixer subdevice structure | |
20 | * | |
21 | * @dev: driver device | |
22 | * @regs: mixer registers | |
23 | * @id: id of the mixer | |
24 | * @drm_crtc: crtc object link to the mixer | |
25 | * @pending_event: set if a flip event is pending on crtc | |
5e03abc5 | 26 | * @enabled: to know if the mixer is active or not |
e21e2193 BG |
27 | */ |
28 | struct sti_mixer { | |
29 | struct device *dev; | |
30 | void __iomem *regs; | |
31 | int id; | |
871bcdfe | 32 | struct drm_crtc drm_crtc; |
e21e2193 | 33 | struct drm_pending_vblank_event *pending_event; |
5e03abc5 | 34 | bool enabled; |
e21e2193 BG |
35 | }; |
36 | ||
37 | const char *sti_mixer_to_str(struct sti_mixer *mixer); | |
38 | ||
39 | struct sti_mixer *sti_mixer_create(struct device *dev, int id, | |
871bcdfe | 40 | void __iomem *baseaddr); |
e21e2193 | 41 | |
871bcdfe VA |
42 | int sti_mixer_set_plane_status(struct sti_mixer *mixer, |
43 | struct sti_plane *plane, bool status); | |
44 | void sti_mixer_clear_all_planes(struct sti_mixer *mixer); | |
45 | int sti_mixer_set_plane_depth(struct sti_mixer *mixer, struct sti_plane *plane); | |
e21e2193 | 46 | int sti_mixer_active_video_area(struct sti_mixer *mixer, |
871bcdfe | 47 | struct drm_display_mode *mode); |
e21e2193 BG |
48 | |
49 | void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable); | |
50 | ||
51 | /* depth in Cross-bar control = z order */ | |
bf60b29f | 52 | #define GAM_MIXER_NB_DEPTH_LEVEL 6 |
e21e2193 BG |
53 | |
54 | #define STI_MIXER_MAIN 0 | |
55 | #define STI_MIXER_AUX 1 | |
56 | ||
57 | #endif |