1
2
3
4
5
6
7
8
9
10
11
12
13
14#ifndef __RCAR_DU_PLANE_H__
15#define __RCAR_DU_PLANE_H__
16
17#include <drm/drmP.h>
18#include <drm/drm_crtc.h>
19
20struct rcar_du_format_info;
21struct rcar_du_group;
22
23
24
25
26
27
28#define RCAR_DU_NUM_KMS_PLANES 9
29#define RCAR_DU_NUM_HW_PLANES 8
30
31enum rcar_du_plane_source {
32 RCAR_DU_PLANE_MEMORY,
33 RCAR_DU_PLANE_VSPD0,
34 RCAR_DU_PLANE_VSPD1,
35};
36
37struct rcar_du_plane {
38 struct drm_plane plane;
39 struct rcar_du_group *group;
40};
41
42static inline struct rcar_du_plane *to_rcar_plane(struct drm_plane *plane)
43{
44 return container_of(plane, struct rcar_du_plane, plane);
45}
46
47
48
49
50
51
52
53
54
55struct rcar_du_plane_state {
56 struct drm_plane_state state;
57
58 const struct rcar_du_format_info *format;
59 int hwindex;
60 enum rcar_du_plane_source source;
61
62 unsigned int alpha;
63 unsigned int colorkey;
64};
65
66static inline struct rcar_du_plane_state *
67to_rcar_plane_state(struct drm_plane_state *state)
68{
69 return container_of(state, struct rcar_du_plane_state, state);
70}
71
72int rcar_du_atomic_check_planes(struct drm_device *dev,
73 struct drm_atomic_state *state);
74
75int rcar_du_planes_init(struct rcar_du_group *rgrp);
76
77void __rcar_du_plane_setup(struct rcar_du_group *rgrp,
78 const struct rcar_du_plane_state *state);
79
80static inline void rcar_du_plane_setup(struct rcar_du_plane *plane)
81{
82 struct rcar_du_plane_state *state =
83 to_rcar_plane_state(plane->plane.state);
84
85 return __rcar_du_plane_setup(plane->group, state);
86}
87
88#endif
89