summaryrefslogtreecommitdiff
path: root/nvif
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-08-10 04:10:20 +1000
committerBen Skeggs <bskeggs@redhat.com>2014-08-10 04:43:27 +1000
commit8b25193ea0a484dd96821a581e6fbd8121d1106d (patch)
tree30267584a64348f15bf2d87a616cb1a0bcf79456 /nvif
parent04b07655a85d7768e652b47db91d465560df0cfd (diff)
downloadnouveau-8b25193ea0a484dd96821a581e6fbd8121d1106d.tar.gz
core: import ioctl/event interfaces
This forms the basis for the new APIs that will be exposed to userspace, giving it access to: - Object method calls, the immediately useful of which is performance counters and the abiity to manipulate the ZBC tables. - Information on the child classes an object supports, in order to avoid having to try all supported classes until successful. - Notifications, which will be used in the future to inform the client if its channel was killed due to a lockup, etc. This commit imports the interfaces, but are not currently used. The DRM portion of the driver will be ported to speak to the core using these interfaces as much as possible. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'nvif')
-rw-r--r--nvif/event.h26
-rw-r--r--nvif/ioctl.h125
2 files changed, 151 insertions, 0 deletions
diff --git a/nvif/event.h b/nvif/event.h
index 6daced098..cef3ef103 100644
--- a/nvif/event.h
+++ b/nvif/event.h
@@ -1,16 +1,39 @@
#ifndef __NVIF_EVENT_H__
#define __NVIF_EVENT_H__
+struct nvif_notify_req_v0 {
+ __u8 version;
+ __u8 reply;
+ __u8 pad02[5];
+#define NVIF_NOTIFY_V0_ROUTE_NVIF 0x00
+ __u8 route;
+ __u64 token; /* must be unique */
+ __u8 data[]; /* request data (below) */
+};
+
+struct nvif_notify_rep_v0 {
+ __u8 version;
+ __u8 pad01[6];
+ __u8 route;
+ __u64 token;
+ __u8 data[]; /* reply data (below) */
+};
+
struct nvif_notify_head_req_v0 {
+ /* nvif_notify_req ... */
__u8 version;
__u8 head;
+ __u8 pad02[6];
};
struct nvif_notify_head_rep_v0 {
+ /* nvif_notify_rep ... */
__u8 version;
+ __u8 pad01[7];
};
struct nvif_notify_conn_req_v0 {
+ /* nvif_notify_req ... */
__u8 version;
#define NVIF_NOTIFY_CONN_V0_PLUG 0x01
#define NVIF_NOTIFY_CONN_V0_UNPLUG 0x02
@@ -18,11 +41,14 @@ struct nvif_notify_conn_req_v0 {
#define NVIF_NOTIFY_CONN_V0_ANY 0x07
__u8 mask;
__u8 conn;
+ __u8 pad03[5];
};
struct nvif_notify_conn_rep_v0 {
+ /* nvif_notify_rep ... */
__u8 version;
__u8 mask;
+ __u8 pad02[6];
};
#endif
diff --git a/nvif/ioctl.h b/nvif/ioctl.h
new file mode 100644
index 000000000..38f24d1e9
--- /dev/null
+++ b/nvif/ioctl.h
@@ -0,0 +1,125 @@
+#ifndef __NVIF_IOCTL_H__
+#define __NVIF_IOCTL_H__
+
+struct nvif_ioctl_v0 {
+ __u8 version;
+#define NVIF_IOCTL_V0_OWNER_NVIF 0x00
+#define NVIF_IOCTL_V0_OWNER_ANY 0xff
+ __u8 owner;
+#define NVIF_IOCTL_V0_NOP 0x00
+#define NVIF_IOCTL_V0_SCLASS 0x01
+#define NVIF_IOCTL_V0_NEW 0x02
+#define NVIF_IOCTL_V0_DEL 0x03
+#define NVIF_IOCTL_V0_MTHD 0x04
+#define NVIF_IOCTL_V0_RD 0x05
+#define NVIF_IOCTL_V0_WR 0x06
+#define NVIF_IOCTL_V0_MAP 0x07
+#define NVIF_IOCTL_V0_UNMAP 0x08
+#define NVIF_IOCTL_V0_NTFY_NEW 0x09
+#define NVIF_IOCTL_V0_NTFY_DEL 0x0a
+#define NVIF_IOCTL_V0_NTFY_GET 0x0b
+#define NVIF_IOCTL_V0_NTFY_PUT 0x0c
+ __u8 type;
+ __u8 path_nr;
+#define NVIF_IOCTL_V0_ROUTE_NVIF 0x00
+#define NVIF_IOCTL_V0_ROUTE_HIDDEN 0xff
+ __u8 pad04[3];
+ __u8 route;
+ __u64 token;
+ __u32 path[8]; /* in reverse */
+ __u8 data[]; /* ioctl data (below) */
+};
+
+struct nvif_ioctl_nop {
+};
+
+struct nvif_ioctl_sclass_v0 {
+ /* nvif_ioctl ... */
+ __u8 version;
+ __u8 count;
+ __u8 pad02[6];
+ __u32 oclass[];
+};
+
+struct nvif_ioctl_new_v0 {
+ /* nvif_ioctl ... */
+ __u8 version;
+ __u8 pad01[6];
+ __u8 route;
+ __u64 token;
+ __u32 handle;
+ __u32 oclass;
+ __u8 data[]; /* class data (class.h) */
+};
+
+struct nvif_ioctl_del {
+};
+
+struct nvif_ioctl_rd_v0 {
+ /* nvif_ioctl ... */
+ __u8 version;
+ __u8 size;
+ __u8 pad02[2];
+ __u32 data;
+ __u64 addr;
+};
+
+struct nvif_ioctl_wr_v0 {
+ /* nvif_ioctl ... */
+ __u8 version;
+ __u8 size;
+ __u8 pad02[2];
+ __u32 data;
+ __u64 addr;
+};
+
+struct nvif_ioctl_map_v0 {
+ /* nvif_ioctl ... */
+ __u8 version;
+ __u8 pad01[3];
+ __u32 length;
+ __u64 handle;
+};
+
+struct nvif_ioctl_unmap {
+};
+
+struct nvif_ioctl_ntfy_new_v0 {
+ /* nvif_ioctl ... */
+ __u8 version;
+ __u8 event;
+ __u8 index;
+ __u8 pad03[5];
+ __u8 data[]; /* event request data (event.h) */
+};
+
+struct nvif_ioctl_ntfy_del_v0 {
+ /* nvif_ioctl ... */
+ __u8 version;
+ __u8 index;
+ __u8 pad02[6];
+};
+
+struct nvif_ioctl_ntfy_get_v0 {
+ /* nvif_ioctl ... */
+ __u8 version;
+ __u8 index;
+ __u8 pad02[6];
+};
+
+struct nvif_ioctl_ntfy_put_v0 {
+ /* nvif_ioctl ... */
+ __u8 version;
+ __u8 index;
+ __u8 pad02[6];
+};
+
+struct nvif_ioctl_mthd_v0 {
+ /* nvif_ioctl ... */
+ __u8 version;
+ __u8 method;
+ __u8 pad02[6];
+ __u8 data[]; /* method data (class.h) */
+};
+
+#endif