summaryrefslogtreecommitdiff
path: root/xc/lib/GL/mesa/src/drv/ffb
diff options
context:
space:
mode:
Diffstat (limited to 'xc/lib/GL/mesa/src/drv/ffb')
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_context.h2
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c6
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c4
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_points.c9
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_rendertmp.h42
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_state.c88
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c11
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c6
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h6
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c4
-rw-r--r--xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c21
11 files changed, 91 insertions, 108 deletions
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_context.h b/xc/lib/GL/mesa/src/drv/ffb/ffb_context.h
index 4c7c38978..6e68b6dd2 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_context.h
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_context.h
@@ -3,7 +3,6 @@
#ifndef _FFB_CONTEXT_H
#define _FFB_CONTEXT_H
-#include <X11/Xlibint.h>
#include "dri_util.h"
#include "mtypes.h"
@@ -269,7 +268,6 @@ do { if ((STATE_MASK) & ~((FMESA)->state_dirty)) { \
drmContext hHWContext;
drmLock *driHwLock;
int driFd;
- Display *display;
unsigned int clear_pixel;
unsigned int clear_depth;
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c
index e14b6d443..d0137000f 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c
@@ -26,10 +26,6 @@
*/
#include "mtypes.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
#include "mm.h"
#include "ffb_dd.h"
#include "ffb_span.h"
@@ -41,7 +37,7 @@
#include "ffb_lock.h"
#include "extensions.h"
-#define FFB_DATE "20010624"
+#define FFB_DATE "20021125"
/* Mesa's Driver Functions */
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c
index e82c9ab51..da1de18f3 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_lines.c
@@ -26,10 +26,6 @@
*/
#include "mtypes.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-
#include "mm.h"
#include "ffb_dd.h"
#include "ffb_span.h"
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_points.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_points.c
index a92c69d09..ee956d371 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_points.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_points.c
@@ -27,20 +27,13 @@
#include "mtypes.h"
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "mm.h"
#include "ffb_dd.h"
-#include "ffb_span.h"
-#include "ffb_depth.h"
#include "ffb_context.h"
#include "ffb_vb.h"
-#include "ffb_lines.h"
#include "ffb_points.h"
#include "ffb_tris.h"
#include "ffb_lock.h"
-#include "extensions.h"
+
#undef FFB_POINT_TRACE
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_rendertmp.h b/xc/lib/GL/mesa/src/drv/ffb/ffb_rendertmp.h
index de5185909..d1a376cd5 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_rendertmp.h
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_rendertmp.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_rendertmp.h,v 1.1 2002/02/22 21:32:59 dawes Exp $ */
+/* $XFree86$ */
#define IMPL_LOCAL_VARS \
ffbContextPtr fmesa = FFB_CONTEXT(ctx); \
@@ -56,8 +56,8 @@ static void TAG(ffb_vb_points)(GLcontext *ctx, GLuint start, GLuint count, GLuin
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_POINTS);
if (ctx->_TriangleCaps & DD_POINT_SMOOTH) {
@@ -90,8 +90,8 @@ static void TAG(ffb_vb_lines)(GLcontext *ctx, GLuint start, GLuint count, GLuint
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_LINES);
for (i = start + 1; i < count; i += 2) {
@@ -123,8 +123,8 @@ static void TAG(ffb_vb_line_loop)(GLcontext *ctx, GLuint start, GLuint count, GL
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_LINE_LOOP);
if ((flags & PRIM_BEGIN) != 0) {
@@ -185,8 +185,8 @@ static void TAG(ffb_vb_line_strip)(GLcontext *ctx, GLuint start, GLuint count, G
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_LINE_STRIP);
FFBFifo(fmesa, (1 + FFB_PRIM_COLOR_COST +
@@ -278,8 +278,8 @@ static void TAG(ffb_vb_triangles)(GLcontext *ctx, GLuint start, GLuint count, GL
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_TRIANGLES);
for (i = start + 2; i < count; i += 3) {
@@ -321,8 +321,8 @@ static void TAG(ffb_vb_tri_strip)(GLcontext *ctx, GLuint start, GLuint count, GL
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_TRIANGLE_STRIP);
if ((flags & PRIM_PARITY) != 0)
@@ -394,8 +394,8 @@ static void TAG(ffb_vb_tri_fan)(GLcontext *ctx, GLuint start, GLuint count, GLui
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_TRIANGLE_FAN);
@@ -464,8 +464,8 @@ static void TAG(ffb_vb_poly)(GLcontext *ctx, GLuint start, GLuint count, GLuint
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_POLYGON);
@@ -508,8 +508,8 @@ static void TAG(ffb_vb_quads)(GLcontext *ctx, GLuint start, GLuint count, GLuint
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_QUADS);
@@ -557,8 +557,8 @@ static void TAG(ffb_vb_quad_strip)(GLcontext *ctx, GLuint start, GLuint count, G
IMPL_LOCAL_VARS;
#ifdef FFB_RENDER_TRACE
- fprintf(stderr, __FUNCTION__ ": start(%d) count(%d) flags(%x)\n",
- start, count, flags);
+ fprintf(stderr, "%s: start(%d) count(%d) flags(%x)\n",
+ __FUNCTION__, start, count, flags);
#endif
ffbRenderPrimitive(ctx, GL_QUAD_STRIP);
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_state.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_state.c
index 3853fd3a0..6f33a35d2 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_state.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_state.c
@@ -27,9 +27,6 @@
#include "mtypes.h"
-#include <stdio.h>
-#include <stdlib.h>
-
#include "mm.h"
#include "ffb_dd.h"
#include "ffb_span.h"
@@ -37,8 +34,6 @@
#include "ffb_context.h"
#include "ffb_vb.h"
#include "ffb_tris.h"
-#include "ffb_lines.h"
-#include "ffb_points.h"
#include "ffb_state.h"
#include "ffb_lock.h"
#include "extensions.h"
@@ -56,6 +51,7 @@
static unsigned int ffbComputeAlphaFunc(GLcontext *ctx)
{
unsigned int xclip;
+ GLubyte alphaRef;
#ifdef STATE_TRACE
fprintf(stderr, "ffbDDAlphaFunc: func(%s) ref(%02x)\n",
@@ -77,12 +73,13 @@ static unsigned int ffbComputeAlphaFunc(GLcontext *ctx)
return FFB_XCLIP_TEST_ALWAYS | 0x00;
}
- xclip |= (ctx->Color.AlphaRef & 0xff);
+ CLAMPED_FLOAT_TO_UBYTE(alphaRef, ctx->Color.AlphaRef);
+ xclip |= (alphaRef & 0xff);
return xclip;
}
-static void ffbDDAlphaFunc(GLcontext *ctx, GLenum func, GLchan ref)
+static void ffbDDAlphaFunc(GLcontext *ctx, GLenum func, GLfloat ref)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
@@ -448,7 +445,7 @@ void ffbCalcViewport(GLcontext *ctx)
ffbCalcViewportRegs(ctx);
- fmesa->setupnewinputs |= VERT_CLIP;
+ fmesa->setupnewinputs |= VERT_BIT_CLIP;
}
static void ffbDDViewport(GLcontext *ctx, GLint x, GLint y,
@@ -468,32 +465,32 @@ static void ffbDDScissor(GLcontext *ctx, GLint cx, GLint cy,
ffbCalcViewport(ctx);
}
-static void ffbDDSetDrawBuffer(GLcontext *ctx, GLenum buffer)
+static void ffbDDDrawBuffer(GLcontext *ctx, GLenum buffer)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
unsigned int fbc = fmesa->fbc;
#ifdef STATE_TRACE
- fprintf(stderr, "ffbDDSetDrawBuffer: mode(%s)\n",
+ fprintf(stderr, "ffbDDDrawBuffer: mode(%s)\n",
_mesa_lookup_enum_by_nr(buffer));
#endif
- fbc &= ~(FFB_FBC_WB_AB);
+ fbc &= ~(FFB_FBC_WB_AB | FFB_FBC_RB_MASK);
switch (buffer) {
- case GL_FRONT_LEFT:
+ case FRONT_LEFT_BIT:
if (fmesa->back_buffer == 0)
- fbc |= FFB_FBC_WB_B;
+ fbc |= FFB_FBC_WB_B | FFB_FBC_RB_B;
else
- fbc |= FFB_FBC_WB_A;
+ fbc |= FFB_FBC_WB_A | FFB_FBC_RB_A;
break;
- case GL_BACK_LEFT:
+ case BACK_LEFT_BIT:
if (fmesa->back_buffer == 0)
- fbc |= FFB_FBC_WB_A;
+ fbc |= FFB_FBC_WB_A | FFB_FBC_RB_A;
else
- fbc |= FFB_FBC_WB_B;
+ fbc |= FFB_FBC_WB_B | FFB_FBC_RB_B;
break;
- case GL_FRONT_AND_BACK:
+ case BACK_LEFT_BIT | FRONT_LEFT_BIT:
fbc |= FFB_FBC_WB_AB;
break;
@@ -507,8 +504,18 @@ static void ffbDDSetDrawBuffer(GLcontext *ctx, GLenum buffer)
}
}
-static void ffbDDSetReadBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
- GLenum buffer)
+
+static void ffbDDReadBuffer(GLcontext *ctx, GLenum buffer)
+{
+ /* no-op, unless you implement h/w glRead/CopyPixels */
+}
+
+
+/*
+ * Specifies buffer for sw fallbacks (spans)
+ */
+static void ffbDDSetBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
+ GLuint bufferBit)
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
unsigned int fbc = fmesa->fbc;
@@ -518,15 +525,15 @@ static void ffbDDSetReadBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
_mesa_lookup_enum_by_nr(buffer));
#endif
fbc &= ~(FFB_FBC_RB_MASK);
- switch (buffer) {
- case GL_FRONT_LEFT:
+ switch (bufferBit) {
+ case FRONT_LEFT_BIT:
if (fmesa->back_buffer == 0)
fbc |= FFB_FBC_RB_B;
else
fbc |= FFB_FBC_RB_A;
break;
- case GL_BACK_LEFT:
+ case BACK_LEFT_BIT:
if (fmesa->back_buffer == 0)
fbc |= FFB_FBC_RB_A;
else
@@ -543,13 +550,17 @@ static void ffbDDSetReadBuffer(GLcontext *ctx, GLframebuffer *colorBuffer,
}
}
-static void ffbDDClearColor(GLcontext *ctx, const GLchan color[4])
+static void ffbDDClearColor(GLcontext *ctx, const GLfloat color[4])
{
ffbContextPtr fmesa = FFB_CONTEXT(ctx);
-
- fmesa->clear_pixel = ((color[0] << 0) |
- (color[1] << 8) |
- (color[2] << 16));
+ GLubyte c[4];
+ CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]);
+ CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]);
+ CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]);
+
+ fmesa->clear_pixel = ((c[0] << 0) |
+ (c[1] << 8) |
+ (c[2] << 16));
}
static void ffbDDClearDepth(GLcontext *ctx, GLclampd depth)
@@ -842,14 +853,14 @@ static void ffbDDEnable(GLcontext *ctx, GLenum cap, GLboolean state)
tmp = fmesa->fbc & ~FFB_FBC_YE_MASK;
if (state) {
ffbDDStencilFunc(ctx,
- ctx->Stencil.Function,
- ctx->Stencil.Ref,
- ctx->Stencil.ValueMask);
- ffbDDStencilMask(ctx, ctx->Stencil.WriteMask);
+ ctx->Stencil.Function[0],
+ ctx->Stencil.Ref[0],
+ ctx->Stencil.ValueMask[0]);
+ ffbDDStencilMask(ctx, ctx->Stencil.WriteMask[0]);
ffbDDStencilOp(ctx,
- ctx->Stencil.FailFunc,
- ctx->Stencil.ZFailFunc,
- ctx->Stencil.ZPassFunc);
+ ctx->Stencil.FailFunc[0],
+ ctx->Stencil.ZFailFunc[0],
+ ctx->Stencil.ZPassFunc[0]);
tmp |= FFB_FBC_YE_MASK;
} else {
fmesa->stencil = 0xf0000000;
@@ -1017,7 +1028,7 @@ static void ffbDDUpdateState(GLcontext *ctx, GLuint newstate)
if (newstate & _NEW_TEXTURE)
FALLBACK( ctx, FFB_BADATTR_TEXTURE,
- (ctx->Texture._ReallyEnabled != 0));
+ (ctx->Texture._EnabledUnits != 0));
#ifdef STATE_TRACE
fprintf(stderr, "ffbDDUpdateState: newstate(%08x)\n", newstate);
@@ -1078,7 +1089,8 @@ void ffbDDInitStateFuncs(GLcontext *ctx)
ctx->Driver.StencilOp = NULL;
}
- ctx->Driver.SetDrawBuffer = ffbDDSetDrawBuffer;
+ ctx->Driver.DrawBuffer = ffbDDDrawBuffer;
+ ctx->Driver.ReadBuffer = ffbDDReadBuffer;
ctx->Driver.ClearColor = ffbDDClearColor;
ctx->Driver.ClearDepth = ffbDDClearDepth;
ctx->Driver.ClearStencil = ffbDDClearStencil;
@@ -1107,7 +1119,7 @@ void ffbDDInitStateFuncs(GLcontext *ctx)
{
struct swrast_device_driver *swdd =
_swrast_GetDeviceDriverReference(ctx);
- swdd->SetReadBuffer = ffbDDSetReadBuffer;
+ swdd->SetBuffer = ffbDDSetBuffer;
}
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c
index 792198652..d0d3c3b9d 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_tris.c
@@ -25,16 +25,13 @@
* David S. Miller <davem@redhat.com>
*/
-#include <stdio.h>
-#include <stdlib.h>
-
#include "glheader.h"
#include "mtypes.h"
#include "macros.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
-#include "swrast_setup/ss_context.h"
+#include "swrast/s_context.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
@@ -926,7 +923,7 @@ void ffbFallback( GLcontext *ctx, GLuint bit, GLboolean mode )
void ffbDDInitRenderFuncs( GLcontext *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- SScontext *swsetup = SWSETUP_CONTEXT(ctx);
+ SWcontext *swrast = SWRAST_CONTEXT(ctx);
static int firsttime = 1;
if (firsttime) {
@@ -944,6 +941,6 @@ void ffbDDInitRenderFuncs( GLcontext *ctx )
tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts;
tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts;
- swsetup->Driver.Start = ffbSWRenderStart;
- swsetup->Driver.Finish = ffbSWRenderFinish;
+ swrast->Driver.SpanRenderStart = ffbSWRenderStart;
+ swrast->Driver.SpanRenderFinish = ffbSWRenderFinish;
}
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c
index 2e8c6687f..09c9d041e 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_vb.c
@@ -28,7 +28,7 @@
#include "ffb_xmesa.h"
#include "ffb_context.h"
#include "ffb_vb.h"
-#include "mem.h"
+#include "imports.h"
#include "tnl/t_context.h"
#include "swrast_setup/swrast_setup.h"
#include "math/m_translate.h"
@@ -175,12 +175,12 @@ static void ffbDDBuildVertices(GLcontext *ctx, GLuint start, GLuint count,
if (!newinputs)
return;
- if (newinputs & VERT_CLIP) {
+ if (newinputs & VERT_BIT_CLIP) {
setup_tab[fmesa->setupindex].emit(ctx, start, count);
} else {
GLuint ind = 0;
- if (newinputs & VERT_RGBA)
+ if (newinputs & VERT_BIT_COLOR0)
ind |= (FFB_VB_RGBA_BIT | FFB_VB_TWOSIDE_BIT);
ind &= fmesa->setupindex;
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h b/xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h
index f0c1bf355..58b0391c7 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vbtmp.h,v 1.1 2002/02/22 21:32:59 dawes Exp $ */
+/* $XFree86$ */
static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end)
{
@@ -13,8 +13,8 @@ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end)
#endif
#endif
#if (IND & FFB_VB_XYZ_BIT)
- GLfloat (*proj)[4] = VB->ProjectedClipPtr->data;
- GLuint proj_stride = VB->ProjectedClipPtr->stride;
+ GLfloat (*proj)[4] = VB->NdcPtr->data;
+ GLuint proj_stride = VB->NdcPtr->stride;
const GLubyte *mask = VB->ClipMask;
#endif
ffb_vertex *v = &fmesa->verts[start];
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c
index d274410ea..329911bdc 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_vtxfmt.c,v 1.1 2002/02/22 21:32:59 dawes Exp $
+/* $XFree86$
*
* GLX Hardware Device Driver for Sun Creator/Creator3D
* Copyright (C) 2001 David S. Miller
@@ -30,7 +30,7 @@
#include "context.h"
#include "light.h"
#include "macros.h"
-#include "mem.h"
+#include "imports.h"
#include "mmath.h"
#include "mtypes.h"
#include "simple_list.h"
diff --git a/xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c b/xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c
index b851a3240..eff0d5d9f 100644
--- a/xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c
+++ b/xc/lib/GL/mesa/src/drv/ffb/ffb_xmesa.c
@@ -27,15 +27,12 @@
#ifdef GLX_DIRECT_RENDERING
-#include <X11/Xlibint.h>
-#include <stdio.h>
-
#include "ffb_xmesa.h"
#include "context.h"
#include "matrix.h"
#include "simple_list.h"
#include "mmath.h"
-#include "mem.h"
+#include "imports.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
@@ -43,9 +40,6 @@
#include "tnl/t_pipeline.h"
#include "array_cache/acache.h"
-
-#include "xf86dri.h"
-
#include "ffb_context.h"
#include "ffb_dd.h"
#include "ffb_span.h"
@@ -176,7 +170,7 @@ static const struct gl_pipeline_stage *ffb_pipeline[] = {
/* Create and initialize the Mesa and driver specific context data */
static GLboolean
-ffbCreateContext(Display *dpy, const __GLcontextModes *mesaVis,
+ffbCreateContext(const __GLcontextModes *mesaVis,
__DRIcontextPrivate *driContextPriv,
void *sharedContextPrivate)
{
@@ -208,7 +202,6 @@ ffbCreateContext(Display *dpy, const __GLcontextModes *mesaVis,
ffbScreen = (ffbScreenPrivate *) sPriv->private;
/* Dri stuff. */
- fmesa->display = dpy;
fmesa->hHWContext = driContextPriv->hHWContext;
fmesa->driFd = sPriv->fd;
fmesa->driHwLock = &sPriv->pSAREA->lock;
@@ -315,8 +308,7 @@ ffbDestroyContext(__DRIcontextPrivate *driContextPriv)
/* Create and initialize the Mesa and driver specific pixmap buffer data */
static GLboolean
-ffbCreateBuffer(Display *dpy,
- __DRIscreenPrivate *driScrnPriv,
+ffbCreateBuffer(__DRIscreenPrivate *driScrnPriv,
__DRIdrawablePrivate *driDrawPriv,
const __GLcontextModes *mesaVis,
GLboolean isPixmap )
@@ -346,9 +338,8 @@ ffbDestroyBuffer(__DRIdrawablePrivate *driDrawPriv)
#define USE_FAST_SWAP
static void
-ffbSwapBuffers(Display *dpy, void *drawablePrivate)
+ffbSwapBuffers( __DRIdrawablePrivate *dPriv )
{
- __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate;
ffbContextPtr fmesa = (ffbContextPtr) dPriv->driContextPriv->driverPrivate;
unsigned int fbc, wid, wid_reg_val, dac_db_bit;
unsigned int shadow_dac_addr, active_dac_addr;
@@ -360,7 +351,7 @@ ffbSwapBuffers(Display *dpy, void *drawablePrivate)
return;
/* Flush pending rendering commands */
- _mesa_swapbuffers(fmesa->glCtx);
+ _mesa_notifySwapBuffers(fmesa->glCtx);
ffb = fmesa->regs;
dac = fmesa->ffbScreen->dac;
@@ -557,7 +548,7 @@ void ffbXMesaUpdateState(ffbContextPtr fmesa)
__DRIscreenPrivate *sPriv = fmesa->driScreen;
int stamp = dPriv->lastStamp;
- DRI_VALIDATE_DRAWABLE_INFO(fmesa->display, sPriv, dPriv);
+ DRI_VALIDATE_DRAWABLE_INFO(sPriv, dPriv);
if (dPriv->lastStamp != stamp) {
GLcontext *ctx = fmesa->glCtx;