1/*
2 * Copyright © 2004 Keith Packard
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of Keith Packard not be used in
9 * advertising or publicity pertaining to distribution of the software without
10 * specific, written prior permission.  Keith Packard makes no
11 * representations about the suitability of this software for any purpose.  It
12 * is provided "as is" without express or implied warranty.
13 *
14 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20 * PERFORMANCE OF THIS SOFTWARE.
21 */
22
23#ifndef _FBDEV_H_
24#define _FBDEV_H_
25#include <stdio.h>
26#include <unistd.h>
27#include "kdrive.h"
28
29#ifdef RANDR
30#include "randrstr.h"
31#endif
32
33typedef struct _fakePriv {
34    CARD8	*base;
35    int		bytes_per_line;
36} FakePriv;
37
38typedef struct _fakeScrPriv {
39    Rotation	randr;
40    Bool	shadow;
41} FakeScrPriv;
42
43extern KdCardFuncs  fakeFuncs;
44
45Bool
46fakeInitialize (KdCardInfo *card, FakePriv *priv);
47
48Bool
49fakeCardInit (KdCardInfo *card);
50
51Bool
52fakeScreenInit (KdScreenInfo *screen);
53
54Bool
55fakeScreenInitialize (KdScreenInfo *screen, FakeScrPriv *scrpriv);
56
57Bool
58fakeInitScreen (ScreenPtr pScreen);
59
60Bool
61fakeFinishInitScreen (ScreenPtr pScreen);
62
63Bool
64fakeCreateResources (ScreenPtr pScreen);
65
66void
67fakePreserve (KdCardInfo *card);
68
69Bool
70fakeEnable (ScreenPtr pScreen);
71
72Bool
73fakeDPMS (ScreenPtr pScreen, int mode);
74
75void
76fakeDisable (ScreenPtr pScreen);
77
78void
79fakeRestore (KdCardInfo *card);
80
81void
82fakeScreenFini (KdScreenInfo *screen);
83
84void
85fakeCardFini (KdCardInfo *card);
86
87void
88fakeGetColors (ScreenPtr pScreen, int n, xColorItem *pdefs);
89
90void
91fakePutColors (ScreenPtr pScreen, int n, xColorItem *pdefs);
92
93Bool
94fakeMapFramebuffer (KdScreenInfo *screen);
95
96void *
97fakeWindowLinear (ScreenPtr	pScreen,
98		   CARD32	row,
99		   CARD32	offset,
100		   int		mode,
101		   CARD32	*size,
102		   void		*closure);
103
104void
105fakeSetScreenSizes (ScreenPtr pScreen);
106
107Bool
108fakeUnmapFramebuffer (KdScreenInfo *screen);
109
110Bool
111fakeSetShadow (ScreenPtr pScreen);
112
113Bool
114fakeCreateColormap (ColormapPtr pmap);
115
116#ifdef RANDR
117Bool
118fakeRandRGetInfo (ScreenPtr pScreen, Rotation *rotations);
119
120Bool
121fakeRandRSetConfig (ScreenPtr		pScreen,
122		     Rotation		randr,
123		     int		rate,
124		     RRScreenSizePtr	pSize);
125Bool
126fakeRandRInit (ScreenPtr pScreen);
127
128#endif
129
130extern KdPointerDriver FakePointerDriver;
131
132extern KdKeyboardDriver	FakeKeyboardDriver;
133
134extern KdOsFuncs   FakeOsFuncs;
135
136#endif /* _FBDEV_H_ */
137