Port-sparc64 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Modular xorg on NetBSD/sparc64



                Hello,

I've just managed to compile and run modular-xorg-server 1.3.0.0nb3 from
pkgsrc-2007Q3 on my Ultra 60. It is not perfect yet (see the end of this
mail). I did not have too many things to change:

$ cd /usr/pkgsrc/x11/modular-xorg-server && make configure
- hw/xfree86/os-support/bus/Makefile:
  * uncommented "am__objects_10 = Sbus.lo" line 84
- hw/xfree86/os-support/bus/Sbus.c:
  * included changes from xsrc (the file is attached, it doesn't add too
many #ifdef)
- hw/xfree86/os-support/bus/xf86Sbus.h:
  * added these two lines under "#elif defined(__NetBSD__)":
    #  include <dev/sun/fbio.h>
    #  include <dev/ofw/openfirmio.h>
    (this file is attached too)
- hw/xfree86/common/Makefile:
  * uncommented "am__objects_2 = xf86sbusBus.lo" line 78
$ make package

I then installed the stock xf86-video-sunffb-1.1.0.tar.gz from
ftp.freedesktop.org. I did not check if the one from xsrc has patches to
backport yet.

I can provide an actual pkgsrc patch for xf86Sbus.h and Sbus.c, but I
did not find how to include the sbus bits for compilation properly.

The issue now is that Xorg constantly consumes 100% CPU. Widgets in
WindowMaker and Gtk+ draw very slowly, I can see every blit appear
sequentially with steps of 0.5s. The pixbuf demo from gtk-demo is
running decently though.

Moreover, I could not stop X without a SIGKILL.

I would welcome any suggestion on how to solve this; I'll also send a PR
to have sunffb in pkgsrc.

HTH,
-- 
khorben
/*
 * SBUS and OpenPROM access functions.
 *
 * Copyright (C) 2000 Jakub Jelinek (jakub%redhat.com@localhost)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif

#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#ifdef sun
#include <sys/utsname.h>
#endif
#include "xf86.h"
#include "xf86Priv.h"
#include "xf86_OSlib.h"

#include "xf86sbusBus.h"
#include "xf86Sbus.h"

int promRootNode;

static int promFd = -1;
static int promCurrentNode;
static int promOpenCount = 0;
static int promP1275 = -1;
#define MAX_PROP        128
#define MAX_VAL         (4096-128-4)
static struct openpromio *promOpio;

sbusDevicePtr *xf86SbusInfo = NULL;

struct sbus_devtable sbusDeviceTable[] = {
    { SBUS_DEVICE_BW2, FBTYPE_SUN2BW, "bwtwo", "Sun Monochrome (bwtwo)" },
    { SBUS_DEVICE_CG2, FBTYPE_SUN2COLOR, "cgtwo", "Sun Color2 (cgtwo)" },
    { SBUS_DEVICE_CG3, FBTYPE_SUN3COLOR, "cgthree", "Sun Color3 (cgthree)" },
    { SBUS_DEVICE_CG4, FBTYPE_SUN4COLOR, "cgfour", "Sun Color4 (cgfour)" },
    { SBUS_DEVICE_CG6, FBTYPE_SUNFAST_COLOR, "cgsix", "Sun GX" },
    { SBUS_DEVICE_CG8, FBTYPE_MEMCOLOR, "cgeight", "Sun CG8/RasterOps" },
    { SBUS_DEVICE_CG12, FBTYPE_SUNGP3, "cgtwelve", "Sun GS (cgtwelve)" },
    { SBUS_DEVICE_CG14, FBTYPE_MDICOLOR, "cgfourteen", "Sun SX" },
    { SBUS_DEVICE_GT, FBTYPE_SUNGT, "gt", "Sun Graphics Tower" },
    { SBUS_DEVICE_MGX, -1, "mgx", "Quantum 3D MGXplus" },
    { SBUS_DEVICE_LEO, FBTYPE_SUNLEO, "leo", "Sun ZX or Turbo ZX" },
    { SBUS_DEVICE_TCX, FBTYPE_TCXCOLOR, "tcx", "Sun TCX" },
    { SBUS_DEVICE_FFB, FBTYPE_CREATOR, "ffb", "Sun FFB" },
    { SBUS_DEVICE_FFB, FBTYPE_CREATOR, "afb", "Sun Elite3D" },
    { 0, 0, NULL }
};

#ifdef __NetBSD__
static struct ofiocdesc ofio;
static char of_buf[256];
#endif

#ifdef __NetBSD__
int
promGetSibling(int node)
{
    if (node == -1)
        return 0;

    if (ioctl(promFd, OFIOCGETNEXT, &node) < 0)
        return 0;

    promCurrentNode = node;

    return node;
}
#else
int
promGetSibling(int node)
{
    promOpio->oprom_size = sizeof(int);

    if (node == -1) return 0;
    *(int *)promOpio->oprom_array = node;
    if (ioctl(promFd, OPROMNEXT, promOpio) < 0)
        return 0;
    promCurrentNode = *(int *)promOpio->oprom_array;
    return *(int *)promOpio->oprom_array;
}
#endif

#ifdef __NetBSD__
int
promGetChild(int node)
{   

    if (node == 0 || node == -1)
        return 0;

    if (ioctl(promFd, OFIOCGETCHILD, &node) < 0)
        return 0;

    promCurrentNode = node;

    return node;
}
#else
int
promGetChild(int node)
{
    promOpio->oprom_size = sizeof(int);

    if (!node || node == -1) return 0;
    *(int *)promOpio->oprom_array = node;
    if (ioctl(promFd, OPROMCHILD, promOpio) < 0)
        return 0;
    promCurrentNode = *(int *)promOpio->oprom_array;
    return *(int *)promOpio->oprom_array;
}
#endif

#ifdef __NetBSD__
char *
promGetProperty(const char *prop, int *lenp)
{   

    ofio.of_nodeid = promCurrentNode;
    ofio.of_name = (char *)prop;
    ofio.of_namelen = strlen(prop);
    ofio.of_buf = of_buf;
    ofio.of_buflen = sizeof(of_buf);

    if (ioctl(promFd, OFIOCNEXTPROP, &ofio) < 0)
        return 0;

    of_buf[ofio.of_buflen] = '\0';

    if (lenp)
        *lenp = ofio.of_buflen;

    return of_buf;
}
#else
char *
promGetProperty(const char *prop, int *lenp)
{
    promOpio->oprom_size = MAX_VAL;

    strcpy(promOpio->oprom_array, prop);
    if (ioctl(promFd, OPROMGETPROP, promOpio) < 0)
        return 0;
    if (lenp) *lenp = promOpio->oprom_size;
    return promOpio->oprom_array;
}
#endif

#ifdef __NetBSD__
int
promGetBool(const char *prop)
{
    ofio.of_nodeid = promCurrentNode;
    ofio.of_name = (char *)prop;
    ofio.of_namelen = strlen(prop);
    ofio.of_buf = of_buf;
    ofio.of_buflen = sizeof(of_buf);

    if (ioctl(promFd, OFIOCNEXTPROP, &ofio) < 0)
        return 0;
    if (!ofio.of_buflen)
        return 0;

    return 1;
}
#else
int
promGetBool(const char *prop)
{
    promOpio->oprom_size = 0;

    *(int *)promOpio->oprom_array = 0;
    for (;;) {
        promOpio->oprom_size = MAX_PROP;
        if (ioctl(promFd, OPROMNXTPROP, promOpio) < 0)
            return 0;
        if (!promOpio->oprom_size)
            return 0;
        if (!strcmp(promOpio->oprom_array, prop))
            return 1;
    }
}
#endif

#define PROM_NODE_SIBLING 0x01
#define PROM_NODE_PREF    0x02
#define PROM_NODE_SBUS    0x04
#define PROM_NODE_EBUS    0x08
#define PROM_NODE_PCI     0x10

static int
promSetNode(sbusPromNodePtr pnode)
{
    int node;

    if (!pnode->node || pnode->node == -1)
        return -1;
    if (pnode->cookie[0] & PROM_NODE_SIBLING)
        node = promGetSibling(pnode->cookie[1]);
    else
        node = promGetChild(pnode->cookie[1]);
    if (pnode->node != node)
        return -1;
    return 0;
}

static void
promIsP1275(void)
{
#ifdef linux
    FILE *f;
    char buffer[1024];

    if (promP1275 != -1)
        return;
    promP1275 = 0;
    f = fopen("/proc/cpuinfo","r");
    if (!f) return;
    while (fgets(buffer, 1024, f) != NULL)
        if (!strncmp (buffer, "type", 4) && strstr (buffer, "sun4u")) {
            promP1275 = 1;
            break;
        }
    fclose(f);
#elif defined(sun)
    struct utsname buffer;

    if ((uname(&buffer) >= 0) && !strcmp(buffer.machine, "sun4u"))
        promP1275 = TRUE;
    else
        promP1275 = FALSE;
#elif defined(__FreeBSD__)
    promP1275 = TRUE;
#elif defined(__NetBSD__)
    promP1275 = TRUE;
#else
#error Missing promIsP1275() function for this OS
#endif
}

_X_EXPORT void
sparcPromClose(void)
{
    if (promOpenCount > 1) {
        promOpenCount--;
        return;
    }
    if (promFd != -1) {
        close(promFd);
        promFd = -1;
    }
    if (promOpio) {
        xfree(promOpio);
        promOpio = NULL;
    }
    promOpenCount = 0;
}

_X_EXPORT int
sparcPromInit(void)
{
    if (promOpenCount) {
        promOpenCount++;
        return 0;
    }
    promFd = open("/dev/openprom", O_RDONLY, 0);
    if (promFd == -1)
        return -1;
    promOpio = (struct openpromio *)xalloc(4096);
    if (!promOpio) {
        sparcPromClose();
        return -1;
    }
    promRootNode = promGetSibling(0);
    if (!promRootNode) {
        sparcPromClose();
        return -1;
    }
    promIsP1275();
    promOpenCount++;

    return 0;
}

_X_EXPORT char *
sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp)
{
    if (promSetNode(pnode))
        return NULL;
    return promGetProperty(prop, lenp);
}

_X_EXPORT int
sparcPromGetBool(sbusPromNodePtr pnode, const char *prop)
{
    if (promSetNode(pnode))
        return 0;
    return promGetBool(prop);
}

static void
promWalkAssignNodes(int node, int oldnode, int flags, sbusDevicePtr *devicePtrs)
{
    int nextnode;
    int len, sbus = flags & PROM_NODE_SBUS;
    char *prop;
    int devId, i, j;
    sbusPromNode pNode, pNode2;

    prop = promGetProperty("device_type", &len);
    if (prop && (len > 0)) do {
        if (!strcmp(prop, "display")) {
            prop = promGetProperty("name", &len);
            if (!prop || len <= 0)
                break;
            while ((*prop >= 'A' && *prop <= 'Z') || *prop == ',')
                prop++;
            for (i = 0; sbusDeviceTable[i].devId; i++)
                if (!strcmp(prop, sbusDeviceTable[i].promName))
                    break;
            devId = sbusDeviceTable[i].devId;
            if (!devId)
                break;
            if (!sbus) {
                if (devId == SBUS_DEVICE_FFB) {
                    /*
                     * All /SUNW,ffb outside of SBUS tree come before all
                     * /SUNW,afb outside of SBUS tree in Linux.
                     */
                    if (!strcmp(prop, "afb"))
                        flags |= PROM_NODE_PREF;
                } else if (devId != SBUS_DEVICE_CG14)
                    break;
            }
            for (i = 0; i < 32; i++) {
                if (!devicePtrs[i] || devicePtrs[i]->devId != devId)
                    continue;
                if (devicePtrs[i]->node.node) {
                    if ((devicePtrs[i]->node.cookie[0] & ~PROM_NODE_SIBLING) <=
                        (flags & ~PROM_NODE_SIBLING))
                        continue;
                    for (j = i + 1, pNode = devicePtrs[i]->node; j < 32; j++) {
                        if (!devicePtrs[j] || devicePtrs[j]->devId != devId)
                            continue;
                        pNode2 = devicePtrs[j]->node;
                        devicePtrs[j]->node = pNode;
                        pNode = pNode2;
                    }
                }
                devicePtrs[i]->node.node = node;
                devicePtrs[i]->node.cookie[0] = flags;
                devicePtrs[i]->node.cookie[1] = oldnode;
                break;
            }
            break;
        }
    } while (0);

    prop = promGetProperty("name", &len);
    if (prop && len > 0) {
        if (!strcmp(prop, "sbus") || !strcmp(prop, "sbi"))
            sbus = PROM_NODE_SBUS;
    }

    nextnode = promGetChild(node);
    if (nextnode)
        promWalkAssignNodes(nextnode, node, sbus, devicePtrs);

    nextnode = promGetSibling(node);
    if (nextnode)
        promWalkAssignNodes(nextnode, node, PROM_NODE_SIBLING | sbus, 
devicePtrs);
}

