Przeglądaj źródła

recipes,classes: import a lot of recipes from meta-shr

* tested on shr-lite-image for om-gta02 and nokia900 (with meta-shr layer)
Martin Jansa 13 lat temu
rodzic
commit
89500c583e
100 zmienionych plików z 6539 dodań i 0 usunięć
  1. 84 0
      meta-oe/classes/gitpkgv.bbclass
  2. 80 0
      meta-oe/classes/gitver.bbclass
  3. 7 0
      meta-oe/classes/glx-use-tls.bbclass
  4. 17 0
      meta-oe/classes/gpe.bbclass
  5. 123 0
      meta-oe/classes/srctree.bbclass
  6. 71 0
      meta-oe/recipes-connectivity/bluez/bluez4.inc
  7. 16 0
      meta-oe/recipes-connectivity/bluez/bluez4/bluetooth.conf
  8. 13 0
      meta-oe/recipes-connectivity/bluez/bluez4/fix-dfutool-usb-declaration-mismatch.patch
  9. 33 0
      meta-oe/recipes-connectivity/bluez/bluez4/hid2hci_usb_init.patch
  10. 11 0
      meta-oe/recipes-connectivity/bluez/bluez4/sbc-thumb.patch
  11. 15 0
      meta-oe/recipes-connectivity/bluez/bluez4_4.91.bb
  12. 79 0
      meta-oe/recipes-connectivity/connman/connman.inc
  13. 42 0
      meta-oe/recipes-connectivity/connman/connman/connman
  14. 13 0
      meta-oe/recipes-connectivity/connman/connman/link-against-libnl2.patch
  15. 42 0
      meta-oe/recipes-connectivity/connman/connman/shr/connman
  16. 31 0
      meta-oe/recipes-connectivity/connman/connman_0.72.bb
  17. 18 0
      meta-oe/recipes-connectivity/phonet-utils/phonet-utils_git.bb
  18. 32 0
      meta-oe/recipes-core/meta/distro-feed-configs.bb
  19. 52 0
      meta-oe/recipes-core/tasks/task-cli-tools.bb
  20. 43 0
      meta-oe/recipes-core/tasks/task-x11.bb
  21. 482 0
      meta-oe/recipes-devtools/gdbus-binding-tool/gdbus-binding-tool/COPYING
  22. 37 0
      meta-oe/recipes-devtools/gdbus-binding-tool/gdbus-binding-tool_git.bb
  23. 20 0
      meta-oe/recipes-devtools/gobject-introspection/gobject-introspection/use-usr-bin-env-for-python.patch
  24. 32 0
      meta-oe/recipes-devtools/gobject-introspection/gobject-introspection_0.9.10.bb
  25. 14 0
      meta-oe/recipes-devtools/json-glib/json-glib_0.10.4.bb
  26. 13 0
      meta-oe/recipes-devtools/libcanberra/libcanberra/libcanberra-increase-buffer-size.patch
  27. 56 0
      meta-oe/recipes-devtools/libcanberra/libcanberra_0.26.bb
  28. 18 0
      meta-oe/recipes-devtools/libgee/libgee.inc
  29. 12 0
      meta-oe/recipes-devtools/libgee/libgee_0.6.0.bb
  30. 24 0
      meta-oe/recipes-devtools/python/python-dateutil_1.4.1.bb
  31. 33 0
      meta-oe/recipes-devtools/python/python-numeric/no-lapack.patch
  32. 15 0
      meta-oe/recipes-devtools/python/python-numeric_24.2.bb
  33. 24 0
      meta-oe/recipes-devtools/python/python-pexpect_2.3.bb
  34. 15 0
      meta-oe/recipes-devtools/python/python-phoneutils_git.bb
  35. 16 0
      meta-oe/recipes-devtools/python/python-pyalsaaudio_0.4.bb
  36. 23 0
      meta-oe/recipes-devtools/python/python-pyserial_2.4.bb
  37. 64 0
      meta-oe/recipes-devtools/python/python-pyyaml/setup.py
  38. 22 0
      meta-oe/recipes-devtools/python/python-pyyaml_svn.bb
  39. 17 0
      meta-oe/recipes-devtools/python/python-vobject_0.8.1c.bb
  40. 16 0
      meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool.inc
  41. 6 0
      meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool_git.bb
  42. 25 0
      meta-oe/recipes-devtools/vala/vala.inc
  43. 7 0
      meta-oe/recipes-devtools/vala/vala_0.12.0.bb
  44. 18 0
      meta-oe/recipes-extended/tzcode/tzcode-native.inc
  45. 19 0
      meta-oe/recipes-extended/tzcode/tzcode-native_2011e.bb
  46. 178 0
      meta-oe/recipes-extended/tzdata/tzdata.inc
  47. 13 0
      meta-oe/recipes-extended/tzdata/tzdata_2011e.bb
  48. 1095 0
      meta-oe/recipes-graphics/drm/libdrm-2.4.24/glamo.patch
  49. 43 0
      meta-oe/recipes-graphics/drm/libdrm-2.4.24/installtests.patch
  50. 39 0
      meta-oe/recipes-graphics/drm/libdrm_2.4.24.bb
  51. 12 0
      meta-oe/recipes-graphics/mesa/README
  52. 19 0
      meta-oe/recipes-graphics/mesa/mesa-7.10.2.inc
  53. 2425 0
      meta-oe/recipes-graphics/mesa/mesa-7.10.2/glamo.patch
  54. 26 0
      meta-oe/recipes-graphics/mesa/mesa-7.10.2/uclibc.patch
  55. 53 0
      meta-oe/recipes-graphics/mesa/mesa-common.inc
  56. 10 0
      meta-oe/recipes-graphics/mesa/mesa-dri.inc
  57. 4 0
      meta-oe/recipes-graphics/mesa/mesa-dri_7.10.2.bb
  58. 2 0
      meta-oe/recipes-graphics/mesa/mesa-xlib.inc
  59. 4 0
      meta-oe/recipes-graphics/mesa/mesa-xlib_7.10.2.bb
  60. 6 0
      meta-oe/recipes-graphics/mesa/mesa_7.10.2.bb
  61. 40 0
      meta-oe/recipes-graphics/tasks/task-fonts-truetype.bb
  62. 23 0
      meta-oe/recipes-graphics/ttf-fonts/ttf-liberation_0.2.bb
  63. 1 0
      meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/iphone3g/pointercal.xinput
  64. 2 0
      meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/nokia900/pointercal.xinput
  65. 2 0
      meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/om-gta01/pointercal.xinput
  66. 2 0
      meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/om-gta02/pointercal.xinput
  67. 1 0
      meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput
  68. 21 0
      meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb
  69. 8 0
      meta-oe/recipes-graphics/xinput-calibrator/xinput-calibrator.inc
  70. 17 0
      meta-oe/recipes-graphics/xinput-calibrator/xinput-calibrator_0.6.1.bb
  71. 10 0
      meta-oe/recipes-graphics/xorg-app/rgb_1.0.4.bb
  72. 8 0
      meta-oe/recipes-graphics/xorg-app/xinput_1.5.3.bb
  73. 15 0
      meta-oe/recipes-graphics/xorg-app/xorg-app-common.inc
  74. 12 0
      meta-oe/recipes-graphics/xorg-doc/xorg-doc-common.inc
  75. 8 0
      meta-oe/recipes-graphics/xorg-doc/xorg-sgml-doctools_1.7.bb
  76. 17 0
      meta-oe/recipes-graphics/xorg-driver/xf86-input-keyboard_1.6.0.bb
  77. 17 0
      meta-oe/recipes-graphics/xorg-driver/xf86-input-mouse_1.7.0.bb
  78. 11 0
      meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/10-x11-input-tslib.fdi
  79. 5 0
      meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/99-xf86-input-tslib.rules
  80. 20 0
      meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/double-free-crash.patch
  81. 34 0
      meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/xserver-174-XGetPointerControl.patch
  82. 32 0
      meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib_0.0.6.bb
  83. 9 0
      meta-oe/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.2.bb
  84. 66 0
      meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo/0001-glamo-drm-define-GLAMO_CMDQ_MAX_COUNT-instead-of-mag.patch
  85. 19 0
      meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo_git.bb
  86. 40 0
      meta-oe/recipes-graphics/xorg-driver/xorg-driver-common.inc
  87. 4 0
      meta-oe/recipes-graphics/xorg-driver/xorg-driver-input.inc
  88. 4 0
      meta-oe/recipes-graphics/xorg-driver/xorg-driver-video.inc
  89. 55 0
      meta-oe/recipes-graphics/xorg-lib/liblbxutil-1.1.0/mkg3states-1.1.patch
  90. 14 0
      meta-oe/recipes-graphics/xorg-lib/liblbxutil_1.1.0.bb
  91. 19 0
      meta-oe/recipes-graphics/xorg-lib/libx11-1.4.1/keysymdef_include.patch
  92. 29 0
      meta-oe/recipes-graphics/xorg-lib/libx11-1.4.1/x11_disable_makekeys.patch
  93. 19 0
      meta-oe/recipes-graphics/xorg-lib/libx11-1.4.3/keysymdef_include.patch
  94. 29 0
      meta-oe/recipes-graphics/xorg-lib/libx11-1.4.3/x11_disable_makekeys.patch
  95. 52 0
      meta-oe/recipes-graphics/xorg-lib/libx11.inc
  96. 12 0
      meta-oe/recipes-graphics/xorg-lib/libx11_1.4.1.bb
  97. 12 0
      meta-oe/recipes-graphics/xorg-lib/libx11_1.4.3.bb
  98. 28 0
      meta-oe/recipes-graphics/xorg-lib/libxaw_1.0.9.bb
  99. 22 0
      meta-oe/recipes-graphics/xorg-lib/libxfixes_5.0.bb
  100. 21 0
      meta-oe/recipes-graphics/xorg-lib/libxi_1.4.2.bb

+ 84 - 0
meta-oe/classes/gitpkgv.bbclass

@@ -0,0 +1,84 @@
+# gitpkgv.bbclass provides a GITPKGV and GITPKGVTAG variables to be
+# used in PKGV, as described bellow:
+#
+# - GITPKGV which is a sortable version with the format NN+GITHASH, to
+#   be used in PKGV, where
+#
+#   NN equals the total number of revs up to SRCREV
+#   GITHASH is SRCREV's (full) hash
+#
+# - GITPKGVTAG which is the output of 'git describe' allowing for
+#   automatic versioning
+#
+# gitpkgv.bbclass assumes the git repository has been cloned, and
+# contains SRCREV. So ${GITPKGV} and ${GITPKGVTAG} should never be
+# used in PV, only in PKGV.  It can handle SRCREV = ${AUTOREV}, as
+# well as SRCREV = "<some fixed git hash>".
+#
+# WARNING: if upstream repository is always using consistent and
+# sortable tag name scheme you can get sortable version including tag
+# name with ${GITPKGVTAG}, but be aware that ie tag sequence "v1.0,
+# v1.2, xtest, v2.0" will force you to increment PE to get upgradeable
+# path to v2.0 revisions
+#
+# use example:
+#
+# inherit gitpkgv
+#
+# PV = "1.0+gitr${SRCPV}"      # expands to something like 1.0+gitr3+4c1c21d7dbbf93b0df336994524313dfe0d4963b
+# PKGV = "1.0+gitr${GITPKGV}"  # expands also to something like 1.0+gitr31337+4c1c21d7d
+#
+# or
+#
+# inherit gitpkgv
+#
+# PV = "1.0+gitr${SRCPV}" # expands to something like 1.0+gitr3+4c1c21d7dbbf93b0df336994524313dfe0d4963b
+# PKGV = "${GITPKGVTAG}"  # expands to something like 1.0-31337+g4c1c21d
+#                           if there is tag v1.0 before this revision or
+#                           ver1.0-31337+g4c1c21d if there is tag ver1.0
+
+GITPKGV = "${@get_git_pkgv(d, False)}"
+GITPKGVTAG = "${@get_git_pkgv(d, True)}"
+
+def gitpkgv_drop_tag_prefix(version):
+    import re
+    if re.match("v\d", version):
+        return version[1:]
+    else:
+        return version
+
+def get_git_pkgv(d, use_tags):
+	import os
+	import bb
+
+	urls = bb.data.getVar('SRC_URI', d, 1).split()
+
+	for url in urls:
+		(type, host, path, user, pswd, parm) = bb.decodeurl(bb.data.expand(url, d))
+		if type in ['git']:
+
+			gitsrcname = '%s%s' % (host, path.replace('/', '.'))
+			repodir = os.path.join(bb.data.expand('${GITDIR}', d), gitsrcname)
+			if not os.path.exists(repodir):
+				return None
+
+			rev = bb.fetch.get_srcrev(d).split('+')[1]
+
+			cwd = os.getcwd()
+			os.chdir(repodir)
+
+			commits = bb.fetch.runfetchcmd("git rev-list %s -- 2> /dev/null | wc -l" % rev, d, quiet=True).strip()
+
+			if use_tags:
+				try:
+					ver = gitpkgv_drop_tag_prefix(bb.fetch.runfetchcmd("git describe %s 2>/dev/null" % rev, d, quiet=True).strip())
+				except Exception:
+					ver = "0.0-%s-g%s" % (commits, rev[:7])
+			else:
+				ver = "%s+%s" % (commits, rev[:7])
+
+			os.chdir(cwd)
+
+			return ver
+
+	return "0+0"

+ 80 - 0
meta-oe/classes/gitver.bbclass

@@ -0,0 +1,80 @@
+# Copyright (C) 2009 Chris Larson <clarson@kergoth.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+#
+# gitver.bbclass provides a GITVER variable which is a (fairly) sane version,
+# for use in ${PV}, extracted from the ${S} git checkout, assuming it is one.
+# This is most useful in concert with srctree.bbclass.
+
+def git_drop_tag_prefix(version):
+    import re
+    if re.match("v\d", version):
+        return version[1:]
+    else:
+        return version
+
+GIT_TAGADJUST = "git_drop_tag_prefix(version)"
+GITVER = "${@get_git_pv('${S}', d, tagadjust=lambda version:${GIT_TAGADJUST})}"
+GITSHA = "${@get_git_hash('${S}', d)}"
+
+def get_git_hash(path, d):
+    return oe_run(d, ["git", "rev-parse", "--short", "HEAD"], cwd=path).rstrip()
+
+def get_git_pv(path, d, tagadjust=None):
+    import os
+    import oe.process
+
+    gitdir = os.path.abspath(os.path.join(d.getVar("S", True), ".git"))
+    def git(cmd):
+        try:
+            return oe_run(d, ["git"] + cmd, cwd=gitdir).rstrip()
+        except oe.process.CmdError, exc:
+            bb.fatal(str(exc))
+
+    try:
+        ver = oe_run(d, ["git", "describe", "--tags"], cwd=gitdir).rstrip()
+    except Exception, exc:
+        bb.fatal(str(exc))
+
+    if not ver:
+        try:
+            ver = get_git_hash(gitdir, d)
+        except Exception, exc:
+            bb.fatal(str(exc))
+
+        if ver:
+            return "0.0+%s" % ver
+        else:
+            return "0.0"
+    else:
+        if tagadjust:
+            ver = tagadjust(ver)
+        return ver
+
+def mark_recipe_dependencies(path, d):
+    from bb.parse import mark_dependency
+
+    gitdir = os.path.join(path, ".git")
+
+    # Force the recipe to be reparsed so the version gets bumped
+    # if the active branch is switched, or if the branch changes.
+    mark_dependency(d, os.path.join(gitdir, "HEAD"))
+
+    # Force a reparse if anything in the index changes.
+    mark_dependency(d, os.path.join(gitdir, "index"))
+
+    try:
+        ref = oe_run(d, ["git", "symbolic-ref", "-q", "HEAD"], cwd=gitdir).rstrip()
+    except oe.process.CmdError:
+        pass
+    else:
+        if ref:
+            mark_dependency(d, os.path.join(gitdir, ref))
+
+    # Catch new tags.
+    tagdir = os.path.join(gitdir, "refs", "tags")
+    if os.path.exists(tagdir):
+        mark_dependency(d, tagdir)
+
+python () {
+    mark_recipe_dependencies(d.getVar("S", True), d)
+}

+ 7 - 0
meta-oe/classes/glx-use-tls.bbclass

@@ -0,0 +1,7 @@
+def get_tls_setting(bb, d):
+    # until we have no prober TLS support in uclibc disable it
+    if bb.data.getVar('TARGET_OS', d, 1).find('uclibc') >= 0 :
+        return ""
+    return "--enable-glx-tls"
+
+EXTRA_OECONF += "${@get_tls_setting(bb, d)}"

+ 17 - 0
meta-oe/classes/gpe.bbclass

@@ -0,0 +1,17 @@
+DEPENDS_prepend = "virtual/libintl intltool-native "
+GPE_TARBALL_SUFFIX ?= "gz"
+SRC_URI = "${GPE_MIRROR}/${PN}-${PV}.tar.${GPE_TARBALL_SUFFIX}"
+FILES_${PN} += "${datadir}/gpe ${datadir}/application-registry"
+SECTION ?= "gpe"
+
+inherit gettext
+
+gpe_do_compile() {
+	oe_runmake PREFIX=${prefix}
+}
+
+gpe_do_install() {
+	oe_runmake PREFIX=${prefix} DESTDIR=${D} install
+}
+
+EXPORT_FUNCTIONS do_compile do_install

+ 123 - 0
meta-oe/classes/srctree.bbclass

@@ -0,0 +1,123 @@
+# Copyright (C) 2009 Chris Larson <clarson@kergoth.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+#
+# srctree.bbclass enables operation inside of an existing source tree for a
+# project, rather than using the fetch/unpack/patch idiom.
+#
+# By default, it expects that you're keeping the recipe(s) inside the
+# aforementioned source tree, but you could override S to point at an external
+# directory and place the recipes in a normal collection/overlay, if you so
+# chose.
+#
+# It also provides some convenience python functions for assembling your
+# do_clean, if you want to leverage things like 'git clean' to simplify the
+# operation.
+
+
+# Grab convenience methods & sane default for do_clean
+inherit clean
+
+# Build here
+S = "${FILE_DIRNAME}"
+SRC_URI = ""
+
+def remove_tasks(deltasks, d):
+    for task in filter(lambda k: d.getVarFlag(k, "task"), d.keys()):
+        deps = d.getVarFlag(task, "deps")
+        for preptask in deltasks:
+            if preptask in deps:
+                deps.remove(preptask)
+        d.setVarFlag(task, "deps", deps)
+
+addtask configure after do_setscene
+
+def merge_tasks(d):
+    """
+    Merges all of the operations that occur prior to do_populate_sysroot
+    into do_populate_sysroot.
+
+    This is necessary because of recipe variants (normal, native, cross,
+    sdk).  If a bitbake run happens to want to build more than one of
+    these variants in a single run, it's possible for them to step on one
+    another's toes, due to the shared ${S}.  Interleaved
+    configure/compile/install amongst variants will break things badly.
+    """
+    from itertools import chain
+    from bb import note
+
+    def __gather_taskdeps(task, seen):
+        for dep in d.getVarFlag(task, "deps"):
+            if not dep in seen:
+                __gather_taskdeps(dep, seen)
+        if not task in seen:
+            seen.append(task)
+
+    def gather_taskdeps(task):
+        items = []
+        __gather_taskdeps(task, items)
+        return items
+
+    newtask = "do_populate_sysroot_post"
+    mergedtasks = gather_taskdeps(newtask)
+    mergedtasks.pop()
+
+    for task in (key for key in d.keys()
+                 if d.getVarFlag(key, "task") and
+                 not key in mergedtasks):
+        deps = d.getVarFlag(task, "deps")
+        for mergetask in mergedtasks:
+            if mergetask in (d.getVarFlag(task, "recrdeptask"),
+                             d.getVarFlag(task, "recdeptask"),
+                             d.getVarFlag(task, "deptask")):
+                continue
+
+            if mergetask in deps:
+                deps.remove(mergetask)
+                #note("removing dep on %s from %s" % (mergetask, task))
+
+                if not newtask in deps:
+                    #note("adding dep on %s to %s" % (newtask, task))
+                    deps.append(newtask)
+        d.setVarFlag(task, "deps", deps)
+
+    # Pull cross recipe task deps over
+    depends = []
+    deptask = []
+    for task in mergedtasks[:-1]:
+        depends.append(d.getVarFlag(task, "depends") or "")
+        deptask.append(d.getVarFlag(task, "deptask") or "")
+
+    d.setVarFlag("do_populate_sysroot_post", "depends", " ".join(depends))
+    d.setVarFlag("do_populate_sysroot_post", "deptask", " ".join(deptask))
+
+python () {
+    remove_tasks(["do_patch", "do_unpack", "do_fetch"], d)
+    b = d.getVar("B", True)
+    if not b or b == d.getVar("S", True):
+        merge_tasks(d)
+}
+
+# Manually run do_install & all of its deps
+python do_populate_sysroot_post () {
+    from os.path import exists
+    from bb.build import exec_func, make_stamp
+    from bb import note
+
+    stamp = d.getVar("STAMP", True)
+
+    def rec_exec_task(task, seen):
+        for dep in d.getVarFlag(task, "deps"):
+            if not dep in seen:
+                rec_exec_task(dep, seen)
+        seen.add(task)
+        if not exists("%s.%s" % (stamp, task)):
+            note("%s: executing task %s" % (d.getVar("PF", True), task))
+            exec_func(task, d)
+            flags = d.getVarFlags(task)
+            if not flags.get('nostamp') and not flags.get('selfstamp'):
+                make_stamp(task, d)
+
+    rec_exec_task("do_populate_sysroot", set())
+}
+addtask populate_sysroot_post after do_populate_sysroot
+do_populate_sysroot_post[lockfiles] += "${S}/.lock"

+ 71 - 0
meta-oe/recipes-connectivity/bluez/bluez4.inc

@@ -0,0 +1,71 @@
+DESCRIPTION = "Linux Bluetooth Stack Userland V4"
+HOMEPAGE = "http://www.bluez.org"
+SECTION = "libs"
+PRIORITY = "optional"
+LICENSE = "GPLv2/LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+                    file://COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09 \
+"
+DEPENDS = "gst-plugins-base alsa-lib virtual/libusb0 dbus-glib"
+INC_PR = "r8"
+
+# temporary solution until bug 5176 is properly fixed
+PROVIDES += "bluez-utils bluez-libs bluez-utils-dbus"
+RPROVIDES_bluez4 += "bluez-utils bluez-libs bluez-utils-dbus"
+RPROVIDES_bluez4-dev = "bluez-libs-dev"
+
+SRC_URI = "\
+  http://www.kernel.org/pub/linux/bluetooth/bluez-${PV}.tar.gz \
+  file://fix-dfutool-usb-declaration-mismatch.patch \
+  file://bluetooth.conf \
+"
+S = "${WORKDIR}/bluez-${PV}"
+
+inherit autotools update-rc.d
+
+EXTRA_OECONF = "\
+  --enable-gstreamer \
+  --enable-alsa \
+  --enable-usb \
+  --enable-netlink \
+  --enable-tools \
+  --enable-bccmd \
+  --enable-hid2hci \
+  --enable-dfutool \
+  --enable-hidd \
+  --enable-pand \
+  --enable-dund \
+  --disable-cups \
+  --enable-test \
+  --enable-manpages \
+  --enable-configfiles \
+  --enable-initscripts \
+  --disable-pcmciarules \
+"
+
+do_install_append() {
+        install -m 0644 ${S}/audio/audio.conf ${D}/${sysconfdir}/bluetooth/
+        install -m 0644 ${S}/network/network.conf ${D}/${sysconfdir}/bluetooth/
+        install -m 0644 ${S}/input/input.conf ${D}/${sysconfdir}/bluetooth/
+        # at_console doesn't really work with the current state of OE, so punch some more holes so people can actually use BT
+        install -m 0644 ${WORKDIR}/bluetooth.conf ${D}/${sysconfdir}/dbus-1/system.d/
+}
+
+INITSCRIPT_NAME = "bluetooth"
+INITSCRIPT_PARAMS = "defaults 23 19"
+
+PACKAGES =+ "gst-plugin-bluez libasound-module-bluez"
+
+FILES_gst-plugin-bluez = "${libdir}/gstreamer-0.10/lib*.so"
+FILES_libasound-module-bluez = "${libdir}/alsa-lib/lib*.so ${datadir}/alsa/bluetooth.conf"
+FILES_${PN} += "${libdir}/bluetooth/plugins/*.so ${base_libdir}/udev"
+FILES_${PN}-dev += "\
+  ${libdir}/bluetooth/plugins/*.la \
+  ${libdir}/alsa-lib/*.la \
+  ${libdir}/gstreamer-0.10/*.la \
+"
+
+FILES_${PN}-dbg += "\
+  ${libdir}/bluetooth/plugins/.debug \
+  ${libdir}/*/.debug \
+"

+ 16 - 0
meta-oe/recipes-connectivity/bluez/bluez4/bluetooth.conf

@@ -0,0 +1,16 @@
+<!-- This configuration file specifies the required security policies
+     for Bluetooth core daemon to work. -->
+
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+  <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+  <policy context="default">
+    <allow own="org.bluez"/>
+    <allow send_destination="org.bluez"/>
+    <allow send_interface="org.bluez.Agent"/>
+  </policy>
+
+</busconfig>

+ 13 - 0
meta-oe/recipes-connectivity/bluez/bluez4/fix-dfutool-usb-declaration-mismatch.patch

@@ -0,0 +1,13 @@
+Index: bluez-4.27/tools/dfutool.c
+===================================================================
+--- bluez-4.27.orig/tools/dfutool.c
++++ bluez-4.27/tools/dfutool.c
+@@ -59,7 +59,7 @@
+ #endif
+ 
+ #ifdef NEED_USB_GET_BUSSES
+-static inline struct usb_bus *usb_get_busses(void)
++inline struct usb_bus *usb_get_busses(void)
+ {
+ 	return usb_busses;
+ }

+ 33 - 0
meta-oe/recipes-connectivity/bluez/bluez4/hid2hci_usb_init.patch

