diff options
author | Stephan Schreiber <info@fs-driver.org> | 2012-08-29 20:03:58 +0200 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-10-04 13:06:02 -0700 |
commit | 36c18bb81be619df712778bcb99dd6f1fa38701a (patch) | |
tree | 3b925749d7e3b923f334363a0bd99f4091a3a7ed | |
parent | 4bf3eac5fe20fb203b917a486f69514c55be595a (diff) |
int10: fix pci_device_read_rom usage
I noticed that the build-in int10 driver always reports
"Unable to retrieve all of segment 0x0C0000."
even though the entire BIOS data is retrieved with success.
The associated code is in hw/xfree86/int10/generic.c, in the function
xf86ExtendedInitInt10():
if (pci_device_read_rom(pInt->dev, vbiosMem) < V_BIOS_SIZE) {
xf86DrvMsg(screen, X_WARNING,
"Unable to retrieve all of segment 0x0C0000.\n");
}
The function pci_device_read_rom() is from libpciaccess; its return
value is not a size but an error status code: 0 means success.
If pci_device_read_rom() returns 0 for success, the warning is generated.
The proposed patch corrects the evaluation of the return value of
pci_device_read_rom() and of the supplied BIOS size.
Debian bug#686153
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | hw/xfree86/int10/generic.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c index 4633120fd..d7594def2 100644 --- a/hw/xfree86/int10/generic.c +++ b/hw/xfree86/int10/generic.c @@ -178,7 +178,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) */ vbiosMem = (char *) base + V_BIOS; memset(vbiosMem, 0, 2 * V_BIOS_SIZE); - if (pci_device_read_rom(pInt->dev, vbiosMem) < V_BIOS_SIZE) { + if (pci_device_read_rom(pInt->dev, vbiosMem) != 0 + || pInt->dev->rom_size < V_BIOS_SIZE) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unable to retrieve all of segment 0x0C0000.\n"); } |