wsfb.h revision 3306a6a4
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
495d492fd2Smacallan#include "xf86RamDac.h"
505d492fd2Smacallan
515d492fd2Smacallan#ifndef WSFB_H
525d492fd2Smacallan#define WSFB_H
535d492fd2Smacallan
545d492fd2Smacallan/* private data */
555d492fd2Smacallantypedef struct {
565d492fd2Smacallan	int			fd; /* file descriptor of open device */
573788fa92Smacallan	struct wsdisplayio_fbinfo fbi;
585d492fd2Smacallan	int			rotate;
595d492fd2Smacallan	unsigned char*		fbstart;
605d492fd2Smacallan	unsigned char*		fbmem;
615d492fd2Smacallan	size_t			fbmem_len;
62b603b469Snonaka	void *			shadow;
635d492fd2Smacallan	Bool			shadowFB;
645d492fd2Smacallan	Bool			HWCursor;
650ef55ed1Smacallan	Bool			useSwap32;
663306a6a4Sjandberg	Bool			planarAfb;
675d492fd2Smacallan	CloseScreenProcPtr	CloseScreen;
685d492fd2Smacallan	CreateScreenResourcesProcPtr CreateScreenResources;
699974adabSmrg	void                    (*PointerMoved)(SCRN_ARG_TYPE, int, int);
705d492fd2Smacallan	EntityInfoPtr		pEnt;
715d492fd2Smacallan	struct wsdisplay_cmap	saved_cmap;
725d492fd2Smacallan
735d492fd2Smacallan	struct wsdisplay_cursor cursor;
745d492fd2Smacallan	int			maskoffset;
755d492fd2Smacallan	xf86CursorInfoPtr	CursorInfoRec;
765d492fd2Smacallan#ifdef XFreeXDGA
775d492fd2Smacallan	/* DGA info */
785d492fd2Smacallan	DGAModePtr		pDGAMode;
795d492fd2Smacallan	int			nDGAMode;
805d492fd2Smacallan#endif
815d492fd2Smacallan	OptionInfoPtr		Options;
825d492fd2Smacallan} WsfbRec, *WsfbPtr;
835d492fd2Smacallan
845d492fd2Smacallan#define WSFBPTR(p) ((WsfbPtr)((p)->driverPrivate))
855d492fd2Smacallan
865d492fd2SmacallanBool WsfbSetupCursor(ScreenPtr);
875d492fd2Smacallan
885d492fd2Smacallan#endif
89