Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 205082
b: refs/heads/master
c: 41090eb
h: refs/heads/master
v: v3
  • Loading branch information
Ben Skeggs committed Jul 13, 2010
1 parent c554844 commit 2b3fdd4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dad9acff504257d37058d3452c978a4129944d99
refs/heads/master: 41090eb4243bef2e90159b2a6acdc671ad0f825b
33 changes: 9 additions & 24 deletions trunk/drivers/gpu/drm/nouveau/nouveau_bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,36 +203,26 @@ struct methods {
const bool rw;
};

static struct methods nv04_methods[] = {
{ "PROM", load_vbios_prom, false },
{ "PRAMIN", load_vbios_pramin, true },
{ "PCIROM", load_vbios_pci, true },
};

static struct methods nv50_methods[] = {
{ "ACPI", load_vbios_acpi, true },
static struct methods shadow_methods[] = {
{ "PRAMIN", load_vbios_pramin, true },
{ "PROM", load_vbios_prom, false },
{ "PCIROM", load_vbios_pci, true },
{ "ACPI", load_vbios_acpi, true },
};

#define METHODCNT 3

static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct methods *methods;
int i;
const int nr_methods = ARRAY_SIZE(shadow_methods);
struct methods *methods = shadow_methods;
int testscore = 3;
int scores[METHODCNT];
int scores[nr_methods], i;

if (nouveau_vbios) {
methods = nv04_methods;
for (i = 0; i < METHODCNT; i++)
for (i = 0; i < nr_methods; i++)
if (!strcasecmp(nouveau_vbios, methods[i].desc))
break;

if (i < METHODCNT) {
if (i < nr_methods) {
NV_INFO(dev, "Attempting to use BIOS image from %s\n",
methods[i].desc);

Expand All @@ -244,12 +234,7 @@ static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data)
NV_ERROR(dev, "VBIOS source \'%s\' invalid\n", nouveau_vbios);
}

if (dev_priv->card_type < NV_50)
methods = nv04_methods;
else
methods = nv50_methods;

for (i = 0; i < METHODCNT; i++) {
for (i = 0; i < nr_methods; i++) {
NV_TRACE(dev, "Attempting to load BIOS image from %s\n",
methods[i].desc);
data[0] = data[1] = 0; /* avoid reuse of previous image */
Expand All @@ -260,7 +245,7 @@ static bool NVShadowVBIOS(struct drm_device *dev, uint8_t *data)
}

while (--testscore > 0) {
for (i = 0; i < METHODCNT; i++) {
for (i = 0; i < nr_methods; i++) {
if (scores[i] == testscore) {
NV_TRACE(dev, "Using BIOS image from %s\n",
methods[i].desc);
Expand Down

0 comments on commit 2b3fdd4

Please sign in to comment.