Various regressions with xf86-video-intel 2.0.0 on 855GM

Wang Zhenyu zhenyu.z.wang at intel.com
Fri May 18 00:08:38 PDT 2007


On 2007.05.18 07:59:04 +0000, Rémi Cardona wrote:
> Michel Dänzer wrote:
> > 
> > See http://bugs.freedesktop.org/show_bug.cgi?id=10808 .
> > 
> 
> How do I calculate the cachelines parameter for my card? I couldn't find
> anything about it in xorg.conf(5)
> 
> For reference :
> 
> http://en.pastebin.ca/494374  <= xorg.conf
> http://en.pastebin.ca/494378  <= Xorg.0.log
> 

oh, you use EXA, so that cacheline workaround won't help you. 
Eric, should we handle texture mem like the attached patch for now?

-------------- next part --------------
diff --git a/src/i830.h b/src/i830.h
index 8dcc4b5..0d25978 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -279,6 +279,7 @@ typedef struct _I830Rec {
    i830_memory *memory_list;	/**< Linked list of video memory allocations */
    long stolen_size;		/**< bytes of pre-bound stolen memory */
    int gtt_acquired;		/**< whether we currently own the AGP */
+   int memory_available;	/**< left aperture size */
 
    i830_memory *front_buffer;
    i830_memory *front_buffer_2;
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 3ae10cf..f2318a1 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -146,6 +146,14 @@ i830_get_fence_size(ScrnInfoPtr pScrn, u
     }
 }
 
+static int
+i830_get_available_memory(ScrnInfoPtr pScrn)
+{
+    I830Ptr pI830 = I830PTR(pScrn);
+    return pI830->memory_available;
+}
+
+
 static Bool
 i830_bind_memory(ScrnInfoPtr pScrn, i830_memory *mem)
 {
@@ -181,6 +189,8 @@ i830_unbind_memory(ScrnInfoPtr pScrn, i8
 void
 i830_free_memory(ScrnInfoPtr pScrn, i830_memory *mem)
 {
+    I830Ptr pI830 = I830PTR(pScrn);
+
     if (mem == NULL)
 	return;
 
@@ -198,6 +208,8 @@ i830_free_memory(ScrnInfoPtr pScrn, i830
 	mem->key = -1;
     }
 
+    pI830->memory_available += mem->size;
+
     xfree(mem->name);
     xfree(mem);
 }
@@ -309,6 +321,7 @@ i830_allocator_init(ScrnInfoPtr pScrn, u
     end->prev = start;
 
     pI830->memory_list = start;
+    pI830->memory_available = size;
 
     return TRUE;
 }
@@ -469,6 +482,8 @@ i830_allocate_aperture(ScrnInfoPtr pScrn
     scan->next = mem;
     mem->next->prev = mem;
 
+    pI830->memory_available -= size;
+
     return mem;
 }
 
@@ -1285,7 +1300,17 @@ i830_allocate_texture_memory(ScrnInfoPtr
 
     if (pI830->mmModeFlags & I830_KERNEL_TEX) {
 	/* XXX: auto-sizing */
-	size = MB(32);
+	/* XXX last mem block if previous all failed, set to all
+	   left mem if less than 32MB */
+	if ((size = i830_get_available_memory(pScrn)) > MB(32))
+	    size = MB(32);
+	else 
+	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+		    "%ld kBytes space left for texture mem,"
+		    "you might fail in some large 3d games,"
+		    "try to set higher aperture size in bios.\n",
+		    size / 1024);
+		  
 	i = myLog2(size / I830_NR_TEX_REGIONS);
 	if (i < I830_LOG_MIN_TEX_REGION_SIZE)
 	    i = I830_LOG_MIN_TEX_REGION_SIZE;


More information about the xorg mailing list