From 51a87cf04e1aaca1efd938dcf37ba973f1d27350 Mon Sep 17 00:00:00 2001 From: Jonathan Nieder Date: Tue, 23 Mar 2010 21:54:29 -0500 Subject: radeontool: error out for too many control or fb regions With the previous commit (radeontool: handle r128 again, 2010-03-23), the rules for finding the control area and framebuffer became more lax. It is possible that some cards have multiple regions satisfying the new criteria, in which case the code makes a silly arbitrary choice. Better to error out and make it clear what happened in such a case. Signed-off-by: Jonathan Nieder Signed-off-by: Dave Airlie --- radeontool.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/radeontool.c b/radeontool.c index 7cfd8e4..10b9266 100644 --- a/radeontool.c +++ b/radeontool.c @@ -915,10 +915,15 @@ static void map_radeon_cntl_mem(void) } for (i = 0; i < 6; i++) { if (device->regions[i].size >= 16 * 1024 && - device->regions[i].size <= 64 * 1024) + device->regions[i].size <= 64 * 1024) { + if (ctrl_region != -1) + fatal("cannot distinguish ctrl region\n"); ctrl_region = i; - else if (device->regions[i].size >= 64 * 1024 * 1024) + } else if (device->regions[i].size >= 64 * 1024 * 1024) { + if (fb_region != -1) + fatal("cannot distinguish fb region\n"); fb_region = i; + } } if (ctrl_region == -1) fatal("cannot find ctrl region\n"); -- cgit v1.2.3