xserver: Branch 'master' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun Dec 17 16:59:45 UTC 2023


 glamor/glamor_glyphblt.c                |    8 ++++++++
 glamor/glamor_text.c                    |    8 ++++++++
 hw/xfree86/drivers/modesetting/driver.c |   15 ++++++++++-----
 3 files changed, 26 insertions(+), 5 deletions(-)

New commits:
commit 6c605715281073e0d5fc3103b83c3855820c0e33
Author: xurui <xurui at kylinos.cn>
Date:   Wed Mar 22 17:08:58 2023 +0800

    modesetting: Check the return value of the drmGetVersion
    
    Signed-off-by: xurui <xurui at kylinos.cn>

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 334102d9c..ea8873d55 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -1100,16 +1100,21 @@ msShouldDoubleShadow(ScrnInfoPtr pScrn, modesettingPtr ms)
 {
     Bool ret = FALSE, asked;
     int from;
-    drmVersionPtr v = drmGetVersion(ms->fd);
+    drmVersionPtr v;
 
     if (!ms->drmmode.shadow_enable)
         return FALSE;
 
-    if (!strcmp(v->name, "mgag200") ||
-        !strcmp(v->name, "ast")) /* XXX || rn50 */
-        ret = TRUE;
+    if ((v = drmGetVersion(ms->fd))) {
+        if (!strcmp(v->name, "mgag200") ||
+            !strcmp(v->name, "ast")) /* XXX || rn50 */
+            ret = TRUE;
 
-    drmFreeVersion(v);
+        drmFreeVersion(v);
+    }
+    else
+        xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+                   "Failed to query DRM version.\n");
 
     asked = xf86GetOptValBool(ms->drmmode.Options, OPTION_DOUBLE_SHADOW, &ret);
 
commit 4cf89222701d73d46c098be9fcc8d9eb6d96f885
Author: Alexey <fatton2011 at yandex.ru>
Date:   Fri Jun 24 15:12:54 2022 +0000

    Fixed mirrored glyphs on big-endian machines

diff --git a/glamor/glamor_glyphblt.c b/glamor/glamor_glyphblt.c
index 44f668818..4ab23b333 100644
--- a/glamor/glamor_glyphblt.c
+++ b/glamor/glamor_glyphblt.c
@@ -102,7 +102,11 @@ glamor_poly_glyph_blt_gl(DrawablePtr drawable, GCPtr gc,
                         int pt_x_i = glyph_x + xx;
                         int pt_y_i = glyph_y + yy;
 
+#if BITMAP_BIT_ORDER == MSBFirst
+                        if (!(*glyph & (128 >> (xx & 7))))
+#else
                         if (!(*glyph & (1 << (xx & 7))))
+#endif
                             continue;
 
                         if (!RegionContainsPoint(clip, pt_x_i, pt_y_i, NULL))
@@ -209,7 +213,11 @@ glamor_push_pixels_gl(GCPtr gc, PixmapPtr bitmap,
     for (yy = 0; yy < h; yy++) {
         uint8_t *bitmap_row = bitmap_data + yy * bitmap_stride;
         for (xx = 0; xx < w; xx++) {
+#if BITMAP_BIT_ORDER == MSBFirst
+            if (bitmap_row[xx / 8] & (128 >> xx % 8) &&
+#else
             if (bitmap_row[xx / 8] & (1 << xx % 8) &&
+#endif
                 RegionContainsPoint(clip,
                                     x + xx,
                                     y + yy,
diff --git a/glamor/glamor_text.c b/glamor/glamor_text.c
index f1672d420..0cabecbd5 100644
--- a/glamor/glamor_text.c
+++ b/glamor/glamor_text.c
@@ -235,7 +235,11 @@ static const char fs_vars_text[] =
 
 static const char fs_exec_text[] =
     "       ivec2 itile_texture = ivec2(glyph_pos);\n"
+#if BITMAP_BIT_ORDER == MSBFirst
+    "       uint x = uint(7) - uint(itile_texture.x & 7);\n"
+#else
     "       uint x = uint(itile_texture.x & 7);\n"
+#endif
     "       itile_texture.x >>= 3;\n"
     "       uint texel = texelFetch(font, itile_texture, 0).x;\n"
     "       uint bit = (texel >> x) & uint(1);\n"
@@ -244,7 +248,11 @@ static const char fs_exec_text[] =
 
 static const char fs_exec_te[] =
     "       ivec2 itile_texture = ivec2(glyph_pos);\n"
+#if BITMAP_BIT_ORDER == MSBFirst
+    "       uint x = uint(7) - uint(itile_texture.x & 7);\n"
+#else
     "       uint x = uint(itile_texture.x & 7);\n"
+#endif
     "       itile_texture.x >>= 3;\n"
     "       uint texel = texelFetch(font, itile_texture, 0).x;\n"
     "       uint bit = (texel >> x) & uint(1);\n"


More information about the xorg-commit mailing list