summaryrefslogtreecommitdiff
path: root/hw/xfree86/dri
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2007-11-07 15:37:23 +1030
committerPeter Hutterer <peter@cs.unisa.edu.au>2007-11-07 15:37:23 +1030
commit0b729051c04da7068f1e6dd319190bd0a362b2c0 (patch)
tree6e15c5de67a40d04167fcf0a2e0e26af8eca11c2 /hw/xfree86/dri
parentb7ee005d327372c1e414ee6c526f9f7aee14bc86 (diff)
parentd7c5e8bfc1aecbd23a4cbb2eab08656587aac2e8 (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')
-rw-r--r--hw/xfree86/dri/dri.c51
-rw-r--r--hw/xfree86/dri/dri.h4
-rw-r--r--hw/xfree86/dri/xf86dri.c14
3 files changed, 12 insertions, 57 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;
}
diff --git a/hw/xfree86/dri/dri.h b/hw/xfree86/dri/dri.h
index 98e8b75be..516da97a5 100644
--- a/hw/xfree86/dri/dri.h
+++ b/hw/xfree86/dri/dri.h
@@ -35,6 +35,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef _DRI_H_
+#include <pciaccess.h>
+
#include "scrnintstr.h"
#include "xf86dri.h"
@@ -363,7 +365,7 @@ extern void DRIMoveBuffersHelper(ScreenPtr pScreen,
int *ydir,
RegionPtr reg);
-extern char *DRICreatePCIBusID(pciVideoPtr PciInfo);
+extern char *DRICreatePCIBusID(const struct pci_device *PciInfo);
extern int drmInstallSIGIOHandler(int fd, void (*f)(int, void *, void *));
extern int drmRemoveSIGIOHandler(int fd);
diff --git a/hw/xfree86/dri/xf86dri.c b/hw/xfree86/dri/xf86dri.c
index fdf0e9983..ea11b38ee 100644
--- a/hw/xfree86/dri/xf86dri.c
+++ b/hw/xfree86/dri/xf86dri.c
@@ -322,8 +322,6 @@ ProcXF86DRICreateContext(
{
xXF86DRICreateContextReply rep;
ScreenPtr pScreen;
- VisualPtr visual;
- int i;
REQUEST(xXF86DRICreateContextReq);
REQUEST_SIZE_MATCH(xXF86DRICreateContextReq);
@@ -337,19 +335,9 @@ ProcXF86DRICreateContext(
rep.sequenceNumber = client->sequence;
pScreen = screenInfo.screens[stuff->screen];
- visual = pScreen->visuals;
-
- /* Find the requested X visual */
- for (i = 0; i < pScreen->numVisuals; i++, visual++)
- if (visual->vid == stuff->visual)
- break;
- if (i == pScreen->numVisuals) {
- /* No visual found */
- return BadValue;
- }
if (!DRICreateContext( pScreen,
- visual,
+ NULL,
stuff->context,
(drm_context_t *)&rep.hHWContext)) {
return BadValue;