nv50: move nv50_prim() into a header file rather than duplicating
authorBen Skeggs <bskeggs@redhat.com>
Tue, 9 Mar 2010 04:52:30 +0000 (14:52 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Wed, 10 Mar 2010 06:30:01 +0000 (16:30 +1000)
src/gallium/drivers/nv50/nv50_context.h
src/gallium/drivers/nv50/nv50_push.c
src/gallium/drivers/nv50/nv50_vbo.c

index 35abfba93b9ed91664b2d10caf362b8e7f5d7403..f65b328a56f6a47d409bb111b2d04f414b2f7e71 100644 (file)
@@ -259,4 +259,35 @@ nv50_upload_sifc(struct nv50_context *nv50,
 struct pipe_context *
 nv50_create(struct pipe_screen *pscreen, void *priv);
 
+static INLINE unsigned
+nv50_prim(unsigned mode)
+{
+       switch (mode) {
+       case PIPE_PRIM_POINTS: return NV50TCL_VERTEX_BEGIN_POINTS;
+       case PIPE_PRIM_LINES: return NV50TCL_VERTEX_BEGIN_LINES;
+       case PIPE_PRIM_LINE_LOOP: return NV50TCL_VERTEX_BEGIN_LINE_LOOP;
+       case PIPE_PRIM_LINE_STRIP: return NV50TCL_VERTEX_BEGIN_LINE_STRIP;
+       case PIPE_PRIM_TRIANGLES: return NV50TCL_VERTEX_BEGIN_TRIANGLES;
+       case PIPE_PRIM_TRIANGLE_STRIP:
+               return NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP;
+       case PIPE_PRIM_TRIANGLE_FAN: return NV50TCL_VERTEX_BEGIN_TRIANGLE_FAN;
+       case PIPE_PRIM_QUADS: return NV50TCL_VERTEX_BEGIN_QUADS;
+       case PIPE_PRIM_QUAD_STRIP: return NV50TCL_VERTEX_BEGIN_QUAD_STRIP;
+       case PIPE_PRIM_POLYGON: return NV50TCL_VERTEX_BEGIN_POLYGON;
+       case PIPE_PRIM_LINES_ADJACENCY:
+               return NV50TCL_VERTEX_BEGIN_LINES_ADJACENCY;
+       case PIPE_PRIM_LINE_STRIP_ADJACENCY:
+               return NV50TCL_VERTEX_BEGIN_LINE_STRIP_ADJACENCY;
+       case PIPE_PRIM_TRIANGLES_ADJACENCY:
+               return NV50TCL_VERTEX_BEGIN_TRIANGLES_ADJACENCY;
+       case PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY:
+               return NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP_ADJACENCY;
+       default:
+               break;
+       }
+
+       NOUVEAU_ERR("invalid primitive type %d\n", mode);
+       return NV50TCL_VERTEX_BEGIN_POINTS;
+}
+
 #endif
index b615f4e05494c30e0d56c8f7c948ac1de63b355d..96a1f32d304f7af0aee5cfae50166f011b43269d 100644 (file)
@@ -6,37 +6,6 @@
 #include "nouveau/nouveau_util.h"
 #include "nv50_context.h"
 
-static INLINE unsigned
-nv50_prim(unsigned mode)
-{
-   switch (mode) {
-   case PIPE_PRIM_POINTS: return NV50TCL_VERTEX_BEGIN_POINTS;
-   case PIPE_PRIM_LINES: return NV50TCL_VERTEX_BEGIN_LINES;
-   case PIPE_PRIM_LINE_LOOP: return NV50TCL_VERTEX_BEGIN_LINE_LOOP;
-   case PIPE_PRIM_LINE_STRIP: return NV50TCL_VERTEX_BEGIN_LINE_STRIP;
-   case PIPE_PRIM_TRIANGLES: return NV50TCL_VERTEX_BEGIN_TRIANGLES;
-   case PIPE_PRIM_TRIANGLE_STRIP:
-      return NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP;
-   case PIPE_PRIM_TRIANGLE_FAN: return NV50TCL_VERTEX_BEGIN_TRIANGLE_FAN;
-   case PIPE_PRIM_QUADS: return NV50TCL_VERTEX_BEGIN_QUADS;
-   case PIPE_PRIM_QUAD_STRIP: return NV50TCL_VERTEX_BEGIN_QUAD_STRIP;
-   case PIPE_PRIM_POLYGON: return NV50TCL_VERTEX_BEGIN_POLYGON;
-   case PIPE_PRIM_LINES_ADJACENCY:
-      return NV50TCL_VERTEX_BEGIN_LINES_ADJACENCY;
-   case PIPE_PRIM_LINE_STRIP_ADJACENCY:
-      return NV50TCL_VERTEX_BEGIN_LINE_STRIP_ADJACENCY;
-   case PIPE_PRIM_TRIANGLES_ADJACENCY:
-      return NV50TCL_VERTEX_BEGIN_TRIANGLES_ADJACENCY;
-   case PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY:
-      return NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP_ADJACENCY;
-   default:
-      break;
-   }
-
-   NOUVEAU_ERR("invalid primitive type %d\n", mode);
-   return NV50TCL_VERTEX_BEGIN_POINTS;
-}
-
 struct push_context {
    struct nv50_context *nv50;
 
index 7eedd4927180c0c5e71d4d4ca1b99c8be65f5a4f..2b06b8105625be1cc92088dbf236fef42981beb5 100644 (file)
 
 #define NV50_USING_LOATHED_EDGEFLAG(ctx) ((ctx)->vertprog->cfg.edgeflag_in < 16)
 
-static INLINE unsigned
-nv50_prim(unsigned mode)
-{
-       switch (mode) {
-       case PIPE_PRIM_POINTS: return NV50TCL_VERTEX_BEGIN_POINTS;
-       case PIPE_PRIM_LINES: return NV50TCL_VERTEX_BEGIN_LINES;
-       case PIPE_PRIM_LINE_LOOP: return NV50TCL_VERTEX_BEGIN_LINE_LOOP;
-       case PIPE_PRIM_LINE_STRIP: return NV50TCL_VERTEX_BEGIN_LINE_STRIP;
-       case PIPE_PRIM_TRIANGLES: return NV50TCL_VERTEX_BEGIN_TRIANGLES;
-       case PIPE_PRIM_TRIANGLE_STRIP:
-               return NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP;
-       case PIPE_PRIM_TRIANGLE_FAN: return NV50TCL_VERTEX_BEGIN_TRIANGLE_FAN;
-       case PIPE_PRIM_QUADS: return NV50TCL_VERTEX_BEGIN_QUADS;
-       case PIPE_PRIM_QUAD_STRIP: return NV50TCL_VERTEX_BEGIN_QUAD_STRIP;
-       case PIPE_PRIM_POLYGON: return NV50TCL_VERTEX_BEGIN_POLYGON;
-       case PIPE_PRIM_LINES_ADJACENCY:
-               return NV50TCL_VERTEX_BEGIN_LINES_ADJACENCY;
-       case PIPE_PRIM_LINE_STRIP_ADJACENCY:
-               return NV50TCL_VERTEX_BEGIN_LINE_STRIP_ADJACENCY;
-       case PIPE_PRIM_TRIANGLES_ADJACENCY:
-               return NV50TCL_VERTEX_BEGIN_TRIANGLES_ADJACENCY;
-       case PIPE_PRIM_TRIANGLE_STRIP_ADJACENCY:
-               return NV50TCL_VERTEX_BEGIN_TRIANGLE_STRIP_ADJACENCY;
-       default:
-               break;
-       }
-
-       NOUVEAU_ERR("invalid primitive type %d\n", mode);
-       return NV50TCL_VERTEX_BEGIN_POINTS;
-}
-
 static INLINE uint32_t
 nv50_vbo_type_to_hw(enum pipe_format format)
 {