cg14.h revision 1a3e96b4
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 541a3e96b4Smacallan/* Hardware cursor map */ 551a3e96b4Smacallan#define CG14_CURS_SIZE 32 561a3e96b4Smacallanstruct cg14curs { 571a3e96b4Smacallan volatile uint32_t curs_plane0[CG14_CURS_SIZE]; /* plane 0 */ 581a3e96b4Smacallan volatile uint32_t curs_plane1[CG14_CURS_SIZE]; 591a3e96b4Smacallan volatile uint8_t curs_ctl; /* control register */ 601a3e96b4Smacallan#define CG14_CURS_ENABLE 0x4 611a3e96b4Smacallan#define CG14_CURS_DOUBLEBUFFER 0x2 /* use X-channel for curs */ 621a3e96b4Smacallan volatile uint8_t pad0[3]; 631a3e96b4Smacallan volatile uint16_t curs_x; /* x position */ 641a3e96b4Smacallan volatile uint16_t curs_y; /* y position */ 651a3e96b4Smacallan volatile uint32_t curs_color1; /* color register 1 */ 661a3e96b4Smacallan volatile uint32_t curs_color2; /* color register 2 */ 671a3e96b4Smacallan volatile uint32_t pad[444]; /* pad to 2KB boundary */ 681a3e96b4Smacallan volatile uint32_t curs_plane0incr[CG14_CURS_SIZE]; /* autoincr */ 691a3e96b4Smacallan volatile uint32_t curs_plane1incr[CG14_CURS_SIZE]; /* autoincr */ 701a3e96b4Smacallan}; 711a3e96b4Smacallan 72f7ec340bSmacallantypedef struct { 731a3e96b4Smacallan unsigned char *fb; 74f7ec340bSmacallan unsigned char *x32; 75f7ec340bSmacallan unsigned char *xlut; 761a3e96b4Smacallan struct cg14curs *curs; 77f7ec340bSmacallan int width; 78f7ec340bSmacallan int height; 791a3e96b4Smacallan int use_shadow; 801a3e96b4Smacallan int HWCursor; 811a3e96b4Smacallan void * shadow; 82f7ec340bSmacallan sbusDevicePtr psdp; 83f7ec340bSmacallan CloseScreenProcPtr CloseScreen; 841a3e96b4Smacallan CreateScreenResourcesProcPtr CreateScreenResources; 85f7ec340bSmacallan OptionInfoPtr Options; 861a3e96b4Smacallan xf86CursorInfoPtr CursorInfoRec; 87f7ec340bSmacallan} Cg14Rec, *Cg14Ptr; 88f7ec340bSmacallan 891a3e96b4SmacallanBool CG14SetupCursor(ScreenPtr); 901a3e96b4Smacallan 91f7ec340bSmacallan#define GET_CG14_FROM_SCRN(p) ((Cg14Ptr)((p)->driverPrivate)) 92f7ec340bSmacallan 93f7ec340bSmacallan/* 94f7ec340bSmacallan * This should match corresponding definition in Solaris's 95f7ec340bSmacallan * '/usr/include/sys/cg14io.h'. 96f7ec340bSmacallan */ 97b73528caSmacallan#ifdef __NetBSD__ 981bd6d369Smacallan#include <dev/sun/fbio.h> 99b73528caSmacallan#include <sys/ioccom.h> 100b73528caSmacallan#define CG14_SET_PIXELMODE _IOW('M', 3, int) 101b73528caSmacallan#else 102f7ec340bSmacallan#define CG14_SET_PIXELMODE (('M' << 8) | 3) 103b73528caSmacallan#endif 104f7ec340bSmacallan 105f7ec340bSmacallan#endif /* CG14_H */ 106