David, Alan, Jeff and Kevin,

I understand you would prefer a class of modules that are both HW
specific and OS specific.  Currently, the number of OS's supporting the
DRM is 2; and the number of OS's the IHV's care about is 1 (linux x86 to
be specific).  So, there is no short term problem with persuing your
model of having an extra module for each HW and OS combination.

It is the long term I'm concerned about.  If XFree86 aspires to have
good 3D support for more than just one or two OS's, then an extra module
for each HW and OS combination becomes a problem.

David Dawes wrote:
> The XFree86 video driver module
> contains HW dependencies, but should have no OS dependencies.

This fundamental design decision is an important one.  Today, 2D support
on a given processor platform can achieve support for hundreds of
combinations of HW and OS's with a relatively small set of HW specific
DDX modules and OS specific X servers.  For example, the x86 processor
has at least 20 unique DDX driver modules and 15 unique OS specific X
servers which enable it to support over 300 combinations of HW and OS. 
If you allowed OS dependencies in the DDX driver module, you would need
to support 300 unique DDX driver modules instead of just 20.  The
concept of keeping OS specifics and HW specifics seperate is a very
powerful one indeed.  I encourage you to factor that into the long term
health of 3D support within XFree86.

The drmCommand approach allows OS specifics and HW specifics to be
seperated and follows the excellent principle set by the 2D DDX driver. 
I have completely removed the Linux specifics from the drmCommand
interface.  Attached is my latest patch against the tcl-0-0-branch. 
Please let me know if you see any OS portability limitations in this
current interface.  If you see any portability limitations that can't be
fixed, I'll fall back and implement the 300+ combined HW and OS specific
sub module approach.

Regards,
Jens

--                             /\
         Jens Owen            /  \/\ _    
  [EMAIL PROTECTED]  /    \ \ \   Steamboat Springs, Colorado
Index: programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c,v
retrieving revision 1.21.2.3
diff -u -r1.21.2.3 radeon_dri.c
--- programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c        25 Mar 2002 10:35:48 
-0000      1.21.2.3
+++ programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c        28 Mar 2002 21:14:34 
+-0000
@@ -963,6 +963,9 @@
     int           cpp         = info->CurrentLayout.pixel_bytes;
     drmRadeonInit drmInfo;
 
+    memset( &drmInfo, 0, sizeof(drmRadeonInit) );
+
+    drmInfo.func                = DRM_RADEON_INIT_CP;
     drmInfo.sarea_priv_offset   = sizeof(XF86DRISAREARec);
     drmInfo.is_pci              = info->IsPCI;
     drmInfo.cp_mode             = info->CPMode;
@@ -987,7 +990,9 @@
     drmInfo.buffers_offset      = info->bufHandle;
     drmInfo.agp_textures_offset = info->agpTexHandle;
 
-    if (drmRadeonInitCP(info->drmFD, &drmInfo) < 0) return FALSE;
+    if (drmCommandWrite(info->drmFD, DRM_RADEON_CP_INIT,
+                       &drmInfo, sizeof(drmRadeonInit)) < 0)
+       return FALSE;
 
     /* drmRadeonInitCP does an engine reset, which resets some engine
        registers back to their default values, so we need to restore
Index: programs/Xserver/hw/xfree86/os-support/xf86drm.h
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h,v
retrieving revision 1.20.8.1
diff -u -r1.20.8.1 xf86drm.h
--- programs/Xserver/hw/xfree86/os-support/xf86drm.h    20 Feb 2002 05:45:03 -0000     
 1.20.8.1
+++ programs/Xserver/hw/xfree86/os-support/xf86drm.h    28 Mar 2002 21:14:52 -0000
@@ -445,7 +445,13 @@
                                  int *uid, unsigned long *magic,
                                  unsigned long *iocs);
 extern int           drmGetStats(int fd, drmStatsT *stats);
-
+extern int           drmCommandNone(int fd, unsigned long drmCommandIndex);
+extern int           drmCommandRead(int fd, unsigned long drmCommandIndex,
+                                   void *data, unsigned long size);
+extern int           drmCommandWrite(int fd, unsigned long drmCommandIndex,
+                                    void *data, unsigned long size);
+extern int           drmCommandWriteRead(int fd, unsigned long drmCommandIndex,
+                                        void *data, unsigned long size);
 
 /* General user-level programmer's API: X server (root) only  */
 extern void          drmFreeBusid(const char *busid);