void
sparcPromAssignNodes(void)
{
    sbusDevicePtr psdp, *psdpp;
    int n, holes = 0, i, j;
    FILE *f;
    sbusDevicePtr devicePtrs[32];

    (void)memset(devicePtrs, 0, sizeof(devicePtrs));
    for (psdpp = xf86SbusInfo, n = 0; (psdp = *psdpp); psdpp++, n++) {
        if (psdp->fbNum != n)
            holes = 1;
        devicePtrs[psdp->fbNum] = psdp;
    }
    if (holes && (f = fopen("/proc/fb", "r")) != NULL) {
        /* We could not open one of fb devices, check /proc/fb to see what
         * were the types of the cards missed. */
        char buffer[64];
        int fbNum, devId;
        static struct {
            int devId;
            char *prefix;
        } procFbPrefixes[] = {
            { SBUS_DEVICE_BW2, "BWtwo" },
            { SBUS_DEVICE_CG14, "CGfourteen" },
            { SBUS_DEVICE_CG6, "CGsix" },
            { SBUS_DEVICE_CG3, "CGthree" },
            { SBUS_DEVICE_FFB, "Creator" },
            { SBUS_DEVICE_FFB, "Elite 3D" },
            { SBUS_DEVICE_LEO, "Leo" },
            { SBUS_DEVICE_TCX, "TCX" },
            { 0, NULL },
        };

        while (fscanf(f, "%d %63s\n", &fbNum, buffer) == 2) {
            for (i = 0; procFbPrefixes[i].devId; i++)
                if (! strncmp(procFbPrefixes[i].prefix, buffer,
                      strlen(procFbPrefixes[i].prefix)))
                    break;
            devId = procFbPrefixes[i].devId;
            if (! devId) continue;
            if (devicePtrs[fbNum]) {
                if (devicePtrs[fbNum]->devId != devId)
                    xf86ErrorF("Inconsistent /proc/fb with FBIOGATTR\n");
            } else if (!devicePtrs[fbNum]) {
                devicePtrs[fbNum] = psdp = xnfcalloc(sizeof (sbusDevice), 1);
                psdp->devId = devId;
                psdp->fbNum = fbNum;
                psdp->fd = -2;
            }
        }
        fclose(f);
    }
    promGetSibling(0);
    promWalkAssignNodes(promRootNode, 0, PROM_NODE_PREF, devicePtrs);
    for (i = 0, j = 0; i < 32; i++)
        if (devicePtrs[i] && devicePtrs[i]->fbNum == -1)
            j++;
    xf86SbusInfo = xnfrealloc(xf86SbusInfo, sizeof(psdp) * (n + j + 1));
    for (i = 0, psdpp = xf86SbusInfo; i < 32; i++)
        if (devicePtrs[i]) {
            if (devicePtrs[i]->fbNum == -1) {
                memmove(psdpp + 1, psdpp, sizeof(psdpp) * (n + 1));
                *psdpp = devicePtrs[i];
            } else
                n--;
        }
}

