Linux-libre 5.3.12-gnu
[librecmc/linux-libre.git] / drivers / gpu / drm / sun4i / sun4i_layer.h
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Copyright (C) 2015 Free Electrons
4  * Copyright (C) 2015 NextThing Co
5  *
6  * Maxime Ripard <maxime.ripard@free-electrons.com>
7  */
8
9 #ifndef _SUN4I_LAYER_H_
10 #define _SUN4I_LAYER_H_
11
12 struct sunxi_engine;
13
14 struct sun4i_layer {
15         struct drm_plane        plane;
16         struct sun4i_drv        *drv;
17         struct sun4i_backend    *backend;
18         int                     id;
19 };
20
21 struct sun4i_layer_state {
22         struct drm_plane_state  state;
23         unsigned int            pipe;
24         bool                    uses_frontend;
25 };
26
27 static inline struct sun4i_layer *
28 plane_to_sun4i_layer(struct drm_plane *plane)
29 {
30         return container_of(plane, struct sun4i_layer, plane);
31 }
32
33 static inline struct sun4i_layer_state *
34 state_to_sun4i_layer_state(struct drm_plane_state *state)
35 {
36         return container_of(state, struct sun4i_layer_state, state);
37 }
38
39 struct drm_plane **sun4i_layers_init(struct drm_device *drm,
40                                      struct sunxi_engine *engine);
41
42 #endif /* _SUN4I_LAYER_H_ */