Merge branch 'mesa_7_6_branch'
[mesa.git] / src / gallium / state_trackers / xorg / xorg_driver.c
index 923662b24a933ea7e843c62ce6001b069dc1fdbd..4bc87aa613d083ab3bc454666fc627a3cb26544f 100644 (file)
 #include "xf86.h"
 #include "xf86_OSproc.h"
 #include "compiler.h"
-#include "xf86RAC.h"
 #include "xf86PciInfo.h"
 #include "xf86Pci.h"
-#include "xf86Resources.h"
 #include "mipointer.h"
 #include "micmap.h"
 #include <X11/extensions/randr.h>
@@ -84,42 +82,10 @@ static const OptionInfoRec Options[] = {
     {-1, NULL, OPTV_NONE, {0}, FALSE}
 };
 
-/*
- * Functions that might be needed
- */
-
-static const char *exaSymbols[] = {
-    "exaGetVersion",
-    "exaDriverInit",
-    "exaDriverFini",
-    "exaOffscreenAlloc",
-    "exaOffscreenFree",
-    "exaWaitSync",
-    NULL
-};
-
-static const char *fbSymbols[] = {
-    "fbPictureInit",
-    "fbScreenInit",
-    NULL
-};
-
-static const char *ddcSymbols[] = {
-    "xf86PrintEDID",
-    "xf86SetDDCproperties",
-    NULL
-};
-
 /*
  * Exported Xorg driver functions to winsys
  */
 
-void
-xorg_tracker_loader_ref_sym_lists()
-{
-    LoaderRefSymLists(exaSymbols, fbSymbols, ddcSymbols, NULL);
-}
-
 const OptionInfoRec *
 xorg_tracker_available_options(int chipid, int busid)
 {
@@ -288,10 +254,6 @@ PreInit(ScrnInfoPtr pScrn, int flags)
     } else
        ms->entityPrivate = NULL;
 
-    if (xf86RegisterResources(ms->pEnt->index, NULL, ResNone)) {
-       return FALSE;
-    }
-
     if (xf86IsEntityShared(pScrn->entityList[0])) {
        if (xf86IsPrimInitDone(pScrn->entityList[0])) {
            /* do something */
@@ -312,7 +274,6 @@ PreInit(ScrnInfoPtr pScrn, int flags)
     if (ms->fd < 0)
        return FALSE;
 
-    pScrn->racMemFlags = RAC_FB | RAC_COLORMAP;
     pScrn->monitor = pScrn->confScreen->monitor;
     pScrn->progClock = TRUE;
     pScrn->rgbBits = 8;
@@ -398,8 +359,6 @@ PreInit(ScrnInfoPtr pScrn, int flags)
        return FALSE;
     }
 
-    xf86LoaderReqSymLists(fbSymbols, NULL);
-
     xf86LoadSubModule(pScrn, "exa");
 
 #ifdef DRI2
@@ -481,6 +440,7 @@ CreateScreenResources(ScreenPtr pScreen)
     rootPixmap = pScreen->GetScreenPixmap(pScreen);
 
     xorg_exa_set_displayed_usage(rootPixmap);
+    xorg_exa_set_shared_usage(rootPixmap);
     if (!pScreen->ModifyPixmapHeader(rootPixmap, -1, -1, -1, -1, -1, NULL))
        FatalError("Couldn't adjust screen pixmap\n");
 
@@ -598,6 +558,7 @@ ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
     xf86SetBlackWhitePixels(pScreen);
 
     ms->exa = xorg_exa_init(pScrn);
+    ms->debug_fallback = debug_get_bool_option("XORG_DEBUG_FALLBACK", TRUE);
 
     miInitializeBackingStore(pScreen);
     xf86SetBackingStore(pScreen);
@@ -660,10 +621,6 @@ FreeScreen(int scrnIndex, int flags)
     FreeRec(xf86Screens[scrnIndex]);
 }
 
-/* HACK */
-void
-cursor_destroy(xf86CrtcPtr crtc);
-
 static void
 LeaveVT(int scrnIndex, int flags)
 {
@@ -675,7 +632,7 @@ LeaveVT(int scrnIndex, int flags)
     for (o = 0; o < config->num_crtc; o++) {
        xf86CrtcPtr crtc = config->crtc[o];
 
-       cursor_destroy(crtc);
+       crtc_cursor_destroy(crtc);
 
        if (crtc->rotatedPixmap || crtc->rotatedData) {
            crtc->funcs->shadow_destroy(crtc, crtc->rotatedPixmap,
@@ -769,8 +726,10 @@ CloseScreen(int scrnIndex, ScreenPtr pScreen)
     if (ms->exa)
        xorg_exa_close(pScrn);
 
+    if (ms->api->destroy)
        ms->api->destroy(ms->api);
-       ms->api = NULL;
+    ms->api = NULL;
+
     drmClose(ms->fd);
     ms->fd = -1;