@@ -0,0 +1,33 @@
+# Signed-off-by: Khem Raj <raj.khem@gmail.com>
+#
+# Use the new usb1 API for usb_init() and check for fails from 
+# usb_init (). Currently we see a crash on a system which does
+# not have USB because usb_init() fails and it cleans up all initialized
+# data (e.g. ctx) which is used in subsequent calls to libusb
+# We return immediately if usb_init() fails for some reason.
+
+Index: bluez-4.24/tools/hid2hci.c
+===================================================================
+--- bluez-4.24.orig/tools/hid2hci.c	2008-10-25 23:40:34.000000000 -0700
++++ bluez-4.24/tools/hid2hci.c	2008-12-29 22:06:04.000000000 -0800
+@@ -337,7 +337,7 @@
+ int main(int argc, char *argv[])
+ {
+ 	struct device_info dev[16];
+-	int i, opt, num, quiet = 0, mode = HCI;
++	int i, ret, opt, num, quiet = 0, mode = HCI;
+ 
+ 	while ((opt = getopt_long(argc, argv, "+01qh", main_options, NULL)) != -1) {
+ 		switch (opt) {
+@@ -361,8 +361,9 @@
+ 	argc -= optind;
+ 	argv += optind;
+ 	optind = 0;
+-
+-	usb_init();
++	ret = libusb_init();
++	if (ret < 0)
++		return ret;
+ 
+ 	num = find_devices(mode, dev, sizeof(dev) / sizeof(dev[0]));
+ 	if (num <= 0) {

+ 11 - 0
meta-oe/recipes-connectivity/bluez/bluez4/sbc-thumb.patch

@@ -0,0 +1,11 @@
+--- bluez/sbc/sbc_math.h~	2008-03-05 20:18:03.000000000 +0000
++++ bluez/sbc/sbc_math.h	2008-10-27 13:39:27.000000000 +0000
+@@ -59,7 +59,7 @@
+ 
+ #define SBC_FIXED_0(val) { val = 0; }
+ #define MUL(a, b)        ((a) * (b))
+-#ifdef __arm__
++#if defined(__arm__) && !defined(__thumb__)
+ #define MULA(a, b, res) ({				\
+ 		int tmp = res;			\
+ 		__asm__(				\

+ 15 - 0
meta-oe/recipes-connectivity/bluez/bluez4_4.91.bb

@@ -0,0 +1,15 @@
+require bluez4.inc
+
+SRC_URI[md5sum] = "3059b7ef5168c84cd0c6a67034ce79f9"
+SRC_URI[sha256sum] = "11e9279e2669db996afd464b96d2c68f41f157f6eb9b8842a0bbcad8a4eac18d"
+
+DEPENDS += "libsndfile1"
+
+PR = "${INC_PR}.0"
+
+# Not all distros have a recent enough udev
+BTUDEV = " --disable-udevrules"
+BTUDEV_angstrom = " --enable-udevrules"
+BTUDEV_shr = " --enable-udevrules"
+
+EXTRA_OECONF += "${BTUDEV}"

+ 79 - 0
meta-oe/recipes-connectivity/connman/connman.inc

@@ -0,0 +1,79 @@
+SUMMARY = "A daemon for managing internet connections within embedded devices"
+DESCRIPTION = "The ConnMan project provides a daemon for managing \
+internet connections within embedded devices running the Linux \
+operating system.  The Connection Manager is designed to be slim and \
+to use as few resources as possible, so it can be easily integrated. \
+It is a fully modular system that can be extended, through plug-ins, \
+to support all kinds of wired or wireless technologies. Also, \
+configuration methods, like DHCP and domain name resolving, are \
+implemented using plug-ins."
+HOMEPAGE = "http://connman.net/"
+BUGTRACKER = "http://bugs.meego.com/buglist.cgi?quicksearch=connman"
+LICENSE  = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+                    file://src/main.c;beginline=1;endline=20;md5=4b55b550fa6b33cc2055ef30dd262b3e"
+
+# we need to define the depends here, the dynamic stuff is too late
+DEPENDS  = "libnl wpa-supplicant dbus glib-2.0 ppp busybox dhcp resolvconf bluez4"
+
+EXTRA_OECONF += "\
+    ac_cv_path_WPASUPPLICANT=/usr/sbin/wpa_supplicant \
+    ac_cv_path_DHCLIENT=/sbin/dhclient \
+    ac_cv_path_UDHCPC=/sbin/udhcpc \
+    ac_cv_path_RESOLVCONF=/sbin/resolvconf \
+    ac_cv_path_PPPD=/usr/sbin/pppd \
+"
+
+INITSCRIPT_NAME = "connman"
+INITSCRIPT_PARAMS = "start 05 5 2 . stop 22 0 1 6 ."
+
+PARALLEL_MAKE = ""
+
+inherit autotools pkgconfig update-rc.d
+
+do_configure_append() {
+	ln -sf . include/connman
+}
+
+do_compile_append() {
+	sed -i -e s:deny:allow:g src/connman-dbus.conf
+}
+
+do_install_append() {
+	install -d ${D}${sysconfdir}/init.d
+    install -m 0755 ${WORKDIR}/connman ${D}${sysconfdir}/init.d/connman
+}
+
+python populate_packages_prepend() {
+	depmap = dict( pppd="ppp", udhcp="busybox connman-scripts", dhclient="dhcp-client", wifi="wpa-supplicant", resolvconf="resolvconf", bluetooth="bluez4" )
+	packages = []
+	hook = lambda file,pkg,b,c,d:packages.append((file,pkg))
+	plugin_dir = bb.data.expand('${libdir}/connman/plugins/', d)
+	plugin_name = bb.data.expand('${PN}-plugin-%s', d)
+	do_split_packages(d, plugin_dir, '^(.*).so$', plugin_name, '${PN} plugin for %s', extra_depends='', hook=hook )
+	for (file, package) in packages:
+		plugintype = package.split( '-' )[-1]
+		if plugintype in depmap:
+			rdepends = bb.data.getVar( "RDEPENDS_%s" % package, d )
+			bb.note( "Adding rdependency on %s to package %s" % ( depmap[plugintype], package ) )
+			bb.data.setVar("RDEPENDS_%s" % package, depmap[plugintype], d)
+}
+
+PACKAGES_DYNAMIC = "${PN}-plugin-*"
+
+PACKAGES += "${PN}-scripts ${PN}-test-utils"
+
+FILES_${PN} = "${bindir}/* ${sbindir}/* ${libexecdir}/* ${libdir}/lib*.so.* \
+            ${sysconfdir} ${sharedstatedir} ${localstatedir} \
+            ${base_bindir}/* ${base_sbindir}/* ${base_libdir}/*.so* ${datadir}/${PN} \
+            ${datadir}/pixmaps ${datadir}/applications \
+            ${datadir}/idl ${datadir}/omf ${datadir}/sounds \
+            ${libdir}/bonobo/servers \
+            ${datadir}/dbus-1/system-services/*"
+
+FILES_${PN}-test-utils += "${libdir}/connman/test/*"
+
+FILES_${PN}-scripts += "${libdir}/connman/scripts"
+FILES_${PN}-dbg += "${libdir}/connman/*/.debug"
+FILES_${PN}-dev += "${libdir}/connman/*/*.la"
+

+ 42 - 0
meta-oe/recipes-connectivity/connman/connman/connman

@@ -0,0 +1,42 @@
+#!/bin/sh
+
+DAEMON=/usr/sbin/connmand
+PIDFILE=/var/run/connmand.pid
+DESC="Connection Manager"
+
+if [ -f /etc/default/connman ] ; then
+	. /etc/default/connman
+fi
+
+set -e
+
+do_start() {
+	$DAEMON
+}
+
+do_stop() {
+	start-stop-daemon --stop --name connmand --quiet
+}
+
+case "$1" in
+  start)
+	echo "Starting $DESC"
+	do_start
+	;;
+  stop)
+	echo "Stopping $DESC"
+	do_stop
+	;;
+  restart|force-reload)
+	echo "Restarting $DESC"
+	do_stop
+	sleep 1
+	do_start
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0

+ 13 - 0
meta-oe/recipes-connectivity/connman/connman/link-against-libnl2.patch

@@ -0,0 +1,13 @@
+Index: connman-0.46/configure.ac
+===================================================================
+--- connman-0.46.orig/configure.ac
++++ connman-0.46/configure.ac
+@@ -326,7 +326,7 @@
+ AC_ARG_ENABLE(tools, AC_HELP_STRING([--enable-tools],
+ 		[enable testing tools]), [enable_tools=${enableval}])
+ if (test "${enable_tools}" = "yes"); then
+-	PKG_CHECK_MODULES(NETLINK, libnl-1, dummy=yes,
++	PKG_CHECK_MODULES(NETLINK, libnl-2.0, dummy=yes,
+ 				AC_MSG_ERROR(Netlink library is required))
+ 	AC_SUBST(NETLINK_CFLAGS)
+ 	AC_SUBST(NETLINK_LIBS)

+ 42 - 0
meta-oe/recipes-connectivity/connman/connman/shr/connman

@@ -0,0 +1,42 @@
+#!/bin/sh
+
+DAEMON="/usr/sbin/connmand -I usb0"
+PIDFILE=/var/run/connmand.pid
+DESC="Connection Manager"
+
+if [ -f /etc/default/connman ] ; then
+	. /etc/default/connman
+fi
+
+set -e
+
+do_start() {
+	$DAEMON
+}
+
+do_stop() {
+	start-stop-daemon --stop --name connmand --quiet
+}
+
+case "$1" in
+  start)
+	echo "Starting $DESC"
+	do_start
+	;;
+  stop)
+	echo "Stopping $DESC"
+	do_stop
+	;;
+  restart|force-reload)
+	echo "Restarting $DESC"
+	do_stop
+	sleep 1
+	do_start
+	;;
+  *)
+	echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+	exit 1
+	;;
+esac
+
+exit 0

+ 31 - 0
meta-oe/recipes-connectivity/connman/connman_0.72.bb

@@ -0,0 +1,31 @@
+require connman.inc
+# connman requires libXtables now
+DEPENDS += "iptables"
+PR = "r0"
+
+EXTRA_OECONF += "\
+  --disable-gtk-doc \
+  --enable-debug \
+  --enable-threads \
+  --enable-loopback \
+  --enable-ethernet \
+  --enable-wifi \
+  --disable-wimax \
+  --enable-bluetooth \
+  --enable-ofono \
+  --enable-resolvconf \
+  --enable-dnsproxy \
+  --enable-tools \
+  --disable-polkit \
+  --enable-client \
+  --enable-fake \
+"
+
+SRC_URI  = "\
+  http://www.kernel.org/pub/linux/network/connman/connman-${PV}.tar.gz \
+  file://link-against-libnl2.patch \
+  file://connman \
+"
+
+SRC_URI[md5sum] = "800f9356e0471c88819eee7184713a1f"
+SRC_URI[sha256sum] = "9c8ad312573683fc9f50d5042d4a87ddc8e0700b27ac1b0fb8dc2e8b7424a60f"

+ 18 - 0
meta-oe/recipes-connectivity/phonet-utils/phonet-utils_git.bb

@@ -0,0 +1,18 @@
+DESCRIPTION = "This small package provides a few command line tools for Linux Phonet"
+HOMEPAGE = ""
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
+SRC_URI = "git://gitorious.org/meego-cellular/phonet-utils.git;branch=master;protocol=git"
+PR = "r0"
+S = "${WORKDIR}/git"
+SRCREV = "4acfa720fd37d178a048fc2be17180137d4a70ea"
+PV = "0.0.0+gitr${SRCPV}"
+
+do_compile () {
+	make
+}
+
+do_install () {
+	DESTDIR=${D} oe_runmake install
+}
+

+ 32 - 0
meta-oe/recipes-core/meta/distro-feed-configs.bb

