diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2012-02-24 21:55:44 -0600 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-03-09 09:38:29 +0000 |
commit | a069eac6681e901c8592fb27810a6864678608f9 (patch) | |
tree | 76a973f6ed62bff4fc5b49e34b510c4ed4fcd5bd /radeontool.c | |
parent | 7ea646985afb9eab22df863328f75c90346a0997 (diff) |
radeontool, avivotool: remove unnecessary region autodetection magic
Trying to guess which region is which based on size is needlessly
error-prone and complicated.
Region 0 is always the frame buffer and region 2 is always mmio.
radeonreg already hard-codes the appropriate region numbers. This
patch teaches radeontool and avivotool to do the same.
Suggested-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'radeontool.c')
-rw-r--r-- | radeontool.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/radeontool.c b/radeontool.c index 9ed92c2..cb0d12d 100644 --- a/radeontool.c +++ b/radeontool.c @@ -948,22 +948,8 @@ static void map_radeon_cntl_mem(void) if (!device) die("cannot find Radeon device"); - for (i = 0; i < 6; i++) { - if (device->regions[i].size >= 16 * 1024 && - device->regions[i].size <= 64 * 1024) { - if (ctrl_region != -1) - die("cannot distinguish ctrl region"); - ctrl_region = i; - } else if (device->regions[i].size >= 64 * 1024 * 1024) { - if (fb_region != -1) - die("cannot distinguish fb region"); - fb_region = i; - } - } - if (ctrl_region == -1) - die("cannot find ctrl region"); - if (fb_region == -1) - die("cannot find fb region"); + fb_region = 0; + ctrl_region = 2; avivo_device = device; if (pci_device_map_region(avivo_device, ctrl_region, 1) != 0) |