ngle.h revision 727c6de2
1a7fd8e5eSmacallan/* $OpenBSD: wsfb_driver.c,v 1.18 2003/04/02 16:42:13 jason Exp $ */
2a7fd8e5eSmacallan/*
3a7fd8e5eSmacallan * Copyright (c) 2024 Michael Lorenz
4a7fd8e5eSmacallan * All rights reserved.
5a7fd8e5eSmacallan *
6a7fd8e5eSmacallan * Redistribution and use in source and binary forms, with or without
7a7fd8e5eSmacallan * modification, are permitted provided that the following conditions
8a7fd8e5eSmacallan * are met:
9a7fd8e5eSmacallan *
10a7fd8e5eSmacallan *    - Redistributions of source code must retain the above copyright
11a7fd8e5eSmacallan *      notice, this list of conditions and the following disclaimer.
12a7fd8e5eSmacallan *    - Redistributions in binary form must reproduce the above
13a7fd8e5eSmacallan *      copyright notice, this list of conditions and the following
14a7fd8e5eSmacallan *      disclaimer in the documentation and/or other materials provided
15a7fd8e5eSmacallan *      with the distribution.
16a7fd8e5eSmacallan *
17a7fd8e5eSmacallan * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18a7fd8e5eSmacallan * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19a7fd8e5eSmacallan * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20a7fd8e5eSmacallan * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21a7fd8e5eSmacallan * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22a7fd8e5eSmacallan * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23a7fd8e5eSmacallan * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24a7fd8e5eSmacallan * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25a7fd8e5eSmacallan * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26a7fd8e5eSmacallan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27a7fd8e5eSmacallan * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28a7fd8e5eSmacallan * POSSIBILITY OF SUCH DAMAGE.
29a7fd8e5eSmacallan *
30a7fd8e5eSmacallan */
31a7fd8e5eSmacallan
32a7fd8e5eSmacallan#include <fcntl.h>
33a7fd8e5eSmacallan#include <sys/types.h>
34a7fd8e5eSmacallan#include <sys/time.h>
35a7fd8e5eSmacallan#include <dev/wscons/wsconsio.h>
36a7fd8e5eSmacallan
37727c6de2Smacallan#include "xorg-server.h"
38a7fd8e5eSmacallan#include "xf86.h"
39a7fd8e5eSmacallan#include "xf86_OSproc.h"
40727c6de2Smacallan#include "compiler.h"
41727c6de2Smacallan#include "xorgVersion.h"
42a7fd8e5eSmacallan#include "xf86Cursor.h"
43727c6de2Smacallan#include "exa.h"
44a7fd8e5eSmacallan#include "compat-api.h"
45a7fd8e5eSmacallan
46a7fd8e5eSmacallan#ifndef NGLE_H
47a7fd8e5eSmacallan#define NGLE_H
48a7fd8e5eSmacallan
49a7fd8e5eSmacallan/* private data */
50a7fd8e5eSmacallantypedef struct {
51a7fd8e5eSmacallan	int			fd;
52a7fd8e5eSmacallan	struct wsdisplayio_fbinfo fbi;
53a7fd8e5eSmacallan	unsigned char*		fbmem;
54a7fd8e5eSmacallan	size_t			fbmem_len;
55a7fd8e5eSmacallan	void			*regs;
56a7fd8e5eSmacallan	Bool			HWCursor;
57a7fd8e5eSmacallan	CloseScreenProcPtr	CloseScreen;
58a7fd8e5eSmacallan	CreateScreenResourcesProcPtr CreateScreenResources;
59a7fd8e5eSmacallan	EntityInfoPtr		pEnt;
60a7fd8e5eSmacallan	struct wsdisplay_cursor cursor;
61a7fd8e5eSmacallan	int			maskoffset;
62a7fd8e5eSmacallan	xf86CursorInfoPtr	CursorInfoRec;
63a7fd8e5eSmacallan	OptionInfoPtr		Options;
64727c6de2Smacallan	ExaDriverPtr		pExa;
65727c6de2Smacallan	uint32_t		gid, buf, fbacc;
66727c6de2Smacallan	int 			offset, hwmode;
67727c6de2Smacallan#define HW_FB	0
68727c6de2Smacallan#define HW_FILL	1
69727c6de2Smacallan#define HW_BLIT	2
70a7fd8e5eSmacallan} NGLERec, *NGLEPtr;
71a7fd8e5eSmacallan
72a7fd8e5eSmacallan#define NGLEPTR(p) ((NGLEPtr)((p)->driverPrivate))
73a7fd8e5eSmacallan
74a7fd8e5eSmacallanBool NGLESetupCursor(ScreenPtr);
75727c6de2SmacallanBool NGLEInitAccel(ScreenPtr);
76a7fd8e5eSmacallan
77a7fd8e5eSmacallan#endif
78