static char *
promGetReg(int type)
{
    char *prop;
    int len;
    static char regstr[40];

    regstr[0] = 0;
    prop = promGetProperty("reg", &len);
    if (prop && len >= 4) {
        unsigned int *reg = (unsigned int *)prop;
        if (!promP1275 || (type == PROM_NODE_SBUS) || (type == PROM_NODE_EBUS))
            sprintf (regstr, "@%x,%x", reg[0], reg[1]);
        else if (type == PROM_NODE_PCI) {
            if ((reg[0] >> 8) & 7)
                sprintf (regstr, "@%x,%x", (reg[0] >> 11) & 0x1f, (reg[0] >> 8) 
& 7);
            else
                sprintf (regstr, "@%x", (reg[0] >> 11) & 0x1f);
        } else if (len == 4)
            sprintf (regstr, "@%x", reg[0]);
        else {
            unsigned int regs[2];

            /* Things get more complicated on UPA. If upa-portid exists,
               then address is @upa-portid,second-int-in-reg, otherwise
               it is @first-int-in-reg/16,second-int-in-reg (well, probably
               upa-portid always exists, but just to be safe). */
            memcpy (regs, reg, sizeof(regs));
            prop = promGetProperty("upa-portid", &len);
            if (prop && len == 4) {
                reg = (unsigned int *)prop;
                sprintf (regstr, "@%x,%x", reg[0], regs[1]);
            } else
                sprintf (regstr, "@%x,%x", regs[0] >> 4, regs[1]);
        }
    }
    return regstr;
}

static int
promWalkNode2Pathname(char *path, int parent, int node, int searchNode, int 
type)
{
    int nextnode;
    int len, ntype = type;
    char *prop, *p;

    prop = promGetProperty("name", &len);
    *path = '/';
    if (!prop || len <= 0)
        return 0;
    if ((!strcmp(prop, "sbus") || !strcmp(prop, "sbi")) && !type)
        ntype = PROM_NODE_SBUS;
    else if (!strcmp(prop, "ebus") && type == PROM_NODE_PCI)
        ntype = PROM_NODE_EBUS;
    else if (!strcmp(prop, "pci") && !type)
        ntype = PROM_NODE_PCI;
    strcpy (path + 1, prop);
    p = promGetReg(type);
    if (*p)
        strcat (path, p);
    if (node == searchNode)
        return 1;
    nextnode = promGetChild(node);
    if (nextnode &&
        promWalkNode2Pathname(strchr(path, 0), node, nextnode, searchNode, 
ntype))
        return 1;
    nextnode = promGetSibling(node);
    if (nextnode &&
        promWalkNode2Pathname(path, parent, nextnode, searchNode, type))
        return 1;
    return 0;
}

char *
sparcPromNode2Pathname(sbusPromNodePtr pnode)
{
    char *ret;

    if (!pnode->node) return NULL;
    ret = xalloc(4096);
    if (!ret) return NULL;
    if (promWalkNode2Pathname(ret, promRootNode, promGetChild(promRootNode), 
pnode->node, 0))
        return ret;
    xfree(ret);
    return NULL;
}

static int
promWalkPathname2Node(char *name, char *regstr, int parent, int type)
{
    int len, node, ret;
    char *prop, *p;

    for (;;) {
        prop = promGetProperty("name", &len);
        if (!prop || len <= 0)
            return 0;
        if ((!strcmp(prop, "sbus") || !strcmp(prop, "sbi")) && !type)
            type = PROM_NODE_SBUS;
        else if (!strcmp(prop, "ebus") && type == PROM_NODE_PCI)
            type = PROM_NODE_EBUS;
        else if (!strcmp(prop, "pci") && !type)
            type = PROM_NODE_PCI;
        for (node = promGetChild(parent); node; node = promGetSibling(node)) {
            prop = promGetProperty("name", &len);
            if (!prop || len <= 0)
                continue;
            if (*name && strcmp(name, prop))
                continue;
            if (*regstr) {
                p = promGetReg(type);
                if (! *p || strcmp(p + 1, regstr))
                    continue;
            }
            break;
        }
        if (!node) {
            for (node = promGetChild(parent); node; node = 
promGetSibling(node)) {
                ret = promWalkPathname2Node(name, regstr, node, type);
                if (ret) return ret;
            }
            return 0;
        }
        name = strchr(regstr, 0) + 1;
        if (! *name)
            return node;
        p = strchr(name, '/');
        if (p)
            *p = 0;
        else
            p = strchr(name, 0);
        regstr = strchr(name, '@');
        if (regstr)
            *regstr++ = 0;
        else
            regstr = p;
        if (name == regstr)
            return 0;
        parent = node;
    }
}

