[Intel-gfx] [PATCH] Remove StolenOnly support.

Eric Anholt eric at anholt.net
Sat Feb 28 09:54:05 CET 2009


We rely on having AGPGART present to successfully allocate video memory as
we configure it by default.  Admit that fact, and remove support for
non-AGPGART/KMS setups.
---
 src/i830.h        |    2 --
 src/i830_driver.c |   49 ++++++++++++++++---------------------------------
 src/i830_memory.c |    8 ++------
 3 files changed, 18 insertions(+), 41 deletions(-)

diff --git a/src/i830.h b/src/i830.h
index 3d1a30a..ffb2732 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -609,8 +609,6 @@ typedef struct _I830Rec {
 
    Bool tv_present; /* TV connector present (from VBIOS) */
 
-   Bool StolenOnly;
-
    /* Driver phase/state information */
    Bool preinit;
    Bool starting;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 8c18f97..472e189 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1917,17 +1917,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
        return FALSE;
    }
 
-   /*
-    * XXX If we knew the pre-initialised GTT format for certain, we could
-    * probably figure out the physical address even in the StolenOnly case.
-    */
-   if (pI830->StolenOnly && pI830->CursorNeedsPhysical &&
-	      !pI830->SWCursor) {
-      xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
-		 "HW Cursor disabled because it needs agpgart memory.\n");
-      pI830->SWCursor = TRUE;
-   }
-
    if (pScrn->modes == NULL) {
       xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n");
       PreInitCleanup(pScrn);
@@ -2876,25 +2865,19 @@ I830AdjustMemory(ScreenPtr pScreen)
    /* Limit videoRam to how much we might be able to allocate from AGP */
    sys_mem = I830CheckAvailableMemory(pScrn);
    if (sys_mem == -1) {
-      if (pScrn->videoRam > pI830->stolen_size / KB(1)) {
+      xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		 "/dev/agpgart is either not available, or no memory "
+		 "is available\nfor allocation.  Please enable agpgart\n.");
+      pScrn->videoRam = pI830->stolen_size / KB(1);
+   }
+   if (sys_mem + (pI830->stolen_size / 1024) < pScrn->videoRam) {
+      pScrn->videoRam = sys_mem + (pI830->stolen_size / 1024);
+      from = X_PROBED;
+      if (sys_mem + (pI830->stolen_size / 1024) <
+	  pI830->pEnt->device->videoRam) {
 	 xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-		    "/dev/agpgart is either not available, or no memory "
-		    "is available\nfor allocation.  "
-		    "Using pre-allocated memory only.\n");
-	 pScrn->videoRam = pI830->stolen_size / KB(1);
-      }
-      pI830->StolenOnly = TRUE;
-   } else {
-      if (sys_mem + (pI830->stolen_size / 1024) < pScrn->videoRam) {
-	 pScrn->videoRam = sys_mem + (pI830->stolen_size / 1024);
-	 from = X_PROBED;
-	 if (sys_mem + (pI830->stolen_size / 1024) <
-	     pI830->pEnt->device->videoRam)
-	 {
-	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-		       "VideoRAM reduced to %d kByte "
-		       "(limited to available sysmem)\n", pScrn->videoRam);
-	 }
+		    "VideoRAM reduced to %d kByte "
+		    "(limited to available sysmem)\n", pScrn->videoRam);
       }
    }
 
@@ -3137,9 +3120,9 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 #ifdef I830_XV
    pI830->XvEnabled = !pI830->XvDisabled;
    if (pI830->XvEnabled) {
-      if (pI830->accel == ACCEL_NONE || pI830->StolenOnly) {
+      if (pI830->accel == ACCEL_NONE) {
 	 xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Xv is disabled because it "
-		    "needs 2D accel and AGPGART.\n");
+		    "needs 2D acceleration.\n");
 	 pI830->XvEnabled = FALSE;
       }
    }
@@ -3181,9 +3164,9 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
     * InitGLXVisuals call back.
     */
    if (pI830->directRenderingType == DRI_XF86DRI) {
-      if (pI830->accel == ACCEL_NONE || pI830->SWCursor || pI830->StolenOnly) {
+      if (pI830->accel == ACCEL_NONE || pI830->SWCursor) {
 	 xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "DRI is disabled because it "
-		    "needs HW cursor, 2D accel and AGPGART.\n");
+		    "needs HW cursor and 2D accel.\n");
 	 pI830->directRenderingType = DRI_NONE;
       }
    }
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 96f4008..0fd5d5b 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -1431,8 +1431,7 @@ i830_allocate_2d_memory(ScrnInfoPtr pScrn)
     long size;
 
     if (!pI830->use_drm_mode) {
-	if (!pI830->StolenOnly &&
-	    (!xf86AgpGARTSupported() || !xf86AcquireGART(pScrn->scrnIndex))) {
+	if (!xf86AgpGARTSupported() || !xf86AcquireGART(pScrn->scrnIndex)) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		       "AGP GART support is either not available or cannot "
 		       "be used.\n"
@@ -1970,7 +1969,7 @@ i830_bind_all_memory(ScrnInfoPtr pScrn)
 {
     I830Ptr pI830 = I830PTR(pScrn);
 
-    if (pI830->StolenOnly == TRUE || pI830->memory_list == NULL)
+    if (pI830->memory_list == NULL)
 	return TRUE;
 
     if (pI830->use_drm_mode || (xf86AgpGARTSupported() &&
@@ -2010,9 +2009,6 @@ i830_unbind_all_memory(ScrnInfoPtr pScrn)
 {
     I830Ptr pI830 = I830PTR(pScrn);
 
-    if (pI830->StolenOnly == TRUE)
-	return TRUE;
-
     if (pI830->use_drm_mode || (xf86AgpGARTSupported() &&
 				pI830->gtt_acquired)) {
 	i830_memory *mem;
-- 
1.5.6.5




More information about the Intel-gfx mailing list