Subject: port-sparc64/17996: New ffb device driver running Xsun24 on Ultra 1E
To: None <gnats-bugs@gnats.netbsd.org>
From: None <swchung7@hotmail.com>
List: netbsd-bugs
Date: 08/19/2002 21:40:58
>Number:         17996
>Category:       port-sparc64
>Synopsis:       New ffb device driver running Xsun24 on Ultra 1E
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-sparc64-maintainer
>State:          open
>Class:          support
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 19 15:27:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Sung-Won Chung
>Release:        NetBSD 1.6_RC1 (16 Aug 2002 source)
>Organization:

	ECE, Pusan National University

>Environment:

System: NetBSD ultra1 1.6F NetBSD 1.6F (KERNEL) #17: Mon Aug 19 18:22:34 UTC 2002 cimon@ultra1:/home/cimon/kernel/sys/arch/sparc64/compile/KERNEL sparc64
Architecture: sparc64
Machine: sparc64

>Description:

	Kernel couldn't recognize Creator3D frame buffer, and
	Xsun24 din't run with it.  Following is the output of dmesg.

SUNW,ffb at mainbus0 addr 0xffb68000 not configured

>How-To-Repeat:

	booting Ultra 1E after attaching Creator3D frame buffer.

>Fix:
	
	I wrote a simple frame buffer device driver and needed fixes 
	to Xsun24 with the help of Charles Carvalho. The driver is
	tested on Ultra 1/200E.

	Because I implemented the minimal facility to run X server,
	there is no support for hardware cursor and DirectColor visual.
	So, I rebuilt Xsun24 to use this driver to force X server to
	use software cursor and TrueColor visual. Although it seems 
	to be stable, since acceleration is not used, scroll is 
	much slower than cgsix.

	Since I didn't found a simple way to claim 2k pixel accross, 
	as a work around, I set fb_type.fb_width as 2048. Therefore, 
	a subtle remaining problem is the difference between fb_width 
	and the real screen width - 1280.  As a result, when I moves 
	an xterm to the right end and it reaches the border of screen, 
	the hidden part of the xterm begins to appear in the left 
	border of screen. To resolve this, I think further 
	investigation into the code of Xsun24 is needed.

	The dmesg output of the kernel with this driver is

ffb0 at mainbus0 addr 0xffb68000: SUNW,501-2633, 1280 x 1024 (console)
ffb0: attached to /dev/fb

	Much of the code for this driver is borrowed from XFree sunffb, 
	OpenBSD creator, and NetBSD cgsix, cgeight, cgfourteen device driver.

	The device driver sources and fixes to Xsun24 are below.

Index: ffb.c
===================================================================
/*
 * Copyright (c) 1999-2002 Sung-Won Chung
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

/* This is a device-driver for SUN Creator/Creator3D frame buffer */

#include "opt_ddb.h"

#include <sys/param.h>
#include <sys/extent.h>
#include <sys/malloc.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/ioctl.h>
#include <sys/reboot.h>

#include <machine/bus.h>
#include <machine/openfirm.h>

#include <dev/sun/fbio.h>
#include <dev/sun/fbvar.h>

#include <sparc64/sparc64/cache.h>
#include <sparc64/dev/iommureg.h>
#include <sparc64/dev/iommuvar.h>
#include <sparc64/dev/ffbreg.h> 
#include <sparc64/dev/ffbvar.h> 

#include <uvm/uvm_prot.h>

#include <machine/autoconf.h>
#include <machine/cpu.h>
#include <machine/sparc64.h>

/* Autoconfiguration driver */

int	ffb_match_mainbus __P((struct device *, struct cfdata *, void *));
void	ffb_attach_mainbus __P((struct device *, struct device *, void *));
void	ffb_attach __P((struct ffb_softc *));

struct cfattach ffb_ca = {
	sizeof(struct ffb_softc), ffb_match_mainbus, ffb_attach_mainbus
};

extern struct cfdriver ffb_cd;

/* Frame buffer generic driver */

