Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 307531
b: refs/heads/master
c: 78339fb
h: refs/heads/master
i:
  307529: 0c64722
  307527: 866f99f
v: v3
  • Loading branch information
Ben Skeggs committed May 24, 2012
1 parent 46992d2 commit 133c598
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c6b7e89582bdb028e1b1763197ff24c77a43e1b0
refs/heads/master: 78339fb75c21403677f61a02e1839b626a79325b
21 changes: 21 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/nouveau_bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "nouveau_gpio.h"

#include <linux/io-mapping.h>
#include <linux/firmware.h>

/* these defines are made up */
#define NV_CIO_CRE_44_HEADA 0x0
Expand Down Expand Up @@ -249,8 +250,12 @@ bios_shadow(struct drm_device *dev)
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nvbios *bios = &dev_priv->vbios;
struct methods *mthd, *best;
const struct firmware *fw;
char fname[32];
int ret;

if (nouveau_vbios) {
/* try to match one of the built-in methods */
mthd = shadow_methods;
do {
if (strcasecmp(nouveau_vbios, mthd->desc))
Expand All @@ -263,6 +268,22 @@ bios_shadow(struct drm_device *dev)
return true;
} while ((++mthd)->shadow);

/* attempt to load firmware image */
snprintf(fname, sizeof(fname), "nouveau/%s", nouveau_vbios);
ret = request_firmware(&fw, fname, &dev->pdev->dev);
if (ret == 0) {
bios->length = fw->size;
bios->data = kmemdup(fw->data, fw->size, GFP_KERNEL);
release_firmware(fw);

NV_INFO(dev, "VBIOS image: %s\n", nouveau_vbios);
if (score_vbios(bios, 1))
return true;

kfree(bios->data);
bios->data = NULL;
}

NV_ERROR(dev, "VBIOS source \'%s\' invalid\n", nouveau_vbios);
}

Expand Down

0 comments on commit 133c598

Please sign in to comment.