m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/private_data.h
blob: 65eb948e17e0f35d9dd3f4ee39317474f85d4985 (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
68
69
70
71
72
73
74
75
76
77
#ifndef PRIVATE_DATA_H
#define PRIVATE_DATA_H

#include <linux/device.h>
#include <linux/cdev.h>

struct doom_data {
	struct cdev cdev;
	struct device *device;
	struct device *pci_device;
	void __iomem *iomem;
	struct mutex cmd_mutex;
	struct mutex ping_mutex;
	struct semaphore pong_sem;
	struct semaphore pong_async_sem;

	uint16_t cmd_counter;

	// cache of registers we don't want to modify when not neccessary
	uint32_t surf_dst_pt;
	uint32_t surf_src_pt;
	uint32_t texture_pt;
	uint32_t flat_addr;
	uint32_t colors_addr;
	uint32_t trans_addr;
	uint32_t surf_dims_w;
	uint32_t surf_dims_h;
	uint32_t texture_dims_s;
	uint32_t texture_dims_h;
	uint32_t draw_params;
};

struct surface_data {
	struct doom_data *doom_data;

	int surface_size;
	int width;
	int height;
	int pages;
	int total_bytes;

	uint8_t *surface_cpu;
	uint32_t *page_table_cpu;
	dma_addr_t surface_dev;
	dma_addr_t page_table_dev;
};

struct texture_data {
	struct doom_data *doom_data;

	uint32_t size;
	uint16_t height;
	int pages;

	uint8_t *texture_cpu;
	uint32_t *page_table_cpu;
	dma_addr_t texture_dev;
	dma_addr_t page_table_dev;
};

struct flat_data {
	struct doom_data *doom_data;

	uint8_t *flat_cpu;
	dma_addr_t flat_dev;
};

struct colors_data {
	struct doom_data *doom_data;

	uint32_t number;

	uint8_t *colors_cpu;
	dma_addr_t colors_dev;
};

#endif