forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/gpu/drm/sun4i/sun8i_ui_layer.h
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Copyright (C) Icenowy Zheng <icenowy@aosc.io>
34 *
....@@ -6,11 +7,6 @@
67 * Copyright (C) 2015 NextThing Co
78 *
89 * Maxime Ripard <maxime.ripard@free-electrons.com>
9
- *
10
- * This program is free software; you can redistribute it and/or
11
- * modify it under the terms of the GNU General Public License as
12
- * published by the Free Software Foundation; either version 2 of
13
- * the License, or (at your option) any later version.
1410 */
1511
1612 #ifndef _SUN8I_UI_LAYER_H_
....@@ -18,23 +14,26 @@
1814
1915 #include <drm/drm_plane.h>
2016
21
-#define SUN8I_MIXER_CHAN_UI_LAYER_ATTR(ch, layer) \
22
- (0x2000 + 0x1000 * (ch) + 0x20 * (layer) + 0x0)
23
-#define SUN8I_MIXER_CHAN_UI_LAYER_SIZE(ch, layer) \
24
- (0x2000 + 0x1000 * (ch) + 0x20 * (layer) + 0x4)
25
-#define SUN8I_MIXER_CHAN_UI_LAYER_COORD(ch, layer) \
26
- (0x2000 + 0x1000 * (ch) + 0x20 * (layer) + 0x8)
27
-#define SUN8I_MIXER_CHAN_UI_LAYER_PITCH(ch, layer) \
28
- (0x2000 + 0x1000 * (ch) + 0x20 * (layer) + 0xc)
29
-#define SUN8I_MIXER_CHAN_UI_LAYER_TOP_LADDR(ch, layer) \
30
- (0x2000 + 0x1000 * (ch) + 0x20 * (layer) + 0x10)
31
-#define SUN8I_MIXER_CHAN_UI_LAYER_BOT_LADDR(ch, layer) \
32
- (0x2000 + 0x1000 * (ch) + 0x20 * (layer) + 0x14)
33
-#define SUN8I_MIXER_CHAN_UI_LAYER_FCOLOR(ch, layer) \
34
- (0x2000 + 0x1000 * (ch) + 0x20 * (layer) + 0x18)
35
-#define SUN8I_MIXER_CHAN_UI_TOP_HADDR(ch) (0x2000 + 0x1000 * (ch) + 0x80)
36
-#define SUN8I_MIXER_CHAN_UI_BOT_HADDR(ch) (0x2000 + 0x1000 * (ch) + 0x84)
37
-#define SUN8I_MIXER_CHAN_UI_OVL_SIZE(ch) (0x2000 + 0x1000 * (ch) + 0x88)
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) \
32
+ ((base) + 0x80)
33
+#define SUN8I_MIXER_CHAN_UI_BOT_HADDR(base) \
34
+ ((base) + 0x84)
35
+#define SUN8I_MIXER_CHAN_UI_OVL_SIZE(base) \
36
+ ((base) + 0x88)
3837
3938 #define SUN8I_MIXER_CHAN_UI_LAYER_ATTR_EN BIT(0)
4039 #define SUN8I_MIXER_CHAN_UI_LAYER_ATTR_ALPHA_MODE_MASK GENMASK(2, 1)