xserver: Branch 'master' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 27 21:18:42 UTC 2022


 hw/kdrive/ephyr/ephyr.c |    8 +++++---
 hw/kdrive/ephyr/hostx.c |    7 ++++---
 hw/kdrive/ephyr/hostx.h |    3 ++-
 3 files changed, 11 insertions(+), 7 deletions(-)

New commits:
commit cf30498fb8f1da11912e7abc4e44975cd2f4c61b
Author: Adam Jackson <ajax at redhat.com>
Date:   Wed Feb 9 00:33:10 2022 -0500

    ephyr: Sync even less in ephyrInternalDamageRedisplay
    
    If we have multiple damage rects we would sync (if we would sync) after
    every hostx_paint_rect. For shm images you'd rather push all the
    ShmPutImage requests and wait after the last one.
    
          before                  after   Operation
    ------------   --------------------   -------------------------
     232000000.0    240000000.0 (1.034)   Dot
      41500000.0     41400000.0 (0.998)   1x1 rectangle
      11400000.0     11400000.0 (1.000)   10x10 rectangle
        553000.0       553000.0 (1.000)   100x100 rectangle
         37300.0        38500.0 (1.032)   500x500 rectangle
        831000.0      1140000.0 (1.372)   PutImage 10x10 square
         65200.0       134000.0 (2.055)   PutImage 100x100 square
          3410.0         3500.0 (1.026)   PutImage 500x500 square
        810000.0      1150000.0 (1.420)   ShmPutImage 10x10 square
        346000.0       364000.0 (1.052)   ShmPutImage 100x100 square
         22400.0        22800.0 (1.018)   ShmPutImage 500x500 square
    
    Reviewed-by: Emma Anholt <emma at anholt.net>

diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index 9236252b2..8b90584be 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -298,7 +298,7 @@ ephyrShadowUpdate(ScreenPtr pScreen, shadowBufPtr pBuf)
      * pBuf->pDamage  regions
      */
     shadowUpdateRotatePacked(pScreen, pBuf);
-    hostx_paint_rect(screen, 0, 0, 0, 0, screen->width, screen->height);
+    hostx_paint_rect(screen, 0, 0, 0, 0, screen->width, screen->height, TRUE);
 }
 
 static void
@@ -328,7 +328,8 @@ ephyrInternalDamageRedisplay(ScreenPtr pScreen)
                 hostx_paint_rect(screen,
                                  pbox->x1, pbox->y1,
                                  pbox->x1, pbox->y1,
-                                 pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
+                                 pbox->x2 - pbox->x1, pbox->y2 - pbox->y1,
+                                 nbox == 0);
                 pbox++;
             }
         }
@@ -889,7 +890,8 @@ ephyrProcessExpose(xcb_generic_event_t *xev)
     if (scrpriv) {
         hostx_paint_rect(scrpriv->screen, 0, 0, 0, 0,
                          scrpriv->win_width,
-                         scrpriv->win_height);
+                         scrpriv->win_height,
+                         TRUE);
     } else {
         EPHYR_LOG_ERROR("failed to get host screen\n");
     }
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index d8ed68bfd..1dc14be38 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -1011,7 +1011,8 @@ static void hostx_paint_debug_rect(KdScreenInfo *screen,
 
 void
 hostx_paint_rect(KdScreenInfo *screen,
-                 int sx, int sy, int dx, int dy, int width, int height)
+                 int sx, int sy, int dx, int dy, int width, int height,
+                 Bool sync)
 {
     EphyrScrPriv *scrpriv = screen->driver;
 
@@ -1100,7 +1101,8 @@ hostx_paint_rect(KdScreenInfo *screen,
                           HostX.gc, scrpriv->ximg,
                           scrpriv->shminfo,
                           sx, sy, dx, dy, width, height, FALSE);
-        xcb_aux_sync(HostX.conn);
+        if (sync)
+            xcb_aux_sync(HostX.conn);
     }
     else {
         xcb_image_t *subimg = xcb_image_subimage(scrpriv->ximg, sx, sy,
diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h
index 4b2678e58..8b3caf245 100644
--- a/hw/kdrive/ephyr/hostx.h
+++ b/hw/kdrive/ephyr/hostx.h
@@ -146,7 +146,8 @@ void *hostx_screen_init(KdScreenInfo *screen,
 
 void
 hostx_paint_rect(KdScreenInfo *screen,
-                 int sx, int sy, int dx, int dy, int width, int height);
+                 int sx, int sy, int dx, int dy, int width, int height,
+                 Bool sync);
 
 Bool
 hostx_load_keymap(KeySymsPtr keySyms, CARD8 *modmap, XkbControlsPtr controls);
commit 7f8848996377bc7883ad108fa55958656330cdc1
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Feb 8 18:02:40 2022 -0500

    ephyr: Sync less in hostx_paint_rect
    
    Move the xcb_aux_sync into the shm path, where we do still need it to
    synchronize access with the host. In the non-shm path the image is
    copied to the host anyway so the sync just adds latency and keeps you
    from using all your network bandwidth.
    
    Only the non-shm-putimage path benefits from this, but the benefit is
    significant even on the local machine (here a 3.2GHz Core i7-8700, using
    XEPHYR_NO_SHM=1):
    
          before                  after   Operation
    ------------   --------------------   -------------------------
     228000000.0    225000000.0 (0.987)   Dot
      40900000.0     41600000.0 (1.017)   1x1 rectangle
      10400000.0     10700000.0 (1.029)   10x10 rectangle
        477000.0       471000.0 (0.987)   100x100 rectangle
         30900.0        31800.0 (1.029)   500x500 rectangle
        760000.0       981000.0 (1.291)   PutImage 10x10 square
         14700.0        19200.0 (1.306)   PutImage 100x100 square
           320.0          382.0 (1.194)   PutImage 500x500 square
        749000.0       984000.0 (1.314)   ShmPutImage 10x10 square
        268000.0       304000.0 (1.134)   ShmPutImage 100x100 square
         16600.0        18500.0 (1.114)   ShmPutImage 500x500 square
    
    Reviewed-by: Emma Anholt <emma at anholt.net>

diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index f9cb6980f..d8ed68bfd 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -1100,6 +1100,7 @@ hostx_paint_rect(KdScreenInfo *screen,
                           HostX.gc, scrpriv->ximg,
                           scrpriv->shminfo,
                           sx, sy, dx, dy, width, height, FALSE);
+        xcb_aux_sync(HostX.conn);
     }
     else {
         xcb_image_t *subimg = xcb_image_subimage(scrpriv->ximg, sx, sy,
@@ -1110,8 +1111,6 @@ hostx_paint_rect(KdScreenInfo *screen,
             xcb_image_destroy(img);
         xcb_image_destroy(subimg);
     }
-
-    xcb_aux_sync(HostX.conn);
 }
 
 static void


More information about the xorg-commit mailing list