Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / char / drm / r128_drm.h
index efa13a4..5d835b0 100644 (file)
@@ -1,7 +1,7 @@
 /* r128_drm.h -- Public header for the r128 driver -*- linux-c -*-
  * Created: Wed Apr  5 19:24:19 2000 by kevin@precisioninsight.com
- *
- * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
+ */
+/* Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
  * Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California.
  * All rights reserved.
  *
@@ -93,7 +93,7 @@
 #define R128_MAX_TEXTURE_LEVELS                11
 #define R128_MAX_TEXTURE_UNITS         2
 
-#endif /* __R128_SAREA_DEFINES__ */
+#endif                         /* __R128_SAREA_DEFINES__ */
 
 typedef struct {
        /* Context state - can be written in one large chunk */
@@ -140,7 +140,6 @@ typedef struct {
        unsigned int tex_border_color;
 } drm_r128_texture_regs_t;
 
-
 typedef struct drm_r128_sarea {
        /* The channel for communication of state information to the kernel
         * on firing a vertex buffer.
@@ -161,14 +160,13 @@ typedef struct drm_r128_sarea {
        unsigned int last_frame;
        unsigned int last_dispatch;
 
-       drm_tex_region_t tex_list[R128_NR_TEX_HEAPS][R128_NR_TEX_REGIONS+1];
+       drm_tex_region_t tex_list[R128_NR_TEX_HEAPS][R128_NR_TEX_REGIONS + 1];
        unsigned int tex_age[R128_NR_TEX_HEAPS];
        int ctx_owner;
-       int pfAllowPageFlip;        /* number of 3d windows (0,1,2 or more) */
-       int pfCurrentPage;          /* which buffer is being displayed? */
+       int pfAllowPageFlip;    /* number of 3d windows (0,1,2 or more) */
+       int pfCurrentPage;      /* which buffer is being displayed? */
 } drm_r128_sarea_t;
 
-
 /* WARNING: If you change any of these defines, make sure to change the
  * defines in the Xserver file (xf86drmR128.h)
  */
@@ -176,28 +174,51 @@ typedef struct drm_r128_sarea {
 /* Rage 128 specific ioctls
  * The device specific ioctl range is 0x40 to 0x79.
  */
-#define DRM_IOCTL_R128_INIT            DRM_IOW( 0x40, drm_r128_init_t)
-#define DRM_IOCTL_R128_CCE_START       DRM_IO(  0x41)
-#define DRM_IOCTL_R128_CCE_STOP                DRM_IOW( 0x42, drm_r128_cce_stop_t)
-#define DRM_IOCTL_R128_CCE_RESET       DRM_IO(  0x43)
-#define DRM_IOCTL_R128_CCE_IDLE                DRM_IO(  0x44)
-#define DRM_IOCTL_R128_RESET           DRM_IO(  0x46)
-#define DRM_IOCTL_R128_SWAP            DRM_IO(  0x47)
-#define DRM_IOCTL_R128_CLEAR           DRM_IOW( 0x48, drm_r128_clear_t)
-#define DRM_IOCTL_R128_VERTEX          DRM_IOW( 0x49, drm_r128_vertex_t)
-#define DRM_IOCTL_R128_INDICES         DRM_IOW( 0x4a, drm_r128_indices_t)
-#define DRM_IOCTL_R128_BLIT            DRM_IOW( 0x4b, drm_r128_blit_t)
-#define DRM_IOCTL_R128_DEPTH           DRM_IOW( 0x4c, drm_r128_depth_t)
-#define DRM_IOCTL_R128_STIPPLE         DRM_IOW( 0x4d, drm_r128_stipple_t)
-#define DRM_IOCTL_R128_INDIRECT                DRM_IOWR(0x4f, drm_r128_indirect_t)
-#define DRM_IOCTL_R128_FULLSCREEN      DRM_IOW( 0x50, drm_r128_fullscreen_t)
-#define DRM_IOCTL_R128_CLEAR2          DRM_IOW( 0x51, drm_r128_clear2_t)
-#define DRM_IOCTL_R128_GETPARAM                DRM_IOW( 0x52, drm_r128_getparam_t)
-#define DRM_IOCTL_R128_FLIP            DRM_IO(  0x53)
+#define DRM_R128_INIT       0x00
+#define DRM_R128_CCE_START  0x01
+#define DRM_R128_CCE_STOP   0x02
+#define DRM_R128_CCE_RESET  0x03
+#define DRM_R128_CCE_IDLE   0x04
+/* 0x05 not used */
+#define DRM_R128_RESET      0x06
+#define DRM_R128_SWAP       0x07
+#define DRM_R128_CLEAR      0x08
+#define DRM_R128_VERTEX     0x09
+#define DRM_R128_INDICES    0x0a
+#define DRM_R128_BLIT       0x0b
+#define DRM_R128_DEPTH      0x0c
+#define DRM_R128_STIPPLE    0x0d
+/* 0x0e not used */
+#define DRM_R128_INDIRECT   0x0f
+#define DRM_R128_FULLSCREEN 0x10
+#define DRM_R128_CLEAR2     0x11
+#define DRM_R128_GETPARAM   0x12
+#define DRM_R128_FLIP       0x13
+
+#define DRM_IOCTL_R128_INIT       DRM_IOW( DRM_COMMAND_BASE + DRM_R128_INIT, drm_r128_init_t)
+#define DRM_IOCTL_R128_CCE_START  DRM_IO(  DRM_COMMAND_BASE + DRM_R128_CCE_START)
+#define DRM_IOCTL_R128_CCE_STOP   DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CCE_STOP, drm_r128_cce_stop_t)
+#define DRM_IOCTL_R128_CCE_RESET  DRM_IO(  DRM_COMMAND_BASE + DRM_R128_CCE_RESET)
+#define DRM_IOCTL_R128_CCE_IDLE   DRM_IO(  DRM_COMMAND_BASE + DRM_R128_CCE_IDLE)
+/* 0x05 not used */
+#define DRM_IOCTL_R128_RESET      DRM_IO(  DRM_COMMAND_BASE + DRM_R128_RESET)
+#define DRM_IOCTL_R128_SWAP       DRM_IO(  DRM_COMMAND_BASE + DRM_R128_SWAP)
+#define DRM_IOCTL_R128_CLEAR      DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CLEAR, drm_r128_clear_t)
+#define DRM_IOCTL_R128_VERTEX     DRM_IOW( DRM_COMMAND_BASE + DRM_R128_VERTEX, drm_r128_vertex_t)
+#define DRM_IOCTL_R128_INDICES    DRM_IOW( DRM_COMMAND_BASE + DRM_R128_INDICES, drm_r128_indices_t)
+#define DRM_IOCTL_R128_BLIT       DRM_IOW( DRM_COMMAND_BASE + DRM_R128_BLIT, drm_r128_blit_t)
+#define DRM_IOCTL_R128_DEPTH      DRM_IOW( DRM_COMMAND_BASE + DRM_R128_DEPTH, drm_r128_depth_t)
+#define DRM_IOCTL_R128_STIPPLE    DRM_IOW( DRM_COMMAND_BASE + DRM_R128_STIPPLE, drm_r128_stipple_t)
+/* 0x0e not used */
+#define DRM_IOCTL_R128_INDIRECT   DRM_IOWR(DRM_COMMAND_BASE + DRM_R128_INDIRECT, drm_r128_indirect_t)
+#define DRM_IOCTL_R128_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_R128_FULLSCREEN, drm_r128_fullscreen_t)
+#define DRM_IOCTL_R128_CLEAR2     DRM_IOW( DRM_COMMAND_BASE + DRM_R128_CLEAR2, drm_r128_clear2_t)
+#define DRM_IOCTL_R128_GETPARAM   DRM_IOWR( DRM_COMMAND_BASE + DRM_R128_GETPARAM, drm_r128_getparam_t)
+#define DRM_IOCTL_R128_FLIP       DRM_IO(  DRM_COMMAND_BASE + DRM_R128_FLIP)
 
 typedef struct drm_r128_init {
        enum {
-               R128_INIT_CCE    = 0x01,
+               R128_INIT_CCE = 0x01,
                R128_CLEANUP_CCE = 0x02
        } func;
 #if CONFIG_XFREE86_VERSION < XFREE86_VERSION(4,1,0,0)
@@ -255,9 +276,9 @@ typedef struct drm_r128_clear {
 
 typedef struct drm_r128_vertex {
        int prim;
-       int idx;                        /* Index of vertex buffer */
-       int count;                      /* Number of vertices in buffer */
-       int discard;                    /* Client finished with buffer? */
+       int idx;                /* Index of vertex buffer */
+       int count;              /* Number of vertices in buffer */
+       int discard;            /* Client finished with buffer? */
 } drm_r128_vertex_t;
 
 typedef struct drm_r128_indices {
@@ -265,7 +286,7 @@ typedef struct drm_r128_indices {
        int idx;
        int start;
        int end;
-       int discard;                    /* Client finished with buffer? */
+       int discard;            /* Client finished with buffer? */
 } drm_r128_indices_t;
 
 typedef struct drm_r128_blit {
@@ -279,20 +300,20 @@ typedef struct drm_r128_blit {
 
 typedef struct drm_r128_depth {
        enum {
-               R128_WRITE_SPAN         = 0x01,
-               R128_WRITE_PIXELS       = 0x02,
-               R128_READ_SPAN          = 0x03,
-               R128_READ_PIXELS        = 0x04
+               R128_WRITE_SPAN = 0x01,
+               R128_WRITE_PIXELS = 0x02,
+               R128_READ_SPAN = 0x03,
+               R128_READ_PIXELS = 0x04
        } func;
        int n;
-       int *x;
-       int *y;
-       unsigned int *buffer;
-       unsigned char *mask;
+       int __user *x;
+       int __user *y;
+       unsigned int __user *buffer;
+       unsigned char __user *mask;
 } drm_r128_depth_t;
 
 typedef struct drm_r128_stipple {
-       unsigned int *mask;
+       unsigned int __user *mask;
 } drm_r128_stipple_t;
 
 typedef struct drm_r128_indirect {
@@ -304,19 +325,19 @@ typedef struct drm_r128_indirect {
 
 typedef struct drm_r128_fullscreen {
        enum {
-               R128_INIT_FULLSCREEN    = 0x01,
+               R128_INIT_FULLSCREEN = 0x01,
                R128_CLEANUP_FULLSCREEN = 0x02
        } func;
 } drm_r128_fullscreen_t;
 
 /* 2.3: An ioctl to get parameters that aren't available to the 3d
- * client any other way.  
+ * client any other way.
  */
 #define R128_PARAM_IRQ_NR            1
 
 typedef struct drm_r128_getparam {
        int param;
-       int *value;
+       void __user *value;
 } drm_r128_getparam_t;
 
 #endif