Index: extras/Mesa/src/mesa/drivers/dri/dri_client/xf86drm.c =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/extras/Mesa/src/mesa/drivers/dri/dri_client/xf86drm.c,v retrieving revision 1.1.1.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 xf86drm.c --- extras/Mesa/src/mesa/drivers/dri/dri_client/xf86drm.c 16 Jun 2004 09:18:31 -0000 1.1.1.1 +++ extras/Mesa/src/mesa/drivers/dri/dri_client/xf86drm.c 8 Apr 2005 15:40:18 -0000 @@ -1505,7 +1505,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, drm_handle_t *handle) { drm_agp_buffer_t b; @@ -1532,7 +1532,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, drm_handle_t handle) { drm_agp_buffer_t b; @@ -1556,7 +1556,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, drm_handle_t handle, unsigned long offset) { drm_agp_binding_t b; @@ -1579,7 +1579,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, drm_handle_t handle) { drm_agp_binding_t b; @@ -1769,7 +1769,7 @@ return i.id_device; } -int drmScatterGatherAlloc(int fd, unsigned long size, unsigned long *handle) +int drmScatterGatherAlloc(int fd, unsigned long size, drm_handle_t *handle) { drm_scatter_gather_t sg; @@ -1781,7 +1781,7 @@ return 0; } -int drmScatterGatherFree(int fd, unsigned long handle) +int drmScatterGatherFree(int fd, drm_handle_t handle) { drm_scatter_gather_t sg; Index: extras/Mesa/src/mesa/drivers/dri/dri_client/imports/xf86drm.h =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/extras/Mesa/src/mesa/drivers/dri/dri_client/imports/xf86drm.h,v retrieving revision 1.1.1.1 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.1.1.1 xf86drm.h --- extras/Mesa/src/mesa/drivers/dri/dri_client/imports/xf86drm.h 16 Jun 2004 09:18:32 -0000 1.1.1.1 +++ extras/Mesa/src/mesa/drivers/dri/dri_client/imports/xf86drm.h 8 Apr 2005 15:40:18 -0000 @@ -575,11 +575,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, + drm_handle_t *handle); +extern int drmAgpFree(int fd, drm_handle_t handle); +extern int drmAgpBind(int fd, drm_handle_t handle, unsigned long offset); -extern int drmAgpUnbind(int fd, unsigned long handle); +extern int drmAgpUnbind(int fd, drm_handle_t handle); /* AGP/GART info: authenticated client and/or X */ extern int drmAgpVersionMajor(int fd); @@ -594,8 +594,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); + drm_handle_t *handle); +extern int drmScatterGatherFree(int fd, drm_handle_t handle); extern int drmWaitVBlank(int fd, drmVBlankPtr vbl); Index: extras/drm/shared/drm.h =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/extras/drm/shared/drm.h,v retrieving revision 1.2 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.2 drm.h --- extras/drm/shared/drm.h 2 Mar 2005 11:20:29 -0000 1.2 +++ extras/drm/shared/drm.h 8 Apr 2005 15:40:24 -0000 @@ -101,7 +101,7 @@ #define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) -typedef unsigned long drm_handle_t; /**< To mapped regions */ +typedef unsigned int drm_handle_t; /**< To mapped regions */ typedef unsigned int drm_context_t; /**< GLXContext handle */ typedef unsigned int drm_drawable_t; typedef unsigned int drm_magic_t; /**< Magic for authentication */ @@ -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; @@ -259,17 +259,35 @@ * * \sa drmAddMap(). */ +#ifdef __KERNEL__ typedef struct drm_map { 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() */ + unsigned long pub_handle; /**< User-space: "Handle" to pass to mmap() */ /**< Kernel-space: kernel-virtual address */ int mtrr; /**< MTRR slot used */ /* Private data */ + void handle; } drm_map_t; +#endif +typedef struct drm_pub_map { + 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 */ + unsigned long handle; /**< User-space: "Handle" to pass to mmap() */ + /**< Kernel-space: kernel-virtual address */ + int mtrr; /**< MTRR slot used */ + /* Private data */ +} +#ifdef __KERNEL__ + drm_pub_map_t; +#else + drm_map_t; +#endif /** * DRM_IOCTL_GET_CLIENT ioctl argument type. Index: programs/Xserver/GL/dri/xf86dri.c =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/GL/dri/xf86dri.c,v retrieving revision 1.5 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.5 xf86dri.c --- programs/Xserver/GL/dri/xf86dri.c 30 Jul 2004 20:38:27 -0000 1.5 +++ programs/Xserver/GL/dri/xf86dri.c 8 Apr 2005 15:40:55 -0000 @@ -210,11 +210,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) @@ -548,11 +544,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/r128_dri.c =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c,v retrieving revision 1.5 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.5 r128_dri.c --- programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c 4 Dec 2004 22:34:54 -0000 1.5 +++ programs/Xserver/hw/xfree86/drivers/ati/r128_dri.c 8 Apr 2005 15:41:00 -0000 @@ -482,7 +482,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) { @@ -522,7 +522,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) { @@ -540,7 +540,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, @@ -560,7 +560,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, @@ -580,7 +580,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, @@ -642,7 +642,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 */ @@ -666,7 +666,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) { @@ -687,7 +687,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, @@ -710,7 +710,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, @@ -811,7 +811,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.c =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c,v retrieving revision 1.16 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.16 radeon_dri.c --- programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c 24 Mar 2005 06:45:51 -0000 1.16 +++ programs/Xserver/hw/xfree86/drivers/ati/radeon_dri.c 8 Apr 2005 15:41:00 -0000 @@ -806,7 +806,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, @@ -824,7 +824,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) { @@ -842,7 +842,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, @@ -862,7 +862,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, @@ -882,7 +882,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, @@ -915,7 +915,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); @@ -927,7 +927,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) { @@ -948,7 +948,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, @@ -971,7 +971,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, @@ -994,7 +994,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, @@ -1022,7 +1022,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/glint/glint_dri.c =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c,v retrieving revision 1.3 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.3 glint_dri.c --- programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c 16 Jun 2004 09:43:59 -0000 1.3 +++ programs/Xserver/hw/xfree86/drivers/glint/glint_dri.c 8 Apr 2005 15:41:00 -0000 @@ -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_dri.c =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v retrieving revision 1.6 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.6 i810_dri.c --- programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c 24 Jan 2005 15:02:17 -0000 1.6 +++ programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c 8 Apr 2005 15:41:00 -0000 @@ -286,8 +286,8 @@ DRIInfoPtr pDRIInfo; I810DRIPtr pI810DRI; unsigned long tom; - unsigned long agpHandle; - unsigned long dcacheHandle; + drm_handle_t agpHandle; + drm_handle_t dcacheHandle; int sysmem_size = 0; int back_size = 0; unsigned 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/i830_dri.c =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c,v retrieving revision 1.7 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.7 i830_dri.c --- programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c 1 Feb 2005 19:47:32 -0000 1.7 +++ programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c 8 Apr 2005 15:41:00 -0000 @@ -620,7 +620,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); /* @@ -640,7 +640,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; @@ -653,7 +653,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); @@ -666,7 +666,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; @@ -681,7 +681,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); if (!I830InitDma(pScrn)) { Index: programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v retrieving revision 1.4 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.4 mga_dri.c --- programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c 26 Jul 2004 23:14:37 -0000 1.4 +++ programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c 8 Apr 2005 15:41:00 -0000 @@ -675,7 +675,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 ) { @@ -697,7 +697,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, @@ -724,7 +724,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, @@ -751,7 +751,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, @@ -795,7 +795,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 ); @@ -821,7 +821,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; @@ -834,7 +834,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/mga/mga_dri.h =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.h,v retrieving revision 1.3 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.3 mga_dri.h --- programs/Xserver/hw/xfree86/drivers/mga/mga_dri.h 16 Jun 2004 09:44:00 -0000 1.3 +++ programs/Xserver/hw/xfree86/drivers/mga/mga_dri.h 8 Apr 2005 15:41:00 -0000 @@ -79,6 +79,12 @@ } MGADRIServerPrivateRec, *MGADRIServerPrivatePtr; +typedef struct _mgaDrmRegion { + drm_handle_t handle; + unsigned int offset; + drmSize size; +} mgaDrmRegion, *mgaDrmRegionPtr; + typedef struct { int chipset; int width; @@ -111,10 +117,10 @@ unsigned int mAccess; - drmRegion registers; - drmRegion status; - drmRegion primary; - drmRegion buffers; + mgaDrmRegion registers; + mgaDrmRegion status; + mgaDrmRegion primary; + mgaDrmRegion buffers; unsigned int sarea_priv_offset; } MGADRIRec, *MGADRIPtr; Index: programs/Xserver/hw/xfree86/drivers/sis/sis.h =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/sis/sis.h,v retrieving revision 1.35 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.35 sis.h --- programs/Xserver/hw/xfree86/drivers/sis/sis.h 11 Mar 2005 14:39:48 -0000 1.35 +++ programs/Xserver/hw/xfree86/drivers/sis/sis.h 8 Apr 2005 15:41:01 -0000 @@ -635,7 +635,7 @@ ScrnInfoPtr pScrn_2; UChar *BIOS; SiS_Private *SiS_Pr; - ULong agpHandle; + drm_handle_t agpHandle; ULong agpAddr; UChar *agpBase; unsigned int agpSize; @@ -893,7 +893,7 @@ unsigned int cmdQueueSize_div2; unsigned int cmdQueueSize_div4; unsigned int cmdQueueSize_4_3; - ULong agpHandle; + drm_handle_t agpHandle; ULong agpAddr; UChar *agpBase; unsigned int agpSize; Index: programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c,v retrieving revision 1.13 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.13 sis_dri.c --- programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c 11 Mar 2005 14:39:48 -0000 1.13 +++ programs/Xserver/hw/xfree86/drivers/sis/sis_dri.c 8 Apr 2005 15:41:01 -0000 @@ -431,7 +431,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/tdfx/tdfx_dri.c =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c,v retrieving revision 1.3 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.3 tdfx_dri.c --- programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c 16 Jun 2004 09:44:00 -0000 1.3 +++ programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_dri.c 8 Apr 2005 15:41:02 -0000 @@ -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/via/via_dri.c =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/via/via_dri.c,v retrieving revision 1.12 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.12 via_dri.c --- programs/Xserver/hw/xfree86/drivers/via/via_dri.c 6 Feb 2005 07:12:43 -0000 1.12 +++ programs/Xserver/hw/xfree86/drivers/via/via_dri.c 8 Apr 2005 15:41:02 -0000 @@ -658,7 +658,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; @@ -853,7 +853,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_driver.h =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/drivers/via/via_driver.h,v retrieving revision 1.7 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.7 via_driver.h --- programs/Xserver/hw/xfree86/drivers/via/via_driver.h 6 Feb 2005 07:12:43 -0000 1.7 +++ programs/Xserver/hw/xfree86/drivers/via/via_driver.h 8 Apr 2005 15:41:02 -0000 @@ -245,8 +245,8 @@ int numVisualConfigs; __GLXvisualConfig* pVisualConfigs; VIAConfigPrivPtr pVisualConfigsPriv; - unsigned long agpHandle; - unsigned long registerHandle; + drm_handle_t agpHandle; + drm_handle_t registerHandle; unsigned long agpAddr; drmAddress agpMappedAddr; unsigned char *agpBase; Index: programs/Xserver/hw/xfree86/os-support/xf86drm.h =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/xf86drm.h,v retrieving revision 1.4 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.4 xf86drm.h --- programs/Xserver/hw/xfree86/os-support/xf86drm.h 1 Jan 2005 20:12:35 -0000 1.4 +++ programs/Xserver/hw/xfree86/os-support/xf86drm.h 8 Apr 2005 15:41:03 -0000 @@ -576,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, + drm_handle_t *handle); +extern int drmAgpFree(int fd, drm_handle_t handle); +extern int drmAgpBind(int fd, drm_handle_t handle, unsigned long offset); -extern int drmAgpUnbind(int fd, unsigned long handle); +extern int drmAgpUnbind(int fd, drm_handle_t handle); /* AGP/GART info: authenticated client and/or X */ extern int drmAgpVersionMajor(int fd); @@ -595,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); + drm_handle_t *handle); +extern int drmScatterGatherFree(int fd, drm_handle_t handle); extern int drmWaitVBlank(int fd, drmVBlankPtr vbl); Index: programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c =================================================================== RCS file: /work/eich/freedesktop/cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c,v retrieving revision 1.4 diff -I$XFree86.*$ -I$Id.*$ -I$Header.*$ -I$Date.*$ -I$Revision.*$ -I$Author.*$ -I$Source.*$ -u -r1.4 xf86drm.c --- programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c 11 Aug 2004 23:22:43 -0000 1.4 +++ programs/Xserver/hw/xfree86/os-support/linux/drm/xf86drm.c 8 Apr 2005 15:41:03 -0000 @@ -898,7 +898,7 @@ { drm_map_t map; - map.handle = (void *)handle; + map.handle = handle; if(ioctl(fd, DRM_IOCTL_RM_MAP, &map)) return -errno; return 0; @@ -1051,6 +1051,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; } @@ -1501,7 +1505,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, drm_handle_t *handle) { drm_agp_buffer_t b; @@ -1528,7 +1532,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, drm_handle_t handle) { drm_agp_buffer_t b; @@ -1552,7 +1556,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, drm_handle_t handle, unsigned long offset) { drm_agp_binding_t b; @@ -1575,7 +1579,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, drm_handle_t handle) { drm_agp_binding_t b; @@ -1765,7 +1769,7 @@ return i.id_device; } -int drmScatterGatherAlloc(int fd, unsigned long size, unsigned long *handle) +int drmScatterGatherAlloc(int fd, unsigned long size, drm_handle_t *handle) { drm_scatter_gather_t sg; @@ -1777,7 +1781,7 @@ return 0; } -int drmScatterGatherFree(int fd, unsigned long handle) +int drmScatterGatherFree(int fd, drm_handle_t handle) { drm_scatter_gather_t sg; @@ -1944,7 +1948,7 @@ 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; @@ -1997,7 +2001,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;