summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i810
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-09-03 16:43:02 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-09-03 16:43:02 +0000
commit687918b794d12a0ff5d395b8cf87880dbe8012bf (patch)
tree280d1b882dc3bfd0e105d14a1f9d90c7cef935dd /src/mesa/drivers/dri/i810
parente6925b51e1e71dc45079636ce336a09806356999 (diff)
SetBuffer, renderbuffer changes
Diffstat (limited to 'src/mesa/drivers/dri/i810')
-rw-r--r--src/mesa/drivers/dri/i810/i810context.c7
-rw-r--r--src/mesa/drivers/dri/i810/i810context.h2
-rw-r--r--src/mesa/drivers/dri/i810/i810screen.c3
-rw-r--r--src/mesa/drivers/dri/i810/i810span.c76
-rw-r--r--src/mesa/drivers/dri/i810/i810state.c9
5 files changed, 15 insertions, 82 deletions
diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c
index fd80e7675c..d3445706a4 100644
--- a/src/mesa/drivers/dri/i810/i810context.c
+++ b/src/mesa/drivers/dri/i810/i810context.c
@@ -60,6 +60,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i810vb.h"
#include "i810ioctl.h"
+#include "drirenderbuffer.h"
#include "utils.h"
#define need_GL_ARB_multisample
@@ -489,15 +490,13 @@ i810UpdatePageFlipping( i810ContextPtr imesa )
if ( imesa->sarea->pf_current_page == 1 )
front ^= 1;
+
+ driFlipRenderbuffers(ctx->WinSysDrawBuffer, front);
if (front) {
imesa->BufferSetup[I810_DESTREG_DI1] = imesa->i810Screen->fbOffset | imesa->i810Screen->backPitchBits;
- imesa->drawMap = (char *)imesa->driScreen->pFB;
- imesa->readMap = (char *)imesa->driScreen->pFB;
} else {
imesa->BufferSetup[I810_DESTREG_DI1] = imesa->i810Screen->backOffset | imesa->i810Screen->backPitchBits;
- imesa->drawMap = imesa->i810Screen->back.map;
- imesa->readMap = imesa->i810Screen->back.map;
}
imesa->dirty |= I810_UPLOAD_BUFFERS;
diff --git a/src/mesa/drivers/dri/i810/i810context.h b/src/mesa/drivers/dri/i810/i810context.h
index a2202e148f..b83500bbd0 100644
--- a/src/mesa/drivers/dri/i810/i810context.h
+++ b/src/mesa/drivers/dri/i810/i810context.h
@@ -152,8 +152,6 @@ struct i810_context_t {
/* These refer to the current draw (front vs. back) buffer:
*/
- char *drawMap; /* draw buffer address in virtual mem */
- char *readMap;
int drawX; /* origin of drawable in draw buffer */
int drawY;
GLuint numClipRects; /* cliprects for that buffer */
diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c
index 991c7cb231..af8e0cc08a 100644
--- a/src/mesa/drivers/dri/i810/i810screen.c
+++ b/src/mesa/drivers/dri/i810/i810screen.c
@@ -362,6 +362,7 @@ i810CreateBuffer( __DRIscreenPrivate *driScrnPriv,
/*screen->frontOffset*/0, screen->backPitch);
i810SetSpanFunctions(frontRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base);
+ frontRb->Base.Data = driScrnPriv->pFB;
}
if (mesaVis->doubleBufferMode) {
@@ -370,6 +371,7 @@ i810CreateBuffer( __DRIscreenPrivate *driScrnPriv,
screen->backOffset, screen->backPitch);
i810SetSpanFunctions(backRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base);
+ backRb->Base.Data = (GLubyte *) screen->back.map;
}
if (mesaVis->depthBits == 16) {
@@ -378,6 +380,7 @@ i810CreateBuffer( __DRIscreenPrivate *driScrnPriv,
screen->depthOffset, screen->backPitch);
i810SetSpanFunctions(depthRb, mesaVis);
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base);
+ depthRb->Base.Data = (GLubyte *) screen->depth.map;
}
_mesa_add_soft_renderbuffers(fb,
diff --git a/src/mesa/drivers/dri/i810/i810span.c b/src/mesa/drivers/dri/i810/i810span.c
index 1a976048c8..ac90106664 100644
--- a/src/mesa/drivers/dri/i810/i810span.c
+++ b/src/mesa/drivers/dri/i810/i810span.c
@@ -16,25 +16,23 @@
#define LOCAL_VARS \
i810ContextPtr imesa = I810_CONTEXT(ctx); \
__DRIdrawablePrivate *dPriv = imesa->driDrawable; \
- i810ScreenPrivate *i810Screen = imesa->i810Screen; \
- GLuint pitch = i810Screen->backPitch; \
+ driRenderbuffer *drb = (driRenderbuffer *) rb; \
+ GLuint pitch = drb->pitch; \
GLuint height = dPriv->h; \
GLushort p; \
- char *buf = (char *)(imesa->drawMap + \
+ char *buf = (char *)(drb->flippedData + \
dPriv->x * 2 + \
dPriv->y * pitch); \
- char *read_buf = (char *)(imesa->readMap + \
- dPriv->x * 2 + \
- dPriv->y * pitch); \
+ char *read_buf = buf; \
(void) read_buf; (void) buf; (void) p
#define LOCAL_DEPTH_VARS \
i810ContextPtr imesa = I810_CONTEXT(ctx); \
__DRIdrawablePrivate *dPriv = imesa->driDrawable; \
- i810ScreenPrivate *i810Screen = imesa->i810Screen; \
- GLuint pitch = i810Screen->backPitch; \
+ driRenderbuffer *drb = (driRenderbuffer *) rb; \
+ GLuint pitch = drb->pitch; \
GLuint height = dPriv->h; \
- char *buf = (char *)(i810Screen->depth.map + \
+ char *buf = (char *)(drb->Base.Data + \
dPriv->x * 2 + \
dPriv->y * pitch)
@@ -76,41 +74,10 @@ do { \
#define READ_DEPTH( d, _x, _y ) \
d = *(GLushort *)(buf + (_x)*2 + (_y)*pitch);
-#define TAG(x) i810##x##_16
+#define TAG(x) i810##x##_z16
#include "depthtmp.h"
-/*
- * This function is called to specify which buffer to read and write
- * for software rasterization (swrast) fallbacks. This doesn't necessarily
- * correspond to glDrawBuffer() or glReadBuffer() calls.
- */
-static void i810SetBuffer(GLcontext *ctx, GLframebuffer *buffer,
- GLuint bufferBit )
-{
- i810ContextPtr imesa = I810_CONTEXT(ctx);
- (void) buffer;
-
- switch(bufferBit) {
- case BUFFER_BIT_FRONT_LEFT:
- if ( imesa->sarea->pf_current_page == 1)
- imesa->readMap = imesa->i810Screen->back.map;
- else
- imesa->readMap = (char*)imesa->driScreen->pFB;
- break;
- case BUFFER_BIT_BACK_LEFT:
- if ( imesa->sarea->pf_current_page == 1)
- imesa->readMap = (char*)imesa->driScreen->pFB;
- else
- imesa->readMap = imesa->i810Screen->back.map;
- break;
- default:
- ASSERT(0);
- break;
- }
- imesa->drawMap = imesa->readMap;
-}
-
/* Move locking out to get reasonable span performance.
*/
void i810SpanRenderStart( GLcontext *ctx )
@@ -131,26 +98,6 @@ void i810SpanRenderFinish( GLcontext *ctx )
void i810InitSpanFuncs( GLcontext *ctx )
{
struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference(ctx);
-
- swdd->SetBuffer = i810SetBuffer;
-
-#if 0
- swdd->WriteRGBASpan = i810WriteRGBASpan_565;
- swdd->WriteRGBSpan = i810WriteRGBSpan_565;
- swdd->WriteMonoRGBASpan = i810WriteMonoRGBASpan_565;
- swdd->WriteRGBAPixels = i810WriteRGBAPixels_565;
- swdd->WriteMonoRGBAPixels = i810WriteMonoRGBAPixels_565;
- swdd->ReadRGBASpan = i810ReadRGBASpan_565;
- swdd->ReadRGBAPixels = i810ReadRGBAPixels_565;
-#endif
-
-#if 0
- swdd->ReadDepthSpan = i810ReadDepthSpan_16;
- swdd->WriteDepthSpan = i810WriteDepthSpan_16;
- swdd->ReadDepthPixels = i810ReadDepthPixels_16;
- swdd->WriteDepthPixels = i810WriteDepthPixels_16;
-#endif
-
swdd->SpanRenderStart = i810SpanRenderStart;
swdd->SpanRenderFinish = i810SpanRenderFinish;
}
@@ -174,12 +121,7 @@ i810SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis)
drb->Base.PutMonoValues = i810WriteMonoRGBAPixels_565;
}
else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) {
- drb->Base.GetRow = i810ReadDepthSpan_16;
- drb->Base.GetValues = i810ReadDepthPixels_16;
- drb->Base.PutRow = i810WriteDepthSpan_16;
- drb->Base.PutMonoRow = i810WriteMonoDepthSpan_16;
- drb->Base.PutValues = i810WriteDepthPixels_16;
- drb->Base.PutMonoValues = NULL;
+ i810InitDepthPointers_z16(&drb->Base);
}
else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) {
/* should never get here */
diff --git a/src/mesa/drivers/dri/i810/i810state.c b/src/mesa/drivers/dri/i810/i810state.c
index c4662e8958..4a811a0d03 100644
--- a/src/mesa/drivers/dri/i810/i810state.c
+++ b/src/mesa/drivers/dri/i810/i810state.c
@@ -329,11 +329,6 @@ void i810DrawBuffer(GLcontext *ctx, GLenum mode )
imesa->i810Screen->backPitchBits);
i810XMesaSetBackClipRects( imesa );
}
-
- /* We want to update the s/w rast state too so that r200SetBuffer()
- * gets called.
- */
- _swrast_DrawBuffer(ctx, mode);
}
@@ -939,14 +934,10 @@ void i810InitState( GLcontext *ctx )
if (imesa->glCtx->Visual.doubleBufferMode && imesa->sarea->pf_current_page == 0) {
/* use back buffer by default */
- imesa->drawMap = i810Screen->back.map;
- imesa->readMap = i810Screen->back.map;
imesa->BufferSetup[I810_DESTREG_DI1] = (i810Screen->backOffset |
i810Screen->backPitchBits);
} else {
/* use front buffer by default */
- imesa->drawMap = (char *)imesa->driScreen->pFB;
- imesa->readMap = (char *)imesa->driScreen->pFB;
imesa->BufferSetup[I810_DESTREG_DI1] = (i810Screen->fbOffset |
i810Screen->backPitchBits);
}