[PATCH] rootless: Delete dead remnants of rootless acceleration.

Jamey Sharp jamey at minilop.net
Wed Jul 14 13:49:09 PDT 2010


Jeremy deleted rootlessAccelInit's implementation in 2008 in commit
587c010a1cd733fded4d49dc339df0634bda8be6. Delete its prototype and the
remaining commented-out call to it.

It still makes sense for the rootless GC ops to relax the planemask, but
that's independent of the size of the operation, so quit checking the
thresholds there.

FillBytes and CompositePixels are not called anywhere, so delete
everything related to both.

Signed-off-by: Jamey Sharp <jamey at minilop.net>
Cc: Jeremy Huddleston <jeremyhu at apple.com>
Cc: Jon TURNEY <jon.turney at dronecode.org.uk>
---
 hw/xquartz/xpr/xprFrame.c       |    4 --
 hw/xquartz/xpr/xprScreen.c      |    6 ---
 hw/xwin/win.h                   |   10 ------
 hw/xwin/winscrinit.c            |    4 --
 hw/xwin/winwin32rootless.c      |   22 ------------
 miext/rootless/README.txt       |   41 +----------------------
 miext/rootless/rootless.h       |   69 ---------------------------------------
 miext/rootless/rootlessCommon.c |    2 -
 miext/rootless/rootlessGC.c     |   57 ++++++--------------------------
 9 files changed, 11 insertions(+), 204 deletions(-)

diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c
index 9f5d8a6..7b938c1 100644
--- a/hw/xquartz/xpr/xprFrame.c
+++ b/hw/xquartz/xpr/xprFrame.c
@@ -457,8 +457,6 @@ static RootlessFrameProcsRec xprRootlessProcs = {
     xprHideWindow,
     xprUpdateColormap,
     xp_copy_bytes,
-    xp_fill_bytes,
-    xp_composite_pixels,
     xprCopyWindow
 };
 
@@ -474,8 +472,6 @@ xprInit(ScreenPtr pScreen)
     TA_SERVER();
     
     rootless_CopyBytes_threshold = xp_copy_bytes_threshold;
