xserver: Branch 'master' - 9 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Apr 2 18:11:44 UTC 2022


 Xext/xtest.c                                     |    2 +-
 config/fdi2iclass.py                             |    5 +----
 exa/exa_driver.c                                 |    2 +-
 exa/exa_mixed.c                                  |    4 +---
 glx/vndservermapping.c                           |    1 -
 hw/xfree86/common/xf86Mode.c                     |   18 ++++--------------
 hw/xfree86/drivers/modesetting/drmmode_display.c |   10 +++++-----
 hw/xwin/glx/gen_gl_wrappers.py                   |    2 +-
 xkb/xkbtext.c                                    |    3 +--
 9 files changed, 15 insertions(+), 32 deletions(-)

New commits:
commit 4422177d2659adef2cdf239e243fb7e1e262a9fd
Author: Konstantin Kharlamov <Hi-Angel at yandex.ru>
Date:   Sun Mar 24 02:32:00 2019 +0300

    gen_gl_wrappers: remove unused imports
    
    Fixes LGTM warnings:
        * Import of 'cProfile' is not used.
        * Import of 'pdb' is not used.
        * Import of 'string' is not used.
        * Import of 'time' is not used.
    
    Signed-off-by: Konstantin Kharlamov <Hi-Angel at yandex.ru>

diff --git a/hw/xwin/glx/gen_gl_wrappers.py b/hw/xwin/glx/gen_gl_wrappers.py
index b9e8dda75..256f2d752 100755
--- a/hw/xwin/glx/gen_gl_wrappers.py
+++ b/hw/xwin/glx/gen_gl_wrappers.py
@@ -24,7 +24,7 @@
 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 # MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
 
-import sys, time, pdb, string, cProfile
+import sys
 from reg import *
 
 # Default input / log files
commit 1eddcbe5c4b3d7beaeca8808e6a99472cc895652
Author: Konstantin Kharlamov <Hi-Angel at yandex.ru>
Date:   Sun Mar 24 02:28:08 2019 +0300

    fdi2iclass: remove unused local variable
    
    Fixes LGTM warning "The value assigned to local variable 'children' is
    never used."
    
    Signed-off-by: Konstantin Kharlamov <Hi-Angel at yandex.ru>

diff --git a/config/fdi2iclass.py b/config/fdi2iclass.py
index 36ef3801b..840d36f5a 100755
--- a/config/fdi2iclass.py
+++ b/config/fdi2iclass.py
@@ -184,9 +184,6 @@ def parse_fdi(fdi):
     # find all <match> leaf nodes
     num = 0
     for match_node in fdi.getElementsByTagName('match'):
-        children = set([n.tagName for n in match_node.childNodes
-                if n.nodeType == xml.dom.minidom.Node.ELEMENT_NODE])
-
         # see if there are any options at this level
         (driver, ignore, options) = parse_options(match_node)
         if not driver and not ignore and not options:
commit cd9d32c289f8d437ac11c4b22e02dda51da985e9
Author: Konstantin Kharlamov <Hi-Angel at yandex.ru>
Date:   Sun Mar 24 02:26:21 2019 +0300

    fdi2iclass.py: use "is" to compare with None
    
    Fixes LGTM warning "Testing for None should use the 'is' operator."
    
    Signed-off-by: Konstantin Kharlamov <Hi-Angel at yandex.ru>

diff --git a/config/fdi2iclass.py b/config/fdi2iclass.py
index 897444068..36ef3801b 100755
--- a/config/fdi2iclass.py
+++ b/config/fdi2iclass.py
@@ -150,7 +150,7 @@ def parse_all_matches(node):
 
         # walk up to a parent match node
         node = node.parentNode
-        if node == None or not is_match_node(node):
+        if node is None or not is_match_node(node):
             break
 
         # leave if there other options at this level
commit 0011f4ad173deb284d3001929439c67ad45aa6f2
Author: Konstantin Kharlamov <Hi-Angel at yandex.ru>
Date:   Sun Mar 24 02:22:46 2019 +0300

    modesetting: don't pass a big struct by value
    
    Fixes LGTM warning "This parameter of type drmModeModeInfo is 68 bytes -
    consider passing a const pointer/reference instead."
    
    Signed-off-by: Konstantin Kharlamov <Hi-Angel at yandex.ru>

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 21c9222e1..65e8e6335 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -519,13 +519,13 @@ connector_add_prop(drmModeAtomicReq *req, drmmode_output_private_ptr drmmode_out
 }
 
 static int