Index: programs/Xserver/hw/xfree86/os-support/xf86drmRadeon.h
===================================================================
RCS file: /cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/xf86drmRadeon.h,v
retrieving revision 1.10.2.3
diff -u -r1.10.2.3 xf86drmRadeon.h
--- programs/Xserver/hw/xfree86/os-support/xf86drmRadeon.h      25 Mar 2002 10:30:41 
-0000      1.10.2.3
+++ programs/Xserver/hw/xfree86/os-support/xf86drmRadeon.h      28 Mar 2002 21:14:52 
+-0000
@@ -1,4 +1,4 @@
-/* xf86drmRadeon.h -- OS-independent header for Radeon DRM user-level
+
  *                    library interface
  *
  * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
@@ -39,14 +39,40 @@
  * the kernel include file as well (radeon_drm.h)
  */
 
+/* Driver specific DRM command indices
+ * NOTE: these are not OS specific, but they are driver specific
+ */
+#define DRM_RADEON_CP_INIT                0x00
+#define DRM_RADEON_CP_START               0x01
+#define DRM_RADEON_CP_STOP                0x02
+#define DRM_RADEON_CP_RESET               0x03
+#define DRM_RADEON_CP_IDLE                0x04
+#define DRM_RADEON_RESET                  0x05
+#define DRM_RADEON_FULLSCREEN             0x06
+#define DRM_RADEON_SWAP                   0x07
+#define DRM_RADEON_CLEAR                  0x08
+#define DRM_RADEON_VERTEX                 0x09
+#define DRM_RADEON_INDICES                0x0a
+#define DRM_RADEON_STIPPLE                0x0c
+#define DRM_RADEON_INDIRECT               0x0d
+#define DRM_RADEON_TEXTURE                0x0e
+#define DRM_RADEON_VERTEX2                0x0f
+#define DRM_RADEON_CMDBUF                 0x10
+#define DRM_RADEON_GETPARAM               0x11
+#define DRM_RADEON_MAX_DRM_COMMAND_INDEX  0x39
+
+
 #define RADEON_FRONT   0x1
 #define RADEON_BACK    0x2
 #define RADEON_DEPTH   0x4
 #define RADEON_STENCIL 0x8
 
 
-
 typedef struct {
+   enum {
+      DRM_RADEON_INIT_CP    = 0x01,
+      DRM_RADEON_CLEANUP_CP = 0x02
+   } func;
    unsigned long sarea_priv_offset;
    int is_pci;
    int cp_mode;
@@ -214,7 +240,6 @@
 } drmRadeonCmdHeader;
 
 
-extern int drmRadeonInitCP( int fd, drmRadeonInit *info );
 extern int drmRadeonCleanupCP( int fd );
 
 extern int drmRadeonStartCP( int fd );
Index: programs/Xserver/hw/xfree86/os-support/linux/drm/Imakefile
===================================================================
RCS file: 
/cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/Imakefile,v
retrieving revision 1.12
diff -u -r1.12 Imakefile
--- programs/Xserver/hw/xfree86/os-support/linux/drm/Imakefile  14 Feb 2002 02:00:21 
-0000      1.12
+++ programs/Xserver/hw/xfree86/os-support/linux/drm/Imakefile  28 Mar 2002 21:14:54 
+-0000
@@ -17,6 +17,7 @@
        xf86drmHash.c \
        xf86drmRandom.c \
        xf86drmSL.c \
+       xf86drmCompat.c \
        xf86drmI810.c \
        xf86drmMga.c \
        xf86drmR128.c \
@@ -30,6 +31,7 @@
        xf86drmHash.o \
        xf86drmRandom.o \
        xf86drmSL.o \
+       xf86drmCompat.o \
        xf86drmI810.o \
        xf86drmMga.o \
        xf86drmR128.o \
Index: programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c
===================================================================
RCS file: 
/cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v
retrieving revision 1.34
diff -u -r1.34 xf86drm.c
--- programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c  27 Jan 2002 20:05:41 
-0000      1.34
+++ programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c  28 Mar 2002 21:14:56 
+-0000
@@ -1407,4 +1407,44 @@
 
     return xf86RemoveSIGIOHandler(fd);
 }
