rpms/xorg-x11-drv-geode/devel dcon.patch, NONE, 1.1 fix-memory-mapping.patch, NONE, 1.1 sources, 1.2, 1.3 xorg-x11-drv-geode.spec, 1.2, 1.3

Dennis Gilmore (ausil) fedora-extras-commits at redhat.com
Tue May 20 19:15:14 UTC 2008


Author: ausil

Update of /cvs/pkgs/rpms/xorg-x11-drv-geode/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv21237

Modified Files:
	sources xorg-x11-drv-geode.spec 
Added Files:
	dcon.patch fix-memory-mapping.patch 
Log Message:
sync to F-9


dcon.patch:

--- NEW FILE dcon.patch ---
geode:  Bring over the DCON detection code from the OLPC tree

From: Jordan Crouse <jordan.crouse at amd.com>


---

 src/geode.h      |    1 +
 src/geode_dcon.c |   47 ++++++++++++++++++++++++++++++++++++++++++++++-
 src/lx_driver.c  |   36 +++++++++++++++++++++++-------------
 3 files changed, 70 insertions(+), 14 deletions(-)

diff --git a/src/geode.h b/src/geode.h
index 2490315..2c2ce89 100644
--- a/src/geode.h
+++ b/src/geode.h
@@ -234,6 +234,7 @@ VESARec;
 #define OUTPUT_CRT   0x02
 #define OUTPUT_TV    0x04
 #define OUTPUT_VOP   0x08
+#define OUTPUT_DCON  0x10
 
 typedef struct _geodeRec
 {
diff --git a/src/geode_dcon.c b/src/geode_dcon.c
index 27cad18..fc887f7 100644
--- a/src/geode_dcon.c
+++ b/src/geode_dcon.c
@@ -35,11 +35,56 @@
 
 #include "geode.h"
 #include <unistd.h>
+#include <fcntl.h>
+
+#define DCON_SLEEP_FILE "/sys/devices/platform/dcon/sleep"
 
 static Bool
 dcon_present(void)
 {
-    return access("/sys/devices/platform/dcon", F_OK) == 0;
+    static int _dval = -1;
+
+    if (_dval == -1)
+	_dval = (access("/sys/devices/platform/dcon", F_OK) == 0);
+
+    return (Bool) _dval;
+}
+
+int
+DCONDPMSSet(ScrnInfoPtr pScrni, int mode, int flags)
+{
+    static int failed = -1;
+    int fd;
+    char value[1];
+
+    if (failed == -1)
+	failed = !dcon_present();
+
+    if (failed)
+	return 0;
+
+    fd = open(DCON_SLEEP_FILE, O_WRONLY);
+
+    if (fd < 0) {
+	failed = 1;
+	return 0;
+    }
+
+    switch (mode) {
+    case DPMSModeOn:
+	value[0] = '0';
+	break;
+    case DPMSModeStandby:
+    case DPMSModeSuspend:
+    case DPMSModeOff:
+	value[0] = '1';
+	break;
+    }
+
+    write(fd, value, sizeof(value));
+    close(fd);
+
+    return 1;
 }
 
 Bool
diff --git a/src/lx_driver.c b/src/lx_driver.c
index d44fb94..e8477db 100644
--- a/src/lx_driver.c
+++ b/src/lx_driver.c
@@ -525,7 +525,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
     OptionInfoRec *GeodeOptions = &LX_GeodeOptions[0];
     rgb defaultWeight = { 0, 0, 0 };
     int modecnt;
-    char *s, *panelgeo = NULL;
+    char *s;
 
     if (pScrni->numEntities != 1)
 	return FALSE;
@@ -636,7 +636,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
 	&pGeode->tryHWCursor);
 
     if (!xf86GetOptValInteger(GeodeOptions, LX_OPTION_FBSIZE,
-	    (int *) &(pGeode->FBAvail)))
+	    (int *)&(pGeode->FBAvail)))
 	pGeode->FBAvail = 0;
 
     /* For compatability - allow SWCursor too */
