From 886e489ef12374c85e13eb13c8a8543fb9a1a78b Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 23 Aug 2010 02:53:22 -0400 Subject: [PATCH] drm/radeon/kms: fix rom fetching There are several bug reports of kms not being able to access the vbios rom while ums works fine. When comparing kms with libpciaccess, it seems the rom size returned from the pci code is set to 0 even when it's not. libpciaccess sets the size to 64k in that case. On newer radeons, we may want to set it to 128 or 256k. Should fix: https://bugzilla.kernel.org/show_bug.cgi?id=15181 https://bugs.freedesktop.org/show_bug.cgi?id=29575 as well as several reports on mailing lists and forums. Signed-off-by: Alex Deucher Cc: stable@kernel.org --- drivers/gpu/drm/radeon/radeon_bios.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c index 654787e..83d7b1a 100644 --- a/drivers/gpu/drm/radeon/radeon_bios.c +++ b/drivers/gpu/drm/radeon/radeon_bios.c @@ -85,7 +85,14 @@ static bool radeon_read_bios(struct radeon_device *rdev) return false; } - if (size == 0 || bios[0] != 0x55 || bios[1] != 0xaa) { + /* sometimes size is returned as 0 eventhough it's not. + * libpciaccess sets it to 64k in that case. On newer cards + * we may want 128k or 256k. + */ + if (size == 0) + size = 0x10000; + + if (bios[0] != 0x55 || bios[1] != 0xaa) { pci_unmap_rom(rdev->pdev, bios); return false; } -- 1.7.1.1