int
sparcPromPathname2Node(const char *pathName)
{
    int i;
    char *name, *regstr, *p;

    i = strlen(pathName);
    name = xalloc(i + 2);
    if (! name) return 0;
    strcpy (name, pathName);
    name [i + 1] = 0;
    if (name[0] != '/')
        return 0;
    p = strchr(name + 1, '/');
    if (p)
        *p = 0;
    else
        p = strchr(name, 0);
    regstr = strchr(name, '@');
    if (regstr)
        *regstr++ = 0;
    else
        regstr = p;
    if (name + 1 == regstr)
        return 0;
    promGetSibling(0);
    i = promWalkPathname2Node(name + 1, regstr, promRootNode, 0);
    xfree(name);
    return i;
}

_X_EXPORT pointer
xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size)
{
    pointer ret;
    unsigned long pagemask = xf86getpagesize() - 1;
    unsigned long off = offset & ~pagemask;
    unsigned long len = ((offset + size + pagemask) & ~pagemask) - off;

    if (psdp->fd == -1) {
        psdp->fd = open(psdp->device, O_RDWR);
        if (psdp->fd == -1)
            return NULL;
    } else if (psdp->fd < 0)
        return NULL;

    ret = (pointer) mmap (NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE,
                          psdp->fd, off);
    if (ret == (pointer) -1) {
        ret = (pointer) mmap (NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED,
                              psdp->fd, off);
    }
    if (ret == (pointer) -1)
        return NULL;

    return (char *)ret + (offset - off);
}

_X_EXPORT void
xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size)
{
    unsigned long mask = xf86getpagesize() - 1;
    unsigned long base = (unsigned long)addr & ~mask;
    unsigned long len = (((unsigned long)addr + size + mask) & ~mask) - base;

    munmap ((pointer)base, len);
}

/* Tell OS that we are driving the HW cursor ourselves. */
_X_EXPORT void
xf86SbusHideOsHwCursor(sbusDevicePtr psdp)
{
    struct fbcursor fbcursor;
    unsigned char zeros[8];

    memset(&fbcursor, 0, sizeof(fbcursor));
    memset(&zeros, 0, sizeof(zeros));
    fbcursor.cmap.count = 2;
    fbcursor.cmap.red = zeros;
    fbcursor.cmap.green = zeros;
    fbcursor.cmap.blue = zeros;
    fbcursor.image = (char *)zeros;
    fbcursor.mask = (char *)zeros;
    fbcursor.size.x = 32;
    fbcursor.size.y = 1;
    fbcursor.set = FB_CUR_SETALL;
    ioctl(psdp->fd, FBIOSCURSOR, &fbcursor);
}

/* Set HW cursor colormap. */
_X_EXPORT void
xf86SbusSetOsHwCursorCmap(sbusDevicePtr psdp, int bg, int fg)
{
    struct fbcursor fbcursor;
    unsigned char red[2], green[2], blue[2];

    memset(&fbcursor, 0, sizeof(fbcursor));
    red[0] = bg >> 16;
    green[0] = bg >> 8;
    blue[0] = bg;
    red[1] = fg >> 16;
    green[1] = fg >> 8;
    blue[1] = fg;
    fbcursor.cmap.count = 2;
    fbcursor.cmap.red = red;
    fbcursor.cmap.green = green;
    fbcursor.cmap.blue = blue;
    fbcursor.set = FB_CUR_SETCMAP;
    ioctl(psdp->fd, FBIOSCURSOR, &fbcursor);
}
X Window System Version 1.3.0
Release Date: 19 April 2007
X Protocol Version 11, Revision 0, Release 1.3
Build Operating System: UNKNOWN 
Current Operating System: NetBSD exxh.defora.lan 4.99.47 NetBSD 4.99.47 
(GENERIC) #0: Wed Jan  2 17:55:37 CET 2008  
khorben%exxh.defora.lan@localhost:/usr/obj/sys/arch/sparc64/compile/GENERIC 
sparc64
Build Date: 06 January 2008
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Sun Jan  6 12:30:08 2008
(==) Using config file: "/etc/X11/xorg.conf"
(==) ServerLayout "X.org Configured"
(**) |-->Screen "Screen0" (0)
(**) |   |-->Monitor "Monitor0"
(**) |   |-->Device "Card0"
(**) |-->Screen "Screen1" (1)
(**) |   |-->Monitor "Monitor1"
(**) |   |-->Device "Card1"
(**) |-->Input Device "Mouse0"
(**) |-->Input Device "Keyboard0"
(**) FontPath set to:
        /usr/pkg/lib/X11/fonts/misc/,
        /usr/pkg/lib/X11/fonts/TTF/,
        /usr/pkg/lib/X11/fonts/Type1/,
        /usr/pkg/lib/X11/fonts/100dpi/:unscaled,
        /usr/pkg/lib/X11/fonts/75dpi/:unscaled,
        /usr/pkg/lib/X11/fonts/100dpi/,
        /usr/pkg/lib/X11/fonts/75dpi/
(**) RgbPath set to "/usr/pkg/share/X11/rgb"
(**) ModulePath set to "/usr/pkg/lib/xorg/modules,/usr/local/lib/xorg/modules"
(II) Loader magic: 0x3bba78
(II) Module ABI versions:
        X.Org ANSI C Emulation: 0.3
        X.Org Video Driver: 1.2
        X.Org XInput driver : 0.7
        X.Org Server Extension : 0.3
        X.Org Font Renderer : 0.5
(II) Loader running on netbsd
(II) LoadModule: "pcidata"
(II) Loading /usr/pkg/lib/xorg/modules//libpcidata.so
(II) Module pcidata: vendor="X.Org Foundation"
        compiled for 1.3.0, module version = 1.0.0
        ABI class: X.Org Video Driver, version 1.2
