wined3d: Simplify select_card_amd_mesa() a bit.

We can use the same code for the Gallium and "classic" drivers, and the
classic drivers are no longer supported upstream anyway.
This commit is contained in:
Henri Verbeet 2013-01-03 11:56:24 +01:00 committed by Alexandre Julliard
parent 06729ed74f
commit cf4f09cf85
1 changed files with 83 additions and 128 deletions

View File

@ -1879,141 +1879,96 @@ static enum wined3d_pci_device select_card_intel(const struct wined3d_gl_info *g
static enum wined3d_pci_device select_card_amd_mesa(const struct wined3d_gl_info *gl_info, static enum wined3d_pci_device select_card_amd_mesa(const struct wined3d_gl_info *gl_info,
const char *gl_renderer) const char *gl_renderer)
{ {
UINT d3d_level;
unsigned int i; unsigned int i;
/* See http://developer.amd.com/drivers/pc_vendor_id/Pages/default.aspx /* 20101109 - These are never returned by current Gallium radeon
* drivers: R700, RV790, R680, RV535, RV516, R410, RS485, RV360, RV351.
* *
* Beware: renderer string do not match exact card model, * These are returned but not handled: RC410, RV380. */
* eg HD 4800 is returned for multiple cards, even for RV790 based ones. */ static const struct
if (strstr(gl_renderer, "Gallium"))
{ {
/* 20101109 - These are never returned by current Gallium radeon const char *renderer;
* drivers: R700, RV790, R680, RV535, RV516, R410, RS485, RV360, RV351. enum wined3d_pci_device id;
* }
* These are returned but not handled: RC410, RV380. */ cards[] =
static const struct {
{ /* Southern Islands */
const char *renderer; {"TAHITI", CARD_AMD_RADEON_HD7900},
enum wined3d_pci_device id; {"PITCAIRN", CARD_AMD_RADEON_HD7800},
} {"CAPE VERDE", CARD_AMD_RADEON_HD7700},
cards[] = /* Northern Islands */
{ {"CAYMAN", CARD_AMD_RADEON_HD6900},
/* Southern Islands */ {"BARTS", CARD_AMD_RADEON_HD6800},
{"TAHITI", CARD_AMD_RADEON_HD7900}, {"TURKS", CARD_AMD_RADEON_HD6600},
{"PITCAIRN", CARD_AMD_RADEON_HD7800}, {"SUMO2", CARD_AMD_RADEON_HD6410D}, /* SUMO2 first, because we do a strstr(). */
{"CAPE VERDE", CARD_AMD_RADEON_HD7700}, {"SUMO", CARD_AMD_RADEON_HD6550D},
/* Northern Islands */ {"CAICOS", CARD_AMD_RADEON_HD6400},
{"CAYMAN", CARD_AMD_RADEON_HD6900}, {"PALM", CARD_AMD_RADEON_HD6300},
{"BARTS", CARD_AMD_RADEON_HD6800}, /* Evergreen */
{"TURKS", CARD_AMD_RADEON_HD6600}, {"HEMLOCK", CARD_AMD_RADEON_HD5900},
{"SUMO2", CARD_AMD_RADEON_HD6410D}, /* SUMO2 first, because we do a strstr(). */ {"CYPRESS", CARD_AMD_RADEON_HD5800},
{"SUMO", CARD_AMD_RADEON_HD6550D}, {"JUNIPER", CARD_AMD_RADEON_HD5700},
{"CAICOS", CARD_AMD_RADEON_HD6400}, {"REDWOOD", CARD_AMD_RADEON_HD5600},
{"PALM", CARD_AMD_RADEON_HD6300}, {"CEDAR", CARD_AMD_RADEON_HD5400},
/* Evergreen */ /* R700 */
{"HEMLOCK", CARD_AMD_RADEON_HD5900}, {"R700", CARD_AMD_RADEON_HD4800},
{"CYPRESS", CARD_AMD_RADEON_HD5800}, {"RV790", CARD_AMD_RADEON_HD4800},
{"JUNIPER", CARD_AMD_RADEON_HD5700}, {"RV770", CARD_AMD_RADEON_HD4800},
{"REDWOOD", CARD_AMD_RADEON_HD5600}, {"RV740", CARD_AMD_RADEON_HD4700},
{"CEDAR", CARD_AMD_RADEON_HD5400}, {"RV730", CARD_AMD_RADEON_HD4600},
/* R700 */ {"RV710", CARD_AMD_RADEON_HD4350},
{"R700", CARD_AMD_RADEON_HD4800}, /* HD4800 - highend */ /* R600/R700 integrated */
{"RV790", CARD_AMD_RADEON_HD4800}, {"RS880", CARD_AMD_RADEON_HD3200},
{"RV770", CARD_AMD_RADEON_HD4800}, {"RS780", CARD_AMD_RADEON_HD3200},
{"RV740", CARD_AMD_RADEON_HD4700}, /* HD4700 - midend */ /* R600 */
{"RV730", CARD_AMD_RADEON_HD4600}, /* HD4600 - midend */ {"R680", CARD_AMD_RADEON_HD2900},
{"RV710", CARD_AMD_RADEON_HD4350}, /* HD4500/HD4350 - lowend */ {"R600", CARD_AMD_RADEON_HD2900},
/* R600/R700 integrated */ {"RV670", CARD_AMD_RADEON_HD2900},
{"RS880", CARD_AMD_RADEON_HD3200}, {"RV635", CARD_AMD_RADEON_HD2600},
{"RS780", CARD_AMD_RADEON_HD3200}, {"RV630", CARD_AMD_RADEON_HD2600},
/* R600 */ {"RV620", CARD_AMD_RADEON_HD2350},
{"R680", CARD_AMD_RADEON_HD2900}, /* HD2900/HD3800 - highend */ {"RV610", CARD_AMD_RADEON_HD2350},
{"R600", CARD_AMD_RADEON_HD2900}, /* R500 */
{"RV670", CARD_AMD_RADEON_HD2900}, {"R580", CARD_AMD_RADEON_X1600},
{"RV635", CARD_AMD_RADEON_HD2600}, /* HD2600/HD3600 - midend; HD3830 is China-only midend */ {"R520", CARD_AMD_RADEON_X1600},
{"RV630", CARD_AMD_RADEON_HD2600}, {"RV570", CARD_AMD_RADEON_X1600},
{"RV620", CARD_AMD_RADEON_HD2350}, /* HD2350/HD2400/HD3400 - lowend */ {"RV560", CARD_AMD_RADEON_X1600},
{"RV610", CARD_AMD_RADEON_HD2350}, {"RV535", CARD_AMD_RADEON_X1600},
/* R500 */ {"RV530", CARD_AMD_RADEON_X1600},
{"R580", CARD_AMD_RADEON_X1600}, {"RV516", CARD_AMD_RADEON_X700},
{"R520", CARD_AMD_RADEON_X1600}, {"RV515", CARD_AMD_RADEON_X700},
{"RV570", CARD_AMD_RADEON_X1600}, /* R400 */
{"RV560", CARD_AMD_RADEON_X1600}, {"R481", CARD_AMD_RADEON_X700},
{"RV535", CARD_AMD_RADEON_X1600}, {"R480", CARD_AMD_RADEON_X700},
{"RV530", CARD_AMD_RADEON_X1600}, {"R430", CARD_AMD_RADEON_X700},
{"RV516", CARD_AMD_RADEON_X700}, /* X700 is actually R400. */ {"R423", CARD_AMD_RADEON_X700},
{"RV515", CARD_AMD_RADEON_X700}, {"R420", CARD_AMD_RADEON_X700},
/* R400 */ {"R410", CARD_AMD_RADEON_X700},
{"R481", CARD_AMD_RADEON_X700}, {"RV410", CARD_AMD_RADEON_X700},
{"R480", CARD_AMD_RADEON_X700}, /* Radeon Xpress - onboard, DX9b, Shader 2.0, 300-400MHz */
{"R430", CARD_AMD_RADEON_X700}, {"RS740", CARD_AMD_RADEON_XPRESS_200M},
{"R423", CARD_AMD_RADEON_X700}, {"RS690", CARD_AMD_RADEON_XPRESS_200M},
{"R420", CARD_AMD_RADEON_X700}, {"RS600", CARD_AMD_RADEON_XPRESS_200M},
{"R410", CARD_AMD_RADEON_X700}, {"RS485", CARD_AMD_RADEON_XPRESS_200M},
{"RV410", CARD_AMD_RADEON_X700}, {"RS482", CARD_AMD_RADEON_XPRESS_200M},
/* Radeon Xpress - onboard, DX9b, Shader 2.0, 300-400MHz */ {"RS480", CARD_AMD_RADEON_XPRESS_200M},
{"RS740", CARD_AMD_RADEON_XPRESS_200M}, {"RS400", CARD_AMD_RADEON_XPRESS_200M},
{"RS690", CARD_AMD_RADEON_XPRESS_200M}, /* R300 */
{"RS600", CARD_AMD_RADEON_XPRESS_200M}, {"R360", CARD_AMD_RADEON_9500},
{"RS485", CARD_AMD_RADEON_XPRESS_200M}, {"R350", CARD_AMD_RADEON_9500},
{"RS482", CARD_AMD_RADEON_XPRESS_200M}, {"R300", CARD_AMD_RADEON_9500},
{"RS480", CARD_AMD_RADEON_XPRESS_200M}, {"RV370", CARD_AMD_RADEON_9500},
{"RS400", CARD_AMD_RADEON_XPRESS_200M}, {"RV360", CARD_AMD_RADEON_9500},
/* R300 */ {"RV351", CARD_AMD_RADEON_9500},
{"R360", CARD_AMD_RADEON_9500}, {"RV350", CARD_AMD_RADEON_9500},
{"R350", CARD_AMD_RADEON_9500}, };
{"R300", CARD_AMD_RADEON_9500},
{"RV370", CARD_AMD_RADEON_9500},
{"RV360", CARD_AMD_RADEON_9500},
{"RV351", CARD_AMD_RADEON_9500},
{"RV350", CARD_AMD_RADEON_9500},
};
for (i = 0; i < sizeof(cards) / sizeof(*cards); ++i) for (i = 0; i < sizeof(cards) / sizeof(*cards); ++i)
{ {
if (strstr(gl_renderer, cards[i].renderer)) if (strstr(gl_renderer, cards[i].renderer))
return cards[i].id; return cards[i].id;
}
return PCI_DEVICE_NONE;
} }
d3d_level = d3d_level_from_gl_info(gl_info);
if (d3d_level >= 9)
{
static const struct
{
const char *renderer;
enum wined3d_pci_device id;
}
cards[] =
{
/* R700 */
{"(R700", CARD_AMD_RADEON_HD4800}, /* HD4800 - highend */
{"(RV790", CARD_AMD_RADEON_HD4800},
{"(RV770", CARD_AMD_RADEON_HD4800},
{"(RV740", CARD_AMD_RADEON_HD4700}, /* HD4700 - midend */
{"(RV730", CARD_AMD_RADEON_HD4600}, /* HD4600 - midend */
{"(RV710", CARD_AMD_RADEON_HD4350}, /* HD4500/HD4350 - lowend */
/* R600/R700 integrated */
{"RS880", CARD_AMD_RADEON_HD3200},
{"RS780", CARD_AMD_RADEON_HD3200},
/* R600 */
{"(R680", CARD_AMD_RADEON_HD2900}, /* HD2900/HD3800 - highend */
{"(R600", CARD_AMD_RADEON_HD2900},
{"(RV670", CARD_AMD_RADEON_HD2900},
{"(RV635", CARD_AMD_RADEON_HD2600}, /* HD2600/HD3600 - midend; HD3830 is China-only midend */
{"(RV630", CARD_AMD_RADEON_HD2600},
{"(RV620", CARD_AMD_RADEON_HD2350}, /* HD2300/HD2400/HD3400 - lowend */
{"(RV610", CARD_AMD_RADEON_HD2350},
};
for (i = 0; i < sizeof(cards) / sizeof(*cards); ++i)
{
if (strstr(gl_renderer, cards[i].renderer))
return cards[i].id;
}
}
return PCI_DEVICE_NONE; return PCI_DEVICE_NONE;
} }