nv50: add option to force immediate-mode submission, disable by default
authorBen Skeggs <bskeggs@redhat.com>
Tue, 9 Mar 2010 04:04:14 +0000 (14:04 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 10 Mar 2010 06:30:01 +0000 (16:30 +1000)
src/gallium/drivers/nv50/nv50_screen.c
src/gallium/drivers/nv50/nv50_screen.h
src/gallium/drivers/nv50/nv50_vbo.c

index 114ae9b38606b7813ce936d467b4985f2cef1ce1..7e2e8aa336e7baa58b46c5f1144a3c5478de9a93 100644 (file)
@@ -95,6 +95,8 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen,
 static int
 nv50_screen_get_param(struct pipe_screen *pscreen, int param)
 {
+       struct nv50_screen *screen = nv50_screen(pscreen);
+
        switch (param) {
        case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS:
                return 32;
@@ -132,9 +134,9 @@ nv50_screen_get_param(struct pipe_screen *pscreen, int param)
        case PIPE_CAP_BLEND_EQUATION_SEPARATE:
                return 1;
        case NOUVEAU_CAP_HW_VTXBUF:
-               return 1;
+               return screen->force_push ? 0 : 1;
        case NOUVEAU_CAP_HW_IDXBUF:
-               return 1;
+               return screen->force_push ? 0 : 1;
        case PIPE_CAP_INDEP_BLEND_ENABLE:
                return 1;
        case PIPE_CAP_INDEP_BLEND_FUNC:
@@ -493,6 +495,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
        so_ref (NULL, &so);
        nouveau_pushbuf_flush(chan, 0);
 
+       screen->force_push = debug_get_bool_option("NV50_ALWAYS_PUSH", FALSE);
        return pscreen;
 }
 
index 2687b72127797a208edfa8db5996a59f8b37b6f1..d1bc80cb9edfcf51667e1ce8d3a486af0a9303ac 100644 (file)
@@ -28,6 +28,8 @@ struct nv50_screen {
        struct nouveau_bo *tsc;
 
        struct nouveau_stateobj *static_init;
+
+       boolean force_push;
 };
 
 static INLINE struct nv50_screen *
index 9d49ad6db24f30cffefe1b84b4689ee1727b0987..7eedd4927180c0c5e71d4d4ca1b99c8be65f5a4f 100644 (file)
@@ -582,9 +582,14 @@ nv50_vbo_validate(struct nv50_context *nv50)
        if (nv50->vtxbuf_nr == 0)
                return NULL;
 
-       if (NV50_USING_LOATHED_EDGEFLAG(nv50))
+       if (nv50->screen->force_push || NV50_USING_LOATHED_EDGEFLAG(nv50))
                nv50->vbo_fifo = 0xffff;
-       nv50->vbo_fifo = 0xffff;
+
+       for (i = 0; i < nv50->vtxbuf_nr; i++) {
+               if (nv50->vtxbuf[i].stride &&
+                   !(nv50->vtxbuf[i].buffer->usage & PIPE_BUFFER_USAGE_VERTEX))
+                       nv50->vbo_fifo = 0xffff;
+       }
 
        n_ve = MAX2(nv50->vtxelt->num_elements, nv50->state.vtxelt_nr);