[PATCH 04/10] avivotool, radeonreg: completely skip early cards with --skip

Jonathan Nieder jrnieder at gmail.com
Fri Feb 24 19:48:19 PST 2012


If only one card is present but --skip=n was supplied, it is more
intuitive to error out than to guess which earlier card the user
meant.

Compare commit a8ce2f23c589 (radeontool: completely skip early cards
with --skip, 2010-03-23).

Signed-off-by: Jonathan Nieder <jrnieder at gmail.com>
---
 avivotool.c |    6 +++---
 radeonreg.c |    5 ++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/avivotool.c b/avivotool.c
index f08ab2d7..438354e8 100644
--- a/avivotool.c
+++ b/avivotool.c
@@ -1848,6 +1848,9 @@ static int map_radeon_mem(void)
                        card_info->igp ? "igp" : "");
         }
 
+        if (skip--)
+            continue;
+
         for (i = 0; i < 6; i++) {
             if (device->regions[i].size == 64 * 1024)
                 ctrl_region = i;
@@ -1859,9 +1862,6 @@ static int map_radeon_mem(void)
                 fb_region = i;
         }
         avivo_device = device;
-        if(skip-- == 0) {
-            break;
-        }
     }
 
     if (!avivo_device){
diff --git a/radeonreg.c b/radeonreg.c
index d5b4aa23..92ba949f 100644
--- a/radeonreg.c
+++ b/radeonreg.c
@@ -396,6 +396,8 @@ static int map_radeon_mem(void)
         if ((device->device_class & 0x00ffff00) != 0x00030000 &&
             (device->device_class & 0x00ffff00) != 0x00038000)
             continue;
+        if (skip--)
+            continue;
 
         for (i = 0; i < sizeof(RADEONCards) / sizeof(RADEONCardInfo); i++) {
             if (RADEONCards[i].pci_device_id == device->device_id)
@@ -405,9 +407,6 @@ static int map_radeon_mem(void)
         fb_region = 0;
         ctrl_region = 2;
         avivo_device = device;
-        if(skip-- == 0) {
-            break;
-        }
     }
 
     if (!avivo_device){
-- 
1.7.9.2



More information about the xorg-driver-ati mailing list