Module: Mesa
Branch: master
Commit: 878eef8c40046f77cf1527fef06f1ea95bd1629a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=878eef8c40046f77cf1527fef06f1ea95bd1629a

Author: Francisco Jerez <[email protected]>
Date:   Wed Mar 10 23:51:06 2010 +0100

dri/nouveau: Just reemit the BO state on pushbuf flush.

Reemitting dirty states on flush causes problems if the GL context
isn't fully consistent when we get to it. It didn't serve any specific
purpose, so, use nouveau_bo_state_emit instead.

---

 src/mesa/drivers/dri/nouveau/nouveau_context.c |    4 ++--
 src/mesa/drivers/dri/nouveau/nouveau_context.h |    2 ++
 src/mesa/drivers/dri/nouveau/nv04_context.c    |   22 ++++++++++------------
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.c 
b/src/mesa/drivers/dri/nouveau/nouveau_context.c
index 502e012..be57d48 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.c
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.c
@@ -69,8 +69,8 @@ nouveau_channel_flush_notify(struct nouveau_channel *chan)
        struct nouveau_context *nctx = chan->user_private;
        GLcontext *ctx = &nctx->base;
 
-       if (nctx->fallback < SWRAST && ctx->DrawBuffer)
-               nouveau_state_emit(&nctx->base);
+       if (nctx->fallback < SWRAST)
+               nouveau_bo_state_emit(ctx);
 }
 
 GLboolean
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_context.h 
b/src/mesa/drivers/dri/nouveau/nouveau_context.h
index 682f8a4..fe64fec 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_context.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_context.h
@@ -85,6 +85,8 @@ struct nouveau_context {
        BITSET_SET(to_nouveau_context(ctx)->dirty, NOUVEAU_STATE_##s)
 #define context_dirty_i(ctx, s, i) \
        BITSET_SET(to_nouveau_context(ctx)->dirty, NOUVEAU_STATE_##s##0 + i)
+#define context_emit(ctx, s) \
+       context_drv(ctx)->emit[NOUVEAU_STATE_##s](ctx, NOUVEAU_STATE_##s)
 
 GLboolean
 nouveau_context_create(const __GLcontextModes *visual, __DRIcontext *dri_ctx,
diff --git a/src/mesa/drivers/dri/nouveau/nv04_context.c 
b/src/mesa/drivers/dri/nouveau/nv04_context.c
index a442425..3624b3a 100644
--- a/src/mesa/drivers/dri/nouveau/nv04_context.c
+++ b/src/mesa/drivers/dri/nouveau/nv04_context.c
@@ -75,18 +75,16 @@ nv04_channel_flush_notify(struct nouveau_channel *chan)
        struct nouveau_context *nctx = chan->user_private;
        GLcontext *ctx = &nctx->base;
 
-       if (nctx->fallback < SWRAST && ctx->DrawBuffer) {
-               GLcontext *ctx = &nctx->base;
-
+       if (nctx->fallback < SWRAST) {
                /* Flushing seems to clobber the engine context. */
-               context_dirty_i(ctx, TEX_OBJ, 0);
-               context_dirty_i(ctx, TEX_OBJ, 1);
-               context_dirty_i(ctx, TEX_ENV, 0);
-               context_dirty_i(ctx, TEX_ENV, 1);
-               context_dirty(ctx, CONTROL);
-               context_dirty(ctx, BLEND);
-
-               nouveau_state_emit(ctx);
+               context_emit(ctx, TEX_OBJ0);
+               context_emit(ctx, TEX_OBJ1);
+               context_emit(ctx, TEX_ENV0);
+               context_emit(ctx, TEX_ENV1);
+               context_emit(ctx, CONTROL);
+               context_emit(ctx, BLEND);
+
+               nouveau_bo_state_emit(ctx);
        }
 }
 
@@ -200,9 +198,9 @@ nv04_context_create(struct nouveau_screen *screen, const 
GLvisual *visual,
        if (ret)
                goto fail;
 
+       init_dummy_texture(ctx);
        nv04_hwctx_init(ctx);
        nv04_render_init(ctx);
-       init_dummy_texture(ctx);
 
        return ctx;
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to