[PATCH 1/7] radeontool: completely skip early cards with --skip

Jonathan Nieder jrnieder at gmail.com
Tue Mar 23 19:51:32 PDT 2010


radeontool looks for the control and fb regions for early cards
with --skip even though that they are not going to be used.  If
radeontool fails to detect one of those regions for the chosen
card, the result can be a setup with one region from one card
and the other from another.

This also improves error handling: if only one card is present
but --skip=1 was supplied, then without this patch radeontool
will not actually error out.

Signed-off-by: Jonathan Nieder <jrnieder at gmail.com>
Acked-by: Tormod Volden <debian.tormod at gmail.com>
---
 radeontool.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/radeontool.c b/radeontool.c
index c58db85..ab5c76e 100644
--- a/radeontool.c
+++ b/radeontool.c
@@ -910,6 +910,9 @@ static void map_radeon_cntl_mem(void)
                        device->device_id, device->device_class);
             }
 
+            if (skip-- != 0) {
+                continue;
+            }
             for (i = 0; i < 6; i++) {
                 if (device->regions[i].size == 64 * 1024)
                     ctrl_region = i;
@@ -917,9 +920,7 @@ static void map_radeon_cntl_mem(void)
                     fb_region = i;
             }
             avivo_device = device;
-            if(skip-- == 0) {
-                break;
-            }
+            break;
         }
     }
 
-- 
1.7.0.3



More information about the xorg-driver-ati mailing list