static void	ffb_unblank __P((struct device *));
static int	ffb_open __P((dev_t, int, int, struct proc *));
static int	ffb_close __P((dev_t, int, int, struct proc *));
static int 	ffb_ioctl __P((dev_t, u_long, caddr_t, int, struct proc *));
static int	ffb_poll __P((dev_t, int, struct proc *));
static paddr_t	ffb_mmap __P((dev_t, off_t, int));

static struct fbdriver ffb_fbdriver = {
	ffb_unblank, ffb_open, ffb_close, ffb_ioctl, ffb_poll, ffb_mmap
};

int
ffb_match_mainbus(struct device *parent, struct cfdata *cf, void *aux)
{
	struct mainbus_attach_args *ma = aux;
	int rv = 0;

	if ((strcmp("SUNW,ffb", ma->ma_name) == 0) ||
	    (strcmp(cf->cf_driver->cd_name, ma->ma_name) == 0))
		rv = 1;

	return rv;
}

void
ffb_attach_mainbus(struct device *parent, struct device *self, void *aux)
{
	struct ffb_softc 		*sc = (struct ffb_softc *)self;
	struct mainbus_attach_args 	*ma = aux;
	int 				i;

	sc->sc_node = ma->ma_node;
	sc->sc_bustag = ma->ma_bustag;
	sc->sc_nreg = min(ma->ma_nreg, FFB_NREGS);

	/* Map frame buffer register */

	if (sc->sc_nreg < FFB_REG_DFB24) {
		printf(": not configured");
		return;
	}

	for (i = 0; i < sc->sc_nreg; i++) {
		sc->sc_addrs[i] = ma->ma_reg[i].ur_paddr;
		sc->sc_sizes[i] = ma->ma_reg[i].ur_len;
	}

	ffb_attach(sc);

	return;
}

void
ffb_attach(struct ffb_softc *sc)
{
	struct fbdevice 	*fb = &sc->sc_fb;
	int 			isconsole;

	/* show Creator info */

	fb_setsize_obp(fb, fb->fb_type.fb_depth, 1280, 1024, sc->sc_node);
	printf(": %s, %d x %d",
	       PROM_getpropstring(sc->sc_node, "model"),
	       fb->fb_type.fb_width,
	       fb->fb_type.fb_height);

	/* Init fbdevice structure: emulate CG8 */

	#define TCX_CG8_OVERLAY	0x40000

	fb->fb_driver         = &ffb_fbdriver;
	fb->fb_device         = &sc->sc_dev;
	fb->fb_type.fb_type   = FBTYPE_MEMCOLOR; 
	fb->fb_flags          = sc->sc_dev.dv_cfdata->cf_flags & FB_USERMASK;
	fb->fb_type.fb_depth  = 32; /* XBGR */
	fb->fb_type.fb_cmsize = 256; /* XXX */
	fb->fb_pfour          = NULL;
	fb->fb_type.fb_width  = 2048; /* This overrides fb_setsize_obp */
	fb->fb_linebytes      = 8192; /* This overrides fb_setsize_obp */
	fb->fb_type.fb_size   = fb->fb_type.fb_height * fb->fb_linebytes 
				+ TCX_CG8_OVERLAY;

	/* attach to /dev/fb */

	isconsole = fb_is_console(sc->sc_node);

	if (isconsole)
		printf(" (console)");

	printf("\n");
	fb_attach(&sc->sc_fb, isconsole); 
}

static void	
ffb_unblank(struct device *dev)
{
	/* not yet supported */
}

static int	
ffb_open(dev_t dev, int flags, int mode, struct proc *p)
{
	int unit = minor(dev);
	struct ffb_softc *sc;
	
	if (unit >= ffb_cd.cd_ndevs || ffb_cd.cd_devs[unit] == NULL)
		return ENXIO;

	sc = ffb_cd.cd_devs[minor(dev)];

	return 0;
}

static int	
ffb_close(dev_t dev, int flags, int mode, struct proc *p)
{
	/* nothing to do now */

	return 0;
}


