wsfb.h revision a7f02474
15d492fd2Smacallan/* $OpenBSD: wsfb_driver.c,v 1.18 2003/04/02 16:42:13 jason Exp $ */ 25d492fd2Smacallan/* 35d492fd2Smacallan * Copyright (c) 2001 Matthieu Herrb 45d492fd2Smacallan * All rights reserved. 55d492fd2Smacallan * 65d492fd2Smacallan * Redistribution and use in source and binary forms, with or without 75d492fd2Smacallan * modification, are permitted provided that the following conditions 85d492fd2Smacallan * are met: 95d492fd2Smacallan * 105d492fd2Smacallan * - Redistributions of source code must retain the above copyright 115d492fd2Smacallan * notice, this list of conditions and the following disclaimer. 125d492fd2Smacallan * - Redistributions in binary form must reproduce the above 135d492fd2Smacallan * copyright notice, this list of conditions and the following 145d492fd2Smacallan * disclaimer in the documentation and/or other materials provided 155d492fd2Smacallan * with the distribution. 165d492fd2Smacallan * 175d492fd2Smacallan * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 185d492fd2Smacallan * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 195d492fd2Smacallan * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 205d492fd2Smacallan * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 215d492fd2Smacallan * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 225d492fd2Smacallan * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 235d492fd2Smacallan * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 245d492fd2Smacallan * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 255d492fd2Smacallan * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 265d492fd2Smacallan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 275d492fd2Smacallan * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 285d492fd2Smacallan * POSSIBILITY OF SUCH DAMAGE. 295d492fd2Smacallan * 305d492fd2Smacallan */ 315d492fd2Smacallan 325d492fd2Smacallan/* 335d492fd2Smacallan * Based on fbdev.c written by: 345d492fd2Smacallan * 355d492fd2Smacallan * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk> 365d492fd2Smacallan * Michel Dänzer, <michdaen@iiic.ethz.ch> 375d492fd2Smacallan */ 385d492fd2Smacallan 395d492fd2Smacallan#include <fcntl.h> 405d492fd2Smacallan#include <sys/types.h> 415d492fd2Smacallan#include <sys/time.h> 425d492fd2Smacallan#include <dev/wscons/wsconsio.h> 435d492fd2Smacallan 449974adabSmrg#include "compat-api.h" 459974adabSmrg 465d492fd2Smacallan#include "xf86.h" 475d492fd2Smacallan#include "xf86_OSproc.h" 485d492fd2Smacallan 49a7f02474Smrg#if ABI_VIDEODRV_VERSION < SET_ABI_VERSION(25, 2) 505d492fd2Smacallan#include "xf86RamDac.h" 51a7f02474Smrg#else 52a7f02474Smrg#include "xf86Cursor.h" 53a7f02474Smrg#endif 545d492fd2Smacallan 555d492fd2Smacallan#ifndef WSFB_H 565d492fd2Smacallan#define WSFB_H 575d492fd2Smacallan 585d492fd2Smacallan/* private data */ 595d492fd2Smacallantypedef struct { 605d492fd2Smacallan int fd; /* file descriptor of open device */ 613788fa92Smacallan struct wsdisplayio_fbinfo fbi; 625d492fd2Smacallan int rotate; 635d492fd2Smacallan unsigned char* fbstart; 645d492fd2Smacallan unsigned char* fbmem; 655d492fd2Smacallan size_t fbmem_len; 66b603b469Snonaka void * shadow; 675d492fd2Smacallan Bool shadowFB; 685d492fd2Smacallan Bool HWCursor; 690ef55ed1Smacallan Bool useSwap32; 703306a6a4Sjandberg Bool planarAfb; 715d492fd2Smacallan CloseScreenProcPtr CloseScreen; 725d492fd2Smacallan CreateScreenResourcesProcPtr CreateScreenResources; 739974adabSmrg void (*PointerMoved)(SCRN_ARG_TYPE, int, int); 745d492fd2Smacallan EntityInfoPtr pEnt; 755d492fd2Smacallan struct wsdisplay_cmap saved_cmap; 765d492fd2Smacallan 775d492fd2Smacallan struct wsdisplay_cursor cursor; 785d492fd2Smacallan int maskoffset; 795d492fd2Smacallan xf86CursorInfoPtr CursorInfoRec; 805d492fd2Smacallan#ifdef XFreeXDGA 815d492fd2Smacallan /* DGA info */ 825d492fd2Smacallan DGAModePtr pDGAMode; 835d492fd2Smacallan int nDGAMode; 845d492fd2Smacallan#endif 855d492fd2Smacallan OptionInfoPtr Options; 865d492fd2Smacallan} WsfbRec, *WsfbPtr; 875d492fd2Smacallan 885d492fd2Smacallan#define WSFBPTR(p) ((WsfbPtr)((p)->driverPrivate)) 895d492fd2Smacallan 905d492fd2SmacallanBool WsfbSetupCursor(ScreenPtr); 915d492fd2Smacallan 925d492fd2Smacallan#endif 93