xserver: Branch 'master' - 3 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Dec 21 09:15:05 UTC 2018


 glamor/glamor_render.c |   31 ++++++++++++++++++++-----------
 glamor/glamor_utils.h  |    6 ------
 2 files changed, 20 insertions(+), 17 deletions(-)

New commits:
commit a3d01ee9d0b5e523b0771e2a26542ac15e29a33f
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Dec 19 10:11:22 2018 +0100

    glamor: Remove unused format_for_pixmap helper
    
    Reviewed-by: Eric Anholt <eric at anholt.net>

diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h
index 1890c1fe5..8a147ca7e 100644
--- a/glamor/glamor_utils.h
+++ b/glamor/glamor_utils.h
@@ -629,12 +629,6 @@ gl_iformat_for_pixmap(PixmapPtr pixmap)
     }
 }
 
-static inline CARD32
-format_for_pixmap(PixmapPtr pixmap)
-{
-    return format_for_depth((pixmap)->drawable.depth);
-}
-
 #define REVERT_NONE       		0
 #define REVERT_NORMAL     		1
 #define REVERT_UPLOADING_A1		3
commit 2e256e8260648619e407b1de70fe43cf32819247
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Dec 19 11:10:10 2018 +0100

    glamor: Allow HW acceleration for more RENDER formats
    
    As long as the storage format is compatible.
    
    v2:
    * Remove explicit cases for formats handled by the default case.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>

diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index d5737018f..7fd932452 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -780,15 +780,15 @@ glamor_render_format_is_supported(PicturePtr picture)
     storage_format = format_for_depth(picture->pDrawable->depth);
 
     switch (picture->format) {
-    case PICT_x2r10g10b10:
+    case PICT_a2r10g10b10:
         return storage_format == PICT_x2r10g10b10;
     case PICT_a8r8g8b8:
     case PICT_x8r8g8b8:
         return storage_format == PICT_a8r8g8b8 || storage_format == PICT_x8r8g8b8;
-    case PICT_a8:
-        return storage_format == PICT_a8;
+    case PICT_a1r5g5b5:
+        return storage_format == PICT_x1r5g5b5;
     default:
-        return FALSE;
+        return picture->format == storage_format;
     }
 }
 
commit 7e6faa5b3c05e0b7149ee840403885b0b40b5827
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Dec 19 10:06:23 2018 +0100

    glamor: Check that storage format is compatible with RENDER format
    
    Fixes x2r10g10b10 related rendercheck failures.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>

diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 0417df4e6..d5737018f 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -766,18 +766,27 @@ glamor_set_normalize_tcoords_generic(PixmapPtr pixmap,
  *
  * We could support many more formats by using GL_ARB_texture_view to
  * parse the same bits as different formats.  For now, we only support
- * tweaking whether we sample the alpha bits of an a8r8g8b8, or just
- * force them to 1.
+ * tweaking whether we sample the alpha bits, or just force them to 1.
  */
 static Bool
-glamor_render_format_is_supported(PictFormatShort format)
+glamor_render_format_is_supported(PicturePtr picture)
 {
-    switch (format) {
+    PictFormatShort storage_format;
+
+    /* Source-only pictures should always work */
+    if (!picture->pDrawable)
+        return TRUE;
+
+    storage_format = format_for_depth(picture->pDrawable->depth);
+
+    switch (picture->format) {
     case PICT_x2r10g10b10:
+        return storage_format == PICT_x2r10g10b10;
     case PICT_a8r8g8b8:
     case PICT_x8r8g8b8:
+        return storage_format == PICT_a8r8g8b8 || storage_format == PICT_x8r8g8b8;
     case PICT_a8:
-        return TRUE;
+        return storage_format == PICT_a8;
     default:
         return FALSE;
     }
@@ -815,7 +824,7 @@ glamor_composite_choose_shader(CARD8 op,
         goto fail;
     }
 
-    if (!glamor_render_format_is_supported(dest->format)) {
+    if (!glamor_render_format_is_supported(dest)) {
         glamor_fallback("Unsupported dest picture format.\n");
         goto fail;
     }
@@ -978,7 +987,7 @@ glamor_composite_choose_shader(CARD8 op,
                 goto fail;
             }
         } else {
-            if (source && !glamor_render_format_is_supported(source->format)) {
+            if (source && !glamor_render_format_is_supported(source)) {
                 glamor_fallback("Unsupported source picture format.\n");
                 goto fail;
             }
@@ -990,7 +999,7 @@ glamor_composite_choose_shader(CARD8 op,
                 goto fail;
             }
         } else if (mask) {
-            if (!glamor_render_format_is_supported(mask->format)) {
+            if (!glamor_render_format_is_supported(mask)) {
                 glamor_fallback("Unsupported mask picture format.\n");
                 goto fail;
             }


More information about the xorg-commit mailing list