summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--radeontool.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/radeontool.c b/radeontool.c
index 03b9f8d..d8622d5 100644
--- a/radeontool.c
+++ b/radeontool.c
@@ -33,7 +33,7 @@ int skip = 0;
/* Not the address but what it points to is volatile. */
struct pci_device *avivo_device = NULL;
unsigned char * volatile radeon_cntl_mem;
-unsigned int ctrl_region, fb_region;
+int ctrl_region = -1, fb_region = -1;
unsigned char * volatile fb_mem;
unsigned char * volatile ctrl_mem;
static void radeon_rom_legacy_mmio_table(unsigned char *bios, int offset);
@@ -882,7 +882,7 @@ void radeon_cmd_stretch(char *param)
}
-/* Here we fork() and exec() the lspci command to look for the Radeon hardware address. */
+/* Look for the Radeon hardware address. */
static void map_radeon_cntl_mem(void)
{
struct pci_slot_match match;
@@ -919,6 +919,10 @@ static void map_radeon_cntl_mem(void)
else if (device->regions[i].size >= 128 * 1024 * 1024)
fb_region = i;
}
+ if (ctrl_region == -1)
+ fatal("cannot find ctrl region\n");
+ if (fb_region == -1)
+ fatal("cannot find fb region\n");
avivo_device = device;
break;
}