From: Marek Olšák Date: Sun, 11 Sep 2011 12:57:55 +0000 (+0200) Subject: r600g: simplify deducing chip family X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=915227b0aa228fd203618adbb35930e994658087;p=mesa.git r600g: simplify deducing chip family --- diff --git a/src/gallium/winsys/r600/drm/r600_drm.c b/src/gallium/winsys/r600/drm/r600_drm.c index d9eeda9e9f8..8f1fc722f6d 100644 --- a/src/gallium/winsys/r600/drm/r600_drm.c +++ b/src/gallium/winsys/r600/drm/r600_drm.c @@ -92,44 +92,16 @@ struct radeon *radeon_create(struct radeon_winsys *ws) fprintf(stderr, "Unknown chipset 0x%04X\n", radeon->info.pci_id); return radeon_destroy(radeon); } + /* 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: - case CHIP_PALM: - case CHIP_SUMO: - case CHIP_SUMO2: - case CHIP_BARTS: - case CHIP_TURKS: - case CHIP_CAICOS: - radeon->chip_class = EVERGREEN; - break; - case CHIP_CAYMAN: + if (radeon->family == CHIP_CAYMAN) { radeon->chip_class = CAYMAN; - break; - default: - fprintf(stderr, "%s unknown or unsupported chipset 0x%04X\n", - __func__, radeon->info.pci_id); - break; + } else if (radeon->family >= CHIP_CEDAR) { + radeon->chip_class = EVERGREEN; + } else if (radeon->family >= CHIP_RV730) { + radeon->chip_class = R700; + } else { + radeon->chip_class = R600; } return radeon;