Annotation of /trunk/vnc/patches/vnc-server-always-use-fb-2.patch
Parent Directory | Revision Log
Revision 643 -
(hide annotations)
(download)
Tue Jun 3 21:20:10 2008 UTC (16 years, 3 months ago) by niro
File size: 6195 byte(s)
Tue Jun 3 21:20:10 2008 UTC (16 years, 3 months ago) by niro
File size: 6195 byte(s)
-added several new fixes from fedora
1 | niro | 643 | --- vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.always_use_fb 2007-03-05 14:03:21.000000000 +0100 |
2 | +++ vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc 2007-03-05 14:10:57.000000000 +0100 | ||
3 | @@ -33,27 +33,28 @@ | ||
4 | #include <network/TcpSocket.h> | ||
5 | #include "vncExtInit.h" | ||
6 | |||
7 | +#ifdef HAVE_DIX_CONFIG_H | ||
8 | +#include <dix-config.h> | ||
9 | +#endif | ||
10 | + | ||
11 | extern "C" { | ||
12 | #define class c_class | ||
13 | #define public c_public | ||
14 | +#define new c_new | ||
15 | #ifdef WIN32 | ||
16 | #include <X11/Xwinsock.h> | ||
17 | #endif | ||
18 | #include <stdio.h> | ||
19 | -#include "X11/X.h" | ||
20 | +#include <X11/X.h> | ||
21 | #define NEED_EVENTS | ||
22 | -#include "X11/Xproto.h" | ||
23 | -#include "X11/Xos.h" | ||
24 | +#include <X11/Xproto.h> | ||
25 | +#include <X11/Xos.h> | ||
26 | #include "scrnintstr.h" | ||
27 | #include "servermd.h" | ||
28 | -#ifdef VNC_USE_FB | ||
29 | #include "fb.h" | ||
30 | -#else | ||
31 | -#define PSZ 8 | ||
32 | -#include "cfb.h" | ||
33 | -#endif | ||
34 | #include "mi.h" | ||
35 | -#include "mibstore.h" | ||
36 | +#include "micmap.h" | ||
37 | +#include "miline.h" | ||
38 | #include "colormapst.h" | ||
39 | #include "gcstruct.h" | ||
40 | #include "input.h" | ||
41 | @@ -66,24 +67,12 @@ | ||
42 | #endif | ||
43 | #include <X11/XWDFile.h> | ||
44 | #include "dix.h" | ||
45 | -#include "miline.h" | ||
46 | #include "inputstr.h" | ||
47 | #include "keysym.h" | ||
48 | extern int defaultColorVisualClass; | ||
49 | +#undef new | ||
50 | #undef class | ||
51 | #undef public | ||
52 | -#ifndef VNC_USE_FB | ||
53 | - extern Bool cfb16ScreenInit(ScreenPtr, pointer, int, int, int, int, int); | ||
54 | - extern Bool cfb32ScreenInit(ScreenPtr, pointer, int, int, int, int, int); | ||
55 | - extern Bool cfb16CreateGC(GCPtr); | ||
56 | - extern Bool cfb32CreateGC(GCPtr); | ||
57 | - extern void cfb16GetSpans(DrawablePtr, int, DDXPointPtr, int*, int, char*); | ||
58 | - extern void cfb32GetSpans(DrawablePtr, int, DDXPointPtr, int*, int, char*); | ||
59 | - extern void cfb16GetImage(DrawablePtr, int, int, int, int, unsigned int, | ||
60 | - unsigned long, char*); | ||
61 | - extern void cfb32GetImage(DrawablePtr, int, int, int, int, unsigned int, | ||
62 | - unsigned long, char*); | ||
63 | -#endif | ||
64 | } | ||
65 | |||
66 | #define XVNCVERSION "Free Edition 4.1.2" | ||
67 | @@ -502,67 +491,6 @@ | ||
68 | } | ||
69 | #endif | ||
70 | |||
71 | -#ifndef VNC_USE_FB | ||
72 | -static Bool vfbMultiDepthCreateGC(GCPtr pGC) | ||
73 | -{ | ||
74 | - switch (vfbBitsPerPixel(pGC->depth)) | ||
75 | - { | ||
76 | - case 1: return mfbCreateGC (pGC); | ||
77 | - case 8: return cfbCreateGC (pGC); | ||
78 | - case 16: return cfb16CreateGC (pGC); | ||
79 | - case 32: return cfb32CreateGC (pGC); | ||
80 | - default: return FALSE; | ||
81 | - } | ||
82 | -} | ||
83 | - | ||
84 | -static void vfbMultiDepthGetSpans( | ||
85 | - DrawablePtr pDrawable, /* drawable from which to get bits */ | ||
86 | - int wMax, /* largest value of all *pwidths */ | ||
87 | - register DDXPointPtr ppt, /* points to start copying from */ | ||
88 | - int *pwidth, /* list of number of bits to copy */ | ||
89 | - int nspans, /* number of scanlines to copy */ | ||
90 | - char *pdstStart) /* where to put the bits */ | ||
91 | -{ | ||
92 | - switch (pDrawable->bitsPerPixel) { | ||
93 | - case 1: | ||
94 | - mfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart); | ||
95 | - break; | ||
96 | - case 8: | ||
97 | - cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart); | ||
98 | - break; | ||
99 | - case 16: | ||
100 | - cfb16GetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart); | ||
101 | - break; | ||
102 | - case 32: | ||
103 | - cfb32GetSpans(pDrawable, wMax, ppt, pwidth, nspans, pdstStart); | ||
104 | - break; | ||
105 | - } | ||
106 | - return; | ||
107 | -} | ||
108 | - | ||
109 | -static void | ||
110 | -vfbMultiDepthGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, | ||
111 | - unsigned int format, unsigned long planeMask, | ||
112 | - char *pdstLine) | ||
113 | -{ | ||
114 | - switch (pDrawable->bitsPerPixel) | ||
115 | - { | ||
116 | - case 1: | ||
117 | - mfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); | ||
118 | - break; | ||
119 | - case 8: | ||
120 | - cfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); | ||
121 | - break; | ||
122 | - case 16: | ||
123 | - cfb16GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); | ||
124 | - break; | ||
125 | - case 32: | ||
126 | - cfb32GetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine); | ||
127 | - break; | ||
128 | - } | ||
129 | -} | ||
130 | -#endif | ||
131 | - | ||
132 | static ColormapPtr InstalledMaps[MAXSCREENS]; | ||
133 | |||
134 | static int vfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps) | ||
135 | @@ -832,44 +760,32 @@ | ||
136 | defaultColorVisualClass | ||
137 | = (pvfb->bitsPerPixel > 8) ? TrueColor : PseudoColor; | ||
138 | |||
139 | -#ifdef VNC_USE_FB | ||
140 | - if (!fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height, | ||
141 | - dpi, dpi, pvfb->paddedWidth, pvfb->bitsPerPixel)) | ||
142 | - return FALSE; | ||
143 | + miSetPixmapDepths(); | ||
144 | |||
145 | -#ifdef RENDER | ||
146 | - if (ret && Render) | ||
147 | - fbPictureInit(pScreen, 0, 0); | ||
148 | -#endif /* RENDER */ | ||
149 | -#else /* VNC_USE_FB */ | ||
150 | switch (pvfb->bitsPerPixel) | ||
151 | { | ||
152 | - case 1: | ||
153 | - ret = mfbScreenInit(pScreen, pbits, pvfb->width, pvfb->height, | ||
154 | - dpi, dpi, pvfb->paddedWidth); | ||
155 | - break; | ||
156 | case 8: | ||
157 | - ret = cfbScreenInit(pScreen, pbits, pvfb->width, pvfb->height, | ||
158 | - dpi, dpi, pvfb->paddedWidth); | ||
159 | + miSetVisualTypesAndMasks (8, 1 << PseudoColor, 8, PseudoColor, 0, 0, 0); | ||
160 | + | ||
161 | break; | ||
162 | case 16: | ||
163 | - ret = cfb16ScreenInit(pScreen, pbits, pvfb->width, pvfb->height, | ||
164 | - dpi, dpi, pvfb->paddedWidth); | ||
165 | + miSetVisualTypesAndMasks (16, 1 << TrueColor, 8, TrueColor, 0xf800, 0x07e0, 0x001f); | ||
166 | break; | ||
167 | case 32: | ||
168 | - ret = cfb32ScreenInit(pScreen, pbits, pvfb->width, pvfb->height, | ||
169 | - dpi, dpi, pvfb->paddedWidth); | ||
170 | + miSetVisualTypesAndMasks (32, 1 << TrueColor , 8, TrueColor, 0xff000000, 0x00ff0000, 0x0000ff00); | ||
171 | break; | ||
172 | default: | ||
173 | return FALSE; | ||
174 | } | ||
175 | |||
176 | - if (!ret) return FALSE; | ||
177 | + if (!fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height, | ||
178 | + dpi, dpi, pvfb->paddedWidth, pvfb->bitsPerPixel)) | ||
179 | + return FALSE; | ||
180 | |||
181 | - pScreen->CreateGC = vfbMultiDepthCreateGC; | ||
182 | - pScreen->GetImage = vfbMultiDepthGetImage; | ||
183 | - pScreen->GetSpans = vfbMultiDepthGetSpans; | ||
184 | -#endif | ||
185 | +#ifdef RENDER | ||
186 | + if (ret && Render) | ||
187 | + fbPictureInit(pScreen, 0, 0); | ||
188 | +#endif /* RENDER */ | ||
189 | |||
190 | pScreen->InstallColormap = vfbInstallColormap; | ||
191 | pScreen->UninstallColormap = vfbUninstallColormap; | ||
192 | @@ -915,18 +831,7 @@ | ||
193 | } | ||
194 | } | ||
195 | |||
196 | -#ifdef VNC_USE_FB | ||
197 | ret = fbCreateDefColormap(pScreen); | ||
198 | -#else | ||
199 | - if (pvfb->bitsPerPixel == 1) | ||
200 | - { | ||
201 | - ret = mfbCreateDefColormap(pScreen); | ||
202 | - } | ||
203 | - else | ||
204 | - { | ||
205 | - ret = cfbCreateDefColormap(pScreen); | ||
206 | - } | ||
207 | -#endif | ||
208 | |||
209 | miSetZeroLineBias(pScreen, pvfb->lineBias); | ||
210 |