Remove usleeps from sis driver. We probably aren't doing anyone a service
authorEric Anholt <anholt@FreeBSD.org>
Tue, 9 Dec 2003 00:00:40 +0000 (00:00 +0000)
committerEric Anholt <anholt@FreeBSD.org>
Tue, 9 Dec 2003 00:00:40 +0000 (00:00 +0000)
sleeping with the lock held.  Also, rename cEngineState to engineState since
it isn't a char any more.

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

index 0830e5676f1957149f9df55a4388d4882d7f431b..6aa61944086835f46017dafbc76c4aac1c338c43 100644 (file)
@@ -84,27 +84,25 @@ static const char * const card_extensions[] =
 void
 WaitEngIdle (sisContextPtr smesa)
 {
-   GLuint cEngineState;
+   GLuint engineState;
 
    do {
-      cEngineState = MMIO_READ(REG_CommandQueue);
-   } while ((cEngineState & SiS_EngIdle) != SiS_EngIdle);
+      engineState = MMIO_READ(REG_CommandQueue);
+   } while ((engineState & SiS_EngIdle) != SiS_EngIdle);
 }
 
 void
 Wait2DEngIdle (sisContextPtr smesa)
 {
-   GLuint cEngineState;
+   GLuint engineState;
 
    do {
-      cEngineState = MMIO_READ(REG_CommandQueue);
-   } while ((cEngineState & SiS_EngIdle2d) != SiS_EngIdle2d);
+      engineState = MMIO_READ(REG_CommandQueue);
+   } while ((engineState & SiS_EngIdle2d) != SiS_EngIdle2d);
 }
 
 /* To be called from mWait3DCmdQueue.  Separate function for profiling
  * purposes, and speed doesn't matter because we're spinning anyway.
- * This function should use usleeps to release cpu probably, but I have yet
- * to see it get called.
  */
 void
 WaitingFor3dIdle(sisContextPtr smesa, int wLen)
index 3171be50024e97737f85701ec99c6e8d68164778..f1a51039d295107250e2cf31be7d33f0142a7055 100644 (file)
@@ -162,7 +162,7 @@ static void sisCopyBuffer( __DRIdrawablePrivate *dPriv )
    ENGPACKET stEngPacket;
   
    while ((*smesa->FrameCountPtr) - MMIO_READ(0x8a2c) > SIS_MAX_FRAME_LENGTH)
-      usleep(1);
+      ;
 
    LOCK_HARDWARE();
 
index 4877e346503370937f493afb3055e28ef31783b8..abe6a3fb075d2fca0099cee2ea86b4e37e5b4fa4 100644 (file)
@@ -870,7 +870,6 @@ sisMakeRoomAGP( sisContextPtr smesa, GLint num )
       sisUpdateAGP( smesa );
       while (size > AGP_SpaceLeft) {
          /* Spin until space is available. */
-         usleep(1);
          AGP_ReadPtr = (GLfloat *)((long)MMIO_READ(REG_3D_AGPCmBase) -
             (long)smesa->AGPCmdBufAddr + (long)smesa->AGPCmdBufBase);
          sisUpdateAGP( smesa );