static int 	
ffb_ioctl(dev_t dev, u_long cmd, caddr_t data, int flags, struct proc *p)
{
	struct ffb_softc *sc = ffb_cd.cd_devs[minor(dev)];

	switch (cmd) {
	case FBIOGTYPE:
		*(struct fbtype *)data = sc->sc_fb.fb_type;
		break;

	case FBIOGATTR:
#define fba ((struct fbgattr *)data)
		fba->real_type = sc->sc_fb.fb_type.fb_type;
		fba->owner = 0;		/* XXX ??? */
		fba->fbtype = sc->sc_fb.fb_type;
		fba->sattr.flags = 0;
		fba->sattr.emu_type = FBTYPE_MEMCOLOR; /* emulate cg8 */
		fba->sattr.dev_specific[0] = -1;
		fba->emu_types[0] = sc->sc_fb.fb_type.fb_type;
		fba->emu_types[1] = FBTYPE_MEMCOLOR;
		fba->emu_types[2] = -1;
#undef fba
		break;

	case FBIOGETCMAP:		
	case FBIOPUTCMAP:	/* used by Xsun24 */

		/* 
		 * Since FBIOPUTCMAP is not yet implemented,
		 * Xsun24 should start with '-cc 4' serve option 
		 * or recompiled forced to use TrueColor visual
		 * by modifing LARGE_VISUAL in cfbcmap.c
		 */

	case FBIOGVIDEO:
	case FBIOSVIDEO:	/* used by Xsun24 */

	case FBIOGCURSOR:
	case FBIOSCURSOR:	/* used by Xsun24 uses it */

		/*	
		 * Since FBIOSCURSOR is not yet implemented,
		 * Xsun24 should not use hardware cursor.
		 * To use software cursor, FBIOGCURMAX should
		 * be undefined in sunCursor.c
		 */

	case FBIOGCURPOS:
	case FBIOSCURPOS:

	case FBIOGCURMAX:	/* used by Xsun24 */

		/* XXX to be implemented XXX */

		break;

	default:
		printf("ffb: not supported ffb_ioctl\n");
		return ENOTTY; 
		break;
	}
	return 0;
}

static int	
ffb_poll(dev_t dev, int events, struct proc *p)
{
	return seltrue(dev, events, p);
}

static paddr_t	
ffb_mmap(dev_t dev, off_t off, int prot)
{
	struct ffb_softc *sc = ffb_cd.cd_devs[minor(dev)];
	paddr_t paddr;

	/* emulate CG8 */

	if (off >= 0x40000)
		off -= 0x40000;

	/* sanity check for single buffer */

	if (off >= 0x800000) {
		printf("ffb: remap %lx to %lx\n", off, off - 0x800000);
		off -= 0x800000;
	} 

	/* map */

	if (off >= 0 && off < sc->sc_sizes[FFB_REG_DFB24]) {
		paddr = bus_space_mmap(sc->sc_bustag,
			    sc->sc_addrs[FFB_REG_DFB24], 
			    off, 
			    prot,
			    BUS_SPACE_MAP_LINEAR);
		return paddr;
	}
	printf("ffb: failed to map offset %lx\n", off);

	return -1;
}



Index: ffbvar.h
===================================================================
/*	$Id: ffbvar.h,v 1.1 2002/08/19 19:51:41 cimon Exp $/
/*	$OpenBSD: creatorvar.h,v 1.6 2002/07/30 19:48:15 jason Exp $	*/

/*
 * Copyright (c) 2002 Jason L. Wright (jason@thought.net),
 *  Federico G. Schwindt (fgsch@openbsd.org)
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by Jason L. Wright
 * 4. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

struct ffb_softc {
	struct device		sc_dev;
	struct fbdevice		sc_fb;
	bus_space_tag_t 	sc_bustag;
	bus_addr_t		sc_addrs[FFB_NREGS];
	bus_addr_t		sc_sizes[FFB_NREGS];
	int			sc_height;
	int			sc_width;
	int			sc_linebytes;
	int			sc_depth;
	int			sc_nscrens;
	int			sc_nreg;
	int			sc_console;
	int			sc_node;
	int			sc_type;
};



Index: ffbvar.h
===================================================================
/*	$Id: ffbreg.h,v 1.1 2002/08/19 19:51:41 cimon Exp $ */
/*	$OpenBSD: creatorreg.h,v 1.5 2002/07/29 06:21:45 jason Exp $	*/

