r300: check buffer sizes in non-tcl case + set correct VRAM limits
authorDave Airlie <airlied@redhat.com>
Wed, 25 Mar 2009 07:02:32 +0000 (17:02 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 26 Mar 2009 03:24:21 +0000 (13:24 +1000)
src/mesa/drivers/dri/r300/r300_render.c
src/mesa/drivers/dri/radeon/radeon_common.c

index 402d2d76388e80d6348d54995dc72c9cd891f359..829d088033aa8f703095a88aa30d0b19ed228719 100644 (file)
@@ -490,6 +490,9 @@ static GLboolean r300RunNonTCLRender(GLcontext * ctx,
        if (!(rmesa->radeon.radeonScreen->chip_flags & RADEON_CHIPSET_TCL))
                return GL_TRUE;
 
+       if (!r300ValidateBuffers(ctx))
+           return GL_TRUE;
+       
        return r300RunRender(ctx, stage);
 }
 
index 9f646c4386caa79d42380f55893bc402dbecb39a..3ce868d2cf33ad10a1e00b25e1bbb9cfd52a21ed 100644 (file)
@@ -1094,7 +1094,7 @@ void rcommonInitCmdBuf(radeonContextPtr rmesa)
 
                if (!drmCommandWriteRead(rmesa->dri.fd, DRM_RADEON_GEM_INFO, &mminfo, sizeof(mminfo)))
                {
-                       radeon_cs_set_limit(rmesa->cmdbuf.cs, RADEON_GEM_DOMAIN_VRAM, mminfo.vram_size);
+                       radeon_cs_set_limit(rmesa->cmdbuf.cs, RADEON_GEM_DOMAIN_VRAM, mminfo.vram_visible);
                        radeon_cs_set_limit(rmesa->cmdbuf.cs, RADEON_GEM_DOMAIN_GTT, mminfo.gart_size);
                }
        }