diff options
Diffstat (limited to 'drivers/video/tegra/host/nvhost_hwctx.h')
-rw-r--r-- | drivers/video/tegra/host/nvhost_hwctx.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/drivers/video/tegra/host/nvhost_hwctx.h b/drivers/video/tegra/host/nvhost_hwctx.h new file mode 100644 index 00000000000..02a3976f01c --- /dev/null +++ b/drivers/video/tegra/host/nvhost_hwctx.h | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * drivers/video/tegra/host/nvhost_hwctx.h | ||
3 | * | ||
4 | * Tegra Graphics Host Hardware Context Interface | ||
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_HWCTX_H | ||
22 | #define __NVHOST_HWCTX_H | ||
23 | |||
24 | #include <linux/string.h> | ||
25 | #include <linux/kref.h> | ||
26 | |||
27 | #include <linux/nvhost.h> | ||
28 | #include <mach/nvmap.h> | ||
29 | |||
30 | struct nvhost_channel; | ||
31 | struct nvhost_cdma; | ||
32 | |||
33 | struct nvhost_hwctx { | ||
34 | struct kref ref; | ||
35 | struct nvhost_hwctx_handler *h; | ||
36 | struct nvhost_channel *channel; | ||
37 | bool valid; | ||
38 | bool has_timedout; | ||
39 | }; | ||
40 | |||
41 | struct nvhost_hwctx_handler { | ||
42 | struct nvhost_hwctx * (*alloc) (struct nvhost_hwctx_handler *h, | ||
43 | struct nvhost_channel *ch); | ||
44 | void (*get) (struct nvhost_hwctx *ctx); | ||
45 | void (*put) (struct nvhost_hwctx *ctx); | ||
46 | void (*save_push) (struct nvhost_hwctx *ctx, | ||
47 | struct nvhost_cdma *cdma); | ||
48 | void (*save_service) (struct nvhost_hwctx *ctx); | ||
49 | void *priv; | ||
50 | }; | ||
51 | |||
52 | |||
53 | struct hwctx_reginfo { | ||
54 | unsigned int offset:12; | ||
55 | unsigned int count:16; | ||
56 | unsigned int type:2; | ||
57 | }; | ||
58 | |||
59 | enum { | ||
60 | HWCTX_REGINFO_DIRECT = 0, | ||
61 | HWCTX_REGINFO_INDIRECT, | ||
62 | HWCTX_REGINFO_INDIRECT_4X | ||
63 | }; | ||
64 | |||
65 | #define HWCTX_REGINFO(offset, count, type) {offset, count, HWCTX_REGINFO_##type} | ||
66 | |||
67 | #endif | ||