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

Adam Jackson ajax at kemper.freedesktop.org
Mon Jul 21 14:16:56 PDT 2008


 glx/glxcmds.c                  |    4 ---
 glx/glxext.c                   |    9 +++++++
 hw/xfree86/common/xf86Config.c |    4 +--
 hw/xfree86/modes/xf86Crtc.c    |   51 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 62 insertions(+), 6 deletions(-)

New commits:
commit 2d6022bd4001190df97b5320dccb306a78d7ca21
Author: Kristian Høgsberg <krh at redhat.com>
Date:   Mon Jul 21 16:05:53 2008 -0400

    Need to unref pixmaps backing pbuffers too.
    (cherry picked from commit facb255fa9267e343cbc91f841f1b64e5dc99e98)

diff --git a/glx/glxext.c b/glx/glxext.c
index cd92f6d..13c65da 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -109,8 +109,12 @@ static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
 {
     ScreenPtr pScreen = glxPriv->pDraw->pScreen;
 
-    if (glxPriv->type == GLX_DRAWABLE_PIXMAP)
+    switch (glxPriv->type) {
+	case GLX_DRAWABLE_PIXMAP:
+	case GLX_DRAWABLE_PBUFFER:
 	    (*pScreen->DestroyPixmap)((PixmapPtr) glxPriv->pDraw);
+	    break;
+    }
 
     glxPriv->pDraw = NULL;
     glxPriv->drawId = 0;
commit e4cfdc07f4ef2e42762f0296936bbe776b4b7fbe
Author: Kristian Høgsberg <krh at redhat.com>
Date:   Mon Jul 21 15:28:50 2008 -0400

    Fix embarrasing GLXPixmap leak.
    (cherry picked from commit d5ae85b5b722821499d5796cf0973ecb6ec125f1)

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index dcd8352..0c2a95e 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -1223,10 +1223,6 @@ static int DoDestroyDrawable(__GLXclientState *cl, XID glxdrawable, int type)
 	}
     }
 
-    if (type == GLX_DRAWABLE_PIXMAP) {
-	((PixmapPtr) pGlxDraw->pDraw)->refcnt--;
-    }
-
     FreeResource(glxdrawable, FALSE);
 
     return Success;
diff --git a/glx/glxext.c b/glx/glxext.c
index 85d8deb..cd92f6d 100644
--- a/glx/glxext.c
+++ b/glx/glxext.c
@@ -107,6 +107,11 @@ static int ContextGone(__GLXcontext* cx, XID id)
 */
 static Bool DrawableGone(__GLXdrawable *glxPriv, XID xid)
 {
+    ScreenPtr pScreen = glxPriv->pDraw->pScreen;
+
+    if (glxPriv->type == GLX_DRAWABLE_PIXMAP)
+	    (*pScreen->DestroyPixmap)((PixmapPtr) glxPriv->pDraw);
+
     glxPriv->pDraw = NULL;
     glxPriv->drawId = 0;
     __glXUnrefDrawable(glxPriv);
commit ceffece78b828c30a144affa437cd5ae2021a342
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Fri Jun 20 23:49:32 2008 -0400

    Fix "warning: passing argument 1 of `modeIsPresent' from incompatible pointer type".
    (cherry picked from commit 95d4ede538fbb68049ba3efa0acb0e9712e5cb01)

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 8e30c84..fde3a9c 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -2418,14 +2418,14 @@ configInput(IDevPtr inputp, XF86ConfInputPtr conf_input, MessageType from)
 }
 
 static Bool
-modeIsPresent(char * modename,MonPtr monitorp)
+modeIsPresent(DisplayModePtr mode, MonPtr monitorp)
 {
     DisplayModePtr knownmodes = monitorp->Modes;
 
     /* all I can think of is a linear search... */
     while(knownmodes != NULL)
     {
-	if(!strcmp(modename,knownmodes->name) &&
+	if(!strcmp(mode->name, knownmodes->name) &&
 	   !(knownmodes->type & M_T_DEFAULT))
 	    return TRUE;
 	knownmodes = knownmodes->next;
commit 7f542ab37fe0795fa04ea647b0ff3b9b886758f6
Author: Dave Airlie <airlied at redhat.com>
Date:   Fri Jul 4 07:29:32 2008 +1000

    modes: fix initial xorg.conf mode selection.
    
    This was all kinds of broken, we ignored user preferred modes for multiple
    monitors and also for side-by-side configurations.
    (cherry picked from commit 0b9ef835a0fe900c121b84e43989591e58ab1126)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index ea452df..91ba1b7 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -997,6 +997,54 @@ xf86DefaultScreenLimits (ScrnInfoPtr scrn, int *widthp, int *heightp,
 
 #define POSITION_UNSET	-100000
 
+/*
+ * check if the user configured any outputs at all 
+ * with either a position or a relative setting or a mode.
+ */
+static Bool
+xf86UserConfiguredOutputs(ScrnInfoPtr scrn, DisplayModePtr *modes)
+{
+    xf86CrtcConfigPtr	config = XF86_CRTC_CONFIG_PTR(scrn);
+    int o;
+    Bool user_conf = FALSE;
+
+    for (o = 0; o < config->num_output; o++)
+    {
+	xf86OutputPtr output = config->output[o];
+	char	    *position;
+	char	    *relative_name;
+	OutputOpts	    relation;
+	int r;
+	static const OutputOpts	relations[] = {
+	    OPTION_BELOW, OPTION_RIGHT_OF, OPTION_ABOVE, OPTION_LEFT_OF
+	};
+
+	position = xf86GetOptValString (output->options,
+					OPTION_POSITION);
+	if (position)
+	    user_conf = TRUE;
+
+	relation = 0;
+	relative_name = NULL;
+	for (r = 0; r < 4; r++)
+	{
+	    relation = relations[r];
+	    relative_name = xf86GetOptValString (output->options,
+						     relation);
+	    if (relative_name)
+		break;
+	}
+	if (relative_name)
+	    user_conf = TRUE;
+
+	modes[o] = xf86OutputHasUserPreferredMode(output);
+	if (modes[o])
+	    user_conf = TRUE;
+    }
+
+    return user_conf;
+}
+
 static Bool
 xf86InitialOutputPositions (ScrnInfoPtr scrn, DisplayModePtr *modes)
 {
@@ -1984,6 +2032,9 @@ xf86TargetUserpref(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
 {
     int o;
 
+    if (xf86UserConfiguredOutputs(scrn, modes))
+	return xf86TargetFallback(scrn, config, modes, enabled, width, height);
+    
     for (o = -1; nextEnabledOutput(config, enabled, &o); )
 	if (xf86OutputHasUserPreferredMode(config->output[o]))
 	    return 


More information about the xorg-commit mailing list