--- libdrm-2.4.37+git20120713.992e2afd.orig/debian/compat +++ libdrm-2.4.37+git20120713.992e2afd/debian/compat @@ -0,0 +1 @@ +9 --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/copyright +++ libdrm-2.4.37+git20120713.992e2afd/debian/copyright @@ -0,0 +1,316 @@ +This package was downloaded from +http://dri.freedesktop.org/libdrm/ + +It was debianized by Marcelo E. Magallon on +Fri, 19 Aug 2005 21:11:18 -0600. + + + Copyright 2005 Adam Jackson. + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation on the rights to use, copy, modify, merge, + publish, distribute, sub license, and/or sell copies of the Software, + and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice (including the + next paragraph) shall be included in all copies or substantial + portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NON-INFRINGEMENT. IN NO EVENT SHALL ADAM JACKSON BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + Copyright 2000 Precision Insight, Inc., Cedar Park, Texas. + Copyright 2000 VA Linux Systems, Inc., Sunnyvale, 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. + + + Copyright (c) 2007-2008 Dave Airlie + Copyright (c) 2007-2008 Jakob Bornecrantz + Copyright (c) 2008 Red Hat Inc. + Copyright (c) 2007-2008 Tungsten Graphics, Inc., Cedar Park, TX., USA + Copyright (c) 2007-2009 Intel Corporation + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice 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. + + + Copyright 2002-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, 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 + 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. + + + Copyright 2000 Gareth Hughes + Copyright 2002 Frank C. Earl + Copyright 2002-2003 Leif Delgass + 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 + THE COPYRIGHT OWNER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + Copyright 2000 VA Linux Systems, Inc., Sunnyvale, California. + Copyright 2005 Stephane Marchesin. + 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 + VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + + Copyright 2004 Felix Kuehling + 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 FELIX KUEHLING BE LIABLE FOR + ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + Copyright 2005 Eric Anholt + Copyright © 2007-2008 Intel Corporation + 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, 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. + + + Copyright 1998-2003 VIA Technologies, Inc. All Rights Reserved. + Copyright 2001-2003 S3 Graphics, Inc. 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 + VIA, S3 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. + + + Copyright © 2009 VMware, Inc., Palo Alto, CA., USA + Copyright © 2007-2009 Red Hat Inc. + Copyright © 2007 Intel Corporation + Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA + Copyright © 2008 Dave Airlie + Copyright © 2008 Jérôme Glisse + Copyright © 2008 Nicolai Haehnle + All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sub license, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice (including the + next paragraph) shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. + + + Copyright (C) 1999 Wittawat Yamwong + + 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 + WITTAWAT YAMWONG, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,? + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR? + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE? + OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + Copyright (c) 2007 Nouveau Project + + 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. + + + Copyright 2010 Jerome 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 + on the rights to use, copy, modify, merge, publish, distribute, sub + license, and/or sell copies of the Software, and to permit persons to whom + the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice (including the next + paragraph) shall be included in all copies or substantial portions of the + Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + USE OR OTHER DEALINGS IN THE SOFTWARE. --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libkms1.symbols +++ libdrm-2.4.37+git20120713.992e2afd/debian/libkms1.symbols @@ -0,0 +1,16 @@ +libkms.so.1 libkms1 #MINVER# +| libkms-private + dumb_create@Base 0 1 + intel_create@Base 0 1 + kms_bo_create@Base 0 + kms_bo_destroy@Base 0 + kms_bo_get_prop@Base 0 + kms_bo_map@Base 0 + kms_bo_unmap@Base 0 + kms_create@Base 0 + kms_destroy@Base 0 + kms_get_prop@Base 0 + linux_create@Base 0 1 + nouveau_create@Base 0 1 + radeon_create@Base 2.4.24 1 + vmwgfx_create@Base 0 1 --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/rules +++ libdrm-2.4.37+git20120713.992e2afd/debian/rules @@ -0,0 +1,117 @@ +#!/usr/bin/make -f + +### +### Configuration, decide what to build +### + +# Some variables: +DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) +DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) + +# Linux vs. the rest: +ifeq (linux, $(DEB_HOST_ARCH_OS)) + confflags += --enable-udev + confflags += --enable-libkms + LIBKMS = yes + confflags += --enable-vmwgfx-experimental-api + confflags += --enable-nouveau + NOUVEAU = yes + confflags += --enable-radeon + RADEON = yes +else + confflags += --disable-udev + confflags += --disable-libkms + LIBKMS = no + confflags += --disable-vmwgfx-experimental-api + confflags += --disable-nouveau + NOUVEAU = no + confflags += --disable-radeon + RADEON = no +endif + +# Intel is only on x86: +ifneq (,$(filter amd64 i386,$(DEB_HOST_ARCH_CPU))) +ifneq (,$(filter linux kfreebsd,$(DEB_HOST_ARCH_OS))) + INTEL = yes +endif +endif +ifeq ($(INTEL), yes) + confflags += --enable-intel +else + confflags += --disable-intel +endif + +# Omap is only on arm +ifneq (,$(filter arm,$(DEB_HOST_ARCH_CPU))) + OMAP = yes +endif +ifeq ($(OMAP), yes) + confflags += --enable-omap-experimental-api +else + confflags += --disable-omap-experimental-api +endif + +### +### Actual build +### + +override_dh_auto_configure: + dh_auto_configure -- --enable-static=yes $(confflags) + +override_dh_auto_test: + dh_auto_test || echo "Test suite failure, but keeping on anyway" + +override_dh_auto_install: + dh_auto_install --destdir=debian/tmp + +override_dh_install: + find debian/tmp -name '*.la' -delete + # Temporary rules for libdrm_nouveau1a + rm debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdrm_nouveau.a + ln -s libdrm_nouveau.so.1 \ + debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdrm_nouveau1.so + ln -sf libdrm_nouveau.so.2 \ + debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libdrm_nouveau.so + dh_install --fail-missing + +override_dh_strip: + dh_strip -plibdrm2 --dbg-package=libdrm2-dbg +ifeq ($(INTEL), yes) + dh_strip -plibdrm-intel1 --dbg-package=libdrm-intel1-dbg +endif +ifeq ($(NOUVEAU), yes) + dh_strip -plibdrm-nouveau1a --dbg-package=libdrm-nouveau1a-dbg + dh_strip -plibdrm-nouveau2 --dbg-package=libdrm-nouveau2-dbg +endif +ifeq ($(RADEON), yes) + dh_strip -plibdrm-radeon1 --dbg-package=libdrm-radeon1-dbg +endif +ifeq ($(OMAP), yes) + dh_strip -plibdrm-omap1 --dbg-package=libdrm-omap1-dbg +endif +ifeq ($(LIBKMS), yes) + dh_strip -p libkms1 --dbg-package=libkms1-dbg +endif + dh_strip -s --remaining-packages + +override_dh_makeshlibs: + dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.31)' -- -c4 +ifeq ($(INTEL), yes) + dh_makeshlibs -plibdrm-intel1 -V'libdrm-intel1 (>= 2.4.32)' -- -c4 +endif +ifeq ($(NOUVEAU), yes) + dh_makeshlibs -plibdrm-nouveau1a -V'libdrm-nouveau1a (>= 2.4.23)' -- -c4 + dh_makeshlibs -plibdrm-nouveau2 -V'libdrm-nouveau2 (>= 2.4.34)' -- -c4 +endif +ifeq ($(RADEON), yes) + dh_makeshlibs -plibdrm-radeon1 -V'libdrm-radeon1 (>= 2.4.31)' -- -c4 +endif +ifeq ($(OMAP), yes) + dh_makeshlibs -plibdrm-omap1 -V'libdrm-omap1' -- -c4 +endif +ifeq ($(LIBKMS), yes) + dh_makeshlibs -plibkms1 -V'libkms1' -- -c4 +endif + +%: + dh $@ --with quilt,autoreconf --builddirectory=build/ --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm-omap1.symbols +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm-omap1.symbols @@ -0,0 +1,16 @@ +libdrm_omap.so.1 libdrm-omap1 #MINVER# + omap_bo_cpu_fini@Base 2.4.33 + omap_bo_cpu_prep@Base 2.4.33 + omap_bo_del@Base 2.4.33 + omap_bo_dmabuf@Base 2.4.34 + omap_bo_from_name@Base 2.4.33 + omap_bo_get_name@Base 2.4.33 + omap_bo_handle@Base 2.4.33 + omap_bo_map@Base 2.4.33 + omap_bo_new@Base 2.4.33 + omap_bo_new_tiled@Base 2.4.33 + omap_bo_size@Base 2.4.33 + omap_device_del@Base 2.4.33 + omap_device_new@Base 2.4.33 + omap_get_param@Base 2.4.33 + omap_set_param@Base 2.4.33 --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm-radeon1.symbols +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm-radeon1.symbols @@ -0,0 +1,62 @@ +libdrm_radeon.so.1 libdrm-radeon1 #MINVER# +| libdrm-radeon-private + bof_array@Base 0 1 + bof_array_append@Base 0 1 + bof_array_get@Base 0 1 + bof_array_size@Base 0 1 + bof_blob@Base 0 1 + bof_blob_size@Base 0 1 + bof_blob_value@Base 0 1 + bof_decref@Base 0 1 + bof_dump_file@Base 0 1 + bof_incref@Base 0 1 + bof_int32@Base 0 1 + bof_int32_value@Base 0 1 + bof_load_file@Base 0 1 + bof_object@Base 0 1 + bof_object_get@Base 0 1 + bof_object_set@Base 0 1 + bof_print@Base 0 1 + bof_string@Base 0 1 + radeon_bo_debug@Base 2.4.17 + radeon_bo_get_handle@Base 2.4.17 + radeon_bo_get_src_domain@Base 2.4.17 + radeon_bo_get_tiling@Base 2.4.17 + radeon_bo_is_busy@Base 2.4.17 + radeon_bo_is_referenced_by_cs@Base 2.4.17 + radeon_bo_is_static@Base 2.4.17 + radeon_bo_manager_gem_ctor@Base 2.4.17 + radeon_bo_manager_gem_dtor@Base 2.4.17 + radeon_bo_map@Base 2.4.17 + radeon_bo_open@Base 2.4.17 + radeon_bo_ref@Base 2.4.17 + radeon_bo_set_tiling@Base 2.4.17 + radeon_bo_unmap@Base 2.4.17 + radeon_bo_unref@Base 2.4.17 + radeon_bo_wait@Base 2.4.17 + radeon_cs_begin@Base 2.4.17 + radeon_cs_create@Base 2.4.17 + radeon_cs_destroy@Base 2.4.17 + radeon_cs_emit@Base 2.4.17 + radeon_cs_end@Base 2.4.17 + radeon_cs_erase@Base 2.4.17 + radeon_cs_get_id@Base 2.4.20 + radeon_cs_manager_gem_ctor@Base 2.4.17 + radeon_cs_manager_gem_dtor@Base 2.4.17 + radeon_cs_need_flush@Base 2.4.17 + radeon_cs_print@Base 2.4.17 + radeon_cs_set_limit@Base 2.4.17 + radeon_cs_space_add_persistent_bo@Base 2.4.17 + radeon_cs_space_check@Base 2.4.17 + radeon_cs_space_check_with_bo@Base 2.4.17 + radeon_cs_space_reset_bos@Base 2.4.17 + radeon_cs_space_set_flush@Base 2.4.17 + radeon_cs_write_reloc@Base 2.4.17 + radeon_gem_get_kernel_name@Base 2.4.17 + radeon_gem_get_reloc_in_cs@Base 2.4.20 + radeon_gem_name_bo@Base 2.4.17 + radeon_gem_set_domain@Base 2.4.17 + radeon_surface_best@Base 2.4.31 + radeon_surface_init@Base 2.4.31 + radeon_surface_manager_free@Base 2.4.31 + radeon_surface_manager_new@Base 2.4.31 --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm-dev.install +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm-dev.install @@ -0,0 +1,4 @@ +usr/include/* +usr/lib/*/lib*.a +usr/lib/*/lib*.so +usr/lib/*/pkgconfig/* --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/README.source +++ libdrm-2.4.37+git20120713.992e2afd/debian/README.source @@ -0,0 +1,55 @@ +------------------------------------------------------ +Quick Guide To Patching This Package For The Impatient +------------------------------------------------------ + +1. Make sure you have quilt installed +2. Unpack the package as usual with "dpkg-source -x" +3. Run the "patch" target in debian/rules +4. Create a new patch with "quilt new" (see quilt(1)) +5. Edit all the files you want to include in the patch with "quilt edit" + (see quilt(1)). +6. Write the patch with "quilt refresh" (see quilt(1)) +7. Run the "clean" target in debian/rules + +Alternatively, instead of using quilt directly, you can drop the patch in to +debian/patches and add the name of the patch to debian/patches/series. + +While building from git, dpkg-source can complain about symlinks vs. +normal files mismatches. To work around this issue, before uploading, +and without committing: + + find -type l | while read dest; do src=$(readlink -f $dest); rm $dest; cp $src $dest; done + +------------------------------------ +Guide To The X Strike Force Packages +------------------------------------ + +The X Strike Force team maintains X packages in git repositories on +git.debian.org in the pkg-xorg subdirectory. Most upstream packages +are actually maintained in git repositories as well, so they often +just need to be pulled into git.debian.org in a "upstream-*" branch. +Otherwise, the upstream sources are manually installed in the Debian +git repository. + +The .orig.tar.gz upstream source file could be generated using this +"upstream-*" branch in the Debian git repository but it is actually +copied from upstream tarballs directly. + +Due to X.org being highly modular, packaging all X.org applications +as their own independent packages would have created too many Debian +packages. For this reason, some X.org applications have been grouped +into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils, +x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils. +Most packages, including the X.org server itself and all libraries +and drivers are, however maintained independently. + +The Debian packaging is added by creating the "debian-*" git branch +which contains the aforementioned "upstream-*" branch plus the debian/ +repository files. +When a patch has to be applied to the Debian package, two solutions +are involved: +* If the patch is available in one of the upstream branches, it + may be git'cherry-picked into the Debian repository. In this + case, it appears directly in the .diff.gz. +* Otherwise, the patch is added to debian/patches/ which is managed + with quilt as documented in /usr/share/doc/quilt/README.source. --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm-intel1.install +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm-intel1.install @@ -0,0 +1 @@ +usr/lib/*/libdrm_intel.so.1* --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm-nouveau2.symbols +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm-nouveau2.symbols @@ -0,0 +1,41 @@ +libdrm_nouveau.so.2 libdrm-nouveau2 #MINVER# + abi16_bo_info@Base 2.4.34 + abi16_bo_init@Base 2.4.34 + abi16_chan_nv04@Base 2.4.34 + abi16_chan_nvc0@Base 2.4.34 + abi16_engobj@Base 2.4.34 + abi16_ntfy@Base 2.4.34 + nouveau_bo_map@Base 2.4.34 + nouveau_bo_name_get@Base 2.4.34 + nouveau_bo_name_ref@Base 2.4.34 + nouveau_bo_new@Base 2.4.34 + nouveau_bo_ref@Base 2.4.34 + nouveau_bo_wait@Base 2.4.34 + nouveau_bo_wrap@Base 2.4.34 + nouveau_bufctx_del@Base 2.4.34 + nouveau_bufctx_mthd@Base 2.4.34 + nouveau_bufctx_new@Base 2.4.34 + nouveau_bufctx_refn@Base 2.4.34 + nouveau_bufctx_reset@Base 2.4.34 + nouveau_client_del@Base 2.4.34 + nouveau_client_new@Base 2.4.34 + nouveau_debug@Base 2.4.34 + nouveau_device_del@Base 2.4.34 + nouveau_device_open@Base 2.4.34 + nouveau_device_open_existing@Base 2.4.34 + nouveau_device_wrap@Base 2.4.34 + nouveau_getparam@Base 2.4.34 + nouveau_object_del@Base 2.4.34 + nouveau_object_find@Base 2.4.34 + nouveau_object_new@Base 2.4.34 + nouveau_pushbuf_bufctx@Base 2.4.34 + nouveau_pushbuf_data@Base 2.4.34 + nouveau_pushbuf_del@Base 2.4.34 + nouveau_pushbuf_kick@Base 2.4.34 + nouveau_pushbuf_new@Base 2.4.34 + nouveau_pushbuf_refd@Base 2.4.34 + nouveau_pushbuf_refn@Base 2.4.34 + nouveau_pushbuf_reloc@Base 2.4.34 + nouveau_pushbuf_space@Base 2.4.34 + nouveau_pushbuf_validate@Base 2.4.34 + nouveau_setparam@Base 2.4.34 --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm-nouveau1a.lintian-overrides +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm-nouveau1a.lintian-overrides @@ -0,0 +1 @@ +libdrm-nouveau1a: package-name-doesnt-match-sonames libdrm-nouveau1 --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm2.install +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm2.install @@ -0,0 +1 @@ +usr/lib/*/libdrm.so.2* --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm-omap1.install +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm-omap1.install @@ -0,0 +1 @@ +usr/lib/*/libdrm_omap.so.1* --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/control +++ libdrm-2.4.37+git20120713.992e2afd/debian/control @@ -0,0 +1,245 @@ +Source: libdrm +Priority: optional +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Debian X Strike Force +Uploaders: Cyril Brulebois +Build-Depends: + debhelper (>= 9), + dh-autoreconf, + quilt, + libx11-dev, + pkg-config, + libpthread-stubs0-dev, + libudev-dev [linux-any], + libpciaccess-dev, +Standards-Version: 3.9.2 +Section: libs +Vcs-Git: git://git.debian.org/git/pkg-xorg/lib/libdrm +Vcs-Browser: http://git.debian.org/?p=pkg-xorg/lib/libdrm.git + +Package: libdrm-dev +Section: libdevel +Architecture: any +Depends: + libdrm2 (= ${binary:Version}), + libdrm-intel1 (= ${binary:Version}) [amd64 i386 kfreebsd-amd64 kfreebsd-i386], + libdrm-radeon1 (= ${binary:Version}) [linux-any], + libdrm-nouveau1a (= ${binary:Version}) [linux-any], + libdrm-nouveau2 (= ${binary:Version}) [linux-any], + libdrm-omap1 (= ${binary:Version}) [any-arm], + libkms1 (= ${binary:Version}) [linux-any], + ${misc:Depends}, +Replaces: + linux-libc-dev (<< 2.6.32-10) +Description: Userspace interface to kernel DRM services -- development files + This library implements the userspace interface to the kernel DRM + services. DRM stands for "Direct Rendering Manager", which is the + kernelspace portion of the "Direct Rendering Infrastructure" (DRI). + The DRI is currently used on Linux to provide hardware-accelerated + OpenGL drivers. + . + This package provides the development environment for libdrm. + +Package: libdrm2 +Section: libs +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Description: Userspace interface to kernel DRM services -- runtime + This library implements the userspace interface to the kernel DRM + services. DRM stands for "Direct Rendering Manager", which is the + kernelspace portion of the "Direct Rendering Infrastructure" (DRI). + The DRI is currently used on Linux to provide hardware-accelerated + OpenGL drivers. + . + This package provides the runtime environment for libdrm. + +Package: libdrm2-dbg +Section: debug +Priority: extra +Architecture: any +Depends: + libdrm2 (= ${binary:Version}), + ${misc:Depends}, +Multi-Arch: same +Description: Userspace interface to kernel DRM services -- debugging symbols + This library implements the userspace interface to the kernel DRM + services. DRM stands for "Direct Rendering Manager", which is the + kernelspace portion of the "Direct Rendering Infrastructure" (DRI). + The DRI is currently used on Linux to provide hardware-accelerated + OpenGL drivers. + . + This package provides debugging symbols for the libdrm2 package. + +Package: libdrm-intel1 +Section: libs +Architecture: amd64 i386 kfreebsd-amd64 kfreebsd-i386 +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Pre-Depends: ${misc:Pre-Depends} +Multi-Arch: same +Description: Userspace interface to intel-specific kernel DRM services -- runtime + This library implements the userspace interface to the intel-specific kernel + DRM services. DRM stands for "Direct Rendering Manager", which is the + kernelspace portion of the "Direct Rendering Infrastructure" (DRI). The DRI is + currently used on Linux to provide hardware-accelerated OpenGL drivers. + +Package: libdrm-intel1-dbg +Section: debug +Priority: extra +Architecture: amd64 i386 kfreebsd-amd64 kfreebsd-i386 +Depends: + libdrm-intel1 (= ${binary:Version}), + ${misc:Depends}, +Multi-Arch: same +Description: Userspace interface to intel-specific kernel DRM services -- debugging symbols + This library implements the userspace interface to the kernel DRM services. + DRM stands for "Direct Rendering Manager", which is the kernelspace portion + of the "Direct Rendering Infrastructure" (DRI). The DRI is currently used on + Linux to provide hardware-accelerated OpenGL drivers. + . + This package provides the debugging symbols for the libdrm-intel1 package. + +Package: libdrm-nouveau1a +Section: libs +Architecture: linux-any +Depends: ${shlibs:Depends}, + ${misc:Depends}, +Conflicts: libdrm-nouveau1 +Pre-Depends: ${misc:Pre-Depends} +Multi-Arch: same +Description: Userspace interface to nouveau-specific kernel DRM services -- runtime + This library implements the userspace interface to the nouveau-specific kernel + DRM services. DRM stands for "Direct Rendering Manager", which is the + kernelspace portion of the "Direct Rendering Infrastructure" (DRI). The DRI is + currently used on Linux to provide hardware-accelerated OpenGL drivers. + +Package: libdrm-nouveau1a-dbg +Section: debug +Priority: extra +Architecture: linux-any +Depends: libdrm-nouveau1a (= ${binary:Version}), + ${misc:Depends}, +Conflicts: libdrm-nouveau1-dbg +Multi-Arch: same +Description: Userspace interface to nouveau-specific kernel DRM -- debugging symbols + This library implements the userspace interface to the kernel DRM services. + DRM stands for "Direct Rendering Manager", which is the kernelspace portion + of the "Direct Rendering Infrastructure" (DRI). The DRI is currently used on + Linux to provide hardware-accelerated OpenGL drivers. + . + This package provides the debugging symbols for the libdrm-nouveau1a package. + +Package: libdrm-nouveau2 +Section: libs +Architecture: linux-any +Depends: ${shlibs:Depends}, + ${misc:Depends}, +Pre-Depends: ${misc:Pre-Depends} +Multi-Arch: same +Description: Userspace interface to nouveau-specific kernel DRM services -- runtime + This library implements the userspace interface to the nouveau-specific kernel + DRM services. DRM stands for "Direct Rendering Manager", which is the + kernelspace portion of the "Direct Rendering Infrastructure" (DRI). The DRI is + currently used on Linux to provide hardware-accelerated OpenGL drivers. + +Package: libdrm-nouveau2-dbg +Section: debug +Priority: extra +Architecture: linux-any +Depends: libdrm-nouveau2 (= ${binary:Version}), + ${misc:Depends}, +Multi-Arch: same +Description: Userspace interface to nouveau-specific kernel DRM -- debugging symbols + This library implements the userspace interface to the kernel DRM services. + DRM stands for "Direct Rendering Manager", which is the kernelspace portion + of the "Direct Rendering Infrastructure" (DRI). The DRI is currently used on + Linux to provide hardware-accelerated OpenGL drivers. + . + This package provides the debugging symbols for the libdrm-nouveau2 package. + +Package: libdrm-radeon1 +Section: libs +Architecture: linux-any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Pre-Depends: ${misc:Pre-Depends} +Multi-Arch: same +Description: Userspace interface to radeon-specific kernel DRM services -- runtime + This library implements the userspace interface to the radeon-specific kernel + DRM services. DRM stands for "Direct Rendering Manager", which is the + kernelspace portion of the "Direct Rendering Infrastructure" (DRI). The DRI is + currently used on Linux to provide hardware-accelerated OpenGL drivers. + +Package: libdrm-radeon1-dbg +Section: debug +Priority: extra +Architecture: linux-any +Depends: + libdrm-radeon1 (= ${binary:Version}), + ${misc:Depends}, +Multi-Arch: same +Description: Userspace interface to radeon-specific kernel DRM services -- debugging symbols + This library implements the userspace interface to the kernel DRM services. + DRM stands for "Direct Rendering Manager", which is the kernelspace portion + of the "Direct Rendering Infrastructure" (DRI). The DRI is currently used on + Linux to provide hardware-accelerated OpenGL drivers. + . + This package provides the debugging symbols for the libdrm-radeon1 package. + +Package: libkms1 +Section: libs +Architecture: linux-any +Depends: ${shlibs:Depends}, ${misc:Depends} +Multi-Arch: same +Pre-Depends: ${misc:Pre-Depends} +Description: Userspace interface to kernel DRM buffer management + This library implements a unified userspace interface to the different buffer + management interfaces of the kernel DRM hardware drivers. + +Package: libkms1-dbg +Section: debug +Priority: extra +Architecture: linux-any +Depends: libkms1 (= ${binary:Version}), ${misc:Depends} +Multi-Arch: same +Description: Userspace interface to kernel DRM buffer management -- debugging symbols + This library implements a unified userspace interface to the different buffer + management interfaces of the kernel DRM hardware drivers. + . + This package provides the debugging symbols for the libkms1 package. + +Package: libdrm-omap1 +Section: libs +Architecture: any-arm +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Pre-Depends: ${misc:Pre-Depends} +Multi-Arch: same +Description: Userspace interface to omap-specific kernel DRM services -- runtime + This library implements the userspace interface to the omap-specific kernel + DRM services. DRM stands for "Direct Rendering Manager", which is the + kernelspace portion of the "Direct Rendering Infrastructure" (DRI). The DRI is + currently used on Linux to provide hardware-accelerated OpenGL drivers. + +Package: libdrm-omap1-dbg +Section: debug +Priority: extra +Architecture: any-arm +Depends: + libdrm-omap1 (= ${binary:Version}), + ${misc:Depends}, +Multi-Arch: same +Description: Userspace interface to omap-specific kernel DRM services -- debugging symbols + This library implements the userspace interface to the kernel DRM services. + DRM stands for "Direct Rendering Manager", which is the kernelspace portion + of the "Direct Rendering Infrastructure" (DRI). The DRI is currently used on + Linux to provide hardware-accelerated OpenGL drivers. + . + This package provides the debugging symbols for the libdrm-omap1 package. --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/watch +++ libdrm-2.4.37+git20120713.992e2afd/debian/watch @@ -0,0 +1,3 @@ +#git=git://anongit.freedesktop.org/mesa/drm +version=3 +http://dri.freedesktop.org/libdrm/libdrm-(.*)\.tar\.gz --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm-radeon1.lintian-overrides +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm-radeon1.lintian-overrides @@ -0,0 +1 @@ +libdrm-radeon1: symbols-declares-dependency-on-other-package libdrm-radeon-private --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm2.NEWS +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm2.NEWS @@ -0,0 +1,8 @@ +libdrm (2.3.0-4) experimental; urgency=low + + * We are now shipping libdrm with the default permissions set to 666, + rather than the upstream default of 660. If you have untrusted users, + you should configure the X server to explicitly use a mode of 660 in + the xorg.conf. + + -- David Nusinow Wed, 18 Apr 2007 22:44:21 -0400 --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm-nouveau2.install +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm-nouveau2.install @@ -0,0 +1 @@ +usr/lib/*/libdrm_nouveau.so.2* --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libkms1.install +++ libdrm-2.4.37+git20120713.992e2afd/debian/libkms1.install @@ -0,0 +1 @@ +usr/lib/*/libkms.so.1* --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/changelog +++ libdrm-2.4.37+git20120713.992e2afd/debian/changelog @@ -0,0 +1,602 @@ +libdrm (2.4.37+git20120713.992e2afd-0ubuntu0ricotz) quantal; urgency=medium + + * Checkout from git 20120713 (master branch) up to commit + 992e2afd59539d169689bf21d78fac8b5cea4e3c + * Only added debian/ tree from origin/debian-experimental + + -- Rico Tzschichholz Fri, 13 Jul 2012 07:12:34 +0200 + +libdrm (2.4.37-1) UNRELEASED; urgency=low + + [ Maarten Lankhorst ] + * New upstream release. + * Modify libdrm-2.4.37-nouveau-1.patch from fedora 17 + - Allows building libdrm_nouveau.so.1 and 2 simultaneously + - libdrm_nouveau1.{so,pc} links to legacy libdrm_nouveau.so.1 + - libdrm_nouveau.{so,pc} links to new api libdrm_nouveau.so.2 + - This is done to allow building upstream unmodified, + while retaining compatibility with mesa stable + + -- Maarten Lankhorst Tue, 03 Jul 2012 10:34:04 +0200 + +libdrm (2.4.33-3) unstable; urgency=low + + * Add missing dependency on libdrm-omap1 to libdrm-dev (thanks, Robert + Hooker!). Make some arm matching a bit simpler. + + -- Julien Cristau Thu, 21 Jun 2012 23:22:22 +0200 + +libdrm (2.4.33-2) unstable; urgency=low + + [ Sebastian Reichel ] + * Build libdrm_omap (closes: #667572). + + -- Julien Cristau Thu, 21 Jun 2012 22:39:22 +0200 + +libdrm (2.4.33-1) unstable; urgency=low + + * New upstream release. + + -- Cyril Brulebois Mon, 02 Apr 2012 01:28:22 +0000 + +libdrm (2.4.32-1) unstable; urgency=low + + [ Robert Hooker ] + * New upstream release (2.4.31). + * Bump libdrm2 and libdrm-radeon1 symbols and shlibs to account for + recent changes. + + [ Cyril Brulebois ] + * New upstream release (2.4.32). + * Bump libdrm-intel1's symbols and shlibs accordingly. + + -- Cyril Brulebois Mon, 19 Mar 2012 19:56:12 +0000 + +libdrm (2.4.30-1) unstable; urgency=low + + * New upstream release. + * Bump libdrm2's and libdrm-intel1's symbols and shlibs accordingly. + * Document the symlink dance when building from git in README.source. + + -- Cyril Brulebois Fri, 06 Jan 2012 20:04:37 +0100 + +libdrm (2.4.29-1) unstable; urgency=low + + * New upstream release: + - assert()s are now gone (Closes: #651316). + * Update libdrm-intel1's symbols and shlibs accordingly. + + -- Cyril Brulebois Tue, 13 Dec 2011 13:16:22 +0100 + +libdrm (2.4.28-1) unstable; urgency=low + + * New upstream release. + + -- Cyril Brulebois Tue, 06 Dec 2011 15:17:50 +0100 + +libdrm (2.4.27-1) unstable; urgency=low + + * New upstream release: + - Push the new Intel API for use by mesa. + - Usual bug fixes. + * Update libdrm-intel1's symbols and shlibs accordingly. + + -- Cyril Brulebois Tue, 01 Nov 2011 19:30:54 +0100 + +libdrm (2.4.26-1) unstable; urgency=low + + * New upstream release: + - Fix two important intel bugs. + * Add libpciaccess-dev build-dep. + * Update libdrm-intel1.symbols and shlibs for new aperture-related symbol. + + -- Cyril Brulebois Fri, 24 Jun 2011 17:07:04 +0200 + +libdrm (2.4.25-3) unstable; urgency=low + + * Team upload. + + [ Steve Langasek ] + * Build for multiarch. + + [ Julien Cristau ] + * Add lintian overrides for symbols-declares-dependency-on-other-package (we + use that for private symbols). + * Bump Standards-Version to 3.9.2. + + -- Julien Cristau Thu, 09 Jun 2011 20:05:53 +0200 + +libdrm (2.4.25-2) unstable; urgency=low + + * Upload to unstable. + + -- Cyril Brulebois Mon, 16 May 2011 19:14:49 +0200 + +libdrm (2.4.25-1) experimental; urgency=low + + * New upstream release. + * Update libdrm2.symbols and shlibs. + * Update libkms1.symbols, marking dumb_create@Base as private. + * Switch to dh: + - Bump compat/build-dep to 8. + - Use dh-autoreconf. + - Tidy old build-deps. + - Testsuite now automatically gets run. + * Accordingly, add a build-dep to fix FTBFS during make check: + - 03_build_against_librt.diff + * Add libudev-dev build-dep on Linux so that detection works. + * Since the testsuite just got enabled, let's not bail out if it fails. + * Remove xsfbs as it's no longer needed. + * Bump Standards-Version (no changes needed). + + -- Cyril Brulebois Tue, 19 Apr 2011 02:57:29 +0200 + +libdrm (2.4.24-2) unstable; urgency=low + + * Upload to unstable. + + -- Cyril Brulebois Sun, 10 Apr 2011 22:57:02 +0200 + +libdrm (2.4.24-1) experimental; urgency=low + + [ Christopher James Halse Rogers ] + * New upstream release. + * Add new internal radeon symbols to libkms1.symbols + + [ Cyril Brulebois ] + * Just as a reminder, not adding a lintian override for the following + warning, since patches were sent upstream to stop exporting private + symbols: symbols-declares-dependency-on-other-package + + -- Cyril Brulebois Sat, 05 Mar 2011 20:27:23 +0100 + +libdrm (2.4.23-3) unstable; urgency=low + + * Cherry-pick from upstream: + - intel: Fallback to old exec if no mrb_exec is available + - intel: Set the public handle after opening by name + - intel: Remember named bo + * The first of those fixes should fix some failures to submit batch + buffer (Closes: #612766). + * Bump dependency to 2.4.23-3 for the drm_intel_bo_mrb_exec symbol in + libdrm-intel1's symbols file. While the former version is alright + from a shared object point of view, runtime doesn't seem to agree + (Closes: #609299). + * Bump the libdrm-intel1 shlibs version for consistency. + + -- Cyril Brulebois Wed, 16 Feb 2011 11:44:44 +0100 + +libdrm (2.4.23-2) unstable; urgency=low + + * Upload to unstable. + * Update Uploaders list. Thanks, David & Brice! + + -- Cyril Brulebois Sat, 05 Feb 2011 11:26:44 +0100 + +libdrm (2.4.23-1) experimental; urgency=low + + [ Sven Joachim ] + * New upstream release. + * Rename the libdrm-nouveau1 package to libdrm-nouveau1a, since upstream + broke the ABI without changing the soname. + - Make libdrm-nouveau1a{,-dbg} conflict with libdrm-nouveau1{,-dbg} and + remove the Breaks against xserver-xorg-video-nouveau. + - Adjust the lintian override. + - Bump libdrm-nouveau shlibs and symbols versions to 2.4.23. + * Use dh_prep instead of the deprecated dh_clean -k in debian/rules. + + -- Julien Cristau Thu, 23 Dec 2010 17:56:54 +0100 + +libdrm (2.4.22-2) experimental; urgency=low + + * Cherry-pick some commits from upstream to make the intel video driver + 2.13.901 buildable: + - 057fab33: intel: Prepare for BLT ring split + - 36245771: intel: enable relaxed fence allocation for i915 + - 49447a9b: intel: initialize bufmgr.bo_mrb_exec unconditionally + + -- Cyril Brulebois Sun, 07 Nov 2010 22:51:12 +0100 + +libdrm (2.4.22-1) experimental; urgency=low + + [ Sven Joachim ] + * New upstream release. + + -- Cyril Brulebois Sat, 02 Oct 2010 00:41:05 +0200 + +libdrm (2.4.21-2) experimental; urgency=low + + [ Sven Joachim ] + * Bump libdrm-nouveau shlibs and symbols versions to 2.4.21-1 to ensure + that packages built against this version are not used with squeeze's + libdrm-nouveau1. + * Add a lintian override for the symbols-file-contains-debian-revision + warning. Bump debhelper compatibility level to 6 for dh_lintian. + + -- Julien Cristau Wed, 25 Aug 2010 23:14:40 +0200 + +libdrm (2.4.21-1) experimental; urgency=low + + [ Christopher James Halse Rogers ] + * debian/rules: + - Add libkms to build + - Build vmwgfx experimental API. The drm module is available in the 2.6.34 + kernel so we might as well build the userspace bits. + * debian/control: + - Add libkms1, libkms1-dbg packages on linux + * debian/patches/02_build_libkms_against_in_tree_drm: + - Link libkms against libdrm as it uses symbols from libdrm. + + [ Robert Hooker ] + * New upstream release. + * Refresh 02_build_libkms_against_in_tree_drm. + * Update libdrm-intel1.symbols, libdrm-radeon1.symbols and shlibs. + + [ Julien Cristau ] + * Update the copyright file to hopefully include all licenses variations and + copyright statements from the source tree. + * Mark new libdrm_radeon symbols private. They shouldn't actually be + exported. + * Same with libkms. Also don't set a minimum version to 2.4.20, since we + didn't ship it before anyway. + + -- Julien Cristau Thu, 10 Jun 2010 23:24:54 +0200 + +libdrm (2.4.20-3) experimental; urgency=low + + [ Sven Joachim ] + * Update libdrm-nouveau1 to the ABI of Linux 2.6.34. + - Drop 03_revert_abi_change.diff. + - Bump libdrm-nouveau shlibs and symbols versions to 2.4.20-3~ + to ensure that packages built against this version are not used + with an older libdrm-nouveau1 version. + - Add versioned Breaks against xserver-xorg-video-nouveau to force + an upgrade of that package and prevent X segfaults. + * Include full SONAME in libdrm-nouveau1.install. + * Update xsfbs to 81fc271788605b52e85c2d11635a0371fb44605e0. + + -- Julien Cristau Wed, 26 May 2010 10:33:22 +0200 + +libdrm (2.4.20-2) experimental; urgency=low + + * Upload again, faking a new upstream version, since a screw-up on + ftpmaster side trashed all files from experimental. + + -- Cyril Brulebois Wed, 28 Apr 2010 01:54:44 +0200 + +libdrm (2.4.20-1) experimental; urgency=low + + * New upstream release. + + Cherry-pick upstream fixes 107ccd92 and 332739e3. + * Update libdrm-intel1.symbols, libdrm-radeon1.symbols and shlibs. + * Disable libkms for now. + + -- Brice Goglin Fri, 16 Apr 2010 07:14:41 +0200 + +libdrm (2.4.18-5) unstable; urgency=low + + * Upload to unstable. + + -- Cyril Brulebois Wed, 14 Apr 2010 13:02:34 +0200 + +libdrm (2.4.18-4) experimental; urgency=low + + * Steal 03_revert_abi_change.diff from Ubuntu to revert the nouveau ABI + change. Current Debian kernels support only the old ABI. + Thanks Sven Joachim! + * Build a libdrm-nouveau1 package on Linux architectures (Closes: #568162). + Patch adapted from the Ubuntu package. Thanks Sven Joachim! + + -- Brice Goglin Wed, 24 Mar 2010 22:27:00 +0100 + +libdrm (2.4.18-3) unstable; urgency=low + + * Include full SONAME in libdrm*.install to prevent accidental breakage. + * Add back the drm headers in libdrm-dev. + + -- Julien Cristau Tue, 16 Mar 2010 12:28:50 +0100 + +libdrm (2.4.18-2) unstable; urgency=low + + * Fix FTBFS on non-Linux architectures (Closes: #570851): Replace + --{enable,disable}-radeon-experimental-api configure flag with + --{enable,disable}-radeon since it got renamed. + * Add ${misc:Depends} where it was missing, and fold all Depends. + * Bump Standards-Version from 3.8.3 to 3.8.4 (no changes needed). + * Add myself to Uploaders. + + -- Cyril Brulebois Mon, 22 Feb 2010 15:31:47 +0100 + +libdrm (2.4.18-1) unstable; urgency=low + + * New upstream release. + + -- Brice Goglin Thu, 18 Feb 2010 08:06:14 +0100 + +libdrm (2.4.17-1) unstable; urgency=low + + [ Julien Cristau ] + * New upstream release, closes: #560434, #567831. + * Update patch 01_default_perms.diff to account for upstream move of libdrm + to toplevel. + * Update libdrm2.symbols and shlibs. + * Update libdrm-intel1.symbols and shlibs. + * Bump debhelper build-dep, we use dh_strip --remaining-packages (closes: + #558443). Thanks, Sergio Gelato! + * Enable libdrm_radeon, interface to kernel graphics memory management on + radeon (closes: #558786). + * Rename the build directory to not include DEB_BUILD_GNU_TYPE for no + good reason. Thanks, Colin Watson! + * Remove myself from Uploaders + + [ Brice Goglin ] + * Bump linux-libc-dev dependency to 2.6.32, thanks Piotr Engelking, + closes: #561224. + * Add libdrm-radeon1 symbols and update shlibs. + * Update debian/copyright. + + [ Timo Aaltonen ] + * Update libdrm2.symbols and shlibs. + + -- Brice Goglin Sun, 31 Jan 2010 20:12:38 +0100 + +libdrm (2.4.15-1) unstable; urgency=low + + * New upstream release. + + update libdrm-intel1 symbols and shlibs + * Only build libdrm-intel on x86 (linux and kfreebsd). + + -- Julien Cristau Mon, 23 Nov 2009 17:00:57 +0100 + +libdrm (2.4.14-1) unstable; urgency=low + + * Parse space-separated DEB_BUILD_OPTIONS, and handle parallel=N. + * New upstream release. + * Bump Standards-Version to 3.8.3. + + -- Julien Cristau Thu, 24 Sep 2009 21:53:09 +0200 + +libdrm (2.4.13-1) unstable; urgency=low + + [ Christopher James Halse Rogers ] + * debian/control: + + Remove scary 'built from DRM snapshot' warning from long description of + libdrm-intel1{,-dbg} + + [ Julien Cristau ] + * New upstream release. + * Update libdrm-intel1.symbols. + + -- Julien Cristau Sat, 05 Sep 2009 13:15:36 +0200 + +libdrm (2.4.12-1) unstable; urgency=low + + * New upstream release. + + -- Brice Goglin Tue, 21 Jul 2009 15:29:03 +0200 + +libdrm (2.4.11-1) unstable; urgency=low + + * New upstream release. + * Also pull in additional fix for libdrm-intel: Only do BO caching up to + 64MB objects. + * Update libdrm-intel1.symbols and bump shlibs. + * Add README.source from xsfbs. Bump Standards-Version to 3.8.1. + * Remove Thierry Reding from Uploaders, he doesn't seem to be around anymore + :( + + -- Julien Cristau Mon, 08 Jun 2009 16:22:04 +0200 + +libdrm (2.4.9-2) unstable; urgency=low + + * Ship all drm headers on kfreebsd, again. + * Move -dbg packages to new debug section. + + -- Julien Cristau Sun, 03 May 2009 18:55:42 +0200 + +libdrm (2.4.9-1) unstable; urgency=low + + [ Brice Goglin ] + * New upstream release. + + Remove buggy symlinks for the upstream tarball. + * Add myself to Uploaders. + + [ Julien Cristau ] + * Make the linux-libc-dev dependency linux-only (closes: #521253). Thanks, + Petr Salinger! + + -- Brice Goglin Sat, 11 Apr 2009 23:12:49 +0200 + +libdrm (2.4.5-2) unstable; urgency=low + + * Add drm_mode.h to the list of headers we don't ship. + + -- Julien Cristau Wed, 25 Mar 2009 10:56:53 +0100 + +libdrm (2.4.5-1) unstable; urgency=low + + * New upstream release. (closes: #505740) + + [ Timo Aaltonen ] + * debian/rules: + -Run autoreconf at build time, build-depend on automake and libtool. + (closes: #482727) + -Add a debian/libdrm2.symbols file and '-c4' parameter to dh_makeshlibs + to fail if new symbols are added. Don't use Debian versions for now. + + [ Julien Cristau ] + * Add a new package for the intel-specific bits (libdrm-intel1) + * Build-depend on pkg-config and libpthread-stubs0-dev (closes: #502078). + Thanks, Frank Lichtenheld! + * Don't mention *.la in libdrm-dev.install. + * Make libdrm-dev depend on libdrm-intel1 on x86. + * On Linux, let udev create the device files. + * Let linux-libc-dev provide some drm headers, drop them from libdrm-dev. + Add dependency on linux-libc-dev >= 2.6.28. + * Set libdrm2 shlibs to 2.4.3, libdrm-intel1 shlibs to 2.4.5. Update + symbols files. + + -- Julien Cristau Tue, 24 Mar 2009 22:20:50 +0100 + +libdrm (2.3.1-2) unstable; urgency=high + + * Remove from the source package a bunch of files that are only used by the + kernel drm component. This gets rid of the mga, r128 and radeon + microcode, and thus closes: #502675. Thanks, Ben Hutchings! + + -- Julien Cristau Sun, 19 Oct 2008 14:26:37 +0200 + +libdrm (2.3.1-1) unstable; urgency=low + + [ Brice Goglin ] + * Update upstream URL in debian/copyright. + * Bump Standards-Version to 3.7.3 (no changes). + * Drop the XS- prefix from Vcs-Git and Vcs-Browser fields in debian/control. + * Install the upstream ChangeLog. + + [ Julien Cristau ] + * New upstream release (needed for mesa 7.1 and newer xserver). + * Note: this release removes the memory manager (TTM) interface used by the + i915tex dri driver. + * debian/rules: don't call configure with --host if we're not + cross-building, and fix some rules dependencies. + + [ Timo Aaltonen ] + * Bump the shlibs to 2.3.1. + + -- Julien Cristau Sun, 13 Jul 2008 19:07:49 +0200 + +libdrm (2.3.0-4) unstable; urgency=low + + [ David Nusinow ] + * Add NEWS.Debian explaining the change in the last upload to interested + administrators. + + [ Julien Cristau ] + * Upload to unstable. + + -- Julien Cristau Fri, 20 Apr 2007 05:06:34 +0200 + +libdrm (2.3.0-3) experimental; urgency=low + + * Add myself to uploaders + * Patch libdrm to default to device permission 666 so we don't have to do it + in xorg.conf. The only way libdrm can do anything is through the server + anyway. This can still be overridden by a user's xorg.conf. This change + also requires adding quilt to the build-depends + + -- David Nusinow Sun, 15 Apr 2007 13:08:50 -0400 + +libdrm (2.3.0-2) unstable; urgency=low + + * Update my email address in debian/control. + * Add XS-Vcs-Git and XS-Vcs-Browser in debian/control. + * Upload to unstable. + + -- Julien Cristau Thu, 12 Apr 2007 19:06:57 +0200 + +libdrm (2.3.0-1) experimental; urgency=low + + [ Thierry Reding ] + * New upstream release. + * Set the Debian X Strike Force as maintainer. + * Add myself to uploaders. + * Add a debugging symbol package for libdrm2. + + [ Julien Cristau ] + * Bump shlibs to libdrm2 >= 2.3.0. + * Add myself to uploaders. + * Add build-dep on dpkg-dev >= 1.13.19 to make sure that the binary:Version + substvar is available. + * libdrm2-dbg depends on libdrm2 (= ${binary:Version}). + * Don't install libdrm.la, and use dh_install --list-missing. + + -- Julien Cristau Thu, 4 Jan 2007 18:56:08 +0100 + +libdrm (2.2.0-0.1) experimental; urgency=low + + * Non-maintainer upload. + * New upstream release. + * Bump Standards-Version to 3.7.2, no changes required. + * Bump debhelper compatibility to 5 and adjust build-dependency. + * Don't try to install pkgconfig files from usr/share/pkgconfig because + there is nothing in that directory. + + -- Thierry Reding Sat, 18 Nov 2006 19:50:26 +0100 + +libdrm (2.0.2-0.1) unstable; urgency=low + + * Non-maintainer upload. + * New upstream release (closes: #377166). + - Includes a fix for FTBFS on GNU/kFreeBSD (closes: #332994). + * Manually force static build. + + -- Andres Salomon Sat, 23 Sep 2006 06:32:23 +0000 + +libdrm (2.0.1-1) unstable; urgency=high + + * New upstream release + - Fixes a pathological hash table smash discovered by the Coverity scanner + - updates the installed header files for various new #defines + + -- David Nusinow Tue, 4 Apr 2006 23:46:05 -0400 + +libdrm (2.0-1) experimental; urgency=low + + * First upload to Debian + + -- David Nusinow Thu, 5 Jan 2006 22:45:27 -0500 + +libdrm (2.0-0ubuntu1) dapper; urgency=low + + * New upstream release. + * Change binary package from libdrm1 to libdrm2, following soversion bump. + + -- Daniel Stone Mon, 12 Dec 2005 13:05:22 +1100 + +libdrm (1.0.5-0ubuntu1) dapper; urgency=low + + * New upstream version. + + -- Daniel Stone Wed, 2 Nov 2005 01:56:07 +1100 + +libdrm (1.0.3-3) unstable; urgency=low + + * Yay for understandable bug reports! *gmprf* + * debian/control:libdrm1 =~ s/development/runtime/ (closes: bug#325515) + + -- Marcelo E. Magallon Fri, 16 Sep 2005 09:46:05 -0600 + +libdrm (1.0.3-2) unstable; urgency=low + + * libdrm.pc.in: add -ldrm to Libs + + -- Marcelo E. Magallon Thu, 08 Sep 2005 20:49:01 -0600 + +libdrm (1.0.3-1) unstable; urgency=low + + * New upstream + + -- Marcelo E. Magallon Sun, 28 Aug 2005 11:12:07 -0600 + +libdrm (1.0.2-3) unstable; urgency=low + + * debian/control: it's "Direct Rendering Infraestructure". I was rather + sure it stand for interface... thanks Michel. (closes: bug#324514) + * debian/control: forgot to actually write this in the file. Build-Depends + on libx11-dev. Thanks Kurt (closes: bug#324560) + + -- Marcelo E. Magallon Sun, 28 Aug 2005 11:01:41 -0600 + +libdrm (1.0.2-2) unstable; urgency=low + + * Forgot to fix the other broken bit :-P + + -- Marcelo E. Magallon Fri, 19 Aug 2005 22:01:32 -0600 + +libdrm (1.0.2-1) unstable; urgency=low + + * Initial release. Closes: #324074 + + -- Marcelo E. Magallon Fri, 19 Aug 2005 21:11:18 -0600 + --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm-nouveau1a.install +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm-nouveau1a.install @@ -0,0 +1 @@ +usr/lib/*/libdrm_nouveau.so.1* --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm-intel1.symbols +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm-intel1.symbols @@ -0,0 +1,70 @@ +libdrm_intel.so.1 libdrm-intel1 #MINVER# + drm_intel_bo_alloc@Base 2.4.1 + drm_intel_bo_alloc_for_render@Base 2.4.5 + drm_intel_bo_alloc_tiled@Base 2.4.15 + drm_intel_bo_busy@Base 2.4.13 + drm_intel_bo_disable_reuse@Base 2.4.10 + drm_intel_bo_emit_reloc@Base 2.4.1 + drm_intel_bo_emit_reloc_fence@Base 2.4.20 + drm_intel_bo_exec@Base 2.4.1 + drm_intel_bo_fake_alloc_static@Base 2.4.1 + drm_intel_bo_fake_disable_backing_store@Base 2.4.1 + drm_intel_bo_flink@Base 2.4.1 + drm_intel_bo_gem_create_from_name@Base 2.4.1 + drm_intel_bo_get_subdata@Base 2.4.1 + drm_intel_bo_get_tiling@Base 2.4.1 + drm_intel_bo_is_reusable@Base 2.4.21 + drm_intel_bo_madvise@Base 2.4.16 + drm_intel_bo_map@Base 2.4.1 + drm_intel_bo_mrb_exec@Base 2.4.23-3~ + drm_intel_bo_pin@Base 2.4.1 + drm_intel_bo_reference@Base 2.4.1 + drm_intel_bo_references@Base 2.4.15 + drm_intel_bo_set_tiling@Base 2.4.1 + drm_intel_bo_subdata@Base 2.4.1 + drm_intel_bo_unmap@Base 2.4.1 + drm_intel_bo_unpin@Base 2.4.1 + drm_intel_bo_unreference@Base 2.4.1 + drm_intel_bo_wait_rendering@Base 2.4.1 + drm_intel_bufmgr_check_aperture_space@Base 2.4.1 + drm_intel_bufmgr_destroy@Base 2.4.1 + drm_intel_bufmgr_fake_contended_lock_take@Base 2.4.1 + drm_intel_bufmgr_fake_evict_all@Base 2.4.1 + drm_intel_bufmgr_fake_init@Base 2.4.1 + drm_intel_bufmgr_fake_set_exec_callback@Base 2.4.1 + drm_intel_bufmgr_fake_set_fence_callback@Base 2.4.1 + drm_intel_bufmgr_fake_set_last_dispatch@Base 2.4.1 + drm_intel_bufmgr_gem_enable_fenced_relocs@Base 2.4.20 + drm_intel_bufmgr_gem_enable_reuse@Base 2.4.1 + drm_intel_bufmgr_gem_get_devid@Base 2.4.32 + drm_intel_bufmgr_gem_init@Base 2.4.1 + drm_intel_bufmgr_gem_set_aub_dump@Base 2.4.32 + drm_intel_bufmgr_gem_set_aub_annotations@Base 2.4.34 + drm_intel_bufmgr_gem_set_vma_cache_size@Base 2.4.29 + drm_intel_bufmgr_set_debug@Base 2.4.1 + drm_intel_decode@Base 2.4.30 + drm_intel_decode_context_alloc@Base 2.4.30 + drm_intel_decode_context_free@Base 2.4.30 + drm_intel_decode_set_batch_pointer@Base 2.4.30 + drm_intel_decode_set_dump_past_end@Base 2.4.30 + drm_intel_decode_set_head_tail@Base 2.4.30 + drm_intel_decode_set_output_file@Base 2.4.30 + drm_intel_gem_bo_aub_dump_bmp@Base 2.4.32 + drm_intel_gem_bo_clear_relocs@Base 2.4.27 + drm_intel_gem_bo_context_exec@Base 2.4.36 + drm_intel_gem_bo_get_reloc_count@Base 2.4.27 + drm_intel_gem_bo_map_gtt@Base 2.4.3 + drm_intel_gem_bo_map_unsynchronized@Base 2.4.32 + drm_intel_gem_bo_start_gtt_access@Base 2.4.3 + drm_intel_gem_bo_unmap_gtt@Base 2.4.9 + drm_intel_gem_bo_wait@Base 2.4.36 + drm_intel_gem_context_create@Base 2.4.37 + drm_intel_gem_context_destroy@Base 2.4.37 + drm_intel_get_aperture_sizes@Base 2.4.26 + drm_intel_get_pipe_from_crtc_id@Base 2.4.11 + drm_mmAllocMem@Base 2.4.1 + drm_mmDestroy@Base 2.4.1 + drm_mmDumpMemInfo@Base 2.4.1 + drm_mmFindBlock@Base 2.4.1 + drm_mmFreeMem@Base 2.4.1 + drm_mmInit@Base 2.4.1 --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libkms1.lintian-overrides +++ libdrm-2.4.37+git20120713.992e2afd/debian/libkms1.lintian-overrides @@ -0,0 +1 @@ +symbols-declares-dependency-on-other-package libkms-private --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm2.symbols +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm2.symbols @@ -0,0 +1,146 @@ +libdrm.so.2 libdrm2 #MINVER# + drmAddBufs@Base 2.3.1 + drmAddContextPrivateMapping@Base 2.3.1 + drmAddContextTag@Base 2.3.1 + drmAddMap@Base 2.3.1 + drmAgpAcquire@Base 2.3.1 + drmAgpAlloc@Base 2.3.1 + drmAgpBase@Base 2.3.1 + drmAgpBind@Base 2.3.1 + drmAgpDeviceId@Base 2.3.1 + drmAgpEnable@Base 2.3.1 + drmAgpFree@Base 2.3.1 + drmAgpGetMode@Base 2.3.1 + drmAgpMemoryAvail@Base 2.3.1 + drmAgpMemoryUsed@Base 2.3.1 + drmAgpRelease@Base 2.3.1 + drmAgpSize@Base 2.3.1 + drmAgpUnbind@Base 2.3.1 + drmAgpVendorId@Base 2.3.1 + drmAgpVersionMajor@Base 2.3.1 + drmAgpVersionMinor@Base 2.3.1 + drmAllocCpy@Base 2.4.3 + drmAuthMagic@Base 2.3.1 + drmAvailable@Base 2.3.1 + drmCheckModesettingSupported@Base 2.4.3 + drmClose@Base 2.3.1 + drmCloseOnce@Base 2.3.1 + drmCommandNone@Base 2.3.1 + drmCommandRead@Base 2.3.1 + drmCommandWrite@Base 2.3.1 + drmCommandWriteRead@Base 2.3.1 + drmCreateContext@Base 2.3.1 + drmCreateDrawable@Base 2.3.1 + drmCtlInstHandler@Base 2.3.1 + drmCtlUninstHandler@Base 2.3.1 + drmDMA@Base 2.3.1 + drmDelContextTag@Base 2.3.1 + drmDestroyContext@Base 2.3.1 + drmDestroyDrawable@Base 2.3.1 + drmDropMaster@Base 2.4.3 + drmError@Base 2.3.1 + drmFinish@Base 2.3.1 + drmFree@Base 2.3.1 + drmFreeBufs@Base 2.3.1 + drmFreeBusid@Base 2.3.1 + drmFreeReservedContextList@Base 2.3.1 + drmFreeVersion@Base 2.3.1 + drmGetBufInfo@Base 2.3.1 + drmGetBusid@Base 2.3.1 + drmGetCap@Base 2.4.25 + drmGetClient@Base 2.3.1 + drmGetContextFlags@Base 2.3.1 + drmGetContextPrivateMapping@Base 2.3.1 + drmGetContextTag@Base 2.3.1 + drmGetDeviceNameFromFd@Base 2.4.16 + drmGetEntry@Base 2.3.1 + drmGetHashTable@Base 2.3.1 + drmGetInterruptFromBusID@Base 2.3.1 + drmGetLibVersion@Base 2.3.1 + drmGetLock@Base 2.3.1 + drmGetMagic@Base 2.3.1 + drmGetMap@Base 2.3.1 + drmGetReservedContextList@Base 2.3.1 + drmGetStats@Base 2.3.1 + drmGetVersion@Base 2.3.1 + drmHandleEvent@Base 2.4.16 + drmHashCreate@Base 2.3.1 + drmHashDelete@Base 2.3.1 + drmHashDestroy@Base 2.3.1 + drmHashFirst@Base 2.3.1 + drmHashInsert@Base 2.3.1 + drmHashLookup@Base 2.3.1 + drmHashNext@Base 2.3.1 + drmIoctl@Base 2.4.3 + drmMalloc@Base 2.3.1 + drmMap@Base 2.3.1 + drmMapBufs@Base 2.3.1 + drmMarkBufs@Base 2.3.1 + drmModeAddFB2@Base 2.4.30 + drmModeAddFB@Base 2.4.3 + drmModeAttachMode@Base 2.4.3 + drmModeConnectorSetProperty@Base 2.4.3 + drmModeCrtcGetGamma@Base 2.4.3 + drmModeCrtcSetGamma@Base 2.4.3 + drmModeDetachMode@Base 2.4.3 + drmModeDirtyFB@Base 2.4.17 + drmModeFreeConnector@Base 2.4.3 + drmModeFreeCrtc@Base 2.4.3 + drmModeFreeEncoder@Base 2.4.3 + drmModeFreeFB@Base 2.4.3 + drmModeFreeModeInfo@Base 2.4.3 + drmModeFreeObjectProperties@Base 2.4.36 + drmModeFreePlane@Base 2.4.30 + drmModeFreePlaneResources@Base 2.4.31 + drmModeFreeProperty@Base 2.4.3 + drmModeFreePropertyBlob@Base 2.4.3 + drmModeFreeResources@Base 2.4.3 + drmModeGetConnector@Base 2.4.3 + drmModeGetCrtc@Base 2.4.3 + drmModeGetEncoder@Base 2.4.3 + drmModeGetFB@Base 2.4.3 + drmModeGetPlane@Base 2.4.30 + drmModeGetPlaneResources@Base 2.4.30 + drmModeGetProperty@Base 2.4.3 + drmModeGetPropertyBlob@Base 2.4.3 + drmModeGetResources@Base 2.4.3 + drmModeMoveCursor@Base 2.4.3 + drmModeObjectGetProperties@Base 2.4.36 + drmModeObjectSetProperty@Base 2.4.36 + drmModePageFlip@Base 2.4.17 + drmModeRmFB@Base 2.4.3 + drmModeSetCrtc@Base 2.4.3 + drmModeSetCursor@Base 2.4.3 + drmModeSetPlane@Base 2.4.30 + drmMsg@Base 2.4.1 + drmOpen@Base 2.3.1 + drmOpenControl@Base 2.4.3 + drmOpenOnce@Base 2.3.1 + drmRandom@Base 2.3.1 + drmRandomCreate@Base 2.3.1 + drmRandomDestroy@Base 2.3.1 + drmRandomDouble@Base 2.3.1 + drmRmMap@Base 2.3.1 + drmSLCreate@Base 2.3.1 + drmSLDelete@Base 2.3.1 + drmSLDestroy@Base 2.3.1 + drmSLDump@Base 2.3.1 + drmSLFirst@Base 2.3.1 + drmSLInsert@Base 2.3.1 + drmSLLookup@Base 2.3.1 + drmSLLookupNeighbors@Base 2.3.1 + drmSLNext@Base 2.3.1 + drmScatterGatherAlloc@Base 2.3.1 + drmScatterGatherFree@Base 2.3.1 + drmSetBusid@Base 2.3.1 + drmSetContextFlags@Base 2.3.1 + drmSetDebugMsgFunction@Base 2.3.1 + drmSetInterfaceVersion@Base 2.3.1 + drmSetMaster@Base 2.4.3 + drmSetServerInfo@Base 2.3.1 + drmSwitchToContext@Base 2.3.1 + drmUnlock@Base 2.3.1 + drmUnmap@Base 2.3.1 + drmUnmapBufs@Base 2.3.1 + drmUpdateDrawableInfo@Base 2.3.1 + drmWaitVBlank@Base 2.3.1 --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm-radeon1.install +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm-radeon1.install @@ -0,0 +1 @@ +usr/lib/*/libdrm_radeon.so.1* --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/libdrm-nouveau1a.symbols +++ libdrm-2.4.37+git20120713.992e2afd/debian/libdrm-nouveau1a.symbols @@ -0,0 +1,46 @@ +libdrm_nouveau.so.1 libdrm-nouveau1a #MINVER# + nouveau_bo_busy@Base 2.4.23 + nouveau_bo_emit_buffer@Base 2.4.23 + nouveau_bo_handle_get@Base 2.4.23 + nouveau_bo_handle_ref@Base 2.4.23 + nouveau_bo_init@Base 2.4.23 + nouveau_bo_map@Base 2.4.23 + nouveau_bo_map_flush@Base 2.4.23 + nouveau_bo_map_range@Base 2.4.23 + nouveau_bo_new@Base 2.4.23 + nouveau_bo_new_tile@Base 2.4.23 + nouveau_bo_pending@Base 2.4.23 + nouveau_bo_ref@Base 2.4.23 + nouveau_bo_takedown@Base 2.4.23 + nouveau_bo_unmap@Base 2.4.23 + nouveau_bo_user@Base 2.4.23 + nouveau_bo_wrap@Base 2.4.23 + nouveau_channel_alloc@Base 2.4.23 + nouveau_channel_free@Base 2.4.23 + nouveau_device_close@Base 2.4.23 + nouveau_device_get_param@Base 2.4.23 + nouveau_device_open@Base 2.4.23 + nouveau_device_open_existing@Base 2.4.23 + nouveau_device_set_param@Base 2.4.23 + nouveau_grobj_alloc@Base 2.4.23 + nouveau_grobj_autobind@Base 2.4.23 + nouveau_grobj_free@Base 2.4.23 + nouveau_grobj_ref@Base 2.4.23 + nouveau_notifier_alloc@Base 2.4.23 + nouveau_notifier_free@Base 2.4.23 + nouveau_notifier_reset@Base 2.4.23 + nouveau_notifier_return_val@Base 2.4.23 + nouveau_notifier_status@Base 2.4.23 + nouveau_notifier_wait_status@Base 2.4.23 + nouveau_pushbuf_emit_reloc@Base 2.4.23 + nouveau_pushbuf_fini@Base 2.4.23 + nouveau_pushbuf_flush@Base 2.4.23 + nouveau_pushbuf_init@Base 2.4.23 + nouveau_pushbuf_marker_emit@Base 2.4.23 + nouveau_pushbuf_marker_undo@Base 2.4.23 + nouveau_pushbuf_submit@Base 2.4.23 + nouveau_reloc_emit@Base 2.4.23 + nouveau_resource_alloc@Base 2.4.23 + nouveau_resource_destroy@Base 2.4.23 + nouveau_resource_free@Base 2.4.23 + nouveau_resource_init@Base 2.4.23 --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/patches/01_default_perms.diff +++ libdrm-2.4.37+git20120713.992e2afd/debian/patches/01_default_perms.diff @@ -0,0 +1,13 @@ +Index: libdrm/xf86drm.h +=================================================================== +--- libdrm.orig/xf86drm.h ++++ libdrm/xf86drm.h +@@ -70,7 +70,7 @@ + /* Default /dev/dri directory permissions 0755 */ + #define DRM_DEV_DIRMODE \ + (S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH) +-#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP) ++#define DRM_DEV_MODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH) + + #define DRM_DIR_NAME "/dev/dri" + #define DRM_DEV_NAME "%s/card%d" --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/patches/04_libdrm-2.4.37-nouveau-1.diff +++ libdrm-2.4.37+git20120713.992e2afd/debian/patches/04_libdrm-2.4.37-nouveau-1.diff @@ -0,0 +1,2921 @@ +diff --git a/Makefile.am b/Makefile.am +index 256a8cc..045add1 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -34,7 +34,7 @@ INTEL_SUBDIR = intel + endif + + if HAVE_NOUVEAU +-NOUVEAU_SUBDIR = nouveau ++NOUVEAU_SUBDIR = nouveau-1 nouveau + endif + + if HAVE_RADEON +diff --git a/configure.ac b/configure.ac +index a1c8c69..6439b81 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -319,6 +319,8 @@ AC_CONFIG_FILES([ + intel/libdrm_intel.pc + radeon/Makefile + radeon/libdrm_radeon.pc ++ nouveau-1/Makefile ++ nouveau-1/libdrm_nouveau1.pc + nouveau/Makefile + nouveau/libdrm_nouveau.pc + omap/Makefile +diff --git a/nouveau-1/Makefile.am b/nouveau-1/Makefile.am +new file mode 100644 +index 0000000..7e6aa13 +--- /dev/null ++++ b/nouveau-1/Makefile.am +@@ -0,0 +1,43 @@ ++AM_CFLAGS = \ ++ $(WARN_CFLAGS) \ ++ -I$(top_srcdir) \ ++ -I$(top_srcdir)/nouveau-1 \ ++ $(PTHREADSTUBS_CFLAGS) \ ++ -I$(top_srcdir)/include/drm ++ ++libdrm_nouveau_la_LTLIBRARIES = libdrm_nouveau.la ++libdrm_nouveau_ladir = $(libdir) ++libdrm_nouveau_la_LDFLAGS = -version-number 1:0:0 -no-undefined ++libdrm_nouveau_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ ++ ++libdrm_nouveau_la_SOURCES = \ ++ nouveau_device.c \ ++ nouveau_channel.c \ ++ nouveau_pushbuf.c \ ++ nouveau_grobj.c \ ++ nouveau_notifier.c \ ++ nouveau_bo.c \ ++ nouveau_resource.c \ ++ nouveau_private.h \ ++ nouveau_reloc.c ++ ++libdrm_nouveaucommonincludedir = ${includedir}/nouveau ++libdrm_nouveaucommoninclude_HEADERS = \ ++ nouveau_device.h \ ++ nouveau_channel.h \ ++ nouveau_grobj.h \ ++ nouveau_notifier.h \ ++ nouveau_pushbuf.h \ ++ nv04_pushbuf.h \ ++ nvc0_pushbuf.h \ ++ nouveau_bo.h \ ++ nouveau_resource.h \ ++ nouveau_reloc.h ++ ++ ++libdrm_nouveauincludedir = ${includedir}/libdrm ++libdrm_nouveauinclude_HEADERS = \ ++ nouveau_drmif.h ++ ++pkgconfigdir = @pkgconfigdir@ ++pkgconfig_DATA = libdrm_nouveau1.pc +diff --git a/nouveau-1/libdrm_nouveau1.pc.in b/nouveau-1/libdrm_nouveau1.pc.in +new file mode 100644 +index 0000000..8f3d40f +--- /dev/null ++++ b/nouveau-1/libdrm_nouveau1.pc.in +@@ -0,0 +1,11 @@ ++prefix=@prefix@ ++exec_prefix=@exec_prefix@ ++libdir=@libdir@ ++includedir=@includedir@ ++ ++Name: libdrm_nouveau ++Description: Userspace interface to nouveau kernel DRM services ++Version: 0.6 ++Libs: -L${libdir} -ldrm_nouveau1 ++Cflags: -I${includedir} -I${includedir}/libdrm -I${includedir}/nouveau ++Requires.private: libdrm +diff --git a/nouveau-1/nouveau_bo.c b/nouveau-1/nouveau_bo.c +new file mode 100644 +index 0000000..d6bb22d +--- /dev/null ++++ b/nouveau-1/nouveau_bo.c +@@ -0,0 +1,549 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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. ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include ++#endif ++#include ++#include ++#include ++#include ++ ++#include ++ ++#include "nouveau_private.h" ++ ++int ++nouveau_bo_init(struct nouveau_device *dev) ++{ ++ return 0; ++} ++ ++void ++nouveau_bo_takedown(struct nouveau_device *dev) ++{ ++} ++ ++static int ++nouveau_bo_info(struct nouveau_bo_priv *nvbo, struct drm_nouveau_gem_info *arg) ++{ ++ nvbo->handle = nvbo->base.handle = arg->handle; ++ nvbo->domain = arg->domain; ++ nvbo->size = arg->size; ++ nvbo->offset = arg->offset; ++ nvbo->map_handle = arg->map_handle; ++ nvbo->base.tile_mode = arg->tile_mode; ++ /* XXX - flag inverted for backwards compatibility */ ++ nvbo->base.tile_flags = arg->tile_flags ^ NOUVEAU_GEM_TILE_NONCONTIG; ++ return 0; ++} ++ ++static int ++nouveau_bo_allocated(struct nouveau_bo_priv *nvbo) ++{ ++ if (nvbo->sysmem || nvbo->handle) ++ return 1; ++ return 0; ++} ++ ++static int ++nouveau_bo_ualloc(struct nouveau_bo_priv *nvbo) ++{ ++ if (nvbo->user || nvbo->sysmem) { ++ assert(nvbo->sysmem); ++ return 0; ++ } ++ ++ nvbo->sysmem = malloc(nvbo->size); ++ if (!nvbo->sysmem) ++ return -ENOMEM; ++ ++ return 0; ++} ++ ++static void ++nouveau_bo_ufree(struct nouveau_bo_priv *nvbo) ++{ ++ if (nvbo->sysmem) { ++ if (!nvbo->user) ++ free(nvbo->sysmem); ++ nvbo->sysmem = NULL; ++ } ++} ++ ++static void ++nouveau_bo_kfree(struct nouveau_bo_priv *nvbo) ++{ ++ struct nouveau_device_priv *nvdev = nouveau_device(nvbo->base.device); ++ struct drm_gem_close req; ++ ++ if (!nvbo->handle) ++ return; ++ ++ if (nvbo->map) { ++ munmap(nvbo->map, nvbo->size); ++ nvbo->map = NULL; ++ } ++ ++ req.handle = nvbo->handle; ++ nvbo->handle = 0; ++ drmIoctl(nvdev->fd, DRM_IOCTL_GEM_CLOSE, &req); ++} ++ ++static int ++nouveau_bo_kalloc(struct nouveau_bo_priv *nvbo, struct nouveau_channel *chan) ++{ ++ struct nouveau_device_priv *nvdev = nouveau_device(nvbo->base.device); ++ struct drm_nouveau_gem_new req; ++ struct drm_nouveau_gem_info *info = &req.info; ++ int ret; ++ ++ if (nvbo->handle) ++ return 0; ++ ++ req.channel_hint = chan ? chan->id : 0; ++ req.align = nvbo->align; ++ ++ ++ info->size = nvbo->size; ++ info->domain = 0; ++ ++ if (nvbo->flags & NOUVEAU_BO_VRAM) ++ info->domain |= NOUVEAU_GEM_DOMAIN_VRAM; ++ if (nvbo->flags & NOUVEAU_BO_GART) ++ info->domain |= NOUVEAU_GEM_DOMAIN_GART; ++ if (!info->domain) { ++ info->domain |= (NOUVEAU_GEM_DOMAIN_VRAM | ++ NOUVEAU_GEM_DOMAIN_GART); ++ } ++ ++ if (nvbo->flags & NOUVEAU_BO_MAP) ++ info->domain |= NOUVEAU_GEM_DOMAIN_MAPPABLE; ++ ++ info->tile_mode = nvbo->base.tile_mode; ++ info->tile_flags = nvbo->base.tile_flags; ++ /* XXX - flag inverted for backwards compatibility */ ++ info->tile_flags ^= NOUVEAU_GEM_TILE_NONCONTIG; ++ if (!nvdev->has_bo_usage) ++ info->tile_flags &= NOUVEAU_GEM_TILE_LAYOUT_MASK; ++ ++ ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_GEM_NEW, ++ &req, sizeof(req)); ++ if (ret) ++ return ret; ++ ++ nouveau_bo_info(nvbo, &req.info); ++ return 0; ++} ++ ++static int ++nouveau_bo_kmap(struct nouveau_bo_priv *nvbo) ++{ ++ struct nouveau_device_priv *nvdev = nouveau_device(nvbo->base.device); ++ ++ if (nvbo->map) ++ return 0; ++ ++ if (!nvbo->map_handle) ++ return -EINVAL; ++ ++ nvbo->map = mmap(0, nvbo->size, PROT_READ | PROT_WRITE, ++ MAP_SHARED, nvdev->fd, nvbo->map_handle); ++ if (nvbo->map == MAP_FAILED) { ++ nvbo->map = NULL; ++ return -errno; ++ } ++ ++ return 0; ++} ++ ++int ++nouveau_bo_new_tile(struct nouveau_device *dev, uint32_t flags, int align, ++ int size, uint32_t tile_mode, uint32_t tile_flags, ++ struct nouveau_bo **bo) ++{ ++ struct nouveau_bo_priv *nvbo; ++ int ret; ++ ++ if (!dev || !bo || *bo) ++ return -EINVAL; ++ ++ nvbo = calloc(1, sizeof(struct nouveau_bo_priv)); ++ if (!nvbo) ++ return -ENOMEM; ++ nvbo->base.device = dev; ++ nvbo->base.size = size; ++ nvbo->base.tile_mode = tile_mode; ++ nvbo->base.tile_flags = tile_flags; ++ ++ nvbo->refcount = 1; ++ nvbo->flags = flags; ++ nvbo->size = size; ++ nvbo->align = align; ++ ++ if (flags & (NOUVEAU_BO_VRAM | NOUVEAU_BO_GART)) { ++ ret = nouveau_bo_kalloc(nvbo, NULL); ++ if (ret) { ++ nouveau_bo_ref(NULL, (void *)&nvbo); ++ return ret; ++ } ++ } ++ ++ *bo = &nvbo->base; ++ return 0; ++} ++ ++int ++nouveau_bo_new(struct nouveau_device *dev, uint32_t flags, int align, ++ int size, struct nouveau_bo **bo) ++{ ++ return nouveau_bo_new_tile(dev, flags, align, size, 0, 0, bo); ++} ++ ++int ++nouveau_bo_user(struct nouveau_device *dev, void *ptr, int size, ++ struct nouveau_bo **bo) ++{ ++ struct nouveau_bo_priv *nvbo; ++ int ret; ++ ++ ret = nouveau_bo_new(dev, NOUVEAU_BO_MAP, 0, size, bo); ++ if (ret) ++ return ret; ++ nvbo = nouveau_bo(*bo); ++ ++ nvbo->sysmem = ptr; ++ nvbo->user = 1; ++ return 0; ++} ++ ++int ++nouveau_bo_wrap(struct nouveau_device *dev, uint32_t handle, ++ struct nouveau_bo **bo) ++{ ++ struct nouveau_device_priv *nvdev = nouveau_device(dev); ++ struct drm_nouveau_gem_info req; ++ struct nouveau_bo_priv *nvbo; ++ int ret; ++ ++ ret = nouveau_bo_new(dev, 0, 0, 0, bo); ++ if (ret) ++ return ret; ++ nvbo = nouveau_bo(*bo); ++ ++ req.handle = handle; ++ ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_GEM_INFO, ++ &req, sizeof(req)); ++ if (ret) { ++ nouveau_bo_ref(NULL, bo); ++ return ret; ++ } ++ ++ nouveau_bo_info(nvbo, &req); ++ nvbo->base.size = nvbo->size; ++ return 0; ++} ++ ++int ++nouveau_bo_handle_get(struct nouveau_bo *bo, uint32_t *handle) ++{ ++ struct nouveau_device_priv *nvdev = nouveau_device(bo->device); ++ struct nouveau_bo_priv *nvbo = nouveau_bo(bo); ++ int ret; ++ ++ if (!bo || !handle) ++ return -EINVAL; ++ ++ if (!nvbo->global_handle) { ++ struct drm_gem_flink req; ++ ++ ret = nouveau_bo_kalloc(nvbo, NULL); ++ if (ret) ++ return ret; ++ ++ req.handle = nvbo->handle; ++ ret = drmIoctl(nvdev->fd, DRM_IOCTL_GEM_FLINK, &req); ++ if (ret) { ++ nouveau_bo_kfree(nvbo); ++ return ret; ++ } ++ ++ nvbo->global_handle = req.name; ++ } ++ ++ *handle = nvbo->global_handle; ++ return 0; ++} ++ ++int ++nouveau_bo_handle_ref(struct nouveau_device *dev, uint32_t handle, ++ struct nouveau_bo **bo) ++{ ++ struct nouveau_device_priv *nvdev = nouveau_device(dev); ++ struct nouveau_bo_priv *nvbo; ++ struct drm_gem_open req; ++ int ret; ++ ++ req.name = handle; ++ ret = drmIoctl(nvdev->fd, DRM_IOCTL_GEM_OPEN, &req); ++ if (ret) { ++ nouveau_bo_ref(NULL, bo); ++ return ret; ++ } ++ ++ ret = nouveau_bo_wrap(dev, req.handle, bo); ++ if (ret) { ++ nouveau_bo_ref(NULL, bo); ++ return ret; ++ } ++ ++ nvbo = nouveau_bo(*bo); ++ nvbo->base.handle = nvbo->handle; ++ return 0; ++} ++ ++static void ++nouveau_bo_del(struct nouveau_bo **bo) ++{ ++ struct nouveau_bo_priv *nvbo; ++ ++ if (!bo || !*bo) ++ return; ++ nvbo = nouveau_bo(*bo); ++ *bo = NULL; ++ ++ if (--nvbo->refcount) ++ return; ++ ++ if (nvbo->pending) { ++ nvbo->pending = NULL; ++ nouveau_pushbuf_flush(nvbo->pending_channel, 0); ++ } ++ ++ nouveau_bo_ufree(nvbo); ++ nouveau_bo_kfree(nvbo); ++ free(nvbo); ++} ++ ++int ++nouveau_bo_ref(struct nouveau_bo *ref, struct nouveau_bo **pbo) ++{ ++ if (!pbo) ++ return -EINVAL; ++ ++ if (ref) ++ nouveau_bo(ref)->refcount++; ++ ++ if (*pbo) ++ nouveau_bo_del(pbo); ++ ++ *pbo = ref; ++ return 0; ++} ++ ++static int ++nouveau_bo_wait(struct nouveau_bo *bo, int cpu_write, int no_wait, int no_block) ++{ ++ struct nouveau_device_priv *nvdev = nouveau_device(bo->device); ++ struct nouveau_bo_priv *nvbo = nouveau_bo(bo); ++ struct drm_nouveau_gem_cpu_prep req; ++ int ret; ++ ++ if (!nvbo->global_handle && !nvbo->write_marker && !cpu_write) ++ return 0; ++ ++ if (nvbo->pending && ++ (nvbo->pending->write_domains || cpu_write)) { ++ nvbo->pending = NULL; ++ nouveau_pushbuf_flush(nvbo->pending_channel, 0); ++ } ++ ++ req.handle = nvbo->handle; ++ req.flags = 0; ++ if (cpu_write) ++ req.flags |= NOUVEAU_GEM_CPU_PREP_WRITE; ++ if (no_wait) ++ req.flags |= NOUVEAU_GEM_CPU_PREP_NOWAIT; ++ if (no_block) ++ req.flags |= NOUVEAU_GEM_CPU_PREP_NOBLOCK; ++ ++ do { ++ ret = drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GEM_CPU_PREP, ++ &req, sizeof(req)); ++ } while (ret == -EAGAIN); ++ if (ret) ++ return ret; ++ ++ if (ret == 0) ++ nvbo->write_marker = 0; ++ return 0; ++} ++ ++int ++nouveau_bo_map_range(struct nouveau_bo *bo, uint32_t delta, uint32_t size, ++ uint32_t flags) ++{ ++ struct nouveau_bo_priv *nvbo = nouveau_bo(bo); ++ int ret; ++ ++ if (!nvbo || bo->map) ++ return -EINVAL; ++ ++ if (!nouveau_bo_allocated(nvbo)) { ++ if (nvbo->flags & (NOUVEAU_BO_VRAM | NOUVEAU_BO_GART)) { ++ ret = nouveau_bo_kalloc(nvbo, NULL); ++ if (ret) ++ return ret; ++ } ++ ++ if (!nouveau_bo_allocated(nvbo)) { ++ ret = nouveau_bo_ualloc(nvbo); ++ if (ret) ++ return ret; ++ } ++ } ++ ++ if (nvbo->sysmem) { ++ bo->map = (char *)nvbo->sysmem + delta; ++ } else { ++ ret = nouveau_bo_kmap(nvbo); ++ if (ret) ++ return ret; ++ ++ if (!(flags & NOUVEAU_BO_NOSYNC)) { ++ ret = nouveau_bo_wait(bo, (flags & NOUVEAU_BO_WR), ++ (flags & NOUVEAU_BO_NOWAIT), 0); ++ if (ret) ++ return ret; ++ ++ nvbo->map_refcnt++; ++ } ++ ++ bo->map = (char *)nvbo->map + delta; ++ } ++ ++ return 0; ++} ++ ++void ++nouveau_bo_map_flush(struct nouveau_bo *bo, uint32_t delta, uint32_t size) ++{ ++} ++ ++int ++nouveau_bo_map(struct nouveau_bo *bo, uint32_t flags) ++{ ++ return nouveau_bo_map_range(bo, 0, bo->size, flags); ++} ++ ++void ++nouveau_bo_unmap(struct nouveau_bo *bo) ++{ ++ struct nouveau_bo_priv *nvbo = nouveau_bo(bo); ++ ++ if (bo->map && !nvbo->sysmem && nvbo->map_refcnt) { ++ struct nouveau_device_priv *nvdev = nouveau_device(bo->device); ++ struct drm_nouveau_gem_cpu_fini req; ++ ++ req.handle = nvbo->handle; ++ drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GEM_CPU_FINI, ++ &req, sizeof(req)); ++ nvbo->map_refcnt--; ++ } ++ ++ bo->map = NULL; ++} ++ ++int ++nouveau_bo_busy(struct nouveau_bo *bo, uint32_t access) ++{ ++ return nouveau_bo_wait(bo, (access & NOUVEAU_BO_WR), 1, 1); ++} ++ ++uint32_t ++nouveau_bo_pending(struct nouveau_bo *bo) ++{ ++ struct nouveau_bo_priv *nvbo = nouveau_bo(bo); ++ uint32_t flags; ++ ++ if (!nvbo->pending) ++ return 0; ++ ++ flags = 0; ++ if (nvbo->pending->read_domains) ++ flags |= NOUVEAU_BO_RD; ++ if (nvbo->pending->write_domains) ++ flags |= NOUVEAU_BO_WR; ++ ++ return flags; ++} ++ ++struct drm_nouveau_gem_pushbuf_bo * ++nouveau_bo_emit_buffer(struct nouveau_channel *chan, struct nouveau_bo *bo) ++{ ++ struct nouveau_pushbuf_priv *nvpb = &nouveau_channel(chan)->pb; ++ struct nouveau_bo_priv *nvbo = nouveau_bo(bo); ++ struct drm_nouveau_gem_pushbuf_bo *pbbo; ++ struct nouveau_bo *ref = NULL; ++ int ret; ++ ++ if (nvbo->pending) ++ return nvbo->pending; ++ ++ if (!nvbo->handle) { ++ ret = nouveau_bo_kalloc(nvbo, chan); ++ if (ret) ++ return NULL; ++ ++ if (nvbo->sysmem) { ++ void *sysmem_tmp = nvbo->sysmem; ++ ++ nvbo->sysmem = NULL; ++ ret = nouveau_bo_map(bo, NOUVEAU_BO_WR); ++ if (ret) ++ return NULL; ++ nvbo->sysmem = sysmem_tmp; ++ ++ memcpy(bo->map, nvbo->sysmem, nvbo->base.size); ++ nouveau_bo_ufree(nvbo); ++ nouveau_bo_unmap(bo); ++ } ++ } ++ ++ if (nvpb->nr_buffers >= NOUVEAU_GEM_MAX_BUFFERS) ++ return NULL; ++ pbbo = nvpb->buffers + nvpb->nr_buffers++; ++ nvbo->pending = pbbo; ++ nvbo->pending_channel = chan; ++ nvbo->pending_refcnt = 0; ++ ++ nouveau_bo_ref(bo, &ref); ++ pbbo->user_priv = (uint64_t)(unsigned long)ref; ++ pbbo->handle = nvbo->handle; ++ pbbo->valid_domains = NOUVEAU_GEM_DOMAIN_VRAM | NOUVEAU_GEM_DOMAIN_GART; ++ pbbo->read_domains = 0; ++ pbbo->write_domains = 0; ++ pbbo->presumed.domain = nvbo->domain; ++ pbbo->presumed.offset = nvbo->offset; ++ pbbo->presumed.valid = 1; ++ return pbbo; ++} +diff --git a/nouveau-1/nouveau_bo.h b/nouveau-1/nouveau_bo.h +new file mode 100644 +index 0000000..3a1f2d4 +--- /dev/null ++++ b/nouveau-1/nouveau_bo.h +@@ -0,0 +1,104 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 __NOUVEAU_BO_H__ ++#define __NOUVEAU_BO_H__ ++ ++/* Relocation/Buffer type flags */ ++#define NOUVEAU_BO_VRAM (1 << 0) ++#define NOUVEAU_BO_GART (1 << 1) ++#define NOUVEAU_BO_RD (1 << 2) ++#define NOUVEAU_BO_WR (1 << 3) ++#define NOUVEAU_BO_RDWR (NOUVEAU_BO_RD | NOUVEAU_BO_WR) ++#define NOUVEAU_BO_MAP (1 << 4) ++#define NOUVEAU_BO_LOW (1 << 6) ++#define NOUVEAU_BO_HIGH (1 << 7) ++#define NOUVEAU_BO_OR (1 << 8) ++#define NOUVEAU_BO_INVAL (1 << 12) ++#define NOUVEAU_BO_NOSYNC (1 << 13) ++#define NOUVEAU_BO_NOWAIT (1 << 14) ++#define NOUVEAU_BO_IFLUSH (1 << 15) ++#define NOUVEAU_BO_DUMMY (1 << 31) ++ ++#define NOUVEAU_BO_TILE_LAYOUT_MASK 0x0000ff00 ++#define NOUVEAU_BO_TILE_16BPP 0x00000001 ++#define NOUVEAU_BO_TILE_32BPP 0x00000002 ++#define NOUVEAU_BO_TILE_ZETA 0x00000004 ++#define NOUVEAU_BO_TILE_SCANOUT 0x00000008 ++ ++struct nouveau_bo { ++ struct nouveau_device *device; ++ uint32_t handle; ++ ++ uint64_t size; ++ void *map; ++ ++ uint32_t tile_mode; ++ uint32_t tile_flags; ++}; ++ ++int ++nouveau_bo_new(struct nouveau_device *, uint32_t flags, int align, int size, ++ struct nouveau_bo **); ++ ++int ++nouveau_bo_new_tile(struct nouveau_device *, uint32_t flags, int align, ++ int size, uint32_t tile_mode, uint32_t tile_flags, ++ struct nouveau_bo **); ++ ++int ++nouveau_bo_user(struct nouveau_device *, void *ptr, int size, ++ struct nouveau_bo **); ++ ++int ++nouveau_bo_wrap(struct nouveau_device *, uint32_t handle, struct nouveau_bo **); ++ ++int ++nouveau_bo_handle_get(struct nouveau_bo *, uint32_t *); ++ ++int ++nouveau_bo_handle_ref(struct nouveau_device *, uint32_t handle, ++ struct nouveau_bo **); ++ ++int ++nouveau_bo_ref(struct nouveau_bo *, struct nouveau_bo **); ++ ++int ++nouveau_bo_map_range(struct nouveau_bo *, uint32_t delta, uint32_t size, ++ uint32_t flags); ++ ++void ++nouveau_bo_map_flush(struct nouveau_bo *, uint32_t delta, uint32_t size); ++ ++int ++nouveau_bo_map(struct nouveau_bo *, uint32_t flags); ++ ++void ++nouveau_bo_unmap(struct nouveau_bo *); ++ ++int ++nouveau_bo_busy(struct nouveau_bo *, uint32_t access); ++ ++uint32_t ++nouveau_bo_pending(struct nouveau_bo *); ++ ++#endif +diff --git a/nouveau-1/nouveau_channel.c b/nouveau-1/nouveau_channel.c +new file mode 100644 +index 0000000..96fa03b +--- /dev/null ++++ b/nouveau-1/nouveau_channel.c +@@ -0,0 +1,142 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 ++#include ++#include ++ ++#include "nouveau_private.h" ++ ++int ++nouveau_channel_alloc(struct nouveau_device *dev, uint32_t fb_ctxdma, ++ uint32_t tt_ctxdma, int pushbuf_size, ++ struct nouveau_channel **chan) ++{ ++ struct nouveau_device_priv *nvdev = nouveau_device(dev); ++ struct nouveau_channel_priv *nvchan; ++ unsigned i; ++ int ret; ++ ++ if (!nvdev || !chan || *chan) ++ return -EINVAL; ++ ++ nvchan = calloc(1, sizeof(struct nouveau_channel_priv)); ++ if (!nvchan) ++ return -ENOMEM; ++ nvchan->base.device = dev; ++ ++ nvchan->drm.fb_ctxdma_handle = fb_ctxdma; ++ nvchan->drm.tt_ctxdma_handle = tt_ctxdma; ++ ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_CHANNEL_ALLOC, ++ &nvchan->drm, sizeof(nvchan->drm)); ++ if (ret) { ++ free(nvchan); ++ return ret; ++ } ++ ++ nvchan->base.id = nvchan->drm.channel; ++ if (nouveau_grobj_ref(&nvchan->base, nvchan->drm.fb_ctxdma_handle, ++ &nvchan->base.vram) || ++ nouveau_grobj_ref(&nvchan->base, nvchan->drm.tt_ctxdma_handle, ++ &nvchan->base.gart)) { ++ nouveau_channel_free((void *)&nvchan); ++ return -EINVAL; ++ } ++ ++ /* Mark all DRM-assigned subchannels as in-use */ ++ for (i = 0; i < nvchan->drm.nr_subchan; i++) { ++ struct nouveau_grobj_priv *gr = calloc(1, sizeof(*gr)); ++ ++ gr->base.bound = NOUVEAU_GROBJ_BOUND_EXPLICIT; ++ gr->base.subc = i; ++ gr->base.handle = nvchan->drm.subchan[i].handle; ++ gr->base.grclass = nvchan->drm.subchan[i].grclass; ++ gr->base.channel = &nvchan->base; ++ ++ nvchan->base.subc[i].gr = &gr->base; ++ } ++ ++ if (dev->chipset < 0xc0) { ++ ret = nouveau_bo_wrap(dev, nvchan->drm.notifier_handle, ++ &nvchan->notifier_bo); ++ if (!ret) ++ ret = nouveau_bo_map(nvchan->notifier_bo, ++ NOUVEAU_BO_RDWR); ++ if (ret) { ++ nouveau_channel_free((void *)&nvchan); ++ return ret; ++ } ++ ++ ret = nouveau_grobj_alloc(&nvchan->base, 0x00000000, 0x0030, ++ &nvchan->base.nullobj); ++ if (ret) { ++ nouveau_channel_free((void *)&nvchan); ++ return ret; ++ } ++ } ++ ++ ret = nouveau_pushbuf_init(&nvchan->base, pushbuf_size); ++ if (ret) { ++ nouveau_channel_free((void *)&nvchan); ++ return ret; ++ } ++ ++ *chan = &nvchan->base; ++ return 0; ++} ++ ++void ++nouveau_channel_free(struct nouveau_channel **chan) ++{ ++ struct nouveau_channel_priv *nvchan; ++ struct nouveau_device_priv *nvdev; ++ struct drm_nouveau_channel_free cf; ++ unsigned i; ++ ++ if (!chan || !*chan) ++ return; ++ nvchan = nouveau_channel(*chan); ++ (*chan)->flush_notify = NULL; ++ *chan = NULL; ++ nvdev = nouveau_device(nvchan->base.device); ++ ++ FIRE_RING(&nvchan->base); ++ ++ nouveau_pushbuf_fini(&nvchan->base); ++ if (nvchan->notifier_bo) { ++ nouveau_bo_unmap(nvchan->notifier_bo); ++ nouveau_bo_ref(NULL, &nvchan->notifier_bo); ++ } ++ ++ for (i = 0; i < nvchan->drm.nr_subchan; i++) ++ free(nvchan->base.subc[i].gr); ++ ++ nouveau_grobj_free(&nvchan->base.vram); ++ nouveau_grobj_free(&nvchan->base.gart); ++ nouveau_grobj_free(&nvchan->base.nullobj); ++ ++ cf.channel = nvchan->drm.channel; ++ drmCommandWrite(nvdev->fd, DRM_NOUVEAU_CHANNEL_FREE, &cf, sizeof(cf)); ++ free(nvchan); ++} ++ ++ +diff --git a/nouveau-1/nouveau_channel.h b/nouveau-1/nouveau_channel.h +new file mode 100644 +index 0000000..d61a4c0 +--- /dev/null ++++ b/nouveau-1/nouveau_channel.h +@@ -0,0 +1,57 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 __NOUVEAU_CHANNEL_H__ ++#define __NOUVEAU_CHANNEL_H__ ++ ++struct nouveau_subchannel { ++ struct nouveau_grobj *gr; ++ unsigned sequence; ++}; ++ ++struct nouveau_channel { ++ uint32_t *cur; ++ uint32_t *end; ++ ++ struct nouveau_device *device; ++ int id; ++ ++ struct nouveau_grobj *nullobj; ++ struct nouveau_grobj *vram; ++ struct nouveau_grobj *gart; ++ ++ void *user_private; ++ void (*hang_notify)(struct nouveau_channel *); ++ void (*flush_notify)(struct nouveau_channel *); ++ ++ struct nouveau_subchannel subc[8]; ++ unsigned subc_sequence; ++}; ++ ++int ++nouveau_channel_alloc(struct nouveau_device *, uint32_t fb, uint32_t tt, ++ int pushbuf_size, struct nouveau_channel **); ++ ++void ++nouveau_channel_free(struct nouveau_channel **); ++ ++#endif +diff --git a/nouveau-1/nouveau_device.c b/nouveau-1/nouveau_device.c +new file mode 100644 +index 0000000..425c5d2 +--- /dev/null ++++ b/nouveau-1/nouveau_device.c +@@ -0,0 +1,198 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 ++#include ++#include ++ ++#include "nouveau_private.h" ++ ++int ++nouveau_device_open_existing(struct nouveau_device **dev, int close, ++ int fd, drm_context_t ctx) ++{ ++ struct nouveau_device_priv *nvdev; ++ drmVersionPtr ver; ++ uint64_t value; ++ int ret; ++ ++ if (!dev || *dev) ++ return -EINVAL; ++ ++ nvdev = calloc(1, sizeof(*nvdev)); ++ if (!nvdev) ++ return -ENOMEM; ++ nvdev->fd = fd; ++ nvdev->ctx = ctx; ++ nvdev->needs_close = close; ++ ++ ver = drmGetVersion(fd); ++ if (!ver) { ++ nouveau_device_close((void *)&nvdev); ++ return -EINVAL; ++ } ++ ++ if ((ver->version_major == 0 && ver->version_patchlevel != 16) || ++ ver->version_major > 1) { ++ nouveau_device_close((void *)&nvdev); ++ return -EINVAL; ++ } ++ ++ drmFreeVersion(ver); ++ ++ ret = nouveau_device_get_param(&nvdev->base, ++ NOUVEAU_GETPARAM_VM_VRAM_BASE, &value); ++ if (ret) { ++ nouveau_device_close((void *)&nvdev); ++ return ret; ++ } ++ nvdev->base.vm_vram_base = value; ++ ++ ret = nouveau_device_get_param(&nvdev->base, ++ NOUVEAU_GETPARAM_FB_SIZE, &value); ++ if (ret) { ++ nouveau_device_close((void *)&nvdev); ++ return ret; ++ } ++ nvdev->base.vm_vram_size = value; ++ ++ ret = nouveau_device_get_param(&nvdev->base, ++ NOUVEAU_GETPARAM_AGP_SIZE, &value); ++ if (ret) { ++ nouveau_device_close((void *)&nvdev); ++ return ret; ++ } ++ nvdev->base.vm_gart_size = value; ++ ++ ret = nouveau_bo_init(&nvdev->base); ++ if (ret) { ++ nouveau_device_close((void *)&nvdev); ++ return ret; ++ } ++ ++ ret = nouveau_device_get_param(&nvdev->base, ++ NOUVEAU_GETPARAM_CHIPSET_ID, &value); ++ if (ret) { ++ nouveau_device_close((void *)&nvdev); ++ return ret; ++ } ++ nvdev->base.chipset = value; ++ ++ ret = nouveau_device_get_param(&nvdev->base, ++ NOUVEAU_GETPARAM_HAS_BO_USAGE, &value); ++ if (!ret) ++ nvdev->has_bo_usage = value; ++ ++ *dev = &nvdev->base; ++ return 0; ++} ++ ++int ++nouveau_device_open(struct nouveau_device **dev, const char *busid) ++{ ++ drm_context_t ctx; ++ int fd, ret; ++ ++ if (!dev || *dev) ++ return -EINVAL; ++ ++ fd = drmOpen("nouveau", busid); ++ if (fd < 0) ++ return -EINVAL; ++ ++ ret = drmCreateContext(fd, &ctx); ++ if (ret) { ++ drmClose(fd); ++ return ret; ++ } ++ ++ ret = nouveau_device_open_existing(dev, 1, fd, ctx); ++ if (ret) { ++ drmDestroyContext(fd, ctx); ++ drmClose(fd); ++ return ret; ++ } ++ ++ return 0; ++} ++ ++void ++nouveau_device_close(struct nouveau_device **dev) ++{ ++ struct nouveau_device_priv *nvdev; ++ ++ if (!dev || !*dev) ++ return; ++ nvdev = nouveau_device(*dev); ++ *dev = NULL; ++ ++ nouveau_bo_takedown(&nvdev->base); ++ ++ if (nvdev->needs_close) { ++ drmDestroyContext(nvdev->fd, nvdev->ctx); ++ drmClose(nvdev->fd); ++ } ++ free(nvdev); ++} ++ ++int ++nouveau_device_get_param(struct nouveau_device *dev, ++ uint64_t param, uint64_t *value) ++{ ++ struct nouveau_device_priv *nvdev = nouveau_device(dev); ++ struct drm_nouveau_getparam g; ++ int ret; ++ ++ if (!nvdev || !value) ++ return -EINVAL; ++ ++ g.param = param; ++ ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_GETPARAM, ++ &g, sizeof(g)); ++ if (ret) ++ return ret; ++ ++ *value = g.value; ++ return 0; ++} ++ ++int ++nouveau_device_set_param(struct nouveau_device *dev, ++ uint64_t param, uint64_t value) ++{ ++ struct nouveau_device_priv *nvdev = nouveau_device(dev); ++ struct drm_nouveau_setparam s; ++ int ret; ++ ++ if (!nvdev) ++ return -EINVAL; ++ ++ s.param = param; ++ s.value = value; ++ ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_SETPARAM, ++ &s, sizeof(s)); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ +diff --git a/nouveau-1/nouveau_device.h b/nouveau-1/nouveau_device.h +new file mode 100644 +index 0000000..c0d9333 +--- /dev/null ++++ b/nouveau-1/nouveau_device.h +@@ -0,0 +1,33 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 __NOUVEAU_DEVICE_H__ ++#define __NOUVEAU_DEVICE_H__ ++ ++struct nouveau_device { ++ unsigned chipset; ++ uint64_t vm_vram_base; ++ uint64_t vm_vram_size; ++ uint64_t vm_gart_size; ++}; ++ ++#endif +diff --git a/nouveau-1/nouveau_drmif.h b/nouveau-1/nouveau_drmif.h +new file mode 100644 +index 0000000..ec226a2 +--- /dev/null ++++ b/nouveau-1/nouveau_drmif.h +@@ -0,0 +1,58 @@ ++/* ++ * Copyright 2008 Nouveau Project ++ * ++ * 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 __NOUVEAU_DRMIF_H__ ++#define __NOUVEAU_DRMIF_H__ ++ ++#include ++#include ++ ++#include "nouveau_device.h" ++ ++struct nouveau_device_priv { ++ struct nouveau_device base; ++ ++ int fd; ++ drm_context_t ctx; ++ drmLock *lock; ++ int needs_close; ++ int has_bo_usage; ++}; ++#define nouveau_device(n) ((struct nouveau_device_priv *)(n)) ++ ++int ++nouveau_device_open_existing(struct nouveau_device **, int close, ++ int fd, drm_context_t ctx); ++ ++int ++nouveau_device_open(struct nouveau_device **, const char *busid); ++ ++void ++nouveau_device_close(struct nouveau_device **); ++ ++int ++nouveau_device_get_param(struct nouveau_device *, uint64_t param, uint64_t *v); ++ ++int ++nouveau_device_set_param(struct nouveau_device *, uint64_t param, uint64_t val); ++ ++#endif +diff --git a/nouveau-1/nouveau_grobj.c b/nouveau-1/nouveau_grobj.c +new file mode 100644 +index 0000000..36344b9 +--- /dev/null ++++ b/nouveau-1/nouveau_grobj.c +@@ -0,0 +1,148 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 ++#include ++ ++#include "nouveau_private.h" ++ ++int ++nouveau_grobj_alloc(struct nouveau_channel *chan, uint32_t handle, ++ int class, struct nouveau_grobj **grobj) ++{ ++ struct nouveau_device_priv *nvdev = nouveau_device(chan->device); ++ struct nouveau_grobj_priv *nvgrobj; ++ struct drm_nouveau_grobj_alloc g; ++ int ret; ++ ++ if (!nvdev || !grobj || *grobj) ++ return -EINVAL; ++ ++ nvgrobj = calloc(1, sizeof(*nvgrobj)); ++ if (!nvgrobj) ++ return -ENOMEM; ++ nvgrobj->base.channel = chan; ++ nvgrobj->base.handle = handle; ++ nvgrobj->base.grclass = class; ++ nvgrobj->base.bound = NOUVEAU_GROBJ_UNBOUND; ++ nvgrobj->base.subc = -1; ++ ++ g.channel = chan->id; ++ g.handle = handle; ++ g.class = class; ++ ret = drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GROBJ_ALLOC, ++ &g, sizeof(g)); ++ if (ret) { ++ nouveau_grobj_free((void *)&nvgrobj); ++ return ret; ++ } ++ ++ *grobj = &nvgrobj->base; ++ return 0; ++} ++ ++int ++nouveau_grobj_ref(struct nouveau_channel *chan, uint32_t handle, ++ struct nouveau_grobj **grobj) ++{ ++ struct nouveau_grobj_priv *nvgrobj; ++ ++ if (!chan || !grobj || *grobj) ++ return -EINVAL; ++ ++ nvgrobj = calloc(1, sizeof(struct nouveau_grobj_priv)); ++ if (!nvgrobj) ++ return -ENOMEM; ++ nvgrobj->base.channel = chan; ++ nvgrobj->base.handle = handle; ++ nvgrobj->base.grclass = 0; ++ ++ *grobj = &nvgrobj->base; ++ return 0; ++} ++ ++void ++nouveau_grobj_free(struct nouveau_grobj **grobj) ++{ ++ struct nouveau_device_priv *nvdev; ++ struct nouveau_channel_priv *chan; ++ struct nouveau_grobj_priv *nvgrobj; ++ ++ if (!grobj || !*grobj) ++ return; ++ nvgrobj = nouveau_grobj(*grobj); ++ *grobj = NULL; ++ ++ ++ chan = nouveau_channel(nvgrobj->base.channel); ++ nvdev = nouveau_device(chan->base.device); ++ ++ if (nvgrobj->base.grclass) { ++ struct drm_nouveau_gpuobj_free f; ++ ++ FIRE_RING(&chan->base); ++ f.channel = chan->drm.channel; ++ f.handle = nvgrobj->base.handle; ++ drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE, ++ &f, sizeof(f)); ++ } ++ if (nvgrobj->base.bound != NOUVEAU_GROBJ_UNBOUND) ++ chan->base.subc[nvgrobj->base.subc].gr = NULL; ++ free(nvgrobj); ++} ++ ++void ++nouveau_grobj_autobind(struct nouveau_grobj *grobj) ++{ ++ struct nouveau_channel *chan = grobj->channel; ++ struct nouveau_subchannel *subc = NULL; ++ int i; ++ ++ for (i = 0; i < 8; i++) { ++ struct nouveau_subchannel *scc = &grobj->channel->subc[i]; ++ ++ if (scc->gr && scc->gr->bound == NOUVEAU_GROBJ_BOUND_EXPLICIT) ++ continue; ++ ++ if (!subc || scc->sequence < subc->sequence) ++ subc = scc; ++ } ++ ++ if (subc->gr) { ++ subc->gr->bound = NOUVEAU_GROBJ_UNBOUND; ++ subc->gr->subc = -1; ++ } ++ ++ subc->gr = grobj; ++ subc->gr->bound = NOUVEAU_GROBJ_BOUND; ++ subc->gr->subc = subc - &grobj->channel->subc[0]; ++ ++ WAIT_RING(chan, 2); ++ if (chan->device->chipset < 0xc0) { ++ OUT_RING (chan, (1 << 18) | (grobj->subc << 13)); ++ OUT_RING (chan, grobj->handle); ++ } else { ++ OUT_RING (chan, (2 << 28) | (1 << 16) | (grobj->subc << 13)); ++ OUT_RING (chan, grobj->grclass); ++ } ++} ++ +diff --git a/nouveau-1/nouveau_grobj.h b/nouveau-1/nouveau_grobj.h +new file mode 100644 +index 0000000..51ac7d9 +--- /dev/null ++++ b/nouveau-1/nouveau_grobj.h +@@ -0,0 +1,48 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 __NOUVEAU_GROBJ_H__ ++#define __NOUVEAU_GROBJ_H__ ++ ++#include "nouveau_channel.h" ++ ++struct nouveau_grobj { ++ struct nouveau_channel *channel; ++ int grclass; ++ uint32_t handle; ++ ++ enum { ++ NOUVEAU_GROBJ_UNBOUND = 0, ++ NOUVEAU_GROBJ_BOUND = 1, ++ NOUVEAU_GROBJ_BOUND_EXPLICIT = 2 ++ } bound; ++ int subc; ++}; ++ ++int nouveau_grobj_alloc(struct nouveau_channel *, uint32_t handle, ++ int class, struct nouveau_grobj **); ++int nouveau_grobj_ref(struct nouveau_channel *, uint32_t handle, ++ struct nouveau_grobj **); ++void nouveau_grobj_free(struct nouveau_grobj **); ++void nouveau_grobj_autobind(struct nouveau_grobj *); ++ ++#endif +diff --git a/nouveau-1/nouveau_notifier.c b/nouveau-1/nouveau_notifier.c +new file mode 100644 +index 0000000..513fa63 +--- /dev/null ++++ b/nouveau-1/nouveau_notifier.c +@@ -0,0 +1,148 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 ++#include ++#include ++ ++#include "nouveau_private.h" ++ ++#define NOTIFIER(__v) \ ++ struct nouveau_notifier_priv *nvnotify = nouveau_notifier(notifier); \ ++ volatile uint32_t *__v = (uint32_t *)((char *)nvnotify->map + (id * 32)) ++ ++int ++nouveau_notifier_alloc(struct nouveau_channel *chan, uint32_t handle, ++ int count, struct nouveau_notifier **notifier) ++{ ++ struct nouveau_notifier_priv *nvnotify; ++ int ret; ++ ++ if (!chan || !notifier || *notifier) ++ return -EINVAL; ++ ++ nvnotify = calloc(1, sizeof(struct nouveau_notifier_priv)); ++ if (!nvnotify) ++ return -ENOMEM; ++ nvnotify->base.channel = chan; ++ nvnotify->base.handle = handle; ++ ++ nvnotify->drm.channel = chan->id; ++ nvnotify->drm.handle = handle; ++ nvnotify->drm.size = (count * 32); ++ if ((ret = drmCommandWriteRead(nouveau_device(chan->device)->fd, ++ DRM_NOUVEAU_NOTIFIEROBJ_ALLOC, ++ &nvnotify->drm, ++ sizeof(nvnotify->drm)))) { ++ nouveau_notifier_free((void *)&nvnotify); ++ return ret; ++ } ++ ++ nvnotify->map = (char *)nouveau_channel(chan)->notifier_bo->map + ++ nvnotify->drm.offset; ++ *notifier = &nvnotify->base; ++ return 0; ++} ++ ++void ++nouveau_notifier_free(struct nouveau_notifier **notifier) ++{ ++ ++ struct nouveau_notifier_priv *nvnotify; ++ struct nouveau_channel_priv *nvchan; ++ struct nouveau_device_priv *nvdev; ++ struct drm_nouveau_gpuobj_free f; ++ ++ if (!notifier || !*notifier) ++ return; ++ nvnotify = nouveau_notifier(*notifier); ++ *notifier = NULL; ++ ++ nvchan = nouveau_channel(nvnotify->base.channel); ++ nvdev = nouveau_device(nvchan->base.device); ++ ++ FIRE_RING(&nvchan->base); ++ ++ f.channel = nvchan->drm.channel; ++ f.handle = nvnotify->base.handle; ++ drmCommandWrite(nvdev->fd, DRM_NOUVEAU_GPUOBJ_FREE, &f, sizeof(f)); ++ free(nvnotify); ++} ++ ++void ++nouveau_notifier_reset(struct nouveau_notifier *notifier, int id) ++{ ++ NOTIFIER(n); ++ ++ n[NV_NOTIFY_TIME_0 /4] = 0x00000000; ++ n[NV_NOTIFY_TIME_1 /4] = 0x00000000; ++ n[NV_NOTIFY_RETURN_VALUE/4] = 0x00000000; ++ n[NV_NOTIFY_STATE /4] = (NV_NOTIFY_STATE_STATUS_IN_PROCESS << ++ NV_NOTIFY_STATE_STATUS_SHIFT); ++} ++ ++uint32_t ++nouveau_notifier_status(struct nouveau_notifier *notifier, int id) ++{ ++ NOTIFIER(n); ++ ++ return n[NV_NOTIFY_STATE/4] >> NV_NOTIFY_STATE_STATUS_SHIFT; ++} ++ ++uint32_t ++nouveau_notifier_return_val(struct nouveau_notifier *notifier, int id) ++{ ++ NOTIFIER(n); ++ ++ return n[NV_NOTIFY_RETURN_VALUE/4]; ++} ++ ++static inline double ++gettime(void) ++{ ++ struct timeval tv; ++ ++ gettimeofday(&tv, NULL); ++ return (double)tv.tv_sec + tv.tv_usec / 1000000.0; ++} ++ ++int ++nouveau_notifier_wait_status(struct nouveau_notifier *notifier, int id, ++ uint32_t status, double timeout) ++{ ++ NOTIFIER(n); ++ double time = 0, t_start = gettime(); ++ ++ while (time <= timeout) { ++ uint32_t v; ++ ++ v = n[NV_NOTIFY_STATE/4] >> NV_NOTIFY_STATE_STATUS_SHIFT; ++ if (v == status) ++ return 0; ++ ++ if (timeout) ++ time = gettime() - t_start; ++ } ++ ++ return -EBUSY; ++} ++ +diff --git a/nouveau-1/nouveau_notifier.h b/nouveau-1/nouveau_notifier.h +new file mode 100644 +index 0000000..dbc6a3b +--- /dev/null ++++ b/nouveau-1/nouveau_notifier.h +@@ -0,0 +1,63 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 __NOUVEAU_NOTIFIER_H__ ++#define __NOUVEAU_NOTIFIER_H__ ++ ++#define NV_NOTIFIER_SIZE 32 ++#define NV_NOTIFY_TIME_0 0x00000000 ++#define NV_NOTIFY_TIME_1 0x00000004 ++#define NV_NOTIFY_RETURN_VALUE 0x00000008 ++#define NV_NOTIFY_STATE 0x0000000C ++#define NV_NOTIFY_STATE_STATUS_MASK 0xFF000000 ++#define NV_NOTIFY_STATE_STATUS_SHIFT 24 ++#define NV_NOTIFY_STATE_STATUS_COMPLETED 0x00 ++#define NV_NOTIFY_STATE_STATUS_IN_PROCESS 0x01 ++#define NV_NOTIFY_STATE_ERROR_CODE_MASK 0x0000FFFF ++#define NV_NOTIFY_STATE_ERROR_CODE_SHIFT 0 ++ ++struct nouveau_notifier { ++ struct nouveau_channel *channel; ++ uint32_t handle; ++}; ++ ++int ++nouveau_notifier_alloc(struct nouveau_channel *, uint32_t handle, int count, ++ struct nouveau_notifier **); ++ ++void ++nouveau_notifier_free(struct nouveau_notifier **); ++ ++void ++nouveau_notifier_reset(struct nouveau_notifier *, int id); ++ ++uint32_t ++nouveau_notifier_status(struct nouveau_notifier *, int id); ++ ++uint32_t ++nouveau_notifier_return_val(struct nouveau_notifier *, int id); ++ ++int ++nouveau_notifier_wait_status(struct nouveau_notifier *, int id, uint32_t status, ++ double timeout); ++ ++#endif +diff --git a/nouveau-1/nouveau_private.h b/nouveau-1/nouveau_private.h +new file mode 100644 +index 0000000..124fe87 +--- /dev/null ++++ b/nouveau-1/nouveau_private.h +@@ -0,0 +1,136 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 __NOUVEAU_PRIVATE_H__ ++#define __NOUVEAU_PRIVATE_H__ ++ ++#include ++#include ++#include ++ ++#include "nouveau_drmif.h" ++#include "nouveau_device.h" ++#include "nouveau_channel.h" ++#include "nouveau_grobj.h" ++#include "nouveau_notifier.h" ++#include "nouveau_bo.h" ++#include "nouveau_resource.h" ++#include "nouveau_pushbuf.h" ++#include "nouveau_reloc.h" ++ ++#define CALPB_BUFFERS 3 ++ ++struct nouveau_pushbuf_priv { ++ uint32_t cal_suffix0; ++ uint32_t cal_suffix1; ++ struct nouveau_bo *buffer[CALPB_BUFFERS]; ++ int current; ++ int current_offset; ++ ++ unsigned *pushbuf; ++ unsigned size; ++ ++ uint32_t *marker; ++ unsigned marker_offset; ++ unsigned marker_relocs; ++ unsigned marker_push; ++ ++ struct drm_nouveau_gem_pushbuf_bo *buffers; ++ unsigned nr_buffers; ++ struct drm_nouveau_gem_pushbuf_reloc *relocs; ++ unsigned nr_relocs; ++ struct drm_nouveau_gem_pushbuf_push push[NOUVEAU_GEM_MAX_PUSH]; ++ unsigned nr_push; ++}; ++#define nouveau_pushbuf(n) ((struct nouveau_pushbuf_priv *)(n)) ++ ++int ++nouveau_pushbuf_init(struct nouveau_channel *, int buf_size); ++void ++nouveau_pushbuf_fini(struct nouveau_channel *); ++ ++struct nouveau_channel_priv { ++ struct nouveau_channel base; ++ ++ struct drm_nouveau_channel_alloc drm; ++ ++ struct nouveau_bo *notifier_bo; ++ ++ struct nouveau_pushbuf_priv pb; ++}; ++#define nouveau_channel(n) ((struct nouveau_channel_priv *)(n)) ++ ++struct nouveau_grobj_priv { ++ struct nouveau_grobj base; ++}; ++#define nouveau_grobj(n) ((struct nouveau_grobj_priv *)(n)) ++ ++struct nouveau_notifier_priv { ++ struct nouveau_notifier base; ++ ++ struct drm_nouveau_notifierobj_alloc drm; ++ volatile void *map; ++}; ++#define nouveau_notifier(n) ((struct nouveau_notifier_priv *)(n)) ++ ++struct nouveau_bo_priv { ++ struct nouveau_bo base; ++ int refcount; ++ ++ /* Buffer configuration + usage hints */ ++ unsigned flags; ++ unsigned size; ++ unsigned align; ++ int user; ++ ++ /* Tracking */ ++ struct drm_nouveau_gem_pushbuf_bo *pending; ++ struct nouveau_channel *pending_channel; ++ int pending_refcnt; ++ int write_marker; ++ ++ /* Userspace object */ ++ void *sysmem; ++ ++ /* Kernel object */ ++ uint32_t global_handle; ++ drm_handle_t handle; ++ uint64_t map_handle; ++ int map_refcnt; ++ void *map; ++ ++ /* Last known information from kernel on buffer status */ ++ uint64_t offset; ++ uint32_t domain; ++}; ++#define nouveau_bo(n) ((struct nouveau_bo_priv *)(n)) ++ ++int ++nouveau_bo_init(struct nouveau_device *); ++ ++void ++nouveau_bo_takedown(struct nouveau_device *); ++ ++struct drm_nouveau_gem_pushbuf_bo * ++nouveau_bo_emit_buffer(struct nouveau_channel *, struct nouveau_bo *); ++ ++#endif +diff --git a/nouveau-1/nouveau_pushbuf.c b/nouveau-1/nouveau_pushbuf.c +new file mode 100644 +index 0000000..59f60d9 +--- /dev/null ++++ b/nouveau-1/nouveau_pushbuf.c +@@ -0,0 +1,344 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 ++#include ++#include ++#include ++ ++#include "nouveau_private.h" ++ ++#define PB_BUFMGR_DWORDS (4096 / 2) ++#define PB_MIN_USER_DWORDS 2048 ++ ++static int ++nouveau_pushbuf_space(struct nouveau_channel *chan, unsigned min) ++{ ++ struct nouveau_channel_priv *nvchan = nouveau_channel(chan); ++ struct nouveau_pushbuf_priv *nvpb = &nvchan->pb; ++ struct nouveau_bo *bo; ++ int ret; ++ ++ if (min < PB_MIN_USER_DWORDS) ++ min = PB_MIN_USER_DWORDS; ++ ++ nvpb->current_offset = chan->cur - nvpb->pushbuf; ++ if (chan->cur + min + 2 <= chan->end) ++ return 0; ++ ++ nvpb->current++; ++ if (nvpb->current == CALPB_BUFFERS) ++ nvpb->current = 0; ++ bo = nvpb->buffer[nvpb->current]; ++ ++ ret = nouveau_bo_map(bo, NOUVEAU_BO_WR); ++ if (ret) ++ return ret; ++ ++ nvpb->size = (bo->size - 8) / 4; ++ nvpb->pushbuf = bo->map; ++ nvpb->current_offset = 0; ++ ++ chan->cur = nvpb->pushbuf; ++ chan->end = nvpb->pushbuf + nvpb->size; ++ ++ nouveau_bo_unmap(bo); ++ return 0; ++} ++ ++static void ++nouveau_pushbuf_fini_call(struct nouveau_channel *chan) ++{ ++ struct nouveau_channel_priv *nvchan = nouveau_channel(chan); ++ struct nouveau_pushbuf_priv *nvpb = &nvchan->pb; ++ int i; ++ ++ for (i = 0; i < CALPB_BUFFERS; i++) ++ nouveau_bo_ref(NULL, &nvpb->buffer[i]); ++ nvpb->pushbuf = NULL; ++} ++ ++static int ++nouveau_pushbuf_init_call(struct nouveau_channel *chan, int buf_size) ++{ ++ struct drm_nouveau_gem_pushbuf req; ++ struct nouveau_channel_priv *nvchan = nouveau_channel(chan); ++ struct nouveau_pushbuf_priv *nvpb = &nvchan->pb; ++ struct nouveau_device *dev = chan->device; ++ uint32_t flags = 0; ++ int i, ret; ++ ++ if (nvchan->drm.pushbuf_domains & NOUVEAU_GEM_DOMAIN_GART) ++ flags |= NOUVEAU_BO_GART; ++ else ++ flags |= NOUVEAU_BO_VRAM; ++ ++ req.channel = chan->id; ++ req.nr_push = 0; ++ ret = drmCommandWriteRead(nouveau_device(dev)->fd, ++ DRM_NOUVEAU_GEM_PUSHBUF, &req, sizeof(req)); ++ if (ret) ++ return ret; ++ ++ for (i = 0; i < CALPB_BUFFERS; i++) { ++ ret = nouveau_bo_new(dev, flags | NOUVEAU_BO_MAP, ++ 0, buf_size, &nvpb->buffer[i]); ++ if (ret) { ++ nouveau_pushbuf_fini_call(chan); ++ return ret; ++ } ++ } ++ ++ nvpb->cal_suffix0 = req.suffix0; ++ nvpb->cal_suffix1 = req.suffix1; ++ return 0; ++} ++ ++int ++nouveau_pushbuf_init(struct nouveau_channel *chan, int buf_size) ++{ ++ struct nouveau_channel_priv *nvchan = nouveau_channel(chan); ++ struct nouveau_pushbuf_priv *nvpb = &nvchan->pb; ++ int ret; ++ ++ ret = nouveau_pushbuf_init_call(chan, buf_size); ++ if (ret) ++ return ret; ++ ++ ret = nouveau_pushbuf_space(chan, 0); ++ if (ret) ++ return ret; ++ ++ nvpb->buffers = calloc(NOUVEAU_GEM_MAX_BUFFERS, ++ sizeof(struct drm_nouveau_gem_pushbuf_bo)); ++ nvpb->relocs = calloc(NOUVEAU_GEM_MAX_RELOCS, ++ sizeof(struct drm_nouveau_gem_pushbuf_reloc)); ++ return 0; ++} ++ ++void ++nouveau_pushbuf_fini(struct nouveau_channel *chan) ++{ ++ struct nouveau_channel_priv *nvchan = nouveau_channel(chan); ++ struct nouveau_pushbuf_priv *nvpb = &nvchan->pb; ++ nouveau_pushbuf_fini_call(chan); ++ free(nvpb->buffers); ++ free(nvpb->relocs); ++} ++ ++static int ++nouveau_pushbuf_bo_add(struct nouveau_channel *chan, struct nouveau_bo *bo, ++ unsigned offset, unsigned length) ++{ ++ struct nouveau_channel_priv *nvchan = nouveau_channel(chan); ++ struct nouveau_pushbuf_priv *nvpb = &nvchan->pb; ++ struct drm_nouveau_gem_pushbuf_push *p = &nvpb->push[nvpb->nr_push++]; ++ struct drm_nouveau_gem_pushbuf_bo *pbbo; ++ struct nouveau_bo_priv *nvbo = nouveau_bo(bo); ++ ++ pbbo = nouveau_bo_emit_buffer(chan, bo); ++ if (!pbbo) ++ return -ENOMEM; ++ pbbo->valid_domains &= nvchan->drm.pushbuf_domains; ++ pbbo->read_domains |= nvchan->drm.pushbuf_domains; ++ nvbo->pending_refcnt++; ++ ++ p->bo_index = pbbo - nvpb->buffers; ++ p->offset = offset; ++ p->length = length; ++ return 0; ++} ++ ++int ++nouveau_pushbuf_submit(struct nouveau_channel *chan, struct nouveau_bo *bo, ++ unsigned offset, unsigned length) ++{ ++ struct nouveau_pushbuf_priv *nvpb = &nouveau_channel(chan)->pb; ++ int ret, len; ++ ++ if ((AVAIL_RING(chan) + nvpb->current_offset) != nvpb->size) { ++ if (nvpb->cal_suffix0 || nvpb->cal_suffix1) { ++ *(chan->cur++) = nvpb->cal_suffix0; ++ *(chan->cur++) = nvpb->cal_suffix1; ++ } ++ ++ len = (chan->cur - nvpb->pushbuf) - nvpb->current_offset; ++ ++ ret = nouveau_pushbuf_bo_add(chan, nvpb->buffer[nvpb->current], ++ nvpb->current_offset * 4, len * 4); ++ if (ret) ++ return ret; ++ ++ nvpb->current_offset += len; ++ } ++ ++ return bo ? nouveau_pushbuf_bo_add(chan, bo, offset, length) : 0; ++} ++ ++static void ++nouveau_pushbuf_bo_unref(struct nouveau_pushbuf_priv *nvpb, int index) ++{ ++ struct drm_nouveau_gem_pushbuf_bo *pbbo = &nvpb->buffers[index]; ++ struct nouveau_bo *bo = (void *)(unsigned long)pbbo->user_priv; ++ struct nouveau_bo_priv *nvbo = nouveau_bo(bo); ++ ++ if (--nvbo->pending_refcnt) ++ return; ++ ++ if (pbbo->presumed.valid == 0) { ++ nvbo->domain = pbbo->presumed.domain; ++ nvbo->offset = pbbo->presumed.offset; ++ } ++ ++ nvbo->pending = NULL; ++ nouveau_bo_ref(NULL, &bo); ++ ++ /* we only ever remove from the tail of the pending lists, ++ * so this is safe. ++ */ ++ nvpb->nr_buffers--; ++} ++ ++int ++nouveau_pushbuf_flush(struct nouveau_channel *chan, unsigned min) ++{ ++ struct nouveau_device_priv *nvdev = nouveau_device(chan->device); ++ struct nouveau_channel_priv *nvchan = nouveau_channel(chan); ++ struct nouveau_pushbuf_priv *nvpb = &nvchan->pb; ++ struct drm_nouveau_gem_pushbuf req; ++ unsigned i; ++ int ret; ++ ++ ret = nouveau_pushbuf_submit(chan, NULL, 0, 0); ++ if (ret) ++ return ret; ++ ++ if (!nvpb->nr_push) ++ return 0; ++ ++ req.channel = chan->id; ++ req.nr_push = nvpb->nr_push; ++ req.push = (uint64_t)(unsigned long)nvpb->push; ++ req.nr_buffers = nvpb->nr_buffers; ++ req.buffers = (uint64_t)(unsigned long)nvpb->buffers; ++ req.nr_relocs = nvpb->nr_relocs; ++ req.relocs = (uint64_t)(unsigned long)nvpb->relocs; ++ req.suffix0 = nvpb->cal_suffix0; ++ req.suffix1 = nvpb->cal_suffix1; ++ ++ do { ++ ret = drmCommandWriteRead(nvdev->fd, DRM_NOUVEAU_GEM_PUSHBUF, ++ &req, sizeof(req)); ++ } while (ret == -EAGAIN); ++ nvpb->cal_suffix0 = req.suffix0; ++ nvpb->cal_suffix1 = req.suffix1; ++ nvdev->base.vm_vram_size = req.vram_available; ++ nvdev->base.vm_gart_size = req.gart_available; ++ ++ /* Update presumed offset/domain for any buffers that moved. ++ * Dereference all buffers on validate list ++ */ ++ for (i = 0; i < nvpb->nr_relocs; i++) { ++ nouveau_pushbuf_bo_unref(nvpb, nvpb->relocs[i].bo_index); ++ nouveau_pushbuf_bo_unref(nvpb, nvpb->relocs[i].reloc_bo_index); ++ } ++ ++ for (i = 0; i < nvpb->nr_push; i++) ++ nouveau_pushbuf_bo_unref(nvpb, nvpb->push[i].bo_index); ++ ++ nvpb->nr_buffers = 0; ++ nvpb->nr_relocs = 0; ++ nvpb->nr_push = 0; ++ ++ /* Allocate space for next push buffer */ ++ if (nouveau_pushbuf_space(chan, min)) ++ assert(0); ++ ++ if (chan->flush_notify) ++ chan->flush_notify(chan); ++ ++ nvpb->marker = NULL; ++ return ret; ++} ++ ++int ++nouveau_pushbuf_marker_emit(struct nouveau_channel *chan, ++ unsigned wait_dwords, unsigned wait_relocs) ++{ ++ struct nouveau_pushbuf_priv *nvpb = &nouveau_channel(chan)->pb; ++ ++ if (AVAIL_RING(chan) < wait_dwords) ++ return nouveau_pushbuf_flush(chan, wait_dwords); ++ ++ if (nvpb->nr_relocs + wait_relocs >= NOUVEAU_GEM_MAX_RELOCS) ++ return nouveau_pushbuf_flush(chan, wait_dwords); ++ ++ nvpb->marker = chan->cur; ++ nvpb->marker_offset = nvpb->current_offset; ++ nvpb->marker_push = nvpb->nr_push; ++ nvpb->marker_relocs = nvpb->nr_relocs; ++ return 0; ++} ++ ++void ++nouveau_pushbuf_marker_undo(struct nouveau_channel *chan) ++{ ++ struct nouveau_pushbuf_priv *nvpb = &nouveau_channel(chan)->pb; ++ unsigned i; ++ ++ if (!nvpb->marker) ++ return; ++ ++ /* undo any relocs/buffers added to the list since last marker */ ++ for (i = nvpb->marker_relocs; i < nvpb->nr_relocs; i++) { ++ nouveau_pushbuf_bo_unref(nvpb, nvpb->relocs[i].bo_index); ++ nouveau_pushbuf_bo_unref(nvpb, nvpb->relocs[i].reloc_bo_index); ++ } ++ nvpb->nr_relocs = nvpb->marker_relocs; ++ ++ for (i = nvpb->marker_push; i < nvpb->nr_push; i++) ++ nouveau_pushbuf_bo_unref(nvpb, nvpb->push[i].bo_index); ++ nvpb->nr_push = nvpb->marker_push; ++ ++ /* reset pushbuf back to last marker */ ++ chan->cur = nvpb->marker; ++ nvpb->current_offset = nvpb->marker_offset; ++ nvpb->marker = NULL; ++} ++ ++int ++nouveau_pushbuf_emit_reloc(struct nouveau_channel *chan, void *ptr, ++ struct nouveau_bo *bo, uint32_t data, uint32_t data2, ++ uint32_t flags, uint32_t vor, uint32_t tor) ++{ ++ struct nouveau_pushbuf_priv *nvpb = &nouveau_channel(chan)->pb; ++ int ret; ++ ++ ret = nouveau_reloc_emit(chan, nvpb->buffer[nvpb->current], ++ (char *)ptr - (char *)nvpb->pushbuf, ptr, ++ bo, data, data2, flags, vor, tor); ++ if (ret) ++ return ret; ++ ++ return 0; ++} ++ +diff --git a/nouveau-1/nouveau_pushbuf.h b/nouveau-1/nouveau_pushbuf.h +new file mode 100644 +index 0000000..2a98789 +--- /dev/null ++++ b/nouveau-1/nouveau_pushbuf.h +@@ -0,0 +1,162 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 __NOUVEAU_PUSHBUF_H__ ++#define __NOUVEAU_PUSHBUF_H__ ++ ++#include ++#include ++ ++#include "nouveau_bo.h" ++#include "nouveau_grobj.h" ++ ++int ++nouveau_pushbuf_flush(struct nouveau_channel *, unsigned min); ++ ++int ++nouveau_pushbuf_marker_emit(struct nouveau_channel *chan, ++ unsigned wait_dwords, unsigned wait_relocs); ++ ++void ++nouveau_pushbuf_marker_undo(struct nouveau_channel *chan); ++ ++int ++nouveau_pushbuf_emit_reloc(struct nouveau_channel *, void *ptr, ++ struct nouveau_bo *, uint32_t data, uint32_t data2, ++ uint32_t flags, uint32_t vor, uint32_t tor); ++ ++int ++nouveau_pushbuf_submit(struct nouveau_channel *chan, struct nouveau_bo *bo, ++ unsigned offset, unsigned length); ++ ++/* Push buffer access macros */ ++static __inline__ int ++MARK_RING(struct nouveau_channel *chan, unsigned dwords, unsigned relocs) ++{ ++ return nouveau_pushbuf_marker_emit(chan, dwords, relocs); ++} ++ ++static __inline__ void ++MARK_UNDO(struct nouveau_channel *chan) ++{ ++ nouveau_pushbuf_marker_undo(chan); ++} ++ ++static __inline__ void ++OUT_RING(struct nouveau_channel *chan, unsigned data) ++{ ++ *(chan->cur++) = (data); ++} ++ ++static __inline__ void ++OUT_RINGp(struct nouveau_channel *chan, const void *data, unsigned size) ++{ ++ memcpy(chan->cur, data, size * 4); ++ chan->cur += size; ++} ++ ++static __inline__ void ++OUT_RINGf(struct nouveau_channel *chan, float f) ++{ ++ union { uint32_t i; float f; } c; ++ c.f = f; ++ OUT_RING(chan, c.i); ++} ++ ++static __inline__ unsigned ++AVAIL_RING(struct nouveau_channel *chan) ++{ ++ return chan->end - chan->cur; ++} ++ ++static __inline__ void ++WAIT_RING(struct nouveau_channel *chan, unsigned size) ++{ ++ if (chan->cur + size > chan->end) ++ nouveau_pushbuf_flush(chan, size); ++} ++ ++static __inline__ void ++FIRE_RING(struct nouveau_channel *chan) ++{ ++ nouveau_pushbuf_flush(chan, 0); ++} ++ ++static __inline__ int ++OUT_RELOC(struct nouveau_channel *chan, struct nouveau_bo *bo, ++ unsigned data, unsigned flags, unsigned vor, unsigned tor) ++{ ++ return nouveau_pushbuf_emit_reloc(chan, chan->cur++, bo, ++ data, 0, flags, vor, tor); ++} ++ ++static __inline__ int ++OUT_RELOC2(struct nouveau_channel *chan, struct nouveau_bo *bo, ++ unsigned data, unsigned data2, unsigned flags, ++ unsigned vor, unsigned tor) ++{ ++ return nouveau_pushbuf_emit_reloc(chan, chan->cur++, bo, ++ data, data2, flags, vor, tor); ++} ++ ++/* Raw data + flags depending on FB/TT buffer */ ++static __inline__ int ++OUT_RELOCd(struct nouveau_channel *chan, struct nouveau_bo *bo, ++ unsigned data, unsigned flags, unsigned vor, unsigned tor) ++{ ++ return OUT_RELOC(chan, bo, data, flags | NOUVEAU_BO_OR, vor, tor); ++} ++ ++/* FB/TT object handle */ ++static __inline__ int ++OUT_RELOCo(struct nouveau_channel *chan, struct nouveau_bo *bo, ++ unsigned flags) ++{ ++ return OUT_RELOC(chan, bo, 0, flags | NOUVEAU_BO_OR, ++ chan->vram->handle, chan->gart->handle); ++} ++ ++/* Low 32-bits of offset */ ++static __inline__ int ++OUT_RELOCl(struct nouveau_channel *chan, struct nouveau_bo *bo, ++ unsigned delta, unsigned flags) ++{ ++ return OUT_RELOC(chan, bo, delta, flags | NOUVEAU_BO_LOW, 0, 0); ++} ++ ++/* Low 32-bits of offset + GPU linear access range info */ ++static __inline__ int ++OUT_RELOCr(struct nouveau_channel *chan, struct nouveau_bo *bo, ++ unsigned delta, unsigned size, unsigned flags) ++{ ++ return OUT_RELOC2(chan, bo, delta, size, flags | NOUVEAU_BO_LOW, 0, 0); ++} ++ ++/* High 32-bits of offset */ ++static __inline__ int ++OUT_RELOCh(struct nouveau_channel *chan, struct nouveau_bo *bo, ++ unsigned delta, unsigned flags) ++{ ++ return OUT_RELOC(chan, bo, delta, flags | NOUVEAU_BO_HIGH, 0, 0); ++} ++ ++#endif +diff --git a/nouveau-1/nouveau_reloc.c b/nouveau-1/nouveau_reloc.c +new file mode 100644 +index 0000000..cd219db +--- /dev/null ++++ b/nouveau-1/nouveau_reloc.c +@@ -0,0 +1,154 @@ ++/* ++ * Copyright 2010 Nouveau Project ++ * ++ * 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 ++#include ++#include ++#include ++ ++#include "nouveau_private.h" ++ ++static uint32_t ++nouveau_reloc_calc(struct drm_nouveau_gem_pushbuf_bo *pbbo, ++ struct drm_nouveau_gem_pushbuf_reloc *r) ++{ ++ uint32_t push = 0; ++ ++ if (r->flags & NOUVEAU_GEM_RELOC_LOW) ++ push = (pbbo->presumed.offset + r->data); ++ else ++ if (r->flags & NOUVEAU_GEM_RELOC_HIGH) ++ push = (pbbo->presumed.offset + r->data) >> 32; ++ else ++ push = r->data; ++ ++ if (r->flags & NOUVEAU_GEM_RELOC_OR) { ++ if (pbbo->presumed.domain & NOUVEAU_GEM_DOMAIN_VRAM) ++ push |= r->vor; ++ else ++ push |= r->tor; ++ } ++ ++ return push; ++} ++ ++int ++nouveau_reloc_emit(struct nouveau_channel *chan, struct nouveau_bo *reloc_bo, ++ uint32_t reloc_offset, uint32_t *reloc_ptr, ++ struct nouveau_bo *bo, uint32_t data, uint32_t data2, ++ uint32_t flags, uint32_t vor, uint32_t tor) ++{ ++ struct nouveau_pushbuf_priv *nvpb = &nouveau_channel(chan)->pb; ++ struct nouveau_bo_priv *nvbo = nouveau_bo(bo); ++ struct drm_nouveau_gem_pushbuf_reloc *r; ++ struct drm_nouveau_gem_pushbuf_bo *pbbo, *rpbbo; ++ uint32_t domains = 0; ++ ++ if (nvpb->nr_relocs >= NOUVEAU_GEM_MAX_RELOCS) { ++ fprintf(stderr, "too many relocs!!\n"); ++ return -ENOMEM; ++ } ++ ++ if (nvbo->user && (flags & NOUVEAU_BO_WR)) { ++ fprintf(stderr, "write to user buffer!!\n"); ++ return -EINVAL; ++ } ++ ++ /* We're about to reloc a user buffer, better make sure we don't cause ++ * a double migration. ++ */ ++ if (!(nvbo->flags & (NOUVEAU_BO_GART | NOUVEAU_BO_VRAM))) ++ nvbo->flags |= (flags & (NOUVEAU_BO_GART | NOUVEAU_BO_VRAM)); ++ ++ /* add buffer to validation list */ ++ pbbo = nouveau_bo_emit_buffer(chan, bo); ++ if (!pbbo) { ++ fprintf(stderr, "buffer emit fail :(\n"); ++ return -ENOMEM; ++ } ++ nouveau_bo(bo)->pending_refcnt++; ++ ++ if (flags & (NOUVEAU_BO_VRAM | NOUVEAU_BO_GART)) { ++ if (flags & NOUVEAU_BO_VRAM) ++ domains |= NOUVEAU_GEM_DOMAIN_VRAM; ++ if (flags & NOUVEAU_BO_GART) ++ domains |= NOUVEAU_GEM_DOMAIN_GART; ++ } else ++ domains |= nvbo->domain; ++ ++ if (!(pbbo->valid_domains & domains)) { ++ fprintf(stderr, "no valid domains remain!\n"); ++ return -EINVAL; ++ } ++ pbbo->valid_domains &= domains; ++ ++ assert(flags & NOUVEAU_BO_RDWR); ++ if (flags & NOUVEAU_BO_RD) { ++ pbbo->read_domains |= domains; ++ } ++ if (flags & NOUVEAU_BO_WR) { ++ pbbo->write_domains |= domains; ++ nvbo->write_marker = 1; ++ } ++ ++ /* nvc0 gallium driver uses reloc_emit() with NULL target buffer ++ * to inform bufmgr of a buffer's use - however, we need something ++ * to track, so create a reloc for now, and hope it never triggers ++ * (it shouldn't, constant virtual address..).. ++ */ ++ if (!reloc_bo) { ++ reloc_bo = nvpb->buffer[nvpb->current]; ++ reloc_offset = 0; ++ reloc_ptr = NULL; ++ } ++ ++ /* add reloc target bo to validation list, and create the reloc */ ++ rpbbo = nouveau_bo_emit_buffer(chan, reloc_bo); ++ if (!rpbbo) ++ return -ENOMEM; ++ nouveau_bo(reloc_bo)->pending_refcnt++; ++ ++ r = nvpb->relocs + nvpb->nr_relocs++; ++ r->reloc_bo_index = rpbbo - nvpb->buffers; ++ r->reloc_bo_offset = reloc_offset; ++ r->bo_index = pbbo - nvpb->buffers; ++ r->flags = 0; ++ if (flags & NOUVEAU_BO_LOW) ++ r->flags |= NOUVEAU_GEM_RELOC_LOW; ++ if (flags & NOUVEAU_BO_HIGH) ++ r->flags |= NOUVEAU_GEM_RELOC_HIGH; ++ if (flags & NOUVEAU_BO_OR) ++ r->flags |= NOUVEAU_GEM_RELOC_OR; ++ r->data = data; ++ r->vor = vor; ++ r->tor = tor; ++ ++ if (reloc_ptr) { ++ if (flags & NOUVEAU_BO_DUMMY) ++ *reloc_ptr = 0; ++ else ++ *reloc_ptr = nouveau_reloc_calc(pbbo, r); ++ } ++ ++ return 0; ++} ++ +diff --git a/nouveau-1/nouveau_reloc.h b/nouveau-1/nouveau_reloc.h +new file mode 100644 +index 0000000..24ddb52 +--- /dev/null ++++ b/nouveau-1/nouveau_reloc.h +@@ -0,0 +1,32 @@ ++/* ++ * Copyright 2010 Nouveau Project ++ * ++ * 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 __NOUVEAU_RELOC_H__ ++#define __NOUVEAU_RELOC_H__ ++ ++int ++nouveau_reloc_emit(struct nouveau_channel *chan, struct nouveau_bo *reloc_bo, ++ uint32_t reloc_offset, uint32_t *reloc_ptr, ++ struct nouveau_bo *bo, uint32_t data, uint32_t data2, ++ uint32_t flags, uint32_t vor, uint32_t tor); ++ ++#endif +diff --git a/nouveau-1/nouveau_resource.c b/nouveau-1/nouveau_resource.c +new file mode 100644 +index 0000000..7acaf7d +--- /dev/null ++++ b/nouveau-1/nouveau_resource.c +@@ -0,0 +1,124 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 ++#include ++ ++#include "nouveau_private.h" ++ ++int ++nouveau_resource_init(struct nouveau_resource **heap, ++ unsigned start, unsigned size) ++{ ++ struct nouveau_resource *r; ++ ++ r = calloc(1, sizeof(struct nouveau_resource)); ++ if (!r) ++ return 1; ++ ++ r->start = start; ++ r->size = size; ++ *heap = r; ++ return 0; ++} ++ ++void ++nouveau_resource_destroy(struct nouveau_resource **heap) ++{ ++ if (!*heap) ++ return; ++ free(*heap); ++ *heap = NULL; ++} ++ ++int ++nouveau_resource_alloc(struct nouveau_resource *heap, unsigned size, void *priv, ++ struct nouveau_resource **res) ++{ ++ struct nouveau_resource *r; ++ ++ if (!heap || !size || !res || *res) ++ return 1; ++ ++ while (heap) { ++ if (!heap->in_use && heap->size >= size) { ++ r = calloc(1, sizeof(struct nouveau_resource)); ++ if (!r) ++ return 1; ++ ++ r->start = (heap->start + heap->size) - size; ++ r->size = size; ++ r->in_use = 1; ++ r->priv = priv; ++ ++ heap->size -= size; ++ ++ r->next = heap->next; ++ if (heap->next) ++ heap->next->prev = r; ++ r->prev = heap; ++ heap->next = r; ++ ++ *res = r; ++ return 0; ++ } ++ ++ heap = heap->next; ++ } ++ ++ return 1; ++} ++ ++void ++nouveau_resource_free(struct nouveau_resource **res) ++{ ++ struct nouveau_resource *r; ++ ++ if (!res || !*res) ++ return; ++ r = *res; ++ *res = NULL; ++ ++ r->in_use = 0; ++ ++ if (r->next && !r->next->in_use) { ++ struct nouveau_resource *new = r->next; ++ ++ new->prev = r->prev; ++ if (r->prev) ++ r->prev->next = new; ++ new->size += r->size; ++ new->start = r->start; ++ ++ free(r); ++ r = new; ++ } ++ ++ if (r->prev && !r->prev->in_use) { ++ r->prev->next = r->next; ++ if (r->next) ++ r->next->prev = r->prev; ++ r->prev->size += r->size; ++ free(r); ++ } ++ ++} +diff --git a/nouveau-1/nouveau_resource.h b/nouveau-1/nouveau_resource.h +new file mode 100644 +index 0000000..b760dfb +--- /dev/null ++++ b/nouveau-1/nouveau_resource.h +@@ -0,0 +1,51 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 __NOUVEAU_RESOURCE_H__ ++#define __NOUVEAU_RESOURCE_H__ ++ ++struct nouveau_resource { ++ struct nouveau_resource *prev; ++ struct nouveau_resource *next; ++ ++ int in_use; ++ void *priv; ++ ++ unsigned int start; ++ unsigned int size; ++}; ++ ++int ++nouveau_resource_init(struct nouveau_resource **heap, unsigned start, ++ unsigned size); ++ ++void ++nouveau_resource_destroy(struct nouveau_resource **heap); ++ ++int ++nouveau_resource_alloc(struct nouveau_resource *heap, unsigned size, void *priv, ++ struct nouveau_resource **); ++ ++void ++nouveau_resource_free(struct nouveau_resource **); ++ ++#endif +diff --git a/nouveau-1/nv04_pushbuf.h b/nouveau-1/nv04_pushbuf.h +new file mode 100644 +index 0000000..586b284 +--- /dev/null ++++ b/nouveau-1/nv04_pushbuf.h +@@ -0,0 +1,66 @@ ++/* ++ * Copyright 2007 Nouveau Project ++ * ++ * 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 __NV04_PUSHBUF_H__ ++#define __NV04_PUSHBUF_H__ ++ ++#include "nouveau_pushbuf.h" ++ ++static __inline__ void ++BEGIN_RING(struct nouveau_channel *chan, struct nouveau_grobj *gr, ++ unsigned mthd, unsigned size) ++{ ++ if (gr->bound == NOUVEAU_GROBJ_UNBOUND) ++ nouveau_grobj_autobind(gr); ++ chan->subc[gr->subc].sequence = chan->subc_sequence++; ++ ++ WAIT_RING(chan, size + 1); ++ OUT_RING(chan, (gr->subc << 13) | (size << 18) | mthd); ++} ++ ++/* non-incrementing BEGIN_RING */ ++static __inline__ void ++BEGIN_RING_NI(struct nouveau_channel *chan, struct nouveau_grobj *gr, ++ unsigned mthd, unsigned size) ++{ ++ BEGIN_RING(chan, gr, mthd | 0x40000000, size); ++} ++ ++static __inline__ void ++BIND_RING(struct nouveau_channel *chan, struct nouveau_grobj *gr, unsigned sc) ++{ ++ struct nouveau_subchannel *subc = &gr->channel->subc[sc]; ++ ++ if (subc->gr) { ++ if (subc->gr->bound == NOUVEAU_GROBJ_BOUND_EXPLICIT) ++ assert(0); ++ subc->gr->bound = NOUVEAU_GROBJ_UNBOUND; ++ } ++ subc->gr = gr; ++ subc->gr->subc = sc; ++ subc->gr->bound = NOUVEAU_GROBJ_BOUND_EXPLICIT; ++ ++ BEGIN_RING(chan, gr, 0x0000, 1); ++ OUT_RING (chan, gr->handle); ++} ++ ++#endif +diff --git a/nouveau-1/nvc0_pushbuf.h b/nouveau-1/nvc0_pushbuf.h +new file mode 100644 +index 0000000..40dc7e6 +--- /dev/null ++++ b/nouveau-1/nvc0_pushbuf.h +@@ -0,0 +1,92 @@ ++/* ++ * Copyright 2010 Nouveau Project ++ * ++ * 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 __NVC0_PUSHBUF_H__ ++#define __NVC0_PUSHBUF_H__ ++ ++#include "nouveau_pushbuf.h" ++ ++#define SUBC_BIND(chan, gr) do { \ ++ if (gr->bound == NOUVEAU_GROBJ_UNBOUND) \ ++ nouveau_grobj_autobind(gr); \ ++ chan->subc[gr->subc].sequence = chan->subc_sequence++; \ ++} while (0) ++ ++/* incremental methods */ ++static __inline__ void ++BEGIN_RING(struct nouveau_channel *chan, struct nouveau_grobj *gr, ++ unsigned mthd, unsigned size) ++{ ++ SUBC_BIND(chan, gr); ++ WAIT_RING(chan, size + 1); ++ OUT_RING (chan, (0x2 << 28) | (size << 16) | (gr->subc << 13) | (mthd >> 2)); ++} ++ ++/* non-incremental */ ++static __inline__ void ++BEGIN_RING_NI(struct nouveau_channel *chan, struct nouveau_grobj *gr, ++ unsigned mthd, unsigned size) ++{ ++ SUBC_BIND(chan, gr); ++ WAIT_RING(chan, size + 1); ++ OUT_RING (chan, (0x6 << 28) | (size << 16) | (gr->subc << 13) | (mthd >> 2)); ++} ++ ++/* increment-once */ ++static __inline__ void ++BEGIN_RING_1I(struct nouveau_channel *chan, struct nouveau_grobj *gr, ++ unsigned mthd, unsigned size) ++{ ++ SUBC_BIND(chan, gr); ++ WAIT_RING(chan, size + 1); ++ OUT_RING (chan, (0xa << 28) | (size << 16) | (gr->subc << 13) | (mthd >> 2)); ++} ++ ++/* inline-data */ ++static __inline__ void ++IMMED_RING(struct nouveau_channel *chan, struct nouveau_grobj *gr, ++ unsigned mthd, unsigned data) ++{ ++ SUBC_BIND(chan, gr); ++ WAIT_RING(chan, 1); ++ OUT_RING (chan, (0x8 << 28) | (data << 16) | (gr->subc << 13) | (mthd >> 2)); ++} ++ ++static __inline__ void ++BIND_RING(struct nouveau_channel *chan, struct nouveau_grobj *gr, unsigned sc) ++{ ++ struct nouveau_subchannel *subc = &gr->channel->subc[sc]; ++ ++ if (subc->gr) { ++ if (subc->gr->bound == NOUVEAU_GROBJ_BOUND_EXPLICIT) ++ assert(0); ++ subc->gr->bound = NOUVEAU_GROBJ_UNBOUND; ++ } ++ subc->gr = gr; ++ subc->gr->subc = sc; ++ subc->gr->bound = NOUVEAU_GROBJ_BOUND_EXPLICIT; ++ ++ BEGIN_RING(chan, gr, 0x0000, 1); ++ OUT_RING (chan, gr->grclass); ++} ++ ++#endif --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/patches/series +++ libdrm-2.4.37+git20120713.992e2afd/debian/patches/series @@ -0,0 +1,4 @@ +01_default_perms.diff +02_build_libkms_against_in_tree_drm.diff +03_build_against_librt.diff +04_libdrm-2.4.37-nouveau-1.diff --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/patches/02_build_libkms_against_in_tree_drm.diff +++ libdrm-2.4.37+git20120713.992e2afd/debian/patches/02_build_libkms_against_in_tree_drm.diff @@ -0,0 +1,17 @@ +Description: Add libdrm to LIBADD as libkms uses symbols from libdrm +Author: Christopher Halse Rogers +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=26852 + +Index: libdrm/libkms/Makefile.am +=================================================================== +--- libdrm.orig/libkms/Makefile.am ++++ libdrm/libkms/Makefile.am +@@ -6,7 +6,7 @@ AM_CFLAGS = \ + libkms_la_LTLIBRARIES = libkms.la + libkms_ladir = $(libdir) + libkms_la_LDFLAGS = -version-number 1:0:0 -no-undefined +-libkms_la_LIBADD = ++libkms_la_LIBADD = ../libdrm.la + + #if HAVE_LIBUDEV + #libkms_la_LIBADD += $(LIBUDEV_LIBS) --- libdrm-2.4.37+git20120713.992e2afd.orig/debian/patches/03_build_against_librt.diff +++ libdrm-2.4.37+git20120713.992e2afd/debian/patches/03_build_against_librt.diff @@ -0,0 +1,11 @@ +--- a/tests/Makefile.am ++++ b/tests/Makefile.am +@@ -10,6 +10,8 @@ check_PROGRAMS = \ + dristat \ + drmstat + ++dristat_LDADD = $(CLOCK_LIB) ++ + SUBDIRS = modeprint + + if HAVE_LIBKMS