@@ -0,0 +1,32 @@
+DESCRIPTION = "Configuration files for online package repositories aka feeds"
+PR = "r1"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${TOPDIR}/meta-shr/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+DISTRO_FEED_PREFIX ?= "remote"
+DISTRO_FEED_URI ?= "http://my-distribution.example/remote-feed/"
+
+do_compile() {
+    mkdir -p ${S}/${sysconfdir}/opkg
+    for feed in all ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}; do
+        echo "src/gz ${DISTRO_FEED_PREFIX}-${feed} ${DISTRO_FEED_URI}/${feed}" > ${S}/${sysconfdir}/opkg/${feed}-feed.conf
+    done
+}
+do_install () {
+        install -d ${D}${sysconfdir}/opkg
+        install -m 0644 ${S}/${sysconfdir}/opkg/* ${D}${sysconfdir}/opkg/
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+#def distro_feed_configs(d):
+#    import bb
+#    parchs = bb.data.getVar( "PACKAGE_EXTRA_ARCHS", d, 1 ).split()
+#    march = bb.data.getVar( "MACHINE_ARCH", d, 1 ).split()
+#    archs = [ "all" ] + parchs + march
+#    confs = [ ( "${sysconfdir}/opkg/%s-feed.conf" % feed ) for feed in archs ]
+#    return " ".join( confs )
+#
+#CONFFILES_${PN} += '${@distro_feed_configs(d)}'
+
+CONFFILES_${PN} += '${@ " ".join( [ ( "${sysconfdir}/opkg/%s-feed.conf" % feed ) for feed in "all ${PACKAGE_EXTRA_ARCHS} ${MACHINE_ARCH}".split() ] ) }'

+ 52 - 0
meta-oe/recipes-core/tasks/task-cli-tools.bb

@@ -0,0 +1,52 @@
+DESCRIPTION = "A set of useful command line tools"
+DESCRIPTION_${PN}-debug = "A set of command line tools useful for debugging"
+SECTION = "console"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${TOPDIR}/meta-shr/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+PV = "1.0"
+PR = "r18"
+
+inherit task
+
+PACKAGES += "${PN}-debug"
+
+def get_ltrace(bb, d):
+    if bb.data.getVar('TARGET_ARCH', d, 1) in [ 'sh4', 'sh3' ] :
+        return ""
+    return "ltrace"
+
+RDEPENDS_${PN} = "\
+  dbus-daemon-proxy \
+  dosfstools \
+  htop \
+  iptables \
+  lsof \
+  mbuffer \
+  mdbus2 \
+  mtd-utils \
+  mterm2 \
+  nano \
+  nfs-utils-client \
+  nmon \
+  powertop \
+  screen \
+  socat \
+  sysstat \
+"
+
+RDEPENDS_${PN}-debug = "\
+  evtest \
+  devmem2 \
+  i2c-tools \
+  gdb \
+  ${@get_ltrace(bb, d)} \
+  mkdump \
+  mioctl \
+  procps \
+  pxaregs \
+  s3c24xx-gpio \
+  s3c64xx-gpio \
+  serial-forward \
+  strace \
+  tcpdump \
+"

+ 43 - 0
meta-oe/recipes-core/tasks/task-x11.bb

@@ -0,0 +1,43 @@
+DESCRIPTION = "The X Window System -- install this task to get a client/server based display multiplexer."
+SECTION = "x11/server"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${TOPDIR}/meta-shr/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+PV = "1.0"
+PR = "r7"
+
+# WORK IN PROGRESS
+
+inherit task
+
+PACKAGES += "\
+  ${PN}-server \
+  ${PN}-utils \
+"
+
+RRECOMMENDS_${PN} = "\
+  ${PN}-server \
+  ${PN}-utils \
+"
+
+# Some machines don't set a *runtime* provider for X, so default to Xfbdev here
+# virtual/xserver won't work, since the kdrive recipes will build multiple xserver packages
+XSERVER ?= "xserver-kdrive-fbdev"
+XSERVER_COMMON ?= "xserver-kdrive-common"
+XSERVER_COMMON_shr = "xserver-common"
+
+# This is also the reason why we have to make this package machine specific :/
+PACKAGE_ARCH_${PN}-server = "${MACHINE_ARCH}"
+
+RDEPENDS_${PN}-server = "\
+  ${XSERVER} \
+"
+
+RDEPENDS_${PN}-utils = "\
+  ${XSERVER_COMMON} \
+  xserver-nodm-init \
+  xauth \
+  xhost \
+  xset \
+  xrandr \
+"
+

+ 482 - 0
meta-oe/recipes-devtools/gdbus-binding-tool/gdbus-binding-tool/COPYING

@@ -0,0 +1,482 @@
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+    		    59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Library General Public
+    License as published by the Free Software Foundation; either
+    version 2 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Library General Public License for more details.
+
+    You should have received a copy of the GNU Library General Public
+    License along with this library; if not, write to the 
+    Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
+    Boston, MA  02111-1307  USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!

+ 37 - 0
meta-oe/recipes-devtools/gdbus-binding-tool/gdbus-binding-tool_git.bb

@@ -0,0 +1,37 @@
+DESCRIPTION = "gdbus-binding-tool is used to generate C code for interacting with remote objects using D-Bus."
+DEPENDS = "glib-2.0 gdbus-binding-tool-native"
+DEPENDS_virtclass-native = "glib-2.0-native"
+RDEPENDS_${PN} = "glib-2.0-utils"
+# taken from glib where this is supposed to be moved later
+LICENSE = "LGPLv2+ & BSD & public domain"
+LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING;md5=3bf50002aefd002f49e7bb854063f7e7"
+
+PR = "r2"
+
+inherit autotools pkgconfig
+
+SRC_URI = "git://anongit.freedesktop.org/~david/${BPN};protocol=git;branch=master \
+           file://COPYING"
+SRCREV = "229fd9adbb6bd9d824b38a3bd092229016540f41"
+PV = "0.1+gitr${SRCPV}"
+S = "${WORKDIR}/git"
+
+do_configure() {
+  # missing ${topdir}/gtk-doc.make and --disable-gtk-doc* is not enough
+  sed -i '/^doc\/Makefile/d' ${S}/configure.ac
+  sed -i 's/SUBDIRS = src doc/SUBDIRS = src/g' ${S}/Makefile.am
+
+  # cannot execute target binary, so use staged native
+  sed -i "s#\$(top_builddir)/src/gdbus-codegen#${STAGING_BINDIR_NATIVE}/gdbus-codegen#g" ${S}/src/Makefile.am
+
+  autotools_do_configure
+}
+do_configure_virtclass-native() {
+  # missing ${topdir}/gtk-doc.make and --disable-gtk-doc* is not enough
+  sed -i '/^doc\/Makefile/d' ${S}/configure.ac
+  sed -i 's/SUBDIRS = src doc/SUBDIRS = src/g' ${S}/Makefile.am
+
+  autotools_do_configure
+}
+
+BBCLASSEXTEND = "native"

+ 20 - 0
meta-oe/recipes-devtools/gobject-introspection/gobject-introspection/use-usr-bin-env-for-python.patch

@@ -0,0 +1,20 @@
+Index: gobject-introspection-0.9.10/tools/g-ir-annotation-tool.in
+===================================================================
+--- gobject-introspection-0.9.10.orig/tools/g-ir-annotation-tool.in
++++ gobject-introspection-0.9.10/tools/g-ir-annotation-tool.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/env python
+ # -*- Mode: Python -*-
+ # GObject-Introspection - a framework for introspecting GObject libraries
+ # Copyright (C) 2008  Johan Dahlin
+Index: gobject-introspection-0.9.10/tools/g-ir-scanner.in
+===================================================================
+--- gobject-introspection-0.9.10.orig/tools/g-ir-scanner.in
++++ gobject-introspection-0.9.10/tools/g-ir-scanner.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON@
++#!/usr/bin/env python
+ # -*- Mode: Python -*-
+ # GObject-Introspection - a framework for introspecting GObject libraries
+ # Copyright (C) 2008  Johan Dahlin

+ 32 - 0
meta-oe/recipes-devtools/gobject-introspection/gobject-introspection_0.9.10.bb

@@ -0,0 +1,32 @@
+# NOTE: WIP! This recipe does not cross-compile atm., only -native
+SECTION = "libs"
+DEPENDS = "glib-2.0 libffi bison-native"
+BBCLASSEXTEND = "native"
+PR = "r1"
+
+LICENSE = "GPLv2+ & LGPLv2+"
+LIC_FILES_CHKSUM = "file://COPYING;md5=90d577535a3898e1ae5dbf0ae3509a8c \
+                    file://COPYING.GPL;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://COPYING.LGPL;md5=3bf50002aefd002f49e7bb854063f7e7"
+
+SRC_URI[md5sum] = "e5cd63d6bcc5c105e898e7c33cf42175"
+SRC_URI[sha256sum] = "4bf244db75df04499dea704e7734376c0fc5a3a17fb59be2123c8d76111e6fb8"
+
+SRC_URI = "\
+  ${GNOME_MIRROR}/gobject-introspection/0.9/${BPN}-${PV}.tar.bz2 \
+  file://use-usr-bin-env-for-python.patch \
+"
+S = "${WORKDIR}/${BPN}-${PV}"
+
+inherit autotools
+
+do_configure_prepend() {
+	touch -f gtk-doc.make
+}
+
+EXTRA_OECONF = "\
+  --disable-gtk-doc \
+  --disable-gtk-doc-html \
+  --disable-gtk-doc-pdf \
+  --disable-tests \
+"

+ 14 - 0
meta-oe/recipes-devtools/json-glib/json-glib_0.10.4.bb

@@ -0,0 +1,14 @@
+DESCRIPTION = "JSON-GLib is a library providing serialization and deserialization support for the JavaScript Object Notation (JSON) format"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=7fbc338309ac38fefcd64b04bb903e34"
+DEPENDS = "glib-2.0"
+
+PR = "r1"
+
+EXTRA_OECONF = "--enable-introspection=no"
+
+inherit autotools
+SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/json-glib/0.10/json-glib-0.10.4.tar.gz"
+
+SRC_URI[md5sum] = "87677e939a4b3d42e1c56b2a3046b9bb"
+SRC_URI[sha256sum] = "9561b3c58b350c89333d154f1e8669b8ece611c9c724252aed0e6273cda9cc6f"

+ 13 - 0
meta-oe/recipes-devtools/libcanberra/libcanberra/libcanberra-increase-buffer-size.patch

@@ -0,0 +1,13 @@
+Index: libcanberra-0.14/src/alsa.c
+===================================================================
+--- libcanberra-0.14.orig/src/alsa.c
++++ libcanberra-0.14/src/alsa.c
+@@ -272,7 +272,7 @@
+     return translate_error(ret);
+ }
+ 
+-#define BUFSIZE (16*1024)
++#define BUFSIZE (128*1024)
+ 
+ static void* thread_func(void *userdata) {
+     struct outstanding *out = userdata;

+ 56 - 0
meta-oe/recipes-devtools/libcanberra/libcanberra_0.26.bb

@@ -0,0 +1,56 @@
+DESCRIPTION = "Libcanberra is an implementation of the XDG Sound Theme and Name \
+Specifications, for generating event sounds on free desktops."
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1"
+DEPENDS = "alsa-lib gstreamer gtk+ libtool libvorbis gconf"
+SECTION = "libs/multimedia"
+AUTHOR = "Lennart Poettering"
+HOMEPAGE = "http://0pointer.de/lennart/projects/libcanberra"
+PR = "r1"
+
+inherit autotools vala
+
+SRC_URI = "http://0pointer.de/lennart/projects/libcanberra/libcanberra-${PV}.tar.gz \
+           file://libcanberra-increase-buffer-size.patch"
+
+SRC_URI[md5sum] = "ee2c66ada7c851a4e7b6eb1682285a24"
+SRC_URI[sha256sum] = "4b5d8d2c2835133620adbc53745dd107b6e58b9a2963059e8f457143fee00982"
+
+EXTRA_OECONF = "\
+  --enable-alsa \
+  --enable-gstreamer \
+  --enable-gtk \
+  --enable-multi \
+  --enable-null \
+  --disable-oss \
+  --disable-pulse \
+  --disable-tdb \
+"
+# enable pulse again when pulseaudio >= 0.9.11 is the default in OE
+
+python populate_packages_prepend() {
+	plugindir = bb.data.expand('${libdir}/${P}/', d)
+	do_split_packages(d, plugindir, '^libcanberra-(.*)\.so$', 'libcanberra-%s', '%s support library', extra_depends='' )
+}
+
+PACKAGES =+ "${PN}-gtk"
+
+PACKAGES_DYNAMIC = "libcanberra-*"
+
+FILES_${PN}-gtk = "\
+  ${sysconfdir}/gconf \
+  ${bindir}/* \
+  ${libdir}/libcanberra-gtk.so.* \
+  ${libdir}/gtk-2.0/modules/* \
+  ${datadir}/gnome \
+  ${datadir}/gdm \
+"
+
+FILES_${PN}-dev += "\
+  ${libdir}/${P}/*.la \
+"
+
+FILES_${PN}-dbg += "\
+  ${libdir}/gtk-2.0/modules/.debug \
+  ${libdir}/${P}/.debug \
+"

+ 18 - 0
meta-oe/recipes-devtools/libgee/libgee.inc

@@ -0,0 +1,18 @@
+DESCRIPTION = "libgee is a collection library providing GObject-based interfaces \
+and classes for commonly used data structures."
+HOMEPAGE = "http://live.gnome.org/Libgee"
+SECTION = "libs"
+DEPENDS = "glib-2.0"
+BBCLASSEXTEND = "native"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
+INC_PR = "r6"
+PE = "1"
+
+inherit autotools vala
+do_configure_prepend() {
+     MACROS="libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4"
+      for i in ${MACROS}; do
+         rm -f m4/$i
+      done
+}

+ 12 - 0
meta-oe/recipes-devtools/libgee/libgee_0.6.0.bb

@@ -0,0 +1,12 @@
+require libgee.inc
+PE = "1"
+PR = "${INC_PR}.1"
+#autoreconf needs introspection.m4 (staged by gobject-introspection-native) after http://git.gnome.org/browse/libgee/commit/?id=d026a29b38ca1a3388981c6e75a92602212373d8
+DEPENDS += "gobject-introspection-native"
+DEPENDS_virtclass-native += "gobject-introspection-native"
+
+SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/libgee/0.6/${BPN}-${PV}.tar.bz2"
+S = "${WORKDIR}/${BPN}-${PV}"
+
+SRC_URI[md5sum] = "4eb513b23ab6ea78884989518a4acf6f"
+SRC_URI[sha256sum] = "e586678d0a88637abeaaf850b62231000772e79ea6d9c4b45dc3cea99f778a7a"

+ 24 - 0
meta-oe/recipes-devtools/python/python-dateutil_1.4.1.bb

@@ -0,0 +1,24 @@
+DESCRIPTION = "Extensions to the standard Python date/time support"
+HOMEPAGE = "http://labix.org/python-dateutil"
+SECTION = "devel/python"
+PRIORITY = "optional"
+LICENSE = "PSF"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=d82268718c68bda0b091006ec6e583c6"
+SRCNAME = "${PN}"
+PR = "r1"
+
+SRC_URI = "http://labix.org/download/python-dateutil/${SRCNAME}-${PV}.tar.gz"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit setuptools
+
+PACKAGES =+ "${PN}-zoneinfo"
+FILES_${PN}-zoneinfo = "${libdir}/${PYTHON_DIR}/site-packages/dateutil/zoneinfo"
+
+RDEPENDS_${PN} = "\
+  python-core \
+  python-datetime \
+"
+
+SRC_URI[md5sum] = "2a5f25ab12fcefcf0b21348f2d47595a"
+SRC_URI[sha256sum] = "74b615c6a55b4421187feba1633fc233e7c5ebdd7abe9b092447a32946823357"

+ 33 - 0
meta-oe/recipes-devtools/python/python-numeric/no-lapack.patch

@@ -0,0 +1,33 @@
+
+#
+# Patch managed by http://www.holgerschurig.de/patcher.html
+#
+
+--- Numeric-23.7/setup.py~nolapack
++++ Numeric-23.7/setup.py
+@@ -32,7 +32,7 @@
+     mathlibs = []
+ 
+ # delete all but the first one in this list if using your own LAPACK/BLAS
+-sourcelist = [os.path.join('Src', 'lapack_litemodule.c'),
++sourcelist = [
+               #os.path.join('Src', 'blas_lite.c'), 
+               #os.path.join('Src', 'f2c_lite.c'), 
+               #os.path.join('Src', 'zlapack_lite.c'),
+@@ -40,12 +40,12 @@
+              ]
+ # set these to use your own BLAS;
+ 
+-library_dirs_list = ['/usr/lib/atlas']
+-libraries_list = ['lapack', 'cblas', 'f77blas', 'atlas', 'g2c'] 
++library_dirs_list = []
++libraries_list = [] 
+ 
+ # set to true (1), if you also want BLAS optimized matrixmultiply/dot/innerproduct
+-use_dotblas = 1 
+-include_dirs = ['/usr/include/atlas']  
++use_dotblas = 0
++include_dirs = []  
+                    # You may need to set this to find cblas.h
+                    #  e.g. on UNIX using ATLAS this should be ['/usr/include/atlas']
+ extra_link_args = []

+ 15 - 0
meta-oe/recipes-devtools/python/python-numeric_24.2.bb

@@ -0,0 +1,15 @@
+DESCRIPTION = "A sophisticated Numeric Processing Package for Python"
+SECTION = "devel/python"
+PRIORITY = "optional"
+LICENSE = "PSF & LLNL"
+LIC_FILES_CHKSUM = "file://Legal.htm;md5=e3ce75dedd4043918d15979ae43e312e"
+
+PR = "ml1"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/numpy/Numeric-${PV}.tar.gz"
+S = "${WORKDIR}/Numeric-${PV}"
+
+inherit distutils
+
+SRC_URI[md5sum] = "2ae672656e06716a149acb048cca3093"
+SRC_URI[sha256sum] = "5f72e729eb6ff57442f2a38bfc9931738b59e5077928e2e70d22b4610ff15258"

+ 24 - 0
meta-oe/recipes-devtools/python/python-pexpect_2.3.bb

@@ -0,0 +1,24 @@
+DESCRIPTION = "A Pure Python Expect like Module for Python"
+SECTION = "devel/python"
+PRIORITY = "optional"
+LICENSE = "PSF"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=04a2bf11b85ce49d4a8c0c413fd34404"
+SRCNAME = "pexpect"
+PR = "ml1"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils
+
+RDEPENDS_${PN} = "\
+  python-core \
+  python-io \
+  python-terminal \
+  python-resource \
+  python-fcntl \
+"
+
+
+SRC_URI[md5sum] = "bf107cf54e67bc6dec5bea1f3e6a65c3"
+SRC_URI[sha256sum] = "d315e7f3a8544fd85034d7e17fd7c5854e8f0828f5791f83cf313f8fa5740b75"

+ 15 - 0
meta-oe/recipes-devtools/python/python-phoneutils_git.bb

@@ -0,0 +1,15 @@
+DESCRIPTION = "Python Bindings for libphone-utils"
+SECTION = "devel/python"
+DEPENDS = "libphone-utils python-cython-native python-pyrex-native"
+RDEPENDS_${PN} = "libphone-utils"
+LICENSE = "LGPLv2.1+"
+LIC_FILES_CHKSUM = "file://phoneutils/c_phoneutils.pyx;endline=18;md5=ca321e4ec3a30a44469b23ebca782665"
+
+SRCREV = "8a7c719e0c3f1f8c10f77f17422da02d7177f0dd"
+PV = "0.0.2+gitr${SRCPV}"
+PR = "r3"
+
+SRC_URI = "git://git.shr-project.org/repo/libphone-utils.git;protocol=http;branch=master"
+S = "${WORKDIR}/git/src/python"
+
+inherit setuptools

+ 16 - 0
meta-oe/recipes-devtools/python/python-pyalsaaudio_0.4.bb

@@ -0,0 +1,16 @@
+DESCRIPTION = "Support for the Linux 2.6.x ALSA Sound System"
+SECTION = "devel/python"
+DEPENDS = "alsa-lib"
+PRIORITY = "optional"
+LICENSE = "PSF"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=1a3b161aa0fcec32a0c8907a2219ad9d"
+SRCNAME = "pyalsaaudio"
+PR = "ml0"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/pyalsaaudio/${SRCNAME}-${PV}.tar.gz"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit distutils
+
+SRC_URI[md5sum] = "b312c28efba7db0494836a79f0a49898"
+SRC_URI[sha256sum] = "07148ce16024724b17cc24c51d0f4fb78af214b09b7dc8dcb7b06e5647f4c582"

+ 23 - 0
meta-oe/recipes-devtools/python/python-pyserial_2.4.bb

@@ -0,0 +1,23 @@
+DESCRIPTION = "Serial Port Support for Python"
+SECTION = "devel/python"
+PRIORITY = "optional"
+LICENSE = "PSF"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=7424386ffe323e815ee62ee9ad591dd8"
+SRCNAME = "pyserial"
+PR = "ml2"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${SRCNAME}/${SRCNAME}-${PV}.tar.gz"
+S = "${WORKDIR}/${SRCNAME}-${PV}"
+
+inherit setuptools
+
+# FIXME might stop packaging serialwin32 and serialjava files
+
+RDEPENDS_${PN} = "\
+  python-fcntl \
+  python-io \
+  python-stringold \
+"
+
+SRC_URI[md5sum] = "eec19df59fd75ba5a136992897f8e468"
+SRC_URI[sha256sum] = "6b6a9e3d2fd5978c92c843e0109918a4bcac481eecae316254481c0e0f7e73c8"

+ 64 - 0
meta-oe/recipes-devtools/python/python-pyyaml/setup.py

@@ -0,0 +1,64 @@
+NAME = 'PyYAML'
+VERSION = '3.06'
+DESCRIPTION = "YAML parser and emitter for Python"
+LONG_DESCRIPTION = """\
+YAML is a data serialization format designed for human readability and
+interaction with scripting languages.  PyYAML is a YAML parser and
+emitter for Python.
+
+PyYAML features a complete YAML 1.1 parser, Unicode support, pickle
+support, capable extension API, and sensible error messages.  PyYAML
+supports standard YAML tags and provides Python-specific tags that allow
+to represent an arbitrary Python object.
+
+PyYAML is applicable for a broad range of tasks from complex
+configuration files to object serialization and persistance."""
+AUTHOR = "Kirill Simonov"
+AUTHOR_EMAIL = 'xi@resolvent.net'
+LICENSE = "MIT"
+PLATFORMS = "Any"
+URL = "http://pyyaml.org/wiki/PyYAML"
+DOWNLOAD_URL = "http://pyyaml.org/download/pyyaml/%s-%s.tar.gz" % (NAME, VERSION)
+CLASSIFIERS = [
+    "Development Status :: 5 - Production/Stable",
+    "Intended Audience :: Developers",
+    "License :: OSI Approved :: MIT License",
+    "Operating System :: OS Independent",
+    "Programming Language :: Python",
+    "Topic :: Software Development :: Libraries :: Python Modules",
+    "Topic :: Text Processing :: Markup",
+]
+
+from distutils.core import setup
+from distutils.extension import Extension
+from Cython.Distutils import build_ext
+
+import sys, os.path
+
+
+if __name__ == '__main__':
+
+    setup(
+        name=NAME,
+        version=VERSION,
+        description=DESCRIPTION,
+        long_description=LONG_DESCRIPTION,
+        author=AUTHOR,
+        author_email=AUTHOR_EMAIL,
+        license=LICENSE,
+        platforms=PLATFORMS,
+        url=URL,
+        download_url=DOWNLOAD_URL,
+        classifiers=CLASSIFIERS,
+
+        package_dir={'': 'lib'},
+        packages=['yaml'],
+
+        ext_modules = [
+        Extension( "_yaml", ["ext/_yaml.pyx"], libraries = ["yaml"] )
+        ],
+
+        cmdclass={
+            'build_ext': build_ext,
+        },
+    )

+ 22 - 0
meta-oe/recipes-devtools/python/python-pyyaml_svn.bb

@@ -0,0 +1,22 @@
+DESCRIPTION = "Python support for YAML"
+HOMEPAGE = "http://www.pyyaml.org"
+SECTION = "devel/python"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=6015f088759b10e0bc2bf64898d4ae17"
+DEPENDS = "libyaml python-cython-native"
+SRCREV = "344"
+PV = "3.08+svnr${SRCPV}"
+PR = "ml0"
+
+SRC_URI = "\
+  svn://svn.pyyaml.org/pyyaml;module=trunk;proto=http \
+  file://setup.py \
+"
+S = "${WORKDIR}/trunk"
+
+inherit distutils
+
+do_configure_prepend() {
+	# upstream setup.py overcomplicated, use ours
+	install -m 0644 ${WORKDIR}/setup.py ${S}
+}

+ 17 - 0
meta-oe/recipes-devtools/python/python-vobject_0.8.1c.bb

@@ -0,0 +1,17 @@
+DESCRIPTION = "Python package for parsing and generating vCard and vCalendar files" 
+SECTION = "devel/python" 
+PRIORITY = "optional" 
+LICENSE = "Apache License V2.0" 
+LIC_FILES_CHKSUM = "file://LICENSE-2.0.txt;md5=3b83ef96387f14655fc854ddc3c6bd57"
+HOMEPAGE = "http://vobject.skyhouseconsulting.com/" 
+SRCNAME = "vobject" 
+RDEPENDS_${PN} = "python python-dateutil"
+PR = "r2"
+
+SRC_URI = "http://vobject.skyhouseconsulting.com/${SRCNAME}-${PV}.tar.gz" 
+S = "${WORKDIR}/${SRCNAME}-${PV}" 
+
+inherit setuptools  
+
+SRC_URI[md5sum] = "c9686dd74d39fdae140890d9c694c076"
+SRC_URI[sha256sum] = "594113117f2017ed837c8f3ce727616f9053baa5a5463a7420c8249b8fc556f5"

+ 16 - 0
meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool.inc

@@ -0,0 +1,16 @@
+DESCRIPTION = "Vala DBus Binding Tool"
+SECTION = "devel"
+DEPENDS = "vala libgee libxml2 intltool-native"
+HOMEPAGE = "http://wiki.freesmartphone.org/index.php/Implementations/vala-dbus-binding-tool"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504"
+PE = "1"
+INC_PR = "r3"
+
+export XDG_DATA_DIRS = "${STAGING_DATADIR}"
+
+SRC_URI = "http://downloads.freesmartphone.org/sources/vala-dbus-binding-tool-${PV}.tar.bz2;name=archive"
+
+inherit autotools
+
+BBCLASSEXTEND = "native"

+ 6 - 0
meta-oe/recipes-devtools/vala-dbus-binding-tool/vala-dbus-binding-tool_git.bb

@@ -0,0 +1,6 @@
+require vala-dbus-binding-tool.inc
+SRCREV = "fd89af4941d6478575900128d09029fa5549e0db"
+PV = "0.3.2+gitr${SRCPV}"
+
+SRC_URI = "${FREESMARTPHONE_GIT}/vala-dbus-binding-tool.git;protocol=git;branch=master"
+S = "${WORKDIR}/git"

+ 25 - 0
meta-oe/recipes-devtools/vala/vala.inc

@@ -0,0 +1,25 @@
+DESCRIPTION = "Vala is a C#-like language dedicated to ease GObject programming. \
+Vala compiles to plain C and has no runtime environment nor penalities whatsoever."
+SECTION = "devel"
+DEPENDS = "glib-2.0 dbus"
+BBCLASSEXTEND = "native"
+DEPENDS_virtclass-native = "glib-2.0-native dbus-native"
+HOMEPAGE = "http://vala-project.org"
+LICENSE = "LGPLv2.1"
+LIC_FILES_CHKSUM = "file://COPYING;md5=fbc093901857fcd118f065f900982c24"
+INC_PR = "r0"
+
+#
+# WARNING: This source release has specifically been built for OpenEmbedded.
+# Don't update to any upstream release without consulting the recipe maintainer.
+#
+
+SRC_URI = "\
+  http://downloads.freesmartphone.org/sources/vala-${PV}.tar.bz2;name=archive \
+"
+
+inherit autotools
+
+EXTRA_OECONF = "--disable-vapigen"
+
+FILES_${PN}-doc += ${datadir}/devhelp

+ 7 - 0
meta-oe/recipes-devtools/vala/vala_0.12.0.bb

@@ -0,0 +1,7 @@
+require vala.inc
+SRC_URI = "ftp://ftp.gnome.org/pub/GNOME/sources/vala/0.12/vala-0.12.0.tar.bz2"
+
+FILES_${PN} += "${datadir}/vala-0.12/vapi"
+
+SRC_URI[md5sum] = "b11fafaa705085342156312e356b6ff2"
+SRC_URI[sha256sum] = "9a398e16fba2c78c9bcadb05e489c9bc318e34901d43451ac5d2ce4bc46b1225"

+ 18 - 0
meta-oe/recipes-extended/tzcode/tzcode-native.inc

@@ -0,0 +1,18 @@
+DESCRIPTION = "tzcode, timezone zoneinfo utils -- zic, zdump, tzselect"
+INC_PR = "r4"
+
+SRC_URI = " \
+        ftp://elsie.nci.nih.gov/pub/tzcode${PV}.tar.gz;name=tzcode-${PV};subdir=${BPN}-${PV} \
+        ftp://elsie.nci.nih.gov/pub/tzdata${TZDATA_PV}.tar.gz;name=tzdata-${TZDATA_PV};subdir=${BPN}-${PV} \
+	"
+
+inherit native
+
+do_install () {
+        install -d ${D}${bindir}
+        install -m 755 zic ${D}${bindir}/
+        install -m 755 zdump ${D}${bindir}/
+        install -m 755 tzselect ${D}${bindir}/
+}
+
+NATIVE_INSTALL_WORKS = "1"

+ 19 - 0
meta-oe/recipes-extended/tzcode/tzcode-native_2011e.bb

@@ -0,0 +1,19 @@
+require tzcode-native.inc
+
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://README;md5=3ae8198f82258417ce29066d3b034035"
+
+# Note that elsie.nci.nih.gov removes old versions when new is coming out
+# So if this doesn't build for you because of missing source file, just
+# bump it to the latest available version, removing old one
+# Also, tzdata (and it is needed to build tzcode) version can differ from
+# tzcode version, thus this variable
+
+TZDATA_PV = "2011e"
+
+PR = "${INC_PR}.0"
+
+SRC_URI[tzcode-2011e.md5sum] = "fbfc05dbf9ebcfe7c4bba18549870173"
+SRC_URI[tzcode-2011e.sha256sum] = "8fb00f8763aa51d83d6f3190d144124bb7176ca829fc08823d6205297bf0426b"
+SRC_URI[tzdata-2011e.md5sum] = "044a07072300a0ee72b046e5a9a4ec90"
+SRC_URI[tzdata-2011e.sha256sum] = "44fef01de4589a4979eb6b5fdbbfd21a3b135852af1ecbfb9e0368ae47392c79"

+ 178 - 0
meta-oe/recipes-extended/tzdata/tzdata.inc

@@ -0,0 +1,178 @@
+DESCRIPTION = "Timezone data"
+SECTION = "base"
+PRIORITY = "optional"
+DEPENDS = "tzcode-native"
+
+INC_PR = "r9"
+
+DEFAULT_TIMEZONE ?= "Europe/London"
+
+RCONFLICTS_${PN} = "timezones timezone-africa timezone-america timezone-antarctica \
+             timezone-arctic timezone-asia timezone-atlantic \
+             timezone-australia timezone-europe timezone-indian \
+             timezone-iso3166.tab timezone-pacific timezone-zone.tab"
+
+SRC_URI = "ftp://elsie.nci.nih.gov/pub/tzdata${PV}.tar.gz;subdir=${BPN}-${PV}"
+
+TZONES= "africa antarctica asia australasia europe northamerica southamerica  \
+         factory solar87 solar88 solar89 etcetera backward systemv \
+        "
+#        pacificnew \
+
+CONFFILES_${PN} = "${sysconfdir}/timezone ${sysconfdir}/localtime"
+
+do_compile () {
+        mkdir -p build
+        for zone in ${TZONES}; do \
+            ${STAGING_BINDIR_NATIVE}/zic -d ${S}/build${datadir}/zoneinfo -L /dev/null \
+                -y ${S}/yearistype.sh ${S}/${zone} ; \
+            ${STAGING_BINDIR_NATIVE}/zic -d ${S}/build${datadir}/zoneinfo/posix -L /dev/null \
+                -y ${S}/yearistype.sh ${S}/${zone} ; \
+            ${STAGING_BINDIR_NATIVE}/zic -d ${S}/build${datadir}/zoneinfo/right -L ${S}/leapseconds \
+                -y ${S}/yearistype.sh ${S}/${zone} ; \
+        done
+}
+
+do_install () {
+        install -d ${D}${prefix} ${D}${datadir}/zoneinfo
+        cp -pPR ${S}/build${prefix}/* ${D}${prefix}
+        # Only eglibc is removing zoneinfo files from package
+        if [ "${LIBC}"x = "eglibc"x ] ; then
+          cp -pP "${S}/zone.tab" ${D}${datadir}/zoneinfo
+          cp -pP "${S}/iso3166.tab" ${D}${datadir}/zoneinfo
+        fi
+
+        # Install a sane default for timezones
+        install -d ${D}${sysconfdir}
+        echo ${DEFAULT_TIMEZONE} > ${D}${sysconfdir}/timezone
+        cp -pPR ${S}/build${datadir}/zoneinfo/${DEFAULT_TIMEZONE} ${D}${sysconfdir}/localtime
+}
+
+PACKAGE_ARCH = "all"
+# Packages primarily organized by directory with a major city
+# in most time zones in the base package
+
+PACKAGES = "${PN}-dbg tzdata tzdata-misc tzdata-posix tzdata-right tzdata-africa \
+    tzdata-americas tzdata-antarctica tzdata-arctic tzdata-asia \
+    tzdata-atlantic tzdata-australia tzdata-europe tzdata-pacific"
+
+ALLOW_EMPTY_${PN}-dbg = "1"
+
+FILES_tzdata-africa += "${datadir}/zoneinfo/Africa/*"
+RPROVIDES_tzdata-africa = "tzdata-africa"
+
+FILES_tzdata-americas += "${datadir}/zoneinfo/America/*  \
+                ${datadir}/zoneinfo/US/*                \
+                ${datadir}/zoneinfo/Brazil/*            \
+                ${datadir}/zoneinfo/Canada/*            \
+                ${datadir}/zoneinfo/Mexico/*            \
+                ${datadir}/zoneinfo/Chile/*"
+RPROVIDES_tzdata-americas = "tzdata-americas"
+
+FILES_tzdata-antarctica += "${datadir}/zoneinfo/Antarctica/*"
+RPROVIDES_tzdata-antarctica = "tzdata-antarctica"
+
+FILES_tzdata-arctic += "${datadir}/zoneinfo/Arctic/*"
+RPROVIDES_tzdata-arctic = "tzdata-arctic"
+
+FILES_tzdata-asia += "${datadir}/zoneinfo/Asia/*        \
+                ${datadir}/zoneinfo/Indian/*            \
+                ${datadir}/zoneinfo/Mideast/*"
+RPROVIDES_tzdata-asia = "tzdata-asia"
+
+FILES_tzdata-atlantic += "${datadir}/zoneinfo/Atlantic/*"
+RPROVIDES_tzdata-atlantic = "tzdata-atlantic"
+
+FILES_tzdata-australia += "${datadir}/zoneinfo/Australia/*"
+RPROVIDES_tzdata-australia = "tzdata-australia"
+
+FILES_tzdata-europe += "${datadir}/zoneinfo/Europe/*"
+RPROVIDES_tzdata-europe = "tzdata-europe"
+
+FILES_tzdata-pacific += "${datadir}/zoneinfo/Pacific/*"
+RPROVIDES_tzdata-pacific = "tzdata-pacific"
+
+FILES_tzdata-posix += "${datadir}/zoneinfo/posix/*"
+RPROVIDES_tzdata-posix = "tzdata-posix"
+
+FILES_tzdata-right += "${datadir}/zoneinfo/right/*"
+RPROVIDES_tzdata-right = "tzdata-right"
+
+
+FILES_tzdata-misc += "${datadir}/zoneinfo/Cuba           \
+                ${datadir}/zoneinfo/Egypt                \
+                ${datadir}/zoneinfo/Eire                 \
+                ${datadir}/zoneinfo/Factory              \
+                ${datadir}/zoneinfo/GB-Eire              \
+                ${datadir}/zoneinfo/Hongkong             \
+                ${datadir}/zoneinfo/Iceland              \
+                ${datadir}/zoneinfo/Iran                 \
+                ${datadir}/zoneinfo/Israel               \
+                ${datadir}/zoneinfo/Jamaica              \
+                ${datadir}/zoneinfo/Japan                \
+                ${datadir}/zoneinfo/Kwajalein            \
+                ${datadir}/zoneinfo/Libya                \
+                ${datadir}/zoneinfo/Navajo               \
+                ${datadir}/zoneinfo/Poland               \
+                ${datadir}/zoneinfo/Portugal             \
+                ${datadir}/zoneinfo/Singapore            \
+                ${datadir}/zoneinfo/Turkey"
+RPROVIDES_tzdata-misc = "tzdata-misc"
+
+
+FILES_${PN} += "${datadir}/zoneinfo/Pacific/Honolulu     \
+                ${datadir}/zoneinfo/America/Anchorage    \
+                ${datadir}/zoneinfo/America/Los_Angeles  \
+                ${datadir}/zoneinfo/America/Denver       \
+                ${datadir}/zoneinfo/America/Chicago      \
+                ${datadir}/zoneinfo/America/New_York     \
+                ${datadir}/zoneinfo/America/Caracas      \
+                ${datadir}/zoneinfo/America/Sao_Paulo    \
+                ${datadir}/zoneinfo/Europe/London        \
+                ${datadir}/zoneinfo/Europe/Paris         \
+                ${datadir}/zoneinfo/Africa/Cairo         \
+                ${datadir}/zoneinfo/Europe/Moscow        \
+                ${datadir}/zoneinfo/Asia/Dubai           \
+                ${datadir}/zoneinfo/Asia/Karachi         \
+                ${datadir}/zoneinfo/Asia/Dhaka           \
+                ${datadir}/zoneinfo/Asia/Bankok          \
+                ${datadir}/zoneinfo/Asia/Hong_Kong       \
+                ${datadir}/zoneinfo/Asia/Tokyo           \
+                ${datadir}/zoneinfo/Australia/Perth      \
+                ${datadir}/zoneinfo/Australia/Darwin     \
+                ${datadir}/zoneinfo/Australia/Adelaide   \
+                ${datadir}/zoneinfo/Australia/Brisbane   \
+                ${datadir}/zoneinfo/Australia/Sydney     \
+                ${datadir}/zoneinfo/Pacific/Noumea       \
+                ${datadir}/zoneinfo/CET                  \
+                ${datadir}/zoneinfo/CST6CDT              \
+                ${datadir}/zoneinfo/EET                  \
+                ${datadir}/zoneinfo/EST                  \
+                ${datadir}/zoneinfo/EST5EDT              \
+                ${datadir}/zoneinfo/GB                   \
+                ${datadir}/zoneinfo/GMT                  \
+                ${datadir}/zoneinfo/GMT+0                \
+                ${datadir}/zoneinfo/GMT-0                \
+                ${datadir}/zoneinfo/GMT0                 \
+                ${datadir}/zoneinfo/Greenwich            \
+                ${datadir}/zoneinfo/HST                  \
+                ${datadir}/zoneinfo/MET                  \
+                ${datadir}/zoneinfo/MST                  \
+                ${datadir}/zoneinfo/MST7MDT              \
+                ${datadir}/zoneinfo/NZ                   \
+                ${datadir}/zoneinfo/NZ-CHAT              \
+                ${datadir}/zoneinfo/PRC                  \
+                ${datadir}/zoneinfo/PST8PDT              \
+                ${datadir}/zoneinfo/ROC                  \
+                ${datadir}/zoneinfo/ROK                  \
+                ${datadir}/zoneinfo/UCT                  \
+                ${datadir}/zoneinfo/UTC                  \
+                ${datadir}/zoneinfo/Universal            \
+                ${datadir}/zoneinfo/W-SU                 \
+                ${datadir}/zoneinfo/WET                  \
+                ${datadir}/zoneinfo/Zulu                 \
+                ${datadir}/zoneinfo/Etc/*                \
+                ${datadir}/zoneinfo/iso3166.tab          \
+                ${datadir}/zoneinfo/zone.tab             \
+                ${sysconfdir}/localtime                  \
+                ${sysconfdir}/timezone                   "

+ 13 - 0
meta-oe/recipes-extended/tzdata/tzdata_2011e.bb

@@ -0,0 +1,13 @@
+require tzdata.inc
+
+LICENSE = "PD"
+LIC_FILES_CHKSUM = "file://asia;beginline=2;endline=3;md5=06468c0e84ef4d4c97045a4a29b08234"
+
+# Note that elsie.nci.nih.gov removes old archives after a new one is
+# released. So if this doesn't build for you because of missing source file
+# just bump it to the latest available version, removing the old one
+
+PR = "${INC_PR}.0"
+
+SRC_URI[md5sum] = "044a07072300a0ee72b046e5a9a4ec90"
+SRC_URI[sha256sum] = "44fef01de4589a4979eb6b5fdbbfd21a3b135852af1ecbfb9e0368ae47392c79"

+ 1095 - 0
meta-oe/recipes-graphics/drm/libdrm-2.4.24/glamo.patch

@@ -0,0 +1,1095 @@
+diff --git a/Makefile.am b/Makefile.am
+index 25d1747..f384228 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -41,7 +41,11 @@ if HAVE_RADEON
+ RADEON_SUBDIR = radeon
+ endif
+ 
+-SUBDIRS = . $(LIBKMS_SUBDIR) $(INTEL_SUBDIR) $(NOUVEAU_SUBDIR) $(RADEON_SUBDIR) tests include
++if HAVE_GLAMO
++GLAMO_SUBDIR = glamo
++endif
++
++SUBDIRS = . $(LIBKMS_SUBDIR) $(INTEL_SUBDIR) $(NOUVEAU_SUBDIR) $(RADEON_SUBDIR) $(GLAMO_SUBDIR) tests include
+ 
+ libdrm_la_LTLIBRARIES = libdrm.la
+ libdrm_ladir = $(libdir)
+diff --git a/configure.ac b/configure.ac
+index 62db817..0b2a33e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -73,6 +73,11 @@ AC_ARG_ENABLE(nouveau-experimental-api,
+ 	      [NOUVEAU=$enableval], [NOUVEAU=no])
+ 
+ 
++AC_ARG_ENABLE(glamo-experimental-api,
++	      AS_HELP_STRING([--enable-glamo-experimental-api],
++	      [Enable support for Glamo's KMS API (default: disabled)]),
++	      [GLAMO=$enableval], [GLAMO=no])
++
+ dnl ===========================================================================
+ dnl check compiler flags
+ AC_DEFUN([LIBDRM_CC_TRY_FLAG], [
+@@ -169,6 +174,11 @@ if test "x$NOUVEAU" = xyes; then
+ 	AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau (nvidia) support])
+ fi
+ 
++AM_CONDITIONAL(HAVE_GLAMO, [test "x$GLAMO" = xyes])
++if test "x$GLAMO" = xyes; then
++	AC_DEFINE(HAVE_GLAMO, 1, [Have glamo support])
++fi
++
+ PKG_CHECK_MODULES(CAIRO, cairo, [HAVE_CAIRO=yes], [HAVE_CAIRO=no])
+ if test "x$HAVE_CAIRO" = xyes; then
+ 	AC_DEFINE(HAVE_CAIRO, 1, [Have cairo support])
+@@ -262,6 +272,8 @@ AC_OUTPUT([
+ 	radeon/libdrm_radeon.pc
+ 	nouveau/Makefile
+ 	nouveau/libdrm_nouveau.pc
++	glamo/Makefile
++	glamo/libdrm_glamo.pc
+ 	tests/Makefile
+ 	tests/modeprint/Makefile
+ 	tests/modetest/Makefile
+diff --git a/glamo/Makefile.am b/glamo/Makefile.am
+new file mode 100644
+index 0000000..1f17aa3
+--- /dev/null
++++ b/glamo/Makefile.am
+@@ -0,0 +1,52 @@
++# Copyright (c) 2009 Thomas Whtie <taw@bitwiz.org.uk>
++# Based on libdrm-glamo Copyright © 2008 Jérôme Glisse
++#
++# 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:
++#    Jérôme Glisse <glisse@freedesktop.org>
++#    Thomas White <taw@bitwiz.org.uk>
++
++AM_CFLAGS = \
++	$(WARN_CFLAGS) \
++	-I$(top_srcdir) \
++	-I$(top_srcdir)/glamo \
++	$(PTHREADSTUBS_CFLAGS) \
++	-I$(top_srcdir)/include/drm
++
++libdrm_glamo_la_LTLIBRARIES = libdrm_glamo.la
++libdrm_glamo_ladir = $(libdir)
++libdrm_glamo_la_LDFLAGS = -version-number 1:0:0 -no-undefined
++libdrm_glamo_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@
++
++libdrm_glamo_la_SOURCES = \
++	glamo_bo_gem.c \
++	glamo_track.c
++
++libdrm_glamoincludedir = ${includedir}/libdrm
++libdrm_glamoinclude_HEADERS = \
++	glamo_bo.h \
++	glamo_bo_gem.h \
++	glamo_track.h
++
++pkgconfigdir = @pkgconfigdir@
++pkgconfig_DATA = libdrm_glamo.pc
++
++EXTRA_DIST = libdrm_glamo.pc.in
+diff --git a/glamo/glamo_bo.h b/glamo/glamo_bo.h
+new file mode 100644
+index 0000000..8ef2a18
+--- /dev/null
++++ b/glamo/glamo_bo.h
+@@ -0,0 +1,183 @@
++/*
++ * Copyright (c) 2009 Thomas White
++ *
++ * Heavily based on radeon_bo.h
++ * Copyright © 2008 Jérôme Glisse
++ * 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 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.
++ *
++ * The above copyright notice and this permission notice (including the
++ * next paragraph) shall be included in all copies or substantial portions
++ * of the Software.
++ */
++/*
++ * Authors:
++ *      Jérôme Glisse <glisse@freedesktop.org>
++ *	Thomas White <taw@bitwiz.org.uk>
++ */
++#ifndef GLAMO_BO_H
++#define GLAMO_BO_H
++
++#include <stdio.h>
++#include <stdint.h>
++#include "glamo_track.h"
++
++/* bo object */
++#define GLAMO_BO_FLAGS_MACRO_TILE  1
++#define GLAMO_BO_FLAGS_MICRO_TILE  2
++
++struct glamo_bo_manager;
++
++struct glamo_bo {
++    uint32_t                    alignment;
++    uint32_t                    handle;
++    uint32_t                    size;
++    uint32_t                    domains;
++    uint32_t                    flags;
++    unsigned                    cref;
++#ifdef GLAMO_BO_TRACK
++    struct glamo_track		*track;
++#endif
++    struct glamo_bo_manager	*bom;
++    void			*virtual;
++    uint32_t			space_accounted;
++};
++
++/* bo functions */
++struct glamo_bo_funcs {
++    struct glamo_bo *(*bo_open)(struct glamo_bo_manager *bom,
++                                 uint32_t handle,
++                                 uint32_t size,
++                                 uint32_t alignment,
++                                 uint32_t domains,
++                                 uint32_t flags);
++    void (*bo_ref)(struct glamo_bo *bo);
++    struct glamo_bo *(*bo_unref)(struct glamo_bo *bo);
++    int (*bo_map)(struct glamo_bo *bo, int write);
++    int (*bo_unmap)(struct glamo_bo *bo);
++    int (*bo_wait)(struct glamo_bo *bo);
++};
++
++struct glamo_bo_manager {
++    struct glamo_bo_funcs  *funcs;
++    int                     fd;
++    struct glamo_tracker   tracker;
++};
++
++static inline void _glamo_bo_debug(struct glamo_bo *bo,
++                                    const char *op,
++                                    const char *file,
++                                    const char *func,
++                                    int line)
++{
++    fprintf(stderr, "%s %p 0x%08X 0x%08X 0x%08X [%s %s %d]\n",
++            op, (void *)bo, bo->handle, bo->size, bo->cref, file, func, line);
++}
++
++static inline struct glamo_bo *_glamo_bo_open(struct glamo_bo_manager *bom,
++                                                uint32_t handle,
++                                                uint32_t size,
++                                                uint32_t alignment,
++                                                uint32_t domains,
++                                                uint32_t flags,
++                                                const char *file,
++                                                const char *func,
++                                                int line)
++{
++    struct glamo_bo *bo;
++
++    bo = bom->funcs->bo_open(bom, handle, size, alignment, domains, flags);
++#ifdef GLAMO_BO_TRACK
++    if (bo) {
++        bo->track = glamo_tracker_add_track(&bom->tracker, bo->handle);
++        glamo_track_add_event(bo->track, file, func, "open", line);
++    }
++#endif
++    return bo;
++}
++
++static inline void _glamo_bo_ref(struct glamo_bo *bo,
++                                  const char *file,
++                                  const char *func,
++                                  int line)
++{
++    bo->cref++;
++#ifdef GLAMO_BO_TRACK
++    glamo_track_add_event(bo->track, file, func, "ref", line);
++#endif
++    bo->bom->funcs->bo_ref(bo);
++}
++
++static inline struct glamo_bo *_glamo_bo_unref(struct glamo_bo *bo,
++                                                 const char *file,
++                                                 const char *func,
++                                                 int line)
++{
++    bo->cref--;
++#ifdef GLAMO_BO_TRACK
++    glamo_track_add_event(bo->track, file, func, "unref", line);
++    if (bo->cref <= 0) {
++        glamo_tracker_remove_track(&bo->bom->tracker, bo->track);
++        bo->track = NULL;
++    }
++#endif
++    return bo->bom->funcs->bo_unref(bo);
++}
++
++static inline int _glamo_bo_map(struct glamo_bo *bo,
++                                 int write,
++                                 const char *file,
++                                 const char *func,
++                                 int line)
++{
++    return bo->bom->funcs->bo_map(bo, write);
++}
++
++static inline int _glamo_bo_unmap(struct glamo_bo *bo,
++                                   const char *file,
++                                   const char *func,
++                                   int line)
++{
++    return bo->bom->funcs->bo_unmap(bo);
++}
++
++static inline int _glamo_bo_wait(struct glamo_bo *bo,
++                                  const char *file,
++                                  const char *func,
++                                  int line)
++{
++    return bo->bom->funcs->bo_wait(bo);
++}
++
++#define glamo_bo_open(bom, h, s, a, d, f)\
++    _glamo_bo_open(bom, h, s, a, d, f, __FILE__, __FUNCTION__, __LINE__)
++#define glamo_bo_ref(bo)\
++    _glamo_bo_ref(bo, __FILE__, __FUNCTION__, __LINE__)
++#define glamo_bo_unref(bo)\
++    _glamo_bo_unref(bo, __FILE__, __FUNCTION__, __LINE__)
++#define glamo_bo_map(bo, w)\
++    _glamo_bo_map(bo, w, __FILE__, __FUNCTION__, __LINE__)
++#define glamo_bo_unmap(bo)\
++    _glamo_bo_unmap(bo, __FILE__, __FUNCTION__, __LINE__)
++#define glamo_bo_debug(bo, opcode)\
++    _glamo_bo_debug(bo, opcode, __FILE__, __FUNCTION__, __LINE__)
++#define glamo_bo_wait(bo) \
++    _glamo_bo_wait(bo, __FILE__, __func__, __LINE__)
++
++#endif
+diff --git a/glamo/glamo_bo_gem.c b/glamo/glamo_bo_gem.c
+new file mode 100644
+index 0000000..38a4436
+--- /dev/null
++++ b/glamo/glamo_bo_gem.c
+@@ -0,0 +1,336 @@
++/*
++ * Copyright © 2009 Thomas White
++ *
++ * Based on radeon_bo_gem.c, to which the following notice applies:
++ *
++ * Copyright © 2008 Dave Airlie
++ * Copyright © 2008 Jérôme Glisse
++ * 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 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.
++ *
++ * The above copyright notice and this permission notice (including the
++ * next paragraph) shall be included in all copies or substantial portions
++ * of the Software.
++ */
++/*
++ * Authors:
++ *      Dave Airlie
++ *      Jérôme Glisse <glisse@freedesktop.org>
++ *
++ *
++ * Memory mapping functions are based on intel_bufmgr_gem.c, to which the
++ * following notice applies:
++ *
++ * Copyright © 2007 Red Hat Inc.
++ * Copyright © 2007 Intel Corporation
++ * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., 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 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.
++ *
++ * The above copyright notice and this permission notice (including the
++ * next paragraph) shall be included in all copies or substantial portions
++ * of the Software.
++ *
++ *
++ **************************************************************************/
++/*
++ * Authors: Thomas Hellström <thomas-at-tungstengraphics-dot-com>
++ *          Keith Whitwell <keithw-at-tungstengraphics-dot-com>
++ *	    Eric Anholt <eric@anholt.net>
++ *	    Dave Airlie <airlied@linux.ie>
++ */
++
++#ifdef HAVE_CONFIG_H
++#include "config.h"
++#endif
++
++#include <stdio.h>
++#include <stdint.h>
++#include <stdlib.h>
++#include <string.h>
++#include <sys/mman.h>
++#include <sys/ioctl.h>
++#include <errno.h>
++
++#include "xf86drm.h"
++#include "drm.h"
++#include "glamo_drm.h"
++#include "glamo_bo.h"
++#include "glamo_bo_gem.h"
++
++struct glamo_bo_gem {
++	struct glamo_bo   base;
++	uint32_t          name;
++	int               map_count;
++};
++
++struct bo_manager_gem {
++	struct glamo_bo_manager    base;
++};
++
++static struct glamo_bo *bo_open(struct glamo_bo_manager *bom,
++                                 uint32_t handle,
++                                 uint32_t size,
++                                 uint32_t alignment,
++                                 uint32_t domains,
++                                 uint32_t flags)
++{
++	struct glamo_bo_gem *bo;
++	int r;
++
++	bo = (struct glamo_bo_gem*)calloc(1, sizeof(struct glamo_bo_gem));
++	if (bo == NULL) {
++		return NULL;
++	}
++
++	bo->base.bom = bom;
++	bo->base.handle = 0;
++	bo->base.size = size;
++	bo->base.alignment = alignment;
++	bo->base.domains = domains;
++	bo->base.flags = flags;
++	bo->base.cref = 0;
++	bo->map_count = 0;
++	bo->base.virtual = NULL;
++	if (handle) {
++		struct drm_gem_open open_arg;
++
++		memset(&open_arg, 0, sizeof(open_arg));
++		open_arg.name = handle;
++		r = ioctl(bom->fd, DRM_IOCTL_GEM_OPEN, &open_arg);
++		if (r != 0) {
++			free(bo);
++			return NULL;
++		}
++		bo->base.handle = open_arg.handle;
++		bo->base.size = open_arg.size;
++		bo->name = handle;
++	} else {
++		struct drm_glamo_gem_create args;
++
++		args.size = size;
++		args.alignment = alignment;
++		args.initial_domain = bo->base.domains;
++		args.no_backing_store = 0;
++		args.handle = 0;
++		r = drmCommandWriteRead(bom->fd, DRM_GLAMO_GEM_CREATE,
++		                        &args, sizeof(args));
++		bo->base.handle = args.handle;
++		if (r) {
++			fprintf(stderr, "Failed to allocate :\n");
++			fprintf(stderr, "   size      : %d bytes\n", size);
++			fprintf(stderr, "   alignment : %d bytes\n", alignment);
++			free(bo);
++			return NULL;
++		}
++	}
++	glamo_bo_ref((struct glamo_bo*)bo);
++	return (struct glamo_bo*)bo;
++}
++
++static void bo_ref(struct glamo_bo *bo)
++{
++}
++
++static struct glamo_bo *bo_unref(struct glamo_bo *bo)
++{
++	struct glamo_bo_gem *bo_gem = (struct glamo_bo_gem*)bo;
++	struct drm_gem_close args;
++
++	if (bo == NULL) {
++		return NULL;
++	}
++	if (bo->cref) {
++		return bo;
++	}
++	if (bo_gem->map_count) {
++		munmap(bo->virtual, bo->size);
++	}
++
++	/* close object */
++	args.handle = bo->handle;
++	ioctl(bo->bom->fd, DRM_IOCTL_GEM_CLOSE, &args);
++	memset(bo_gem, 0, sizeof(struct glamo_bo_gem));
++	free(bo_gem);
++	return NULL;
++}
++
++static int bo_map(struct glamo_bo *bo, int write)
++{
++	struct glamo_bo_gem *bo_gem;
++	struct glamo_bo_manager *bufmgr;
++	int ret;
++
++	bo_gem = (struct glamo_bo_gem *)bo;
++	bufmgr = (struct glamo_bo_manager*)bo->bom;
++
++	/* Get a mapping of the buffer if we haven't before. */
++	if (bo->virtual == NULL) {
++
++		struct drm_glamo_gem_mmap mmap_arg;
++
++		memset(&mmap_arg, 0, sizeof(mmap_arg));
++		mmap_arg.handle = bo->handle;
++
++		/* Get the fake offset back... */
++		ret = ioctl(bufmgr->fd, DRM_IOCTL_GLAMO_GEM_MMAP, &mmap_arg);
++		if (ret != 0) {
++			fprintf(stderr,
++			        "%s:%d: Error preparing BO map %d (%d): %s .\n",
++			        __FILE__, __LINE__,
++			        bo->handle, bo_gem->name,
++			        strerror(errno));
++			return ret;
++		}
++		/* and mmap it */
++		bo->virtual = mmap(0, bo->size, PROT_READ | PROT_WRITE,
++		                       MAP_SHARED, bufmgr->fd,
++		                       mmap_arg.offset);
++		if (bo->virtual == MAP_FAILED) {
++			fprintf(stderr,
++			        "%s:%d: Error mapping buffer %d (%d): %s .\n",
++			        __FILE__, __LINE__,
++			        bo->handle, bo_gem->name,
++			        strerror(errno));
++			return errno;
++		}
++	}
++	bo_gem->map_count++;
++
++	return 0;
++}
++
++static int bo_unmap(struct glamo_bo *bo)
++{
++	struct glamo_bo_gem *bo_gem = (struct glamo_bo_gem*)bo;
++
++	if ( bo_gem->map_count == 0 ) {
++		fprintf(stderr, "Not unmapping %p, because its map count"
++		                " is already zero.\n", bo_gem);
++		return 0;
++	}
++
++	if (--bo_gem->map_count > 0) {
++		return 0;
++	}
++	munmap(bo->virtual, bo->size);
++	bo->virtual = NULL;
++	return 0;
++}
++
++static int bo_wait(struct glamo_bo *bo)
++{
++	struct drm_glamo_gem_wait_rendering args;
++	int ret;
++
++	args.handle = bo->handle;
++	args.have_handle = 1;
++	do {
++		ret = drmCommandWriteRead(bo->bom->fd,
++		                          DRM_GLAMO_GEM_WAIT_RENDERING,
++		                          &args, sizeof(args));
++	} while (ret == -EAGAIN);
++	return ret;
++}
++
++static struct glamo_bo_funcs bo_gem_funcs = {
++	bo_open,
++	bo_ref,
++	bo_unref,
++	bo_map,
++	bo_unmap,
++	bo_wait
++};
++
++struct glamo_bo_manager *glamo_bo_manager_gem_ctor(int fd)
++{
++	struct bo_manager_gem *bomg;
++
++	bomg = (struct bo_manager_gem*)calloc(1, sizeof(struct bo_manager_gem));
++	if (bomg == NULL) return NULL;
++
++	bomg->base.funcs = &bo_gem_funcs;
++	bomg->base.fd = fd;
++	return (struct glamo_bo_manager*)bomg;
++}
++
++void glamo_bo_manager_gem_dtor(struct glamo_bo_manager *bom)
++{
++	struct bo_manager_gem *bomg = (struct bo_manager_gem*)bom;
++
++	if (bom == NULL) return;
++	free(bomg);
++}
++
++uint32_t glamo_gem_get_name(struct glamo_bo *bo)
++{
++	struct glamo_bo_gem *bo_gem = (struct glamo_bo_gem*)bo;
++	return bo_gem->name;
++}
++
++int glamo_gem_name_buffer(struct glamo_bo *bo, uint32_t *name)
++{
++	struct drm_gem_flink flink;
++	int r;
++
++	if ( !bo ) {
++		fprintf(stderr, "No buffer object!\n");
++		return -1;
++	}
++
++	flink.handle = bo->handle;
++	r = ioctl(bo->bom->fd, DRM_IOCTL_GEM_FLINK, &flink);
++	if (r) return r;
++
++	*name = flink.name;
++	return 0;
++}
++
++int glamo_bo_subdata(struct glamo_bo *bo, unsigned long offset,
++                     unsigned long size, const void *data)
++{
++	int ret;
++
++	if (size == 0 || data == NULL)
++		return 0;
++
++	ret = bo_map(bo, 1);
++	if ( ret ) return ret;
++
++	memcpy((unsigned char *)bo->virtual + offset, data, size);
++
++	bo_unmap(bo);
++
++	return 0;
++}
+diff --git a/glamo/glamo_bo_gem.h b/glamo/glamo_bo_gem.h
+new file mode 100644
+index 0000000..05b5fb9
+--- /dev/null
++++ b/glamo/glamo_bo_gem.h
+@@ -0,0 +1,43 @@
++/*
++ * Copyright © 2008 Dave Airlie
++ * Copyright © 2008 Jérôme Glisse
++ * 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 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.
++ *
++ * The above copyright notice and this permission notice (including the
++ * next paragraph) shall be included in all copies or substantial portions
++ * of the Software.
++ */
++/*
++ * Authors:
++ *      Dave Airlie
++ *      Jérôme Glisse <glisse@freedesktop.org>
++ */
++#ifndef GLAMO_BO_GEM_H
++#define GLAMO_BO_GEM_H
++
++#include "glamo_bo.h"
++
++struct glamo_bo_manager *glamo_bo_manager_gem_ctor(int fd);
++void glamo_bo_manager_gem_dtor(struct glamo_bo_manager *bom);
++int glamo_gem_name_buffer(struct glamo_bo *bo, uint32_t *name);
++uint32_t glamo_gem_get_name(struct glamo_bo *bo);
++extern int glamo_bo_subdata(struct glamo_bo *bo, unsigned long offset,
++                            unsigned long size, const void *data);
++#endif
+diff --git a/glamo/glamo_track.c b/glamo/glamo_track.c
+new file mode 100644
+index 0000000..27ffe41
+--- /dev/null
++++ b/glamo/glamo_track.c
+@@ -0,0 +1,140 @@
++/* 
++ * Copyright © 2008 Jérôme Glisse
++ * 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 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.
++ *
++ * The above copyright notice and this permission notice (including the
++ * next paragraph) shall be included in all copies or substantial portions
++ * of the Software.
++ */
++/*
++ * Authors:
++ *      Jérôme Glisse <glisse@freedesktop.org>
++ */
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include "glamo_track.h"
++
++void glamo_track_add_event(struct glamo_track *track,
++                            const char *file,
++                            const char *func,
++                            const char *op,
++                            unsigned line)
++{
++    struct glamo_track_event *event;
++
++    if (track == NULL) {
++        return;
++    }
++    event = (void*)calloc(1,sizeof(struct glamo_track_event));
++    if (event == NULL) {
++        return;
++    }
++    event->line = line;
++    event->file = strdup(file);
++    event->func = strdup(func);
++    event->op = strdup(op);
++    if (event->file == NULL || event->func == NULL || event->op == NULL) {
++        free(event->file);
++        free(event->func);
++        free(event->op);
++        free(event);
++        return;
++    }
++    event->next = track->events;
++    track->events = event;
++}
++
++struct glamo_track *glamo_tracker_add_track(struct glamo_tracker *tracker,
++                                              unsigned key)
++{
++    struct glamo_track *track;
++
++    track = (struct glamo_track*)calloc(1, sizeof(struct glamo_track));
++    if (track) {
++        track->next = tracker->tracks.next;
++        track->prev = &tracker->tracks;
++        tracker->tracks.next = track;
++        if (track->next) {
++            track->next->prev = track;
++        }
++        track->key = key;
++        track->events = NULL;
++    }
++    return track;
++}
++
++void glamo_tracker_remove_track(struct glamo_tracker *tracker,
++                                 struct glamo_track *track)
++{
++    struct glamo_track_event *event;
++    void *tmp;
++
++    if (track == NULL) {
++        return;
++    }
++    track->prev->next = track->next;
++    if (track->next) {
++        track->next->prev = track->prev;
++    }
++    track->next = track->prev = NULL;
++    event = track->events;
++    while (event) {
++        tmp = event;
++        free(event->file);
++        free(event->func);
++        free(event->op);
++        event = event->next;
++        free(tmp);
++    }
++    track->events = NULL;
++    free(track);
++}
++
++void glamo_tracker_print(struct glamo_tracker *tracker, FILE *file)
++{
++    struct glamo_track *track;
++    struct glamo_track_event *event;
++    void *tmp;
++
++    track = tracker->tracks.next;
++    while (track) {
++        event = track->events;
++        fprintf(file, "[0x%08X] :\n", track->key);
++        while (event) {
++            tmp = event;
++            fprintf(file, "  [0x%08X:%s](%s:%s:%d)\n",
++                    track->key, event->op,  event->file,
++                    event->func, event->line);
++            free(event->file);
++            free(event->func);
++            free(event->op);
++            event->file = NULL;
++            event->func = NULL;
++            event->op = NULL;
++            event = event->next;
++            free(tmp);
++        }
++        track->events = NULL;
++        tmp = track;
++        track = track->next;
++        free(tmp);
++    }
++}
+diff --git a/glamo/glamo_track.h b/glamo/glamo_track.h
+new file mode 100644
+index 0000000..fedead7
+--- /dev/null
++++ b/glamo/glamo_track.h
+@@ -0,0 +1,64 @@
++/*
++ * Copyright © 2008 Jérôme Glisse
++ * 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 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.
++ *
++ * The above copyright notice and this permission notice (including the
++ * next paragraph) shall be included in all copies or substantial portions
++ * of the Software.
++ */
++/*
++ * Authors:
++ *      Jérôme Glisse <glisse@freedesktop.org>
++ */
++#ifndef GLAMO_TRACK_H
++#define GLAMO_TRACK_H
++
++struct glamo_track_event {
++    struct glamo_track_event   *next;
++    char                        *file;
++    char                        *func;
++    char                        *op;
++    unsigned                    line;
++};
++
++struct glamo_track {
++    struct glamo_track         *next;
++    struct glamo_track         *prev;
++    unsigned                    key;
++    struct glamo_track_event   *events;
++};
++
++struct glamo_tracker {
++    struct glamo_track         tracks;
++};
++
++void glamo_track_add_event(struct glamo_track *track,
++                            const char *file,
++                            const char *func,
++                            const char *op,
++                            unsigned line);
++struct glamo_track *glamo_tracker_add_track(struct glamo_tracker *tracker,
++                                              unsigned key);
++void glamo_tracker_remove_track(struct glamo_tracker *tracker,
++                                 struct glamo_track *track);
++void glamo_tracker_print(struct glamo_tracker *tracker,
++                          FILE *file);
++
++#endif
+diff --git a/glamo/libdrm_glamo.pc.in b/glamo/libdrm_glamo.pc.in
+new file mode 100644
+index 0000000..d4d8e70
+--- /dev/null
++++ b/glamo/libdrm_glamo.pc.in
+@@ -0,0 +1,10 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: libdrm_glamo
++Description: Userspace interface to kernel DRM services for Glamo
++Version: 1.0.1
++Libs: -L${libdir} -ldrm_glamo
++Cflags: -I${includedir} -I${includedir}/libdrm
+diff --git a/include/drm/Makefile.am b/include/drm/Makefile.am
+index 43695bd..f3f7edf 100644
+--- a/include/drm/Makefile.am
++++ b/include/drm/Makefile.am
+@@ -35,6 +35,7 @@ klibdrminclude_HEADERS = \
+ 	savage_drm.h \
+ 	sis_drm.h \
+ 	via_drm.h \
++	glamo_drm.h \
+ 	mach64_drm.h
+ 
+ 
+diff --git a/include/drm/glamo_drm.h b/include/drm/glamo_drm.h
+new file mode 100644
+index 0000000..7629ebc
+--- /dev/null
++++ b/include/drm/glamo_drm.h
+@@ -0,0 +1,153 @@
++/* glamo_drm.h -- Public header for the Glamo driver
++ *
++ * Copyright 2009 Thomas White
++ * Copyright 2000 Precision Insight, Inc., Cedar Park, Texas.
++ * Copyright 2000 VA Linux Systems, Inc., Fremont, California.
++ * Copyright 2002 Tungsten Graphics, 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, 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
++ * 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.
++ *
++ * Authors:
++ *    Thomas White <taw@bitwiz.org.uk>
++ *    Kevin E. Martin <martin@valinux.com>
++ *    Gareth Hughes <gareth@valinux.com>
++ *    Keith Whitwell <keith@tungstengraphics.com>
++ */
++
++#ifndef __GLAMO_DRM_H__
++#define __GLAMO_DRM_H__
++
++#include "drm.h"
++
++#define GLAMO_GEM_DOMAIN_VRAM (0x1)
++
++/* Glamo specific ioctls */
++#define DRM_GLAMO_CMDBUF     0x01
++#define DRM_GLAMO_SWAP       0x02
++#define DRM_GLAMO_CMDBURST   0x03
++
++#define DRM_GLAMO_GEM_INFO     0x1c
++#define DRM_GLAMO_GEM_CREATE   0x1d
++#define DRM_GLAMO_GEM_MMAP     0x1e
++#define DRM_GLAMO_GEM_PIN      0x1f
++#define DRM_GLAMO_GEM_UNPIN    0x20
++#define DRM_GLAMO_GEM_PREAD    0x21
++#define DRM_GLAMO_GEM_PWRITE   0x22
++#define DRM_GLAMO_GEM_WAIT_RENDERING 0x24
++
++#define DRM_IOCTL_GLAMO_CMDBUF     DRM_IOW(DRM_COMMAND_BASE + DRM_GLAMO_CMDBUF, drm_glamo_cmd_buffer_t)
++#define DRM_IOCTL_GLAMO_SWAP       DRM_IO(DRM_COMMAND_BASE + DRM_GLAMO_SWAP)
++#define DRM_IOCTL_GLAMO_CMDBURST     DRM_IOW(DRM_COMMAND_BASE + DRM_GLAMO_CMDBURST, drm_glamo_cmd_burst_t)
++
++#define DRM_IOCTL_GLAMO_GEM_INFO   DRM_IOWR(DRM_COMMAND_BASE + DRM_GLAMO_GEM_INFO, struct drm_glamo_gem_info)
++#define DRM_IOCTL_GLAMO_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + DRM_GLAMO_GEM_CREATE, struct drm_glamo_gem_create)
++#define DRM_IOCTL_GLAMO_GEM_MMAP   DRM_IOWR(DRM_COMMAND_BASE + DRM_GLAMO_GEM_MMAP, struct drm_glamo_gem_mmap)
++#define DRM_IOCTL_GLAMO_GEM_PIN    DRM_IOWR(DRM_COMMAND_BASE + DRM_GLAMO_GEM_PIN, struct drm_glamo_gem_pin)
++#define DRM_IOCTL_GLAMO_GEM_UNPIN  DRM_IOWR(DRM_COMMAND_BASE + DRM_GLAMO_GEM_UNPIN, struct drm_glamo_gem_unpin)
++#define DRM_IOCTL_GLAMO_GEM_PREAD  DRM_IOWR(DRM_COMMAND_BASE + DRM_GLAMO_GEM_PREAD, struct drm_glamo_gem_pread)
++#define DRM_IOCTL_GLAMO_GEM_PWRITE DRM_IOWR(DRM_COMMAND_BASE + DRM_GLAMO_GEM_PWRITE, struct drm_glamo_gem_pwrite)
++#define DRM_IOCTL_GLAMO_GEM_WAIT_RENDERING DRM_IOW(DRM_COMMAND_BASE + DRM_GLAMO_GEM_WAIT_RENDERING, struct drm_glamo_gem_wait_rendering)
++
++
++/* Simple command submission - a list of 16-bit address-data pairs */
++typedef struct drm_glamo_cmd_buffer {
++	unsigned int bufsz;	/* Size of buffer, in bytes */
++	char *buf;		/* Buffer of stuff to go onto the ring buffer */
++	unsigned int *obj_pos;	/* Offsets (in bytes) at which to put objs */
++	uint32_t *objs;		/* List of buffer object (handles) to use */
++	unsigned int nobjs;	/* Number of objects referenced */
++	int nbox;
++	struct drm_clip_rect *boxes;
++} drm_glamo_cmd_buffer_t;
++
++
++/* Burst command submission - base address and data:
++ *  - Data can be 32-bit (more easily)
++ *  - Easier for the kernel to validate */
++typedef struct drm_glamo_cmd_burst {
++	uint16_t base;		/* Base address (command) */
++	int bufsz;		/* Size of data, in bytes */
++	uint16_t *data;		/* Pointer to data */
++	unsigned int *obj_pos;	/* Offsets (in bytes) at which to put objs */
++	uint32_t *objs;		/* List of buffer object (handles) to use */
++	unsigned int nobjs;	/* Number of objects referenced */
++} drm_glamo_cmd_burst_t;
++
++struct drm_glamo_gem_info {
++	uint64_t vram_start;
++	uint64_t vram_size;
++};
++
++struct drm_glamo_gem_create {
++	uint64_t size;
++	uint64_t alignment;
++	uint32_t handle;
++	uint32_t initial_domain; // to allow VRAM to be created
++	uint32_t no_backing_store;
++};
++
++struct drm_glamo_gem_mmap {
++	uint32_t handle;	/* Handle goes in... */
++	uint64_t offset;	/* ...offset comes out */
++};
++
++struct drm_glamo_gem_wait_rendering {
++	uint32_t handle;
++	int have_handle;
++};
++
++struct drm_glamo_gem_pin {
++	uint32_t handle;
++	uint32_t pin_domain;
++	uint64_t alignment;
++	uint64_t offset;
++};
++
++struct drm_glamo_gem_unpin {
++	uint32_t handle;
++	uint32_t pad;
++};
++
++struct drm_glamo_gem_pread {
++	/** Handle for the object being read. */
++	uint32_t handle;
++	uint32_t pad;
++	/** Offset into the object to read from */
++	uint64_t offset;
++	/** Length of data to read */
++	uint64_t size;
++	/** Pointer to write the data into. */
++	uint64_t data_ptr;	/* void *, but pointers are not 32/64 compatible */
++};
++
++struct drm_glamo_gem_pwrite {
++	/** Handle for the object being written to. */
++	uint32_t handle;
++	uint32_t pad;
++	/** Offset into the object to write to */
++	uint64_t offset;
++	/** Length of data to write */
++	uint64_t size;
++	/** Pointer to read the data from. */
++	uint64_t data_ptr;	/* void *, but pointers are not 32/64 compatible */
++};
++
++#endif

+ 43 - 0
meta-oe/recipes-graphics/drm/libdrm-2.4.24/installtests.patch

@@ -0,0 +1,43 @@
+Index: libdrm-2.4.7/tests/Makefile.am
+===================================================================
+--- libdrm-2.4.7.orig/tests/Makefile.am	2009-04-09 20:16:35.000000000 +0100
++++ libdrm-2.4.7/tests/Makefile.am	2009-04-17 12:35:14.000000000 +0100
+@@ -6,10 +6,11 @@
+
+ LDADD = $(top_builddir)/libdrm.la
+
+-check_PROGRAMS = \
++bin_PROGRAMS = \
+ 	dristat \
+ 	drmstat
+
++check_PROGRAMS =
+ SUBDIRS =
+
+ if HAVE_LIBKMS
+Index: libdrm-2.4.7/tests/modeprint/Makefile.am
+===================================================================
+--- libdrm-2.4.7.orig/tests/modeprint/Makefile.am	2009-02-17 19:52:37.000000000 +0000
++++ libdrm-2.4.7/tests/modeprint/Makefile.am	2009-04-17 12:35:32.000000000 +0100
+@@ -3,7 +3,7 @@
+ 	-I$(top_srcdir)/libdrm/intel/ \
+ 	-I$(top_srcdir)/libdrm
+
+-noinst_PROGRAMS = \
++bin_PROGRAMS = \
+ 	modeprint
+
+ modeprint_SOURCES = \
+Index: libdrm-2.4.7/tests/modetest/Makefile.am
+===================================================================
+--- libdrm-2.4.7.orig/tests/modetest/Makefile.am	2009-02-17 19:52:37.000000000 +0000
++++ libdrm-2.4.7/tests/modetest/Makefile.am	2009-04-17 12:35:42.000000000 +0100
+@@ -4,7 +4,7 @@
+ 	-I$(top_srcdir)/libdrm \
+ 	$(CAIRO_CFLAGS)
+
+-noinst_PROGRAMS = \
++bin_PROGRAMS = \
+ 	modetest
+
+ modetest_SOURCES = \

+ 39 - 0
meta-oe/recipes-graphics/drm/libdrm_2.4.24.bb

@@ -0,0 +1,39 @@
+SUMMARY = "Userspace interface to the kernel DRM services"
+DESCRIPTION = "The runtime library for accessing the kernel DRM services.  DRM \
+stands for \"Direct Rendering Manager\", which is the kernel portion of the \
+\"Direct Rendering Infrastructure\" (DRI).  DRI is required for many hardware \
+accelerated OpenGL drivers."
+HOMEPAGE = "http://dri.freedesktop.org"
+SECTION = "x11/base"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://xf86drm.c;beginline=9;endline=32;md5=c8a3b961af7667c530816761e949dc71"
+SRC_URI = "http://dri.freedesktop.org/libdrm/libdrm-${PV}.tar.bz2"
+PROVIDES = "drm"
+DEPENDS = "libpthread-stubs udev cairo virtual/libx11"
+
+inherit autotools pkgconfig
+
+PACKAGES =+ "${PN}-tests ${PN}-drivers ${PN}-kms ${@base_contains('MACHINE_FEATURES', 'x86', '${PN}-intel', '',d)}"
+FILES_${PN}-tests = "${bindir}/dr* ${bindir}/mode*"
+FILES_${PN}-drivers = "${libdir}/libdrm_*.so.*"
+FILES_${PN}-intel = "${libdir}/libdrm_intel.so.*"
+FILES_${PN}-kms = "${libdir}/libkms*.so.*"
+
+LEAD_SONAME = "libdrm.so"
+
+EXTRA_OECONF_append = " ${@base_contains('MACHINE_FEATURES', 'x86', '', '--disable-intel --disable-radeon',d)}"
+EXTRA_OECONF_append_shr = " --enable-glamo-experimental-api"
+
+PR = "r8"
+
+SRC_URI += "file://installtests.patch"
+SRC_URI += "file://glamo.patch"
+
+SRC_URI[md5sum] = "8d802bf3b368f9fac0d7d17516a9436f"
+SRC_URI[sha256sum] = "c7012381f64458af9f291d913309448aac7dd23a28dc86c6970e4bf38effb6a5"
+
+do_compile_prepend_libc-uclibc() {
+	eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "/_FILE_OFFSET_BITS/d" ${S}/libkms/intel.c', d)}"
+	eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "/_FILE_OFFSET_BITS/d" ${S}/libkms/vmwgfx.c', d)}"
+	eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "/_FILE_OFFSET_BITS/d" ${S}/libkms/nouveau.c', d)}"
+}

+ 12 - 0
meta-oe/recipes-graphics/mesa/README

@@ -0,0 +1,12 @@
+mesa-common.inc
+* Settings shared by ALL recipes
+
+mesa-${PV}.inc
+* Settings for particular version, mostly checksums and additional patches
+* Patches are stored mesa-${PV} dir and -dri and xlib has adjusted FILESPATHPKG
+
+mesa-dri.inc
+* Setting shared by ALL dri recipes - defines what is mesa-dri
+
+mesa-xlib.inc
+* Setting shared by ALL xlib recipes - defines what is mesa-xlib

+ 19 - 0
meta-oe/recipes-graphics/mesa/mesa-7.10.2.inc

@@ -0,0 +1,19 @@
+SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2;name=archive \
+           file://glamo.patch \
+           file://uclibc.patch \
+          "
+
+DEPENDS += "talloc"
+
+SRC_URI[archive.md5sum] = "f5de82852f1243f42cc004039e10b771"
+SRC_URI[archive.sha256sum] = "8ced2678ce11cf30804694a92ea3ca6b82f158ae8995bdc626c7e85aac71c7c1"
+
+EXTRA_OECONF += " --disable-gallium"
+
+#needs more testing and updated glamo.patch before making default
+DEFAULT_PREFERENCE = "-2"
+
+do_configure_prepend() {
+  #check for python not python2, because python-native does not stage python2 binary/link
+  sed -i 's/AC_CHECK_PROGS(\[PYTHON2\], \[python2 python\])/AC_CHECK_PROGS(\[PYTHON2\], \[python python\])/g' ${S}/configure.ac
+}

+ 2425 - 0
meta-oe/recipes-graphics/mesa/mesa-7.10.2/glamo.patch

@@ -0,0 +1,2425 @@
+git diff upstream/7.10 and gitorious/7.10
+
+http://gitorious.org/mesa/mesa/commits/7.10
+
+diff --git a/configs/autoconf.in b/configs/autoconf.in
+index e2d70c6..5874955 100644
+--- a/configs/autoconf.in
++++ b/configs/autoconf.in
+@@ -120,7 +120,7 @@ OSMESA_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @OSMESA_MESA_DEPS@ \
+ 	$(EXTRA_LIB_PATH) @OSMESA_LIB_DEPS@
+ EGL_LIB_DEPS = $(EXTRA_LIB_PATH) @EGL_LIB_DEPS@
+ GLU_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLU_MESA_DEPS@ \
+-	$(EXTRA_LIB_PATH) @GLU_LIB_DEPS@
++	$(EXTRA_LIB_PATH) @GLU_LIB_DEPS@ -lstdc++
+ GLUT_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLUT_MESA_DEPS@ \
+ 	$(EXTRA_LIB_PATH) @GLUT_LIB_DEPS@
+ GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) @GLW_MESA_DEPS@ \
+diff --git a/src/mesa/drivers/dri/glamo/Makefile b/src/mesa/drivers/dri/glamo/Makefile
+new file mode 100644
+index 0000000..e77193d
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/Makefile
+@@ -0,0 +1,22 @@
++# src/mesa/drivers/dri/glamo/Makefile
++
++TOP = ../../../../..
++include $(TOP)/configs/current
++
++LIBNAME = glamo_dri.so
++
++DRIVER_SOURCES = \
++	glamo_screen.c glamo_context.c glamo_state.c glamo_fbo.c glamo_tris.c \
++	glamo_cmdq.c glamo_render.c
++
++C_SOURCES = \
++	$(COMMON_SOURCES) \
++	$(DRIVER_SOURCES)
++
++ASM_SOURCES =
++
++DRI_LIB_DEPS += -ldrm_glamo
++
++include ../Makefile.template
++
++symlinks:
+diff --git a/src/mesa/drivers/dri/glamo/glamo_cmdq.c b/src/mesa/drivers/dri/glamo/glamo_cmdq.c
+new file mode 100644
+index 0000000..1334f8e
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_cmdq.c
+@@ -0,0 +1,110 @@
++/*
++ * Command queue submission via DRM
++ *
++ * Copyright 2009 Thomas White <taw@bitwiz.org.uk>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++
++#include <stdint.h>
++#include <stdlib.h>
++#include <drm.h>
++#include <glamo_drm.h>
++#include <glamo_bo.h>
++
++#include "glamo_context.h"
++#include "glamo_cmdq.h"
++
++
++/* Submit the prepared command sequence to the kernel */
++void glamoDRMDispatch(glamoContext *gCtx)
++{
++	drm_glamo_cmd_burst_t burst;
++	int r;
++
++	burst.base = gCtx->cmd_burst_base;
++	burst.data = gCtx->cmdq_drm;
++	burst.bufsz = gCtx->cmdq_drm_used * 2;	/* -> bytes */
++	burst.nobjs = gCtx->cmdq_obj_used;
++	burst.objs = gCtx->cmdq_objs;
++	burst.obj_pos = gCtx->cmdq_obj_pos;
++
++	r = drmCommandWrite(gCtx->drm_fd, DRM_GLAMO_CMDBURST,
++	                    &burst, sizeof(burst));
++	if ( r != 0 ) {
++		fprintf(stderr, "DRM_GLAMO_CMDBURST failed\n");
++	}
++
++	/* Reset counts to zero for the next sequence */
++	gCtx->cmdq_obj_used = 0;
++	gCtx->cmdq_drm_used = 0;
++}
++
++
++void glamoDRMAddData(glamoContext *gCtx, uint32_t val, int len)
++{
++	if ( gCtx->cmdq_drm_used+4 > gCtx->cmdq_drm_size ) {
++		fprintf(stderr, "Burst command too large\n");
++		return;
++	}
++
++	/* Record command */
++	if ( len == 2 ) {
++		gCtx->cmdq_drm[gCtx->cmdq_drm_used++] = val & 0xffff;
++	} else if ( len == 4 ) {
++		gCtx->cmdq_drm[gCtx->cmdq_drm_used++] = val & 0x0000ffff;
++		gCtx->cmdq_drm[gCtx->cmdq_drm_used++] = val & 0xffff0000;
++	} else {
++		fprintf(stderr, "Wrong command length!\n");
++	}
++}
++
++
++void glamoDRMAddBO(glamoContext *gCtx, struct glamo_bo *bo)
++{
++	if ( gCtx->cmdq_drm_used+4 > gCtx->cmdq_drm_size ) {
++		fprintf(stderr, "Burst command too large\n");
++		return;
++	}
++
++	/* Record object position */
++	gCtx->cmdq_objs[gCtx->cmdq_obj_used] = bo->handle;
++	/* -> bytes */
++	gCtx->cmdq_obj_pos[gCtx->cmdq_obj_used] = gCtx->cmdq_drm_used * 2;
++	gCtx->cmdq_obj_used++;
++
++	/* Record command */
++	gCtx->cmdq_drm[gCtx->cmdq_drm_used++] = 0x0000;
++	gCtx->cmdq_drm[gCtx->cmdq_drm_used++] = 0x0000;
++}
++
++
++void glamoDRMStartBurst(glamoContext *gCtx, uint16_t base)
++{
++	gCtx->cmd_burst_base = base;
++}
++
++
++void glamoInitCmdqCache(glamoContext *gCtx)
++{
++	gCtx->cmdq_objs = malloc(1024);
++	gCtx->cmdq_obj_pos = malloc(1024);
++	gCtx->cmdq_obj_used = 0;
++	gCtx->cmdq_drm_used = 0;
++	gCtx->cmdq_drm_size = 4 * 1024;
++	gCtx->cmdq_drm = malloc(gCtx->cmdq_drm_size);
++}
+diff --git a/src/mesa/drivers/dri/glamo/glamo_cmdq.h b/src/mesa/drivers/dri/glamo/glamo_cmdq.h
+new file mode 100644
+index 0000000..7420d7b
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_cmdq.h
+@@ -0,0 +1,33 @@
++/*
++ * Command queue submission via DRM
++ *
++ * Copyright 2009 Thomas White <taw@bitwiz.org.uk>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++
++#include <stdint.h>
++#include <glamo_bo.h>
++
++#include "glamo_context.h"
++
++
++extern void glamoDRMDispatch(glamoContext *gCtx);
++extern void glamoDRMAddBO(glamoContext *gCtx, struct glamo_bo *bo);
++extern void glamoDRMAddData(glamoContext *gCtx, uint32_t val, int len);
++extern void glamoDRMStartBurst(glamoContext *gCtx, uint16_t base);
++extern void glamoInitCmdqCache(glamoContext *gCtx);
+diff --git a/src/mesa/drivers/dri/glamo/glamo_context.c b/src/mesa/drivers/dri/glamo/glamo_context.c
+new file mode 100644
+index 0000000..39eb4e7
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_context.c
+@@ -0,0 +1,360 @@
++/*
++ * Direct Rendering Support for SMedia Glamo 336x/337x
++ *
++ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
++ * Roughly based on sis_context.c (c) 2003 Eric Anholt
++ *              and radeon_common_context.c
++ *
++ * 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 AUTHORS 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.
++ */
++
++
++#include "dri_util.h"
++#include "drirenderbuffer.h"
++#include "utils.h"
++
++#include "swrast/swrast.h"
++#include "swrast_setup/swrast_setup.h"
++#include "drivers/common/driverfuncs.h"
++#include "vbo/vbo.h"
++#include "tnl/tnl.h"
++#include "tnl/t_pipeline.h"
++#include "main/state.h"
++
++#include "glamo_context.h"
++#include "glamo_screen.h"
++#include "glamo_state.h"
++#include "glamo_fbo.h"
++#include "glamo_tris.h"
++#include "glamo_render.h"
++#include "glamo_cmdq.h"
++
++#include <glamo_bo.h>
++#include <glamo_bo_gem.h>
++#include <glamo_drm.h>
++
++
++#define DRIVER_DATE  "20090913"
++
++
++static inline struct glamo_renderbuffer *glamo_get_renderbuffer(
++                                                      struct gl_framebuffer *fb,
++                                                      int att_index)
++{
++	if ( att_index >= 0 ) {
++		struct glamo_renderbuffer *gr;
++		gr = glamo_renderbuffer(fb->Attachment[att_index].Renderbuffer);
++		return gr;
++	} else {
++		return NULL;
++	}
++}
++
++
++static const GLubyte *glamoGetString(struct gl_context *ctx, GLenum name)
++{
++	static char buffer[128];
++
++	switch (name) {
++	case GL_VENDOR:
++		return (GLubyte *)"Thomas White";
++	case GL_RENDERER: {
++		driGetRendererString(buffer, "Glamo", DRIVER_DATE, 0);
++		return (GLubyte *) buffer;
++	}
++	default:
++		return 0;
++	}
++}
++
++
++/* Called when Mesa needs to know the size of the framebuffer */
++static void glamoBufferSize(struct gl_framebuffer *buffer,
++                            GLuint *width, GLuint *height)
++{
++	GET_CURRENT_CONTEXT(ctx);
++	glamoContextPtr glamo = GLAMO_CONTEXT(ctx);
++
++	*width = glamo->driDrawable->w;
++	*height = glamo->driDrawable->h;
++}
++
++
++GLboolean glamoCreateContext(const struct gl_config *glVisual,
++                             __DRIcontext *driContextPriv,
++                             void *sharedContextPrivate)
++{
++	struct gl_context *ctx, *shareCtx;
++	__DRIscreen *sPriv = driContextPriv->driScreenPriv;
++	glamoContextPtr context;
++	glamoScreenPtr glamoScreen;
++	struct dd_function_table functions;
++
++	context = (glamoContextPtr)CALLOC(sizeof(*context));
++	if ( context == NULL ) return GL_FALSE;
++
++	_mesa_init_driver_functions(&functions);
++
++	/* Allocate the Mesa context */
++	if ( sharedContextPrivate )
++		shareCtx = ((glamoContextPtr)sharedContextPrivate)->glCtx;
++	else
++		shareCtx = NULL;
++	context->glCtx = _mesa_create_context(glVisual, shareCtx,
++		                        &functions, (void *)context);
++	if ( context->glCtx == NULL ) {
++		FREE(context);
++		return GL_FALSE;
++	}
++	driContextPriv->driverPrivate = context;
++	ctx = context->glCtx;
++
++	glamoScreen = context->glamoScreen = (glamoScreenPtr)sPriv->private;
++
++	ctx->Driver.GetString = glamoGetString;
++	ctx->Driver.GetBufferSize = glamoBufferSize;
++
++	context->driContext = driContextPriv;
++	context->driScreen = sPriv;
++	context->driDrawable = NULL;
++	context->drm_fd = sPriv->fd;
++
++	/* Initialize the software rasterizer and helper modules. */
++	_swrast_CreateContext(ctx);
++	_vbo_CreateContext(ctx);
++	_tnl_CreateContext(ctx);
++	_swsetup_CreateContext(ctx);
++
++	/* Install our pipeline (see glamo_render.c) */
++	_tnl_install_pipeline(ctx, glamo_pipeline);
++
++	_swrast_allow_pixel_fog(ctx, GL_TRUE);
++	_swrast_allow_vertex_fog(ctx, GL_FALSE);
++	_tnl_allow_pixel_fog(ctx, GL_TRUE);
++	_tnl_allow_vertex_fog(ctx, GL_FALSE);
++
++	glamoInitCmdqCache(context);
++	glamoInitStateFuncs(ctx);
++	glamoInitTriFuncs(ctx);
++
++	return GL_TRUE;
++}
++
++
++void glamoDestroyContext(__DRIcontext *driContextPriv)
++{
++	glamoContextPtr context;
++
++	context = (glamoContextPtr)driContextPriv->driverPrivate;
++	assert(context != NULL);
++
++	if ( context != NULL ) {
++
++		_swsetup_DestroyContext(context->glCtx);
++		_tnl_DestroyContext(context->glCtx);
++		_vbo_DestroyContext(context->glCtx);
++		_swrast_DestroyContext(context->glCtx);
++
++		_mesa_destroy_context(context->glCtx);
++
++	}
++
++	FREE(context);
++}
++
++
++void glamo_update_renderbuffers(__DRIcontext *context,
++                                __DRIdrawable *drawable)
++{
++	unsigned int attachments[10];
++	__DRIbuffer *buffers;
++	__DRIscreen *screen;
++	int i, count;
++	struct glamo_framebuffer *draw;
++	glamoContextPtr glamo;
++	struct glamo_bo *bo;
++
++	draw = drawable->driverPrivate;
++	screen = context->driScreenPriv;
++	glamo = (glamoContextPtr)context->driverPrivate;
++	i = 0;
++	if ( draw->color_rb[0] ) {
++		attachments[i++] = __DRI_BUFFER_FRONT_LEFT;
++	}
++	if ( draw->color_rb[1] ) {
++		attachments[i++] = __DRI_BUFFER_BACK_LEFT;
++	}
++
++	buffers = screen->dri2.loader->getBuffers(drawable,
++	                                          &drawable->w,
++	                                          &drawable->h,
++	                                          attachments, i,
++	                                          &count,
++	                                          drawable->loaderPrivate);
++	if ( buffers == NULL ) return;
++
++	/* Set one cliprect to cover the whole drawable */
++	drawable->x = 0;
++	drawable->y = 0;
++	drawable->backX = 0;
++	drawable->backY = 0;
++	drawable->numClipRects = 1;
++	drawable->pClipRects[0].x1 = 0;
++	drawable->pClipRects[0].y1 = 0;
++	drawable->pClipRects[0].x2 = drawable->w;
++	drawable->pClipRects[0].y2 = drawable->h;
++	drawable->numBackClipRects = 1;
++	drawable->pBackClipRects[0].x1 = 0;
++	drawable->pBackClipRects[0].y1 = 0;
++	drawable->pBackClipRects[0].x2 = drawable->w;
++	drawable->pBackClipRects[0].y2 = drawable->h;
++
++	/* For each attachment */
++	for ( i=0; i<count; i++ ) {
++
++		struct glamo_renderbuffer *grb;
++
++		switch ( buffers[i].attachment ) {
++		case __DRI_BUFFER_FRONT_LEFT:
++			grb = draw->color_rb[0];
++			break;
++		case __DRI_BUFFER_BACK_LEFT:
++			grb = draw->color_rb[1];
++			break;
++		case __DRI_BUFFER_DEPTH:
++			grb = glamo_get_renderbuffer(&draw->base, BUFFER_DEPTH);
++			break;
++		case __DRI_BUFFER_STENCIL:
++			grb = glamo_get_renderbuffer(&draw->base,
++			                                        BUFFER_STENCIL);
++			break;
++		case __DRI_BUFFER_FAKE_FRONT_LEFT:
++			grb = draw->color_rb[0];
++			break;
++		case __DRI_BUFFER_ACCUM:
++		default:
++			fprintf(stderr,
++				"Unhandled buffer attach event,"
++				" attachment type %d\n", buffers[i].attachment);
++			return;
++		}
++
++		if ( grb == NULL ) {
++			/* Don't know how to handle this type of buffer */
++			continue;
++		}
++
++		if ( grb->bo ) {
++			uint32_t name = glamo_gem_get_name(grb->bo);
++			if ( name == buffers[i].name ) {
++				/* Buffer already attached.  No action needed */
++				continue;
++			}
++		}
++
++		grb->cpp = buffers[i].cpp;
++		grb->pitch = buffers[i].pitch;
++		grb->width = drawable->w;
++		grb->height = drawable->h;
++
++		bo = glamo_bo_open(glamo->glamoScreen->bom, buffers[i].name,
++		                   0, 0, GLAMO_GEM_DOMAIN_VRAM,
++		                   buffers[i].flags);
++		if ( bo == NULL ) {
++			fprintf(stderr, "Failed to attach buffer %d\n",
++				buffers[i].name);
++		}
++
++		glamo_renderbuffer_set_bo(grb, bo);
++		glamo_bo_unref(bo);
++
++	}
++
++	driUpdateFramebufferSize(glamo->glCtx, drawable);
++}
++
++
++GLboolean glamoMakeCurrent(__DRIcontext *driContextPriv,
++                           __DRIdrawable *driDrawPriv,
++                           __DRIdrawable *driReadPriv)
++{
++	struct glamo_framebuffer *draw_fb;
++	struct gl_framebuffer *read_fb;
++	glamoContextPtr glamo;
++
++	if ( driContextPriv == NULL ) {
++		_mesa_make_current(NULL, NULL, NULL);
++		return GL_TRUE;
++	}
++
++	/* The Glamo context we're switching to */
++	glamo = (glamoContextPtr)driContextPriv->driverPrivate;
++
++	glamo->driDrawable = driDrawPriv;
++
++	/* These two will probably be the same */
++	draw_fb = (struct glamo_framebuffer *)driDrawPriv->driverPrivate;
++	read_fb = (struct gl_framebuffer *)driReadPriv->driverPrivate;
++
++	glamo_update_renderbuffers(driContextPriv, driDrawPriv);
++	if (driDrawPriv != driReadPriv)
++		glamo_update_renderbuffers(driContextPriv, driReadPriv);
++
++	_mesa_make_current(glamo->glCtx, &draw_fb->base, read_fb);
++	_mesa_update_state(glamo->glCtx);
++
++	return GL_TRUE;
++}
++
++
++GLboolean glamoUnbindContext(__DRIcontext *driContextPriv)
++{
++	return GL_TRUE;
++}
++
++
++/* Convert IEEE754 32-bit float to Glamo's signed 24-bit float */
++uint32_t float7s16(GLfloat in)
++{
++	uint32_t a, b;
++	uint32_t sign, expo, mant;  /* Sign, exponent, significand */
++
++	a = *(uint32_t *)&in;
++
++	/* This is bad */
++	if ( a & 0x40000000 ) {
++		printf(stderr, "Warning: Exponent won't fit into 7 bits\n");
++	}
++
++	/* This hopefully isn't a big problem */
++	if ( a & 0x0000007f ) {
++		printf(stderr, "Warning: Precision lost in FP conversion\n");
++	}
++
++	/* Separate out the right bits */
++	mant = a & 0x007fff80;  /* Bits 7-22 (bits 0-6 are lost) */
++	expo = a & 0x3f800000;  /* Bits 23-29 (bit 30 is lost) */
++	sign = a & 0x80000000;  /* Bit 31 */
++
++	/* Shift and recombine */
++	b  = sign >> 8;  /* Fills bit 23 */
++	b |= expo >> 7;  /* Fills bits 16-22 */
++	b |= mant >> 7;  /* Fills bits 0-15 */
++
++	return b;
++}
+diff --git a/src/mesa/drivers/dri/glamo/glamo_context.h b/src/mesa/drivers/dri/glamo/glamo_context.h
+new file mode 100644
+index 0000000..8de3946
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_context.h
+@@ -0,0 +1,106 @@
++/*
++ * Direct Rendering Support for SMedia Glamo 336x/337x
++ *
++ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
++ * Roughly based on sis_context.h (c) 2003 Eric Anholt
++ *
++ * 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 AUTHORS 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.
++ */
++
++#ifndef __GLAMO_CONTEXT_H
++#define __GLAMO_CONTEXT_H
++
++
++#include "dri_util.h"
++#include "utils.h"
++#include "tnl/t_vertex.h"
++
++#include "glamo_screen.h"
++
++
++typedef struct glamo_context glamoContext;
++typedef struct glamo_context *glamoContextPtr;
++
++struct glamo_context {
++
++	struct gl_context *glCtx;                  /* Must be first in this structure */
++
++	int drm_fd;                        /* DRM fd */
++
++	__DRIcontext  *driContext;  /* DRI context */
++	__DRIscreen   *driScreen;   /* DRI screen */
++	__DRIdrawable *driDrawable; /* DRI drawable bound to this ctx */
++
++	glamoScreenPtr glamoScreen;        /* Screen private DRI data */
++
++	driOptionCache optionCache;
++
++	uint16_t *cmdq_drm;                /* Command queue cache */
++	uint16_t cmd_burst_base;
++	int cmdq_drm_used;
++	int cmdq_drm_size;
++	int cmdq_obj_used;
++	uint32_t *cmdq_objs;
++	unsigned int *cmdq_obj_pos;
++
++	/* Information about the current primitive */
++	struct {
++		GLuint id;
++		uint32_t primitive;	/* Current hardware primitive type */
++		struct glamo_bo *vb_bo;
++		uint8_t *vb;
++		unsigned int start_offset; /* Byte offset of start */
++		unsigned int current_offset; /* Byte offset of next vertex */
++		unsigned int count;	/* Number of vertices */
++	} prim;
++
++	/* Current vertex format and attributes */
++	int vertex_size;
++	struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
++
++	/* State */
++	GLuint new_state;      /* State which must be updated */
++	uint16_t col_clear;
++
++};
++
++#define GLAMO_CONTEXT(ctx) ((glamoContextPtr)(ctx->DriverCtx))
++
++#define TAG(x) glamo##x
++#include "tnl_dd/t_dd_vertex.h"
++#undef TAG
++
++extern GLboolean glamoCreateContext(const struct gl_config *glVis,
++                                    __DRIcontext *driContextPriv,
++                                    void *sharedContextPrivate);
++extern void glamoDestroyContext(__DRIcontext *dcp);
++extern GLboolean glamoMakeCurrent(__DRIcontext *driContextPriv,
++                                  __DRIdrawable *driDrawPriv,
++                                  __DRIdrawable *driReadPriv);
++extern GLboolean glamoUnbindContext(__DRIcontext *driContextPriv);
++extern void glamo_update_renderbuffers(__DRIcontext *context,
++                                       __DRIdrawable *drawable);
++
++#define GLAMO_PACKCOLOR565(r, g, b) \
++	((((r) & 0xf8) << 8)        \
++	| (((g) & 0xfc) << 3)       \
++	| (((b) & 0xf8) >> 3))
++
++extern uint32_t float7s16(GLfloat in);
++
++#endif   /* __GLAMO_CONTEXT_H */
+diff --git a/src/mesa/drivers/dri/glamo/glamo_fbo.c b/src/mesa/drivers/dri/glamo/glamo_fbo.c
+new file mode 100644
+index 0000000..e25ca31
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_fbo.c
+@@ -0,0 +1,130 @@
++/*
++ * Direct Rendering Support for SMedia Glamo 336x/337x
++ *
++ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
++ * Roughly based on radeon_fbo.c (c) 2008 Red Hat 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 AUTHORS 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.
++ */
++
++
++#include "main/imports.h"
++#include "main/macros.h"
++#include "main/mtypes.h"
++#include "main/formats.h"
++#include "main/fbobject.h"
++#include "main/framebuffer.h"
++#include "main/renderbuffer.h"
++#include "main/context.h"
++#include "dri_util.h"
++
++/* This comes from libdrm_glamo */
++#include <glamo_bo.h>
++
++#include "glamo_fbo.h"
++
++
++static void glamo_delete_renderbuffer(struct gl_renderbuffer *rb)
++{
++   struct glamo_renderbuffer *grb = glamo_renderbuffer(rb);
++
++   ASSERT(grb);
++
++   if ( grb && grb->bo ) {
++      glamo_bo_unref(grb->bo);
++   }
++   free(grb);
++}
++
++
++static void *glamo_get_pointer(struct gl_context *ctx, struct gl_renderbuffer *rb,
++                               GLint x, GLint y)
++{
++   return NULL;   /* Can't be directly addressed */
++}
++
++
++/* Called for each hardware renderbuffer when a _window_ is resized.
++ * Just update fields.
++ * Not used for user-created renderbuffers!
++ */
++static GLboolean glamo_alloc_window_storage(struct gl_context *ctx,
++                                            struct gl_renderbuffer *rb,
++                                            GLenum internalFormat,
++                                            GLuint width, GLuint height)
++{
++   ASSERT(rb->Name == 0);
++   rb->Width = width;
++   rb->Height = height;
++   rb->Format = internalFormat;
++   return GL_TRUE;
++}
++
++
++/* Create a buffer, such as a colour or depth buffer */
++struct glamo_renderbuffer *glamo_create_renderbuffer(GLenum format,
++                                              __DRIdrawable *driDrawPriv)
++{
++   struct glamo_renderbuffer *grb;
++
++   grb = CALLOC_STRUCT(glamo_renderbuffer);
++   if ( !grb ) return NULL;
++
++   _mesa_init_renderbuffer(&grb->base, 0);
++   grb->base.ClassID = GLAMO_RB_CLASS;
++
++   switch (format) {
++      case GL_RGB5:
++         grb->base.Format = MESA_FORMAT_RGB565;
++         grb->base._BaseFormat = GL_RGB;
++
++         grb->base.DataType = GL_UNSIGNED_BYTE;
++         break;
++      case GL_DEPTH_COMPONENT16:
++         grb->base.DataType = GL_UNSIGNED_SHORT;
++	 grb->base._BaseFormat = GL_DEPTH_COMPONENT;
++         break;
++      default:
++         fprintf(stderr, "%s: Unknown format 0x%04x\n", __FUNCTION__, format);
++         _mesa_delete_renderbuffer(&grb->base);
++         return NULL;
++   }
++
++   grb->dPriv = driDrawPriv;
++   grb->base.InternalFormat = format;
++
++   grb->base.Delete = glamo_delete_renderbuffer;
++   grb->base.AllocStorage = glamo_alloc_window_storage;
++   grb->base.GetPointer = glamo_get_pointer;
++
++   return grb;
++}
++
++
++void glamo_renderbuffer_set_bo(struct glamo_renderbuffer *grb,
++                               struct glamo_bo *bo)
++{
++  struct glamo_bo *old;
++  old = grb->bo;
++  grb->bo = bo;
++  glamo_bo_ref(bo);
++  if ( old ) glamo_bo_unref(old);
++}
++
++
++/* kate: space-indent on; indent-width 3; mixedindent off; indent-mode cstyle; */
+diff --git a/src/mesa/drivers/dri/glamo/glamo_fbo.h b/src/mesa/drivers/dri/glamo/glamo_fbo.h
+new file mode 100644
+index 0000000..48210dd
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_fbo.h
+@@ -0,0 +1,77 @@
++/*
++ * Direct Rendering Support for SMedia Glamo 336x/337x
++ *
++ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
++ *
++ * 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 AUTHORS 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.
++ */
++
++#ifndef __GLAMO_FBO_H
++#define __GLAMO_FBO_H
++
++
++#include "main/mtypes.h"
++#include "dri_util.h"
++
++
++/* This is just a marker so we can tell a Glamo renderbuffer from a Mesa one */
++#define GLAMO_RB_CLASS (0xdeadbeef)
++
++
++struct glamo_renderbuffer
++{
++	struct gl_renderbuffer base;   /* Must be first */
++	struct glamo_bo *bo;
++	unsigned int cpp;
++	unsigned int pitch;
++	unsigned int width;
++	unsigned int height;
++
++	__DRIdrawable *dPriv;
++};
++
++
++struct glamo_framebuffer
++{
++	struct gl_framebuffer base;
++	struct glamo_renderbuffer *color_rb[2];
++};
++
++
++/* This is just a small wrapper function to return NULL if the gl_renderbuffer
++ * is not a glamo_renderbuffer */
++static inline struct glamo_renderbuffer
++                                 *glamo_renderbuffer(struct gl_renderbuffer *rb)
++{
++	struct glamo_renderbuffer *grb = (struct glamo_renderbuffer *)rb;
++	if ( grb && grb->base.ClassID == GLAMO_RB_CLASS )
++		return grb;
++	else
++		return NULL;
++}
++
++
++extern struct glamo_renderbuffer *glamo_create_renderbuffer(GLenum format,
++                                             __DRIdrawable *driDrawPriv);
++
++extern void glamo_renderbuffer_set_bo(struct glamo_renderbuffer *grb,
++                               struct glamo_bo *bo);
++
++#endif   /* __GLAMO_FBO_H */
++
++/* kate: space-indent on; indent-width 3; mixedindent off; indent-mode cstyle; */
+diff --git a/src/mesa/drivers/dri/glamo/glamo_regs.h b/src/mesa/drivers/dri/glamo/glamo_regs.h
+new file mode 100644
+index 0000000..02b2294
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_regs.h
+@@ -0,0 +1,174 @@
++#ifndef _GLAMO_REGS_H
++#define _GLAMO_REGS_H
++
++/* Smedia Glamo 336x/337x driver
++ *
++ * (C) 2007 by OpenMoko, Inc.
++ * Author: Harald Welte <laforge@openmoko.org>
++ * All rights reserved.
++ *
++ * Modified for Glamo Mesa driver by Thomas White <taw@bitwiz.org.uk>
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ * MA 02111-1307 USA
++ */
++
++enum glamo_regster_offsets {
++	GLAMO_REGOFS_GENERIC	= 0x0000,
++	GLAMO_REGOFS_HOSTBUS	= 0x0200,
++	GLAMO_REGOFS_MEMORY	= 0x0300,
++	GLAMO_REGOFS_VIDCAP	= 0x0400,
++	GLAMO_REGOFS_ISP	= 0x0500,
++	GLAMO_REGOFS_JPEG	= 0x0800,
++	GLAMO_REGOFS_MPEG	= 0x0c00,
++	GLAMO_REGOFS_LCD	= 0x1100,
++	GLAMO_REGOFS_MMC	= 0x1400,
++	GLAMO_REGOFS_MPROC0	= 0x1500,
++	GLAMO_REGOFS_MPROC1	= 0x1580,
++	GLAMO_REGOFS_CMDQUEUE	= 0x1600,
++	GLAMO_REGOFS_RISC	= 0x1680,
++	GLAMO_REGOFS_2D		= 0x1700,
++	GLAMO_REGOFS_3D		= 0x1b00,
++};
++
++
++#define REG_MPEG(x)           (GLAMO_REGOFS_MPEG+(x))
++
++enum glamo_register_mpeg {
++      //
++      GLAMO_REG_MPEG_DC_ADDRL         = REG_MPEG(0x3c),
++      GLAMO_REG_MPEG_DC_ADDRH         = REG_MPEG(0x3e),
++      GLAMO_REG_MPEG_AC_ADDRL         = REG_MPEG(0x40),
++      GLAMO_REG_MPEG_AC_ADDRH         = REG_MPEG(0x42),
++      //
++      GLAMO_REG_MPEG_SAFE_1           = REG_MPEG(0x60),
++      GLAMO_REG_MPEG_SAFE_2           = REG_MPEG(0x62),
++      GLAMO_REG_MPEG_SAFE_3           = REG_MPEG(0x64),
++      //
++      GLAMO_REG_MPEG_DEC_OUT0_Y_ADDRL = REG_MPEG(0x6e),
++      GLAMO_REG_MPEG_DEC_OUT0_Y_ADDRH = REG_MPEG(0x70),
++      GLAMO_REG_MPEG_DEC_OUT0_U_ADDRL = REG_MPEG(0x72),
++      GLAMO_REG_MPEG_DEC_OUT0_U_ADDRH = REG_MPEG(0x74),
++      GLAMO_REG_MPEG_DEC_OUT0_V_ADDRL = REG_MPEG(0x76),
++      GLAMO_REG_MPEG_DEC_OUT0_V_ADDRH = REG_MPEG(0x78),
++      GLAMO_REG_MPEG_DEC_OUT1_Y_ADDRL = REG_MPEG(0x7a),
++      GLAMO_REG_MPEG_DEC_OUT1_Y_ADDRH = REG_MPEG(0x7c),
++      GLAMO_REG_MPEG_DEC_OUT1_U_ADDRL = REG_MPEG(0x7e),
++      GLAMO_REG_MPEG_DEC_OUT1_U_ADDRH = REG_MPEG(0x80),
++      GLAMO_REG_MPEG_DEC_OUT1_V_ADDRL = REG_MPEG(0x82),
++      GLAMO_REG_MPEG_DEC_OUT1_V_ADDRH = REG_MPEG(0x84),
++      GLAMO_REG_MPEG_DEC_OUT2_Y_ADDRL = REG_MPEG(0x86),
++      GLAMO_REG_MPEG_DEC_OUT2_Y_ADDRH = REG_MPEG(0x88),
++      GLAMO_REG_MPEG_DEC_OUT2_U_ADDRL = REG_MPEG(0x8a),
++      GLAMO_REG_MPEG_DEC_OUT2_U_ADDRH = REG_MPEG(0x8c),
++      GLAMO_REG_MPEG_DEC_OUT2_V_ADDRL = REG_MPEG(0x8e),
++      GLAMO_REG_MPEG_DEC_OUT2_V_ADDRH = REG_MPEG(0x90),
++      GLAMO_REG_MPEG_DEC_WIDTH        = REG_MPEG(0x92),
++      GLAMO_REG_MPEG_DEC_HEIGHT       = REG_MPEG(0x94),
++      GLAMO_REG_MPEG_SPECIAL          = REG_MPEG(0x96),
++      GLAMO_REG_MPEG_DEC_IN_ADDRL     = REG_MPEG(0x98),
++      GLAMO_REG_MPEG_DEC_IN_ADDRH     = REG_MPEG(0x9a),
++      //
++      GLAMO_REG_MPEG_DEBLK_THRESHOLD  = REG_MPEG(0xc0),
++      //
++      GLAMO_REG_MPEG_DEC_STATUS       = REG_MPEG(0xc8),
++      GLAMO_REG_MPEG_DEC_RB0          = REG_MPEG(0xca),
++      GLAMO_REG_MPEG_DEC_RB1          = REG_MPEG(0xcc),
++};
++
++
++#define REG_2D(x)		(GLAMO_REGOFS_2D+(x))
++
++enum glamo_register_2d {
++	GLAMO_REG_2D_SRC_ADDRL		= REG_2D(0x00),
++	GLAMO_REG_2D_SRC_ADDRH		= REG_2D(0x02),
++	GLAMO_REG_2D_SRC_PITCH		= REG_2D(0x04),
++	GLAMO_REG_2D_SRC_X		= REG_2D(0x06),
++	GLAMO_REG_2D_SRC_Y		= REG_2D(0x08),
++	GLAMO_REG_2D_DST_X		= REG_2D(0x0a),
++	GLAMO_REG_2D_DST_Y		= REG_2D(0x0c),
++	GLAMO_REG_2D_DST_ADDRL		= REG_2D(0x0e),
++	GLAMO_REG_2D_DST_ADDRH		= REG_2D(0x10),
++	GLAMO_REG_2D_DST_PITCH		= REG_2D(0x12),
++	GLAMO_REG_2D_DST_HEIGHT		= REG_2D(0x14),
++	GLAMO_REG_2D_RECT_WIDTH		= REG_2D(0x16),
++	GLAMO_REG_2D_RECT_HEIGHT	= REG_2D(0x18),
++	GLAMO_REG_2D_PAT_ADDRL		= REG_2D(0x1a),
++	GLAMO_REG_2D_PAT_ADDRH		= REG_2D(0x1c),
++	GLAMO_REG_2D_PAT_FG		= REG_2D(0x1e),
++	GLAMO_REG_2D_PAT_BG		= REG_2D(0x20),
++	GLAMO_REG_2D_SRC_FG		= REG_2D(0x22),
++	GLAMO_REG_2D_SRC_BG		= REG_2D(0x24),
++	GLAMO_REG_2D_MASK1		= REG_2D(0x26),
++	GLAMO_REG_2D_MASK2		= REG_2D(0x28),
++	GLAMO_REG_2D_MASK3		= REG_2D(0x2a),
++	GLAMO_REG_2D_MASK4		= REG_2D(0x2c),
++	GLAMO_REG_2D_ROT_X		= REG_2D(0x2e),
++	GLAMO_REG_2D_ROT_Y		= REG_2D(0x30),
++	GLAMO_REG_2D_LEFT_CLIP		= REG_2D(0x32),
++	GLAMO_REG_2D_TOP_CLIP		= REG_2D(0x34),
++	GLAMO_REG_2D_RIGHT_CLIP		= REG_2D(0x36),
++	GLAMO_REG_2D_BOTTOM_CLIP	= REG_2D(0x38),
++	GLAMO_REG_2D_COMMAND1		= REG_2D(0x3A),
++	GLAMO_REG_2D_COMMAND2		= REG_2D(0x3C),
++	GLAMO_REG_2D_COMMAND3		= REG_2D(0x3E),
++	GLAMO_REG_2D_SAFE		= REG_2D(0x40),
++	GLAMO_REG_2D_STATUS		= REG_2D(0x42),
++	GLAMO_REG_2D_ID1		= REG_2D(0x44),
++	GLAMO_REG_2D_ID2		= REG_2D(0x46),
++	GLAMO_REG_2D_ID3		= REG_2D(0x48),
++};
++
++
++/* No offset this time */
++#define REG_3D(x)		(x)
++
++enum glamo_register_3d
++{
++	/* Fire the engine */
++	G3D_FIRE			= REG_3D(0x2058),
++
++	/* Streams of vertex/colour/normal/texcoord data */
++	G3D_ACTIVE_STREAMS		= REG_3D(0x1f00),
++	G3D_LAST_STREAM__VCOLFMT	= REG_3D(0x2030),
++	G3D_STREAM_MODE_0		= REG_3D(0x1f10),
++	G3D_STREAM_BASE_0		= REG_3D(0x1f14),
++	G3D_STREAM_MODE_1		= REG_3D(0x1f18),
++	G3D_STREAM_BASE_1		= REG_3D(0x1f1c),
++	G3D_STREAM_MODE_2		= REG_3D(0x1f20),
++	G3D_STREAM_BASE_2		= REG_3D(0x1f24),
++	G3D_STREAM_MODE_3		= REG_3D(0x1f28),
++	G3D_STREAM_BASE_3		= REG_3D(0x1f2c),
++	G3D_STREAM_MODE_4		= REG_3D(0x1f30),
++	G3D_STREAM_BASE_4		= REG_3D(0x1f34),
++	G3D_STREAM_MODE_5		= REG_3D(0x1f38),
++	G3D_STREAM_BASE_5		= REG_3D(0x1f3c),
++	G3D_STREAM_MODE_6		= REG_3D(0x1f40),
++	G3D_STREAM_BASE_6		= REG_3D(0x1f44),
++	G3D_STREAM_MODE_7		= REG_3D(0x1f48),
++	G3D_STREAM_BASE_7		= REG_3D(0x1f4c),
++
++	/* Modelview*projection matrix */
++	G3D_MATRIX_MVP			= REG_3D(0x26a0), /* .. 0x27df */
++
++	/* Modelview matrix */
++	G3D_MATRIX_MV			= REG_3D(0x26e0), /* .. 0x270f */
++
++	/* Inverse MVP, 3x3 only */
++	G3D_MATRIX_IMVP			= REG_3D(0x2710), /* .. 0x2733 */
++
++};
++
++#endif /* _GLAMO_REGS_H */
+diff --git a/src/mesa/drivers/dri/glamo/glamo_render.c b/src/mesa/drivers/dri/glamo/glamo_render.c
+new file mode 100644
+index 0000000..d8b21d5
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_render.c
+@@ -0,0 +1,230 @@
++/*
++ * Direct Rendering Support for SMedia Glamo 336x/337x
++ *
++ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
++ *
++ * 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 AUTHORS 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.
++ *
++ *
++ * Based on intel_render.c, to which the following notice applies:
++ *
++ * Copyright 2003 Tungsten Graphics, 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 TUNGSTEN GRAPHICS 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.
++ *
++ */
++
++
++/*
++ * Render unclipped vertex buffers by emitting vertices directly to
++ * dma buffers.  Use strip/fan hardware acceleration where possible.
++ *
++ */
++#include "main/glheader.h"
++#include "main/context.h"
++#include "main/macros.h"
++#include "main/imports.h"
++#include "main/mtypes.h"
++#include "main/enums.h"
++
++#include "tnl/t_context.h"
++#include "tnl/t_vertex.h"
++#include "tnl/t_pipeline.h"
++#include "math/m_xform.h"
++
++#include "glamo_context.h"
++#include "glamo_tris.h"
++#include "glamo_regs.h"
++
++/*
++ * Render unclipped vertex buffers by emitting vertices directly to
++ * VRAM buffers.  Use strip/fan hardware primitives where possible.
++ * Try to simulate missing primitives with indexed vertices.
++ */
++#define HAVE_POINTS      1
++#define HAVE_LINES       1
++#define HAVE_LINE_STRIPS 0
++#define HAVE_TRIANGLES   1
++#define HAVE_TRI_STRIPS  0
++#define HAVE_TRI_STRIP_1 0
++#define HAVE_TRI_FANS    0
++#define HAVE_POLYGONS    0
++#define HAVE_QUADS       0
++#define HAVE_QUAD_STRIPS 0
++#define HAVE_ELTS        0
++
++
++static void glamoFlushPrim(struct glamo_context *gCtx)
++{
++	printf("glamoFlushPrim: %i vertices, %i %i\n", gCtx->prim.count,
++	gCtx->prim.start_offset, gCtx->prim.current_offset);
++
++	if ( gCtx->prim.vb_bo == NULL ) return;
++
++	/* Upload to hardware */
++	glamo_bo_subdata(gCtx->prim.vb_bo, 0, gCtx->prim.current_offset,
++	                 gCtx->prim.vb);
++
++	/* Dispatch to the hardware */
++	glamoDRMStartBurst(gCtx, G3D_STREAM_MODE_0);
++	glamoDRMAddData(gCtx, 0x000f0300, 4);
++	glamoDRMAddBO(gCtx, gCtx->prim.vb_bo);
++	glamoDRMDispatch(gCtx);
++
++	/* Please use a new BO for the next buffer */
++	gCtx->prim.vb_bo = NULL;
++
++	/* Continue from new start */
++	gCtx->prim.start_offset = gCtx->prim.current_offset;
++}
++
++
++static inline GLuint glamoGetVBMax(struct glamo_context *gCtx)
++{
++	return GLAMO_VB_SIZE / gCtx->vertex_size;
++}
++
++
++static inline GLuint glamoGetCurrentMax(struct glamo_context *gCtx)
++{
++	/* How many more vertices can be accommodated?
++	 * Each vertex takes up 4x 32-bit fixed point values */
++	return (GLAMO_VB_SIZE - gCtx->prim.current_offset) / gCtx->vertex_size;
++}
++
++
++#define LOCAL_VARS \
++	struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
++
++#define INIT(prim)
++
++#define FLUSH() glamoFlushPrim(gCtx)
++
++#define GET_SUBSEQUENT_VB_MAX_VERTS() glamoGetVBMax(gCtx)
++#define GET_CURRENT_VB_MAX_VERTS() glamoGetCurrentMax(gCtx)
++
++#define ALLOC_VERTS(nr) glamoGetPrimSpace(gCtx, nr)
++
++#define EMIT_VERTS(ctx, j, nr, buf) \
++	_tnl_emit_vertices_to_buffer(ctx, j, (j)+(nr), buf)
++
++#define TAG(x) glamo_##x
++#include "tnl_dd/t_dd_dmatmp.h"
++
++
++/**********************************************************************/
++/*                          Render pipeline stage                     */
++/**********************************************************************/
++
++static void glamoFireEngine(struct glamo_context *gCtx)
++{
++	glamoDRMStartBurst(gCtx, G3D_FIRE);
++	glamoDRMAddData(gCtx, 0, 2);  /* Fire! */
++	glamoDRMDispatch(gCtx);
++}
++
++
++static GLboolean glamoRunRender(struct gl_context *ctx,
++                                struct tnl_pipeline_stage *stage)
++{
++	TNLcontext *tnl = TNL_CONTEXT(ctx);
++	struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
++	struct vertex_buffer *VB = &tnl->vb;
++	GLuint i;
++
++	printf("glamoRunRender\n");
++
++	/* Don't handle clipping */
++	if ( !glamo_validate_render(ctx, VB) ) {
++		return GL_TRUE; /* Failed */
++	}
++
++	/* Validate GPU state */
++	if ( gCtx->new_state ) {
++		if ( !glamoValidateState(ctx, gCtx->new_state) ) {
++			printf("Couldn't validate state...\n");
++		}
++	} /* else nothing to update */
++
++	tnl->clipspace.new_inputs |= VERT_BIT_POS;
++
++	tnl->Driver.Render.Start(ctx);
++
++	for ( i=0; i<VB->PrimitiveCount; i++ ) {
++
++		GLuint prim = _tnl_translate_prim(&VB->Primitive[i]);
++		GLuint start = VB->Primitive[i].start;
++		GLuint length = VB->Primitive[i].count;
++
++		if (!length) continue;
++
++		glamo_render_tab_verts[prim & PRIM_MODE_MASK](ctx, start,
++                                                     start + length, prim);
++
++	}
++
++	tnl->Driver.Render.Finish(ctx);
++
++	glamoFireEngine(gCtx);
++
++	return GL_FALSE;  /* Ok */
++}
++
++
++static const struct tnl_pipeline_stage _glamo_render_stage = {
++	"glamo render",
++	NULL,
++	NULL,
++	NULL,
++	NULL,
++	glamoRunRender
++};
++
++
++const struct tnl_pipeline_stage *glamo_pipeline[] = {
++	&_tnl_vertex_transform_stage,
++	&_tnl_normal_transform_stage,
++	&_tnl_lighting_stage,
++	&_tnl_fog_coordinate_stage,
++	&_tnl_texgen_stage,
++	&_tnl_texture_transform_stage,
++	&_tnl_point_attenuation_stage,
++	&_tnl_vertex_program_stage,
++	&_glamo_render_stage,        /* ADD: unclipped rastersetup-to-dma */
++	&_tnl_render_stage,
++	0,
++};
+diff --git a/src/mesa/drivers/dri/glamo/glamo_render.h b/src/mesa/drivers/dri/glamo/glamo_render.h
+new file mode 100644
+index 0000000..99c36a8
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_render.h
+@@ -0,0 +1,31 @@
++/*
++ * Direct Rendering Support for SMedia Glamo 336x/337x
++ *
++ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
++ *
++ * 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 AUTHORS 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.
++ */
++
++#ifndef __GLAMO_RENDER_H
++#define __GLAMO_RENDER_H
++
++#include "main/mtypes.h"
++
++extern const struct tnl_pipeline_stage *glamo_pipeline[];
++
++#endif   /* __GLAMO_RENDER_H */
+diff --git a/src/mesa/drivers/dri/glamo/glamo_screen.c b/src/mesa/drivers/dri/glamo/glamo_screen.c
+new file mode 100644
+index 0000000..cc8a730
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_screen.c
+@@ -0,0 +1,250 @@
++/*
++ * Direct Rendering Support for SMedia Glamo 336x/337x
++ *
++ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
++ * Roughly based on sis_screen.c (c) 2003 Eric Anholt
++ *
++ * 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 AUTHORS 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.
++ */
++
++
++#include "dri_util.h"
++#include "utils.h"
++#include "xmlconfig.h"
++#include "GL/internal/dri_interface.h"
++#include "main/framebuffer.h"
++#include "main/renderbuffer.h"
++
++#include "glamo_screen.h"
++#include "glamo_context.h"
++#include "glamo_fbo.h"
++
++/* This comes from libdrm_glamo */
++#include <glamo_bo_gem.h>
++
++
++static int glamoInitDriver(__DRIscreen *psp)
++{
++   return 0;
++}
++
++
++static glamoScreenPtr glamoCreateScreen(__DRIscreen *sPriv)
++{
++   glamoScreenPtr glamoScreen;
++
++   /* Allocate the private area */
++   glamoScreen = (glamoScreenPtr)CALLOC(sizeof(*glamoScreen));
++   if ( glamoScreen == NULL )
++      return NULL;
++
++   glamoScreen->driScreen = sPriv;
++
++   /* This is our link to the kernel's memory manager, via libdrm */
++   glamoScreen->bom = glamo_bo_manager_gem_ctor(sPriv->fd);
++
++   return glamoScreen;
++}
++
++
++static void glamoDestroyScreen(__DRIscreen *sPriv)
++{
++   glamoScreenPtr glamoScreen = (glamoScreenPtr)sPriv->private;
++
++   if ( glamoScreen == NULL )
++      return;
++
++   FREE(glamoScreen);
++   sPriv->private = NULL;
++}
++
++
++static const __DRIconfig **glamoInitScreen(__DRIscreen *sPriv)
++{
++   __DRIconfig **configs;
++   uint8_t depth_bits_array[2];
++   uint8_t stencil_bits_array[2];
++   uint8_t msaa_samples_array[1];
++   static const GLenum db_modes[] = { GLX_SWAP_COPY_OML, GLX_NONE };
++
++   /* Driver initialisation */
++   if ( glamoInitDriver(sPriv) ) {
++      return NULL;
++   }
++
++   /* Screen-specific initialisation */
++   sPriv->private = glamoCreateScreen(sPriv);
++   if ( !sPriv->private ) {
++      glamoDestroyScreen(sPriv);
++      return NULL;
++   }
++
++   depth_bits_array[0] = 0;
++   stencil_bits_array[0] = 0;
++   depth_bits_array[1] = 16;
++   stencil_bits_array[1] = 0;
++   msaa_samples_array[0] = 0;
++
++   configs = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
++                           depth_bits_array, stencil_bits_array, 2,
++                           db_modes, 2, msaa_samples_array, 1, GL_TRUE);
++
++   if ( configs == NULL ) {
++      fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__);
++      return NULL;
++   }
++
++   return (const __DRIconfig **)configs;
++}
++
++
++static const __DRIconfig **glamoInitScreen2(__DRIscreen *sPriv)
++{
++   __DRIconfig **configs;
++   uint8_t depth_bits_array[2];
++   uint8_t stencil_bits_array[2];
++   uint8_t msaa_samples_array[1];
++   static const GLenum db_modes[] = { GLX_SWAP_COPY_OML, GLX_NONE };
++
++   /* Driver initialisation */
++   if ( glamoInitDriver(sPriv) ) {
++      return NULL;
++   }
++
++   /* Screen-specific initialisation */
++   sPriv->private = glamoCreateScreen(sPriv);
++   if ( !sPriv->private ) {
++      glamoDestroyScreen(sPriv);
++      return NULL;
++   }
++
++   depth_bits_array[0] = 0;
++   stencil_bits_array[0] = 0;
++   depth_bits_array[1] = 16;
++   stencil_bits_array[1] = 0;
++   msaa_samples_array[0] = 0;
++
++   configs = driCreateConfigs(GL_RGB, GL_UNSIGNED_SHORT_5_6_5,
++                           depth_bits_array, stencil_bits_array, 2,
++                           db_modes, 2, msaa_samples_array, 1, GL_TRUE);
++
++   if ( configs == NULL ) {
++      fprintf(stderr, "[%s:%u] Error creating FBConfig!\n", __func__, __LINE__);
++      return NULL;
++   }
++
++   return (const __DRIconfig **)configs;
++}
++
++
++/* Allocate buffers for a context.  This is where the fun starts... */
++static GLboolean glamoCreateBuffer(__DRIscreen *driScrnPriv,
++                                   __DRIdrawable *driDrawPriv,
++                                   const struct gl_config *mesaVis,
++                                   GLboolean isPixmap)
++{
++   struct glamo_framebuffer *gfb;
++   GLenum rgbFormat;
++
++   if ( isPixmap ) return GL_FALSE; /* not implemented */
++
++   gfb = CALLOC_STRUCT(glamo_framebuffer);
++   if ( !gfb ) return GL_FALSE;
++
++   _mesa_initialize_window_framebuffer(&gfb->base, mesaVis);
++
++   /* we only support this one format at the moment */
++   rgbFormat = GL_RGB5;
++
++   /* Front color renderbuffer */
++   gfb->color_rb[0] = glamo_create_renderbuffer(rgbFormat, driDrawPriv);
++   _mesa_add_renderbuffer(&gfb->base, BUFFER_FRONT_LEFT,
++                          &gfb->color_rb[0]->base);
++
++   /* Back color renderbuffer, if requested */
++   if ( mesaVis->doubleBufferMode ) {
++      gfb->color_rb[1] = glamo_create_renderbuffer(rgbFormat, driDrawPriv);
++      _mesa_add_renderbuffer(&gfb->base, BUFFER_BACK_LEFT,
++                             &gfb->color_rb[1]->base);
++   }
++
++   if ( mesaVis->depthBits == 16 ) {
++      struct glamo_renderbuffer *depth;
++      depth = glamo_create_renderbuffer(GL_DEPTH_COMPONENT16, driDrawPriv);
++      _mesa_add_renderbuffer(&gfb->base, BUFFER_DEPTH, &depth->base);
++   }
++
++   /* Add software renderbuffers for the things we can't support in hardware */
++   _mesa_add_soft_renderbuffers(&gfb->base,
++      GL_FALSE,  /* color */
++      GL_FALSE,  /* depth */
++      mesaVis->stencilBits > 0,   /* stencil, if required */
++      mesaVis->accumRedBits > 0,  /* accum, if required */
++      GL_FALSE,  /* alpha */
++      GL_FALSE   /* aux */
++   );
++   driDrawPriv->driverPrivate = (void *)gfb;
++
++   return (driDrawPriv->driverPrivate != NULL);
++}
++
++
++static void glamoDestroyBuffer(__DRIdrawable *driDrawPriv)
++{
++}
++
++
++static void glamoSwapBuffers(__DRIdrawable *driDrawPriv)
++{
++   printf("glamoSwapBuffers\n"); fflush(stdout);
++}
++
++
++/*
++ *  Mesa entry points
++ *
++ *  See src/mesa/drivers/dri/common/dri_util.h for information about these
++ */
++const struct __DriverAPIRec driDriverAPI = {
++   .InitScreen      = glamoInitScreen,
++   .DestroyScreen   = glamoDestroyScreen,
++   .CreateContext   = glamoCreateContext,
++   .DestroyContext  = glamoDestroyContext,
++   .CreateBuffer    = glamoCreateBuffer,
++   .DestroyBuffer   = glamoDestroyBuffer,
++   .SwapBuffers     = glamoSwapBuffers,
++   .MakeCurrent     = glamoMakeCurrent,
++   .UnbindContext   = glamoUnbindContext,
++   .GetSwapInfo     = NULL,   /* Not used */
++   .WaitForMSC      = NULL,
++   .WaitForSBC      = NULL,
++   .SwapBuffersMSC  = NULL,
++   .CopySubBuffer   = NULL,
++   .GetDrawableMSC  = NULL,   /* Not used */
++   .InitScreen2     = glamoInitScreen2,    /* For DRI2 */
++};
++
++/* This is the table of extensions that the loader will dlsym() for. */
++PUBLIC const __DRIextension *__driDriverExtensions[] = {
++    &driCoreExtension.base,
++    &driLegacyExtension.base,
++    &driDRI2Extension.base,
++    NULL
++};
++
++/* kate: space-indent on; indent-width 3; mixedindent off; indent-mode cstyle; */
+diff --git a/src/mesa/drivers/dri/glamo/glamo_screen.h b/src/mesa/drivers/dri/glamo/glamo_screen.h
+new file mode 100644
+index 0000000..3f2eb5f
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_screen.h
+@@ -0,0 +1,44 @@
++/*
++ * Direct Rendering Support for SMedia Glamo 336x/337x
++ *
++ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
++ * Roughly based on sis_screen.h (c) 2003 Eric Anholt
++ *
++ * 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 AUTHORS 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.
++ */
++
++#ifndef __GLAMO_SCREEN_H
++#define __GLAMO_SCREEN_H
++
++#include "xmlconfig.h"
++#include "dri_util.h"
++
++#include <glamo_bo_gem.h>
++
++typedef struct {
++
++   __DRIscreen *driScreen;
++   driOptionCache optionCache;
++
++   struct glamo_bo_manager *bom;
++
++} glamoScreenRec, *glamoScreenPtr;
++
++#endif   /* __GLAMO_SCREEN_H */
++
++/* kate: space-indent on; indent-width 3; mixedindent off; indent-mode cstyle; */
+diff --git a/src/mesa/drivers/dri/glamo/glamo_state.c b/src/mesa/drivers/dri/glamo/glamo_state.c
+new file mode 100644
+index 0000000..3aa2f8b
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_state.c
+@@ -0,0 +1,305 @@
++/*
++ * Direct Rendering Support for SMedia Glamo 336x/337x
++ *
++ * (c) 2009-2010 Thomas White <taw@bitwiz.org.uk>
++ * Roughly based on sis_state.c (c) 2003 Eric Anholt
++ *
++ * 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 AUTHORS 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.
++ *
++ *
++ * Also partially based on intel_fbo.c, to which the following notice applies:
++ *
++ * Copyright 2006 Tungsten Graphics, 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 TUNGSTEN GRAPHICS 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.
++ */
++
++
++#include "main/context.h"
++#include "main/framebuffer.h"
++#include "main/api_arrayelt.h"
++#include "main/macros.h"
++#include "swrast/swrast.h"
++#include "swrast_setup/swrast_setup.h"
++#include "tnl/tnl.h"
++
++#include "glamo_fbo.h"
++#include "glamo_state.h"
++#include "glamo_context.h"
++#include "glamo_cmdq.h"
++#include "glamo_regs.h"
++
++
++static void glamoResizeBuffers(struct gl_context *ctx, struct gl_framebuffer *fb,
++                               GLuint width, GLuint height)
++{
++	struct glamo_framebuffer *glamo_fb = (struct glamo_framebuffer *)fb;
++	int i;
++
++	_mesa_resize_framebuffer(ctx, fb, width, height);
++
++	fb->Initialized = GL_TRUE; /* XXX remove someday */
++
++	if (fb->Name != 0) {
++		return;
++	}
++
++	/* Make sure all window system renderbuffers are up to date */
++	for (i = 0; i < 2; i++) {
++		struct gl_renderbuffer *rb = &glamo_fb->color_rb[i]->base;
++
++		/* only resize if size is changing */
++		if (rb && (rb->Width != width || rb->Height != height)) {
++			rb->AllocStorage(ctx, rb, rb->InternalFormat,
++		                         width, height);
++		}
++	}
++}
++
++
++static void glamoClear(struct gl_context *ctx, GLbitfield mask)
++{
++	glamoContext *gCtx;
++	struct gl_framebuffer *fb;
++	int i;
++
++	gCtx = GLAMO_CONTEXT(ctx);
++	fb = ctx->DrawBuffer;
++
++	printf("glamoClear (%f %f %f %f)\n", ctx->Color.ClearColor[0],
++	       ctx->Color.ClearColor[1], ctx->Color.ClearColor[2],
++	       ctx->Color.ClearColor[3]); fflush(stdout);
++
++	for (i = 0; i < fb->_NumColorDrawBuffers; i++) {
++
++		struct glamo_renderbuffer *grb;
++
++		grb = glamo_renderbuffer(fb->_ColorDrawBuffers[i]);
++
++		glamoDRMStartBurst(gCtx, GLAMO_REG_2D_DST_X);
++		glamoDRMAddData(gCtx, fb->_Xmin, 2);           /* dest X */
++		glamoDRMAddData(gCtx, fb->_Ymin, 2);           /* dest Y */
++		glamoDRMAddBO(gCtx, grb->bo);                  /* dest L/H */
++		glamoDRMAddData(gCtx, grb->pitch & 0x7ff, 2);  /* dest pitch */
++		glamoDRMAddData(gCtx, grb->height, 2);         /* dest height */
++		glamoDRMAddData(gCtx, fb->_Xmax-fb->_Xmin, 2); /* width */
++		glamoDRMAddData(gCtx, fb->_Ymax-fb->_Ymin, 2); /* height */
++		glamoDRMAddData(gCtx, 0x0000, 2);              /* patt L */
++		glamoDRMAddData(gCtx, 0x0000, 2);              /* patt H */
++		glamoDRMAddData(gCtx, gCtx->col_clear, 2);     /* FG colour */
++		glamoDRMDispatch(gCtx);
++
++		glamoDRMStartBurst(gCtx, GLAMO_REG_2D_COMMAND1);
++		glamoDRMAddData(gCtx, 0x0000, 2);    /* Cmd param 1 */
++		glamoDRMAddData(gCtx, 0xf0 << 8, 2); /* Cmd param 2 */
++		glamoDRMAddData(gCtx, 0x0000, 2);    /* Cmd param 3 */
++		glamoDRMDispatch(gCtx);
++
++	}
++}
++
++
++static void glamoClearColor(struct gl_context *ctx, const GLfloat color[4])
++{
++	struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
++	GLubyte col_byte[4];
++
++	printf("glamoClearColor (%f %f %f %f)\n", color[0], color[1], color[2],
++	       color[3]); fflush(stdout);
++
++	CLAMPED_FLOAT_TO_UBYTE(col_byte[0], color[0]);
++	CLAMPED_FLOAT_TO_UBYTE(col_byte[1], color[1]);
++	CLAMPED_FLOAT_TO_UBYTE(col_byte[2], color[2]);
++	CLAMPED_FLOAT_TO_UBYTE(col_byte[3], color[3]);
++
++	gCtx->col_clear = GLAMO_PACKCOLOR565(col_byte[0], col_byte[1],
++	                                     col_byte[2]);
++}
++
++
++static void glamoShadeModel(struct gl_context *ctx, GLenum mode)
++{
++	printf("glamoShadeModel\n"); fflush(stdout);
++}
++
++
++static void glamoViewport(struct gl_context *ctx, GLint x, GLint y,
++                          GLsizei width, GLsizei height )
++{
++	struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
++	__DRIcontext *driContext = gCtx->driContext;
++	void (*old_viewport)(struct gl_context *ctx, GLint x, GLint y,
++			 GLsizei w, GLsizei h);
++
++	if ( !driContext->driScreenPriv->dri2.enabled ) return;
++
++	/* TODO: Flush before fiddling with fake front buffer */
++
++	if ( ctx->DrawBuffer->Name == 0 ) {
++
++		glamo_update_renderbuffers(driContext,
++		                           driContext->driDrawablePriv);
++		if ( driContext->driDrawablePriv
++		                              != driContext->driReadablePriv ) {
++			glamo_update_renderbuffers(driContext,
++				                   driContext->driReadablePriv);
++		}
++
++	}
++
++	old_viewport = ctx->Driver.Viewport;
++	ctx->Driver.Viewport = NULL;
++	gCtx->driDrawable = driContext->driDrawablePriv;
++	ctx->Driver.Viewport = old_viewport;
++}
++
++
++static void glamoUploadMatrix(struct glamo_context *gCtx, uint16_t mreg,
++                              GLfloat *matrix)
++{
++	int i;
++	char *type;
++
++	switch ( mreg ) {
++	case G3D_MATRIX_MVP :
++		type = "MVP"; break;
++	case G3D_MATRIX_MV :
++		type = "MV"; break;
++	case G3D_MATRIX_IMVP :
++		type = "inverse MVP"; break;
++	default :
++		type = "unknown"; break;
++	}
++	printf("Uploading %s matrix...\n", type);
++
++	glamoDRMStartBurst(gCtx, mreg);
++	if ( mreg != G3D_MATRIX_IMVP ) {
++		for ( i=0; i<16; i++ ) {
++			glamoDRMAddData(gCtx, float7s16(matrix[i]), 4);
++		}
++	} else {
++		/* Normal matrix needs special treatment */
++		for ( i=0; i<3; i++ ) {
++			glamoDRMAddData(gCtx, float7s16(matrix[4*i]), 4);
++			glamoDRMAddData(gCtx, float7s16(matrix[4*i+1]), 4);
++			glamoDRMAddData(gCtx, float7s16(matrix[4*i+2]), 4);
++		}
++	}
++	glamoDRMDispatch(gCtx);
++}
++
++
++GLboolean glamoValidateState(struct gl_context *ctx, GLuint new_state)
++{
++	struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
++
++	if ( new_state & (_NEW_MODELVIEW|_NEW_PROJECTION) ) {
++
++		glamoUploadMatrix(gCtx, G3D_MATRIX_MVP,
++		                  ctx->_ModelProjectMatrix.m);
++
++		/* FIXME: The following two aren't needed unless lighting
++		 * is in use... */
++		glamoUploadMatrix(gCtx, G3D_MATRIX_MV,
++		                  ctx->ModelviewMatrixStack.Top->m);
++		_math_matrix_alloc_inv(&(ctx->_ModelProjectMatrix));
++		_math_matrix_analyse(&(ctx->_ModelProjectMatrix));
++		glamoUploadMatrix(gCtx, G3D_MATRIX_IMVP,
++		                  ctx->_ModelProjectMatrix.inv);
++	}
++
++	gCtx->new_state = 0;
++	return GL_TRUE;
++}
++
++
++static void glamoUpdateState(struct gl_context *ctx, GLbitfield new_state)
++{
++	struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
++
++	printf("glamoUpdateState\n");
++
++	_swrast_InvalidateState(ctx, new_state);
++	_swsetup_InvalidateState(ctx, new_state);
++	_vbo_InvalidateState(ctx, new_state);
++	_tnl_InvalidateState(ctx, new_state);
++	_ae_invalidate_state(ctx, new_state);
++
++	/* Make a note that some state has changed,
++	 * so that it can be sent to the GPU later. */
++	gCtx->new_state |= new_state;
++}
++
++
++static void glamoFlush(struct gl_context *ctx)
++{
++	printf("glamoFlush\n");
++}
++
++
++void glamoInitStateFuncs(struct gl_context *ctx)
++{
++	ctx->Driver.UpdateState       = glamoUpdateState;
++	ctx->Driver.Clear             = glamoClear;
++	ctx->Driver.ClearColor        = glamoClearColor;
++	ctx->Driver.ClearDepth        = NULL;
++	ctx->Driver.ClearStencil      = NULL;
++	ctx->Driver.AlphaFunc         = NULL;
++	ctx->Driver.BlendFuncSeparate = NULL;
++	ctx->Driver.ColorMask         = NULL;
++	ctx->Driver.CullFace          = NULL;
++	ctx->Driver.DepthMask         = NULL;
++	ctx->Driver.DepthFunc         = NULL;
++	ctx->Driver.DepthRange        = NULL;
++	ctx->Driver.DrawBuffer        = NULL;
++	ctx->Driver.Enable            = NULL;
++	ctx->Driver.FrontFace         = NULL;
++	ctx->Driver.Fogfv             = NULL;
++	ctx->Driver.Hint              = NULL;
++	ctx->Driver.Lightfv           = NULL;
++	ctx->Driver.LogicOpcode       = NULL;
++	ctx->Driver.PolygonMode       = NULL;
++	ctx->Driver.PolygonStipple    = NULL;
++	ctx->Driver.ReadBuffer        = NULL;
++	ctx->Driver.RenderMode        = NULL;
++	ctx->Driver.Scissor           = NULL;
++	ctx->Driver.ShadeModel        = glamoShadeModel;
++	ctx->Driver.LightModelfv      = NULL;
++	ctx->Driver.Viewport          = glamoViewport;
++	ctx->Driver.ResizeBuffers     = glamoResizeBuffers;
++	ctx->Driver.Flush             = glamoFlush;
++}
+diff --git a/src/mesa/drivers/dri/glamo/glamo_state.h b/src/mesa/drivers/dri/glamo/glamo_state.h
+new file mode 100644
+index 0000000..c3872c0
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_state.h
+@@ -0,0 +1,34 @@
++/*
++ * Direct Rendering Support for SMedia Glamo 336x/337x
++ *
++ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
++ * Roughly based on sis_state.h (c) 2003 Eric Anholt
++ *
++ * 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 AUTHORS 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.
++ */
++
++#ifndef __GLAMO_STATE_H
++#define __GLAMO_STATE_H
++
++#include "main/context.h"
++
++extern void glamoInitStateFuncs(struct gl_context *ctx);
++
++#endif   /* __GLAMO_STATE_H */
++
++/* kate: space-indent on; indent-width 3; mixedindent off; indent-mode cstyle; */
+diff --git a/src/mesa/drivers/dri/glamo/glamo_tris.c b/src/mesa/drivers/dri/glamo/glamo_tris.c
+new file mode 100644
+index 0000000..c45fe53
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_tris.c
+@@ -0,0 +1,310 @@
++/*
++ * Direct Rendering Support for SMedia Glamo 336x/337x
++ *
++ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
++ *
++ * 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 AUTHORS 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.
++ *
++ *
++ * Based on intel_tris.c, to which the following notice applies:
++ *
++ * Copyright 2003 Tungsten Graphics, 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 TUNGSTEN GRAPHICS 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.
++ *
++ */
++
++
++#include <glamo_bo.h>
++#include <glamo_bo_gem.h>
++#include <glamo_drm.h>
++
++#include "main/mtypes.h"
++#include "swrast/swrast.h"
++#include "tnl/t_context.h"
++#include "tnl/t_vertex.h"
++#include "tnl/t_pipeline.h"
++
++#include "glamo_tris.h"
++#include "glamo_context.h"
++
++
++static void glamoRunPipeline(struct gl_context *ctx)
++{
++	printf("glamoRunPipeline\n");
++
++	/* TODO: Emit state */
++
++	_tnl_run_pipeline(ctx);
++}
++
++
++static void glamoRenderStart(struct gl_context *ctx)
++{
++	struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
++
++	/* Decide which attributes will be used */
++	gCtx->vertex_attrs[0].attrib = _TNL_ATTRIB_POS;
++	gCtx->vertex_attrs[0].format = EMIT_4F;
++
++	gCtx->vertex_size = _tnl_install_attrs(ctx, gCtx->vertex_attrs, 1,
++	                                       NULL, 0);
++}
++
++
++static void glamoRenderFinish(struct gl_context *ctx)
++{
++	printf("glamoRenderFinish\n");
++}
++
++
++static void glamoPrimitiveNotify(struct gl_context *ctx, GLenum prim)
++{
++	printf("glamoPrimitiveNotify\n");
++}
++
++
++uint32_t *glamoGetPrimSpace(struct glamo_context *gCtx, unsigned int count)
++{
++	uint32_t *addr;
++
++	printf("glamoGetPrimSpace\n");
++
++	/* Check for space in the existing VB */
++	if (gCtx->prim.vb_bo == NULL || (gCtx->prim.current_offset +
++	                           count * gCtx->vertex_size) > GLAMO_VB_SIZE) {
++
++		/* Not enough space, or no VB existing. Start a new one... */
++		if (gCtx->prim.vb == NULL) {
++			printf("Allocated %i bytes\n", GLAMO_VB_SIZE);
++			gCtx->prim.vb = malloc(GLAMO_VB_SIZE);
++		}
++		gCtx->prim.vb_bo = glamo_bo_open(gCtx->glamoScreen->bom, 0,
++		                                 GLAMO_VB_SIZE, 4,
++		                                 GLAMO_GEM_DOMAIN_VRAM, 0);
++		gCtx->prim.start_offset = 0;
++		gCtx->prim.current_offset = 0;
++	}
++
++	addr = (uint32_t *)(gCtx->prim.vb + gCtx->prim.current_offset);
++	gCtx->prim.current_offset += gCtx->vertex_size * count;
++	gCtx->prim.count += count;
++
++	return addr;
++}
++
++
++#define COPY_DWORDS( j, vb, vertsize, v )	\
++do {						\
++   for ( j = 0 ; j < vertsize ; j++ ) {		\
++      vb[j] = ((GLuint *)v)[j];			\
++   }						\
++   vb += vertsize;				\
++} while (0)
++
++
++static void glamo_draw_triangle(struct glamo_context *gCtx,
++                                glamoVertexPtr v0, glamoVertexPtr v1,
++                                glamoVertexPtr v2)
++{
++	GLuint *vb = glamoGetPrimSpace(gCtx, 3);
++	int j;
++
++	COPY_DWORDS(j, vb, gCtx->vertex_size, v0);
++	COPY_DWORDS(j, vb, gCtx->vertex_size, v1);
++	COPY_DWORDS(j, vb, gCtx->vertex_size, v2);
++}
++
++
++static void glamo_draw_line(struct glamo_context *gCtx,
++                            glamoVertexPtr v0, glamoVertexPtr v1)
++{
++	GLuint *vb = glamoGetPrimSpace(gCtx, 2);
++	int j;
++
++	COPY_DWORDS(j, vb, gCtx->vertex_size, v0);
++	COPY_DWORDS(j, vb, gCtx->vertex_size, v1);
++}
++
++
++static void glamo_draw_point(struct glamo_context *gCtx, glamoVertexPtr v0)
++{
++	GLuint *vb = glamoGetPrimSpace(gCtx, 2);
++	int j;
++
++	COPY_DWORDS(j, vb, gCtx->vertex_size, v0);
++}
++
++
++#define TRI( a, b, c )                          \
++do {                                            \
++        glamo_draw_triangle(gCtx, a, b, c  );   \
++} while (0)
++
++
++#define QUAD( a, b, c, d )                      \
++printf("Drawing a quad\n");                     \
++do {                                            \
++        glamo_draw_triangle(gCtx, a, b, d);     \
++        glamo_draw_triangle(gCtx, b, c, d);     \
++} while (0)
++
++
++#define LINE(v0, v1)                            \
++do {                                            \
++        glamo_draw_line(gCtx, v0, v1);          \
++} while (0)
++
++
++#define POINT(v0)                               \
++do {                                            \
++        glamo_draw_point(gCtx, v0);             \
++} while (0)
++
++
++#define IND (0)
++#define TAG(x) x
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_offset
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_twoside
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_twoside_offset
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_unfilled
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_offset_unfilled
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_twoside_unfilled
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_twoside_offset_unfilled
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_fallback
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_offset_fallback
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_twoside_fallback
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_twoside_offset_fallback
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_unfilled_fallback
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_offset_unfilled_fallback
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_twoside_unfilled_fallback
++#include "tnl_dd/t_dd_tritmp.h"
++
++#define IND (0)
++#define TAG(x) x##_twoside_offset_unfilled_fallback
++#include "tnl_dd/t_dd_tritmp.h"
++
++
++static void init_rast_tab()
++{
++	init();
++	init_offset();
++	init_twoside();
++	init_twoside_offset();
++	init_unfilled();
++	init_offset_unfilled();
++	init_twoside_unfilled();
++	init_twoside_offset_unfilled();
++	init_fallback();
++	init_offset_fallback();
++	init_twoside_fallback();
++	init_twoside_offset_fallback();
++	init_unfilled_fallback();
++	init_offset_unfilled_fallback();
++	init_twoside_unfilled_fallback();
++	init_twoside_offset_unfilled_fallback();
++}
++
++
++void glamoInitTriFuncs(struct gl_context *ctx)
++{
++	TNLcontext *tnl = TNL_CONTEXT(ctx);
++	struct glamo_context *gCtx = GLAMO_CONTEXT(ctx);
++	static int firsttime = 1;
++
++	if (firsttime) {
++		init_rast_tab();
++		firsttime = 0;
++	}
++
++	gCtx->prim.start_offset = 0;
++	gCtx->prim.current_offset = 0;
++	gCtx->prim.vb_bo = NULL;
++	gCtx->prim.vb = NULL;
++	gCtx->prim.count = 0;
++
++	tnl->Driver.RunPipeline = glamoRunPipeline;
++	tnl->Driver.Render.Start = glamoRenderStart;
++	tnl->Driver.Render.Finish = glamoRenderFinish;
++	tnl->Driver.Render.PrimitiveNotify = glamoPrimitiveNotify;
++	tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple;
++	tnl->Driver.Render.BuildVertices = _tnl_build_vertices;
++	tnl->Driver.Render.CopyPV = _tnl_copy_pv;
++	tnl->Driver.Render.Interp = _tnl_interp;
++}
+diff --git a/src/mesa/drivers/dri/glamo/glamo_tris.h b/src/mesa/drivers/dri/glamo/glamo_tris.h
+new file mode 100644
+index 0000000..ea396c1
+--- /dev/null
++++ b/src/mesa/drivers/dri/glamo/glamo_tris.h
+@@ -0,0 +1,38 @@
++/*
++ * Direct Rendering Support for SMedia Glamo 336x/337x
++ *
++ * (c) 2009 Thomas White <taw@bitwiz.org.uk>
++ *
++ * 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 AUTHORS 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.
++ */
++
++#ifndef __GLAMO_TRIS_H
++#define __GLAMO_TRIS_H
++
++#include "main/mtypes.h"
++
++#include "glamo_context.h"
++
++/* Amount of space reserved for vertex submission */
++#define GLAMO_VB_SIZE (32*1024)
++
++extern void glamoInitTriFuncs(struct gl_context *ctx);
++extern uint32_t *glamoGetPrimSpace(struct glamo_context *gCtx,
++                                   unsigned int count);
++
++#endif   /* __GLAMO_TRIS_H */
+diff --git a/src/mesa/tnl_dd/t_dd_dmatmp.h b/src/mesa/tnl_dd/t_dd_dmatmp.h
+index 997fc0b..e3c9119 100644
+--- a/src/mesa/tnl_dd/t_dd_dmatmp.h
++++ b/src/mesa/tnl_dd/t_dd_dmatmp.h
+@@ -127,6 +127,8 @@ static void TAG(render_points_verts)( struct gl_context *ctx,
+ 	 currentsz = dmasz;
+       }
+ 
++      FLUSH();
++
+    } else {
+       fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+       return;
+@@ -162,6 +164,8 @@ static void TAG(render_lines_verts)( struct gl_context *ctx,
+ 	 currentsz = dmasz;
+       }
+ 
++      FLUSH();
++
+    } else {
+       fprintf(stderr, "%s - cannot draw primitive\n", __FUNCTION__);
+       return;
+@@ -191,7 +195,7 @@ static void TAG(render_line_strip_verts)( struct gl_context *ctx,
+ 	 TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
+ 	 currentsz = dmasz;
+       }
+- 
++
+       FLUSH();
+ 
+    } else {
+@@ -294,6 +298,8 @@ static void TAG(render_triangles_verts)( struct gl_context *ctx,
+       TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
+       currentsz = dmasz;
+    }
++
++   FLUSH();
+ }
+ 
+ 
+@@ -567,6 +573,8 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
+          TAG(emit_verts)( ctx, j, nr, ALLOC_VERTS(nr) );
+          currentsz = dmasz;
+       }
++
++      FLUSH();
+    }
+    else if (HAVE_ELTS) {
+       /* Hardware doesn't have a quad primitive type -- try to
+@@ -640,6 +648,8 @@ static void TAG(render_quads_verts)( struct gl_context *ctx,
+ 	 tmp = EMIT_VERTS(ctx, j + 1, 3, tmp);
+ 	 (void) tmp;
+       }
++
++      FLUSH();
+    }
+    else {
+       /* Vertices won't fit in a single buffer, should never happen.

+ 26 - 0
meta-oe/recipes-graphics/mesa/mesa-7.10.2/uclibc.patch

@@ -0,0 +1,26 @@
+Index: Mesa-7.9.1/src/mesa/main/imports.c
+===================================================================
+--- Mesa-7.9.1.orig/src/mesa/main/imports.c	2010-12-15 13:50:00.000000000 -0800
++++ Mesa-7.9.1/src/mesa/main/imports.c	2011-01-10 12:23:48.848656001 -0800
+@@ -757,7 +757,7 @@
+ float
+ _mesa_strtof( const char *s, char **end )
+ {
+-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
++#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && !defined(__UCLIBC__)
+    static locale_t loc = NULL;
+    if (!loc) {
+       loc = newlocale(LC_CTYPE_MASK, "C", NULL);
+Index: Mesa-7.9.1/src/glsl/strtod.c
+===================================================================
+--- Mesa-7.9.1.orig/src/glsl/strtod.c	2011-01-10 20:08:01.568656001 -0800
++++ Mesa-7.9.1/src/glsl/strtod.c	2011-01-10 20:08:39.898656001 -0800
+@@ -44,7 +44,7 @@
+ double
+ glsl_strtod(const char *s, char **end)
+ {
+-#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__)
++#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && !defined(__UCLIBC__)
+    static locale_t loc = NULL;
+    if (!loc) {
+       loc = newlocale(LC_CTYPE_MASK, "C", NULL);

+ 53 - 0
meta-oe/recipes-graphics/mesa/mesa-common.inc

@@ -0,0 +1,53 @@
+SECTION = "x11"
+
+DESCRIPTION = "An open source implementation of the OpenGL spec"
+HOMEPAGE = "http://mesa3d.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://docs/license.html;md5=7a3373c039b6b925c427755a4f779c1d"
+
+INC_PR = "r11"
+PE = "2"
+
+PROTO_DEPS = "xf86driproto glproto"
+LIB_DEPS = "virtual/libx11 libxext libxxf86vm libxdamage libxfixes"
+
+DEPENDS = "${PROTO_DEPS}  ${LIB_DEPS}"
+
+SRC_URI = "ftp://ftp.freedesktop.org/pub/mesa/${PV}/MesaLib-${PV}.tar.bz2;name=archive \
+          "
+S = "${WORKDIR}/Mesa-${PV}"
+
+PROVIDES = "virtual/libgl"
+
+inherit autotools pkgconfig
+
+EXTRA_OECONF = "--enable-glu \
+                --disable-glw \
+                --disable-glut \
+	       "
+
+inherit glx-use-tls
+
+# Package contents vary according to ${MACHINE_DRI_MODULES}.
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+PACKAGES =+ "libegl libegl-dev libegl-dbg libglu libglu-dev libosmesa libosmesa-dev libgl libgl-dev"
+FILES_${PN} += "${libdir}/dri/*.so"
+FILES_libegl = "${libdir}/libEGL.so.* ${libdir}/egl/*.so"
+FILES_libgl = "${libdir}/libGL.so.*"
+FILES_libglu = "${libdir}/libGLU.so.*"
+FILES_libosmesa = "${libdir}/libOSMesa.so.*"
+
+FILES_libegl-dev = "${libdir}/libEGL.* ${includedir}/EGL"
+FILES_libgl-dev = "${libdir}/libGL.* ${includedir}/GL"
+FILES_libglu-dev = "${libdir}/libGLU.* ${includedir}/GL/glu*.h"
+FILES_libosmesa-dev = "${libdir}/libOSMesa.* ${includedir}/osmesa.h"
+
+FILES_${PN}-dbg += "${libdir}/dri/.debug/*"
+FILES_libegl-dbg += "${libdir}/egl/.debug/*"
+
+NATIVE_INSTALL_WORKS = "1"
+do_install_append () {
+    install -d ${D}/${includedir}/GL
+    cp -pPr ${S}/include/GL/internal* ${D}/${includedir}/GL
+}

+ 10 - 0
meta-oe/recipes-graphics/mesa/mesa-dri.inc

@@ -0,0 +1,10 @@
+DEPENDS += "dri2proto expat libdrm makedepend-native"
+
+#not supported in oe-core base.bbclass
+#FILESPATHPKG =. "mesa-${PV}:mesa:"
+FILESPATH =. "${FILE_DIRNAME}/mesa:${FILE_DIRNAME}/mesa-${PV}:"
+
+# most of our targets do not have DRI so will use mesa-xlib
+DEFAULT_PREFERENCE = "-1"
+
+EXTRA_OECONF += " --with-driver=dri --with-dri-drivers=swrast,${MACHINE_DRI_MODULES}"

+ 4 - 0
meta-oe/recipes-graphics/mesa/mesa-dri_7.10.2.bb

@@ -0,0 +1,4 @@
+require mesa-common.inc
+require mesa-${PV}.inc
+require mesa-dri.inc
+PR = "${INC_PR}.0"

+ 2 - 0
meta-oe/recipes-graphics/mesa/mesa-xlib.inc

@@ -0,0 +1,2 @@
+FILESPATHPKG =. "mesa-${PV}:mesa:"
+EXTRA_OECONF += " --with-driver=xlib"

+ 4 - 0
meta-oe/recipes-graphics/mesa/mesa-xlib_7.10.2.bb

@@ -0,0 +1,4 @@
+require mesa-common.inc
+require mesa-${PV}.inc
+require mesa-xlib.inc
+PR = "${INC_PR}.0"

+ 6 - 0
meta-oe/recipes-graphics/mesa/mesa_7.10.2.bb

@@ -0,0 +1,6 @@
+# This is a dummy package so OE can use the poky mesa files
+require mesa-dri_${PV}.bb
+
+PR = "${INC_PR}.0"
+
+EXTRA_OECONF += "--disable-egl"

+ 40 - 0
meta-oe/recipes-graphics/tasks/task-fonts-truetype.bb

@@ -0,0 +1,40 @@
+DESCRIPTION = "Install one of these tasks to get support for truetype fonts."
+SECTION = "fonts"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${TOPDIR}/meta-shr/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+PV = "1.0"
+PR = "r0"
+
+inherit task
+
+PACKAGES += "\
+  ${PN}-core \
+  ${PN}-chinese \
+  ${PN}-japanese \
+"
+
+RRECOMMENDS_task-fonts-truetype = "\
+  ${PN}-core \
+  ${PN}-chinese \
+  ${PN}-japanese \
+"
+
+RDEPENDS_task-fonts-truetype-core = "\
+  fontconfig-utils \
+  \
+  ttf-dejavu-common \
+  ttf-dejavu-sans \
+  ttf-dejavu-sans-mono \
+"
+#  ttf-dejavu-serif \
+
+RDEPENDS_task-fonts-truetype-chinese = "\
+  ${PN}-core \
+  ttf-arphic-uming \
+"
+
+RDEPENDS_task-fonts-truetype-japanese = "\
+  ${PN}-core \
+  ttf-sazanami-gothic \
+  ttf-sazanami-mincho \
+"

+ 23 - 0
meta-oe/recipes-graphics/ttf-fonts/ttf-liberation_0.2.bb

@@ -0,0 +1,23 @@
+require ttf.inc
+
+DESCRIPTION = "Liberation fonts - TTF Version"
+HOMEPAGE = "https://www.redhat.com/promo/fonts/"
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
+                    file://License.txt;md5=5b171c5100029d884fcea21d9a2b7543 \
+"
+
+PR = "r3"
+
+SRC_URI = "http://fedorahosted.org/liberation-fonts/export/807b6dfd069b998cd9b4d3158da98817ef23c79d/F-9/liberation-fonts-ttf-3.tar.gz"
+S = "${WORKDIR}/liberation-fonts-${PV}"
+
+PACKAGES = "${PN}-dbg ttf-liberation-mono ttf-liberation-sans ttf-liberation-serif"
+RRECOMMENDS_${PN}-dbg = ""
+
+FILES_ttf-liberation-mono  = "${datadir}/fonts/truetype/*Mono*"
+FILES_ttf-liberation-sans  = "${datadir}/fonts/truetype/*Sans*"
+FILES_ttf-liberation-serif = "${datadir}/fonts/truetype/*Serif*"
+
+SRC_URI[md5sum] = "77728078a17e39f7c242b42c3bf6feb8"
+SRC_URI[sha256sum] = "174cf27c57612971434ec8cc4a52bfd37bad8408e9b9219539c6d5113df6ff8f"

+ 1 - 0
meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/iphone3g/pointercal.xinput

@@ -0,0 +1 @@
+xinput set-int-prop "Touchscreen" "Evdev Axis Calibration" 32 -102 4739 6 7321;

+ 2 - 0
meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/nokia900/pointercal.xinput

@@ -0,0 +1,2 @@
+xinput set-int-prop "Touchscreen" "Evdev Axis Calibration" 32 204 3897 3763 178;
+

+ 2 - 0
meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/om-gta01/pointercal.xinput

@@ -0,0 +1,2 @@
+xinput set-int-prop "Touchscreen" "Evdev Axis Calibration" 32 107 918 911 98
+xinput set-int-prop "Touchscreen" "Evdev Axes Swap" 8 1

+ 2 - 0
meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/om-gta02/pointercal.xinput

@@ -0,0 +1,2 @@
+xinput set-int-prop "Touchscreen" "Evdev Axis Calibration" 32 107 918 911 98
+xinput set-int-prop "Touchscreen" "Evdev Axes Swap" 8 1

+ 1 - 0
meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput/pointercal.xinput

@@ -0,0 +1 @@
+# replace with valid machine specific pointercal.xinput

+ 21 - 0
meta-oe/recipes-graphics/xinput-calibrator/pointercal-xinput_0.0.bb

@@ -0,0 +1,21 @@
+DESCRIPTION = "Touchscreen calibration data from xinput-calibrator"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${TOPDIR}/meta-shr/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SECTION = "base"
+
+PR = "r2"
+SRC_URI = "file://pointercal.xinput"
+S = "${WORKDIR}"
+
+do_install() {
+	# Only install file if it has a contents
+	if [ -s ${S}/pointercal.xinput ]; then
+	        install -d ${D}${sysconfdir}/
+	        install -m 0644 ${S}/pointercal.xinput ${D}${sysconfdir}/
+	fi
+}
+
+ALLOW_EMPTY_${PN} = "1"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+CONFFILES_${PN} = "${sysconfdir}/pointercal.xinput"

+ 8 - 0
meta-oe/recipes-graphics/xinput-calibrator/xinput-calibrator.inc

@@ -0,0 +1,8 @@
+DESCRIPTION = "A generic touchscreen calibration program for X.Org"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/xinput_calibrator"
+LICENSE = "MIT/X11"
+DEPENDS = "virtual/libx11 libxi"
+RDEPENDS_${PN} = "xinput pointercal-xinput"
+INC_PR = "r7"
+
+inherit autotools

+ 17 - 0
meta-oe/recipes-graphics/xinput-calibrator/xinput-calibrator_0.6.1.bb

@@ -0,0 +1,17 @@
+require xinput-calibrator.inc
+
+LIC_FILES_CHKSUM = "file://src/calibrator.cpp;endline=22;md5=998e238a7638a7446eaeb02398f691fc"
+SRC_URI = "git://github.com/tias/xinput_calibrator.git;protocol=git"
+
+SRCREV = "d2ce98b3f638667dd64b6d718721379b2dc750a7"
+PR = "${INC_PR}.0"
+S = "${WORKDIR}/git/"
+
+do_install_append() {
+        install -d ${D}${bindir}
+        install -m 0755 scripts/xinput_calibrator_pointercal.sh ${D}${bindir}/xinput_calibrator_once.sh
+        ln -s ${bindir}/xinput_calibrator_x11 ${D}${bindir}/xinput_calibrator
+        install -d ${D}${datadir}/applications/
+        install -m 0755 scripts/xinput_calibrator.desktop ${D}${datadir}/applications/xinput-calibrator.desktop
+        install -m 0755 scripts/xinput_calibrator_get_hal_calibration.sh ${D}${bindir}/xinput_calibrator_get_hal_calibration.sh
+}

+ 10 - 0
meta-oe/recipes-graphics/xorg-app/rgb_1.0.4.bb

@@ -0,0 +1,10 @@
+require xorg-app-common.inc
+DEPENDS += " xproto util-macros"
+LIC_FILES_CHKSUM = "file://COPYING;md5=ef598adbe241bd0b0b9113831f6e249a"
+PE = "1"
+PR = "${INC_PR}.0"
+
+SRC_URI[md5sum] = "35c6cccbf25a872bdd62bfcb1a73d951"
+SRC_URI[sha256sum] = "80887da011ad086fff88bfd16c6d9d5ac7da45ef1bc9d0c192a6f370423370f1"
+
+FILES_${PN} += "${datadir}/X11"

+ 8 - 0
meta-oe/recipes-graphics/xorg-app/xinput_1.5.3.bb

@@ -0,0 +1,8 @@
+require xorg-app-common.inc
+LIC_FILES_CHKSUM = "file://COPYING;md5=22c34ea36136407a77702a8b784f9bd0"
+DESCRIPTION = "a utility to configure and test XInput devices"
+DEPENDS += " libxi"
+PR = "${INC_PR}.0"
+
+SRC_URI[md5sum] = "1e2f0ad4f3fa833b65c568907f171d28"
+SRC_URI[sha256sum] = "6aade131cecddaeefc39ddce1dd5e8473f6039c2e4efbfd9fbb5ee2a75885c76"

+ 15 - 0
meta-oe/recipes-graphics/xorg-app/xorg-app-common.inc

@@ -0,0 +1,15 @@
+DESCRIPTION = "X application"
+HOMEPAGE = "http://www.x.org/"
+SECTION = "x11/apps"
+LICENSE = "MIT-X"
+DEPENDS = "util-macros-native virtual/libx11"
+
+INC_PR = "r5"
+
+SRC_URI = "${XORG_MIRROR}/individual/app/${BPN}-${PV}.tar.bz2"
+
+S = "${WORKDIR}/${BPN}-${PV}"
+
+inherit autotools pkgconfig
+
+FILES_${PN} += "  /usr/lib/X11/${BPN} /usr/share/X11/app-defaults/"

+ 12 - 0
meta-oe/recipes-graphics/xorg-doc/xorg-doc-common.inc

@@ -0,0 +1,12 @@
+DESCRIPTION = "X documentation"
+HOMEPAGE = "http://www.x.org"
+SECTION = "x11/docs"
+LICENSE = "MIT-X"
+
+SRC_URI = "${XORG_MIRROR}/individual/doc/${BPN}-${PV}.tar.bz2"
+
+S = "${WORKDIR}/${BPN}-${PV}"
+
+INC_PR = "r1"
+
+inherit autotools pkgconfig

+ 8 - 0
meta-oe/recipes-graphics/xorg-doc/xorg-sgml-doctools_1.7.bb

@@ -0,0 +1,8 @@
+require xorg-doc-common.inc
+PE = "1"
+PR = "${INC_PR}.0"
+
+SRC_URI[md5sum] = "2588efb3f49f7fc6ecf41ce42e0b2e5e"
+SRC_URI[sha256sum] = "84fd94e5c50556e6f77501485f8a48724cf3c95c6d58480bc280258ba14580c8"
+
+FILES_${PN} += " /usr/share/sgml/X11"

+ 17 - 0
meta-oe/recipes-graphics/xorg-driver/xf86-input-keyboard_1.6.0.bb

@@ -0,0 +1,17 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- keyboard input driver"
+
+DESCRIPTION = "keyboard is an Xorg input driver for keyboards. The \
+driver supports the standard OS-provided keyboard interface.  The driver \
+functions as a keyboard input device, and may be used as the X server's \
+core keyboard."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=ea2099d24ac9e316a6d4b9f20b3d4e10"
+
+DEPENDS += " kbproto"
+PE = "1"
+PR = "${INC_PR}.0"
+
+SRC_URI[md5sum] = "e2abe9f13e526a73cb68a7d257546eba"
+SRC_URI[sha256sum] = "c46c790fec905d696573b7a374b10ab8b4389112a8f69993fe011006c99e858e"

+ 17 - 0
meta-oe/recipes-graphics/xorg-driver/xf86-input-mouse_1.7.0.bb

@@ -0,0 +1,17 @@
+require xorg-driver-input.inc
+
+SUMMARY = "X.Org X server -- mouse input driver"
+
+DESCRIPTION = "mouse is an Xorg input driver for mice. The driver \
+supports most available mouse types and interfaces.  The mouse driver \
+functions as a pointer input device, and may be used as the X server's \
+core pointer. Multiple mice are supported by multiple instances of this \
+driver."
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=237eb1d1a602d29ef2af62d8fba60f19"
+
+PE = "1"
+PR = "${INC_PR}.0"
+
+SRC_URI[md5sum] = "7f31472689c15b6de62eff04d0fb57d7"
+SRC_URI[sha256sum] = "4e989542b5e9e0c5f9087288b18e70de1064dd27c83a4bc6dce58f3ea9d74994"

+ 11 - 0
meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/10-x11-input-tslib.fdi

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deviceinfo version="0.2">
+  <device>
+    <match key="info.capabilities" contains="input.touchpad">
+      <merge key="input.x11_driver" type="string">tslib</merge>
+    </match>
+    <match key="info.capabilities" contains="input.touchscreen">
+      <merge key="input.x11_driver" type="string">tslib</merge>
+    </match>
+  </device>
+</deviceinfo>

+ 5 - 0
meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/99-xf86-input-tslib.rules

@@ -0,0 +1,5 @@
+# create /dev/input/touchscreenX symlink, tag xf86-input-tslib as driver
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen%n", ENV{x11_driver}="tslib"
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen%n", ENV{x11_driver}="tslib"
+
+

+ 20 - 0
meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/double-free-crash.patch

@@ -0,0 +1,20 @@
+xorg-server-1.7.3/hw/xfree86/common/xf86Helper.c contains this code
+causing a double free crash on chvt or exit:
+
+    /* This should *really* be handled in drv->UnInit(dev) call instead, but
+     * if the driver forgets about it make sure we free it or at least crash
+     * with flying colors */
+    if (pInp->private)
+	xfree(pInp->private);
+Index: xf86-input-tslib-0.0.6/src/tslib.c
+===================================================================
+--- xf86-input-tslib-0.0.6.orig/src/tslib.c
++++ xf86-input-tslib-0.0.6/src/tslib.c
+@@ -435,6 +435,7 @@ xf86TslibUninit(InputDriverPtr drv, Inpu
+ 	xf86TslibControlProc(pInfo->dev, DEVICE_OFF);
+ 	ts_close(priv->ts);
+ 	xfree(pInfo->private);
++	pInfo->private = NULL;
+ 	xf86DeleteInput(pInfo, 0);
+ }
+ 

+ 34 - 0
meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib/xserver-174-XGetPointerControl.patch

@@ -0,0 +1,34 @@
+From Grazvydas Ignotas
+
+At least xserver 1.7.4 crashes on XGetPointerControl request because of xf86-input-tslib:
+
+Program received signal SIGSEGV, Segmentation fault.
+#0  0x000355e0 in ProcGetPointerControl (client=0x4a2e58) at devices.c:2122
+#1  0x00062fa8 in Dispatch () at dispatch.c:439
+#2  0x00022444 in main (argc=4, argv=0xbeebedc4, envp=0xbeebedd8) at main.c:285
+
+This happens because ptrfeed field is not set in device structure from tslib.
+To fix this, call InitPtrFeedbackClassDeviceStruct() during DEVICE_INIT to get necessary setup done (as done in other input drivers).
+
+---
+diff -ur xf86-input-tslib-0.0.6/src/tslib.c xf86-input-tslib-0.0.6_/src/tslib.c
+--- xf86-input-tslib-0.0.6/src/tslib.c	2010-02-09 12:23:22.000000000 +0200
++++ xf86-input-tslib-0.0.6_/src/tslib.c	2010-02-09 12:37:33.000000000 +0200
+@@ -103,8 +103,6 @@
+ static void
+ PointerControlProc(DeviceIntPtr dev, PtrCtrl * ctrl)
+ {
+-	ErrorF("%s\n", __FUNCTION__);
+-	return;
+ }
+ 
+ static Bool
+@@ -406,6 +404,8 @@
+ 		xf86MotionHistoryAllocate(pInfo);
+ #endif
+ 
++		if (!InitPtrFeedbackClassDeviceStruct(device, PointerControlProc))
++			return !Success;
+ 		break;
+ 
+ 	case DEVICE_ON:

+ 32 - 0
meta-oe/recipes-graphics/xorg-driver/xf86-input-tslib_0.0.6.bb

@@ -0,0 +1,32 @@
+require xorg-driver-input.inc
+DESCRIPTION = "X.Org X server -- tslib input driver"
+DEPENDS += "tslib"
+RRECOMMENDS_${PN} += "tslib-calibrate"
+RSUGGESTS_${PN} += "hal"
+
+# derived from xf86-input-void, that's why I kept MIT-X, but it's not clear, see COPYING
+LIC_FILES_CHKSUM = "file://src/tslib.c;endline=28;md5=bd62eaef222dcf5cd59e490a12bd795e \
+                    file://COPYING;md5=4641deddaa80fe7ca88e944e1fd94a94"
+
+PR = "${INC_PR}.1"
+
+SRC_URI = "http://www.pengutronix.de/software/xf86-input-tslib/download/xf86-input-tslib-${PV}.tar.bz2;name=archive \
+           file://double-free-crash.patch \
+           file://10-x11-input-tslib.fdi \
+           file://xserver-174-XGetPointerControl.patch \
+           file://99-xf86-input-tslib.rules \
+"
+SRC_URI[md5sum] = "b7a4d2f11637ee3fcf432e044b1d017f"
+SRC_URI[sha256sum] = "5f46fdef095a6e44a69e0f0b57c7d665224b26d990d006611236d8332e85b105"
+
+do_configure_prepend() {
+        rm -rf ${S}/m4/ || true
+}
+do_install_append() {
+        install -d ${D}/${datadir}/hal/fdi/policy/20thirdparty
+        install -m 0644 ${WORKDIR}/10-x11-input-tslib.fdi ${D}/${datadir}/hal/fdi/policy/20thirdparty
+        install -d ${D}/lib/udev/rules.d
+        install -m 0644 ${WORKDIR}/99-xf86-input-tslib.rules ${D}/lib/udev/rules.d/
+}
+
+FILES_${PN} += "${datadir}/hal /lib/udev"

+ 9 - 0
meta-oe/recipes-graphics/xorg-driver/xf86-video-fbdev_0.4.2.bb

@@ -0,0 +1,9 @@
+require xorg-driver-video.inc
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8cbd99fff773f92e844948f74ef0df8"
+
+DESCRIPTION = "X.Org X server -- fbdev display driver"
+PE = "1"
+PR = "${INC_PR}.1"
+
+SRC_URI[md5sum] = "53a533d9e0c2da50962282526bace074"
+SRC_URI[sha256sum] = "93b271b4b41d7e5ca108849a583b9523e96c51813d046282285355b7001f82d5"

+ 66 - 0
meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo/0001-glamo-drm-define-GLAMO_CMDQ_MAX_COUNT-instead-of-mag.patch

@@ -0,0 +1,66 @@
+From e2d0f9a3ba7f36b0b8ac8d736dd76da6e5e07f38 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Fri, 29 Oct 2010 11:19:08 +0200
+Subject: [PATCH] glamo-drm: define GLAMO_CMDQ_MAX_COUNT instead of magic constant 1024
+
+* fix check for full queue, because size != count here
+* make sure we have enough space in queue for 2 resp. 4 more commands in
+  GlamoDRMAddCommand resp. GlamoDRMAddCommandBO
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ src/glamo-drm.c |   16 +++++++++++-----
+ 1 files changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/src/glamo-drm.c b/src/glamo-drm.c
+index aac93bb..01e8510 100644
+--- a/src/glamo-drm.c
++++ b/src/glamo-drm.c
+@@ -32,6 +32,8 @@
+ 
+ #include "glamo.h"
+ 
++/* How many commands can be stored before forced dispatch */
++#define GLAMO_CMDQ_MAX_COUNT 1024
+ 
+ /* Submit the prepared command sequence to the kernel */
+ void GlamoDRMDispatch(GlamoPtr pGlamo)
+@@ -60,7 +62,7 @@ void GlamoDRMDispatch(GlamoPtr pGlamo)
+ 
+ void GlamoDRMAddCommand(GlamoPtr pGlamo, uint16_t reg, uint16_t val)
+ {
+-	if ( pGlamo->cmdq_drm_used == pGlamo->cmdq_drm_size ) {
++	if ( pGlamo->cmdq_drm_used >= GLAMO_CMDQ_MAX_COUNT - 2 ) {
+ 		xf86DrvMsg(pGlamo->pScreen->myNum, X_INFO,
+ 		           "Forced command cache flush.\n");
+ 		GlamoDRMDispatch(pGlamo);
+@@ -74,7 +76,8 @@ void GlamoDRMAddCommand(GlamoPtr pGlamo, uint16_t reg, uint16_t val)
+ 
+ void GlamoDRMAddCommandBO(GlamoPtr pGlamo, uint16_t reg, struct glamo_bo *bo)
+ {
+-	if ( pGlamo->cmdq_drm_used == pGlamo->cmdq_drm_size ) {
++	if ( pGlamo->cmdq_drm_used >= GLAMO_CMDQ_MAX_COUNT - 4 ||
++	       pGlamo->cmdq_obj_used >= GLAMO_CMDQ_MAX_COUNT) {
+ 		xf86DrvMsg(pGlamo->pScreen->myNum, X_INFO,
+ 		           "Forced command cache flush.\n");
+ 		GlamoDRMDispatch(pGlamo);
+@@ -98,10 +101,13 @@ void GlamoDRMAddCommandBO(GlamoPtr pGlamo, uint16_t reg, struct glamo_bo *bo)
+ 
+ void GlamoDRMInit(GlamoPtr pGlamo)
+ {
+-	pGlamo->cmdq_objs = malloc(1024);
+-	pGlamo->cmdq_obj_pos = malloc(1024);
++	pGlamo->cmdq_objs = malloc(GLAMO_CMDQ_MAX_COUNT);
++	pGlamo->cmdq_obj_pos = malloc(GLAMO_CMDQ_MAX_COUNT);
+ 	pGlamo->cmdq_obj_used = 0;
+ 	pGlamo->cmdq_drm_used = 0;
+-	pGlamo->cmdq_drm_size = 4 * 1024;
++	/* we're using 2bytes per entry (uint16_t) that's why we need to allocate
++	 * GLAMO_CMDQ_MAX_COUNT * 2 bytes
++	 */
++	pGlamo->cmdq_drm_size = 2 * GLAMO_CMDQ_MAX_COUNT;
+ 	pGlamo->cmdq_drm = malloc(pGlamo->cmdq_drm_size);
+ }
+-- 
+1.7.3.2
+

+ 19 - 0
meta-oe/recipes-graphics/xorg-driver/xf86-video-glamo_git.bb

@@ -0,0 +1,19 @@
+require xorg-driver-video.inc
+DESCRIPTION = "X.Org X server -- Glamo display driver with KMS support"
+DEPENDS += "libdrm"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=d8cbd99fff773f92e844948f74ef0df8"
+
+RDEPENDS_${PN} = "xserver-xorg-extension-dri xserver-xorg-extension-dri2 xserver-xorg-extension-glx mesa-dri"
+PE = "2"
+PV = "1.0.0+gitr${SRCPV}"
+PR = "${INC_PR}.5"
+
+SRC_URI = "git://git.openmoko.org/git/xf86-video-glamo.git;protocol=git;branch=master \
+           file://0001-glamo-drm-define-GLAMO_CMDQ_MAX_COUNT-instead-of-mag.patch \
+          "
+
+S = "${WORKDIR}/git"
+SRCREV = "16af3c00195adc68cbd508e3613be4b2349260b3"
+
+EXTRA_OECONF = " --enable-kms "

+ 40 - 0
meta-oe/recipes-graphics/xorg-driver/xorg-driver-common.inc

@@ -0,0 +1,40 @@
+DESCRIPTION = "X driver"
+HOMEPAGE = "http://www.x.org"
+SECTION = "x11/drivers"
+LICENSE = "MIT-X"
+INC_PR = "r15"
+
+DEPENDS = "randrproto xorg-server xproto"
+
+SRC_URI = "${XORG_MIRROR}/individual/driver/${BPN}-${PV}.tar.bz2"
+
+S = "${WORKDIR}/${BPN}-${PV}"
+
+FILES_${PN} += " ${libdir}/xorg/modules"
+FILES_${PN}-dbg +=  "${libdir}/xorg/modules/*/.debug"
+
+inherit autotools pkgconfig
+
+TARGET_CPPFLAGS += "-I${STAGING_DIR_HOST}/usr/include/xorg"
+
+# Another sucky behavor from Xorg configure scripts.
+# They use AC_CHECK_FILE to check for DRI headers. Yuck!
+# Of course this will blow up when cross compiling.
+
+do_configure_prepend() {
+	incdir=${layout_includedir}/xorg
+	for f in dri.h sarea.h dristruct.h exa.h damage.h xf86Module.h; do
+		path="$incdir/$f"
+		if [ -f "${STAGING_DIR_HOST}/$path" ]; then
+			p=`echo "$path" | sed 'y%*+%pp%;s%[^_[:alnum:]]%_%g'`
+			eval "export ac_cv_file_$p=yes"
+		fi
+	done
+}
+
+# FIXME: We don't want to include the libtool archives (*.la) from modules
+# directory, as they serve no useful purpose. Upstream should fix Makefile.am
+do_install_append() {
+	find ${D}${libdir}/xorg/modules -regex ".*\.la$" | xargs rm -f --
+}
+

+ 4 - 0
meta-oe/recipes-graphics/xorg-driver/xorg-driver-input.inc

@@ -0,0 +1,4 @@
+include xorg-driver-common.inc
+
+DEPENDS = "randrproto inputproto xserver-xorg xproto"
+

+ 4 - 0
meta-oe/recipes-graphics/xorg-driver/xorg-driver-video.inc

@@ -0,0 +1,4 @@
+include xorg-driver-common.inc
+
+DEPENDS = "randrproto renderproto videoproto xextproto fontsproto xserver-xorg xproto"
+

+ 55 - 0
meta-oe/recipes-graphics/xorg-lib/liblbxutil-1.1.0/mkg3states-1.1.patch

@@ -0,0 +1,55 @@
+diff -uNr liblbxutil-1.1.0.orig/configure.ac liblbxutil-1.1.0/configure.ac
+--- liblbxutil-1.1.0.orig/configure.ac	2009-12-04 23:52:04.000000000 +0100
++++ liblbxutil-1.1.0/configure.ac	2009-12-16 10:45:00.000000000 +0100
+@@ -50,4 +50,5 @@
+ 
+ AC_OUTPUT([Makefile
+ 	   src/Makefile
++	   src/image/Makefile
+ 	   lbxutil.pc])
+diff -uNr liblbxutil-1.1.0.orig/src/image/Makefile.am liblbxutil-1.1.0/src/image/Makefile.am
+--- liblbxutil-1.1.0.orig/src/image/Makefile.am	1970-01-01 01:00:00.000000000 +0100
++++ liblbxutil-1.1.0/src/image/Makefile.am	2009-12-16 10:45:00.000000000 +0100
+@@ -0,0 +1,15 @@
++# evil hack
++CFLAGS=$(CFLAGS_FOR_BUILD)
++CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
++LDFLAGS=$(LDFLAGS_FOR_BUILD)
++
++CC=$(CC_FOR_BUILD)
++LIBTOOL = @LIBTOOL@ --tag=CC
++
++noinst_PROGRAMS = mkg3states
++
++mkg3states_SOURCES =				\
++	mkg3states.c
++
++mkg3states_CFLAGS=$(CFLAGS_FOR_BUILD)
++mkg3states_LDFLAGS=$(LDFLAGS_FOR_BUILD)
+diff -uNr liblbxutil-1.1.0.orig/src/Makefile.am liblbxutil-1.1.0/src/Makefile.am
+--- liblbxutil-1.1.0.orig/src/Makefile.am	2009-12-16 10:48:11.000000000 +0100
++++ liblbxutil-1.1.0/src/Makefile.am	2009-12-16 10:46:47.000000000 +0100
+@@ -3,10 +3,7 @@
+ AM_CFLAGS = $(CWARNFLAGS) $(LBXUTIL_CFLAGS)
+ INCLUDES = -I$(top_srcdir)/include
+ 
+-noinst_PROGRAMS = mkg3states
+-
+-mkg3states_SOURCES =				\
+-	$(srcdir)/image/mkg3states.c
++SUBDIRS = image
+ 
+ liblbxutil_la_SOURCES =				\
+ 	$(srcdir)/lbx_zlib/reqstats.h		\
+@@ -38,9 +35,8 @@
+ 
+ $(srcdir)/image/dfaxg42d.c: g3states.h
+ 
+-g3states.h: mkg3states
+-	-rm -f g3states.h
+-	$(AM_V_GEN) ./mkg3states -c > g3states.h_ && mv g3states.h_ g3states.h
++g3states.h: image/mkg3states
++	$(AM_V_GEN) ./image/mkg3states -c > g3states.h_ && mv g3states.h_ g3states.h
+ 
+ liblbxutil_la_LDFLAGS = -version-number 1:0:0 -no-undefined
+ 

+ 14 - 0
meta-oe/recipes-graphics/xorg-lib/liblbxutil_1.1.0.bb

@@ -0,0 +1,14 @@
+require xorg-lib-common.inc
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=b0d5bdc98f7ebab3b6c3791d9bf40907"
+
+DESCRIPTION = "XFIXES Extension"
+DEPENDS += " xextproto xproto zlib"
+PE = "1"
+PR = "${INC_PR}.0"
+
+SRC_URI += "file://mkg3states-1.1.patch"
+SRC_URI[md5sum] = "273329a78c2e9ea189ac416c7fde94a1"
+SRC_URI[sha256sum] = "c6b6ff7858ec619cafa8205debca6bf78c5610a2844a782ed643c7fd017cf8ae"
+
+export CC_FOR_BUILD = "gcc"

+ 19 - 0
meta-oe/recipes-graphics/xorg-lib/libx11-1.4.1/keysymdef_include.patch

@@ -0,0 +1,19 @@
+diff -uNr libX11-1.3.6.orig//configure.ac libX11-1.3.6/configure.ac
+--- libX11-1.3.6.orig//configure.ac	2010-09-20 08:04:16.000000000 +0200
++++ libX11-1.3.6/configure.ac	2010-09-28 16:29:26.000000000 +0200
+@@ -355,7 +355,14 @@
+ # Find keysymdef.h
+ #
+ AC_MSG_CHECKING([keysym definitions])
+-KEYSYMDEFDIR=`$PKG_CONFIG --variable=includedir xproto`/X11
++AC_ARG_WITH(keysymdefdir,
++        AC_HELP_STRING([--with-keysymdefdir=DIR], [The location of keysymdef.h]),
++        KEYSYMDEFDIR=$withval, KEYSYMDEFDIR="")
++
++if test x$KEYSYMDEFDIR = x; then
++	KEYSYMDEFDIR=`$PKG_CONFIG --variable=includedir xproto`/X11
++fi
++
+ FILES="keysymdef.h XF86keysym.h Sunkeysym.h DECkeysym.h HPkeysym.h"
+ for i in $FILES; do
+     if test -f "$KEYSYMDEFDIR/$i"; then

+ 29 - 0
meta-oe/recipes-graphics/xorg-lib/libx11-1.4.1/x11_disable_makekeys.patch

@@ -0,0 +1,29 @@
+Index: libX11-1.3.4/src/util/Makefile.am
+===================================================================
+--- libX11-1.3.4.orig/src/util/Makefile.am
++++ libX11-1.3.4/src/util/Makefile.am
+@@ -1,24 +1 @@
+-
+-noinst_PROGRAMS=makekeys
+-
+-makekeys_CFLAGS = \
+-	$(X11_CFLAGS) \
+-	$(CWARNFLAGS)
+-
+-CC = @CC_FOR_BUILD@
+-CPPFLAGS = @CPPFLAGS_FOR_BUILD@
+-CFLAGS = @CFLAGS_FOR_BUILD@
+-LDFLAGS = @LDFLAGS_FOR_BUILD@
+-
+ EXTRA_DIST = mkks.sh
+-
+-if LINT
+-# Check source code with tools like lint & sparse
+-
+-ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+-		$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
+-
+-lint:
+-	$(LINT) $(ALL_LINT_FLAGS) makekeys.c
+-
+-endif LINT

+ 19 - 0
meta-oe/recipes-graphics/xorg-lib/libx11-1.4.3/keysymdef_include.patch

@@ -0,0 +1,19 @@
+diff -uNr libX11-1.3.6.orig//configure.ac libX11-1.3.6/configure.ac
+--- libX11-1.3.6.orig//configure.ac	2010-09-20 08:04:16.000000000 +0200
++++ libX11-1.3.6/configure.ac	2010-09-28 16:29:26.000000000 +0200
+@@ -355,7 +355,14 @@
+ # Find keysymdef.h
+ #
+ AC_MSG_CHECKING([keysym definitions])
+-KEYSYMDEFDIR=`$PKG_CONFIG --variable=includedir xproto`/X11
++AC_ARG_WITH(keysymdefdir,
++        AC_HELP_STRING([--with-keysymdefdir=DIR], [The location of keysymdef.h]),
++        KEYSYMDEFDIR=$withval, KEYSYMDEFDIR="")
++
++if test x$KEYSYMDEFDIR = x; then
++	KEYSYMDEFDIR=`$PKG_CONFIG --variable=includedir xproto`/X11
++fi
++
+ FILES="keysymdef.h XF86keysym.h Sunkeysym.h DECkeysym.h HPkeysym.h"
+ for i in $FILES; do
+     if test -f "$KEYSYMDEFDIR/$i"; then

+ 29 - 0
meta-oe/recipes-graphics/xorg-lib/libx11-1.4.3/x11_disable_makekeys.patch

@@ -0,0 +1,29 @@
+Index: libX11-1.3.4/src/util/Makefile.am
+===================================================================
+--- libX11-1.3.4.orig/src/util/Makefile.am
++++ libX11-1.3.4/src/util/Makefile.am
+@@ -1,24 +1 @@
+-
+-noinst_PROGRAMS=makekeys
+-
+-makekeys_CFLAGS = \
+-	$(X11_CFLAGS) \
+-	$(CWARNFLAGS)
+-
+-CC = @CC_FOR_BUILD@
+-CPPFLAGS = @CPPFLAGS_FOR_BUILD@
+-CFLAGS = @CFLAGS_FOR_BUILD@
+-LDFLAGS = @LDFLAGS_FOR_BUILD@
+-
+ EXTRA_DIST = mkks.sh
+-
+-if LINT
+-# Check source code with tools like lint & sparse
+-
+-ALL_LINT_FLAGS=$(LINT_FLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+-		$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS)
+-
+-lint:
+-	$(LINT) $(ALL_LINT_FLAGS) makekeys.c
+-
+-endif LINT

+ 52 - 0
meta-oe/recipes-graphics/xorg-lib/libx11.inc

@@ -0,0 +1,52 @@
+require xorg-lib-common.inc
+
+DESCRIPTION = "Base X libs."
+COMMON_DEPENDS = "util-macros xtrans libxdmcp libxau \
+                  bigreqsproto xproto xextproto xcmiscproto \
+                  xf86bigfontproto kbproto inputproto xproto-native"
+
+DEPENDS = "libxcb ${COMMON_DEPENDS}"		  
+DEPENDS_virtclass-native = "${COMMON_DEPENDS}"
+DEPENDS_virtclass-nativesdk = "${COMMON_DEPENDS}"
+
+FILESPATHPKG .= ":libx11-${PV}:libx11"
+BBCLASSEXTEND = "native nativesdk"
+PROVIDES = "virtual/libx11"
+PE = "1"
+
+PACKAGES =+ "${PN}-xcb"
+
+FILES_${PN} += "${datadir}/X11/XKeysymDB ${datadir}/X11/XErrorDB ${libdir}/X11/Xcms.txt"
+FILES_${PN}-xcb += "${libdir}/libX11-xcb.so.*"
+FILES_${PN}-locale += "${datadir}/X11/locale ${libdir}/X11/locale"
+
+XORG_PN = "libX11"
+
+EXTRA_OECONF += " --with-xcb --with-keysymdefdir=${STAGING_INCDIR}/X11 --with-groff=no --with-ps2pdf=no --with-fop=no"
+EXTRA_OECONF_virtclass-native = " --without-xcb --with-groff=no --with-ps2pdf=no --with-fop=no"
+EXTRA_OECONF_virtclass-nativesdk = " --without-xcb --with-groff=no --with-ps2pdf=no --with-fop=no"
+
+# Below option is added to overcome the GCC bug on ARM
+# see http://gcc.gnu.org/PR42981 for further details.
+# We could potentially take it off when its fixed in gcc 4.5
+
+CFLAGS_append_arm = " -fforward-propagate "
+
+SRC_URI += " file://keysymdef_include.patch \
+             file://x11_disable_makekeys.patch \
+"
+
+do_compile_prepend() {
+	(
+		unset CC LD CXX CCLD CFLAGS CPPFLAGS LDFLAGS CXXFLAGS
+		cd src/util; 
+		mv makekeys.c.orig makekeys.c || true
+		# MIN_REHASH 10 is only in 1.0.1
+		sed -i -e 's:MIN_REHASH 10:MIN_REHASH 16:g' makekeys.c
+		sed -i -e 's:MIN_REHASH 15:MIN_REHASH 16:g' makekeys.c
+		touch makekeys-makekeys.o ; ${BUILD_CC} ${BUILD_CFLAGS} -I${STAGING_INCDIR_NATIVE} makekeys.c -o makekeys
+		# mv to stop it getting rebuilt
+		mv makekeys.c makekeys.c.orig
+		cd ../../
+	) || exit 1
+}

+ 12 - 0
meta-oe/recipes-graphics/xorg-lib/libx11_1.4.1.bb

@@ -0,0 +1,12 @@
+require libx11.inc
+
+LICENSE = "MIT & MIT-style & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=172255dee66bb0151435b2d5d709fcf7"
+
+#--without-xcb is not an option anymore
+#http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=15e5eaf62897b3179d1fbe457cb19f886f0449f8
+DEPENDS_virtclass-native = "libxcb-native ${COMMON_DEPENDS}"
+PR = "${INC_PR}.0"
+
+SRC_URI[md5sum] = "4603bdbce1bd73cbc140de402fe6ed24"
+SRC_URI[sha256sum] = "70f4e0f798645a0f269f362bfdbd4c7934dae3a2dd9ecbad28d6ede414f63ce2"

+ 12 - 0
meta-oe/recipes-graphics/xorg-lib/libx11_1.4.3.bb

@@ -0,0 +1,12 @@
+require libx11.inc
+
+LICENSE = "MIT & MIT-style & BSD"
+LIC_FILES_CHKSUM = "file://COPYING;md5=172255dee66bb0151435b2d5d709fcf7"
+
+#--without-xcb is not an option anymore
+#http://cgit.freedesktop.org/xorg/lib/libX11/commit/?id=15e5eaf62897b3179d1fbe457cb19f886f0449f8
+DEPENDS_virtclass-native = "libxcb-native ${COMMON_DEPENDS}"
+PR = "${INC_PR}.0"
+
+SRC_URI[md5sum] = "85e942627aaa020813e0eb8433353563"
+SRC_URI[sha256sum] = "38b5ddd93291714a46a02cb8a5dd94b995a04ed76a608551c44d1598e113635a"

+ 28 - 0
meta-oe/recipes-graphics/xorg-lib/libxaw_1.0.9.bb

@@ -0,0 +1,28 @@
+require xorg-lib-common.inc
+DESCRIPTION = "X Athena Widget Set"
+DEPENDS += "xproto virtual/libx11 libxext xextproto libxt libxmu libxpm libxp printproto libxau"
+
+LIC_FILES_CHKSUM = "file://COPYING;md5=f1beacbc336a5a256bb28dbfcf01c2be"
+
+PE = "1"
+PR = "${INC_PR}.0"
+
+SRC_URI[md5sum] = "ccc57478c41b7a75b9702241b889b1d4"
+SRC_URI[sha256sum] = "a83977546b78e24ac5dca86affc10b6404a87c16272405b05386feca1a2db037"
+
+# disable docs as groff detection doesn't work on some hosts while cross compilling
+EXTRA_OECONF += " --disable-docs "
+
+do_install_append () {
+        ln -sf libXaw6.so.6 ${D}${libdir}/libXaw.so.6
+        ln -sf libXaw7.so.7 ${D}${libdir}/libXaw.so.7
+        ln -sf libXaw7.so.7 ${D}${libdir}/libXaw.so
+}
+
+PACKAGES =+ "libxaw6 libxaw7 libxaw8"
+
+FILES_libxaw6 = "${libdir}/libXaw*.so.6*"
+FILES_libxaw7 = "${libdir}/libXaw*.so.7*"
+FILES_libxaw8 = "${libdir}/libXaw8.so.8*"
+
+XORG_PN = "libXaw"

+ 22 - 0
meta-oe/recipes-graphics/xorg-lib/libxfixes_5.0.bb

@@ -0,0 +1,22 @@
+SUMMARY = "XFixes: X Fixes extension library."
+
+DESCRIPTION = "X applications have often needed to work around various \
+shortcomings in the core X window system.  This extension is designed to \
+provide the minimal server-side support necessary to eliminate problems \
+caused by these workarounds."
+
+require xorg-lib-common.inc
+
+LICENSE = "MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=3c1ce42c334a6f5cccb0277556a053e0"
+
+DEPENDS += "virtual/libx11 xproto fixesproto xextproto"
+PE = "1"
+PR = "${INC_PR}.0"
+
+SRC_URI[md5sum] = "678071bd7f9f7467e2fc712d81022318"
+SRC_URI[sha256sum] = "537a2446129242737a35db40081be4bbcc126e56c03bf5f2b142b10a79cda2e3"
+
+BBCLASSEXTEND = "native"
+
+XORG_PN = "libXfixes"

+ 21 - 0
meta-oe/recipes-graphics/xorg-lib/libxi_1.4.2.bb

@@ -0,0 +1,21 @@
+require xorg-lib-common.inc
+
+SUMMARY = "XI: X Input extension library"
+
+DESCRIPTION = "libxi is an extension to the X11 protocol to support \
+input devices other than the core X keyboard and pointer.  It allows \
+client programs to select input from these devices independently from \
+each other and independently from the core devices."
+
+LICENSE = "MIT & MIT-style"
+LIC_FILES_CHKSUM = "file://COPYING;md5=17b064789fab936a1c58c4e13d965b0f \
+                    file://src/XIGetDevFocus.c;endline=23;md5=cdfb0d435a33ec57ea0d1e8e395b729f"
+
+DEPENDS += "libxext inputproto"
+PE = "1"
+PR = "${INC_PR}.0"
+
+SRC_URI[md5sum] = "3d14f7bfc4a4335cf0144de9b67a5444"
+SRC_URI[sha256sum] = "272b8041efc0a0203fb0ba33481ddec989539aed862181b58c8c3e410e325691"
+
+XORG_PN = "libXi"

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików