r600g: Store the chip class directly in r600_bc.
authorHenri Verbeet <hverbeet@gmail.com>
Sat, 9 Jul 2011 15:18:59 +0000 (17:18 +0200)
committerHenri Verbeet <hverbeet@gmail.com>
Sat, 9 Jul 2011 16:12:50 +0000 (18:12 +0200)
Instead of deriving it from the family again.

Signed-off-by: Henri Verbeet <hverbeet@gmail.com>
src/gallium/drivers/r600/r600_asm.c
src/gallium/drivers/r600/r600_asm.h
src/gallium/drivers/r600/r600_shader.c

index 471fc65e7a5434ed3202f7664f8d4bab561121da..5fae2b00c8b74f5aa17d5e2f675ce5b55abad9d9 100644 (file)
@@ -195,48 +195,10 @@ static struct r600_bc_tex *r600_bc_tex(void)
        return tex;
 }
 
-int r600_bc_init(struct r600_bc *bc, enum radeon_family family)
+void r600_bc_init(struct r600_bc *bc, enum chip_class chip_class)
 {
        LIST_INITHEAD(&bc->cf);
-       bc->family = family;
-       switch (bc->family) {
-       case CHIP_R600:
-       case CHIP_RV610:
-       case CHIP_RV630:
-       case CHIP_RV670:
-       case CHIP_RV620:
-       case CHIP_RV635:
-       case CHIP_RS780:
-       case CHIP_RS880:
-               bc->chip_class = R600;
-               break;
-       case CHIP_RV770:
-       case CHIP_RV730:
-       case CHIP_RV710:
-       case CHIP_RV740:
-               bc->chip_class = R700;
-               break;
-       case CHIP_CEDAR:
-       case CHIP_REDWOOD:
-       case CHIP_JUNIPER:
-       case CHIP_CYPRESS:
-       case CHIP_HEMLOCK:
-       case CHIP_PALM:
-       case CHIP_SUMO:
-       case CHIP_SUMO2:
-       case CHIP_BARTS:
-       case CHIP_TURKS:
-       case CHIP_CAICOS:
-               bc->chip_class = EVERGREEN;
-               break;
-       case CHIP_CAYMAN:
-               bc->chip_class = CAYMAN;
-               break;
-       default:
-               R600_ERR("unknown family %d\n", bc->family);
-               return -EINVAL;
-       }
-       return 0;
+       bc->chip_class = chip_class;
 }
 
 static int r600_bc_add_cf(struct r600_bc *bc)
@@ -1701,7 +1663,7 @@ int r600_bc_build(struct r600_bc *bc)
                                        r = r700_bc_alu_build(bc, alu, addr);
                                        break;
                                default:
-                                       R600_ERR("unknown family %d\n", bc->family);
+                                       R600_ERR("unknown chip class %d.\n", bc->chip_class);
                                        return -EINVAL;
                                }
                                if (r)
@@ -2180,9 +2142,7 @@ int r600_vertex_elements_build_fetch_shader(struct r600_pipe_context *rctx, stru
        }
 
        memset(&bc, 0, sizeof(bc));
-       r = r600_bc_init(&bc, r600_get_family(rctx->radeon));
-       if (r)
-               return r;
+       r600_bc_init(&bc, rctx->chip_class);
 
        for (i = 0; i < ve->count; i++) {
                if (elements[i].instance_divisor > 1) {
index 423e94b8a1df709e476c54d2e692bc14ac0a85b4..cbdaacf7178d8240cfc3a892b35deb716c934c69 100644 (file)
@@ -171,7 +171,6 @@ struct r600_cf_callstack {
 };
 
 struct r600_bc {
-       enum radeon_family              family;
        enum chip_class                 chip_class;
        int                             type;
        struct list_head                cf;
@@ -193,7 +192,7 @@ struct r600_bc {
 int eg_bc_cf_build(struct r600_bc *bc, struct r600_bc_cf *cf);
 
 /* r600_asm.c */
-int r600_bc_init(struct r600_bc *bc, enum radeon_family family);
+void r600_bc_init(struct r600_bc *bc, enum chip_class chip_class);
 void r600_bc_clear(struct r600_bc *bc);
 int r600_bc_add_alu(struct r600_bc *bc, const struct r600_bc_alu *alu);
 int r600_bc_add_vtx(struct r600_bc *bc, const struct r600_bc_vtx *vtx);
index 6f84d8740eea5da6ae37b1bc46f6ee571b973835..de49d212a587c11a3bcca92b37023b6c8ad1fb0e 100644 (file)
@@ -609,9 +609,7 @@ static int r600_shader_from_tgsi(struct r600_pipe_context * rctx, struct r600_pi
 
        ctx.bc = &shader->bc;
        ctx.shader = shader;
-       r = r600_bc_init(ctx.bc, rctx->family);
-       if (r)
-               return r;
+       r600_bc_init(ctx.bc, rctx->chip_class);
        ctx.tokens = tokens;
        tgsi_scan_shader(tokens, &ctx.info);
        tgsi_parse_init(&ctx.parse, tokens);