Initialize Tizen 2.3
[adaptation/xorg/driver/xserver-xorg-video-emulfb.git] / src / fbdev.h
1 /**************************************************************************
2
3 xserver-xorg-video-emulfb
4
5 Copyright 2010 - 2011 Samsung Electronics co., Ltd. All Rights Reserved.
6
7 Contact: SooChan Lim <sc1.lim@samsung.com>
8
9 Permission is hereby granted, free of charge, to any person obtaining a
10 copy of this software and associated documentation files (the
11 "Software"), to deal in the Software without restriction, including
12 without limitation the rights to use, copy, modify, merge, publish,
13 distribute, sub license, and/or sell copies of the Software, and to
14 permit persons to whom the Software is furnished to do so, subject to
15 the following conditions:
16
17 The above copyright notice and this permission notice (including the
18 next paragraph) shall be included in all copies or substantial portions
19 of the Software.
20
21 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
24 IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
25 ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
26 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
27 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28
29 **************************************************************************/
30
31 #ifndef FBDEV_H
32 #define FBDEV_H
33
34 #ifdef HAVE_CONFIG_H
35 #include "config.h"
36 #endif
37
38 #include "xf86.h"
39 #include "xf86_OSproc.h"
40 #include "fbdevhw.h"
41 #include "xf86xv.h"
42 #include <linux/fb.h>
43
44 #define PAGE_SIZE 4096
45
46 #define FBDEV_VERSION 1000 /* the version of the driver */
47 #define FBDEV_NAME "FBDEV" /* the name used to prefix messages */
48 #define FBDEV_DRIVER_NAME "emulfb" /* the driver name as used in config file.
49                                  * This name should match the name of the driver module binary
50                                  * In this driver, the name of the driver libary module is emulfb_drv.so.
51                                                                                                                                                           */
52 #define SWAPINT(i, j) \
53 {  int _t = i;  i = j;  j = _t; }
54
55 #define SEC_CURSOR_W    64
56 #define SEC_CURSOR_H    64
57
58 #define ADAPTOR_NUM  2
59
60 #define USE_XDBG 1
61
62 /* FBDev driver private data structure to hold the driver's screen-specific data */
63 typedef struct {
64         unsigned char *fbstart; /* start memory point of framebuffer: (fbmem + fboff) */
65         unsigned char *fbmem;   /* mmap memory pointer of framebuffer */
66         int fboff;              /* fb offset */
67         int lineLength;
68         CloseScreenProcPtr CloseScreen;
69         CreateScreenResourcesProcPtr CreateScreenResources;
70         void (*PointerMoved)(int index, int x, int y);
71         EntityInfoPtr pEnt;
72
73         /* driver options */
74         OptionInfoPtr Options;
75         Bool bSWCursorEnbled; /* software cursor enabled */
76         int rotate;
77
78         /* saved video mode */
79         struct fb_var_screeninfo saved_var;
80
81         /* Current information of Framebuffer */
82         struct fb_var_screeninfo var;
83         struct fb_fix_screeninfo fix;
84
85         /* mode infos */
86         DisplayModePtr builtin;
87         DisplayModeRec builtin_saved; /* original mode to send the fake mode when the screen rotates */
88         DisplayModePtr support_modes;
89
90         /* xv */
91 #ifdef XV
92         XF86VideoAdaptorPtr pAdaptor[ADAPTOR_NUM];
93         void  **v4l2_owner;
94         int     v4l2_num;
95         Bool bFbAlphaEnabled;
96 #endif
97
98         Bool bLockScreen;
99
100         /* dpms - flag for the control of lcd onoff*/
101         Bool isLcdOff;
102
103         /* Cursor */
104         Bool enableCursor;
105 } FBDevRec, *FBDevPtr;
106 #define FBDEVPTR(p) ((FBDevPtr)((p)->driverPrivate))
107
108 #endif //FBDEV_H
109