/*
 * Copyright (c) 2002 Jason L. Wright (jason@thought.net)
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by Jason L. Wright
 * 4. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/* Number of register sets */
#define	FFB_NREGS		24

/* Register set numbers */
#define	FFB_REG_PROM		0
#define	FFB_REG_DAC		1
#define	FFB_REG_FBC		2
#define	FFB_REG_DFB8R		3
#define	FFB_REG_DFB8G		4
#define	FFB_REG_DFB8B		5
#define	FFB_REG_DFB8X		6
#define	FFB_REG_DFB24		7
#define	FFB_REG_DFB32		8
#define	FFB_REG_SFB8R		9
#define	FFB_REG_SFB8G		10
#define	FFB_REG_SFB8B		11
#define	FFB_REG_SFB8X		12
#define	FFB_REG_SFB32		13
#define	FFB_REG_SFB64		14
#define	FFB_REG_DFB422A		15

#define	FFB_FBC_ALPHA		0x00c
#define	FFB_FBC_RED		0x010
#define	FFB_FBC_GREEN		0x014
#define	FFB_FBC_BLUE		0x018
#define	FFB_FBC_DEPTH		0x01c
#define	FFB_FBC_Y		0x020
#define	FFB_FBC_X		0x024
#define	FFB_FBC_RYF		0x030
#define	FFB_FBC_RXF		0x034
#define	FFB_FBC_DMYF		0x040
#define	FFB_FBC_DMXF		0x044
#define	FFB_FBC_EBYI		0x050
#define	FFB_FBC_EBXI		0x054
#define	FFB_FBC_BY		0x060
#define	FFB_FBC_BX		0x064
#define	FFB_FBC_DY		0x068
#define	FFB_FBC_DX		0x06c
#define	FFB_FBC_BH		0x070
#define	FFB_FBC_BW		0x074
#define	FFB_FBC_SUVTX		0x100
#define	FFB_FBC_PPC		0x200	/* pixel processor control */
#define	FFB_FBC_WID		0x204
#define	FFB_FBC_FG		0x208
#define	FFB_FBC_BG		0x20c
#define	FFB_FBC_CONSTY		0x210
#define	FFB_FBC_CONSTZ		0x214
#define	FFB_FBC_XCLIP		0x218
#define	FFB_FBC_DCSS		0x21c
#define	FFB_FBC_VCLIPMIN	0x220
#define	FFB_FBC_VCLIPMAX	0x224
#define	FFB_FBC_VCLIPZMIN	0x228
#define	FFB_FBC_VCLIPZMAX	0x22c
#define	FFB_FBC_DCSF		0x230
#define	FFB_FBC_DCSB		0x234
#define	FFB_FBC_DCZF		0x238
#define	FFB_FBC_DCZB		0x23c
#define	FFB_FBC_BLENDC		0x244
#define	FFB_FBC_BLENDC1		0x248
#define	FFB_FBC_BLENDC2		0x24c
#define	FFB_FBC_FBRAMITC	0x250
#define	FFB_FBC_FBC		0x254	/* Frame Buffer Control	*/
#define	FFB_FBC_ROP		0x258	/* Raster OPeration */
#define	FFB_FBC_CMP		0x25c	/* Frame Buffer Compare */
#define	FFB_FBC_MATCHAB		0x260	/* Buffer AB Match Mask	*/
#define	FFB_FBC_MATCHC		0x264
#define	FFB_FBC_MAGNAB		0x268	/* Buffer AB Magnitude Mask */
#define	FFB_FBC_MAGNC		0x26c
#define	FFB_FBC_FBCFG0		0x270
#define	FFB_FBC_FBCFG1		0x274
#define	FFB_FBC_FBCFG2		0x278
#define	FFB_FBC_FBCFG3		0x27c
#define	FFB_FBC_PPCFG		0x280
#define	FFB_FBC_PICK		0x284
#define	FFB_FBC_FILLMODE	0x288
#define	FFB_FBC_FBRAMWAC	0x28c
#define	FFB_FBC_PMASK		0x290	/* RGB Plane Mask */
#define	FFB_FBC_XPMASK		0x294	/* X PlaneMask */
#define	FFB_FBC_YPMASK		0x298
#define	FFB_FBC_ZPMASK		0x29c
#define	FFB_FBC_CLIP0MIN	0x2a0
#define	FFB_FBC_CLIP0MAX	0x2a4
#define	FFB_FBC_CLIP1MIN	0x2a8
#define	FFB_FBC_CLIP1MAX	0x2ac
#define	FFB_FBC_CLIP2MIN	0x2b0
#define	FFB_FBC_CLIP2MAX	0x2b4
#define	FFB_FBC_CLIP3MIN	0x2b8
#define	FFB_FBC_CLIP3MAX	0x2bc
#define	FFB_FBC_RAWBLEND2	0x2c0
#define	FFB_FBC_RAWPREBLEND	0x2c4
#define	FFB_FBC_RAWSTENCIL	0x2c8
#define	FFB_FBC_RAWSTENCILCTL	0x2cc
#define	FFB_FBC_THREEDRAM1	0x2d0
#define	FFB_FBC_THREEDRAM2	0x2d4
#define	FFB_FBC_PASSIN		0x2d8
#define	FFB_FBC_RAWCLRDEPTH	0x2dc
#define	FFB_FBC_RAWPMASK	0x2e0
#define	FFB_FBC_RAWCSRC		0x2e4
#define	FFB_FBC_RAWMATCH	0x2e8
#define	FFB_FBC_RAWMAGN		0x2ec
#define	FFB_FBC_RAWROPBLEND	0x2f0
#define	FFB_FBC_RAWCMP		0x2f4
#define	FFB_FBC_RAWWAC		0x2f8
#define	FFB_FBC_FBRAMID		0x2fc
#define	FFB_FBC_DRAWOP		0x300	/* Draw OPeration */
#define	FFB_FBC_FONTLPAT	0x30c
#define	FFB_FBC_FONTXY		0x314
#define	FFB_FBC_FONTW		0x318	/* Font Width */
#define	FFB_FBC_FONTINC		0x31c	/* Font Increment */
#define	FFB_FBC_FONT		0x320
#define	FFB_FBC_BLEND2		0x330
#define	FFB_FBC_PREBLEND	0x334
#define	FFB_FBC_STENCIL		0x338
#define	FFB_FBC_STENCILCTL	0x33c
#define	FFB_FBC_DCSS1		0x350
#define	FFB_FBC_DCSS2		0x354
#define	FFB_FBC_DCSS3		0x358
#define	FFB_FBC_WIDPMASK	0x35c
#define	FFB_FBC_DCS2		0x360
#define	FFB_FBC_DCS3		0x364
#define	FFB_FBC_DCS4		0x368
#define	FFB_FBC_DCD2		0x370
#define	FFB_FBC_DCD3		0x374
#define	FFB_FBC_DCD4		0x378
#define	FFB_FBC_PATTERN		0x380
#define	FFB_FBC_DEVID		0x800
#define	FFB_FBC_UCSR		0x900	/* User Control & Status */
#define	FFB_FBC_MER		0x980

