summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2012-02-24 21:48:19 -0600
committerDave Airlie <airlied@redhat.com>2012-03-09 09:37:49 +0000
commit41c8d48f9657573a8067cd151ac82cc9d830eb67 (patch)
treecb22582d12d2ecde415c5b9ff941977e68cb9ebc
parent47e021d5ba4731a92b0eca9bce30427418d81a0a (diff)
avivotool, radeonreg: completely skip early cards with --skip
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@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--avivotool.c7
-rw-r--r--radeonreg.c6
2 files changed, 7 insertions, 6 deletions
diff --git a/avivotool.c b/avivotool.c
index f08ab2d..ab41286 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,7 @@ static int map_radeon_mem(void)
fb_region = i;
}
avivo_device = device;
- if(skip-- == 0) {
- break;
- }
+ break;
}
if (!avivo_device){
diff --git a/radeonreg.c b/radeonreg.c
index d5b4aa2..14e8b0a 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,7 @@ static int map_radeon_mem(void)
fb_region = 0;
ctrl_region = 2;
avivo_device = device;
- if(skip-- == 0) {
- break;
- }
+ break;
}
if (!avivo_device){