nv30, nv40: unify nv[34]0_state_viewport.c
authorLuca Barbieri <luca@luca-barbieri.com>
Sat, 20 Feb 2010 22:30:59 +0000 (23:30 +0100)
committerYounes Manton <younes.m@gmail.com>
Mon, 15 Mar 2010 04:03:02 +0000 (00:03 -0400)
The files are identical, except for an extra comment in nv30.

src/gallium/drivers/nv30/Makefile
src/gallium/drivers/nv30/nv30_context.h
src/gallium/drivers/nv30/nv30_state_viewport.c [deleted file]
src/gallium/drivers/nv40/Makefile
src/gallium/drivers/nv40/nv40_context.h
src/gallium/drivers/nv40/nv40_state_viewport.c [deleted file]
src/gallium/drivers/nvfx/Makefile
src/gallium/drivers/nvfx/nvfx_context.h
src/gallium/drivers/nvfx/nvfx_state_emit.c
src/gallium/drivers/nvfx/nvfx_state_viewport.c [new file with mode: 0644]

index 4f9798de0c66660ca8545e016d1edcb87f3006e6..6ee0d8f248a4b1967cd151de723964eda9c73d29 100644 (file)
@@ -11,7 +11,6 @@ C_SOURCES = \
        nv30_screen.c \
        nv30_state.c \
        nv30_state_fb.c \
-       nv30_state_viewport.c \
        nv30_vbo.c \
        nv30_vertprog.c
 
index a0a1c335ec16ddbf8ce6f5b1c58738f8e2b13939..37def47b61de03149f276e0818c41ce31db1e43b 100644 (file)
@@ -22,7 +22,6 @@ extern void nv30_fragtex_bind(struct nvfx_context *);
 /* nv30_state.c and friends */
 extern struct nvfx_state_entry nv30_state_fragprog;
 extern struct nvfx_state_entry nv30_state_vertprog;
-extern struct nvfx_state_entry nv30_state_viewport;
 extern struct nvfx_state_entry nv30_state_framebuffer;
 extern struct nvfx_state_entry nv30_state_fragtex;
 extern struct nvfx_state_entry nv30_state_vbo;
diff --git a/src/gallium/drivers/nv30/nv30_state_viewport.c b/src/gallium/drivers/nv30/nv30_state_viewport.c
deleted file mode 100644 (file)
index 2e9d5b1..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "nv30_context.h"
-
-static boolean
-nv30_state_viewport_validate(struct nvfx_context *nvfx)
-{
-       struct pipe_viewport_state *vpt = &nvfx->viewport;
-       struct nouveau_stateobj *so;
-
-       if (nvfx->state.hw[NVFX_STATE_VIEWPORT] &&
-           !(nvfx->dirty & NVFX_NEW_VIEWPORT))
-               return FALSE;
-
-       so = so_new(3, 10, 0);
-       so_method(so, nvfx->screen->eng3d,
-                 NV34TCL_VIEWPORT_TRANSLATE_X, 8);
-       so_data  (so, fui(vpt->translate[0]));
-       so_data  (so, fui(vpt->translate[1]));
-       so_data  (so, fui(vpt->translate[2]));
-       so_data  (so, fui(vpt->translate[3]));
-       so_data  (so, fui(vpt->scale[0]));
-       so_data  (so, fui(vpt->scale[1]));
-       so_data  (so, fui(vpt->scale[2]));
-       so_data  (so, fui(vpt->scale[3]));
-/*     so_method(so, nvfx->screen->eng3d, 0x1d78, 1);
-       so_data  (so, 1);
-*/
-       /* TODO/FIXME: never saw value 0x0110 in renouveau dumps, only 0x0001 */
-       so_method(so, nvfx->screen->eng3d, 0x1d78, 1);
-       so_data  (so, 1);
-
-       so_ref(so, &nvfx->state.hw[NVFX_STATE_VIEWPORT]);
-       so_ref(NULL, &so);
-       return TRUE;
-}
-
-struct nvfx_state_entry nv30_state_viewport = {
-       .validate = nv30_state_viewport_validate,
-       .dirty = {
-               .pipe = NVFX_NEW_VIEWPORT | NVFX_NEW_RAST,
-               .hw = NVFX_STATE_VIEWPORT
-       }
-};
index 0b3607be89779ce828ebc7e748af3d4d621931b9..85d6ce9886169e0b69be856c1ea619ed6dc182a7 100644 (file)
@@ -11,7 +11,6 @@ C_SOURCES = \
        nv40_screen.c \
        nv40_state.c \
        nv40_state_fb.c \
-       nv40_state_viewport.c \
        nv40_vbo.c \
        nv40_vertprog.c
 
index 4353d78cd23fa67547dc29dbe36f54a629f311da..a3000eeca043c56aad8d6404994932f8973f56bf 100644 (file)
@@ -26,7 +26,6 @@ extern void nv40_fragtex_bind(struct nvfx_context *);
 /* nv40_state.c and friends */
 extern struct nvfx_state_entry nv40_state_fragprog;
 extern struct nvfx_state_entry nv40_state_vertprog;
-extern struct nvfx_state_entry nv40_state_viewport;
 extern struct nvfx_state_entry nv40_state_framebuffer;
 extern struct nvfx_state_entry nv40_state_fragtex;
 extern struct nvfx_state_entry nv40_state_vbo;
