xserver: Branch 'master' - 5 commits

Keith Packard keithp at kemper.freedesktop.org
Thu Jun 2 14:51:37 UTC 2016


 glamor/glamor_render.c                           |   27 +++++-----
 hw/xfree86/drivers/modesetting/drmmode_display.c |    5 -
 hw/xfree86/modes/xf86Crtc.h                      |   10 +--
 hw/xfree86/modes/xf86Cursors.c                   |   59 -----------------------
 os/access.c                                      |    9 +--
 5 files changed, 24 insertions(+), 86 deletions(-)

New commits:
commit 3735ab965a4642273d070840bda4e827991e5219
Merge: 7c77c42 43dbc55
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Jun 2 07:47:16 2016 -0700

    Merge remote-tracking branch 'daenzer/for-master'

commit 43dbc556f3a4d743b9121d6cfc21961be4a9da56
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu Dec 24 16:43:44 2015 +0900

    xfree86/modes: Remove xf86_reload_cursors v2
    
    No longer needed now that xf86CursorResetCursor is getting called for
    each CRTC configuration change.
    
    v2: Keep xf86_reload_cursors as a deprecated empty inline function
        until all drivers stop calling it. (Adam Jackson)
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 8ca0c26..bf21320 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -508,11 +508,6 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
         }
     }
 
-#if 0
-    if (pScrn->pScreen &&
-        !xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE))
-        xf86_reload_cursors(pScrn->pScreen);
-#endif
  done:
     if (!ret) {
         crtc->x = saved_x;
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 8b01608..bdcfa13 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -968,14 +968,10 @@ extern _X_EXPORT Bool
  xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags);
 
 /**
- * Called when anything on the screen is reconfigured.
- *
- * Reloads cursor images as needed, then adjusts cursor positions.
- *
- * Driver should call this from crtc commit function.
+ * Superseeded by xf86CursorResetCursor, which is getting called
+ * automatically when necessary.
  */
-extern _X_EXPORT void
- xf86_reload_cursors(ScreenPtr screen);
+static _X_INLINE _X_DEPRECATED void xf86_reload_cursors(ScreenPtr screen) {}
 
 /**
  * Called from EnterVT to turn the cursors back on
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index 351777b..6293b73 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -641,63 +641,6 @@ xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags)
 }
 
 /**
- * Called when anything on the screen is reconfigured.
- *
- * Reloads cursor images as needed, then adjusts cursor positions
- * @note We assume that all hardware cursors to be loaded have already been
- *       found to be usable by the hardware.
- */
-
-void
-xf86_reload_cursors(ScreenPtr screen)
-{
-    ScrnInfoPtr scrn;
-    xf86CrtcConfigPtr xf86_config;
-    xf86CursorInfoPtr cursor_info;
-    CursorPtr cursor;
-    int x, y;
-    xf86CursorScreenPtr cursor_screen_priv;
-
-    /* initial mode setting will not have set a screen yet.
-       May be called before the devices are initialised.
-     */
-    if (!screen || !inputInfo.pointer)
-        return;
-    cursor_screen_priv = dixLookupPrivate(&screen->devPrivates,
-                                          xf86CursorScreenKey);
-    /* return if HW cursor is inactive, to avoid displaying two cursors */
-    if (!cursor_screen_priv || !cursor_screen_priv->isUp)
-        return;
-
-    scrn = xf86ScreenToScrn(screen);
-    xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
-
-    /* make sure the cursor code has been initialized */
-    cursor_info = xf86_config->cursor_info;
-    if (!cursor_info)
-        return;
-
-    cursor = xf86CurrentCursor(screen);
-    GetSpritePosition(inputInfo.pointer, &x, &y);
-    if (!(cursor_info->Flags & HARDWARE_CURSOR_UPDATE_UNHIDDEN))
-        (*cursor_info->HideCursor) (scrn);
-
-    if (cursor) {
-        void *src =
-            dixLookupScreenPrivate(&cursor->devPrivates, CursorScreenKey,
-                                   screen);
-        if (cursor->bits->argb && xf86DriverHasLoadCursorARGB(cursor_info))
-            xf86DriverLoadCursorARGB(cursor_info, cursor);
-        else if (src)
-            xf86DriverLoadCursorImage(cursor_info, src);
-
-        x += scrn->frameX0 + cursor_screen_priv->HotX;
-        y += scrn->frameY0 + cursor_screen_priv->HotY;
-        (*cursor_info->SetCursorPosition) (scrn, x, y);
-    }
-}
-
-/**
  * Clean up CRTC-based cursor code
  */
 void
commit e156c0ccb530897d3a428255bd5585f7ea7b9b41
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Mar 30 18:23:04 2016 +0900

    os: Use strtok instead of xstrtokenize in ComputeLocalClient
    
    Fixes leaking the memory pointed to by the members of the array returned
    by xstrtokenize.
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>

