diff options
author | Jon Taylor <taylorj@ggi-project.org> | 1999-08-22 08:56:50 +0000 |
---|---|---|
committer | Jon Taylor <taylorj@ggi-project.org> | 1999-08-22 08:56:50 +0000 |
commit | 72fc9a527d29b731969bc5c94c51467f32f5a2e9 (patch) | |
tree | d8d36ac41de8f046ff9c2c007bb110140b402f5e /src/mesa/drivers/ggi/default/genkgi_mode.c | |
parent | 14c53fe1d5490b94138ca570890f734641e99dac (diff) |
*** empty log message ***
Diffstat (limited to 'src/mesa/drivers/ggi/default/genkgi_mode.c')
-rw-r--r-- | src/mesa/drivers/ggi/default/genkgi_mode.c | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/src/mesa/drivers/ggi/default/genkgi_mode.c b/src/mesa/drivers/ggi/default/genkgi_mode.c index 67e0145f70..b11b641499 100644 --- a/src/mesa/drivers/ggi/default/genkgi_mode.c +++ b/src/mesa/drivers/ggi/default/genkgi_mode.c @@ -1,4 +1,4 @@ -/* $Id: genkgi_mode.c,v 1.2 1999/08/21 22:36:52 jtaylor Exp $ +/* $Id: genkgi_mode.c,v 1.3 1999/08/22 08:56:50 jtaylor Exp $ ****************************************************************************** display-fbdev-kgicon-generic-mesa @@ -41,7 +41,7 @@ int GGIMesa_genkgi_getapi(ggi_visual *vis, int num, char *apiname, char *arguments) { - genkgi_hook_mesa *priv = GENKGI_PRIVATE(vis); + struct genkgi_priv_mesa *priv = GENKGI_PRIV_MESA(vis); gl_ggiDEBUG("Entered mesa_genkgi_getapi, num=%d\n", num); @@ -59,3 +59,44 @@ int GGIMesa_genkgi_getapi(ggi_visual *vis, int num, char *apiname, char *argumen } return -1; } + +int GGIMesa_genkgi_flush(ggi_visual *vis, int x, int y, int w, int h, int tryflag) +{ + struct genkgi_priv_mesa *priv = GENKGI_PRIV_MESA(vis); + int junkval; // There must be a better way to do this + + priv->oldpriv->kgicommand_ptr += getpagesize(); + (kgiu32)(priv->oldpriv->kgicommand_ptr) &= 0xfffff000; + junkval = *((int *)(priv->oldpriv->kgicommand_ptr)); + + /* Check if we are now in the last page, and reset the + * FIFO if so. We can't use the last page to send + * more commands, since there's no page after it that + * we can touch to fault in the last page's commands. + * + * FIXME: This will be replaced with a flush-and-reset handler + * on the end-of-buffer pagefault at some point.... + * + */ + if ((priv->oldpriv->kgicommand_ptr - priv->oldpriv->mapped_kgicommand) + >= (priv->oldpriv->kgicommand_buffersize - getpagesize())) + { + gl_ggiDEBUG("Hit end of FIFO, attempting remap"); + munmap(priv->oldpriv->mapped_kgicommand, priv->oldpriv->kgicommand_buffersize); + gl_ggiDEBUG("Passed munmap"); + if ((priv->oldpriv->mapped_kgicommand = + mmap(NULL, + priv->oldpriv->kgicommand_buffersize, + PROT_READ | PROT_WRITE, + MAP_SHARED, + priv->oldpriv->fd_kgicommand, + 0)) == MAP_FAILED) + { + ggiPanic("Failed to remap kgicommand!"); + } + gl_ggiDEBUG("Passed mmap"); + priv->oldpriv->kgicommand_ptr = priv->oldpriv->mapped_kgicommand; + gl_ggiDEBUG("Passed kgicommand_ptr reset"); + } + return 0; +} |