Mesa (master): nouveau: Remove no-op nvgl_logicop_func function

Ian Romanick idr at kemper.freedesktop.org
Fri Jan 26 03:22:10 UTC 2018


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

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Wed Jan  3 18:28:57 2018 -0800

nouveau: Remove no-op nvgl_logicop_func function

The values that this function returned were always the values passed
in.  The only thing that happened was either an assertion or undefined
results when an unknown value was passed in.  This doesn't seem that
useful.  Most of nouveau_gldefs.h could be removed in this manner.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Francisco Jerez <currojerez at riseup.net>

---

 src/mesa/drivers/dri/nouveau/nouveau_gldefs.h    | 41 ------------------------
 src/mesa/drivers/dri/nouveau/nv10_state_raster.c |  2 +-
 src/mesa/drivers/dri/nouveau/nv20_state_raster.c |  2 +-
 3 files changed, 2 insertions(+), 43 deletions(-)

diff --git a/src/mesa/drivers/dri/nouveau/nouveau_gldefs.h b/src/mesa/drivers/dri/nouveau/nouveau_gldefs.h
index 7df04c1177..11c3dbd3de 100644
--- a/src/mesa/drivers/dri/nouveau/nouveau_gldefs.h
+++ b/src/mesa/drivers/dri/nouveau/nouveau_gldefs.h
@@ -86,47 +86,6 @@ nvgl_blend_eqn(unsigned eqn)
 }
 
 static inline unsigned
-nvgl_logicop_func(unsigned func)
-{
-	switch (func) {
-	case GL_CLEAR:
-		return 0x1500;
-	case GL_NOR:
-		return 0x1508;
-	case GL_AND_INVERTED:
-		return 0x1504;
-	case GL_COPY_INVERTED:
-		return 0x150c;
-	case GL_AND_REVERSE:
-		return 0x1502;
-	case GL_INVERT:
-		return 0x150a;
-	case GL_XOR:
-		return 0x1506;
-	case GL_NAND:
-		return 0x150e;
-	case GL_AND:
-		return 0x1501;
-	case GL_EQUIV:
-		return 0x1509;
-	case GL_NOOP:
-		return 0x1505;
-	case GL_OR_INVERTED:
-		return 0x150d;
-	case GL_COPY:
-		return 0x1503;
-	case GL_OR_REVERSE:
-		return 0x150b;
-	case GL_OR:
-		return 0x1507;
-	case GL_SET:
-		return 0x150f;
-	default:
-		assert(0);
-	}
-}
-
-static inline unsigned
 nvgl_comparison_op(unsigned op)
 {
 	switch (op) {
diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_raster.c b/src/mesa/drivers/dri/nouveau/nv10_state_raster.c
index d537f7bc22..047f539dbc 100644
--- a/src/mesa/drivers/dri/nouveau/nv10_state_raster.c
+++ b/src/mesa/drivers/dri/nouveau/nv10_state_raster.c
@@ -126,7 +126,7 @@ nv10_emit_logic_opcode(struct gl_context *ctx, int emit)
 
 	BEGIN_NV04(push, NV11_3D(COLOR_LOGIC_OP_ENABLE), 2);
 	PUSH_DATAb(push, ctx->Color.ColorLogicOpEnabled);
-	PUSH_DATA (push, nvgl_logicop_func(ctx->Color.LogicOp));
+	PUSH_DATA (push, ctx->Color.LogicOp);
 }
 
 void
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_raster.c b/src/mesa/drivers/dri/nouveau/nv20_state_raster.c
index 4856053aa6..c24c5bbaec 100644
--- a/src/mesa/drivers/dri/nouveau/nv20_state_raster.c
+++ b/src/mesa/drivers/dri/nouveau/nv20_state_raster.c
@@ -38,5 +38,5 @@ nv20_emit_logic_opcode(struct gl_context *ctx, int emit)
 
 	BEGIN_NV04(push, NV20_3D(COLOR_LOGIC_OP_ENABLE), 2);
 	PUSH_DATAb(push, ctx->Color.ColorLogicOpEnabled);
-	PUSH_DATA (push, nvgl_logicop_func(ctx->Color.LogicOp));
+	PUSH_DATA (push, ctx->Color.LogicOp);
 }




More information about the mesa-commit mailing list