#define GLAPIENTRY
#endif
+#ifndef GLAPIENTRYP
+#define GLAPIENTRYP
+#endif
+
#ifndef GLAPI
#define GLAPI
#endif
# This will probably get set to $(X86_SOURCES) in Make-config:
ASM_SOURCES =
+ifndef SOLO
# This should get set in Make-config someday:
DRIVER_SOURCES = \
$(X11_DRIVER_SOURCES) \
$(GLIDE_DRIVER_SOURCES) \
$(SVGA_DRIVER_SOURCES)
+endif
### Object files
--- /dev/null
+# $Id: Makefile.X11,v 1.1 2003/10/16 04:50:42 jonsmirl Exp $
+
+# Mesa 3-D graphics library
+# Version: 5.0
+# Copyright (C) 1995-2002 Brian Paul
+
+TOP = ../../../../..
+
+default: linux-solo
+
+SHARED_INCLUDES = $(INCLUDE_DIRS) -I. -I../common -Iserver
+MINIGLX_INCLUDES = -I$(TOP)/src/glx/mini
+
+DEFINES += \
+ -D_HAVE_SWRAST=1 \
+ -D_HAVE_SWTNL=1 \
+ -D_HAVE_SANITY=1 \
+ -D_HAVE_CODEGEN=1 \
+ -D_HAVE_LIGHTING=1 \
+ -D_HAVE_TEXGEN=1 \
+ -D_HAVE_USERCLIP=1 \
+ -DGLX_DIRECT_RENDERING
+
+# Not yet
+# MINIGLX_SOURCES = server/i810_dri.c
+
+DRIVER_SOURCES = \
+ gamma_context.c \
+ gamma_dd.c \
+ gamma_inithw.c \
+ gamma_lock.c \
+ gamma_render.c \
+ gamma_screen.c \
+ gamma_span.c \
+ gamma_state.c \
+ gamma_tex.c \
+ gamma_texmem.c \
+ gamma_texstate.c \
+ gamma_tris.c \
+ gamma_vb.c \
+ gamma_xmesa.c \
+ ../common/mm.c \
+ ../common/utils.c \
+ ../common/texmem.c \
+ ../common/vblank.c
+
+INCLUDES = $(MINIGLX_INCLUDES) \
+ $(SHARED_INCLUDES)
+
+
+C_SOURCES = $(DRIVER_SOURCES) \
+ $(MINIGLX_SOURCES)
+
+MESA_MODULES = $(TOP)/src/mesa/mesa.a
+
+
+ifeq ($(WINDOW_SYSTEM),dri)
+WINOBJ=$(MESABUILDDIR)/dri/dri.a
+WINLIB=
+else
+WINOBJ=
+WINLIB=-L$(MESA)/src/glx/mini
+endif
+
+ASM_SOURCES =
+OBJECTS = $(C_SOURCES:.c=.o) \
+ $(ASM_SOURCES:.S=.o)
+
+### Include directories
+
+INCLUDE_DIRS = \
+ -I$(TOP)/include \
+ -I$(TOP)/src/mesa \
+ -I$(TOP)/src/mesa/main \
+ -I$(TOP)/src/mesa/glapi \
+ -I$(TOP)/src/mesa/math \
+ -I$(TOP)/src/mesa/transform \
+ -I$(TOP)/src/mesa/swrast \
+ -I$(TOP)/src/mesa/swrast_setup
+
+
+##### RULES #####
+
+.c.o:
+ $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+
+.S.o:
+ $(CC) -c $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@
+
+
+##### TARGETS #####
+
+targets: depend i810_dri.so
+
+i810_dri.so: $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile.X11
+ rm -f $@ && gcc -o $@ -shared $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(WINLIB) -lc $(GL_LIB_DEPS)
+ rm -f $(TOP)/lib/i810_dri.so && \
+ install i810_dri.so $(TOP)/lib/i810_dri.so
+
+# Run 'make -f Makefile.X11 dep' to update the dependencies if you change
+# what's included by any source file.
+depend: $(C_SOURCES) $(ASM_SOURCES)
+ makedepend -fdepend -Y $(SHARED_INCLUDES) $(MINIGLX_INCLUDES) \
+ $(C_SOURCES) $(ASM_SOURCES)
+
+
+# Emacs tags
+tags:
+ etags `find . -name \*.[ch]` `find ../include`
+
+
+# Remove .o and backup files
+clean:
+ -rm -f *.o */*.o *~ *.o *~ *.so server/*.o
+
+
+include $(TOP)/Make-config
+
+include depend
gmesa->glCtx->DriverCtx = NULL;
_mesa_destroy_context(gmesa->glCtx);
- Xfree(gmesa);
+ FREE(gmesa);
driContextPriv->driverPrivate = NULL;
}
}
#include "glheader.h"
+#include "imports.h"
#include "context.h"
#include "matrix.h"
#include "simple_list.h"
{
drmBufMapPtr retval;
- retval = (drmBufMapPtr)ALIGN_MALLOC(sizeof(drmBufMap));
+ retval = (drmBufMapPtr)ALIGN_MALLOC(sizeof(drmBufMap), 32);
if(retval == NULL) return NULL;
memset(retval, 0, sizeof(drmBufMap));
- retval->list = (drmBufPtr)ALIGN_MALLOC(sizeof(drmBuf) * I810_DMA_BUF_NR);
+ retval->list = (drmBufPtr)ALIGN_MALLOC(sizeof(drmBuf) * I810_DMA_BUF_NR, 32);
if(retval->list == NULL) {
- Xfree(retval);
+ FREE(retval);
return NULL;
}
memset(retval->list, 0, sizeof(drmBuf) * I810_DMA_BUF_NR);
i810Screen->bufs = i810_create_empty_buffers();
if (i810Screen->bufs == NULL) {
__driUtilMessage("i810InitDriver: i810_create_empty_buffers() failed");
- Xfree(i810Screen);
+ FREE(i810Screen);
return GL_FALSE;
}
i810Screen->back.handle,
i810Screen->back.size,
(drmAddress *)&i810Screen->back.map) != 0) {
- Xfree(i810Screen);
+ FREE(i810Screen);
sPriv->private = NULL;
__driUtilMessage("i810InitDriver: drmMap failed");
return GL_FALSE;
i810Screen->depth.handle,
i810Screen->depth.size,
(drmAddress *)&i810Screen->depth.map) != 0) {
- Xfree(i810Screen);
+ FREE(i810Screen);
drmUnmap(i810Screen->back.map, i810Screen->back.size);
sPriv->private = NULL;
__driUtilMessage("i810InitDriver: drmMap (2) failed");
i810Screen->tex.handle,
i810Screen->tex.size,
(drmAddress *)&i810Screen->tex.map) != 0) {
- Xfree(i810Screen);
+ FREE(i810Screen);
drmUnmap(i810Screen->back.map, i810Screen->back.size);
drmUnmap(i810Screen->depth.map, i810Screen->depth.size);
sPriv->private = NULL;
drmUnmap(i810Screen->depth.map, i810Screen->depth.size);
drmUnmap(i810Screen->tex.map, i810Screen->tex.size);
- Xfree(i810Screen);
+ FREE(i810Screen);
sPriv->private = NULL;
}
drmBufPtr buf;
int i;
- buffer = ALIGN_MALLOC(I830_DMA_BUF_SZ);
+ buffer = ALIGN_MALLOC(I830_DMA_BUF_SZ, 32);
if(buffer == NULL) return -1;
for(i = 0; i < I830_DMA_BUF_NR; i++) {
buf = &(buffers->list[i]);
{
drmBufMapPtr retval;
- retval = (drmBufMapPtr)ALIGN_MALLOC(sizeof(drmBufMap));
+ retval = (drmBufMapPtr)ALIGN_MALLOC(sizeof(drmBufMap), 32);
if(retval == NULL) return NULL;
memset(retval, 0, sizeof(drmBufMap));
- retval->list = (drmBufPtr)ALIGN_MALLOC(sizeof(drmBuf) * I830_DMA_BUF_NR);
+ retval->list = (drmBufPtr)ALIGN_MALLOC(sizeof(drmBuf) * I830_DMA_BUF_NR, 32);
if(retval->list == NULL) {
- Xfree(retval);
+ FREE(retval);
return NULL;
}
if(i830Screen->bufs == NULL) {
fprintf(stderr,"\nERROR: Failed to create empty buffers in %s \n",
__FUNCTION__);
- Xfree(i830Screen);
+ FREE(i830Screen);
return GL_FALSE;
}
(drmAddress *)&i830Screen->back.map) != 0) {
fprintf(stderr, "\nERROR: line %d, Function %s, File %s\n",
__LINE__, __FUNCTION__, __FILE__);
- Xfree(i830Screen);
+ FREE(i830Screen);
sPriv->private = NULL;
return GL_FALSE;
}
(drmAddress *)&i830Screen->depth.map) != 0) {
fprintf(stderr, "\nERROR: line %d, Function %s, File %s\n",
__LINE__, __FUNCTION__, __FILE__);
- Xfree(i830Screen);
+ FREE(i830Screen);
drmUnmap(i830Screen->back.map, i830Screen->back.size);
sPriv->private = NULL;
return GL_FALSE;
(drmAddress *)&i830Screen->tex.map) != 0) {
fprintf(stderr, "\nERROR: line %d, Function %s, File %s\n",
__LINE__, __FUNCTION__, __FILE__);
- Xfree(i830Screen);
+ FREE(i830Screen);
drmUnmap(i830Screen->back.map, i830Screen->back.size);
drmUnmap(i830Screen->depth.map, i830Screen->depth.size);
sPriv->private = NULL;
drmUnmap(i830Screen->back.map, i830Screen->back.size);
drmUnmap(i830Screen->depth.map, i830Screen->depth.size);
drmUnmap(i830Screen->tex.map, i830Screen->tex.size);
- Xfree(i830Screen);
+ FREE(i830Screen);
sPriv->private = NULL;
}