diff options
author | Eric Anholt <[email protected]> | 2004-06-08 09:19:17 +0000 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2004-06-08 09:19:17 +0000 |
commit | e84f77be215ec1fc7a27388819b6c3a711057e4a (patch) | |
tree | e7f86df30254abcdb5f5581a9dc00a41d0877ac6 /src/mesa/drivers/dri/sis/sis_tris.h | |
parent | a94185474d38f88f141d45d8d42bf9ea081c483d (diff) |
* Convert to use t_vertex.c instead of sis_vb.[ch]
* Don't dispatch vertices directly to MMIO; queue them up in dma-like buffers
first. This makes things more uniform between AGP and MMIO paths, cleans up
some locking ugliness, and makes the driver look more like other drivers.
* Don't use the AGP Cmd buffer provided by the server. Instead allocate one in
the client, which avoids the need for lots of synchronization stuff.
* Mark some MMIO accesses volatile that should have been.
* Disable the AGP submission path by default (agp_disable=true) due to
unresolved issues in the new code. The old code had its own (serious) errors
with AGP, so this is not really a step backwards.
Diffstat (limited to 'src/mesa/drivers/dri/sis/sis_tris.h')
-rw-r--r-- | src/mesa/drivers/dri/sis/sis_tris.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_tris.h b/src/mesa/drivers/dri/sis/sis_tris.h index d0ca7c12c0e..0a8620e5ee1 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.h +++ b/src/mesa/drivers/dri/sis/sis_tris.h @@ -32,13 +32,39 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #ifndef __SIS_TRIS_H__ #define __SIS_TRIS_H__ +#include "sis_lock.h" #include "mtypes.h" extern void sisInitTriFuncs( GLcontext *ctx ); - - +extern void sisFlushPrims( sisContextPtr smesa ); +extern void sisFlushPrimsLocked( sisContextPtr smesa ); extern void sisFallback( GLcontext *ctx, GLuint bit, GLboolean mode ); + #define FALLBACK( smesa, bit, mode ) sisFallback( smesa->glCtx, bit, mode ) +#define SIS_FIREVERTICES(smesa) \ +do { \ + if (smesa->vb_cur != smesa->vb_last) \ + sisFlushPrims(smesa); \ +} while (0) + +static __inline GLuint *sisAllocDmaLow(sisContextPtr smesa, int bytes) +{ + GLuint *start; + if (smesa->vb_cur + bytes >= smesa->vb_end) { + LOCK_HARDWARE(); + sisFlushPrimsLocked(smesa); + if (smesa->using_agp) { + WaitEngIdle(smesa); + smesa->vb_cur = smesa->vb; + smesa->vb_last = smesa->vb_cur; + } + UNLOCK_HARDWARE(); + } + + start = (GLuint *)smesa->vb_cur; + smesa->vb_cur += bytes; + return start; +} #endif /* __SIS_TRIS_H__ */ |