Mesa (master): nvfx: consolidate tiny files

Luca Barbieri lb at kemper.freedesktop.org
Fri Sep 3 20:32:56 PDT 2010


Module: Mesa
Branch: master
Commit: 7a830ac49f8ac29d9f5a7abc0c6474e6495d0a7b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7a830ac49f8ac29d9f5a7abc0c6474e6495d0a7b

Author: Luca Barbieri <luca at luca-barbieri.com>
Date:   Sat Sep  4 05:30:27 2010 +0200

nvfx: consolidate tiny files

We probably want to reorganize the remaining files too, but that's
for later, maybe.

---

 src/gallium/drivers/nvfx/Makefile                |    8 +--
 src/gallium/drivers/nvfx/SConscript              |    6 --
 src/gallium/drivers/nvfx/nvfx_state_blend.c      |   22 -----
 src/gallium/drivers/nvfx/nvfx_state_emit.c       |   93 ++++++++++++++++++++++
 src/gallium/drivers/nvfx/nvfx_state_rasterizer.c |    9 --
 src/gallium/drivers/nvfx/nvfx_state_scissor.c    |   23 ------
 src/gallium/drivers/nvfx/nvfx_state_stipple.c    |   11 ---
 src/gallium/drivers/nvfx/nvfx_state_viewport.c   |   35 --------
 src/gallium/drivers/nvfx/nvfx_state_zsa.c        |   21 -----
 9 files changed, 94 insertions(+), 134 deletions(-)

diff --git a/src/gallium/drivers/nvfx/Makefile b/src/gallium/drivers/nvfx/Makefile
index 6cbbad6..46bb082 100644
--- a/src/gallium/drivers/nvfx/Makefile
+++ b/src/gallium/drivers/nvfx/Makefile
@@ -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 \
diff --git a/src/gallium/drivers/nvfx/SConscript b/src/gallium/drivers/nvfx/SConscript
index 80e3ef2..f1041e7 100644
--- a/src/gallium/drivers/nvfx/SConscript
+++ b/src/gallium/drivers/nvfx/SConscript
@@ -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
index fe34e98..0000000
--- a/src/gallium/drivers/nvfx/nvfx_state_blend.c
+++ /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)));
-}
diff --git a/src/gallium/drivers/nvfx/nvfx_state_emit.c b/src/gallium/drivers/nvfx/nvfx_state_emit.c
index c3594ba..28b8c10 100644
--- a/src/gallium/drivers/nvfx/nvfx_state_emit.c
+++ b/src/gallium/drivers/nvfx/nvfx_state_emit.c
@@ -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
index 7f14ae8..0000000
--- a/src/gallium/drivers/nvfx/nvfx_state_rasterizer.c
+++ /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
index 9077266..0000000
--- a/src/gallium/drivers/nvfx/nvfx_state_scissor.c
+++ /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
index b76e9dd..0000000
--- a/src/gallium/drivers/nvfx/nvfx_state_stipple.c
+++ /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
index e983b16..0000000
--- a/src/gallium/drivers/nvfx/nvfx_state_viewport.c
+++ /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
index 608605d..0000000
--- a/src/gallium/drivers/nvfx/nvfx_state_zsa.c
+++ /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]);
-}



More information about the mesa-commit mailing list