Benjamin Gaignard | e21e2193 | 2014-07-28 10:30:18 +0200 | [diff] [blame] | 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 | |
Vincent Abriou | 9e1f05b | 2015-07-31 11:32:34 +0200 | [diff] [blame] | 14 | #include "sti_plane.h" |
Benjamin Gaignard | e21e2193 | 2014-07-28 10:30:18 +0200 | [diff] [blame] | 15 | |
| 16 | #define to_sti_mixer(x) container_of(x, struct sti_mixer, drm_crtc) |
| 17 | |
Vincent Abriou | 29d1dc6 | 2015-08-03 14:22:16 +0200 | [diff] [blame] | 18 | enum sti_mixer_status { |
| 19 | STI_MIXER_READY, |
| 20 | STI_MIXER_DISABLING, |
| 21 | STI_MIXER_DISABLED, |
| 22 | }; |
| 23 | |
Benjamin Gaignard | e21e2193 | 2014-07-28 10:30:18 +0200 | [diff] [blame] | 24 | /** |
| 25 | * STI Mixer subdevice structure |
| 26 | * |
| 27 | * @dev: driver device |
| 28 | * @regs: mixer registers |
| 29 | * @id: id of the mixer |
| 30 | * @drm_crtc: crtc object link to the mixer |
Vincent Abriou | 29d1dc6 | 2015-08-03 14:22:16 +0200 | [diff] [blame] | 31 | * @status: to know the status of the mixer |
Benjamin Gaignard | e21e2193 | 2014-07-28 10:30:18 +0200 | [diff] [blame] | 32 | */ |
| 33 | struct sti_mixer { |
| 34 | struct device *dev; |
| 35 | void __iomem *regs; |
| 36 | int id; |
Vincent Abriou | 871bcdf | 2015-07-31 11:32:13 +0200 | [diff] [blame] | 37 | struct drm_crtc drm_crtc; |
Vincent Abriou | 29d1dc6 | 2015-08-03 14:22:16 +0200 | [diff] [blame] | 38 | enum sti_mixer_status status; |
Benjamin Gaignard | e21e2193 | 2014-07-28 10:30:18 +0200 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | const char *sti_mixer_to_str(struct sti_mixer *mixer); |
| 42 | |
Vincent Abriou | a5f8107 | 2016-02-04 17:44:50 +0100 | [diff] [blame] | 43 | struct sti_mixer *sti_mixer_create(struct device *dev, |
| 44 | struct drm_device *drm_dev, |
| 45 | int id, |
Vincent Abriou | 871bcdf | 2015-07-31 11:32:13 +0200 | [diff] [blame] | 46 | void __iomem *baseaddr); |
Benjamin Gaignard | e21e2193 | 2014-07-28 10:30:18 +0200 | [diff] [blame] | 47 | |
Vincent Abriou | 871bcdf | 2015-07-31 11:32:13 +0200 | [diff] [blame] | 48 | int sti_mixer_set_plane_status(struct sti_mixer *mixer, |
| 49 | struct sti_plane *plane, bool status); |
Vincent Abriou | 871bcdf | 2015-07-31 11:32:13 +0200 | [diff] [blame] | 50 | int sti_mixer_set_plane_depth(struct sti_mixer *mixer, struct sti_plane *plane); |
Benjamin Gaignard | e21e2193 | 2014-07-28 10:30:18 +0200 | [diff] [blame] | 51 | int sti_mixer_active_video_area(struct sti_mixer *mixer, |
Vincent Abriou | 871bcdf | 2015-07-31 11:32:13 +0200 | [diff] [blame] | 52 | struct drm_display_mode *mode); |
Benjamin Gaignard | e21e2193 | 2014-07-28 10:30:18 +0200 | [diff] [blame] | 53 | |
| 54 | void sti_mixer_set_background_status(struct sti_mixer *mixer, bool enable); |
| 55 | |
Benjamin Gaignard | 83af0a4 | 2016-06-21 15:09:39 +0200 | [diff] [blame] | 56 | int sti_mixer_debugfs_init(struct sti_mixer *mixer, struct drm_minor *minor); |
| 57 | |
Benjamin Gaignard | e21e2193 | 2014-07-28 10:30:18 +0200 | [diff] [blame] | 58 | /* depth in Cross-bar control = z order */ |
Vincent Abriou | bf60b29 | 2015-07-31 11:31:38 +0200 | [diff] [blame] | 59 | #define GAM_MIXER_NB_DEPTH_LEVEL 6 |
Benjamin Gaignard | e21e2193 | 2014-07-28 10:30:18 +0200 | [diff] [blame] | 60 | |
| 61 | #define STI_MIXER_MAIN 0 |
| 62 | #define STI_MIXER_AUX 1 |
| 63 | |
| 64 | #endif |