From db94a2a5be8e9a8e4de088771874b14b79438299 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Wed, 15 Sep 2010 18:03:59 +0200 Subject: dri/nouveau: Cleanup references to the old FBOs on glMakeCurrent(). --- src/mesa/drivers/dri/nouveau/nouveau_context.c | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'src/mesa/drivers/dri/nouveau/nouveau_context.c') diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c b/src/mesa/drivers/dri/nouveau/nouveau_context.c index 244733e133..eff1016c07 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_context.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c @@ -212,7 +212,6 @@ nouveau_update_renderbuffers(__DRIcontext *dri_ctx, __DRIdrawable *draw) for (i = 0; i < count; i++) { struct gl_renderbuffer *rb; struct nouveau_surface *s; - uint32_t old_handle; int index; switch (buffers[i].attachment) { @@ -242,19 +241,10 @@ nouveau_update_renderbuffers(__DRIcontext *dri_ctx, __DRIdrawable *draw) s->pitch = buffers[i].pitch; s->cpp = buffers[i].cpp; - /* Don't bother to reopen the bo if it happens to be - * the same. */ - if (s->bo) { - ret = nouveau_bo_handle_get(s->bo, &old_handle); - assert(!ret); - } - - if (!s->bo || old_handle != buffers[i].name) { - nouveau_bo_ref(NULL, &s->bo); - ret = nouveau_bo_handle_ref(context_dev(ctx), - buffers[i].name, &s->bo); - assert(!ret); - } + nouveau_bo_ref(NULL, &s->bo); + ret = nouveau_bo_handle_ref(context_dev(ctx), + buffers[i].name, &s->bo); + assert(!ret); } _mesa_resize_framebuffer(NULL, fb, draw->w, draw->h); @@ -293,13 +283,15 @@ nouveau_context_make_current(__DRIcontext *dri_ctx, __DRIdrawable *dri_draw, update_framebuffer(dri_ctx, dri_read, &dri_ctx->dri2.read_stamp); + /* Clean up references to the old framebuffer objects. */ + context_bctx(ctx, FRAMEBUFFER); + FIRE_RING(context_chan(ctx)); + /* Pass it down to mesa. */ _mesa_make_current(ctx, dri_draw->driverPrivate, dri_read->driverPrivate); _mesa_update_state(ctx); - FIRE_RING(context_chan(ctx)); - } else { _mesa_make_current(NULL, NULL, NULL); } -- cgit v1.2.3