]> nv-tegra.nvidia Code Review - linux-2.6.git/blob - include/linux/tegra_nvavp.h
Merge commit 'main-jb-2012.08.03-B4' into t114-0806
[linux-2.6.git] / include / linux / tegra_nvavp.h
1 /*
2  * include/linux/tegra_nvavp.h
3  *
4  * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
5  *
6  * This file is licensed under the terms of the GNU General Public License
7  * version 2. This program is licensed "as is" without any warranty of any
8  * kind, whether express or implied.
9  */
10
11 #ifndef __LINUX_TEGRA_NVAVP_H
12 #define __LINUX_TEGRA_NVAVP_H
13
14 #include <linux/ioctl.h>
15 #include <linux/types.h>
16
17 #define NVAVP_MAX_RELOCATION_COUNT 64
18
19 /* avp submit flags */
20 #define NVAVP_FLAG_NONE         0x00000000
21 #define NVAVP_UCODE_EXT         0x00000001 /*use external ucode provided */
22
23 enum {
24         NVAVP_MODULE_ID_AVP     = 2,
25         NVAVP_MODULE_ID_VCP     = 3,
26         NVAVP_MODULE_ID_BSEA    = 27,
27         NVAVP_MODULE_ID_VDE     = 28,
28         NVAVP_MODULE_ID_MPE     = 29,
29         NVAVP_MODULE_ID_EMC     = 75,
30 };
31
32 struct nvavp_cmdbuf {
33         __u32 mem;
34         __u32 offset;
35         __u32 words;
36 };
37
38 struct nvavp_reloc {
39         __u32 cmdbuf_mem;
40         __u32 cmdbuf_offset;
41         __u32 target;
42         __u32 target_offset;
43 };
44
45 struct nvavp_syncpt {
46         __u32 id;
47         __u32 value;
48 };
49
50 struct nvavp_pushbuffer_submit_hdr {
51         struct nvavp_cmdbuf     cmdbuf;
52         struct nvavp_reloc      *relocs;
53         __u32                   num_relocs;
54         struct nvavp_syncpt     *syncpt;
55         __u32                   flags;
56 };
57
58 struct nvavp_set_nvmap_fd_args {
59         __u32 fd;
60 };
61
62 struct nvavp_clock_args {
63         __u32 id;
64         __u32 rate;
65 };
66
67 enum nvavp_clock_stay_on_state {
68         NVAVP_CLOCK_STAY_ON_DISABLED = 0,
69         NVAVP_CLOCK_STAY_ON_ENABLED
70 };
71
72 struct nvavp_clock_stay_on_state_args {
73         enum nvavp_clock_stay_on_state  state;
74 };
75
76 #define NVAVP_IOCTL_MAGIC               'n'
77
78 #define NVAVP_IOCTL_SET_NVMAP_FD        _IOW(NVAVP_IOCTL_MAGIC, 0x60, \
79                                         struct nvavp_set_nvmap_fd_args)
80 #define NVAVP_IOCTL_GET_SYNCPOINT_ID    _IOR(NVAVP_IOCTL_MAGIC, 0x61, \
81                                         __u32)
82 #define NVAVP_IOCTL_PUSH_BUFFER_SUBMIT  _IOWR(NVAVP_IOCTL_MAGIC, 0x63, \
83                                         struct nvavp_pushbuffer_submit_hdr)
84 #define NVAVP_IOCTL_SET_CLOCK           _IOWR(NVAVP_IOCTL_MAGIC, 0x64, \
85                                         struct nvavp_clock_args)
86 #define NVAVP_IOCTL_GET_CLOCK           _IOR(NVAVP_IOCTL_MAGIC, 0x65, \
87                                         struct nvavp_clock_args)
88 #define NVAVP_IOCTL_WAKE_AVP            _IOR(NVAVP_IOCTL_MAGIC, 0x66, \
89                                         __u32)
90 #define NVAVP_IOCTL_FORCE_CLOCK_STAY_ON _IOW(NVAVP_IOCTL_MAGIC, 0x67, \
91                                         struct nvavp_clock_stay_on_state_args)
92 #define NVAVP_IOCTL_ENABLE_AUDIO_CLOCKS  _IOWR(NVAVP_IOCTL_MAGIC, 0x68, \
93                                         struct nvavp_clock_args)
94 #define NVAVP_IOCTL_DISABLE_AUDIO_CLOCKS _IOWR(NVAVP_IOCTL_MAGIC, 0x69, \
95                                         struct nvavp_clock_args)
96
97 #define NVAVP_IOCTL_MIN_NR              _IOC_NR(NVAVP_IOCTL_SET_NVMAP_FD)
98 #define NVAVP_IOCTL_MAX_NR              _IOC_NR(NVAVP_IOCTL_DISABLE_AUDIO_CLOCKS)
99
100 #endif /* __LINUX_TEGRA_NVAVP_H */