With the latest git for xserver and the latest git for savage, an
attempt to start up crashes the server unless this patch is applied. It
seems that an explicit xf86CrtcConfigInit() is now required in the
PreInit stage of the driver setup. I found via valgrind that the absence
of this call causes several invalid reads, but only the one triggered by
DRIFinishScreenInit() actually crashes the server on startup. Grepping
through the git code, only xf86-video-intel, xf86-video-ati,
xf86-video-nv and xf86-video-siliconmotion have this call in their code.
Does this mean that any other driver that tries to init DRI will crash
in the same way with latest xserver?
Changelog:
* Add missing xf86CrtcConfigInit in SavagePreInit. Fixes a crash on
startup with latest xserver git.
--
perl -e '$x=2.4;print sprintf("%.0f + %.0f = %.0f\n",$x,$x,$x+$x);'
>From 9d7b0817f754fb5c03ef1af60443de3943ebd0a3 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Alex=20Villac=C3=ADs=20Lasso?= <[email protected]>
Date: Mon, 12 Jan 2009 23:56:12 -0500
Subject: [PATCH] Add missing xf86CrtcConfigInit call on SavagePreInit. Fixes server crash on startup with latest xserver git.
---
src/savage_driver.c | 14 ++++++++++++++
src/savage_driver.h | 1 +
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/src/savage_driver.c b/src/savage_driver.c
index da472e9..d2954c3 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -1249,6 +1249,18 @@ static void SavageGetPanelInfo(ScrnInfoPtr pScrn)
}
}
+static Bool
+SavageCRTCResize(ScrnInfoPtr scrn, int width, int height)
+{
+ scrn->virtualX = width;
+ scrn->virtualY = height;
+ return TRUE;
+}
+
+static const xf86CrtcConfigFuncsRec SavageCRTCResizeFuncs = {
+ SavageCRTCResize
+};
+
static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
{
@@ -1888,6 +1900,8 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
/* Add more options here. */
+ /* Allocate an xf86CrtcConfig */
+ xf86CrtcConfigInit (pScrn, &SavageCRTCResizeFuncs);
psav = SAVPTR(pScrn);
psav->IsSecondary = FALSE;
diff --git a/src/savage_driver.h b/src/savage_driver.h
index c47b472..1db429a 100644
--- a/src/savage_driver.h
+++ b/src/savage_driver.h
@@ -65,6 +65,7 @@
#include "xaa.h"
#include "exa.h"
#include "xf86xv.h"
+#include "xf86Crtc.h"
#include "savage_regs.h"
#include "savage_vbe.h"
--
1.6.0.6
_______________________________________________
xorg mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/xorg