(--) Using wscons driver
(II) PCI: PCI scan (all values are in hex)
(II) PCI: 00:01:0: chip 108e,1000 card 0000,0000 rev 01 class 06,80,00 hdr 80
(II) PCI: 00:01:1: chip 108e,1001 card 0000,0000 rev 01 class 02,00,00 hdr 80
(II) PCI: 00:03:0: chip 1000,000f card 0000,0000 rev 14 class 01,00,00 hdr 80
(II) PCI: 00:03:1: chip 1000,000f card 0000,0000 rev 14 class 01,00,00 hdr 80
(II) PCI: 00:05:0: chip 1106,3038 card 1106,3038 rev 61 class 0c,03,00 hdr 80
(II) PCI: 00:05:1: chip 1106,3038 card 1106,3038 rev 61 class 0c,03,00 hdr 80
(II) PCI: 00:05:2: chip 1106,3104 card 1106,3104 rev 63 class 0c,03,20 hdr 80
(II) PCI: End of PCI scan
(II) Host-to-PCI bridge:
(II) Bus 0: bridge is at (0:0:0), (0,0,0), BCTRL: 0x0008 (VGA_EN is set)
(II) Bus 0 I/O range:
        [0] -1  0       0x00000000 - 0x0000ffff (0x10000) IX[B]
(II) Bus 0 non-prefetchable memory range:
        [0] -1  0       0x00000000 - 0xffffffff (0x100000000) MX[B]
(II) Bus 0 prefetchable memory range:
        [0] -1  0       0x00000000 - 0xffffffff (0x100000000) MX[B]
(--) SBUS: Sun Elite3D
(--) SBUS: Sun Elite3D
(II) Addressable bus resource ranges are
        [0] -1  0       0x00000000 - 0xffffffff (0x100000000) MX[B]
        [1] -1  0       0x00000000 - 0x0000ffff (0x10000) IX[B]
(II) OS-reported resource ranges:
        [0] -1  0       0x00100000 - 0x3fffffff (0x3ff00000) MX[B]E(B)
        [1] -1  0       0x000f0000 - 0x000fffff (0x10000) MX[B]
        [2] -1  0       0x000c0000 - 0x000effff (0x30000) MX[B]
        [3] -1  0       0x00000000 - 0x0009ffff (0xa0000) MX[B]
        [4] -1  0       0x0000ffff - 0x0000ffff (0x1) IX[B]
        [5] -1  0       0x00000000 - 0x000000ff (0x100) IX[B]
(II) Active PCI resource ranges:
        [0] -1  0       0x00110000 - 0x0011ffff (0x10000) MX[B]E
        [1] -1  0       0x0010e000 - 0x0010ffff (0x2000) MX[B]E
        [2] -1  0       0x0010c000 - 0x0010ffff (0x4000) MX[B]E
        [3] -1  0       0x0010a000 - 0x0010bfff (0x2000) MX[B]E
        [4] -1  0       0x00108000 - 0x0010ffff (0x8000) MX[B]E
        [5] -1  0       0x00100000 - 0x001fffff (0x100000) MX[B]E
        [6] -1  0       0x71000000 - 0x71ffffff (0x1000000) MX[B]E
        [7] -1  0       0x70000000 - 0x7fffffff (0x10000000) MX[B]E
        [8] -1  0       0x00001820 - 0x0000183f (0x20) IX[B]E
        [9] -1  0       0x00001800 - 0x000018ff (0x100) IX[B]E
        [10] -1 0       0x00001400 - 0x000014ff (0x100) IX[B]E
        [11] -1 0       0x00001000 - 0x000010ff (0x100) IX[B]E
(II) PCI I/O resource overlap reduced 0x00001800 from 0x000018ff to 0x0000181f
(II) PCI Memory resource overlap reduced 0x0010c000 from 0x0010ffff to 
0x0010dfff
(II) PCI Memory resource overlap reduced 0x00108000 from 0x0010ffff to 
0x00109fff
(II) PCI Memory resource overlap reduced 0x00100000 from 0x001fffff to 
0x00107fff
(II) PCI Memory resource overlap reduced 0x70000000 from 0x7fffffff to 
0x70ffffff
(II) Active PCI resource ranges after removing overlaps:
        [0] -1  0       0x00110000 - 0x0011ffff (0x10000) MX[B]E
        [1] -1  0       0x0010e000 - 0x0010ffff (0x2000) MX[B]E
        [2] -1  0       0x0010c000 - 0x0010dfff (0x2000) MX[B]E
        [3] -1  0       0x0010a000 - 0x0010bfff (0x2000) MX[B]E
        [4] -1  0       0x00108000 - 0x00109fff (0x2000) MX[B]E
        [5] -1  0       0x00100000 - 0x00107fff (0x8000) MX[B]E
        [6] -1  0       0x71000000 - 0x71ffffff (0x1000000) MX[B]E
        [7] -1  0       0x70000000 - 0x70ffffff (0x1000000) MX[B]E
        [8] -1  0       0x00001820 - 0x0000183f (0x20) IX[B]E
        [9] -1  0       0x00001800 - 0x0000181f (0x20) IX[B]E
        [10] -1 0       0x00001400 - 0x000014ff (0x100) IX[B]E
        [11] -1 0       0x00001000 - 0x000010ff (0x100) IX[B]E
(II) OS-reported resource ranges after removing overlaps with PCI:
        [0] -1  0       0x00100000 - 0x000fffff (0x0) MX[B]E(B)
        [1] -1  0       0x000f0000 - 0x000fffff (0x10000) MX[B]
        [2] -1  0       0x000c0000 - 0x000effff (0x30000) MX[B]
        [3] -1  0       0x00000000 - 0x0009ffff (0xa0000) MX[B]
        [4] -1  0       0x0000ffff - 0x0000ffff (0x1) IX[B]
        [5] -1  0       0x00000000 - 0x000000ff (0x100) IX[B]
(II) All system resource ranges:
        [0] -1  0       0x00100000 - 0x000fffff (0x0) MX[B]E(B)
        [1] -1  0       0x000f0000 - 0x000fffff (0x10000) MX[B]
        [2] -1  0       0x000c0000 - 0x000effff (0x30000) MX[B]
        [3] -1  0       0x00000000 - 0x0009ffff (0xa0000) MX[B]
        [4] -1  0       0x00110000 - 0x0011ffff (0x10000) MX[B]E
        [5] -1  0       0x0010e000 - 0x0010ffff (0x2000) MX[B]E
        [6] -1  0       0x0010c000 - 0x0010dfff (0x2000) MX[B]E
        [7] -1  0       0x0010a000 - 0x0010bfff (0x2000) MX[B]E
        [8] -1  0       0x00108000 - 0x00109fff (0x2000) MX[B]E
        [9] -1  0       0x00100000 - 0x00107fff (0x8000) MX[B]E
        [10] -1 0       0x71000000 - 0x71ffffff (0x1000000) MX[B]E
        [11] -1 0       0x70000000 - 0x70ffffff (0x1000000) MX[B]E
        [12] -1 0       0x0000ffff - 0x0000ffff (0x1) IX[B]
        [13] -1 0       0x00000000 - 0x000000ff (0x100) IX[B]
        [14] -1 0       0x00001820 - 0x0000183f (0x20) IX[B]E
        [15] -1 0       0x00001800 - 0x0000181f (0x20) IX[B]E
        [16] -1 0       0x00001400 - 0x000014ff (0x100) IX[B]E
        [17] -1 0       0x00001000 - 0x000010ff (0x100) IX[B]E
(II) LoadModule: "extmod"
(II) Loading /usr/pkg/lib/xorg/modules/extensions//libextmod.so
(II) Module extmod: vendor="X.Org Foundation"
        compiled for 1.3.0, module version = 1.0.0
        Module class: X.Org Server Extension
        ABI class: X.Org Server Extension, version 0.3
(II) Loading extension SHAPE
(II) Loading extension MIT-SUNDRY-NONSTANDARD
(II) Loading extension BIG-REQUESTS
(II) Loading extension SYNC
(II) Loading extension MIT-SCREEN-SAVER
(II) Loading extension XC-MISC
(II) Loading extension XFree86-VidModeExtension
(II) Loading extension XFree86-Misc
(II) Loading extension XFree86-DGA
(II) Loading extension DPMS
(II) Loading extension TOG-CUP
(II) Loading extension Extended-Visual-Information
(II) Loading extension XVideo
(II) Loading extension XVideo-MotionCompensation
(II) Loading extension X-Resource
(II) LoadModule: "record"
(II) Loading /usr/pkg/lib/xorg/modules/extensions//librecord.so
(II) Module record: vendor="X.Org Foundation"
        compiled for 1.3.0, module version = 1.13.0
        Module class: X.Org Server Extension
        ABI class: X.Org Server Extension, version 0.3
(II) Loading extension RECORD
(II) LoadModule: "dbe"
(II) Loading /usr/pkg/lib/xorg/modules/extensions//libdbe.so
(II) Module dbe: vendor="X.Org Foundation"
        compiled for 1.3.0, module version = 1.0.0
        Module class: X.Org Server Extension
        ABI class: X.Org Server Extension, version 0.3
(II) Loading extension DOUBLE-BUFFER
(II) LoadModule: "glx"
(II) Loading /usr/pkg/lib/xorg/modules/extensions//libglx.so
(II) Module glx: vendor="X.Org Foundation"
        compiled for 1.3.0, module version = 1.0.0
        ABI class: X.Org Server Extension, version 0.3
(==) AIGLX enabled
(II) Loading extension GLX
(II) LoadModule: "xtrap"
(II) Loading /usr/pkg/lib/xorg/modules/extensions//libxtrap.so
(II) Module xtrap: vendor="X.Org Foundation"
        compiled for 1.3.0, module version = 1.0.0
        Module class: X.Org Server Extension
        ABI class: X.Org Server Extension, version 0.3
(II) Loading extension DEC-XTRAP
(II) LoadModule: "dri"
(II) Loading /usr/pkg/lib/xorg/modules/extensions//libdri.so
(II) Module dri: vendor="X.Org Foundation"
        compiled for 1.3.0, module version = 1.0.0
        ABI class: X.Org Server Extension, version 0.3
(II) Loading extension XFree86-DRI
(II) LoadModule: "freetype"
(II) Loading /usr/pkg/lib/xorg/modules/fonts//libfreetype.so
(II) Module freetype: vendor="X.Org Foundation & the After X-TT Project"
        compiled for 1.3.0, module version = 2.1.0
        Module class: X.Org Font Renderer
        ABI class: X.Org Font Renderer, version 0.5
(II) Loading font FreeType
(II) LoadModule: "type1"
(II) Loading /usr/pkg/lib/xorg/modules/fonts//libtype1.so
(II) Module type1: vendor="X.Org Foundation"
        compiled for 1.3.0, module version = 1.0.2
        Module class: X.Org Font Renderer
        ABI class: X.Org Font Renderer, version 0.5
(II) Loading font Type1
(II) LoadModule: "sunffb"
(II) Loading /usr/local/lib/xorg/modules/drivers//sunffb_drv.so
(II) Module sunffb: vendor="X.Org Foundation"
        compiled for 1.3.0, module version = 1.1.0
        Module class: X.Org Video Driver
        ABI class: X.Org Video Driver, version 1.2
(II) LoadModule: "mouse"
(II) Loading /usr/pkg/lib/xorg/modules/input//mouse_drv.so
(II) Module mouse: vendor="X.Org Foundation"
        compiled for 1.3.0, module version = 1.2.2
        Module class: X.Org XInput Driver
        ABI class: X.Org XInput driver, version 0.7
(II) LoadModule: "kbd"
(II) Loading /usr/pkg/lib/xorg/modules/input//kbd_drv.so
(II) Module kbd: vendor="X.Org Foundation"
        compiled for 1.3.0, module version = 1.1.0
        Module class: X.Org XInput Driver
        ABI class: X.Org XInput driver, version 0.7
(II) SUNFFB: driver for Creator, Creator 3D and Elite 3D
(II) resource ranges after probing:
        [0] -1  0       0x00100000 - 0x000fffff (0x0) MX[B]E(B)
        [1] -1  0       0x000f0000 - 0x000fffff (0x10000) MX[B]
        [2] -1  0       0x000c0000 - 0x000effff (0x30000) MX[B]
        [3] -1  0       0x00000000 - 0x0009ffff (0xa0000) MX[B]
        [4] -1  0       0x00110000 - 0x0011ffff (0x10000) MX[B]E
        [5] -1  0       0x0010e000 - 0x0010ffff (0x2000) MX[B]E
        [6] -1  0       0x0010c000 - 0x0010dfff (0x2000) MX[B]E
        [7] -1  0       0x0010a000 - 0x0010bfff (0x2000) MX[B]E
        [8] -1  0       0x00108000 - 0x00109fff (0x2000) MX[B]E
        [9] -1  0       0x00100000 - 0x00107fff (0x8000) MX[B]E
        [10] -1 0       0x71000000 - 0x71ffffff (0x1000000) MX[B]E
        [11] -1 0       0x70000000 - 0x70ffffff (0x1000000) MX[B]E
        [12] -1 0       0x0000ffff - 0x0000ffff (0x1) IX[B]
        [13] -1 0       0x00000000 - 0x000000ff (0x100) IX[B]
        [14] -1 0       0x00001820 - 0x0000183f (0x20) IX[B]E
        [15] -1 0       0x00001800 - 0x0000181f (0x20) IX[B]E
        [16] -1 0       0x00001400 - 0x000014ff (0x100) IX[B]E
        [17] -1 0       0x00001000 - 0x000010ff (0x100) IX[B]E
