nv50: use flush_notify to reduce number of relocs
authorMaarten Maathuis <madman2003@gmail.com>
Mon, 14 Sep 2009 17:42:53 +0000 (19:42 +0200)
committerMaarten Maathuis <madman2003@gmail.com>
Tue, 15 Sep 2009 16:59:53 +0000 (18:59 +0200)
src/gallium/drivers/nv50/nv50_context.c
src/gallium/drivers/nv50/nv50_context.h
src/gallium/drivers/nv50/nv50_state_validate.c

index 6e8f4f9750dbaf5a88efa620c5355629d59131ab..935de8af52172e05f8dcdfecbf049a6c8a7cf66a 100644 (file)
@@ -110,6 +110,9 @@ nv50_create(struct pipe_screen *pscreen, unsigned pctx_id)
        nv50->pipe.is_texture_referenced = nv50_is_texture_referenced;
        nv50->pipe.is_buffer_referenced = nv50_is_buffer_referenced;
 
+       screen->base.channel->user_private = nv50;
+       screen->base.channel->flush_notify = nv50_state_flush_notify;
+
        nv50_init_surface_functions(nv50);
        nv50_init_state_functions(nv50);
        nv50_init_query_functions(nv50);
index 3a5f990e97ef2eaa3e956f381fa35caf158facac..4608854d7111734de2136facf4b6f4c1cf3acdf1 100644 (file)
@@ -196,6 +196,7 @@ extern void nv50_program_destroy(struct nv50_context *nv50, struct nv50_program
 
 /* nv50_state_validate.c */
 extern boolean nv50_state_validate(struct nv50_context *nv50);
+extern void nv50_state_flush_notify(struct nouveau_channel *chan);
 
 /* nv50_tex.c */
 extern void nv50_tex_validate(struct nv50_context *);
index d307a98745320c272ea6f0d560b265c585c32248..5a3559ed181d223f286f43454f6a4d354ab9d551 100644 (file)
@@ -212,6 +212,12 @@ nv50_state_emit(struct nv50_context *nv50)
                        so_emit(chan, nv50->state.vtxattr);
        }
        nv50->state.dirty = 0;
+}
+
+void
+nv50_state_flush_notify(struct nouveau_channel *chan)
+{
+       struct nv50_context *nv50 = chan->user_private;
 
        so_emit_reloc_markers(chan, nv50->state.fb);
        so_emit_reloc_markers(chan, nv50->state.vertprog);