Applied vnc-use-fb.patch from FC3, slightly modified:
Use fb unconditionally. This makes the code simpler, and the old mfb/cfb is buggy and deprecated.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@184 3789f03b-4d11-0410-bbf8-ca57d06f2519
diff --git a/xc.patch b/xc.patch
index cc90f16..274c8ee 100644
--- a/xc.patch
+++ b/xc.patch
@@ -1,110 +1,6 @@
-diff -bcr xc.org/programs/Xserver/cfb/cfb8line.c xc/programs/Xserver/cfb/cfb8line.c
-*** xc.org/programs/Xserver/cfb/cfb8line.c 2004-04-23 21:00:12.000000000 +0200
---- xc/programs/Xserver/cfb/cfb8line.c 2005-02-11 16:47:34.000000000 +0100
-***************
-*** 695,716 ****
- # if PSZ == 24
- y1_or_e1 = xOffset & 3;
- # else
-! # if PGSZ == 64 /* PIM value from <cfbmskbits.h> is not it! (for 16/32 PSZ)*/
-! y1_or_e1 = ((long) addrp) & 0x7;
-! addrp = (PixelType *) (((unsigned char *) addrp) - y1_or_e1);
-! # else
-! y1_or_e1 = ((long) addrp) & PIM;
-! addrp = (PixelType *) (((unsigned char *) addrp) - y1_or_e1);
-! # endif
-! #if PGSZ == 32
-! # if PWSH != 2
-! y1_or_e1 >>= (2 - PWSH);
-! # endif
-! #else /* PGSZ == 64 */
-! # if PWSH != 3
-! y1_or_e1 >>= (3 - PWSH);
-! # endif
-! #endif /* PGSZ */
- # endif /* PSZ == 24 */
- #if PSZ == 24
- {
---- 695,705 ----
- # if PSZ == 24
- y1_or_e1 = xOffset & 3;
- # else
-! /* Round addrp down to the next PixelGroup boundary, and
-! * set y1_or_e1 to the excess (in pixels)
-! * (assumes PGSZB is a power of 2). */
-! y1_or_e1 = (((unsigned long) addrp) & (PGSZB - 1)) / (PSZ / 8);
-! addrp -= y1_or_e1;
- # endif /* PSZ == 24 */
- #if PSZ == 24
- {
-diff -bcr xc.org/programs/Xserver/cfb/cfbcppl.c xc/programs/Xserver/cfb/cfbcppl.c
-*** xc.org/programs/Xserver/cfb/cfbcppl.c 2004-04-23 21:00:12.000000000 +0200
---- xc/programs/Xserver/cfb/cfbcppl.c 2005-02-11 16:47:34.000000000 +0100
-***************
-*** 383,389 ****
- psrcLine = (unsigned int *)psrcBase + srcy * widthSrc + srcx;
- #endif
- pdstLine = (unsigned int *)pdstBase + dsty * widthDst + (dstx >> 5);
-! if (dstx + width <= 32)
- {
- mfbmaskpartialbits(dstx, width, startmask);
- nlMiddle = 0;
---- 383,389 ----
- psrcLine = (unsigned int *)psrcBase + srcy * widthSrc + srcx;
- #endif
- pdstLine = (unsigned int *)pdstBase + dsty * widthDst + (dstx >> 5);
-! if ((dstx & 0x1f) + width <= 32)
- {
- mfbmaskpartialbits(dstx, width, startmask);
- nlMiddle = 0;
-diff -bcr xc.org/programs/Xserver/cfb/cfbtile32.c xc/programs/Xserver/cfb/cfbtile32.c
-*** xc.org/programs/Xserver/cfb/cfbtile32.c 2004-04-23 21:00:12.000000000 +0200
---- xc/programs/Xserver/cfb/cfbtile32.c 2005-02-11 16:47:34.000000000 +0100
-***************
-*** 72,78 ****
- (p)++,(*(p) = MROP_PREBUILT_SOLID(((srcpix<<16)|(srcpix>>8)),*(p))), \
- (p)++,(*(p) = MROP_PREBUILT_SOLID(((srcpix<<8)|(srcpix>>16)),*(p))))
-
-! #if (MROP == Mcopy) && defined(FAST_CONSTANT_OFFSET_MODE) && defined(SHARED_IDCACHE)
- # define Expand(left,right) {\
- int part = nlwMiddle & ((PGSZB*2)-1); \
- nlwMiddle *= 3; \
---- 72,84 ----
- (p)++,(*(p) = MROP_PREBUILT_SOLID(((srcpix<<16)|(srcpix>>8)),*(p))), \
- (p)++,(*(p) = MROP_PREBUILT_SOLID(((srcpix<<8)|(srcpix>>16)),*(p))))
-
-!
-!
-! /* XXX TJR: I doubt that this optimised case works (because the non-24 bit case
-! was broken), so I've added the #if 0 below. Someone who knows what they're
-! doing can re-enable it if they fix it */
-!
-! #if (MROP == Mcopy) && defined(FAST_CONSTANT_OFFSET_MODE) && defined(SHARED_IDCACHE) && 0
- # define Expand(left,right) {\
- int part = nlwMiddle & ((PGSZB*2)-1); \
- nlwMiddle *= 3; \
-***************
-*** 144,151 ****
-
- #if (MROP == Mcopy) && defined(FAST_CONSTANT_OFFSET_MODE) && defined(SHARED_IDCACHE)
- # define Expand(left,right) {\
-! int part = nlwMiddle & ((PGSZB*2)-1); \
-! nlwMiddle >>= PWSH + 1; \
- while (h--) { \
- srcpix = psrc[srcy]; \
- MROP_PREBUILD(srcpix); \
---- 150,157 ----
-
- #if (MROP == Mcopy) && defined(FAST_CONSTANT_OFFSET_MODE) && defined(SHARED_IDCACHE)
- # define Expand(left,right) {\
-! int part = nlwMiddle & 7; \
-! nlwMiddle >>= 3; \
- while (h--) { \
- srcpix = psrc[srcy]; \
- MROP_PREBUILD(srcpix); \
diff -bcr xc.org/programs/Xserver/Imakefile xc/programs/Xserver/Imakefile
*** xc.org/programs/Xserver/Imakefile 2004-12-15 20:22:53.000000000 +0100
---- xc/programs/Xserver/Imakefile 2005-02-11 16:50:00.000000000 +0100
+--- xc/programs/Xserver/Imakefile 2005-02-14 14:23:21.000000000 +0100
***************
*** 128,134 ****
LIBREGEX = RegexLibrary
@@ -124,29 +20,17 @@
#if BuildXprint
***************
*** 414,419 ****
---- 414,442 ----
+--- 414,430 ----
#define ServerToInstall Xsun
#endif
#endif /* XsunServer */
+ XCOMM
+ XCOMM X VNC server
+ XCOMM
-+ MFBSUBDIR = mfb
-+ CFB8SUBDIR = cfb
-+ CFB16SUBDIR = cfb16
-+ CFB24SUBDIR = cfb24
-+ CFB32SUBDIR = cfb32
+ FBSUBDIR = fb
+ XVNCDDXDIR = vnc/Xvnc
-+ #if VncUseFb
+ XVNCDIRS = $(STDDIRS) $(FBSUBDIR) $(XVNCDDXDIR) $(DEPDIRS)
+ XVNCLIBS = PreFbLibs vnc/Xvnc/LibraryTargetName(xvnc) FbPostFbLibs
-+ #else
-+ XVNCDIRS = $(STDDIRS) $(MFBSUBDIR) \
-+ $(CFB8SUBDIR) $(CFB16SUBDIR) $(CFB24SUBDIR) $(CFB32SUBDIR) \
-+ $(XVNCDDXDIR) $(DEPDIRS)
-+ XVNCLIBS = PreFbLibs vnc/Xvnc/LibraryTargetName(xvnc) CFBLibs PostFbLibs
-+ #endif
+ XVNCOBJS = $(XVNCDDXDIR)/stubs.o $(XVNCDDXDIR)/miinitext.o
+ XVNCSYSLIBS = $(FONTLIBS) $(SYSLIBS)
+ ServerTarget(Xvnc,$(XVNCDIRS),$(XVNCOBJS), \