(==) SUNFFB(0): RGB weight 888
(==) SUNFFB(0): Default visual is TrueColor
(==) SUNFFB(0): Using gamma correction (1.0, 1.0, 1.0)
(==) SUNFFB(0): Using HW cursor
(II) Loading sub module "fb"
(II) LoadModule: "fb"
(II) Loading /usr/pkg/lib/xorg/modules//libfb.so
(II) Module fb: vendor="X.Org Foundation"
        compiled for 1.3.0, module version = 1.0.0
        ABI class: X.Org ANSI C Emulation, version 0.3
(II) Loading sub module "xaa"
(II) LoadModule: "xaa"
(II) Loading /usr/pkg/lib/xorg/modules//libxaa.so
(II) Module xaa: vendor="X.Org Foundation"
        compiled for 1.3.0, module version = 1.2.0
        ABI class: X.Org Video Driver, version 1.2
(II) Loading sub module "ramdac"
(II) LoadModule: "ramdac"(II) Module already built-in
(II) Loading sub module "dbe"
(II) LoadModule: "dbe"
(II) Reloading /usr/pkg/lib/xorg/modules/extensions//libdbe.so
(II) Loading extension DOUBLE-BUFFER
(**) SUNFFB(0): Display dimensions: (380, 285) mm
(**) SUNFFB(0): DPI set to (85, 91)
(==) SUNFFB(1): RGB weight 888
(==) SUNFFB(1): Default visual is TrueColor
(==) SUNFFB(1): Using gamma correction (1.0, 1.0, 1.0)
(==) SUNFFB(1): Using HW cursor
(II) Loading sub module "fb"
(II) LoadModule: "fb"
(II) Reloading /usr/pkg/lib/xorg/modules//libfb.so
(II) Loading sub module "xaa"
(II) LoadModule: "xaa"
(II) Reloading /usr/pkg/lib/xorg/modules//libxaa.so
(II) Loading sub module "ramdac"
(II) LoadModule: "ramdac"(II) Module already built-in
(II) Loading sub module "dbe"
(II) LoadModule: "dbe"
(II) Reloading /usr/pkg/lib/xorg/modules/extensions//libdbe.so
(II) Loading extension DOUBLE-BUFFER
(**) SUNFFB(1): Display dimensions: (380, 285) mm
(**) SUNFFB(1): DPI set to (85, 91)
(--) Depth 24 pixmap format is 32 bpp
(II) do I need RAC?  Yes, I do.
(II) resource ranges after preInit:
        [0] -1  0       0x00100000 - 0x000fffff (0x0) MX[B]E(B)
        [1] -1  0       0x000f0000 - 0x000fffff (0x10000) MX[B]
        [2] -1  0       0x000c0000 - 0x000effff (0x30000) MX[B]
        [3] -1  0       0x00000000 - 0x0009ffff (0xa0000) MX[B]
        [4] -1  0       0x00110000 - 0x0011ffff (0x10000) MX[B]E
        [5] -1  0       0x0010e000 - 0x0010ffff (0x2000) MX[B]E
        [6] -1  0       0x0010c000 - 0x0010dfff (0x2000) MX[B]E
        [7] -1  0       0x0010a000 - 0x0010bfff (0x2000) MX[B]E
        [8] -1  0       0x00108000 - 0x00109fff (0x2000) MX[B]E
        [9] -1  0       0x00100000 - 0x00107fff (0x8000) MX[B]E
        [10] -1 0       0x71000000 - 0x71ffffff (0x1000000) MX[B]E
        [11] -1 0       0x70000000 - 0x70ffffff (0x1000000) MX[B]E
        [12] -1 0       0x0000ffff - 0x0000ffff (0x1) IX[B]
        [13] -1 0       0x00000000 - 0x000000ff (0x100) IX[B]
        [14] -1 0       0x00001820 - 0x0000183f (0x20) IX[B]E
        [15] -1 0       0x00001800 - 0x0000181f (0x20) IX[B]E
        [16] -1 0       0x00001400 - 0x000014ff (0x100) IX[B]E
        [17] -1 0       0x00001000 - 0x000010ff (0x100) IX[B]E
(II) /dev/fb0: Detected FFB2+/vertical, Z-buffer, Double-buffered.
(II) /dev/fb0: BT498 (PAC2) ramdac detected
(II) /dev/fb0: Detected Creator/Creator3D
(II) SUNFFB(0): Using XFree86 Acceleration Architecture (XAA)
        Screen to screen bit blits
        Solid filled rectangles
        8x8 mono pattern filled rectangles
        Indirect CPU to Screen color expansion
        Solid Lines
        Dashed Lines
        Driver provided ScreenToScreenBitBlt replacement
        Driver provided WritePixmap replacement
(II) /dev/fb0: Using acceleration
(==) SUNFFB(0): Backing store disabled
(==) SUNFFB(0): Silken mouse enabled
(II) /dev/fb0: DGA support initialized.
(==) RandR enabled
(II) /dev/fb1: Detected FFB2+/vertical, Single-buffered.
(II) /dev/fb1: BT498 (PAC2) ramdac detected
(II) /dev/fb1: Detected Creator/Creator3D
(II) SUNFFB(1): Using XFree86 Acceleration Architecture (XAA)
        Screen to screen bit blits
        Solid filled rectangles
        8x8 mono pattern filled rectangles
        Indirect CPU to Screen color expansion
        Solid Lines
        Dashed Lines
        Driver provided ScreenToScreenBitBlt replacement
        Driver provided WritePixmap replacement
(II) /dev/fb1: Using acceleration
(==) SUNFFB(1): Backing store disabled
(==) SUNFFB(1): Silken mouse enabled
(II) /dev/fb1: DGA support initialized.
(==) RandR enabled
(II) Entity 0 shares no resources
(II) Entity 1 shares no resources
(II) Initializing built-in extension MIT-SHM
(II) Initializing built-in extension XInputExtension
(II) Initializing built-in extension XTEST
(II) Initializing built-in extension XKEYBOARD
(II) Initializing built-in extension XC-APPGROUP
(II) Initializing built-in extension XAccessControlExtension
(II) Initializing built-in extension SECURITY
(II) Initializing built-in extension XINERAMA
(II) Initializing built-in extension XFIXES
(II) Initializing built-in extension XFree86-Bigfont
(II) Initializing built-in extension RENDER
(II) Initializing built-in extension RANDR
(II) Initializing built-in extension COMPOSITE
(II) Initializing built-in extension DAMAGE
(II) Initializing built-in extension XEVIE
(EE) AIGLX: Screen 0 is not DRI capable
(II) Loading local sub module "GLcore"
(II) LoadModule: "GLcore"
(II) Loading /usr/pkg/lib/xorg/modules/extensions//libGLcore.so
(II) Module GLcore: vendor="X.Org Foundation"
        compiled for 1.3.0, module version = 1.0.0
        ABI class: X.Org Server Extension, version 0.3
