All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tommi Rantala <tt.rantala@gmail.com>
To: davej@redhat.com
Cc: trinity@vger.kernel.org, Tommi Rantala <tt.rantala@gmail.com>
Subject: [PATCH 7/8] ioctls/drm: add deprecated nouveau ioctls
Date: Sun, 30 Jun 2013 22:33:11 +0300	[thread overview]
Message-ID: <1372620792-16384-8-git-send-email-tt.rantala@gmail.com> (raw)
In-Reply-To: <1372620792-16384-1-git-send-email-tt.rantala@gmail.com>

nouveau has some deprecated ioctls that the kernel implements, but the
ioctl definitions are no longer available in the kernel headers.
---
 ioctls/drm.c | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 102 insertions(+)

diff --git a/ioctls/drm.c b/ioctls/drm.c
index 736c264..952a356 100644
--- a/ioctls/drm.c
+++ b/ioctls/drm.c
@@ -45,6 +45,101 @@
 #define DRM_IOCTL_SIS_FLIP_FINAL	DRM_IO(  0x50)
 */
 
+/* deprecated nouveau ioctls */
+/*
+ * Copyright 2005 Stephane Marchesin.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+#ifndef DRM_IOCTL_NOUVEAU_GETPARAM
+struct drm_nouveau_getparam {
+	uint64_t param;
+	uint64_t value;
+};
+#define DRM_IOCTL_NOUVEAU_GETPARAM           DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_GETPARAM, struct drm_nouveau_getparam)
+#endif
+
+#ifndef DRM_IOCTL_NOUVEAU_SETPARAM
+struct drm_nouveau_setparam {
+	uint64_t param;
+	uint64_t value;
+};
+#define DRM_IOCTL_NOUVEAU_SETPARAM           DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_SETPARAM, struct drm_nouveau_setparam)
+#endif
+
+#ifndef DRM_IOCTL_NOUVEAU_CHANNEL_ALLOC
+struct drm_nouveau_channel_alloc {
+	uint32_t     fb_ctxdma_handle;
+	uint32_t     tt_ctxdma_handle;
+
+	int          channel;
+	uint32_t     pushbuf_domains;
+
+	/* Notifier memory */
+	uint32_t     notifier_handle;
+
+	/* DRM-enforced subchannel assignments */
+	struct {
+		uint32_t handle;
+		uint32_t grclass;
+	} subchan[8];
+	uint32_t nr_subchan;
+};
+#define DRM_IOCTL_NOUVEAU_CHANNEL_ALLOC      DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_ALLOC, struct drm_nouveau_channel_alloc)
+#endif
+
+#ifndef DRM_IOCTL_NOUVEAU_CHANNEL_FREE
+struct drm_nouveau_channel_free {
+	int channel;
+};
+#define DRM_IOCTL_NOUVEAU_CHANNEL_FREE       DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_CHANNEL_FREE, struct drm_nouveau_channel_free)
+#endif
+
+#ifndef DRM_IOCTL_NOUVEAU_GROBJ_ALLOC
+struct drm_nouveau_grobj_alloc {
+	int      channel;
+	uint32_t handle;
+	int      class;
+};
+#define DRM_IOCTL_NOUVEAU_GROBJ_ALLOC        DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GROBJ_ALLOC, struct drm_nouveau_grobj_alloc)
+#endif
+
+#ifndef DRM_IOCTL_NOUVEAU_NOTIFIEROBJ_ALLOC
+struct drm_nouveau_notifierobj_alloc {
+	uint32_t channel;
+	uint32_t handle;
+	uint32_t size;
+	uint32_t offset;
+};
+#define DRM_IOCTL_NOUVEAU_NOTIFIEROBJ_ALLOC  DRM_IOWR(DRM_COMMAND_BASE + DRM_NOUVEAU_NOTIFIEROBJ_ALLOC, struct drm_nouveau_notifierobj_alloc)
+#endif
+
+#ifndef DRM_IOCTL_NOUVEAU_GPUOBJ_FREE
+struct drm_nouveau_gpuobj_free {
+	int      channel;
+	uint32_t handle;
+};
+#define DRM_IOCTL_NOUVEAU_GPUOBJ_FREE        DRM_IOW (DRM_COMMAND_BASE + DRM_NOUVEAU_GPUOBJ_FREE, struct drm_nouveau_gpuobj_free)
+#endif
+
 typedef struct {
 	int context;
 	unsigned long offset;
@@ -294,6 +389,13 @@ static const struct ioctl drm_ioctls[] = {
 	IOCTL(DRM_IOCTL_MGA_DMA_BOOTSTRAP),
 
 	/* nouveau_drm.h */
+	IOCTL(DRM_IOCTL_NOUVEAU_GETPARAM),
+	IOCTL(DRM_IOCTL_NOUVEAU_SETPARAM),
+	IOCTL(DRM_IOCTL_NOUVEAU_CHANNEL_ALLOC),
+	IOCTL(DRM_IOCTL_NOUVEAU_CHANNEL_FREE),
+	IOCTL(DRM_IOCTL_NOUVEAU_GROBJ_ALLOC),
+	IOCTL(DRM_IOCTL_NOUVEAU_NOTIFIEROBJ_ALLOC),
+	IOCTL(DRM_IOCTL_NOUVEAU_GPUOBJ_FREE),
 #ifdef DRM_IOCTL_NOUVEAU_GEM_NEW
 	IOCTL(DRM_IOCTL_NOUVEAU_GEM_NEW),
 #endif
-- 
1.8.1.4

  parent reply	other threads:[~2013-06-30 19:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-30 19:33 [PATCH 0/8] misc trinity patches Tommi Rantala
2013-06-30 19:33 ` [PATCH 1/8] Use TRINITY_PF_MAX instead of PF_MAX in syscalls/socket.c Tommi Rantala
2013-06-30 19:33 ` [PATCH 2/8] Fix open() result check in check_tainted() Tommi Rantala
2013-06-30 19:33 ` [PATCH 3/8] Avoid needless get_filename() calls in generate_pathname() Tommi Rantala
2013-06-30 19:33 ` [PATCH 4/8] Fix double rand() " Tommi Rantala
2013-06-30 19:33 ` [PATCH 5/8] move perf_event.h to include/ Tommi Rantala
2013-06-30 23:29   ` Dave Jones
2013-07-01 14:35     ` Tommi Rantala
2013-07-01 14:43       ` Dave Jones
2013-07-01 15:30         ` Vince Weaver
2013-06-30 19:33 ` [PATCH 6/8] msgrcv() and msgsnd() IPC_NOWAIT msgflg Tommi Rantala
2013-06-30 19:33 ` Tommi Rantala [this message]
2013-06-30 19:33 ` [PATCH 8/8] ioctls/vhost: VHOST_SCSI_* ioctls Tommi Rantala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1372620792-16384-8-git-send-email-tt.rantala@gmail.com \
    --to=tt.rantala@gmail.com \
    --cc=davej@redhat.com \
    --cc=trinity@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.