Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Philipp Zabel | b8d181e | 2013-10-10 16:18:45 +0200 | [diff] [blame] | 2 | #ifndef __IPUV3_PLANE_H__ |
| 3 | #define __IPUV3_PLANE_H__ |
| 4 | |
| 5 | #include <drm/drm_crtc.h> /* drm_plane */ |
| 6 | |
| 7 | struct drm_plane; |
| 8 | struct drm_device; |
| 9 | struct ipu_soc; |
| 10 | struct drm_crtc; |
| 11 | struct drm_framebuffer; |
| 12 | |
| 13 | struct ipuv3_channel; |
| 14 | struct dmfc_channel; |
| 15 | struct ipu_dp; |
| 16 | |
| 17 | struct ipu_plane { |
| 18 | struct drm_plane base; |
| 19 | |
| 20 | struct ipu_soc *ipu; |
| 21 | struct ipuv3_channel *ipu_ch; |
Philipp Zabel | f6b50ef | 2016-07-22 12:02:45 +0200 | [diff] [blame] | 22 | struct ipuv3_channel *alpha_ch; |
Philipp Zabel | b8d181e | 2013-10-10 16:18:45 +0200 | [diff] [blame] | 23 | struct dmfc_channel *dmfc; |
| 24 | struct ipu_dp *dp; |
| 25 | |
| 26 | int dma; |
| 27 | int dp_flow; |
Philipp Zabel | eb8c888 | 2017-02-24 18:31:05 +0100 | [diff] [blame] | 28 | |
| 29 | bool disabling; |
Philipp Zabel | b8d181e | 2013-10-10 16:18:45 +0200 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | struct ipu_plane *ipu_plane_init(struct drm_device *dev, struct ipu_soc *ipu, |
| 33 | int dma, int dp, unsigned int possible_crtcs, |
Philipp Zabel | 4389559 | 2015-11-06 11:08:02 +0100 | [diff] [blame] | 34 | enum drm_plane_type type); |
Philipp Zabel | b8d181e | 2013-10-10 16:18:45 +0200 | [diff] [blame] | 35 | |
| 36 | /* Init IDMAC, DMFC, DP */ |
| 37 | int ipu_plane_mode_set(struct ipu_plane *plane, struct drm_crtc *crtc, |
| 38 | struct drm_display_mode *mode, |
| 39 | struct drm_framebuffer *fb, int crtc_x, int crtc_y, |
| 40 | unsigned int crtc_w, unsigned int crtc_h, |
| 41 | uint32_t src_x, uint32_t src_y, uint32_t src_w, |
Philipp Zabel | dd7fa6d | 2014-07-11 18:02:06 +0200 | [diff] [blame] | 42 | uint32_t src_h, bool interlaced); |
Philipp Zabel | b8d181e | 2013-10-10 16:18:45 +0200 | [diff] [blame] | 43 | |
Philipp Zabel | b8d181e | 2013-10-10 16:18:45 +0200 | [diff] [blame] | 44 | int ipu_plane_get_resources(struct ipu_plane *plane); |
| 45 | void ipu_plane_put_resources(struct ipu_plane *plane); |
| 46 | |
| 47 | int ipu_plane_irq(struct ipu_plane *plane); |
| 48 | |
Philipp Zabel | eb8c888 | 2017-02-24 18:31:05 +0100 | [diff] [blame] | 49 | void ipu_plane_disable(struct ipu_plane *ipu_plane, bool disable_dp_channel); |
| 50 | void ipu_plane_disable_deferred(struct drm_plane *plane); |
| 51 | |
Philipp Zabel | b8d181e | 2013-10-10 16:18:45 +0200 | [diff] [blame] | 52 | #endif |