Mesa (master): r300g: small code cleanup (v2)

David Heidelberg okias at kemper.freedesktop.org
Fri Feb 6 17:32:52 UTC 2015


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

Author: David Heidelberg <david at ixit.cz>
Date:   Sun Dec 28 01:11:14 2014 +0100

r300g: small code cleanup (v2)

v2: incorporated changes from Marek Olšák

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Signed-off-by: David Heidelberg <david at ixit.cz>

---

 src/gallium/drivers/r300/r300_reg.h           |   22 ++--------------------
 src/gallium/drivers/r300/r300_screen.c        |    6 ++----
 src/gallium/drivers/r300/r300_state.c         |    1 -
 src/gallium/drivers/r300/r300_state_inlines.h |    1 -
 4 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h
index 46aeba0..8a0728d 100644
--- a/src/gallium/drivers/r300/r300_reg.h
+++ b/src/gallium/drivers/r300/r300_reg.h
@@ -191,7 +191,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #	define R300_VAP_TCL_BYPASS		(1 << 8)
 /* Read only flag if TCL engine is busy. */
 #	define R300_VAP_PVS_BUSY                (1 << 11)
-/* TODO: gap for MAX_MPS */
 /* Read only flag if the vertex store is busy. */
 #	define R300_VAP_VS_BUSY                 (1 << 24)
 /* Read only flag if the reciprocal engine is busy. */
@@ -921,9 +920,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
  *
  * The line width is given in multiples of 6.
  * In default mode lines are classified as vertical lines.
- * HO: horizontal
- * VE: vertical or horizontal
- * HO & VE: no classification
  */
 #define R300_GA_LINE_CNTL                             0x4234
 #       define R300_GA_LINE_CNTL_WIDTH_SHIFT       0
@@ -934,12 +930,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #	define R300_GA_LINE_CNTL_END_TYPE_COMP     (3 << 16) /* Computed (perpendicular to slope) */
 #	define R500_GA_LINE_CNTL_SORT_NO           (0 << 18)
 #	define R500_GA_LINE_CNTL_SORT_MINX_MINY    (1 << 18)
-/** TODO: looks wrong */
-#       define R300_LINESIZE_MAX              (R300_GA_LINE_CNTL_WIDTH_MASK / 6)
-/** TODO: looks wrong */
-#       define R300_LINE_CNT_HO               (1 << 16)
-/** TODO: looks wrong */
-#       define R300_LINE_CNT_VE               (1 << 17)
 
 /* Line Stipple configuration information. */
 #define R300_GA_LINE_STIPPLE_CONFIG                   0x4238
@@ -1278,8 +1268,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define R300_RS_IP_1				        0x4314
 #define R300_RS_IP_2				        0x4318
 #define R300_RS_IP_3				        0x431C
-#       define R300_RS_INTERP_SRC_SHIFT          2 /* TODO: check for removal */
-#       define R300_RS_INTERP_SRC_MASK           (7 << 2) /* TODO: check for removal */
 #	define R300_RS_TEX_PTR(x)		        (x << 0)
 #	define R300_RS_COL_PTR(x)		        ((x) << 6)
 #	define R300_RS_COL_FMT(x)		        ((x) << 9)
@@ -3300,7 +3288,7 @@ enum {
 #   define R500_INST_ALPHA_PRED_SEL_GGGG		(3 << 25)
 #   define R500_INST_ALPHA_PRED_SEL_BBBB		(4 << 25)
 #   define R500_INST_ALPHA_PRED_SEL_AAAA		(5 << 25)
-/* XXX next four are kind of guessed */
+/* Next four are guessed, documentation doesn't mention order. */
 #   define R500_INST_STAT_WE_R				(1 << 28)
 #   define R500_INST_STAT_WE_G				(1 << 29)
 #   define R500_INST_STAT_WE_B				(1 << 30)
@@ -3546,19 +3534,13 @@ enum {
 /*
  * CP type-3 packets
  */
-#define R300_CP_CMD_BITBLT_MULTI	0xC0009B00
-
-/* XXX Corbin's stuff from radeon and r200 */
-
 #define RADEON_WAIT_UNTIL                   0x1720
 #       define RADEON_WAIT_CRTC_PFLIP       (1 << 0)
 #       define RADEON_WAIT_2D_IDLECLEAN     (1 << 16)
 #       define RADEON_WAIT_3D_IDLECLEAN     (1 << 17)
 #       define RADEON_WAIT_HOST_IDLECLEAN   (1 << 18)
 
-#define R200_3D_DRAW_IMMD_2      0xC0003500
-
-#define RADEON_CP_PACKET0 0x0 /* XXX stolen from radeon_reg.h */
+#define RADEON_CP_PACKET0                           0x00000000
 #define RADEON_CP_PACKET3                           0xC0000000
 
 #define RADEON_ONE_REG_WR        (1 << 15)
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 640d547..7794fc2 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -271,7 +271,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e
         case PIPE_SHADER_CAP_MAX_TEMPS:
             return is_r500 ? 128 : is_r400 ? 64 : 32;
         case PIPE_SHADER_CAP_MAX_PREDS:
-            return is_r500 ? 1 : 0;
+            return 0; /* unused */
         case PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS:
         case PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS:
            return r300screen->caps.num_tex_units;
@@ -321,7 +321,7 @@ static int r300_get_shader_param(struct pipe_screen *pscreen, unsigned shader, e
         case PIPE_SHADER_CAP_MAX_TEMPS:
             return 32;
         case PIPE_SHADER_CAP_MAX_PREDS:
-            return is_r500 ? 4 : 0; /* XXX guessed. */
+            return 0; /* unused */
         case PIPE_SHADER_CAP_INDIRECT_CONST_ADDR:
             return 1;
         case PIPE_SHADER_CAP_MAX_TEX_INSTRUCTIONS:
@@ -372,8 +372,6 @@ static float r300_get_paramf(struct pipe_screen* pscreen,
         case PIPE_CAPF_GUARD_BAND_TOP:
         case PIPE_CAPF_GUARD_BAND_RIGHT:
         case PIPE_CAPF_GUARD_BAND_BOTTOM:
-            /* XXX I don't know what these should be but the least we can do is
-             * silence the potential error message */
             return 0.0f;
         default:
             debug_printf("r300: Warning: Unknown CAP %d in get_paramf.\n",
diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c
index 6ce0329..e886df8 100644
--- a/src/gallium/drivers/r300/r300_state.c
+++ b/src/gallium/drivers/r300/r300_state.c
@@ -1156,7 +1156,6 @@ static void r300_delete_fs_state(struct pipe_context* pipe, void* shader)
 static void r300_set_polygon_stipple(struct pipe_context* pipe,
                                      const struct pipe_poly_stipple* state)
 {
-    /* XXX no idea how to set this up, but not terribly important */
 }
 
 /* Create a new rasterizer state based on the CSO rasterizer state.
diff --git a/src/gallium/drivers/r300/r300_state_inlines.h b/src/gallium/drivers/r300/r300_state_inlines.h
index 97619db..feec494 100644
--- a/src/gallium/drivers/r300/r300_state_inlines.h
+++ b/src/gallium/drivers/r300/r300_state_inlines.h
@@ -60,7 +60,6 @@ static INLINE uint32_t r300_translate_blend_function(int blend_func,
     return 0;
 }
 
-/* XXX we can also offer the D3D versions of some of these... */
 static INLINE uint32_t r300_translate_blend_factor(int blend_fact)
 {
     switch (blend_fact) {




More information about the mesa-commit mailing list