[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-modesetting: Changes to 'ubuntu'



 debian/changelog                                 |    8 +
 debian/patches/adding-platform-bus-support.patch |  141 +++++++++++++++++++++++
 debian/patches/series                            |    2 
 3 files changed, 150 insertions(+), 1 deletion(-)

New commits:
commit 1a543a01a1029f1c64e9c3d9fa5fa73b6e959cb6
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Sun Aug 26 18:38:20 2012 +0300

    release to quantal
    
    * debian/patches/adding-platform-bus-support.patch:
      - Adding platformBus support, to protect xorg on also loading the fbdev
        driver when running on ARM (mostly platform devices) (LP: #1041727)

diff --git a/debian/changelog b/debian/changelog
index 6648608..6858738 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+xserver-xorg-video-modesetting (0.4.0-0ubuntu2) quantal; urgency=low
+
+  * debian/patches/adding-platform-bus-support.patch:
+    - Adding platformBus support, to protect xorg on also loading the fbdev
+      driver when running on ARM (mostly platform devices) (LP: #1041727)
+
+ -- Ricardo Salveti de Araujo <ricardo.salveti@linaro.org>  Sun, 26 Aug 2012 00:10:21 -0300
+
 xserver-xorg-video-modesetting (0.4.0-0ubuntu1) quantal-proposed; urgency=low
 
   * Sync from unreleased debian git.
diff --git a/debian/patches/adding-platform-bus-support.patch b/debian/patches/adding-platform-bus-support.patch
new file mode 100644
index 0000000..72b4019
--- /dev/null
+++ b/debian/patches/adding-platform-bus-support.patch
@@ -0,0 +1,141 @@
+From: Dave Airlie <airlied@redhat.com>
+Subject: modesetting: add platform bus support
+Origin: upstream, http://cgit.freedesktop.org/xorg/driver/xf86-video-modesetting/commit/?id=65054df
+Bug-Ubuntu: http://bugs.launchpad.net/bugs/1041727
+
+diff --git a/src/driver.c b/src/driver.c
+index 8c3f4a4..86be277 100644
+--- a/src/driver.c
++++ b/src/driver.c
+@@ -52,6 +52,9 @@
+ #include "xf86xv.h"
+ #include <X11/extensions/Xv.h>
+ #include <xorg-server.h>
++#ifdef XSERVER_PLATFORM_BUS
++#include "xf86platformBus.h"
++#endif
+ #if XSERVER_LIBPCIACCESS
+ #include <pciaccess.h>
+ #endif
+@@ -88,6 +91,12 @@ static const struct pci_id_match ms_device_match[] = {
+ };
+ #endif
+ 
++#ifdef XSERVER_PLATFORM_BUS
++static Bool ms_platform_probe(DriverPtr driver,
++                          int entity_num, int flags, struct xf86_platform_device *device,
++			  intptr_t match_data);
++#endif
++
+ _X_EXPORT DriverRec modesetting = {
+     1,
+     "modesetting",
+@@ -99,6 +108,9 @@ _X_EXPORT DriverRec modesetting = {
+     NULL,
+     ms_device_match,
+     ms_pci_probe,
++#ifdef XSERVER_PLATFORM_BUS
++    ms_platform_probe,
++#endif
+ };
+ 
+ static SymTabRec Chipsets[] = {
+@@ -288,6 +300,40 @@ ms_pci_probe(DriverPtr driver,
+ }
+ #endif
+ 
++#ifdef XSERVER_PLATFORM_BUS
++static Bool
++ms_platform_probe(DriverPtr driver,
++              int entity_num, int flags, struct xf86_platform_device *dev, intptr_t match_data)
++{
++    ScrnInfoPtr scrn = NULL;
++    char *path = xf86_get_platform_device_attrib(dev, ODEV_ATTRIB_PATH);
++    int scr_flags = 0;
++
++    if (flags & PLATFORM_PROBE_GPU_SCREEN)
++            scr_flags = XF86_ALLOCATE_GPU_SCREEN;
++
++    if (probe_hw(path)) {
++        scrn = xf86AllocateScreen(driver, scr_flags);
++        xf86AddEntityToScreen(scrn, entity_num);
++
++        scrn->driverName = "modesetting";
++        scrn->name = "modesetting";
++        scrn->PreInit = PreInit;
++        scrn->ScreenInit = ScreenInit;
++        scrn->SwitchMode = SwitchMode;
++        scrn->AdjustFrame = AdjustFrame;
++        scrn->EnterVT = EnterVT;
++        scrn->LeaveVT = LeaveVT;
++        scrn->FreeScreen = FreeScreen;
++        scrn->ValidMode = ValidMode;
++        xf86DrvMsg(scrn->scrnIndex, X_INFO,
++                   "using drv %s\n", path ? path : "default device");
++    }
++
++    return scrn != NULL;
++}
++#endif
++
+ static Bool
+ Probe(DriverPtr drv, int flags)
+ {
+@@ -431,7 +477,7 @@ PreInit(ScrnInfoPtr pScrn, int flags)
+     rgb defaultWeight = { 0, 0, 0 };
+     EntityInfoPtr pEnt;
+     EntPtr msEnt = NULL;
+-    char *BusID, *devicename;
++    char *BusID = NULL, *devicename;
+     Bool prefer_shadow = TRUE;
+     uint64_t value = 0;
+     int ret;
+@@ -477,24 +523,32 @@ PreInit(ScrnInfoPtr pScrn, int flags)
+     pScrn->progClock = TRUE;
+     pScrn->rgbBits = 8;
+ 
+-    ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index);
+-    if (ms->PciInfo) {
+-       BusID = malloc(64);
+-       sprintf(BusID, "PCI:%d:%d:%d",
++#if XSERVER_PLATFORM_BUS
++    if (pEnt->location.type == BUS_PLATFORM) {
++            char *path = xf86_get_platform_device_attrib(pEnt->location.id.plat, ODEV_ATTRIB_PATH);
++            ms->fd = open_hw(path);
++    }
++    else 
++#endif
++    if (pEnt->location.type == BUS_PCI) {
++        ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index);
++        if (ms->PciInfo) {
++            BusID = malloc(64);
++            sprintf(BusID, "PCI:%d:%d:%d",
+ #if XSERVER_LIBPCIACCESS
+-	        ((ms->PciInfo->domain << 8) | ms->PciInfo->bus),
+-	        ms->PciInfo->dev, ms->PciInfo->func
++                    ((ms->PciInfo->domain << 8) | ms->PciInfo->bus),
++                    ms->PciInfo->dev, ms->PciInfo->func
+ #else
+-	        ((pciConfigPtr) ms->PciInfo->thisCard)->busnum,
+-	        ((pciConfigPtr) ms->PciInfo->thisCard)->devnum,
+-	        ((pciConfigPtr) ms->PciInfo->thisCard)->funcnum
++                    ((pciConfigPtr) ms->PciInfo->thisCard)->busnum,
++                    ((pciConfigPtr) ms->PciInfo->thisCard)->devnum,
++                    ((pciConfigPtr) ms->PciInfo->thisCard)->funcnum
+ #endif
+-	    );
+-
+-       ms->fd = drmOpen(NULL, BusID);
++                );
++        }
++        ms->fd = drmOpen(NULL, BusID);
+     } else {
+-       devicename = xf86FindOptionValue(ms->pEnt->device->options, "kmsdev");
+-       ms->fd = open_hw(devicename);
++        devicename = xf86FindOptionValue(ms->pEnt->device->options, "kmsdev");
++        ms->fd = open_hw(devicename);
+     }
+     if (ms->fd < 0)
+ 	return FALSE;
+-- 
+1.7.9.5
diff --git a/debian/patches/series b/debian/patches/series
index fdffa2a..d696b3b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1 @@
-# placeholder
+adding-platform-bus-support.patch


Reply to: