open-src/xserver/xvnc/vnc-use-fb.patch
changeset 606 068c11b419c9
parent 235 06772554f851
equal deleted inserted replaced
605:e5259db5befc 606:068c11b419c9
     1 ## Patch originally from Fedora vnc-4.1.2-21.fc8 RPM - vnc-use-fb.patch
     1 ## Patch originally from Fedora - Revision 1.5 of:
       
     2 http://cvs.fedoraproject.org/viewvc/rpms/vnc/devel/vnc-use-fb.patch
     2 
     3 
     3 --- vnc-4_1-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.use-fb	2005-02-28 12:59:09.000000000 +0000
     4 Makes Xvnc use fb instead of the older cfb*/mfb libraries.
     4 +++ vnc-4_1-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc	2005-03-04 16:13:19.000000000 +0000
     5 
     5 @@ -48,8 +48,12 @@
     6 diff -up vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.use-fb vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc
       
     7 --- vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc.use-fb	2006-05-12 18:50:32.000000000 +0200
       
     8 +++ vnc-4_1_2-unixsrc/unix/xc/programs/Xserver/vnc/Xvnc/xvnc.cc	2008-07-16 13:28:27.000000000 +0200
       
     9 @@ -48,8 +48,12 @@ extern "C" {
     6  #include "X11/Xos.h"
    10  #include "X11/Xos.h"
     7  #include "scrnintstr.h"
    11  #include "scrnintstr.h"
     8  #include "servermd.h"
    12  #include "servermd.h"
     9 +#ifdef VNC_USE_FB
    13 +#ifdef VNC_USE_FB
    10 +#include "fb.h"
    14 +#include "fb.h"
    13  #include "cfb.h"
    17  #include "cfb.h"
    14 +#endif
    18 +#endif
    15  #include "mi.h"
    19  #include "mi.h"
    16  #include "mibstore.h"
    20  #include "mibstore.h"
    17  #include "colormapst.h"
    21  #include "colormapst.h"
    18 @@ -73,6 +77,7 @@
    22 @@ -73,6 +77,7 @@ extern "C" {
    19  #undef public
    23  #undef public
    20  #undef xor
    24  #undef xor
    21  #undef and
    25  #undef and
    22 +#ifndef VNC_USE_FB
    26 +#ifndef VNC_USE_FB
    23    extern Bool cfb16ScreenInit(ScreenPtr, pointer, int, int, int, int, int);
    27    extern Bool cfb16ScreenInit(ScreenPtr, pointer, int, int, int, int, int);
    24    extern Bool cfb32ScreenInit(ScreenPtr, pointer, int, int, int, int, int);
    28    extern Bool cfb32ScreenInit(ScreenPtr, pointer, int, int, int, int, int);
    25    extern Bool cfb16CreateGC(GCPtr);
    29    extern Bool cfb16CreateGC(GCPtr);
    26 @@ -83,6 +88,7 @@
    30 @@ -83,6 +88,7 @@ extern "C" {
    27                              unsigned long, char*);
    31                              unsigned long, char*);
    28    extern void cfb32GetImage(DrawablePtr, int, int, int, int, unsigned int,
    32    extern void cfb32GetImage(DrawablePtr, int, int, int, int, unsigned int,
    29                              unsigned long, char*);
    33                              unsigned long, char*);
    30 +#endif
    34 +#endif
    31  }
    35  }
    32  
    36  
    33  #define XVNCVERSION "Free Edition 4.1"
    37  #define XVNCVERSION "Free Edition 4.1.2"
    34 @@ -482,7 +488,7 @@
    38 @@ -482,7 +488,7 @@ CARD32 GetTimeInMillis()
    35  }
    39  }
    36  #endif
    40  #endif
    37  
    41  
    38 -
    42 -
    39 +#ifndef VNC_USE_FB
    43 +#ifndef VNC_USE_FB
    40  static Bool vfbMultiDepthCreateGC(GCPtr   pGC)
    44  static Bool vfbMultiDepthCreateGC(GCPtr   pGC)
    41  {
    45  {
    42    switch (vfbBitsPerPixel(pGC->depth))
    46    switch (vfbBitsPerPixel(pGC->depth))
    43 @@ -541,6 +547,7 @@
    47 @@ -541,6 +547,7 @@ vfbMultiDepthGetImage(DrawablePtr pDrawa
    44      break;
    48      break;
    45    }
    49    }
    46  }
    50  }
    47 +#endif
    51 +#endif
    48  
    52  
    49  static ColormapPtr InstalledMaps[MAXSCREENS];
    53  static ColormapPtr InstalledMaps[MAXSCREENS];
    50  
    54  
    51 @@ -811,6 +818,11 @@
    55 @@ -811,6 +818,11 @@ static Bool vfbScreenInit(int index, Scr
    52    defaultColorVisualClass
    56    defaultColorVisualClass
    53      = (pvfb->bitsPerPixel > 8) ? TrueColor : PseudoColor;
    57      = (pvfb->bitsPerPixel > 8) ? TrueColor : PseudoColor;
    54  
    58  
    55 +#ifdef VNC_USE_FB
    59 +#ifdef VNC_USE_FB
    56 +  if (!fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
    60 +  if (!fbScreenInit(pScreen, pbits, pvfb->width, pvfb->height,
    58 +      return FALSE;
    62 +      return FALSE;
    59 +#else
    63 +#else
    60    switch (pvfb->bitsPerPixel)
    64    switch (pvfb->bitsPerPixel)
    61    {
    65    {
    62    case 1:
    66    case 1:
    63 @@ -838,6 +850,7 @@
    67 @@ -838,6 +850,7 @@ static Bool vfbScreenInit(int index, Scr
    64    pScreen->CreateGC = vfbMultiDepthCreateGC;
    68    pScreen->CreateGC = vfbMultiDepthCreateGC;
    65    pScreen->GetImage = vfbMultiDepthGetImage;
    69    pScreen->GetImage = vfbMultiDepthGetImage;
    66    pScreen->GetSpans = vfbMultiDepthGetSpans;
    70    pScreen->GetSpans = vfbMultiDepthGetSpans;
    67 +#endif
    71 +#endif
    68  
    72  
    69    pScreen->InstallColormap = vfbInstallColormap;
    73    pScreen->InstallColormap = vfbInstallColormap;
    70    pScreen->UninstallColormap = vfbUninstallColormap;
    74    pScreen->UninstallColormap = vfbUninstallColormap;
    71 @@ -883,6 +896,9 @@
    75 @@ -883,6 +896,9 @@ static Bool vfbScreenInit(int index, Scr
    72      }
    76      }
    73    }
    77    }
    74  
    78  
    75 +#ifdef VNC_USE_FB
    79 +#ifdef VNC_USE_FB
    76 +  ret = fbCreateDefColormap(pScreen);
    80 +  ret = fbCreateDefColormap(pScreen);
    77 +#else
    81 +#else
    78    if (pvfb->bitsPerPixel == 1)
    82    if (pvfb->bitsPerPixel == 1)
    79    {
    83    {
    80      ret = mfbCreateDefColormap(pScreen);
    84      ret = mfbCreateDefColormap(pScreen);
    81 @@ -891,6 +907,7 @@
    85 @@ -891,6 +907,7 @@ static Bool vfbScreenInit(int index, Scr
    82    {
    86    {
    83      ret = cfbCreateDefColormap(pScreen);
    87      ret = cfbCreateDefColormap(pScreen);
    84    }
    88    }
    85 +#endif
    89 +#endif
    86  
    90  
    87    miSetZeroLineBias(pScreen, pvfb->lineBias);
    91    miSetZeroLineBias(pScreen, pvfb->lineBias);
       
    92