summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r200/r200_lock.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-09-01 04:03:44 +0000
committerBrian Paul <[email protected]>2005-09-01 04:03:44 +0000
commitfcbfeb5d28aea87c60f2d02daa213d0c0c2516e8 (patch)
tree783872f7936fc274c1786dd8a06e227494939c7a /src/mesa/drivers/dri/r200/r200_lock.c
parent982e8e4d5c95e9e9040b4b70d7322a2a8a9396d9 (diff)
Finish up some of the gl_renderbuffer work.
Use driRenderbuffer's offset, pitch fields in the span routines. Remove the SetBuffer driver function. Consolidate the code for setting CTX_RB3D_COLOROFFSET and CTX_RB3D_COLORPITCH state in new radeonUpdateDrawBuffer() function. Old code is surrounded by #if 000 / #endif, temporarily.
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_lock.c')
-rw-r--r--src/mesa/drivers/dri/r200/r200_lock.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_lock.c b/src/mesa/drivers/dri/r200/r200_lock.c
index 9b82c18d1fe..f0858f2c313 100644
--- a/src/mesa/drivers/dri/r200/r200_lock.c
+++ b/src/mesa/drivers/dri/r200/r200_lock.c
@@ -39,6 +39,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "r200_tex.h"
#include "r200_state.h"
#include "r200_ioctl.h"
+#include "drirenderbuffer.h"
#if DEBUG_LOCKING
char *prevLockFile = NULL;
@@ -50,6 +51,7 @@ int prevLockLine = 0;
static void
r200UpdatePageFlipping( r200ContextPtr rmesa )
{
+#if 000
int use_back;
rmesa->doPageFlip = rmesa->sarea->pfState;
@@ -68,6 +70,43 @@ r200UpdatePageFlipping( r200ContextPtr rmesa )
rmesa->hw.ctx.cmd[CTX_RB3D_COLOROFFSET] = rmesa->state.color.drawOffset
+ rmesa->r200Screen->fbLocation;
rmesa->hw.ctx.cmd[CTX_RB3D_COLORPITCH] = rmesa->state.color.drawPitch;
+#else
+ if (rmesa->doPageFlip != rmesa->sarea->pfState
+ || rmesa->sarea->pfState) {
+ /* If page flipping is on, re we're turning it on/off now we need
+ * to update the flipped buffer info.
+ */
+ struct gl_framebuffer *fb = rmesa->glCtx->WinSysDrawBuffer;
+ driRenderbuffer *front_drb
+ = (driRenderbuffer *) fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
+ driRenderbuffer *back_drb
+ = (driRenderbuffer *) fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer;
+
+ if (rmesa->sarea->pfState && rmesa->sarea->pfCurrentPage == 1) {
+ /* flipped buffers */
+ front_drb->flippedOffset = back_drb->offset;
+ front_drb->flippedPitch = back_drb->pitch;
+ back_drb->flippedOffset = front_drb->offset;
+ back_drb->flippedPitch = front_drb->pitch;
+ }
+ else {
+ /* unflipped buffers */
+ front_drb->flippedOffset = front_drb->offset;
+ front_drb->flippedPitch = front_drb->pitch;
+ if (back_drb) {
+ /* back buffer is non-existant when single buffered */
+ back_drb->flippedOffset = back_drb->offset;
+ back_drb->flippedPitch = back_drb->pitch;
+ }
+ }
+
+ /* update local state */
+ rmesa->doPageFlip = rmesa->sarea->pfState;
+
+ /* set hw.ctx.cmd state here */
+ r200UpdateDrawBuffer(rmesa->glCtx);
+ }
+#endif
}