+
+int drmCommandNone(int fd, unsigned long drmCommandIndex)
+{
+  void *data = NULL; /* dummy */
+  unsigned long request;
+
+  request = DRM_IO( DRM_COMMAND_BASE + drmCommandIndex);
+
+  return ioctl(fd, request, data);
+}
+
+int drmCommandRead(int fd, unsigned long drmCommandIndex,
+                   void *data, unsigned long size )
+{
+  unsigned long request;
+
+  request = DRM_IOR( DRM_COMMAND_BASE + drmCommandIndex, size);
+
+  return ioctl(fd, request, data);
+}
+
+int drmCommandWrite(int fd, unsigned long drmCommandIndex,
+                   void *data, unsigned long size )
+{
+  unsigned long request;
+
+  request = DRM_IOW( DRM_COMMAND_BASE + drmCommandIndex, size);
+
+  return ioctl(fd, request, data);
+}
+
+int drmCommandWriteRead(int fd, unsigned long drmCommandIndex,
+                   void *data, unsigned long size )
+{
+  unsigned long request;
+
+  request = DRM_IOWR( DRM_COMMAND_BASE + drmCommandIndex, size);
+
+  return ioctl(fd, request, data);
+}
 #endif
Index: programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmRadeon.c
===================================================================
RCS file: 
/cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmRadeon.c,v
retrieving revision 1.11.2.2
diff -u -r1.11.2.2 xf86drmRadeon.c
--- programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmRadeon.c    25 Mar 2002 
10:30:41 -0000      1.11.2.2
+++ programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmRadeon.c    28 Mar 2002 
+21:14:56 -0000
@@ -78,45 +78,6 @@
 #define RADEON_BUFFER_RETRY    32
 #define RADEON_IDLE_RETRY      16
 
