Jonathan Nieder wrote:
>> On Fri, Mar 05, 2010 at 05:00:27PM +0100, Tormod Volden wrote:

>>> The old version just grepped the lspci output for "Memory" and "K" to
>>> find the control region. The new one looks for a region of size
>>> 64K, which fails for your class of cards (yours is 16K).
[...]
> Here are some patches against upstream master that seem to fix this.
> I am attaching them rather than sending them as separate messages
> since the Debian BTS deals better with that.

Here’s a fourth, to make sure I am not breaking anything for cards that
previously worked.

Side note: The wildly ill-advised ‘radeontool regmatch '*'’ command
locks up the system (it didn’t in version 1.5).

Of course, ‘radeontool regs’, ‘radeontool light on’, and
‘radeontool light off’ work without problems, which is more important.
>From 8d70da5fa98923ee54ecd0275002cc7bebe35cc0 Mon Sep 17 00:00:00 2001
From: Jonathan Nieder <jrnie...@gmail.com>
Date: Fri, 5 Mar 2010 13:26:48 -0600
Subject: [PATCH 4/3] radeontool: error out if too many control or fb regions

With the previous patch (radeontool: handle r128 again, 2010-03-05),
the rules for finding the control area and framebuffer became more
lax.  Some cards may have multiple regions satisfying the new criteria,
in which case the code makes a silly arbitrary choice.  Better to error
out to make it clear what is happening in such a case.
---
 radeontool.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/radeontool.c b/radeontool.c
index 919b92f..870c872 100644
--- a/radeontool.c
+++ b/radeontool.c
@@ -894,10 +894,15 @@ static void map_radeon_cntl_mem(void)
             }
             for (i = 0; i < 6; i++) {
                 if (device->regions[i].size == 64 * 1024 ||
-                    device->regions[i].size == 16 * 1024)
+                        device->regions[i].size == 16 * 1024) {
+                    if (ctrl_region != (unsigned int) -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 != (unsigned int) -1)
+                        fatal("cannot distinguish fb region\n");
                     fb_region = i;
+                }
             }
             if (ctrl_region == (unsigned int) -1)
                 fatal("cannot find ctrl region\n");
-- 
1.7.0

Reply via email to