diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mga_dri.c | 25 | ||||
-rw-r--r-- | src/mga_dri.h | 1 | ||||
-rw-r--r-- | src/mga_driver.c | 1 | ||||
-rw-r--r-- | src/mga_sarea.h | 4 |
4 files changed, 18 insertions, 13 deletions
diff --git a/src/mga_dri.c b/src/mga_dri.c index 6f1fa75..e429027 100644 --- a/src/mga_dri.c +++ b/src/mga_dri.c @@ -52,6 +52,7 @@ #include "mga_macros.h" #include "mga_dri.h" #include "mga_sarea.h" +#include "mga_common.h" #define _XF86DRI_SERVER_ #include "GL/glxtokens.h" @@ -321,14 +322,14 @@ static Bool MGAInitVisualConfigs( ScreenPtr pScreen ) } static Bool MGACreateContext( ScreenPtr pScreen, VisualPtr visual, - drmContext hwContext, void *pVisualConfigPriv, + drm_context_t hwContext, void *pVisualConfigPriv, DRIContextType contextStore ) { /* Nothing yet */ return TRUE; } -static void MGADestroyContext( ScreenPtr pScreen, drmContext hwContext, +static void MGADestroyContext( ScreenPtr pScreen, drm_context_t hwContext, DRIContextType contextStore ) { /* Nothing yet */ @@ -809,7 +810,7 @@ static Bool MGADRIMapInit( ScreenPtr pScreen ) pMGADRIServer->registers.size = MGAIOMAPSIZE; if ( drmAddMap( pMga->drmFD, - (drmHandle)pMga->IOAddress, + (drm_handle_t)pMga->IOAddress, pMGADRIServer->registers.size, DRM_REGISTERS, DRM_READ_ONLY, &pMGADRIServer->registers.handle ) < 0 ) { @@ -1040,11 +1041,15 @@ Bool MGADRIScreenInit( ScreenPtr pScreen ) pDRIInfo->drmDriverName = MGAKernelDriverName; pDRIInfo->clientDriverName = MGAClientDriverName; - pDRIInfo->busIdString = xalloc(64); - sprintf( pDRIInfo->busIdString, "PCI:%d:%d:%d", - ((pciConfigPtr)pMga->PciInfo->thisCard)->busnum, - ((pciConfigPtr)pMga->PciInfo->thisCard)->devnum, - ((pciConfigPtr)pMga->PciInfo->thisCard)->funcnum ); + if (xf86LoaderCheckSymbol("DRICreatePCIBusID")) { + pDRIInfo->busIdString = DRICreatePCIBusID(pMga->PciInfo); + } else { + pDRIInfo->busIdString = xalloc(64); + sprintf( pDRIInfo->busIdString, "PCI:%d:%d:%d", + ((pciConfigPtr)pMga->PciInfo->thisCard)->busnum, + ((pciConfigPtr)pMga->PciInfo->thisCard)->devnum, + ((pciConfigPtr)pMga->PciInfo->thisCard)->funcnum ); + } pDRIInfo->ddxDriverMajorVersion = MGA_MAJOR_VERSION; pDRIInfo->ddxDriverMinorVersion = MGA_MINOR_VERSION; pDRIInfo->ddxDriverPatchVersion = MGA_PATCHLEVEL; @@ -1389,10 +1394,10 @@ void MGADRICloseScreen( ScreenPtr pScreen ) pMGADRIServer->agpTextures.map = NULL; } - if ( pMGADRIServer->agp.handle ) { + if ( pMGADRIServer->agp.handle != DRM_AGP_NO_HANDLE ) { drmAgpUnbind( pMga->drmFD, pMGADRIServer->agp.handle ); drmAgpFree( pMga->drmFD, pMGADRIServer->agp.handle ); - pMGADRIServer->agp.handle = 0; + pMGADRIServer->agp.handle = DRM_AGP_NO_HANDLE; drmAgpRelease( pMga->drmFD ); } diff --git a/src/mga_dri.h b/src/mga_dri.h index b9ed1c2..5785a34 100644 --- a/src/mga_dri.h +++ b/src/mga_dri.h @@ -32,7 +32,6 @@ #define __MGA_DRI_H__ #include "xf86drm.h" -#include "mga_common.h" #define MGA_DEFAULT_AGP_MODE 1 #define MGA_MAX_AGP_MODE 4 diff --git a/src/mga_driver.c b/src/mga_driver.c index 36d4d22..27bb481 100644 --- a/src/mga_driver.c +++ b/src/mga_driver.c @@ -330,6 +330,7 @@ static const char *driSymbols[] = { "DRIScreenInit", "DRIUnlock", "GlxSetVisualConfigs", + "DRICreatePCIBusID", NULL }; #endif diff --git a/src/mga_sarea.h b/src/mga_sarea.h index 616dee5..c124747 100644 --- a/src/mga_sarea.h +++ b/src/mga_sarea.h @@ -176,7 +176,7 @@ typedef struct { /* The current cliprects, or a subset thereof. */ - XF86DRIClipRectRec boxes[MGA_NR_SAREA_CLIPRECTS]; + drm_clip_rect_t boxes[MGA_NR_SAREA_CLIPRECTS]; unsigned int nbox; /* Information about the most recently used 3d drawable. The @@ -197,7 +197,7 @@ typedef struct { unsigned int exported_nback; int exported_back_x, exported_front_x, exported_w; int exported_back_y, exported_front_y, exported_h; - XF86DRIClipRectRec exported_boxes[MGA_NR_SAREA_CLIPRECTS]; + drm_clip_rect_t exported_boxes[MGA_NR_SAREA_CLIPRECTS]; /* Counters for aging textures and for client-side throttling. */ |