xserver: Branch 'master' - 2 commits

Michel Dänzer daenzer at kemper.freedesktop.org
Mon Jun 5 09:33:16 UTC 2017


 glamor/glamor_utils.h        |    4 ++--
 hw/xfree86/man/xorg.conf.man |    5 +++++
 hw/xfree86/modes/xf86Crtc.c  |    4 ++++
 3 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 7c88977d338a01aca866e52c9e736f8857fb9ae4
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Fri May 26 12:30:13 2017 +0900

    glamor: Store the actual EGL/GLX context pointer in lastGLContext
    
    Fixes subtle breakage which could sometimes trigger after a server reset
    with multiple screens using glamor:
    
    Screen A enters glamor_close_screen last and calls various cleanup
    functions, which at some point call glamor_make_current to make sure
    screen A's GL context is current. This sets lastGLContext to screen A's
    &glamor_priv->ctx. Finally, glamor_close_screen calls
    glamor_release_screen_priv, which calls free(glamor_priv).
    
    Later, screen B enters glamor_init, which allocates a new glamor_priv.
    With bad luck, this can return the same pointer which was previously
    used for screen A's glamor_priv. So when screen B's glamor_init calls
    glamor_make_current, lastGLContext == &glamor_priv->ctx, so MakeCurrent
    isn't called for screen B's GL context, and the following OpenGL API
    calls triggered by glamor_init mess up screen A's GL context.
    
    The observed end result of this was a crash in glamor_get_vbo_space
    because glamor_priv->vbo didn't match the GL context, though there might
    be other possible outcomes.
    
    Assigning the actual GL context pointer to lastGLContext prevents this
    by preventing the false negative test in glamor_make_current.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Eric Anholt <eric at anholt.net>

diff --git a/glamor/glamor_utils.h b/glamor/glamor_utils.h
index 6b88527e6..a35917c37 100644
--- a/glamor/glamor_utils.h
+++ b/glamor/glamor_utils.h
@@ -723,8 +723,8 @@ glamor_is_large_pixmap(PixmapPtr pixmap)
 static inline void
 glamor_make_current(glamor_screen_private *glamor_priv)
 {
-    if (lastGLContext != &glamor_priv->ctx) {
-        lastGLContext = &glamor_priv->ctx;
+    if (lastGLContext != glamor_priv->ctx.ctx) {
+        lastGLContext = glamor_priv->ctx.ctx;
         glamor_priv->ctx.make_current(&glamor_priv->ctx);
     }
 }
commit d164c10850609c96fd46c8441efd40940b06dfe0
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Thu May 25 16:19:35 2017 +0900

    xfree86: Add Option "PreferCloneMode"
    
    When the default behaviour was changed from clone mode to horizontal
    extended layout, a boolean ScrnInfoRec member preferClone was introduced
    to choose the old default behaviour. Option "PreferCloneMode" allows
    setting this preferClone member.
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/hw/xfree86/man/xorg.conf.man b/hw/xfree86/man/xorg.conf.man
index 0c39062e6..ec8d07c65 100644
--- a/hw/xfree86/man/xorg.conf.man
+++ b/hw/xfree86/man/xorg.conf.man
@@ -1495,6 +1495,11 @@ option.
 .BI "Option \*qModeDebug\*q \*q" boolean \*q
 Enable printing of additional debugging information about modesetting to
 the server log.
+.TP 7
+.BI "Option \*qPreferCloneMode\*q \*q" boolean \*q
+If enabled, bring up monitors of a screen in clone mode instead of horizontal
+extended layout by default. (Defaults to off; the video driver can change the
+default value, but this option can always override it)
 .ig
 .TP 7
 This optional entry allows an IRQ number to be specified.
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 3f9857b4a..fa404d9d4 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -469,10 +469,12 @@ static OptionInfoRec xf86OutputOptions[] = {
 
 enum {
     OPTION_MODEDEBUG,
+    OPTION_PREFER_CLONEMODE,
 };
 
 static OptionInfoRec xf86DeviceOptions[] = {
     {OPTION_MODEDEBUG, "ModeDebug", OPTV_BOOLEAN, {0}, FALSE},
+    {OPTION_PREFER_CLONEMODE, "PreferCloneMode", OPTV_BOOLEAN, {0}, FALSE},
     {-1, NULL, OPTV_NONE, {0}, FALSE},
 };
 
@@ -2134,6 +2136,8 @@ xf86TargetRightOf(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
     Bool has_tile = FALSE;
     uint32_t configured_outputs;
 
+    xf86GetOptValBool(config->options, OPTION_PREFER_CLONEMODE,
+                      &scrn->preferClone);
     if (scrn->preferClone)
         return FALSE;
 


More information about the xorg-commit mailing list