diff --git a/os/access.c b/os/access.c
index 58f95a9..8828e08 100644
--- a/os/access.c
+++ b/os/access.c
@@ -1131,19 +1131,20 @@ ComputeLocalClient(ClientPtr client)
      * is forwarded from another host via SSH
      */
     if (cmdname) {
-        char **cmd;
+        char *cmd = strdup(cmdname);
         Bool ret;
 
         /* Cut off any colon and whatever comes after it, see
          * https://lists.freedesktop.org/archives/xorg-devel/2015-December/048164.html
          */
-        cmd = xstrtokenize(cmdname, ":");
+        cmd = strtok(cmd, ":");
 
 #if !defined(WIN32) || defined(__CYGWIN__)
-        cmd[0] = basename(cmd[0]);
+        ret = strcmp(basename(cmd), "ssh") != 0;
+#else
+        ret = strcmp(cmd, "ssh") != 0;
 #endif
 
-        ret = strcmp(cmd[0], "ssh") != 0;
         free(cmd);
 
         return ret;
commit 5ff75da317539e87cca429185d710d0eeb9d9222
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu May 26 19:01:59 2016 +0900

    glamor: Cannot use copies when accessing outside of composite source
    
    Commit b64108fa ("glamor: Check for composite operations which are
    equivalent to copies") failed to copy conditions from exaComposite which
    ensure that the composite operation doesn't access outside of the source
    picture.
    
    This fixes rendercheck regressions from the commit above.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 165bced..64141ac 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1424,18 +1424,21 @@ glamor_composite_clipped_region(CARD8 op,
     if (!mask && !source->alphaMap && !dest->alphaMap
         && source->pDrawable && !source->transform
         && ((op == PictOpSrc
-             && ((source->format == dest->format
-                  || (PICT_FORMAT_COLOR(dest->format)
-                      && PICT_FORMAT_COLOR(source->format)
-                      && dest->format == PICT_FORMAT(PICT_FORMAT_BPP(source->format),
-                                                     PICT_FORMAT_TYPE(source->format),
-                                                     0,
-                                                     PICT_FORMAT_R(source->format),
-                                                     PICT_FORMAT_G(source->format),
-                                                     PICT_FORMAT_B(source->format))))
-                 || (op == PictOpOver
-                     && source->format == dest->format
-                     && !PICT_FORMAT_A(source->format)))))) {
+             && (source->format == dest->format
+                 || (PICT_FORMAT_COLOR(dest->format)
+                     && PICT_FORMAT_COLOR(source->format)
+                     && dest->format == PICT_FORMAT(PICT_FORMAT_BPP(source->format),
+                                                    PICT_FORMAT_TYPE(source->format),
+                                                    0,
+                                                    PICT_FORMAT_R(source->format),
+                                                    PICT_FORMAT_G(source->format),
+                                                    PICT_FORMAT_B(source->format)))))
+            || (op == PictOpOver
+                && source->format == dest->format
+                && !PICT_FORMAT_A(source->format)))
+        && x_source >= 0 && y_source >= 0
+        && (x_source + width) <= source->pDrawable->width
+        && (y_source + height) <= source->pDrawable->height) {
         x_source += source->pDrawable->x;
         y_source += source->pDrawable->y;
         x_dest += dest->pDrawable->x;
commit 84e0d5d63c393fc36e91433cd7897e776e82528c
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Fri May 27 16:58:19 2016 +0900

    xfree86/modes: Assign xf86_config->cursor in xf86_load_cursor_image v2
    
    Fixes a crash on startup in the radeon driver's drmmode_show_cursor()
    due to xf86_config->cursor == NULL, because no CRTC was enabled yet, so
    xf86_crtc_load_cursor_image was never called.
    
    (Also use scrn->pScreen instead of xf86ScrnToScreen(scrn))
    
    v2: Set xf86_config->cursor at the beginning of xf86_load_cursor_image
        instead of at the end.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index b737268..351777b 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -456,7 +456,6 @@ xf86_crtc_load_cursor_image(xf86CrtcPtr crtc, CARD8 *src)
     CARD8 *cursor_image;
     const Rotation rotation = xf86_crtc_cursor_rotation(crtc);
 
-    xf86_config->cursor = xf86CurrentCursor(xf86ScrnToScreen(scrn));
     crtc->cursor_argb = FALSE;
 
     if (rotation == RR_Rotate_0)
@@ -493,6 +492,7 @@ xf86_load_cursor_image(ScrnInfoPtr scrn, unsigned char *src)
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
     int c;
 
+    xf86_config->cursor = xf86CurrentCursor(scrn->pScreen);
     for (c = 0; c < xf86_config->num_crtc; c++) {
         xf86CrtcPtr crtc = xf86_config->crtc[c];
 


More information about the xorg-commit mailing list