xserver: Branch 'server-1.19-branch' - 4 commits

Adam Jackson ajax at kemper.freedesktop.org
Thu Feb 23 19:36:57 UTC 2017


 glamor/glamor_render.c        |    4 ++++
 hw/xwayland/xwayland-cvt.c    |    7 +++++++
 hw/xwayland/xwayland-output.c |   37 ++++++++++++++++++++++++-------------
 3 files changed, 35 insertions(+), 13 deletions(-)

New commits:
commit e2243e5b805df387cb3881b2298bffaac4f02942
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Tue Jan 24 18:08:30 2017 +0100

    glamor: Two pass won't work on memory pixmaps
    
    When selecting "CA_TWO_PASS" in glamor_composite_clipped_region() when
    the hardware does not support "GL_ARB_blend_func_extended", we call
    glamor_composite_choose_shader() twice in a row, which in turn calls
    glamor_pixmap_ensure_fbo().
    
    On memory pixmaps, the first call will set the FBO and the second one
    will fail an assertion in glamor_upload_picture_to_texture() because
    the FBO is already set.
    
    Bail out earlier when the mask pixmap is in memory and the hardware
    capabilities would require to use two pass, so that the assertion is not
    failed and the rendering is correct.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99346
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>
    (cherry picked from commit 86463981361064dd0352ec215abf1696ce7fc5ea)

diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index e04dd21..52f073d 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1494,6 +1494,10 @@ glamor_composite_clipped_region(CARD8 op,
             ca_state = CA_DUAL_BLEND;
         } else {
             if (op == PictOpOver) {
+                if (glamor_pixmap_is_memory(mask_pixmap)) {
+                    glamor_fallback("two pass not supported on memory pximaps\n");
+                    goto out;
+                }
                 ca_state = CA_TWO_PASS;
                 op = PictOpOutReverse;
             }
commit ada5328290f444e3fc0e6a05557d5963dec626e5
Author: Svitozar Cherepii <razotivs at gmail.com>
Date:   Fri Feb 3 01:49:04 2017 +0200

    xwayland: Add hack for FWXGA resolution #99574
    
    For some applications (like fullscreen games) it matters for XRandr
    resolution to be correctly set and equal to root window resolution.
    
    In XServer there is already hack for this, adapted it for XWayland.
    
    Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=99574
    
    Signed-off-by: Svitozar Cherepii <razotivs at gmail.com>
    Tested-by: Svitozar Cherepii <razotivs at gmail.com>
    Acked-by: Olivier Fourdan <ofourdan at redhat.com>
    (cherry picked from commit 1c78bec9ca3cd1975a38bf5ebdba7dea65b309ab)

diff --git a/hw/xwayland/xwayland-cvt.c b/hw/xwayland/xwayland-cvt.c
index 9655e10..8564fdb 100644
--- a/hw/xwayland/xwayland-cvt.c
+++ b/hw/xwayland/xwayland-cvt.c
@@ -296,6 +296,13 @@ xwayland_cvt(int HDisplay, int VDisplay, float VRefresh, Bool Reduced,
     if (Interlaced)
         modeinfo.modeFlags |= RR_Interlace;
 
+    /* FWXGA hack adapted from hw/xfree86/modes/xf86EdidModes.c, because you can't say 1366 */
+    if (HDisplay == 1366 && VDisplay == 768) {
+         modeinfo.width = 1366;
+         modeinfo.hSyncStart--;
+         modeinfo.hSyncEnd--;
+    }
+
     snprintf(name, sizeof name, "%dx%d",
              modeinfo.width, modeinfo.height);
     modeinfo.nameLength = strlen(name);
commit abf3bc68db579eb524c2eb5786daa5a00957a2f8
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Tue Feb 7 15:31:22 2017 +0100

    xwayland: CRTC should support all rotations
    
    If the Wayland compositor sets a rotation on the output, Xwayland
    translates the transformation as an xrandr rotation for the given
    output.
    
    However, if the rotation is not supported by the CRTC, this is not
    a valid setup and xrandr queries will fail.
    
    Pretend we support all rotations and reflections so that the
    configuration remains a valid xrandr setup.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit afeace27d3818274b75d59375771dc964d2f56bb)

diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
index 150b67a..a4bc185 100644
--- a/hw/xwayland/xwayland-output.c
+++ b/hw/xwayland/xwayland-output.c
@@ -31,6 +31,12 @@
 #include <randrstr.h>
 
 #define DEFAULT_DPI 96
+#define ALL_ROTATIONS (RR_Rotate_0   | \
+                       RR_Rotate_90  | \
+                       RR_Rotate_180 | \
+                       RR_Rotate_270 | \
+                       RR_Reflect_X  | \
+                       RR_Reflect_Y)
 
 static Rotation
 wl_transform_to_xrandr(enum wl_output_transform transform)
