File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,19 @@ static struct drm_encoder *sun4i_crtc_get_encoder(struct drm_crtc *crtc)
46
46
return NULL ;
47
47
}
48
48
49
+ static int sun4i_crtc_atomic_check (struct drm_crtc * crtc ,
50
+ struct drm_crtc_state * state )
51
+ {
52
+ struct sun4i_crtc * scrtc = drm_crtc_to_sun4i_crtc (crtc );
53
+ struct sunxi_engine * engine = scrtc -> engine ;
54
+ int ret = 0 ;
55
+
56
+ if (engine && engine -> ops && engine -> ops -> atomic_check )
57
+ ret = engine -> ops -> atomic_check (engine , state );
58
+
59
+ return ret ;
60
+ }
61
+
49
62
static void sun4i_crtc_atomic_begin (struct drm_crtc * crtc ,
50
63
struct drm_crtc_state * old_state )
51
64
{
@@ -125,6 +138,7 @@ static void sun4i_crtc_mode_set_nofb(struct drm_crtc *crtc)
125
138
}
126
139
127
140
static const struct drm_crtc_helper_funcs sun4i_crtc_helper_funcs = {
141
+ .atomic_check = sun4i_crtc_atomic_check ,
128
142
.atomic_begin = sun4i_crtc_atomic_begin ,
129
143
.atomic_flush = sun4i_crtc_atomic_flush ,
130
144
.atomic_enable = sun4i_crtc_atomic_enable ,
Original file line number Diff line number Diff line change @@ -22,6 +22,23 @@ struct sunxi_engine;
22
22
* implement the proper behaviour.
23
23
*/
24
24
struct sunxi_engine_ops {
25
+ /**
26
+ * @atomic_check:
27
+ *
28
+ * This callback allows to validate plane-update related CRTC
29
+ * constraints specific to engines. This is mirroring the
30
+ * &drm_crtc_helper_funcs.atomic_check callback, so any
31
+ * documentation there applies.
32
+ *
33
+ * This function is optional.
34
+ *
35
+ * RETURNS:
36
+ *
37
+ * 0 on success or a negative error code.
38
+ */
39
+ int (* atomic_check )(struct sunxi_engine * engine ,
40
+ struct drm_crtc_state * state );
41
+
25
42
/**
26
43
* @commit:
27
44
*
You can’t perform that action at this time.
0 commit comments