summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-09-04 05:30:27 +0200
committerLuca Barbieri <[email protected]>2010-09-04 05:31:52 +0200
commit7a830ac49f8ac29d9f5a7abc0c6474e6495d0a7b (patch)
tree7bfebc1988577d1f72f8d33f2b5b199c238709b2 /src
parent603bef557220d68dbb165e775c7c9b0d6db7709e (diff)
nvfx: consolidate tiny files
We probably want to reorganize the remaining files too, but that's for later, maybe.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/nvfx/Makefile8
-rw-r--r--src/gallium/drivers/nvfx/SConscript6
-rw-r--r--src/gallium/drivers/nvfx/nvfx_state_blend.c22
-rw-r--r--src/gallium/drivers/nvfx/nvfx_state_emit.c93
-rw-r--r--src/gallium/drivers/nvfx/nvfx_state_rasterizer.c9
-rw-r--r--src/gallium/drivers/nvfx/nvfx_state_scissor.c23
-rw-r--r--src/gallium/drivers/nvfx/nvfx_state_stipple.c11
-rw-r--r--src/gallium/drivers/nvfx/nvfx_state_viewport.c35
-rw-r--r--src/gallium/drivers/nvfx/nvfx_state_zsa.c21
9 files changed, 94 insertions, 134 deletions
diff --git a/src/gallium/drivers/nvfx/Makefile b/src/gallium/drivers/nvfx/Makefile
index 6cbbad699eb..46bb0823881 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 80e3ef2257f..f1041e77633 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 fe34e98364c..00000000000
--- 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 c3594ba615e..28b8c107576 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 7f14ae85d5a..00000000000
--- 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 9077266120a..00000000000
--- 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 b76e9dd3824..00000000000
--- 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 e983b16f321..00000000000
--- 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 608605d32bd..00000000000
--- 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]);
-}