Subject: Re: wscons support for various framebuffers (questions from NetBSD sparc newbie)
To: None <port-sparc@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-sparc
Date: 03/05/2007 11:02:00
>> It certainly is trying to do something very much like SBus
>> enumeration; see the call sparcPromInit() and the loop that follows
>> in xf86SbusProbe and the implementations of those functions in
>> os-support/bus/*SBus.c.
> As far as I remember that's for X -configure.  When you actually run
> the Xserver you point it at whatever fb devices you want it to use
> and that's it.

xf86Init.c, InitOutput(), contains two calls to xf86BusProbe (which
calls xf86SbusProbe), the first inside

    if (autoconfig || appendauto) {
...
    }

but the second inside

    if (!autoconfig && !appendauto) {
...
    }

which sure looks to me as though it's run even when not -configure.

>> It also seems to think that bwtwos exist only at sbus, [...]
> You fell for their confusing naming scheme.
> Their 'SBus support' really doesn't know anything about actual SBus -
> it's talking to whatever it finds behind /dev/fb* - even FFBs.

I thought so at first, but it's not quite so.  In promWalkAssignByNodes,

    sbus = newNode.cookie[0] & PROM_NODE_SBUS;
...
        if (!sbus) {
            if (devId == SBUS_DEVICE_FFB) {
                /*
                 * All /SUNW,ffb outside of SBUS tree come before all
                 * /SUNW,afb outside of SBUS tree.
                 */
                if (!strcmp(prop, "afb"))
                    newNode.cookie[0] |= PROM_NODE_PREF;
            } else if (devId != SBUS_DEVICE_CG14)
                break;
        }
...
    prop = promGetProperty("name", &len);
    if (prop && len > 0) {
        if (!strcmp(prop, "sbus") || !strcmp(prop, "sbi"))
            sbus = PROM_NODE_SBUS;
    }

In other words, if it's not an ffb or a cg14, it can't exist except
behind sbus or sbi.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B