Fix SiS AGP vertex dispatch by not trying to emit 0 vertices, which would hang
authorEric Anholt <anholt@FreeBSD.org>
Sat, 25 Sep 2004 19:01:18 +0000 (19:01 +0000)
committerEric Anholt <anholt@FreeBSD.org>
Sat, 25 Sep 2004 19:01:18 +0000 (19:01 +0000)
the hardware.  Re-enable AGP by default.

src/mesa/drivers/dri/sis/sis_screen.c
src/mesa/drivers/dri/sis/sis_tris.c
src/mesa/drivers/dri/sis/sis_tris.h

index aa1cd9b5df5b272580122b83fb3da77bb25dd7e0..1cf2211d3023af10a9e6ec75b81d8c92415cd7fe 100644 (file)
@@ -46,7 +46,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 const char __driConfigOptions[] =
 DRI_CONF_BEGIN
        DRI_CONF_SECTION_DEBUG
-               DRI_CONF_OPT_BEGIN(agp_disable,bool,true)
+               DRI_CONF_OPT_BEGIN(agp_disable,bool,false)
                DRI_CONF_DESC(en,"Disable AGP vertex dispatch")
                DRI_CONF_OPT_END
                DRI_CONF_OPT_BEGIN(fallback_force,bool,false)
index da23df5fe73e3efa322311b8d7a1f699d1a3b458..048ff848f4c7bcc6097e21079763903b1b34a59e 100644 (file)
@@ -889,7 +889,8 @@ static void sisRenderFinish( GLcontext *ctx )
 void
 sisFlushPrimsLocked(sisContextPtr smesa)
 {
-   GLuint *start;
+   if (smesa->vb_cur == smesa->vb_last)
+      return;
 
    sisUpdateHWState(smesa->glCtx);
 
@@ -898,7 +899,7 @@ sisFlushPrimsLocked(sisContextPtr smesa)
       mEndPrimitive();
       MMIO(REG_3D_AGPCmBase, (smesa->vb_last - smesa->vb) +
          smesa->vb_agp_offset);
-      MMIO(REG_3D_AGPTtDwNum, (smesa->vb_cur - smesa->vb_last) / 4 |
+      MMIO(REG_3D_AGPTtDwNum, ((smesa->vb_cur - smesa->vb_last) / 4) |
         0x50000000);
       MMIO(REG_3D_ParsingSet, smesa->AGPParseSet);
       MMIO(REG_3D_AGPCmFire, (GLint)(-1));
index 0a8620e5ee14d47100868831922358e19b20a0a9..5e07acc2118cee7fc1579eadaaaeacc340a76fc3 100644 (file)
@@ -51,6 +51,7 @@ do {                                                  \
 static __inline GLuint *sisAllocDmaLow(sisContextPtr smesa, int bytes)
 {
    GLuint *start;
+
    if (smesa->vb_cur + bytes >= smesa->vb_end) {
       LOCK_HARDWARE();
       sisFlushPrimsLocked(smesa);