blob: e563ea17a827c81e4be29b346f9f23e2fbc76853 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Philipp Zabelb8d181e2013-10-10 16:18:45 +02002#ifndef __IPUV3_PLANE_H__
3#define __IPUV3_PLANE_H__
4
5#include <drm/drm_crtc.h> /* drm_plane */
6
7struct drm_plane;
8struct drm_device;
9struct ipu_soc;
10struct drm_crtc;
11struct drm_framebuffer;
12
13struct ipuv3_channel;
14struct dmfc_channel;
15struct ipu_dp;
16
17struct ipu_plane {
18 struct drm_plane base;
19
20 struct ipu_soc *ipu;
21 struct ipuv3_channel *ipu_ch;
Philipp Zabelf6b50ef2016-07-22 12:02:45 +020022 struct ipuv3_channel *alpha_ch;
Philipp Zabelb8d181e2013-10-10 16:18:45 +020023 struct dmfc_channel *dmfc;
24 struct ipu_dp *dp;
25
26 int dma;
27 int dp_flow;
Philipp Zabeleb8c8882017-02-24 18:31:05 +010028
29 bool disabling;
Philipp Zabelb8d181e2013-10-10 16:18:45 +020030};
31
32struct ipu_plane *ipu_plane_init(struct drm_device *dev, struct ipu_soc *ipu,
33 int dma, int dp, unsigned int possible_crtcs,
Philipp Zabel43895592015-11-06 11:08:02 +010034 enum drm_plane_type type);
Philipp Zabelb8d181e2013-10-10 16:18:45 +020035
36/* Init IDMAC, DMFC, DP */
37int 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 Zabeldd7fa6d2014-07-11 18:02:06 +020042 uint32_t src_h, bool interlaced);
Philipp Zabelb8d181e2013-10-10 16:18:45 +020043
Philipp Zabelb8d181e2013-10-10 16:18:45 +020044int ipu_plane_get_resources(struct ipu_plane *plane);
45void ipu_plane_put_resources(struct ipu_plane *plane);
46
47int ipu_plane_irq(struct ipu_plane *plane);
48
Philipp Zabeleb8c8882017-02-24 18:31:05 +010049void ipu_plane_disable(struct ipu_plane *ipu_plane, bool disable_dp_channel);
50void ipu_plane_disable_deferred(struct drm_plane *plane);
51
Philipp Zabelb8d181e2013-10-10 16:18:45 +020052#endif