@@ -666,7 +666,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
     }
 
     xf86GetOptValInteger(GeodeOptions, LX_OPTION_EXA_SCRATCH_BFRSZ,
-	(int *) &(pGeode->exaBfrSz));
+	(int *)&(pGeode->exaBfrSz));
 
     if (pGeode->exaBfrSz <= 0)
 	pGeode->exaBfrSz = 0;
@@ -676,23 +676,23 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
 	    pGeode->Output &= ~OUTPUT_PANEL;
     }
 
-    panelgeo = xf86GetOptValString(GeodeOptions, LX_OPTION_PANEL_GEOMETRY);
-
-    /* Get the panel information - if it is specified on the command line,
-     * then go with that - otherwise try to determine it by probing the
-     * BIOS - the BIOS may tell us that the panel doesn't exist, so the
-     * value of the output bitmask may change
+    /* Panel detection code -
+     * 1.  See if an OLPC DCON is attached - we can make some assumptions
+     * about the panel if so.
+     * 2.  Use override options specified in the config
+     * 3.  "Autodetect" the panel through VSA
      */
 
     if (dcon_init(pScrni)) {
-	pGeode->Output = OUTPUT_PANEL;
+	pGeode->Output = OUTPUT_PANEL | OUTPUT_DCON;
     } else if (pGeode->Output & OUTPUT_PANEL) {
+	char *panelgeo =
+	    xf86GetOptValString(GeodeOptions, LX_OPTION_PANEL_GEOMETRY);
+
 	if (panelgeo != NULL)
 	    GeodeGetFPGeometry(panelgeo, &pGeode->PanelX, &pGeode->PanelY);
 	else {
-	    Bool ret = lx_get_panel(&pGeode->PanelX, &pGeode->PanelY);
-
-	    if (ret == FALSE)
+	    if (!lx_get_panel(&pGeode->PanelX, &pGeode->PanelY))
 		pGeode->Output &= ~OUTPUT_PANEL;
 	}
     }
@@ -704,6 +704,9 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
     xf86DrvMsg(pScrni->scrnIndex, X_INFO, " PANEL: %s\n",
 	pGeode->Output & OUTPUT_PANEL ? "YES" : "NO");
 
+    xf86DrvMsg(pScrni->scrnIndex, X_INFO, " DCON: %s\n",
+	pGeode->Output & OUTPUT_DCON ? "YES" : "NO");
+
     xf86DrvMsg(pScrni->scrnIndex, X_INFO, " VGA: %s\n",
 	pGeode->useVGA ? "YES" : "NO");
 
