summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2015-08-23 18:42:52 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2015-08-23 18:42:52 +0000
commitdaa9c3cd74ba008f5b447184975f986c0b39cac8 (patch)
treea8a5988d68bb8febc5e9238cd3bc4f32a7b665e7
parent2f67b97355b80e57c3c19ba22ea040fad60377a8 (diff)
Update to xf86-video-geode 2.11.17
Add compatibility with xserver 1.17, but on OpenBSD I had to disable reading of the 'XpressROM' that is used for directly connected panels.
-rw-r--r--driver/xf86-video-geode/ChangeLog57
-rwxr-xr-xdriver/xf86-video-geode/configure20
-rw-r--r--driver/xf86-video-geode/configure.ac2
-rw-r--r--driver/xf86-video-geode/src/gx_driver.c60
-rw-r--r--driver/xf86-video-geode/src/lx_driver.c42
-rw-r--r--driver/xf86-video-geode/src/lx_memory.c3
6 files changed, 159 insertions, 25 deletions
diff --git a/driver/xf86-video-geode/ChangeLog b/driver/xf86-video-geode/ChangeLog
index 13d8d39a2..fa385cb71 100644
--- a/driver/xf86-video-geode/ChangeLog
+++ b/driver/xf86-video-geode/ChangeLog
@@ -1,3 +1,60 @@
+commit 97e53b5896752a7e504d0159a7009418e2510521
+Author: Martin-Éric Racine <martin-eric.racine@iki.fi>
+Date: Wed May 20 11:24:30 2015 +0300
+
+ Geode 2.11.17
+
+ This release restores compatibility with xserver-1.17.
+
+ Support for the Geode MSR device on OpenBSD is merged.
+
+ VALIDATION PLATFORM
+ * Debian (X server 1.17.1) on FIC ION603A (Geode LX800).
+
+ Signed-off-by: Martin-Éric Racine <martin-eric.racine@iki.fi>
+
+commit f98301ad73b84915358ce6f6d2522b36c4b603d9
+Author: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
+Date: Thu Mar 12 10:50:57 2015 +0100
+
+ Fix building Geode against xserver 1.17
+
+ The xf86MapVidMem API is gone. Use pciaccess calls where applicable and mmap for XpressROMPtr.
+
+ Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
+
+commit 621d946e56efac2c779b83b1a5c6b645169c4ebd
+Author: Brian A. Lloyd <brian.lloyd@familyhonor.net>
+Date: Wed Oct 1 12:35:18 2014 +0300
+
+ Add config.h include to src/lx_memory.c
+
+ The src/lx_memory.c file uses the xf86.h header file. This file must have
+ HAVE_STRNDUP defined before calling it when the building platform has a strndup
+ function. When using config.h, this file doesn't have that define and so fails
+ to compile.
+
+ The attached patch adds the conditional config.h to this file so it may compile
+ on the affected platforms.
+
+ The patch is trivial and may be included and used under whatever licensing
+ desired.
+
+ Closes: Free Desktop Bug #84541
+
+ Signed-off-by: Brian A. Lloyd <brian.lloyd@familyhonor.net>
+
+commit efb42fc933a4198645691a94fe350f361cbf55a8
+Author: Marc Balmer <mbalmer@netbsd.org>
+Date: Thu Sep 25 16:11:56 2014 +0300
+
+ Geode MSR support for OpenBSD
+
+ This patch adds conditional support for the Geode MSR device on OpenBSD.
+
+ Signed-off-by: Marc Balmer <mbalmer@netbsd.org>
+ Signed-off-by: Matthieu Herrb <matthieu@openbsd.org>
+
commit 6ec1e2df7aeb78332fee0dd90900906e58aa790b
Author: Martin-Éric Racine <martin-eric.racine@iki.fi>
Date: Thu Jul 17 03:28:26 2014 +0300
diff --git a/driver/xf86-video-geode/configure b/driver/xf86-video-geode/configure
index f915831d8..b13767de7 100755
--- a/driver/xf86-video-geode/configure
+++ b/driver/xf86-video-geode/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for xf86-video-geode 2.11.16.
+# Generated by GNU Autoconf 2.69 for xf86-video-geode 2.11.17.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver%2Fgeode>.
#
@@ -591,8 +591,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='xf86-video-geode'
PACKAGE_TARNAME='xf86-video-geode'
-PACKAGE_VERSION='2.11.16'
-PACKAGE_STRING='xf86-video-geode 2.11.16'
+PACKAGE_VERSION='2.11.17'
+PACKAGE_STRING='xf86-video-geode 2.11.17'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver%2Fgeode'
PACKAGE_URL='http://www.x.org/wiki/GeodeDriver'
@@ -1363,7 +1363,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures xf86-video-geode 2.11.16 to adapt to many kinds of systems.
+\`configure' configures xf86-video-geode 2.11.17 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1434,7 +1434,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of xf86-video-geode 2.11.16:";;
+ short | recursive ) echo "Configuration of xf86-video-geode 2.11.17:";;
esac
cat <<\_ACEOF
@@ -1570,7 +1570,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-xf86-video-geode configure 2.11.16
+xf86-video-geode configure 2.11.17
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1985,7 +1985,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by xf86-video-geode $as_me 2.11.16, which was
+It was created by xf86-video-geode $as_me 2.11.17, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2816,7 +2816,7 @@ fi
# Define the identity of the package.
PACKAGE='xf86-video-geode'
- VERSION='2.11.16'
+ VERSION='2.11.17'
cat >>confdefs.h <<_ACEOF
@@ -18792,7 +18792,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by xf86-video-geode $as_me 2.11.16, which was
+This file was extended by xf86-video-geode $as_me 2.11.17, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -18859,7 +18859,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-xf86-video-geode config.status 2.11.16
+xf86-video-geode config.status 2.11.17
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/driver/xf86-video-geode/configure.ac b/driver/xf86-video-geode/configure.ac
index c8b76314b..a819ccb88 100644
--- a/driver/xf86-video-geode/configure.ac
+++ b/driver/xf86-video-geode/configure.ac
@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ(2.60)
AC_INIT([xf86-video-geode],
- [2.11.16],
+ [2.11.17],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver%2Fgeode],
[xf86-video-geode],
[http://www.x.org/wiki/GeodeDriver])
diff --git a/driver/xf86-video-geode/src/gx_driver.c b/driver/xf86-video-geode/src/gx_driver.c
index 7f44e19f7..53a18bd50 100644
--- a/driver/xf86-video-geode/src/gx_driver.c
+++ b/driver/xf86-video-geode/src/gx_driver.c
@@ -31,7 +31,11 @@
#include "config.h"
#endif
+#include <errno.h>
#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/mman.h>
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -322,7 +326,6 @@ map_pci_mem(ScrnInfoPtr pScrni, int vram,
struct pci_device *dev, int bar, int size)
{
void *ptr;
- void **result = (void **) &ptr;
int map_size = size ? size : dev->regions[bar].size;
int err = pci_device_map_range(dev,
@@ -330,12 +333,18 @@ map_pci_mem(ScrnInfoPtr pScrni, int vram,
map_size,
PCI_DEV_MAP_FLAG_WRITABLE |
(vram ? PCI_DEV_MAP_FLAG_WRITE_COMBINE : 0),
- result);
+ &ptr);
if (err)
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
extern unsigned long gfx_gx2_scratch_base;
@@ -373,8 +382,24 @@ GXMapMem(ScrnInfoPtr pScrni)
gfx_gx2_scratch_base = pGeode->FBAvail - 0x4000;
+#ifndef XSERVER_LIBPCIACCESS
XpressROMPtr = xf86MapVidMem(index, VIDMEM_FRAMEBUFFER, 0xF0000, 0x10000);
-
+#else
+ {
+#ifndef __OpenBSD__
+ int fd = open("/dev/mem", O_RDWR);
+ if (fd < 0) {
+ xf86DrvMsg(index, X_ERROR, "Failed to open /dev/mem: %s\n",
+ strerror(errno));
+ return FALSE;
+ }
+ XpressROMPtr = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0xF0000);
+ close(fd);
+#else
+ XpressROMPtr = NULL;
+#endif
+ }
+#endif
pGeode->FBBase = gfx_virt_fbptr;
if ((!gfx_virt_regptr) || (!gfx_virt_gpptr) ||
@@ -395,9 +420,9 @@ GXMapMem(ScrnInfoPtr pScrni)
*/
static Bool
-GXCheckVGA(ScrnInfoPtr pScrni)
+GXCheckVGA(ScrnInfoPtr pScrni, EntityInfoPtr pEnt)
{
-
+#ifndef XSERVER_LIBPCIACCESS
unsigned char *ptr;
const char *vgasig = "IBM VGA Compatible";
int ret;
@@ -413,6 +438,11 @@ GXCheckVGA(ScrnInfoPtr pScrni)
xf86UnMapVidMem(pScrni->scrnIndex, (pointer) ptr, strlen(vgasig));
return ret ? FALSE : TRUE;
+#else
+ pciVideoPtr pci = xf86GetPciInfoForEntity(pEnt->index);
+
+ return pci_device_is_boot_vga(pci);
+#endif
}
static Bool
@@ -443,7 +473,7 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
if (pGeode == NULL)
return FALSE;
- useVGA = GXCheckVGA(pScrni);
+ useVGA = GXCheckVGA(pScrni, pEnt);
if (flags & PROBE_DETECT) {
GeodeProbeDDC(pScrni, pEnt->index);
@@ -591,12 +621,18 @@ GXPreInit(ScrnInfoPtr pScrni, int flags)
panelgeo = xf86GetOptValString(GeodeOptions, GX_OPTION_PANEL_GEOMETRY);
if ((s = xf86GetOptValString(GeodeOptions, GX_OPTION_ACCEL_METHOD))) {
+#if defined(XF86XAA) && defined(XF86EXA)
if (!xf86NameCmp(s, "XAA"))
pGeode->useEXA = FALSE;
else if (xf86NameCmp(s, "EXA"))
xf86DrvMsg(pScrni->scrnIndex, X_ERROR,
"Unknown accleration method %s. Defaulting to XAA.\n",
s);
+#elif defined(XF86EXA)
+ pGeode->useEXA = TRUE;
+#else
+ pGeode->useEXA = FALSE;
+#endif
}
xf86DrvMsg(pScrni->scrnIndex, X_INFO,
@@ -752,11 +788,21 @@ GXUnmapMem(ScrnInfoPtr pScrni)
GeodeRec *pGeode = GEODEPTR(pScrni);
/* unmap all the memory map's */
-
+#ifndef XSERVER_LIBPCIACCESS
xf86UnMapVidMem(pScrni->scrnIndex, gfx_virt_regptr, GX_CPU_REG_SIZE);
xf86UnMapVidMem(pScrni->scrnIndex, gfx_virt_gpptr, GX_GP_REG_SIZE);
xf86UnMapVidMem(pScrni->scrnIndex, gfx_virt_vidptr, GX_VID_REG_SIZE);
xf86UnMapVidMem(pScrni->scrnIndex, gfx_virt_fbptr, pGeode->FBAvail);
+#else
+ pciVideoPtr pci = xf86GetPciInfoForEntity(pGeode->pEnt->index);
+
+ unmap_pci_mem(pScrni, pci, gfx_virt_regptr, GX_CPU_REG_SIZE);
+ unmap_pci_mem(pScrni, pci, gfx_virt_gpptr, GX_GP_REG_SIZE);
+ unmap_pci_mem(pScrni, pci, gfx_virt_vidptr, GX_VID_REG_SIZE);
+ unmap_pci_mem(pScrni, pci, gfx_virt_fbptr, pGeode->FBAvail);
+
+ munmap(XpressROMPtr, 0x10000);
+#endif
return TRUE;
}
diff --git a/driver/xf86-video-geode/src/lx_driver.c b/driver/xf86-video-geode/src/lx_driver.c
index 146578ebc..5583888b5 100644
--- a/driver/xf86-video-geode/src/lx_driver.c
+++ b/driver/xf86-video-geode/src/lx_driver.c
@@ -31,8 +31,12 @@
#include "config.h"
#endif
+#include <errno.h>
#include <stdio.h>
#include <string.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sys/mman.h>
#include "xf86.h"
#include "xf86_OSproc.h"
@@ -155,7 +159,6 @@ map_pci_mem(ScrnInfoPtr pScrni, int vram,
struct pci_device *dev, int bar, int size)
{
void *ptr;
- void **result = (void **) &ptr;
int map_size = size ? size : dev->regions[bar].size;
int err = pci_device_map_range(dev,
@@ -163,7 +166,7 @@ map_pci_mem(ScrnInfoPtr pScrni, int vram,
map_size,
PCI_DEV_MAP_FLAG_WRITABLE |
(vram ? PCI_DEV_MAP_FLAG_WRITE_COMBINE : 0),
- result);
+ &ptr);
if (err)
return NULL;
@@ -235,7 +238,25 @@ LXMapMem(ScrnInfoPtr pScrni)
pGeode->FBAvail);
gp_set_command_buffer_base(cmd_bfr_phys, 0, pGeode->CmdBfrSize);
+#ifndef XSERVER_LIBPCIACCESS
XpressROMPtr = xf86MapVidMem(index, VIDMEM_FRAMEBUFFER, 0xF0000, 0x10000);
+#else
+ {
+#ifndef __OpenBSD__
+ int fd = open("/dev/mem", O_RDWR);
+
+ if (fd < 0) {
+ xf86DrvMsg(index, X_ERROR, "Failed to open /dev/mem: %s\n",
+ strerror(errno));
+ return FALSE;
+ }
+ XpressROMPtr = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0xF0000);
+ close(fd);
+#else
+ XpressROMPtr = NULL;
+#endif
+ }
+#endif
pGeode->FBBase = cim_fb_ptr;
@@ -253,9 +274,9 @@ LXMapMem(ScrnInfoPtr pScrni)
*/
static Bool
-LXCheckVGA(ScrnInfoPtr pScrni)
+LXCheckVGA(ScrnInfoPtr pScrni, EntityInfoPtr pEnt)
{
-
+#ifndef XSERVER_LIBPCIACCESS
unsigned char *ptr;
const char *vgasig = "IBM VGA Compatible";
int ret;
@@ -271,6 +292,11 @@ LXCheckVGA(ScrnInfoPtr pScrni)
xf86UnMapVidMem(pScrni->scrnIndex, (pointer) ptr, strlen(vgasig));
return ret ? FALSE : TRUE;
+#else
+ pciVideoPtr pci = xf86GetPciInfoForEntity(pEnt->index);
+
+ return pci_device_is_boot_vga(pci);
+#endif
}
static Bool
@@ -310,7 +336,7 @@ LXPreInit(ScrnInfoPtr pScrni, int flags)
if (pGeode == NULL)
return FALSE;
- pGeode->useVGA = LXCheckVGA(pScrni);
+ pGeode->useVGA = LXCheckVGA(pScrni, pEnt);
pGeode->VGAActive = FALSE;
pGeode->pEnt = pEnt;
@@ -611,6 +637,8 @@ LXUnmapMem(ScrnInfoPtr pScrni)
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);
+
+ xf86UnMapVidMem(pScrni->scrnIndex, XpressROMPtr, 0x10000);
#else
GeodeRec *pGeode = GEODEPTR(pScrni);
pciVideoPtr pci = xf86GetPciInfoForEntity(pGeode->pEnt->index);
@@ -620,9 +648,9 @@ LXUnmapMem(ScrnInfoPtr pScrni)
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, XpressROMPtr, 0x10000);
+ munmap(XpressROMPtr, 0x10000);
+#endif
return TRUE;
}
diff --git a/driver/xf86-video-geode/src/lx_memory.c b/driver/xf86-video-geode/src/lx_memory.c
index f26d2806e..992446f4f 100644
--- a/driver/xf86-video-geode/src/lx_memory.c
+++ b/driver/xf86-video-geode/src/lx_memory.c
@@ -22,6 +22,9 @@
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*/
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
#include "xf86.h"
#include "geode.h"