xref: /linux/drivers/gpu/drm/verisilicon/vs_cursor_plane_regs.h (revision b2f1e6301efa4a80becdb0715416c3cbc693fbb4)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Copyright (C) 2025 Icenowy Zheng <uwu@icenowy.me>
4  *
5  * Based on vs_dc_hw.h, which is:
6  *   Copyright (C) 2023 VeriSilicon Holdings Co., Ltd.
7  */
8 
9 #ifndef _VS_CURSOR_PLANE_REGS_H_
10 #define _VS_CURSOR_PLANE_REGS_H_
11 
12 #include <linux/bits.h>
13 
14 #define VSDC_CURSOR_CONFIG(n)		(0x1468 + 0x1080 * (n))
15 #define VSDC_CURSOR_CONFIG_FMT_MASK	GENMASK(1, 0)
16 #define VSDC_CURSOR_CONFIG_FMT_ARGB8888	(0x2 << 0)
17 #define VSDC_CURSOR_CONFIG_FMT_OFF	(0x0 << 0)
18 #define VSDC_CURSOR_CONFIG_IMG_UPDATE	BIT(2)
19 #define VSDC_CURSOR_CONFIG_COMMIT	BIT(3)
20 #define VSDC_CURSOR_CONFIG_SIZE_MASK	GENMASK(7, 5)
21 #define VSDC_CURSOR_CONFIG_SIZE_32	(0x0 << 5)
22 #define VSDC_CURSOR_CONFIG_SIZE_64	(0x1 << 5)
23 #define VSDC_CURSOR_CONFIG_SIZE_128	(0x2 << 5)
24 #define VSDC_CURSOR_CONFIG_SIZE_256	(0x3 << 5)
25 #define VSDC_CURSOR_CONFIG_Y_OFF_MASK	GENMASK(12, 8)
26 #define VSDC_CURSOR_CONFIG_Y_OFF(v)	((v) << 8)
27 #define VSDC_CURSOR_CONFIG_X_OFF_MASK	GENMASK(20, 16)
28 #define VSDC_CURSOR_CONFIG_X_OFF(v)	((v) << 16)
29 
30 #define VSDC_CURSOR_ADDRESS(n)		(0x146C + 0x1080 * (n))
31 
32 #define VSDC_CURSOR_LOCATION(n)		(0x1470 + 0x1080 * (n))
33 #define VSDC_CURSOR_LOCATION_X_MASK	GENMASK(14, 0)
34 #define VSDC_CURSOR_LOCATION_X(v)	((v) << 0)
35 #define VSDC_CURSOR_LOCATION_Y_MASK	GENMASK(30, 16)
36 #define VSDC_CURSOR_LOCATION_Y(v)	((v) << 16)
37 
38 #define VSDC_CURSOR_BACKGROUND(n)	(0x1474 + 0x1080 * (n))
39 #define VSDC_CURSOR_BACKGRUOND_DEFAULT	0x00FFFFFF
40 
41 #define VSDC_CURSOR_FOREGROUND(n)	(0x1478 + 0x1080 * (n))
42 #define VSDC_CURSOR_FOREGRUOND_DEFAULT	0x00AAAAAA
43 
44 #endif /* _VS_CURSOR_PLANE_REGS_H_ */
45