Date: Thursday, March 26, 2015 @ 08:44:24 Author: tpowa Revision: 234950
upgpkg: xf86-video-r128 6.9.2-5 fix segfaults and autodetection of VGA ports Added: xf86-video-r128/trunk/0001-Fix-allocation-of-private-entity.patch xf86-video-r128/trunk/0001-Look-for-VGA-ports-in-the-VBIOS.patch xf86-video-r128/trunk/0001-Update-bitmasks-for-DDC.patch xf86-video-r128/trunk/exa.patch Modified: xf86-video-r128/trunk/PKGBUILD ---------------------------------------------+ 0001-Fix-allocation-of-private-entity.patch | 83 ++++++++++++++++++++++++++ 0001-Look-for-VGA-ports-in-the-VBIOS.patch | 57 +++++++++++++++++ 0001-Update-bitmasks-for-DDC.patch | 59 ++++++++++++++++++ PKGBUILD | 23 +++++-- exa.patch | 40 ++++++++++++ 5 files changed, 258 insertions(+), 4 deletions(-) Added: 0001-Fix-allocation-of-private-entity.patch =================================================================== --- 0001-Fix-allocation-of-private-entity.patch (rev 0) +++ 0001-Fix-allocation-of-private-entity.patch 2015-03-26 07:44:24 UTC (rev 234950) @@ -0,0 +1,83 @@ +From bae1922f1a38e51633644cf65d2c6f8c73490d12 Mon Sep 17 00:00:00 2001 +From: Connor Behan <[email protected]> +Date: Thu, 12 Mar 2015 17:18:13 -0400 +Subject: [PATCH] Fix allocation of private entity + +In the past, pR128Ent was only used for Xinerama-style dualhead and +therefore only allocated for cards with two outputs. However, recent +patches have repurposed pR128Ent as a general struct for things that are +card-specific instead of instance-specific. It therefore needs to be +allocated for all cards. + +Signed-off-by: Connor Behan <[email protected]> +--- + src/r128_probe.c | 32 +++++++++++++++----------------- + 1 file changed, 15 insertions(+), 17 deletions(-) + +diff --git a/src/r128_probe.c b/src/r128_probe.c +index 9771d52..0fd31c6 100644 +--- a/src/r128_probe.c ++++ b/src/r128_probe.c +@@ -234,6 +234,7 @@ r128_get_scrninfo(int entity_num) + { + ScrnInfoPtr pScrn = NULL; + EntityInfoPtr pEnt; ++ DevUnion* pPriv; + + pScrn = xf86ConfigPciEntity(pScrn, 0, entity_num, R128PciChipsets, + NULL, +@@ -261,6 +262,20 @@ r128_get_scrninfo(int entity_num) + + pEnt = xf86GetEntityInfo(entity_num); + ++ /* Allocate private entity used for convenience with one or two heads. */ ++ if (gR128EntityIndex < 0) { ++ gR128EntityIndex = xf86AllocateEntityPrivateIndex(); ++ pPriv = xf86GetEntityPrivate(pScrn->entityList[0], gR128EntityIndex); ++ ++ if (!pPriv->ptr) { ++ R128EntPtr pR128Ent; ++ pPriv->ptr = xnfcalloc(sizeof(R128EntRec), 1); ++ pR128Ent = pPriv->ptr; ++ pR128Ent->HasSecondary = FALSE; ++ pR128Ent->IsSecondaryRestored = FALSE; ++ } ++ } ++ + /* mobility cards support Dual-Head, mark the entity as sharable*/ + if (pEnt->chipset == PCI_CHIP_RAGE128LE || + pEnt->chipset == PCI_CHIP_RAGE128LF || +@@ -268,7 +283,6 @@ r128_get_scrninfo(int entity_num) + pEnt->chipset == PCI_CHIP_RAGE128ML) + { + static int instance = 0; +- DevUnion* pPriv; + + xf86SetEntitySharable(entity_num); + +@@ -276,22 +290,6 @@ r128_get_scrninfo(int entity_num) + pScrn->entityList[0], + instance); + +- if (gR128EntityIndex < 0) +- { +- gR128EntityIndex = xf86AllocateEntityPrivateIndex(); +- +- pPriv = xf86GetEntityPrivate(pScrn->entityList[0], +- gR128EntityIndex); +- +- if (!pPriv->ptr) +- { +- R128EntPtr pR128Ent; +- pPriv->ptr = xnfcalloc(sizeof(R128EntRec), 1); +- pR128Ent = pPriv->ptr; +- pR128Ent->HasSecondary = FALSE; +- pR128Ent->IsSecondaryRestored = FALSE; +- } +- } + instance++; + } + +-- +2.3.2 + Added: 0001-Look-for-VGA-ports-in-the-VBIOS.patch =================================================================== --- 0001-Look-for-VGA-ports-in-the-VBIOS.patch (rev 0) +++ 0001-Look-for-VGA-ports-in-the-VBIOS.patch 2015-03-26 07:44:24 UTC (rev 234950) @@ -0,0 +1,57 @@ +From bd8f067e559bab3bba187a0aa905a0ebd3f957c2 Mon Sep 17 00:00:00 2001 +From: Connor Behan <[email protected]> +Date: Mon, 16 Mar 2015 18:53:04 -0400 +Subject: [PATCH] Look for VGA ports in the VBIOS + +It appears that not all r128 chipsets marked as DFP capable have DVI +ports. Some have VGA which we should detect. The old driver "detected" +this by attempting a DVI based probe for monitors. Anything that failed +this was assumed to be VGA. + +Signed-off-by: Connor Behan <[email protected]> +--- + src/r128_output.c | 20 +++++++++++++++++++- + 1 file changed, 19 insertions(+), 1 deletion(-) + +diff --git a/src/r128_output.c b/src/r128_output.c +index 0160880..c042c98 100644 +--- a/src/r128_output.c ++++ b/src/r128_output.c +@@ -400,6 +400,24 @@ void R128SetupGenericConnectors(ScrnInfoPtr pScrn, R128OutputType *otypes) + otypes[1] = OUTPUT_VGA; + } + ++void R128GetConnectorInfoFromBIOS(ScrnInfoPtr pScrn, R128OutputType *otypes) ++{ ++ R128InfoPtr info = R128PTR(pScrn); ++ uint16_t bios_header; ++ int offset; ++ ++ /* XXX: Currently, this function only finds VGA ports misidentified as DVI. */ ++ if (!info->VBIOS || otypes[0] != OUTPUT_DVI) return; ++ ++ bios_header = R128_BIOS16(0x48); ++ offset = R128_BIOS16(bios_header + 0x60); ++ ++ if (offset) { ++ otypes[0] = OUTPUT_VGA; ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Found CRT table, assuming VGA connector\n"); ++ } ++} ++ + Bool R128SetupConnectors(ScrnInfoPtr pScrn) + { + R128InfoPtr info = R128PTR(pScrn); +@@ -411,8 +429,8 @@ Bool R128SetupConnectors(ScrnInfoPtr pScrn) + int num_dvi = 0; + int i; + +- /* XXX: Can we make R128GetConnectorInfoFromBIOS()? */ + R128SetupGenericConnectors(pScrn, otypes); ++ R128GetConnectorInfoFromBIOS(pScrn, otypes); + + for (i = 0; i < R128_MAX_BIOS_CONNECTOR; i++) { + if (otypes[i] == OUTPUT_VGA) +-- +2.3.2 + Added: 0001-Update-bitmasks-for-DDC.patch =================================================================== --- 0001-Update-bitmasks-for-DDC.patch (rev 0) +++ 0001-Update-bitmasks-for-DDC.patch 2015-03-26 07:44:24 UTC (rev 234950) @@ -0,0 +1,59 @@ +From ffa931387c627ee04292e745b4adadd4243aa122 Mon Sep 17 00:00:00 2001 +From: Connor Behan <[email protected]> +Date: Thu, 19 Mar 2015 15:48:18 -0400 +Subject: [PATCH] Update bitmasks for DDC + +A RAGE128TR chipset with a VGA port uses different i2c clock bits than +the VGA cards previously tested. It seems reasonable to assume that +other Pro2 cards are set up this way as well. In case this is incorrect, +a newly added xf86I2CProbeAddress() should still allow a monitor to be +detected. + +Signed-off-by: Connor Behan <[email protected]> +--- + src/r128_output.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/src/r128_output.c b/src/r128_output.c +index 0160880..bd418ba 100644 +--- a/src/r128_output.c ++++ b/src/r128_output.c +@@ -239,6 +239,9 @@ static R128MonitorType R128DisplayDDCConnected(xf86OutputPtr output) + + if (r128_output->type == OUTPUT_LVDS) { + return MT_LCD; ++ } else if (r128_output->type == OUTPUT_VGA && info->isPro2) { ++ mask1 = R128_GPIO_MONID_MASK_1 | R128_GPIO_MONID_MASK_2; ++ mask2 = R128_GPIO_MONID_A_1 | R128_GPIO_MONID_A_2; + } else if (r128_output->type == OUTPUT_VGA) { + mask1 = R128_GPIO_MONID_MASK_1 | R128_GPIO_MONID_MASK_3; + mask2 = R128_GPIO_MONID_A_1 | R128_GPIO_MONID_A_3; +@@ -268,6 +271,9 @@ static R128MonitorType R128DisplayDDCConnected(xf86OutputPtr output) + else + MonType = MT_CRT; + } ++ } else if (xf86I2CProbeAddress(r128_output->pI2CBus, 0x0060)) { ++ /* Just in case. */ ++ MonType = MT_CRT; + } + + return MonType; +@@ -454,8 +460,13 @@ Bool R128SetupConnectors(ScrnInfoPtr pScrn) + + if (otypes[i] != OUTPUT_LVDS && info->DDC) { + i2c.ddc_reg = R128_GPIO_MONID; +- i2c.put_clk_mask = R128_GPIO_MONID_EN_3; +- i2c.get_clk_mask = R128_GPIO_MONID_Y_3; ++ if (otypes[i] == OUTPUT_VGA && info->isPro2) { ++ i2c.put_clk_mask = R128_GPIO_MONID_EN_2; ++ i2c.get_clk_mask = R128_GPIO_MONID_Y_2; ++ } else { ++ i2c.put_clk_mask = R128_GPIO_MONID_EN_3; ++ i2c.get_clk_mask = R128_GPIO_MONID_Y_3; ++ } + if (otypes[i] == OUTPUT_VGA) { + i2c.put_data_mask = R128_GPIO_MONID_EN_1; + i2c.get_data_mask = R128_GPIO_MONID_Y_1; +-- +2.3.2 + Modified: PKGBUILD =================================================================== --- PKGBUILD 2015-03-26 00:09:37 UTC (rev 234949) +++ PKGBUILD 2015-03-26 07:44:24 UTC (rev 234950) @@ -3,7 +3,7 @@ pkgname=xf86-video-r128 pkgver=6.9.2 -pkgrel=4 +pkgrel=5 pkgdesc="X.org ati Rage128 video driver" arch=(i686 x86_64) url="http://xorg.freedesktop.org/" @@ -13,13 +13,28 @@ conflicts=('xorg-server<1.16' 'X-ABI-VIDEODRV_VERSION<19' 'X-ABI-VIDEODRV_VERSION>=20') optdepends=('r128-dri: DRI1 support from community repo') groups=('xorg-drivers' 'xorg') -source=(${url}/releases/individual/driver/${pkgname}-${pkgver}.tar.bz2 git-fixes.patch) -sha256sums=('8b2d295f1842d07304a75da1cfb9bf139b320a6539970eaf8d5ecc010cd36ee0' - '2139a1d3b12950f452b72f4d9b916143814789df5080cee03a1e0955421b1808') +source=(${url}/releases/individual/driver/${pkgname}-${pkgver}.tar.bz2 + git-fixes.patch + exa.patch + 0001-Fix-allocation-of-private-entity.patch + 0001-Look-for-VGA-ports-in-the-VBIOS.patch + 0001-Update-bitmasks-for-DDC.patch) +md5sums=('2e906d856a1c477bde000254b142445c' + '4f1b508b64dd0435f1ab85c043bd531d' + 'de1c99f8697c25d0d07cc31754d31a4e' + '1fe6389478461b71704f66161a1d3a91' + '086aba37a33d624bd83686fb190639b2' + '6d8bbf5c7f77596d7df040b14b542806') prepare() { cd ${pkgname}-${pkgver} patch -Np1 -i ../git-fixes.patch + # fixes for r128 with VGA port, pushed upstream by Connor Behan + # tested by Tobias Powalowski + patch -Np1 -i ../exa.patch + patch -Np1 -i ../0001-Fix-allocation-of-private-entity.patch + patch -Np1 -i ../0001-Look-for-VGA-ports-in-the-VBIOS.patch + patch -Np1 -i ../0001-Update-bitmasks-for-DDC.patch autoreconf -fi } Added: exa.patch =================================================================== --- exa.patch (rev 0) +++ exa.patch 2015-03-26 07:44:24 UTC (rev 234950) @@ -0,0 +1,40 @@ +From bfff401440c5bb72fb1ce90c804f3a5623d733b0 Mon Sep 17 00:00:00 2001 +From: Connor Behan <[email protected]> +Date: Mon, 2 Mar 2015 16:15:16 -0500 +Subject: Make it easier to find EXA + +As of commit e31564e1a21e73f4d20d6471da4fc7a9b63e4062, the xserver is +more picky about the order in which headers are included. We need to +account for this in order for the compile time exa.h check to succeed. + +Signed-off-by: Connor Behan <[email protected]> + +diff --git a/configure.ac b/configure.ac +index 3cc3113..7b461c6 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -121,12 +121,7 @@ CPPFLAGS="$CPPFLAGS $XORG_CFLAGS" + AC_MSG_CHECKING([whether to enable EXA support]) + if test "x$EXA" = xyes; then + AC_MSG_RESULT(yes) +- +- SAVE_CPPFLAGS="$CPPFLAGS" +- CPPFLAGS="$CPPFLAGS $XORG_CFLAGS" +- AC_CHECK_HEADER(exa.h, +- [have_exa_h="yes"], [have_exa_h="no"]) +- CPPFLAGS="$SAVE_CPPFLAGS" ++ AC_CHECK_FILE(${sdkdir}/exa.h, [have_exa_h="yes"], [have_exa_h="no"]) + else + AC_MSG_RESULT(no) + fi +@@ -136,6 +131,7 @@ CPPFLAGS="$CPPFLAGS $XORG_CFLAGS" + if test "x$have_exa_h" = xyes; then + AC_MSG_CHECKING([whether EXA version is at least 2.0.0]) + AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ ++#include "xorg-server.h" + #include "exa.h" + #if EXA_VERSION_MAJOR < 2 + #error OLD EXA! +-- +cgit v0.10.2 +
