wsfb.h revision 5d492fd2
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
445d492fd2Smacallan#include "xf86.h"
455d492fd2Smacallan#include "xf86_OSproc.h"
465d492fd2Smacallan#include "xf86_ansic.h"
475d492fd2Smacallan
485d492fd2Smacallan#include "xf86RamDac.h"
495d492fd2Smacallan
505d492fd2Smacallan#ifndef WSFB_H
515d492fd2Smacallan#define WSFB_H
525d492fd2Smacallan
535d492fd2Smacallan/* private data */
545d492fd2Smacallantypedef struct {
555d492fd2Smacallan	int			fd; /* file descriptor of open device */
565d492fd2Smacallan	struct wsdisplay_fbinfo info; /* frame buffer characteristics */
575d492fd2Smacallan	int			linebytes; /* number of bytes per row */
585d492fd2Smacallan	int			rotate;
595d492fd2Smacallan	unsigned char*		fbstart;
605d492fd2Smacallan	unsigned char*		fbmem;
615d492fd2Smacallan	size_t			fbmem_len;
625d492fd2Smacallan	//void *			shadow;
635d492fd2Smacallan	Bool			shadowFB;
645d492fd2Smacallan	Bool			HWCursor;
655d492fd2Smacallan	CloseScreenProcPtr	CloseScreen;
665d492fd2Smacallan	CreateScreenResourcesProcPtr CreateScreenResources;
675d492fd2Smacallan	void                    (*PointerMoved)(int, int, int);
685d492fd2Smacallan	EntityInfoPtr		pEnt;
695d492fd2Smacallan	struct wsdisplay_cmap	saved_cmap;
705d492fd2Smacallan
715d492fd2Smacallan	struct wsdisplay_cursor cursor;
725d492fd2Smacallan	int			maskoffset;
735d492fd2Smacallan	xf86CursorInfoPtr	CursorInfoRec;
745d492fd2Smacallan#ifdef XFreeXDGA
755d492fd2Smacallan	/* DGA info */
765d492fd2Smacallan	DGAModePtr		pDGAMode;
775d492fd2Smacallan	int			nDGAMode;
785d492fd2Smacallan#endif
795d492fd2Smacallan	OptionInfoPtr		Options;
805d492fd2Smacallan} WsfbRec, *WsfbPtr;
815d492fd2Smacallan
825d492fd2Smacallan#define WSFBPTR(p) ((WsfbPtr)((p)->driverPrivate))
835d492fd2Smacallan
845d492fd2SmacallanBool WsfbSetupCursor(ScreenPtr);
855d492fd2Smacallan
865d492fd2Smacallan#endif
87