blob: 596b24ddbf657001472eae416abba3b38f064307 [file] [log] [blame]
Philipp Zabelb8d181e2013-10-10 16:18:45 +02001#ifndef __IPUV3_PLANE_H__
2#define __IPUV3_PLANE_H__
3
4#include <drm/drm_crtc.h> /* drm_plane */
5
6struct drm_plane;
7struct drm_device;
8struct ipu_soc;
9struct drm_crtc;
10struct drm_framebuffer;
11
12struct ipuv3_channel;
13struct dmfc_channel;
14struct ipu_dp;
15
16struct ipu_plane {
17 struct drm_plane base;
18
19 struct ipu_soc *ipu;
20 struct ipuv3_channel *ipu_ch;
Philipp Zabelf6b50ef2016-07-22 12:02:45 +020021 struct ipuv3_channel *alpha_ch;
Philipp Zabelb8d181e2013-10-10 16:18:45 +020022 struct dmfc_channel *dmfc;
23 struct ipu_dp *dp;
24
25 int dma;
26 int dp_flow;
Philipp Zabeleb8c8882017-02-24 18:31:05 +010027
28 bool disabling;
Philipp Zabelb8d181e2013-10-10 16:18:45 +020029};
30
31struct ipu_plane *ipu_plane_init(struct drm_device *dev, struct ipu_soc *ipu,
32 int dma, int dp, unsigned int possible_crtcs,
Philipp Zabel43895592015-11-06 11:08:02 +010033 enum drm_plane_type type);
Philipp Zabelb8d181e2013-10-10 16:18:45 +020034
35/* Init IDMAC, DMFC, DP */
36int ipu_plane_mode_set(struct ipu_plane *plane, struct drm_crtc *crtc,
37 struct drm_display_mode *mode,
38 struct drm_framebuffer *fb, int crtc_x, int crtc_y,
39 unsigned int crtc_w, unsigned int crtc_h,
40 uint32_t src_x, uint32_t src_y, uint32_t src_w,
Philipp Zabeldd7fa6d2014-07-11 18:02:06 +020041 uint32_t src_h, bool interlaced);
Philipp Zabelb8d181e2013-10-10 16:18:45 +020042
Philipp Zabelb8d181e2013-10-10 16:18:45 +020043int ipu_plane_get_resources(struct ipu_plane *plane);
44void ipu_plane_put_resources(struct ipu_plane *plane);
45
46int ipu_plane_irq(struct ipu_plane *plane);
47
Philipp Zabeleb8c8882017-02-24 18:31:05 +010048void ipu_plane_disable(struct ipu_plane *ipu_plane, bool disable_dp_channel);
49void ipu_plane_disable_deferred(struct drm_plane *plane);
50
Philipp Zabelb8d181e2013-10-10 16:18:45 +020051#endif