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,15 +1879,8 @@ 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
*
* Beware: renderer string do not match exact card model,
* eg HD 4800 is returned for multiple cards, even for RV790 based ones. */
if (strstr(gl_renderer, "Gallium"))
{
/* 20101109 - These are never returned by current Gallium radeon /* 20101109 - These are never returned by current Gallium radeon
* drivers: R700, RV790, R680, RV535, RV516, R410, RS485, RV360, RV351. * drivers: R700, RV790, R680, RV535, RV516, R410, RS485, RV360, RV351.
* *
@ -1918,22 +1911,22 @@ static enum wined3d_pci_device select_card_amd_mesa(const struct wined3d_gl_info
{"REDWOOD", CARD_AMD_RADEON_HD5600}, {"REDWOOD", CARD_AMD_RADEON_HD5600},
{"CEDAR", CARD_AMD_RADEON_HD5400}, {"CEDAR", CARD_AMD_RADEON_HD5400},
/* R700 */ /* R700 */
{"R700", CARD_AMD_RADEON_HD4800}, /* HD4800 - highend */ {"R700", CARD_AMD_RADEON_HD4800},
{"RV790", CARD_AMD_RADEON_HD4800}, {"RV790", CARD_AMD_RADEON_HD4800},
{"RV770", CARD_AMD_RADEON_HD4800}, {"RV770", CARD_AMD_RADEON_HD4800},
{"RV740", CARD_AMD_RADEON_HD4700}, /* HD4700 - midend */ {"RV740", CARD_AMD_RADEON_HD4700},
{"RV730", CARD_AMD_RADEON_HD4600}, /* HD4600 - midend */ {"RV730", CARD_AMD_RADEON_HD4600},
{"RV710", CARD_AMD_RADEON_HD4350}, /* HD4500/HD4350 - lowend */ {"RV710", CARD_AMD_RADEON_HD4350},
/* R600/R700 integrated */ /* R600/R700 integrated */
{"RS880", CARD_AMD_RADEON_HD3200}, {"RS880", CARD_AMD_RADEON_HD3200},
{"RS780", CARD_AMD_RADEON_HD3200}, {"RS780", CARD_AMD_RADEON_HD3200},
/* R600 */ /* R600 */
{"R680", CARD_AMD_RADEON_HD2900}, /* HD2900/HD3800 - highend */ {"R680", CARD_AMD_RADEON_HD2900},
{"R600", CARD_AMD_RADEON_HD2900}, {"R600", CARD_AMD_RADEON_HD2900},
{"RV670", CARD_AMD_RADEON_HD2900}, {"RV670", CARD_AMD_RADEON_HD2900},
{"RV635", CARD_AMD_RADEON_HD2600}, /* HD2600/HD3600 - midend; HD3830 is China-only midend */ {"RV635", CARD_AMD_RADEON_HD2600},
{"RV630", CARD_AMD_RADEON_HD2600}, {"RV630", CARD_AMD_RADEON_HD2600},
{"RV620", CARD_AMD_RADEON_HD2350}, /* HD2350/HD2400/HD3400 - lowend */ {"RV620", CARD_AMD_RADEON_HD2350},
{"RV610", CARD_AMD_RADEON_HD2350}, {"RV610", CARD_AMD_RADEON_HD2350},
/* R500 */ /* R500 */
{"R580", CARD_AMD_RADEON_X1600}, {"R580", CARD_AMD_RADEON_X1600},
@ -1942,7 +1935,7 @@ static enum wined3d_pci_device select_card_amd_mesa(const struct wined3d_gl_info
{"RV560", CARD_AMD_RADEON_X1600}, {"RV560", CARD_AMD_RADEON_X1600},
{"RV535", CARD_AMD_RADEON_X1600}, {"RV535", CARD_AMD_RADEON_X1600},
{"RV530", CARD_AMD_RADEON_X1600}, {"RV530", CARD_AMD_RADEON_X1600},
{"RV516", CARD_AMD_RADEON_X700}, /* X700 is actually R400. */ {"RV516", CARD_AMD_RADEON_X700},
{"RV515", CARD_AMD_RADEON_X700}, {"RV515", CARD_AMD_RADEON_X700},
/* R400 */ /* R400 */
{"R481", CARD_AMD_RADEON_X700}, {"R481", CARD_AMD_RADEON_X700},
@ -1975,45 +1968,7 @@ static enum wined3d_pci_device select_card_amd_mesa(const struct wined3d_gl_info
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;
} }