xf86-video-geode: fix GPIO probing and RandR init
authorOtavio Salvador <otavio@ossystems.com.br>
Sat, 23 May 2009 01:14:04 +0000 (22:14 -0300)
committerOtavio Salvador <otavio@ossystems.com.br>
Sun, 24 May 2009 22:09:42 +0000 (19:09 -0300)
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
recipes/xorg-driver/xf86-video-geode/0001-probe-GPIO-device-before-asking-for-base_addr.patch [new file with mode: 0644]
recipes/xorg-driver/xf86-video-geode/0002-GX-fix-RandR-to-properly-use-dixSetPrivate.patch [new file with mode: 0644]
recipes/xorg-driver/xf86-video-geode_2.11.2.bb

diff --git a/recipes/xorg-driver/xf86-video-geode/0001-probe-GPIO-device-before-asking-for-base_addr.patch b/recipes/xorg-driver/xf86-video-geode/0001-probe-GPIO-device-before-asking-for-base_addr.patch
new file mode 100644 (file)
index 0000000..af267ba
--- /dev/null
@@ -0,0 +1,30 @@
+From 1c70b4d2b70155558a9b5edb79a172696c16e129 Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Fri, 22 May 2009 18:02:04 -0300
+Subject: [PATCH] probe GPIO device before asking for base_addr
+
+After finding the PCI ISA device it is required to ask for the
+resources to be read, before we use the base_addr for GPIO.
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ src/geode_ddc.c |    3 +++
+ 1 files changed, 3 insertions(+), 0 deletions(-)
+
+diff --git a/src/geode_ddc.c b/src/geode_ddc.c
+index 2533488..086dbb1 100644
+--- a/src/geode_ddc.c
++++ b/src/geode_ddc.c
+@@ -72,6 +72,9 @@ geode_gpio_iobase(void)
+     if (pci == NULL)
+       return 0;
++    if (pci_device_probe(pci) != 0)
++        return 0;
++
+     /* The GPIO I/O address is in resource 1 */
+     return (unsigned short)pci->regions[1].base_addr;
+ #else
+-- 
+1.6.3.1.54.g99dd
+
diff --git a/recipes/xorg-driver/xf86-video-geode/0002-GX-fix-RandR-to-properly-use-dixSetPrivate.patch b/recipes/xorg-driver/xf86-video-geode/0002-GX-fix-RandR-to-properly-use-dixSetPrivate.patch
new file mode 100644 (file)
index 0000000..7408473
--- /dev/null
@@ -0,0 +1,56 @@
+From 312b5ad7a3e1f92abaa113c3e72c8da5cb3e6cb0 Mon Sep 17 00:00:00 2001
+From: Otavio Salvador <otavio@ossystems.com.br>
+Date: Fri, 22 May 2009 20:40:16 -0300
+Subject: [PATCH 2/2] [GX] fix RandR to properly use dixSetPrivate
+
+Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
+---
+ src/gx_randr.c |   13 +++----------
+ 1 files changed, 3 insertions(+), 10 deletions(-)
+
+diff --git a/src/gx_randr.c b/src/gx_randr.c
+index 6cdd244..68e1dbd 100644
+--- a/src/gx_randr.c
++++ b/src/gx_randr.c
+@@ -57,18 +57,13 @@ typedef struct _GXRandRInfo
+ #define AMD_OLDPRIV (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4)
+-#if AMD_OLDPRIV
+-
+ static int GXRandRIndex;
++#if AMD_OLDPRIV
+ #define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[GXRandRIndex].ptr)
+ #else
+-
+-static DevPrivateKey GXRandRKey;
+-
+ #define XF86RANDRINFO(p) ((XF86RandRInfoPtr) \
+-                        dixLookupPrivate(&(p)->devPrivates, GXRandRKey));
+-
++                        dixLookupPrivate(&(p)->devPrivates, GXRandRIndex));
+ #endif
+ static int
+@@ -333,8 +328,6 @@ GXRandRInit(ScreenPtr pScreen, int rotation)
+     }
+ #if AMD_OLDPRIV
+     GXRandRIndex = AllocateScreenPrivateIndex();
+-#else
+-    GXRandRKey = &GXRandRKey;
+ #endif
+     pRandr = xcalloc(sizeof(XF86RandRInfoRec), 1);
+@@ -363,7 +356,7 @@ GXRandRInit(ScreenPtr pScreen, int rotation)
+ #if AMD_OLDPRIV
+     pScreen->devPrivates[GXRandRIndex].ptr = pRandr;
+ #else
+-    dixSetPrivate(&pScreen->devPrivates, GXRandRKey, pRandr);
++    dixSetPrivate(&pScreen->devPrivates, &GXRandRIndex, pRandr);
+ #endif
+     return TRUE;
+ }
+-- 
+1.6.3.1.54.g99dd
+
index 380ce2e..5f1cc3a 100644 (file)
@@ -1,5 +1,10 @@
 require xorg-driver-video.inc
 PE = "1"
+PR = "r1"
 
 COMPATIBLE_HOST = 'i.86.*-linux'
 DESCRIPTION = "X.org server -- Geode GX2/LX display driver"
+
+SRC_URI += "file://0001-probe-GPIO-device-before-asking-for-base_addr.patch;patch=1 \
+            file://0002-GX-fix-RandR-to-properly-use-dixSetPrivate.patch;patch=1 \
+           "