diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-11-07 15:37:23 +1030 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2007-11-07 15:37:23 +1030 |
commit | 0b729051c04da7068f1e6dd319190bd0a362b2c0 (patch) | |
tree | 6e15c5de67a40d04167fcf0a2e0e26af8eca11c2 /hw/xfree86/dri/dri.c | |
parent | b7ee005d327372c1e414ee6c526f9f7aee14bc86 (diff) | |
parent | d7c5e8bfc1aecbd23a4cbb2eab08656587aac2e8 (diff) |
Merge branch 'master' into mpx
Conflicts:
Xi/extinit.c
Xi/grabdev.c
Xi/setmode.c
Xi/ungrdev.c
dix/devices.c
dix/events.c
dix/getevents.c
include/dix.h
mi/midispcur.c
mi/misprite.c
xkb/xkbActions.c
xkb/xkbEvents.c
xkb/xkbPrKeyEv.c
Diffstat (limited to 'hw/xfree86/dri/dri.c')
-rw-r--r-- | hw/xfree86/dri/dri.c | 51 |
1 files changed, 8 insertions, 43 deletions
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 196f2d49e..e2be5983c 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -67,7 +67,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "dristruct.h" #include "xf86.h" #include "xf86drm.h" -#include "glxserver.h" #include "mi.h" #include "mipointer.h" #include "xf86_OSproc.h" @@ -973,24 +972,8 @@ static Bool DRICreateDummyContext(ScreenPtr pScreen, Bool needCtxPriv) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - __GLXscreen *pGLXScreen = __glXgetActiveScreen(pScreen->myNum); - __GLcontextModes *modes = pGLXScreen->modes; - void **pVisualConfigPriv = pGLXScreen->pVisualPriv; DRIContextPrivPtr pDRIContextPriv; void *contextStore; - VisualPtr visual; - int visNum; - - visual = pScreen->visuals; - - /* Find the X visual that corresponds the the first GLX visual */ - for (visNum = 0; - visNum < pScreen->numVisuals; - visNum++, visual++) { - if (modes->visualID == visual->vid) - break; - } - if (visNum == pScreen->numVisuals) return FALSE; if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, @@ -1000,9 +983,9 @@ DRICreateDummyContext(ScreenPtr pScreen, Bool needCtxPriv) contextStore = DRIGetContextStore(pDRIContextPriv); if (pDRIPriv->pDriverInfo->CreateContext && needCtxPriv) { - if (!pDRIPriv->pDriverInfo->CreateContext(pScreen, visual, + if (!pDRIPriv->pDriverInfo->CreateContext(pScreen, NULL, pDRIPriv->pSAREA->dummy_context, - *pVisualConfigPriv, + NULL, (DRIContextType)(long)contextStore)) { DRIDestroyContextPriv(pDRIContextPriv); return FALSE; @@ -1037,9 +1020,6 @@ DRICreateContext(ScreenPtr pScreen, VisualPtr visual, XID context, drm_context_t * pHWContext) { DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - __GLXscreen *pGLXScreen = __glXgetActiveScreen(pScreen->myNum); - __GLcontextModes *modes = pGLXScreen->modes; - void **pVisualConfigPriv = pGLXScreen->pVisualPriv; DRIContextPrivPtr pDRIContextPriv; void *contextStore; @@ -1051,26 +1031,14 @@ DRICreateContext(ScreenPtr pScreen, VisualPtr visual, } } - /* Find the GLX visual associated with the one requested */ - for (modes = pGLXScreen->modes; modes != NULL; modes = modes->next) { - if (modes->visualID == visual->vid) - break; - pVisualConfigPriv++; - } - - if (modes == NULL) { - /* No matching GLX visual found */ - return FALSE; - } - if (!(pDRIContextPriv = DRICreateContextPriv(pScreen, pHWContext, 0))) { return FALSE; } contextStore = DRIGetContextStore(pDRIContextPriv); if (pDRIPriv->pDriverInfo->CreateContext) { - if (!((*pDRIPriv->pDriverInfo->CreateContext)(pScreen, visual, - *pHWContext, *pVisualConfigPriv, + if (!((*pDRIPriv->pDriverInfo->CreateContext)(pScreen, NULL, + *pHWContext, NULL, (DRIContextType)(long)contextStore))) { DRIDestroyContextPriv(pDRIContextPriv); return FALSE; @@ -2450,20 +2418,17 @@ DRIMoveBuffersHelper( } char * -DRICreatePCIBusID(pciVideoPtr PciInfo) +DRICreatePCIBusID(const struct pci_device * dev) { char *busID; - int domain; - PCITAG tag; busID = xalloc(20); if (busID == NULL) return NULL; - tag = pciTag(PciInfo->bus, PciInfo->device, PciInfo->func); - domain = xf86GetPciDomain(tag); - snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", domain, - PCI_BUS_NO_DOMAIN(PciInfo->bus), PciInfo->device, PciInfo->func); + snprintf(busID, 20, "pci:%04x:%02x:%02x.%d", dev->domain, dev->bus, + dev->dev, dev->func); + return busID; } |