xserver: Branch 'master' - 3 commits

Adam Jackson ajax at kemper.freedesktop.org
Mon Sep 21 09:14:24 PDT 2015


 hw/kdrive/ephyr/ephyr.c       |   12 +-----------
 hw/kdrive/ephyr/ephyrdriext.c |    4 ++--
 hw/kdrive/ephyr/ephyrglxext.c |    2 +-
 hw/kdrive/ephyr/ephyrinit.c   |    2 +-
 hw/kdrive/ephyr/hostx.c       |   26 ++++++++++++++++++--------
 hw/kdrive/ephyr/hostx.h       |    2 +-
 6 files changed, 24 insertions(+), 24 deletions(-)

New commits:
commit a579e6ba7763749d51d16e3a54941e06939df07a
Author: Ian Scott <ian.scott at arteris.com>
Date:   Thu May 21 16:13:12 2015 -0700

    Xephyr: Paint with subimage for non-Glamor & non-XSHM case
    
    This improves the case for when we paint an area without SHM.
    xcb_image_subimage() is used to create a subimage for the damaged area, which
    is converted to native format if necessary.
    
    Signed-off-by: Ian Scott <ian.scott at arteris.com>
    Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 5406938..3991c51 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -1047,11 +1047,13 @@ hostx_paint_rect(KdScreenInfo *screen,
                           sx, sy, dx, dy, width, height, FALSE);
     }
     else {
-        /* This is slow and could be done better */
-        xcb_image_t *img = xcb_image_native (HostX.conn, scrpriv->ximg, 1);
-        xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, img, 0, 0, 0);
-        if (scrpriv->ximg != img)
+        xcb_image_t *subimg = xcb_image_subimage(scrpriv->ximg, sx, sy,
+                                                 width, height, 0, 0, 0);
+        xcb_image_t *img = xcb_image_native(HostX.conn, subimg, 1);
+        xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, img, dx, dy, 0);
+        if (subimg != img)
             xcb_image_destroy(img);
+        xcb_image_destroy(subimg);
     }
 
     xcb_aux_sync(HostX.conn);
commit a6c0564f7f00aa66fd19180f75b6b09904444f06
Author: Laércio de Sousa <laerciosousa at sme-mogidascruzes.sp.gov.br>
Date:   Mon Mar 23 10:58:03 2015 -0300

    ephyr: move host_has_extension() implementation to hostx.c
    
    This is a trivial patch that moves host_has_extension() implementation
    from ephyr.c to hostx.c so that it can be called by hostx.c internal
    functions. Also rename function to hostx_has_extension() for consistency.
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Laércio de Sousa <laerciosousa at sme-mogidascruzes.sp.gov.br>

diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index e6e72d3..1909a06 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -71,16 +71,6 @@ Bool EphyrWantResize = 0;
 Bool EphyrWantNoHostGrab = 0;
 
 Bool
-host_has_extension(xcb_extension_t *extension)
-{
-    const xcb_query_extension_reply_t *rep;
-
-    rep = xcb_get_extension_data(hostx_get_xcbconn(), extension);
-
-    return rep && rep->present;
-}
-
-Bool
 ephyrInitialize(KdCardInfo * card, EphyrPriv * priv)
 {
     OsSignal(SIGUSR1, hostx_handle_signal);
@@ -670,7 +660,7 @@ ephyrInitScreen(ScreenPtr pScreen)
     }
 #endif /*XV*/
 #ifdef XF86DRI
-    if (!ephyrNoDRI && !host_has_extension(&xcb_xf86dri_id)) {
+    if (!ephyrNoDRI && !hostx_has_extension(&xcb_xf86dri_id)) {
         EPHYR_LOG("host x does not support DRI. Disabling DRI forwarding\n");
         ephyrNoDRI = TRUE;
     }
diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c
index 748b608..3703adf 100644
--- a/hw/kdrive/ephyr/ephyrdriext.c
+++ b/hw/kdrive/ephyr/ephyrdriext.c
@@ -1321,12 +1321,12 @@ ephyrDRIExtensionInit(ScreenPtr a_screen)
     EphyrDRIScreenPrivPtr screen_priv = NULL;
 
     EPHYR_LOG("enter\n");
-    if (!host_has_extension(&xcb_xf86dri_id)) {
+    if (!hostx_has_extension(&xcb_xf86dri_id)) {
         EPHYR_LOG("host does not have DRI extension\n");
         goto out;
     }
     EPHYR_LOG("host X does have DRI extension\n");
-    if (!host_has_extension(&xcb_shape_id)) {
+    if (!hostx_has_extension(&xcb_shape_id)) {
         EPHYR_LOG("host does not have XShape extension\n");
         goto out;
     }
diff --git a/hw/kdrive/ephyr/ephyrglxext.c b/hw/kdrive/ephyr/ephyrglxext.c
index 248689e..c6d1569 100644
--- a/hw/kdrive/ephyr/ephyrglxext.c
+++ b/hw/kdrive/ephyr/ephyrglxext.c
@@ -84,7 +84,7 @@ ephyrHijackGLXExtension(void)
 {
     const void *(*dispatch_functions)[2];
 
-    if (!host_has_extension(&xcb_glx_id)) {
+    if (!hostx_has_extension(&xcb_glx_id)) {
         EPHYR_LOG("host X does not have GLX\n");
         return FALSE;
     }
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index dc265d5..5406938 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -99,6 +99,16 @@ int ephyrResNameFromCmd = 0;
 char *ephyrTitle = NULL;
 Bool ephyr_glamor = FALSE;
 
+Bool
+hostx_has_extension(xcb_extension_t *extension)
+{
+    const xcb_query_extension_reply_t *rep;
+
+    rep = xcb_get_extension_data(HostX.conn, extension);
+
+    return rep && rep->present;
+}
+
 static void
  hostx_set_fullscreen_hint(void);
 
@@ -240,7 +250,7 @@ hostx_get_output_geometry(const char *output,
     xcb_randr_get_crtc_info_reply_t *crtc_info_r;
 
     /* First of all, check for extension */
-    if (!xcb_get_extension_data(HostX.conn, &xcb_randr_id)->present)
+    if (!hostx_has_extension(&xcb_randr_id))
     {
         fprintf(stderr, "\nHost X server does not support RANDR extension (or it's disabled).\n");
         exit(1);
@@ -422,7 +432,6 @@ hostx_init(void)
     char *tmpstr;
     char *class_hint;
     size_t class_len;
-    const xcb_query_extension_reply_t *shm_rep;
     xcb_screen_t *xscreen;
     xcb_rectangle_t rect = { 0, 0, 1, 1 };
 
@@ -632,8 +641,7 @@ hostx_init(void)
     }
 
     /* Try to get share memory ximages for a little bit more speed */
-    shm_rep = xcb_get_extension_data(HostX.conn, &xcb_shm_id);
-    if (!shm_rep || !shm_rep->present || getenv("XEPHYR_NO_SHM")) {
+    if (!hostx_has_extension(&xcb_shm_id) || getenv("XEPHYR_NO_SHM")) {
         fprintf(stderr, "\nXephyr unable to use SHM XImages\n");
         HostX.have_shm = FALSE;
     }
diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h
index 93aaa50..9299e8d 100644
--- a/hw/kdrive/ephyr/hostx.h
+++ b/hw/kdrive/ephyr/hostx.h
@@ -182,7 +182,7 @@ int hostx_set_window_geometry(int a_win, EphyrBox * a_geo);
 int hostx_set_window_bounding_rectangles(int a_window,
                                          EphyrRect * a_rects, int a_num_rects);
 
-int host_has_extension(xcb_extension_t *extension);
+int hostx_has_extension(xcb_extension_t *extension);
 
 #ifdef XF86DRI
 int hostx_lookup_peer_window(void *a_local_window,
commit 9414ba3683231afe9bee0f941c53998dea218615
Author: Jürg Billeter <j at bitron.ch>
Date:   Sun Feb 8 11:34:18 2015 +0100

    ephyr: fix -no-host-grab argument processing
    
    Signed-off-by: Jürg Billeter <j at bitron.ch>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c
index 8fbaf1d..d86baf2 100644
--- a/hw/kdrive/ephyr/ephyrinit.c
+++ b/hw/kdrive/ephyr/ephyrinit.c
@@ -367,7 +367,7 @@ ddxProcessArgument(int argc, char **argv, int i)
     /* end Xnest compat */
     else if (!strcmp(argv[i], "-no-host-grab")) {
         EphyrWantNoHostGrab = 1;
-        return 2;
+        return 1;
     }
 
     return KdProcessArgument(argc, argv, i);


More information about the xorg-commit mailing list