-drmmode_CompareKModes(drmModeModeInfo * kmode, drmModeModeInfo * other)
+drmmode_CompareKModes(const drmModeModeInfo * kmode, const drmModeModeInfo * other)
 {
     return memcmp(kmode, other, sizeof(*kmode));
 }
 
 static int
-drm_mode_ensure_blob(xf86CrtcPtr crtc, drmModeModeInfo mode_info)
+drm_mode_ensure_blob(xf86CrtcPtr crtc, const drmModeModeInfo* mode_info)
 {
     modesettingPtr ms = modesettingPTR(crtc->scrn);
     drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
@@ -533,14 +533,14 @@ drm_mode_ensure_blob(xf86CrtcPtr crtc, drmModeModeInfo mode_info)
     int ret;
 
     if (drmmode_crtc->current_mode &&
-        drmmode_CompareKModes(&drmmode_crtc->current_mode->mode_info, &mode_info) == 0)
+        drmmode_CompareKModes(&drmmode_crtc->current_mode->mode_info, mode_info) == 0)
         return 0;
 
     mode = calloc(sizeof(drmmode_mode_rec), 1);
     if (!mode)
         return -1;
 
-    mode->mode_info = mode_info;
+    mode->mode_info = *mode_info;
     ret = drmModeCreatePropertyBlob(ms->fd,
                                     &mode->mode_info,
                                     sizeof(mode->mode_info),
@@ -589,7 +589,7 @@ crtc_add_dpms_props(drmModeAtomicReq *req, xf86CrtcPtr crtc,
         drmModeModeInfo kmode;
 
         drmmode_ConvertToKMode(crtc->scrn, &kmode, &crtc->mode);
-        ret |= drm_mode_ensure_blob(crtc, kmode);
+        ret |= drm_mode_ensure_blob(crtc, &kmode);
 
         ret |= crtc_add_prop(req, drmmode_crtc,
                              DRMMODE_CRTC_ACTIVE, 1);
commit b6f79815eea63fba33cf765d33fc8059f303de76
Author: Konstantin Kharlamov <Hi-Angel at yandex.ru>
Date:   Sun Mar 24 02:16:21 2019 +0300

    glx: remove a noop assert (index is unsigned)
    
    Fixes "Pointless comparison of unsigned value to zero."
    
    Signed-off-by: Konstantin Kharlamov <Hi-Angel at yandex.ru>

diff --git a/glx/vndservermapping.c b/glx/vndservermapping.c
index 04788ffbd..e5b9e6b2a 100644
--- a/glx/vndservermapping.c
+++ b/glx/vndservermapping.c
@@ -131,7 +131,6 @@ GlxContextTagInfo *GlxAllocContextTag(ClientPtr client, GlxServerVendor *vendor)
         cl->contextTagCount = newSize;
     }
 
-    assert(index >= 0);
     assert(index < cl->contextTagCount);
     memset(&cl->contextTags[index], 0, sizeof(GlxContextTagInfo));
     cl->contextTags[index].tag = (GLXContextTag) (index + 1);
commit bad94e88cef8b692982ed0af112e7b2191ba558b
Author: Konstantin Kharlamov <Hi-Angel at yandex.ru>
Date:   Sun Mar 24 02:06:59 2019 +0300

    xkbtext: fix copy-paste error
    
    As can be seen in diff, nOut is always 0 here. The code was likely
    copy-pasted from comparisons further below.
    
    Fixes LGTM warning "Comparison is always false because nOut <= 0."
    
    Signed-off-by: Konstantin Kharlamov <Hi-Angel at yandex.ru>

diff --git a/xkb/xkbtext.c b/xkb/xkbtext.c
index 00a26c576..fb17f513e 100644
--- a/xkb/xkbtext.c
+++ b/xkb/xkbtext.c
@@ -967,8 +967,7 @@ CopySetLockControlsArgs(XkbDescPtr xkb, XkbAction *action, char *buf, int *sz)
         int nOut = 0;
 
         if (tmp & XkbRepeatKeysMask) {
-            snprintf(tbuf, sizeof(tbuf), "%sRepeatKeys", (nOut > 0 ? "+" : ""));
-            TryCopyStr(buf, tbuf, sz);
+            TryCopyStr(buf, "RepeatKeys", sz);
             nOut++;
         }
         if (tmp & XkbSlowKeysMask) {
commit 49c64bd1699780d9075806f79ac0270f0ea82d77
Author: Konstantin Kharlamov <Hi-Angel at yandex.ru>
Date:   Sun Mar 24 01:58:02 2019 +0300

    Xext: the check firstValuator ≤ 1 is duplicated in this branch
    
    Correctness is ensured be checking md5sum result before and after the
    commit (it's the same).
    
    Fixes LGTM warning: "Comparison is always true because firstValuator <= 1."
    
    Signed-off-by: Konstantin Kharlamov <Hi-Angel at yandex.ru>

diff --git a/Xext/xtest.c b/Xext/xtest.c
index 540d270a1..bf27eb590 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -382,7 +382,7 @@ ProcXTestFakeInput(ClientPtr client)
             if ((flags & POINTER_ABSOLUTE) && firstValuator <= 1 && numValuators > 0) {
                 if (firstValuator == 0)
                     valuators[0] += root->drawable.pScreen->x;
-                if (firstValuator < 2 && firstValuator + numValuators > 1)
+                if (firstValuator + numValuators > 1)
                     valuators[1 - firstValuator] += root->drawable.pScreen->y;
             }
         }
commit cd0d4c1bb54b809100444e6efc1f161054c43a8b
Author: Konstantin Kharlamov <Hi-Angel at yandex.ru>
Date:   Sun Mar 24 01:48:39 2019 +0300

    xfree86: numTimings is never value other than 0
    
    Correctness is ensured be checking md5sum result before and after the
    commit (it's the same).
    
    Fixes LGTM warning "Comparison is always false because numTimings <= 0."
    
    Signed-off-by: Konstantin Kharlamov <Hi-Angel at yandex.ru>

diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c
index eb0885571..4a0623c49 100644
--- a/hw/xfree86/common/xf86Mode.c
+++ b/hw/xfree86/common/xf86Mode.c
@@ -1352,8 +1352,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
     int saveType;
     PixmapFormatRec *BankFormat;
     ClockRangePtr cp;
-    int numTimings = 0;
-    range hsync[MAX_HSYNC];
+    const int numTimings = 0;
     range vrefresh[MAX_VREFRESH];
     Bool inferred_virtual = FALSE;
 
@@ -1394,18 +1393,9 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
         Bool specified = FALSE;
 
         if (scrp->monitor->nHsync <= 0) {
-            if (numTimings > 0) {
-                scrp->monitor->nHsync = numTimings;
-                for (i = 0; i < numTimings; i++) {
-                    scrp->monitor->hsync[i].lo = hsync[i].lo;
-                    scrp->monitor->hsync[i].hi = hsync[i].hi;
-                }
-            }
-            else {
-                scrp->monitor->hsync[0].lo = 31.5;
-                scrp->monitor->hsync[0].hi = 48.0;
-                scrp->monitor->nHsync = 1;
-            }
+            scrp->monitor->hsync[0].lo = 31.5;
+            scrp->monitor->hsync[0].hi = 48.0;
+            scrp->monitor->nHsync = 1;
             type = "default ";
         }
         else {
commit 1d80db55ddfa45edc7fae39b3c9382d7b60f8f72
Author: Konstantin Kharlamov <Hi-Angel at yandex.ru>
Date:   Sun Mar 24 01:37:27 2019 +0300

    exa: fix "comparison is always false"
    
    Both functions has a check at the beginning to return when h > 32767.
    
    Fixes LGTM 2 warnings "Comparison is always false because h <= 32767."
    
    Signed-off-by: Konstantin Kharlamov <Hi-Angel at yandex.ru>

diff --git a/exa/exa_driver.c b/exa/exa_driver.c
index 8799a798e..45acf152c 100644
--- a/exa/exa_driver.c
+++ b/exa/exa_driver.c
@@ -87,7 +87,7 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
     }
     else {
         paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits);
-        if (paddedWidth / 4 > 32767 || h > 32767)
+        if (paddedWidth / 4 > 32767)
             return NullPixmap;
 
         exaSetFbPitch(pExaScr, pExaPixmap, w, h, bpp);
diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c
index 1e67ec23a..d926f8033 100644
--- a/exa/exa_mixed.c
+++ b/exa/exa_mixed.c
@@ -72,7 +72,7 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
     bpp = pPixmap->drawable.bitsPerPixel;
 
     paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits);
-    if (paddedWidth / 4 > 32767 || h > 32767)
+    if (paddedWidth / 4 > 32767)
         return NullPixmap;
 
     /* We will allocate the system pixmap later if needed. */
@@ -326,5 +326,3 @@ exaSetSharedPixmapBacking_mixed(PixmapPtr pPixmap, void *handle)
 
     return ret;
 }
-
-


More information about the xorg-commit mailing list