1
2
3#ifndef __DRM_GEM_ATOMIC_HELPER_H__
4#define __DRM_GEM_ATOMIC_HELPER_H__
5
6#include <linux/dma-buf-map.h>
7
8#include <drm/drm_plane.h>
9
10struct drm_simple_display_pipe;
11
12
13
14
15
16int drm_gem_plane_helper_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state);
17int drm_gem_simple_display_pipe_prepare_fb(struct drm_simple_display_pipe *pipe,
18 struct drm_plane_state *plane_state);
19
20
21
22
23
24
25
26
27
28
29
30
31struct drm_shadow_plane_state {
32
33 struct drm_plane_state base;
34
35
36
37
38
39
40
41
42
43 struct dma_buf_map map[4];
44};
45
46
47
48
49
50static inline struct drm_shadow_plane_state *
51to_drm_shadow_plane_state(struct drm_plane_state *state)
52{
53 return container_of(state, struct drm_shadow_plane_state, base);
54}
55
56void drm_gem_reset_shadow_plane(struct drm_plane *plane);
57struct drm_plane_state *drm_gem_duplicate_shadow_plane_state(struct drm_plane *plane);
58void drm_gem_destroy_shadow_plane_state(struct drm_plane *plane,
59 struct drm_plane_state *plane_state);
60
61
62
63
64
65
66
67
68#define DRM_GEM_SHADOW_PLANE_FUNCS \
69 .reset = drm_gem_reset_shadow_plane, \
70 .atomic_duplicate_state = drm_gem_duplicate_shadow_plane_state, \
71 .atomic_destroy_state = drm_gem_destroy_shadow_plane_state
72
73int drm_gem_prepare_shadow_fb(struct drm_plane *plane, struct drm_plane_state *plane_state);
74void drm_gem_cleanup_shadow_fb(struct drm_plane *plane, struct drm_plane_state *plane_state);
75
76
77
78
79
80
81
82
83
84#define DRM_GEM_SHADOW_PLANE_HELPER_FUNCS \
85 .prepare_fb = drm_gem_prepare_shadow_fb, \
86 .cleanup_fb = drm_gem_cleanup_shadow_fb
87
88int drm_gem_simple_kms_prepare_shadow_fb(struct drm_simple_display_pipe *pipe,
89 struct drm_plane_state *plane_state);
90void drm_gem_simple_kms_cleanup_shadow_fb(struct drm_simple_display_pipe *pipe,
91 struct drm_plane_state *plane_state);
92void drm_gem_simple_kms_reset_shadow_plane(struct drm_simple_display_pipe *pipe);
93struct drm_plane_state *
94drm_gem_simple_kms_duplicate_shadow_plane_state(struct drm_simple_display_pipe *pipe);
95void drm_gem_simple_kms_destroy_shadow_plane_state(struct drm_simple_display_pipe *pipe,
96 struct drm_plane_state *plane_state);
97
98
99
100
101
102
103
104
105
106#define DRM_GEM_SIMPLE_DISPLAY_PIPE_SHADOW_PLANE_FUNCS \
107 .prepare_fb = drm_gem_simple_kms_prepare_shadow_fb, \
108 .cleanup_fb = drm_gem_simple_kms_cleanup_shadow_fb, \
109 .reset_plane = drm_gem_simple_kms_reset_shadow_plane, \
110 .duplicate_plane_state = drm_gem_simple_kms_duplicate_shadow_plane_state, \
111 .destroy_plane_state = drm_gem_simple_kms_destroy_shadow_plane_state
112
113#endif
114