summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/logicvc/logicvc_drm.h
blob: e0f4787c69f9376427083a75547adedbd9dcdfd4 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* SPDX-License-Identifier: GPL-2.0+ */
/*
 * Copyright (C) 2019-2022 Bootlin
 * Author: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
 */

#ifndef _LOGICVC_DRM_H_
#define _LOGICVC_DRM_H_

#include <linux/regmap.h>
#include <linux/types.h>
#include <drm/drm_device.h>

#define LOGICVC_DISPLAY_INTERFACE_RGB			0
#define LOGICVC_DISPLAY_INTERFACE_ITU656		1
#define LOGICVC_DISPLAY_INTERFACE_LVDS_4BITS		2
#define LOGICVC_DISPLAY_INTERFACE_LVDS_4BITS_CAMERA	3
#define LOGICVC_DISPLAY_INTERFACE_LVDS_3BITS		4
#define LOGICVC_DISPLAY_INTERFACE_DVI			5

#define LOGICVC_DISPLAY_COLORSPACE_RGB		0
#define LOGICVC_DISPLAY_COLORSPACE_YUV422	1
#define LOGICVC_DISPLAY_COLORSPACE_YUV444	2

#define logicvc_drm(d) \
	container_of(d, struct logicvc_drm, drm_dev)

struct logicvc_crtc;
struct logicvc_interface;

struct logicvc_drm_config {
	u32 display_interface;
	u32 display_colorspace;
	u32 display_depth;
	u32 row_stride;
	bool dithering;
	bool background_layer;
	bool layers_configurable;
	u32 layers_count;
};

struct logicvc_drm_caps {
	unsigned int major;
	unsigned int minor;
	char level;
	bool layer_address;
};

struct logicvc_drm {
	const struct logicvc_drm_caps *caps;
	struct logicvc_drm_config config;

	struct drm_device drm_dev;
	phys_addr_t reserved_mem_base;
	struct regmap *regmap;

	struct clk *vclk;
	struct clk *vclk2;
	struct clk *lvdsclk;
	struct clk *lvdsclkn;

	struct list_head layers_list;
	struct logicvc_crtc *crtc;
	struct logicvc_interface *interface;
};

#endif