(II) GLX: Initialized MESA-PROXY GL provider for screen 0
(EE) AIGLX: Screen 1 is not DRI capable
(II) GLX: Initialized MESA-PROXY GL provider for screen 1
(**) Option "Protocol" "wsmouse"
(**) Mouse0: Protocol: wsmouse
(**) Option "CorePointer"
(**) Mouse0: Core Pointer
(**) Option "Device" "/dev/wsmouse"
(==) Mouse0: Emulate3Buttons, Emulate3Timeout: 50
(**) Option "ZAxisMapping" "4 5 6 7"
(**) Mouse0: ZAxisMapping: buttons 4, 5, 6 and 7
(**) Mouse0: Buttons: 11
(**) Option "CoreKeyboard"
(**) Keyboard0: Core Keyboard
(**) Option "Protocol" "wskbd"
(**) Keyboard0: Protocol: wskbd
(**) Option "Device" "/dev/wskbd"
(--) Keyboard type: Sun5
(**) Option "AutoRepeat" "500 30"
(**) Option "XkbRules" "xorg"
(**) Keyboard0: XkbRules: "xorg"
(**) Option "XkbModel" "pc105"
(**) Keyboard0: XkbModel: "pc105"
(**) Option "XkbLayout" "us"
(**) Keyboard0: XkbLayout: "us"
(**) Option "XkbOptions" "compose:ralt"
(**) Keyboard0: XkbOptions: "compose:ralt"
(**) Option "CustomKeycodes" "off"
(**) Keyboard0: CustomKeycodes disabled
(II) XINPUT: Adding extended input device "Keyboard0" (type: KEYBOARD)
(II) XINPUT: Adding extended input device "Mouse0" (type: MOUSE)
SetClientVersion: 0 9
AUDIT: Sun Jan  6 12:32:32 2008: 26968 X: client 3 rejected from local host 
(uid 1000)
  Auth name: MIT-MAGIC-COOKIE-1 ID: -1
(II) 3rd Button detected: disabling emulate3Button
(II) Screen 0 shares mem & io resources
(II) Screen 1 shares mem & io resources
(II) Screen 0 shares mem & io resources
(II) Screen 1 shares mem & io resources
FreeFontPath: FPE "/usr/pkg/lib/X11/fonts/misc/" refcount is 2, should be 1; 
fixing.
(II) Screen 0 shares mem & io resources
(II) Screen 1 shares mem & io resources
(II) /dev/fb0: Detected FFB2+/vertical, Z-buffer, Double-buffered.
(II) /dev/fb0: BT498 (PAC2) ramdac detected
(II) /dev/fb0: Detected Creator/Creator3D

Fatal server error:
Caught signal 10.  Server aborting

/*
 * Platform specific SBUS and OpenPROM access declarations.
 *
 * Copyright (C) 2000 Jakub Jelinek (jakub%redhat.com@localhost)
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif

#ifndef _XF86_SBUS_H
#define _XF86_SBUS_H

#if defined(linux)
#include <asm/types.h>
#include <linux/fb.h>
#include <asm/fbio.h>
#include <asm/openpromio.h>
#elif defined(SVR4)
#include <sys/fbio.h>
#include <sys/openpromio.h>
#elif defined(__OpenBSD__) && defined(__sparc64__)
/* XXX */
#elif defined(__NetBSD__)
#  include <dev/sun/fbio.h>
#  include <dev/ofw/openfirmio.h>
#elif defined(CSRG_BASED)
#if defined(__FreeBSD__)
#include <sys/types.h>
#include <sys/fbio.h>
#include <dev/ofw/openpromio.h>
#else
#include <machine/fbio.h>
#endif
#else
#include <sun/fbio.h>
#endif

#ifndef FBTYPE_SUNGP3
#define FBTYPE_SUNGP3 -1
#endif
#ifndef FBTYPE_MDICOLOR
#define FBTYPE_MDICOLOR -1
#endif
#ifndef FBTYPE_SUNLEO
#define FBTYPE_SUNLEO -1
#endif
#ifndef FBTYPE_TCXCOLOR
#define FBTYPE_TCXCOLOR -1
#endif
#ifndef FBTYPE_CREATOR
#define FBTYPE_CREATOR -1
#endif

#endif /* _XF86_SBUS_H */
Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen         "Screen0"
        Screen         "Screen1" RightOf "Screen0"
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
        RgbPath      "/usr/pkg/share/X11/rgb"
        ModulePath   "/usr/pkg/lib/xorg/modules"
        ModulePath   "/usr/local/lib/xorg/modules"
        FontPath     "/usr/pkg/lib/X11/fonts/misc/"
        FontPath     "/usr/pkg/lib/X11/fonts/TTF/"
        FontPath     "/usr/pkg/lib/X11/fonts/Type1/"
        FontPath     "/usr/pkg/lib/X11/fonts/100dpi/:unscaled"
        FontPath     "/usr/pkg/lib/X11/fonts/75dpi/:unscaled"
        FontPath     "/usr/pkg/lib/X11/fonts/100dpi/"
        FontPath     "/usr/pkg/lib/X11/fonts/75dpi/"
EndSection

Section "Module"
        Load  "extmod"
        Load  "record"
        Load  "dbe"
        Load  "glx"
        Load  "GLcore"
        Load  "xtrap"
        Load  "dri"
        Load  "freetype"
        Load  "type1"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "Protocol" "wskbd"
        Option      "Device" "/dev/wskbd"
        Option      "XkbRules" "xorg"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us"
        Option      "XkbOptions" "compose:ralt"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "wsmouse"
        Option      "Device" "/dev/wsmouse"
        Option      "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
        DisplaySize  380 285
        VertRefresh  60
EndSection

Section "Monitor"
        Identifier   "Monitor1"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
        DisplaySize  380 285
        VertRefresh  60
EndSection

Section "Device"
        Identifier  "Card0"
        Driver      "sunffb"
        BusID       "SBUS:fb0"
EndSection

Section "Device"
        Identifier  "Card1"
        Driver      "sunffb"
        BusID       "SBUS:fb1"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        DefaultDepth 24
        SubSection "Display"
                Viewport   0 0
                Depth     1
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     4
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     8
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     15
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     16
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection

Section "Screen"
        Identifier "Screen1"
        Device     "Card1"
        Monitor    "Monitor1"
        DefaultDepth 24
        SubSection "Display"
                Viewport   0 0
                Depth     1
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     4
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     8
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     15
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     16
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection



Home | Main Index | Thread Index | Old Index