nvfx: consolidate tiny files
authorLuca Barbieri <luca@luca-barbieri.com>
Sat, 4 Sep 2010 03:30:27 +0000 (05:30 +0200)
committerLuca Barbieri <luca@luca-barbieri.com>
Sat, 4 Sep 2010 03:31:52 +0000 (05:31 +0200)
We probably want to reorganize the remaining files too, but that's
for later, maybe.

src/gallium/drivers/nvfx/Makefile
src/gallium/drivers/nvfx/SConscript
src/gallium/drivers/nvfx/nvfx_state_blend.c [deleted file]
src/gallium/drivers/nvfx/nvfx_state_emit.c
src/gallium/drivers/nvfx/nvfx_state_rasterizer.c [deleted file]
src/gallium/drivers/nvfx/nvfx_state_scissor.c [deleted file]
src/gallium/drivers/nvfx/nvfx_state_stipple.c [deleted file]
src/gallium/drivers/nvfx/nvfx_state_viewport.c [deleted file]
src/gallium/drivers/nvfx/nvfx_state_zsa.c [deleted file]

index 6cbbad699eb5eb728a74fcffd300bf00302b2fab..46bb082388116d98c17ee3b8e0086f4753511e4e 100644 (file)
@@ -19,14 +19,8 @@ C_SOURCES = \
        nvfx_resource.c \
        nvfx_screen.c \
        nvfx_state.c \
-       nvfx_state_blend.c \
-        nvfx_state_emit.c \
+       nvfx_state_emit.c \
        nvfx_state_fb.c \
-       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 \
        nvfx_vbo.c \
