aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/nouveau/nouveau_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.c')
-rw-r--r--src/mesa/drivers/dri/nouveau/nouveau_context.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c
index 44392c0267c..f36483a3d49 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
@@ -216,9 +216,6 @@ GLboolean nouveauCreateContext( const __GLcontextModes *glVisual,
nouveauDDInitState( nmesa );
switch(nmesa->screen->card->type)
{
- case NV_03:
- //nv03TriInitFunctions( ctx );
- break;
case NV_04:
case NV_05:
nv04TriInitFunctions( ctx );
@@ -315,21 +312,24 @@ GLboolean nouveauUnbindContext( __DRIcontextPrivate *driContextPriv )
return GL_TRUE;
}
-static void nouveauDoSwapBuffers(nouveauContextPtr nmesa,
- __DRIdrawablePrivate *dPriv)
+void
+nouveauDoSwapBuffers(nouveauContextPtr nmesa, __DRIdrawablePrivate *dPriv)
{
struct gl_framebuffer *fb;
- nouveau_renderbuffer *src, *dst;
+ nouveauScreenPtr screen = dPriv->driScreenPriv->private;
+ nouveau_renderbuffer_t *src;
drm_clip_rect_t *box;
int nbox, i;
fb = (struct gl_framebuffer *)dPriv->driverPrivate;
- dst = (nouveau_renderbuffer*)
- fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
- src = (nouveau_renderbuffer*)
- fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer;
+ if (fb->_ColorDrawBufferMask[0] == BUFFER_BIT_FRONT_LEFT) {
+ src = (nouveau_renderbuffer_t *)
+ fb->Attachment[BUFFER_FRONT_LEFT].Renderbuffer;
+ } else {
+ src = (nouveau_renderbuffer_t *)
+ fb->Attachment[BUFFER_BACK_LEFT].Renderbuffer;
+ }
-#ifdef ALLOW_MULTI_SUBCHANNEL
LOCK_HARDWARE(nmesa);
nbox = dPriv->numClipRects;
box = dPriv->pClipRects;
@@ -341,13 +341,14 @@ static void nouveauDoSwapBuffers(nouveauContextPtr nmesa,
OUT_RING (6); /* X8R8G8B8 */
else
OUT_RING (4); /* R5G6B5 */
- OUT_RING ((dst->pitch << 16) | src->pitch);
- OUT_RING (src->offset);
- OUT_RING (dst->offset);
+ OUT_RING(((screen->frontPitch * screen->fbFormat) << 16) |
+ src->pitch);
+ OUT_RING(src->offset);
+ OUT_RING(screen->frontOffset);
}
for (i=0; i<nbox; i++, box++) {
- BEGIN_RING_SIZE(NvSubImageBlit, NV10_IMAGE_BLIT_SET_POINT, 3);
+ BEGIN_RING_SIZE(NvSubImageBlit, NV_IMAGE_BLIT_POINT_IN, 3);
OUT_RING (((box->y1 - dPriv->y) << 16) |
(box->x1 - dPriv->x));
OUT_RING ((box->y1 << 16) | box->x1);
@@ -357,7 +358,6 @@ static void nouveauDoSwapBuffers(nouveauContextPtr nmesa,
FIRE_RING();
UNLOCK_HARDWARE(nmesa);
-#endif
}
void nouveauSwapBuffers(__DRIdrawablePrivate *dPriv)