#define	FFB_FBC_WB_A		0x20000000
#define	FFB_FBC_WM_COMBINED	0x00080000
#define	FFB_FBC_RB_A		0x00004000
#define	FFB_FBC_SB_BOTH		0x00003000
#define	FFB_FBC_ZE_OFF		0x00000400
#define	FFB_FBC_YE_OFF		0x00000100
#define	FFB_FBC_XE_ON		0x00000080
#define	FFB_FBC_XE_OFF		0x00000040
#define	FFB_FBC_RGBE_ON		0x0000002a
#define	FFB_FBC_RGBE_MASK	0x0000003f

#define	FBC_PPC_FW_DIS		0x00800000	/* force wid disable */
#define	FBC_PPC_FW_ENA		0x00c00000	/* force wid enable */
#define	FBC_PPC_ACE_DIS		0x00040000	/* aux clip disable */
#define	FBC_PPC_ACE_AUXSUB	0x00080000	/* aux clip add */
#define	FBC_PPC_ACE_AUXADD	0x000c0000	/* aux clip subtract */
#define	FBC_PPC_DCE_DIS		0x00020000	/* depth cue disable */
#define	FBC_PPC_DCE_ENA		0x00020000	/* depth cue enable */
#define	FBC_PPC_ABE_DIS		0x00008000	/* alpha blend disable */
#define	FBC_PPC_ABE_ENA		0x0000c000	/* alpha blend enable */
#define	FBC_PPC_VCE_DIS		0x00001000	/* view clip disable */
#define	FBC_PPC_VCE_2D		0x00002000	/* view clip 2d */
#define	FBC_PPC_VCE_3D		0x00003000	/* view clip 3d */
#define	FBC_PPC_APE_DIS		0x00000800	/* area pattern disable */
#define	FBC_PPC_APE_ENA		0x00000c00	/* area pattern enable */
#define	FBC_PPC_TBE_OPAQUE	0x00000200	/* opaque background */
#define	FBC_PPC_TBE_TRANSPAR	0x00000300	/* transparent background */
#define	FBC_PPC_ZS_VAR		0x00000080	/* z source ??? */
#define	FBC_PPC_ZS_CONST	0x000000c0	/* z source ??? */
#define	FBC_PPC_YS_VAR		0x00000020	/* y source ??? */
#define	FBC_PPC_YS_CONST	0x00000030	/* y source ??? */
#define	FBC_PPC_XS_WID		0x00000004	/* x source ??? */
#define	FBC_PPC_XS_VAR		0x00000008	/* x source ??? */
#define	FBC_PPC_XS_CONST	0x0000000c	/* x source ??? */
#define	FBC_PPC_CS_VAR		0x00000002	/* color source ??? */
#define	FBC_PPC_CS_CONST	0x00000003	/* color source ??? */