diff --git a/src/gallium/drivers/nv40/nv40_state_viewport.c b/src/gallium/drivers/nv40/nv40_state_viewport.c
deleted file mode 100644 (file)
index bf73e11..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#include "nv40_context.h"
-
-static boolean
-nv40_state_viewport_validate(struct nvfx_context *nvfx)
-{
-       struct pipe_viewport_state *vpt = &nvfx->viewport;
-       struct nouveau_stateobj *so;
-
-       if (nvfx->state.hw[NVFX_STATE_VIEWPORT] &&
-           !(nvfx->dirty & NVFX_NEW_VIEWPORT))
-               return FALSE;
-
-       so = so_new(2, 9, 0);
-       so_method(so, nvfx->screen->eng3d,
-                 NV34TCL_VIEWPORT_TRANSLATE_X, 8);
-       so_data  (so, fui(vpt->translate[0]));
-       so_data  (so, fui(vpt->translate[1]));
-       so_data  (so, fui(vpt->translate[2]));
-       so_data  (so, fui(vpt->translate[3]));
-       so_data  (so, fui(vpt->scale[0]));
-       so_data  (so, fui(vpt->scale[1]));
-       so_data  (so, fui(vpt->scale[2]));
-       so_data  (so, fui(vpt->scale[3]));
-       so_method(so, nvfx->screen->eng3d, 0x1d78, 1);
-       so_data  (so, 1);
-
-       so_ref(so, &nvfx->state.hw[NVFX_STATE_VIEWPORT]);
-       so_ref(NULL, &so);
-       return TRUE;
-}
-
-struct nvfx_state_entry nv40_state_viewport = {
-       .validate = nv40_state_viewport_validate,
-       .dirty = {
-               .pipe = NVFX_NEW_VIEWPORT | NVFX_NEW_RAST,
-               .hw = NVFX_STATE_VIEWPORT
-       }
-};
index f51ab1856b65d41ce8cd3ef0c1fe7f06d0b8aa3a..2f198d9d1a28a293caf2c2998a3aaf9e9c98c42c 100644 (file)
@@ -12,6 +12,7 @@ C_SOURCES = \
        nvfx_state_rasterizer.c \
        nvfx_state_scissor.c \
         nvfx_state_stipple.c \
+       nvfx_state_viewport.c \
        nvfx_state_zsa.c \
        nvfx_surface.c \
        nvfx_transfer.c
index 5f61d4450d172cb35fe38f7736d5a1d83e348c5c..b6e6cf8fd959c38e238b318d0b894906e6baa6f7 100644 (file)
@@ -187,6 +187,7 @@ extern struct nvfx_state_entry nvfx_state_rasterizer;
 extern struct nvfx_state_entry nvfx_state_scissor;
 extern struct nvfx_state_entry nvfx_state_sr;
 extern struct nvfx_state_entry nvfx_state_stipple;
+extern struct nvfx_state_entry nvfx_state_viewport;
 extern struct nvfx_state_entry nvfx_state_zsa;
 
 extern void nvfx_init_query_functions(struct nvfx_context *nvfx);
index 04c0429ce19402ae987b5f0150cf99faa4017e0e..b86cb44936a710fc20729a712ac049a6b6b03105 100644 (file)
@@ -16,7 +16,7 @@ static struct nvfx_state_entry *name##_render_states[] = { \
        &nvfx_state_blend_colour, \
        &nvfx_state_zsa, \
        &nvfx_state_sr, \
-       &nvxx##_state_viewport, \
+       &nvfx_state_viewport, \
        &nvxx##_state_##vbo, \
        NULL \
 }
diff --git a/src/gallium/drivers/nvfx/nvfx_state_viewport.c b/src/gallium/drivers/nvfx/nvfx_state_viewport.c
new file mode 100644 (file)
index 0000000..72057a8
--- /dev/null
@@ -0,0 +1,38 @@
+#include "nvfx_context.h"
+
+static boolean
+nvfx_state_viewport_validate(struct nvfx_context *nvfx)
+{
+       struct pipe_viewport_state *vpt = &nvfx->viewport;
+       struct nouveau_stateobj *so;
+
+       if (nvfx->state.hw[NVFX_STATE_VIEWPORT] &&
+           !(nvfx->dirty & NVFX_NEW_VIEWPORT))
+               return FALSE;
+
+       so = so_new(2, 9, 0);
+       so_method(so, nvfx->screen->eng3d,
+                 NV34TCL_VIEWPORT_TRANSLATE_X, 8);
+       so_data  (so, fui(vpt->translate[0]));
+       so_data  (so, fui(vpt->translate[1]));
+       so_data  (so, fui(vpt->translate[2]));
+       so_data  (so, fui(vpt->translate[3]));
+       so_data  (so, fui(vpt->scale[0]));
+       so_data  (so, fui(vpt->scale[1]));
+       so_data  (so, fui(vpt->scale[2]));
+       so_data  (so, fui(vpt->scale[3]));
+       so_method(so, nvfx->screen->eng3d, 0x1d78, 1);
+       so_data  (so, 1);
+
+       so_ref(so, &nvfx->state.hw[NVFX_STATE_VIEWPORT]);
+       so_ref(NULL, &so);
+       return TRUE;
+}
+
+struct nvfx_state_entry nvfx_state_viewport = {
+       .validate = nvfx_state_viewport_validate,
+       .dirty = {
+               .pipe = NVFX_NEW_VIEWPORT | NVFX_NEW_RAST,
+               .hw = NVFX_STATE_VIEWPORT
+       }
+};