index 80e3ef2257f8d0e9bd837fba17f4e305d8d4de9b..f1041e7763345b7bd9519331587f39f973b691a6 100644 (file)
@@ -24,14 +24,8 @@ nvfx = env.ConvenienceLibrary(
         'nvfx_resource.c',
         'nvfx_screen.c',
         'nvfx_state.c',
-        'nvfx_state_blend.c',
         'nvfx_state_emit.c',
         'nvfx_state_fb.c',
-        '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',
         'nvfx_vbo.c',
diff --git a/src/gallium/drivers/nvfx/nvfx_state_blend.c b/src/gallium/drivers/nvfx/nvfx_state_blend.c
deleted file mode 100644 (file)
index fe34e98..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#include "nvfx_context.h"
-
-void
-nvfx_state_blend_validate(struct nvfx_context *nvfx)
-{
-       struct nouveau_channel* chan = nvfx->screen->base.channel;
-       sb_emit(chan, nvfx->blend->sb, nvfx->blend->sb_len);
-}
-
-void
-nvfx_state_blend_colour_validate(struct nvfx_context *nvfx)
-{
-       struct nouveau_channel* chan = nvfx->screen->base.channel;
-       struct pipe_blend_color *bcol = &nvfx->blend_colour;
-
-       WAIT_RING(chan, 2);
-       OUT_RING(chan, RING_3D(NV34TCL_BLEND_COLOR, 1));
-       OUT_RING(chan, ((float_to_ubyte(bcol->color[3]) << 24) |
-                      (float_to_ubyte(bcol->color[0]) << 16) |
-                      (float_to_ubyte(bcol->color[1]) <<  8) |
-                      (float_to_ubyte(bcol->color[2]) <<  0)));
-}
index c3594ba615e66ed59cd5a3c8e8b05cc7232fd96b..28b8c107576ba1a08cf62f8237b75fc38a431dba 100644 (file)
@@ -3,6 +3,99 @@
 #include "nvfx_resource.h"
 #include "draw/draw_context.h"
 
+void
+nvfx_state_viewport_validate(struct nvfx_context *nvfx)
+{
+       struct nouveau_channel *chan = nvfx->screen->base.channel;
+       struct pipe_viewport_state *vpt = &nvfx->viewport;
+
+       WAIT_RING(chan, 11);
+       if(nvfx->render_mode == HW) {
+               OUT_RING(chan, RING_3D(NV34TCL_VIEWPORT_TRANSLATE_X, 8));
+               OUT_RINGf(chan, vpt->translate[0]);
+               OUT_RINGf(chan, vpt->translate[1]);
+               OUT_RINGf(chan, vpt->translate[2]);
+               OUT_RINGf(chan, vpt->translate[3]);
+               OUT_RINGf(chan, vpt->scale[0]);
+               OUT_RINGf(chan, vpt->scale[1]);
+               OUT_RINGf(chan, vpt->scale[2]);
+               OUT_RINGf(chan, vpt->scale[3]);
+               OUT_RING(chan, RING_3D(0x1d78, 1));
+               OUT_RING(chan, 1);
+       } else {
+               OUT_RING(chan, RING_3D(NV34TCL_VIEWPORT_TRANSLATE_X, 8));
+               OUT_RINGf(chan, 0.0f);
+               OUT_RINGf(chan, 0.0f);
+               OUT_RINGf(chan, 0.0f);
+               OUT_RINGf(chan, 0.0f);
+               OUT_RINGf(chan, 1.0f);
+               OUT_RINGf(chan, 1.0f);
+               OUT_RINGf(chan, 1.0f);
+               OUT_RINGf(chan, 1.0f);
+               OUT_RING(chan, RING_3D(0x1d78, 1));
+               OUT_RING(chan, nvfx->is_nv4x ? 0x110 : 1);
+       }
+}
+
+void
+nvfx_state_scissor_validate(struct nvfx_context *nvfx)
+{
+       struct nouveau_channel *chan = nvfx->screen->base.channel;
+       struct pipe_rasterizer_state *rast = &nvfx->rasterizer->pipe;
+       struct pipe_scissor_state *s = &nvfx->scissor;
+
+       if ((rast->scissor == 0 && nvfx->state.scissor_enabled == 0))
+               return;
+       nvfx->state.scissor_enabled = rast->scissor;
+
+       WAIT_RING(chan, 3);
+       OUT_RING(chan, RING_3D(NV34TCL_SCISSOR_HORIZ, 2));
+       if (nvfx->state.scissor_enabled) {
+               OUT_RING(chan, ((s->maxx - s->minx) << 16) | s->minx);
+               OUT_RING(chan, ((s->maxy - s->miny) << 16) | s->miny);
+       } else {
+               OUT_RING(chan, 4096 << 16);
+               OUT_RING(chan, 4096 << 16);
+       }
+}
+
+void
+nvfx_state_sr_validate(struct nvfx_context *nvfx)
+{
+       struct nouveau_channel* chan = nvfx->screen->base.channel;
+       struct pipe_stencil_ref *sr = &nvfx->stencil_ref;
+
+       WAIT_RING(chan, 4);
+       OUT_RING(chan, RING_3D(NV34TCL_STENCIL_FRONT_FUNC_REF, 1));
+       OUT_RING(chan, sr->ref_value[0]);
+       OUT_RING(chan, RING_3D(NV34TCL_STENCIL_BACK_FUNC_REF, 1));
+       OUT_RING(chan, sr->ref_value[1]);
+}
+
+void
+nvfx_state_blend_colour_validate(struct nvfx_context *nvfx)
+{
+       struct nouveau_channel* chan = nvfx->screen->base.channel;
+       struct pipe_blend_color *bcol = &nvfx->blend_colour;
+
+       WAIT_RING(chan, 2);
+       OUT_RING(chan, RING_3D(NV34TCL_BLEND_COLOR, 1));
+       OUT_RING(chan, ((float_to_ubyte(bcol->color[3]) << 24) |
+                      (float_to_ubyte(bcol->color[0]) << 16) |
+                      (float_to_ubyte(bcol->color[1]) <<  8) |
+                      (float_to_ubyte(bcol->color[2]) <<  0)));
+}
+
+void
+nvfx_state_stipple_validate(struct nvfx_context *nvfx)
+{
+       struct nouveau_channel *chan = nvfx->screen->base.channel;
+
+       WAIT_RING(chan, 33);
+       OUT_RING(chan, RING_3D(NV34TCL_POLYGON_STIPPLE_PATTERN(0), 32));
+       OUT_RINGp(chan, nvfx->stipple, 32);
+}
+
 static void
 nvfx_coord_conventions_validate(struct nvfx_context* nvfx)
 {
diff --git a/src/gallium/drivers/nvfx/nvfx_state_rasterizer.c b/src/gallium/drivers/nvfx/nvfx_state_rasterizer.c
deleted file mode 100644 (file)
index 7f14ae8..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "nvfx_context.h"
-
-void
-nvfx_state_rasterizer_validate(struct nvfx_context *nvfx)
-{
-       struct nouveau_channel* chan = nvfx->screen->base.channel;
-       sb_emit(chan, nvfx->rasterizer->sb, nvfx->rasterizer->sb_len);
-}
-
diff --git a/src/gallium/drivers/nvfx/nvfx_state_scissor.c b/src/gallium/drivers/nvfx/nvfx_state_scissor.c
deleted file mode 100644 (file)
index 9077266..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "nvfx_context.h"
-
-void
-nvfx_state_scissor_validate(struct nvfx_context *nvfx)
-{
-       struct nouveau_channel *chan = nvfx->screen->base.channel;
-       struct pipe_rasterizer_state *rast = &nvfx->rasterizer->pipe;
-       struct pipe_scissor_state *s = &nvfx->scissor;
-
-       if ((rast->scissor == 0 && nvfx->state.scissor_enabled == 0))
-               return;
-       nvfx->state.scissor_enabled = rast->scissor;
-
-       WAIT_RING(chan, 3);
-       OUT_RING(chan, RING_3D(NV34TCL_SCISSOR_HORIZ, 2));
-       if (nvfx->state.scissor_enabled) {
-               OUT_RING(chan, ((s->maxx - s->minx) << 16) | s->minx);
-               OUT_RING(chan, ((s->maxy - s->miny) << 16) | s->miny);
-       } else {
-               OUT_RING(chan, 4096 << 16);
-               OUT_RING(chan, 4096 << 16);
-       }
-}
diff --git a/src/gallium/drivers/nvfx/nvfx_state_stipple.c b/src/gallium/drivers/nvfx/nvfx_state_stipple.c
deleted file mode 100644 (file)
index b76e9dd..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-#include "nvfx_context.h"
-
-void
-nvfx_state_stipple_validate(struct nvfx_context *nvfx)
-{
-       struct nouveau_channel *chan = nvfx->screen->base.channel;
-
-       WAIT_RING(chan, 33);
-       OUT_RING(chan, RING_3D(NV34TCL_POLYGON_STIPPLE_PATTERN(0), 32));
-       OUT_RINGp(chan, nvfx->stipple, 32);
-}
diff --git a/src/gallium/drivers/nvfx/nvfx_state_viewport.c b/src/gallium/drivers/nvfx/nvfx_state_viewport.c
deleted file mode 100644 (file)
index e983b16..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "nvfx_context.h"
-
-void
-nvfx_state_viewport_validate(struct nvfx_context *nvfx)
-{
-       struct nouveau_channel *chan = nvfx->screen->base.channel;
-       struct pipe_viewport_state *vpt = &nvfx->viewport;
-
-       WAIT_RING(chan, 11);
-       if(nvfx->render_mode == HW) {
-               OUT_RING(chan, RING_3D(NV34TCL_VIEWPORT_TRANSLATE_X, 8));
-               OUT_RINGf(chan, vpt->translate[0]);
-               OUT_RINGf(chan, vpt->translate[1]);
-               OUT_RINGf(chan, vpt->translate[2]);
-               OUT_RINGf(chan, vpt->translate[3]);
-               OUT_RINGf(chan, vpt->scale[0]);
-               OUT_RINGf(chan, vpt->scale[1]);
-               OUT_RINGf(chan, vpt->scale[2]);
-               OUT_RINGf(chan, vpt->scale[3]);
-               OUT_RING(chan, RING_3D(0x1d78, 1));
-               OUT_RING(chan, 1);
-       } else {
-               OUT_RING(chan, RING_3D(NV34TCL_VIEWPORT_TRANSLATE_X, 8));
-               OUT_RINGf(chan, 0.0f);
-               OUT_RINGf(chan, 0.0f);
-               OUT_RINGf(chan, 0.0f);
-               OUT_RINGf(chan, 0.0f);
-               OUT_RINGf(chan, 1.0f);
-               OUT_RINGf(chan, 1.0f);
-               OUT_RINGf(chan, 1.0f);
-               OUT_RINGf(chan, 1.0f);
-               OUT_RING(chan, RING_3D(0x1d78, 1));
-               OUT_RING(chan, nvfx->is_nv4x ? 0x110 : 1);
-       }
-}
diff --git a/src/gallium/drivers/nvfx/nvfx_state_zsa.c b/src/gallium/drivers/nvfx/nvfx_state_zsa.c
deleted file mode 100644 (file)
index 608605d..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "nvfx_context.h"
-
-void
-nvfx_state_zsa_validate(struct nvfx_context *nvfx)
-{
-       struct nouveau_channel* chan = nvfx->screen->base.channel;
-       sb_emit(chan, nvfx->zsa->sb, nvfx->zsa->sb_len);
-}
-
-void
-nvfx_state_sr_validate(struct nvfx_context *nvfx)
-{
-       struct nouveau_channel* chan = nvfx->screen->base.channel;
-       struct pipe_stencil_ref *sr = &nvfx->stencil_ref;
-
-       WAIT_RING(chan, 4);
-       OUT_RING(chan, RING_3D(NV34TCL_STENCIL_FRONT_FUNC_REF, 1));
-       OUT_RING(chan, sr->ref_value[0]);
-       OUT_RING(chan, RING_3D(NV34TCL_STENCIL_BACK_FUNC_REF, 1));
-       OUT_RING(chan, sr->ref_value[1]);
-}