]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/fb-drv/server/src/fb.h
6ce3ac932e3b41f2bc5462c4ac8f2efc610f791d
[l4.git] / l4 / pkg / fb-drv / server / src / fb.h
1 /*
2  * (c) 2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
3  *          Alexander Warg <warg@os.inf.tu-dresden.de>
4  *     economic rights: Technische Universität Dresden (Germany)
5  *
6  * This file is part of TUD:OS and distributed under the terms of the
7  * GNU General Public License 2.
8  * Please see the COPYING-GPL-2 file for details.
9  */
10 #pragma once
11
12 #include <l4/re/util/video/goos_svr>
13 #include <l4/re/util/cap_alloc>
14 #include <l4/re/util/object_registry>
15 #include <l4/re/util/dataspace_svr>
16
17 class Prog_args
18 {
19 public:
20   Prog_args(int argc, char *argv[]);
21
22   int vbemode;
23   bool do_dummy;
24   char *config_str;
25 };
26
27
28 class Phys_fb : public L4Re::Util::Video::Goos_svr,
29                 public L4Re::Util::Dataspace_svr,
30                 public L4::Server_object
31 {
32 public:
33   Phys_fb() : _vidmem_start(0), _map_done(0) {}
34
35   ~Phys_fb() throw() {}
36   virtual bool setup_drv(Prog_args *pa) = 0;
37   void setup_ds(char const *name);
38   int dispatch(l4_umword_t obj, L4::Ipc_iostream &ios);
39   int map_hook(l4_addr_t offs, unsigned long flags,
40                l4_addr_t min, l4_addr_t max);
41
42   bool running() { return _vidmem_start; };
43
44 protected:
45   l4_addr_t _vidmem_start;
46   l4_addr_t _vidmem_end;
47   l4_addr_t _vidmem_size;
48
49 private:
50   bool _map_done;
51 };
52
53
54 class Vesa_fb : public Phys_fb
55 {
56 public:
57   bool setup_drv(Prog_args *pa);
58 };
59
60
61 class Lcd_drv_fb : public Phys_fb
62 {
63 public:
64   bool setup_drv(Prog_args *pa);
65 };
66
67 class Dummy_fb : public Phys_fb
68 {
69 public:
70   bool setup_drv(Prog_args *pa);
71 };