#define	FBC_ROP_NEW		0x83
#define	FBC_ROP_OLD		0x85

#define	FBC_UCSR_FIFO_MASK	0x00000fff
#define	FBC_UCSR_FB_BUSY	0x01000000
#define	FBC_UCSR_RP_BUSY	0x02000000
#define	FBC_UCSR_READ_ERR	0x40000000
#define	FBC_UCSR_FIFO_OVFL	0x80000000

#define	FBC_DRAWOP_DOT		0x00
#define	FBC_DRAWOP_AADOT	0x01
#define	FBC_DRAWOP_BRLINECAP	0x02
#define	FBC_DRAWOP_BRLINEOPEN	0x03
#define	FBC_DRAWOP_DDLINE	0x04
#define	FBC_DRAWOP_AALINE	0x05
#define	FBC_DRAWOP_TRIANGLE	0x06
#define	FBC_DRAWOP_POLYGON	0x07
#define	FBC_DRAWOP_RECTANGLE	0x08
#define	FBC_DRAWOP_FASTFILL	0x09
#define	FBC_DRAWOP_BCOPY	0x0a	/* block copy: not implemented */
#define	FBC_DRAWOP_VSCROLL	0x0b	/* vertical scroll */



Index: files.sparc64
===================================================================
RCS file: /usr/local/cvsroot/nunbora/src/syssrc/sys/arch/sparc64/conf/files.sparc64,v
retrieving revision 1.1.1.1
diff -r1.1.1.1 files.sparc64
272a273,278
> 
> # Creator 
> 
> device	ffb: fb
> attach	ffb at mainbus
> file	arch/sparc64/dev/ffb.c		ffb



Index: cfbcmap.c
===================================================================
RCS file: /cvsroot/xsrc/xc/programs/Xserver/cfb/cfbcmap.c,v
retrieving revision 1.1.1.3
diff -r1.1.1.3 cfbcmap.c
373,374c373
< #define LARGE_VISUALS	(TrueColorMask|\
< 			 DirectColorMask)
---
> #define LARGE_VISUALS	TrueColorMask



Index: sunCursor.c
===================================================================
RCS file: /cvsroot/xsrc/xc/programs/Xserver/hw/sun/sunCursor.c,v
retrieving revision 1.2
diff -r1.2 sunCursor.c
42a43
> #undef FBIOGCURMAX  /* force software cursor for FFB */
>Release-Note:
>Audit-Trail:
>Unformatted: