forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-20 ea08eeccae9297f7aabd2ef7f0c2517ac4549acc
kernel/drivers/gpu/drm/sun4i/sun8i_vi_layer.h
....@@ -1,10 +1,6 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Copyright (C) Jernej Skrabec <jernej.skrabec@siol.net>
3
- *
4
- * This program is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU General Public License as
6
- * published by the Free Software Foundation; either version 2 of
7
- * the License, or (at your option) any later version.
84 */
95
106 #ifndef _SUN8I_VI_LAYER_H_
....@@ -12,23 +8,37 @@
128
139 #include <drm/drm_plane.h>
1410
15
-#define SUN8I_MIXER_CHAN_VI_LAYER_ATTR(ch, layer) \
16
- (0x2000 + 0x1000 * (ch) + 0x30 * (layer) + 0x0)
17
-#define SUN8I_MIXER_CHAN_VI_LAYER_SIZE(ch, layer) \
18
- (0x2000 + 0x1000 * (ch) + 0x30 * (layer) + 0x4)
19
-#define SUN8I_MIXER_CHAN_VI_LAYER_COORD(ch, layer) \
20
- (0x2000 + 0x1000 * (ch) + 0x30 * (layer) + 0x8)
21
-#define SUN8I_MIXER_CHAN_VI_LAYER_PITCH(ch, layer, plane) \
22
- (0x2000 + 0x1000 * (ch) + 0x30 * (layer) + 0xc + 4 * (plane))
23
-#define SUN8I_MIXER_CHAN_VI_LAYER_TOP_LADDR(ch, layer, plane) \
24
- (0x2000 + 0x1000 * (ch) + 0x30 * (layer) + 0x18 + 4 * (plane))
25
-#define SUN8I_MIXER_CHAN_VI_OVL_SIZE(ch) (0x2000 + 0x1000 * (ch) + 0xe8)
11
+#define SUN8I_MIXER_CHAN_VI_LAYER_ATTR(base, layer) \
12
+ ((base) + 0x30 * (layer) + 0x0)
13
+#define SUN8I_MIXER_CHAN_VI_LAYER_SIZE(base, layer) \
14
+ ((base) + 0x30 * (layer) + 0x4)
15
+#define SUN8I_MIXER_CHAN_VI_LAYER_COORD(base, layer) \
16
+ ((base) + 0x30 * (layer) + 0x8)
17
+#define SUN8I_MIXER_CHAN_VI_LAYER_PITCH(base, layer, plane) \
18
+ ((base) + 0x30 * (layer) + 0xc + 4 * (plane))
19
+#define SUN8I_MIXER_CHAN_VI_LAYER_TOP_LADDR(base, layer, plane) \
20
+ ((base) + 0x30 * (layer) + 0x18 + 4 * (plane))
21
+#define SUN8I_MIXER_CHAN_VI_OVL_SIZE(base) \
22
+ ((base) + 0xe8)
23
+#define SUN8I_MIXER_CHAN_VI_HDS_Y(base) \
24
+ ((base) + 0xf0)
25
+#define SUN8I_MIXER_CHAN_VI_HDS_UV(base) \
26
+ ((base) + 0xf4)
27
+#define SUN8I_MIXER_CHAN_VI_VDS_Y(base) \
28
+ ((base) + 0xf8)
29
+#define SUN8I_MIXER_CHAN_VI_VDS_UV(base) \
30
+ ((base) + 0xfc)
2631
2732 #define SUN8I_MIXER_CHAN_VI_LAYER_ATTR_EN BIT(0)
2833 /* RGB mode should be set for RGB formats and cleared for YCbCr */
2934 #define SUN8I_MIXER_CHAN_VI_LAYER_ATTR_RGB_MODE BIT(15)
3035 #define SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_OFFSET 8
3136 #define SUN8I_MIXER_CHAN_VI_LAYER_ATTR_FBFMT_MASK GENMASK(12, 8)
37
+#define SUN50I_MIXER_CHAN_VI_LAYER_ATTR_ALPHA_MASK GENMASK(31, 24)
38
+#define SUN50I_MIXER_CHAN_VI_LAYER_ATTR_ALPHA(x) ((x) << 24)
39
+
40
+#define SUN8I_MIXER_CHAN_VI_DS_N(x) ((x) << 16)
41
+#define SUN8I_MIXER_CHAN_VI_DS_M(x) ((x) << 0)
3242
3343 struct sun8i_mixer;
3444