--- xserver-xorg-video-psb-0.20.0+repack.orig/debian/xserver-xorg-video-psb.postrm.in +++ xserver-xorg-video-psb-0.20.0+repack/debian/xserver-xorg-video-psb.postrm.in @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +THIS_PACKAGE=xserver-xorg-video-psb +THIS_SCRIPT=postrm + +#DEBHELPER# + +# remove the diversion on purge if still diverted by this package +file="/usr/lib/xorg/modules/libexa.so" +divert="/usr/lib/xorg/modules/libexa.so.$THIS_PACKAGE" +if [ "$1" = "purge" ] && LC_ALL=C dpkg-divert --list "$file" | grep -q " by $THIS_PACKAGE\$"; then + dpkg-divert \ + --package "$THIS_PACKAGE" \ + --rename \ + --remove "$file" || true +fi +# remove the dir we created due to dpkg-divert bugs before 1.14.20; Debian +# #476973, #469033 +rmdir --ignore-fail-on-non-empty -p "$(dirname "$divert")" + --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/changelog +++ xserver-xorg-video-psb-0.20.0+repack/debian/changelog @@ -0,0 +1,436 @@ +xserver-xorg-video-psb (0.20.0+repack-0ubuntu1~804um1~dooz1) hardy; urgency=low + + * New upstream release. + - Repack tarball to drop the debian/ dir. + - Drop patch 107_firefox_fix, merged upstream with Xorg 1.4 ifdefs. + - Drop patch 108_smaller-exa-pixmaps, merged upstream. + - Note that this tarball uses a special Makefile.am.1.4 / Makefile.am.1.5 + mechanism (selection is made by autogen.sh) instead of an + AM_CONDITIONAL, so you need to run autogen.sh to use this package for + xorg-server >= 1.4.99 (this will disable the exa build); a patch to use + AM_CONDITIONAL was sent upstream. + + -- Loic Minier Wed, 14 Jan 2009 12:53:59 +0100 + +xserver-xorg-video-psb (0.16.0+repack-0ubuntu1~804um6) hardy; urgency=low + + * New patch, 108_smaller-exa-pixmaps, Use smaller EXA pixmaps; fixes a video + corruption in Mahjongg; LP: #262308 + + -- Loic Minier Thu, 20 Nov 2008 19:55:29 +0100 + +xserver-xorg-video-psb (0.16.0+repack-0ubuntu1~804um5) hardy; urgency=low + + * Workaround a bug in dpkg-divert fixed in dpkg 1.14.20 (Debian #476973, + #469033) by creating the target directory of the diversion before calling + dpkg-divert in preinst, and cleaning it up after the removal of the + diversion in postinst. + * Also set package name and script name in -dbg's postrm. + * Cleanup postrm/preinst snippet to use package name var. + + -- Loic Minier Tue, 18 Nov 2008 23:15:24 +0100 + +xserver-xorg-video-psb (0.16.0+repack-0ubuntu1~804um4) hardy; urgency=low + + * Remove file check for libexa in psb preinst as we want to install the + diversion in all cases. + * Also set THIS_PACKAGE and _SCRIPT in the -dbg preinst. + + -- Loic Minier Thu, 13 Nov 2008 20:55:18 +0100 + +xserver-xorg-video-psb (0.16.0+repack-0ubuntu1~804um3) hardy; urgency=low + + * Sprinkle THIS_{PACKAGE,SCRIPT} into the preinst/postrm. + * Guard adding the diversion in the preinst. + + -- Steve Kowalik Thu, 13 Nov 2008 15:54:55 +1100 + +xserver-xorg-video-psb (0.16.0+repack-0ubuntu1~804um2) hardy; urgency=low + + * Update xsfbs.mk from xorg-server 2:1.5.2-2ubuntu3; fixes generation of + maintainer scripts from .in template. + + -- Loic Minier Wed, 12 Nov 2008 10:20:27 +0100 + +xserver-xorg-video-psb (0.16.0+repack-0ubuntu1~804um1) hardy; urgency=low + + * Cleanup rules; don't set INSTALL_PROGRAM as we use dh_strip anyway; use + make -C $(dir) instead of cd $(dir) && make. + * Wrap build-deps and deps. + * Let the -dbg package depend on ${misc:Depends}. + * Add reminder on top of 106_gen_pci_ids to do things in a more sensible way + in a future upstream release. + * Pass -i and -s to dh_* calls in binary-indep and binary-arch. + * Drop unused patch 105_psb_drm_headers which used to add src/psb_drm.h + src/psb_drv.h src/psb_msvdx.h src/psb_reg.h src/psb_scene.h + src/psb_schedule.h. + * Bump up Standards-Version to 3.8.0. + * Also divert the detached debugging symbols in + /usr/lib/debug/usr/lib/xorg/modules for the libexa fork in the -dbg + package. + * Repack tarball and change version number to reflect this. + * Bump libdrm-dev bdep to 2.3.0.16-0ubuntu2~804um3 to pick the new PSB + version string. + + -- Loic Minier Fri, 07 Nov 2008 09:54:21 +0100 + +xserver-xorg-video-psb (0.16.0-0ubuntu1~804um1) hardy; urgency=low + + * New upstream release + + -- Bryce Harrington Thu, 06 Nov 2008 23:13:39 -0800 + +xserver-xorg-video-psb (0.16.0) unstable; urgency=low + + * D2_Build_1 + * Disable drm_bo memory caching to improve 2D performance + * Enable Overlay Plane to support downscaling + + -- John Ye Thu, 31 Jul 2008 13:45:21 +0800 + +xserver-xorg-video-psb (0.15.0-0ubuntu1~804um6) hardy; urgency=low + + * 107_firefox_fix.patch: Move DRI driverSwapMethod earlier to prevent + application crashes (LP: #273760) + + -- Bryce Harrington Sun, 19 Oct 2008 20:06:39 -0700 + +xserver-xorg-video-psb (0.15.0-0ubuntu1~804um5) hardy; urgency=low + + * Convert to xsfbs. + - Copy debian/xsfbs from vesa 1:2.0.0-1ubuntu3. + - Include xsfbs.mk. + - Update target deps. + - Drop config.status target. + - Drop quilt stuff. + - Fix confflags usage. + - Rename mantainer scripts to .in. + * Bdep on xserver-xorg-dev >= 2:1.4. + * Drop Xs-Vcs header, we're not using this repo. + * Append ~ to libxvmc-dev bdep which looks entirely bogus if you ask me. + * Recode copyright to utf-8. + + -- Loic Minier Wed, 15 Oct 2008 01:16:24 +0200 + +xserver-xorg-video-psb (0.15.0-0ubuntu1~804um4) hardy; urgency=low + + * Also remove the diversion on purge (if still diverted by this package). + + -- Loic Minier Sun, 07 Sep 2008 00:44:36 +0200 + +xserver-xorg-video-psb (0.15.0-0ubuntu1~804um3) hardy; urgency=low + + * Install the exa fork and dpkg-divert /usr/lib/xorg/modules/libexa.so in + preinst (unless already diverted). + + -- Loic Minier Sat, 06 Sep 2008 21:59:38 +0200 + +xserver-xorg-video-psb (0.15.0-0ubuntu1~804um2) hardy; urgency=low + + * Bump libdrm bdep to >= 2.3.0.16-0ubuntu2~804um1 to build against latest + version of the psb drm headers in there. + + -- Loic Minier Tue, 01 Jul 2008 15:11:30 +0200 + +xserver-xorg-video-psb (0.15.0-0ubuntu1~804um1) hardy; urgency=low + + * New upstream release: + - drop MIT License.txt + - configure.ac: bump version from 0.14.0 to 0.15.0 + - Upstream changes: + + D1_Build_7, 0.15.0, 2.1.0.32L.0019, no change since D1_Build_6 + + D1_Build_6, 0.15.0, 2.0.0.32L.0018 + + Fix the S3 bug when there are no any frame buffer driver is + loaded + + D1_Build_5, 0.14.0, 2.0.0.32L.0017, no change since D1_Build_4.1 + - exa/exa.c: fix fb_pitch related constant in exaCreatePixmap(); + supposedly fixes above mentionned S3 bug + + -- Bryce Harrington Fri, 27 Jun 2008 17:44:06 -0700 + +xserver-xorg-video-psb (0.15.0-2) unstable; urgency=low + + * D1_Build_7, 0.15.0, 2.1.0.32L.0019, no change since D1_Build_6 + + -- John Ye Tue, 17 Jun 2008 09:49:14 +0800 + +xserver-xorg-video-psb (0.15.0-1) unstable; urgency=low + + * D1_Build_6, 0.15.0, 2.0.0.32L.0018 + * Fix the S3 bug when there are no any frame buffer driver is loaded + + -- John Ye Fri, 13 Jun 2008 13:55:17 +0800 + +xserver-xorg-video-psb (0.14.0-1) unstable; urgency=low + + * D1_Build_5, 0.14.0, 2.0.0.32L.0017, no change since D1_Build_4.1 + + -- John Ye Fri, 06 Jun 2008 09:51:36 +0800 + +xserver-xorg-video-psb (0.14.0-0ubuntu1~804um1) hardy; urgency=low + + * New upstream release: + - added toplevel "MIT license.txt" + - bumped upstream version in configure from 0.13.0 to 0.14.0 + - commented out PSB_DEBUG() calls in src/psb_cursor.c + - src/psb_driver.c, src/psb_driver.h: + + added /dev/fb0 detection to save and restore vga regs on resume; + this is protected by the new WA_NOFB_GARBAGE_DISPLAY define which + is always set + + two other small undocumented changes, one related to locking, + another related to VT switching when the screen is closed + + version bump from 0.9 to 0.14 + - new debian/changelog entry "D1_Build_4.1, 0.14.0, 2.0.1.32L.0016" + + -- Bryce Harrington Mon, 16 Jun 2008 17:45:14 +0000 + +xserver-xorg-video-psb (0.14.0) unstable; urgency=low + + * D1_Build_4.1, 0.14.0, 2.0.1.32L.0016 + + -- John Ye Fri, 30 May 2008 00:14:38 +0800 + +xserver-xorg-video-psb (0.13.0ubuntu1~804um4) hardy; urgency=low + + * Disable 105_psb_drm_headers.patch, to move these headers back into libdrm. + + -- Bryce Harrington Wed, 28 May 2008 14:29:58 -0700 + +xserver-xorg-video-psb (0.13.0ubuntu1~804um3) hardy; urgency=low + + * Update 106_gen_pci_ids.patch to remove automake modification, quilt + and autotools don't get along well + * debian/rules: Install psb.ids by hand + + -- Steve Magoun Tue, 27 May 2008 16:38:34 -0400 + +xserver-xorg-video-psb (0.13.0ubuntu1~804um2) hardy; urgency=low + + * Add 106_gen_pci_ids.patch + - Add psb.ids to fix autodetection of PSB hardware (LP: #235288) + + -- Steve Magoun Tue, 27 May 2008 14:59:11 -0400 + +xserver-xorg-video-psb (0.13.0ubuntu1~804um1) hardy; urgency=low + + * New upstream release + * Add 105_psb_drm_headers.patch + - Kernel module header files from psb-kmd + * Drop 101_libdrm_headers.patch 102_xorg-psb-use-exa-2.1.patch + - disabled in previous build; no longer needed. + * Disable 103_psb_debugs.patch 104_disable_locks.diff + - Assuming changes are taken upstream and these are no longer needed + - If the problem booting up resumes, we may need these patches + + -- Bryce Harrington Thu, 15 May 2008 23:50:54 +0000 + +xserver-xorg-video-psb (0.13.0-1) unstable; urgency=low + + * D1_Build_4, no change since D1_Build_3 + + -- James Xu Tue, 20 May 2008 12:04:55 +0800 + +xserver-xorg-video-psb (0.13.0) unstable; urgency=low + + * D1_Build_3 + + -- Waldo Bastian Tue, 22 Apr 2008 15:23:04 -0700 + +xserver-xorg-video-psb (0.12.0) unstable; urgency=low + + * D1_Build_2.7 + + -- John Ye Mon, 14 Apr 2008 19:50:36 +0800 + +xserver-xorg-video-psb (0.11.0) unstable; urgency=low + + * D1_Build_2.6, no change since D1_Build_2.5 + + -- John Ye Mon, 7 Apr 2008 12:32:36 -0700 + +xserver-xorg-video-psb (0.10.0) unstable; urgency=low + + * D1_Build_2.5 + + -- John Ye Tue, 1 Apr 2008 08:45:36 -0700 + +xserver-xorg-video-psb (0.9.0) unstable; urgency=low + + * Beta9 + + -- Waldo Bastian Wed, 12 Mar 2008 17:23:21 -0700 + +xserver-xorg-video-psb (0.8.0) unstable; urgency=low + + * Beta8 + + -- Waldo Bastian Wed, 20 Feb 2008 15:07:31 -0800 + +xserver-xorg-video-psb (0.7.0) unstable; urgency=low + + * Beta7 + + -- Waldo Bastian Wed, 16 Jan 2008 09:54:58 -0800 + +xserver-xorg-video-psb (0.6.0) unstable; urgency=low + + * Beta6, changed package name from xf86-video-psb to xserver-xorg-video-psb + + -- Waldo Bastian Wed, 16 Jan 2008 09:54:58 -0800 + +xserver-xorg-video-psb (0.6.0) unstable; urgency=low + + * Beta6 + + -- Waldo Bastian Fri, 11 Jan 2008 16:42:31 -0800 + +xserver-xorg-video-psb (0.4.0) unstable; urgency=low + + * Beta5 + + -- Waldo Bastian Tue, 18 Dec 2007 10:43:06 -0800 + +xserver-xorg-video-psb (0.3.0) unstable; urgency=low + + * Beta4 + + -- Waldo Bastian Tue, 04 Dec 2007 12:02:06 -0800 + +xserver-xorg-video-psb (0.2.8-0ubuntu1~804um1) hardy; urgency=low + + * Beta09 + + -- Inuka Gunawardana Tue, 15 Apr 2008 11:58:07 -0700 + +xserver-xorg-video-psb (0.2.7-0ubuntu1~804um3) hardy; urgency=low + + * Update libdrm dependency + + -- Steve Magoun Wed, 13 Feb 2008 17:21:49 -0500 + +xserver-xorg-video-psb (0.2.7-0ubuntu1~804um2) hardy; urgency=low + + * Add patch to work around hang on startup + + -- Steve Magoun Tue, 12 Feb 2008 18:31:52 -0500 + +xserver-xorg-video-psb (0.2.7-0ubuntu1~804um1) hardy; urgency=low + + * Packaging of beta6 for ubuntu-mobile Hardy + + -- Bryce Harrington Tue, 29 Jan 2008 20:49:31 -0800 + +xserver-xorg-video-psb (0.2.6-0ubuntu1~804um1) hardy; urgency=low + + * debian/patches/103_psb_debugs.patch: Additional debug output for + code following our last known info message in Xorg.0.log. This is + intended to help track down the X lockup on psb we're seeing + currently. + * Drop Intel workaround for building on Gutsy, which causes -psb's + libexa to be copied atop the stock xserver's libexa. This + workaround is not necessary on Hardy, and could lead to other + breakage potentially. + * Re-enabling patch 100 in debian/patches/series - it had been disabled + in ~psb1, but appears necessary to build libmm. Leave patch 102 + disabled (only needed for building against an EXA 2.1 server). Leave + patch 103 disabled since we have a newer libdrm-dev dependency. + + -- Bryce Harrington Tue, 15 Jan 2008 20:23:43 -0800 + +xserver-xorg-video-psb (0.2.6-0ubuntu1~psb2) gutsy; urgency=low + + * Correct version number for libdrm dependancy. + + -- Steve Kowalik Mon, 14 Jan 2008 23:09:02 +1100 + +xserver-xorg-video-psb (0.2.6-0ubuntu1~psb1) gutsy; urgency=low + + * Merging new release from Intel. Remaining changes: + - Replace debian/ dir with one appropriate for Debian + - debian/control: + - Added XS-Vcs-Git (https://wiki.ubuntu.com/XS-Vcs) + - Maintainer change for Ubuntu + - Change xf86- to xserver-xorg- + - Build for the lpia architecture + - debian/patches/ + - Rename 00_xorg_headers.patch to 100_xorg_headers.patch + - 101_libdrm_headers.patch: Header files from libdrm needed + by libmm to build + - 102_xorg-psb-use-exa-2.1.patch: Fix issue where -psb + requires EXA 2.2, but only EXA 2.1 is available in Gutsy. + * Updated standards version to 3.7.3 + * Updated patch 102_xorg-psb-use-exa-2.1.patch for current source + (else FTBS) + * Dropping debian/TODO: out of date + * Add -dbg target for debugging symbols + + -- Bryce Harrington Thu, 10 Jan 2008 13:49:53 -0800 + +xserver-xorg-video-psb (0.2.6) unstable; urgency=low + + * Beta3 + + -- Waldo Bastian Tue, 13 Nov 2007 18:36:11 -0800 + +xserver-xorg-video-psb (0.2.5) unstable; urgency=low + + * Beta2 + + -- Waldo Bastian Thu, 25 Oct 2007 17:29:32 -0700 + +xserver-xorg-video-psb (0.2.4) unstable; urgency=low + + * Beta1 + + -- Waldo Bastian Thu, 11 Oct 2007 18:52:18 -0700 + +xserver-xorg-video-psb (0.2.3) unstable; urgency=low + + * Engineering drop of TG 09/25 2D graphics driver + + -- Waldo Bastian Thu, 04 Oct 2007 14:47:15 -0700 + +xserver-xorg-video-psb (0.2.2) unstable; urgency=low + + * Alpha-2 release of 2D graphics driver for Poulsbo + + -- Chunfeng Zhao Fri, 24 Aug 2007 14:51:12 -0700 + +xserver-xorg-video-psb (0.2.1-1ubuntu3) gutsy; urgency=low + + [Steve Magoun ] + * debian/patches/102_xorg-psb-use-exa-2.1.patch: Fix issue where -psb + requires EXA 2.2, but only EXA 2.1 is available in Gutsy. + - Fix for building with EXA 2.1 + - Build against system exa.h rather than internal version + - Disable build of internal exa.h, it's not used + + -- Bryce Harrington Thu, 6 Sep 2007 21:20:15 -0700 + +xserver-xorg-video-psb (0.2.1-1ubuntu2) gutsy; urgency=low + + * Build for the lpia architecture. + + -- Matthias Klose Wed, 29 Aug 2007 16:41:09 +0000 + +xserver-xorg-video-psb (0.2.1-1ubuntu1) gutsy; urgency=low + + * Initial release for Ubuntu + * debian/control: + - Added XS-Vcs-Git (https://wiki.ubuntu.com/XS-Vcs) + - Maintainer change for Ubuntu + - Change xf86- to xserver-xorg- + - Upped Build-Depends to require libdrm >= 2.3.0-4ubuntu1 due to + need of the psb additions to libdrm + * debian/patches/ + - Rename 00_xorg_headers.patch to 100_xorg_headers.patch + - Added 101_libdrm_headers.patch: Header files from libdrm needed by libmm to build + + -- Bryce Harrington Thu, 2 Aug 2007 13:46:12 -0700 + +xserver-xorg-video-psb (0.2.1-1) unstable; urgency=low + + * Alpha-1 release of 2D graphics driver for Poulsbo + + -- Chunfeng Zhao Wed, 20 Jun 2007 11:21:36 -0700 + --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/rules +++ xserver-xorg-video-psb-0.20.0+repack/debian/rules @@ -0,0 +1,90 @@ +#!/usr/bin/make -f + +include debian/xsfbs/xsfbs.mk + +DRIVER := xserver-xorg-video-psb + +CFLAGS += -Wall -g -O$(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),0,2) + +DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) +confflags += --build=$(DEB_BUILD_GNU_TYPE) +else +confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE) +endif + +confflags += \ + --prefix=/usr \ + --mandir=\$${prefix}/share/man \ + --infodir=\$${prefix}/share/info + +build: patch build-stamp +build-stamp: + dh_testdir + test -d obj-$(DEB_BUILD_GNU_TYPE) || mkdir obj-$(DEB_BUILD_GNU_TYPE) + cd obj-$(DEB_BUILD_GNU_TYPE) && \ + ../configure $(confflags) CFLAGS="$(CFLAGS)" + $(MAKE) -C obj-$(DEB_BUILD_GNU_TYPE) + touch $@ + +clean: xsfclean + dh_testdir + dh_testroot + rm -f build-stamp + rm -f config.cache config.log config.status + rm -f */config.cache */config.log */config.status + rm -f conftest* */conftest* + rm -rf autom4te.cache */autom4te.cache + rm -rf obj-* + rm -f Makefile config.h stamp-* + dh_clean + +scripts: stamp-scripts +stamp-scripts: genscripts validatescripts + touch $@ + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + $(MAKE) -C obj-$(DEB_BUILD_GNU_TYPE) DESTDIR=$(CURDIR)/debian/tmp install + # Ew... + install -m644 -D src/psb.ids $(CURDIR)/debian/tmp/usr/share/xserver-xorg/pci/psb.ids + +binary-arch: build install serverabi + dh_testdir + dh_testroot + dh_installdocs -s + dh_installchangelogs -s + dh_install -s --sourcedir=$(CURDIR)/debian/tmp --list-missing --exclude=.la --exclude=usr/share/man/man4 + dh_installman -s + dh_link -s + dh_strip -s --dbg-package=$(DRIVER)-dbg + dh_compress -s + dh_fixperms -s + dh_makeshlibs -s + dh_shlibdeps -s + dh_installdeb -s + dh_gencontrol -s + dh_md5sums -s + dh_builddeb -s + +binary-indep: build install + dh_testdir + dh_testroot + dh_installdocs -i + dh_installchangelogs -i + dh_link -i + dh_compress -i + dh_fixperms -i + dh_installdeb -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/compat +++ xserver-xorg-video-psb-0.20.0+repack/debian/compat @@ -0,0 +1 @@ +5 --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/xserver-xorg-video-psb.install +++ xserver-xorg-video-psb-0.20.0+repack/debian/xserver-xorg-video-psb.install @@ -0,0 +1,4 @@ +usr/lib/xorg/modules/drivers/psb_drv.* +usr/lib/xorg/modules/drivers/libmm.* +usr/lib/xorg/modules/libexa.* +usr/share/xserver-xorg/pci/* --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/control +++ xserver-xorg-video-psb-0.20.0+repack/debian/control @@ -0,0 +1,52 @@ +Source: xserver-xorg-video-psb +Section: x11 +Priority: optional +Maintainer: Ubuntu MOTU Developers +XSBC-Original-Maintainer: Chunfeng Zhao +Build-Depends: libdrm-dev (>= 2.3.0.16-0ubuntu2~804um3) [!hurd-i386], + debhelper (>= 5), + quilt (>= 0.40), + pkg-config, + xserver-xorg-dev (>= 2:1.4), + x11proto-gl-dev, + x11proto-video-dev, + libgl1-mesa-dev | libgl-dev, + libxvmc-dev (>= 1:1.0.1-1~), + x11proto-core-dev, + x11proto-fonts-dev, + x11proto-randr-dev, + x11proto-render-dev, + x11proto-xinerama-dev, + x11proto-xf86dri-dev, + x11proto-xf86dga-dev, + x11proto-xf86misc-dev +Standards-Version: 3.8.0 + +Package: xserver-xorg-video-psb +Architecture: i386 lpia +Depends: ${shlibs:Depends}, + ${misc:Depends}, + libdrm2 (>= 2.3.0-4ubuntu2~psb1) +Provides: ${xviddriver:Provides} +Replaces: xserver-xorg (<< 6.8.2-35), + xserver-xorg-driver-psb +Description: 2D graphics driver for Poulsbo + This package provides the driver for the Intel Poulsbo 2D graphics + driver for the Poulsbo family of embedded graphics chips. + . + More information about the Poulsbo chipset can be found at: + + + . + This package is built from the moblin.org xf86-video-psb driver + module. + +Package: xserver-xorg-video-psb-dbg +Architecture: i386 lpia +Depends: xserver-xorg-video-psb (= ${binary:Version}), + ${misc:Depends} +Priority: extra +Description: 2D graphics driver for Poulsbo (debugging symbols) + This package provides debugging symbols for the Intel Poulsbo 2D + graphics driver for the Poulsbo family of embedded graphics chips. + --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/xserver-xorg-video-psb-dbg.postrm.in +++ xserver-xorg-video-psb-0.20.0+repack/debian/xserver-xorg-video-psb-dbg.postrm.in @@ -0,0 +1,22 @@ +#!/bin/sh + +set -e + +THIS_PACKAGE=xserver-xorg-video-psb-dbg +THIS_SCRIPT=postrm + +#DEBHELPER# + +# remove the diversion on purge if still diverted by this package +file="/usr/lib/debug/usr/lib/xorg/modules/libexa.so" +divert="/usr/lib/xorg/modules/libexa.so.$THIS_PACKAGE" +if [ "$1" = "purge" ] && LC_ALL=C dpkg-divert --list "$file" | grep -q " by $THIS_PACKAGE\$"; then + dpkg-divert \ + --package "$THIS_PACKAGE" \ + --rename \ + --remove "$file" || true +fi +# remove the dir we created due to dpkg-divert bugs before 1.14.20; Debian +# #476973, #469033 +rmdir --ignore-fail-on-non-empty -p "$(dirname "$divert")" + --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/copyright +++ xserver-xorg-video-psb-0.20.0+repack/debian/copyright @@ -0,0 +1,167 @@ +This package was debianized by Calvin Zhao on +Wed, 20 Jun 2007 11:21:36 -0700. + +It was snapshotted from git via +rsync://moblin.org/repos/projects/xf86-video-psb.git + +It was originally authored by Tungsten Graphics under contract to Intel, +based on code from the XFree86 Project Inc. Intel Corp. is the +principle copyright holder and primary code maintainer. + + +Upstream Maintainer: + Intel Corporation (maintained at moblin.org) + +Copyright Holders: + Copyright 1998-1999 Precision Insight, Inc., Cedar Park, TX + Copyright © 1999, 2001 Keith Packard + Copyright © 2002 David Dawes + Copyright © 2003 Anders Carlsson + Copyright © 2006-2007 Intel Corporation + Copyright 2006-2007 Tungsten Graphics, Inc., Cedar Park, TX + Copyright 2006 Dave Airlie + Copyright 2006 Thomas Hellstrom. + Partly based on code that is Copyright © The XFree86 Project Inc. + + +------------------------------------------------------------------------ + +Copyright (c) Intel Corp. 2007. +All Rights Reserved. + +Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to +develop this driver. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS +AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + + +------------------------------------------------------------------------ + +Copyright (C) 2000 Keith Packard + 2004 Eric Anholt + 2005 Zack Rusin + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of copyright holders not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. Copyright holders +make no representations about the suitability of this software for any +purpose. It is provided "as is" without express or implied warranty. + +THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY +SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +------------------------------------------------------------------------ + +Copyright 2006 Dave Airlie + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation on the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND/OR THEIR +SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + +------------------------------------------------------------------------ + +Copyright 2006-2007 Tungsten Graphics, Inc., Cedar Park, TX., USA. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS +AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + + +------------------------------------------------------------------------ + +Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sub license, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice (including the +next paragraph) shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. +IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR +ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +------------------------------------------------------------------------ + + +The Debian packaging is (C) 2007, Intel Corporation and +is licensed under the GPL, see `/usr/share/common-licenses/GPL'. + + + --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/xserver-xorg-video-psb-dbg.preinst.in +++ xserver-xorg-video-psb-0.20.0+repack/debian/xserver-xorg-video-psb-dbg.preinst.in @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +THIS_PACKAGE=xserver-xorg-video-psb-dbg +THIS_SCRIPT=preinst + +# install the diversion if no diversion installed yet +file="/usr/lib/debug/usr/lib/xorg/modules/libexa.so" +divert="$file.$THIS_PACKAGE" +# create the dir first due to dpkg-divert bugs before 1.14.20; Debian #476973, +# #469033 +mkdir -p "$(dirname "$divert")" +if [ "$(dpkg-divert --list "$file")" = "" ]; then + dpkg-divert \ + --package "$THIS_PACKAGE" \ + --divert "$divert" \ + --rename \ + --add "$file" +fi + +#DEBHELPER# + --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/xserver-xorg-video-psb.preinst.in +++ xserver-xorg-video-psb-0.20.0+repack/debian/xserver-xorg-video-psb.preinst.in @@ -0,0 +1,23 @@ +#!/bin/sh + +set -e + +THIS_PACKAGE=xserver-xorg-video-psb +THIS_SCRIPT=preinst + +# install the diversion if no diversion installed yet +file="/usr/lib/xorg/modules/libexa.so" +divert="$file.$THIS_PACKAGE" +# create the dir first due to dpkg-divert bugs before 1.14.20; Debian #476973, +# #469033 +mkdir -p "$(dirname "$divert")" +if [ "$(dpkg-divert --list "$file")" = "" ]; then + dpkg-divert \ + --package "$THIS_PACKAGE" \ + --divert "$divert" \ + --rename \ + --add "$file" +fi + +#DEBHELPER# + --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/xsfbs/xsfbs.mk +++ xserver-xorg-video-psb-0.20.0+repack/debian/xsfbs/xsfbs.mk @@ -0,0 +1,293 @@ +#!/usr/bin/make -f + +# Debian X Strike Force Build System (XSFBS): Make portion + +# Copyright 1996 Stephen Early +# Copyright 1997 Mark Eichin +# Copyright 1998-2005, 2007 Branden Robinson +# Copyright 2005 David Nusinow +# +# Licensed under the GNU General Public License, version 2. See the file +# /usr/share/common-licenses/GPL or . + +# Originally by Stephen Early +# Modified by Mark W. Eichin +# Modified by Adam Heath +# Modified by Branden Robinson +# Modified by Fabio Massimo Di Nitto +# Modified by David Nusinow +# Acknowledgements to Manoj Srivastava. + +# Pass $(DH_OPTIONS) into the environment for debhelper's benefit. +export DH_OPTIONS + +# force quilt to not use ~/.quiltrc and to use debian/patches +QUILT = QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null + +# Set up parameters for the upstream build environment. + +# Determine (source) package name from Debian changelog. +SOURCE_NAME:=$(shell dpkg-parsechangelog -ldebian/changelog \ + | grep '^Source:' | awk '{print $$2}') + +# Determine package version from Debian changelog. +SOURCE_VERSION:=$(shell dpkg-parsechangelog -ldebian/changelog \ + | grep '^Version:' | awk '{print $$2}') + +# Determine upstream version number. +UPSTREAM_VERSION:=$(shell echo $(SOURCE_VERSION) | sed 's/-.*//') + +# Determine the source version without the epoch for make-orig-tar-gz +NO_EPOCH_VER:=$(shell echo $(UPSTREAM_VERSION) | sed 's/^.://') + +# Figure out who's building this package. +BUILDER:=$(shell echo $${DEBEMAIL:-$${EMAIL:-$$(echo $$LOGNAME@$$(cat /etc/mailname 2>/dev/null))}}) + +# Find out if this is an official build; an official build has nothing but +# digits, dots, and/or the codename of a release in the Debian part of the +# version number. Anything else indicates an unofficial build. +OFFICIAL_BUILD:=$(shell VERSION=$(SOURCE_VERSION); if ! expr "$$(echo $${VERSION\#\#*-} | sed 's/\(woody\|sarge\|etch\|lenny\)//g')" : ".*[^0-9.].*" >/dev/null 2>&1; then echo yes; fi) + +# Set up parameters for the Debian build environment. + +# Determine our architecture. +BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) +# Work around some old-time dpkg braindamage. +BUILD_ARCH:=$(subst i486,i386,$(BUILD_ARCH)) +# The DEB_HOST_ARCH variable may be set per the Debian cross-compilation policy. +ifdef DEB_HOST_ARCH + ARCH:=$(DEB_HOST_ARCH) +else + # dpkg-cross sets the ARCH environment variable; if set, use it. + ifdef ARCH + ARCH:=$(ARCH) + else + ARCH:=$(BUILD_ARCH) + endif +endif + +# $(STAMP_DIR) houses stamp files for complex targets. +STAMP_DIR:=stampdir + +# $(DEBTREEDIR) is where all install rules are told (via $(DESTDIR)) to place +# their files. +DEBTREEDIR:=$(CURDIR)/debian/tmp + +# All "important" targets have four lines: +# 1) A target name that is invoked by a package-building tool or the user. +# This consists of a dependency on a "$(STAMP_DIR)/"-prefixed counterpart. +# 2) A line delcaring 1) as a phony target (".PHONY:"). +# 3) A "$(STAMP_DIR)/"-prefixed target which does the actual work, and may +# depend on other targets. +# 4) A line declaring 3) as a member of the $(stampdir_targets) variable; the +# "$(STAMP_DIR)/" prefix is omitted. +# +# This indirection is needed so that the "stamp" files that signify when a rule +# is done can be located in a separate "stampdir". Recall that make has no way +# to know when a goal has been met for a phony target (like "build" or +# "install"). +# +# At the end of each "$(STAMP_DIR)/" target, be sure to run the command ">$@" +# so that the target will not be run again. Removing the file will make Make +# run the target over. + +# All phony targets should be declared as dependencies of .PHONY, even if they +# do not have "($STAMP_DIR)/"-prefixed counterparts. + +# Define a harmless default rule to keep things from going nuts by accident. +.PHONY: default +default: + +# Set up the $(STAMP_DIR) directory. +.PHONY: stampdir +stampdir_targets+=stampdir +stampdir: $(STAMP_DIR)/stampdir +$(STAMP_DIR)/stampdir: + mkdir $(STAMP_DIR) + >$@ + +# Set up the package build directory as quilt expects to find it. +.PHONY: prepare +stampdir_targets+=prepare +prepare: $(STAMP_DIR)/prepare +$(STAMP_DIR)/prepare: $(STAMP_DIR)/log $(STAMP_DIR)/genscripts + >$@ + +.PHONY: log +stampdir_targets+=log +log: $(STAMP_DIR)/log +$(STAMP_DIR)/log: $(STAMP_DIR)/stampdir + mkdir -p $(STAMP_DIR)/log + +# Apply all patches to the upstream source. +.PHONY: patch +stampdir_targets+=patch +patch: $(STAMP_DIR)/patch +$(STAMP_DIR)/patch: $(STAMP_DIR)/prepare + if ! [ `which quilt` ]; then \ + echo "Couldn't find quilt. Please install it or add it to the build-depends for this package."; \ + exit 1; \ + fi; \ + if $(QUILT) next >/dev/null 2>&1; then \ + echo -n "Applying patches..."; \ + if $(QUILT) push -a -v >$(STAMP_DIR)/log/patch 2>&1; then \ + cat $(STAMP_DIR)/log/patch; \ + echo "successful."; \ + else \ + cat $(STAMP_DIR)/log/patch; \ + echo "failed! (check $(STAMP_DIR)/log/patch for details)"; \ + exit 1; \ + fi; \ + else \ + echo "No patches to apply"; \ + fi; \ + >$@ + +# Revert all patches to the upstream source. +.PHONY: unpatch +unpatch: $(STAMP_DIR)/log + rm -f $(STAMP_DIR)/patch + @echo -n "Unapplying patches..."; \ + if $(QUILT) applied >/dev/null 2>/dev/null; then \ + if $(QUILT) pop -a -v >$(STAMP_DIR)/log/unpatch 2>&1; then \ + cat $(STAMP_DIR)/log/unpatch; \ + echo "successful."; \ + else \ + cat $(STAMP_DIR)/log/unpatch; \ + echo "failed! (check $(STAMP_DIR)/log/unpatch for details)"; \ + exit 1; \ + fi; \ + else \ + echo "nothing to do."; \ + fi + +# Clean the generated maintainer scripts. +.PHONY: cleanscripts +cleanscripts: + rm -f $(STAMP_DIR)/genscripts + rm -f debian/*.config \ + debian/*.postinst \ + debian/*.postrm \ + debian/*.preinst \ + debian/*.prerm + +# Clean the package build tree. +.PHONY: xsfclean +xsfclean: cleanscripts unpatch + dh_testdir + rm -rf .pc + rm -rf $(STAMP_DIR) $(SOURCE_DIR) + rm -rf imports + dh_clean debian/shlibs.local \ + debian/po/pothead + +# Generate the debconf templates POT file header. +debian/po/pothead: debian/po/pothead.in + sed -e 's/SOURCE_VERSION/$(SOURCE_VERSION)/' \ + -e 's/DATE/$(shell date "+%F %X%z"/)' <$< >$@ + +# Update POT and PO files. +.PHONY: updatepo +updatepo: debian/po/pothead + debian/scripts/debconf-updatepo --pot-header=pothead --verbose + +# Remove files from the upstream source tree that we don't need, or which have +# licensing problems. It must be run before creating the .orig.tar.gz. +# +# Note: This rule is for Debian package maintainers' convenience, and is not +# needed for conventional build scenarios. +.PHONY: prune-upstream-tree +prune-upstream-tree: + # Ensure we're in the correct directory. + dh_testdir + grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf + +# Verify that there are no offsets or fuzz in the patches we apply. +# +# Note: This rule is for Debian package maintainers' convenience, and is not +# needed for conventional build scenarios. +.PHONY: patch-audit +patch-audit: prepare unpatch + @echo -n "Auditing patches..."; \ + >$(STAMP_DIR)/log/patch; \ + FUZZY=; \ + while [ -n "$$($(QUILT) next)" ]; do \ + RESULT=$$($(QUILT) push -v | tee -a $(STAMP_DIR)/log/patch | grep ^Hunk | sed 's/^Hunk.*\(succeeded\|FAILED\).*/\1/');\ + case "$$RESULT" in \ + succeeded) \ + echo "fuzzy patch: $$($(QUILT) top)" \ + | tee -a $(STAMP_DIR)/log/$$($(QUILT) top); \ + FUZZY=yes; \ + ;; \ + FAILED) \ + echo "broken patch: $$($(QUILT) next)" \ + | tee -a $(STAMP_DIR)/log/$$($(QUILT) next); \ + exit 1; \ + ;; \ + esac; \ + done; \ + if [ -n "$$FUZZY" ]; then \ + echo "there were fuzzy patches; please fix."; \ + exit 1; \ + else \ + echo "done."; \ + fi + +# Generate the maintainer scripts. +.PHONY: genscripts +stampdir_targets+=genscripts +genscripts: $(STAMP_DIR)/genscripts +$(STAMP_DIR)/genscripts: $(STAMP_DIR)/stampdir + for FILE in debian/*.config.in \ + debian/*.postinst.in \ + debian/*.postrm.in \ + debian/*.preinst.in \ + debian/*.prerm.in; do \ + if [ -e "$$FILE" ]; then \ + MAINTSCRIPT=$$(echo $$FILE | sed 's/.in$$//'); \ + sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' <$$FILE \ + | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >$$MAINTSCRIPT.tmp; \ + cat debian/xsfbs/xsfbs.sh >>$$MAINTSCRIPT.tmp; \ + sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' <$$FILE \ + | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >>$$MAINTSCRIPT.tmp; \ + sed -e 's/@SOURCE_VERSION@/$(SOURCE_VERSION)/' \ + -e 's/@OFFICIAL_BUILD@/$(OFFICIAL_BUILD)/' \ + -e 's/@DEFAULT_DCRESOLUTIONS@/$(DEFAULT_DCRESOLUTIONS)/' \ + <$$MAINTSCRIPT.tmp >$$MAINTSCRIPT; \ + rm $$MAINTSCRIPT.tmp; \ + fi; \ + done + # Validate syntax of generated shell scripts. + #sh debian/scripts/validate-posix-sh debian/*.config \ + # debian/*.postinst \ + # debian/*.postrm \ + # debian/*.preinst \ + # debian/*.prerm + >$@ + +# Generate the shlibs.local file. +debian/shlibs.local: + cat debian/*.shlibs >$@ + +SERVERMINVERS = $(shell cat /usr/share/xserver-xorg/serverminver 2>/dev/null) +VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null) +INPUTABI = $(shell cat /usr/share/xserver-xorg/inputabiver 2>/dev/null) +SERVER_DEPENDS = xserver-xorg-core (>= $(SERVERMINVERS)) +VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI) +INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI) +ifeq ($(PACKAGE),) +PACKAGE=$(shell awk '/^Package:/ { print $$2; exit }' < debian/control) +endif + +.PHONY: serverabi +serverabi: install +ifeq ($(SERVERMINVERS),) + @echo error: xserver-xorg-dev needs to be installed + @exit 1 +else + echo "xserver:Depends=$(SERVER_DEPENDS)" >> debian/$(PACKAGE).substvars + echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars + echo "xinpdriver:Provides=$(INPDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars +endif + +# vim:set noet ai sts=8 sw=8 tw=0: --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/xsfbs/xsfbs.sh +++ xserver-xorg-video-psb-0.20.0+repack/debian/xsfbs/xsfbs.sh @@ -0,0 +1,931 @@ +# $Id$ + +# This is the X Strike Force shell library for X Window System package +# maintainer scripts. It serves to define shell functions commonly used by +# such packages, and performs some error checking necessary for proper operation +# of those functions. By itself, it does not "do" much; the maintainer scripts +# invoke the functions defined here to accomplish package installation and +# removal tasks. + +# If you are reading this within a Debian package maintainer script (e.g., +# /var/lib/dpkg)info/PACKAGE.{config,preinst,postinst,prerm,postrm}), you can +# skip past this library by scanning forward in this file to the string +# "GOBSTOPPER". + +SOURCE_VERSION=@SOURCE_VERSION@ +OFFICIAL_BUILD=@OFFICIAL_BUILD@ + +# Use special abnormal exit codes so that problems with this library are more +# easily tracked down. +SHELL_LIB_INTERNAL_ERROR=86 +SHELL_LIB_THROWN_ERROR=74 +SHELL_LIB_USAGE_ERROR=99 + +# old -> new variable names +if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then + DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE" +fi +if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then + DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF" +fi + +# initial sanity checks +if [ -z "$THIS_PACKAGE" ]; then + cat >&2 < on the World Wide Web for +instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the +"doc-debian" package, or install the "reportbug" package and use the command of +the same name to file a report against version $SOURCE_VERSION of this package. +EOF + exit $SHELL_LIB_USAGE_ERROR +fi + +if [ -z "$THIS_SCRIPT" ]; then + cat >&2 < on the World Wide Web for +instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the +"doc-debian" package, or install the "reportbug" package and use the command of +the same name to file a report against version $SOURCE_VERSION of the +"$THIS_PACKAGE" package. +EOF + exit $SHELL_LIB_USAGE_ERROR +fi + +ARCHITECTURE="$(dpkg --print-installation-architecture)" + +if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then + RECONFIGURE="true" +else + RECONFIGURE= +fi + +if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then + FIRSTINST="yes" +fi + +if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then + UPGRADE="yes" +fi + +trap "message;\ + message \"Received signal. Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\ + message;\ + exit 1" HUP INT QUIT TERM + +reject_nondigits () { + # syntax: reject_nondigits [ operand ... ] + # + # scan operands (typically shell variables whose values cannot be trusted) for + # characters other than decimal digits and barf if any are found + while [ -n "$1" ]; do + # does the operand contain anything but digits? + if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then + # can't use die(), because it wraps message() which wraps this function + echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \ + "possibly malicious garbage \"$1\"" >&2 + exit $SHELL_LIB_THROWN_ERROR + fi + shift + done +} + +reject_whitespace () { + # syntax: reject_whitespace [ operand ] + # + # scan operand (typically a shell variable whose value cannot be trusted) for + # whitespace characters and barf if any are found + if [ -n "$1" ]; then + # does the operand contain any whitespace? + if expr "$1" : "[[:space:]]" > /dev/null 2>&1; then + # can't use die(), because I want to avoid forward references + echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_whitespace() encountered" \ + "possibly malicious garbage \"$1\"" >&2 + exit $SHELL_LIB_THROWN_ERROR + fi + fi +} + +reject_unlikely_path_chars () { + # syntax: reject_unlikely_path_chars [ operand ... ] + # + # scan operands (typically shell variables whose values cannot be trusted) for + # characters unlikely to be seen in a path and which the shell might + # interpret and barf if any are found + while [ -n "$1" ]; do + # does the operand contain any funny characters? + if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then + # can't use die(), because I want to avoid forward references + echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \ + "encountered possibly malicious garbage \"$1\"" >&2 + exit $SHELL_LIB_THROWN_ERROR + fi + shift + done +} + +# Query the terminal to establish a default number of columns to use for +# displaying messages to the user. This is used only as a fallback in the +# event the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while +# the script is running, and this cannot, only being calculated once.) +DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true +if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then + DEFCOLUMNS=80 +fi + +message () { + # pretty-print messages of arbitrary length + reject_nondigits "$COLUMNS" + echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2 +} + +observe () { + # syntax: observe message ... + # + # issue observational message suitable for logging someday when support for + # it exists in dpkg + if [ -n "$DEBUG_XORG_PACKAGE" ]; then + message "$THIS_PACKAGE $THIS_SCRIPT note: $*" + fi +} + +warn () { + # syntax: warn message ... + # + # issue warning message suitable for logging someday when support for + # it exists in dpkg; also send to standard error + message "$THIS_PACKAGE $THIS_SCRIPT warning: $*" +} + +die () { + # syntax: die message ... + # + # exit script with error message + message "$THIS_PACKAGE $THIS_SCRIPT error: $*" + exit $SHELL_LIB_THROWN_ERROR +} + +internal_error () { + # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message + message "internal error: $*" + if [ -n "$OFFICIAL_BUILD" ]; then + message "Please report a bug in the $THIS_SCRIPT script of the" \ + "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \ + "Tracking System. Include all messages above that mention the" \ + "$THIS_PACKAGE package. Visit " \ + " on the World Wide Web for" \ + "instructions, read the file" \ + "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \ + "package, or install the reportbug package and use the command of" \ + "the same name to file a report." + fi + exit $SHELL_LIB_INTERNAL_ERROR +} + +usage_error () { + message "usage error: $*" + message "Please report a bug in the $THIS_SCRIPT script of the" \ + "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \ + "Tracking System. Include all messages above that mention the" \ + "$THIS_PACKAGE package. Visit " \ + " on the World Wide Web for" \ + "instructions, read the file" \ + "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \ + "package, or install the reportbug package and use the command of" \ + "the same name to file a report." + exit $SHELL_LIB_USAGE_ERROR +} + + +maplink () { + # returns what symlink should point to; i.e., what the "sane" answer is + # Keep this in sync with the debian/*.links files. + # This is only needed for symlinks to directories. + # + # XXX: Most of these look wrong in the X11R7 world and need to be fixed. + # If we've stopped using this function, fixing it might enable us to re-enable + # it again and catch more errors. + case "$1" in + /etc/X11/xkb/compiled) echo /var/lib/xkb ;; + /etc/X11/xkb/xkbcomp) echo /usr/X11R6/bin/xkbcomp ;; + /usr/X11R6/lib/X11/app-defaults) echo /etc/X11/app-defaults ;; + /usr/X11R6/lib/X11/fs) echo /etc/X11/fs ;; + /usr/X11R6/lib/X11/lbxproxy) echo /etc/X11/lbxproxy ;; + /usr/X11R6/lib/X11/proxymngr) echo /etc/X11/proxymngr ;; + /usr/X11R6/lib/X11/rstart) echo /etc/X11/rstart ;; + /usr/X11R6/lib/X11/twm) echo /etc/X11/twm ;; + /usr/X11R6/lib/X11/xdm) echo /etc/X11/xdm ;; + /usr/X11R6/lib/X11/xinit) echo /etc/X11/xinit ;; + /usr/X11R6/lib/X11/xkb) echo /etc/X11/xkb ;; + /usr/X11R6/lib/X11/xserver) echo /etc/X11/xserver ;; + /usr/X11R6/lib/X11/xsm) echo /etc/X11/xsm ;; + /usr/bin/X11) echo ../X11R6/bin ;; + /usr/bin/rstartd) echo ../X11R6/bin/rstartd ;; + /usr/include/X11) echo ../X11R6/include/X11 ;; + /usr/lib/X11) echo ../X11R6/lib/X11 ;; + *) internal_error "maplink() called with unknown path \"$1\"" ;; + esac +} + +analyze_path () { + # given a supplied set of pathnames, break each one up by directory and do an + # ls -dl on each component, cumulatively; i.e. + # analyze_path /usr/X11R6/bin -> ls -dl /usr /usr/X11R6 /usr/X11R6/bin + # Thanks to Randolph Chung for this clever hack. + + local f g + + while [ -n "$1" ]; do + reject_whitespace "$1" + g= + message "Analyzing $1:" + for f in $(echo "$1" | tr / \ ); do + if [ -e /$g$f ]; then + ls -dl /$g$f /$g$f.dpkg-* 2> /dev/null || true + g=$g$f/ + else + message "/$g$f: nonexistent; directory contents of /$g:" + ls -l /$g + break + fi + done + shift + done +} + +find_culprits () { + local f p dpkg_info_dir possible_culprits smoking_guns bad_packages package \ + msg + + reject_whitespace "$1" + message "Searching for overlapping packages..." + dpkg_info_dir=/var/lib/dpkg/info + if [ -d $dpkg_info_dir ]; then + if [ "$(echo $dpkg_info_dir/*.list)" != "$dpkg_info_dir/*.list" ]; then + possible_culprits=$(ls -1 $dpkg_info_dir/*.list | egrep -v \ + "(xbase-clients|x11-common|xfs|xlibs)") + if [ -n "$possible_culprits" ]; then + smoking_guns=$(grep -l "$1" $possible_culprits || true) + if [ -n "$smoking_guns" ]; then + bad_packages=$(printf "\\n") + for f in $smoking_guns; do + # too bad you can't nest parameter expansion voodoo + p=${f%*.list} # strip off the trailing ".list" + package=${p##*/} # strip off the directories + bad_packages=$(printf "%s\n%s" "$bad_packages" "$package") + done + msg=$(cat < /dev/null 2>&1; then + message "The readlink command was not found. Please install version" \ + "1.13.1 or later of the debianutils package." + readlink () { + # returns what symlink in $1 actually points to + perl -e '$l = shift; exit 1 unless -l $l; $r = readlink $l; exit 1 unless $r; print "$r\n"' "$1" + } +fi + +check_symlink () { + # syntax: check_symlink symlink + # + # See if specified symlink points where it is supposed to. Return 0 if it + # does, and 1 if it does not. + # + # Primarily used by check_symlinks_and_warn() and check_symlinks_and_bomb(). + + local symlink + + # validate arguments + if [ $# -ne 1 ]; then + usage_error "check_symlink() called with wrong number of arguments;" \ + "expected 1, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + symlink="$1" + + if [ "$(maplink "$symlink")" = "$(readlink "$symlink")" ]; then + return 0 + else + return 1 + fi +} + +check_symlinks_and_warn () { + # syntax: check_symlinks_and_warn symlink ... + # + # For each argument, check for symlink sanity, and warn if it isn't sane. + # + # Call this function from a preinst script in the event $1 is "upgrade" or + # "install". + + local errmsg symlink + + # validate arguments + if [ $# -lt 1 ]; then + usage_error "check_symlinks_and_warn() called with wrong number of" \ + "arguments; expected at least 1, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + while [ -n "$1" ]; do + symlink="$1" + if [ -L "$symlink" ]; then + if ! check_symlink "$symlink"; then + observe "$symlink symbolic link points to wrong location" \ + "$(readlink "$symlink"); removing" + rm "$symlink" + fi + elif [ -e "$symlink" ]; then + errmsg="$symlink exists and is not a symbolic link; this package cannot" + errmsg="$errmsg be installed until this" + if [ -f "$symlink" ]; then + errmsg="$errmsg file" + elif [ -d "$symlink" ]; then + errmsg="$errmsg directory" + else + errmsg="$errmsg thing" + fi + errmsg="$errmsg is removed" + die "$errmsg" + fi + shift + done +} + +check_symlinks_and_bomb () { + # syntax: check_symlinks_and_bomb symlink ... + # + # For each argument, check for symlink sanity, and bomb if it isn't sane. + # + # Call this function from a postinst script. + + local problem symlink + + # validate arguments + if [ $# -lt 1 ]; then + usage_error "check_symlinks_and_bomb() called with wrong number of" + "arguments; expected at least 1, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + while [ -n "$1" ]; do + problem= + symlink="$1" + if [ -L "$symlink" ]; then + if ! check_symlink "$symlink"; then + problem=yes + warn "$symlink symbolic link points to wrong location" \ + "$(readlink "$symlink")" + fi + elif [ -e "$symlink" ]; then + problem=yes + warn "$symlink is not a symbolic link" + else + problem=yes + warn "$symlink symbolic link does not exist" + fi + if [ -n "$problem" ]; then + analyze_path "$symlink" "$(readlink "$symlink")" + find_culprits "$symlink" + die "bad symbolic links on system" + fi + shift + done +} + +font_update () { + # run $UPDATECMDS in $FONTDIRS + + local dir cmd shortcmd x_font_dir_prefix + + x_font_dir_prefix="/usr/share/fonts/X11" + + if [ -z "$UPDATECMDS" ]; then + usage_error "font_update() called but \$UPDATECMDS not set" + fi + if [ -z "$FONTDIRS" ]; then + usage_error "font_update() called but \$FONTDIRS not set" + fi + + reject_unlikely_path_chars "$UPDATECMDS" + reject_unlikely_path_chars "$FONTDIRS" + + for dir in $FONTDIRS; do + if [ -d "$x_font_dir_prefix/$dir" ]; then + for cmd in $UPDATECMDS; do + if which "$cmd" > /dev/null 2>&1; then + shortcmd=${cmd##*/} + observe "running $shortcmd in $dir font directory" + cmd_opts= + if [ "$shortcmd" = "update-fonts-alias" ]; then + cmd_opts=--x11r7-layout + fi + if [ "$shortcmd" = "update-fonts-dir" ]; then + cmd_opts=--x11r7-layout + fi + if [ "$shortcmd" = "update-fonts-scale" ]; then + cmd_opts=--x11r7-layout + fi + $cmd $cmd_opts $dir || warn "$cmd $cmd_opts $dir" \ + "failed; font directory data may not" \ + "be up to date" + else + warn "$cmd not found; not updating corresponding $dir font" \ + "directory data" + fi + done + else + warn "$dir is not a directory; not updating font directory data" + fi + done +} + +remove_conffile_prepare () { + # syntax: remove_conffile_prepare filename official_md5sum ... + # + # Check a conffile "filename" against a list of canonical MD5 checksums. + # If the file's current MD5 checksum matches one of the "official_md5sum" + # operands provided, then prepare the conffile for removal from the system. + # We defer actual deletion until the package is configured so that we can + # roll this operation back if package installation fails. + # + # Call this function from a preinst script in the event $1 is "upgrade" or + # "install" and verify $2 to ensure the package is being upgraded from a + # version (or installed over a version removed-but-not-purged) prior to the + # one in which the conffile was obsoleted. + + local conffile current_checksum + + # validate arguments + if [ $# -lt 2 ]; then + usage_error "remove_conffile_prepare() called with wrong number of" \ + "arguments; expected at least 2, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + conffile="$1" + shift + + # does the conffile even exist? + if [ -e "$conffile" ]; then + # calculate its checksum + current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//') + # compare it to each supplied checksum + while [ -n "$1" ]; do + if [ "$current_checksum" = "$1" ]; then + # we found a match; move the confffile and stop looking + observe "preparing obsolete conffile $conffile for removal" + mv "$conffile" "$conffile.$THIS_PACKAGE-tmp" + break + fi + shift + done + fi +} + +remove_conffile_lookup () { + # syntax: remove_conffile_lookup package filename + # + # Lookup the md5sum of a conffile in dpkg's database, and prepare for removal + # if it matches the actual file's md5sum. + # + # Call this function when you would call remove_conffile_prepare but only + # want to check against dpkg's status database instead of known checksums. + + local package conffile old_md5sum + + # validate arguments + if [ $# -ne 2 ]; then + usage_error "remove_conffile_lookup() called with wrong number of" \ + "arguments; expected 1, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + package="$1" + conffile="$2" + + if ! [ -e "$conffile" ]; then + return + fi + old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$package" | \ + awk '{ if (match($0, "^ '"$conffile"' ")) print $2}')" + if [ -n "$old_md5sum" ]; then + remove_conffile_prepare "$conffile" "$old_md5sum" + fi +} + +remove_conffile_commit () { + # syntax: remove_conffile_commit filename + # + # Complete the removal of a conffile "filename" that has become obsolete. + # + # Call this function from a postinst script after having used + # remove_conffile_prepare() in the preinst. + + local conffile + + # validate arguments + if [ $# -ne 1 ]; then + usage_error "remove_conffile_commit() called with wrong number of" \ + "arguments; expected 1, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + conffile="$1" + + # if the temporary file created by remove_conffile_prepare() exists, remove it + if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then + observe "committing removal of obsolete conffile $conffile" + rm "$conffile.$THIS_PACKAGE-tmp" + fi +} + +remove_conffile_rollback () { + # syntax: remove_conffile_rollback filename + # + # Roll back the removal of a conffile "filename". + # + # Call this function from a postrm script in the event $1 is "abort-upgrade" + # or "abort-install" is after having used remove_conffile_prepare() in the + # preinst. + + local conffile + + # validate arguments + if [ $# -ne 1 ]; then + usage_error "remove_conffile_rollback() called with wrong number of" \ + "arguments; expected 1, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + conffile="$1" + + # if the temporary file created by remove_conffile_prepare() exists, move it + # back + if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then + observe "rolling back removal of obsolete conffile $conffile" + mv "$conffile.$THIS_PACKAGE-tmp" "$conffile" + fi +} + +replace_conffile_with_symlink_prepare () { + # syntax: replace_conffile_with_symlink_prepare oldfilename newfilename \ + # official_md5sum ... + # + # Check a conffile "oldfilename" against a list of canonical MD5 checksums. + # If the file's current MD5 checksum matches one of the "official_md5sum" + # operands provided, then prepare the conffile for removal from the system. + # We defer actual deletion until the package is configured so that we can + # roll this operation back if package installation fails. Otherwise copy it + # to newfilename and let dpkg handle it through conffiles mechanism. + # + # Call this function from a preinst script in the event $1 is "upgrade" or + # "install" and verify $2 to ensure the package is being upgraded from a + # version (or installed over a version removed-but-not-purged) prior to the + # one in which the conffile was obsoleted. + + local conffile current_checksum + + # validate arguments + if [ $# -lt 3 ]; then + usage_error "replace_conffile_with_symlink_prepare() called with wrong" \ + " number of arguments; expected at least 3, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + oldconffile="$1" + shift + newconffile="$1" + shift + + remove_conffile_prepare "$_oldconffile" "$@" + # If $oldconffile still exists, then md5sums didn't match. + # Copy it to new one. + if [ -f "$oldconffile" ]; then + cp "$oldconffile" "$newconffile" + fi + +} + +replace_conffile_with_symlink_commit () { + # syntax: replace_conffile_with_symlink_commit oldfilename + # + # Complete the removal of a conffile "oldfilename" that has been + # replaced by a symlink. + # + # Call this function from a postinst script after having used + # replace_conffile_with_symlink_prepare() in the preinst. + + local conffile + + # validate arguments + if [ $# -ne 1 ]; then + usage_error "replace_conffile_with_symlink_commit() called with wrong" \ + "number of arguments; expected 1, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + conffile="$1" + + remove_conffile_commit "$conffile" +} + +replace_conffile_with_symlink_rollback () { + # syntax: replace_conffile_with_symlink_rollback oldfilename newfilename + # + # Roll back the replacing of a conffile "oldfilename" with symlink to + # "newfilename". + # + # Call this function from a postrm script in the event $1 is "abort-upgrade" + # or "abort-install" and verify $2 to ensure the package failed to upgrade + # from a version (or install over a version removed-but-not-purged) prior + # to the one in which the conffile was obsoleted. + # You should have used replace_conffile_with_symlink_prepare() in the + # preinst. + + local conffile + + # validate arguments + if [ $# -ne 2 ]; then + usage_error "replace_conffile_with_symlink_rollback() called with wrong" \ + "number of arguments; expected 2, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + oldconffile="$1" + newconffile="$2" + + remove_conffile_rollback "$_oldconffile" + if [ -f "$newconffile" ]; then + rm "$newconffile" + fi +} + +run () { + # syntax: run command [ argument ... ] + # + # Run specified command with optional arguments and report its exit status. + # Useful for commands whose exit status may be nonzero, but still acceptable, + # or commands whose failure is not fatal to us. + # + # NOTE: Do *not* use this function with db_get or db_metaget commands; in + # those cases the return value of the debconf command *must* be checked + # before the string returned by debconf is used for anything. + + local retval + + # validate arguments + if [ $# -lt 1 ]; then + usage_error "run() called with wrong number of arguments; expected at" \ + "least 1, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + "$@" || retval=$? + + if [ ${retval:-0} -ne 0 ]; then + observe "command \"$*\" exited with status $retval" + fi +} + +register_x_lib_dir_with_ld_so () { + # syntax: register_x_lib_dir_with_ld_so + # + # Configure the dynamic loader ld.so to search /usr/X11R6/lib for shared + # libraries. + # + # Call this function from the postinst script of a package that places a + # shared library in /usr/X11R6/lib, before invoking ldconfig. + + local dir ldsoconf + + dir="/usr/X11R6/lib" + ldsoconf="/etc/ld.so.conf" + + # is the line not already present? + if ! fgrep -qsx "$dir" "$ldsoconf"; then + observe "adding $dir directory to $ldsoconf" + echo "$dir" >> "$ldsoconf" + fi +} + +deregister_x_lib_dir_with_ld_so () { + # syntax: deregister_x_lib_dir_with_ld_so + # + # Configure dynamic loader ld.so to not search /usr/X11R6/lib for shared + # libraries, if and only if no shared libaries remain there. + # + # Call this function from the postrm script of a package that places a shared + # library in /usr/X11R6/lib, in the event "$1" is "remove", and before + # invoking ldconfig. + + local dir ldsoconf fgrep_status cmp_status + + dir="/usr/X11R6/lib" + ldsoconf="/etc/ld.so.conf" + + # is the line present? + if fgrep -qsx "$dir" "$ldsoconf"; then + # are there any shared objects in the directory? + if [ "$(echo "$dir"/lib*.so.*.*)" = "$dir/lib*.so.*.*" ]; then + # glob expansion produced nothing, so no shared libraries are present + observe "removing $dir directory from $ldsoconf" + # rewrite the file (very carefully) + set +e + fgrep -svx "$dir" "$ldsoconf" > "$ldsoconf.dpkg-tmp" + fgrep_status=$? + set -e + case $fgrep_status in + 0|1) ;; # we don't actually care if any lines matched or not + *) die "error reading \"$ldsoconf\"; fgrep exited with status" \ + "$fgrep_status" ;; + esac + set +e + cmp -s "$ldsoconf.dpkg-tmp" "$ldsoconf" + cmp_status=$? + set -e + case $cmp_status in + 0) rm "$ldsoconf.dpkg-tmp" ;; # files are identical + 1) mv "$ldsoconf.dpkg-tmp" "$ldsoconf" ;; # files differ + *) die "error comparing \"$ldsoconf.dpkg-tmp\" to \"$ldsoconf\";" \ + "cmp exited with status $cmp_status" ;; + esac + fi + fi +} + +make_symlink_sane () { + # syntax: make_symlink_sane symlink target + # + # Ensure that the symbolic link symlink exists, and points to target. + # + # If symlink does not exist, create it and point it at target. + # + # If symlink exists but is not a symbolic link, back it up. + # + # If symlink exists, is a symbolic link, but points to the wrong location, fix + # it. + # + # If symlink exists, is a symbolic link, and already points to target, do + # nothing. + # + # This function wouldn't be needed if ln had an -I, --idempotent option. + + # Validate arguments. + if [ $# -ne 2 ]; then + usage_error "make_symlink_sane() called with wrong number of arguments;" \ + "expected 2, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + # We could just use the positional parameters as-is, but that makes things + # harder to follow. + local symlink target + + symlink="$1" + target="$2" + + if [ -L "$symlink" ] && [ "$(readlink "$symlink")" = "$target" ]; then + observe "link from $symlink to $target already exists" + else + observe "creating symbolic link from $symlink to $target" + mkdir -p "${target%/*}" "${symlink%/*}" + ln -s -b -S ".dpkg-old" "$target" "$symlink" + fi +} + +migrate_dir_to_symlink () { + # syntax: migrate_dir_to_symlink old_location new_location + # + # Per Debian Policy section 6.5.4, "A directory will never be replaced by a + # symbolic link to a directory or vice versa; instead, the existing state + # (symlink or not) will be left alone and dpkg will follow the symlink if + # there is one." + # + # We have to do it ourselves. + # + # This function moves the contents of old_location, a directory, into + # new_location, a directory, then makes old_location a symbolic link to + # new_location. + # + # old_location need not exist, but if it does, it must be a directory (or a + # symlink to a directory). If it is not, it is backed up. If new_location + # exists already and is not a directory, it is backed up. + # + # This function should be called from a package's preinst so that other + # packages unpacked after this one --- but before this package's postinst runs + # --- are unpacked into new_location even if their payloads contain + # old_location filespecs. + + # Validate arguments. + if [ $# -ne 2 ]; then + usage_error "migrate_dir_to_symlink() called with wrong number of" + "arguments; expected 2, got $#" + exit $SHELL_LIB_USAGE_ERROR + fi + + # We could just use the positional parameters as-is, but that makes things + # harder to follow. + local new old + + old="$1" + new="$2" + + # Is old location a symlink? + if [ -L "$old" ]; then + # Does it already point to new location? + if [ "$(readlink "$old")" = "$new" ]; then + # Nothing to do; migration has already been done. + observe "migration of $old to $new already done" + return 0 + else + # Back it up. + warn "backing up symbolic link $old as $old.dpkg-old" + mv -b "$old" "$old.dpkg-old" + fi + fi + + # Does old location exist, but is not a directory? + if [ -e "$old" ] && ! [ -d "$old" ]; then + # Back it up. + warn "backing up non-directory $old as $old.dpkg-old" + mv -b "$old" "$old.dpkg-old" + fi + + observe "migrating $old to $new" + + # Is new location a symlink? + if [ -L "$new" ]; then + # Does it point the wrong way, i.e., back to where we're migrating from? + if [ "$(readlink "$new")" = "$old" ]; then + # Get rid of it. + observe "removing symbolic link $new which points to $old" + rm "$new" + else + # Back it up. + warn "backing up symbolic link $new as $new.dpkg-old" + mv -b "$new" "$new.dpkg-old" + fi + fi + + # Does new location exist, but is not a directory? + if [ -e "$new" ] && ! [ -d "$new" ]; then + warn "backing up non-directory $new as $new.dpkg-old" + mv -b "$new" "$new.dpkg-old" + fi + + # Create new directory if it does not yet exist. + if ! [ -e "$new" ]; then + observe "creating $new" + mkdir -p "$new" + fi + + # Copy files in old location to new location. Back up any filenames that + # already exist in the new location with the extension ".dpkg-old". + observe "copying files from $old to $new" + if ! (cd "$old" && cp -a -b -S ".dpkg-old" . "$new"); then + die "error(s) encountered while copying files from $old to $new" + fi + + # Remove files at old location. + observe "removing $old" + rm -r "$old" + + # Create symlink from old location to new location. + make_symlink_sane "$old" "$new" +} + +# vim:set ai et sw=2 ts=2 tw=80: + +# GOBSTOPPER: The X Strike Force shell library ends here. --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/patches/106_gen_pci_ids.patch +++ xserver-xorg-video-psb-0.20.0+repack/debian/patches/106_gen_pci_ids.patch @@ -0,0 +1,19 @@ +Note Loïc Minier 2008/11/06: +This patch creates a static file with PCI ids; I don't see much point in doing +this as a patch instead of simply shipping the file as debian/psb.ids. What +other drivers do is patching the upstream source to generate the list of ids +from internal driver structs, but as of this writing the psb driver simply has: + #define PCI_CHIP_PSB1 0x8108 + #define PCI_CHIP_PSB2 0x8109 +Hence, this patch is good enough for now, but we should move to a more sensible +approach when the upstream code provides a longer list in the form of an +internal struct. + +Index: xserver-xorg-video-psb-0.13.0ubuntu1~804um1/src/psb.ids +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ xserver-xorg-video-psb-0.13.0ubuntu1~804um1/src/psb.ids 2008-05-27 14:57:50.000000000 -0400 +@@ -0,0 +1,2 @@ ++80868108 ++80868109 +\ No newline at end of file --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/patches/00_xorg_headers.patch +++ xserver-xorg-video-psb-0.20.0+repack/debian/patches/00_xorg_headers.patch @@ -0,0 +1,1497 @@ +diff -Nru xf86-video-psb-0.2.1.orig/src/xf86Crtc.h xf86-video-psb-0.2.1/src/xf86Crtc.h +--- xf86-video-psb-0.2.1.orig/src/xf86Crtc.h 1969-12-31 16:00:00.000000000 -0800 ++++ xf86-video-psb-0.2.1/src/xf86Crtc.h 2007-06-20 12:23:08.000000000 -0700 +@@ -0,0 +1,746 @@ ++/* ++ * Copyright © 2006 Keith Packard ++ * ++ * Permission to use, copy, modify, distribute, and sell this software and its ++ * documentation for any purpose is hereby granted without fee, provided that ++ * the above copyright notice appear in all copies and that both that copyright ++ * notice and this permission notice appear in supporting documentation, and ++ * that the name of the copyright holders not be used in advertising or ++ * publicity pertaining to distribution of the software without specific, ++ * written prior permission. The copyright holders make no representations ++ * about the suitability of this software for any purpose. It is provided "as ++ * is" without express or implied warranty. ++ * ++ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, ++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO ++ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR ++ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, ++ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER ++ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE ++ * OF THIS SOFTWARE. ++ */ ++#ifndef _XF86CRTC_H_ ++#define _XF86CRTC_H_ ++ ++#include ++#include "randrstr.h" ++#if XF86_MODES_RENAME ++#include "xf86Rename.h" ++#endif ++#include "xf86Modes.h" ++#include "xf86Cursor.h" ++#include "damage.h" ++ ++/* Compat definitions for older X Servers. */ ++#ifndef M_T_PREFERRED ++#define M_T_PREFERRED 0x08 ++#endif ++#ifndef M_T_DRIVER ++#define M_T_DRIVER 0x40 ++#endif ++#ifndef HARDWARE_CURSOR_ARGB ++#define HARDWARE_CURSOR_ARGB 0x00004000 ++#endif ++ ++typedef struct _xf86Crtc xf86CrtcRec, *xf86CrtcPtr; ++typedef struct _xf86Output xf86OutputRec, *xf86OutputPtr; ++ ++/* define a standard for connector types */ ++typedef enum _xf86ConnectorType { ++ XF86ConnectorNone, ++ XF86ConnectorVGA, ++ XF86ConnectorDVI_I, ++ XF86ConnectorDVI_D, ++ XF86ConnectorDVI_A, ++ XF86ConnectorComposite, ++ XF86ConnectorSvideo, ++ XF86ConnectorComponent, ++ XF86ConnectorLFP, ++ XF86ConnectorProprietary, ++} xf86ConnectorType; ++ ++typedef enum _xf86OutputStatus { ++ XF86OutputStatusConnected, ++ XF86OutputStatusDisconnected, ++ XF86OutputStatusUnknown, ++} xf86OutputStatus; ++ ++typedef struct _xf86CrtcFuncs { ++ /** ++ * Turns the crtc on/off, or sets intermediate power levels if available. ++ * ++ * Unsupported intermediate modes drop to the lower power setting. If the ++ * mode is DPMSModeOff, the crtc must be disabled sufficiently for it to ++ * be safe to call mode_set. ++ */ ++ void ++ (*dpms)(xf86CrtcPtr crtc, ++ int mode); ++ ++ /** ++ * Saves the crtc's state for restoration on VT switch. ++ */ ++ void ++ (*save)(xf86CrtcPtr crtc); ++ ++ /** ++ * Restore's the crtc's state at VT switch. ++ */ ++ void ++ (*restore)(xf86CrtcPtr crtc); ++ ++ /** ++ * Lock CRTC prior to mode setting, mostly for DRI. ++ * Returns whether unlock is needed ++ */ ++ Bool ++ (*lock) (xf86CrtcPtr crtc); ++ ++ /** ++ * Unlock CRTC after mode setting, mostly for DRI ++ */ ++ void ++ (*unlock) (xf86CrtcPtr crtc); ++ ++ /** ++ * Callback to adjust the mode to be set in the CRTC. ++ * ++ * This allows a CRTC to adjust the clock or even the entire set of ++ * timings, which is used for panels with fixed timings or for ++ * buses with clock limitations. ++ */ ++ Bool ++ (*mode_fixup)(xf86CrtcPtr crtc, ++ DisplayModePtr mode, ++ DisplayModePtr adjusted_mode); ++ ++ /** ++ * Prepare CRTC for an upcoming mode set. ++ */ ++ void ++ (*prepare)(xf86CrtcPtr crtc); ++ ++ /** ++ * Callback for setting up a video mode after fixups have been made. ++ */ ++ void ++ (*mode_set)(xf86CrtcPtr crtc, ++ DisplayModePtr mode, ++ DisplayModePtr adjusted_mode, ++ int x, int y); ++ ++ /** ++ * Commit mode changes to a CRTC ++ */ ++ void ++ (*commit)(xf86CrtcPtr crtc); ++ ++ /* Set the color ramps for the CRTC to the given values. */ ++ void ++ (*gamma_set)(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue, ++ int size); ++ ++ /** ++ * Allocate the shadow area, delay the pixmap creation until needed ++ */ ++ void * ++ (*shadow_allocate) (xf86CrtcPtr crtc, int width, int height); ++ ++ /** ++ * Create shadow pixmap for rotation support ++ */ ++ PixmapPtr ++ (*shadow_create) (xf86CrtcPtr crtc, void *data, int width, int height); ++ ++ /** ++ * Destroy shadow pixmap ++ */ ++ void ++ (*shadow_destroy) (xf86CrtcPtr crtc, PixmapPtr pPixmap, void *data); ++ ++ /** ++ * Set cursor colors ++ */ ++ void ++ (*set_cursor_colors) (xf86CrtcPtr crtc, int bg, int fg); ++ ++ /** ++ * Set cursor position ++ */ ++ void ++ (*set_cursor_position) (xf86CrtcPtr crtc, int x, int y); ++ ++ /** ++ * Show cursor ++ */ ++ void ++ (*show_cursor) (xf86CrtcPtr crtc); ++ ++ /** ++ * Hide cursor ++ */ ++ void ++ (*hide_cursor) (xf86CrtcPtr crtc); ++ ++ /** ++ * Load monochrome image ++ */ ++ void ++ (*load_cursor_image) (xf86CrtcPtr crtc, CARD8 *image); ++ ++ /** ++ * Load ARGB image ++ */ ++ void ++ (*load_cursor_argb) (xf86CrtcPtr crtc, CARD32 *image); ++ ++ /** ++ * Clean up driver-specific bits of the crtc ++ */ ++ void ++ (*destroy) (xf86CrtcPtr crtc); ++} xf86CrtcFuncsRec, *xf86CrtcFuncsPtr; ++ ++struct _xf86Crtc { ++ /** ++ * Associated ScrnInfo ++ */ ++ ScrnInfoPtr scrn; ++ ++ /** ++ * Active state of this CRTC ++ * ++ * Set when this CRTC is driving one or more outputs ++ */ ++ Bool enabled; ++ ++ /** ++ * Active mode ++ * ++ * This reflects the mode as set in the CRTC currently ++ * It will be cleared when the VT is not active or ++ * during server startup ++ */ ++ DisplayModeRec mode; ++ Rotation rotation; ++ PixmapPtr rotatedPixmap; ++ void *rotatedData; ++ ++ /** ++ * Position on screen ++ * ++ * Locates this CRTC within the frame buffer ++ */ ++ int x, y; ++ ++ /** ++ * Desired mode ++ * ++ * This is set to the requested mode, independent of ++ * whether the VT is active. In particular, it receives ++ * the startup configured mode and saves the active mode ++ * on VT switch. ++ */ ++ DisplayModeRec desiredMode; ++ Rotation desiredRotation; ++ int desiredX, desiredY; ++ ++ /** crtc-specific functions */ ++ const xf86CrtcFuncsRec *funcs; ++ ++ /** ++ * Driver private ++ * ++ * Holds driver-private information ++ */ ++ void *driver_private; ++ ++#ifdef RANDR_12_INTERFACE ++ /** ++ * RandR crtc ++ * ++ * When RandR 1.2 is available, this ++ * points at the associated crtc object ++ */ ++ RRCrtcPtr randr_crtc; ++#else ++ void *randr_crtc; ++#endif ++ ++ /** ++ * Current cursor is ARGB ++ */ ++ Bool cursor_argb; ++ /** ++ * Track whether cursor is within CRTC range ++ */ ++ Bool cursor_in_range; ++ /** ++ * Track state of cursor associated with this CRTC ++ */ ++ Bool cursor_shown; ++}; ++ ++typedef struct _xf86OutputFuncs { ++ /** ++ * Called to allow the output a chance to create properties after the ++ * RandR objects have been created. ++ */ ++ void ++ (*create_resources)(xf86OutputPtr output); ++ ++ /** ++ * Turns the output on/off, or sets intermediate power levels if available. ++ * ++ * Unsupported intermediate modes drop to the lower power setting. If the ++ * mode is DPMSModeOff, the output must be disabled, as the DPLL may be ++ * disabled afterwards. ++ */ ++ void ++ (*dpms)(xf86OutputPtr output, ++ int mode); ++ ++ /** ++ * Saves the output's state for restoration on VT switch. ++ */ ++ void ++ (*save)(xf86OutputPtr output); ++ ++ /** ++ * Restore's the output's state at VT switch. ++ */ ++ void ++ (*restore)(xf86OutputPtr output); ++ ++ /** ++ * Callback for testing a video mode for a given output. ++ * ++ * This function should only check for cases where a mode can't be supported ++ * on the output specifically, and not represent generic CRTC limitations. ++ * ++ * \return MODE_OK if the mode is valid, or another MODE_* otherwise. ++ */ ++ int ++ (*mode_valid)(xf86OutputPtr output, ++ DisplayModePtr pMode); ++ ++ /** ++ * Callback to adjust the mode to be set in the CRTC. ++ * ++ * This allows an output to adjust the clock or even the entire set of ++ * timings, which is used for panels with fixed timings or for ++ * buses with clock limitations. ++ */ ++ Bool ++ (*mode_fixup)(xf86OutputPtr output, ++ DisplayModePtr mode, ++ DisplayModePtr adjusted_mode); ++ ++ /** ++ * Callback for preparing mode changes on an output ++ */ ++ void ++ (*prepare)(xf86OutputPtr output); ++ ++ /** ++ * Callback for committing mode changes on an output ++ */ ++ void ++ (*commit)(xf86OutputPtr output); ++ ++ /** ++ * Callback for setting up a video mode after fixups have been made. ++ * ++ * This is only called while the output is disabled. The dpms callback ++ * must be all that's necessary for the output, to turn the output on ++ * after this function is called. ++ */ ++ void ++ (*mode_set)(xf86OutputPtr output, ++ DisplayModePtr mode, ++ DisplayModePtr adjusted_mode); ++ ++ /** ++ * Probe for a connected output, and return detect_status. ++ */ ++ xf86OutputStatus ++ (*detect)(xf86OutputPtr output); ++ ++ /** ++ * Query the device for the modes it provides. ++ * ++ * This function may also update MonInfo, mm_width, and mm_height. ++ * ++ * \return singly-linked list of modes or NULL if no modes found. ++ */ ++ DisplayModePtr ++ (*get_modes)(xf86OutputPtr output); ++ ++#ifdef RANDR_12_INTERFACE ++ /** ++ * Callback when an output's property has changed. ++ */ ++ Bool ++ (*set_property)(xf86OutputPtr output, ++ Atom property, ++ RRPropertyValuePtr value); ++#endif ++ /** ++ * Clean up driver-specific bits of the output ++ */ ++ void ++ (*destroy) (xf86OutputPtr output); ++} xf86OutputFuncsRec, *xf86OutputFuncsPtr; ++ ++struct _xf86Output { ++ /** ++ * Associated ScrnInfo ++ */ ++ ScrnInfoPtr scrn; ++ ++ /** ++ * Currently connected crtc (if any) ++ * ++ * If this output is not in use, this field will be NULL. ++ */ ++ xf86CrtcPtr crtc; ++ ++ /** ++ * Possible CRTCs for this output as a mask of crtc indices ++ */ ++ CARD32 possible_crtcs; ++ ++ /** ++ * Possible outputs to share the same CRTC as a mask of output indices ++ */ ++ CARD32 possible_clones; ++ ++ /** ++ * Whether this output can support interlaced modes ++ */ ++ Bool interlaceAllowed; ++ ++ /** ++ * Whether this output can support double scan modes ++ */ ++ Bool doubleScanAllowed; ++ ++ /** ++ * List of available modes on this output. ++ * ++ * This should be the list from get_modes(), plus perhaps additional ++ * compatible modes added later. ++ */ ++ DisplayModePtr probed_modes; ++ ++ /** ++ * Options parsed from the related monitor section ++ */ ++ OptionInfoPtr options; ++ ++ /** ++ * Configured monitor section ++ */ ++ XF86ConfMonitorPtr conf_monitor; ++ ++ /** ++ * Desired initial position ++ */ ++ int initial_x, initial_y; ++ ++ /** ++ * Desired initial rotation ++ */ ++ Rotation initial_rotation; ++ ++ /** ++ * Current connection status ++ * ++ * This indicates whether a monitor is known to be connected ++ * to this output or not, or whether there is no way to tell ++ */ ++ xf86OutputStatus status; ++ ++ /** EDID monitor information */ ++ xf86MonPtr MonInfo; ++ ++ /** subpixel order */ ++ int subpixel_order; ++ ++ /** Physical size of the currently attached output device. */ ++ int mm_width, mm_height; ++ ++ /** Output name */ ++ char *name; ++ ++ /** output-specific functions */ ++ const xf86OutputFuncsRec *funcs; ++ ++ /** driver private information */ ++ void *driver_private; ++ ++ /** Whether to use the old per-screen Monitor config section */ ++ Bool use_screen_monitor; ++ ++#ifdef RANDR_12_INTERFACE ++ /** ++ * RandR 1.2 output structure. ++ * ++ * When RandR 1.2 is available, this points at the associated ++ * RandR output structure and is created when this output is created ++ */ ++ RROutputPtr randr_output; ++#else ++ void *randr_output; ++#endif ++}; ++ ++typedef struct _xf86CrtcConfigFuncs { ++ /** ++ * Requests that the driver resize the screen. ++ * ++ * The driver is responsible for updating scrn->virtualX and scrn->virtualY. ++ * If the requested size cannot be set, the driver should leave those values ++ * alone and return FALSE. ++ * ++ * A naive driver that cannot reallocate the screen may simply change ++ * virtual[XY]. A more advanced driver will want to also change the ++ * devPrivate.ptr and devKind of the screen pixmap, update any offscreen ++ * pixmaps it may have moved, and change pScrn->displayWidth. ++ */ ++ Bool ++ (*resize)(ScrnInfoPtr scrn, ++ int width, ++ int height); ++} xf86CrtcConfigFuncsRec, *xf86CrtcConfigFuncsPtr; ++ ++typedef struct _xf86CrtcConfig { ++ int num_output; ++ xf86OutputPtr *output; ++ /** ++ * compat_output is used whenever we deal ++ * with legacy code that only understands a single ++ * output. pScrn->modes will be loaded from this output, ++ * adjust frame will whack this output, etc. ++ */ ++ int compat_output; ++ ++ int num_crtc; ++ xf86CrtcPtr *crtc; ++ ++ int minWidth, minHeight; ++ int maxWidth, maxHeight; ++ ++ /* For crtc-based rotation */ ++ DamagePtr rotation_damage; ++ Bool rotation_damage_registered; ++ ++ /* DGA */ ++ unsigned int dga_flags; ++ unsigned long dga_address; ++ DGAModePtr dga_modes; ++ int dga_nmode; ++ int dga_width, dga_height, dga_stride; ++ DisplayModePtr dga_save_mode; ++ ++ const xf86CrtcConfigFuncsRec *funcs; ++ ++ CreateScreenResourcesProcPtr CreateScreenResources; ++ ++ CloseScreenProcPtr CloseScreen; ++ ++ /* Cursor information */ ++ xf86CursorInfoPtr cursor_info; ++ CursorPtr cursor; ++ CARD8 *cursor_image; ++ Bool cursor_on; ++ CARD32 cursor_fg, cursor_bg; ++} xf86CrtcConfigRec, *xf86CrtcConfigPtr; ++ ++extern int xf86CrtcConfigPrivateIndex; ++ ++#define XF86_CRTC_CONFIG_PTR(p) ((xf86CrtcConfigPtr) ((p)->privates[xf86CrtcConfigPrivateIndex].ptr)) ++ ++/* ++ * Initialize xf86CrtcConfig structure ++ */ ++ ++void ++xf86CrtcConfigInit (ScrnInfoPtr scrn, ++ const xf86CrtcConfigFuncsRec *funcs); ++ ++void ++xf86CrtcSetSizeRange (ScrnInfoPtr scrn, ++ int minWidth, int minHeight, ++ int maxWidth, int maxHeight); ++ ++/* ++ * Crtc functions ++ */ ++xf86CrtcPtr ++xf86CrtcCreate (ScrnInfoPtr scrn, ++ const xf86CrtcFuncsRec *funcs); ++ ++void ++xf86CrtcDestroy (xf86CrtcPtr crtc); ++ ++ ++/** ++ * Sets the given video mode on the given crtc ++ */ ++Bool ++xf86CrtcSetMode (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, ++ int x, int y); ++ ++/* ++ * Assign crtc rotation during mode set ++ */ ++Bool ++xf86CrtcRotate (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation); ++ ++/* ++ * Clean up rotation during CloseScreen ++ */ ++void ++xf86RotateCloseScreen (ScreenPtr pScreen); ++ ++/** ++ * Return whether any output is assigned to the crtc ++ */ ++Bool ++xf86CrtcInUse (xf86CrtcPtr crtc); ++ ++/* ++ * Output functions ++ */ ++xf86OutputPtr ++xf86OutputCreate (ScrnInfoPtr scrn, ++ const xf86OutputFuncsRec *funcs, ++ const char *name); ++ ++void ++xf86OutputUseScreenMonitor (xf86OutputPtr output, Bool use_screen_monitor); ++ ++Bool ++xf86OutputRename (xf86OutputPtr output, const char *name); ++ ++void ++xf86OutputDestroy (xf86OutputPtr output); ++ ++void ++xf86ProbeOutputModes (ScrnInfoPtr pScrn, int maxX, int maxY); ++ ++void ++xf86SetScrnInfoModes (ScrnInfoPtr pScrn); ++ ++Bool ++xf86CrtcScreenInit (ScreenPtr pScreen); ++ ++Bool ++xf86InitialConfiguration (ScrnInfoPtr pScrn, Bool canGrow); ++ ++void ++xf86DPMSSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags); ++ ++Bool ++xf86SaveScreen(ScreenPtr pScreen, int mode); ++ ++void ++xf86DisableUnusedFunctions(ScrnInfoPtr pScrn); ++ ++DisplayModePtr ++xf86OutputFindClosestMode (xf86OutputPtr output, DisplayModePtr desired); ++ ++Bool ++xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation); ++ ++/** ++ * Set the EDID information for the specified output ++ */ ++void ++xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon); ++ ++/** ++ * Return the list of modes supported by the EDID information ++ * stored in 'output' ++ */ ++DisplayModePtr ++xf86OutputGetEDIDModes (xf86OutputPtr output); ++ ++xf86MonPtr ++xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus); ++ ++/** ++ * Initialize dga for this screen ++ */ ++ ++Bool ++xf86DiDGAInit (ScreenPtr pScreen, unsigned long dga_address); ++ ++/** ++ * Re-initialize dga for this screen (as when the set of modes changes) ++ */ ++ ++Bool ++xf86DiDGAReInit (ScreenPtr pScreen); ++ ++/* ++ * Set the subpixel order reported for the screen using ++ * the information from the outputs ++ */ ++ ++void ++xf86CrtcSetScreenSubpixelOrder (ScreenPtr pScreen); ++ ++/* ++ * Get a standard string name for a connector type ++ */ ++char * ++xf86ConnectorGetName(xf86ConnectorType connector); ++ ++/* ++ * Using the desired mode information in each crtc, set ++ * modes (used in EnterVT functions, or at server startup) ++ */ ++ ++Bool ++xf86SetDesiredModes (ScrnInfoPtr pScrn); ++ ++/** ++ * Initialize the CRTC-based cursor code. CRTC function vectors must ++ * contain relevant cursor setting functions. ++ * ++ * Driver should call this from ScreenInit function ++ */ ++Bool ++xf86_cursors_init (ScreenPtr screen, int max_width, int max_height, int flags); ++ ++/** ++ * Called when anything on the screen is reconfigured. ++ * ++ * Reloads cursor images as needed, then adjusts cursor positions. ++ * ++ * Driver should call this from crtc commit function. ++ */ ++void ++xf86_reload_cursors (ScreenPtr screen); ++ ++/** ++ * Called from EnterVT to turn the cursors back on ++ */ ++void ++xf86_show_cursors (ScrnInfoPtr scrn); ++ ++/** ++ * Called by the driver to turn cursors off ++ */ ++void ++xf86_hide_cursors (ScrnInfoPtr scrn); ++ ++/** ++ * Clean up CRTC-based cursor code. Driver must call this at CloseScreen time. ++ */ ++void ++xf86_cursors_fini (ScreenPtr screen); ++ ++#endif /* _XF86CRTC_H_ */ +diff -Nru xf86-video-psb-0.2.1.orig/src/xf86Modes.h xf86-video-psb-0.2.1/src/xf86Modes.h +--- xf86-video-psb-0.2.1.orig/src/xf86Modes.h 1969-12-31 16:00:00.000000000 -0800 ++++ xf86-video-psb-0.2.1/src/xf86Modes.h 2007-06-20 12:23:08.000000000 -0700 +@@ -0,0 +1,98 @@ ++/* ++ * Copyright © 2006 Intel Corporation ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ++ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ++ * SOFTWARE. ++ * ++ * Authors: ++ * Eric Anholt ++ * ++ */ ++ ++#ifndef _XF86MODES_H_ ++#define _XF86MODES_H_ ++ ++#include ++#include ++#include ++ ++#include "xf86.h" ++#include "xorgVersion.h" ++#include "edid.h" ++#include "xf86Parser.h" ++#if XF86_MODES_RENAME ++#include "xf86Rename.h" ++#endif ++ ++double xf86ModeHSync(DisplayModePtr mode); ++double xf86ModeVRefresh(DisplayModePtr mode); ++ ++int ++xf86ModeWidth (DisplayModePtr mode, Rotation rotation); ++ ++int ++xf86ModeHeight (DisplayModePtr mode, Rotation rotation); ++ ++DisplayModePtr xf86DuplicateMode(DisplayModePtr pMode); ++DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn, ++ DisplayModePtr modeList); ++void xf86SetModeDefaultName(DisplayModePtr mode); ++void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags); ++Bool xf86ModesEqual(DisplayModePtr pMode1, DisplayModePtr pMode2); ++void xf86PrintModeline(int scrnIndex,DisplayModePtr mode); ++DisplayModePtr xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new); ++ ++DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC); ++DisplayModePtr xf86CVTMode(int HDisplay, int VDisplay, float VRefresh, ++ Bool Reduced, Bool Interlaced); ++ ++void ++xf86ValidateModesFlags(ScrnInfoPtr pScrn, DisplayModePtr modeList, ++ int flags); ++ ++void ++xf86ValidateModesClocks(ScrnInfoPtr pScrn, DisplayModePtr modeList, ++ int *min, int *max, int n_ranges); ++ ++void ++xf86ValidateModesSize(ScrnInfoPtr pScrn, DisplayModePtr modeList, ++ int maxX, int maxY, int maxPitch); ++ ++void ++xf86ValidateModesSync(ScrnInfoPtr pScrn, DisplayModePtr modeList, ++ MonPtr mon); ++ ++void ++xf86PruneInvalidModes(ScrnInfoPtr pScrn, DisplayModePtr *modeList, ++ Bool verbose); ++ ++void ++xf86ValidateModesFlags(ScrnInfoPtr pScrn, DisplayModePtr modeList, ++ int flags); ++ ++void ++xf86ValidateModesUserConfig(ScrnInfoPtr pScrn, DisplayModePtr modeList); ++ ++DisplayModePtr ++xf86GetMonitorModes (ScrnInfoPtr pScrn, XF86ConfMonitorPtr conf_monitor); ++ ++DisplayModePtr ++xf86GetDefaultModes (Bool interlaceAllowed, Bool doubleScanAllowed); ++ ++#endif /* _XF86MODES_H_ */ +diff -Nru xf86-video-psb-0.2.1.orig/src/xf86Optrec.h xf86-video-psb-0.2.1/src/xf86Optrec.h +--- xf86-video-psb-0.2.1.orig/src/xf86Optrec.h 1969-12-31 16:00:00.000000000 -0800 ++++ xf86-video-psb-0.2.1/src/xf86Optrec.h 2007-06-20 12:23:08.000000000 -0700 +@@ -0,0 +1,112 @@ ++/* ++ * ++ * Copyright (c) 1997 Metro Link Incorporated ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in ++ * all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF ++ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ++ * SOFTWARE. ++ * ++ * Except as contained in this notice, the name of the Metro Link shall not be ++ * used in advertising or otherwise to promote the sale, use or other dealings ++ * in this Software without prior written authorization from Metro Link. ++ * ++ */ ++/* ++ * Copyright (c) 1997-2001 by The XFree86 Project, Inc. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in ++ * all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ * ++ * Except as contained in this notice, the name of the copyright holder(s) ++ * and author(s) shall not be used in advertising or otherwise to promote ++ * the sale, use or other dealings in this Software without prior written ++ * authorization from the copyright holder(s) and author(s). ++ */ ++ ++ ++/* ++ * This file contains the Option Record that is passed between the Parser, ++ * and Module setup procs. ++ */ ++#ifdef HAVE_XORG_CONFIG_H ++#include ++#endif ++ ++#ifndef _xf86Optrec_h_ ++#define _xf86Optrec_h_ ++#include ++ ++/* ++ * all records that need to be linked lists should contain a GenericList as ++ * their first field. ++ */ ++typedef struct generic_list_rec ++{ ++ void *next; ++} ++GenericListRec, *GenericListPtr, *glp; ++ ++/* ++ * All options are stored using this data type. ++ */ ++typedef struct ++{ ++ GenericListRec list; ++ char *opt_name; ++ char *opt_val; ++ int opt_used; ++ char *opt_comment; ++} ++XF86OptionRec, *XF86OptionPtr; ++ ++ ++XF86OptionPtr xf86addNewOption(XF86OptionPtr head, char *name, char *val); ++XF86OptionPtr xf86optionListDup(XF86OptionPtr opt); ++void xf86optionListFree(XF86OptionPtr opt); ++char *xf86optionName(XF86OptionPtr opt); ++char *xf86optionValue(XF86OptionPtr opt); ++XF86OptionPtr xf86newOption(char *name, char *value); ++XF86OptionPtr xf86nextOption(XF86OptionPtr list); ++XF86OptionPtr xf86findOption(XF86OptionPtr list, const char *name); ++char *xf86findOptionValue(XF86OptionPtr list, const char *name); ++int xf86findOptionBoolean (XF86OptionPtr, const char *, int); ++XF86OptionPtr xf86optionListCreate(const char **options, int count, int used); ++XF86OptionPtr xf86optionListMerge(XF86OptionPtr head, XF86OptionPtr tail); ++char *xf86configStrdup (const char *s); ++int xf86nameCompare (const char *s1, const char *s2); ++char *xf86uLongToString(unsigned long i); ++void xf86debugListOptions(XF86OptionPtr); ++XF86OptionPtr xf86parseOption(XF86OptionPtr head); ++void xf86printOptionList(FILE *fp, XF86OptionPtr list, int tabs); ++ ++ ++#endif /* _xf86Optrec_h_ */ +diff -Nru xf86-video-psb-0.2.1.orig/src/xf86Parser.h xf86-video-psb-0.2.1/src/xf86Parser.h +--- xf86-video-psb-0.2.1.orig/src/xf86Parser.h 1969-12-31 16:00:00.000000000 -0800 ++++ xf86-video-psb-0.2.1/src/xf86Parser.h 2007-06-20 12:23:08.000000000 -0700 +@@ -0,0 +1,483 @@ ++/* ++ * ++ * Copyright (c) 1997 Metro Link Incorporated ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in ++ * all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ++ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF ++ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ++ * SOFTWARE. ++ * ++ * Except as contained in this notice, the name of the Metro Link shall not be ++ * used in advertising or otherwise to promote the sale, use or other dealings ++ * in this Software without prior written authorization from Metro Link. ++ * ++ */ ++/* ++ * Copyright (c) 1997-2003 by The XFree86 Project, Inc. ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in ++ * all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ * OTHER DEALINGS IN THE SOFTWARE. ++ * ++ * Except as contained in this notice, the name of the copyright holder(s) ++ * and author(s) shall not be used in advertising or otherwise to promote ++ * the sale, use or other dealings in this Software without prior written ++ * authorization from the copyright holder(s) and author(s). ++ */ ++ ++ ++/* ++ * This file contains the external interfaces for the XFree86 configuration ++ * file parser. ++ */ ++#ifdef HAVE_XORG_CONFIG_H ++#include ++#endif ++ ++#ifndef _xf86Parser_h_ ++#define _xf86Parser_h_ ++ ++#include "xf86Optrec.h" ++ ++#define HAVE_PARSER_DECLS ++ ++typedef struct ++{ ++ char *file_logfile; ++ char *file_rgbpath; ++ char *file_modulepath; ++ char *file_inputdevs; ++ char *file_fontpath; ++ char *file_comment; ++} ++XF86ConfFilesRec, *XF86ConfFilesPtr; ++ ++/* Values for load_type */ ++#define XF86_LOAD_MODULE 0 ++#define XF86_LOAD_DRIVER 1 ++ ++typedef struct ++{ ++ GenericListRec list; ++ int load_type; ++ char *load_name; ++ XF86OptionPtr load_opt; ++ char *load_comment; ++ int ignore; ++} ++XF86LoadRec, *XF86LoadPtr; ++ ++typedef struct ++{ ++ XF86LoadPtr mod_load_lst; ++ char *mod_comment; ++} ++XF86ConfModuleRec, *XF86ConfModulePtr; ++ ++#define CONF_IMPLICIT_KEYBOARD "Implicit Core Keyboard" ++ ++#define CONF_IMPLICIT_POINTER "Implicit Core Pointer" ++ ++#define XF86CONF_PHSYNC 0x0001 ++#define XF86CONF_NHSYNC 0x0002 ++#define XF86CONF_PVSYNC 0x0004 ++#define XF86CONF_NVSYNC 0x0008 ++#define XF86CONF_INTERLACE 0x0010 ++#define XF86CONF_DBLSCAN 0x0020 ++#define XF86CONF_CSYNC 0x0040 ++#define XF86CONF_PCSYNC 0x0080 ++#define XF86CONF_NCSYNC 0x0100 ++#define XF86CONF_HSKEW 0x0200 /* hskew provided */ ++#define XF86CONF_BCAST 0x0400 ++#define XF86CONF_CUSTOM 0x0800 /* timing numbers customized by editor */ ++#define XF86CONF_VSCAN 0x1000 ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *ml_identifier; ++ int ml_clock; ++ int ml_hdisplay; ++ int ml_hsyncstart; ++ int ml_hsyncend; ++ int ml_htotal; ++ int ml_vdisplay; ++ int ml_vsyncstart; ++ int ml_vsyncend; ++ int ml_vtotal; ++ int ml_vscan; ++ int ml_flags; ++ int ml_hskew; ++ char *ml_comment; ++} ++XF86ConfModeLineRec, *XF86ConfModeLinePtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *vp_identifier; ++ XF86OptionPtr vp_option_lst; ++ char *vp_comment; ++} ++XF86ConfVideoPortRec, *XF86ConfVideoPortPtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *va_identifier; ++ char *va_vendor; ++ char *va_board; ++ char *va_busid; ++ char *va_driver; ++ XF86OptionPtr va_option_lst; ++ XF86ConfVideoPortPtr va_port_lst; ++ char *va_fwdref; ++ char *va_comment; ++} ++XF86ConfVideoAdaptorRec, *XF86ConfVideoAdaptorPtr; ++ ++#define CONF_MAX_HSYNC 8 ++#define CONF_MAX_VREFRESH 8 ++ ++typedef struct ++{ ++ float hi, lo; ++} ++parser_range; ++ ++typedef struct ++{ ++ int red, green, blue; ++} ++parser_rgb; ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *modes_identifier; ++ XF86ConfModeLinePtr mon_modeline_lst; ++ char *modes_comment; ++} ++XF86ConfModesRec, *XF86ConfModesPtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *ml_modes_str; ++ XF86ConfModesPtr ml_modes; ++} ++XF86ConfModesLinkRec, *XF86ConfModesLinkPtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *mon_identifier; ++ char *mon_vendor; ++ char *mon_modelname; ++ int mon_width; /* in mm */ ++ int mon_height; /* in mm */ ++ XF86ConfModeLinePtr mon_modeline_lst; ++ int mon_n_hsync; ++ parser_range mon_hsync[CONF_MAX_HSYNC]; ++ int mon_n_vrefresh; ++ parser_range mon_vrefresh[CONF_MAX_VREFRESH]; ++ float mon_gamma_red; ++ float mon_gamma_green; ++ float mon_gamma_blue; ++ XF86OptionPtr mon_option_lst; ++ XF86ConfModesLinkPtr mon_modes_sect_lst; ++ char *mon_comment; ++} ++XF86ConfMonitorRec, *XF86ConfMonitorPtr; ++ ++#define CONF_MAXDACSPEEDS 4 ++#define CONF_MAXCLOCKS 128 ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *dev_identifier; ++ char *dev_vendor; ++ char *dev_board; ++ char *dev_chipset; ++ char *dev_busid; ++ char *dev_card; ++ char *dev_driver; ++ char *dev_ramdac; ++ int dev_dacSpeeds[CONF_MAXDACSPEEDS]; ++ int dev_videoram; ++ int dev_textclockfreq; ++ unsigned long dev_bios_base; ++ unsigned long dev_mem_base; ++ unsigned long dev_io_base; ++ char *dev_clockchip; ++ int dev_clocks; ++ int dev_clock[CONF_MAXCLOCKS]; ++ int dev_chipid; ++ int dev_chiprev; ++ int dev_irq; ++ int dev_screen; ++ XF86OptionPtr dev_option_lst; ++ char *dev_comment; ++} ++XF86ConfDeviceRec, *XF86ConfDevicePtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *mode_name; ++} ++XF86ModeRec, *XF86ModePtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ int disp_frameX0; ++ int disp_frameY0; ++ int disp_virtualX; ++ int disp_virtualY; ++ int disp_depth; ++ int disp_bpp; ++ char *disp_visual; ++ parser_rgb disp_weight; ++ parser_rgb disp_black; ++ parser_rgb disp_white; ++ XF86ModePtr disp_mode_lst; ++ XF86OptionPtr disp_option_lst; ++ char *disp_comment; ++} ++XF86ConfDisplayRec, *XF86ConfDisplayPtr; ++ ++typedef struct ++{ ++ XF86OptionPtr flg_option_lst; ++ char *flg_comment; ++} ++XF86ConfFlagsRec, *XF86ConfFlagsPtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *al_adaptor_str; ++ XF86ConfVideoAdaptorPtr al_adaptor; ++} ++XF86ConfAdaptorLinkRec, *XF86ConfAdaptorLinkPtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *scrn_identifier; ++ char *scrn_obso_driver; ++ int scrn_defaultdepth; ++ int scrn_defaultbpp; ++ int scrn_defaultfbbpp; ++ char *scrn_monitor_str; ++ XF86ConfMonitorPtr scrn_monitor; ++ char *scrn_device_str; ++ XF86ConfDevicePtr scrn_device; ++ XF86ConfAdaptorLinkPtr scrn_adaptor_lst; ++ XF86ConfDisplayPtr scrn_display_lst; ++ XF86OptionPtr scrn_option_lst; ++ char *scrn_comment; ++} ++XF86ConfScreenRec, *XF86ConfScreenPtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *inp_identifier; ++ char *inp_driver; ++ XF86OptionPtr inp_option_lst; ++ char *inp_comment; ++} ++XF86ConfInputRec, *XF86ConfInputPtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ XF86ConfInputPtr iref_inputdev; ++ char *iref_inputdev_str; ++ XF86OptionPtr iref_option_lst; ++} ++XF86ConfInputrefRec, *XF86ConfInputrefPtr; ++ ++/* Values for adj_where */ ++#define CONF_ADJ_OBSOLETE -1 ++#define CONF_ADJ_ABSOLUTE 0 ++#define CONF_ADJ_RIGHTOF 1 ++#define CONF_ADJ_LEFTOF 2 ++#define CONF_ADJ_ABOVE 3 ++#define CONF_ADJ_BELOW 4 ++#define CONF_ADJ_RELATIVE 5 ++ ++typedef struct ++{ ++ GenericListRec list; ++ int adj_scrnum; ++ XF86ConfScreenPtr adj_screen; ++ char *adj_screen_str; ++ XF86ConfScreenPtr adj_top; ++ char *adj_top_str; ++ XF86ConfScreenPtr adj_bottom; ++ char *adj_bottom_str; ++ XF86ConfScreenPtr adj_left; ++ char *adj_left_str; ++ XF86ConfScreenPtr adj_right; ++ char *adj_right_str; ++ int adj_where; ++ int adj_x; ++ int adj_y; ++ char *adj_refscreen; ++} ++XF86ConfAdjacencyRec, *XF86ConfAdjacencyPtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *inactive_device_str; ++ XF86ConfDevicePtr inactive_device; ++} ++XF86ConfInactiveRec, *XF86ConfInactivePtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *lay_identifier; ++ XF86ConfAdjacencyPtr lay_adjacency_lst; ++ XF86ConfInactivePtr lay_inactive_lst; ++ XF86ConfInputrefPtr lay_input_lst; ++ XF86OptionPtr lay_option_lst; ++ char *lay_comment; ++} ++XF86ConfLayoutRec, *XF86ConfLayoutPtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *vs_name; ++ char *vs_identifier; ++ XF86OptionPtr vs_option_lst; ++ char *vs_comment; ++} ++XF86ConfVendSubRec, *XF86ConfVendSubPtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ char *vnd_identifier; ++ XF86OptionPtr vnd_option_lst; ++ XF86ConfVendSubPtr vnd_sub_lst; ++ char *vnd_comment; ++} ++XF86ConfVendorRec, *XF86ConfVendorPtr; ++ ++typedef struct ++{ ++ GenericListRec list; ++ int buf_count; ++ int buf_size; ++ char *buf_flags; ++ char *buf_comment; ++} ++XF86ConfBuffersRec, *XF86ConfBuffersPtr; ++ ++typedef struct ++{ ++ char *dri_group_name; ++ int dri_group; ++ int dri_mode; ++ XF86ConfBuffersPtr dri_buffers_lst; ++ char *dri_comment; ++} ++XF86ConfDRIRec, *XF86ConfDRIPtr; ++ ++typedef struct ++{ ++ XF86OptionPtr ext_option_lst; ++ char *extensions_comment; ++} ++XF86ConfExtensionsRec, *XF86ConfExtensionsPtr; ++ ++typedef struct ++{ ++ XF86ConfFilesPtr conf_files; ++ XF86ConfModulePtr conf_modules; ++ XF86ConfFlagsPtr conf_flags; ++ XF86ConfVideoAdaptorPtr conf_videoadaptor_lst; ++ XF86ConfModesPtr conf_modes_lst; ++ XF86ConfMonitorPtr conf_monitor_lst; ++ XF86ConfDevicePtr conf_device_lst; ++ XF86ConfScreenPtr conf_screen_lst; ++ XF86ConfInputPtr conf_input_lst; ++ XF86ConfLayoutPtr conf_layout_lst; ++ XF86ConfVendorPtr conf_vendor_lst; ++ XF86ConfDRIPtr conf_dri; ++ XF86ConfExtensionsPtr conf_extensions; ++ char *conf_comment; ++} ++XF86ConfigRec, *XF86ConfigPtr; ++ ++typedef struct ++{ ++ int token; /* id of the token */ ++ char *name; /* pointer to the LOWERCASED name */ ++} ++xf86ConfigSymTabRec, *xf86ConfigSymTabPtr; ++ ++/* ++ * prototypes for public functions ++ */ ++extern const char *xf86openConfigFile (const char *, const char *, ++ const char *); ++extern void xf86setBuiltinConfig(const char *config[]); ++extern XF86ConfigPtr xf86readConfigFile (void); ++extern void xf86closeConfigFile (void); ++extern void xf86freeConfig (XF86ConfigPtr p); ++extern int xf86writeConfigFile (const char *, XF86ConfigPtr); ++XF86ConfDevicePtr xf86findDevice(const char *ident, XF86ConfDevicePtr p); ++XF86ConfLayoutPtr xf86findLayout(const char *name, XF86ConfLayoutPtr list); ++XF86ConfMonitorPtr xf86findMonitor(const char *ident, XF86ConfMonitorPtr p); ++XF86ConfModesPtr xf86findModes(const char *ident, XF86ConfModesPtr p); ++XF86ConfModeLinePtr xf86findModeLine(const char *ident, XF86ConfModeLinePtr p); ++XF86ConfScreenPtr xf86findScreen(const char *ident, XF86ConfScreenPtr p); ++XF86ConfInputPtr xf86findInput(const char *ident, XF86ConfInputPtr p); ++XF86ConfInputPtr xf86findInputByDriver(const char *driver, XF86ConfInputPtr p); ++XF86ConfVendorPtr xf86findVendor(const char *name, XF86ConfVendorPtr list); ++XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident, ++ XF86ConfVideoAdaptorPtr p); ++ ++GenericListPtr xf86addListItem(GenericListPtr head, GenericListPtr c_new); ++int xf86itemNotSublist(GenericListPtr list_1, GenericListPtr list_2); ++ ++int xf86pathIsAbsolute(const char *path); ++int xf86pathIsSafe(const char *path); ++char *xf86addComment(char *cur, char *add); ++ ++#endif /* _xf86Parser_h_ */ +diff -Nru xf86-video-psb-0.2.1.orig/src/xf86RandR12.h xf86-video-psb-0.2.1/src/xf86RandR12.h +--- xf86-video-psb-0.2.1.orig/src/xf86RandR12.h 1969-12-31 16:00:00.000000000 -0800 ++++ xf86-video-psb-0.2.1/src/xf86RandR12.h 2007-06-20 12:23:08.000000000 -0700 +@@ -0,0 +1,38 @@ ++/* ++ * Copyright © 2006 Keith Packard ++ * ++ * Permission to use, copy, modify, distribute, and sell this software and its ++ * documentation for any purpose is hereby granted without fee, provided that ++ * the above copyright notice appear in all copies and that both that copyright ++ * notice and this permission notice appear in supporting documentation, and ++ * that the name of the copyright holders not be used in advertising or ++ * publicity pertaining to distribution of the software without specific, ++ * written prior permission. The copyright holders make no representations ++ * about the suitability of this software for any purpose. It is provided "as ++ * is" without express or implied warranty. ++ * ++ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, ++ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO ++ * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR ++ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, ++ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER ++ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE ++ * OF THIS SOFTWARE. ++ */ ++ ++#ifndef _XF86_RANDR_H_ ++#define _XF86_RANDR_H_ ++#include ++#include ++ ++Bool xf86RandR12CreateScreenResources (ScreenPtr pScreen); ++Bool xf86RandR12Init(ScreenPtr pScreen); ++void xf86RandR12SetRotations (ScreenPtr pScreen, Rotation rotation); ++Bool xf86RandR12SetConfig(ScreenPtr pScreen, Rotation rotation, int rate, ++ RRScreenSizePtr pSize); ++Rotation xf86RandR12GetRotation(ScreenPtr pScreen); ++void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y); ++Bool xf86RandR12PreInit (ScrnInfoPtr pScrn); ++void xf86RandR12TellChanged (ScreenPtr pScreen); ++ ++#endif /* _XF86_RANDR_H_ */ --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/patches/104_disable_locks.diff +++ xserver-xorg-video-psb-0.20.0+repack/debian/patches/104_disable_locks.diff @@ -0,0 +1,24 @@ +Index: xserver-xorg-video-psb-0.2.7/src/psb_driver.c +=================================================================== +--- xserver-xorg-video-psb-0.2.7.orig/src/psb_driver.c 2008-02-12 18:29:52.000000000 -0500 ++++ xserver-xorg-video-psb-0.2.7/src/psb_driver.c 2008-02-12 18:30:50.000000000 -0500 +@@ -1337,7 +1337,9 @@ + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Locking DRI for screen\n"); ++ /* Temporary Fix TBD + psbDRILock(pScrn, 0); ++ */ + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Creating PSB Scanout\n"); + pPsb->front = psbScanoutCreate(pScrn, pScrn->bitsPerPixel >> 3, +@@ -1507,7 +1509,9 @@ + + return psbEnterVT(pScreen->myNum, 0); + out_err_unlock: ++ /* Temporary Fix TBD + psbDRIUnlock(pScrn); ++ */ + out_err: + psbRestoreHWState(pDevice); + return FALSE; --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/patches/series +++ xserver-xorg-video-psb-0.20.0+repack/debian/patches/series @@ -0,0 +1,4 @@ +00_xorg_headers.patch +#103_psb_debugs.patch +#104_disable_locks.diff +106_gen_pci_ids.patch --- xserver-xorg-video-psb-0.20.0+repack.orig/debian/patches/103_psb_debugs.patch +++ xserver-xorg-video-psb-0.20.0+repack/debian/patches/103_psb_debugs.patch @@ -0,0 +1,93 @@ +--- xserver-xorg-video-psb-0.2.6/src/psb_dri.c 2007-12-18 12:35:09.000000000 -0800 ++++ xserver-xorg-video-psb-0.2.6-0ubuntu1~psb3/src/psb_dri.c 2008-01-15 19:22:36.942369627 -0800 +@@ -237,7 +237,7 @@ psbDeviceLegacyDRIInit(ScreenPtr pScreen + goto out_err; + } else { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, +- "[drm] Allocated device DRM context %d.\n", ++ "[drm] Allocated (legacy) device DRM context %d.\n", + (int)pDevice->drmContext); + } + +@@ -642,8 +642,11 @@ psbDRIScreenInit(ScreenPtr pScreen) + goto out_err; + } + #if PSB_LEGACY_DRI +- if (!psbDeviceLegacyDRIInit(pScreen)) ++ if (!psbDeviceLegacyDRIInit(pScreen)) { ++ xf86DrvMsg(pScreen->myNum, X_ERROR, ++ "[dri] Failed to init Legacy DRI device. Closing screen\n"); + goto out_err; ++ } + #endif + + return TRUE; +--- xserver-xorg-video-psb-0.2.6/src/psb_driver.c 2007-12-18 12:35:09.000000000 -0800 ++++ xserver-xorg-video-psb-0.2.6-0ubuntu1~psb3/src/psb_driver.c 2008-01-15 19:28:33.980767805 -0800 +@@ -1293,6 +1293,8 @@ psbScreenInit(int scrnIndex, ScreenPtr p + "This driver currently needs DRM to operate.\n"); + return FALSE; + } ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, ++ "Creating memory manager.\n"); + pDevice->man = mmCreateDRM(pDevice->drmFD); + if (!pDevice->man) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, +@@ -1302,10 +1304,13 @@ psbScreenInit(int scrnIndex, ScreenPtr p + } + #else + if (pDevice->hasDRM) ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, ++ "Initting DRI Screen\n"); + driEnabled = psbDRIScreenInit(pScreen); + #endif + #endif + ++ PSB_DEBUG(scrnIndex, 3, "serverGeneration\n"); + if (serverGeneration != pPsb->serverGeneration) { + + /* +@@ -1317,18 +1322,26 @@ psbScreenInit(int scrnIndex, ScreenPtr p + /* Unfortunately the Xserver is broken with regard to canGrow, so + * we need to set this to FALSE for now. + */ ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, ++ "Calling xf86InitialConfiguration()\n"); + if (!xf86InitialConfiguration(pScrn, FALSE)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "Could not find a valid initial configuration " + "for this screen\n"); + goto out_err; + } ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, ++ "Checking PSB Crtcs\n"); + psbCheckCrtcs(pDevice); + } + + pScrn->pScreen = pScreen; + ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, ++ "Locking DRI for screen\n"); + psbDRILock(pScrn, 0); ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, ++ "Creating PSB Scanout\n"); + pPsb->front = psbScanoutCreate(pScrn, pScrn->bitsPerPixel >> 3, + pScrn->depth, pScrn->virtualX, + pScrn->virtualY, 0, -1, 0); +@@ -1344,11 +1357,16 @@ psbScreenInit(int scrnIndex, ScreenPtr p + pPsb->stride = psbScanoutStride(pPsb->front); + pPsb->cpp = psbScanoutCpp(pPsb->front); + ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, ++ "Starting handling of mi layer\n"); + /* mi layer */ ++ PSB_DEBUG(scrnIndex, 3, "mi layer\n"); + miClearVisualTypes(); + if (!miSetVisualTypes(pScrn->depth, miGetDefaultVisualMask(pScrn->depth), + pScrn->rgbBits, pScrn->defaultVisual)) + goto out_err_unlock; ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, ++ "Setting mi Pixmap Depths\n"); + if (!miSetPixmapDepths()) + goto out_err_unlock; +