@@ -270,6 +276,7 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id)
         ErrorF("Failed creating RandR CRTC\n");
         goto err;
     }
+    RRCrtcSetRotations (xwl_output->randr_crtc, ALL_ROTATIONS);
 
     xwl_output->randr_output = RROutputCreate(xwl_screen->screen, name,
                                               strlen(name), xwl_output);
@@ -321,7 +328,7 @@ xwl_output_remove(struct xwl_output *xwl_output)
 static Bool
 xwl_randr_get_info(ScreenPtr pScreen, Rotation * rotations)
 {
-    *rotations = 0;
+    *rotations = ALL_ROTATIONS;
 
     return TRUE;
 }
commit fd74867b8b4a4d5da80d2ff9c3eb4ae5c36df4df
Author: Olivier Fourdan <ofourdan at redhat.com>
Date:   Wed Feb 8 09:23:20 2017 +0100

    xwayland: Apply output rotation for screen size
    
    Previously, we would swap the width/height of the Xwayland output based
    on the output rotation, so that the overall screen size would match the
    actual rotation of each output.
    
    Problem is the RandR's ConstrainCursorHarder() handler will also apply
    the output rotation, meaning that when the output is rotated, the
    pointer will be constrained within the wrong dimension.
    
    Moreover, XRandR assumes the original output width/height are unchanged
    when the output is rotated, so by changing the Xwayland output width and
    height based on rotation, Xwayland causes XRandr to report the wrong
    output sizes (an output of size 1024x768 rotated left or right should
    remain 1024x768, not 768x1024).
    
    So to avoid this issue and keep things consistent between Wayland and
    Xwayland outputs, leave the actual width/height unchanged but apply the
    rotation when computing the screen size. This fixes both the output size
    being wrong in "xrandr -q" and the pointer being constrained in the
    wrong dimension with rotated with weston.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99663
    Signed-off-by: Olivier Fourdan <ofourdan at redhat.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit 058809c43ec578a407cf40d4c3e54a42503e3562)

diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c
index ef3b6f6..150b67a 100644
--- a/hw/xwayland/xwayland-output.c
+++ b/hw/xwayland/xwayland-output.c
@@ -102,14 +102,8 @@ output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags,
     if (!(flags & WL_OUTPUT_MODE_CURRENT))
         return;
 
-    if (xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) {
-        xwl_output->width = width;
-        xwl_output->height = height;
-    } else {
-        xwl_output->width = height;
-        xwl_output->height = width;
-    }
-
+    xwl_output->width = width;
+    xwl_output->height = height;
     xwl_output->refresh = refresh;
 }
 
@@ -117,11 +111,21 @@ static inline void
 output_get_new_size(struct xwl_output *xwl_output,
                     int *height, int *width)
 {
-    if (*width < xwl_output->x + xwl_output->width)
-        *width = xwl_output->x + xwl_output->width;
+    int output_width, output_height;
+
+    if (xwl_output->rotation & (RR_Rotate_0 | RR_Rotate_180)) {
+        output_width = xwl_output->width;
+        output_height = xwl_output->height;
+    } else {
+        output_width = xwl_output->height;
+        output_height = xwl_output->width;
+    }
+
+    if (*width < xwl_output->x + output_width)
+        *width = xwl_output->x + output_width;
 
-    if (*height < xwl_output->y + xwl_output->height)
-        *height = xwl_output->y + xwl_output->height;
+    if (*height < xwl_output->y + output_height)
+        *height = xwl_output->y + output_height;
 }
 
 /* Approximate some kind of mmpd (m.m. per dot) of the screen given the outputs


More information about the xorg-commit mailing list