1 /* SPDX-License-Identifier: GPL-2.0-or-later */
5 * Based on sun4i_layer.h, which is:
6 * Copyright (C) 2015 Free Electrons
7 * Copyright (C) 2015 NextThing Co
12 #ifndef _SUN8I_UI_LAYER_H_
13 #define _SUN8I_UI_LAYER_H_
15 #include <drm/drm_plane.h>
17 #define SUN8I_MIXER_CHAN_UI_LAYER_ATTR(base, layer) \
18 ((base) + 0x20 * (layer) + 0x0)
19 #define SUN8I_MIXER_CHAN_UI_LAYER_SIZE(base, layer) \
20 ((base) + 0x20 * (layer) + 0x4)
21 #define SUN8I_MIXER_CHAN_UI_LAYER_COORD(base, layer) \
22 ((base) + 0x20 * (layer) + 0x8)
23 #define SUN8I_MIXER_CHAN_UI_LAYER_PITCH(base, layer) \
24 ((base) + 0x20 * (layer) + 0xc)
25 #define SUN8I_MIXER_CHAN_UI_LAYER_TOP_LADDR(base, layer) \
26 ((base) + 0x20 * (layer) + 0x10)
27 #define SUN8I_MIXER_CHAN_UI_LAYER_BOT_LADDR(base, layer) \
28 ((base) + 0x20 * (layer) + 0x14)
29 #define SUN8I_MIXER_CHAN_UI_LAYER_FCOLOR(base, layer) \
30 ((base) + 0x20 * (layer) + 0x18)
31 #define SUN8I_MIXER_CHAN_UI_TOP_HADDR(base) \
33 #define SUN8I_MIXER_CHAN_UI_BOT_HADDR(base) \
35 #define SUN8I_MIXER_CHAN_UI_OVL_SIZE(base) \
38 #define SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN BIT(0)
39 #define SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_MODE_MASK GENMASK(2, 1)
40 #define SUN8I_MIXER_CHAN_UI_LAYER_ATTR_FBFMT_MASK GENMASK(12, 8)
41 #define SUN8I_MIXER_CHAN_UI_LAYER_ATTR_FBFMT_OFFSET 8
42 #define SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_MASK GENMASK(31, 24)
43 #define SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA(x) ((x) << 24)
45 #define SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_MODE_PIXEL ((0) << 1)
46 #define SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_MODE_LAYER ((1) << 1)
47 #define SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_MODE_COMBINED ((2) << 1)
52 struct sun8i_layer *sun8i_ui_layer_init_one(struct drm_device *drm,
53 struct sun8i_mixer *mixer,
55 #endif /* _SUN8I_UI_LAYER_H_ */