@@ -1204,9 +1207,16 @@ LXLoadPalette(ScrnInfoPtr pScrni,
 static void
 LXDPMSSet(ScrnInfoPtr pScrni, int mode, int flags)
 {
+    GeodeRec *pGeode = GEODEPTR(pScrni);
+
     if (!pScrni->vtSema)
 	return;
 
+    if (pGeode->Output & OUTPUT_DCON) {
+	if (DCONDPMSSet(pScrni, mode, flags))
+	    return;
+    }
+
     switch (mode) {
     case DPMSModeOn:
 	lx_enable_dac_power(pScrni, 1);

fix-memory-mapping.patch:

--- NEW FILE fix-memory-mapping.patch ---
geode:  Unmap the PCI memory when we close the screen

From: Jordan Crouse <jordan.crouse at amd.com>


---

 src/lx_driver.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/lx_driver.c b/src/lx_driver.c
index 48aff44..d44fb94 100644
--- a/src/lx_driver.c
+++ b/src/lx_driver.c
@@ -418,6 +418,13 @@ map_pci_mem(ScrnInfoPtr pScrni, int vram,
 	return NULL;
     return ptr;
 }
+
+static inline int
+unmap_pci_mem(ScrnInfoPtr pScrni, struct pci_device *dev, void *ptr, int size)
+{
+       return pci_device_unmap_range(dev, ptr, size);
+}
+
 #endif
 
 static Bool
@@ -848,15 +855,23 @@ static Bool
 LXUnmapMem(ScrnInfoPtr pScrni)
 {
     GeodeRec *pGeode = GEODEPTR(pScrni);
+    pciVideoPtr pci = xf86GetPciInfoForEntity(pGeode->pEnt->index);
 
+#ifndef XSERVER_LIBPCIACCESS
     xf86UnMapVidMem(pScrni->scrnIndex, (pointer) cim_gp_ptr, LX_GP_REG_SIZE);
     xf86UnMapVidMem(pScrni->scrnIndex, (pointer) cim_vg_ptr, LX_VG_REG_SIZE);
     xf86UnMapVidMem(pScrni->scrnIndex, (pointer) cim_vid_ptr,
 	LX_VID_REG_SIZE);
     xf86UnMapVidMem(pScrni->scrnIndex, (pointer) cim_vip_ptr,
 	LX_VIP_REG_SIZE);
+#else
+    unmap_pci_mem(pScrni, pci, cim_gp_ptr, LX_GP_REG_SIZE);
+    unmap_pci_mem(pScrni, pci, cim_vg_ptr, LX_VG_REG_SIZE);
+    unmap_pci_mem(pScrni, pci, cim_vid_ptr, LX_VID_REG_SIZE);
+    unmap_pci_mem(pScrni, pci, cim_vip_ptr, LX_VIP_REG_SIZE);
+    unmap_pci_mem(pScrni, pci, cim_fb_ptr, pGeode->FBAvail + CIM_CMD_BFR_SZ);
+#endif
 
-    xf86UnMapVidMem(pScrni->scrnIndex, cim_fb_ptr, pGeode->FBAvail);
     xf86UnMapVidMem(pScrni->scrnIndex, XpressROMPtr, 0x10000);
 
     return TRUE;


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-geode/devel/sources,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- sources	4 Apr 2008 02:11:42 -0000	1.2
+++ sources	20 May 2008 19:14:34 -0000	1.3
@@ -1 +1 @@
-a2b9c70a32b0a6436d837d67fa7aae18  xf86-video-geode-2.8.0.tar.bz2
+d7b3254e6f4f1978fecf8f4fa2823259  xf86-video-geode-2.9.0.tar.bz2


Index: xorg-x11-drv-geode.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-geode/devel/xorg-x11-drv-geode.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- xorg-x11-drv-geode.spec	17 Apr 2008 19:47:28 -0000	1.2
+++ xorg-x11-drv-geode.spec	20 May 2008 19:14:34 -0000	1.3
@@ -4,11 +4,12 @@
 
 Summary:   Xorg X11 AMD Geode video driver
 Name:      xorg-x11-drv-geode
-Version:   2.8.0
-Release:   3%{?dist}
+Version:   2.9.0
+Release:   2%{?dist}
 URL:       http://www.x.org/wiki/AMDGeodeDriver
 Source0:   http://xorg.freedesktop.org/releases/individual/driver/xf86-video-geode-%{version}.tar.bz2
-Patch0:    libddc.patch
+Patch0:    http://dev.laptop.org/~jcrouse/fix-memory-mapping.patch
+Patch1:    http://dev.laptop.org/~jcrouse/dcon.patch
 License:   MIT
 Group:     User Interface/X Hardware Support
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -34,7 +35,7 @@
 %prep
 %setup -q -n %{tarball}-%{version}
 %patch0 -p1
-./autogen.sh
+%patch1 -p1
 
 %build
 %configure --disable-static --libdir=%{_libdir} --mandir=%{_mandir} \
@@ -63,6 +64,13 @@
 %{driverdir}/ztv_drv.so
 
 %changelog
+* Tue May 20 2008 Dennis Gilmore <dennis at ausil.us> 2.9.0-2
+- apply patches for olpc
+
+* Thu May 08 2008 Dennis Gilmore <dennis at ausil.us> 2.9.0-1
+- update to 2.9.0
+- adds olpc support for everything but DPMS
+
 * Thu Apr 17 2008 Warren Togami <wtogami at redhat.com> 2.8.0-3
 - Use libddc instead of unreliable BIOS DDC queries.
 




More information about the fedora-extras-commits mailing list