? extras/drm/diff.Makefile ? extras/drm/diff.ati_pcigart ? extras/drm/diff.drm_drv ? extras/drm/done Index: extras/Mesa/src/glx/mini/xf86drm.c =================================================================== RCS file: /home/eich/cvs/xc/extras/Mesa/src/glx/mini/xf86drm.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/Mesa/src/glx/mini/xf86drm.c 6 Jul 2004 15:08:53 -0000 1.1.1.1 +++ extras/Mesa/src/glx/mini/xf86drm.c 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -642,7 +642,7 @@ * the arguments in a drm_map structure. */ int drmAddMap(int fd, - drmHandle offset, + drm_handle_t offset, drmSize size, drmMapType type, drmMapFlags flags, @@ -656,7 +656,7 @@ map.type = type; map.flags = flags; if (ioctl(fd, DRM_IOCTL_ADD_MAP, &map)) return -errno; - if (handle) *handle = (drmHandle)map.handle; + if (handle) *handle = (drmHandle)map.shandle; return 0; } @@ -1094,7 +1094,7 @@ * arguments in a drm_agp_buffer structure. */ int drmAgpAlloc(int fd, unsigned long size, unsigned long type, - unsigned long *address, unsigned long *handle) + unsigned long *address, drmHandle *handle) { drm_agp_buffer_t b; *handle = 0; @@ -1120,7 +1120,7 @@ * This function is a wrapper around the DRM_IOCTL_AGP_FREE ioctl, passing the * argument in a drm_agp_buffer structure. */ -int drmAgpFree(int fd, unsigned long handle) +int drmAgpFree(int fd, drmHandle handle) { drm_agp_buffer_t b; @@ -1144,7 +1144,7 @@ * This function is a wrapper around the DRM_IOCTL_AGP_BIND ioctl, passing the * argument in a drm_agp_binding structure. */ -int drmAgpBind(int fd, unsigned long handle, unsigned long offset) +int drmAgpBind(int fd, drmHandle handle, unsigned long offset) { drm_agp_binding_t b; @@ -1167,7 +1167,7 @@ * This function is a wrapper around the DRM_IOCTL_AGP_UNBIND ioctl, passing * the argument in a drm_agp_binding structure. */ -int drmAgpUnbind(int fd, unsigned long handle) +int drmAgpUnbind(int fd, drmHandle handle) { drm_agp_binding_t b; @@ -1357,7 +1357,7 @@ return i.id_device; } -int drmScatterGatherAlloc(int fd, unsigned long size, unsigned long *handle) +int drmScatterGatherAlloc(int fd, unsigned long size, drmHandle *handle) { drm_scatter_gather_t sg; @@ -1369,7 +1369,7 @@ return 0; } -int drmScatterGatherFree(int fd, unsigned long handle) +int drmScatterGatherFree(int fd, drmHandle handle) { drm_scatter_gather_t sg; Index: extras/Mesa/src/glx/mini/xf86drm.h =================================================================== RCS file: /home/eich/cvs/xc/extras/Mesa/src/glx/mini/xf86drm.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/Mesa/src/glx/mini/xf86drm.h 6 Jul 2004 15:08:53 -0000 1.1.1.1 +++ extras/Mesa/src/glx/mini/xf86drm.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -53,7 +53,7 @@ #define DRM_AGP_NO_HANDLE 0 -typedef unsigned long drmHandle, *drmHandlePtr; /* To mapped regions */ +typedef unsigned int drmHandle, *drmHandlePtr; /* To mapped regions */ typedef unsigned int drmSize, *drmSizePtr; /* For mapped regions */ typedef void *drmAddress, **drmAddressPtr; /* For mapped regions */ typedef unsigned int drmContext, *drmContextPtr; /* GLXContext handle */ @@ -467,7 +467,7 @@ extern char *drmGetBusid(int fd); extern int drmGetInterruptFromBusID(int fd, int busnum, int devnum, int funcnum); -extern int drmGetMap(int fd, int idx, drmHandle *offset, +extern int drmGetMap(int fd, int idx, drm_handle_t *offset, drmSize *size, drmMapType *type, drmMapFlags *flags, drmHandle *handle, int *mtrr); @@ -488,7 +488,7 @@ extern int drmSetBusid(int fd, const char *busid); extern int drmAuthMagic(int fd, drmMagic magic); extern int drmAddMap(int fd, - drmHandle offset, + drm_handle_t offset, drmSize size, drmMapType type, drmMapFlags flags, @@ -548,11 +548,11 @@ extern int drmAgpEnable(int fd, unsigned long mode); extern int drmAgpAlloc(int fd, unsigned long size, unsigned long type, unsigned long *address, - unsigned long *handle); -extern int drmAgpFree(int fd, unsigned long handle); -extern int drmAgpBind(int fd, unsigned long handle, + drmHandle *handle); +extern int drmAgpFree(int fd, drmHandle handle); +extern int drmAgpBind(int fd, drmHandle handle, unsigned long offset); -extern int drmAgpUnbind(int fd, unsigned long handle); +extern int drmAgpUnbind(int fd, drmHandle handle); /* AGP/GART info: authenticated client and/or X */ extern int drmAgpVersionMajor(int fd); @@ -567,8 +567,8 @@ /* PCI scatter/gather support: X server (root) only */ extern int drmScatterGatherAlloc(int fd, unsigned long size, - unsigned long *handle); -extern int drmScatterGatherFree(int fd, unsigned long handle); + drmHandle *handle); +extern int drmScatterGatherFree(int fd, drmHandle handle); extern int drmWaitVBlank(int fd, drmVBlankPtr vbl); Index: extras/drm/linux/Makefile =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/linux/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/linux/Makefile 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/linux/Makefile 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -47,16 +47,28 @@ MODULE_LIST := gamma.o tdfx.o r128.o radeon.o mga.o sis.o savage.o via.o mach64.o # Modules only for ix86 architectures -ifneq (,$(findstring 86,$(MACHINE))) +ifneq (,$(filter i%86,$(MACHINE))) ARCHX86 := 1 MODULE_LIST += i830.o i810.o i915.o endif +ifneq (,$(findstring x86_64,$(MACHINE))) +DO_IOCTL32 = y +endif + ifneq (,$(findstring sparc64,$(MACHINE))) ARCHSPARC64 := 1 MODULE_LIST += ffb.o endif +ifneq ($(DO_IOCTL32),y) +MODULE_LIST += drm_ioctl32.o +MGA_IOCTL32_HEADER = mga_ioctl32.h +RADEON_IOCTL32_HEADER = radeon_ioctl32.h +R128_IOCTL32_HEADER = r128_ioctl32.h +IOCTL32HEADERS = drm_ioctl32.h +endif + DRM_MODULES ?= $(MODULE_LIST) # These definitions are for handling dependencies in the out of kernel build. @@ -72,13 +84,13 @@ gamma_old_dma.h gamma_lock.h $(DRMHEADERS) $(DRMTEMPLATES) TDFXHEADERS = tdfx.h $(DRMHEADERS) $(DRMTEMPLATES) TDFXSHARED = tdfx.h -R128HEADERS = r128.h r128_drv.h r128_drm.h $(DRMHEADERS) $(DRMTEMPLATES) +R128HEADERS = r128.h r128_drv.h r128_drm.h $(R128_IOCTL32_HEADER) $(DRMHEADERS) $(DRMTEMPLATES) R128SHARED = r128.h r128_drv.h r128_drm.h r128_cce.c r128_state.c r128_irq.c -RADEONHEADERS = radeon.h radeon_drv.h radeon_drm.h $(DRMHEADERS) \ +RADEONHEADERS = radeon.h radeon_drv.h radeon_drm.h $(RADEON_IOCTL32_HEADER) $(DRMHEADERS) \ $(DRMTEMPLATES) RADEONSHARED = radeon.h radeon_drv.h radeon_drm.h radeon_cp.c radeon_irq.c \ radeon_mem.c radeon_state.c -MGAHEADERS = mga.h mga_drv.h mga_drm.h mga_ucode.h $(DRMHEADERS) \ +MGAHEADERS = mga.h mga_drv.h mga_drm.h mga_ucode.h $(MGA_IOCTL32_HEADER) $(DRMHEADERS) \ $(DRMTEMPLATES) MGASHARED = mga.h mga_dma.c mga_drm.h mga_drv.h mga_irq.c mga_state.c \ mga_ucode.h mga_warp.c @@ -325,6 +337,8 @@ CONFIG_DRM_VIA := n CONFIG_DRM_MACH64 := n +CONFIG_DRM_IOCTL32 := m + # Enable module builds for the modules requested/supported. ifneq (,$(findstring gamma,$(DRM_MODULES))) @@ -388,6 +402,7 @@ $(savage-objs): $(SAVAGEHEADERS) $(via-objs): $(VIAHEADERS) $(mach64-objs): $(MACH64HEADERS) +$(drm_ioctl32-objs): $(IOCTL32HEADERS) endif Index: extras/drm/linux/Makefile.kernel =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/linux/Makefile.kernel,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/linux/Makefile.kernel 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/linux/Makefile.kernel 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -6,6 +6,12 @@ # # $XFree86: xc/programs/Xserver/hw/xfree86/os-support/linux/drm/kernel/Makefile.kernel,v 1.18 2003/08/16 17:59:17 dawes Exp $ # +ifneq (,$(MACHINE)) +MACHINE := $(ARCH) +endif +ifneq (,findstring x86_64,$(MACHINE)) +DO_IOCTL32 := y +endif gamma-objs := gamma_drv.o gamma_dma.o tdfx-objs := tdfx_drv.o @@ -20,6 +26,13 @@ savage-objs := savage_drv.o savage_dma.o via-objs := via_irq.o via_drv.o via_ds.o via_map.o via_mm.o mach64-objs := mach64_drv.o mach64_dma.o mach64_irq.o mach64_state.o +ioctl32-objs := drm_ioctl32.c + +ifeq ($(DO_IOCTL32),y) +r128-objs += r128_ioctl32.o +radeon-objs += radeon_ioctl32.o +mga-objs += mga_ioctl32.o +endif # Kernel version checks @@ -40,6 +53,9 @@ obj-n := obj- := export-objs := via_mm.o +ifeq ($(DO_IOCTL32),y) +list-multi += drm_ioctl32.o +endif endif obj-$(CONFIG_DRM_GAMMA) += gamma.o @@ -55,6 +71,7 @@ obj-$(CONFIG_DRM_SAVAGE)+= savage.o obj-$(CONFIG_DRM_VIA) += via.o obj-$(CONFIG_DRM_MACH64)+= mach64.o +obj-$(CONFIG_DRM_IOCTL32) += drm_ioctl32.o ifeq ($(BELOW2552),y) include $(TOPDIR)/Rules.make @@ -100,5 +117,7 @@ mach64.o: $(mach64-objs) $(lib) $(LD) -r -o $@ $(mach64-objs) $(lib) +drm_ioctl32.o $(ioctl32-objs) $(lib) + $(LD) -r -o $@ $(ioctl32-objs) $(lib) endif Index: extras/drm/linux/drmP.h =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/linux/drmP.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/linux/drmP.h 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/linux/drmP.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -369,7 +369,7 @@ list_for_each( _list, &dev->maplist->head ) { \ drm_map_list_t *_entry = list_entry( _list, drm_map_list_t, head ); \ if ( _entry->map && \ - _entry->map->offset == (_o) ) { \ + _entry->map->shandle == (_o) ) { \ (_map) = _entry->map; \ break; \ } \ @@ -889,6 +889,9 @@ unsigned int cmd, unsigned long arg); extern int DRM(getmap)(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); +/* backward compatibility */ +extern int DRM(oldgetmap)(struct inode *inode, struct file *filp, + unsigned int cmd, unsigned long arg); extern int DRM(getclient)(struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg); extern int DRM(getstats)(struct inode *inode, struct file *filp, @@ -961,6 +964,11 @@ extern int DRM(addmap)( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); extern int DRM(rmmap)( struct inode *inode, struct file *filp, + unsigned int cmd, unsigned long arg ); +/* backward compatibility */ +extern int DRM(oldaddmap)( struct inode *inode, struct file *filp, + unsigned int cmd, unsigned long arg ); +extern int DRM(oldrmmap)( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ); #if __HAVE_DMA extern int DRM(addbufs)( struct inode *inode, struct file *filp, Index: extras/drm/linux/drm_bufs.h =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/linux/drm_bufs.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/linux/drm_bufs.h 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/linux/drm_bufs.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -79,6 +79,40 @@ return order; } +#ifdef _LP64 +static __inline__ unsigned int HandleID(void *handle, drm_device_t *dev) +{ + unsigned long lhandle; + unsigned int hash; + struct list_head *list; + drm_map_list_t *r_list = NULL; + + lhandle = (unsigned long)handle; + hash = (unsigned int)(((lhandle >> 32) + + (lhandle >> 16) + + lhandle) & 0xffff0000); + while (1) { + if (hash == 0) hash = (1 << 16); + + list = &dev->maplist->head; + list_for_each(list, &dev->maplist->head) { + r_list = list_entry(list, drm_map_list_t, head); + + if(r_list->map && r_list->map->shandle + && r_list->map->shandle == hash) + break; + } + + if(list == (&dev->maplist->head)) + return hash; + + hash += (1 << 16); + } +} +#else +# define HandleID(x,dev) (unsigned int)(x) +#endif + /** * Ioctl to specify a range of memory that is available for mapping by a non-root process. * @@ -98,6 +132,7 @@ drm_file_t *priv = filp->private_data; drm_device_t *dev = priv->dev; drm_map_t *map; + drm_oldmap_t oldmap; drm_map_list_t *list; if ( !(filp->f_mode & 3) ) return -EACCES; /* Require read/write */ @@ -106,11 +141,25 @@ if ( !map ) return -ENOMEM; - if ( copy_from_user( map, (drm_map_t *)arg, sizeof(*map) ) ) { - DRM(free)( map, sizeof(*map), DRM_MEM_MAPS ); - return -EFAULT; + map->shandle = 0; + if (cmd != DRM_IOCTL_OLDADD_MAP) { + if ( copy_from_user( map, (drm_map_t *)arg, sizeof(*map) ) ) { + DRM(free)( map, sizeof(*map), DRM_MEM_MAPS ); + return -EFAULT; + } + } else { + if ( copy_from_user( &oldmap, (drm_oldmap_t *)arg, sizeof(*map) ) ) { + DRM(free)( map, sizeof(*map), DRM_MEM_MAPS ); + return -EFAULT; + } + printk(KERN_WARNING"Old\n"); + map->flags = oldmap.flags; + map->type = oldmap.type; + map->offset = oldmap.offset; + map->size = oldmap.size; } + /* Only allow shared memory to be removable since we only keep enough * book keeping information about shared memory to allow for removal * when processes fork. @@ -154,7 +203,7 @@ break; case _DRM_SHM: - map->handle = vmalloc_32(map->size); + map->handle = vmalloc(map->size); DRM_DEBUG( "%lu %d %p\n", map->size, DRM(order)( map->size ), map->handle ); if ( !map->handle ) { @@ -187,7 +236,7 @@ DRM(free)(map, sizeof(*map), DRM_MEM_MAPS); return -EINVAL; } - map->offset += dev->sg->handle; + map->offset += (unsigned long) dev->sg->virtual; break; default: @@ -206,19 +255,31 @@ down(&dev->struct_sem); list_add(&list->head, &dev->maplist->head); up(&dev->struct_sem); - - if ( copy_to_user( (drm_map_t *)arg, map, sizeof(*map) ) ) - return -EFAULT; - if ( map->type != _DRM_SHM ) { + map->shandle = HandleID(map->handle, dev); + DRM_DEBUG("HandleID = 0x%lx offset = 0x%lx\n", + map->shandle,map->offset); + + if (cmd != DRM_IOCTL_OLDADD_MAP) { + if ( copy_to_user( (drm_map_t *)arg, map, sizeof(*map) ) ) + return -EFAULT; if ( copy_to_user( &((drm_map_t *)arg)->handle, - &map->offset, - sizeof(map->offset) ) ) + &map->shandle, + sizeof(map->shandle) ) ) + return -EFAULT; + } else { + oldmap.mtrr = map->mtrr; + oldmap.handle = (void *)map->shandle; + oldmap.offset = map->offset; + if ( copy_to_user( (drm_oldmap_t *)arg, &oldmap, sizeof(*map) ) ) + return -EFAULT; + if ( copy_to_user( &((drm_oldmap_t *)arg)->handle, + &map->shandle, + sizeof(map->shandle) ) ) return -EFAULT; } return 0; } - /** * Remove a map private from list and deallocate resources if the mapping * isn't in use. @@ -245,20 +306,32 @@ drm_vma_entry_t *pt, *prev; drm_map_t *map; drm_map_t request; + drm_oldmap_t old_request; int found_maps = 0; + unsigned long shandle; - if (copy_from_user(&request, (drm_map_t *)arg, - sizeof(request))) { - return -EFAULT; + if (cmd != DRM_IOCTL_OLDRM_MAP) { + if (copy_from_user(&request, (drm_map_t *)arg, + sizeof(request))) { + return -EFAULT; + } + shandle = request.shandle; + } else { + if (copy_from_user(&old_request, (drm_oldmap_t *)arg, + sizeof(old_request))) { + return -EFAULT; + } + shandle = (unsigned long) old_request.handle; } + down(&dev->struct_sem); list = &dev->maplist->head; list_for_each(list, &dev->maplist->head) { r_list = list_entry(list, drm_map_list_t, head); if(r_list->map && - r_list->map->handle == request.handle && + r_list->map->shandle == shandle && r_list->map->flags & _DRM_REMOVABLE) break; } @@ -305,6 +378,7 @@ return 0; } + #if __HAVE_DMA /** @@ -872,7 +946,8 @@ buf->offset = (dma->byte_count + offset); buf->bus_address = agp_offset + offset; - buf->address = (void *)(agp_offset + offset + dev->sg->handle); + buf->address = (void *)(agp_offset + offset + + (unsigned long)dev->sg->virtual); buf->next = NULL; buf->waiting = 0; buf->pending = 0; @@ -1236,7 +1311,7 @@ virtual = do_mmap( filp, 0, map->size, PROT_READ | PROT_WRITE, MAP_SHARED, - (unsigned long)map->offset ); + (unsigned long)map->shandle ); #if LINUX_VERSION_CODE <= 0x020402 up( ¤t->mm->mmap_sem ); #else Index: extras/drm/linux/drm_context.h =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/linux/drm_context.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/linux/drm_context.h 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/linux/drm_context.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -232,7 +232,7 @@ map = dev->context_sareas[request.ctx_id]; up(&dev->struct_sem); - request.handle = map->handle; + request.handle = map->shandle; if (copy_to_user((drm_ctx_priv_map_t *)arg, &request, sizeof(request))) return -EFAULT; return 0; @@ -269,7 +269,7 @@ list_for_each(list, &dev->maplist->head) { r_list = list_entry(list, drm_map_list_t, head); if(r_list->map && - r_list->map->handle == request.handle) + r_list->map->shandle == request.handle) goto found; } bad: Index: extras/drm/linux/drm_drv.h =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/linux/drm_drv.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/linux/drm_drv.h 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/linux/drm_drv.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -123,6 +123,12 @@ #ifndef DRIVER_POSTSETUP #define DRIVER_POSTSETUP() #endif +#ifndef DRIVER_REGISTER_IOCTL32CONV +#define DRIVER_REGISTER_IOCTL32CONV() +#endif +#ifndef DRIVER_UNREGISTER_IOCTL32CONV +#define DRIVER_UNREGISTER_IOCTL32CONV() +#endif #ifndef DRIVER_IOCTLS #define DRIVER_IOCTLS #endif @@ -727,6 +733,7 @@ pci_register_driver(&drm_driver); else DRM_INFO("Used old pci detect: framebuffer loaded\n"); + DRIVER_REGISTER_IOCTL32CONV(); return 0; } @@ -775,7 +782,7 @@ dev->agp = NULL; } #endif - + DRIVER_UNREGISTER_IOCTL32CONV(); class_simple_device_remove(MKDEV(DRM_MAJOR, 0)); } Index: extras/drm/linux/drm_ioctl.h =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/linux/drm_ioctl.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/linux/drm_ioctl.h 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/linux/drm_ioctl.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -173,14 +173,21 @@ drm_file_t *priv = filp->private_data; drm_device_t *dev = priv->dev; drm_map_t map; + drm_oldmap_t old_map; drm_map_list_t *r_list = NULL; struct list_head *list; int idx; int i; - if (copy_from_user(&map, (drm_map_t *)arg, sizeof(map))) - return -EFAULT; - idx = map.offset; + if (cmd != DRM_IOCTL_OLDGET_MAP) { + if (copy_from_user(&map, (drm_map_t *)arg, sizeof(map))) + return -EFAULT; + idx = map.offset; + } else { + if (copy_from_user(&old_map, (drm_oldmap_t *)arg, sizeof(old_map))) + return -EFAULT; + idx = old_map.offset; + } down(&dev->struct_sem); if (idx < 0) { @@ -201,17 +208,32 @@ return -EINVAL; } - map.offset = r_list->map->offset; - map.size = r_list->map->size; - map.type = r_list->map->type; - map.flags = r_list->map->flags; - map.handle = r_list->map->handle; - map.mtrr = r_list->map->mtrr; - up(&dev->struct_sem); + if (cmd != DRM_IOCTL_OLDGET_MAP) { + map.offset = r_list->map->offset; + map.size = r_list->map->size; + map.type = r_list->map->type; + map.flags = r_list->map->flags; + map.handle = r_list->map->handle; + map.mtrr = r_list->map->mtrr; + up(&dev->struct_sem); + + if (copy_to_user((drm_map_t *)arg, &map, sizeof(map))) + return -EFAULT; + } else { + old_map.offset = r_list->map->offset; + old_map.size = r_list->map->size; + old_map.type = r_list->map->type; + old_map.flags = r_list->map->flags; + old_map.handle = r_list->map->handle; + old_map.mtrr = r_list->map->mtrr; + up(&dev->struct_sem); - if (copy_to_user((drm_map_t *)arg, &map, sizeof(map))) return -EFAULT; + if (copy_to_user((drm_oldmap_t *)arg, &old_map, sizeof(old_map))) + return -EFAULT; + } return 0; } + /** * Get client information. Index: extras/drm/linux/drm_ioctl32.c =================================================================== RCS file: extras/drm/linux/drm_ioctl32.c diff -N extras/drm/linux/drm_ioctl32.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ extras/drm/linux/drm_ioctl32.c 28 Jul 2004 20:21:51 -0000 1.1.2.1 @@ -0,0 +1,1174 @@ +#include +#include +#include +#include +#include +#if 0 +#include +#else +#include +#endif +#include +#include +#include +#include +#include + +#ifdef __x86_64__ + +#include +#include "drm.h" +#define IOCTL32_PRIVATE +#include "drm_ioctl32.h" + + +MODULE_AUTHOR( "Egbert Eich, eich@suse.de" ); +MODULE_DESCRIPTION( "DRM ioctl32 translations" ); +#ifdef MODULE_LICENSE +MODULE_LICENSE("GPL and additional rights"); +#endif + +#define DRM_IOCTL_VERSION_32 DRM_IOWR(0x00, drm32_version_t) +#define DRM_IOCTL_GET_UNIQUE_32 DRM_IOWR(0x01, drm32_unique_t) +#define DRM_IOCTL_GET_MAP_32 DRM_IOWR(0x04, drm32_map_t) +#define DRM_IOCTL_GET_CLIENT_32 DRM_IOWR(0x05, drm32_client_t) +#define DRM_IOCTL_GET_STATS_32 DRM_IOR( 0x06, drm32_stats_t) +#define DRM_IOCTL_SET_UNIQUE_32 DRM_IOW( 0x10, drm32_unique_t) +#define DRM_IOCTL_ADD_MAP_32 DRM_IOWR(0x15, drm32_map_t) +#define DRM_IOCTL_ADD_BUFS_32 DRM_IOWR(0x16, drm32_buf_desc_t) +#define DRM_IOCTL_MARK_BUFS_32 DRM_IOW( 0x17, drm32_buf_desc_t) +#define DRM_IOCTL_INFO_BUFS_32 DRM_IOWR(0x18, drm32_buf_info_t) +#define DRM_IOCTL_MAP_BUFS_32 DRM_IOWR(0x19, drm32_buf_map_t) +#define DRM_IOCTL_FREE_BUFS_32 DRM_IOW( 0x1a, drm32_buf_free_t) +#define DRM_IOCTL_RM_MAP_32 DRM_IOW( 0x1b, drm32_map_t) +#if 0 +#define DRM_IOCTL_SET_SAREA_CTX_32 DRM_IOW( 0x1c, drm32_ctx_priv_map_t) +#define DRM_IOCTL_GET_SAREA_CTX_32 DRM_IOWR(0x1d, drm32_ctx_priv_map_t) +#endif +#define DRM_IOCTL_RES_CTX_32 DRM_IOWR(0x26, drm32_ctx_res_t) +#define DRM_IOCTL_DMA_32 DRM_IOWR(0x29, drm32_dma_t) +#define DRM_IOCTL_AGP_ENABLE_32 DRM_IOW( 0x32, drm32_agp_mode_t) +#define DRM_IOCTL_AGP_INFO_32 DRM_IOR( 0x33, drm32_agp_info_t) +#define DRM_IOCTL_AGP_ALLOC_32 DRM_IOWR(0x34, drm32_agp_buffer_t) +#define DRM_IOCTL_AGP_FREE_32 DRM_IOW( 0x35, drm32_agp_buffer_t) +#define DRM_IOCTL_AGP_BIND_32 DRM_IOW( 0x36, drm32_agp_binding_t) +#define DRM_IOCTL_AGP_UNBIND_32 DRM_IOW( 0x37, drm32_agp_binding_t) +#define DRM_IOCTL_SG_ALLOC_32 DRM_IOW( 0x38, drm32_scatter_gather_t) +#define DRM_IOCTL_SG_FREE_32 DRM_IOW( 0x39, drm32_scatter_gather_t) +#define DRM_IOCTL_WAIT_VBLANK_32 DRM_IOWR(0x3a, drm32_wait_vblank_t) + +typedef struct drm32_version { /* OK */ + int version_major; /* Major version */ + int version_minor; /* Minor version */ + int version_patchlevel;/* Patch level */ + unsigned int name_len; /* Length of name buffer */ + u32 name; /* Name of driver */ + unsigned int date_len; /* Length of date buffer */ + u32 date; /* User-space buffer to hold date*/ + unsigned int desc_len; /* Length of desc buffer */ + u32 desc; /* User-space buffer to hold desc*/ +} drm32_version_t; + +typedef struct drm32_unique { /* OK */ + unsigned int unique_len;/* Length of unique */ + u32 unique; /* Unique name for driver instantiation */ +} drm32_unique_t; + +typedef struct drm32_client { + int idx; /* Which client desired? */ + int auth; /* Is client authenticated? */ +/*?*/ unsigned int pid; /* Process id */ +/*?*/ unsigned int uid; /* User id */ +/*?*/ unsigned int magic; /* Magic */ +/*?*/ unsigned int iocs; /* Ioctl count */ +} drm32_client_t; + +#if 0 +typedef struct drm32_ctx_priv_map { + unsigned int ctx_id; /* Context requesting private mapping */ +/*?*/ u32 handle; /* Handle of map */ +} drm32_ctx_priv_map_t; +#endif + +typedef struct drm32_buf_desc { /* OK */ + int count; /* Number of buffers of this size */ + int size; /* Size in bytes */ + int low_mark; /* Low water mark */ + int high_mark; /* High water mark */ + int flags; +/*?*/ unsigned int agp_start; /* Start address of where the agp buffers + * are in the agp aperture */ +} drm32_buf_desc_t; + +typedef struct drm32_buf_info { /* OK */ + int count; /* Entries in list */ + u32 list; +} drm32_buf_info_t; + +typedef struct drm32_buf_pub { /* OK (see drm32_buf_map) */ + int idx; /* Index into master buflist */ + int total; /* Buffer size */ + int used; /* Amount of buffer in use (for DMA) */ + u32 address; /* Address of buffer */ +} drm32_buf_pub_t; + +typedef struct drm32_buf_map { /*OK (if do_mmap works correctly) */ + int count; /* Length of buflist */ + u32 virtual; /* Mmaped area in user-virtual */ + u32 list; /* Buffer information */ +} drm32_buf_map_t; + +typedef struct drm32_buf_free { /* OK (see above) */ + int count; + u32 list; +} drm32_buf_free_t; + +typedef struct drm32_stats { +/*?*/ unsigned int count; + struct { + unsigned int value; + drm_stat_type_t type; + } data[15]; +} drm32_stats_t; + +typedef struct drm32_map { +/*?*/ unsigned int offset; /* Requested physical address (0 for SARA)*/ +/*?*/ unsigned int size; /* Requested physical size (bytes) */ + drm_map_type_t type; /* Type of memory to map */ + drm_map_flags_t flags; /* Flags */ + unsigned int shandle; /* User-space: "Handle" to pass to mmap */ + int mtrr; /* MTRR slot used */ + /* Private data */ + u32 handle ; /* Kernel-space: kernel-virtual address */ +} drm32_map_t; + +typedef struct drm32_ctx_res { /* OK */ + int count; + u32 contexts; +} drm32_ctx_res_t; + +typedef struct drm32_dma { /* should be OK */ + /* Indices here refer to the offset into + buflist in drm_buf_get_t. */ + int context; /* Context handle */ + int send_count; /* Number of buffers to send */ + u32 send_indices; /* List of handles to buffers */ + u32 send_sizes; /* Lengths of data to send */ + drm_dma_flags_t flags; /* Flags */ + int request_count; /* Number of buffers requested */ + int request_size; /* Desired size for buffers */ + u32 request_indices; /* Buffer information */ + u32 request_sizes; + int granted_count; /* Number of buffers granted */ +} drm32_dma_t; + +typedef struct drm32_agp_buffer { +/*?*/ int size; +/*?*/ int handle; +/*?*/ int type; +/*?*/ int physical; +} drm32_agp_buffer_t; + +typedef struct drm32_agp_info { + int agp_version_major; + int agp_version_minor; +/*?*/ unsigned int mode; +/*?*/ unsigned int aperture_base; /* physical address */ +/*?*/ unsigned int aperture_size; /* bytes */ +/*?*/ unsigned int memory_allowed; /* bytes */ +/*?*/ unsigned int memory_used; + + /* PCI information */ + unsigned short id_vendor; + unsigned short id_device; +} drm32_agp_info_t; + +typedef struct drm32_agp_mode { +/*?*/ unsigned int mode; +} drm32_agp_mode_t; + +typedef struct drm32_agp_binding { +/*?*/ unsigned int handle; /* From drm_agp_buffer */ +/*?*/ unsigned int offset; /* In bytes -- will round to page boundary */ +} drm32_agp_binding_t; + +typedef struct drm32_scatter_gather { +/*?*/ unsigned int size; /* In bytes -- will round to page boundary */ +/*?*/ unsigned int handle; /* Used for mapping / unmapping */ +} drm32_scatter_gather_t; + +struct drm32_wait_vblank_request { + drm_vblank_seq_type_t type; + unsigned int sequence; + unsigned int signal; +}; + +struct drm32_wait_vblank_reply { + drm_vblank_seq_type_t type; + unsigned int sequence; + int tval_sec; + int tval_usec; +}; + +typedef union drm32_wait_vblank { + struct drm32_wait_vblank_request request; + struct drm32_wait_vblank_reply reply; +} drm32_wait_vblank_t; + +static void drm_unregister_ioctl32(void); + +static int ioctl_conversions_successful = 0; + +static int +drm_version_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_version_t *arg32 = (drm32_version_t *) arg; + drm_version_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("drm_version_32_64"); + GET_USER(version_major); + GET_USER(version_minor); + GET_USER(version_patchlevel); + GET_USER(name_len); + GET_USER_P(name); + GET_USER(date_len); + GET_USER_P(date); + GET_USER(desc_len); + GET_USER_P(desc); + + if (err) return -EFAULT; + + SYS_IOCTL; + if (err) return err; + + PUT_USER(version_major); + PUT_USER(version_minor); + PUT_USER(version_patchlevel); + PUT_USER(name_len); +// PUT_USER(name); + PUT_USER(date_len); +// PUT_USER(date); + PUT_USER(desc_len); +// PUT_USER(desc); + + DEBUG("done"); + return err ? -EFAULT : 0; +} + +static int +drm_unique_wr_32_64(unsigned int fd, unsigned cmd, + unsigned long arg, struct file *file) +{ + drm32_unique_t *arg32 = (drm32_unique_t *) arg; + drm_unique_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("drm_unique_wr_32_64"); + GET_USER(unique_len); + GET_USER_P(unique); + + if (err) return -EFAULT; + + SYS_IOCTL; + if (err) return err; + + PUT_USER(unique_len); +// PUT_USER(unique); + DEBUG("done"); + return err ? -EFAULT : 0; +} + +static int +drm_unique_w_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_unique_t *arg32 = (drm32_unique_t *) arg; + drm_unique_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("drm_unique_w_32_64"); + GET_USER(unique_len); + GET_USER_P(unique); + + if (err) return -EFAULT; + + SYS_IOCTL; + DEBUG("done"); + return err; +} + +static int +drm_map_rw_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_map_t *arg32 = (drm32_map_t *) arg; + drm_map_t arg64; + mm_segment_t old_fs; + int err = 0; +// u64 dummy; + + DEBUG("drm_map_rw_32_64"); + GET_USER(offset); + GET_USER(size); + GET_USER(type); + GET_USER(flags); +// GET_USER_P(handle); +// GET_USER(shandle); + GET_USER(mtrr); + + if (err) return -EFAULT; + + SYS_IOCTL; + + if (err) return err; + + ASSERT32(offset); + PUT_USER(offset); + ASSERT32(size); + PUT_USER(size); + PUT_USER(type); + PUT_USER(flags); +// PUT_USER_P(handle); + PUT_USER(shandle); + PUT_USER(mtrr); + + DEBUG("done"); + return err ? -EFAULT : 0; +} + +static int +drm_map_w_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_map_t *arg32 = (drm32_map_t *) arg; + drm_map_t arg64; + mm_segment_t old_fs; + int err = 0; +// u64 dummy; + + DEBUG("drm_map_w_32_64"); + GET_USER(offset); + GET_USER(size); + GET_USER(type); + GET_USER(flags); +// GET_USER_P(handle); + GET_USER(mtrr); + + if (err) return -EFAULT; + + SYS_IOCTL; + DEBUG("done"); + return err; +} + +static int +drm_client_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_client_t *arg32 = (drm32_client_t *) arg; + drm_client_t arg64; + mm_segment_t old_fs; + int err = 0; + + DEBUG("drm_client_32_64"); + GET_USER(idx); +// GET_USER(auth); +// GET_USER(pid); +// GET_USER(uid); +// GET_USER(magic); +// GET_USER(iocs); + + if (err) return -EFAULT; + + SYS_IOCTL; + if (err) return err; + +// PUT_USER(idx); + PUT_USER(auth); + ASSERT32(pid); + PUT_USER(pid); + ASSERT32(uid); + PUT_USER(uid); + ASSERT32(magic); + PUT_USER(magic); + ASSERT32(iocs); + PUT_USER(iocs); + + DEBUG("done"); + return err ? -EFAULT : 0; +} + +static int +drm_stats_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_stats_t *arg32 = (drm32_stats_t *) arg; + drm_stats_t arg64; + mm_segment_t old_fs; + int err = 0; + int i; + + DEBUG("drm_stats_32_64"); + SYS_IOCTL; + if (err) return err; + + PUT_USER(count); + for (i = 0; i < arg64.count; i ++) { + PUT_USER(data[i].value); + PUT_USER(data[i].type); + } + + DEBUG("done"); + return err ? -EFAULT : 0; +} + +#if 0 +static int +drm_ctx_priv_map_wr_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_ctx_priv_map_t *arg32 = (drm32_ctx_priv_map_t *) arg; + drm_ctx_priv_map_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("drm_ctx_priv_map_wr_32_64"); + GET_USER(ctx_id); +// GET_USER_P(handle); + + if (err) return -EFAULT; + + SYS_IOCTL; + if (err) return err; + +// PUT_USER(ctx_id); + PUT_USER_P(handle); + + DEBUG("done"); + return err ? -EFAULT : 0; +} + +static int +drm_ctx_priv_map_w_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_ctx_priv_map_t *arg32 = (drm32_ctx_priv_map_t *) arg; + drm_ctx_priv_map_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("drm_ctx_priv_map_w_32_64"); + GET_USER(ctx_id); + GET_USER_P(handle); + + if (err) return -EFAULT; + + SYS_IOCTL; + + DEBUG("done"); + return err; +} +#endif + +static int +drm_ctx_res_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_ctx_res_t *arg32 = (drm32_ctx_res_t *) arg; + drm_ctx_res_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("drm_ctx_res_32_64"); + GET_USER(count); + GET_USER_P(contexts); + + if (err) return -EFAULT; + + SYS_IOCTL; + if (err) return err; + + PUT_USER(count); +// PUT_USER(contexts); + + DEBUG("done"); + return err ? -EFAULT : 0; +} + + +static int +drm_dma_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_dma_t *arg32 = (drm32_dma_t *) arg; + drm_dma_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("drm_dma_32_64"); + GET_USER(context); + GET_USER(send_count); + GET_USER_P(send_indices); + GET_USER_P(send_sizes); + GET_USER(flags); + GET_USER(request_count); + GET_USER(request_size); + GET_USER_P(request_indices); + GET_USER_P(request_sizes); + GET_USER(granted_count); + + if (err) return -EFAULT; + + SYS_IOCTL; + if (err) return err; + + PUT_USER(context); + PUT_USER(send_count); +// PUT_USER(send_indices); +// PUT_USER(send_sizes); + PUT_USER(flags); + PUT_USER(request_count); + PUT_USER(request_size); +// PUT_USER(request_indices); +// PUT_USER(request_sizes); + PUT_USER(granted_count); + + DEBUG("done"); + return err ? -EFAULT : 0; +} + +static int +drm_buf_desc_wr_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_buf_desc_t *arg32 = (drm32_buf_desc_t *) arg; + drm_buf_desc_t arg64; + mm_segment_t old_fs; + int err = 0; + + DEBUG("drm_buf_desc_wr_32_64"); + GET_USER(count); + GET_USER(size); + GET_USER(low_mark); + GET_USER(high_mark); + GET_USER(flags); + GET_USER(agp_start); + + if (err) return -EFAULT; + + SYS_IOCTL; + if (err) return err; + + PUT_USER(count); + PUT_USER(size); +// PUT_USER(low_mark); +// PUT_USER(high_mark); +// PUT_USER(flags); +// PUT_USER(agp_start); + + DEBUG("done"); + return err ? -EFAULT : 0; +} + +static int +drm_buf_desc_w_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_buf_desc_t *arg32 = (drm32_buf_desc_t *) arg; + drm_buf_desc_t arg64; + mm_segment_t old_fs; + int err = 0; + + DEBUG("drm_buf_desc_w_32_64"); + GET_USER(count); + GET_USER(size); + GET_USER(low_mark); + GET_USER(high_mark); + GET_USER(flags); + GET_USER(agp_start); + + if (err) return -EFAULT; + + SYS_IOCTL; + + DEBUG("done"); + return err; +} + +static int +drm_buf_info_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_buf_info_t *arg32 = (drm32_buf_info_t *) arg; + drm_buf_info_t arg64; + mm_segment_t old_fs; + int err = 0; + drm32_buf_desc_t *list32 = (drm32_buf_desc_t*)(u64)arg32->list; + drm_buf_desc_t *list64; + int i; + + DEBUG("drm_buf_info_32_64"); + list64 = K_ALLOC(arg32->count * sizeof (drm_buf_desc_t)); + if (!list64) return -EFAULT; + + GET_USER(count); + arg64.list = list64; + + for (i = 0 ; i < arg32->count; i ++) { + err |= get_user(list64[i].count,&list32[i].count); + err |= get_user(list64[i].size,&list32[i].size); + err |= get_user(list64[i].high_mark,&list32[i].low_mark); + err |= get_user(list64[i].flags,&list32[i].flags); + err |= get_user(list64[i].agp_start,&list32[i].agp_start); + } + + if (err) { + K_FREE(list64); + return -EFAULT; + } + + SYS_IOCTL; + if (err) { + K_FREE(list64); + return err; + } + + + for (i = 0 ; i < arg32->count; i ++) { + err |= put_user(list64[i].count,&list32[i].count); + err |= put_user(list64[i].size,&list32[i].size); + err |= put_user(list64[i].low_mark,&list32[i].low_mark); + err |= put_user(list64[i].high_mark,&list32[i].high_mark); + err |= put_user(list64[i].flags,&list32[i].flags); +// err |= put_user(list64[i].agp_start,&list32[i].agp_start); + } + PUT_USER(count); + + K_FREE(list64); + + DEBUG("done"); + return err ? -EFAULT : 0; +} + + +static int +drm_buf_map_32_64(unsigned int fd, unsigned cmd, + unsigned long arg, struct file *file) +{ + drm32_buf_map_t *arg32 = (drm32_buf_map_t *) arg; + drm_buf_map_t arg64; + mm_segment_t old_fs; + int err = 0; + drm32_buf_pub_t *list32 = (drm32_buf_pub_t*)(unsigned long)arg32->list; + drm_buf_pub_t *list64; + int count, i; + u64 dummy; + + DEBUG("drm_buf_map_32_64"); + list64 = K_ALLOC(arg32->count * sizeof (drm_buf_pub_t)); + if (!list64) return -EFAULT; + + GET_USER(count); + GET_USER_P(virtual); + arg64.list = list64; +#if 0 + for (i = 0 ; i < arg32->count; i ++) { + err |= get_user(list64[i].idx,&list32[i].idx); + err |= get_user(list64[i].total,&list32[i].total); + err |= get_user(list64[i].used,&list32[i].used); + err |= get_user(dummy,&list32[i].address); + list64[i].address = (void *)dummy; + } +#endif + if (err) { + K_FREE(list64); + return -EFAULT; + } + + SYS_IOCTL; + if (err) { + K_FREE(list64); + return err; + } + + count = arg32->count < arg64.count ? arg32->count : arg64.count; + PUT_USER(count); + PUT_USER_P(virtual); + + for (i = 0 ; i < count; i ++) { + err |= put_user(list64[i].idx,&list32[i].idx); + err |= put_user(list64[i].total,&list32[i].total); + err |= put_user(list64[i].used,&list32[i].used); + dummy = (u64)list64[i].address; + err |= put_user((u32)dummy,&list32[i].address); + } + K_FREE(list64); + + return err ? -EFAULT : 0; +} + +static int +drm_buf_free_w_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_buf_free_t *arg32 = (drm32_buf_free_t *) arg; + drm_buf_free_t arg64; + mm_segment_t old_fs; + int err = 0; + int i; + int *list32 = (int *)(unsigned long)arg32->list; + + DEBUG("drm_buf_free_w_32_64"); + GET_USER(count); + for (i = 0; i < arg32->count; i++) + err |= get_user(arg64.list[i],&list32[i]); + + + if (err) return -EFAULT; + + SYS_IOCTL; + + DEBUG("done"); + return err; +} + +static int +drm_agp_info_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_agp_info_t *arg32 = (drm32_agp_info_t *) arg; + drm_agp_info_t arg64; + mm_segment_t old_fs; + int err = 0; + + DEBUG("drm_agp_info_32_64"); + + SYS_IOCTL; + if (err) return err; + + PUT_USER(agp_version_major); + PUT_USER(agp_version_minor); + PUT_USER(mode); + ASSERT32(aperture_base); + PUT_USER(aperture_base); + ASSERT32(aperture_size); + PUT_USER(aperture_size); + ASSERT32(memory_allowed); + PUT_USER(memory_allowed); + ASSERT32(memory_used); + PUT_USER(memory_used); + PUT_USER(id_vendor); + PUT_USER(id_device); + + return err ? -EFAULT : 0; +} + +static int +drm_agp_buffer_w_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_agp_buffer_t *arg32 = (drm32_agp_buffer_t *) arg; + drm_agp_buffer_t arg64; + mm_segment_t old_fs; + int err = 0; + + DEBUG("drm_agp_buffer_w_32_64"); + GET_USER(handle); + + if (err) return -EFAULT; + + SYS_IOCTL; + return err; +} + +static int +drm_agp_buffer_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_agp_buffer_t *arg32 = (drm32_agp_buffer_t *) arg; + drm_agp_buffer_t arg64; + mm_segment_t old_fs; + int err = 0; + + DEBUG("drm_agp_buffer_32_64"); + GET_USER(size); + GET_USER(handle); + GET_USER(type); + GET_USER(physical); + + if (err) return -EFAULT; + + SYS_IOCTL; + if (err) return err; + + ASSERT32(size); + PUT_USER(size); + ASSERT32(handle); + PUT_USER(handle); + ASSERT32(type); + PUT_USER(type); +// PUT_USER(physical); + + return err ? -EFAULT : 0; +} + +static int +drm_agp_mode_w_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_agp_mode_t *arg32 = (drm32_agp_mode_t *) arg; + drm_agp_mode_t arg64; + mm_segment_t old_fs; + int err = 0; + + DEBUG("drm_agp_mode_w_32_64"); + GET_USER(mode); + + if (err) return -EFAULT; + + SYS_IOCTL; + + return err; +} + +static int +drm_agp_binding_w_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_agp_binding_t *arg32 = (drm32_agp_binding_t *) arg; + drm_agp_binding_t arg64; + mm_segment_t old_fs; + int err = 0; + + DEBUG("drm_agp_binding_w_32_64"); + GET_USER(handle); + GET_USER(offset); + + if (err) return -EFAULT; + + SYS_IOCTL; + + return err; +} + +static int +drm32_scatter_gather_w_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_scatter_gather_t *arg32 = (drm32_scatter_gather_t *) arg; + drm_scatter_gather_t arg64; + mm_segment_t old_fs; + int err = 0; + + DEBUG("drm_agp_scatter_gather_w_32_64"); + + GET_USER(size); + GET_USER(handle); + + if (err) return -EFAULT; + + SYS_IOCTL; + + return err; +} + +static int +drm32_wait_vblank_rw_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_wait_vblank_t *arg32 = (drm32_wait_vblank_t *) arg; + drm_wait_vblank_t arg64; + mm_segment_t old_fs; + int err = 0; + + DEBUG("drm_agp_scatter_gather_rw_32_64"); + + err |= get_user(arg64.request.type,&arg32->request.type); + err |= get_user(arg64.request.sequence,&arg32->request.sequence); + err |= get_user(arg64.request.signal,&arg32->request.signal); + + if (err) return -EFAULT; + + SYS_IOCTL; + + err |= put_user(arg64.reply.type,&arg32->reply.type); + err |= put_user(arg64.reply.sequence,&arg32->reply.sequence); + ASSERT32(reply.tval_sec); + err |= put_user(arg64.reply.tval_sec,&arg32->reply.tval_sec); + ASSERT32(reply.tval_usec); + err |= put_user(arg64.reply.tval_usec,&arg32->reply.tval_usec); + + return err ? -EFAULT : 0; +} + +int +drm32_default_handler(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + return SYS_IOCTL_FUNC(fd,cmd,arg); +} + +/* ============ Compatibility stuff for old ioctls =============== */ + +#define DRM_IOCTL_GET_MAP_COMPAT_32 DRM_IOWR(0x04, drm32_map_compat_t) +#define DRM_IOCTL_ADD_MAP_COMPAT_32 DRM_IOWR(0x15, drm32_map_compat_t) +#define DRM_IOCTL_RM_MAP_COMPAT_32 DRM_IOW( 0x1b, drm32_map_compat_t) + +typedef struct drm32_map_compat { +/*?*/ unsigned int offset; /* Requested physical address (0 for SARA)*/ +/*?*/ unsigned int size; /* Requested physical size (bytes) */ + drm_map_type_t type; /* Type of memory to map */ + drm_map_flags_t flags; /* Flags */ + unsigned int shandle; + int mtrr; /* MTRR slot used */ + /* Private data */ +} drm32_map_compat_t; + +static int +drm_map_compat_rw_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_map_compat_t *arg32 = (drm32_map_compat_t *) arg; + drm_map_t arg64; + mm_segment_t old_fs; + int err = 0; +// u64 dummy; + + DEBUG("drm_map_compat_rw_32_64"); + GET_USER(offset); + GET_USER(size); + GET_USER(type); + GET_USER(flags); +// GET_USER_P(handle); +// GET_USER(shandle); + GET_USER(mtrr); + + if (err) return -EFAULT; + + SYS_IOCTL; + + if (err) return err; + + ASSERT32(offset); + PUT_USER(offset); + ASSERT32(size); + PUT_USER(size); + PUT_USER(type); + PUT_USER(flags); +// PUT_USER_P(handle); + PUT_USER(shandle); + PUT_USER(mtrr); + + DEBUG("done"); + return err ? -EFAULT : 0; +} + +static int +drm_map_compat_w_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_map_compat_t *arg32 = (drm32_map_compat_t *) arg; + drm_map_t arg64; + mm_segment_t old_fs; + int err = 0; +// u64 dummy; + + DEBUG("drm_map_compat_w_32_64"); + GET_USER(offset); + GET_USER(size); + GET_USER(type); + GET_USER(flags); +// GET_USER_P(handle); + GET_USER(mtrr); + + if (err) return -EFAULT; + + SYS_IOCTL; + DEBUG("done"); + return err; +} + +/* ============ =============== */ + +static int +drm_register_ioctl32(void) +{ + int err; + REG_IOCTL32(DRM_IOCTL_VERSION_32,drm_version_32_64); + REG_IOCTL32(DRM_IOCTL_GET_UNIQUE_32,drm_unique_wr_32_64); + REG_IOCTL32(DRM_IOCTL_GET_MAP_32,drm_map_rw_32_64); + REG_IOCTL32(DRM_IOCTL_GET_MAP_COMPAT_32,drm_map_compat_rw_32_64); + REG_IOCTL32(DRM_IOCTL_GET_CLIENT_32,drm_client_32_64); + REG_IOCTL32(DRM_IOCTL_GET_STATS_32,drm_stats_32_64); + REG_IOCTL32(DRM_IOCTL_SET_UNIQUE_32,drm_unique_w_32_64); + REG_IOCTL32(DRM_IOCTL_ADD_MAP_32,drm_map_rw_32_64); + REG_IOCTL32(DRM_IOCTL_ADD_MAP_COMPAT_32,drm_map_compat_rw_32_64); + REG_IOCTL32(DRM_IOCTL_ADD_BUFS_32,drm_buf_desc_wr_32_64); + REG_IOCTL32(DRM_IOCTL_MARK_BUFS_32,drm_buf_desc_w_32_64); + REG_IOCTL32(DRM_IOCTL_INFO_BUFS_32,drm_buf_info_32_64); + REG_IOCTL32(DRM_IOCTL_MAP_BUFS_32,drm_buf_map_32_64); + REG_IOCTL32(DRM_IOCTL_FREE_BUFS_32,drm_buf_free_w_32_64); + REG_IOCTL32(DRM_IOCTL_RM_MAP_32,drm_map_w_32_64); + REG_IOCTL32(DRM_IOCTL_RM_MAP_COMPAT_32,drm_map_compat_w_32_64); +#if 0 + REG_IOCTL32(DRM_IOCTL_SET_SAREA_CTX_32,drm_ctx_priv_map_w_32_64); + REG_IOCTL32(DRM_IOCTL_GET_SAREA_CTX_32,drm_ctx_priv_map_wr_32_64); +#endif + REG_IOCTL32(DRM_IOCTL_RES_CTX_32,drm_ctx_res_32_64) + REG_IOCTL32(DRM_IOCTL_DMA_32,drm_dma_32_64); + REG_IOCTL32(DRM_IOCTL_AGP_ENABLE_32,drm_agp_mode_w_32_64); + REG_IOCTL32(DRM_IOCTL_AGP_INFO_32,drm_agp_info_32_64); + REG_IOCTL32(DRM_IOCTL_AGP_ALLOC_32,drm_agp_buffer_32_64); + REG_IOCTL32(DRM_IOCTL_AGP_FREE_32,drm_agp_buffer_w_32_64); + REG_IOCTL32(DRM_IOCTL_AGP_BIND_32,drm_agp_binding_w_32_64); + REG_IOCTL32(DRM_IOCTL_AGP_UNBIND_32,drm_agp_binding_w_32_64); + REG_IOCTL32(DRM_IOCTL_SG_ALLOC_32,drm32_scatter_gather_w_32_64); + REG_IOCTL32(DRM_IOCTL_SG_FREE_32,drm32_scatter_gather_w_32_64); + REG_IOCTL32(DRM_IOCTL_WAIT_VBLANK_32,drm32_wait_vblank_rw_32_64); + REG_IOCTL32(DRM_IOCTL_GET_MAGIC,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_IRQ_BUSID,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_SET_VERSION,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_AUTH_MAGIC,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_BLOCK,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_UNBLOCK,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_CONTROL,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_SET_SAREA_CTX,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_GET_SAREA_CTX,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_ADD_CTX,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RM_CTX,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_MOD_CTX,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_GET_CTX,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_SWITCH_CTX,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_NEW_CTX,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_ADD_DRAW,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RM_DRAW,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_LOCK,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_UNLOCK,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_FINISH,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_AGP_ACQUIRE,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_AGP_RELEASE,drm32_default_handler); + + ioctl_conversions_successful = 1; + + return 0; + failed: + return -1; +} + + +static void +drm_unregister_ioctl32(void) +{ + UNREG_IOCTL32(DRM_IOCTL_VERSION_32); + UNREG_IOCTL32(DRM_IOCTL_GET_UNIQUE_32); + UNREG_IOCTL32(DRM_IOCTL_GET_CLIENT_32); +#if 0 + UNREG_IOCTL32(DRM_IOCTL_SET_SAREA_CTX_32); + UNREG_IOCTL32(DRM_IOCTL_GET_SAREA_CTX_32); +#endif + UNREG_IOCTL32(DRM_IOCTL_RES_CTX_32); + UNREG_IOCTL32(DRM_IOCTL_DMA_32); + + UNREG_IOCTL32(DRM_IOCTL_INFO_BUFS_32); + UNREG_IOCTL32(DRM_IOCTL_MAP_BUFS_32); + UNREG_IOCTL32(DRM_IOCTL_FREE_BUFS_32); + + UNREG_IOCTL32(DRM_IOCTL_GET_MAP_32); + UNREG_IOCTL32(DRM_IOCTL_GET_STATS_32); + UNREG_IOCTL32(DRM_IOCTL_SET_UNIQUE_32); + UNREG_IOCTL32(DRM_IOCTL_ADD_MAP_32); + UNREG_IOCTL32(DRM_IOCTL_RM_MAP_32); + UNREG_IOCTL32(DRM_IOCTL_ADD_BUFS_32); + UNREG_IOCTL32(DRM_IOCTL_MARK_BUFS_32); + UNREG_IOCTL32(DRM_IOCTL_AGP_ALLOC_32); + UNREG_IOCTL32(DRM_IOCTL_AGP_FREE_32); + UNREG_IOCTL32(DRM_IOCTL_AGP_INFO_32); + UNREG_IOCTL32(DRM_IOCTL_AGP_ENABLE_32); + UNREG_IOCTL32(DRM_IOCTL_AGP_BIND_32); + UNREG_IOCTL32(DRM_IOCTL_AGP_UNBIND_32); + UNREG_IOCTL32(DRM_IOCTL_SG_ALLOC_32); + UNREG_IOCTL32(DRM_IOCTL_SG_FREE_32); + UNREG_IOCTL32(DRM_IOCTL_WAIT_VBLANK_32); + + UNREG_IOCTL32(DRM_IOCTL_GET_MAP_COMPAT_32); + UNREG_IOCTL32(DRM_IOCTL_ADD_MAP_COMPAT_32); + UNREG_IOCTL32(DRM_IOCTL_RM_MAP_COMPAT_32); + + UNREG_IOCTL32(DRM_IOCTL_SET_SAREA_CTX); + UNREG_IOCTL32(DRM_IOCTL_GET_SAREA_CTX); + UNREG_IOCTL32(DRM_IOCTL_GET_MAGIC); + UNREG_IOCTL32(DRM_IOCTL_IRQ_BUSID); + UNREG_IOCTL32(DRM_IOCTL_BLOCK); + UNREG_IOCTL32(DRM_IOCTL_UNBLOCK); + UNREG_IOCTL32(DRM_IOCTL_AUTH_MAGIC); + UNREG_IOCTL32(DRM_IOCTL_ADD_CTX); + UNREG_IOCTL32(DRM_IOCTL_RM_CTX); + UNREG_IOCTL32(DRM_IOCTL_MOD_CTX); + UNREG_IOCTL32(DRM_IOCTL_GET_CTX); + UNREG_IOCTL32(DRM_IOCTL_SWITCH_CTX); + UNREG_IOCTL32(DRM_IOCTL_NEW_CTX); + UNREG_IOCTL32(DRM_IOCTL_ADD_DRAW); + UNREG_IOCTL32(DRM_IOCTL_RM_DRAW); + UNREG_IOCTL32(DRM_IOCTL_LOCK); + UNREG_IOCTL32(DRM_IOCTL_UNLOCK); + UNREG_IOCTL32(DRM_IOCTL_FINISH); + UNREG_IOCTL32(DRM_IOCTL_CONTROL); + UNREG_IOCTL32(DRM_IOCTL_AGP_ACQUIRE); + UNREG_IOCTL32(DRM_IOCTL_AGP_RELEASE); +} + +int +drm32_register(void) +{ + if (ioctl_conversions_successful == 0) + return 0; +#if 0 && defined(MODULE) + MOD_INC_USE_COUNT; +#endif + return 1; +} + +void +drm32_unregister(void) +{ +#if 0 && defined(MODULE) + if (ioctl_conversions_successful == 0) + return; + MOD_DEC_USE_COUNT; +#endif + return; +} + +static int +__init drm32_init( void ) +{ + return drm_register_ioctl32(); +} + +static void +__exit drm32_cleanup (void) +{ + drm_unregister_ioctl32(); +} + + +module_init(drm32_init); +module_exit(drm32_cleanup); + +EXPORT_SYMBOL(drm32_register); +EXPORT_SYMBOL(drm32_unregister); +EXPORT_SYMBOL(drm32_default_handler); + +#endif Index: extras/drm/linux/drm_ioctl32.h =================================================================== RCS file: extras/drm/linux/drm_ioctl32.h diff -N extras/drm/linux/drm_ioctl32.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ extras/drm/linux/drm_ioctl32.h 28 Jul 2004 20:21:51 -0000 1.1.2.1 @@ -0,0 +1,58 @@ +#ifndef _DRM_IOCTL32_H +# define _DRM_IOCTL32_H + +# ifdef IOCTL32_PRIVATE + +#define DEBUG(x) /**/ /* printk(KERN_DEBUG"%s\n",x) */ + +#define SYS_IOCTL_FUNC sys_ioctl + +# define GET_USER_ARGS(x32,x64,elem) err |= get_user(x64.elem,&x32->elem) +# define PUT_USER_ARGS(x32,x64,elem) err |= put_user(x64.elem,&x32->elem) +# define GET_USER(elem) GET_USER_ARGS(arg32,arg64,elem) +# define PUT_USER(elem) PUT_USER_ARGS(arg32,arg64,elem) +# define GET_USER_P_ARGS(x32,x64,elem) do { \ + err |= get_user(dummy,&x32->elem); \ + x64.elem = (void *) dummy; \ +} while (0); +# define PUT_USER_P_ARGS(x32,x64,elem) do { \ + dummy = (u64) x64.elem; \ + err |= put_user((u32)dummy,&x32->elem); \ +} while (0); + +# define GET_USER_P(elem) GET_USER_P_ARGS(arg32,arg64,elem) +# define PUT_USER_P(elem) PUT_USER_P_ARGS(arg32,arg64,elem) + +# define SYS_IOCTL do { \ + old_fs = get_fs(); \ + set_fs(KERNEL_DS); \ + DEBUG("SYS_IOCTL_FUNC called"); \ + err = SYS_IOCTL_FUNC(fd,cmd,(unsigned long)&arg64); \ + DEBUG("SYS_IOCTL_FUNC done"); \ + set_fs(old_fs); \ + } while (0); + +# define REG_IOCTL32(nr,c_func) \ + err = register_ioctl32_conversion(nr,c_func); \ + if (err) goto failed; + +# define UNREG_IOCTL32(nr) \ + unregister_ioctl32_conversion(nr); + +# define K_ALLOC(x) kmalloc(x,GFP_KERNEL) +# define K_FREE(x) kfree(x) + +# define ASSERT32(x) do { \ + if (arg64.x & 0xFFFFFFFF00000000) \ + printk(KERN_WARNING "ioctl32: var " #x " is > 32bit in ioctl(0x%x)\n",cmd); \ + } while (0) + +extern int drm32_default_handler(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file); + +# endif + +extern int drm32_register(void); +extern void drm32_unregister(void); + +#endif Index: extras/drm/linux/drm_scatter.h =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/linux/drm_scatter.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/linux/drm_scatter.h 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/linux/drm_scatter.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -62,6 +62,12 @@ DRM_MEM_SGLISTS ); } +#ifdef _LP64 +# define ScatterHandle(x) (unsigned int)((x >> 32) + (x & ((1L << 32) - 1))) +#else +# define ScatterHandle(x) (unsigned int)(x) +#endif + int DRM(sg_alloc)( struct inode *inode, struct file *filp, unsigned int cmd, unsigned long arg ) { @@ -113,7 +119,7 @@ } memset( (void *)entry->busaddr, 0, pages * sizeof(*entry->busaddr) ); - entry->virtual = vmalloc_32( pages << PAGE_SHIFT ); + entry->virtual = vmalloc( pages << PAGE_SHIFT ); if ( !entry->virtual ) { DRM(free)( entry->busaddr, entry->pages * sizeof(*entry->busaddr), @@ -132,12 +138,12 @@ */ memset( entry->virtual, 0, pages << PAGE_SHIFT ); - entry->handle = (unsigned long)entry->virtual; + entry->handle = ScatterHandle((unsigned long)entry->virtual); DRM_DEBUG( "sg alloc handle = %08lx\n", entry->handle ); DRM_DEBUG( "sg alloc virtual = %p\n", entry->virtual ); - for ( i = entry->handle, j = 0 ; j < pages ; i += PAGE_SIZE, j++ ) { + for ( i = (unsigned long)entry->virtual, j = 0 ; j < pages ; i += PAGE_SIZE, j++ ) { entry->pagelist[j] = vmalloc_to_page((void *)i); if (!entry->pagelist[j]) goto failed; Index: extras/drm/linux/drm_vm.h =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/linux/drm_vm.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/linux/drm_vm.h 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/linux/drm_vm.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -67,12 +67,12 @@ r_list = list_entry(list, drm_map_list_t, head); map = r_list->map; if (!map) continue; - if (map->offset == VM_OFFSET(vma)) break; + if (map->shandle == VM_OFFSET(vma)) break; } if (map && map->type == _DRM_AGP) { unsigned long offset = address - vma->vm_start; - unsigned long baddr = VM_OFFSET(vma) + offset; + unsigned long baddr = map->offset + offset; struct drm_agp_mem *agpmem; struct page *page; @@ -290,7 +290,7 @@ offset = address - vma->vm_start; - map_offset = map->offset - dev->sg->handle; + map_offset = map->offset - (unsigned long)dev->sg->virtual; page_offset = (offset >> PAGE_SHIFT) + (map_offset >> PAGE_SHIFT); page = entry->pagelist[page_offset]; get_page(page); @@ -496,6 +496,10 @@ #define DRIVER_GET_MAP_OFS() (map->offset) #endif +#ifndef DRIVER_GET_MAP_SHANDLE +#define DRIVER_GET_MAP_SHANDLE() (map->shandle) +#endif + #ifndef DRIVER_GET_REG_OFS #ifdef __alpha__ #define DRIVER_GET_REG_OFS() (dev->hose->dense_mem_base - \ @@ -524,7 +528,7 @@ drm_device_t *dev = priv->dev; drm_map_t *map = NULL; drm_map_list_t *r_list; - unsigned long offset = 0; + unsigned long vm_offset = 0, offset = 0; struct list_head *list; DRM_DEBUG("start = 0x%lx, end = 0x%lx, offset = 0x%lx\n", @@ -551,13 +555,14 @@ for performance, even if the list was a bit longer. */ list_for_each(list, &dev->maplist->head) { - unsigned long off; + unsigned long shandle; r_list = list_entry(list, drm_map_list_t, head); map = r_list->map; if (!map) continue; - off = DRIVER_GET_MAP_OFS(); - if (off == VM_OFFSET(vma)) break; + shandle = DRIVER_GET_MAP_SHANDLE(); + printk(KERN_WARNING"shandle=%lx offset=%lx\n",shandle,VM_OFFSET(vma)); + if (shandle == VM_OFFSET(vma)) break; } if (!map || ((map->flags&_DRM_RESTRICTED) && !capable(CAP_SYS_ADMIN))) @@ -578,7 +583,8 @@ __pte(pgprot_val(vma->vm_page_prot))))); #endif } - + /* fetch real vm_offset from map structure */ + vm_offset = DRIVER_GET_MAP_OFS(); switch (map->type) { case _DRM_AGP: #if __REALLY_HAVE_AGP @@ -598,7 +604,7 @@ /* fall through to _DRM_FRAME_BUFFER... */ case _DRM_FRAME_BUFFER: case _DRM_REGISTERS: - if (VM_OFFSET(vma) >= __pa(high_memory)) { + if (vm_offset >= __pa(high_memory)) { #if defined(__i386__) || defined(__AMD64__) if (boot_cpu_data.x86 > 3 && map->type != _DRM_AGP) { pgprot_val(vma->vm_page_prot) |= _PAGE_PCD; @@ -616,12 +622,12 @@ offset = DRIVER_GET_REG_OFS(); #ifdef __sparc__ if (io_remap_page_range(DRM_RPR_ARG(vma) vma->vm_start, - VM_OFFSET(vma) + offset, + vm_offset + offset, vma->vm_end - vma->vm_start, vma->vm_page_prot, 0)) #else if (remap_page_range(DRM_RPR_ARG(vma) vma->vm_start, - VM_OFFSET(vma) + offset, + vm_offset + offset, vma->vm_end - vma->vm_start, vma->vm_page_prot)) #endif @@ -629,7 +635,7 @@ DRM_DEBUG(" Type = %d; start = 0x%lx, end = 0x%lx," " offset = 0x%lx\n", map->type, - vma->vm_start, vma->vm_end, VM_OFFSET(vma) + offset); + vma->vm_start, vma->vm_end, vm_offset + offset); vma->vm_ops = &DRM(vm_ops); break; case _DRM_SHM: Index: extras/drm/linux/gamma_dma.c =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/linux/gamma_dma.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/linux/gamma_dma.c 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/linux/gamma_dma.c 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -827,7 +827,7 @@ map = dev->context_sareas[request.ctx_id]; up(&dev->struct_sem); - request.handle = map->handle; + request.handle = map->shandle; if (copy_to_user((drm_ctx_priv_map_t *)arg, &request, sizeof(request))) return -EFAULT; return 0; @@ -853,7 +853,7 @@ list_for_each(list, &dev->maplist->head) { r_list = list_entry(list, drm_map_list_t, head); if(r_list->map && - r_list->map->handle == request.handle) break; + r_list->map->shandle == request.handle) break; } if (list == &(dev->maplist->head)) { up(&dev->struct_sem); Index: extras/drm/linux/mga_ioctl32.c =================================================================== RCS file: extras/drm/linux/mga_ioctl32.c diff -N extras/drm/linux/mga_ioctl32.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ extras/drm/linux/mga_ioctl32.c 28 Jul 2004 20:21:51 -0000 1.1.2.1 @@ -0,0 +1,164 @@ +#include +#include +#include +#include +#if 0 +#include +#else +#include +#endif +#include +#include +#include +#include +#include + +#ifdef __x86_64__ + +#include +#include "drm.h" +#include "mga_drm.h" +#define IOCTL32_PRIVATE +#include "drm_ioctl32.h" + + +typedef struct drm32_mga_init { + int func; + u32 sarea_priv_offset; + int chipset; + int sgram; + unsigned int maccess; + unsigned int fb_cpp; + unsigned int front_offset, front_pitch; + unsigned int back_offset, back_pitch; + unsigned int depth_cpp; + unsigned int depth_offset, depth_pitch; + unsigned int texture_offset[MGA_NR_TEX_HEAPS]; + unsigned int texture_size[MGA_NR_TEX_HEAPS]; + u32 fb_offset; + u32 mmio_offset; + u32 status_offset; + u32 warp_offset; + u32 primary_offset; + u32 buffers_offset; +} drm32_mga_init_t; + +typedef struct drm32_mga_getpram { + int param; + u32 value; +} drm32_mga_getparam_t; + +#define DRM_IOCTL_MGA_INIT32 DRM_IOW( 0x40, drm32_mga_init_t) +#define DRM_IOCTL_MGA_GETPARAM32 DRM_IOWR(0x49, drm32_mga_getparam_t) + +void mga_unregister_ioctl32(void); + +static int +mga_init_w_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_mga_init_t *arg32 = (drm32_mga_init_t *) arg; + drm_mga_init_t arg64; + mm_segment_t old_fs; + int err = 0; + int i; + + DEBUG("mga_init_w_32_64"); + GET_USER(func); + GET_USER(sarea_priv_offset); + GET_USER(chipset); + GET_USER(sgram); + GET_USER(maccess); + GET_USER(fb_cpp); + GET_USER(front_offset); + GET_USER(front_pitch); + GET_USER(back_offset); + GET_USER(back_pitch); + GET_USER(depth_cpp); + GET_USER(depth_offset); + GET_USER(depth_pitch); + + for (i = 0; i < MGA_NR_TEX_HEAPS; i++) { + GET_USER(texture_offset[i]); + GET_USER(texture_size[i]); + } + + GET_USER(fb_offset); + GET_USER(mmio_offset); + GET_USER(status_offset); + GET_USER(warp_offset); + GET_USER(primary_offset); + GET_USER(buffers_offset); + + if (err) return -EFAULT; + + SYS_IOCTL; + return err; +} + +static int +mga_getparam_wr_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_mga_getparam_t *arg32 = (drm32_mga_getparam_t *) arg; + drm_mga_getparam_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("mga_getparam_wr_32_64"); + GET_USER(param); + GET_USER_P(value); + + if (err) return -EFAULT; + + SYS_IOCTL; + DEBUG("done"); + + return err; +} + +int +mga_register_ioctl32(void) +{ + int err; + + if (!drm32_register()) return -1; + REG_IOCTL32(DRM_IOCTL_MGA_INIT32,mga_init_w_32_64); + REG_IOCTL32(DRM_IOCTL_MGA_GETPARAM32,mga_getparam_wr_32_64); + + REG_IOCTL32(DRM_IOCTL_MGA_FLUSH,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_MGA_RESET,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_MGA_SWAP,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_MGA_CLEAR,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_MGA_VERTEX,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_MGA_INDICES,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_MGA_ILOAD,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_MGA_BLIT,drm32_default_handler); + + return 0; + failed: + mga_unregister_ioctl32(); + return -1; +} + +void +mga_unregister_ioctl32(void) +{ + UNREG_IOCTL32(DRM_IOCTL_MGA_INIT32); + UNREG_IOCTL32(DRM_IOCTL_MGA_GETPARAM32); + UNREG_IOCTL32(DRM_IOCTL_MGA_FLUSH); + UNREG_IOCTL32(DRM_IOCTL_MGA_RESET); + UNREG_IOCTL32(DRM_IOCTL_MGA_RESET); + UNREG_IOCTL32(DRM_IOCTL_MGA_SWAP); + UNREG_IOCTL32(DRM_IOCTL_MGA_CLEAR); + UNREG_IOCTL32(DRM_IOCTL_MGA_VERTEX); + UNREG_IOCTL32(DRM_IOCTL_MGA_INDICES); + UNREG_IOCTL32(DRM_IOCTL_MGA_INDICES); + UNREG_IOCTL32(DRM_IOCTL_MGA_ILOAD); + UNREG_IOCTL32(DRM_IOCTL_MGA_BLIT); + + drm32_unregister(); +} + +#endif Index: extras/drm/linux/r128_ioctl32.c =================================================================== RCS file: extras/drm/linux/r128_ioctl32.c diff -N extras/drm/linux/r128_ioctl32.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ extras/drm/linux/r128_ioctl32.c 28 Jul 2004 20:21:51 -0000 1.1.2.1 @@ -0,0 +1,240 @@ +#include +#include +#include +#include +#if 0 +#include +#else +#include +#endif +#include +#include +#include +#include +#include + +#ifdef __x86_64__ + +#include +#include "drm.h" +#include "r128_drm.h" +#define IOCTL32_PRIVATE +#include "drm_ioctl32.h" + +#define DRM_IOCTL_R128_INIT32 DRM_IOW( 0x40, drm32_r128_init_t) +#define DRM_IOCTL_R128_DEPTH32 DRM_IOW( 0x4c, drm32_r128_depth_t) +#define DRM_IOCTL_R128_STIPPLE32 DRM_IOW( 0x4d, drm32_r128_stipple_t) +#define DRM_IOCTL_R128_GETPARAM32 DRM_IOW( 0x52, drm32_r128_getparam_t) + +typedef struct drm32_r128_init { + int func; + unsigned int sarea_priv_offset; + int is_pci; + int cce_mode; + int cce_secure; + 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 int span_offset; + + unsigned int fb_offset; + unsigned int mmio_offset; + unsigned int ring_offset; + unsigned int ring_rptr_offset; + unsigned int buffers_offset; + unsigned int agp_textures_offset; +} drm32_r128_init_t; + +typedef struct drm32_r128_depth { + int func; + int n; + u32 x; + u32 y; + u32 buffer; + u32 mask; +} drm32_r128_depth_t; + +typedef struct drm32_r128_stipple { + u32 mask; +} drm32_r128_stipple_t; + +typedef struct drm32_r128_getparam { + int param; + u32 value; +} drm32_r128_getparam_t; + +static int +drm_128_init_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_r128_init_t *arg32 = (drm32_r128_init_t *) arg; + drm_r128_init_t arg64; + mm_segment_t old_fs; + int err = 0; + + DEBUG("r128_init_32_64"); + + GET_USER(func); + GET_USER(sarea_priv_offset); + GET_USER(is_pci); + GET_USER(cce_mode); + GET_USER(cce_secure); + GET_USER(ring_size); + GET_USER(usec_timeout); + GET_USER(fb_bpp); + GET_USER(front_offset); + GET_USER(front_pitch); + GET_USER(back_offset); + GET_USER(back_pitch); + GET_USER(depth_bpp); + GET_USER(depth_offset); + GET_USER(depth_pitch); + GET_USER(span_offset); + GET_USER(fb_offset); + GET_USER(mmio_offset); + GET_USER(ring_offset); + GET_USER(ring_rptr_offset); + GET_USER(buffers_offset); + GET_USER(agp_textures_offset); + + if (err) return -EFAULT; + + SYS_IOCTL; + return err; +} + +static int +drm_128_depth_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_r128_depth_t *arg32 = (drm32_r128_depth_t *) arg; + drm_r128_depth_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("r128_depth_32_64"); + + GET_USER(func); + GET_USER(n); + GET_USER_P(x); + GET_USER_P(y); + GET_USER_P(buffer); + GET_USER_P(mask); + + if (err) return -EFAULT; + + SYS_IOCTL; + return err; +} + +static int +drm_128_stipple_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_r128_stipple_t *arg32 = (drm32_r128_stipple_t *) arg; + drm_r128_stipple_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("r128_stipple_32_64"); + + GET_USER_P(mask); + + if (err) return -EFAULT; + + SYS_IOCTL; + return err; +} + +static int +drm_128_getparam_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_r128_getparam_t *arg32 = (drm32_r128_getparam_t *) arg; + drm_r128_getparam_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("r128_getparam_wr_32_64"); + GET_USER(param); + GET_USER_P(value); + + if (err) return -EFAULT; + + SYS_IOCTL; + DEBUG("done"); + + return err; +} + + +void +r128_unregister_ioctl32(void); + +int +r128_register_ioctl32(void) +{ + int err; + + if (!drm32_register()) return -1; + REG_IOCTL32(DRM_IOCTL_R128_INIT32, drm_128_init_32_64); + REG_IOCTL32(DRM_IOCTL_R128_DEPTH32, drm_128_depth_32_64); + REG_IOCTL32(DRM_IOCTL_R128_STIPPLE32, drm_128_stipple_32_64); + REG_IOCTL32(DRM_IOCTL_R128_GETPARAM32, drm_128_getparam_32_64); + + REG_IOCTL32(DRM_IOCTL_R128_CCE_START, drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_R128_CCE_STOP, drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_R128_CCE_RESET, drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_R128_CCE_IDLE, drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_R128_RESET, drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_R128_SWAP, drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_R128_CLEAR, drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_R128_VERTEX, drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_R128_INDICES, drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_R128_BLIT, drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_R128_INDIRECT, drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_R128_FULLSCREEN, drm32_default_handler); +// REG_IOCTL32(DRM_IOCTL_R128_CLEAR2, drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_R128_FLIP, drm32_default_handler); + + return 0; + failed: + r128_unregister_ioctl32(); + return -1; +} + +void +r128_unregister_ioctl32(void) +{ + UNREG_IOCTL32(DRM_IOCTL_R128_INIT32); + UNREG_IOCTL32(DRM_IOCTL_R128_DEPTH32); + UNREG_IOCTL32(DRM_IOCTL_R128_STIPPLE32); + UNREG_IOCTL32(DRM_IOCTL_R128_GETPARAM); + + UNREG_IOCTL32(DRM_IOCTL_R128_CCE_START); + UNREG_IOCTL32(DRM_IOCTL_R128_CCE_STOP); + UNREG_IOCTL32(DRM_IOCTL_R128_CCE_RESET); + UNREG_IOCTL32(DRM_IOCTL_R128_CCE_IDLE); + UNREG_IOCTL32(DRM_IOCTL_R128_RESET); + UNREG_IOCTL32(DRM_IOCTL_R128_SWAP); + UNREG_IOCTL32(DRM_IOCTL_R128_CLEAR); + UNREG_IOCTL32(DRM_IOCTL_R128_VERTEX); + UNREG_IOCTL32(DRM_IOCTL_R128_INDICES); + UNREG_IOCTL32(DRM_IOCTL_R128_BLIT); + UNREG_IOCTL32(DRM_IOCTL_R128_INDIRECT); + UNREG_IOCTL32(DRM_IOCTL_R128_FULLSCREEN); +// UNREG_IOCTL32(DRM_IOCTL_R128_CLEAR2); + UNREG_IOCTL32(DRM_IOCTL_R128_FLIP); + + drm32_unregister(); +} + +#endif Index: extras/drm/linux/radeon_ioctl32.c =================================================================== RCS file: extras/drm/linux/radeon_ioctl32.c diff -N extras/drm/linux/radeon_ioctl32.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ extras/drm/linux/radeon_ioctl32.c 28 Jul 2004 20:21:51 -0000 1.1.2.1 @@ -0,0 +1,462 @@ +#include +#include +#include +#include +#if 0 +#include +#else +#include +#endif +#include +#include +#include +#include +#include + +#ifdef __x86_64__ + +#include +#include "drm.h" +#include "radeon_drm.h" +#define IOCTL32_PRIVATE +#include "drm_ioctl32.h" + + + +typedef struct drm32_radeon_clear { + unsigned int flags; + unsigned int clear_color; + unsigned int clear_depth; + unsigned int color_mask; + unsigned int depth_mask; + u32 depth_boxes; /* drm_radeon_clear_rect_t * */ +} drm32_radeon_clear_t; + +typedef struct drm32_radeon_stipple { + u32 mask; /* unsigned int * */ +} drm32_radeon_stipple_t; + +typedef struct drm32_radeon_tex_image { + unsigned int x, y; /* Blit coordinates */ + unsigned int width, height; + u32 data; /* const void * */ +} drm32_radeon_tex_image_t; + +typedef struct drm32_radeon_texture { + int offset; + int pitch; + int format; + int width; /* Texture image coordinates */ + int height; + u32 image; /* drm_radeon_tex_image_t * */ +} drm32_radeon_texture_t; + +typedef struct drm32_radeon_vertex2 { + int idx; + int discard; + int nr_states; + u32 state; /* drm_radeon_state_t */ + int nr_prims; + u32 prim; /* drm_radeon_prim_t */ +} drm32_radeon_vertex2_t; + +typedef struct drm32_radeon_init { + int func; + unsigned int sarea_priv_offset; + int is_pci; + int cp_mode; + int gart_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; + + u32 fb_offset; + u32 mmio_offset; + u32 ring_offset; + u32 ring_rptr_offset; + u32 buffers_offset; + u32 gart_textures_offset; +} drm32_radeon_init_t; + +typedef struct drm32_radeon_getparam { + int param; + u32 value; +} drm32_radeon_getparam_t; + +typedef struct drm32_radeon_mem_alloc { + int region; + int alignment; + int size; + u32 region_offset; /* offset from start of fb or agp */ +} drm32_radeon_mem_alloc_t; + +typedef struct drm32_radeon_irq_emit { + u32 irq_seq; +} drm32_radeon_irq_emit_t; + +typedef struct drm32_radeon_cmd_buffer { + int bufsz; + u32 buf; + int nbox; + u32 boxes; +} drm32_radeon_cmd_buffer_t; + +typedef struct drm32_radeon_setparam { + unsigned int param; + int64_t value; +} __attribute__((packed)) drm32_radeon_setparam_t; + + +#define DRM_IOCTL_RADEON_CLEAR32 DRM_IOW( 0x48, drm32_radeon_clear_t) +#define DRM_IOCTL_RADEON_STIPPLE32 DRM_IOW( 0x4c, drm32_radeon_stipple_t) +#define DRM_IOCTL_RADEON_TEXTURE32 DRM_IOWR(0x4e, drm32_radeon_texture_t) +#define DRM_IOCTL_RADEON_VERTEX232 DRM_IOW( 0x4f, drm32_radeon_vertex2_t) +#define DRM_IOCTL_RADEON_CP_INIT32 DRM_IOW( 0x40, drm32_radeon_init_t) +#define DRM_IOCTL_RADEON_ALLOC32 DRM_IOWR(0x53, drm32_radeon_mem_alloc_t) +#define DRM_IOCTL_RADEON_IRQ_EMIT32 DRM_IOWR(0x56, drm32_radeon_irq_emit_t) +#define DRM_IOCTL_RADEON_GETPARAM32 DRM_IOWR(0x51, drm32_radeon_getparam_t) +#define DRM_IOCTL_RADEON_CMDBUF32 DRM_IOW(0x50, drm32_radeon_cmd_buffer_t) +#define DRM_IOCTL_RADEON_SETPARAM32 DRM_IOW(0x59, drm32_radeon_setparam_t) + + +void radeon_unregister_ioctl32(void); + +static int +drm_clear_w_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_radeon_clear_t *arg32 = (drm32_radeon_clear_t *) arg; + drm_radeon_clear_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("drm_clear_w_32_64"); + GET_USER(flags); + GET_USER(clear_color); + GET_USER(clear_depth); + GET_USER(color_mask); + GET_USER(depth_mask); + GET_USER_P(depth_boxes); + + if (err) return -EFAULT; + + SYS_IOCTL; + return err; +} + +static int +drm_stipple_w_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_radeon_stipple_t *arg32 = (drm32_radeon_stipple_t *) arg; + drm_radeon_stipple_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("drm_stipple_w_32_64"); + GET_USER_P(mask); + + if (err) return -EFAULT; + + SYS_IOCTL; + return err; +} + +static int +drm_texture_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_radeon_texture_t *arg32 = (drm32_radeon_texture_t *) arg; + drm_radeon_texture_t arg64; + drm32_radeon_tex_image_t *image32; + drm_radeon_tex_image_t image64; + mm_segment_t old_fs; + int err = 0, err_tmp = 0; + u64 dummy; + + DEBUG("drm_texture_32_64"); + GET_USER(offset); + GET_USER(pitch); + GET_USER(format); + GET_USER(width); + GET_USER(height); + image32 = (drm32_radeon_tex_image_t *)(unsigned long)(arg32->image); + arg64.image = &image64; + err |= get_user(image64.x,&image32->x); + err |= get_user(image64.y,&image32->y); + err |= get_user(image64.width,&image32->width); + err |= get_user(image64.height,&image32->height); + err |= get_user(dummy,&image32->data); + image64.data = (void *)dummy; + + if (err) return -EFAULT; + + SYS_IOCTL; + err_tmp = err; + err = 0; + + PUT_USER(offset); + PUT_USER(pitch); + PUT_USER(format); + PUT_USER(width); + PUT_USER(height); + err |= put_user(image64.x,&image32->x); + err |= put_user(image64.y,&image32->y); + err |= put_user(image64.width,&image32->width); + err |= put_user(image64.height,&image32->height); + dummy = (u64)image64.data; + + err |= put_user((u32)dummy,&image32->data); + return err ? -EFAULT : err_tmp; +} + +static int +drm_vertex2_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_radeon_vertex2_t *arg32 = (drm32_radeon_vertex2_t *) arg; + drm_radeon_vertex2_t arg64; + mm_segment_t old_fs; + u64 dummy; + int err = 0; + + DEBUG("drm_vertex2_32_64"); + + GET_USER(idx); + GET_USER(discard); + GET_USER(nr_states); + GET_USER_P(state); + GET_USER(nr_prims); + GET_USER_P(prim); + + if (err) + return -EFAULT; + + SYS_IOCTL; + + return err; +} + +static int +drm_radeon_init_w_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_radeon_init_t *arg32 = (drm32_radeon_init_t *) arg; + drm_radeon_init_t arg64; + mm_segment_t old_fs; + int err = 0; + + DEBUG("radeon_init_w_32_64"); + + GET_USER(func); + GET_USER(sarea_priv_offset); + GET_USER(is_pci); + GET_USER(cp_mode); + GET_USER(gart_size); + GET_USER(ring_size); + GET_USER(usec_timeout); + GET_USER(fb_bpp); + GET_USER(front_offset); + GET_USER(front_pitch); + GET_USER(back_offset); + GET_USER(back_pitch); + GET_USER(depth_bpp); + GET_USER(depth_offset); + GET_USER(depth_pitch); + GET_USER(fb_offset); + GET_USER(mmio_offset); + GET_USER(ring_offset); + GET_USER(ring_rptr_offset); + GET_USER(buffers_offset); + GET_USER(gart_textures_offset); + + if (err) return -EFAULT; + + SYS_IOCTL; + return err; +} + +static int +drm_radeon_cmd_buffer_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_radeon_cmd_buffer_t *arg32 = (drm32_radeon_cmd_buffer_t *) arg; + drm_radeon_cmd_buffer_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("radeon_cmd_buffer_32_64"); + + GET_USER(bufsz); + GET_USER_P(buf); + GET_USER(nbox); + GET_USER_P(boxes); + + if (err) return -EFAULT; + + SYS_IOCTL; + return err; +} + +static int +drm_radeon_mem_alloc_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_radeon_mem_alloc_t *arg32 = (drm32_radeon_mem_alloc_t *) arg; + drm_radeon_mem_alloc_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("radeon_alloc_32_64"); + + GET_USER(region); + GET_USER(alignment); + GET_USER(size); + GET_USER_P(region_offset); + + if (err) return -EFAULT; + + SYS_IOCTL; + return err; +} + +static int +drm_radeon_irq_emit_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_radeon_irq_emit_t *arg32 = (drm32_radeon_irq_emit_t *) arg; + drm_radeon_irq_emit_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("radeon_irq_emit_32_64"); + + GET_USER_P(irq_seq); + + if (err) return -EFAULT; + + SYS_IOCTL; + return err; +} + +static int +drm_radeon_getparam_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_radeon_getparam_t *arg32 = (drm32_radeon_getparam_t *) arg; + drm_radeon_getparam_t arg64; + mm_segment_t old_fs; + int err = 0; + u64 dummy; + + DEBUG("radeon_getpram_32_64"); + + GET_USER(param); + GET_USER_P(value); + + if (err) return -EFAULT; + + SYS_IOCTL; + return err; +} + +static int +drm_radeon_setparam_32_64(unsigned int fd, unsigned int cmd, + unsigned long arg, struct file *file) +{ + drm32_radeon_setparam_t *arg32 = (drm32_radeon_setparam_t *) arg; + drm_radeon_setparam_t arg64; + mm_segment_t old_fs; + int err = 0; + + DEBUG("radeon_setparam_32_64"); + + GET_USER(param); + GET_USER(value); + + if (err) return -EFAULT; + + SYS_IOCTL; + return err; +} + +int +radeon_register_ioctl32(void) +{ + int err; + printk(KERN_WARNING"ADD_MAP %lx %lx\n",DRM_IOCTL_ADD_MAP,DRM_IOCTL_OLDADD_MAP); + + if (!drm32_register()) return -1; + REG_IOCTL32(DRM_IOCTL_RADEON_CLEAR32,drm_clear_w_32_64); + REG_IOCTL32(DRM_IOCTL_RADEON_STIPPLE32,drm_stipple_w_32_64); + REG_IOCTL32(DRM_IOCTL_RADEON_TEXTURE32,drm_texture_32_64); + REG_IOCTL32(DRM_IOCTL_RADEON_VERTEX232,drm_vertex2_32_64); + REG_IOCTL32(DRM_IOCTL_RADEON_CP_INIT32,drm_radeon_init_w_32_64); + REG_IOCTL32(DRM_IOCTL_RADEON_ALLOC32,drm_radeon_mem_alloc_32_64); + REG_IOCTL32(DRM_IOCTL_RADEON_IRQ_EMIT32,drm_radeon_irq_emit_32_64); + REG_IOCTL32(DRM_IOCTL_RADEON_GETPARAM32,drm_radeon_getparam_32_64); + REG_IOCTL32(DRM_IOCTL_RADEON_CMDBUF32,drm_radeon_cmd_buffer_32_64); + REG_IOCTL32(DRM_IOCTL_RADEON_SETPARAM32,drm_radeon_setparam_32_64); + + REG_IOCTL32(DRM_IOCTL_RADEON_CP_START,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RADEON_CP_STOP,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RADEON_CP_RESET,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RADEON_CP_IDLE,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RADEON_RESET,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RADEON_FULLSCREEN,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RADEON_SWAP,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RADEON_VERTEX,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RADEON_INDICES,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RADEON_INDIRECT,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RADEON_FLIP,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RADEON_FREE,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RADEON_IRQ_WAIT,drm32_default_handler); + REG_IOCTL32(DRM_IOCTL_RADEON_CP_RESUME,drm32_default_handler); + return 0; + failed: + radeon_unregister_ioctl32(); + return -1; +} + +void +radeon_unregister_ioctl32(void) +{ + UNREG_IOCTL32(DRM_IOCTL_RADEON_CLEAR32); + UNREG_IOCTL32(DRM_IOCTL_RADEON_STIPPLE32); + UNREG_IOCTL32(DRM_IOCTL_RADEON_TEXTURE32); + UNREG_IOCTL32(DRM_IOCTL_RADEON_VERTEX232); + UNREG_IOCTL32(DRM_IOCTL_RADEON_CP_INIT32); + UNREG_IOCTL32(DRM_IOCTL_RADEON_ALLOC32); + UNREG_IOCTL32(DRM_IOCTL_RADEON_IRQ_EMIT32); + UNREG_IOCTL32(DRM_IOCTL_RADEON_GETPARAM32); + UNREG_IOCTL32(DRM_IOCTL_RADEON_CMDBUF32); + UNREG_IOCTL32(DRM_IOCTL_RADEON_SETPARAM32); + + UNREG_IOCTL32(DRM_IOCTL_RADEON_CP_START); + UNREG_IOCTL32(DRM_IOCTL_RADEON_CP_STOP); + UNREG_IOCTL32(DRM_IOCTL_RADEON_CP_RESET); + UNREG_IOCTL32(DRM_IOCTL_RADEON_CP_IDLE); + UNREG_IOCTL32(DRM_IOCTL_RADEON_RESET); + UNREG_IOCTL32(DRM_IOCTL_RADEON_FULLSCREEN); + UNREG_IOCTL32(DRM_IOCTL_RADEON_SWAP); + UNREG_IOCTL32(DRM_IOCTL_RADEON_VERTEX); + UNREG_IOCTL32(DRM_IOCTL_RADEON_INDICES); + UNREG_IOCTL32(DRM_IOCTL_RADEON_INDIRECT); + UNREG_IOCTL32(DRM_IOCTL_RADEON_FLIP); + UNREG_IOCTL32(DRM_IOCTL_RADEON_FREE); + UNREG_IOCTL32(DRM_IOCTL_RADEON_IRQ_WAIT); + UNREG_IOCTL32(DRM_IOCTL_RADEON_CP_RESUME); + + drm32_unregister(); +} + +#endif Index: extras/drm/shared/drm.h =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/shared/drm.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/shared/drm.h 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/shared/drm.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -249,7 +249,7 @@ typedef struct drm_ctx_priv_map { unsigned int ctx_id; /**< Context requesting private mapping */ - void *handle; /**< Handle of map */ + unsigned long handle; /**< Handle of map */ } drm_ctx_priv_map_t; @@ -264,12 +264,23 @@ unsigned long size; /**< Requested physical size (bytes) */ drm_map_type_t type; /**< Type of memory to map */ drm_map_flags_t flags; /**< Flags */ - void *handle; /**< User-space: "Handle" to pass to mmap() */ + unsigned long shandle; /**< User-space: "Handle" to pass to mmap() */ /**< Kernel-space: kernel-virtual address */ int mtrr; /**< MTRR slot used */ + void *handle; /* Private data */ } drm_map_t; +/* backward compatibility */ +typedef struct drm_oldmap { + unsigned long offset; /**< Requested physical address (0 for SAREA)*/ + unsigned long size; /**< Requested physical size (bytes) */ + drm_map_type_t type; /**< Type of memory to map */ + drm_map_flags_t flags; /**< Flags */ + void *handle; /**< User-space: "Handle" to pass to mmap() */ + int mtrr; /**< MTRR slot used */ + /* Private data */ +} drm_oldmap_t; /** * DRM_IOCTL_GET_CLIENT ioctl argument type. @@ -636,6 +647,8 @@ #define DRM_IOCTL_GET_MAGIC DRM_IOR( 0x02, drm_auth_t) #define DRM_IOCTL_IRQ_BUSID DRM_IOWR(0x03, drm_irq_busid_t) #define DRM_IOCTL_GET_MAP DRM_IOWR(0x04, drm_map_t) +/* backward compatibility */ +#define DRM_IOCTL_OLDGET_MAP DRM_IOWR(0x04, drm_oldmap_t) #define DRM_IOCTL_GET_CLIENT DRM_IOWR(0x05, drm_client_t) #define DRM_IOCTL_GET_STATS DRM_IOR( 0x06, drm_stats_t) #define DRM_IOCTL_SET_VERSION DRM_IOWR(0x07, drm_set_version_t) @@ -646,6 +659,8 @@ #define DRM_IOCTL_UNBLOCK DRM_IOWR(0x13, drm_block_t) #define DRM_IOCTL_CONTROL DRM_IOW( 0x14, drm_control_t) #define DRM_IOCTL_ADD_MAP DRM_IOWR(0x15, drm_map_t) +/* backward compatibility */ +#define DRM_IOCTL_OLDADD_MAP DRM_IOWR(0x15, drm_oldmap_t) #define DRM_IOCTL_ADD_BUFS DRM_IOWR(0x16, drm_buf_desc_t) #define DRM_IOCTL_MARK_BUFS DRM_IOW( 0x17, drm_buf_desc_t) #define DRM_IOCTL_INFO_BUFS DRM_IOWR(0x18, drm_buf_info_t) @@ -653,6 +668,8 @@ #define DRM_IOCTL_FREE_BUFS DRM_IOW( 0x1a, drm_buf_free_t) #define DRM_IOCTL_RM_MAP DRM_IOW( 0x1b, drm_map_t) +/* backward compatibility */ +#define DRM_IOCTL_OLDRM_MAP DRM_IOW( 0x1b, drm_oldmap_t) #define DRM_IOCTL_SET_SAREA_CTX DRM_IOW( 0x1c, drm_ctx_priv_map_t) #define DRM_IOCTL_GET_SAREA_CTX DRM_IOWR(0x1d, drm_ctx_priv_map_t) Index: extras/drm/shared/mga.h =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/shared/mga.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/shared/mga.h 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/shared/mga.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -71,6 +71,22 @@ /* Driver customization: */ +#ifdef __x86_64__ +# define DRIVER_REGISTER_IOCTL32CONV() do { \ + mga_register_ioctl32(); \ +} while (0) +#else +# define DRIVER_REGISTER_IOCTL32CONV() +#endif + +#ifdef __x86_64__ +# define DRIVER_UNREGISTER_IOCTL32CONV() do { \ + mga_unregister_ioctl32(); \ +} while (0) +#else +# define DRIVER_UNREGISTER_IOCTL32CONV() +#endif + #define DRIVER_PRETAKEDOWN( dev ) do { \ mga_do_cleanup_dma( dev ); \ } while (0) Index: extras/drm/shared/mga_drv.h =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/shared/mga_drv.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/shared/mga_drv.h 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/shared/mga_drv.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -130,6 +130,9 @@ extern int mga_warp_install_microcode( drm_mga_private_t *dev_priv ); extern int mga_warp_init( drm_mga_private_t *dev_priv ); +extern int mga_register_ioctl32( void ); +extern void mga_unregister_ioctl32( void ); + #define mga_flush_write_combine() DRM_WRITEMEMORYBARRIER() #if defined(__linux__) && defined(__alpha__) Index: extras/drm/shared/r128.h =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/shared/r128.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/shared/r128.h 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/shared/r128.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -81,6 +81,15 @@ /* Driver customization: */ +#ifdef __x86_64__ +# define DRIVER_REGISTER_IOCTL32CONV() do { \ + r128_register_ioctl32(); \ +} while (0) +# define DRIVER_UNREGISTER_IOCTL32CONV() do { \ + r128_unregister_ioctl32(); \ +} while (0) +#endif + #define DRIVER_PRERELEASE() do { \ if ( dev->dev_private ) { \ drm_r128_private_t *dev_priv = dev->dev_private; \ Index: extras/drm/shared/r128_cce.c =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/shared/r128_cce.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/shared/r128_cce.c 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/shared/r128_cce.c 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -327,7 +327,8 @@ ring_start = dev_priv->cce_ring->offset - dev->agp->base; else #endif - ring_start = dev_priv->cce_ring->offset - dev->sg->handle; + ring_start = dev_priv->cce_ring->offset + - (unsigned long)dev->sg->virtual; R128_WRITE( R128_PM4_BUFFER_OFFSET, ring_start | R128_AGP_OFFSET ); @@ -539,7 +540,7 @@ dev_priv->cce_buffers_offset = dev->agp->base; else #endif - dev_priv->cce_buffers_offset = dev->sg->handle; + dev_priv->cce_buffers_offset = (unsigned long)dev->sg->virtual; dev_priv->ring.start = (u32 *)dev_priv->cce_ring->handle; dev_priv->ring.end = ((u32 *)dev_priv->cce_ring->handle Index: extras/drm/shared/r128_drv.h =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/shared/r128_drv.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/shared/r128_drv.h 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/shared/r128_drv.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -123,6 +123,9 @@ extern int r128_cce_buffers( DRM_IOCTL_ARGS ); extern int r128_getparam( DRM_IOCTL_ARGS ); +extern int r128_register_ioctl32( void ); +extern void r128_unregister_ioctl32( void ); + extern void r128_freelist_reset( drm_device_t *dev ); extern drm_buf_t *r128_freelist_get( drm_device_t *dev ); Index: extras/drm/shared/radeon.h =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/shared/radeon.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/shared/radeon.h 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/shared/radeon.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -133,6 +133,18 @@ * * DRM infrastructure takes care of reclaiming dma buffers. */ +#ifdef __x86_64__ +# define DRIVER_REGISTER_IOCTL32CONV() do { \ + radeon_register_ioctl32(); \ +} while (0) +# define DRIVER_UNREGISTER_IOCTL32CONV() do { \ + radeon_unregister_ioctl32(); \ +} while (0) +#else +# define DRIVER_REGISTER_IOCTL32CONV() +# define DRIVER_UNREGISTER_IOCTL32CONV() +#endif + #define DRIVER_PRERELEASE() \ do { \ if ( dev->dev_private ) { \ Index: extras/drm/shared/radeon_cp.c =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/shared/radeon_cp.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/shared/radeon_cp.c 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/shared/radeon_cp.c 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -871,10 +871,11 @@ } else #endif ring_start = (dev_priv->cp_ring->offset - - dev->sg->handle + - (unsigned long)dev->sg->virtual + dev_priv->gart_vm_start); RADEON_WRITE( RADEON_CP_RB_BASE, ring_start ); + RADEON_READ( RADEON_CP_RB_WPTR_DELAY ); /* read back to propagate */ /* Set the write pointer delay */ RADEON_WRITE( RADEON_CP_RB_WPTR_DELAY, 0 ); @@ -897,14 +898,15 @@ drm_sg_mem_t *entry = dev->sg; unsigned long tmp_ofs, page_ofs; - tmp_ofs = dev_priv->ring_rptr->offset - dev->sg->handle; + tmp_ofs = dev_priv->ring_rptr->offset + - (unsigned long)dev->sg->virtual; page_ofs = tmp_ofs >> PAGE_SHIFT; RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR, entry->busaddr[page_ofs]); DRM_DEBUG( "ring rptr: offset=0x%08lx handle=0x%08lx\n", - (unsigned long) entry->busaddr[page_ofs], - entry->handle + tmp_ofs ); + (unsigned long)entry->busaddr[page_ofs], + (unsigned long)entry->virtual + tmp_ofs ); } /* Initialize the scratch register pointer. This will cause @@ -1219,7 +1221,7 @@ else #endif dev_priv->gart_buffers_offset = (dev_priv->buffers->offset - - dev->sg->handle + - (unsigned long)dev->sg->virtual + dev_priv->gart_vm_start); DRM_DEBUG( "dev_priv->gart_size %d\n", Index: extras/drm/shared/radeon_drv.h =================================================================== RCS file: /home/eich/cvs/xc/extras/drm/shared/radeon_drv.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- extras/drm/shared/radeon_drv.h 6 Jul 2004 15:08:46 -0000 1.1.1.1 +++ extras/drm/shared/radeon_drv.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -187,6 +187,8 @@ extern int radeon_cp_getparam( DRM_IOCTL_ARGS ); extern int radeon_cp_setparam( DRM_IOCTL_ARGS ); extern int radeon_cp_flip( DRM_IOCTL_ARGS ); +extern int radeon_register_ioctl32( void ); +extern void radeon_unregister_ioctl32( void ); extern int radeon_mem_alloc( DRM_IOCTL_ARGS ); extern int radeon_mem_free( DRM_IOCTL_ARGS ); Index: programs/Xserver/GL/dri/dri.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/GL/dri/dri.c,v retrieving revision 1.1.1.19.2.1 retrieving revision 1.1.1.19.2.1.2.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.19.2.1 -r1.1.1.19.2.1.2.1 --- programs/Xserver/GL/dri/dri.c 22 Jul 2004 08:53:40 -0000 1.1.1.19.2.1 +++ programs/Xserver/GL/dri/dri.c 28 Jul 2004 20:21:51 -0000 1.1.1.19.2.1.2.1 @@ -1281,7 +1281,7 @@ Bool DRIGetDeviceInfo(ScreenPtr pScreen, - drm_handle_t * hFrameBuffer, + drmHandle * hFrameBuffer, int* fbOrigin, int* fbSize, int* fbStride, Index: programs/Xserver/GL/dri/dri.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/GL/dri/dri.h,v retrieving revision 1.1.1.11 retrieving revision 1.1.1.11.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.11 -r1.1.1.11.4.1 --- programs/Xserver/GL/dri/dri.h 6 Jul 2004 15:11:30 -0000 1.1.1.11 +++ programs/Xserver/GL/dri/dri.h 28 Jul 2004 20:21:51 -0000 1.1.1.11.4.1 @@ -225,7 +225,7 @@ drm_clip_rect_t ** pBackClipRects); extern Bool DRIGetDeviceInfo(ScreenPtr pScreen, - drm_handle_t * hFrameBuffer, + drmHandle * hFrameBuffer, int* fbOrigin, int* fbSize, int* fbStride, Index: programs/Xserver/GL/dri/xf86dri.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/GL/dri/xf86dri.c,v retrieving revision 1.1.1.10.2.1 retrieving revision 1.1.1.10.2.1.2.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.10.2.1 -r1.1.1.10.2.1.2.1 --- programs/Xserver/GL/dri/xf86dri.c 22 Jul 2004 08:53:40 -0000 1.1.1.10.2.1 +++ programs/Xserver/GL/dri/xf86dri.c 28 Jul 2004 20:21:51 -0000 1.1.1.10.2.1.2.1 @@ -209,11 +209,7 @@ ((rep.busIdStringLength + 3) & ~3)) >> 2; rep.hSAREALow = (CARD32)(hSAREA & 0xffffffff); -#ifdef LONG64 - rep.hSAREAHigh = (CARD32)(hSAREA >> 32); -#else rep.hSAREAHigh = 0; -#endif WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *)&rep); if (rep.busIdStringLength) @@ -547,11 +543,7 @@ } rep.hFrameBufferLow = (CARD32)(hFrameBuffer & 0xffffffff); -#ifdef LONG64 - rep.hFrameBufferHigh = (CARD32)(hFrameBuffer >> 32); -#else rep.hFrameBufferHigh = 0; -#endif rep.length = 0; if (rep.devPrivateSize) { Index: programs/Xserver/hw/xfree86/drivers/ati/mach64_dri.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/mach64_dri.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- programs/Xserver/hw/xfree86/drivers/ati/mach64_dri.h 6 Jul 2004 15:12:06 -0000 1.1.1.1 +++ programs/Xserver/hw/xfree86/drivers/ati/mach64_dri.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -34,28 +34,28 @@ #include "xf86drm.h" typedef struct { - drm_handle_t fbHandle; + drmHandle fbHandle; - drm_handle_t regsHandle; + drmHandle regsHandle; drmSize regsSize; int IsPCI; - drm_handle_t agpHandle; /* Handle from drmAgpAlloc */ + drmHandle agpHandle; /* Handle from drmAgpAlloc */ unsigned long agpOffset; drmSize agpSize; int agpMode; /* DMA descriptor ring */ unsigned long ringStart; /* Offset into AGP space */ - drm_handle_t ringHandle; /* Handle from drmAddMap */ + drmHandle ringHandle; /* Handle from drmAddMap */ drmSize ringMapSize; /* Size of map */ int ringSize; /* Size of ring (in kB) */ drmAddress ringMap; /* Map */ /* vertex buffer data */ unsigned long bufferStart; /* Offset into AGP space */ - drm_handle_t bufferHandle; /* Handle from drmAddMap */ + drmHandle bufferHandle; /* Handle from drmAddMap */ drmSize bufferMapSize; /* Size of map */ int bufferSize; /* Size of buffers (in MB) */ drmAddress bufferMap; /* Map */ @@ -65,7 +65,7 @@ /* AGP Texture data */ unsigned long agpTexStart; /* Offset into AGP space */ - drm_handle_t agpTexHandle; /* Handle from drmAddMap */ + drmHandle agpTexHandle; /* Handle from drmAddMap */ drmSize agpTexMapSize; /* Size of map */ int agpTexSize; /* Size of AGP tex space (in MB) */ drmAddress agpTexMap; /* Map */ @@ -113,10 +113,10 @@ unsigned int textureSize; int logTextureGranularity; - drm_handle_t regs; + drmHandle regs; drmSize regsSize; - drm_handle_t agp; + drmHandle agp; drmSize agpSize; unsigned int agpTextureOffset; unsigned int agpTextureSize; Index: programs/Xserver/hw/xfree86/drivers/ati/r128.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/r128.h,v retrieving revision 1.1.1.21 retrieving revision 1.1.1.21.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.21 -r1.1.1.21.4.1 --- programs/Xserver/hw/xfree86/drivers/ati/r128.h 6 Jul 2004 15:12:09 -0000 1.1.1.21 +++ programs/Xserver/hw/xfree86/drivers/ati/r128.h 28 Jul 2004 20:21:51 -0000 1.1.1.21.4.1 @@ -294,14 +294,14 @@ __GLXvisualConfig *pVisualConfigs; R128ConfigPrivPtr pVisualConfigsPriv; - drm_handle_t fbHandle; + drmHandle fbHandle; drmSize registerSize; - drm_handle_t registerHandle; + drmHandle registerHandle; Bool IsPCI; /* Current card is a PCI card */ drmSize pciSize; - drm_handle_t pciMemHandle; + drmHandle pciMemHandle; unsigned char *PCI; /* Map */ Bool allowPageFlip; /* Enable 3d page flipping */ @@ -309,7 +309,7 @@ int drmMinor; drmSize agpSize; - drm_handle_t agpMemHandle; /* Handle from drmAgpAlloc */ + drmHandle agpMemHandle; /* Handle from drmAgpAlloc */ unsigned long agpOffset; unsigned char *AGP; /* Map */ int agpMode; @@ -322,20 +322,20 @@ /* CCE ring buffer data */ unsigned long ringStart; /* Offset into AGP space */ - drm_handle_t ringHandle; /* Handle from drmAddMap */ + drmHandle ringHandle; /* Handle from drmAddMap */ drmSize ringMapSize; /* Size of map */ int ringSize; /* Size of ring (in MB) */ unsigned char *ring; /* Map */ int ringSizeLog2QW; unsigned long ringReadOffset; /* Offset into AGP space */ - drm_handle_t ringReadPtrHandle; /* Handle from drmAddMap */ + drmHandle ringReadPtrHandle; /* Handle from drmAddMap */ drmSize ringReadMapSize; /* Size of map */ unsigned char *ringReadPtr; /* Map */ /* CCE vertex/indirect buffer data */ unsigned long bufStart; /* Offset into AGP space */ - drm_handle_t bufHandle; /* Handle from drmAddMap */ + drmHandle bufHandle; /* Handle from drmAddMap */ drmSize bufMapSize; /* Size of map */ int bufSize; /* Size of buffers (in MB) */ unsigned char *buf; /* Map */ @@ -344,7 +344,7 @@ /* CCE AGP Texture data */ unsigned long agpTexStart; /* Offset into AGP space */ - drm_handle_t agpTexHandle; /* Handle from drmAddMap */ + drmHandle agpTexHandle; /* Handle from drmAddMap */ drmSize agpTexMapSize; /* Size of map */ int agpTexSize; /* Size of AGP tex space (in MB) */ unsigned char *agpTex; /* Map */ Index: programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c,v retrieving revision 1.1.1.25 retrieving revision 1.1.1.25.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.25 -r1.1.1.25.4.1 --- programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c 6 Jul 2004 15:12:09 -0000 1.1.1.25 +++ programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c 28 Jul 2004 20:21:51 -0000 1.1.1.25.4.1 @@ -490,7 +490,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[agp] %d kB allocated with handle 0x%08lx\n", + "[agp] %d kB allocated with handle 0x%08x\n", info->agpSize*1024, info->agpMemHandle); if (drmAgpBind(info->drmFD, info->agpMemHandle, info->agpOffset) < 0) { @@ -530,7 +530,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[agp] ring handle = 0x%08lx\n", info->ringHandle); + "[agp] ring handle = 0x%08x\n", info->ringHandle); if (drmMap(info->drmFD, info->ringHandle, info->ringMapSize, (drmAddressPtr)&info->ring) < 0) { @@ -548,7 +548,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[agp] ring read ptr handle = 0x%08lx\n", + "[agp] ring read ptr handle = 0x%08x\n", info->ringReadPtrHandle); if (drmMap(info->drmFD, info->ringReadPtrHandle, info->ringReadMapSize, @@ -568,7 +568,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[agp] vertex/indirect buffers handle = 0x%08lx\n", + "[agp] vertex/indirect buffers handle = 0x%08x\n", info->bufHandle); if (drmMap(info->drmFD, info->bufHandle, info->bufMapSize, @@ -588,7 +588,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[agp] AGP texture map handle = 0x%08lx\n", + "[agp] AGP texture map handle = 0x%08x\n", info->agpTexHandle); if (drmMap(info->drmFD, info->agpTexHandle, info->agpTexMapSize, @@ -650,7 +650,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[pci] %d kB allocated with handle 0x%08lx\n", + "[pci] %d kB allocated with handle 0x%08x\n", info->agpSize*1024, info->pciMemHandle); /* Initialize the CCE ring buffer data */ @@ -674,7 +674,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[pci] ring handle = 0x%08lx\n", info->ringHandle); + "[pci] ring handle = 0x%08x\n", info->ringHandle); if (drmMap(info->drmFD, info->ringHandle, info->ringMapSize, (drmAddressPtr)&info->ring) < 0) { @@ -695,7 +695,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[pci] ring read ptr handle = 0x%08lx\n", + "[pci] ring read ptr handle = 0x%08x\n", info->ringReadPtrHandle); if (drmMap(info->drmFD, info->ringReadPtrHandle, info->ringReadMapSize, @@ -718,7 +718,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[pci] vertex/indirect buffers handle = 0x%08lx\n", + "[pci] vertex/indirect buffers handle = 0x%08x\n", info->bufHandle); if (drmMap(info->drmFD, info->bufHandle, info->bufMapSize, @@ -819,7 +819,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] register handle = 0x%08lx\n", info->registerHandle); + "[drm] register handle = 0x%08x\n", info->registerHandle); return TRUE; } Index: programs/Xserver/hw/xfree86/drivers/ati/r128_dri.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.h,v retrieving revision 1.1.1.8 retrieving revision 1.1.1.8.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.8 -r1.1.1.8.4.1 --- programs/Xserver/hw/xfree86/drivers/ati/r128_dri.h 6 Jul 2004 15:12:09 -0000 1.1.1.8 +++ programs/Xserver/hw/xfree86/drivers/ati/r128_dri.h 28 Jul 2004 20:21:51 -0000 1.1.1.8.4.1 @@ -87,11 +87,11 @@ int log2TexGran; /* MMIO register data */ - drm_handle_t registerHandle; + drmHandle registerHandle; drmSize registerSize; /* CCE AGP Texture data */ - drm_handle_t agpTexHandle; + drmHandle agpTexHandle; drmSize agpTexMapSize; int log2AGPTexGran; int agpTexOffset; Index: programs/Xserver/hw/xfree86/drivers/ati/radeon.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon.h,v retrieving revision 1.1.1.27 retrieving revision 1.1.1.27.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.27 -r1.1.1.27.4.1 --- programs/Xserver/hw/xfree86/drivers/ati/radeon.h 6 Jul 2004 15:12:08 -0000 1.1.1.27 +++ programs/Xserver/hw/xfree86/drivers/ati/radeon.h 28 Jul 2004 20:21:51 -0000 1.1.1.27.4.1 @@ -426,14 +426,14 @@ __GLXvisualConfig *pVisualConfigs; RADEONConfigPrivPtr pVisualConfigsPriv; - drm_handle_t fbHandle; + drmHandle fbHandle; drmSize registerSize; - drm_handle_t registerHandle; + drmHandle registerHandle; Bool IsPCI; /* Current card is a PCI card */ drmSize pciSize; - drm_handle_t pciMemHandle; + drmHandle pciMemHandle; unsigned char *PCI; /* Map */ Bool depthMoves; /* Enable depth moves -- slow! */ @@ -442,7 +442,7 @@ int drmMinor; drmSize gartSize; - drm_handle_t agpMemHandle; /* Handle from drmAgpAlloc */ + drmHandle agpMemHandle; /* Handle from drmAgpAlloc */ unsigned long gartOffset; unsigned char *AGP; /* Map */ int agpMode; @@ -459,20 +459,20 @@ /* CP ring buffer data */ unsigned long ringStart; /* Offset into GART space */ - drm_handle_t ringHandle; /* Handle from drmAddMap */ + drmHandle ringHandle; /* Handle from drmAddMap */ drmSize ringMapSize; /* Size of map */ int ringSize; /* Size of ring (in MB) */ unsigned char *ring; /* Map */ int ringSizeLog2QW; unsigned long ringReadOffset; /* Offset into GART space */ - drm_handle_t ringReadPtrHandle; /* Handle from drmAddMap */ + drmHandle ringReadPtrHandle; /* Handle from drmAddMap */ drmSize ringReadMapSize; /* Size of map */ unsigned char *ringReadPtr; /* Map */ /* CP vertex/indirect buffer data */ unsigned long bufStart; /* Offset into GART space */ - drm_handle_t bufHandle; /* Handle from drmAddMap */ + drmHandle bufHandle; /* Handle from drmAddMap */ drmSize bufMapSize; /* Size of map */ int bufSize; /* Size of buffers (in MB) */ unsigned char *buf; /* Map */ @@ -481,7 +481,7 @@ /* CP GART Texture data */ unsigned long gartTexStart; /* Offset into GART space */ - drm_handle_t gartTexHandle; /* Handle from drmAddMap */ + drmHandle gartTexHandle; /* Handle from drmAddMap */ drmSize gartTexMapSize; /* Size of map */ int gartTexSize; /* Size of GART tex space (in MB) */ unsigned char *gartTex; /* Map */ Index: programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c,v retrieving revision 1.1.1.22 retrieving revision 1.1.1.22.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.22 -r1.1.1.22.4.1 --- programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c 6 Jul 2004 15:12:08 -0000 1.1.1.22 +++ programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c 28 Jul 2004 20:21:51 -0000 1.1.1.22.4.1 @@ -803,7 +803,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[agp] %d kB allocated with handle 0x%08lx\n", + "[agp] %d kB allocated with handle 0x%08x\n", info->gartSize*1024, info->agpMemHandle); if (drmAgpBind(info->drmFD, @@ -821,7 +821,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[agp] ring handle = 0x%08lx\n", info->ringHandle); + "[agp] ring handle = 0x%08x\n", info->ringHandle); if (drmMap(info->drmFD, info->ringHandle, info->ringMapSize, (drmAddressPtr)&info->ring) < 0) { @@ -839,7 +839,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[agp] ring read ptr handle = 0x%08lx\n", + "[agp] ring read ptr handle = 0x%08x\n", info->ringReadPtrHandle); if (drmMap(info->drmFD, info->ringReadPtrHandle, info->ringReadMapSize, @@ -859,7 +859,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[agp] vertex/indirect buffers handle = 0x%08lx\n", + "[agp] vertex/indirect buffers handle = 0x%08x\n", info->bufHandle); if (drmMap(info->drmFD, info->bufHandle, info->bufMapSize, @@ -879,7 +879,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[agp] GART texture map handle = 0x%08lx\n", + "[agp] GART texture map handle = 0x%08x\n", info->gartTexHandle); if (drmMap(info->drmFD, info->gartTexHandle, info->gartTexMapSize, @@ -912,7 +912,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[pci] %d kB allocated with handle 0x%08lx\n", + "[pci] %d kB allocated with handle 0x%08x\n", info->gartSize*1024, info->pciMemHandle); RADEONDRIInitGARTValues(info); @@ -924,7 +924,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[pci] ring handle = 0x%08lx\n", info->ringHandle); + "[pci] ring handle = 0x%08x\n", info->ringHandle); if (drmMap(info->drmFD, info->ringHandle, info->ringMapSize, (drmAddressPtr)&info->ring) < 0) { @@ -945,7 +945,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[pci] ring read ptr handle = 0x%08lx\n", + "[pci] ring read ptr handle = 0x%08x\n", info->ringReadPtrHandle); if (drmMap(info->drmFD, info->ringReadPtrHandle, info->ringReadMapSize, @@ -968,7 +968,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[pci] vertex/indirect buffers handle = 0x%08lx\n", + "[pci] vertex/indirect buffers handle = 0x%08x\n", info->bufHandle); if (drmMap(info->drmFD, info->bufHandle, info->bufMapSize, @@ -991,7 +991,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[pci] GART texture map handle = 0x%08lx\n", + "[pci] GART texture map handle = 0x%08x\n", info->gartTexHandle); if (drmMap(info->drmFD, info->gartTexHandle, info->gartTexMapSize, @@ -1019,7 +1019,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] register handle = 0x%08lx\n", info->registerHandle); + "[drm] register handle = 0x%08x\n", info->registerHandle); return TRUE; } Index: programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.h,v retrieving revision 1.1.1.7 retrieving revision 1.1.1.7.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.7 -r1.1.1.7.4.1 --- programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.h 6 Jul 2004 15:12:08 -0000 1.1.1.7 +++ programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.h 28 Jul 2004 20:21:51 -0000 1.1.1.7.4.1 @@ -87,15 +87,15 @@ int log2TexGran; /* MMIO register data */ - drm_handle_t registerHandle; + drmHandle registerHandle; drmSize registerSize; /* CP in-memory status information */ - drm_handle_t statusHandle; + drmHandle statusHandle; drmSize statusSize; /* CP GART Texture data */ - drm_handle_t gartTexHandle; + drmHandle gartTexHandle; drmSize gartTexMapSize; int log2GARTTexGran; int gartTexOffset; Index: programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c,v retrieving revision 1.1.1.39 retrieving revision 1.1.1.39.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.39 -r1.1.1.39.4.1 --- programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c 6 Jul 2004 15:12:08 -0000 1.1.1.39 +++ programs/Xserver/hw/xfree86/drivers/ati/radeon_driver.c 28 Jul 2004 20:21:51 -0000 1.1.1.39.4.1 @@ -5266,7 +5266,7 @@ | RADEON_PPLL_ATOMIC_UPDATE_EN | RADEON_PPLL_VGA_ATOMIC_UPDATE_EN)); - xf86DrvMsg(0, X_INFO, "Wrote: rd=%ld, fd=%ld, pd=%ld\n", + xf86DrvMsg(0, X_INFO, "Wrote: rd=%d, fd=%d, pd=%d\n", restore->ppll_ref_div & RADEON_PPLL_REF_DIV_MASK, restore->ppll_div_3 & RADEON_PPLL_FB3_DIV_MASK, (restore->ppll_div_3 & RADEON_PPLL_POST3_DIV_MASK) >> 16); Index: programs/Xserver/hw/xfree86/drivers/ati/radeon_mergedfb.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_mergedfb.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- programs/Xserver/hw/xfree86/drivers/ati/radeon_mergedfb.c 6 Jul 2004 15:12:12 -0000 1.1.1.1 +++ programs/Xserver/hw/xfree86/drivers/ati/radeon_mergedfb.c 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -406,7 +406,7 @@ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Mode: \"%s\" is not a supported mode for CRT2\n", mode1->name); xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Skipping metamode \"%s\".\n"); + "Skipping metamode.\n"); mode1 = NULL; } else { result = RADEONCopyModeNLink(pScrn, result, mode1, mode2, sr); Index: programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c,v retrieving revision 1.1.1.20 retrieving revision 1.1.1.20.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.20 -r1.1.1.20.4.1 --- programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c 6 Jul 2004 15:12:29 -0000 1.1.1.20 +++ programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c 28 Jul 2004 20:21:51 -0000 1.1.1.20.4.1 @@ -328,7 +328,7 @@ return FALSE; } xf86DrvMsg( pScreen->myNum, X_INFO, - "[agp] %d kB allocated with handle 0x%08lx\n", + "[agp] %d kB allocated with handle 0x%08x\n", pGlint->agp.size/1024, pGlint->agp.handle ); if ( drmAgpBind( pGlint->drmSubFD, pGlint->agp.handle, 0 ) < 0 ) { @@ -348,7 +348,7 @@ return FALSE; } xf86DrvMsg( pScreen->myNum, X_INFO, - "[agp] DMA buffers handle = 0x%08lx\n", + "[agp] DMA buffers handle = 0x%08x\n", pGlint->buffers.handle ); if ( drmMap( pGlint->drmSubFD, pGlint->buffers.handle, @@ -648,7 +648,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] Register handle 0 = 0x%08lx\n", + "[drm] Register handle 0 = 0x%08x\n", pGlintDRI->registers0.handle); /* pci region 0: control regs, following region, client access */ @@ -663,7 +663,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] Register handle 1 = 0x%08lx\n", + "[drm] Register handle 1 = 0x%08x\n", pGlintDRI->registers1.handle); /* pci region 0: control regs, second MX, first 4k page */ @@ -678,7 +678,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] Register handle 2 = 0x%08lx\n", + "[drm] Register handle 2 = 0x%08x\n", pGlintDRI->registers2.handle); /* pci region 0: control regs, second MX, following region */ @@ -693,7 +693,7 @@ return FALSE; } xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] Register handle 3 = 0x%08lx\n", + "[drm] Register handle 3 = 0x%08x\n", pGlintDRI->registers3.handle); /* setup DMA buffers */ Index: programs/Xserver/hw/xfree86/drivers/i810/i810.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h,v retrieving revision 1.1.1.31 retrieving revision 1.1.1.31.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.31 -r1.1.1.31.4.1 --- programs/Xserver/hw/xfree86/drivers/i810/i810.h 6 Jul 2004 15:12:24 -0000 1.1.1.31 +++ programs/Xserver/hw/xfree86/drivers/i810/i810.h 28 Jul 2004 20:21:51 -0000 1.1.1.31.4.1 @@ -245,11 +245,11 @@ unsigned long xvmcHandle; unsigned long sysmemHandle; Bool agpAcquired; - drm_handle_t buffer_map; - drm_handle_t ring_map; - drm_handle_t overlay_map; - drm_handle_t mc_map; - drm_handle_t xvmcContext; + drmHandle buffer_map; + drmHandle ring_map; + drmHandle overlay_map; + drmHandle mc_map; + drmHandle xvmcContext; #endif Bool agpAcquired2d; Index: programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v retrieving revision 1.1.1.32 retrieving revision 1.1.1.32.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.32 -r1.1.1.32.4.1 --- programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c 6 Jul 2004 15:12:25 -0000 1.1.1.32 +++ programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c 28 Jul 2004 20:21:51 -0000 1.1.1.32.4.1 @@ -286,8 +286,8 @@ DRIInfoPtr pDRIInfo; I810DRIPtr pI810DRI; unsigned long tom; - unsigned long agpHandle; - unsigned long dcacheHandle; + drmHandle agpHandle; + drmHandle dcacheHandle; int sysmem_size = 0; int back_size = 0; int pitch_idx = 0; @@ -487,7 +487,7 @@ DRICloseScreen(pScreen); return FALSE; } - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Registers = 0x%08lx\n", + xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Registers = 0x%08x\n", pI810DRI->regs); pI810->backHandle = DRM_AGP_NO_HANDLE; @@ -526,7 +526,7 @@ drmAgpAlloc(pI810->drmSubFD, 4096 * 1024, 1, NULL, &dcacheHandle); pI810->dcacheHandle = dcacheHandle; - xf86DrvMsg(pScreen->myNum, X_INFO, "[agp] dcacheHandle : 0x%lx\n", + xf86DrvMsg(pScreen->myNum, X_INFO, "[agp] dcacheHandle : 0x%x\n", dcacheHandle); #define Elements(x) sizeof(x)/sizeof(*x) Index: programs/Xserver/hw/xfree86/drivers/i810/i810_dri.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.h,v retrieving revision 1.1.1.11 retrieving revision 1.1.1.11.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.11 -r1.1.1.11.4.1 --- programs/Xserver/hw/xfree86/drivers/i810/i810_dri.h 6 Jul 2004 15:12:25 -0000 1.1.1.11 +++ programs/Xserver/hw/xfree86/drivers/i810/i810_dri.h 28 Jul 2004 20:21:51 -0000 1.1.1.11.4.1 @@ -10,20 +10,20 @@ #define I810_MAX_DRAWABLES 256 typedef struct { - drm_handle_t regs; + drmHandle regs; drmSize regsSize; drmAddress regsMap; drmSize backbufferSize; - drm_handle_t backbuffer; + drmHandle backbuffer; drmSize depthbufferSize; - drm_handle_t depthbuffer; + drmHandle depthbuffer; - drm_handle_t textures; + drmHandle textures; int textureSize; - drm_handle_t agp_buffers; + drmHandle agp_buffers; drmSize agp_buf_size; int deviceID; Index: programs/Xserver/hw/xfree86/drivers/i810/i830.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/i810/i830.h,v retrieving revision 1.1.1.11 retrieving revision 1.1.1.11.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.11 -r1.1.1.11.4.1 --- programs/Xserver/hw/xfree86/drivers/i810/i830.h 6 Jul 2004 15:12:24 -0000 1.1.1.11 +++ programs/Xserver/hw/xfree86/drivers/i810/i830.h 28 Jul 2004 20:21:51 -0000 1.1.1.11.4.1 @@ -293,8 +293,8 @@ int numVisualConfigs; __GLXvisualConfig *pVisualConfigs; I830ConfigPrivPtr pVisualConfigsPriv; - drm_handle_t buffer_map; - drm_handle_t ring_map; + drmHandle buffer_map; + drmHandle ring_map; #endif OptionInfoPtr Options; Index: programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c,v retrieving revision 1.1.1.13 retrieving revision 1.1.1.13.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.13 -r1.1.1.13.4.1 --- programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c 6 Jul 2004 15:12:25 -0000 1.1.1.13 +++ programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c 28 Jul 2004 20:21:51 -0000 1.1.1.13.4.1 @@ -591,7 +591,7 @@ DRICloseScreen(pScreen); return FALSE; } - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Registers = 0x%08lx\n", + xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Registers = 0x%08x\n", pI830DRI->regs); /* @@ -611,7 +611,7 @@ DRICloseScreen(pScreen); return FALSE; } - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Back Buffer = 0x%08lx\n", + xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Back Buffer = 0x%08x\n", pI830DRI->backbuffer); pI830DRI->depthbufferSize = pI830->DepthBuffer.Size; @@ -624,7 +624,7 @@ DRICloseScreen(pScreen); return FALSE; } - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Depth Buffer = 0x%08lx\n", + xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Depth Buffer = 0x%08x\n", pI830DRI->depthbuffer); @@ -637,7 +637,7 @@ DRICloseScreen(pScreen); return FALSE; } - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] ring buffer = 0x%08lx\n", + xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] ring buffer = 0x%08x\n", pI830->ring_map); pI830DRI->textureSize = pI830->TexMem.Size; @@ -652,7 +652,7 @@ DRICloseScreen(pScreen); return FALSE; } - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] textures = 0x%08lx\n", + xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] textures = 0x%08x\n", pI830DRI->textures); I830InitDma(pScrn); Index: programs/Xserver/hw/xfree86/drivers/i810/i830_dri.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.h,v retrieving revision 1.1.1.6 retrieving revision 1.1.1.6.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.6 -r1.1.1.6.4.1 --- programs/Xserver/hw/xfree86/drivers/i810/i830_dri.h 6 Jul 2004 15:12:25 -0000 1.1.1.6 +++ programs/Xserver/hw/xfree86/drivers/i810/i830_dri.h 28 Jul 2004 20:21:51 -0000 1.1.1.6.4.1 @@ -16,20 +16,20 @@ #define I830_REG_SIZE 0x80000 typedef struct _I830DRIRec { - drm_handle_t regs; + drmHandle regs; drmSize regsSize; drmAddress regsMap; drmSize backbufferSize; - drm_handle_t backbuffer; + drmHandle backbuffer; drmSize depthbufferSize; - drm_handle_t depthbuffer; + drmHandle depthbuffer; - drm_handle_t textures; + drmHandle textures; int textureSize; - drm_handle_t agp_buffers; + drmHandle agp_buffers; drmSize agp_buf_size; int deviceID; Index: programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v retrieving revision 1.1.1.28 retrieving revision 1.1.1.28.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.28 -r1.1.1.28.4.1 --- programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c 6 Jul 2004 15:12:12 -0000 1.1.1.28 +++ programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c 28 Jul 2004 20:21:51 -0000 1.1.1.28.4.1 @@ -673,7 +673,7 @@ return FALSE; } xf86DrvMsg( pScreen->myNum, X_INFO, - "[agp] %d kB allocated with handle 0x%08lx\n", + "[agp] %d kB allocated with handle 0x%08x\n", pMGADRIServer->agp.size/1024, pMGADRIServer->agp.handle ); if ( drmAgpBind( pMga->drmFD, pMGADRIServer->agp.handle, 0 ) < 0 ) { @@ -695,7 +695,7 @@ return FALSE; } xf86DrvMsg( pScreen->myNum, X_INFO, - "[agp] WARP microcode handle = 0x%08lx\n", + "[agp] WARP microcode handle = 0x%08x\n", pMGADRIServer->warp.handle ); if ( drmMap( pMga->drmFD, @@ -722,7 +722,7 @@ return FALSE; } xf86DrvMsg( pScreen->myNum, X_INFO, - "[agp] Primary DMA handle = 0x%08lx\n", + "[agp] Primary DMA handle = 0x%08x\n", pMGADRIServer->primary.handle ); if ( drmMap( pMga->drmFD, @@ -749,7 +749,7 @@ return FALSE; } xf86DrvMsg( pScreen->myNum, X_INFO, - "[agp] DMA buffers handle = 0x%08lx\n", + "[agp] DMA buffers handle = 0x%08x\n", pMGADRIServer->buffers.handle ); if ( drmMap( pMga->drmFD, @@ -793,7 +793,7 @@ } /* should i map it ? */ xf86DrvMsg( pScreen->myNum, X_INFO, - "[agp] agpTexture handle = 0x%08lx\n", + "[agp] agpTexture handle = 0x%08x\n", pMGADRIServer->agpTextures.handle ); xf86DrvMsg( pScreen->myNum, X_INFO, "[agp] agpTexture size: %d kb\n", pMGADRIServer->agpTextures.size/1024 ); @@ -819,7 +819,7 @@ return FALSE; } xf86DrvMsg( pScreen->myNum, X_INFO, - "[drm] Registers handle = 0x%08lx\n", + "[drm] Registers handle = 0x%08x\n", pMGADRIServer->registers.handle ); pMGADRIServer->status.size = SAREA_MAX; @@ -832,7 +832,7 @@ return FALSE; } xf86DrvMsg( pScreen->myNum, X_INFO, - "[drm] Status handle = 0x%08lx\n", + "[drm] Status handle = 0x%08x\n", pMGADRIServer->status.handle ); if ( drmMap( pMga->drmFD, Index: programs/Xserver/hw/xfree86/drivers/savage/savage_dri.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/savage/savage_dri.h,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 -r1.1.1.1.4.1 --- programs/Xserver/hw/xfree86/drivers/savage/savage_dri.h 6 Jul 2004 15:12:35 -0000 1.1.1.1 +++ programs/Xserver/hw/xfree86/drivers/savage/savage_dri.h 28 Jul 2004 20:21:51 -0000 1.1.1.1.4.1 @@ -116,20 +116,20 @@ int agpMode; - drm_handle_t frontbuffer; + drmHandle frontbuffer; unsigned int frontbufferSize; unsigned int frontOffset; unsigned int frontPitch; unsigned int frontBitmapDesc; /*Bitmap Descriptior*/ unsigned int IsfrontTiled; - drm_handle_t backbuffer; + drmHandle backbuffer; unsigned int backbufferSize; unsigned int backOffset; unsigned int backPitch; unsigned int backBitmapDesc; /*Bitmap Descriptior*/ - drm_handle_t depthbuffer; + drmHandle depthbuffer; unsigned int depthbufferSize; unsigned int depthOffset; unsigned int depthPitch; @@ -137,8 +137,8 @@ - drm_handle_t textures; - drm_handle_t xvmcSurfHandle; + drmHandle textures; + drmHandle xvmcSurfHandle; unsigned int textureOffset; unsigned int textureSize; int logTextureGranularity; Index: programs/Xserver/hw/xfree86/drivers/sis/sis.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h,v retrieving revision 1.1.1.25 retrieving revision 1.1.1.25.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.25 -r1.1.1.25.4.1 --- programs/Xserver/hw/xfree86/drivers/sis/sis.h 6 Jul 2004 15:12:16 -0000 1.1.1.25 +++ programs/Xserver/hw/xfree86/drivers/sis/sis.h 28 Jul 2004 20:21:51 -0000 1.1.1.25.4.1 @@ -510,7 +510,7 @@ ScrnInfoPtr pScrn_2; unsigned char * BIOS; SiS_Private * SiS_Pr; - unsigned long agpHandle; + drmHandle agpHandle; unsigned long agpAddr; unsigned char *agpBase; unsigned int agpSize; @@ -760,7 +760,7 @@ unsigned int cmdQueueSize_div2; unsigned int cmdQueueSize_div4; unsigned int cmdQueueSize_4_3; - unsigned long agpHandle; + drmHandle agpHandle; unsigned long agpAddr; unsigned char *agpBase; unsigned int agpSize; Index: programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c,v retrieving revision 1.1.1.28 retrieving revision 1.1.1.28.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.28 -r1.1.1.28.4.1 --- programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c 6 Jul 2004 15:12:19 -0000 1.1.1.28 +++ programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c 28 Jul 2004 20:21:51 -0000 1.1.1.28.4.1 @@ -436,7 +436,7 @@ return FALSE; } - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Registers = 0x%08lx\n", + xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Registers = 0x%08x\n", pSISDRI->regs.handle); /* AGP */ Index: programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h,v retrieving revision 1.1.1.13 retrieving revision 1.1.1.13.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.13 -r1.1.1.13.4.1 --- programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h 6 Jul 2004 15:12:19 -0000 1.1.1.13 +++ programs/Xserver/hw/xfree86/drivers/sis/sis_dri.h 28 Jul 2004 20:21:51 -0000 1.1.1.13.4.1 @@ -41,7 +41,6 @@ * went into drm.h. This file did not exist earlier. */ #ifndef _DRM_H_ -#define drm_handle_t drmHandle #define drm_context_t drmContext #endif @@ -73,7 +72,7 @@ #define SIS_DEPTH 2 typedef struct { - drm_handle_t handle; + drmHandle handle; drmSize size; drmAddress map; } sisRegion, *sisRegionPtr; Index: programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c,v retrieving revision 1.1.1.20 retrieving revision 1.1.1.20.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.20 -r1.1.1.20.4.1 --- programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c 6 Jul 2004 15:12:27 -0000 1.1.1.20 +++ programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c 28 Jul 2004 20:21:51 -0000 1.1.1.20.4.1 @@ -439,7 +439,7 @@ xf86DrvMsg(pScreen->myNum, X_ERROR, "drmAddMap failed, disabling DRI.\n"); return FALSE; } - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Registers = 0x%08lx\n", + xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Registers = 0x%08x\n", pTDFXDRI->regs); if (!(TDFXInitVisualConfigs(pScreen))) { Index: programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.h,v retrieving revision 1.1.1.4 retrieving revision 1.1.1.4.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.4 -r1.1.1.4.4.1 --- programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.h 6 Jul 2004 15:12:27 -0000 1.1.1.4 +++ programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.h 28 Jul 2004 20:21:51 -0000 1.1.1.4.4.1 @@ -6,7 +6,7 @@ #include "xf86drm.h" typedef struct { - drm_handle_t regs; + drmHandle regs; drmSize regsSize; drmAddress regsMap; int deviceID; Index: programs/Xserver/hw/xfree86/drivers/via/via_dri.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/via/via_dri.c,v retrieving revision 1.1.1.7 retrieving revision 1.1.1.7.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.7 -r1.1.1.7.4.1 --- programs/Xserver/hw/xfree86/drivers/via/via_dri.c 6 Jul 2004 15:12:22 -0000 1.1.1.7 +++ programs/Xserver/hw/xfree86/drivers/via/via_dri.c 28 Jul 2004 20:21:51 -0000 1.1.1.7.4.1 @@ -455,7 +455,7 @@ pVIADRI->regs.size = VIA_MMIO_REGSIZE; pVIADRI->regs.map = 0; pVIADRI->regs.handle = pVia->registerHandle; - xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] mmio Registers = 0x%08lx\n", + xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] mmio Registers = 0x%08x\n", pVIADRI->regs.handle); pVIADRI->drixinerama = pVia->drixinerama; @@ -623,7 +623,7 @@ } xf86DrvMsg(pScreen->myNum, X_INFO, - "[drm] register handle = 0x%08lx\n", pVia->registerHandle); + "[drm] register handle = 0x%08x\n", pVia->registerHandle); return TRUE; } Index: programs/Xserver/hw/xfree86/drivers/via/via_dri.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/via/via_dri.h,v retrieving revision 1.1.1.3 retrieving revision 1.1.1.3.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.3 -r1.1.1.3.4.1 --- programs/Xserver/hw/xfree86/drivers/via/via_dri.h 6 Jul 2004 15:12:22 -0000 1.1.1.3 +++ programs/Xserver/hw/xfree86/drivers/via/via_dri.h 28 Jul 2004 20:21:51 -0000 1.1.1.3.4.1 @@ -38,7 +38,7 @@ } VIASAREAPriv; typedef struct { - drm_handle_t handle; + drmHandle handle; drmSize size; drmAddress map; } viaRegion, *viaRegionPtr; Index: programs/Xserver/hw/xfree86/drivers/via/via_driver.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h,v retrieving revision 1.1.1.8 retrieving revision 1.1.1.8.6.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.8 -r1.1.1.8.6.1 --- programs/Xserver/hw/xfree86/drivers/via/via_driver.h 16 Feb 2004 15:18:29 -0000 1.1.1.8 +++ programs/Xserver/hw/xfree86/drivers/via/via_driver.h 28 Jul 2004 20:21:51 -0000 1.1.1.8.6.1 @@ -327,8 +327,8 @@ int numVisualConfigs; __GLXvisualConfig* pVisualConfigs; VIAConfigPrivPtr pVisualConfigsPriv; - unsigned long agpHandle; - unsigned long registerHandle; + drmHandle agpHandle; + drmHandle registerHandle; unsigned long agpAddr; drmAddress agpMappedAddr; unsigned char *agpBase; Index: programs/Xserver/hw/xfree86/os-support/xf86drm.h =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h,v retrieving revision 1.1.1.20 retrieving revision 1.1.1.20.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.20 -r1.1.1.20.4.1 --- programs/Xserver/hw/xfree86/os-support/xf86drm.h 6 Jul 2004 15:12:46 -0000 1.1.1.20 +++ programs/Xserver/hw/xfree86/os-support/xf86drm.h 28 Jul 2004 20:21:51 -0000 1.1.1.20.4.1 @@ -58,6 +58,7 @@ #define DRM_AGP_NO_HANDLE 0 +typedef unsigned int drmHandle, *drmHandlePtr; /* To mapped regions */ typedef unsigned int drmSize, *drmSizePtr; /**< For mapped regions */ typedef void *drmAddress, **drmAddressPtr; /**< For mapped regions */ @@ -232,7 +233,7 @@ } drmDMAReq, *drmDMAReqPtr; typedef struct _drmRegion { - drm_handle_t handle; + drmHandle handle; unsigned int offset; drmSize size; drmAddress map; @@ -495,7 +496,7 @@ int funcnum); extern int drmGetMap(int fd, int idx, drm_handle_t *offset, drmSize *size, drmMapType *type, - drmMapFlags *flags, drm_handle_t *handle, + drmMapFlags *flags, drmHandle *handle, int *mtrr); extern int drmGetClient(int fd, int idx, int *auth, int *pid, int *uid, unsigned long *magic, @@ -519,10 +520,10 @@ drmSize size, drmMapType type, drmMapFlags flags, - drm_handle_t * handle); -extern int drmRmMap(int fd, drm_handle_t handle); + drmHandle * handle); +extern int drmRmMap(int fd, drmHandle handle); extern int drmAddContextPrivateMapping(int fd, drm_context_t ctx_id, - drm_handle_t handle); + drmHandle handle); extern int drmAddBufs(int fd, int count, int size, drmBufDescFlags flags, @@ -552,7 +553,7 @@ /* General user-level programmer's API: authenticated client and/or X */ extern int drmMap(int fd, - drm_handle_t handle, + drmHandle handle, drmSize size, drmAddressPtr address); extern int drmUnmap(drmAddress address, drmSize size); @@ -567,7 +568,7 @@ extern int drmUnlock(int fd, drm_context_t context); extern int drmFinish(int fd, int context, drmLockFlags flags); extern int drmGetContextPrivateMapping(int fd, drm_context_t ctx_id, - drm_handle_t * handle); + drmHandle * handle); /* AGP/GART support: X server (root) only */ extern int drmAgpAcquire(int fd); @@ -575,11 +576,11 @@ extern int drmAgpEnable(int fd, unsigned long mode); extern int drmAgpAlloc(int fd, unsigned long size, unsigned long type, unsigned long *address, - unsigned long *handle); -extern int drmAgpFree(int fd, unsigned long handle); -extern int drmAgpBind(int fd, unsigned long handle, + drmHandle *handle); +extern int drmAgpFree(int fd, drmHandle handle); +extern int drmAgpBind(int fd, drmHandle handle, unsigned long offset); -extern int drmAgpUnbind(int fd, unsigned long handle); +extern int drmAgpUnbind(int fd, drmHandle handle); /* AGP/GART info: authenticated client and/or X */ extern int drmAgpVersionMajor(int fd); @@ -594,8 +595,8 @@ /* PCI scatter/gather support: X server (root) only */ extern int drmScatterGatherAlloc(int fd, unsigned long size, - unsigned long *handle); -extern int drmScatterGatherFree(int fd, unsigned long handle); + drmHandle *handle); +extern int drmScatterGatherFree(int fd, drmHandle handle); extern int drmWaitVBlank(int fd, drmVBlankPtr vbl); Index: programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c =================================================================== RCS file: /home/eich/cvs/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v retrieving revision 1.1.1.23 retrieving revision 1.1.1.23.4.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.23 -r1.1.1.23.4.1 --- programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c 6 Jul 2004 15:12:50 -0000 1.1.1.23 +++ programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c 28 Jul 2004 20:21:51 -0000 1.1.1.23.4.1 @@ -878,7 +878,7 @@ drmSize size, drmMapType type, drmMapFlags flags, - drm_handle_t * handle) + drmHandle * handle) { drm_map_t map; @@ -894,15 +894,16 @@ map.type = type; map.flags = flags; if (ioctl(fd, DRM_IOCTL_ADD_MAP, &map)) return -errno; - if (handle) *handle = (drm_handle_t)map.handle; + if (handle) *handle = (drmHandle)map.shandle; + return 0; } -int drmRmMap(int fd, drm_handle_t handle) +int drmRmMap(int fd, drmHandle handle) { drm_map_t map; - map.handle = (void *)handle; + map.shandle = handle; if(ioctl(fd, DRM_IOCTL_RM_MAP, &map)) return -errno; return 0; @@ -1041,7 +1042,7 @@ * This function is a wrapper for mmap(). */ int drmMap(int fd, - drm_handle_t handle, + drmHandle handle, drmSize size, drmAddressPtr address) { @@ -1055,6 +1056,10 @@ size = (size + pagesize_mask) & ~pagesize_mask; *address = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, handle); +#if 0 + fprintf(stderr,"drmMap(offset=0x%x, size=0x%x) = 0x%lx\n", + handle,size,(unsigned long)*address); +#endif if (*address == MAP_FAILED) return -errno; return 0; } @@ -1505,7 +1510,7 @@ * arguments in a drm_agp_buffer structure. */ int drmAgpAlloc(int fd, unsigned long size, unsigned long type, - unsigned long *address, unsigned long *handle) + unsigned long *address, drmHandle *handle) { drm_agp_buffer_t b; @@ -1532,7 +1537,7 @@ * This function is a wrapper around the DRM_IOCTL_AGP_FREE ioctl, passing the * argument in a drm_agp_buffer structure. */ -int drmAgpFree(int fd, unsigned long handle) +int drmAgpFree(int fd, drmHandle handle) { drm_agp_buffer_t b; @@ -1556,7 +1561,7 @@ * This function is a wrapper around the DRM_IOCTL_AGP_BIND ioctl, passing the * argument in a drm_agp_binding structure. */ -int drmAgpBind(int fd, unsigned long handle, unsigned long offset) +int drmAgpBind(int fd, drmHandle handle, unsigned long offset) { drm_agp_binding_t b; @@ -1579,7 +1584,7 @@ * This function is a wrapper around the DRM_IOCTL_AGP_UNBIND ioctl, passing * the argument in a drm_agp_binding structure. */ -int drmAgpUnbind(int fd, unsigned long handle) +int drmAgpUnbind(int fd, drmHandle handle) { drm_agp_binding_t b; @@ -1769,7 +1774,7 @@ return i.id_device; } -int drmScatterGatherAlloc(int fd, unsigned long size, unsigned long *handle) +int drmScatterGatherAlloc(int fd, unsigned long size, drmHandle *handle) { drm_scatter_gather_t sg; @@ -1781,7 +1786,7 @@ return 0; } -int drmScatterGatherFree(int fd, unsigned long handle) +int drmScatterGatherFree(int fd, drmHandle handle) { drm_scatter_gather_t sg; @@ -1943,18 +1948,18 @@ return value; } -int drmAddContextPrivateMapping(int fd, drm_context_t ctx_id, drm_handle_t handle) +int drmAddContextPrivateMapping(int fd, drm_context_t ctx_id, drmHandle handle) { drm_ctx_priv_map_t map; map.ctx_id = ctx_id; - map.handle = (void *)handle; + map.handle = handle; if (ioctl(fd, DRM_IOCTL_SET_SAREA_CTX, &map)) return -errno; return 0; } -int drmGetContextPrivateMapping(int fd, drm_context_t ctx_id, drm_handle_t * handle) +int drmGetContextPrivateMapping(int fd, drm_context_t ctx_id, drmHandlePtr handle) { drm_ctx_priv_map_t map; @@ -1967,7 +1972,7 @@ } int drmGetMap(int fd, int idx, drm_handle_t *offset, drmSize *size, - drmMapType *type, drmMapFlags *flags, drm_handle_t *handle, + drmMapType *type, drmMapFlags *flags, drmHandlePtr handle, int *mtrr) { drm_map_t map; @@ -1978,7 +1983,7 @@ *size = map.size; *type = map.type; *flags = map.flags; - *handle = (unsigned long)map.handle; + *handle = (unsigned long)map.shandle; *mtrr = map.mtrr; return 0; } @@ -2001,7 +2006,7 @@ int drmGetStats(int fd, drmStatsT *stats) { drm_stats_t s; - int i; + unsigned int i; if (ioctl(fd, DRM_IOCTL_GET_STATS, &s)) return -errno;