cg14.h revision 1bd6d369
1f7ec340bSmacallan/*
2f7ec340bSmacallan * CG14 framebuffer - defines.
3f7ec340bSmacallan *
4f7ec340bSmacallan * Copyright (C) 2000 Jakub Jelinek (jakub@redhat.com)
5f7ec340bSmacallan *
6f7ec340bSmacallan * Permission is hereby granted, free of charge, to any person obtaining a copy
7f7ec340bSmacallan * of this software and associated documentation files (the "Software"), to deal
8f7ec340bSmacallan * in the Software without restriction, including without limitation the rights
9f7ec340bSmacallan * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10f7ec340bSmacallan * copies of the Software, and to permit persons to whom the Software is
11f7ec340bSmacallan * furnished to do so, subject to the following conditions:
12f7ec340bSmacallan *
13f7ec340bSmacallan * The above copyright notice and this permission notice shall be included in
14f7ec340bSmacallan * all copies or substantial portions of the Software.
15f7ec340bSmacallan *
16f7ec340bSmacallan * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17f7ec340bSmacallan * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18f7ec340bSmacallan * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19f7ec340bSmacallan * JAKUB JELINEK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20f7ec340bSmacallan * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21f7ec340bSmacallan * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22f7ec340bSmacallan */
23f7ec340bSmacallan/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/suncg14/cg14.h,v 1.2 2001/03/03 22:41:33 tsi Exp $ */
24f7ec340bSmacallan
25f7ec340bSmacallan#ifndef CG14_H
26f7ec340bSmacallan#define CG14_H
27f7ec340bSmacallan
28f7ec340bSmacallan#include "xf86.h"
29f7ec340bSmacallan#include "xf86_OSproc.h"
30f7ec340bSmacallan#include "xf86RamDac.h"
31f7ec340bSmacallan#include <X11/Xmd.h>
32f7ec340bSmacallan#include "gcstruct.h"
33f7ec340bSmacallan#include "xf86sbusBus.h"
34f7ec340bSmacallan
35f7ec340bSmacallan/* Various offsets in virtual (ie. mmap()) spaces Linux and Solaris support. */
36f7ec340bSmacallan#define CG14_REGS_VOFF		0x00000000	/* registers */
37f7ec340bSmacallan#define CG14_XLUT_VOFF		0x00003000	/* X Look Up Table */
38f7ec340bSmacallan#define CG14_CLUT1_VOFF		0x00004000	/* Color Look Up Table */
39f7ec340bSmacallan#define CG14_CLUT2_VOFF		0x00005000	/* Color Look Up Table */
40f7ec340bSmacallan#define CG14_CLUT3_VOFF		0x00006000	/* Color Look Up Table */
41f7ec340bSmacallan#define CG14_DIRECT_VOFF	0x10000000
42f7ec340bSmacallan#define CG14_CTLREG_VOFF	0x20000000
43f7ec340bSmacallan#define CG14_CURSOR_VOFF	0x30000000
44f7ec340bSmacallan#define CG14_SHDW_VRT_VOFF	0x40000000
45f7ec340bSmacallan#define CG14_XBGR_VOFF		0x50000000
46f7ec340bSmacallan#define CG14_BGR_VOFF		0x60000000
47f7ec340bSmacallan#define CG14_X16_VOFF		0x70000000
48f7ec340bSmacallan#define CG14_C16_VOFF		0x80000000
49f7ec340bSmacallan#define CG14_X32_VOFF		0x90000000
50f7ec340bSmacallan#define CG14_B32_VOFF		0xa0000000
51f7ec340bSmacallan#define CG14_G32_VOFF		0xb0000000
52f7ec340bSmacallan#define CG14_R32_VOFF		0xc0000000
53f7ec340bSmacallan
54f7ec340bSmacallantypedef struct {
55f7ec340bSmacallan	unsigned int	*fb;
56f7ec340bSmacallan	unsigned char	*x32;
57f7ec340bSmacallan	unsigned char	*xlut;
58f7ec340bSmacallan	int		width;
59f7ec340bSmacallan	int		height;
60f7ec340bSmacallan	sbusDevicePtr	psdp;
61f7ec340bSmacallan	CloseScreenProcPtr CloseScreen;
62f7ec340bSmacallan	OptionInfoPtr	Options;
63f7ec340bSmacallan} Cg14Rec, *Cg14Ptr;
64f7ec340bSmacallan
65f7ec340bSmacallan#define GET_CG14_FROM_SCRN(p)    ((Cg14Ptr)((p)->driverPrivate))
66f7ec340bSmacallan
67f7ec340bSmacallan/*
68f7ec340bSmacallan * This should match corresponding definition in Solaris's
69f7ec340bSmacallan * '/usr/include/sys/cg14io.h'.
70f7ec340bSmacallan */
71b73528caSmacallan#ifdef __NetBSD__
721bd6d369Smacallan#include <dev/sun/fbio.h>
73b73528caSmacallan#include <sys/ioccom.h>
74b73528caSmacallan#define CG14_SET_PIXELMODE	_IOW('M', 3, int)
75b73528caSmacallan#else
76f7ec340bSmacallan#define CG14_SET_PIXELMODE	(('M' << 8) | 3)
77b73528caSmacallan#endif
78f7ec340bSmacallan
79f7ec340bSmacallan#endif /* CG14_H */
80