add a few more patches for xorg-server from ubuntu

This commit is contained in:
Stephan Raue 2009-04-05 23:18:12 +02:00
parent f601c3d2b8
commit cc31d5c877
4 changed files with 186 additions and 0 deletions

View File

@ -0,0 +1,30 @@
--- xorg-server.orig/exa/exa.c 2008-10-14 23:24:44.000000000 +0200
+++ xorg-server/exa/exa.c 2008-10-14 23:25:52.000000000 +0200
@@ -882,6 +882,11 @@
dixSetPrivate(&pScreen->devPrivates, exaScreenPrivateKey, pExaScr);
pExaScr->migration = ExaMigrationAlways;
+ if (pScreenInfo->flags & EXA_MIGRATION_GREEDY) {
+ pExaScr->migration = ExaMigrationGreedy;
+ LogMessage(X_INFO, "EXA(%d): Forcing greedy migration option\n",
+ pScreen->myNum);
+ }
exaDDXDriverInit(pScreen);
--- xorg-server.orig/exa/exa.h 2008-10-14 23:24:44.000000000 +0200
+++ xorg-server/exa/exa.h 2008-10-14 23:25:52.000000000 +0200
@@ -737,6 +737,13 @@
#define EXA_TWO_BITBLT_DIRECTIONS (1 << 2)
/**
+ * EXA_MIGRATION_GREEDY indicates to EXA that the driver prefers to
+ * use the "greedy" migration heuristic. This is to work around
+ * issues with EXA on the Intel 965 chipset. (LP: #177492)
+ */
+#define EXA_MIGRATION_GREEDY (1 << 3)
+
+/**
* EXA_HANDLES_PIXMAPS indicates to EXA that the driver can handle
* all pixmap addressing and migration.
*/

View File

@ -0,0 +1,27 @@
Binary files patched/.git/index and working/.git/index differ
diff -Nurp patched/hw/xfree86/common/xf86AutoConfig.c working/hw/xfree86/common/xf86AutoConfig.c
--- patched/hw/xfree86/common/xf86AutoConfig.c 2008-10-21 09:49:35.000000000 -0700
+++ working/hw/xfree86/common/xf86AutoConfig.c 2008-10-21 09:59:08.000000000 -0700
@@ -422,6 +422,22 @@ matchDriverFromFiles (char** matches, ui
}
direntry = readdir(idsdir);
}
+ /* If we failed to find any driver, at least try 'vesa' (LP: #261977) */
+ if (matches[0] == NULL) {
+ xf86Msg(X_INFO, "No matches found for this device in %s\n", PCI_TXT_IDS_PATH);
+
+#if defined(__i386__) || defined(__amd64__) || defined(__hurd__)
+ xf86Msg(X_DEFAULT, "Registering 'vesa' as fallback\n");
+ matches[0] = xnfstrdup("vesa");
+#elif defined(__sparc__) && !defined(sun)
+ xf86Msg(X_DEFAULT, "Registering 'sunffb' as fallback\n");
+ matches[0] = xnfstrdup("sunffb");
+#else
+ xf86Msg(X_DEFAULT, "Registering 'fbdev' as fallback\n");
+ matches[0] = xnfstrdup("fbdev");
+#endif
+ }
+
end:
xfree(line);
closedir(idsdir);

View File

@ -0,0 +1,108 @@
From 69e53f2493c142ef5569af01ce52565be5b2976e Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax@redhat.com>
Date: Tue, 3 Mar 2009 10:58:33 -0500
Subject: [PATCH] Primary video device hack
---
hw/xfree86/common/xf86pciBus.c | 60 ++++++++++++++++++++++++++++++++--------
1 files changed, 48 insertions(+), 12 deletions(-)
diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c
index 467a0c3..0d2d01c 100644
--- a/hw/xfree86/common/xf86pciBus.c
+++ b/hw/xfree86/common/xf86pciBus.c
@@ -60,11 +60,7 @@ static struct pci_device ** xf86PciVideoInfo = NULL; /* PCI probe for video hw *
/* PCI classes that get included in xf86PciVideoInfo */
#define PCIINFOCLASSES(c) \
( (((c) & 0x00ff0000) == (PCI_CLASS_PREHISTORIC << 16)) \
- || (((c) & 0x00ff0000) == (PCI_CLASS_DISPLAY << 16)) \
- || ((((c) & 0x00ffff00) \
- == ((PCI_CLASS_MULTIMEDIA << 16) | (PCI_SUBCLASS_MULTIMEDIA_VIDEO << 8)))) \
- || ((((c) & 0x00ffff00) \
- == ((PCI_CLASS_PROCESSOR << 16) | (PCI_SUBCLASS_PROCESSOR_COPROC << 8)))) )
+ || (((c) & 0x00ffff00) == (PCI_CLASS_DISPLAY << 16)) )
/*
* PCI classes that have messages printed always. The others are only
@@ -341,6 +337,39 @@ restorePciBusState(BusAccPtr ptr)
}
#undef MASKBITS
+/* oh god what have i done */
+static Bool
+looks_like_bios_primary(struct pci_device *info)
+{
+ unsigned char *bios;
+ unsigned short vendor, device;
+ int offset;
+ Bool ret = FALSE;
+
+ bios = xf86MapVidMem(-1, VIDMEM_MMIO, 0xc0000, 0x10000);
+ if (!bios)
+ return FALSE;
+
+ if (bios[0] != 0x55 || bios[1] != 0xAA)
+ goto out;
+
+ offset = (bios[0x19] << 8) + bios[0x18];
+
+ if (bios[offset] != 'P' ||
+ bios[offset+1] != 'C' ||
+ bios[offset+2] != 'I' ||
+ bios[offset+3] != 'R')
+ goto out;
+
+ vendor = (bios[offset+5] << 8) + bios[offset+4];
+ device = (bios[offset+7] << 8) + bios[offset+6];
+
+ ret = (info->vendor_id == vendor) && (info->device_id == device);
+
+out:
+ xf86UnMapVidMem(-1, bios, 0x10000);
+ return ret;
+}
/*
* xf86Bus.c interface
@@ -375,24 +404,31 @@ xf86PciProbe(void)
}
}
-
/* If we haven't found a primary device try a different heuristic */
if (primaryBus.type == BUS_NONE && num) {
for (i = 0; i < num; i++) {
uint16_t command;
info = xf86PciVideoInfo[i];
+ if (!IS_VGA(info->device_class))
+ continue;
+
pci_device_cfg_read_u16(info, & command, 4);
- if ((command & PCI_CMD_MEM_ENABLE)
- && ((num == 1) || IS_VGA(info->device_class))) {
- if (primaryBus.type == BUS_NONE) {
+ if ((command & PCI_CMD_MEM_ENABLE)) {
+ if (num == 1) {
primaryBus.type = BUS_PCI;
primaryBus.id.pci = info;
- } else {
- xf86Msg(X_NOTICE,
+ break;
+ } else if (looks_like_bios_primary(info)) {
+ if (primaryBus.type == BUS_NONE) {
+ primaryBus.type = BUS_PCI;
+ primaryBus.id.pci = info;
+ } else {
+ xf86Msg(X_NOTICE,
"More than one possible primary device found\n");
- primaryBus.type ^= (BusType)(-1);
+ primaryBus.type ^= (BusType)(-1);
+ }
}
}
}
--
1.6.1.3

View File

@ -0,0 +1,21 @@
#
# Ubuntu: https://bugs.launchpad.net/bugs/353074
# Upstream: http://bugs.freedesktop.org/show_bug.cgi?id=21000
#
Index: xorg-server-1.6.0/hw/xfree86/modes/xf86EdidModes.c
===================================================================
--- xorg-server-1.6.0.orig/hw/xfree86/modes/xf86EdidModes.c 2009-04-01 19:45:23.000000000 +0200
+++ xorg-server-1.6.0/hw/xfree86/modes/xf86EdidModes.c 2009-04-01 19:45:32.000000000 +0200
@@ -155,6 +155,11 @@
DDC->vendor.prod_id == 13600)
return TRUE;
+ /* Bug #21000: LGPhilipsLCD LP154W01-TLAJ */
+ if (memcmp (DDC->vendor.name, "LPL", 4) == 0 &&
+ DDC->vendor.prod_id == 47360)
+ return TRUE;
+
return FALSE;
}