-
-int drmRadeonInitCP( int fd, drmRadeonInit *info )
-{
-   drm_radeon_init_t init;
-
-   memset( &init, 0, sizeof(drm_radeon_init_t) );
-
-   init.func                   = RADEON_INIT_CP;
-   init.sarea_priv_offset      = info->sarea_priv_offset;
-   init.is_pci                 = info->is_pci;
-   init.cp_mode                        = info->cp_mode;
-   init.agp_size               = info->agp_size;
-   init.ring_size              = info->ring_size;
-   init.usec_timeout           = info->usec_timeout;
-
-   init.fb_bpp                 = info->fb_bpp;
-   init.front_offset           = info->front_offset;
-   init.front_pitch            = info->front_pitch;
-   init.back_offset            = info->back_offset;
-   init.back_pitch             = info->back_pitch;
-
-   init.depth_bpp              = info->depth_bpp;
-   init.depth_offset           = info->depth_offset;
-   init.depth_pitch            = info->depth_pitch;
-
-   init.fb_offset              = info->fb_offset;
-   init.mmio_offset            = info->mmio_offset;
-   init.ring_offset            = info->ring_offset;
-   init.ring_rptr_offset       = info->ring_rptr_offset;
-   init.buffers_offset         = info->buffers_offset;
-   init.agp_textures_offset    = info->agp_textures_offset;
-
-   if ( ioctl( fd, DRM_IOCTL_RADEON_CP_INIT, &init ) ) {
-      return -errno;
-   } else {
-      return 0;
-   }
-}
-
 int drmRadeonCleanupCP( int fd )
 {
    drm_radeon_init_t init;
Index: programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h
===================================================================
RCS file: 
/cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h,v
retrieving revision 1.35.2.2
diff -u -r1.35.2.2 drm.h
--- programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h       25 Mar 2002 
10:29:12 -0000      1.35.2.2
+++ programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/drm.h       28 Mar 2002 
+21:14:58 -0000
@@ -428,6 +428,14 @@
 #define DRM_IOCTL_SG_ALLOC             DRM_IOW( 0x38, drm_scatter_gather_t)
 #define DRM_IOCTL_SG_FREE              DRM_IOW( 0x39, drm_scatter_gather_t)
 
+/* Device specfic ioctls should only be in their respective headers,
+ * however, a few device specific ioctls defined before XFree86 4.3
+ * are left here to preserve compatability.  Do not add new device
+ * specific ioctls here.
+ *
+ * The device specific ioctl range is 0x40 to 0x79.                  */
+#define DRM_COMMAND_BASE               0x40
+
 /* MGA specific ioctls */
 #define DRM_IOCTL_MGA_INIT             DRM_IOW( 0x40, drm_mga_init_t)
 #define DRM_IOCTL_MGA_FLUSH            DRM_IOW( 0x41, drm_lock_t)
@@ -475,7 +483,7 @@
 #define DRM_IOCTL_R128_CLEAR2          DRM_IOW( 0x51, drm_r128_clear2_t)
 
 /* Radeon specific ioctls */
-#define DRM_IOCTL_RADEON_CP_INIT       DRM_IOW( 0x40, drm_radeon_init_t)
+#define DRM_COMPAT_IOCTL_RADEON_CP_INIT        DRM_IOW( 0x40, drm_radeon_init_t)
 #define DRM_IOCTL_RADEON_CP_START      DRM_IO(  0x41)
 #define DRM_IOCTL_RADEON_CP_STOP       DRM_IOW( 0x42, drm_radeon_cp_stop_t)
 #define DRM_IOCTL_RADEON_CP_RESET      DRM_IO(  0x43)
Index: programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drm.h
===================================================================
RCS file: 
/cvsroot/dri/xc/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drm.h,v
retrieving revision 1.9.2.4
diff -u -r1.9.2.4 radeon_drm.h
--- programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drm.h        25 Mar 
2002 10:29:12 -0000      1.9.2.4
+++ programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/radeon_drm.h        28 Mar 
+2002 21:15:00 -0000
@@ -299,6 +299,9 @@
  *
  * KW: actually it's illegal to change any of this (backwards compatibility).
  */
+
+#define DRM_IOCTL_RADEON_CP_INIT       DRM_IOW( 0x40, drm_radeon_init_t)
+
 typedef struct drm_radeon_init {
        enum {
                RADEON_INIT_CP    = 0x01,
Index: programs/Xserver/hw/xfree86/os-support/linux/xf86drmCompat.h
===================================================================
--- /dev/null   Thu Aug 30 14:30:55 2001
+++ programs/Xserver/hw/xfree86/os-support/linux/xf86drmCompat.h        Thu Mar 28 
+08:23:29 2002
@@ -0,0 +1,81 @@
+/* xf86drmCompat.h -- OS-independent header for old device specific DRM user-level
+ *                    library interface
+ *
+ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
+ * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * 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
+ * PRECISION INSIGHT 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.
+ *
+ * Authors:
+ *   Gareth Hughes <[EMAIL PROTECTED]>
+ *   Kevin E. Martin <[EMAIL PROTECTED]>
+ *   Keith Whitwell <[EMAIL PROTECTED]>
+ *
+ * Backwards compatability modules broken out by:
+ *   Jens Owen <[EMAIL PROTECTED]>
+ *
+ * $XFree86: xc/programs/Xserver/hw/xfree86/os-support/xf86drmRadeon.h,v 1.6 
+2001/04/16 15:02:13 tsi Exp $
+ *
+ */
+
+#ifndef _XF86DRI_COMPAT_H_
+#define _XF86DRI_COMPAT_H_
+
+/* WARNING: Do not change, or add, anything to this file.  It is only provided
+ * for backwards compatability with the old driver specific DRM extensions
+ * found in XFree86 4.0, 4.1 and 4.2.
+ */
+
+/* Driver escape indices */
+#define DRM_ESC_RADEON_CP_INIT         0x00
+#define DRM_ESC_RADEON_MAX_INDEX       0x39 /* range defined in drm.h */
+
+typedef struct {
+   unsigned long sarea_priv_offset;
+   int is_pci;
+   int cp_mode;
+   int agp_size;
+   int ring_size;
+   int usec_timeout;
+
+   unsigned int fb_bpp;
+   unsigned int front_offset, front_pitch;
+   unsigned int back_offset, back_pitch;
+   unsigned int depth_bpp;
+   unsigned int depth_offset, depth_pitch;
+
+   unsigned long fb_offset;
+   unsigned long mmio_offset;
+   unsigned long ring_offset;
+   unsigned long ring_rptr_offset;
+   unsigned long buffers_offset;
+   unsigned long agp_textures_offset;
+} drmCompatRadeonInit;
+
+
+extern int drmRadeonInitCP( int fd, drmCompatRadeonInit *info );
+
+#endif
+
+/* WARNING: Do not change, or add, anything to this file.  It is only provided
+ * for backwards compatability with the old driver specific DRM extensions
+ * found in XFree86 4.0, 4.1 and 4.2.
+ */
Index: programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmCompat.c
===================================================================
--- /dev/null   Thu Aug 30 14:30:55 2001
+++ programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drmCompat.c    Thu Mar 28 
+08:21:26 2002
@@ -0,0 +1,126 @@
+/* xf86drmCompat.c -- User-level interface to old DRM devices
+ *
+ * Copyright 2000 VA Linx Systems, Inc., Fremont, California.
+ * Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * 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
+ * PRECISION INSIGHT 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.
+ *
+ * Original Authors:
+ *   Gareth Hughes <[EMAIL PROTECTED]>
+ *   Kevin E. Martin <[EMAIL PROTECTED]>
+ *
+ * Backwards compatability modules broken out by:
+ *   Jens Owen <[EMAIL PROTECTED]>
+ *
+ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v 1.4 
+2001/08/27 17:40:59 dawes Exp $ */
+
+#ifdef XFree86Server
+# include "xf86.h"
+# include "xf86_OSproc.h"
+# include "xf86_ansic.h"
+# define _DRM_MALLOC xalloc
+# define _DRM_FREE   xfree
+# ifndef XFree86LOADER
+#  include <sys/mman.h>
+# endif
+#else
+# include <stdio.h>
+# include <stdlib.h>
+# include <unistd.h>
+# include <string.h>
+# include <ctype.h>
+# include <fcntl.h>
+# include <errno.h>
+# include <signal.h>
+# include <sys/types.h>
+# include <sys/ioctl.h>
+# include <sys/mman.h>
+# include <sys/time.h>
+# ifdef DRM_USE_MALLOC
+#  define _DRM_MALLOC malloc
+#  define _DRM_FREE   free
+extern int xf86InstallSIGIOHandler(int fd, void (*f)(int, void *), void *);
+extern int xf86RemoveSIGIOHandler(int fd);
+# else
+#  include <X11/Xlibint.h>
+#  define _DRM_MALLOC Xmalloc
+#  define _DRM_FREE   Xfree
+# endif
+#endif
+
+/* Not all systems have MAP_FAILED defined */
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
+#ifdef __linux__
+#include <sys/sysmacros.h>     /* for makedev() */
+#endif
+#include "xf86drm.h"
+#include "xf86drmCompat.h"
+#include "drm.h"
+
+
+/* WARNING: Do not change, or add, anything to this file.  It is only provided
+ * for backwards compatability with the old driver specific DRM extensions
+ * found in XFree86 4.0, 4.1 and 4.2.
+ */
+
+
+int drmRadeonInitCP( int fd, drmCompatRadeonInit *info )
+{
+   drm_radeon_init_t init;
+
+   memset( &init, 0, sizeof(drm_radeon_init_t) );
+
+   init.func                   = RADEON_INIT_CP;
+   init.sarea_priv_offset      = info->sarea_priv_offset;
+   init.is_pci                 = info->is_pci;
+   init.cp_mode                        = info->cp_mode;
+   init.agp_size               = info->agp_size;
+   init.ring_size              = info->ring_size;
+   init.usec_timeout           = info->usec_timeout;
+
+   init.fb_bpp                 = info->fb_bpp;
+   init.front_offset           = info->front_offset;
+   init.front_pitch            = info->front_pitch;
+   init.back_offset            = info->back_offset;
+   init.back_pitch             = info->back_pitch;
+
+   init.depth_bpp              = info->depth_bpp;
+   init.depth_offset           = info->depth_offset;
+   init.depth_pitch            = info->depth_pitch;
+
+   init.fb_offset              = info->fb_offset;
+   init.mmio_offset            = info->mmio_offset;
+   init.ring_offset            = info->ring_offset;
+   init.ring_rptr_offset       = info->ring_rptr_offset;
+   init.buffers_offset         = info->buffers_offset;
+   init.agp_textures_offset    = info->agp_textures_offset;
+
+   if ( ioctl( fd, DRM_IOCTL_RADEON_CP_INIT, &init ) ) {
+      return -errno;
+   } else {
+      return 0;
+   }
+}
+

Reply via email to