2 * Linux Rendering Resource Manager
4 * Implements the SGI-compatible rendering resource manager.
5 * This takes care of implementing the virtualized video hardware
6 * access required for OpenGL direct rendering.
8 * Author: Miguel de Icaza (miguel@nuclecu.unam.mx)
12 #include <asm/uaccess.h>
16 #include <linux/module.h>
20 rrm_open_rn (int rnid
, void *arg
)
26 rrm_close_rn (int rnid
, void *arg
)
32 rrm_bind_proc_to_rn (int rnid
, void *arg
)
37 typedef int (*rrm_function
)(void *arg
);
40 int (*r_fn
)(int rnid
, void *arg
);
42 } rrm_functions
[] = {
43 { rrm_open_rn
, sizeof (struct RRM_OpenRN
) },
44 { rrm_close_rn
, sizeof (struct RRM_CloseRN
) },
45 { rrm_bind_proc_to_rn
, sizeof (struct RRM_BindProcToRN
) }
48 #define RRM_FUNCTIONS (sizeof (rrm_functions)/sizeof (rrm_functions [0]))
50 /* cmd is a number in the range [0..RRM_CMD_LIMIT-RRM_BASE] */
52 rrm_command (unsigned int cmd
, void *arg
)
56 if (cmd
> RRM_FUNCTIONS
){
57 printk ("Called unimplemented rrm ioctl: %d\n", cmd
+ RRM_BASE
);
60 i
= verify_area (VERIFY_READ
, arg
, rrm_functions
[cmd
].arg_size
);
63 if (__get_user (rnid
, (int *) arg
))
65 return (*(rrm_functions
[cmd
].r_fn
))(rnid
, arg
);
69 rrm_close (struct inode
*inode
, struct file
*file
)
71 /* This routine is invoked when the device is closed */