[prev in list] [next in list] [prev in thread] [next in thread] 

List:       dri-patches
Subject:    drm: Branch 'nouveau-1'
From:       darktama () kemper ! freedesktop ! org (Ben Skeggs)
Date:       2006-08-30 6:55:20
Message-ID: 20060830065520.5E17310078 () kemper ! freedesktop ! org
[Download RAW message or body]

 shared-core/nouveau_drm.h   |   14 ++++++++++++++
 shared-core/nouveau_drv.h   |    2 ++
 shared-core/nouveau_fifo.c  |    2 ++
 shared-core/nouveau_state.c |   36 ++++++++++++++++++++++++++++++++++++
 4 files changed, 54 insertions(+)

New commits:
diff-tree 24dddc27549f2b8cf837305ee84dd1ca97df98e7 (from 3cfab681b3c82c7951f1cc337d2021a6f0d08b1e)
Author: Ben Skeggs <darktama@iinet.net.au>
Date:   Wed Aug 30 16:55:02 2006 +1000

    Add stub {get,set}param ioctls.

diff --git a/shared-core/nouveau_drm.h b/shared-core/nouveau_drm.h
index eab8ca2..76fb3a1 100644
--- a/shared-core/nouveau_drm.h
+++ b/shared-core/nouveau_drm.h
@@ -79,6 +79,18 @@ typedef struct drm_nouveau_mem_free {
 }
 drm_nouveau_mem_free_t;
 
+typedef struct drm_nouveau_getparam {
+	unsigned int param;
+	unsigned int value;
+}
+drm_nouveau_getparam_t;
+
+typedef struct drm_nouveau_setparam {
+	unsigned int param;
+	unsigned int value;
+}
+drm_nouveau_setparam_t;
+
 enum nouveau_card_type {
 	NV_UNKNOWN =0,
 	NV_01      =1,
@@ -114,6 +126,8 @@ drm_nouveau_sarea_t;
 #define DRM_NOUVEAU_DMA_OBJECT_INIT 0x03 // We don't want this eventually..
 #define DRM_NOUVEAU_MEM_ALLOC       0x04
 #define DRM_NOUVEAU_MEM_FREE        0x05
+#define DRM_NOUVEAU_GETPARAM        0x06
+#define DRM_NOUVEAU_SETPARAM        0x07
 
 #endif /* __NOUVEAU_DRM_H__ */
 
diff --git a/shared-core/nouveau_drv.h b/shared-core/nouveau_drv.h
index c4f9718..d701401 100644
--- a/shared-core/nouveau_drv.h
+++ b/shared-core/nouveau_drv.h
@@ -131,6 +131,8 @@ extern void nouveau_preclose(drm_device_
 extern int nouveau_load(struct drm_device *dev, unsigned long flags);
 extern int nouveau_firstopen(struct drm_device *dev);
 extern int nouveau_unload(struct drm_device *dev);
+extern int nouveau_ioctl_getparam(DRM_IOCTL_ARGS);
+extern int nouveau_ioctl_setparam(DRM_IOCTL_ARGS);
 
 /* nouveau_mem.c */
 extern uint64_t          nouveau_mem_fb_amount(struct drm_device *dev);
diff --git a/shared-core/nouveau_fifo.c b/shared-core/nouveau_fifo.c
index 18ad7c5..c0d54b3 100644
--- a/shared-core/nouveau_fifo.c
+++ b/shared-core/nouveau_fifo.c
@@ -263,6 +263,8 @@ drm_ioctl_desc_t nouveau_ioctls[] = {
 	[DRM_IOCTL_NR(DRM_NOUVEAU_DMA_OBJECT_INIT)] = {nouveau_ioctl_dma_object_init, DRM_AUTH},
 	[DRM_IOCTL_NR(DRM_NOUVEAU_MEM_ALLOC)] = {nouveau_ioctl_mem_alloc, DRM_AUTH},
 	[DRM_IOCTL_NR(DRM_NOUVEAU_MEM_FREE)] = {nouveau_ioctl_mem_free, DRM_AUTH},
+	[DRM_IOCTL_NR(DRM_NOUVEAU_GETPARAM)] = {nouveau_ioctl_getparam, DRM_AUTH},
+	[DRM_IOCTL_NR(DRM_NOUVEAU_SETPARAM)] = {nouveau_ioctl_setparam, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY},	
 };
 
 int nouveau_max_ioctl = DRM_ARRAY_SIZE(nouveau_ioctls);
diff --git a/shared-core/nouveau_state.c b/shared-core/nouveau_state.c
index 3bfa99c..01ebbc8 100644
--- a/shared-core/nouveau_state.c
+++ b/shared-core/nouveau_state.c
@@ -132,3 +132,39 @@ int nouveau_unload(struct drm_device *de
 	return 0;
 }
 
+int nouveau_ioctl_getparam(DRM_IOCTL_ARGS)
+{
+	DRM_DEVICE;
+	drm_nouveau_getparam_t getparam;
+
+	DRM_COPY_FROM_USER_IOCTL(getparam, (drm_nouveau_getparam_t __user *)data,
+			sizeof(getparam));
+
+	switch (getparam.param) {
+	default:
+		DRM_ERROR("unknown parameter %d\n", getparam.param);
+		return DRM_ERR(EINVAL);
+	}
+
+	DRM_COPY_TO_USER_IOCTL((drm_nouveau_getparam_t __user *)data, getparam,
+			sizeof(getparam));
+	return 0;
+}
+
+int nouveau_ioctl_setparam(DRM_IOCTL_ARGS)
+{
+	DRM_DEVICE;
+	drm_nouveau_setparam_t setparam;
+
+	DRM_COPY_FROM_USER_IOCTL(setparam, (drm_nouveau_setparam_t __user *)data,
+			sizeof(setparam));
+
+	switch (setparam.param) {
+	default:
+		DRM_ERROR("unknown parameter %d\n", setparam.param);
+		return DRM_ERR(EINVAL);
+	}
+
+	return 0;
+}
+

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
--
_______________________________________________
Dri-patches mailing list
Dri-patches@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-patches
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic