diff -Nru xserver-xorg-video-geode-2.11.16/aclocal.m4 xserver-xorg-video-geode-2.11.17/aclocal.m4 --- xserver-xorg-video-geode-2.11.16/aclocal.m4 2014-07-17 00:38:32.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/aclocal.m4 2015-05-20 08:29:15.000000000 +0000 @@ -2263,10 +2263,9 @@ # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- diff -Nru xserver-xorg-video-geode-2.11.16/build-aux/config.sub xserver-xorg-video-geode-2.11.17/build-aux/config.sub --- xserver-xorg-video-geode-2.11.16/build-aux/config.sub 2014-07-16 21:00:04.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/build-aux/config.sub 2015-03-12 10:29:53.000000000 +0000 @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. -timestamp='2014-05-01' +timestamp='2014-09-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -302,6 +302,7 @@ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ + | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ @@ -828,6 +829,10 @@ basic_machine=powerpc-unknown os=-morphos ;; + moxiebox) + basic_machine=moxie-unknown + os=-moxiebox + ;; msdos) basic_machine=i386-pc os=-msdos @@ -1373,7 +1378,7 @@ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ + | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ diff -Nru xserver-xorg-video-geode-2.11.16/build-aux/ltmain.sh xserver-xorg-video-geode-2.11.17/build-aux/ltmain.sh --- xserver-xorg-video-geode-2.11.16/build-aux/ltmain.sh 2014-07-16 20:59:50.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/build-aux/ltmain.sh 2015-03-12 10:29:09.000000000 +0000 @@ -70,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7 +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.11 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1.7" +VERSION="2.4.2 Debian-2.4.2-1.11" TIMESTAMP="" package_revision=1.3337 diff -Nru xserver-xorg-video-geode-2.11.16/ChangeLog xserver-xorg-video-geode-2.11.17/ChangeLog --- xserver-xorg-video-geode-2.11.16/ChangeLog 2014-07-17 00:39:06.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/ChangeLog 2015-05-20 08:31:29.000000000 +0000 @@ -1,3 +1,60 @@ +commit 97e53b5896752a7e504d0159a7009418e2510521 +Author: Martin-Éric Racine +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 + +commit f98301ad73b84915358ce6f6d2522b36c4b603d9 +Author: Maarten Lankhorst +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 + +commit 621d946e56efac2c779b83b1a5c6b645169c4ebd +Author: Brian A. Lloyd +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 + +commit efb42fc933a4198645691a94fe350f361cbf55a8 +Author: Marc Balmer +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 + Signed-off-by: Matthieu Herrb + commit 6ec1e2df7aeb78332fee0dd90900906e58aa790b Author: Martin-Éric Racine Date: Thu Jul 17 03:28:26 2014 +0300 diff -Nru xserver-xorg-video-geode-2.11.16/configure xserver-xorg-video-geode-2.11.17/configure --- xserver-xorg-video-geode-2.11.16/configure 2014-07-17 00:38:43.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/configure 2015-05-20 08:29:26.000000000 +0000 @@ -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 . # @@ -591,8 +591,8 @@ # 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 @@ # 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 @@ 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 @@ 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 @@ 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 $@ @@ -2541,8 +2541,8 @@ ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in @@ -2855,7 +2855,7 @@ # Define the identity of the package. PACKAGE='xf86-video-geode' - VERSION='2.11.16' + VERSION='2.11.17' cat >>confdefs.h <<_ACEOF @@ -19069,7 +19069,7 @@ # 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 @@ -19136,7 +19136,7 @@ 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 -Nru xserver-xorg-video-geode-2.11.16/configure.ac xserver-xorg-video-geode-2.11.17/configure.ac --- xserver-xorg-video-geode-2.11.16/configure.ac 2014-07-16 21:09:52.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/configure.ac 2015-05-20 08:24:06.000000000 +0000 @@ -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 -Nru xserver-xorg-video-geode-2.11.16/debian/changelog xserver-xorg-video-geode-2.11.17/debian/changelog --- xserver-xorg-video-geode-2.11.16/debian/changelog 2015-05-06 13:20:30.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/debian/changelog 2015-05-20 08:51:53.000000000 +0000 @@ -1,3 +1,10 @@ +xserver-xorg-video-geode (2.11.17-1) unstable; urgency=medium + + * New upstream release. + - Dropped all patches (merged upstream). + + -- Martin-Éric Racine Wed, 20 May 2015 11:51:01 +0300 + xserver-xorg-video-geode (2.11.16-9) unstable; urgency=medium * Bumped debhelper compat level to 9. diff -Nru xserver-xorg-video-geode-2.11.16/debian/patches/0001-Geode-MSR-support-for-OpenBSD.patch xserver-xorg-video-geode-2.11.17/debian/patches/0001-Geode-MSR-support-for-OpenBSD.patch --- xserver-xorg-video-geode-2.11.16/debian/patches/0001-Geode-MSR-support-for-OpenBSD.patch 2015-05-06 08:56:23.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/debian/patches/0001-Geode-MSR-support-for-OpenBSD.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,113 +0,0 @@ -From efb42fc933a4198645691a94fe350f361cbf55a8 Mon Sep 17 00:00:00 2001 -From: Marc Balmer -Date: Thu, 25 Sep 2014 16:11:56 +0300 -Subject: [PATCH 1/3] Geode MSR support for OpenBSD - -This patch adds conditional support for the Geode MSR device on OpenBSD. - -Signed-off-by: Marc Balmer -Signed-off-by: Matthieu Herrb ---- - src/geode_msr.c | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- - 1 file changed, 46 insertions(+), 4 deletions(-) - -diff --git a/src/geode_msr.c b/src/geode_msr.c -index b7c56d9..8f57939 100644 ---- a/src/geode_msr.c -+++ b/src/geode_msr.c -@@ -33,18 +33,36 @@ - #include - #include - #include -+ -+#ifdef __OpenBSD__ -+#include -+#include -+#endif -+ - #include "os.h" - #include "geode.h" - -+#ifdef __OpenBSD__ -+#define _PATH_MSRDEV "/dev/amdmsr" -+#define X_PRIVSEP -+#else -+#define _PATH_MSRDEV "/dev/cpu/0/msr" -+#endif -+ - static int - _msr_open(void) - { - static int msrfd = 0; - - if (msrfd == 0) { -- msrfd = open("/dev/cpu/0/msr", O_RDWR); -+#ifdef X_PRIVSEP -+ msrfd = priv_open_device(_PATH_MSRDEV); -+#else -+ msrfd = open(_PATH_MSRDEV, O_RDWR); -+#endif - if (msrfd == -1) -- ErrorF("Unable to open /dev/cpu/0/msr: %d\n", errno); -+ FatalError("Unable to open %s: %s\n", _PATH_MSRDEV, -+ strerror(errno)); - } - - return msrfd; -@@ -53,6 +71,19 @@ _msr_open(void) - int - GeodeReadMSR(unsigned long addr, unsigned long *lo, unsigned long *hi) - { -+#ifdef __OpenBSD__ -+ struct amdmsr_req req; -+ int fd = _msr_open(); -+ -+ req.addr = addr; -+ -+ if (ioctl(fd, RDMSR, &req) == -1) -+ FatalError("Unable to read MSR at address %0x06x: %s\n", addr, -+ strerror(errno)); -+ -+ *hi = req.val >> 32; -+ *lo = req.val & 0xffffffff; -+#else - unsigned int data[2]; - int fd = _msr_open(); - int ret; -@@ -72,13 +103,24 @@ GeodeReadMSR(unsigned long addr, unsigned long *lo, unsigned long *hi) - - *hi = data[1]; - *lo = data[0]; -- -+#endif - return 0; - } - - int - GeodeWriteMSR(unsigned long addr, unsigned long lo, unsigned long hi) - { -+#ifdef __OpenBSD__ -+ struct amdmsr_req req; -+ int fd = _msr_open(); -+ -+ req.addr = addr; -+ req.val = (u_int64_t) hi << 32 | (u_int64_t)lo; -+ -+ if (ioctl(fd, WRMSR, &req) == -1) -+ FatalError("Unable to write MSR at address 0x%06x: %s\n", addr, -+ strerror(errno)); -+#else - unsigned int data[2]; - int fd = _msr_open(); - -@@ -93,6 +135,6 @@ GeodeWriteMSR(unsigned long addr, unsigned long lo, unsigned long hi) - - if (write(fd, (void *) data, 8) != 8) - return -1; -- -+#endif - return 0; - } --- -2.1.4 - diff -Nru xserver-xorg-video-geode-2.11.16/debian/patches/0002-Add-config.h-include-to-src-lx_memory.c.patch xserver-xorg-video-geode-2.11.17/debian/patches/0002-Add-config.h-include-to-src-lx_memory.c.patch --- xserver-xorg-video-geode-2.11.16/debian/patches/0002-Add-config.h-include-to-src-lx_memory.c.patch 2015-05-06 08:56:23.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/debian/patches/0002-Add-config.h-include-to-src-lx_memory.c.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -From 621d946e56efac2c779b83b1a5c6b645169c4ebd Mon Sep 17 00:00:00 2001 -From: "Brian A. Lloyd" -Date: Wed, 1 Oct 2014 12:35:18 +0300 -Subject: [PATCH 2/3] 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 ---- - src/lx_memory.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/lx_memory.c b/src/lx_memory.c -index f26d280..992446f 100644 ---- a/src/lx_memory.c -+++ b/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" --- -2.1.4 - diff -Nru xserver-xorg-video-geode-2.11.16/debian/patches/0003-Fix-building-Geode-against-xserver-1.17.patch xserver-xorg-video-geode-2.11.17/debian/patches/0003-Fix-building-Geode-against-xserver-1.17.patch --- xserver-xorg-video-geode-2.11.16/debian/patches/0003-Fix-building-Geode-against-xserver-1.17.patch 2015-05-06 08:56:23.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/debian/patches/0003-Fix-building-Geode-against-xserver-1.17.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,259 +0,0 @@ -From f98301ad73b84915358ce6f6d2522b36c4b603d9 Mon Sep 17 00:00:00 2001 -From: Maarten Lankhorst -Date: Thu, 12 Mar 2015 10:50:57 +0100 -Subject: [PATCH 3/3] 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 ---- - src/gx_driver.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++------- - src/lx_driver.c | 35 ++++++++++++++++++++++++++++------- - 2 files changed, 75 insertions(+), 14 deletions(-) - -diff --git a/src/gx_driver.c b/src/gx_driver.c -index 7f44e19..ab57df1 100644 ---- a/src/gx_driver.c -+++ b/src/gx_driver.c -@@ -32,6 +32,9 @@ - #endif - - #include -+#include -+#include -+#include - - #include "xf86.h" - #include "xf86_OSproc.h" -@@ -322,7 +325,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 +332,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 +381,19 @@ GXMapMem(ScrnInfoPtr pScrni) - - gfx_gx2_scratch_base = pGeode->FBAvail - 0x4000; - -+#ifndef XSERVER_LIBPCIACCESS - XpressROMPtr = xf86MapVidMem(index, VIDMEM_FRAMEBUFFER, 0xF0000, 0x10000); -- -+#else -+ { -+ int fd = open("/dev/mem", O_RDWR); -+ if (fd < 0) { -+ xf86DrvMsg(index, X_ERROR, "Failed to open /dev/mem: %m\n"); -+ return FALSE; -+ } -+ XpressROMPtr = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0xF0000); -+ close(fd); -+ } -+#endif - pGeode->FBBase = gfx_virt_fbptr; - - if ((!gfx_virt_regptr) || (!gfx_virt_gpptr) || -@@ -395,9 +414,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 +432,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 +467,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 +615,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 +782,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/src/lx_driver.c b/src/lx_driver.c -index 146578e..c68f715 100644 ---- a/src/lx_driver.c -+++ b/src/lx_driver.c -@@ -33,6 +33,9 @@ - - #include - #include -+#include -+#include -+#include - - #include "xf86.h" - #include "xf86_OSproc.h" -@@ -155,7 +158,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 +165,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 +237,19 @@ 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 -+ { -+ int fd = open("/dev/mem", O_RDWR); -+ if (fd < 0) { -+ xf86DrvMsg(index, X_ERROR, "Failed to open /dev/mem: %m\n"); -+ return FALSE; -+ } -+ XpressROMPtr = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0xF0000); -+ close(fd); -+ } -+#endif - - pGeode->FBBase = cim_fb_ptr; - -@@ -253,9 +267,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 +285,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 +329,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 +630,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 +641,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; - } --- -2.1.4 - diff -Nru xserver-xorg-video-geode-2.11.16/debian/patches/series xserver-xorg-video-geode-2.11.17/debian/patches/series --- xserver-xorg-video-geode-2.11.16/debian/patches/series 2015-05-06 08:58:20.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/debian/patches/series 2015-05-20 08:50:53.000000000 +0000 @@ -1,3 +0,0 @@ -0001-Geode-MSR-support-for-OpenBSD.patch -0002-Add-config.h-include-to-src-lx_memory.c.patch -0003-Fix-building-Geode-against-xserver-1.17.patch diff -Nru xserver-xorg-video-geode-2.11.16/src/geode_msr.c xserver-xorg-video-geode-2.11.17/src/geode_msr.c --- xserver-xorg-video-geode-2.11.16/src/geode_msr.c 2014-07-16 20:59:37.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/src/geode_msr.c 2015-03-12 10:28:33.000000000 +0000 @@ -33,18 +33,36 @@ #include #include #include + +#ifdef __OpenBSD__ +#include +#include +#endif + #include "os.h" #include "geode.h" +#ifdef __OpenBSD__ +#define _PATH_MSRDEV "/dev/amdmsr" +#define X_PRIVSEP +#else +#define _PATH_MSRDEV "/dev/cpu/0/msr" +#endif + static int _msr_open(void) { static int msrfd = 0; if (msrfd == 0) { - msrfd = open("/dev/cpu/0/msr", O_RDWR); +#ifdef X_PRIVSEP + msrfd = priv_open_device(_PATH_MSRDEV); +#else + msrfd = open(_PATH_MSRDEV, O_RDWR); +#endif if (msrfd == -1) - ErrorF("Unable to open /dev/cpu/0/msr: %d\n", errno); + FatalError("Unable to open %s: %s\n", _PATH_MSRDEV, + strerror(errno)); } return msrfd; @@ -53,6 +71,19 @@ int GeodeReadMSR(unsigned long addr, unsigned long *lo, unsigned long *hi) { +#ifdef __OpenBSD__ + struct amdmsr_req req; + int fd = _msr_open(); + + req.addr = addr; + + if (ioctl(fd, RDMSR, &req) == -1) + FatalError("Unable to read MSR at address %0x06x: %s\n", addr, + strerror(errno)); + + *hi = req.val >> 32; + *lo = req.val & 0xffffffff; +#else unsigned int data[2]; int fd = _msr_open(); int ret; @@ -72,13 +103,24 @@ *hi = data[1]; *lo = data[0]; - +#endif return 0; } int GeodeWriteMSR(unsigned long addr, unsigned long lo, unsigned long hi) { +#ifdef __OpenBSD__ + struct amdmsr_req req; + int fd = _msr_open(); + + req.addr = addr; + req.val = (u_int64_t) hi << 32 | (u_int64_t)lo; + + if (ioctl(fd, WRMSR, &req) == -1) + FatalError("Unable to write MSR at address 0x%06x: %s\n", addr, + strerror(errno)); +#else unsigned int data[2]; int fd = _msr_open(); @@ -93,6 +135,6 @@ if (write(fd, (void *) data, 8) != 8) return -1; - +#endif return 0; } diff -Nru xserver-xorg-video-geode-2.11.16/src/gx_driver.c xserver-xorg-video-geode-2.11.17/src/gx_driver.c --- xserver-xorg-video-geode-2.11.16/src/gx_driver.c 2014-07-16 20:59:37.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/src/gx_driver.c 2015-03-12 10:32:40.000000000 +0000 @@ -32,6 +32,9 @@ #endif #include +#include +#include +#include #include "xf86.h" #include "xf86_OSproc.h" @@ -322,7 +325,6 @@ 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 +332,18 @@ 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 +381,19 @@ gfx_gx2_scratch_base = pGeode->FBAvail - 0x4000; +#ifndef XSERVER_LIBPCIACCESS XpressROMPtr = xf86MapVidMem(index, VIDMEM_FRAMEBUFFER, 0xF0000, 0x10000); - +#else + { + int fd = open("/dev/mem", O_RDWR); + if (fd < 0) { + xf86DrvMsg(index, X_ERROR, "Failed to open /dev/mem: %m\n"); + return FALSE; + } + XpressROMPtr = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0xF0000); + close(fd); + } +#endif pGeode->FBBase = gfx_virt_fbptr; if ((!gfx_virt_regptr) || (!gfx_virt_gpptr) || @@ -395,9 +414,9 @@ */ 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 +432,11 @@ 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 +467,7 @@ if (pGeode == NULL) return FALSE; - useVGA = GXCheckVGA(pScrni); + useVGA = GXCheckVGA(pScrni, pEnt); if (flags & PROBE_DETECT) { GeodeProbeDDC(pScrni, pEnt->index); @@ -591,12 +615,18 @@ 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 +782,21 @@ 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 -Nru xserver-xorg-video-geode-2.11.16/src/lx_driver.c xserver-xorg-video-geode-2.11.17/src/lx_driver.c --- xserver-xorg-video-geode-2.11.16/src/lx_driver.c 2014-07-16 20:59:37.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/src/lx_driver.c 2015-03-12 10:32:40.000000000 +0000 @@ -33,6 +33,9 @@ #include #include +#include +#include +#include #include "xf86.h" #include "xf86_OSproc.h" @@ -155,7 +158,6 @@ 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 +165,7 @@ map_size, PCI_DEV_MAP_FLAG_WRITABLE | (vram ? PCI_DEV_MAP_FLAG_WRITE_COMBINE : 0), - result); + &ptr); if (err) return NULL; @@ -235,7 +237,19 @@ pGeode->FBAvail); gp_set_command_buffer_base(cmd_bfr_phys, 0, pGeode->CmdBfrSize); +#ifndef XSERVER_LIBPCIACCESS XpressROMPtr = xf86MapVidMem(index, VIDMEM_FRAMEBUFFER, 0xF0000, 0x10000); +#else + { + int fd = open("/dev/mem", O_RDWR); + if (fd < 0) { + xf86DrvMsg(index, X_ERROR, "Failed to open /dev/mem: %m\n"); + return FALSE; + } + XpressROMPtr = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0xF0000); + close(fd); + } +#endif pGeode->FBBase = cim_fb_ptr; @@ -253,9 +267,9 @@ */ 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 +285,11 @@ 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 +329,7 @@ if (pGeode == NULL) return FALSE; - pGeode->useVGA = LXCheckVGA(pScrni); + pGeode->useVGA = LXCheckVGA(pScrni, pEnt); pGeode->VGAActive = FALSE; pGeode->pEnt = pEnt; @@ -611,6 +630,8 @@ 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 +641,9 @@ 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 -Nru xserver-xorg-video-geode-2.11.16/src/lx_memory.c xserver-xorg-video-geode-2.11.17/src/lx_memory.c --- xserver-xorg-video-geode-2.11.16/src/lx_memory.c 2014-07-16 20:59:37.000000000 +0000 +++ xserver-xorg-video-geode-2.11.17/src/lx_memory.c 2015-03-12 10:28:33.000000000 +0000 @@ -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"