summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/verisilicon/vs_cursor_plane_regs.h
blob: 99693f2c95b94b7c6b71b65e8c8653b076ab0576 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * Copyright (C) 2025 Icenowy Zheng <uwu@icenowy.me>
 *
 * Based on vs_dc_hw.h, which is:
 *   Copyright (C) 2023 VeriSilicon Holdings Co., Ltd.
 */

#ifndef _VS_CURSOR_PLANE_REGS_H_
#define _VS_CURSOR_PLANE_REGS_H_

#include <linux/bits.h>

#define VSDC_CURSOR_CONFIG(n)		(0x1468 + 0x1080 * (n))
#define VSDC_CURSOR_CONFIG_FMT_MASK	GENMASK(1, 0)
#define VSDC_CURSOR_CONFIG_FMT_ARGB8888	(0x2 << 0)
#define VSDC_CURSOR_CONFIG_FMT_OFF	(0x0 << 0)
#define VSDC_CURSOR_CONFIG_IMG_UPDATE	BIT(2)
#define VSDC_CURSOR_CONFIG_COMMIT	BIT(3)
#define VSDC_CURSOR_CONFIG_SIZE_MASK	GENMASK(7, 5)
#define VSDC_CURSOR_CONFIG_SIZE_32	(0x0 << 5)
#define VSDC_CURSOR_CONFIG_SIZE_64	(0x1 << 5)
#define VSDC_CURSOR_CONFIG_SIZE_128	(0x2 << 5)
#define VSDC_CURSOR_CONFIG_SIZE_256	(0x3 << 5)
#define VSDC_CURSOR_CONFIG_Y_OFF_MASK	GENMASK(12, 8)
#define VSDC_CURSOR_CONFIG_Y_OFF(v)	((v) << 8)
#define VSDC_CURSOR_CONFIG_X_OFF_MASK	GENMASK(20, 16)
#define VSDC_CURSOR_CONFIG_X_OFF(v)	((v) << 16)

#define VSDC_CURSOR_ADDRESS(n)		(0x146C + 0x1080 * (n))

#define VSDC_CURSOR_LOCATION(n)		(0x1470 + 0x1080 * (n))
#define VSDC_CURSOR_LOCATION_X_MASK	GENMASK(14, 0)
#define VSDC_CURSOR_LOCATION_X(v)	((v) << 0)
#define VSDC_CURSOR_LOCATION_Y_MASK	GENMASK(30, 16)
#define VSDC_CURSOR_LOCATION_Y(v)	((v) << 16)

#define VSDC_CURSOR_BACKGROUND(n)	(0x1474 + 0x1080 * (n))
#define VSDC_CURSOR_BACKGRUOND_DEFAULT	0x00FFFFFF

#define VSDC_CURSOR_FOREGROUND(n)	(0x1478 + 0x1080 * (n))
#define VSDC_CURSOR_FOREGRUOND_DEFAULT	0x00AAAAAA

#endif /* _VS_CURSOR_PLANE_REGS_H_ */