summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorJon Taylor <[email protected]>2000-11-19 23:42:32 +0000
committerJon Taylor <[email protected]>2000-11-19 23:42:32 +0000
commit1487b3ea3ed0d30fa70655247e65d0ede3eef3af (patch)
tree1f1ec314c4a4c9f3fafca1227259ff61ed692097 /src/mesa/drivers
parenta852378a6289d154364dde440f89a39bbfc33e2d (diff)
* More work on the auto* build system
* Added missing #includes all over the place * Added GGI-style debugging harness to GGIMesa
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/ggi/default/stubs.c14
-rw-r--r--src/mesa/drivers/ggi/ggimesa.c143
-rw-r--r--src/mesa/drivers/ggi/include/ggi/mesa/debug.h3
-rw-r--r--src/mesa/drivers/x11/glxapi.c3
-rw-r--r--src/mesa/drivers/x11/xmesaP.h4
5 files changed, 95 insertions, 72 deletions
diff --git a/src/mesa/drivers/ggi/default/stubs.c b/src/mesa/drivers/ggi/default/stubs.c
index 69617be9c03..a47d0ff4cca 100644
--- a/src/mesa/drivers/ggi/default/stubs.c
+++ b/src/mesa/drivers/ggi/default/stubs.c
@@ -27,8 +27,8 @@
#include <ggi/internal/ggi-dl.h>
#include <ggi/mesa/ggimesa_int.h>
-#include "../../swrast/swrast.h"
-#include "../../swrast_setup/swrast_setup.h"
+#include "swrast/swrast.h"
+#include "swrast_setup/swrast_setup.h"
/**********************************************************************/
/***** Write spans of pixels *****/
@@ -302,15 +302,15 @@ int GGIsetup_driver(GGIMesaContext ggictx,struct ggi_mesa_info *info)
ctx->Driver.WriteRGBASpan = GGIwrite_rgba_span;
ctx->Driver.WriteRGBSpan = GGIwrite_rgb_span;
- ctx->Driver.WriteMonoRGBASpan = GGIwrite_mono_span;
+// ctx->Driver.WriteMonoRGBASpan = GGIwrite_mono_span;
ctx->Driver.WriteRGBAPixels = GGIwrite_rgba_pixels;
- ctx->Driver.WriteMonoRGBAPixels = GGIwrite_mono_pixels;
+// ctx->Driver.WriteMonoRGBAPixels = GGIwrite_mono_pixels;
ctx->Driver.WriteCI32Span = GGIwrite_ci32_span;
ctx->Driver.WriteCI8Span = GGIwrite_ci8_span;
- ctx->Driver.WriteMonoCISpan = GGIwrite_mono_span;
+// ctx->Driver.WriteMonoCISpan = GGIwrite_mono_span;
ctx->Driver.WriteCI32Pixels = GGIwrite_ci32_pixels;
- ctx->Driver.WriteMonoCIPixels = GGIwrite_mono_pixels;
+// ctx->Driver.WriteMonoCIPixels = GGIwrite_mono_pixels;
ctx->Driver.ReadCI32Span = GGIread_ci32_span;
ctx->Driver.ReadRGBASpan = GGIread_rgba_span;
@@ -318,7 +318,7 @@ int GGIsetup_driver(GGIMesaContext ggictx,struct ggi_mesa_info *info)
ctx->Driver.ReadRGBAPixels = GGIread_rgba_pixels;
ctx->Driver.RegisterVB = _swsetup_RegisterVB;
- ctx->Driver.RegisterVB = _swsetup_UnregisterVB;
+ ctx->Driver.UnregisterVB = _swsetup_UnregisterVB;
return 0;
}
diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c
index fffbaa5f4ff..ca68faaf4a1 100644
--- a/src/mesa/drivers/ggi/ggimesa.c
+++ b/src/mesa/drivers/ggi/ggimesa.c
@@ -26,11 +26,10 @@
#include "conf.h"
#endif
-#ifdef GGI
-
#include <ggi/mesa/ggimesa_int.h>
-#include <ggi/mesa/debug.h>
+#include "debug.h"
#include "extensions.h"
+#include "matrix.h"
#undef VIS
#undef FLIP
@@ -49,50 +48,32 @@ static void *_ggimesaConfigHandle;
static char ggimesaconfstub[512] = GGIMESACONFFILE;
static char *ggimesaconffile = ggimesaconfstub + GGIMESATAGLEN;
-int gl_ggi_init = GL_FALSE;
-int gl_ggi_debug = GL_FALSE;
+int _ggimesaDebugSync = 0;
+uint32 _ggimesaDebugState = 0;
static void gl_ggiUpdateState(GLcontext *ctx);
static int changed(ggi_visual_t vis, int whatchanged);
-#if 0
-/* FIXME: Move this debugging stuff to include/ggi/mesa/internal/ */
-void gl_ggiPrint(char *format,...)
-{
- va_list args;
- va_start(args,format);
- fprintf(stderr,"GGIMesa: ");
- vfprintf(stderr,format,args);
- va_end(args);
-}
-
-void gl_ggiDEBUG(char *format,...)
-{
- va_list args;
- if (gl_ggi_debug)
- {
- va_start(args,format);
- fprintf(stderr,"GGIMesa: ");
- vfprintf(stderr,format,args);
- va_end(args);
- }
-}
-#endif
-
static void gl_ggiGetSize(GLcontext *ctx, GLuint *width, GLuint *height)
{
+ GGIMESADPRINT_CORE("gl_ggiGetSize() called\n");
+
*width = GGIMesa->width;
- *height = GGIMesa->height;
+ *height = GGIMesa->height;
}
static void gl_ggiSetIndex(GLcontext *ctx, GLuint ci)
{
+ GGIMESADPRINT_CORE("gl_ggiSetIndex() called\n");
+
ggiSetGCForeground(VIS, ci);
GGICTX->color = (ggi_pixel)ci;
}
static void gl_ggiSetClearIndex(GLcontext *ctx, GLuint ci)
{
+ GGIMESADPRINT_CORE("gl_ggiSetClearIndex() called\n");
+
ggiSetGCForeground(VIS, ci);
GGICTX->clearcolor = (ggi_pixel)ci;
}
@@ -103,6 +84,8 @@ static void gl_ggiSetColor(GLcontext *ctx, GLubyte red, GLubyte green,
ggi_color rgb;
ggi_pixel col;
+ GGIMESADPRINT_CORE("gl_ggiSetColor() called\n");
+
rgb.r = (uint16)red << SHIFT;
rgb.g = (uint16)green << SHIFT;
rgb.b = (uint16)blue << SHIFT;
@@ -116,6 +99,9 @@ static void gl_ggiSetClearColor(GLcontext *ctx, GLubyte red, GLubyte green,
{
ggi_color rgb;
ggi_pixel col;
+
+ GGIMESADPRINT_CORE("gl_ggiSetClearColor() called\n");
+
rgb.r = (uint16)red << SHIFT;
rgb.g = (uint16)green << SHIFT;
rgb.b = (uint16)blue << SHIFT;
@@ -127,6 +113,7 @@ static void gl_ggiSetClearColor(GLcontext *ctx, GLubyte red, GLubyte green,
static GLbitfield gl_ggiClear(GLcontext *ctx,GLbitfield mask, GLboolean all,
GLint x, GLint y, GLint width, GLint height)
{
+ GGIMESADPRINT_CORE("gl_ggiClear() called\n");
if (mask & GL_COLOR_BUFFER_BIT)
{
@@ -150,6 +137,8 @@ static GLbitfield gl_ggiClear(GLcontext *ctx,GLbitfield mask, GLboolean all,
#if 0
static GLboolean gl_ggiSetBuffer(GLcontext *ctx, GLenum mode)
{
+ GGIMESADPRINT_CORE("gl_ggiSetBuffer() called\n");
+
if (mode == GL_FRONT)
GGICTX->active_buffer = 1;
else
@@ -162,6 +151,8 @@ static GLboolean gl_ggiSetBuffer(GLcontext *ctx, GLenum mode)
/* Set the buffer used for drawing */
static GLboolean gl_ggiSetDrawBuffer(GLcontext *ctx, GLenum mode)
{
+ GGIMESADPRINT_CORE("gl_ggiSetDrawBuffer() called\n");
+
if (mode == GL_FRONT_LEFT)
{
GGICTX->active_buffer = 1;
@@ -183,6 +174,8 @@ static GLboolean gl_ggiSetDrawBuffer(GLcontext *ctx, GLenum mode)
/* XXX support for separate read/draw buffers hasn't been tested */
static void gl_ggiSetReadBuffer(GLcontext *ctx, GLframebuffer *buffer, GLenum mode)
{
+ GGIMESADPRINT_CORE("gl_ggiSetReadBuffer() called\n");
+
if (mode == GL_FRONT_LEFT)
{
GGICTX->active_buffer = 1;
@@ -196,6 +189,8 @@ static void gl_ggiSetReadBuffer(GLcontext *ctx, GLframebuffer *buffer, GLenum mo
static const GLubyte * gl_ggiGetString(GLcontext *ctx, GLenum name)
{
+ GGIMESADPRINT_CORE("gl_ggiGetString() called\n");
+
if (name == GL_RENDERER)
return (GLubyte *) "Mesa GGI";
else
@@ -204,11 +199,15 @@ static const GLubyte * gl_ggiGetString(GLcontext *ctx, GLenum name)
static void gl_ggiFlush(GLcontext *ctx)
{
+ GGIMESADPRINT_CORE("gl_ggiFlush() called\n");
+
ggiFlush(VIS);
}
-static void gl_ggiSetupPointers( GLcontext *ctx )
+static void gl_ggiSetupPointers(GLcontext *ctx)
{
+ GGIMESADPRINT_CORE("gl_ggiSetupPointers() called\n");
+
/* Initialize all the pointers in the DD struct. Do this whenever */
/* a new context is made current or we change buffers via set_buffer! */
@@ -224,14 +223,15 @@ static void gl_ggiSetupPointers( GLcontext *ctx )
ctx->Driver.GetBufferSize = gl_ggiGetSize;
ctx->Driver.Finish = gl_ggiFlush;
- ctx->Driver.Flush = gl_ggiFlush;
-
+ ctx->Driver.Flush = gl_ggiFlush;
}
static int gl_ggiInitInfo(GGIMesaContext ctx, struct ggi_mesa_info *info)
{
ggi_mode mode;
+ GGIMESADPRINT_CORE("gl_ggiInitInfo() called\n");
+
ggiGetMode(ctx->ggi_vis, &mode);
info->depth_bits = DEFAULT_SOFTWARE_DEPTH_BITS;
@@ -265,6 +265,22 @@ static int gl_ggiInitInfo(GGIMesaContext ctx, struct ggi_mesa_info *info)
int ggiMesaInit()
{
int err;
+ char *str;
+
+ GGIMESADPRINT_CORE("ggiMesaInit() called\n");
+
+ str = getenv("GGIMESA_DEBUG");
+ if (str != NULL) {
+ _ggimesaDebugState = atoi(str);
+ GGIMESADPRINT_CORE("Debugging=%d\n", _ggimesaDebugState);
+ }
+
+ str = getenv("GGIMESA_DEBUGSYNC");
+ if (str != NULL) {
+ _ggimesaDebugSync = 1;
+ }
+
+ GGIMESADPRINT_CORE("ggiMesaInit()\n");
_ggimesaLibIsUp++;
if (_ggimesaLibIsUp > 1)
@@ -273,7 +289,7 @@ int ggiMesaInit()
err = ggLoadConfig(ggimesaconffile, &_ggimesaConfigHandle);
if (err != GGI_OK)
{
- fprintf(stderr, "GGIMesa: Couldn't open %s\n", ggimesaconffile);
+ GGIMESADPRINT_CORE("GGIMesa: Couldn't open %s\n", ggimesaconffile);
_ggimesaLibIsUp--;
return err;
}
@@ -282,7 +298,7 @@ int ggiMesaInit()
if (ggiMesaID < 0)
{
- fprintf(stderr, "GGIMesa: failed to register as extension\n");
+ GGIMESADPRINT_CORE("GGIMesa: failed to register as extension\n");
_ggimesaLibIsUp--;
ggFreeConfig(_ggimesaConfigHandle);
return ggiMesaID;
@@ -295,11 +311,10 @@ int ggiMesaInit()
GGIMesaContext GGIMesaCreateContext(void)
{
GGIMesaContext ctx;
- char *s;
-
- s = getenv("GGIMESA_DEBUG");
- gl_ggi_debug = (s && atoi(s));
+ char *str;
+ GGIMESADPRINT_CORE("ggiMesaCreateContext() called\n");
+
if (ggiMesaInit() < 0) /* register extensions*/
{
return NULL;
@@ -327,6 +342,8 @@ GGIMesaContext GGIMesaCreateContext(void)
void GGIMesaDestroyContext(GGIMesaContext ctx)
{
+ GGIMESADPRINT_CORE("ggiMesaDestroyContext() called\n");
+
if (ctx)
{
_mesa_destroy_visual(ctx->gl_vis);
@@ -353,6 +370,8 @@ int GGIMesaSetVisual(GGIMesaContext ctx, ggi_visual_t vis,
ggi_mode mode;
int num_buf;
+ GGIMESADPRINT_CORE("ggiMesaSetVisual() called\n");
+
if (!ctx) return -1;
if (!vis) return -1;
@@ -386,8 +405,8 @@ int GGIMesaSetVisual(GGIMesaContext ctx, ggi_visual_t vis,
if (!func)
{
- fprintf(stderr, "setup_driver==NULL!\n");
- fprintf(stderr, "Please check your config files!\n");
+ GGIMESADPRINT_CORE("setup_driver==NULL!\n");
+ GGIMESADPRINT_CORE("Please check your config files!\n");
return -1;
}
@@ -410,7 +429,7 @@ int GGIMesaSetVisual(GGIMesaContext ctx, ggi_visual_t vis,
1);
if (!ctx->gl_vis)
{
- fprintf(stderr, "Can't create gl_visual!\n");
+ GGIMESADPRINT_CORE("Can't create gl_visual!\n");
return -1;
}
@@ -423,7 +442,7 @@ int GGIMesaSetVisual(GGIMesaContext ctx, ggi_visual_t vis,
if (!ctx->gl_buffer)
{
- fprintf(stderr, "Can't create gl_buffer!\n");
+ GGIMESADPRINT_CORE("Can't create gl_buffer!\n");
return -1;
}
@@ -452,7 +471,7 @@ int GGIMesaSetVisual(GGIMesaContext ctx, ggi_visual_t vis,
if (ctx->lfb[0] == NULL)
{
- fprintf(stderr, "No linear frame buffer!\n");
+ GGIMESADPRINT_CORE("No linear frame buffer!\n");
return -1;
}
@@ -485,6 +504,8 @@ int GGIMesaSetVisual(GGIMesaContext ctx, ggi_visual_t vis,
void GGIMesaMakeCurrent(GGIMesaContext ctx)
{
+ GGIMESADPRINT_CORE("ggiMesaMakeCurrent(ctx = %p) called\n", ctx);
+
if (!ctx->ggi_vis)
return;
@@ -501,6 +522,8 @@ void GGIMesaMakeCurrent(GGIMesaContext ctx)
GGIMesaContext GGIMesaGetCurrentContext(void)
{
+ GGIMESADPRINT_CORE("ggiMesaGetCurrentContext() called\n");
+
return GGIMesa;
}
@@ -509,7 +532,7 @@ GGIMesaContext GGIMesaGetCurrentContext(void)
*/
void GGIMesaSwapBuffers(void)
{
- GGIMESADPRINT_CORE("GGIMesaSwapBuffers\n");
+ GGIMESADPRINT_CORE("ggiMesaSwapBuffers() called\n");
_mesa_swapbuffers( GGIMesa->gl_ctx );
gl_ggiFlush(GGIMesa->gl_ctx);
@@ -524,11 +547,13 @@ static void gl_ggiUpdateState(GLcontext *ctx)
{
void *func;
+ GGIMESADPRINT_CORE("gl_ggiUpdateState() called\n");
+
func = (void *)CTX_OPMESA(ctx)->update_state;
if (!func) {
- fprintf(stderr, "update_state == NULL!\n");
- fprintf(stderr, "Please check your config files!\n");
+ GGIMESADPRINT_CORE("update_state == NULL!\n");
+ GGIMESADPRINT_CORE("Please check your config files!\n");
ggiPanic("");
}
@@ -537,6 +562,8 @@ static void gl_ggiUpdateState(GLcontext *ctx)
static int changed(ggi_visual_t vis, int whatchanged)
{
+ GGIMESADPRINT_CORE("changed() called\n");
+
switch (whatchanged)
{
case GGI_CHG_APILIST:
@@ -569,6 +596,8 @@ int ggiMesaExit(void)
{
int rc;
+ GGIMESADPRINT_CORE("ggiMesaExit() called\n");
+
if (!_ggimesaLibIsUp)
return -1;
@@ -589,6 +618,8 @@ int ggiMesaExit(void)
static int _ggi_error(void)
{
+ GGIMESADPRINT_CORE("_ggi_error() called\n");
+
return -1;
}
@@ -596,6 +627,8 @@ int ggiMesaAttach(ggi_visual_t vis)
{
int rc;
+ GGIMESADPRINT_CORE("ggiMesaAttach() called\n");
+
rc = ggiExtensionAttach(vis, ggiMesaID);
if (rc == 0)
{
@@ -613,19 +646,7 @@ int ggiMesaAttach(ggi_visual_t vis)
int ggiMesaDetach(ggi_visual_t vis)
{
+ GGIMESADPRINT_CORE("ggiMesaDetach() called\n");
+
return ggiExtensionDetach(vis, ggiMesaID);
}
-
-
-#else
-/*
- * Need this to provide at least one external definition when GGI is
- * not defined on the compiler command line.
- */
-
-int gl_ggi_dummy_function(void)
-{
- return 0;
-}
-
-#endif
diff --git a/src/mesa/drivers/ggi/include/ggi/mesa/debug.h b/src/mesa/drivers/ggi/include/ggi/mesa/debug.h
index b07a8ad9a73..edd47e423f1 100644
--- a/src/mesa/drivers/ggi/include/ggi/mesa/debug.h
+++ b/src/mesa/drivers/ggi/include/ggi/mesa/debug.h
@@ -1,4 +1,4 @@
-/* $Id: debug.h,v 1.2 2000/01/07 08:34:44 jtaylor Exp $
+/* $Id: debug.h,v 1.3 2000/11/19 23:42:33 jtaylor Exp $
******************************************************************************
GGIMesa debugging macros
@@ -34,6 +34,7 @@
#include <ggi/types.h>
#include <ggi/gg.h>
+#define DEBUG
__BEGIN_DECLS
diff --git a/src/mesa/drivers/x11/glxapi.c b/src/mesa/drivers/x11/glxapi.c
index 45c5e0f1c99..1a3c9193bc4 100644
--- a/src/mesa/drivers/x11/glxapi.c
+++ b/src/mesa/drivers/x11/glxapi.c
@@ -1,4 +1,4 @@
-/* $Id: glxapi.c,v 1.17 2000/06/08 22:50:28 brianp Exp $ */
+/* $Id: glxapi.c,v 1.18 2000/11/19 23:42:33 jtaylor Exp $ */
/*
* Mesa 3-D graphics library
@@ -34,6 +34,7 @@
#include <assert.h>
#include <stdlib.h>
+#include <string.h>
#include "glapi.h"
#include "glxapi.h"
diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h
index 4f7cfdeefce..c88e1f7eb62 100644
--- a/src/mesa/drivers/x11/xmesaP.h
+++ b/src/mesa/drivers/x11/xmesaP.h
@@ -1,4 +1,4 @@
-/* $Id: xmesaP.h,v 1.15 2000/11/14 17:40:15 brianp Exp $ */
+/* $Id: xmesaP.h,v 1.16 2000/11/19 23:42:33 jtaylor Exp $ */
/*
* Mesa 3-D graphics library
@@ -44,7 +44,7 @@
#include "types.h"
#if defined(FX) && !defined(GLX_DIRECT_RENDERING)
#include "GL/fxmesa.h"
-#include "../FX/fxdrv.h"
+#include "FX/fxdrv.h"
#endif