crime.h revision 26dcc2a3
1/* $NetBSD: crime.h,v 1.3 2009/03/26 04:09:49 macallan Exp $ */
2/*
3 * Copyright (c) 2008 Michael Lorenz
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 *    - Redistributions of source code must retain the above copyright
11 *      notice, this list of conditions and the following disclaimer.
12 *    - Redistributions in binary form must reproduce the above
13 *      copyright notice, this list of conditions and the following
14 *      disclaimer in the documentation and/or other materials provided
15 *      with the distribution.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
23 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 *
30 */
31
32#include <fcntl.h>
33#include <sys/types.h>
34#include <sys/time.h>
35#include <dev/wscons/wsconsio.h>
36#include <dev/crmfbreg.h>
37
38#include "xf86.h"
39#include "xf86_OSproc.h"
40#include "xf86_ansic.h"
41
42#include "xf86RamDac.h"
43#include "xaa.h"
44
45#ifndef CRIME_H
46#define CRIME_H
47
48#define CRIME_DEBUG
49
50#define CRIME_DEBUG_LINES		0x00000001
51#define CRIME_DEBUG_BITBLT		0x00000002
52#define CRIME_DEBUG_RECTFILL		0x00000004
53#define CRIME_DEBUG_IMAGEWRITE		0x00000008
54#define CRIME_DEBUG_COLOUREXPAND	0x00000010
55#define CRIME_DEBUG_CLIPPING		0x00000020
56#define CRIME_DEBUG_SYNC		0x00000040
57#define CRIME_DEBUG_XRENDER		0x00000080
58#define CRIME_DEBUG_IMAGEREAD		0x00000100
59#define CRIME_DEBUG_ALL			0xffffffff
60#define CRIME_DEBUG_MASK (/*CRIME_DEBUG_IMAGEWRITE*/0)
61
62#ifdef CRIME_DEBUG
63#define LOG(x) if (x & CRIME_DEBUG_MASK) xf86Msg(X_ERROR, "%s\n", __func__)
64#define DONE(x) if (x & CRIME_DEBUG_MASK) \
65		 xf86Msg(X_ERROR, "%s done\n", __func__)
66#else
67#define LOG(x)
68#define DONE(x)
69#endif
70
71/* private data */
72typedef struct {
73	int			fd; /* file descriptor of open device */
74	struct wsdisplay_fbinfo info; /* frame buffer characteristics */
75	Bool			HWCursor;
76	CloseScreenProcPtr	CloseScreen;
77	EntityInfoPtr		pEnt;
78
79	struct wsdisplay_cursor cursor;
80	int			maskoffset;
81	xf86CursorInfoPtr	CursorInfoRec;
82	OptionInfoPtr		Options;
83
84	XAAInfoRecPtr		pXAA;
85	void			*engine;
86	char			*linear;
87	void			*fb;
88	unsigned char		*buffers[8];
89	unsigned char		*expandbuffers[1];
90	int			ux, uy, uw, uh, us, um;
91	int			start, xdir, ydir;
92	int			format;
93	int			use_mte;
94	uint32_t		expand[2048];
95	uint32_t		alpha_color;
96	int			texture_depth;
97	unsigned char		*alpha_texture;
98	void			*src, *msk;
99} CrimeRec, *CrimePtr;
100
101#define CRIMEPTR(p) ((CrimePtr)((p)->driverPrivate))
102
103Bool CrimeSetupCursor(ScreenPtr);
104int CrimeAccelInit(ScrnInfoPtr);
105
106#endif
107