1 /**************************************************************************
3 xserver-xorg-video-emulfb
5 Copyright 2010 - 2011 Samsung Electronics co., Ltd. All Rights Reserved.
7 Contact: SooChan Lim <sc1.lim@samsung.com>
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:
17 The above copyright notice and this permission notice (including the
18 next paragraph) shall be included in all copies or substantial portions
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.
29 **************************************************************************/
39 #include "xf86_OSproc.h"
44 #define PAGE_SIZE 4096
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.
52 #define SWAPINT(i, j) \
53 { int _t = i; i = j; j = _t; }
55 #define SEC_CURSOR_W 64
56 #define SEC_CURSOR_H 64
62 /* FBDev driver private data structure to hold the driver's screen-specific data */
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 */
68 CloseScreenProcPtr CloseScreen;
69 CreateScreenResourcesProcPtr CreateScreenResources;
70 void (*PointerMoved)(int index, int x, int y);
74 OptionInfoPtr Options;
75 Bool bSWCursorEnbled; /* software cursor enabled */
78 /* saved video mode */
79 struct fb_var_screeninfo saved_var;
81 /* Current information of Framebuffer */
82 struct fb_var_screeninfo var;
83 struct fb_fix_screeninfo fix;
86 DisplayModePtr builtin;
87 DisplayModeRec builtin_saved; /* original mode to send the fake mode when the screen rotates */
88 DisplayModePtr support_modes;
92 XF86VideoAdaptorPtr pAdaptor[ADAPTOR_NUM];
100 /* dpms - flag for the control of lcd onoff*/
105 } FBDevRec, *FBDevPtr;
106 #define FBDEVPTR(p) ((FBDevPtr)((p)->driverPrivate))