1706f2543Smrg/*
2706f2543Smrg * Copyright � 1999 Keith Packard
3706f2543Smrg *
4706f2543Smrg * Permission to use, copy, modify, distribute, and sell this software and its
5706f2543Smrg * documentation for any purpose is hereby granted without fee, provided that
6706f2543Smrg * the above copyright notice appear in all copies and that both that
7706f2543Smrg * copyright notice and this permission notice appear in supporting
8706f2543Smrg * documentation, and that the name of Keith Packard not be used in
9706f2543Smrg * advertising or publicity pertaining to distribution of the software without
10706f2543Smrg * specific, written prior permission.  Keith Packard makes no
11706f2543Smrg * representations about the suitability of this software for any purpose.  It
12706f2543Smrg * is provided "as is" without express or implied warranty.
13706f2543Smrg *
14706f2543Smrg * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15706f2543Smrg * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16706f2543Smrg * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17706f2543Smrg * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18706f2543Smrg * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19706f2543Smrg * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20706f2543Smrg * PERFORMANCE OF THIS SOFTWARE.
21706f2543Smrg */
22706f2543Smrg
23706f2543Smrg#ifndef _FBDEV_H_
24706f2543Smrg#define _FBDEV_H_
25706f2543Smrg#include <stdio.h>
26706f2543Smrg#include <linux/fb.h>
27706f2543Smrg#include <unistd.h>
28706f2543Smrg#include <sys/mman.h>
29706f2543Smrg#include "kdrive.h"
30706f2543Smrg
31706f2543Smrg#ifdef RANDR
32706f2543Smrg#include "randrstr.h"
33706f2543Smrg#endif
34706f2543Smrg
35706f2543Smrgtypedef struct _fbdevPriv {
36706f2543Smrg    struct fb_var_screeninfo	var;
37706f2543Smrg    struct fb_fix_screeninfo	fix;
38706f2543Smrg    __u16			red[256];
39706f2543Smrg    __u16			green[256];
40706f2543Smrg    __u16			blue[256];
41706f2543Smrg    int				fd;
42706f2543Smrg    char			*fb;
43706f2543Smrg    char			*fb_base;
44706f2543Smrg} FbdevPriv;
45706f2543Smrg
46706f2543Smrgtypedef struct _fbdevScrPriv {
47706f2543Smrg    Rotation			randr;
48706f2543Smrg    Bool			shadow;
49706f2543Smrg} FbdevScrPriv;
50706f2543Smrg
51706f2543Smrgextern KdCardFuncs  fbdevFuncs;
52706f2543Smrgextern char*        fbdevDevicePath;
53706f2543Smrg
54706f2543SmrgBool
55706f2543SmrgfbdevCardInit (KdCardInfo *card);
56706f2543Smrg
57706f2543SmrgBool
58706f2543SmrgfbdevScreenInit (KdScreenInfo *screen);
59706f2543Smrg
60706f2543SmrgBool
61706f2543SmrgfbdevInitScreen (ScreenPtr pScreen);
62706f2543Smrg
63706f2543SmrgBool
64706f2543SmrgfbdevFinishInitScreen (ScreenPtr pScreen);
65706f2543Smrg
66706f2543SmrgBool
67706f2543SmrgfbdevCreateResources (ScreenPtr pScreen);
68706f2543Smrg
69706f2543Smrgvoid
70706f2543SmrgfbdevPreserve (KdCardInfo *card);
71706f2543Smrg
72706f2543SmrgBool
73706f2543SmrgfbdevEnable (ScreenPtr pScreen);
74706f2543Smrg
75706f2543SmrgBool
76706f2543SmrgfbdevDPMS (ScreenPtr pScreen, int mode);
77706f2543Smrg
78706f2543Smrgvoid
79706f2543SmrgfbdevDisable (ScreenPtr pScreen);
80706f2543Smrg
81706f2543Smrgvoid
82706f2543SmrgfbdevRestore (KdCardInfo *card);
83706f2543Smrg
84706f2543Smrgvoid
85706f2543SmrgfbdevScreenFini (KdScreenInfo *screen);
86706f2543Smrg
87706f2543Smrgvoid
88706f2543SmrgfbdevCardFini (KdCardInfo *card);
89706f2543Smrg
90706f2543Smrgvoid
91706f2543SmrgfbdevGetColors (ScreenPtr pScreen, int n, xColorItem *pdefs);
92706f2543Smrg
93706f2543Smrgvoid
94706f2543SmrgfbdevPutColors (ScreenPtr pScreen, int n, xColorItem *pdefs);
95706f2543Smrg
96706f2543SmrgBool
97706f2543SmrgfbdevMapFramebuffer (KdScreenInfo *screen);
98706f2543Smrg
99706f2543Smrg#endif /* _FBDEV_H_ */
100