diff options
Diffstat (limited to 'drivers/video/tegra/host/nvhost_channel.h')
-rw-r--r-- | drivers/video/tegra/host/nvhost_channel.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/drivers/video/tegra/host/nvhost_channel.h b/drivers/video/tegra/host/nvhost_channel.h new file mode 100644 index 00000000000..7b946c8ee85 --- /dev/null +++ b/drivers/video/tegra/host/nvhost_channel.h | |||
@@ -0,0 +1,86 @@ | |||
1 | /* | ||
2 | * drivers/video/tegra/host/nvhost_channel.h | ||
3 | * | ||
4 | * Tegra Graphics Host Channel | ||
5 | * | ||
6 | * Copyright (c) 2010-2012, NVIDIA Corporation. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms and conditions of the GNU General Public License, | ||
10 | * version 2, as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
15 | * more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | */ | ||
20 | |||
21 | #ifndef __NVHOST_CHANNEL_H | ||
22 | #define __NVHOST_CHANNEL_H | ||
23 | |||
24 | #include "nvhost_cdma.h" | ||
25 | #include "nvhost_acm.h" | ||
26 | #include "nvhost_hwctx.h" | ||
27 | #include "nvhost_job.h" | ||
28 | |||
29 | #include <linux/cdev.h> | ||
30 | #include <linux/io.h> | ||
31 | |||
32 | #define NVHOST_MAX_WAIT_CHECKS 256 | ||
33 | #define NVHOST_MAX_GATHERS 512 | ||
34 | #define NVHOST_MAX_HANDLES 1280 | ||
35 | #define NVHOST_MAX_POWERGATE_IDS 2 | ||
36 | |||
37 | struct nvhost_master; | ||
38 | struct nvhost_waitchk; | ||
39 | struct nvhost_device; | ||
40 | |||
41 | struct nvhost_channel_gather { | ||
42 | u32 words; | ||
43 | phys_addr_t mem; | ||
44 | u32 mem_id; | ||
45 | int offset; | ||
46 | }; | ||
47 | |||
48 | struct nvhost_channel { | ||
49 | int refcount; | ||
50 | int chid; | ||
51 | u32 syncpt_id; | ||
52 | struct mutex reflock; | ||
53 | struct mutex submitlock; | ||
54 | void __iomem *aperture; | ||
55 | struct nvhost_hwctx *cur_ctx; | ||
56 | struct device *node; | ||
57 | struct nvhost_device *dev; | ||
58 | struct cdev cdev; | ||
59 | struct nvhost_hwctx_handler *ctxhandler; | ||
60 | struct nvhost_cdma cdma; | ||
61 | }; | ||
62 | |||
63 | int nvhost_channel_init( | ||
64 | struct nvhost_channel *ch, | ||
65 | struct nvhost_master *dev, int index); | ||
66 | |||
67 | int nvhost_channel_submit(struct nvhost_job *job); | ||
68 | |||
69 | struct nvhost_channel *nvhost_getchannel(struct nvhost_channel *ch); | ||
70 | void nvhost_putchannel(struct nvhost_channel *ch, struct nvhost_hwctx *ctx); | ||
71 | int nvhost_channel_suspend(struct nvhost_channel *ch); | ||
72 | |||
73 | #define channel_cdma_op(ch) (nvhost_get_host(ch->dev)->op.cdma) | ||
74 | #define channel_op(ch) (nvhost_get_host(ch->dev)->op.channel) | ||
75 | #define host_channel_op(host) (host->op.channel) | ||
76 | |||
77 | int nvhost_channel_drain_read_fifo(void __iomem *chan_regs, | ||
78 | u32 *ptr, unsigned int count, unsigned int *pending); | ||
79 | |||
80 | int nvhost_channel_read_3d_reg( | ||
81 | struct nvhost_channel *channel, | ||
82 | struct nvhost_hwctx *hwctx, | ||
83 | u32 offset, | ||
84 | u32 *value); | ||
85 | |||
86 | #endif | ||