diff options
author | Jerome Glisse <[email protected]> | 2010-09-20 11:58:00 -0400 |
---|---|---|
committer | Jerome Glisse <[email protected]> | 2010-09-20 11:59:20 -0400 |
commit | 363dfb83f1ca7f1ab09eec30aeb89732c5ce3e02 (patch) | |
tree | 909be9a4766d6af3f5a22730a9595e8ed2a23921 /src/gallium/winsys/r600/drm | |
parent | 6ea16b6c510ee7f0e68505838a99562f0852f8e4 (diff) |
r600g: move chip class to radeon common structure
So texture code can be shared btw new state design
& old one.
Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/winsys/r600/drm')
-rw-r--r-- | src/gallium/winsys/r600/drm/r600.c | 36 | ||||
-rw-r--r-- | src/gallium/winsys/r600/drm/r600_priv.h | 1 | ||||
-rw-r--r-- | src/gallium/winsys/r600/drm/radeon.c | 36 | ||||
-rw-r--r-- | src/gallium/winsys/r600/drm/radeon_priv.h | 1 |
4 files changed, 74 insertions, 0 deletions
diff --git a/src/gallium/winsys/r600/drm/r600.c b/src/gallium/winsys/r600/drm/r600.c index af9b9187ab1..fdcadffc532 100644 --- a/src/gallium/winsys/r600/drm/r600.c +++ b/src/gallium/winsys/r600/drm/r600.c @@ -32,6 +32,11 @@ enum radeon_family r600_get_family(struct radeon *r600) return r600->family; } +enum chip_class r600_get_family_class(struct radeon *radeon) +{ + return radeon->chip_class; +} + static int r600_get_device(struct radeon *r600) { struct drm_radeon_info info; @@ -117,6 +122,37 @@ struct radeon *r600_new(int fd, unsigned device) R600_ERR("unknown or unsupported chipset 0x%04X\n", r600->device); break; } + + /* setup class */ + switch (r600->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: + r600->chip_class = R600; + break; + case CHIP_RV770: + case CHIP_RV730: + case CHIP_RV710: + case CHIP_RV740: + r600->chip_class = R700; + break; + case CHIP_CEDAR: + case CHIP_REDWOOD: + case CHIP_JUNIPER: + case CHIP_CYPRESS: + case CHIP_HEMLOCK: + r600->chip_class = EVERGREEN; + break; + default: + R600_ERR("unknown or unsupported chipset 0x%04X\n", r600->device); + break; + } + return r600; } diff --git a/src/gallium/winsys/r600/drm/r600_priv.h b/src/gallium/winsys/r600/drm/r600_priv.h index 7a9025ad3c2..d02562f17f3 100644 --- a/src/gallium/winsys/r600/drm/r600_priv.h +++ b/src/gallium/winsys/r600/drm/r600_priv.h @@ -38,6 +38,7 @@ struct radeon { int refcount; unsigned device; unsigned family; + enum chip_class chip_class; }; struct radeon *r600_new(int fd, unsigned device); diff --git a/src/gallium/winsys/r600/drm/radeon.c b/src/gallium/winsys/r600/drm/radeon.c index f39d020559c..c3d345fef92 100644 --- a/src/gallium/winsys/r600/drm/radeon.c +++ b/src/gallium/winsys/r600/drm/radeon.c @@ -30,6 +30,11 @@ enum radeon_family radeon_get_family(struct radeon *radeon) return radeon->family; } +enum chip_class radeon_get_family_class(struct radeon *radeon) +{ + return radeon->chip_class; +} + void radeon_set_mem_constant(struct radeon *radeon, boolean state) { radeon->use_mem_constant = state; @@ -127,6 +132,37 @@ struct radeon *radeon_new(int fd, unsigned device) break; } + /* setup class */ + switch (radeon->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: + radeon->chip_class = R600; + break; + case CHIP_RV770: + case CHIP_RV730: + case CHIP_RV710: + case CHIP_RV740: + radeon->chip_class = R700; + break; + case CHIP_CEDAR: + case CHIP_REDWOOD: + case CHIP_JUNIPER: + case CHIP_CYPRESS: + case CHIP_HEMLOCK: + radeon->chip_class = EVERGREEN; + break; + default: + fprintf(stderr, "%s unknown or unsupported chipset 0x%04X\n", + __func__, radeon->device); + break; + } + radeon->mman = pb_malloc_bufmgr_create(); if (!radeon->mman) return NULL; diff --git a/src/gallium/winsys/r600/drm/radeon_priv.h b/src/gallium/winsys/r600/drm/radeon_priv.h index c284f6aa7d1..85aea89c700 100644 --- a/src/gallium/winsys/r600/drm/radeon_priv.h +++ b/src/gallium/winsys/r600/drm/radeon_priv.h @@ -83,6 +83,7 @@ struct radeon { int refcount; unsigned device; unsigned family; + enum chip_class chip_class; unsigned nstype; struct radeon_stype_info *stype; unsigned max_states; |