diff options
author | Ben Skeggs <darktama@iinet.net.au> | 2006-08-30 16:55:02 +1000 |
---|---|---|
committer | Ben Skeggs <darktama@iinet.net.au> | 2006-08-30 16:55:02 +1000 |
commit | 24dddc27549f2b8cf837305ee84dd1ca97df98e7 (patch) | |
tree | 217068e76b95b3d71306d9b8b0c18858348b5094 | |
parent | 3cfab681b3c82c7951f1cc337d2021a6f0d08b1e (diff) |
Add stub {get,set}param ioctls.
-rw-r--r-- | shared-core/nouveau_drm.h | 14 | ||||
-rw-r--r-- | shared-core/nouveau_drv.h | 2 | ||||
-rw-r--r-- | shared-core/nouveau_fifo.c | 2 | ||||
-rw-r--r-- | shared-core/nouveau_state.c | 36 |
4 files changed, 54 insertions, 0 deletions
diff --git a/shared-core/nouveau_drm.h b/shared-core/nouveau_drm.h index eab8ca29..76fb3a17 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 c4f9718d..d7014017 100644 --- a/shared-core/nouveau_drv.h +++ b/shared-core/nouveau_drv.h @@ -131,6 +131,8 @@ extern void nouveau_preclose(drm_device_t * dev, DRMFILE filp); 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 18ad7c5f..c0d54b33 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 3bfa99ca..01ebbc8f 100644 --- a/shared-core/nouveau_state.c +++ b/shared-core/nouveau_state.c @@ -132,3 +132,39 @@ int nouveau_unload(struct drm_device *dev) 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; +} + |