-    rootless_FillBytes_threshold = xp_fill_bytes_threshold;
-    rootless_CompositePixels_threshold = xp_composite_area_threshold;
     rootless_CopyWindow_threshold = xp_scroll_area_threshold;
 
     return TRUE;
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 87e97d4..c03a82d 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -367,12 +367,6 @@ xprAddScreen(int index, ScreenPtr pScreen)
 static Bool
 xprSetupScreen(int index, ScreenPtr pScreen)
 {
-    // Initialize accelerated rootless drawing
-    // Note that this must be done before DamageSetup().
-
-    // These are crashing ugly... better to be stable and not crash for now.
-    //RootlessAccelInit(pScreen);
-
 #ifdef DAMAGE
     // The Damage extension needs to wrap underneath the
     // generic rootless layer, so do it now.
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 8c4b67f..1b1358c 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -1377,16 +1377,6 @@ winMWExtWMCopyBytes (unsigned int width, unsigned int height,
 			   void *dst, unsigned int dstRowBytes);
 
 void
-winMWExtWMFillBytes (unsigned int width, unsigned int height, unsigned int value,
-			   void *dst, unsigned int dstRowBytes);
-
-int
-winMWExtWMCompositePixels (unsigned int width, unsigned int height, unsigned int function,
-				 void *src[2], unsigned int srcRowBytes[2],
-				 void *mask, unsigned int maskRowBytes,
-				 void *dst[2], unsigned int dstRowBytes[2]);
-
-void
 winMWExtWMCopyWindow (RootlessFrameID wid, int dstNrects, const BoxRec *dstRects,
 			    int dx, int dy);
 #endif
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index 1b40933..178a1e4 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -61,8 +61,6 @@ winMWExtWMProcs = {
   NULL,//winMWExtWMUpdateColorMap,
 
   NULL,//winMWExtWMCopyBytes,
-  NULL,//winMWExtWMFillBytes,
-  NULL,//winMWExtWMCompositePixels,
   winMWExtWMCopyWindow
 };
 #endif
@@ -463,8 +461,6 @@ winFinishScreenInitFB (int index,
       winDebug ("winScreenInit - MultiWindowExtWM - RootlessInit returned\n");
       
       rootless_CopyBytes_threshold = 0;
-      rootless_FillBytes_threshold = 0;
-      rootless_CompositePixels_threshold = 0;
       /* FIXME: How many? Profiling needed? */
       rootless_CopyWindow_threshold = 1;
 
diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c
index 9749861..fbe4191 100755
--- a/hw/xwin/winwin32rootless.c
+++ b/hw/xwin/winwin32rootless.c
@@ -1007,28 +1007,6 @@ winMWExtWMCopyBytes (unsigned int width, unsigned int height,
 }
 
 void
-winMWExtWMFillBytes (unsigned int width, unsigned int height, unsigned int value,
-			   void *dst, unsigned int dstRowBytes)
-{
-#if CYGMULTIWINDOW_DEBUG
-  winDebug ("winMWExtWMFillBytes - Not implemented\n");
-#endif
-}
-
-int
-winMWExtWMCompositePixels (unsigned int width, unsigned int height, unsigned int function,
-				 void *src[2], unsigned int srcRowBytes[2],
-				 void *mask, unsigned int maskRowBytes,
-				 void *dst[2], unsigned int dstRowBytes[2])
-{
-#if CYGMULTIWINDOW_DEBUG
-  winDebug ("winMWExtWMCompositePixels - Not implemented\n");
-#endif
-  return 0;
-}
-
-
-void
 winMWExtWMCopyWindow (RootlessFrameID wid, int nDstRects, const BoxRec *pDstRects,
 			    int nDx, int nDy)
 {
diff --git a/miext/rootless/README.txt b/miext/rootless/README.txt
index 7ec5c41..754715d 100644
--- a/miext/rootless/README.txt
+++ b/miext/rootless/README.txt
@@ -102,8 +102,7 @@ rootlessConfig.h:
         offset that is applied to all screens when converting from
         screen-local to global coordinates.
 
-      o rootless_CopyBytes_threshold, rootless_FillBytes_threshold, 
-        rootless_CompositePixels_threshold, rootless_CopyWindow_threshold:
+      o rootless_CopyBytes_threshold, rootless_CopyWindow_threshold:
         The minimum number of bytes or pixels for which to use the rootless
         implementation's respective acceleration function. The rootless
         acceleration functions are all optional so these will only be used
@@ -322,44 +321,6 @@ typedef void (*RootlessCopyBytesProc)
      void *dst, unsigned int dstRowBytes);
 
 /*
- * Fill memory with 32-bit pattern. (Optional)
- *
- *  width       Bytes to fill per row
- *  height      Number of rows
- *  value       32-bit pattern to fill with
- *  dst         Destination data
- *  dstRowBytes Width of destination in bytes
- */
-typedef void (*RootlessFillBytesProc)
-    (unsigned int width, unsigned int height, unsigned int value,
-     void *dst, unsigned int dstRowBytes);
-
-/*
- * Composite pixels from source and mask to destination. (Optional)
- *
- *  width, height   Size of area to composite to in pizels
- *  function        Composite function built with RL_COMPOSITE_FUNCTION
- *  src             Source data
- *  srcRowBytes     Width of source in bytes (Passing NULL means source
- *                  is a single pixel.
- *  mask            Mask data
- *  maskRowBytes    Width of mask in bytes
- *  dst             Destination data
- *  dstRowBytes     Width of destination in bytes
- *
- *  For src and dst, the first element of the array is the color data. If
- *  the second element is non-null it implies there is alpha data (which
- *  may be meshed or planar). Data without alpha is assumed to be opaque.
- *
- *  An X11 error code is returned.
- */
-typedef int (*RootlessCompositePixelsProc)
-    (unsigned int width, unsigned int height, unsigned int function,
-     void *src[2], unsigned int srcRowBytes[2],
-     void *mask, unsigned int maskRowBytes,
-     void *dst[2], unsigned int dstRowBytes[2]);
-
-/*
  * Copy area in frame to another part of frame. (Optional)
  *
  *  wid         Frame id
diff --git a/miext/rootless/rootless.h b/miext/rootless/rootless.h
index 359d6c1..e5c2379 100644
--- a/miext/rootless/rootless.h
+++ b/miext/rootless/rootless.h
@@ -82,30 +82,8 @@ extern int rootlessGlobalOffsetY;
 /* The minimum number of bytes or pixels for which to use the
    implementation's accelerated functions. */
 extern unsigned int rootless_CopyBytes_threshold;
-extern unsigned int rootless_FillBytes_threshold;
-extern unsigned int rootless_CompositePixels_threshold;
 extern unsigned int rootless_CopyWindow_threshold;
 
-/* Operations used by CompositePixels */
-enum rl_composite_op_enum {
-    RL_COMPOSITE_SRC = 0,
-    RL_COMPOSITE_OVER,
-};
-
-/* Data formats for depth field and composite functions */
-enum rl_depth_enum {
-    RL_DEPTH_NIL = 0,			/* null source when compositing */
-    RL_DEPTH_ARGB8888,
-    RL_DEPTH_RGB555,
-    RL_DEPTH_A8,			/* for masks when compositing */
-    RL_DEPTH_INDEX8,
-};
-
-/* Macro to form the composite function for CompositePixels */
-#define RL_COMPOSITE_FUNCTION(op, src_depth, mask_depth, dest_depth) \
-    (((op) << 24) | ((src_depth) << 16) \
-     | ((mask_depth) << 8) | ((dest_depth) << 0))
-
 /* Gravity for window contents during resizing */
 enum rl_gravity_enum {
     RL_GRAVITY_NONE             = 0,	/* no gravity, fill everything */
@@ -292,44 +270,6 @@ typedef void (*RootlessCopyBytesProc)
      void *dst, unsigned int dstRowBytes);
 
 /*
- * Fill memory with 32-bit pattern. (Optional)
- *
- *  width       Bytes to fill per row
- *  height      Number of rows
- *  value       32-bit pattern to fill with
- *  dst         Destination data
- *  dstRowBytes Width of destination in bytes
- */
-typedef void (*RootlessFillBytesProc)
-    (unsigned int width, unsigned int height, unsigned int value,
-     void *dst, unsigned int dstRowBytes);
-
-/*
- * Composite pixels from source and mask to destination. (Optional)
- *
- *  width, height   Size of area to composite to in pizels
- *  function        Composite function built with RL_COMPOSITE_FUNCTION
- *  src             Source data
- *  srcRowBytes     Width of source in bytes (Passing NULL means source
- *                  is a single pixel.
- *  mask            Mask data
- *  maskRowBytes    Width of mask in bytes
- *  dst             Destination data
- *  dstRowBytes     Width of destination in bytes
- *
- *  For src and dst, the first element of the array is the color data. If
- *  the second element is non-null it implies there is alpha data (which
- *  may be meshed or planar). Data without alpha is assumed to be opaque.
- *
- *  An X11 error code is returned.
- */
-typedef int (*RootlessCompositePixelsProc)
-    (unsigned int width, unsigned int height, unsigned int function,
-     void *src[2], unsigned int srcRowBytes[2],
-     void *mask, unsigned int maskRowBytes,
-     void *dst[2], unsigned int dstRowBytes[2]);
-
-/*
  * Copy area in frame to another part of frame. (Optional)
  *
  *  wid         Frame id
@@ -374,8 +314,6 @@ typedef struct _RootlessFrameProcs {
 
     /* Optional acceleration functions */
     RootlessCopyBytesProc CopyBytes;
-    RootlessFillBytesProc FillBytes;
-    RootlessCompositePixelsProc CompositePixels;
     RootlessCopyWindowProc CopyWindow;
 } RootlessFrameProcsRec, *RootlessFrameProcsPtr;
 
@@ -386,13 +324,6 @@ typedef struct _RootlessFrameProcs {
 Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcsPtr procs);
 
 /*
- * Initialize acceleration for rootless mode on a given screen.
- *  Note: RootlessAccelInit() must be called before DamageSetup()
- *  and RootlessInit() must be called afterwards.
- */
-Bool RootlessAccelInit(ScreenPtr pScreen);
-
-/*
  * Return the frame ID for the physical window displaying the given window. 
  *
  *  create      If true and the window has no frame, attempt to create one
diff --git a/miext/rootless/rootlessCommon.c b/miext/rootless/rootlessCommon.c
index 219844a..cae73f6 100644
--- a/miext/rootless/rootlessCommon.c
+++ b/miext/rootless/rootlessCommon.c
@@ -40,8 +40,6 @@
 #include "colormapst.h"
 
 unsigned int rootless_CopyBytes_threshold = 0;
-unsigned int rootless_FillBytes_threshold = 0;
-unsigned int rootless_CompositePixels_threshold = 0;
 unsigned int rootless_CopyWindow_threshold = 0;
 int rootlessGlobalOffsetX = 0;
 int rootlessGlobalOffsetY = 0;
diff --git a/miext/rootless/rootlessGC.c b/miext/rootless/rootlessGC.c
index 63f24ce..f6e905b 100644
--- a/miext/rootless/rootlessGC.c
+++ b/miext/rootless/rootlessGC.c
@@ -141,9 +141,6 @@ static const GCOps rootlessGCOps = {
 };
 
 /*
-   There are two issues we must contend with when drawing. These are
-   controlled with ROOTLESS_PROTECT_ALPHA and RootlessAccelInit().
-
    If ROOTLESS_PROTECT_ALPHA is set, we have to make sure that the alpha
    channel of the on screen windows is always opaque. fb makes this harder
    than it would otherwise be by noticing that a planemask of 0x00ffffff
@@ -164,21 +161,8 @@ static const GCOps rootlessGCOps = {
    can do this when drawing op is GXcopy. We can also do this when copying
    from another window since its alpha channel must also be opaque.
 
-   The other issue to consider is that the rootless implementation may
-   provide accelerated drawing functions if RootlessAccelInit() is called.For 
-   some drawing primitives we swap in rootless acceleration functions, which
-   use the accelerated drawing functions where possible.
-
-   Where both alpha protection and acceleration is used, it is even a bigger
-   win to relax the planemask to all ones because most accelerated drawing
-   functions can only be used in this case. However, even if we can't set
-   the planemask to all ones, we can still use the accelerated
-   CompositePixels function for GXcopy if it is a forward copy. This is
-   mainly intended for copying from pixmaps to windows. The CompositePixels
-   operation used sets alpha to 0xFF during the copy.
-
-   The three macros below are used to implement this, potentially accelerated
-   drawing ops look something like this:
+   The three macros below are used to implement this. Drawing ops that can
+   potentially have their planemask relaxed look like:
 
    OP {
        GC_SAVE(gc);
@@ -278,16 +262,6 @@ canAccelFill(DrawablePtr pDraw, GCPtr pGC)
     return canAccelBlit(pDraw, pGC);
 }
 
-static unsigned int
-boxBytes(DrawablePtr pDraw, BoxRec *box)
-{
-    unsigned int pixels;
-
-    pixels = (box->x2 - box->x1) * (box->y2 - box->y1);
-
-    return pixels * (pDraw->bitsPerPixel >> 3);
-}
-
 
 /*
  * Screen function to create a graphics context
@@ -448,8 +422,7 @@ RootlessFillSpans(DrawablePtr dst, GCPtr pGC, int nInit,
 
         RootlessStartDrawing((WindowPtr) dst);
 
-        if (canAccelFill(dst, pGC) &&
-            boxBytes(dst, &box) >= rootless_FillBytes_threshold)
+        if (canAccelFill(dst, pGC))
         {
             GC_UNSET_PM(pGC, dst);
         }
@@ -555,15 +528,11 @@ RootlessCopyArea(DrawablePtr pSrc, DrawablePtr dst, GCPtr pGC,
     RL_DEBUG_MSG("copy area start (src 0x%x, dst 0x%x)", pSrc, dst);
 
     if (pSrc->type == DRAWABLE_WINDOW && IsFramedWindow((WindowPtr)pSrc)) {
-        unsigned int bytes;
-
         /* If both source and dest are windows, and we're doing
            a simple copy operation, we can remove the alpha-protecting
            planemask (since source has opaque alpha as well) */
 
-        bytes = w * h * (pSrc->depth >> 3);
-
-        if (bytes >= rootless_CopyBytes_threshold && canAccelBlit(pSrc, pGC))
+        if (canAccelBlit(pSrc, pGC))
         {
             GC_UNSET_PM(pGC, dst);
         }
@@ -1035,8 +1004,7 @@ static void RootlessFillPolygon(DrawablePtr dst, GCPtr pGC,
 
         RootlessStartDrawing((WindowPtr) dst);
 
-        if (canAccelFill(dst, pGC) &&
-            boxBytes(dst, &box) >= rootless_FillBytes_threshold)
+        if (canAccelFill(dst, pGC))
         {
             GC_UNSET_PM(pGC, dst);
         }
@@ -1088,8 +1056,7 @@ static void RootlessPolyFillRect(DrawablePtr dst, GCPtr pGC,
 
         RootlessStartDrawing((WindowPtr) dst);
  
-        if (canAccelFill(dst, pGC) &&
-            boxBytes(dst, &box) >= rootless_FillBytes_threshold)
+        if (canAccelFill(dst, pGC))
         {
             GC_UNSET_PM(pGC, dst);
         }
@@ -1141,8 +1108,7 @@ static void RootlessPolyFillArc(DrawablePtr dst, GCPtr pGC,
 
         RootlessStartDrawing((WindowPtr) dst);
 
-        if (canAccelFill(dst, pGC) &&
-            boxBytes(dst, &box) >= rootless_FillBytes_threshold)
+        if (canAccelFill(dst, pGC))
         {
             GC_UNSET_PM(pGC, dst);
         }
@@ -1192,8 +1158,7 @@ static void RootlessImageText8(DrawablePtr dst, GCPtr pGC,
 
         RootlessStartDrawing((WindowPtr) dst);
 
-        if (canAccelFill(dst, pGC) &&
-            boxBytes(dst, &box) >= rootless_FillBytes_threshold)
+        if (canAccelFill(dst, pGC))
         {
             GC_UNSET_PM(pGC, dst);
         }
@@ -1280,8 +1245,7 @@ static void RootlessImageText16(DrawablePtr dst, GCPtr pGC,
 
         RootlessStartDrawing((WindowPtr) dst);
 
-        if (canAccelFill(dst, pGC) &&
-            boxBytes(dst, &box) >= rootless_FillBytes_threshold)
+        if (canAccelFill(dst, pGC))
         {
             GC_UNSET_PM(pGC, dst);
         }
@@ -1379,8 +1343,7 @@ static void RootlessImageGlyphBlt(DrawablePtr dst, GCPtr pGC,
 
         RootlessStartDrawing((WindowPtr) dst);
 
-        if (canAccelFill(dst, pGC) &&
-            boxBytes(dst, &box) >= rootless_FillBytes_threshold)
+        if (canAccelFill(dst, pGC))
         {
             GC_UNSET_PM(pGC, dst);
         }
-- 
1.7.0



More information about the xorg-devel mailing list