[PATCH xserver 4/5] glamor: Remove 24bpp awareness from gc tile handling

Adam Jackson ajax at redhat.com
Wed Dec 7 20:08:42 UTC 2016


Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 glamor/glamor_core.c           | 37 -------------------------------------
 hw/xfree86/common/xf86Helper.c | 25 +++++--------------------
 hw/xfree86/common/xf86Init.c   | 11 -----------
 3 files changed, 5 insertions(+), 68 deletions(-)

diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c
index 7b2b396..610ae71 100644
--- a/glamor/glamor_core.c
+++ b/glamor/glamor_core.c
@@ -200,43 +200,6 @@ glamor_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable)
      * Preempt fbValidateGC by doing its work and masking the change out, so
      * that we can do the Prepare/finish_access.
      */
-#ifdef FB_24_32BIT
-    if ((changes & GCTile) && fbGetRotatedPixmap(gc)) {
-        gc->pScreen->DestroyPixmap(fbGetRotatedPixmap(gc));
-        fbGetRotatedPixmap(gc) = 0;
-    }
-
-    if (gc->fillStyle == FillTiled) {
-        PixmapPtr old_tile, new_tile;
-
-        old_tile = gc->tile.pixmap;
-        if (old_tile->drawable.bitsPerPixel != drawable->bitsPerPixel) {
-            new_tile = fbGetRotatedPixmap(gc);
-            if (!new_tile ||
-                new_tile->drawable.bitsPerPixel != drawable->bitsPerPixel) {
-                if (new_tile)
-                    gc->pScreen->DestroyPixmap(new_tile);
-                /* fb24_32ReformatTile will do direct access of a newly-
-                 * allocated pixmap.
-                 */
-                glamor_fallback
-                    ("GC %p tile FB_24_32 transformat %p.\n", gc, old_tile);
-
-                if (glamor_prepare_access
-                    (&old_tile->drawable, GLAMOR_ACCESS_RO)) {
-                    new_tile =
-                        fb24_32ReformatTile(old_tile, drawable->bitsPerPixel);
-                    glamor_finish_access(&old_tile->drawable);
-                }
-            }
-            if (new_tile) {
-                fbGetRotatedPixmap(gc) = old_tile;
-                gc->tile.pixmap = new_tile;
-                changes |= GCTile;
-            }
-        }
-    }
-#endif
     if (changes & GCTile) {
         if (!gc->tileIsPixel) {
             glamor_pixmap_private *pixmap_priv =
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 297196c..ddef1bd 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -370,7 +370,6 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
 {
     int i;
     DispPtr disp;
-    Bool nomatch = FALSE;
 
     scrp->bitsPerPixel = -1;
     scrp->depth = -1;
@@ -448,29 +447,18 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
     if (scrp->bitsPerPixel < 0) {
         /* The depth must be set */
         if (scrp->depth > -1) {
-            if (scrp->depth == 1)
-                scrp->bitsPerPixel = 1;
-            else if (scrp->depth <= 4)
-                scrp->bitsPerPixel = 4;
-            else if (scrp->depth <= 8)
+            if (scrp->depth = 8)
                 scrp->bitsPerPixel = 8;
             else if (scrp->depth <= 16)
                 scrp->bitsPerPixel = 16;
-            else if (scrp->depth <= 24) {
-                /* Verify that the screen can do 32bpp */
-                if (DO_PIX32(depth24flags)) {
-                    scrp->bitsPerPixel = 32;
-                }
-                else {
-                    nomatch = TRUE;
-                }
+            else if (scrp->depth <= 24 && DO_PIX32(depth24flags)) {
+                scrp->bitsPerPixel = 32;
             }
             else if (scrp->depth <= 32)
                 scrp->bitsPerPixel = 32;
             else {
                 xf86DrvMsg(scrp->scrnIndex, X_ERROR,
-                           "Specified depth (%d) is greater than 32\n",
-                           scrp->depth);
+                           "No bpp for depth (%d)\n", scrp->depth);
                 return FALSE;
             }
         }
@@ -481,10 +469,7 @@ xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int dummy, int fbbpp,
             return FALSE;
         }
         if (scrp->bitsPerPixel < 0) {
-            if (nomatch)
-                xf86DrvMsg(scrp->scrnIndex, X_ERROR,
-                           "Driver can't support 32bpp pixmap format\n");
-            else if ((depth24flags & (Support24bppFb | Support32bppFb)) ==
+            if ((depth24flags & (Support24bppFb | Support32bppFb)) ==
                      NoDepth24Support)
                 xf86DrvMsg(scrp->scrnIndex, X_ERROR,
                            "Driver can't support depth 24\n");
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index 75a27c8..9cb8d1c 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -1468,17 +1468,6 @@ PixmapFormatPtr
 xf86GetPixFormat(ScrnInfoPtr pScrn, int depth)
 {
     int i;
-    static PixmapFormatRec format;      /* XXX not reentrant */
-
-    /* XXX this could be simpler now? */
-    if (!formatsDone) {
-        if (depth == 24) {
-            format.depth = 24;
-            format.scanlinePad = BITMAP_SCANLINE_PAD;
-            format.bitsPerPixel = 32;
-            return &format;
-        }
-    }
 
     for (i = 0; i < numFormats; i++)
         if (formats[i].depth == depth)
-- 
2.9.3



More information about the xorg-devel mailing list