nouveau: bind the 3D engine to subchannel 7 and add RING_3D
authorLuca Barbieri <luca@luca-barbieri.com>
Tue, 23 Feb 2010 10:06:31 +0000 (11:06 +0100)
committerLuca Barbieri <luca@luca-barbieri.com>
Mon, 12 Apr 2010 10:13:15 +0000 (12:13 +0200)
RING_3D creates a method start for subchannel 7.

Bind the 3D engine to a fixed subchannel to make it work

This is much faster than the old BEGIN_RING, since we don't need
to waste cycles trying to "autobind" stuff, when a fast static binding
is perfectly good.

Subchannel 7 is chosen because the kernel takes up the lowest ones.

src/gallium/drivers/nouveau/nouveau_screen.h
src/gallium/drivers/nv50/nv50_screen.c
src/gallium/drivers/nvfx/nvfx_screen.c

index c0ec6e48952ce2f93b9c310eb5c5f41e3e023f83..f32ecd0b69bc3593a769752c7758a9ee821f8186 100644 (file)
@@ -60,4 +60,16 @@ void nouveau_screen_fini(struct nouveau_screen *);
 
 
 
+static __inline__ unsigned
+RING_3D(unsigned mthd, unsigned size)
+{
+       return (7 << 13) | (size << 18) | mthd;
+}
+
+static __inline__ unsigned
+RING_3D_NI(unsigned mthd, unsigned size)
+{
+       return 0x40000000 | (7 << 13) | (size << 18) | mthd;
+}
+
 #endif
index a0fe4c591321e72e81d1fe27841b1ee1700a6d65..425786f00f2e8482f2281a3f9b3a166ab3f913e6 100644 (file)
@@ -335,6 +335,9 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
                return NULL;
        }
 
+       /* this is necessary for the new RING_3D / statebuffer code */
+       BIND_RING(chan, screen->tesla, 7);
+
        /* Sync notifier */
        ret = nouveau_notifier_alloc(chan, 0xbeef0301, 1, &screen->sync);
        if (ret) {
index 1f6e6e34973b5df5a600c970277f5e771c6e5690..e63e1abcead5e35d9da1a647fb5b9c3c457bbd64 100644 (file)
@@ -418,6 +418,8 @@ nvfx_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
                return NULL;
        }
 
+       BIND_RING(chan, screen->eng3d, 7);
+
        /* Static eng3d initialisation */
        /* make the so big and don't worry about exact values
           since we it will be thrown away immediately after use */