EXYNOS_SUBDIR = exynos
endif
-if HAVE_SLP
-SLP_SUBDIR = slp
+if HAVE_VIGS
+VIGS_SUBDIR = vigs
endif
-SUBDIRS = . $(LIBKMS_SUBDIR) $(INTEL_SUBDIR) $(NOUVEAU_SUBDIR) $(RADEON_SUBDIR) $(OMAP_SUBDIR) $(EXYNOS_SUBDIR) $(SLP_SUBDIR) tests include
+SUBDIRS = . $(LIBKMS_SUBDIR) $(INTEL_SUBDIR) $(NOUVEAU_SUBDIR) $(RADEON_SUBDIR) $(OMAP_SUBDIR) $(EXYNOS_SUBDIR) $(VIGS_SUBDIR) tests include
libdrm_la_LTLIBRARIES = libdrm.la
libdrm_ladir = $(libdir)
[Enable support for EXYNOS's experimental API (default: disabled)]),
[EXYNOS=$enableval], [EXYNOS=no])
-AC_ARG_ENABLE(slp,
- AS_HELP_STRING([--disable-slp],
- [Enable support for slp's API (default: auto)]),
- [SLP=$enableval], [SLP=auto])
-
-AC_ARG_VAR([bufmgr_dir], [Directory of slp-bufmgr])
-
-if test "x$bufmgr_dir" = xyes; then
- AC_DEFINE_UNQUOTED(BUFMGR_DIR, "$bufmgr_dir", [Directory for the modules of slp_bufmgr])
-else
- AC_DEFINE(BUFMGR_DIR, "/usr/lib/bufmgr", [Directory for the modules of slp_bufmgr])
-fi
+AC_ARG_ENABLE(vigs,
+ AS_HELP_STRING([--disable-vigs],
+ [Enable support for VIGS's API (default: enabled)]),
+ [VIGS=$enableval], [VIGS=yes])
dnl ===========================================================================
dnl check compiler flags
# For enumerating devices in test case
PKG_CHECK_MODULES(LIBUDEV, libudev, [HAVE_LIBUDEV=yes], [HAVE_LIBUDEV=no])
if test "x$HAVE_LIBUDEV" = xyes; then
- AC_DEFINE(HAVE_LIBUDEV, 1, [Have libudev support])
+ AC_DEFINE(HAVE_LIBUDEV, 1, [Have libudev support])
fi
AM_CONDITIONAL(HAVE_LIBUDEV, [test "x$HAVE_LIBUDEV" = xyes])
-if test "x$INTEL" != "xno" -o "x$RADEON" != "xno" -o "x$NOUVEAU" != "xno" -o "x$SLP" != "xno"; then
+if test "x$INTEL" != "xno" -o "x$RADEON" != "xno" -o "x$NOUVEAU" != "xno" -o "x$VIGS" != "xno"; then
# Check for atomic intrinsics
AC_CACHE_CHECK([for native atomic primitives], drm_cv_atomic_primitives,
[
fi
fi
-if test "x$SLP" != "xno"; then
- AC_DEFINE(HAVE_SLP, 1, [Have slp])
+if test "x$VIGS" != "xno"; then
+ AC_DEFINE(HAVE_VIGS, 1, [Have VIGS])
fi
if test "x$INTEL" != "xno"; then
AC_DEFINE([HAVE_VALGRIND], 1, [Use valgrind intrinsics to suppress false warnings])
fi
-AM_CONDITIONAL(HAVE_SLP, [test "x$SLP" != "xno"])
AM_CONDITIONAL(HAVE_INTEL, [test "x$INTEL" != "xno"])
AM_CONDITIONAL(HAVE_RADEON, [test "x$RADEON" != "xno"])
AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" != "xno"])
if test "x$RADEON" = xyes; then
AC_DEFINE(HAVE_RADEON, 1, [Have radeon support])
fi
+AM_CONDITIONAL(HAVE_VIGS, [test "x$VIGS" != "xno"])
AC_ARG_WITH([kernel-source],
[AS_HELP_STRING([--with-kernel-source],
Makefile
libkms/Makefile
libkms/libkms.pc
- slp/Makefile
- slp/libdrm_slp.pc
intel/Makefile
intel/libdrm_intel.pc
radeon/Makefile
omap/libdrm_omap.pc
exynos/Makefile
exynos/libdrm_exynos.pc
+ vigs/Makefile
+ vigs/libdrm_vigs.pc
tests/Makefile
tests/modeprint/Makefile
tests/modetest/Makefile
tests/proptest/Makefile
tests/radeon/Makefile
tests/vbltest/Makefile
- tests/gemtest/Makefile
- tests/g2dtest/Makefile
- tests/ipptest/Makefile
- tests/rottest/Makefile
include/Makefile
include/drm/Makefile
libdrm.pc])
echo " Nouveau API $NOUVEAU"
echo " OMAP API $OMAP"
echo " EXYNOS API $EXYNOS"
-echo " SLP API $SLP"
-echo " SLP bufmgr_dir $bufmgr_dir"
+echo " VIGS API $VIGS"
echo ""
+++ /dev/null
-------------------------------------------------------
-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.
-
-------------------------------------
-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.
-
-quilt is actually invoked by the Debian X packaging through a larger
-set of scripts called XSFBS. XSFBS brings some other X specific
-features such as managing dependencies and conflicts due to the video
-and input driver ABIs.
-XSFBS itself is maintained in a separate repository at
- git://git.debian.org/pkg-xorg/xsfbs.git
-and it is pulled inside the other Debian X repositories when needed.
-
-The XSFBS patching system requires a build dependency on quilt. Also
-a dependency on $(STAMP_DIR)/patch has to be added to debian/rules
-so that the XSFBS patching occurs before the actual build. So the
-very first target of the build (likely the one running autoreconf)
-should depend on $(STAMP_DIR)/patch. It should also not depend on
-anything so that parallel builds are correctly supported (nothing
-should probably run while patching is being done). And finally, the
-clean target should depend on the xsfclean target so that patches
-are unapplied on clean.
-
-When the upstream sources contain some DFSG-nonfree files, they are
-listed in text files in debian/prune/ in the "debian-*" branch of
-the Debian repository. XSFBS' scripts then take care of removing
-these listed files during the build so as to generate a modified
-DFSG-free .orig.tar.gz tarball.
+++ /dev/null
-libdrm (2.4.35-1slp2) unstable; urgency=low
-
- * upgrade to 2.4.35
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.35-1slp2
-
- -- Boram Park <boram1288.park@samsung.com> Mon, 11 Jun 2012 18:58:07 +0900
-
-libdrm (2.4.33-5slp2) unstable; urgency=low
-
- * update changelog
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.33-5slp2
-
- -- Boram Park <boram1288.park@samsung.com> Tue, 29 May 2012 20:33:15 +0900
-
-libdrm (2.4.33-4slp2) unstable; urgency=low
-
- * update for cacheflush
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.33-4slp2
-
- -- Boram Park <boram1288.park@samsung.com> Mon, 30 Apr 2012 16:46:47 +0900
-
-libdrm (2.4.33-3slp2) unstable; urgency=low
-
- * fix : wrong condition
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.33-3slp2
-
- -- Boram Park <boram1288.park@samsung.com> Thu, 26 Apr 2012 15:10:55 +0900
-
-libdrm (2.4.33-2slp2) unstable; urgency=low
-
- * update changelog
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.33-2slp2
-
- -- Boram Park <boram1288.park@samsung.com> Thu, 26 Apr 2012 11:06:32 +0900
-
-libdrm (2.4.33-1slp2) unstable; urgency=low
-
- * version upgrade to 2.4.33
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.33-1slp2
-
- -- Boram Park <boram1288.park@samsung.com> Wed, 25 Apr 2012 11:38:37 +0900
-
-libdrm (2.4.27-18slp2) unstable; urgency=low
-
- * update exynos_drm.h
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-18slp2
-
- -- Boram Park <boram1288.park@samsung.com> Thu, 29 Mar 2012 16:58:17 +0900
-
-libdrm (2.4.27-17slp2) unstable; urgency=low
-
- * fix exynos_drm.h
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-17slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Thu, 22 Mar 2012 20:33:18 +0900
-
-libdrm (2.4.27-16slp2) unstable; urgency=low
-
- * update exynos_drm.h
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-16slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Thu, 22 Mar 2012 20:00:05 +0900
-
-libdrm (2.4.27-15slp2) unstable; urgency=low
-
- * update exynos_drm.h
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-15slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Wed, 07 Mar 2012 13:16:38 +0900
-
-libdrm (2.4.27-14slp2) unstable; urgency=low
-
- * update headers for g2d and virtual output
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-14slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Fri, 17 Feb 2012 15:19:47 +0900
-
-libdrm (2.4.27-13slp2) unstable; urgency=low
-
- * patch from kernel : add virtual display for wireless display
- * null check of user_data
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-13slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Thu, 09 Feb 2012 20:43:01 +0900
-
-libdrm (2.4.27-12slp2) unstable; urgency=low
-
- * drm_slp_bufmgr: add error check
- * increase version
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-12slp2
-
- -- Boram Park <boram1288.park@samsung.com> Wed, 04 Jan 2012 17:39:16 +0900
-
-libdrm (2.4.27-11slp2) unstable; urgency=low
-
- * increase version
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-11slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Tue, 20 Dec 2011 10:41:16 +0900
-
-libdrm (2.4.27-10slp2) unstable; urgency=low
-
- * patch from kernel
- * Git: slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-10slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Mon, 19 Dec 2011 13:27:17 +0900
-
-libdrm (2.4.27-9slp2) unstable; urgency=low
-
- * do 'flush all' if bo is NULL
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-9slp2
-
- -- Boram Park <boram1288.park@samsung.com> Thu, 08 Dec 2011 16:06:25 +0900
-
-libdrm (2.4.27-8slp2) unstable; urgency=low
-
- * Bug Fix : fix the mutax lock
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-8slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Mon, 05 Dec 2011 21:00:24 +0900
-
-libdrm (2.4.27-7slp2) unstable; urgency=low
-
- * Check if input param is valid
- * Refactoring: Move common code
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-7slp2
-
- -- Boram Park <boram1288.park@samsung.com> Mon, 05 Dec 2011 10:52:44 +0900
-
-libdrm (2.4.27-6slp2) unstable; urgency=low
-
- * G[S]et physical address from(to) gem
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-6slp2
-
- -- Boram Park <boram1288.park@samsung.com> Wed, 30 Nov 2011 08:50:08 +0900
-
-libdrm (2.4.27-5slp2) unstable; urgency=low
-
- * has user_data
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-5slp2
-
- -- Boram Park <boram1288.park@samsung.com> Thu, 24 Nov 2011 15:29:13 +0900
-
-libdrm (2.4.27-4slp2) unstable; urgency=low
-
- * drm_slp_bufmgr_cache_flush should return the result
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-4slp2
-
- -- Boram Park <boram1288.park@samsung.com> Tue, 22 Nov 2011 20:46:10 +0900
-
-libdrm (2.4.27-3slp2) unstable; urgency=low
-
- * bo can be NULL
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-3slp2
-
- -- Boram Park <boram1288.park@samsung.com> Wed, 16 Nov 2011 19:11:54 +0900
-
-libdrm (2.4.27-2slp2) unstable; urgency=low
-
- * bo can't be NULL
- * patch from kernel
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-2slp2
-
- -- Boram Park <boram1288.park@samsung.com> Mon, 14 Nov 2011 18:54:40 +0900
-
-libdrm (2.4.27-1slp2) unstable; urgency=low
-
- * Update version to 2.4.27
- * patch from kernel
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.27-1slp2
-
- -- Boram Park <boram1288.park@samsung.com> Mon, 07 Nov 2011 17:20:23 +0900
-
-libdrm (2.4.26-4slp2) unstable; urgency=low
-
- * generate packages for both i386 and armel
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.26-4slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Wed, 19 Oct 2011 19:44:09 +0900
-
-libdrm (2.4.26-3slp2) unstable; urgency=low
-
- * add cacheflush operation
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.26-3slp2
-
- -- Boram Park <boram1288.park@samsung.com> Tue, 18 Oct 2011 11:27:30 +0900
-
-libdrm (2.4.26-2slp2) unstable; urgency=low
-
- * define SLP in config.h
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.26-2slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Thu, 13 Oct 2011 20:27:14 +0900
-
-libdrm (2.4.26-1slp2) unstable; urgency=low
-
- * upgrade 2.4.26
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.26-1slp2
-
- -- Boram Park <boram1288.park@samsung.com> Thu, 13 Oct 2011 16:14:42 +0900
-
-libdrm (2.4.23-8slp2) unstable; urgency=low
-
- * Load SLP buffer manager
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.23-8slp2
-
- -- Boram Park <boram1288.park@samsung.com> Sat, 08 Oct 2011 15:40:47 +0900
-
-libdrm (2.4.23-7slp2) unstable; urgency=low
-
- * Remove the dependency of ump & pvr2d
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.23-7slp2
-
- -- Boram Park <boram1288.park@samsung.com> Thu, 06 Oct 2011 16:07:14 +0900
-
-libdrm (2.4.23-6slp2) unstable; urgency=low
-
- * add lock/unlock buffer for ump
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.23-6slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Tue, 05 Jul 2011 16:32:49 +0900
-
-libdrm (2.4.23-5slp2) unstable; urgency=low
-
- * modify the dependency packages
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.23-5slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Thu, 09 Jun 2011 10:45:02 +0900
-
-libdrm (2.4.23-4slp2) unstable; urgency=low
-
- * version up
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.23-4slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Fri, 03 Jun 2011 18:02:05 +0900
-
-libdrm (2.4.23-3slp2) unstable; urgency=low
-
- * add drm_slp modules
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.23-3slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Fri, 03 Jun 2011 14:05:17 +0900
-
-libdrm (2.4.23-2slp2) unstable; urgency=low
-
- * [X11R7.6] upgrade package
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.23-2slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Sun, 06 Mar 2011 15:32:04 +0900
-
-libdrm (2.4.23-1slp2) unstable; urgency=low
-
- * [X11R7.6] upgrade package
- * Git: 165.213.180.234:slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.23-1slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Mon, 03 Jan 2011 13:44:14 +0900
-
-libdrm (2.4.21-1slp2) unstable; urgency=low
-
- * version upgrade
- * Git: 165.213.180.234:/git/slp/pkgs/xorg/lib/libdrm
- * Tag: libdrm_2.4.21-1slp2
-
- -- SooChan Lim <sc1.lim@samsung.com> Fri, 05 Nov 2010 20:43:36 +0900
-
-libdrm (2.4.21-1ubuntu2.1) unstable; urgency=low
-
- * Add 03_intel_limit_tiled_pitches.patch: Fixes a problem where framebuffers
- with a width greater than 2048 pixels could not be allocated on pre-i965
- generation intel GPUs, which is common for multi-monitor setups. Backport
- of upstream commit 726210f87. (LP: #619663)
-
- -- Robert Hooker <robert.hooker@canonical.com> Fri, 08 Oct 2010 12:08:09 -0400
-
-libdrm (2.4.21-1ubuntu2) unstable; urgency=low
-
- * debian/rules: Don't install upstream changelog. This saves > 1 MB of CD
- space.
-
- -- Martin Pitt <martin.pitt@ubuntu.com> Sun, 01 Aug 2010 20:46:42 +0200
-
-libdrm (2.4.21-1ubuntu1) unstable; urgency=low
-
- * Merge from debian experimental. Remaining Ubuntu changes:
- - Enable libdrm-intel for ports architectures until plymouth is fixed to
- not need it unconditionally.
- - Move runtime libraries to /lib for plymouth.
-
- -- Robert Hooker <sarvatt@ubuntu.com> Thu, 10 Jun 2010 18:52:09 -0400
-
-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 <jcristau@debian.org> 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 <jcristau@debian.org> Wed, 26 May 2010 10:33:22 +0200
-
-libdrm (2.4.20-2ubuntu1) unstable; urgency=low
-
- * Merge from debian experimental, remaining changes:
- - Dropped patches:
- 02_fix_kms_detection_with_linux_backport_modules.diff - Obsolete
- 03_revert_abi_change.diff - Obsolete
- 04_git_nouveau_fix_sigsegv_in_nouveau_bo_new_tile.patch - Upstream
- * Refresh libdrm-nouveau1 symbols
-
- -- Robert Hooker <sarvatt@ubuntu.com> Fri, 14 May 2010 13:47:41 -0400
-
-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 <kibi@debian.org> 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 <bgoglin@debian.org> Fri, 16 Apr 2010 07:14:41 +0200
-
-libdrm (2.4.18-5) unstable; urgency=low
-
- * Upload to unstable.
-
- -- Cyril Brulebois <kibi@debian.org> 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 <bgoglin@debian.org> 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 <jcristau@debian.org> 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 <kibi@debian.org> Mon, 22 Feb 2010 15:31:47 +0100
-
-libdrm (2.4.18-1ubuntu3) unstable; urgency=low
-
- * debian/patches/04_git_nouveau_fix_sigsegv_in_nouveau_bo_new_tile.patch:
- + Cherry pick from upstream git. Fixes a segfault in libdrm_nouveau on
- X start for some cards (LP: #547124)
-
- -- Christopher James Halse Rogers <raof@ubuntu.com> Mon, 12 Apr 2010 11:14:11 +1000
-
-libdrm (2.4.18-1ubuntu2) unstable; urgency=low
-
- * libdrm-nouveau1.symbols: Add a missing symbol introduced in 2.4.18.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com> Fri, 19 Feb 2010 14:34:02 +0200
-
-libdrm (2.4.18-1ubuntu1) unstable; urgency=low
-
- * Merge from Debian unstable.
- * Remove the nouveau patches, since they are included in this version.
- * Add 03_revert_abi_change.diff to revert the nouveau ABI change.
- We need the old ABI until the kernel has been updated.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com> Fri, 19 Feb 2010 14:19:08 +0200
-
-libdrm (2.4.18-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Brice Goglin <bgoglin@debian.org> Thu, 18 Feb 2010 08:06:14 +0100
-
-libdrm (2.4.17-1ubuntu3) unstable; urgency=low
-
- * Unapply patches in debian/patches from the source package.
-
- -- Steve Langasek <steve.langasek@ubuntu.com> Thu, 18 Feb 2010 06:48:37 -0800
-
-libdrm (2.4.17-1ubuntu2) unstable; urgency=low
-
- * Move runtime libraries to /lib (needed by plymouth)
-
- -- Steve Langasek <steve.langasek@ubuntu.com> Thu, 18 Feb 2010 06:11:08 -0800
-
-libdrm (2.4.17-1ubuntu1) unstable; urgency=low
-
- * Merge from Debian unstable. Previous merge was from the unreleased
- 2.4.17-1 in pkg-xorg git. This merge picks up the finalised changelog
- and few extra changes. Remaining Ubuntu changes:
- + rules, control, libdrm-nouveau1.symbols, libdrm-nouveau1.install:
- Enable libdrm_nouveau
- * debian/control:
- + libdrm-dev: Only Depend on libdrm-nouveau1 on linux-any.
- * debian/copyright:
- + Remove copyright section for no-longer-shipped add_libdrm-nouveau.patch.
- * debian/patches/02_fix_kms_detection_with_linux_backport_modules.diff:
- + Add /sys/.../lbm-drm/ to search path for controlD* file, as well as
- /sys/.../drm/. linux-backport-modules-nouveau has the drm module renamed
- to lbm_drm to avoid conflicts with other modules' drm. This fixes
- drmCheckModesettingAvailable when using linux-backports-modules-nouveau.
- * debian/patches/03_update_nouveau_defines_1.diff:
- * debian/patches/04_update_nouveau_defines_2.diff:
- * debian/patches/05_update_nouveau_defines_3.diff:
- + Patches taken from git. Update #defines in nouveau headers to make allow
- recent DDXs to build.
- * debian/patches/06_nouveau_free_objects_on_channel_close.diff:
- * debian/patches/07_nouveau_fix_mem_leak_on_channel_free.diff:
- + Patches taken from git. Fix a couple of memory leaks when freeing
- channels
- * debian/libdrm-nouveau1.symbols:
- + Add new symbol added in 06_nouveau_free_objects_on_channel_close.
- * debian/patches/08_nouveau_no_flush_notify_on_channel_free.diff:
- + Patch taken from git. Avoid calling flush_notify when part of the
- channel's context might be freed.
- * debian/patchs/09_add_BEGIN_RING_NI.diff:
- + Patch taken from git. Add BEGIN_RING_NI inline to nouveau_pushbuf.h.
- Used in nv50 accel code.
-
- -- Christopher James Halse Rogers <raof@ubuntu.com> Mon, 01 Feb 2010 15:55:14 +1100
-
-libdrm (2.4.17-0ubuntu2) unstable; urgency=low
-
- * Enable libdrm-intel for ports architectures (LP: #507765)
- * Adjust libdrm-dev dependencies to reflect nouveau being linux-any
-
- -- Emmet Hikory <persia@ubuntu.com> Fri, 15 Jan 2010 12:31:40 +0900
-
-libdrm (2.4.17-0ubuntu1) unstable; urgency=low
-
- * Merge with Debian unstable, remaining changes:
- + control, rules, libdrm-nouveau1.symbols: Enable libdrm_nouveau.
- * Update libdrm-nouveau1.symbols and shlibs.
- * Drop 02_silent_master.diff, applied upstream.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com> Sat, 09 Jan 2010 00:00:29 +0200
-
-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 <bgoglin@debian.org> 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 <jcristau@debian.org> Mon, 23 Nov 2009 17:00:57 +0100
-
-libdrm (2.4.14-1ubuntu2) unstable; urgency=low
-
- * debian/patches/02_silent_master.diff:
- - The library noisily writes to stderr every time the drm master
- is set or dropped; this can have the side-effect that the kernel
- repaints all of the console messages over top of whatever you
- left on the screen. That's fugly.
-
- -- Scott James Remnant <scott@ubuntu.com> Fri, 11 Dec 2009 04:24:50 +0000
-
-libdrm (2.4.14-1ubuntu1) unstable; urgency=low
-
- * Merge from Debian unstable. (LP: #446080)
-
- -- Timo Aaltonen <tjaalton@ubuntu.com> Thu, 08 Oct 2009 16:35:53 +0300
-
-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 <jcristau@debian.org> Thu, 24 Sep 2009 21:53:09 +0200
-
-libdrm (2.4.13-1ubuntu1) unstable; urgency=low
-
- * Merge with Debian. (LP: #420803)
- + Included fixes:
- - radeon: fix GTT writing space check
- (LP: #411115)
- + Remaining Ubuntu changes:
- - control:
- + libdrm-intel1 Replaces libdrm2 (<= 2.4.1-0ubuntu5)
- + libdrm-dev depends on newer linux-libc-dev on !lpia
- + libdrm-dev depends on libdrm-{radeon1,nouveau1}
- + add libdrm-{radeon1,nouveau1}{,-dbg} source packages
- - rules:
- + Add libdrm-nouveau1 and libdrm-nouveau1-dbg package
- + Enable radeon and nouveau experimental apis
- - copyright:
- + Update to include new files from add_libdrm-nouveau.patch
- - libdrm-dev.install: Also install r300_reg.h, via_3d_reg.h,
- xgi_drm.h, the nouveau headers, and other headers not provided by
- the kernel.
- - libdrm-{radeon1,nouveau1}.{install,symbols}: Add nouveau and
- radeon
- * control:
- + Increase linux-libc-dev version dependency to 2.6.30-2.4 for !lpia
- + Drop Replaces on linux-libc-dev
-
- -- Bryce Harrington <bryce@ubuntu.com> Tue, 08 Sep 2009 15:18:34 -0700
-
-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 <jcristau@debian.org> Sat, 05 Sep 2009 13:15:36 +0200
-
-libdrm (2.4.12-1ubuntu1) unstable; urgency=low
-
- * Merge from Debian unstable.
- * Drop 101_update_libdrm-nouveau_interface.patch, included upstream.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com> Tue, 28 Jul 2009 14:13:58 +0300
-
-libdrm (2.4.12-1) unstable; urgency=low
-
- * New upstream release.
-
- -- Brice Goglin <bgoglin@debian.org> Tue, 21 Jul 2009 15:29:03 +0200
-
-libdrm (2.4.11-1ubuntu1) unstable; urgency=low
-
- [ Timo Aaltonen ]
- * Merge from Debian unstable.
-
- [ Christopher James Halse Rogers ]
- * Add 101_update_libdrm-nouveau_interface.patch. Backport several
- libdrm-nouveau commits from upstream which are needed to interface with
- the new 0.0.14 nouveau kernel interface provided by recent nouveau.ko
- (LP: #395700)
- * debian/libdrm-nouveau1.symbols: Add new symbols introduced in
- 101_update_libdrm-nouveau_interface
- * debian/libdrm-dev.install:
- + Remove drm_mode.h from libdrm-dev again; this is shipped in
- linux-libc-dev.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com> Wed, 08 Jul 2009 14:52:50 +0300
-
-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 <jcristau@debian.org> Mon, 08 Jun 2009 16:22:04 +0200
-
-libdrm (2.4.11-0ubuntu1) unstable; urgency=low
-
- * New upstream release
- * Add 100_bo_cache_up_to_64mb.patch. Cherrypick from upstream.
- This avoids making objects significantly bigger than they would be
- otherwise, which would result in some failing at binding to the GTT.
- Fixes issue with hangs viewing large images.
- (LP: #330460)
- * libdrm-intel1.symbols: Add drm_intel_bo_disable_reuse and
- drm_intel_get_pipe_from_crtc_id
- * Don't try to install ChangeLog since not included in upstream release.
-
- -- Bryce Harrington <bryce@ubuntu.com> Tue, 02 Jun 2009 17:31:34 -0700
-
-libdrm (2.4.9-2ubuntu1) unstable; urgency=low
-
- * Merge from debian unstable, remaining changes:
- - control:
- + libdrm-intel1 Replaces libdrm2 (<= 2.4.1-0ubuntu5)
- + libdrm-dev depends on linux-libc-dev => 2.6.28-5.15 on
- [amd64 armel i386] only, and >= 2.6.28-2.4 on lpia
- + Remove scary 'built from DRM snapshot' warning from long description of
- libdrm-intel1{,-dbg}
- + libdrm-dev depends on libdrm-nouveau1
- + add libdrm-nouveau1{,-dbg} source packages
- - rules:
- + Add libdrm-nouveau1 and libdrm-nouveau1-dbg package
- + Enable nouveau experimental api
- - copyright:
- + Update to include new files from add_libdrm-nouveau.patch
- - libdrm-dev.install: Also install r300_reg.h, via_3d_reg.h,
- xgi_drm.h, the nouveau headers, and other headers not provided by
- the kernel.
-
- -- Bryce Harrington <bryce@ubuntu.com> Mon, 11 May 2009 18:56:10 -0700
-
-libdrm (2.4.9-2) unstable; urgency=low
-
- * Ship all drm headers on kfreebsd, again.
- * Move -dbg packages to new debug section.
-
- -- Julien Cristau <jcristau@debian.org> 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 <bgoglin@debian.org> 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 <jcristau@debian.org> Wed, 25 Mar 2009 10:56:53 +0100
-
-libdrm (2.4.5-0ubuntu5) unstable; urgency=low
-
- * debian/patches/02_libdrm_nouveau_update.patch:
- - Pull in upstream changes to libdrm-nouveau.
- + Fixes a memory leak in fence handling.
- + Fixes an error the DDX reports in accessing the frontbuffer.
- + Should be reverted for the next upstream version of libdrm.
-
- -- Christopher James Halse Rogers <raof@ubuntu.com> Sat, 04 Apr 2009 17:54:51 +1100
-
-libdrm (2.4.5-0ubuntu4) unstable; urgency=low
-
- * debian/libdrm-nouveau1.symbols:
- - Fix thinko copied over from libdrm-intel1.symbols. The file should
- specify libdrm-nouveau1 as the corresponding package, not libdrm2.
- Fixes xserver-xorg-video-nouveau failing to depend on libdrm-nouveau1
- (LP: #350925)
- * debian/control:
- - There's no good reason to restrict the dependency of libdrm-dev on
- libdrm-nouveau1 to x86 architectures.
-
- -- Christopher James Halse Rogers <raof@ubuntu.com> Sun, 29 Mar 2009 17:32:31 +1100
-
-libdrm (2.4.5-0ubuntu3) unstable; urgency=low
-
- * debian/control: libdrm-dev should also depend on libdrm-nouveau1
- Fixes xserver-xorg-video-nouveau FTBFS on amd64.
- (LP: #346556)
-
- -- Christopher James Halse Rogers <raof@ubuntu.com> Sat, 21 Mar 2009 11:17:59 +1100
-
-libdrm (2.4.5-0ubuntu2) unstable; urgency=low
-
- * debian/control: nouveau package description should refer to it, not
- intel. (LP: #341294)
- * debian/libdrm-dev.install: Also install r300_reg.h, via_3d_reg.h, and
- xgi_drm.h.
- * debian/rules: Enforce --fail-missing again
-
- -- Bryce Harrington <bryce@ubuntu.com> Wed, 18 Mar 2009 18:50:31 -0700
-
-libdrm (2.4.5-0ubuntu1) unstable; urgency=low
-
- [Bryce Harrington]
- * Merge from debian-unstable (unreleased git). Remaining changes:
- - debian/control: libdrm-intel1 Replaces libdrm2 (<= 2.4.1-0ubuntu5)
- - debian/control: libdrm-dev Depends on linux-libc-dev only
- on [amd64 armel i386] until the other archs have caught up.
- - debian/control: libdrm-dev Replace linux-libc-dev (<= 2.6.28-3.4),
- since it includes the drm headers. We will drop them from libdrm-dev
- when the drivers support the new headers.
- - debian/control: Split the linux-libc-dev dep on lpia and depend
- on >= 2.6.28-2.4 on lpia
- - debian/control: libdrm-dev Depends on linux-libc-dev (>= 2.6.28-5.15).
- * debian/rules: enable nouveau experimental api
-
- [Christopher James Halse Rogers]
- * debian/rules, debian/control, debian/libdrm-nouveau1.install:
- + Add libdrm-nouveau1 and libdrm-nouveau1-dbg package
- * debian/libdrm-nouveau1.symbols:
- + Add initial symbols file.
- * debian/control:
- + Remove scary 'built from DRM snapshot' warning from long description of
- libdrm-intel1{,-dbg}
- * debian/libdrm-dev.install:
- + Also install the libdrm-nouveau headers; these aren't going to be shipped
- by the kernel any time soon.
- * debian/copyright:
- + Update to include new files from add_libdrm-nouveau.patch
-
- -- Bryce Harrington <bryce@ubuntu.com> Mon, 09 Mar 2009 16:43:00 -0700
-
-libdrm (2.4.5-1) unstable; urgency=low
-
- * New upstream release. (closes: #505740)
-
- [ Timo Aaltonen ]
- * New upstream release. (closes: #505740)
- * 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.
-
- -- Julien Cristau <jcristau@debian.org> Tue, 24 Mar 2009 22:20:50 +0100
-
-libdrm (2.4.4-0ubuntu6) unstable; urgency=low
-
- * Bump dep on linux-libc-dev dep to >= 2.6.28-1.4 on lpia as this version of
- the headers now include a compatibility #define which mesa requires.
-
- -- Loic Minier <lool@dooz.org> Tue, 03 Feb 2009 23:20:27 +0100
-
-libdrm (2.4.4-0ubuntu5) unstable; urgency=low
-
- * Revert XS-Original-Vcs-* to Vcs-*, this *is* maintained in Git, sorry.
- * Split the linux-libc-dev dep on lpia and depend on >= 2.6.28-1.1 on lpia
- -- the version differs because it's built from linux-lpia instead of
- linux; this is not going to be fixable anytime soon, so we should be
- careful to use arch-specific versions for linux-libc-dev deps/bdeps.
-
- -- Loic Minier <lool@dooz.org> Sun, 01 Feb 2009 16:25:46 +0100
-
-libdrm (2.4.4-0ubuntu4) unstable; urgency=low
-
- * Also depend on linux-libc-dev on [lpia] as linux-libc-dev_2.6.28-1.2_lpia
- has the drm headers; the avoidance of this dep on other arches just helps
- installability, but because the headers are missing you're unlikely to do
- anything with the lib anyway. The solution is a linux-ports upload.
- * Rename Vcs-* to XS-Original-Vcs-*.
-
- -- Loic Minier <lool@dooz.org> Sat, 31 Jan 2009 23:50:33 +0100
-
-libdrm (2.4.4-0ubuntu3) unstable; urgency=low
-
- * libdrm-dev Depends on linux-libc-dev only on [amd64 armel i386]
- until the other archs have caught up.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com> Sat, 31 Jan 2009 12:37:12 +0200
-
-libdrm (2.4.4-0ubuntu2) unstable; urgency=low
-
- * debian/control: Add a missing comma to libdrm-dev's Depends.
-
- -- Timo Aaltonen <tjaalton@ubuntu.com> Fri, 23 Jan 2009 13:45:58 +0200
-
-libdrm (2.4.4-0ubuntu1) unstable; urgency=low
-
- * Merge with Debian experimental, remaining changes:
- - libdrm-intel1 Replaces libdrm2 (<= 2.4.1-0ubuntu5)
- - libdrm-dev: Replace linux-libc-dev (<= 2.6.28-3.4), since it
- includes the drm headers. We will drop them from libdrm-dev
- after unstable alpha2 when the drivers support the new headers.
- - debian/libdrm-dev.install: Don't install the drm headers anymore,
- the drivers should build against the ones provided by the kernel.
- * debian/libdrm-dev.install: Include a couple of headers not found
- in the 2.6.28 kernel (mach64, nouveau). (LP: #314771)
- * debian/control: libdrm-dev Depends on linux-libc-dev (>= 2.6.28-5.15).
-
- -- Timo Aaltonen <tjaalton@ubuntu.com> Fri, 23 Jan 2009 10:19:06 +0200
-
-libdrm (2.4.1-0ubuntu9) unstable; urgency=low
-
- * debian/libdrm-dev.install: Don't install the drm headers anymore,
- the drivers should build against the ones provided by the kernel.
- (LP: #308387)
-
- -- Timo Aaltonen <tjaalton@ubuntu.com> Fri, 02 Jan 2009 12:48:40 +0200
-
-libdrm (2.4.1-0ubuntu8) unstable; urgency=low
-
- * libdrm-dev: Replace linux-libc-dev (<= 2.6.28-3.4), since it
- includes the drm headers. We will drop them from libdrm-dev
- after unstable alpha2 when the drivers support the new headers.
- (LP: #308387)
-
- -- Timo Aaltonen <tjaalton@ubuntu.com> Tue, 16 Dec 2008 23:29:38 +0200
-
-libdrm (2.4.1-0ubuntu7) unstable; urgency=low
-
- * Merge with debian-experimental git, remaining changes:
- - libdrm-intel1 Replaces libdrm2 (<= 2.4.1-0ubuntu5)
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com> Wed, 03 Dec 2008 09:24:35 +0200
-
-libdrm (2.4.1-0ubuntu6) unstable; urgency=low
-
- * libdrm-intel1 Replaces libdrm2 (<= 2.4.1-0ubuntu5)
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com> Thu, 27 Nov 2008 10:25:29 +0200
-
-libdrm (2.4.1-0ubuntu5) unstable; urgency=low
-
- * Split the symbols file (libdrm2, libdrm-intel1), remove shlibs and
- use dh_makeshlibs properly instead.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com> Thu, 27 Nov 2008 09:42:59 +0200
-
-libdrm (2.4.1-0ubuntu4) unstable; urgency=low
-
- * debian/libdrm2.install: Careful with those wildmarks.
- libdrm2 got libdrm_intel.so too, don't do that.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com> Thu, 27 Nov 2008 08:58:47 +0200
-
-libdrm (2.4.1-0ubuntu3) unstable; urgency=low
-
- * Actually build the new libdrm-intel1 package.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com> Wed, 26 Nov 2008 14:41:08 +0200
-
-libdrm (2.4.1-0ubuntu2) unstable; urgency=low
-
- * Build-depend on libpthread-stubs0-dev and pkg-config (FTBFS).
- * Make libdrm-dev depend on libdrm-intel1.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com> Wed, 26 Nov 2008 01:15:07 +0200
-
-libdrm (2.4.1-0ubuntu1) unstable; urgency=low
-
- * New upstream release.
-
- -- Timo Aaltonen <tepsipakki@ubuntu.com> Wed, 26 Nov 2008 00:38:11 +0200
-
-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 <jcristau@debian.org> 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 <jcristau@debian.org> 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 <jcristau@debian.org> 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 <dnusinow@debian.org> 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 <jcristau@debian.org> 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 <julien.cristau@ens-lyon.org> 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 <thierry@gilfi.de> 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 <dilinger@debian.org> 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 <dnusinow@debian.org> Tue, 4 Apr 2006 23:46:05 -0400
-
-libdrm (2.0-1) experimental; urgency=low
-
- * First upload to Debian
-
- -- David Nusinow <dnusinow@debian.org> Thu, 5 Jan 2006 22:45:27 -0500
-
-libdrm (2.0-0ubuntu1) unstable; urgency=low
-
- * New upstream release.
- * Change binary package from libdrm1 to libdrm2, following soversion bump.
-
- -- Daniel Stone <daniel.stone@ubuntu.com> Mon, 12 Dec 2005 13:05:22 +1100
-
-libdrm (1.0.5-0ubuntu1) unstable; urgency=low
-
- * New upstream version.
-
- -- Daniel Stone <daniel.stone@ubuntu.com> 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 <mmagallo@debian.org> 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 <mmagallo@debian.org> Thu, 08 Sep 2005 20:49:01 -0600
-
-libdrm (1.0.3-1) unstable; urgency=low
-
- * New upstream
-
- -- Marcelo E. Magallon <mmagallo@debian.org> 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 <mmagallo@debian.org> 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 <mmagallo@debian.org> Fri, 19 Aug 2005 22:01:32 -0600
-
-libdrm (1.0.2-1) unstable; urgency=low
-
- * Initial release. Closes: #324074
-
- -- Marcelo E. Magallon <mmagallo@debian.org> Fri, 19 Aug 2005 21:11:18 -0600
+++ /dev/null
-Source: libdrm
-Priority: optional
-Maintainer: SooChan Lim <sc1.lim@samsung.com>, Sangjin Lee <lsj119@samsung.com>, Debian X Strike Force <debian-x@lists.debian.org>
-Uploaders: Julien Cristau <jcristau@debian.org>, David Nusinow <dnusinow@debian.org>, Brice Goglin <bgoglin@debian.org>, SooChan Lim <sc1.lim@samsung.com>
-Build-Depends: debhelper (>= 5.0.0), libx11-dev, dpkg-dev (>= 1.13.19), quilt (>= 0.40), automake, libtool, pkg-config, libpthread-stubs0-dev, libpciaccess-dev
-Standards-Version: 3.8.3
-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-slp1
-Replaces: linux-libc-dev (>= 2.6.29)
-#Depends: linux-libc-dev (>= 2.6.28) [linux-any], libdrm2 (= ${binary:Version}), libdrm-intel1 (= ${binary:Version}) [amd64 i386 kfreebsd-amd64 kfreebsd-i386]
-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}
-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})
-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-slp1
-Section: libs
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Userspace interface to slp-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-slp1-dbg
-Section: debug
-Priority: extra
-Architecture: any
-Depends: libdrm-slp1 (= ${binary:Version}), ${misc:Depends}
-Description: Userspace interface to slp-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-slp package.
-
-Package: libkms1
-Section: libs
-Architecture: 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: 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-intel1
-#Section: libs
-#Architecture: amd64 i386 kfreebsd-amd64 kfreebsd-i386
-#Depends: ${shlibs:Depends}, ${misc:Depends}
-#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}
-#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.
+++ /dev/null
-Copyright 2000 - 2011 Samsung Electronics co., Ltd. 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 fur-
-nished 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, FIT-
-NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
-NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
- 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 <airlied@linux.ie>
- Copyright (c) 2007-2008 Jakob Bornecrantz <wallbraker@gmail.com>
- 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 <glisse@freedesktop.org>
-
- 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.
+++ /dev/null
-usr/include/*
-usr/include/exynos/*
-usr/lib/lib*.a
-usr/lib/lib*.la
-usr/lib/libdrm.so
-usr/lib/libdrm_exynos.so
-usr/lib/libdrm_slp.so
-usr/lib/pkgconfig/*
+++ /dev/null
-#/usr/lib/libdrm.so.2 /usr/lib/libdrm.so
-#/usr/lib/libdrm_slp.so.1.0.0 /usr/lib/libdrm.so
-#/usr/lib/libdrm_intel.so.1 /usr/lib/libdrm_intel.so
-#/usr/lib/libdrm_nouveau.so.1 /usr/lib/libdrm_nouveau.so
-#/usr/lib/libdrm_radeon.so.1 /usr/lib/libdrm_radeon.so
-#/usr/lib/libkms.so.1 /usr/lib/libkms.so
+++ /dev/null
-usr/lib/libdrm_intel.so.1* /lib
+++ /dev/null
-usr/lib/libdrm_nouveau.so.1* /lib
+++ /dev/null
-usr/lib/libdrm_radeon.so.1* /lib
+++ /dev/null
-usr/lib/libdrm_slp*.so.* /usr/lib
+++ /dev/null
-usr/lib/libdrm.so.* /usr/lib
-usr/lib/libdrm_exynos.so.* /usr/lib
+++ /dev/null
-usr/lib/libkms.so.1* /usr/lib
-usr/lib/libkms*.so /usr/lib
+++ /dev/null
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-include debian/xsfbs/xsfbs.mk
-
-# These are used for cross-compiling and for saving the configure script
-# from having to guess our platform (since we know it already)
-DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
-DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
-DEB_HOST_ARCH_OS = $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
-
-ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
-#confflags += --build=$(DEB_HOST_GNU_TYPE)
- confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
-else
- confflags += --build=$(DEB_HOST_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
-# confflags += --build=$(DEB_BUILD_GNU_TYPE) --host=$(DEB_HOST_GNU_TYPE)
-endif
-#ifeq (linux, $(DEB_HOST_ARCH_OS))
-# confflags += --enable-udev
-# confflags += --enable-libkms
-# LIBKMS = yes
-# confflags += --enable-vmwgfx-experimental-api
-# confflags += --enable-nouveau-experimental-api
-# NOUVEAU = yes
-# confflags += --enable-radeon
-# RADEON = yes
-#else
-confflags += --enable-udev
-#confflags += --disable-udev
-confflags += --enable-libkms
-LIBKMS=yes
-confflags += --disable-nouveau
-NOUVEAU = no
-confflags += --disable-radeon
-RADEON = no
-#endif
-
-#ifneq (,$(filter linux kfreebsd,$(DEB_HOST_ARCH_OS)))
-# INTEL = yes
-#endif
-
-#ifeq ($(INTEL), yes)
-# confflags += --enable-intel
-#else
-# confflags += --disable-intel
-#endif
-
-confflags += --disable-intel
-INTEL=no
-
-CFLAGS = -Wall -g
-LDFLAGS += -Wl,--hash-style=both -Wl,--as-needed
-ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -O0
-else
- CFLAGS += -O2
-endif
-ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
- NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
- MAKEFLAGS += -j$(NUMJOBS)
-endif
-
-#soolim
-INTEL=no
-LIBKMS=yes
-RADEON=no
-NOUVEAU=no
-SLP=yes
-
-#configure: $(STAMP_DIR)/patch
-configure:
- dh_testdir
- autoreconf -vfi
-
-obj-$(DEB_BUILD_GNU_TYPE)/config.status: configure
- dh_testdir
- test -d obj-$(DEB_BUILD_GNU_TYPE) || mkdir obj-$(DEB_BUILD_GNU_TYPE)
- cd obj-$(DEB_BUILD_GNU_TYPE) && \
- ../configure --prefix=/usr --mandir=\$${prefix}/share/man \
- --infodir=\$${prefix}/share/info --enable-exynos-experimental-api \
- --enable-static=yes $(confflags) \
- CFLAGS="$(CFLAGS)" \
- LDFLAGS="$(CFLAGS)"
-
-build: build-stamp
-build-stamp: obj-$(DEB_BUILD_GNU_TYPE)/config.status
- dh_testdir
- cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE)
- >$@
-
-clean: xsfclean
- dh_testdir
- dh_testroot
- rm -f build-stamp
-
- rm -f config.cache config.log config.status
- rm -f */config.cache */config.log */config.status
- rm -f conftest* */conftest*
- rm -rf autom4te.cache */autom4te.cache
- rm -rf obj-*
- rm -f $$(find -name Makefile.in)
- rm -f compile config.guess config.sub configure depcomp install-sh
- rm -f ltmain.sh missing INSTALL aclocal.m4 config.h.in mkinstalldirs
- rm -f libdrm.pc libdrm/config.h.in
-
- dh_clean
-
-install: build
- dh_testdir
- dh_testroot
- dh_clean -k
- dh_installdirs
-
- cd obj-$(DEB_BUILD_GNU_TYPE) && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
-#commented by sj76.park
-#ifeq (linux, $(DEB_HOST_ARCH_OS))
-# # remove files provided by linux-libc-dev
-# for file in drm_mode.h drm_sarea.h drm.h i915_drm.h mga_drm.h r128_drm.h radeon_drm.h savage_drm.h sis_drm.h via_drm.h; do \
-# rm -f debian/tmp/usr/include/drm/$$file; \
-# done
-#endif
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir -s
- dh_testroot -s
- dh_installchangelogs -s ChangeLog
- dh_installdocs -s
- dh_installexamples -s
- dh_install -s --sourcedir=debian/tmp --fail-missing
- #dh_install -s --sourcedir=debian/tmp
- #dh_install -s --sourcedir=debian/tmp -X.la --fail-missing
- dh_link -s
- 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-nouveau1 --dbg-package=libdrm-nouveau1-dbg
-endif
-ifeq ($(RADEON), yes)
- #dh_strip -plibdrm-radeon1 --dbg-package=libdrm-radeon1-dbg
-endif
-ifeq ($(LIBKMS), yes)
- dh_strip -p libkms1 --dbg-package=libkms1-dbg
-endif
-ifeq ($(SLP), yes)
- dh_strip -p libdrm-slp1 --dbg-package=libdrm-slp1-dbg
-endif
- dh_strip -s
- #dh_strip -s --remaining-packages
- dh_compress -s
- dh_fixperms -s
- dh_makeshlibs -plibdrm2 -V'libdrm2 (>= 2.4.17)' -- -c4
-ifeq ($(INTEL), yes)
- dh_makeshlibs -plibdrm-intel1 -V'libdrm-intel1 (>= 2.4.21)' -- -c4
-endif
-ifeq ($(NOUVEAU), yes)
- dh_makeshlibs -plibdrm-nouveau1 -V'libdrm-nouveau1 (>= 2.4.20-3~)' -- -c4
-endif
-ifeq ($(RADEON), yes)
- dh_makeshlibs -plibdrm-radeon1 -V'libdrm-radeon1 (>= 2.4.20)' -- -c4
-endif
-ifeq ($(LIBKMS), yes)
- dh_makeshlibs -plibkms1 -V'libkms1' -- -c4
-endif
-ifeq ($(SLP), yes)
- dh_makeshlibs -plibdrm-slp1 -V'libdrm-slp1 (>= 2.4)' -- -c4
-endif
- dh_installdeb -s
- dh_shlibdeps -s
- dh_gencontrol -s
- dh_md5sums -s
- dh_builddeb -s
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install
+++ /dev/null
-version=3
-
-http://dri.freedesktop.org/libdrm/libdrm-(.*)\.tar\.gz
+++ /dev/null
-#!/bin/sh
-
-set -e
-
-if ! [ -d debian/prune ]; then
- exit 0
-fi
-
-if [ "x$1" != x--upstream-version ]; then
- exit 1
-fi
-
-version="$2"
-filename="$3"
-
-if [ -z "$version" ] || ! [ -f "$filename" ]; then
- exit 1
-fi
-
-dir="$(pwd)"
-tempdir="$(mktemp -d)"
-
-cd "$tempdir"
-tar xf "$dir/$filename"
-cat "$dir"/debian/prune/* | while read file; do rm -f */$file; done
-
-tar czf "$dir/$filename" *
-cd "$dir"
-rm -rf "$tempdir"
-echo "Done pruning upstream tarball"
-
-exit 0
+++ /dev/null
-#!/usr/bin/make -f
-
-# Debian X Strike Force Build System (XSFBS): Make portion
-
-# Copyright 1996 Stephen Early
-# Copyright 1997 Mark Eichin
-# Copyright 1998-2005, 2007 Branden Robinson
-# Copyright 2005 David Nusinow
-#
-# Licensed under the GNU General Public License, version 2. See the file
-# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
-
-# Originally by Stephen Early <sde1000@debian.org>
-# Modified by Mark W. Eichin <eichin@kitten.gen.ma.us>
-# Modified by Adam Heath <doogie@debian.org>
-# Modified by Branden Robinson <branden@debian.org>
-# Modified by Fabio Massimo Di Nitto <fabbione@fabbione.net>
-# Modified by David Nusinow <dnusinow@debian.org>
-# Acknowledgements to Manoj Srivastava.
-
-# Pass $(DH_OPTIONS) into the environment for debhelper's benefit.
-export DH_OPTIONS
-
-# force quilt to not use ~/.quiltrc and to use debian/patches
-QUILT = QUILT_PATCHES=debian/patches quilt --quiltrc /dev/null
-
-# Set up parameters for the upstream build environment.
-
-# Determine (source) package name from Debian changelog.
-SOURCE_NAME:=$(shell dpkg-parsechangelog -ldebian/changelog \
- | grep '^Source:' | awk '{print $$2}')
-
-# Determine package version from Debian changelog.
-SOURCE_VERSION:=$(shell dpkg-parsechangelog -ldebian/changelog \
- | grep '^Version:' | awk '{print $$2}')
-
-# Determine upstream version number.
-UPSTREAM_VERSION:=$(shell echo $(SOURCE_VERSION) | sed 's/-.*//')
-
-# Determine the source version without the epoch for make-orig-tar-gz
-NO_EPOCH_VER:=$(shell echo $(UPSTREAM_VERSION) | sed 's/^.://')
-
-# Figure out who's building this package.
-BUILDER:=$(shell echo $${DEBEMAIL:-$${EMAIL:-$$(echo $$LOGNAME@$$(cat /etc/mailname 2>/dev/null))}})
-
-# Find out if this is an official build; an official build has nothing but
-# digits, dots, and/or the codename of a release in the Debian part of the
-# version number. Anything else indicates an unofficial build.
-OFFICIAL_BUILD:=$(shell VERSION=$(SOURCE_VERSION); if ! expr "$$(echo $${VERSION\#\#*-} | sed 's/\(woody\|sarge\|etch\|lenny\)//g')" : ".*[^0-9.].*" >/dev/null 2>&1; then echo yes; fi)
-
-# Set up parameters for the Debian build environment.
-
-# Determine our architecture.
-BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
-# Work around some old-time dpkg braindamage.
-BUILD_ARCH:=$(subst i486,i386,$(BUILD_ARCH))
-# The DEB_HOST_ARCH variable may be set per the Debian cross-compilation policy.
-ifdef DEB_HOST_ARCH
- ARCH:=$(DEB_HOST_ARCH)
-else
- # dpkg-cross sets the ARCH environment variable; if set, use it.
- ifdef ARCH
- ARCH:=$(ARCH)
- else
- ARCH:=$(BUILD_ARCH)
- endif
-endif
-
-# $(STAMP_DIR) houses stamp files for complex targets.
-STAMP_DIR:=stampdir
-
-# $(DEBTREEDIR) is where all install rules are told (via $(DESTDIR)) to place
-# their files.
-DEBTREEDIR:=$(CURDIR)/debian/tmp
-
-# All "important" targets have four lines:
-# 1) A target name that is invoked by a package-building tool or the user.
-# This consists of a dependency on a "$(STAMP_DIR)/"-prefixed counterpart.
-# 2) A line delcaring 1) as a phony target (".PHONY:").
-# 3) A "$(STAMP_DIR)/"-prefixed target which does the actual work, and may
-# depend on other targets.
-# 4) A line declaring 3) as a member of the $(stampdir_targets) variable; the
-# "$(STAMP_DIR)/" prefix is omitted.
-#
-# This indirection is needed so that the "stamp" files that signify when a rule
-# is done can be located in a separate "stampdir". Recall that make has no way
-# to know when a goal has been met for a phony target (like "build" or
-# "install").
-#
-# At the end of each "$(STAMP_DIR)/" target, be sure to run the command ">$@"
-# so that the target will not be run again. Removing the file will make Make
-# run the target over.
-
-# All phony targets should be declared as dependencies of .PHONY, even if they
-# do not have "($STAMP_DIR)/"-prefixed counterparts.
-
-# Define a harmless default rule to keep things from going nuts by accident.
-.PHONY: default
-default:
-
-# Set up the $(STAMP_DIR) directory.
-.PHONY: stampdir
-stampdir_targets+=stampdir
-stampdir: $(STAMP_DIR)/stampdir
-$(STAMP_DIR)/stampdir:
- mkdir $(STAMP_DIR)
- >$@
-
-# Set up the package build directory as quilt expects to find it.
-.PHONY: prepare
-stampdir_targets+=prepare
-prepare: $(STAMP_DIR)/prepare
-$(STAMP_DIR)/prepare: $(STAMP_DIR)/logdir $(STAMP_DIR)/genscripts
- >$@
-
-.PHONY: logdir
-stampdir_targets+=logdir
-logdir: $(STAMP_DIR)/logdir
-$(STAMP_DIR)/logdir: $(STAMP_DIR)/stampdir
- mkdir -p $(STAMP_DIR)/log
- >$@
-
-# Apply all patches to the upstream source.
-.PHONY: patch
-stampdir_targets+=patch
-patch: $(STAMP_DIR)/patch
-$(STAMP_DIR)/patch: $(STAMP_DIR)/prepare
- if ! [ `which quilt` ]; then \
- echo "Couldn't find quilt. Please install it or add it to the build-depends for this package."; \
- exit 1; \
- fi; \
- if $(QUILT) next >/dev/null 2>&1; then \
- echo -n "Applying patches..."; \
- if $(QUILT) push -a -v >$(STAMP_DIR)/log/patch 2>&1; then \
- cat $(STAMP_DIR)/log/patch; \
- echo "successful."; \
- else \
- cat $(STAMP_DIR)/log/patch; \
- echo "failed! (check $(STAMP_DIR)/log/patch for details)"; \
- exit 1; \
- fi; \
- else \
- echo "No patches to apply"; \
- fi; \
- >$@
-
-# Revert all patches to the upstream source.
-.PHONY: unpatch
-unpatch: $(STAMP_DIR)/logdir
- rm -f $(STAMP_DIR)/patch
- @echo -n "Unapplying patches..."; \
- if $(QUILT) applied >/dev/null 2>/dev/null; then \
- if $(QUILT) pop -a -v >$(STAMP_DIR)/log/unpatch 2>&1; then \
- cat $(STAMP_DIR)/log/unpatch; \
- echo "successful."; \
- else \
- cat $(STAMP_DIR)/log/unpatch; \
- echo "failed! (check $(STAMP_DIR)/log/unpatch for details)"; \
- exit 1; \
- fi; \
- else \
- echo "nothing to do."; \
- fi
-
-# Clean the generated maintainer scripts.
-.PHONY: cleanscripts
-cleanscripts:
- rm -f $(STAMP_DIR)/genscripts
- rm -f debian/*.config \
- debian/*.postinst \
- debian/*.postrm \
- debian/*.preinst \
- debian/*.prerm
-
-# Clean the package build tree.
-.PHONY: xsfclean
-xsfclean: cleanscripts unpatch
- dh_testdir
- rm -rf .pc
- rm -rf $(STAMP_DIR)
- dh_clean
-
-# Remove files from the upstream source tree that we don't need, or which have
-# licensing problems. It must be run before creating the .orig.tar.gz.
-#
-# Note: This rule is for Debian package maintainers' convenience, and is not
-# needed for conventional build scenarios.
-.PHONY: prune-upstream-tree
-prune-upstream-tree:
- # Ensure we're in the correct directory.
- dh_testdir
- grep -rvh '^#' debian/prune/ | xargs --no-run-if-empty rm -rf
-
-# Verify that there are no offsets or fuzz in the patches we apply.
-#
-# Note: This rule is for Debian package maintainers' convenience, and is not
-# needed for conventional build scenarios.
-.PHONY: patch-audit
-patch-audit: prepare unpatch
- @echo -n "Auditing patches..."; \
- >$(STAMP_DIR)/log/patch; \
- FUZZY=; \
- while [ -n "$$($(QUILT) next)" ]; do \
- RESULT=$$($(QUILT) push -v | tee -a $(STAMP_DIR)/log/patch | grep ^Hunk | sed 's/^Hunk.*\(succeeded\|FAILED\).*/\1/');\
- case "$$RESULT" in \
- succeeded) \
- echo "fuzzy patch: $$($(QUILT) top)" \
- | tee -a $(STAMP_DIR)/log/$$($(QUILT) top); \
- FUZZY=yes; \
- ;; \
- FAILED) \
- echo "broken patch: $$($(QUILT) next)" \
- | tee -a $(STAMP_DIR)/log/$$($(QUILT) next); \
- exit 1; \
- ;; \
- esac; \
- done; \
- if [ -n "$$FUZZY" ]; then \
- echo "there were fuzzy patches; please fix."; \
- exit 1; \
- else \
- echo "done."; \
- fi
-
-# Generate the maintainer scripts.
-.PHONY: genscripts
-stampdir_targets+=genscripts
-genscripts: $(STAMP_DIR)/genscripts
-$(STAMP_DIR)/genscripts: $(STAMP_DIR)/stampdir
- for FILE in debian/*.config.in \
- debian/*.postinst.in \
- debian/*.postrm.in \
- debian/*.preinst.in \
- debian/*.prerm.in; do \
- if [ -e "$$FILE" ]; then \
- MAINTSCRIPT=$$(echo $$FILE | sed 's/.in$$//'); \
- sed -n '1,/^#INCLUDE_SHELL_LIB#$$/p' <$$FILE \
- | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >$$MAINTSCRIPT.tmp; \
- cat debian/xsfbs/xsfbs.sh >>$$MAINTSCRIPT.tmp; \
- sed -n '/^#INCLUDE_SHELL_LIB#$$/,$$p' <$$FILE \
- | sed -e '/^#INCLUDE_SHELL_LIB#$$/d' >>$$MAINTSCRIPT.tmp; \
- sed -e 's/@SOURCE_VERSION@/$(SOURCE_VERSION)/' \
- -e 's/@OFFICIAL_BUILD@/$(OFFICIAL_BUILD)/' \
- <$$MAINTSCRIPT.tmp >$$MAINTSCRIPT; \
- rm $$MAINTSCRIPT.tmp; \
- fi; \
- done
- # Validate syntax of generated shell scripts.
- #sh debian/scripts/validate-posix-sh debian/*.config \
- # debian/*.postinst \
- # debian/*.postrm \
- # debian/*.preinst \
- # debian/*.prerm
- >$@
-
-# Compute dependencies for drivers
-#
-VIDEODEP = $(shell cat /usr/share/xserver-xorg/videodrvdep 2>/dev/null)
-INPUTDEP = $(shell cat /usr/share/xserver-xorg/xinputdep 2>/dev/null)
-
-# these two can be removed post-squeeze
-VIDEOABI = $(shell cat /usr/share/xserver-xorg/videoabiver 2>/dev/null)
-INPUTABI = $(shell cat /usr/share/xserver-xorg/inputabiver 2>/dev/null)
-VIDDRIVER_PROVIDES = xserver-xorg-video-$(VIDEOABI), xorg-driver-video
-INPDRIVER_PROVIDES = xserver-xorg-input-$(INPUTABI), xorg-driver-input
-
-ifeq ($(PACKAGE),)
-PACKAGE=$(shell awk '/^Package:/ { print $$2; exit }' < debian/control)
-endif
-
-.PHONY: serverabi
-serverabi: install
-ifeq ($(VIDEODEP),)
- @echo 'error: xserver-xorg-dev >= 1.7.6.901 needs to be installed'
- @exit 1
-else
- echo "xviddriver:Depends=$(VIDEODEP)" >> debian/$(PACKAGE).substvars
- echo "xinpdriver:Depends=$(INPUTDEP)" >> debian/$(PACKAGE).substvars
- # the following is there for compatibility...
- echo "xviddriver:Provides=$(VIDDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
- echo "xinpdriver:Provides=$(INPDRIVER_PROVIDES)" >> debian/$(PACKAGE).substvars
- echo "xserver:Depends=$(VIDEODEP), $(INPUTDEP)" >> debian/$(PACKAGE).substvars
-endif
-
-# vim:set noet ai sts=8 sw=8 tw=0:
+++ /dev/null
-# This is the X Strike Force shell library for X Window System package
-# maintainer scripts. It serves to define shell functions commonly used by
-# such packages, and performs some error checking necessary for proper operation
-# of those functions. By itself, it does not "do" much; the maintainer scripts
-# invoke the functions defined here to accomplish package installation and
-# removal tasks.
-
-# If you are reading this within a Debian package maintainer script (e.g.,
-# /var/lib/dpkg/info/PACKAGE.{config,preinst,postinst,prerm,postrm}), you can
-# skip past this library by scanning forward in this file to the string
-# "GOBSTOPPER".
-
-SOURCE_VERSION=@SOURCE_VERSION@
-OFFICIAL_BUILD=@OFFICIAL_BUILD@
-
-# Use special abnormal exit codes so that problems with this library are more
-# easily tracked down.
-SHELL_LIB_INTERNAL_ERROR=86
-SHELL_LIB_THROWN_ERROR=74
-SHELL_LIB_USAGE_ERROR=99
-
-# old -> new variable names
-if [ -z "$DEBUG_XORG_PACKAGE" ] && [ -n "$DEBUG_XFREE86_PACKAGE" ]; then
- DEBUG_XORG_PACKAGE="$DEBUG_XFREE86_PACKAGE"
-fi
-if [ -z "$DEBUG_XORG_DEBCONF" ] && [ -n "$DEBUG_XFREE86_DEBCONF" ]; then
- DEBUG_XORG_DEBCONF="$DEBUG_XFREE86_DEBCONF"
-fi
-
-# initial sanity checks
-if [ -z "$THIS_PACKAGE" ]; then
- cat >&2 <<EOF
-Error: package maintainer script attempted to use shell library without
-definining \$THIS_PACKAGE shell variable. Please report the package name,
-version, and the text of this error message to the Debian Bug Tracking System.
-Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
-instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
-"doc-debian" package, or install the "reportbug" package and use the command of
-the same name to file a report against version $SOURCE_VERSION of this package.
-EOF
- exit $SHELL_LIB_USAGE_ERROR
-fi
-
-if [ -z "$THIS_SCRIPT" ]; then
- cat >&2 <<EOF
-Error: package maintainer script attempted to use shell library without
-definining \$THIS_SCRIPT shell variable. Please report the package name,
-version, and the text of this error message to the Debian Bug Tracking System.
-Visit <http://www.debian.org/Bugs/Reporting> on the World Wide Web for
-instructions, read the file /usr/share/doc/debian/bug-reporting.txt from the
-"doc-debian" package, or install the "reportbug" package and use the command of
-the same name to file a report against version $SOURCE_VERSION of the
-"$THIS_PACKAGE" package.
-EOF
- exit $SHELL_LIB_USAGE_ERROR
-fi
-
-if [ "$1" = "reconfigure" ] || [ -n "$DEBCONF_RECONFIGURE" ]; then
- RECONFIGURE="true"
-else
- RECONFIGURE=
-fi
-
-if ([ "$1" = "install" ] || [ "$1" = "configure" ]) && [ -z "$2" ]; then
- FIRSTINST="yes"
-fi
-
-if [ -z "$RECONFIGURE" ] && [ -z "$FIRSTINST" ]; then
- UPGRADE="yes"
-fi
-
-trap "message;\
- message \"Received signal. Aborting $THIS_PACKAGE package $THIS_SCRIPT script.\";\
- message;\
- exit 1" HUP INT QUIT TERM
-
-reject_nondigits () {
- # syntax: reject_nondigits [ operand ... ]
- #
- # scan operands (typically shell variables whose values cannot be trusted) for
- # characters other than decimal digits and barf if any are found
- while [ -n "$1" ]; do
- # does the operand contain anything but digits?
- if ! expr "$1" : "[[:digit:]]\+$" > /dev/null 2>&1; then
- # can't use die(), because it wraps message() which wraps this function
- echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_nondigits() encountered" \
- "possibly malicious garbage \"$1\"" >&2
- exit $SHELL_LIB_THROWN_ERROR
- fi
- shift
- done
-}
-
-reject_unlikely_path_chars () {
- # syntax: reject_unlikely_path_chars [ operand ... ]
- #
- # scan operands (typically shell variables whose values cannot be trusted) for
- # characters unlikely to be seen in a path and which the shell might
- # interpret and barf if any are found
- while [ -n "$1" ]; do
- # does the operand contain any funny characters?
- if expr "$1" : '.*[!$&()*;<>?|].*' > /dev/null 2>&1; then
- # can't use die(), because I want to avoid forward references
- echo "$THIS_PACKAGE $THIS_SCRIPT error: reject_unlikely_path_chars()" \
- "encountered possibly malicious garbage \"$1\"" >&2
- exit $SHELL_LIB_THROWN_ERROR
- fi
- shift
- done
-}
-
-# Query the terminal to establish a default number of columns to use for
-# displaying messages to the user. This is used only as a fallback in the
-# event the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while
-# the script is running, and this cannot, only being calculated once.)
-DEFCOLUMNS=$(stty size 2> /dev/null | awk '{print $2}') || true
-if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" > /dev/null 2>&1; then
- DEFCOLUMNS=80
-fi
-
-message () {
- # pretty-print messages of arbitrary length
- reject_nondigits "$COLUMNS"
- echo "$*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS} >&2
-}
-
-observe () {
- # syntax: observe message ...
- #
- # issue observational message suitable for logging someday when support for
- # it exists in dpkg
- if [ -n "$DEBUG_XORG_PACKAGE" ]; then
- message "$THIS_PACKAGE $THIS_SCRIPT note: $*"
- fi
-}
-
-warn () {
- # syntax: warn message ...
- #
- # issue warning message suitable for logging someday when support for
- # it exists in dpkg; also send to standard error
- message "$THIS_PACKAGE $THIS_SCRIPT warning: $*"
-}
-
-die () {
- # syntax: die message ...
- #
- # exit script with error message
- message "$THIS_PACKAGE $THIS_SCRIPT error: $*"
- exit $SHELL_LIB_THROWN_ERROR
-}
-
-internal_error () {
- # exit script with error; essentially a "THIS SHOULD NEVER HAPPEN" message
- message "internal error: $*"
- if [ -n "$OFFICIAL_BUILD" ]; then
- message "Please report a bug in the $THIS_SCRIPT script of the" \
- "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
- "Tracking System. Include all messages above that mention the" \
- "$THIS_PACKAGE package. Visit " \
- "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
- "instructions, read the file" \
- "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
- "package, or install the reportbug package and use the command of" \
- "the same name to file a report."
- fi
- exit $SHELL_LIB_INTERNAL_ERROR
-}
-
-usage_error () {
- message "usage error: $*"
- message "Please report a bug in the $THIS_SCRIPT script of the" \
- "$THIS_PACKAGE package, version $SOURCE_VERSION to the Debian Bug" \
- "Tracking System. Include all messages above that mention the" \
- "$THIS_PACKAGE package. Visit " \
- "<http://www.debian.org/Bugs/Reporting> on the World Wide Web for" \
- "instructions, read the file" \
- "/usr/share/doc/debian/bug-reporting.txt from the doc-debian" \
- "package, or install the reportbug package and use the command of" \
- "the same name to file a report."
- exit $SHELL_LIB_USAGE_ERROR
-}
-
-font_update () {
- # run $UPDATECMDS in $FONTDIRS
-
- local dir cmd shortcmd x_font_dir_prefix
-
- x_font_dir_prefix="/usr/share/fonts/X11"
-
- if [ -z "$UPDATECMDS" ]; then
- usage_error "font_update() called but \$UPDATECMDS not set"
- fi
- if [ -z "$FONTDIRS" ]; then
- usage_error "font_update() called but \$FONTDIRS not set"
- fi
-
- reject_unlikely_path_chars "$UPDATECMDS"
- reject_unlikely_path_chars "$FONTDIRS"
-
- for dir in $FONTDIRS; do
- if [ -d "$x_font_dir_prefix/$dir" ]; then
- for cmd in $UPDATECMDS; do
- if which "$cmd" > /dev/null 2>&1; then
- shortcmd=${cmd##*/}
- observe "running $shortcmd in $dir font directory"
- cmd_opts=
- if [ "$shortcmd" = "update-fonts-alias" ]; then
- cmd_opts=--x11r7-layout
- fi
- if [ "$shortcmd" = "update-fonts-dir" ]; then
- cmd_opts=--x11r7-layout
- fi
- if [ "$shortcmd" = "update-fonts-scale" ]; then
- cmd_opts=--x11r7-layout
- fi
- $cmd $cmd_opts $dir || warn "$cmd $cmd_opts $dir" \
- "failed; font directory data may not" \
- "be up to date"
- else
- warn "$cmd not found; not updating corresponding $dir font" \
- "directory data"
- fi
- done
- else
- warn "$dir is not a directory; not updating font directory data"
- fi
- done
-}
-
-remove_conffile_prepare () {
- # syntax: remove_conffile_prepare filename official_md5sum ...
- #
- # Check a conffile "filename" against a list of canonical MD5 checksums.
- # If the file's current MD5 checksum matches one of the "official_md5sum"
- # operands provided, then prepare the conffile for removal from the system.
- # We defer actual deletion until the package is configured so that we can
- # roll this operation back if package installation fails.
- #
- # Call this function from a preinst script in the event $1 is "upgrade" or
- # "install" and verify $2 to ensure the package is being upgraded from a
- # version (or installed over a version removed-but-not-purged) prior to the
- # one in which the conffile was obsoleted.
-
- local conffile current_checksum
-
- # validate arguments
- if [ $# -lt 2 ]; then
- usage_error "remove_conffile_prepare() called with wrong number of" \
- "arguments; expected at least 2, got $#"
- exit $SHELL_LIB_USAGE_ERROR
- fi
-
- conffile="$1"
- shift
-
- # does the conffile even exist?
- if [ -e "$conffile" ]; then
- # calculate its checksum
- current_checksum=$(md5sum < "$conffile" | sed 's/[[:space:]].*//')
- # compare it to each supplied checksum
- while [ -n "$1" ]; do
- if [ "$current_checksum" = "$1" ]; then
- # we found a match; move the confffile and stop looking
- observe "preparing obsolete conffile $conffile for removal"
- mv "$conffile" "$conffile.$THIS_PACKAGE-tmp"
- break
- fi
- shift
- done
- fi
-}
-
-remove_conffile_lookup () {
- # syntax: remove_conffile_lookup package filename
- #
- # Lookup the md5sum of a conffile in dpkg's database, and prepare for removal
- # if it matches the actual file's md5sum.
- #
- # Call this function when you would call remove_conffile_prepare but only
- # want to check against dpkg's status database instead of known checksums.
-
- local package conffile old_md5sum
-
- # validate arguments
- if [ $# -ne 2 ]; then
- usage_error "remove_conffile_lookup() called with wrong number of" \
- "arguments; expected 1, got $#"
- exit $SHELL_LIB_USAGE_ERROR
- fi
-
- package="$1"
- conffile="$2"
-
- if ! [ -e "$conffile" ]; then
- return
- fi
- old_md5sum="$(dpkg-query -W -f='${Conffiles}' "$package" | \
- awk '{ if (match($0, "^ '"$conffile"' ")) print $2}')"
- if [ -n "$old_md5sum" ]; then
- remove_conffile_prepare "$conffile" "$old_md5sum"
- fi
-}
-
-remove_conffile_commit () {
- # syntax: remove_conffile_commit filename
- #
- # Complete the removal of a conffile "filename" that has become obsolete.
- #
- # Call this function from a postinst script after having used
- # remove_conffile_prepare() in the preinst.
-
- local conffile
-
- # validate arguments
- if [ $# -ne 1 ]; then
- usage_error "remove_conffile_commit() called with wrong number of" \
- "arguments; expected 1, got $#"
- exit $SHELL_LIB_USAGE_ERROR
- fi
-
- conffile="$1"
-
- # if the temporary file created by remove_conffile_prepare() exists, remove it
- if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
- observe "committing removal of obsolete conffile $conffile"
- rm "$conffile.$THIS_PACKAGE-tmp"
- fi
-}
-
-remove_conffile_rollback () {
- # syntax: remove_conffile_rollback filename
- #
- # Roll back the removal of a conffile "filename".
- #
- # Call this function from a postrm script in the event $1 is "abort-upgrade"
- # or "abort-install" is after having used remove_conffile_prepare() in the
- # preinst.
-
- local conffile
-
- # validate arguments
- if [ $# -ne 1 ]; then
- usage_error "remove_conffile_rollback() called with wrong number of" \
- "arguments; expected 1, got $#"
- exit $SHELL_LIB_USAGE_ERROR
- fi
-
- conffile="$1"
-
- # if the temporary file created by remove_conffile_prepare() exists, move it
- # back
- if [ -e "$conffile.$THIS_PACKAGE-tmp" ]; then
- observe "rolling back removal of obsolete conffile $conffile"
- mv "$conffile.$THIS_PACKAGE-tmp" "$conffile"
- fi
-}
-
-replace_conffile_with_symlink_prepare () {
- # syntax: replace_conffile_with_symlink_prepare oldfilename newfilename \
- # official_md5sum ...
- #
- # Check a conffile "oldfilename" against a list of canonical MD5 checksums.
- # If the file's current MD5 checksum matches one of the "official_md5sum"
- # operands provided, then prepare the conffile for removal from the system.
- # We defer actual deletion until the package is configured so that we can
- # roll this operation back if package installation fails. Otherwise copy it
- # to newfilename and let dpkg handle it through conffiles mechanism.
- #
- # Call this function from a preinst script in the event $1 is "upgrade" or
- # "install" and verify $2 to ensure the package is being upgraded from a
- # version (or installed over a version removed-but-not-purged) prior to the
- # one in which the conffile was obsoleted.
-
- local conffile current_checksum
-
- # validate arguments
- if [ $# -lt 3 ]; then
- usage_error "replace_conffile_with_symlink_prepare() called with wrong" \
- " number of arguments; expected at least 3, got $#"
- exit $SHELL_LIB_USAGE_ERROR
- fi
-
- oldconffile="$1"
- shift
- newconffile="$1"
- shift
-
- remove_conffile_prepare "$_oldconffile" "$@"
- # If $oldconffile still exists, then md5sums didn't match.
- # Copy it to new one.
- if [ -f "$oldconffile" ]; then
- cp "$oldconffile" "$newconffile"
- fi
-
-}
-
-replace_conffile_with_symlink_commit () {
- # syntax: replace_conffile_with_symlink_commit oldfilename
- #
- # Complete the removal of a conffile "oldfilename" that has been
- # replaced by a symlink.
- #
- # Call this function from a postinst script after having used
- # replace_conffile_with_symlink_prepare() in the preinst.
-
- local conffile
-
- # validate arguments
- if [ $# -ne 1 ]; then
- usage_error "replace_conffile_with_symlink_commit() called with wrong" \
- "number of arguments; expected 1, got $#"
- exit $SHELL_LIB_USAGE_ERROR
- fi
-
- conffile="$1"
-
- remove_conffile_commit "$conffile"
-}
-
-replace_conffile_with_symlink_rollback () {
- # syntax: replace_conffile_with_symlink_rollback oldfilename newfilename
- #
- # Roll back the replacing of a conffile "oldfilename" with symlink to
- # "newfilename".
- #
- # Call this function from a postrm script in the event $1 is "abort-upgrade"
- # or "abort-install" and verify $2 to ensure the package failed to upgrade
- # from a version (or install over a version removed-but-not-purged) prior
- # to the one in which the conffile was obsoleted.
- # You should have used replace_conffile_with_symlink_prepare() in the
- # preinst.
-
- local conffile
-
- # validate arguments
- if [ $# -ne 2 ]; then
- usage_error "replace_conffile_with_symlink_rollback() called with wrong" \
- "number of arguments; expected 2, got $#"
- exit $SHELL_LIB_USAGE_ERROR
- fi
-
- oldconffile="$1"
- newconffile="$2"
-
- remove_conffile_rollback "$_oldconffile"
- if [ -f "$newconffile" ]; then
- rm "$newconffile"
- fi
-}
-
-run () {
- # syntax: run command [ argument ... ]
- #
- # Run specified command with optional arguments and report its exit status.
- # Useful for commands whose exit status may be nonzero, but still acceptable,
- # or commands whose failure is not fatal to us.
- #
- # NOTE: Do *not* use this function with db_get or db_metaget commands; in
- # those cases the return value of the debconf command *must* be checked
- # before the string returned by debconf is used for anything.
-
- local retval
-
- # validate arguments
- if [ $# -lt 1 ]; then
- usage_error "run() called with wrong number of arguments; expected at" \
- "least 1, got $#"
- exit $SHELL_LIB_USAGE_ERROR
- fi
-
- "$@" || retval=$?
-
- if [ ${retval:-0} -ne 0 ]; then
- observe "command \"$*\" exited with status $retval"
- fi
-}
-
-make_symlink_sane () {
- # syntax: make_symlink_sane symlink target
- #
- # Ensure that the symbolic link symlink exists, and points to target.
- #
- # If symlink does not exist, create it and point it at target.
- #
- # If symlink exists but is not a symbolic link, back it up.
- #
- # If symlink exists, is a symbolic link, but points to the wrong location, fix
- # it.
- #
- # If symlink exists, is a symbolic link, and already points to target, do
- # nothing.
- #
- # This function wouldn't be needed if ln had an -I, --idempotent option.
-
- # Validate arguments.
- if [ $# -ne 2 ]; then
- usage_error "make_symlink_sane() called with wrong number of arguments;" \
- "expected 2, got $#"
- exit $SHELL_LIB_USAGE_ERROR
- fi
-
- # We could just use the positional parameters as-is, but that makes things
- # harder to follow.
- local symlink target
-
- symlink="$1"
- target="$2"
-
- if [ -L "$symlink" ] && [ "$(readlink "$symlink")" = "$target" ]; then
- observe "link from $symlink to $target already exists"
- else
- observe "creating symbolic link from $symlink to $target"
- mkdir -p "${target%/*}" "${symlink%/*}"
- ln -s -b -S ".dpkg-old" "$target" "$symlink"
- fi
-}
-
-migrate_dir_to_symlink () {
- # syntax: migrate_dir_to_symlink old_location new_location
- #
- # Per Debian Policy section 6.5.4, "A directory will never be replaced by a
- # symbolic link to a directory or vice versa; instead, the existing state
- # (symlink or not) will be left alone and dpkg will follow the symlink if
- # there is one."
- #
- # We have to do it ourselves.
- #
- # This function moves the contents of old_location, a directory, into
- # new_location, a directory, then makes old_location a symbolic link to
- # new_location.
- #
- # old_location need not exist, but if it does, it must be a directory (or a
- # symlink to a directory). If it is not, it is backed up. If new_location
- # exists already and is not a directory, it is backed up.
- #
- # This function should be called from a package's preinst so that other
- # packages unpacked after this one --- but before this package's postinst runs
- # --- are unpacked into new_location even if their payloads contain
- # old_location filespecs.
-
- # Validate arguments.
- if [ $# -ne 2 ]; then
- usage_error "migrate_dir_to_symlink() called with wrong number of"
- "arguments; expected 2, got $#"
- exit $SHELL_LIB_USAGE_ERROR
- fi
-
- # We could just use the positional parameters as-is, but that makes things
- # harder to follow.
- local new old
-
- old="$1"
- new="$2"
-
- # Is old location a symlink?
- if [ -L "$old" ]; then
- # Does it already point to new location?
- if [ "$(readlink "$old")" = "$new" ]; then
- # Nothing to do; migration has already been done.
- observe "migration of $old to $new already done"
- return 0
- else
- # Back it up.
- warn "backing up symbolic link $old as $old.dpkg-old"
- mv -b "$old" "$old.dpkg-old"
- fi
- fi
-
- # Does old location exist, but is not a directory?
- if [ -e "$old" ] && ! [ -d "$old" ]; then
- # Back it up.
- warn "backing up non-directory $old as $old.dpkg-old"
- mv -b "$old" "$old.dpkg-old"
- fi
-
- observe "migrating $old to $new"
-
- # Is new location a symlink?
- if [ -L "$new" ]; then
- # Does it point the wrong way, i.e., back to where we're migrating from?
- if [ "$(readlink "$new")" = "$old" ]; then
- # Get rid of it.
- observe "removing symbolic link $new which points to $old"
- rm "$new"
- else
- # Back it up.
- warn "backing up symbolic link $new as $new.dpkg-old"
- mv -b "$new" "$new.dpkg-old"
- fi
- fi
-
- # Does new location exist, but is not a directory?
- if [ -e "$new" ] && ! [ -d "$new" ]; then
- warn "backing up non-directory $new as $new.dpkg-old"
- mv -b "$new" "$new.dpkg-old"
- fi
-
- # Create new directory if it does not yet exist.
- if ! [ -e "$new" ]; then
- observe "creating $new"
- mkdir -p "$new"
- fi
-
- # Copy files in old location to new location. Back up any filenames that
- # already exist in the new location with the extension ".dpkg-old".
- observe "copying files from $old to $new"
- if ! (cd "$old" && cp -a -b -S ".dpkg-old" . "$new"); then
- die "error(s) encountered while copying files from $old to $new"
- fi
-
- # Remove files at old location.
- observe "removing $old"
- rm -r "$old"
-
- # Create symlink from old location to new location.
- make_symlink_sane "$old" "$new"
-}
-
-# vim:set ai et sw=2 ts=2 tw=80:
-
-# GOBSTOPPER: The X Strike Force shell library ends here.
};
/**
- * A structure to userptr limited information.
- *
- * @userptr_limit: maximum size to userptr buffer.
- * the buffer could be allocated by unprivileged user using malloc()
- * and the size of the buffer would be limited as userptr_limit value.
- * @pad: just padding to be 64-bit aligned.
- */
-struct drm_exynos_user_limit {
- unsigned int userptr_limit;
- unsigned int pad;
-};
-
-/**
* A structure for user connection request of virtual display.
*
* @connection: indicate whether doing connetion or not by user.
unsigned int pad;
};
+/* Indicate exynos specific vblank flags */
+enum e_drm_exynos_vblank {
+ _DRM_VBLANK_EXYNOS_VIDI = 2,
+};
+
/* indicate cache units. */
enum e_drm_exynos_gem_cache_sel {
EXYNOS_DRM_L1_CACHE = 1 << 0,
};
struct drm_exynos_g2d_set_cmdlist {
- struct drm_exynos_g2d_cmd *cmd;
- struct drm_exynos_g2d_cmd *cmd_gem;
+ __u64 cmd;
+ __u64 cmd_gem;
__u32 cmd_nr;
__u32 cmd_gem_nr;
/* for g2d event */
+ __u64 event_type;
__u64 user_data;
- __u32 event_type;
- __u32 reserved;
};
struct drm_exynos_g2d_exec {
enum drm_exynos_ops_id {
EXYNOS_DRM_OPS_SRC,
EXYNOS_DRM_OPS_DST,
- EXYNOS_DRM_OPS_MAX
+ EXYNOS_DRM_OPS_MAX,
};
/* definition of size */
EXYNOS_DRM_PLANAR_Y,
EXYNOS_DRM_PLANAR_CB,
EXYNOS_DRM_PLANAR_CR,
- EXYNOS_DRM_PLANAR_MAX
+ EXYNOS_DRM_PLANAR_MAX,
+};
+
+/**
+ * A structure for ipp supported property list.
+ *
+ * @version: version of this structure.
+ * @ipp_id: id of ipp driver.
+ * @count: count of ipp driver.
+ * @writeback: flag of writeback supporting.
+ * @flip: flag of flip supporting.
+ * @degree: flag of degree information.
+ * @csc: flag of csc supporting.
+ * @crop: flag of crop supporting.
+ * @scale: flag of scale supporting.
+ * @refresh_min: min hz of refresh.
+ * @refresh_max: max hz of refresh.
+ * @crop_min: crop min resolution.
+ * @crop_max: crop max resolution.
+ * @scale_min: scale min resolution.
+ * @scale_max: scale max resolution.
+ */
+struct drm_exynos_ipp_prop_list {
+ __u32 version;
+ __u32 ipp_id;
+ __u32 count;
+ __u32 writeback;
+ __u32 flip;
+ __u32 degree;
+ __u32 csc;
+ __u32 crop;
+ __u32 scale;
+ __u32 refresh_min;
+ __u32 refresh_max;
+ __u32 reserved;
+ struct drm_exynos_sz crop_min;
+ struct drm_exynos_sz crop_max;
+ struct drm_exynos_sz scale_min;
+ struct drm_exynos_sz scale_max;
};
/**
struct drm_exynos_pos pos;
};
+/* definition of command */
+enum drm_exynos_ipp_cmd {
+ IPP_CMD_NONE,
+ IPP_CMD_M2M,
+ IPP_CMD_WB,
+ IPP_CMD_OUTPUT,
+ IPP_CMD_MAX,
+};
+
+/* define of color range */
+enum drm_exynos_color_range {
+ COLOR_RANGE_LIMITED,
+ COLOR_RANGE_FULL,
+};
+
+/* define of blending operation */
+enum drm_exynos_ipp_blending {
+ IPP_BLENDING_NO,
+ /* [0, 0] */
+ IPP_BLENDING_CLR,
+ /* [Sa, Sc] */
+ IPP_BLENDING_SRC,
+ /* [Da, Dc] */
+ IPP_BLENDING_DST,
+ /* [Sa + (1 - Sa)*Da, Rc = Sc + (1 - Sa)*Dc] */
+ IPP_BLENDING_SRC_OVER,
+ /* [Sa + (1 - Sa)*Da, Rc = Dc + (1 - Da)*Sc] */
+ IPP_BLENDING_DST_OVER,
+ /* [Sa * Da, Sc * Da] */
+ IPP_BLENDING_SRC_IN,
+ /* [Sa * Da, Sa * Dc] */
+ IPP_BLENDING_DST_IN,
+ /* [Sa * (1 - Da), Sc * (1 - Da)] */
+ IPP_BLENDING_SRC_OUT,
+ /* [Da * (1 - Sa), Dc * (1 - Sa)] */
+ IPP_BLENDING_DST_OUT,
+ /* [Da, Sc * Da + (1 - Sa) * Dc] */
+ IPP_BLENDING_SRC_ATOP,
+ /* [Sa, Sc * (1 - Da) + Sa * Dc ] */
+ IPP_BLENDING_DST_ATOP,
+ /* [-(Sa * Da), Sc * (1 - Da) + (1 - Sa) * Dc] */
+ IPP_BLENDING_XOR,
+ /* [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + min(Sc, Dc)] */
+ IPP_BLENDING_DARKEN,
+ /* [Sa + Da - Sa*Da, Sc*(1 - Da) + Dc*(1 - Sa) + max(Sc, Dc)] */
+ IPP_BLENDING_LIGHTEN,
+ /* [Sa * Da, Sc * Dc] */
+ IPP_BLENDING_MULTIPLY,
+ /* [Sa + Da - Sa * Da, Sc + Dc - Sc * Dc] */
+ IPP_BLENDING_SCREEN,
+ /* Saturate(S + D) */
+ IPP_BLENDING_ADD,
+ /* Max */
+ IPP_BLENDING_MAX,
+};
+
+/* define of dithering operation */
+enum drm_exynos_ipp_dithering {
+ IPP_DITHERING_NO,
+ IPP_DITHERING_8BIT,
+ IPP_DITHERING_6BIT,
+ IPP_DITHERING_5BIT,
+ IPP_DITHERING_4BIT,
+ IPP_DITHERING_MAX,
+};
+
+/* define of ipp operation type */
+enum drm_exynos_ipp_type {
+ IPP_SYNC_WORK = 0x0,
+ IPP_EVENT_DRIVEN = 0x1,
+ IPP_TYPE_MAX = 0x2,
+};
+
/**
* A structure for ipp property.
*
* @config: source, destination config.
+ * @cmd: definition of command.
+ * @ipp_id: id of ipp driver.
+ * @prop_id: id of property.
+ * @refresh_rate: refresh rate.
+ * @protect: protection enable flag.
+ * @range: color space converting range.
+ * @type: definition of operation type.
+ * @blending: blending opeation config.
+ * @dithering: dithering opeation config.
+ * @color_fill: color fill value.
+ * @type: color fill value.
*/
struct drm_exynos_ipp_property {
struct drm_exynos_ipp_config config[EXYNOS_DRM_OPS_MAX];
+ enum drm_exynos_ipp_cmd cmd;
+ __u32 ipp_id;
+ __u32 prop_id;
+ __u32 refresh_rate;
+ __u32 protect;
+ enum drm_exynos_color_range range;
+ enum drm_exynos_ipp_type type;
+ enum drm_exynos_ipp_blending blending;
+ enum drm_exynos_ipp_dithering dithering;
+ __u32 color_fill;
};
-/* command of ipp operations */
-enum drm_exynos_ipp_cmd {
- IPP_CMD_NONE,
- IPP_CMD_M2M,
- IPP_CMD_WB,
- IPP_CMD_OUT,
- IPP_CMD_MAX
-};
-
-/* definition of buffer control */
-enum drm_exynos_ipp_buf_ctrl {
- IPP_BUF_CTRL_MAP,
- IPP_BUF_CTRL_UNMAP,
- IPP_BUF_CTRL_QUEUE,
- IPP_BUF_CTRL_DEQUEUE
+/* definition of buffer */
+enum drm_exynos_ipp_buf_type {
+ IPP_BUF_ENQUEUE,
+ IPP_BUF_DEQUEUE,
};
/**
* A structure for ipp buffer operations.
*
* @ops_id: operation directions.
- * @ctrl: buffer control.
- * @id: index of buffer.
+ * @buf_type: definition of buffer.
+ * @prop_id: id of property.
+ * @buf_id: id of buffer.
* @handle: Y, Cb, Cr each planar handle.
* @user_data: user data.
*/
-struct drm_exynos_ipp_buf {
+struct drm_exynos_ipp_queue_buf {
enum drm_exynos_ops_id ops_id;
- enum drm_exynos_ipp_buf_ctrl buf_ctrl;
- __u32 id;
+ enum drm_exynos_ipp_buf_type buf_type;
+ __u32 prop_id;
+ __u32 buf_id;
__u32 handle[EXYNOS_DRM_PLANAR_MAX];
+ __u32 reserved;
__u64 user_data;
};
+/* definition of control */
+enum drm_exynos_ipp_ctrl {
+ IPP_CTRL_PLAY,
+ IPP_CTRL_STOP,
+ IPP_CTRL_PAUSE,
+ IPP_CTRL_RESUME,
+ IPP_CTRL_MAX,
+};
+
/**
* A structure for ipp start/stop operations.
*
- * @cmd: command id.
- * @use: use ipp device.
+ * @prop_id: id of property.
+ * @ctrl: definition of control.
*/
-struct drm_exynos_ipp_ctrl {
- enum drm_exynos_ipp_cmd cmd;
- __u32 use;
+struct drm_exynos_ipp_cmd_ctrl {
+ __u32 prop_id;
+ enum drm_exynos_ipp_ctrl ctrl;
+};
+
+/* type of hdmi audio */
+enum drm_exynos_hdmi_type {
+ HDMI_TYPE_I2S,
+ HDMI_TYPE_SPDIF,
+ HDMI_TYPE_MAX,
+};
+
+/* codec of hdmi audio */
+enum drm_exynos_hdmi_codec {
+ HDMI_CODEC_PCM,
+ HDMI_CODEC_AC3,
+ HDMI_CODEC_MP3,
+ HDMI_CODEC_WMA,
+ HDMI_CODEC_MAX,
+};
+
+/**
+ * A structure for hdmi audio enable.
+ *
+ * @type: audio type list.
+ * @codec: audio codec list.
+ * @enable: enable or disable audio.
+ * @sampling_freq: sampling frequency.
+ e.g 32000,44100,48000,88200,
+ 96000,176400,192000.
+ * @channel: channel mode.
+ e.g stereo-2,5.1 channel-6.
+ * @bits_per_sample: bit per sample.
+ e.g 16,20,24.
+ */
+struct drm_exynos_hdmi_audio {
+ enum drm_exynos_hdmi_type type;
+ enum drm_exynos_hdmi_codec codec;
+ __u32 enable;
+ __u32 sampling_freq;
+ __u32 channel;
+ __u32 bits_per_sample;
};
#define DRM_EXYNOS_GEM_CREATE 0x00
#define DRM_EXYNOS_GEM_MMAP 0x02
#define DRM_EXYNOS_GEM_USERPTR 0x03
#define DRM_EXYNOS_GEM_GET 0x04
-#define DRM_EXYNOS_USER_LIMIT 0x05
#define DRM_EXYNOS_VIDI_CONNECTION 0x07
/* temporary ioctl command. */
#define DRM_EXYNOS_G2D_EXEC 0x22
/* IPP - Image Post Processing */
-#define DRM_EXYNOS_IPP_PROPERTY 0x30
-#define DRM_EXYNOS_IPP_BUF 0x31
-#define DRM_EXYNOS_IPP_CTRL 0x32
+#define DRM_EXYNOS_IPP_GET_PROPERTY 0x30
+#define DRM_EXYNOS_IPP_SET_PROPERTY 0x31
+#define DRM_EXYNOS_IPP_QUEUE_BUF 0x32
+#define DRM_EXYNOS_IPP_CMD_CTRL 0x33
+
+/* HDMI - Audio */
+#define DRM_EXYNOS_HDMI_AUDIO 0x40
#define DRM_IOCTL_EXYNOS_GEM_CREATE DRM_IOWR(DRM_COMMAND_BASE + \
DRM_EXYNOS_GEM_CREATE, struct drm_exynos_gem_create)
#define DRM_IOCTL_EXYNOS_GEM_GET DRM_IOWR(DRM_COMMAND_BASE + \
DRM_EXYNOS_GEM_GET, struct drm_exynos_gem_info)
-#define DRM_IOCTL_EXYNOS_USER_LIMIT DRM_IOWR(DRM_COMMAND_BASE + \
- DRM_EXYNOS_USER_LIMIT, struct drm_exynos_user_limit)
-
#define DRM_IOCTL_EXYNOS_GEM_EXPORT_UMP DRM_IOWR(DRM_COMMAND_BASE + \
DRM_EXYNOS_GEM_EXPORT_UMP, struct drm_exynos_gem_ump)
#define DRM_IOCTL_EXYNOS_G2D_EXEC DRM_IOWR(DRM_COMMAND_BASE + \
DRM_EXYNOS_G2D_EXEC, struct drm_exynos_g2d_exec)
-#define DRM_IOCTL_EXYNOS_IPP_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \
- DRM_EXYNOS_IPP_PROPERTY, struct drm_exynos_ipp_property)
-#define DRM_IOCTL_EXYNOS_IPP_BUF DRM_IOWR(DRM_COMMAND_BASE + \
- DRM_EXYNOS_IPP_BUF, struct drm_exynos_ipp_buf)
-#define DRM_IOCTL_EXYNOS_IPP_CTRL DRM_IOWR(DRM_COMMAND_BASE + \
- DRM_EXYNOS_IPP_CTRL, struct drm_exynos_ipp_ctrl)
+#define DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_EXYNOS_IPP_GET_PROPERTY, struct drm_exynos_ipp_prop_list)
+#define DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_EXYNOS_IPP_SET_PROPERTY, struct drm_exynos_ipp_property)
+#define DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_EXYNOS_IPP_QUEUE_BUF, struct drm_exynos_ipp_queue_buf)
+#define DRM_IOCTL_EXYNOS_IPP_CMD_CTRL DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_EXYNOS_IPP_CMD_CTRL, struct drm_exynos_ipp_cmd_ctrl)
+
+#define DRM_IOCTL_EXYNOS_HDMI_AUDIO DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_EXYNOS_HDMI_AUDIO, struct drm_exynos_hdmi_audio)
/* EXYNOS specific events */
#define DRM_EXYNOS_G2D_EVENT 0x80000000
__u64 user_data;
__u32 tv_sec;
__u32 tv_usec;
- __u32 buf_idx;
+ __u32 prop_id;
__u32 reserved;
+ __u32 buf_id[EXYNOS_DRM_OPS_MAX];
};
+
#endif
savage_drm.h \
sis_drm.h \
via_drm.h \
- mach64_drm.h
+ mach64_drm.h \
+ vigs_drm.h
if HAVE_VMWGFX
--- /dev/null
+/*
+ * vigs_drm.h
+ */
+
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ * Authors:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ *
+ * 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.
+ */
+
+#ifndef _VIGS_DRM_H_
+#define _VIGS_DRM_H_
+
+/*
+ * Bump this whenever driver interface changes.
+ */
+#define DRM_VIGS_DRIVER_VERSION 14
+
+/*
+ * Surface access flags.
+ */
+#define DRM_VIGS_SAF_READ 1
+#define DRM_VIGS_SAF_WRITE 2
+#define DRM_VIGS_SAF_MASK 3
+
+/*
+ * Number of DP framebuffers.
+ */
+#define DRM_VIGS_NUM_DP_FB_BUF 4
+
+/*
+ * DP memory types.
+ */
+#define DRM_VIGS_DP_FB_Y 2
+#define DRM_VIGS_DP_FB_C 3
+
+struct drm_vigs_get_protocol_version
+{
+ uint32_t version;
+};
+
+struct drm_vigs_create_surface
+{
+ uint32_t width;
+ uint32_t height;
+ uint32_t stride;
+ uint32_t format;
+ int scanout;
+ uint32_t handle;
+ uint32_t size;
+ uint32_t id;
+};
+
+struct drm_vigs_create_execbuffer
+{
+ uint32_t size;
+ uint32_t handle;
+};
+
+struct drm_vigs_gem_map
+{
+ uint32_t handle;
+ int track_access;
+ unsigned long address;
+};
+
+struct drm_vigs_gem_wait
+{
+ uint32_t handle;
+};
+
+struct drm_vigs_surface_info
+{
+ uint32_t handle;
+ uint32_t width;
+ uint32_t height;
+ uint32_t stride;
+ uint32_t format;
+ int scanout;
+ uint32_t size;
+ uint32_t id;
+};
+
+struct drm_vigs_exec
+{
+ uint32_t handle;
+};
+
+struct drm_vigs_surface_set_gpu_dirty
+{
+ uint32_t handle;
+};
+
+struct drm_vigs_surface_start_access
+{
+ unsigned long address;
+ uint32_t saf;
+};
+
+struct drm_vigs_surface_end_access
+{
+ unsigned long address;
+ int sync;
+};
+
+struct drm_vigs_create_fence
+{
+ int send;
+ uint32_t handle;
+ uint32_t seq;
+};
+
+struct drm_vigs_fence_wait
+{
+ uint32_t handle;
+};
+
+struct drm_vigs_fence_signaled
+{
+ uint32_t handle;
+ int signaled;
+};
+
+struct drm_vigs_fence_unref
+{
+ uint32_t handle;
+};
+
+struct drm_vigs_plane_set_zpos
+{
+ uint32_t plane_id;
+ int zpos;
+};
+
+struct drm_vigs_plane_set_transform
+{
+ uint32_t plane_id;
+ int hflip;
+ int vflip;
+ int rotation;
+};
+
+struct drm_vigs_dp_create_surface
+{
+ uint32_t dp_plane;
+ uint32_t dp_fb_buf;
+ uint32_t dp_mem_flag;
+ uint32_t width;
+ uint32_t height;
+ uint32_t stride;
+ uint32_t format;
+ uint32_t handle;
+ uint32_t size;
+ uint32_t id;
+};
+
+struct drm_vigs_dp_open_surface
+{
+ uint32_t dp_plane;
+ uint32_t dp_fb_buf;
+ uint32_t dp_mem_flag;
+ uint32_t handle;
+};
+
+#define DRM_VIGS_GET_PROTOCOL_VERSION 0x00
+#define DRM_VIGS_CREATE_SURFACE 0x01
+#define DRM_VIGS_CREATE_EXECBUFFER 0x02
+#define DRM_VIGS_GEM_MAP 0x03
+#define DRM_VIGS_GEM_WAIT 0x04
+#define DRM_VIGS_SURFACE_INFO 0x05
+#define DRM_VIGS_EXEC 0x06
+#define DRM_VIGS_SURFACE_SET_GPU_DIRTY 0x07
+#define DRM_VIGS_SURFACE_START_ACCESS 0x08
+#define DRM_VIGS_SURFACE_END_ACCESS 0x09
+#define DRM_VIGS_CREATE_FENCE 0x0A
+#define DRM_VIGS_FENCE_WAIT 0x0B
+#define DRM_VIGS_FENCE_SIGNALED 0x0C
+#define DRM_VIGS_FENCE_UNREF 0x0D
+#define DRM_VIGS_PLANE_SET_ZPOS 0x0E
+#define DRM_VIGS_PLANE_SET_TRANSFORM 0x0F
+
+#define DRM_VIGS_DP_CREATE_SURFACE 0x20
+#define DRM_VIGS_DP_OPEN_SURFACE 0x21
+
+#define DRM_IOCTL_VIGS_GET_PROTOCOL_VERSION DRM_IOR(DRM_COMMAND_BASE + \
+ DRM_VIGS_GET_PROTOCOL_VERSION, struct drm_vigs_get_protocol_version)
+#define DRM_IOCTL_VIGS_CREATE_SURFACE DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_VIGS_CREATE_SURFACE, struct drm_vigs_create_surface)
+#define DRM_IOCTL_VIGS_CREATE_EXECBUFFER DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_VIGS_CREATE_EXECBUFFER, struct drm_vigs_create_execbuffer)
+#define DRM_IOCTL_VIGS_GEM_MAP DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_VIGS_GEM_MAP, struct drm_vigs_gem_map)
+#define DRM_IOCTL_VIGS_GEM_WAIT DRM_IOW(DRM_COMMAND_BASE + \
+ DRM_VIGS_GEM_WAIT, struct drm_vigs_gem_wait)
+#define DRM_IOCTL_VIGS_SURFACE_INFO DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_VIGS_SURFACE_INFO, struct drm_vigs_surface_info)
+#define DRM_IOCTL_VIGS_EXEC DRM_IOW(DRM_COMMAND_BASE + \
+ DRM_VIGS_EXEC, struct drm_vigs_exec)
+#define DRM_IOCTL_VIGS_SURFACE_SET_GPU_DIRTY DRM_IOW(DRM_COMMAND_BASE + \
+ DRM_VIGS_SURFACE_SET_GPU_DIRTY, struct drm_vigs_surface_set_gpu_dirty)
+#define DRM_IOCTL_VIGS_SURFACE_START_ACCESS DRM_IOW(DRM_COMMAND_BASE + \
+ DRM_VIGS_SURFACE_START_ACCESS, struct drm_vigs_surface_start_access)
+#define DRM_IOCTL_VIGS_SURFACE_END_ACCESS DRM_IOW(DRM_COMMAND_BASE + \
+ DRM_VIGS_SURFACE_END_ACCESS, struct drm_vigs_surface_end_access)
+#define DRM_IOCTL_VIGS_CREATE_FENCE DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_VIGS_CREATE_FENCE, struct drm_vigs_create_fence)
+#define DRM_IOCTL_VIGS_FENCE_WAIT DRM_IOW(DRM_COMMAND_BASE + \
+ DRM_VIGS_FENCE_WAIT, struct drm_vigs_fence_wait)
+#define DRM_IOCTL_VIGS_FENCE_SIGNALED DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_VIGS_FENCE_SIGNALED, struct drm_vigs_fence_signaled)
+#define DRM_IOCTL_VIGS_FENCE_UNREF DRM_IOW(DRM_COMMAND_BASE + \
+ DRM_VIGS_FENCE_UNREF, struct drm_vigs_fence_unref)
+#define DRM_IOCTL_VIGS_PLANE_SET_ZPOS DRM_IOW(DRM_COMMAND_BASE + \
+ DRM_VIGS_PLANE_SET_ZPOS, struct drm_vigs_plane_set_zpos)
+#define DRM_IOCTL_VIGS_PLANE_SET_TRANSFORM DRM_IOW(DRM_COMMAND_BASE + \
+ DRM_VIGS_PLANE_SET_TRANSFORM, struct drm_vigs_plane_set_transform)
+
+#define DRM_IOCTL_VIGS_DP_CREATE_SURFACE DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_VIGS_DP_CREATE_SURFACE, struct drm_vigs_dp_create_surface)
+#define DRM_IOCTL_VIGS_DP_OPEN_SURFACE DRM_IOWR(DRM_COMMAND_BASE + \
+ DRM_VIGS_DP_OPEN_SURFACE, struct drm_vigs_dp_open_surface)
+
+#endif
libkms_la_SOURCES += radeon.c
endif
-if HAVE_SLP
-libkms_la_SOURCES += slp.c
+if HAVE_EXYNOS
+libkms_la_SOURCES += exynos.c
AM_CFLAGS += -I$(top_srcdir)/exynos
endif
#include "exynos_drm.h"
-struct slp_bo
+struct exynos_bo
{
struct kms_bo base;
unsigned map_count;
};
static int
-slp_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
+exynos_get_prop(struct kms_driver *kms, unsigned key, unsigned *out)
{
switch (key) {
case KMS_BO_TYPE:
}
static int
-slp_destroy(struct kms_driver *kms)
+exynos_destroy(struct kms_driver *kms)
{
free(kms);
return 0;
}
static int
-slp_bo_create(struct kms_driver *kms,
+exynos_bo_create(struct kms_driver *kms,
const unsigned width, const unsigned height,
const enum kms_bo_type type, const unsigned *attr,
struct kms_bo **out)
{
struct drm_exynos_gem_create arg;
unsigned size, pitch;
- struct slp_bo *bo;
+ struct exynos_bo *bo;
int i, ret;
for (i = 0; attr[i]; i += 2) {
}
static int
-slp_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out)
+exynos_bo_get_prop(struct kms_bo *bo, unsigned key, unsigned *out)
{
switch (key) {
default:
}
static int
-slp_bo_map(struct kms_bo *_bo, void **out)
+exynos_bo_map(struct kms_bo *_bo, void **out)
{
- struct slp_bo *bo = (struct slp_bo *)_bo;
+ struct exynos_bo *bo = (struct exynos_bo *)_bo;
struct drm_exynos_gem_map_off arg;
void *map = NULL;
int ret;
}
static int
-slp_bo_unmap(struct kms_bo *_bo)
+exynos_bo_unmap(struct kms_bo *_bo)
{
- struct slp_bo *bo = (struct slp_bo *)_bo;
+ struct exynos_bo *bo = (struct exynos_bo *)_bo;
bo->map_count--;
return 0;
}
static int
-slp_bo_destroy(struct kms_bo *_bo)
+exynos_bo_destroy(struct kms_bo *_bo)
{
- struct slp_bo *bo = (struct slp_bo *)_bo;
+ struct exynos_bo *bo = (struct exynos_bo *)_bo;
struct drm_gem_close arg;
int ret;
}
int
-slp_create(int fd, struct kms_driver **out)
+exynos_create(int fd, struct kms_driver **out)
{
struct kms_driver *kms;
kms->fd = fd;
- kms->bo_create = slp_bo_create;
- kms->bo_map = slp_bo_map;
- kms->bo_unmap = slp_bo_unmap;
- kms->bo_get_prop = slp_bo_get_prop;
- kms->bo_destroy = slp_bo_destroy;
- kms->get_prop = slp_get_prop;
- kms->destroy = slp_destroy;
+ kms->bo_create = exynos_bo_create;
+ kms->bo_map = exynos_bo_map;
+ kms->bo_unmap = exynos_bo_unmap;
+ kms->bo_get_prop = exynos_bo_get_prop;
+ kms->bo_destroy = exynos_bo_destroy;
+ kms->get_prop = exynos_get_prop;
+ kms->destroy = exynos_destroy;
*out = kms;
return 0;
-#sbs-git:slp/pkgs/xorg/lib/libdrm libdrm 2.4.27 4df9ab272d6eac089f89ecd9302d39263541a794
Name: libdrm
Version: 2.4.35
-Release: 1
+Release: 20
License: MIT
Summary: Userspace interface to kernel DRM services
Group: System/Libraries
Source0: %{name}-%{version}.tar.gz
-BuildRequires: kernel-headers
BuildRequires: pkgconfig(xorg-macros)
BuildRequires: pkgconfig(pthread-stubs)
%package devel
Summary: Userspace interface to kernel DRM services
Group: Development/Libraries
-Requires: kernel-headers
-Requires: libdrm2
-Requires: libdrm-slp1
-Requires: libkms1
+Requires: libdrm2 = %{version}-%{release}
+Requires: libkms1
%description devel
Userspace interface to kernel DRM services
%description -n libdrm2
Userspace interface to kernel DRM services
-%package slp1
-Summary: Userspace interface to slp-specific kernel DRM services
-Group: Development/Libraries
-
-%description slp1
-Userspace interface to slp-specific kernel DRM services
-
%package -n libkms1
Summary: Userspace interface to kernel DRM buffer management
Group: Development/Libraries
%build
%reconfigure --prefix=%{_prefix} --mandir=%{_prefix}/share/man --infodir=%{_prefix}/share/info \
--enable-static=yes --enable-udev --enable-libkms --enable-exynos-experimental-api \
- --disable-nouveau --disable-radeon --disable-intel
+ --disable-nouveau --disable-radeon --disable-intel \
+ CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS} -Wl,--hash-style=both -Wl,--as-needed"
make %{?_smp_mflags}
%post -n libdrm2 -p /sbin/ldconfig
%postun -n libdrm2 -p /sbin/ldconfig
-%post slp1 -p /sbin/ldconfig
-%postun slp1 -p /sbin/ldconfig
-
%post -n libkms1 -p /sbin/ldconfig
%postun -n libkms1 -p /sbin/ldconfig
%{_includedir}/*
%{_includedir}/exynos/*
%{_libdir}/libdrm.so
-%{_libdir}/libdrm_slp.so
%{_libdir}/libdrm_exynos.so
%{_libdir}/libkms.so
+%{_libdir}/libdrm_vigs.so
%{_libdir}/pkgconfig/*
%files -n libdrm2
%{_libdir}/libdrm.so.*
%{_libdir}/libdrm_exynos.so.*
-
-%files slp1
-%{_libdir}/libdrm_slp*.so.*
+%{_libdir}/libdrm_vigs.so.*
%files -n libkms1
%{_libdir}/libkms.so.*
+++ /dev/null
-SUBDIRS = .
-
-AM_CFLAGS = \
- $(WARN_CFLAGS) \
- -I$(top_srcdir) \
- -I$(top_srcdir)/slp \
- $(PTHREADSTUBS_CFLAGS) \
- -I$(top_srcdir)/include/drm
-
-libdrm_slp_la_LTLIBRARIES = libdrm_slp.la
-libdrm_slp_ladir = $(libdir)
-libdrm_slp_la_LDFLAGS = -version-number 1:0:0 -no-undefined
-libdrm_slp_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@ @CLOCK_LIB@ -ldl
-
-libdrm_slp_la_SOURCES = \
- drm_slp_bufmgr.c \
- drm_slp_bufmgr.h
-
-libdrm_slpincludedir = ${includedir}/libdrm
-libdrm_slpinclude_HEADERS = drm_slp_bufmgr.h
-
-pkgconfig_DATA = libdrm_slp.pc
+++ /dev/null
-/**************************************************************************
-
-xserver-xorg-video-sec
-
-Copyright 2011 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: SooChan Lim <sc1.lim@samsung.com>, Sangjin Lee <lsj119@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-#include "config.h"
-
-#include <unistd.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <dlfcn.h>
-#include <dirent.h>
-#include <string.h>
-#include <errno.h>
-
-#include "drm_slp_bufmgr.h"
-#include "list.h"
-
-#define PREFIX_LIB "libdrm_slp_"
-#define SUFFIX_LIB ".so"
-#define DEFAULT_LIB PREFIX_LIB"default"SUFFIX_LIB
-
-#define NUM_TRY_LOCK 10
-#define SEM_NAME "pixmap_1"
-#define SEM_DEBUG 0
-
-#define DRM_RETURN_IF_FAIL(cond) {if (!(cond)) { fprintf (stderr, "[%s] : '%s' failed.\n", __FUNCTION__, #cond); return; }}
-#define DRM_RETURN_VAL_IF_FAIL(cond, val) {if (!(cond)) { fprintf (stderr, "[%s] : '%s' failed.\n", __FUNCTION__, #cond); return val; }}
-
-#define MGR_IS_VALID(mgr) (mgr && \
- mgr->link.next && \
- mgr->link.next->prev == &mgr->link)
-#define BO_IS_VALID(bo) (bo && \
- MGR_IS_VALID(bo->bufmgr) && \
- bo->list.next && \
- bo->list.next->prev == &bo->list)
-
-typedef struct{
- void* data;
-
- int is_valid;
- drm_data_free free_func ;
-}drm_slp_user_data;
-
-static struct list_head *gBufMgrs = NULL;
-
-static int
-_sem_wait_wrapper(sem_t* sem)
-{
- int res = 0;
- int num_try = NUM_TRY_LOCK;
-
- do
- {
- res = sem_wait(sem);
- num_try--;
- } while((res == -1) && (errno == EINTR) && (num_try >= 0));
-
- if(res == -1)
- {
- fprintf(stderr,
- "[libdrm] error %s:%d(sem:%p, num_try:%d) PID:%04d\n",
- __FUNCTION__,
- __LINE__,
- sem,
- num_try,
- getpid());
- return 0;
- }
-#if SEM_DEBUG
- else
- {
- fprintf(stderr,
- "[libdrm] LOCK >> %s:%d(sem:%p, num_try:%d) PID:%04d\n",
- __FUNCTION__,
- __LINE__,
- sem,
- num_try,
- getpid());
- }
-#endif
-
- return 1;
-}
-
-static int
-_sem_post_wrapper(sem_t* sem)
-{
- int res = 0;
- int num_try = NUM_TRY_LOCK;
-
- do
- {
- res = sem_post(sem);
- num_try--;
-
- } while((res == -1) && (errno == EINTR) && (num_try >= 0));
-
- if(res == -1)
- {
- fprintf(stderr,
- "[libdrm] error %s:%d(sem:%p, num_try:%d) PID:%04d\n",
- __FUNCTION__,
- __LINE__,
- sem,
- num_try,
- getpid());
- return 0;
- }
-#if SEM_DEBUG
- else
- {
- fprintf(stderr,
- "[libdrm] UNLOCK << %s:%d(sem:%p, num_try:%d) PID:%04d\n",
- __FUNCTION__,
- __LINE__,
- sem,
- num_try,
- getpid());
- }
-#endif
-
- return 1;
-}
-
-static int
-_sem_open(drm_slp_bufmgr bufmgr)
-{
- bufmgr->semObj.handle = sem_open(SEM_NAME, O_CREAT, 0777, 1);
- if(bufmgr->semObj.handle == SEM_FAILED)
- {
- fprintf(stderr,
- "[libdrm] error %s:%d(name:%s) PID:%04d\n",
- __FUNCTION__,
- __LINE__,
- SEM_NAME,
- getpid());
- bufmgr->semObj.handle = NULL;
- return 0;
- }
-#if SEM_DEBUG
- else
- {
- fprintf(stderr,
- "[libdrm] OPEN %s:%d(sem:%p) PID:%04d\n",
- __FUNCTION__,
- __LINE__,
- bufmgr->semObj.handle,
- getpid());
- }
-#endif
-
- bufmgr->semObj.status = STATUS_UNLOCK;
-
- return 1;
-}
-
-static int
-_sem_close(drm_slp_bufmgr bufmgr)
-{
- _sem_wait_wrapper(bufmgr->semObj.handle);
- sem_unlink(SEM_NAME);
- return 1;
-}
-
-static int
-_sem_lock(drm_slp_bufmgr bufmgr)
-{
- if(bufmgr->semObj.status != STATUS_UNLOCK) return 0;
-
- if(!_sem_wait_wrapper(bufmgr->semObj.handle)) return 0;
- bufmgr->semObj.status = STATUS_LOCK;
- return 1;
-}
-
-static int
-_sem_unlock(drm_slp_bufmgr bufmgr)
-{
- if(bufmgr->semObj.status != STATUS_LOCK) return 0;
-
- _sem_post_wrapper(bufmgr->semObj.handle);
- bufmgr->semObj.status = STATUS_UNLOCK;
- return 1;
-}
-
-static drm_slp_bufmgr
-_load_bufmgr(int fd, const char *file, void *arg)
-{
- char path[PATH_MAX] = {0,};
- drm_slp_bufmgr bufmgr = NULL;
- int (*bufmgr_init)(drm_slp_bufmgr bufmgr, int fd, void *arg);
- void *module;
-
- snprintf(path, sizeof(path), BUFMGR_DIR "/%s", file);
-
- module = dlopen(path, RTLD_LAZY);
- if (!module) {
- fprintf(stderr,
- "[libdrm] failed to load module: %s(%s)\n",
- dlerror(), file);
- return NULL;
- }
-
- bufmgr_init = dlsym(module, "init_slp_bufmgr");
- if (!bufmgr_init) {
- fprintf(stderr,
- "[libdrm] failed to lookup init function: %s(%s)\n",
- dlerror(), file);
- return NULL;
- }
-
- bufmgr = calloc(sizeof(struct _drm_slp_bufmgr), 1);
- if(!bufmgr)
- {
- return NULL;
- }
-
- if(!bufmgr_init(bufmgr, fd, arg))
- {
- fprintf(stderr,"[libdrm] Fail to init module(%s)\n", file);
- free(bufmgr);
- bufmgr = NULL;
- return NULL;
- }
-
- fprintf(stderr,"[libdrm] Success to load module(%s)\n", file);
-
- return bufmgr;
-}
-
-drm_slp_bufmgr
-drm_slp_bufmgr_init(int fd, void *arg)
-{
- drm_slp_bufmgr bufmgr = NULL;
- const char *p = NULL;
-
- if (fd < 0)
- return NULL;
-
- if(gBufMgrs == NULL)
- {
- gBufMgrs = malloc(sizeof(struct list_head));
- LIST_INITHEAD(gBufMgrs);
- }
- else
- {
- LIST_FOR_EACH_ENTRY(bufmgr, gBufMgrs, link)
- {
- if(bufmgr->drm_fd == fd)
- {
- bufmgr->ref_count++;
- fprintf(stderr, "[libdrm] bufmgr ref: fd=%d, ref_count:%d\n", fd, bufmgr->ref_count);
- return bufmgr;
- }
- }
- bufmgr = NULL;
- }
- fprintf(stderr, "[libdrm] bufmgr init: fd=%d\n", fd);
-
- p = getenv ("SLP_BUFMGR_MODULE");
- if (p)
- {
- char file[PATH_MAX] = {0,};
- snprintf(file, sizeof(file), PREFIX_LIB"%s"SUFFIX_LIB, p);
- bufmgr = _load_bufmgr (fd, file, arg);
- }
-
- if (!bufmgr)
- bufmgr = _load_bufmgr (fd, DEFAULT_LIB, arg);
-
- if (!bufmgr)
- {
- struct dirent **namelist;
- int found = 0;
- int n;
-
- n = scandir(BUFMGR_DIR, &namelist, 0, alphasort);
- if (n < 0)
- fprintf(stderr,"[libdrm] no files : %s\n", BUFMGR_DIR);
- else
- {
- while(n--)
- {
- if (!found && strstr (namelist[n]->d_name, PREFIX_LIB))
- {
- char *p = strstr (namelist[n]->d_name, SUFFIX_LIB);
- if (!strcmp (p, SUFFIX_LIB))
- {
- bufmgr = _load_bufmgr (fd, namelist[n]->d_name, arg);
- if (bufmgr)
- found = 1;
- }
- }
- free(namelist[n]);
- }
- free(namelist);
- }
- }
-
- if (!bufmgr)
- {
- fprintf(stderr,"[libdrm] backend is NULL.\n");
- return NULL;
- }
-
- if (pthread_mutex_init(&bufmgr->lock, NULL) != 0)
- {
- bufmgr->bufmgr_destroy(bufmgr);
- free(bufmgr);
- return NULL;
- }
-
- bufmgr->ref_count = 1;
- bufmgr->drm_fd = fd;
-
- LIST_INITHEAD(&bufmgr->bos);
- LIST_ADD(&bufmgr->link, gBufMgrs);
-
- return bufmgr;
-}
-
-void
-drm_slp_bufmgr_destroy(drm_slp_bufmgr bufmgr)
-{
- DRM_RETURN_IF_FAIL(MGR_IS_VALID(bufmgr));
-
- fprintf(stderr, "[DRM] bufmgr destroy: bufmgr:%p, drm_fd:%d\n",
- bufmgr, bufmgr->drm_fd);
-
- /*Check and Free bos*/
- if(!LIST_IS_EMPTY(&bufmgr->bos))
- {
- drm_slp_bo bo, tmp;
-
- LIST_FOR_EACH_ENTRY_SAFE(bo, tmp, &bufmgr->bos, list)
- {
- fprintf(stderr, "[libdrm] Un-freed bo(%p, ref:%d) \n", bo, bo->ref_cnt);
- bo->ref_cnt = 1;
- drm_slp_bo_unref(bo);
- }
- }
-
- LIST_DEL(&bufmgr->link);
- bufmgr->bufmgr_destroy(bufmgr);
-
- if(bufmgr->semObj.isOpened)
- {
- _sem_close(bufmgr);
- }
-
- pthread_mutex_destroy(&bufmgr->lock);
- free(bufmgr);
-}
-
-int
-drm_slp_bufmgr_lock(drm_slp_bufmgr bufmgr)
-{
- DRM_RETURN_VAL_IF_FAIL(MGR_IS_VALID(bufmgr), 0);
-
- pthread_mutex_lock(&bufmgr->lock);
-
- if(bufmgr->bufmgr_lock)
- {
- int ret;
- ret = bufmgr->bufmgr_lock(bufmgr);
- pthread_mutex_unlock(&bufmgr->lock);
- return ret;
- }
-
- if(!bufmgr->semObj.isOpened)
- {
- if(_sem_open(bufmgr) != 1)
- {
- pthread_mutex_unlock(&bufmgr->lock);
- return 0;
- }
- bufmgr->semObj.isOpened = 1;
- }
-
- if(_sem_lock(bufmgr) != 1)
- {
- pthread_mutex_unlock(&bufmgr->lock);
- return 0;
- }
-
- pthread_mutex_unlock(&bufmgr->lock);
-
- return 1;
-}
-
-int
-drm_slp_bufmgr_unlock(drm_slp_bufmgr bufmgr)
-{
- DRM_RETURN_VAL_IF_FAIL(MGR_IS_VALID(bufmgr), 0);
-
- pthread_mutex_lock(&bufmgr->lock);
-
- if(bufmgr->bufmgr_unlock)
- {
- int ret;
- ret = bufmgr->bufmgr_unlock(bufmgr);
- pthread_mutex_unlock(&bufmgr->lock);
- return ret;
- }
-
- if(_sem_unlock(bufmgr) != 1)
- {
- pthread_mutex_unlock(&bufmgr->lock);
- return 0;
- }
-
- pthread_mutex_unlock(&bufmgr->lock);
-
- return 1;
-}
-
-int
-drm_slp_bufmgr_cache_flush(drm_slp_bufmgr bufmgr, drm_slp_bo bo, int flags)
-{
- int ret;
-
- DRM_RETURN_VAL_IF_FAIL(MGR_IS_VALID(bufmgr) || BO_IS_VALID(bo), 0);
-
- if (!bo)
- flags |= DRM_SLP_CACHE_ALL;
-
- if (bo)
- {
- DRM_RETURN_VAL_IF_FAIL(BO_IS_VALID(bo), 0);
-
- if(!bo->bufmgr)
- return 0;
-
- pthread_mutex_lock(&bo->bufmgr->lock);
- ret = bo->bufmgr->bufmgr_cache_flush(bufmgr, bo, flags);
- pthread_mutex_unlock(&bo->bufmgr->lock);
- }
- else
- {
- pthread_mutex_lock(&bufmgr->lock);
- ret = bufmgr->bufmgr_cache_flush(bufmgr, NULL, flags);
- pthread_mutex_unlock(&bufmgr->lock);
- }
-
- return ret;
-}
-
-int
-drm_slp_bo_size(drm_slp_bo bo)
-{
- int size;
- drm_slp_bufmgr bufmgr;
-
- DRM_RETURN_VAL_IF_FAIL(BO_IS_VALID(bo), 0);
-
- bufmgr = bo->bufmgr;
-
- pthread_mutex_lock(&bufmgr->lock);
- size = bo->bufmgr->bo_size(bo);
- pthread_mutex_unlock(&bufmgr->lock);
-
- return size;
-}
-
-drm_slp_bo
-drm_slp_bo_ref(drm_slp_bo bo)
-{
- drm_slp_bufmgr bufmgr;
-
- DRM_RETURN_VAL_IF_FAIL(BO_IS_VALID(bo), NULL);
-
- bufmgr = bo->bufmgr;
-
- pthread_mutex_lock(&bufmgr->lock);
-
- bo->ref_cnt++;
-
- pthread_mutex_unlock(&bufmgr->lock);
-
- return bo;
-}
-
-void
-drm_slp_bo_unref(drm_slp_bo bo)
-{
- drm_slp_bufmgr bufmgr;
-
- DRM_RETURN_IF_FAIL(BO_IS_VALID(bo));
-
- bufmgr = bo->bufmgr;
-
- if(0 >= bo->ref_cnt)
- return;
-
- pthread_mutex_lock(&bufmgr->lock);
-
- bo->ref_cnt--;
- if(bo->ref_cnt == 0)
- {
- if(bo->user_data)
- {
- void* rd;
- drm_slp_user_data* old_data;
- unsigned long key;
-
- while(1==drmSLFirst(bo->user_data, &key, &rd))
- {
- old_data = (drm_slp_user_data*)rd;
-
- if(old_data->is_valid && old_data->free_func)
- {
- if(old_data->data)
- old_data->free_func(old_data->data);
- old_data->data = NULL;
- free(old_data);
- }
- drmSLDelete(bo->user_data, key);
- }
-
- drmSLDestroy(bo->user_data);
- bo->user_data = (void*)0;
- }
-
- LIST_DEL(&bo->list);
- bufmgr->bo_free(bo);
-
- free(bo);
- }
-
- pthread_mutex_unlock(&bufmgr->lock);
-}
-
-drm_slp_bo
-drm_slp_bo_alloc(drm_slp_bufmgr bufmgr, const char * name, int size, int flags)
-{
- drm_slp_bo bo=NULL;
-
- DRM_RETURN_VAL_IF_FAIL( MGR_IS_VALID(bufmgr) && (size > 0), NULL);
-
- bo = calloc(sizeof(struct _drm_slp_bo), 1);
- if(!bo)
- return NULL;
-
- bo->bufmgr = bufmgr;
-
- pthread_mutex_lock(&bufmgr->lock);
- if(!bufmgr->bo_alloc(bo, name, size, flags))
- {
- free(bo);
- pthread_mutex_unlock(&bufmgr->lock);
- return NULL;
- }
- bo->ref_cnt = 1;
- LIST_ADD(&bo->list, &bufmgr->bos);
- pthread_mutex_unlock(&bufmgr->lock);
-
- return bo;
-}
-
-drm_slp_bo
-drm_slp_bo_attach(drm_slp_bufmgr bufmgr,
- const char* name,
- int type,
- int size,
- unsigned int handle)
-{
- drm_slp_bo bo;
-
- DRM_RETURN_VAL_IF_FAIL(MGR_IS_VALID(bufmgr), NULL);
-
- bo = calloc(sizeof(struct _drm_slp_bo), 1);
- if(!bo)
- return NULL;
-
- bo->bufmgr = bufmgr;
-
- pthread_mutex_lock(&bufmgr->lock);
- if(!bufmgr->bo_attach(bo, name, type, size, handle))
- {
- free(bo);
- pthread_mutex_unlock(&bufmgr->lock);
- return NULL;
- }
- bo->ref_cnt = 1;
- LIST_ADD(&bo->list, &bufmgr->bos);
- pthread_mutex_unlock(&bufmgr->lock);
-
- return bo;
-}
-
-drm_slp_bo
-drm_slp_bo_import(drm_slp_bufmgr bufmgr, unsigned int key)
-{
- drm_slp_bo bo;
-
- DRM_RETURN_VAL_IF_FAIL(MGR_IS_VALID(bufmgr), NULL);
-
- bo = calloc(sizeof(struct _drm_slp_bo), 1);
- if(!bo)
- return NULL;
-
- bo->bufmgr = bufmgr;
-
- pthread_mutex_lock(&bufmgr->lock);
- if(!bufmgr->bo_import(bo, key))
- {
- free(bo);
- pthread_mutex_unlock(&bufmgr->lock);
- return NULL;
- }
- bo->ref_cnt = 1;
- LIST_ADD(&bo->list, &bufmgr->bos);
- pthread_mutex_unlock(&bufmgr->lock);
-
- return bo;
-}
-
-unsigned int
-drm_slp_bo_export(drm_slp_bo bo)
-{
- int ret;
-
- DRM_RETURN_VAL_IF_FAIL(BO_IS_VALID(bo), 0);
-
- pthread_mutex_lock(&bo->bufmgr->lock);
- ret = bo->bufmgr->bo_export(bo);
- pthread_mutex_unlock(&bo->bufmgr->lock);
-
- return ret;
-}
-
-unsigned int
-drm_slp_bo_get_handle(drm_slp_bo bo, int device)
-{
- unsigned int ret;
-
- DRM_RETURN_VAL_IF_FAIL(BO_IS_VALID(bo), 0);
-
- pthread_mutex_lock(&bo->bufmgr->lock);
- ret = bo->bufmgr->bo_get_handle(bo, device);
- pthread_mutex_unlock(&bo->bufmgr->lock);
-
- return ret;
-}
-
-unsigned int
-drm_slp_bo_map(drm_slp_bo bo, int device, int opt)
-{
- unsigned int ret;
-
- DRM_RETURN_VAL_IF_FAIL(BO_IS_VALID(bo), 0);
-
- pthread_mutex_lock(&bo->bufmgr->lock);
- if(bo->bufmgr->bo_lock)
- {
- bo->bufmgr->bo_lock(bo, 0, (void*)0);
- }
-
- ret = bo->bufmgr->bo_map(bo, device, opt);
- pthread_mutex_unlock(&bo->bufmgr->lock);
-
- return ret;
-}
-
-int
-drm_slp_bo_unmap(drm_slp_bo bo, int device)
-{
- int ret;
-
- DRM_RETURN_VAL_IF_FAIL(BO_IS_VALID(bo), 0);
-
- pthread_mutex_lock(&bo->bufmgr->lock);
- ret = bo->bufmgr->bo_unmap(bo, device);
-
- if(bo->bufmgr->bo_unlock)
- {
- bo->bufmgr->bo_unlock(bo);
- }
- pthread_mutex_unlock(&bo->bufmgr->lock);
-
- return 0;
-}
-
-int
-drm_slp_bo_swap(drm_slp_bo bo1, drm_slp_bo bo2)
-{
- void* temp;
-
- DRM_RETURN_VAL_IF_FAIL(BO_IS_VALID(bo1), 0);
- DRM_RETURN_VAL_IF_FAIL(BO_IS_VALID(bo2), 0);
-
- if(bo1->bufmgr->bo_size(bo1) != bo2->bufmgr->bo_size(bo2))
- return 0;
-
- pthread_mutex_lock(&bo1->bufmgr->lock);
- temp = bo1->priv;
- bo1->priv = bo2->priv;
- bo2->priv = temp;
- pthread_mutex_unlock(&bo1->bufmgr->lock);
-
- return 1;
-}
-
-int
-drm_slp_bo_add_user_data(drm_slp_bo bo, unsigned long key, drm_data_free data_free_func)
-{
- int ret;
- drm_slp_user_data* data;
-
- DRM_RETURN_VAL_IF_FAIL(BO_IS_VALID(bo), 0);
-
- if(!bo->user_data)
- bo->user_data = drmSLCreate();
-
- data = calloc(1, sizeof(drm_slp_user_data));
- if(!data)
- return 0;
-
- data->free_func = data_free_func;
- data->data = (void*)0;
- data->is_valid = 0;
-
- ret = drmSLInsert(bo->user_data, key, data);
- if(ret == 1) /* Already in list */
- {
- free(data);
- return 0;
- }
-
- return 1;
-}
-
-int
-drm_slp_bo_set_user_data(drm_slp_bo bo, unsigned long key, void* data)
-{
- void *rd;
- drm_slp_user_data* old_data;
-
- DRM_RETURN_VAL_IF_FAIL(BO_IS_VALID(bo), 0);
-
- if(!bo->user_data)
- return 0;
-
- if(drmSLLookup(bo->user_data, key, &rd))
- return 0;
-
- old_data = (drm_slp_user_data*)rd;
- if (!old_data)
- return 0;
-
- if(old_data->is_valid)
- {
- if(old_data->free_func)
- {
- if(old_data->data)
- old_data->free_func(old_data->data);
- old_data->data = NULL;
- }
- }
- else
- old_data->is_valid = 1;
-
- old_data->data = data;
-
- return 1;
-}
-
-int
-drm_slp_bo_get_user_data(drm_slp_bo bo, unsigned long key, void** data)
-{
- void *rd;
- drm_slp_user_data* old_data;
-
- DRM_RETURN_VAL_IF_FAIL(BO_IS_VALID(bo) && data && bo->user_data, 0);
-
- if(drmSLLookup(bo->user_data, key, &rd))
- {
- *data = NULL;
- return 0;
- }
-
- old_data = (drm_slp_user_data*)rd;
- if (!old_data)
- {
- *data = NULL;
- return 0;
- }
-
- *data = old_data->data;
-
- return 1;
-}
-
-int
-drm_slp_bo_delete_user_data(drm_slp_bo bo, unsigned long key)
-{
- void *rd;
- drm_slp_user_data* old_data=(void*)0;
-
- DRM_RETURN_VAL_IF_FAIL(BO_IS_VALID(bo) && bo->user_data, 0);
-
- if(drmSLLookup(bo->user_data, key, &rd))
- return 0;
-
- old_data = (drm_slp_user_data*)rd;
- if (!old_data)
- return 0;
-
- if(old_data->is_valid && old_data->free_func)
- {
- if(old_data->data)
- old_data->free_func(old_data->data);
- free(old_data);
- }
- drmSLDelete(bo->user_data, key);
-
- return 1;
-}
+++ /dev/null
-/**************************************************************************
-
-xserver-xorg-video-sec
-
-Copyright 2011 Samsung Electronics co., Ltd. All Rights Reserved.
-
-Contact: SooChan Lim <sc1.lim@samsung.com>, Sangjin Lee <lsj119@samsung.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-#ifndef _DRM_SLP_BUFMGR_H_
-#define _DRM_SLP_BUFMGR_H_
-
-#include <semaphore.h>
-#include <pthread.h>
-#include <xf86drm.h>
-
-typedef struct _drm_slp_bo * drm_slp_bo;
-typedef struct _drm_slp_bufmgr * drm_slp_bufmgr;
-
-struct list_head
-{
- struct list_head *prev;
- struct list_head *next;
-};
-
-struct _drm_slp_bo
-{
- struct list_head list;
- drm_slp_bufmgr bufmgr;
- int ref_cnt; /*atomic count*/
- void *user_data;
-
- /* private data */
- void *priv;
-};
-
-typedef enum
-{
- STATUS_UNLOCK,
- STATUS_READY_TO_LOCK,
- STATUS_LOCK,
-} lock_status;
-
-struct _drm_slp_bufmgr
-{
- struct list_head bos; /*list head of bo*/
-
- pthread_mutex_t lock;
- struct {
- int isOpened;
- lock_status status;
- sem_t* handle;
- } semObj;
-
- void (*bufmgr_destroy)(drm_slp_bufmgr bufmgr);
- int (*bufmgr_cache_flush)(drm_slp_bufmgr bufmgr, drm_slp_bo bo, int flags);
-
- int (*bo_size)(drm_slp_bo bo);
-
- void (*bo_free)(drm_slp_bo bo);
- int (*bo_alloc)(drm_slp_bo bo,
- const char* name,
- int size,
- int flags);
- int (*bo_attach)(drm_slp_bo bo,
- const char* name,
- int type,
- int size,
- unsigned int handle);
- int (*bo_import)(drm_slp_bo bo, unsigned int key);
- unsigned int (*bo_export)(drm_slp_bo bo);
-
- unsigned int (*bo_get_handle)(drm_slp_bo bo, int device);
- unsigned int (*bo_map)(drm_slp_bo bo, int device, int opt);
- int (*bo_unmap)(drm_slp_bo bo, int device);
-
-
- /* Padding for future extension */
- int (*bufmgr_lock) (drm_slp_bufmgr bufmgr);
- int (*bufmgr_unlock) (drm_slp_bufmgr bufmgr);
- int (*bo_lock) (drm_slp_bo bo, unsigned int checkOnly, unsigned int* isLocked);
- int (*bo_unlock) (drm_slp_bo bo);
- void (*reserved5) (void);
- void (*reserved6) (void);
-
- /* private data */
- void *priv;
-
- struct list_head link; /*link of bufmgr*/
-
- int drm_fd;
- int ref_count;
-};
-
-/* DRM_SLP_MEM_TYPE */
-#define DRM_SLP_MEM_GEM 0
-#define DRM_SLP_MEM_USERPTR 1
-#define DRM_SLP_MEM_DMABUF 2
-#define DRM_SLP_MEM_GPU 3
-
-/* DRM_SLP_DEVICE_TYPE */
-#define DRM_SLP_DEVICE_DEFAULT 0 //Default handle
-#define DRM_SLP_DEVICE_CPU 1
-#define DRM_SLP_DEVICE_2D 2
-#define DRM_SLP_DEVICE_3D 3
-#define DRM_SLP_DEVICE_MM 4
-
-/* DRM_SLP_OPTION */
-#define DRM_SLP_OPTION_READ (1 << 0)
-#define DRM_SLP_OPTION_WRITE (1 << 1)
-
-/* DRM_SLP_CACHE */
-#define DRM_SLP_CACHE_INV 0x01
-#define DRM_SLP_CACHE_CLN 0x02
-#define DRM_SLP_CACHE_ALL 0x10
-#define DRM_SLP_CACHE_FLUSH (DRM_SLP_CACHE_INV|DRM_SLP_CACHE_CLN)
-#define DRM_SLP_CACHE_FLUSH_ALL (DRM_SLP_CACHE_FLUSH|DRM_SLP_CACHE_ALL)
-
-enum DRM_SLP_BO_FLAGS{
- DRM_SLP_BO_DEFAULT = 0,
- DRM_SLP_BO_SCANOUT = (1<<0),
- DRM_SLP_BO_NONCACHABLE = (1<<1),
- DRM_SLP_BO_WC = (1<<2),
-};
-
-/* Functions for buffer mnager */
-drm_slp_bufmgr
-drm_slp_bufmgr_init(int fd, void * arg);
-void
-drm_slp_bufmgr_destroy(drm_slp_bufmgr bufmgr);
-int
-drm_slp_bufmgr_lock(drm_slp_bufmgr bufmgr);
-int
-drm_slp_bufmgr_unlock(drm_slp_bufmgr bufmgr);
-int
-drm_slp_bufmgr_cache_flush(drm_slp_bufmgr bufmgr, drm_slp_bo bo, int flags);
-
-
-/*Functions for bo*/
-int
-drm_slp_bo_size (drm_slp_bo bo);
-drm_slp_bo
-drm_slp_bo_ref(drm_slp_bo bo);
-void
-drm_slp_bo_unref(drm_slp_bo bo);
-drm_slp_bo
-drm_slp_bo_alloc(drm_slp_bufmgr bufmgr,
- const char* name,
- int size,
- int flags);
-drm_slp_bo
-drm_slp_bo_attach(drm_slp_bufmgr bufmgr,
- const char* name,
- int type,
- int size,
- unsigned int handle);
-drm_slp_bo
-drm_slp_bo_import(drm_slp_bufmgr bufmgr, unsigned int key);
-unsigned int
-drm_slp_bo_export(drm_slp_bo bo);
-unsigned int
-drm_slp_bo_get_handle(drm_slp_bo, int device);
-unsigned int
-drm_slp_bo_map(drm_slp_bo bo, int device, int opt);
-int
-drm_slp_bo_unmap(drm_slp_bo bo, int device);
-int
-drm_slp_bo_swap(drm_slp_bo bo1, drm_slp_bo bo2);
-
-/*Functions for userdata of bo*/
-typedef void (*drm_data_free)(void *);
-int
-drm_slp_bo_add_user_data(drm_slp_bo bo, unsigned long key, drm_data_free data_free_func);
-int
-drm_slp_bo_delete_user_data(drm_slp_bo bo, unsigned long key);
-int
-drm_slp_bo_set_user_data(drm_slp_bo bo, unsigned long key, void* data);
-int
-drm_slp_bo_get_user_data(drm_slp_bo bo, unsigned long key, void** data);
-#endif /* _DRM_SLP_BUFMGR_H_ */
+++ /dev/null
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: libdrm
-Description: Userspace interface to kernel DRM services
-Version: @PACKAGE_VERSION@
-Requires: libdrm
-Libs: -L${libdir} -ldrm_slp
-Cflags: -I${includedir} -I${includedir}/libdrm
+++ /dev/null
-/*
- *
- * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND. USA.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
- * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
- * USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- */
-
-/**
- * \file
- * List macros heavily inspired by the Linux kernel
- * list handling. No list looping yet.
- *
- * Is not threadsafe, so common operations need to
- * be protected using an external mutex.
- */
-#ifndef _U_DOUBLE_LIST_H_
-#define _U_DOUBLE_LIST_H_
-
-#include <stddef.h>
-
-static void list_inithead(struct list_head *item)
-{
- item->prev = item;
- item->next = item;
-}
-
-static inline void list_add(struct list_head *item, struct list_head *list)
-{
- item->prev = list;
- item->next = list->next;
- list->next->prev = item;
- list->next = item;
-}
-
-static inline void list_addtail(struct list_head *item, struct list_head *list)
-{
- item->next = list;
- item->prev = list->prev;
- list->prev->next = item;
- list->prev = item;
-}
-
-static inline void list_replace(struct list_head *from, struct list_head *to)
-{
- to->prev = from->prev;
- to->next = from->next;
- from->next->prev = to;
- from->prev->next = to;
-}
-
-static inline void list_del(struct list_head *item)
-{
- item->prev->next = item->next;
- item->next->prev = item->prev;
-}
-
-static inline void list_delinit(struct list_head *item)
-{
- item->prev->next = item->next;
- item->next->prev = item->prev;
- item->next = item;
- item->prev = item;
-}
-
-#define LIST_INITHEAD(__item) list_inithead(__item)
-#define LIST_ADD(__item, __list) list_add(__item, __list)
-#define LIST_ADDTAIL(__item, __list) list_addtail(__item, __list)
-#define LIST_REPLACE(__from, __to) list_replace(__from, __to)
-#define LIST_DEL(__item) list_del(__item)
-#define LIST_DELINIT(__item) list_delinit(__item)
-
-#define LIST_ENTRY(__type, __item, __field) \
- ((__type *)(((char *)(__item)) - offsetof(__type, __field)))
-
-#define LIST_IS_EMPTY(__list) \
- ((__list)->next == (__list))
-
-#ifndef container_of
-#define container_of(ptr, sample, member) \
- (void *)((char *)(ptr) \
- - ((char *)&(sample)->member - (char *)(sample)))
-#endif
-
-#define LIST_FOR_EACH_ENTRY(pos, head, member) \
- for (pos = container_of((head)->next, pos, member); \
- &pos->member != (head); \
- pos = container_of(pos->member.next, pos, member))
-
-#define LIST_FOR_EACH_ENTRY_SAFE(pos, storage, head, member) \
- for (pos = container_of((head)->next, pos, member), \
- storage = container_of(pos->member.next, pos, member); \
- &pos->member != (head); \
- pos = storage, storage = container_of(storage->member.next, storage, member))
-
-#define LIST_FOR_EACH_ENTRY_SAFE_REV(pos, storage, head, member) \
- for (pos = container_of((head)->prev, pos, member), \
- storage = container_of(pos->member.prev, pos, member); \
- &pos->member != (head); \
- pos = storage, storage = container_of(storage->member.prev, storage, member))
-
-#define LIST_FOR_EACH_ENTRY_FROM(pos, start, head, member) \
- for (pos = container_of((start), pos, member); \
- &pos->member != (head); \
- pos = container_of(pos->member.next, pos, member))
-
-#define LIST_FOR_EACH_ENTRY_FROM_REV(pos, start, head, member) \
- for (pos = container_of((start), pos, member); \
- &pos->member != (head); \
- pos = container_of(pos->member.prev, pos, member))
-
-#endif /*_U_DOUBLE_LIST_H_*/
SUBDIRS += kmstest modetest
endif
-SUBDIRS += ipptest
-SUBDIRS += rottest
-SUBDIRS += gemtest
-SUBDIRS += g2dtest
-
if HAVE_RADEON
SUBDIRS += radeon
endif
+++ /dev/null
-AM_CFLAGS = \
- -I$(top_srcdir)/include/drm \
- -I$(top_srcdir)/libkms/ \
- -I$(top_srcdir)/exynos/ \
- -I$(top_srcdir) \
- $(CAIRO_CFLAGS)
-
-noinst_PROGRAMS = \
- g2dtest
-
-g2dtest_SOURCES = \
- g2dtest.c
-
-g2dtest_LDADD = \
- $(top_builddir)/libdrm.la \
- $(top_builddir)/libkms/libkms.la \
- $(top_builddir)/exynos/libdrm_exynos.la \
- $(CAIRO_LIBS)
+++ /dev/null
-#ifndef _G2D_H_
-#define _G2D_H_
-
-#include "g2d_reg.h"
-
-typedef enum {
- G2D_SELECT_MODE_NORMAL = (0 << 0),
- G2D_SELECT_MODE_FGCOLOR = (1 << 0),
- G2D_SELECT_MODE_BGCOLOR = (2 << 0),
- G2D_SELECT_MODE_MAX = (3 << 0),
-} G2dSelectMode;
-
-typedef enum {
- /* COLOR FORMAT */
- G2D_COLOR_FMT_XRGB8888,
- G2D_COLOR_FMT_ARGB8888,
- G2D_COLOR_FMT_RGB565,
- G2D_COLOR_FMT_XRGB1555,
- G2D_COLOR_FMT_ARGB1555,
- G2D_COLOR_FMT_XRGB4444,
- G2D_COLOR_FMT_ARGB4444,
- G2D_COLOR_FMT_PRGB888,
- G2D_COLOR_FMT_YCbCr444,
- G2D_COLOR_FMT_YCbCr422,
- G2D_COLOR_FMT_YCbCr420 = 10,
- G2D_COLOR_FMT_A8, /* alpha 8bit */
- G2D_COLOR_FMT_L8, /* Luminance 8bit: gray color */
- G2D_COLOR_FMT_A1, /* alpha 1bit */
- G2D_COLOR_FMT_A4, /* alpha 4bit */
- G2D_COLOR_FMT_MASK = (15 << 0), /* VER4.1 */
-
- /* COLOR ORDER */
- G2D_ORDER_AXRGB = (0 << 4), /* VER4.1 */
- G2D_ORDER_RGBAX = (1 << 4), /* VER4.1 */
- G2D_ORDER_AXBGR = (2 << 4), /* VER4.1 */
- G2D_ORDER_BGRAX = (3 << 4), /* VER4.1 */
- G2D_ORDER_MASK = (3 << 4), /* VER4.1 */
-
- /* Number of YCbCr plane */
- G2D_YCbCr_1PLANE = (0 << 8), /* VER4.1 */
- G2D_YCbCr_2PLANE = (1 << 8), /* VER4.1 */
- G2D_YCbCr_PLANE_MASK = (3 << 8), /* VER4.1 */
-
- /* Order in YCbCr */
- G2D_YCbCr_ORDER_CrY1CbY0 = (0 << 12), /* VER4.1 */
- G2D_YCbCr_ORDER_CbY1CrY0 = (1 << 12), /* VER4.1 */
- G2D_YCbCr_ORDER_Y1CrY0Cb = (2 << 12), /* VER4.1 */
- G2D_YCbCr_ORDER_Y1CbY0Cr = (3 << 12), /* VER4.1 */
- G2D_YCbCr_ORDER_MASK = (3 < 12), /* VER4.1 */
-
- /* CSC */
- G2D_CSC_601 = (0 << 16), /* VER4.1 */
- G2D_CSC_709 = (1 << 16), /* VER4.1 */
- G2D_CSC_MASK = (1 << 16), /* VER4.1 */
-
- /* Valid value range of YCbCr */
- G2D_YCbCr_RANGE_NARROW = (0 << 17), /* VER4.1 */
- G2D_YCbCr_RANGE_WIDE = (1 << 17), /* VER4.1 */
- G2D_YCbCr_RANGE_MASK= (1 << 17), /* VER4.1 */
-
- G2D_COLOR_MODE_MASK = 0xFFFFFFFF
-} G2dColorMode;
-
-#endif /* _G2D_H_ */
+++ /dev/null
-#ifndef _G2D_REG_H_
-#define _G2D_REG_H_
-
-/* Registers */
-/* GEBERAL REGISTER */
-#define SOFT_RESET_REG (0x0000)
-#define INTEN_REG (0x0004)
-#define INTC_PEND_REG (0x000c)
-#define FIFO_STAT_REG (0x0010)
-#define AXI_MODE_REG (0x001C)
-#define DMA_SFR_BASE_ADDR_REG (0x0080)
-#define DMA_COMMAND_REG (0x0084)
-#define DMA_EXE_LIST_NUM_REG (0x0088)
-#define DMA_STATUS_REG (0x008C)
-#define DMA_HOLD_CMD_REG (0x0090)
-
-/* COMMAND REGISTER */
-#define BITBLT_START_REG (0x0100)
-#define BITBLT_COMMAND_REG (0x0104)
-#define BLEND_FUNCTION_REG (0x0108) /* VER4.1 */
-#define ROUND_MODE_REG (0x010C) /* VER4.1 */
-
-/* PARAMETER SETTING REGISTER */
-
-/* ROTATE and DIRECTION */
-#define ROTATE_REG (0x0200)
-#define SRC_MASK_DIRECT_REG (0x0204)
-#define DST_PAT_DIRECT_REG (0x0208)
-
-/* SOURCE */
-#define SRC_SELECT_REG (0x0300)
-#define SRC_BASE_ADDR_REG (0x0304)
-#define SRC_STRIDE_REG (0x0308)
-#define SRC_COLOR_MODE_REG (0x030c)
-#define SRC_LEFT_TOP_REG (0x0310)
-#define SRC_RIGHT_BOTTOM_REG (0x0314)
-#define SRC_PLANE2_BASE_ADDR_REG (0x0318) /* VER4.1 */
-#define SRC_REPEAT_MODE_REG (0x031C)
-#define SRC_PAD_VALUE_REG (0x0320)
-#define SRC_A8_RGB_EXT_REG (0x0324)
-#define SRC_SCALE_CTRL_REG (0x0328)
-#define SRC_XSCALE_REG (0x032C)
-#define SRC_YSCALE_REG (0x0330)
-
-/* DESTINATION */
-#define DST_SELECT_REG (0x0400)
-#define DST_BASE_ADDR_REG (0x0404)
-#define DST_STRIDE_REG (0x0408)
-#define DST_COLOR_MODE_REG (0x040C)
-#define DST_LEFT_TOP_REG (0x0410)
-#define DST_RIGHT_BOTTOM_REG (0x0414)
-#define DST_PLANE2_BASE_ADDR_REG (0x0418) /* VER4.1 */
-#define DST_A8_RGB_EXT_REG (0x041C)
-
-/* PATTERN */
-#define PAT_BASE_ADDR_REG (0x0500)
-#define PAT_SIZE_REG (0x0504)
-#define PAT_COLOR_MODE_REG (0x0508)
-#define PAT_OFFSET_REG (0x050C)
-#define PAT_STRIDE_REG (0x0510)
-
-/* MASK */
-#define MASK_BASE_ADDR_REG (0x0520)
-#define MASK_STRIDE_REG (0x0524)
-#define MASK_LEFT_TOP_REG (0x0528) /* VER4.1 */
-#define MASK_RIGHT_BOTTOM_REG (0x052C) /* VER4.1 */
-#define MASK_MODE_REG (0x0530) /* VER4.1 */
-#define MASK_REPEAT_MODE_REG (0x0534)
-#define MASK_PAD_VALUE_REG (0x0538)
-#define MASK_SCALE_CTRL_REG (0x053C)
-#define MASK_XSCALE_REG (0x0540)
-#define MASK_YSCALE_REG (0x0544)
-
-/* CLIPPING WINDOW */
-#define CW_LT_REG (0x0600)
-#define CW_RB_REG (0x0604)
-
-/* ROP & ALPHA SETTING */
-#define THIRD_OPERAND_REG (0x0610)
-#define ROP4_REG (0x0614)
-#define ALPHA_REG (0x0618)
-
-/* COLOR SETTING */
-#define FG_COLOR_REG (0x0700)
-#define BG_COLOR_REG (0x0704)
-#define BS_COLOR_REG (0x0708)
-#define SF_COLOR_REG (0x070C) /* VER4.1 */
-
-/* COLOR KEY */
-#define SRC_COLORKEY_CTRL_REG (0x0710)
-#define SRC_COLORKEY_DR_MIN_REG (0x0714)
-#define SRC_COLORKEY_DR_MAX_REG (0x0718)
-#define DST_COLORKEY_CTRL_REG (0x071C)
-#define DST_COLORKEY_DR_MIN_REG (0x0720)
-#define DST_COLORKEY_DR_MAX_REG (0x0724)
-/* YCbCr src Color Key */
-#define YCbCr_SRC_COLORKEY_CTRL_REG (0x0728) /* VER4.1 */
-#define YCbCr_SRC_COLORKEY_DR_MIN_REG (0x072C) /* VER4.1 */
-#define YCbCr_SRC_COLORKEY_DR_MAX_REG (0x0730) /* VER4.1 */
-/* YCbCr dst Color Key */
-#define YCbCr_DST_COLORKEY_CTRL_REG (0x0734) /* VER4.1 */
-#define YCbCr_DST_COLORKEY_DR_MIN_REG (0x0738) /* VER4.1 */
-#define YCbCr_DST_COLORKEY_DR_MAX_REG (0x073C) /* VER4.1 */
-
-/* bits of BITBLT_COMMAND_REG */
-#define G2D_FAST_SOLID_COLOR_FILL (1 << 28)
-
-#endif /* _G2D_REG_H_ */
+++ /dev/null
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "xf86drm.h"
-#include "xf86drmMode.h"
-#include "exynos_drm.h"
-#include "drm_fourcc.h"
-#include "g2d.h"
-
-#define DRM_MODULE_NAME "exynos"
-
-struct connector {
- uint32_t id;
- char mode_str[64];
- drmModeModeInfo *mode;
- drmModeEncoder *encoder;
- int crtc;
- int plane_zpos;
- unsigned int fb_id[2], current_fb_id;
- struct timeval start;
-
- int swap_count;
-};
-
-struct drm_buffer {
- struct drm_exynos_gem_create gem;
- struct drm_exynos_gem_mmap gem_mmap;
-};
-
-struct drm_fb {
- uint32_t id;
- struct drm_buffer drm_buffer;
-};
-
-struct drm_desc {
- int fd;
- struct connector connector;
- int plane_id[5];
- int width;
- int height;
-};
-
-enum format {
- FMT_RGB565,
- FMT_RGB888,
- FMT_NV12M,
-};
-
-static void connector_find_mode(int fd, struct connector *c,
- drmModeRes *resources)
-{
- drmModeConnector *connector;
- int i, j;
-
- /* First, find the connector & mode */
- c->mode = NULL;
- for (i = 0; i < resources->count_connectors; i++) {
- connector = drmModeGetConnector(fd, resources->connectors[i]);
-
- if (!connector) {
- fprintf(stderr, "could not get connector %i: %s\n",
- resources->connectors[i], strerror(errno));
- drmModeFreeConnector(connector);
- continue;
- }
-
- if (!connector->count_modes) {
- drmModeFreeConnector(connector);
- continue;
- }
-
- if (connector->connector_id != c->id) {
- drmModeFreeConnector(connector);
- continue;
- }
-
- for (j = 0; j < connector->count_modes; j++) {
- c->mode = &connector->modes[j];
- if (!strcmp(c->mode->name, c->mode_str))
- break;
- }
-
- /* Found it, break out */
- if (c->mode)
- break;
-
- drmModeFreeConnector(connector);
- }
-
- if (!c->mode) {
- fprintf(stderr, "failed to find mode \"%s\"\n", c->mode_str);
- return;
- }
-
- /* Now get the encoder */
- for (i = 0; i < resources->count_encoders; i++) {
- c->encoder = drmModeGetEncoder(fd, resources->encoders[i]);
-
- if (!c->encoder) {
- fprintf(stderr, "could not get encoder %i: %s\n",
- resources->encoders[i], strerror(errno));
- drmModeFreeEncoder(c->encoder);
- continue;
- }
-
- if (c->encoder->encoder_id == connector->encoder_id)
- break;
-
- drmModeFreeEncoder(c->encoder);
- }
-
- if (c->crtc == -1)
- c->crtc = c->encoder->crtc_id;
-}
-
-static int connector_find_plane(int fd, unsigned int *plane_id)
-{
- drmModePlaneRes *plane_resources;
- drmModePlane *ovr;
- int i;
-
- plane_resources = drmModeGetPlaneResources(fd);
- if (!plane_resources) {
- fprintf(stderr, "drmModeGetPlaneResources failed: %s\n",
- strerror(errno));
- return -1;
- }
-
- for (i = 0; i < plane_resources->count_planes; i++) {
- plane_id[i] = 0;
-
- ovr = drmModeGetPlane(fd, plane_resources->planes[i]);
- if (!ovr) {
- fprintf(stderr, "drmModeGetPlane failed: %s\n",
- strerror(errno));
- continue;
- }
-
- if (ovr->possible_crtcs & (1 << 0))
- plane_id[i] = ovr->plane_id;
- drmModeFreePlane(ovr);
- }
-
- return 0;
-}
-
-static int exynos_g2d_get_ver(int fd, struct drm_exynos_g2d_get_ver *ver)
-{
- int ret;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_G2D_GET_VER, ver);
- if (ret < 0) {
- fprintf(stderr, "failed to get version: %s\n", strerror(-ret));
- return ret;
- }
-
- return 0;
-}
-
-static int exynos_g2d_set_cmdlist(int fd,
- struct drm_exynos_g2d_set_cmdlist *cmdlist)
-{
- int ret;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_G2D_SET_CMDLIST, cmdlist);
- if (ret < 0) {
- fprintf(stderr, "failed to set cmdlist: %s\n", strerror(-ret));
- return ret;
- }
-
- return 0;
-}
-
-static int exynos_g2d_exec(int fd, int async)
-{
- struct drm_exynos_g2d_exec exec;
- int ret;
-
- exec.async = async;
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_G2D_EXEC, &exec);
- if (ret < 0) {
- fprintf(stderr, "failed to execute: %s\n", strerror(-ret));
- return ret;
- }
-
- return 0;
-}
-
-static int exynos_gem_create(int fd, struct drm_exynos_gem_create *gem)
-{
- int ret;
-
- if (!gem)
- return -EINVAL;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_GEM_CREATE, gem);
- if (ret < 0)
- perror("ioctl failed\n");
-
- return ret;
-}
-
-static int exynos_gem_map_offset(int fd, struct drm_exynos_gem_map_off *map_off)
-{
- int ret;
-
- if (!map_off)
- return -EINVAL;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_GEM_MAP_OFFSET, map_off);
- if (ret < 0)
- perror("ioctl failed\n");
-
- return ret;
-}
-
-static int exynos_gem_mmap(int fd, struct drm_exynos_gem_mmap *in_mmap)
-{
- int ret;
-
- if (!in_mmap)
- return -EINVAL;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_GEM_MMAP, in_mmap);
- if (ret < 0)
- perror("ioctl failed\n");
-
- return ret;
-}
-
-static int exynos_gem_close(int fd, struct drm_gem_close *gem_close)
-{
- int ret;
-
- if (!gem_close)
- return -EINVAL;
-
- ret = ioctl(fd, DRM_IOCTL_GEM_CLOSE, gem_close);
- if (ret < 0)
- perror("ioctl failed\n");
-
- return ret;
-}
-
-static struct drm_desc *drm_alloc_desc(void)
-{
- struct drm_desc *drm_desc;
-
- drm_desc = malloc(sizeof(struct drm_desc));
- if (!drm_desc) {
- perror("memory alloc error\n");
- return NULL;
- }
- memset(drm_desc, 0, sizeof(struct drm_desc));
-
- return drm_desc;
-}
-
-static int drm_open(struct drm_desc *drm_desc)
-{
- if (!drm_desc) {
- fprintf(stderr, "drm_desc is NULL\n");
- return -EINVAL;
- }
-
- drm_desc->fd = drmOpen(DRM_MODULE_NAME, NULL);
- if (drm_desc->fd < 0) {
- printf("Failed to open %s module\n", DRM_MODULE_NAME);
- return drm_desc->fd;
- }
-
- return 0;
-}
-
-static int drm_create_buffer(struct drm_desc *drm_desc, struct drm_fb *drm_fb,
- int width, int height)
-{
- struct drm_buffer *drm_buffer;
- unsigned int num_planes;
- unsigned long size;
- int i;
- int ret;
-
- if (!drm_desc)
- return -EINVAL;
-
- size = width * height * 4;
-
- drm_buffer = &drm_fb->drm_buffer;
-
- {
- struct drm_exynos_gem_create *gem = &drm_buffer->gem;
- struct drm_exynos_gem_mmap *gem_mmap = &drm_buffer->gem_mmap;
-
- memset(gem, 0, sizeof(struct drm_exynos_gem_create));
- gem->size = size;
-
- ret = exynos_gem_create(drm_desc->fd, gem);
- if (ret < 0) {
- printf("failed to create gem\n");
- goto err_gem;
- }
-
- gem_mmap->handle = gem->handle;
- gem_mmap->size = gem->size;
- ret = exynos_gem_mmap(drm_desc->fd, gem_mmap);
- if (ret < 0) {
- printf("failed to mmap gem directly\n");
- goto err_gem;
- }
-
- /* init gem buffer */
- memset((void *)(unsigned long)gem_mmap->mapped, 0,
- gem_mmap->size);
- }
-
- return 0;
-
-err_gem:
- {
- struct drm_exynos_gem_create *gem = &drm_buffer->gem;
- struct drm_gem_close gem_close;
-
- gem_close.handle = gem->handle;
- exynos_gem_close(drm_desc->fd, &gem_close);
- }
-
- return ret;
-}
-
-static int drm_create_fb(struct drm_desc *drm_desc, struct drm_fb *drm_fb,
- int width, int height)
-{
- unsigned int pixel_format;
- unsigned int num_planes;
- unsigned int pitch;
- int i;
- int j;
- int ret;
-
- if (!drm_desc)
- return -EINVAL;
-
- drm_desc->width = width;
- drm_desc->height = height;
-
- pixel_format = DRM_FORMAT_RGBA8888;
- num_planes = 1;
- pitch = width * 4;
-
- {
- uint32_t bo[4] = {0,};
- uint32_t pitches[4] = {0,};
- uint32_t offset[4] = {0,};
-
- ret = drm_create_buffer(drm_desc, drm_fb, width, height);
- if (ret < 0)
- goto err;
-
- for (j = 0; j < num_planes; j++) {
- struct drm_buffer *drm_buffer = &drm_fb->drm_buffer;
- struct drm_exynos_gem_create *gem = &drm_buffer->gem;
-
- bo[j] = gem->handle;
- pitches[j] = pitch;
- }
-
- ret = drmModeAddFB2(drm_desc->fd, width, height, pixel_format,
- bo, pitches, offset, &drm_fb->id,
- 0);
- if (ret < 0) {
- perror("failed to add fb\n");
- goto err;
- }
- }
-
- return 0;
-
-err:
- /* TODO: free buffer */
- return ret;
-}
-
-static int drm_set_crtc(struct drm_desc *drm_desc, struct connector *c,
- struct drm_fb *drm_fb)
-{
- drmModeRes *resources;
- int ret;
-
- memcpy(&drm_desc->connector, c, sizeof(struct connector));
-
- resources = drmModeGetResources(drm_desc->fd);
- if (!resources) {
- fprintf(stderr, "drmModeGetResources failed: %s\n",
- strerror(errno));
- ret = -EFAULT;
- goto err;
- }
-
- connector_find_mode(drm_desc->fd, &drm_desc->connector, resources);
- drmModeFreeResources(resources);
-
- ret = drmModeSetCrtc(drm_desc->fd, drm_desc->connector.crtc,
- drm_fb->id, 0, 0,
- &drm_desc->connector.id, 1,
- drm_desc->connector.mode);
- if (ret) {
- fprintf(stderr, "failed to set mode: %s\n", strerror(errno));
- goto err;
- }
-
- return 0;
-
-err:
- /* TODO */
- return ret;
-}
-
-static inline void set_cmd(struct drm_exynos_g2d_cmd *cmd,
- __u32 offset, __u32 data)
-{
- cmd->offset = offset;
- cmd->data = data;
-}
-
-static int exynos_g2d_test_solid_fill(struct drm_desc *drm_desc, int x, int y,
- int color, int gem_handle)
-{
- struct drm_exynos_g2d_set_cmdlist cmdlist;
- struct drm_exynos_g2d_cmd cmd[20];
- struct drm_exynos_g2d_cmd cmd_gem[5];
- int nr = 0;
- int gem_nr = 0;
- int ret;
-
- memset(&cmdlist, 0, sizeof(struct drm_exynos_g2d_set_cmdlist));
- memset(cmd, 0, sizeof(struct drm_exynos_g2d_cmd) * 20);
- memset(cmd_gem, 0, sizeof(struct drm_exynos_g2d_cmd) * 5);
-
- cmdlist.cmd = cmd;
- cmdlist.cmd_gem = cmd_gem;
-
- set_cmd(&cmd[nr++], BITBLT_COMMAND_REG, G2D_FAST_SOLID_COLOR_FILL);
- /* [14:10] R, [9:5] G, [4:0] B */
- set_cmd(&cmd[nr++], SF_COLOR_REG, color);
-
- /* DST */
- set_cmd(&cmd[nr++], DST_SELECT_REG, G2D_SELECT_MODE_FGCOLOR);
- set_cmd(&cmd_gem[gem_nr++], DST_BASE_ADDR_REG, gem_handle);
- set_cmd(&cmd[nr++], DST_STRIDE_REG, 720 * 4);
- set_cmd(&cmd[nr++], DST_COLOR_MODE_REG, G2D_COLOR_FMT_ARGB8888 |
- G2D_ORDER_AXRGB);
- set_cmd(&cmd[nr++], DST_LEFT_TOP_REG, (0 << 16) | 0);
- set_cmd(&cmd[nr++], DST_RIGHT_BOTTOM_REG, (y << 16) | x);
- set_cmd(&cmd[nr++], DST_A8_RGB_EXT_REG, 0);
-
- cmdlist.cmd_nr = nr;
- cmdlist.cmd_gem_nr = gem_nr;
-
- cmdlist.event_type = G2D_EVENT_NONSTOP;
- cmdlist.user_data = 1234;
-
- ret = exynos_g2d_set_cmdlist(drm_desc->fd, &cmdlist);
- if (ret < 0)
- return ret;
-}
-
-static int exynos_g2d_event(int fd)
-{
- char buffer[1024];
- int len, i;
- struct drm_event *e;
- struct drm_exynos_g2d_event *g2d_event;
-
- len = read(fd, buffer, sizeof buffer);
- if (len == 0)
- return 0;
- if (len < sizeof *e)
- return -1;
-
- i = 0;
- while (i < len) {
- e = (struct drm_event *) &buffer[i];
- switch (e->type) {
- case DRM_EXYNOS_G2D_EVENT:
- g2d_event = (struct drm_exynos_g2d_event *) e;
- printf("cmdlist_no: %d\n", g2d_event->cmdlist_no);
- printf("user_data: %lld\n", g2d_event->user_data);
- break;
- default:
- break;
- }
- i += e->length;
- }
-
- return 0;
-}
-
-int main(int argc, char **argv)
-{
- struct connector con_args;
- struct drm_desc *drm_desc;
- struct drm_fb drm_fb;
- struct drm_exynos_g2d_get_ver ver;
- int x, y;
- int ret;
-
- /* default set of connector */
- memset(&con_args, 0, sizeof(struct connector));
- con_args.id = 12;
- con_args.crtc = 3;
- con_args.plane_zpos = -1;
- strcpy(con_args.mode_str, "720x1280");
- x = 720;
- y = 1280;
-
- drm_desc = drm_alloc_desc();
- if (!drm_desc) {
- ret = -1;
- goto err_free;
- }
-
- ret = drm_open(drm_desc);
- if (ret < 0)
- goto err_free;
-
- /* check version */
- ret = exynos_g2d_get_ver(drm_desc->fd, &ver);
- if (ret < 0)
- return ret;
-
- if (ver.major != 4 || ver.minor != 1) {
- fprintf(stderr, "version(%d.%d) mismatch\n", ver.major, ver.minor);
- return -1;
- }
- printf("g2d hw version: %d.%d\n", ver.major, ver.minor);
-
- ret = drm_create_fb(drm_desc, &drm_fb, x, y);
- if (ret < 0)
- goto err_drm_close;
-
- ret = drm_set_crtc(drm_desc, &con_args, &drm_fb);
- if (ret < 0)
- goto err;
-
- getchar();
-
- ret = exynos_g2d_test_solid_fill(drm_desc, x, y, 0x1f,
- drm_fb.drm_buffer.gem.handle);
- if (ret < 0)
- goto err;
-
- ret = exynos_g2d_exec(drm_desc->fd, 1);
- if (ret < 0)
- return ret;
-
- while (1) {
- struct timeval timeout = { .tv_sec = 3, .tv_usec = 0 };
- fd_set fds;
- int ret;
-
- FD_ZERO(&fds);
- FD_SET(0, &fds);
- FD_SET(drm_desc->fd, &fds);
- ret = select(drm_desc->fd + 1, &fds, NULL, NULL, &timeout);
-
- if (ret <= 0) {
- fprintf(stderr, "select timed out or error (ret %d)\n",
- ret);
- continue;
- } else if (FD_ISSET(0, &fds)) {
- break;
- }
-
- exynos_g2d_event(drm_desc->fd);
- }
-
- getchar();
-
- /* TODO */
-
-err:
- /* TODO */
-err_drm_close:
- drmClose(drm_desc->fd);
-err_free:
- if (drm_desc)
- free(drm_desc);
-
- return ret;
-}
+++ /dev/null
-AM_CFLAGS = \
- -I$(top_srcdir)/include/drm \
- -I$(top_srcdir)/libkms/ \
- -I$(top_srcdir)/exynos/ \
- -I$(top_srcdir) \
- $(CAIRO_CFLAGS)
-
-noinst_PROGRAMS = \
- gemtest
-
-gemtest_SOURCES = \
- gemtest.c
-
-gemtest_LDADD = \
- $(top_builddir)/libdrm.la \
- $(top_builddir)/libkms/libkms.la \
- $(top_builddir)/exynos/libdrm_exynos.la \
- $(CAIRO_LIBS)
+++ /dev/null
-/*
- * DRM based mode setting test program
- * Copyright 2008 Tungsten Graphics
- * Jakob Bornecrantz <jakob@tungstengraphics.com>
- * Copyright 2008 Intel Corporation
- * Jesse Barnes <jesse.barnes@intel.com>
- *
- * 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.
- */
-
-/*
- * This fairly simple test program dumps output in a similar format to the
- * "xrandr" tool everyone knows & loves. It's necessarily slightly different
- * since the kernel separates outputs into encoder and connector structures,
- * each with their own unique ID. The program also allows test testing of the
- * memory management and mode setting APIs by allowing the user to specify a
- * connector and mode to use for mode setting. If all works as expected, a
- * blue background should be painted on the monitor attached to the specified
- * connector after the selected mode is set.
- *
- * TODO: use cairo to write the mode info on the selected output once
- * the mode has been programmed, along with possible test patterns.
- */
-#include "config.h"
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <string.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <sys/poll.h>
-#include <sys/time.h>
-#include <sys/mman.h>
-
-#include "xf86drm.h"
-#include "xf86drmMode.h"
-#include "libkms.h"
-
-#include "exynos_drm.h"
-#include "exynos_drmif.h"
-
-#include "ump_ref_drv.h"
-
-#ifdef HAVE_CAIRO
-#include <math.h>
-#include <cairo.h>
-#endif
-
-#define ALIGN(x, a) (((x) + (a) - 1) & ~((a) + 1))
-#define DEFAULT_SIZE (1280 * 720 * 4)
-#define MAX_CMD 5
-
-/*
- * DIRECT_MAP:
- * - at mapping request, physical memory allocated by gem interface
- * would be mmaped to user space directly.
- *
- * INDIRECT_MAP:
- * - when user tries to access user space memory after mmap,
- * in kernel side, the page fault occurs and then the memory would
- * be mmaped to physical memory. user can not aware of this moment.
- *
- * P.S. in this feature, mmap call is not real-mmaped, just fake-mmaped
- * and to test it, enable only one of them please.
- */
-
-#define DIRECT_MAP
-//#define INDIRECT_MAP
-
-#if 0
-#define UMP_TEST
-
-#define GET_PHY_TEST
-
-#define VIDI_TEST
-
-#define GEMGET_TEST
-#endif
-
-enum exynos_test_type {
- CMD_ALLOC = 1 << 0,
- CMD_CACHE = 1 << 1,
- CMD_PRIME = 1 << 2,
- CMD_UMP = 1 << 3,
-
- ALLOC_CONTIG = 1 << 4,
- ALLOC_NONCONTIG = 1 << 5,
- ALLOC_USERPTR = 1 << 6,
-
- ALLOC_MAP_C = 1 << 7,
- ALLOC_MAP_NC = 1 << 8,
- ALLOC_MAP_WC = 1 << 9,
-
- CACHE_L1 = 1 << 10,
- CACHE_L2 = 1 << 11,
- CACHE_ALL_CORES = 1 << 12,
- CACHE_ALL_CACHES = CACHE_L1 | CACHE_L2,
- CACHE_ALL_CACHES_CORES = CACHE_ALL_CACHES | CACHE_ALL_CORES,
-
- CACHE_CLEAN_ALL = 0 << 13,
- CACHE_INV_ALL = 0 << 14,
- CACHE_FLUSH_ALL = CACHE_CLEAN_ALL | CACHE_INV_ALL,
-
- CACHE_CLEAN_RANGE = 1 << 13,
- CACHE_INV_RANGE = 1 << 14,
- CACHE_FLUSH_RANGE = CACHE_CLEAN_RANGE | CACHE_INV_RANGE,
-
- DMABUF_IMPORT = 1 << 15,
- DMABUF_EXPORT = 1 << 16,
- DMABUF_ALL = DMABUF_IMPORT | DMABUF_EXPORT
-};
-
-struct exynos_gem_test {
- char *scmd[MAX_CMD];
-
- unsigned int cmd_type;
- unsigned int mem_type;
- unsigned int map_type;
- unsigned int cache_type;
- unsigned int cache_op_type;
- unsigned long start_offset;
- unsigned long end_offset;
- unsigned int dmabuf_type;
-};
-
-struct exynos_gem_test exynos_test;
-
-drmModeRes *resources;
-int fd, modes;
-
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
-
-struct type_name {
- int type;
- char *name;
-};
-
-#define type_name_fn(res) \
-char * res##_str(int type) { \
- int i; \
- for (i = 0; i < ARRAY_SIZE(res##_names); i++) { \
- if (res##_names[i].type == type) \
- return res##_names[i].name; \
- } \
- return "(invalid)"; \
-}
-
-struct type_name encoder_type_names[] = {
- { DRM_MODE_ENCODER_NONE, "none" },
- { DRM_MODE_ENCODER_DAC, "DAC" },
- { DRM_MODE_ENCODER_TMDS, "TMDS" },
- { DRM_MODE_ENCODER_LVDS, "LVDS" },
- { DRM_MODE_ENCODER_TVDAC, "TVDAC" },
-};
-
-type_name_fn(encoder_type)
-
-struct type_name connector_status_names[] = {
- { DRM_MODE_CONNECTED, "connected" },
- { DRM_MODE_DISCONNECTED, "disconnected" },
- { DRM_MODE_UNKNOWNCONNECTION, "unknown" },
-};
-
-type_name_fn(connector_status)
-
-struct type_name connector_type_names[] = {
- { DRM_MODE_CONNECTOR_Unknown, "unknown" },
- { DRM_MODE_CONNECTOR_VGA, "VGA" },
- { DRM_MODE_CONNECTOR_DVII, "DVI-I" },
- { DRM_MODE_CONNECTOR_DVID, "DVI-D" },
- { DRM_MODE_CONNECTOR_DVIA, "DVI-A" },
- { DRM_MODE_CONNECTOR_Composite, "composite" },
- { DRM_MODE_CONNECTOR_SVIDEO, "s-video" },
- { DRM_MODE_CONNECTOR_LVDS, "LVDS" },
- { DRM_MODE_CONNECTOR_Component, "component" },
- { DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN" },
- { DRM_MODE_CONNECTOR_DisplayPort, "displayport" },
- { DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" },
- { DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" },
- { DRM_MODE_CONNECTOR_TV, "TV" },
- { DRM_MODE_CONNECTOR_eDP, "embedded displayport" },
- { DRM_MODE_CONNECTOR_VIRTUAL, "Virtual" },
-};
-
-type_name_fn(connector_type)
-
-void dump_encoders(void)
-{
- drmModeEncoder *encoder;
- int i;
-
- printf("Encoders:\n");
- printf("id\tcrtc\ttype\tpossible crtcs\tpossible clones\t\n");
- for (i = 0; i < resources->count_encoders; i++) {
- encoder = drmModeGetEncoder(fd, resources->encoders[i]);
-
- if (!encoder) {
- fprintf(stderr, "could not get encoder %i: %s\n",
- resources->encoders[i], strerror(errno));
- continue;
- }
- printf("%d\t%d\t%s\t0x%08x\t0x%08x\n",
- encoder->encoder_id,
- encoder->crtc_id,
- encoder_type_str(encoder->encoder_type),
- encoder->possible_crtcs,
- encoder->possible_clones);
- drmModeFreeEncoder(encoder);
- }
- printf("\n");
-}
-
-void dump_mode(drmModeModeInfo *mode)
-{
- printf(" %s %d %d %d %d %d %d %d %d %d\n",
- mode->name,
- mode->vrefresh,
- mode->hdisplay,
- mode->hsync_start,
- mode->hsync_end,
- mode->htotal,
- mode->vdisplay,
- mode->vsync_start,
- mode->vsync_end,
- mode->vtotal);
-}
-
-static void
-dump_props(drmModeConnector *connector)
-{
- drmModePropertyPtr props;
- int i;
-
- for (i = 0; i < connector->count_props; i++) {
- props = drmModeGetProperty(fd, connector->props[i]);
- printf("\t%s, flags %d\n", props->name, props->flags);
- drmModeFreeProperty(props);
- }
-}
-
-void dump_connectors(void)
-{
- drmModeConnector *connector;
- int i, j;
-
- printf("Connectors:\n");
- printf("id\tencoder\tstatus\t\ttype\tsize (mm)\tmodes\tencoders\n");
- for (i = 0; i < resources->count_connectors; i++) {
- connector = drmModeGetConnector(fd, resources->connectors[i]);
-
- if (!connector) {
- fprintf(stderr, "could not get connector %i: %s\n",
- resources->connectors[i], strerror(errno));
- continue;
- }
-
- printf("%d\t%d\t%s\t%s\t%dx%d\t\t%d\t",
- connector->connector_id,
- connector->encoder_id,
- connector_status_str(connector->connection),
- connector_type_str(connector->connector_type),
- connector->mmWidth, connector->mmHeight,
- connector->count_modes);
-
- for (j = 0; j < connector->count_encoders; j++)
- printf("%s%d", j > 0 ? ", " : "", connector->encoders[j]);
- printf("\n");
-
- if (!connector->count_modes)
- continue;
-
- printf(" modes:\n");
- printf(" name refresh (Hz) hdisp hss hse htot vdisp "
- "vss vse vtot)\n");
- for (j = 0; j < connector->count_modes; j++)
- dump_mode(&connector->modes[j]);
-
- printf(" props:\n");
- dump_props(connector);
-
- drmModeFreeConnector(connector);
- }
- printf("\n");
-}
-
-void dump_crtcs(void)
-{
- drmModeCrtc *crtc;
- int i;
-
- printf("CRTCs:\n");
- printf("id\tfb\tpos\tsize\n");
- for (i = 0; i < resources->count_crtcs; i++) {
- crtc = drmModeGetCrtc(fd, resources->crtcs[i]);
-
- if (!crtc) {
- fprintf(stderr, "could not get crtc %i: %s\n",
- resources->crtcs[i], strerror(errno));
- continue;
- }
- printf("%d\t%d\t(%d,%d)\t(%dx%d)\n",
- crtc->crtc_id,
- crtc->buffer_id,
- crtc->x, crtc->y,
- crtc->width, crtc->height);
- dump_mode(&crtc->mode);
-
- drmModeFreeCrtc(crtc);
- }
- printf("\n");
-}
-
-void dump_framebuffers(void)
-{
- drmModeFB *fb;
- int i;
-
- printf("Frame buffers:\n");
- printf("id\tsize\tpitch\n");
- for (i = 0; i < resources->count_fbs; i++) {
- fb = drmModeGetFB(fd, resources->fbs[i]);
-
- if (!fb) {
- fprintf(stderr, "could not get fb %i: %s\n",
- resources->fbs[i], strerror(errno));
- continue;
- }
- printf("%u\t(%ux%u)\t%u\n",
- fb->fb_id,
- fb->width, fb->height,
- fb->pitch);
-
- drmModeFreeFB(fb);
- }
- printf("\n");
-}
-
-void exynos_test_dump(void)
-{
-
- printf("cmd_type = %d\n", exynos_test.cmd_type);
- printf("mem_type = %d\n", exynos_test.mem_type);
- printf("map_type = %d\n", exynos_test.map_type);
- printf("cache_type = %d\n", exynos_test.cache_type);
- printf("cache_type = %d\n", exynos_test.cache_op_type);
- printf("start_offset = 0x%lx\n", exynos_test.start_offset);
- printf("end_offset = 0x%lx\n", exynos_test.end_offset);
- printf("dmabuf_type = %d\n", exynos_test.dmabuf_type);
-}
-
-/*
- * Mode setting with the kernel interfaces is a bit of a chore.
- * First you have to find the connector in question and make sure the
- * requested mode is available.
- * Then you need to find the encoder attached to that connector so you
- * can bind it with a free crtc.
- */
-struct connector {
- uint32_t id;
- char mode_str[64];
- drmModeModeInfo *mode;
- drmModeEncoder *encoder;
- int crtc;
- unsigned int fb_id[2], current_fb_id;
- struct timeval start;
-
- int swap_count;
-};
-
-static void
-connector_find_mode(struct connector *c)
-{
- drmModeConnector *connector;
- int i, j;
-
- /* First, find the connector & mode */
- c->mode = NULL;
- for (i = 0; i < resources->count_connectors; i++) {
- connector = drmModeGetConnector(fd, resources->connectors[i]);
-
- if (!connector) {
- fprintf(stderr, "could not get connector %i: %s\n",
- resources->connectors[i], strerror(errno));
- drmModeFreeConnector(connector);
- continue;
- }
-
- if (!connector->count_modes) {
- drmModeFreeConnector(connector);
- continue;
- }
-
- if (connector->connector_id != c->id) {
- drmModeFreeConnector(connector);
- continue;
- }
-
- for (j = 0; j < connector->count_modes; j++) {
- c->mode = &connector->modes[j];
- if (!strcmp(c->mode->name, c->mode_str))
- break;
- }
-
- /* Found it, break out */
- if (c->mode)
- break;
-
- drmModeFreeConnector(connector);
- }
-
- if (!c->mode) {
- fprintf(stderr, "failed to find mode \"%s\"\n", c->mode_str);
- return;
- }
-
- /* Now get the encoder */
- for (i = 0; i < resources->count_encoders; i++) {
- c->encoder = drmModeGetEncoder(fd, resources->encoders[i]);
-
- if (!c->encoder) {
- fprintf(stderr, "could not get encoder %i: %s\n",
- resources->encoders[i], strerror(errno));
- drmModeFreeEncoder(c->encoder);
- continue;
- }
-
- if (c->encoder->encoder_id == connector->encoder_id)
- break;
-
- drmModeFreeEncoder(c->encoder);
- }
-
- if (c->crtc == -1)
- c->crtc = c->encoder->crtc_id;
-}
-
-static struct kms_bo *
-allocate_buffer(struct kms_driver *kms,
- int width, int height, int *stride)
-{
- struct kms_bo *bo;
- unsigned bo_attribs[] = {
- KMS_WIDTH, 0,
- KMS_HEIGHT, 0,
- KMS_BO_TYPE, KMS_BO_TYPE_SCANOUT_X8R8G8B8,
- KMS_TERMINATE_PROP_LIST
- };
- int ret;
-
- bo_attribs[1] = width;
- bo_attribs[3] = height;
-
- ret = kms_bo_create(kms, bo_attribs, &bo);
- if (ret) {
- fprintf(stderr, "failed to alloc buffer: %s\n",
- strerror(-ret));
- return NULL;
- }
-
- ret = kms_bo_get_prop(bo, KMS_PITCH, stride);
- if (ret) {
- fprintf(stderr, "failed to retreive buffer stride: %s\n",
- strerror(-ret));
- kms_bo_destroy(&bo);
- return NULL;
- }
-
- return bo;
-}
-
-static void
-make_pwetty(void *data, int width, int height, int stride)
-{
-#ifdef HAVE_CAIRO
- cairo_surface_t *surface;
- cairo_t *cr;
- int x, y;
-
- surface = cairo_image_surface_create_for_data(data,
- CAIRO_FORMAT_ARGB32,
- width, height,
- stride);
- cr = cairo_create(surface);
- cairo_surface_destroy(surface);
-
- cairo_set_line_cap(cr, CAIRO_LINE_CAP_SQUARE);
- for (x = 0; x < width; x += 250)
- for (y = 0; y < height; y += 250) {
- char buf[64];
-
- cairo_move_to(cr, x, y - 20);
- cairo_line_to(cr, x, y + 20);
- cairo_move_to(cr, x - 20, y);
- cairo_line_to(cr, x + 20, y);
- cairo_new_sub_path(cr);
- cairo_arc(cr, x, y, 10, 0, M_PI * 2);
- cairo_set_line_width(cr, 4);
- cairo_set_source_rgb(cr, 0, 0, 0);
- cairo_stroke_preserve(cr);
- cairo_set_source_rgb(cr, 1, 1, 1);
- cairo_set_line_width(cr, 2);
- cairo_stroke(cr);
-
- snprintf(buf, sizeof buf, "%d, %d", x, y);
- cairo_move_to(cr, x + 20, y + 20);
- cairo_text_path(cr, buf);
- cairo_set_source_rgb(cr, 0, 0, 0);
- cairo_stroke_preserve(cr);
- cairo_set_source_rgb(cr, 1, 1, 1);
- cairo_fill(cr);
- }
-
- cairo_destroy(cr);
-#endif
-}
-
-static int
-create_test_buffer(struct kms_driver *kms,
- int width, int height, int *stride_out,
- struct kms_bo **bo_out)
-{
- struct kms_bo *bo;
- int ret, i, j, stride;
- void *virtual;
-
- bo = allocate_buffer(kms, width, height, &stride);
- if (!bo)
- return -1;
-
- ret = kms_bo_map(bo, &virtual);
- if (ret) {
- fprintf(stderr, "failed to map buffer: %s\n",
- strerror(-ret));
- kms_bo_destroy(&bo);
- return -1;
- }
-
- /* paint the buffer with colored tiles */
- for (j = 0; j < height; j++) {
- uint32_t *fb_ptr = (uint32_t*)((char*)virtual + j * stride);
- for (i = 0; i < width; i++) {
- div_t d = div(i, width);
- fb_ptr[i] =
- 0x00130502 * (d.quot >> 6) +
- 0x000a1120 * (d.rem >> 6);
- }
- }
-
- make_pwetty(virtual, width, height, stride);
-
- kms_bo_unmap(bo);
-
- *bo_out = bo;
- *stride_out = stride;
- return 0;
-}
-
-static int
-create_grey_buffer(struct kms_driver *kms,
- int width, int height, int *stride_out,
- struct kms_bo **bo_out)
-{
- struct kms_bo *bo;
- int size, ret, stride;
- void *virtual;
-
- bo = allocate_buffer(kms, width, height, &stride);
- if (!bo)
- return -1;
-
- ret = kms_bo_map(bo, &virtual);
- if (ret) {
- fprintf(stderr, "failed to map buffer: %s\n",
- strerror(-ret));
- kms_bo_destroy(&bo);
- return -1;
- }
-
- size = stride * height;
- memset(virtual, 0x77, size);
- kms_bo_unmap(bo);
-
- *bo_out = bo;
- *stride_out = stride;
-
- return 0;
-}
-
-void
-page_flip_handler(int fd, unsigned int frame,
- unsigned int sec, unsigned int usec, void *data)
-{
- struct connector *c;
- unsigned int new_fb_id;
- struct timeval end;
- double t;
-
- c = data;
- if (c->current_fb_id == c->fb_id[0])
- new_fb_id = c->fb_id[1];
- else
- new_fb_id = c->fb_id[0];
-
- drmModePageFlip(fd, c->crtc, new_fb_id,
- DRM_MODE_PAGE_FLIP_EVENT, c);
- c->current_fb_id = new_fb_id;
- c->swap_count++;
- if (c->swap_count == 60) {
- gettimeofday(&end, NULL);
- t = end.tv_sec + end.tv_usec * 1e-6 -
- (c->start.tv_sec + c->start.tv_usec * 1e-6);
- fprintf(stderr, "freq: %.02fHz\n", c->swap_count / t);
- c->swap_count = 0;
- c->start = end;
- }
-}
-
-static int exynos_gem_map_offset(int fd, struct drm_exynos_gem_map_off *map_off)
-{
- int ret;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_GEM_MAP_OFFSET, map_off);
- if (ret < 0) {
- fprintf(stderr, "failed to get buffer offset: %s\n",
- strerror(-ret));
- return ret;
- }
-
- return 0;
-}
-
-static int exynos_gem_get_ump(int fd, struct drm_exynos_gem_ump *gem_ump)
-{
- int ret;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_GEM_EXPORT_UMP, gem_ump);
- if (ret < 0) {
- fprintf(stderr, "failed to get ump: %s\n",
- strerror(-ret));
- return ret;
- }
-
- return 0;
-}
-
-static int exynos_gem_cache_op(int fd,
- struct drm_exynos_gem_cache_op *cache_op)
-{
- int ret;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_GEM_CACHE_OP, cache_op);
- if (ret < 0) {
- fprintf(stderr, "failed to cache operation: %s\n",
- strerror(-ret));
- return ret;
- }
-
- return 0;
-}
-
-static int exynos_gem_get_phy(int fd,
- struct drm_exynos_gem_get_phy *get_phy)
-{
- int ret;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_GEM_GET_PHY, get_phy);
- if (ret < 0) {
- fprintf(stderr, "failed to get physical address: %s\n",
- strerror(-ret));
- return ret;
- }
-
- return 0;
-}
-
-static int exynos_gem_phy_imp(int fd,
- struct drm_exynos_gem_phy_imp *phy_imp)
-{
- int ret;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_GEM_PHY_IMP, phy_imp);
- if (ret < 0) {
- fprintf(stderr, "failed to import physical memory to gem: %s\n",
- strerror(-ret));
- return ret;
- }
-
- return 0;
-}
-
-static void
-set_mode(struct connector *c, int count, int page_flip)
-{
- struct kms_driver *kms;
- struct kms_bo *bo, *other_bo;
- unsigned int fb_id, other_fb_id;
- int i, ret, width, height, x, stride;
- unsigned handle;
- drmEventContext evctx;
-
- width = 0;
- height = 0;
- for (i = 0; i < count; i++) {
- connector_find_mode(&c[i]);
- if (c[i].mode == NULL)
- continue;
- width += c[i].mode->hdisplay;
- if (height < c[i].mode->vdisplay)
- height = c[i].mode->vdisplay;
- }
-
- ret = kms_create(fd, &kms);
- if (ret) {
- fprintf(stderr, "failed to create kms driver: %s\n",
- strerror(-ret));
- return;
- }
-
- if (create_test_buffer(kms, width, height, &stride, &bo))
- return;
-
- kms_bo_get_prop(bo, KMS_HANDLE, &handle);
- ret = drmModeAddFB(fd, width, height, 24, 32, stride, handle, &fb_id);
- if (ret) {
- fprintf(stderr, "failed to add fb (%ux%u): %s\n",
- width, height, strerror(errno));
- return;
- }
-
- x = 0;
- for (i = 0; i < count; i++) {
- if (c[i].mode == NULL)
- continue;
-
- printf("setting mode %s on connector %d, crtc %d\n",
- c[i].mode_str, c[i].id, c[i].crtc);
-
- ret = drmModeSetCrtc(fd, c[i].crtc, fb_id, x, 0,
- &c[i].id, 1, c[i].mode);
-
- /* XXX: Actually check if this is needed */
- drmModeDirtyFB(fd, fb_id, NULL, 0);
-
- x += c[i].mode->hdisplay;
-
- if (ret) {
- fprintf(stderr, "failed to set mode: %s\n", strerror(errno));
- return;
- }
- }
-
- if (!page_flip)
- return;
-
- if (create_grey_buffer(kms, width, height, &stride, &other_bo))
- return;
-
- kms_bo_get_prop(other_bo, KMS_HANDLE, &handle);
- ret = drmModeAddFB(fd, width, height, 32, 32, stride, handle,
- &other_fb_id);
- if (ret) {
- fprintf(stderr, "failed to add fb: %s\n", strerror(errno));
- return;
- }
-
- for (i = 0; i < count; i++) {
- if (c[i].mode == NULL)
- continue;
-
- ret = drmModePageFlip(fd, c[i].crtc, other_fb_id,
- DRM_MODE_PAGE_FLIP_EVENT, &c[i]);
- if (ret) {
- fprintf(stderr, "failed to page flip: %s\n", strerror(errno));
- return;
- }
- gettimeofday(&c[i].start, NULL);
- c[i].swap_count = 0;
- c[i].fb_id[0] = fb_id;
- c[i].fb_id[1] = other_fb_id;
- c[i].current_fb_id = other_fb_id;
- }
-
- memset(&evctx, 0, sizeof evctx);
- evctx.version = DRM_EVENT_CONTEXT_VERSION;
- evctx.vblank_handler = NULL;
- evctx.page_flip_handler = page_flip_handler;
-
- while (1) {
-#if 0
- struct pollfd pfd[2];
-
- pfd[0].fd = 0;
- pfd[0].events = POLLIN;
- pfd[1].fd = fd;
- pfd[1].events = POLLIN;
-
- if (poll(pfd, 2, -1) < 0) {
- fprintf(stderr, "poll error\n");
- break;
- }
-
- if (pfd[0].revents)
- break;
-#else
- struct timeval timeout = { .tv_sec = 3, .tv_usec = 0 };
- fd_set fds;
- int ret;
-
- FD_ZERO(&fds);
- FD_SET(0, &fds);
- FD_SET(fd, &fds);
- ret = select(fd + 1, &fds, NULL, NULL, &timeout);
-
- if (ret <= 0) {
- fprintf(stderr, "select timed out or error (ret %d)\n",
- ret);
- continue;
- } else if (FD_ISSET(0, &fds)) {
- break;
- }
-#endif
-
- drmHandleEvent(fd, &evctx);
- }
-
- kms_bo_destroy(&bo);
- kms_bo_destroy(&other_bo);
- kms_destroy(&kms);
-}
-
-extern char *optarg;
-extern int optind, opterr, optopt;
-static char optstr[] = "ecpmfs:t:v";
-
-void usage(char *name)
-{
- fprintf(stderr, "usage: %s [-ecpmfst]\n", name);
- fprintf(stderr, "\t-e\tlist encoders\n");
- fprintf(stderr, "\t-c\tlist connectors\n");
- fprintf(stderr, "\t-p\tlist CRTCs (pipes)\n");
- fprintf(stderr, "\t-m\tlist modes\n");
- fprintf(stderr, "\t-f\tlist framebuffers\n");
- fprintf(stderr, "\t-v\ttest vsynced page flipping\n");
- fprintf(stderr, "\t-s <connector_id>:<mode>\tset a mode\n");
- fprintf(stderr, "\t-s <connector_id>@<crtc_id>:<mode>\tset a mode\n");
- fprintf(stderr, "\t-t <command_type:allocation_type:cache_attr>\tsetup gem allocation\n");
- fprintf(stderr, "\t-t <command_type:cache_type:cache_operation>\tsetup cache operation\n");
- fprintf(stderr, "\t-t <command_type:dmabuf:dmabuf_type>\tsetup drm prime or ump dmabuf\n");
- fprintf(stderr, "\n\tcommand line sentences to -t option\n");
- fprintf(stderr, "\t-t alloc:[contig,noncontig,userptr]:[cache,noncache,writecombine]\n");
- fprintf(stderr, "\t-t cache:[l1,l2,all]:[flush_range,clean_range,inv_range,flush_all,clean_all,inv_all]\n");
- fprintf(stderr, "\t-t [prime,ump]:dmabuf:[export,import,all]\n");
- fprintf(stderr, "\n\tDefault is to dump all info.\n");
- exit(0);
-}
-
-#define dump_resource(res) if (res) dump_##res()
-
-static int page_flipping_supported(int fd)
-{
- /*FIXME: generic ioctl needed? */
- return 1;
-#if 0
- int ret, value;
- struct drm_i915_getparam gp;
-
- gp.param = I915_PARAM_HAS_PAGEFLIPPING;
- gp.value = &value;
-
- ret = drmCommandWriteRead(fd, DRM_I915_GETPARAM, &gp, sizeof(gp));
- if (ret) {
- fprintf(stderr, "drm_i915_getparam: %m\n");
- return 0;
- }
-
- return *gp.value;
-#endif
-}
-
-static void test_exynos_gem(struct connector *c, int count, int page_flip)
-{
- struct drm_exynos_gem_map_off map_off1;
-
- struct drm_exynos_gem_cache_op cache_op;
-
- struct ump_uk_dmabuf ump_dmabuf;
- int ump_fd;
-
- void *vaddr;
-
- struct kms_driver *kms;
- struct kms_bo *other_bo;
- int i, ret, width, height, x, stride;
- unsigned int fb_id, other_fb_id;
- uint32_t handle;
- drmEventContext evctx;
- void *usr_addr1;
- int prime_fd;
-
- struct exynos_device *dev;
- struct exynos_bo *bo;
- unsigned int gem_size, gem_flags;
-
-#if 0
-#ifdef UMP_TEST
- struct drm_exynos_gem_ump gem_ump;
-#endif
-#ifdef GET_PHY_TEST
- /* temporary codes. */
- struct drm_exynos_gem_get_phy get_phy;
- struct drm_exynos_gem_phy_imp phy_imp;
-#endif
-#ifdef VIDI_TEST
- struct drm_exynos_vidi_connection vidi;
-#endif
-#ifdef GEMGET_TEST
- struct drm_exynos_gem_info info;
-#endif
-#ifdef VIDI_TEST
- vidi.connection = 1;
- exynos_vidi_connection(fd, &vidi);
-#endif
-#endif
-
- dev = exynos_device_create(fd);
- if (!dev)
- return;
-
- exynos_test_dump();
-
- width = 0;
- height = 0;
- for (i = 0; i < count; i++) {
- connector_find_mode(&c[i]);
- if (c[i].mode == NULL)
- continue;
- width += c[i].mode->hdisplay;
- if (height < c[i].mode->vdisplay)
- height = c[i].mode->vdisplay;
- }
-
- if (exynos_test.cmd_type & CMD_ALLOC) {
- if (exynos_test.mem_type & ALLOC_USERPTR) {
- vaddr = malloc(DEFAULT_SIZE);
- if (!vaddr)
- return;
-
- ret = exynos_userptr(dev, vaddr, DEFAULT_SIZE, &handle);
- if (ret < 0)
- return;
-
- usr_addr1 = vaddr;
- printf("userptr handle = %d\n", handle);
- } else {
- unsigned int flags;
-
- /* flag memory type. */
- if (exynos_test.mem_type & ALLOC_CONTIG)
- flags = EXYNOS_BO_CONTIG;
- else
- flags = EXYNOS_BO_NONCONTIG;
-
- /* flag cache mapping type. */
- if (exynos_test.map_type & ALLOC_MAP_C)
- flags |= EXYNOS_BO_CACHABLE;
- else if (exynos_test.map_type & ALLOC_MAP_NC)
- flags |= EXYNOS_BO_NONCACHABLE;
- else
- flags |= EXYNOS_BO_WC;
-
- bo = exynos_bo_create(dev, DEFAULT_SIZE, flags);
- if (!bo)
- return;
-
- handle = bo->handle;
-
- printf("gem handle = %d\n", bo->handle);
- }
- }
-
-#ifdef DIRECT_MAP
- if (!(exynos_test.mem_type & ALLOC_USERPTR)) {
- printf("handle = %d, size = 0x%x\n", bo->handle, bo->size);
-
- usr_addr1 = exynos_bo_map(bo);
- if (!usr_addr1)
- return;
-
- memset(usr_addr1, 0x88, bo->size);
- }
-#endif
-#ifdef INDIRECT_MAP
- /* FIXME */
- if (!(exynos_test.mem_type & ALLOC_USERPTR)) {
- map_off1.handle = handle;
-
- /* get map offset. */
- ret = exynos_gem_map_offset(fd, &map_off1);
- if (ret < 0)
- return;
-
- usr_addr1 = mmap(0, gem1.size, PROT_READ | PROT_WRITE,
- MAP_SHARED, fd, map_off1.offset);
-
- memset(usr_addr1, 0x88, gem1.size);
- }
-#endif
-
- if (exynos_test.cmd_type & CMD_CACHE) {
- cache_op.flags = 0;
-
- /* flag cache units to do cache operation. */
- if (exynos_test.cache_type & CACHE_L1)
- cache_op.flags |= EXYNOS_DRM_L1_CACHE;
- if (exynos_test.cache_type & CACHE_L2)
- cache_op.flags |= EXYNOS_DRM_L2_CACHE;
- if (exynos_test.cache_type & CACHE_ALL_CORES)
- cache_op.flags |= EXYNOS_DRM_ALL_CORES;
-
- /* flag cache operations. */
- if (exynos_test.cache_op_type & CACHE_CLEAN_RANGE)
- cache_op.flags |= EXYNOS_DRM_CACHE_CLN_RANGE;
- if (exynos_test.cache_op_type & CACHE_INV_RANGE)
- cache_op.flags |= EXYNOS_DRM_CACHE_INV_RANGE;
- if (!(exynos_test.cache_op_type & CACHE_CLEAN_RANGE)) {
- cache_op.flags &= ~EXYNOS_DRM_CACHE_CLN_RANGE;
- cache_op.flags |= EXYNOS_DRM_CACHE_CLN_ALL;
- }
- if (!(exynos_test.cache_op_type & CACHE_INV_RANGE)) {
- cache_op.flags &= ~EXYNOS_DRM_CACHE_INV_RANGE;
- cache_op.flags |= EXYNOS_DRM_CACHE_INV_ALL;
- }
-
- cache_op.usr_addr = usr_addr1 + exynos_test.start_offset;
- cache_op.size = exynos_test.end_offset -
- exynos_test.start_offset;
-
- exynos_gem_cache_op(fd, &cache_op);
- }
-
-#ifdef GEMGET_TEST
- ret = exynos_bo_gem_info(dev, bo->handle, &gem_size, &gem_flags);
- if (ret < 0)
- return;
-
- printf("[gem get] flags = 0x%x, size = 0x%x\n", gem_flags, gem_size);
-#endif
-
- if (exynos_test.cmd_type & CMD_PRIME) {
- if (exynos_test.dmabuf_type & DMABUF_EXPORT) {
- ret = exynos_prime_handle_to_fd(dev, bo->handle,
- &prime_fd);
- if (ret < 0)
- return;
-
- printf("handle to fd : handle(0x%x) ==> fd(%d)\n",
- bo->handle,
- prime_fd);
- }
-
- if (exynos_test.dmabuf_type & DMABUF_IMPORT) {
- uint32_t gem_handle;
-
- ret = exynos_prime_fd_to_handle(dev, prime_fd, &gem_handle);
- if (ret < 0)
- return;
-
- printf("fd to handle : fd(%d) ==> handle(0x%x)\n",
- prime_fd,
- gem_handle);
- }
- }
-
- if (exynos_test.cmd_type & CMD_UMP) {
- ump_fd = open("/dev/ump", O_RDWR);
- if (ump_fd < 0) {
- printf("failed to open ump.\n");
- return;
- }
-
- memset(&ump_dmabuf, 0, sizeof(struct ump_uk_dmabuf));
-
- if (exynos_test.dmabuf_type & DMABUF_IMPORT) {
- ump_dmabuf.fd = prime_fd;
- ret = ioctl(ump_fd, UMP_IOC_DMABUF_IMPORT, &ump_dmabuf);
- if (ret < 0) {
- printf("failed to ioctl ump.\n");
- return;
- }
-
- printf("ump handle = 0x%x\n", ump_dmabuf.ump_handle);
- }
-
- close(ump_fd);
- }
-
-#if 0
-#ifdef GET_PHY_TEST
- memset(&get_phy, 0, sizeof(struct drm_exynos_gem_get_phy));
- get_phy.gem_handle = handle;
- exynos_gem_get_phy(fd, &get_phy);
- printf("get_phy->phy_addr = 0x%llx, get_phy->size = 0x%llx\n",
- get_phy.phy_addr, get_phy.size);
-
- memset(&phy_imp, 0, sizeof(struct drm_exynos_gem_phy_imp));
- phy_imp.phy_addr = get_phy.phy_addr;
- phy_imp.size = get_phy.size;
- exynos_gem_phy_imp(fd, &phy_imp);
- printf("phy_imp->handle = 0x%x\n", phy_imp.gem_handle);
-#endif
-
-#ifdef UMP_TEST
- /* get secure id for ump. */
- gem_ump.gem_handle = handle;
-
- exynos_gem_get_ump(fd, &gem_ump);
-
- printf("secure id = %d\n", gem_ump.secure_id);
-#endif
-#endif
- stride = width * 4;
-
- ret = drmModeAddFB(fd, width, height, 32, 32, stride, handle, &fb_id);
- if (ret) {
- fprintf(stderr, "failed to add fb: %s\n", strerror(errno));
- goto err;
- }
-
- x = 0;
- for (i = 0; i < count; i++) {
- if (c[i].mode == NULL)
- continue;
-
- printf("setting mode %s on connector %d, crtc %d\n",
- c[i].mode_str, c[i].id, c[i].crtc);
-
- ret = drmModeSetCrtc(fd, c[i].crtc, fb_id, x, 0,
- &c[i].id, 1, c[i].mode);
-
- /* XXX: Actually check if this is needed */
- drmModeDirtyFB(fd, fb_id, NULL, 0);
-
- x += c[i].mode->hdisplay;
-
- if (ret) {
- fprintf(stderr, "failed to set mode: %s\n", strerror(errno));
- return;
- }
- }
-
- if (!page_flip)
- return;
-
- ret = kms_create(fd, &kms);
- if (ret) {
- fprintf(stderr, "failed to create kms driver: %s\n",
- strerror(-ret));
- return;
- }
-
- if (create_test_buffer(kms, width, height, &stride, &other_bo))
- return;
-
- kms_bo_get_prop(other_bo, KMS_HANDLE, &handle);
- ret = drmModeAddFB(fd, width, height, 32, 32, stride, handle,
- &other_fb_id);
- if (ret) {
- fprintf(stderr, "failed to add fb: %s\n", strerror(errno));
- return;
- }
-
- for (i = 0; i < count; i++) {
- if (c[i].mode == NULL)
- continue;
-
- ret = drmModePageFlip(fd, c[i].crtc, other_fb_id,
- DRM_MODE_PAGE_FLIP_EVENT, &c[i]);
- if (ret) {
- fprintf(stderr, "failed to page flip: %s\n", strerror(errno));
- return;
- }
- gettimeofday(&c[i].start, NULL);
- c[i].swap_count = 0;
- c[i].fb_id[0] = fb_id;
- c[i].fb_id[1] = other_fb_id;
- c[i].current_fb_id = other_fb_id;
- }
-
- memset(&evctx, 0, sizeof evctx);
- evctx.version = DRM_EVENT_CONTEXT_VERSION;
- evctx.vblank_handler = NULL;
- evctx.page_flip_handler = page_flip_handler;
-
- while (1) {
- struct timeval timeout = { .tv_sec = 3, .tv_usec = 0 };
- fd_set fds;
- int ret;
-
- FD_ZERO(&fds);
- FD_SET(0, &fds);
- FD_SET(fd, &fds);
- ret = select(fd + 1, &fds, NULL, NULL, &timeout);
-
- if (ret <= 0) {
- fprintf(stderr, "select timed out or error (ret %d)\n",
- ret);
- continue;
- } else if (FD_ISSET(0, &fds)) {
- break;
- }
-
- drmHandleEvent(fd, &evctx);
- }
-
- kms_bo_destroy(&other_bo);
- kms_destroy(&kms);
-
-err:
- if (exynos_test.mem_type == ALLOC_USERPTR) {
- struct drm_gem_close gem_close;
-
- gem_close.handle = handle;
-
- free(usr_addr1);
- drmIoctl(fd, DRM_IOCTL_GEM_CLOSE, &gem_close);
- } else
- exynos_bo_destroy(bo);
-}
-
-
-static int setup_exynos_gem_map_type(void)
-{
- if (strncmp(exynos_test.scmd[2], "cache", 5) == 0)
- exynos_test.map_type = ALLOC_MAP_C;
- else if (strncmp(exynos_test.scmd[2], "noncache", 8) == 0)
- exynos_test.map_type = ALLOC_MAP_NC;
- else if (strncmp(exynos_test.scmd[2], "writecombine", 12) == 0)
- exynos_test.map_type = ALLOC_MAP_WC;
- else {
- printf("invalid map type.\n");
- return -EINVAL;
- }
-
- return 0;
-}
-
-static int setup_exynos_gem_cache_op_type(void)
-{
- if (strncmp(exynos_test.scmd[2], "clean_range", 11) == 0)
- exynos_test.cache_op_type |= CACHE_CLEAN_RANGE;
- else if (strncmp(exynos_test.scmd[2], "inv_range", 9) == 0)
- exynos_test.cache_op_type |= CACHE_INV_RANGE;
- else if (strncmp(exynos_test.scmd[2], "flush_range", 11) == 0)
- exynos_test.cache_op_type |= CACHE_FLUSH_RANGE;
- else if (strncmp(exynos_test.scmd[2], "clean_all", 9) == 0)
- exynos_test.cache_op_type &= ~CACHE_CLEAN_RANGE; /* all */
- else if (strncmp(exynos_test.scmd[2], "inv_all", 7) == 0)
- exynos_test.cache_op_type &= ~CACHE_INV_RANGE; /* all */
- else if (strncmp(exynos_test.scmd[2], "flush_all", 9) == 0)
- exynos_test.cache_op_type &= ~CACHE_FLUSH_RANGE; /* all */
- else {
- printf("invalid cache op type.\n");
- return -EINVAL;
- }
-
- return 0;
-}
-
-static int setup_exynos_gem_dmabuf_type(void)
-{
- if (strncmp(exynos_test.scmd[2], "export", 6) == 0)
- exynos_test.dmabuf_type |= DMABUF_EXPORT;
- else if (strncmp(exynos_test.scmd[2], "import", 6) == 0)
- exynos_test.dmabuf_type |= DMABUF_IMPORT;
- else if (strncmp(exynos_test.scmd[2], "all", 3) == 0)
- exynos_test.dmabuf_type |= DMABUF_ALL;
- else {
- printf("invalid dmabuf type.\n");
- return -EINVAL;
- }
-
- return 0;
-}
-
-static int setup_exynos_gem_test(void)
-{
- if (strncmp(exynos_test.scmd[0], "alloc", 5) == 0) {
- exynos_test.cmd_type |= CMD_ALLOC;
-
- if (strncmp(exynos_test.scmd[1], "contig", 5) == 0)
- exynos_test.mem_type = ALLOC_CONTIG;
- else if (strncmp(exynos_test.scmd[1], "noncontig", 8) == 0)
- exynos_test.mem_type = ALLOC_NONCONTIG;
- else if (strncmp(exynos_test.scmd[1], "userptr", 7) == 0)
- exynos_test.mem_type = ALLOC_USERPTR;
- else {
- printf("invalid option type.\n");
- return -EINVAL;
- }
-
- return setup_exynos_gem_map_type();
- } else if (strncmp(exynos_test.scmd[0], "cache", 5) == 0) {
- exynos_test.cmd_type |= CMD_CACHE;
-
- if (strncmp(exynos_test.scmd[1], "l1", 2) == 0) {
- exynos_test.cache_type |= CACHE_L1;
- } else if (strncmp(exynos_test.scmd[1], "l2", 2) == 0) {
- exynos_test.cache_type |= CACHE_L2;
- } else if (strncmp(exynos_test.scmd[1], "all", 3) == 0) {
- exynos_test.cache_type |= CACHE_ALL_CACHES;
- } else if (strncmp(exynos_test.scmd[1], "all_cores", 9) == 0) {
- exynos_test.cache_type |= CACHE_ALL_CACHES_CORES;
- } else {
- printf("invalid option type.\n");
- return -EINVAL;
- }
-
- return setup_exynos_gem_cache_op_type();
- } else if ((strncmp(exynos_test.scmd[0], "prime", 5) == 0) ||
- (strncmp(exynos_test.scmd[0], "ump", 3) == 0)) {
- exynos_test.cmd_type |= (strncmp(exynos_test.scmd[0],
- "prime", 5) == 0) ?
- CMD_PRIME : CMD_UMP;
-
- if (strncmp(exynos_test.scmd[1], "dmabuf", 6) == 0)
- return setup_exynos_gem_dmabuf_type();
- else {
- printf("invalid option type.\n");
- return -EINVAL;
- }
- } else {
- printf("invalid command type.\n");
- return -EINVAL;
- }
-
- return 0;
-}
-
-int main(int argc, char **argv)
-{
- int c;
- int encoders = 0, connectors = 0, crtcs = 0, framebuffers = 0;
- int test_vsync = 0;
- char *modules[] = { "exynos", "i915", "radeon", "nouveau" };
- char *modeset = NULL;
- int i, count = 0, private_test = 0, cmd_cnt = 0, ret = 0;
- struct connector con_args[2];
-
- opterr = 0;
-
- while ((c = getopt(argc, argv, optstr)) != -1) {
- switch (c) {
- case 'e':
- encoders = 1;
- break;
- case 'c':
- connectors = 1;
- break;
- case 'p':
- crtcs = 1;
- break;
- case 'm':
- modes = 1;
- break;
- case 'f':
- framebuffers = 1;
- break;
- case 'v':
- test_vsync = 1;
- break;
- case 's':
- modeset = strdup(optarg);
- con_args[count].crtc = -1;
- if (sscanf(optarg, "%d:%64s",
- &con_args[count].id,
- con_args[count].mode_str) != 2 &&
- sscanf(optarg, "%d@%d:%64s",
- &con_args[count].id,
- &con_args[count].crtc,
- con_args[count].mode_str) != 3)
- usage(argv[0]);
- count++;
- break;
- case 't':
- modeset = strdup(optarg);
- exynos_test.scmd[cmd_cnt++] = strtok(modeset, ":~");
- while (exynos_test.scmd[cmd_cnt++] = strtok(NULL, ":~"));
-
- cmd_cnt--;
- if (cmd_cnt != 3 && cmd_cnt != 5)
- usage(argv[0]);
-
- ret = setup_exynos_gem_test();
- if (ret < 0)
- return ret;
-
- private_test = 1;
- cmd_cnt = 0;
- break;
- default:
- usage(argv[0]);
- break;
- }
- }
-
- if (argc == 1)
- encoders = connectors = crtcs = modes = framebuffers = 1;
-
- for (i = 0; i < ARRAY_SIZE(modules); i++) {
- printf("trying to load module %s...", modules[i]);
- fd = drmOpen(modules[i], NULL);
- if (fd < 0) {
- printf("failed.\n");
- } else {
- printf("success.\n");
- break;
- }
- }
-
- if (test_vsync && !page_flipping_supported(fd)) {
- fprintf(stderr, "page flipping not supported by drm.\n");
- return -1;
- }
-
- if (i == ARRAY_SIZE(modules)) {
- fprintf(stderr, "failed to load any modules, aborting.\n");
- return -1;
- }
-
- resources = drmModeGetResources(fd);
- if (!resources) {
- fprintf(stderr, "drmModeGetResources failed: %s\n",
- strerror(errno));
- drmClose(fd);
- return 1;
- }
-
- dump_resource(encoders);
- dump_resource(connectors);
- dump_resource(crtcs);
- dump_resource(framebuffers);
-
- if (count > 0) {
- if (private_test)
- test_exynos_gem(con_args, count, test_vsync);
- else
- set_mode(con_args, count, test_vsync);
-
- getchar();
- }
-
- drmModeFreeResources(resources);
-
- return 0;
-}
+++ /dev/null
-/*
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2010 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- */
-
-/**
- * @file ump.h
- *
- * This file contains the user space part of the UMP API.
- */
-
-#ifndef _UNIFIED_MEMORY_PROVIDER_H_
-#define _UNIFIED_MEMORY_PROVIDER_H_
-
-
-/** @defgroup ump_user_space_api UMP User Space API
- * @{ */
-
-
-#include "ump_platform.h"
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/**
- * External representation of a UMP handle in user space.
- */
-typedef void * ump_handle;
-
-/**
- * Typedef for a secure ID, a system wide identificator for UMP memory buffers.
- */
-typedef unsigned int ump_secure_id;
-
-/**
- * Value to indicate an invalid UMP memory handle.
- */
-#define UMP_INVALID_MEMORY_HANDLE ((ump_handle)0)
-
-/**
- * Value to indicate an invalid secure Id.
- */
-#define UMP_INVALID_SECURE_ID ((ump_secure_id)-1)
-
-/**
- * UMP error codes for user space.
- */
-typedef enum
-{
- UMP_OK, /**< indicates success */
- UMP_ERROR, /**< indicates failure */
-} ump_result;
-
-
-/**
- * Opens and initializes the UMP library.
- *
- * This function must be called at least once before calling any other UMP API functions.
- * Each open is reference counted and must be matched with a call to @ref ump_close "ump_close".
- *
- * @see ump_close
- *
- * @return UMP_OK indicates success, UMP_ERROR indicates failure.
- */
-UMP_API_EXPORT ump_result ump_open(void);
-
-
-/**
- * Terminate the UMP library.
- *
- * This must be called once for every successful @ref ump_open "ump_open". The UMP library is
- * terminated when, and only when, the last open reference to the UMP interface is closed.
- *
- * @see ump_open
- */
-UMP_API_EXPORT void ump_close(void);
-
-
-/**
- * Retrieves the secure ID for the specified UMP memory.
- *
- * This identificator is unique across the entire system, and uniquely identifies
- * the specified UMP memory. This identificator can later be used through the
- * @ref ump_handle_create_from_secure_id "ump_handle_create_from_secure_id" or
- * @ref ump_dd_handle_create_from_secure_id "ump_dd_handle_create_from_secure_id"
- * functions in order to access this UMP memory, for instance from another process.
- *
- * @note There is a kernel space equivalent function called @ref ump_dd_secure_id_get "ump_dd_secure_id_get"
- *
- * @see ump_handle_create_from_secure_id
- * @see ump_dd_handle_create_from_secure_id
- * @see ump_dd_secure_id_get
- *
- * @param mem Handle to UMP memory.
- *
- * @return Returns the secure ID for the specified UMP memory.
- */
-UMP_API_EXPORT ump_secure_id ump_secure_id_get(ump_handle mem);
-
-
-/**
- * Retrieves a handle to allocated UMP memory.
- *
- * The usage of UMP memory is reference counted, so this will increment the reference
- * count by one for the specified UMP memory.
- * Use @ref ump_reference_release "ump_reference_release" when there is no longer any
- * use for the retrieved handle.
- *
- * @note There is a kernel space equivalent function called @ref ump_dd_handle_create_from_secure_id "ump_dd_handle_create_from_secure_id"
- *
- * @see ump_reference_release
- * @see ump_dd_handle_create_from_secure_id
- *
- * @param secure_id The secure ID of the UMP memory to open, that can be retrieved using the @ref ump_secure_id_get "ump_secure_id_get " function.
- *
- * @return UMP_INVALID_MEMORY_HANDLE indicates failure, otherwise a valid handle is returned.
- */
-UMP_API_EXPORT ump_handle ump_handle_create_from_secure_id(ump_secure_id secure_id);
-
-
-/**
- * Retrieves the actual size of the specified UMP memory.
- *
- * The size is reported in bytes, and is typically page aligned.
- *
- * @note There is a kernel space equivalent function called @ref ump_dd_size_get "ump_dd_size_get"
- *
- * @see ump_dd_size_get
- *
- * @param mem Handle to UMP memory.
- *
- * @return Returns the allocated size of the specified UMP memory, in bytes.
- */
-UMP_API_EXPORT unsigned long ump_size_get(ump_handle mem);
-
-
-/**
- * Read from specified UMP memory.
- *
- * Another way of reading from (and writing to) UMP memory is to use the
- * @ref ump_mapped_pointer_get "ump_mapped_pointer_get" to retrieve
- * a CPU mapped pointer to the memory.
- *
- * @see ump_mapped_pointer_get
- *
- * @param dst Destination buffer.
- * @param src Handle to UMP memory to read from.
- * @param offset Where to start reading, given in bytes.
- * @param length How much to read, given in bytes.
- */
-UMP_API_EXPORT void ump_read(void * dst, ump_handle src, unsigned long offset, unsigned long length);
-
-
-/**
- * Write to specified UMP memory.
- *
- * Another way of writing to (and reading from) UMP memory is to use the
- * @ref ump_mapped_pointer_get "ump_mapped_pointer_get" to retrieve
- * a CPU mapped pointer to the memory.
- *
- * @see ump_mapped_pointer_get
- *
- * @param dst Handle to UMP memory to write to.
- * @param offset Where to start writing, given in bytes.
- * @param src Buffer to read from.
- * @param length How much to write, given in bytes.
- */
-UMP_API_EXPORT void ump_write(ump_handle dst, unsigned long offset, const void * src, unsigned long length);
-
-
-/**
- * Retrieves a memory mapped pointer to the specified UMP memory.
- *
- * This function retrieves a memory mapped pointer to the specified UMP memory,
- * that can be used by the CPU. Every successful call to
- * @ref ump_mapped_pointer_get "ump_mapped_pointer_get" is reference counted,
- * and must therefor be followed by a call to
- * @ref ump_mapped_pointer_release "ump_mapped_pointer_release " when the
- * memory mapping is no longer needed.
- *
- * @note Systems without a MMU for the CPU only return the physical address, because no mapping is required.
- *
- * @see ump_mapped_pointer_release
- *
- * @param mem Handle to UMP memory.
- *
- * @return NULL indicates failure, otherwise a CPU mapped pointer is returned.
- */
-UMP_API_EXPORT void * ump_mapped_pointer_get(ump_handle mem);
-
-
-/**
- * Releases a previously mapped pointer to the specified UMP memory.
- *
- * The CPU mapping of the specified UMP memory memory is reference counted,
- * so every call to @ref ump_mapped_pointer_get "ump_mapped_pointer_get" must
- * be matched with a call to this function when the mapping is no longer needed.
- *
- * The CPU mapping is not removed before all references to the mapping is released.
- *
- * @note Systems without a MMU must still implement this function, even though no unmapping should be needed.
- *
- * @param mem Handle to UMP memory.
- */
-UMP_API_EXPORT void ump_mapped_pointer_release(ump_handle mem);
-
-
-/**
- * Adds an extra reference to the specified UMP memory.
- *
- * This function adds an extra reference to the specified UMP memory. This function should
- * be used every time a UMP memory handle is duplicated, that is, assigned to another ump_handle
- * variable. The function @ref ump_reference_release "ump_reference_release" must then be used
- * to release each copy of the UMP memory handle.
- *
- * @note You are not required to call @ref ump_reference_add "ump_reference_add"
- * for UMP handles returned from
- * @ref ump_handle_create_from_secure_id "ump_handle_create_from_secure_id",
- * because these handles are already reference counted by this function.
- *
- * @note There is a kernel space equivalent function called @ref ump_dd_reference_add "ump_dd_reference_add"
- *
- * @see ump_dd_reference_add
- *
- * @param mem Handle to UMP memory.
- */
-UMP_API_EXPORT void ump_reference_add(ump_handle mem);
-
-
-/**
- * Releases a reference from the specified UMP memory.
- *
- * This function should be called once for every reference to the UMP memory handle.
- * When the last reference is released, all resources associated with this UMP memory
- * handle are freed.
- *
- * @note There is a kernel space equivalent function called @ref ump_dd_reference_release "ump_dd_reference_release"
- *
- * @see ump_dd_reference_release
- *
- * @param mem Handle to UMP memory.
- */
-UMP_API_EXPORT void ump_reference_release(ump_handle mem);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-/** @} */ /* end group ump_user_space_api */
-
-
-#endif /*_UNIFIED_MEMORY_PROVIDER_H_ */
+++ /dev/null
-/*
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2008-2010 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- */
-
-/**
- * @file ump_platform.h
- *
- * This file should define UMP_API_EXPORT,
- * which dictates how the UMP user space API should be exported/imported.
- * Modify this file, if needed, to match your platform setup.
- */
-
-#ifndef __UMP_PLATFORM_H__
-#define __UMP_PLATFORM_H__
-
-/** @addtogroup ump_user_space_api
- * @{ */
-
-/**
- * A define which controls how UMP user space API functions are imported and exported.
- * This define should be set by the implementor of the UMP API.
- */
-#if defined(_WIN32)
-
-#define UMP_API_EXPORT
-
-#elif defined(__SYMBIAN32__)
-
-#define UMP_API_EXPORT IMPORT_C
-
-#else
-
-#define UMP_API_EXPORT
-
-#endif
-
-/** @} */ /* end group ump_user_space_api */
-
-
-#endif /* __UMP_PLATFORM_H__ */
+++ /dev/null
-/*
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2009-2010 ARM Limited
- * ALL RIGHTS RESERVED
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- */
-
-/**
- * @file ump_ref_drv.h
- *
- * Reference driver extensions to the UMP user space API for allocating UMP memory
- */
-
-#ifndef _UNIFIED_MEMORY_PROVIDER_REF_DRV_H_
-#define _UNIFIED_MEMORY_PROVIDER_REF_DRV_H_
-
-#include "ump.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define UMP_IOCTL_NR 0x90
-
-typedef enum
-{
- /* This enum must match with the IOCTL enum in ump_ioctl.h */
- UMP_REF_DRV_CONSTRAINT_NONE = 0,
- UMP_REF_DRV_CONSTRAINT_PHYSICALLY_LINEAR = 1,
- UMP_REF_DRV_CONSTRAINT_USE_CACHE = 128,
-} ump_alloc_constraints;
-
-typedef enum
-{
- UMP_MSYNC_CLEAN = 0 ,
- UMP_MSYNC_CLEAN_AND_INVALIDATE = 1,
- UMP_MSYNC_READOUT_CACHE_ENABLED = 128,
-} ump_cpu_msync_op;
-
-struct ump_uk_dmabuf {
- void *ctx;
- int fd;
- size_t size;
- uint32_t ump_handle;
-};
-
-#define _UMP_IOC_DMABUF_IMPORT 8
-
-#define UMP_IOC_DMABUF_IMPORT _IOW(UMP_IOCTL_NR, _UMP_IOC_DMABUF_IMPORT,\
- struct ump_uk_dmabuf)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*_UNIFIED_MEMORY_PROVIDER_REF_DRV_H_ */
+++ /dev/null
-AM_CFLAGS = \
- -I$(top_srcdir)/include/drm \
- -I$(top_srcdir)/libkms/ \
- -I$(top_srcdir)/exynos/ \
- -I$(top_srcdir) \
- $(CAIRO_CFLAGS)
-
-noinst_PROGRAMS = \
- ipptest
-
-ipptest_SOURCES = \
- fimctest.c \
- gem.c \
- util.c \
- fimc.c
-
-ipptest_LDADD = \
- $(top_builddir)/libdrm.la \
- $(top_builddir)/libkms/libkms.la \
- $(top_builddir)/exynos/libdrm_exynos.la \
- $(CAIRO_LIBS)
+++ /dev/null
-/*
- * DRM based fimc test program
- * Copyright 2012 Samsung Electronics
- * Eunchul Kim <chulspro.kim@sasmsung.com>
- *
- * 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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/time.h>
-#include <sys/mman.h>
-
-#include "exynos_drm.h"
-#include "fimctest.h"
-#include "gem.h"
-#include "util.h"
-
-#include "drm_fourcc.h"
-
-static int exynos_drm_ipp_property(int fd,
- struct drm_exynos_ipp_property *property,
- struct drm_exynos_sz *def_sz,
- enum drm_exynos_ipp_cmd cmd,
- enum drm_exynos_degree degree)
-{
- struct drm_exynos_pos crop_pos = {0, 0, def_sz->hsize, def_sz->vsize};
- struct drm_exynos_pos scale_pos = {0, 0, def_sz->hsize, def_sz->vsize};
- struct drm_exynos_sz src_sz = {def_sz->hsize, def_sz->vsize};
- struct drm_exynos_sz dst_sz = {def_sz->hsize, def_sz->vsize};
- int ret = 0;
-
- memset(property, 0x00, sizeof(struct drm_exynos_ipp_property));
-
- switch(cmd) {
- case IPP_CMD_M2M:
- property->config[EXYNOS_DRM_OPS_SRC].ops_id = EXYNOS_DRM_OPS_SRC;
- property->config[EXYNOS_DRM_OPS_SRC].flip = EXYNOS_DRM_FLIP_NONE;
- property->config[EXYNOS_DRM_OPS_SRC].degree = EXYNOS_DRM_DEGREE_0;
- property->config[EXYNOS_DRM_OPS_SRC].fmt = DRM_FORMAT_XRGB8888;
- property->config[EXYNOS_DRM_OPS_SRC].pos = crop_pos;
- property->config[EXYNOS_DRM_OPS_SRC].sz = src_sz;
-
- property->config[EXYNOS_DRM_OPS_DST].ops_id = EXYNOS_DRM_OPS_DST;
- property->config[EXYNOS_DRM_OPS_DST].flip = EXYNOS_DRM_FLIP_NONE;
- property->config[EXYNOS_DRM_OPS_DST].degree = degree;
- property->config[EXYNOS_DRM_OPS_DST].fmt = DRM_FORMAT_XRGB8888;
- if (property->config[EXYNOS_DRM_OPS_DST].degree == EXYNOS_DRM_DEGREE_90) {
- dst_sz.hsize = def_sz->vsize;
- dst_sz.vsize = def_sz->hsize;
-
- scale_pos.w = def_sz->vsize;
- scale_pos.h = def_sz->hsize;
- }
- property->config[EXYNOS_DRM_OPS_DST].pos = scale_pos;
- property->config[EXYNOS_DRM_OPS_DST].sz = dst_sz;
- break;
- case IPP_CMD_WB:
- property->config[EXYNOS_DRM_OPS_SRC].ops_id = EXYNOS_DRM_OPS_SRC;
- property->config[EXYNOS_DRM_OPS_SRC].flip = EXYNOS_DRM_FLIP_NONE;
- property->config[EXYNOS_DRM_OPS_SRC].degree = EXYNOS_DRM_DEGREE_0;
- property->config[EXYNOS_DRM_OPS_SRC].fmt = DRM_FORMAT_YUV444;
- property->config[EXYNOS_DRM_OPS_SRC].pos = crop_pos;
- property->config[EXYNOS_DRM_OPS_SRC].sz = src_sz;
-
- property->config[EXYNOS_DRM_OPS_DST].ops_id = EXYNOS_DRM_OPS_DST;
- property->config[EXYNOS_DRM_OPS_DST].flip = EXYNOS_DRM_FLIP_NONE;
- property->config[EXYNOS_DRM_OPS_DST].degree = degree;
- property->config[EXYNOS_DRM_OPS_DST].fmt = DRM_FORMAT_XRGB8888;
- if (property->config[EXYNOS_DRM_OPS_DST].degree == EXYNOS_DRM_DEGREE_90) {
- dst_sz.hsize = def_sz->vsize;
- dst_sz.vsize = def_sz->hsize;
-
- scale_pos.w = def_sz->vsize;
- scale_pos.h = def_sz->hsize;
- }
- property->config[EXYNOS_DRM_OPS_DST].pos = scale_pos;
- property->config[EXYNOS_DRM_OPS_DST].sz = dst_sz;
- break;
- case IPP_CMD_OUT:
- default:
- ret = -EINVAL;
- return ret;
- }
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_IPP_PROPERTY, property);
- if (ret)
- fprintf(stderr,
- "failed to DRM_IOCTL_EXYNOS_IPP_PROPERTY : %s\n",
- strerror(errno));
-
- return ret;
-}
-
-static int exynos_drm_ipp_buf(int fd, struct drm_exynos_ipp_buf *buf,
- enum drm_exynos_ops_id ops_id,
- enum drm_exynos_ipp_buf_ctrl ctrl,
- int id,
- unsigned int gem_handle)
-{
- int ret = 0;
-
- memset(buf, 0x00, sizeof(struct drm_exynos_ipp_buf));
-
- buf->ops_id = ops_id;
- buf->buf_ctrl = ctrl;
- buf->user_data = 0;
- buf->id = id;
- buf->handle[EXYNOS_DRM_PLANAR_Y] = gem_handle;
- buf->handle[EXYNOS_DRM_PLANAR_CB] = 0;
- buf->handle[EXYNOS_DRM_PLANAR_CR] = 0;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_IPP_BUF, buf);
- if (ret)
- fprintf(stderr,
- "failed to DRM_IOCTL_EXYNOS_IPP_BUF[id:%d][ctrl:%d] : %s\n",
- ops_id, ctrl, strerror(errno));
-
- return ret;
-}
-
-static int exynos_drm_ipp_ctrl(int fd, struct drm_exynos_ipp_ctrl *ctrl,
- enum drm_exynos_ipp_cmd cmd, unsigned int use)
-{
- int ret = 0;
-
- memset(ctrl, 0x00, sizeof(struct drm_exynos_ipp_ctrl));
-
- ctrl->cmd = cmd;
- ctrl->use = use;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_IPP_CTRL, ctrl);
- if (ret)
- fprintf(stderr,
- "failed to DRM_IOCTL_EXYNOS_IPP_CTRL[cmd:%d][use:%d] : %s\n",
- cmd, use, strerror(errno));
-
- return ret;
-}
-
-void fimc_m2m_set_mode(struct connector *c, int count, int page_flip,
- long int *usec)
-{
- struct drm_exynos_ipp_property property;
- struct drm_exynos_ipp_ctrl ctrl;
- struct drm_exynos_sz def_sz = {720, 1280};
- struct drm_exynos_ipp_buf buf1, buf2;
- unsigned int width=720, height=1280, stride;
- int ret, i, j, x;
- struct drm_exynos_gem_create gem1, gem2;
- struct drm_exynos_gem_mmap mmap1, mmap2;
- void *usr_addr1, *usr_addr2;
- struct timeval begin, end;
- struct drm_gem_close args;
- char filename[100];
-
- /* For property */
- ret = exynos_drm_ipp_property(fd, &property, &def_sz, IPP_CMD_M2M, EXYNOS_DRM_DEGREE_90);
- if (ret) {
- fprintf(stderr, "failed to ipp property\n");
- return;
- }
-
- /* For mode */
- width = height = 0;
- for (i = 0; i < count; i++) {
- connector_find_mode(&c[i]);
- if (c[i].mode == NULL) continue;
- width += c[i].mode->hdisplay;
- if (height < c[i].mode->vdisplay) height = c[i].mode->vdisplay;
- }
- stride = width * 4;
-
- /* For source buffer */
- ret = util_gem_create_mmap(fd, &gem1, &mmap1, stride * height);
- if (ret) {
- fprintf(stderr, "failed to gem create mmap: %s\n",
- strerror(errno));
- if (ret == -1) return;
- else if (ret == -2) goto err_gem_mmap1;
- }
- usr_addr1 = (void *)(unsigned long)mmap1.mapped;
-
- util_draw_buffer(usr_addr1, 1, width, height, stride, 0);
-
- sprintf(filename, "/opt/media/fimc_m2m_src.bmp", j);
- util_write_bmp(filename, usr_addr1, width, height);
-
- /* For destination buffer */
- ret = util_gem_create_mmap(fd, &gem2, &mmap2, stride * height);
- if (ret) {
- fprintf(stderr, "failed to gem create mmap: %s\n",
- strerror(errno));
- if (ret == -1) goto err_gem_create2;
- else if (ret == -2) goto err_gem_mmap2;
- }
- usr_addr2 = (void*)(unsigned long)mmap2.mapped;
-
- util_draw_buffer(usr_addr2, 0, 0, 0, 0, mmap2.size);
-
- sprintf(filename, "/opt/media/fimc_m2m_dst.bmp", j);
- util_write_bmp(filename, usr_addr2, height, width);
-
- /* For source buffer map to IPP */
- ret = exynos_drm_ipp_buf(fd, &buf1, EXYNOS_DRM_OPS_SRC,
- IPP_BUF_CTRL_MAP, 0, gem1.handle);
- if (ret) {
- fprintf(stderr, "failed to ipp buf src map\n");
- goto err_ipp_buf_map1;
- }
-
- /* For destination buffer map to IPP */
- ret = exynos_drm_ipp_buf(fd, &buf2, EXYNOS_DRM_OPS_DST,
- IPP_BUF_CTRL_MAP, 0, gem2.handle);
- if (ret) {
- fprintf(stderr, "failed to ipp buf dst map\n");
- goto err_ipp_buf_map2;
- }
-
- for (j = 0; j < MAX_LOOP; j++) {
- /* Start */
- gettimeofday(&begin, NULL);
- ret = exynos_drm_ipp_ctrl(fd, &ctrl, IPP_CMD_M2M, 1);
- if (ret) {
- fprintf(stderr,
- "failed to ipp ctrl IPP_CMD_M2M start\n");
- goto err_ipp_ctrl_start;
- }
-
- while (1) {
- struct timeval timeout = { .tv_sec = 3, .tv_usec = 0 };
- fd_set fds;
-
- FD_ZERO(&fds);
- FD_SET(0, &fds);
- FD_SET(fd, &fds);
- ret = select(fd + 1, &fds, NULL, NULL, &timeout);
- if (ret <= 0) {
- fprintf(stderr, "select timed out or error.\n");
- continue;
- } else if (FD_ISSET(0, &fds)) {
- break;
- }
-
- gettimeofday(&end, NULL);
- usec[j] = (end.tv_sec - begin.tv_sec) * 1000000 +
- (end.tv_usec - begin.tv_usec);
-
- sprintf(filename, "/opt/media/fimc_m2m_%d.bmp", j);
- util_write_bmp(filename, usr_addr2, height, width);
-
- break;
- }
-
- /* For destination buffer queue to IPP */
- ret = exynos_drm_ipp_buf(fd, &buf2, EXYNOS_DRM_OPS_DST,
- IPP_BUF_CTRL_QUEUE, 0, gem2.handle);
- if (ret) {
- fprintf(stderr, "failed to ipp buf dst queue\n");
- goto err_ipp_ctrl_start;
- }
- }
-
- /* For source buffer unmap to IPP */
- ret = exynos_drm_ipp_buf(fd, &buf1, EXYNOS_DRM_OPS_SRC,
- IPP_BUF_CTRL_UNMAP, 0, gem1.handle);
- if (ret) {
- fprintf(stderr, "failed to ipp buf src unmap\n");
- goto err_ipp_buf_unmap;
- }
-
- /* For destination buffer unmap to IPP */
- ret = exynos_drm_ipp_buf(fd, &buf2, EXYNOS_DRM_OPS_DST,
- IPP_BUF_CTRL_UNMAP, 0, gem2.handle);
- if (ret < 0) {
- fprintf(stderr, "failed to ipp buf dst unmap\n");
- goto err_ipp_buf_unmap;
- }
-
- /* Stop */
- ret = exynos_drm_ipp_ctrl(fd, &ctrl, IPP_CMD_M2M, 0);
- if (ret) {
- fprintf(stderr, "failed to ipp ctrl IPP_CMD_M2M stop\n");
- goto err_ipp_buf_unmap;
- }
-
- munmap(usr_addr2, mmap2.size);
- munmap(usr_addr1, mmap1.size);
-
- memset(&args, 0x00, sizeof(struct drm_gem_close));
- args.handle = gem2.handle;
- exynos_gem_close(fd, &args);
- memset(&args, 0x00, sizeof(struct drm_gem_close));
- args.handle = gem1.handle;
- exynos_gem_close(fd, &args);
-
- return;
-
-err_ipp_buf_unmap:
- exynos_drm_ipp_ctrl(fd, &ctrl, IPP_CMD_M2M, 0);
-err_ipp_ctrl_start:
- exynos_drm_ipp_buf(fd, &buf2, EXYNOS_DRM_OPS_DST, IPP_BUF_CTRL_UNMAP,
- 0, gem2.handle);
-err_ipp_buf_map2:
- exynos_drm_ipp_buf(fd, &buf1, EXYNOS_DRM_OPS_SRC, IPP_BUF_CTRL_UNMAP,
- 0, gem1.handle);
-err_ipp_buf_map1:
- munmap(usr_addr2, mmap2.size);
-err_gem_mmap2:
- memset(&args, 0x00, sizeof(struct drm_gem_close));
- args.handle = gem2.handle;
- exynos_gem_close(fd, &args);
-err_gem_create2:
- munmap(usr_addr1, mmap1.size);
-err_gem_mmap1:
- memset(&args, 0x00, sizeof(struct drm_gem_close));
- args.handle = gem1.handle;
- exynos_gem_close(fd, &args);
-}
-
-int fimc_event_handler(struct drm_exynos_ipp_buf *buf, struct drm_exynos_gem_create *gem,
- void **usr_addr, unsigned int width, unsigned int height)
-{
- char buffer[1024];
- int len, i;
- struct drm_event *e;
- struct drm_exynos_ipp_event *ipp_event;
- char filename[100];
- int ret = 0;
- static bmp_idx = 0;
-
- len = read(fd, buffer, sizeof buffer);
- if (len == 0)
- return 0;
- if (len < sizeof *e)
- return -1;
-
- i = 0;
- while (i < len) {
- e = (struct drm_event *) &buffer[i];
- switch (e->type) {
- case DRM_EXYNOS_IPP_EVENT:
- ipp_event = (struct drm_exynos_ipp_event *) e;
-
- fprintf(stderr, "%s:buf_idx[%d]bmp_idx[%d]\n", __func__, ipp_event->buf_idx, bmp_idx++);
- sprintf(filename, "/opt/media/fimc_wb_%d.bmp", bmp_idx);
- util_write_bmp(filename, usr_addr[ipp_event->buf_idx], width, height);
-
- /* For destination buffer queue to IPP */
- ret = exynos_drm_ipp_buf(fd, &buf[ipp_event->buf_idx], EXYNOS_DRM_OPS_DST,
- IPP_BUF_CTRL_QUEUE, ipp_event->buf_idx, gem[ipp_event->buf_idx].handle);
- if (ret) {
- fprintf(stderr, "failed to ipp buf dst queue\n");
- goto err_ipp_ctrl_close;
- }
- break;
- default:
- break;
- }
- i += e->length;
- }
-
-err_ipp_ctrl_close:
- return ret;
-}
-
-void fimc_wb_set_mode(struct connector *c, int count, int page_flip,
- long int *usec)
-{
- struct drm_exynos_pos def_pos = {0, 0, 720, 1280};
- struct drm_exynos_sz def_sz = {720, 1280};
- struct drm_exynos_ipp_property property;
- struct drm_exynos_gem_create gem[MAX_BUF];
- struct drm_exynos_gem_mmap mmap[MAX_BUF];
- struct drm_exynos_ipp_buf buf[MAX_BUF];
- void *usr_addr[MAX_BUF];
- struct drm_exynos_ipp_ctrl ctrl;
- unsigned int width, height, stride;
- int ret, i, j;
- struct timeval begin, end;
- struct drm_gem_close args;
-
- /* For property */
- ret = exynos_drm_ipp_property(fd, &property, &def_sz, IPP_CMD_WB, EXYNOS_DRM_DEGREE_0);
- if (ret) {
- fprintf(stderr, "failed to ipp property\n");
- return;
- }
-
- /* For mode */
- width = height = 0;
- for (i = 0; i < count; i++) {
- connector_find_mode(&c[i]);
- if (c[i].mode == NULL) continue;
- width += c[i].mode->hdisplay;
- if (height < c[i].mode->vdisplay) height = c[i].mode->vdisplay;
- }
- stride = width * 4;
-
- /* For destination buffer */
- for (i = 0; i < MAX_BUF; i++) {
- ret = util_gem_create_mmap(fd, &gem[i], &mmap[i], stride * height);
- if (ret) {
- fprintf(stderr, "failed to gem create mmap: %s\n",
- strerror(errno));
- if (ret == -1) return;
- else if (ret == -2) goto err_ipp_ctrl_close;
- }
- usr_addr[i] = (void *)(unsigned long)mmap[i].mapped;
- /* For destination buffer map to IPP */
- ret = exynos_drm_ipp_buf(fd, &buf[i], EXYNOS_DRM_OPS_DST,
- IPP_BUF_CTRL_MAP, i, gem[i].handle);
- if (ret) {
- fprintf(stderr, "failed to ipp buf dst map\n");
- goto err_ipp_ctrl_close;
- }
- }
-
-
- /* Start */
- gettimeofday(&begin, NULL);
- ret = exynos_drm_ipp_ctrl(fd, &ctrl, IPP_CMD_WB, 1);
- if (ret) {
- fprintf(stderr,
- "failed to ipp ctrl IPP_CMD_WB start\n");
- goto err_ipp_ctrl_close;
- }
-
- j = 0;
- while (1) {
- struct timeval timeout = { .tv_sec = 3, .tv_usec = 0 };
- fd_set fds;
-
- FD_ZERO(&fds);
- FD_SET(0, &fds);
- FD_SET(fd, &fds);
- ret = select(fd + 1, &fds, NULL, NULL, &timeout);
- if (ret <= 0) {
- fprintf(stderr, "select timed out or error.\n");
- continue;
- } else if (FD_ISSET(0, &fds)) {
- fprintf(stderr, "select error.\n");
- break;
- }
-
- gettimeofday(&end, NULL);
- usec[j] = (end.tv_sec - begin.tv_sec) * 1000000 +
- (end.tv_usec - begin.tv_usec);
-
- if (property.config[EXYNOS_DRM_OPS_DST].degree == EXYNOS_DRM_DEGREE_90 ||
- property.config[EXYNOS_DRM_OPS_DST].degree == EXYNOS_DRM_DEGREE_270) {
- if(fimc_event_handler(buf, gem, usr_addr, height, width) < 0)
- break;
- } else {
- if(fimc_event_handler(buf, gem, usr_addr, width, height) < 0)
- break;
- }
-
- if (++j > MAX_LOOP)
- break;
-
- if (j == HALF_LOOP) {
- /* Stop */
- ret = exynos_drm_ipp_ctrl(fd, &ctrl, IPP_CMD_WB, 0);
- if (ret) {
- fprintf(stderr, "failed to ipp ctrl IPP_CMD_WB stop\n");
- goto err_ipp_ctrl_close;
- }
-
- /* For property */
- ret = exynos_drm_ipp_property(fd, &property, &def_sz, IPP_CMD_WB, EXYNOS_DRM_DEGREE_90);
- if (ret) {
- fprintf(stderr, "failed to ipp property\n");
- goto err_ipp_ctrl_close;
- }
-
- /* Start */
- ret = exynos_drm_ipp_ctrl(fd, &ctrl, IPP_CMD_WB, 1);
- if (ret) {
- fprintf(stderr,
- "failed to ipp ctrl IPP_CMD_WB start\n");
- goto err_ipp_ctrl_close;
- }
- }
-
- gettimeofday(&begin, NULL);
- }
-
-err_ipp_ctrl_close:
- /* For destination buffer unmap to IPP */
- for (i = 0; i < MAX_BUF; i++) {
- ret = exynos_drm_ipp_buf(fd, &buf[i], EXYNOS_DRM_OPS_DST,
- IPP_BUF_CTRL_UNMAP, i, gem[i].handle);
- if (ret < 0)
- fprintf(stderr, "failed to ipp buf dst unmap\n");
- }
-
- /* Stop */
- ret = exynos_drm_ipp_ctrl(fd, &ctrl, IPP_CMD_WB, 0);
- if (ret)
- fprintf(stderr, "failed to ipp ctrl IPP_CMD_WB stop\n");
-
- for (i = 0; i < MAX_BUF; i++) {
- munmap(usr_addr[i], mmap[i].size);
- memset(&args, 0x00, sizeof(struct drm_gem_close));
- args.handle = gem[i].handle;
- exynos_gem_close(fd, &args);
- }
-
- return;
-}
-
-void fimc_output_set_mode(struct connector *c, int count, int page_flip,
- long int *usec)
-{
- fprintf(stderr, "not supported. please wait v2\n");
-}
-
+++ /dev/null
-#ifndef __FIMC_H__
-#define __FIMC_H__
-
-void fimc_m2m_set_mode(struct connector *c, int count, int page_flip,
- long int *usec);
-void fimc_wb_set_mode(struct connector *c, int count, int page_flip,
- long int *usec);
-void fimc_output_set_mode(struct connector *c, int count, int page_flip,
- long int *usec);
-
-#endif
+++ /dev/null
-/*
- * DRM based fimc test program
- * Copyright 2012 Samsung Electronics
- * Eunchul Kim <chulspro.kim@sasmsung.com>
- *
- * 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.
- */
-
-/*
- * This fairly simple test program dumps output in a similar format to the
- * "xrandr" tool everyone knows & loves. It's necessarily slightly different
- * since the kernel separates outputs into encoder and connector structures,
- * each with their own unique ID. The program also allows test testing of the
- * memory management and mode setting APIs by allowing the user to specify a
- * connector and mode to use for mode setting. If all works as expected, a
- * blue background should be painted on the monitor attached to the specified
- * connector after the selected mode is set.
- *
- */
-
-#include "config.h"
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/poll.h>
-#include <sys/time.h>
-#include <sys/mman.h>
-
-#include "libkms.h"
-
-#include "exynos_drm.h"
-
-#include "fimctest.h"
-#include "fimc.h"
-
-drmModeRes *resources;
-int fd, modes;
-
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
-
-struct type_name {
- int type;
- char *name;
-};
-
-#define type_name_fn(res) \
-char * res##_str(int type) { \
- int i; \
- for (i = 0; i < ARRAY_SIZE(res##_names); i++) { \
- if (res##_names[i].type == type) \
- return res##_names[i].name; \
- } \
- return "(invalid)"; \
-}
-
-struct type_name encoder_type_names[] = {
- { DRM_MODE_ENCODER_NONE, "none" },
- { DRM_MODE_ENCODER_DAC, "DAC" },
- { DRM_MODE_ENCODER_TMDS, "TMDS" },
- { DRM_MODE_ENCODER_LVDS, "LVDS" },
- { DRM_MODE_ENCODER_TVDAC, "TVDAC" },
-};
-
-type_name_fn(encoder_type)
-
-struct type_name connector_status_names[] = {
- { DRM_MODE_CONNECTED, "connected" },
- { DRM_MODE_DISCONNECTED, "disconnected" },
- { DRM_MODE_UNKNOWNCONNECTION, "unknown" },
-};
-
-type_name_fn(connector_status)
-
-struct type_name connector_type_names[] = {
- { DRM_MODE_CONNECTOR_Unknown, "unknown" },
- { DRM_MODE_CONNECTOR_VGA, "VGA" },
- { DRM_MODE_CONNECTOR_DVII, "DVI-I" },
- { DRM_MODE_CONNECTOR_DVID, "DVI-D" },
- { DRM_MODE_CONNECTOR_DVIA, "DVI-A" },
- { DRM_MODE_CONNECTOR_Composite, "composite" },
- { DRM_MODE_CONNECTOR_SVIDEO, "s-video" },
- { DRM_MODE_CONNECTOR_LVDS, "LVDS" },
- { DRM_MODE_CONNECTOR_Component, "component" },
- { DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN" },
- { DRM_MODE_CONNECTOR_DisplayPort, "displayport" },
- { DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" },
- { DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" },
- { DRM_MODE_CONNECTOR_TV, "TV" },
- { DRM_MODE_CONNECTOR_eDP, "embedded displayport" },
- { DRM_MODE_CONNECTOR_VIRTUAL, "Virtual" },
-};
-
-type_name_fn(connector_type)
-
-static void dump_encoders(void)
-{
- drmModeEncoder *encoder;
- int i;
-
- printf("Encoders:\n");
- printf("id\tcrtc\ttype\tpossible crtcs\tpossible clones\t\n");
- for (i = 0; i < resources->count_encoders; i++) {
- encoder = drmModeGetEncoder(fd, resources->encoders[i]);
-
- if (!encoder) {
- fprintf(stderr, "could not get encoder %i: %s\n",
- resources->encoders[i], strerror(errno));
- continue;
- }
- printf("%d\t%d\t%s\t0x%08x\t0x%08x\n",
- encoder->encoder_id,
- encoder->crtc_id,
- encoder_type_str(encoder->encoder_type),
- encoder->possible_crtcs,
- encoder->possible_clones);
- drmModeFreeEncoder(encoder);
- }
- printf("\n");
-}
-
-static void dump_mode(drmModeModeInfo *mode)
-{
- printf(" %s %d %d %d %d %d %d %d %d %d\n",
- mode->name,
- mode->vrefresh,
- mode->hdisplay,
- mode->hsync_start,
- mode->hsync_end,
- mode->htotal,
- mode->vdisplay,
- mode->vsync_start,
- mode->vsync_end,
- mode->vtotal);
-}
-
-static void dump_props(drmModeConnector *connector)
-{
- drmModePropertyPtr props;
- int i;
-
- for (i = 0; i < connector->count_props; i++) {
- props = drmModeGetProperty(fd, connector->props[i]);
- printf("\t%s, flags %d\n", props->name, props->flags);
- drmModeFreeProperty(props);
- }
-}
-
-static void dump_connectors(void)
-{
- drmModeConnector *connector;
- int i, j;
-
- printf("Connectors:\n");
- printf("id\tencoder\tstatus\t\ttype\tsize (mm)\tmodes\tencoders\n");
- for (i = 0; i < resources->count_connectors; i++) {
- connector = drmModeGetConnector(fd, resources->connectors[i]);
-
- if (!connector) {
- fprintf(stderr, "could not get connector %i: %s\n",
- resources->connectors[i], strerror(errno));
- continue;
- }
-
- printf("%d\t%d\t%s\t%s\t%dx%d\t\t%d\t",
- connector->connector_id,
- connector->encoder_id,
- connector_status_str(connector->connection),
- connector_type_str(connector->connector_type),
- connector->mmWidth, connector->mmHeight,
- connector->count_modes);
-
- for (j = 0; j < connector->count_encoders; j++)
- printf("%s%d", j > 0 ? ", " : "",
- connector->encoders[j]);
- printf("\n");
-
- if (!connector->count_modes)
- continue;
-
- printf(" modes:\n");
- printf(" name refresh (Hz) hdisp hss hse htot vdisp "
- "vss vse vtot)\n");
- for (j = 0; j < connector->count_modes; j++)
- dump_mode(&connector->modes[j]);
-
- printf(" props:\n");
- dump_props(connector);
-
- drmModeFreeConnector(connector);
- }
- printf("\n");
-}
-
-static void dump_crtcs(void)
-{
- drmModeCrtc *crtc;
- int i;
-
- printf("CRTCs:\n");
- printf("id\tfb\tpos\tsize\n");
- for (i = 0; i < resources->count_crtcs; i++) {
- crtc = drmModeGetCrtc(fd, resources->crtcs[i]);
-
- if (!crtc) {
- fprintf(stderr, "could not get crtc %i: %s\n",
- resources->crtcs[i], strerror(errno));
- continue;
- }
- printf("%d\t%d\t(%d,%d)\t(%dx%d)\n",
- crtc->crtc_id,
- crtc->buffer_id,
- crtc->x, crtc->y,
- crtc->width, crtc->height);
- dump_mode(&crtc->mode);
-
- drmModeFreeCrtc(crtc);
- }
- printf("\n");
-}
-
-static void dump_framebuffers(void)
-{
- drmModeFB *fb;
- int i;
-
- printf("Frame buffers:\n");
- printf("id\tsize\tpitch\n");
- for (i = 0; i < resources->count_fbs; i++) {
- fb = drmModeGetFB(fd, resources->fbs[i]);
-
- if (!fb) {
- fprintf(stderr, "could not get fb %i: %s\n",
- resources->fbs[i], strerror(errno));
- continue;
- }
- printf("%u\t(%ux%u)\t%u\n",
- fb->fb_id,
- fb->width, fb->height,
- fb->pitch);
-
- drmModeFreeFB(fb);
- }
- printf("\n");
-}
-
-/*
- * Mode setting with the kernel interfaces is a bit of a chore.
- * First you have to find the connector in question and make sure the
- * requested mode is available.
- * Then you need to find the encoder attached to that connector so you
- * can bind it with a free crtc.
- */
-
-void connector_find_mode(struct connector *c)
-{
- drmModeConnector *connector;
- int i, j;
-
- /* First, find the connector & mode */
- c->mode = NULL;
- for (i = 0; i < resources->count_connectors; i++) {
- connector = drmModeGetConnector(fd, resources->connectors[i]);
-
- if (!connector) {
- fprintf(stderr, "could not get connector %i: %s\n",
- resources->connectors[i], strerror(errno));
- drmModeFreeConnector(connector);
- continue;
- }
-
- if (!connector->count_modes) {
- drmModeFreeConnector(connector);
- continue;
- }
-
- if (connector->connector_id != c->id) {
- drmModeFreeConnector(connector);
- continue;
- }
-
- for (j = 0; j < connector->count_modes; j++) {
- c->mode = &connector->modes[j];
- if (!strcmp(c->mode->name, c->mode_str))
- break;
- }
-
- /* Found it, break out */
- if (c->mode)
- break;
-
- drmModeFreeConnector(connector);
- }
-
- if (!c->mode) {
- fprintf(stderr, "failed to find mode \"%s\"\n", c->mode_str);
- return;
- }
-
- /* Now get the encoder */
- for (i = 0; i < resources->count_encoders; i++) {
- c->encoder = drmModeGetEncoder(fd, resources->encoders[i]);
-
- if (!c->encoder) {
- fprintf(stderr, "could not get encoder %i: %s\n",
- resources->encoders[i], strerror(errno));
- drmModeFreeEncoder(c->encoder);
- continue;
- }
-
- if (c->encoder->encoder_id == connector->encoder_id)
- break;
-
- drmModeFreeEncoder(c->encoder);
- }
-
- if (c->crtc == -1)
- c->crtc = c->encoder->crtc_id;
-}
-
-extern char *optarg;
-extern int optind, opterr, optopt;
-static char optstr[] = "ecpmfo:s:v";
-
-static void usage(char *name)
-{
- fprintf(stderr, "usage: %s [-ecpmf]\n", name);
- fprintf(stderr, "\t-e\tlist encoders\n");
- fprintf(stderr, "\t-c\tlist connectors\n");
- fprintf(stderr, "\t-p\tlist CRTCs (pipes)\n");
- fprintf(stderr, "\t-m\tlist modes\n");
- fprintf(stderr, "\t-f\tlist framebuffers\n");
- fprintf(stderr, "\t-v\ttest vsynced page flipping\n");
- fprintf(stderr, "\t-o\tlist of operation id : 0: M2M, 1: Writeback, 2: Output\n");
- fprintf(stderr, "\t-s <connector_id>:<mode>\tset a mode\n");
- fprintf(stderr, "\t-s <connector_id>@<crtc_id>:<mode>\tset a mode\n");
- fprintf(stderr, "\n\tDefault is to dump all info.\n");
- exit(0);
-}
-
-#define dump_resource(res) if (res) dump_##res()
-
-int main(int argc, char **argv)
-{
- int c;
- int operations = 0, encoders = 0, connectors = 0, crtcs = 0, framebuffers = 0;
- int test_vsync = 0;
- char *modules[] = {"exynos", "i915", "radeon", "nouveau", "vmwgfx"};
- char *modeset = NULL;
- int i, count = 0;
- struct connector con_args[2];
-
- opterr = 0;
- while ((c = getopt(argc, argv, optstr)) != -1) {
- switch (c) {
- case 'e':
- encoders = 1;
- break;
- case 'c':
- connectors = 1;
- break;
- case 'p':
- crtcs = 1;
- break;
- case 'm':
- modes = 1;
- break;
- case 'f':
- framebuffers = 1;
- break;
- case 'v':
- test_vsync = 1;
- break;
- case 'o':
- if (optarg)
- sscanf(optarg, "%d", &operations);
- break;
- case 's':
- modeset = strdup(optarg);
- con_args[count].crtc = -1;
- if (sscanf(optarg, "%d:%64s",
- &con_args[count].id,
- con_args[count].mode_str) != 2 &&
- sscanf(optarg, "%d@%d:%64s",
- &con_args[count].id,
- &con_args[count].crtc,
- con_args[count].mode_str) != 3)
- usage(argv[0]);
- count++;
- break;
- default:
- usage(argv[0]);
- break;
- }
- }
-
- if (argc == 1)
- encoders = connectors = crtcs = modes = framebuffers = 1;
-
- for (i = 0; i < ARRAY_SIZE(modules); i++) {
- printf("trying to load module %s...", modules[i]);
- fd = drmOpen(modules[i], NULL);
- if (fd < 0) {
- printf("failed.\n");
- } else {
- printf("success.\n");
- break;
- }
- }
-
- if (i == ARRAY_SIZE(modules)) {
- fprintf(stderr, "failed to load any modules, aborting.\n");
- return -1;
- }
-
- resources = drmModeGetResources(fd);
- if (!resources) {
- fprintf(stderr, "drmModeGetResources failed: %s\n",
- strerror(errno));
- drmClose(fd);
- return 1;
- }
-
- dump_resource(encoders);
- dump_resource(connectors);
- dump_resource(crtcs);
- dump_resource(framebuffers);
-
- if (count > 0) {
- long int sum = 0, usec[MAX_LOOP];
-
- switch(operations) {
- case 0:
- fimc_m2m_set_mode(con_args, count, test_vsync, usec);
- break;
- case 1:
- fimc_wb_set_mode(con_args, count, test_vsync, usec);
- break;
- case 2:
- fimc_output_set_mode(con_args, count, test_vsync, usec);
- break;
- default:
- break;
- }
-
- for (i = 0; i < MAX_LOOP; i++) {
- printf("[%d] : %d\n", i + 1, usec[i]);
- sum += usec[i];
- }
- printf("fimc : cma\n");
- printf("avg : [%d]\n", sum / MAX_LOOP);
- getchar();
- }
-
- drmModeFreeResources(resources);
-
- return 0;
-}
+++ /dev/null
-#ifndef __FIMCTEST_H__
-#define __FIMCTEST_H__
-
-#include "xf86drm.h"
-#include "xf86drmMode.h"
-
-#define MAX_LOOP 20
-#define HALF_LOOP 10
-#define MAX_BUF 3
-
-struct connector {
- uint32_t id;
- char mode_str[64];
- drmModeModeInfo *mode;
- drmModeEncoder *encoder;
- int crtc;
- unsigned int fb_id[2], current_fb_id;
- struct timeval start;
-
- int swap_count;
-};
-
-extern int fd;
-
-extern void connector_find_mode(struct connector *c);
-
-#endif
+++ /dev/null
-/*
- * DRM based fimc test program
- * Copyright 2012 Samsung Electronics
- * Eunchul Kim <chulspro.kim@sasmsung.com>
- *
- * 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.
- */
-
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-
-#include "xf86drm.h"
-#include "xf86drmMode.h"
-#include "libkms.h"
-
-#include "exynos_drm.h"
-
-int exynos_gem_create(int fd, struct drm_exynos_gem_create *gem)
-{
- int ret = 0;
-
- if (!gem) {
- fprintf(stderr, "gem object is null.\n");
- return -EFAULT;
- }
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_GEM_CREATE, gem);
- if (ret < 0)
- fprintf(stderr, "failed to create gem buffer: %s\n",
- strerror(-ret));
- return ret;
-}
-
-int exynos_gem_userptr(int fd, struct drm_exynos_gem_userptr *gem_userptr)
-{
- int ret = 0;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_GEM_USERPTR, gem_userptr);
- if (ret < 0)
- fprintf(stderr, "failed to userptr: %s\n", strerror(-ret));
- return ret;
-}
-
-int exynos_gem_mmap(int fd, struct drm_exynos_gem_mmap *in_mmap)
-{
- int ret = 0;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_GEM_MMAP, in_mmap);
- if (ret < 0)
- fprintf(stderr, "failed to mmap: %s\n", strerror(-ret));
- return ret;
-}
-
-int exynos_gem_close(int fd, struct drm_gem_close *gem_close)
-{
- int ret = 0;
-
- ret = ioctl(fd, DRM_IOCTL_GEM_CLOSE, gem_close);
- if (ret < 0)
- fprintf(stderr, "failed to close: %s\n", strerror(-ret));
- return ret;
-}
-
-int exynos_gem_cache_op(int fd, struct drm_exynos_gem_cache_op *cache_op)
-{
- int ret = 0;
-
- ret = ioctl(fd, DRM_IOCTL_EXYNOS_GEM_CACHE_OP, cache_op);
- if (ret < 0)
- fprintf(stderr, "failed to cache op: %s\n", strerror(-ret));
- return ret;
-}
+++ /dev/null
-#ifndef __GEM_H__
-#define __GEM_H__
-
-extern int exynos_gem_create(int fd, struct drm_exynos_gem_create *gem);
-extern int exynos_gem_userptr(int fd,
- struct drm_exynos_gem_userptr *gem_userptr);
-extern int exynos_gem_mmap(int fd, struct drm_exynos_gem_mmap *in_mmap);
-extern int exynos_gem_close(int fd, struct drm_gem_close *gem_close);
-extern int exynos_gem_cache_op(int fd,
- struct drm_exynos_gem_cache_op *cache_op);
-
-#endif
+++ /dev/null
-/*
- * DRM based fimc test program
- * Copyright 2012 Samsung Electronics
- * Eunchul Kim <chulspro.kim@sasmsung.com>
- *
- * 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.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdint.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-
-#include "exynos_drm.h"
-#include "gem.h"
-
-int util_gem_create_mmap(int fd, struct drm_exynos_gem_create *gem,
- struct drm_exynos_gem_mmap *mmap,
- unsigned int size)
-{
- /* initialize structure for gem create */
- memset(gem, 0x00, sizeof(struct drm_exynos_gem_create));
- gem->size = size;
-
- if (exynos_gem_create(fd, gem) < 0) {
- fprintf(stderr, "failed to gem create: %s\n", strerror(errno));
- return -1;
- }
-
- /* initialize structure for gem mmap */
- memset(mmap, 0x00, sizeof(struct drm_exynos_gem_mmap));
- mmap->handle = gem->handle;
- mmap->size = gem->size;
-
- if (exynos_gem_mmap(fd, mmap) < 0) {
- fprintf(stderr, "failed to gem mmap: %s\n", strerror(errno));
- return -2;
- }
-
- return 0;
-}
-
-void util_draw_buffer(void *addr, unsigned int stripe,
- unsigned int width, unsigned int height,
- unsigned int stride, unsigned int size)
-{
- if (stripe == 1) {
- int i, j;
- unsigned int *fb_ptr;
- div_t d;
-
- for (j = 0; j < height; j++) {
- fb_ptr = (unsigned int *)((char *)addr + j * stride);
- for (i = 0; i < width; i++) {
- d = div(i, width);
- fb_ptr[i] = 0x00130502 * (d.quot >> 6)
- + 0x000a1120 * (d.rem >> 6);
- }
- }
- } else
- memset(addr, 0x77, size);
-}
-
-int util_write_bmp(const char *file, const void *data, unsigned int width,
- unsigned int height)
-{
- int i;
- unsigned int * blocks;
- FILE *fp;
- struct {
- unsigned char magic[2];
- } bmpfile_magic = { {'B', 'M'} };
- struct {
- unsigned int filesz;
- unsigned short creator1;
- unsigned short creator2;
- unsigned int bmp_offset;
- } bmpfile_header = { 0, 0, 0, 0x36 };
- struct {
- unsigned int header_sz;
- unsigned int width;
- unsigned int height;
- unsigned short nplanes;
- unsigned short bitspp;
- unsigned int compress_type;
- unsigned int bmp_bytesz;
- unsigned int hres;
- unsigned int vres;
- unsigned int ncolors;
- unsigned int nimpcolors;
- } bmp_dib_v3_header_t = { 0x28, 0, 0, 1, 32, 0, 0, 0, 0, 0, 0 };
-
- fp = fopen(file, "wb");
- if (fp == NULL) return -1;
-
- bmpfile_header.filesz = sizeof(bmpfile_magic) + sizeof(bmpfile_header)
- + sizeof(bmp_dib_v3_header_t) + width * height * 4;
- bmp_dib_v3_header_t.header_sz = sizeof(bmp_dib_v3_header_t);
- bmp_dib_v3_header_t.width = width;
- bmp_dib_v3_header_t.height = -height;
- bmp_dib_v3_header_t.nplanes = 1;
- bmp_dib_v3_header_t.bmp_bytesz = width * height * 4;
-
- fwrite(&bmpfile_magic, sizeof(bmpfile_magic), 1, fp);
- fwrite(&bmpfile_header, sizeof(bmpfile_header), 1, fp);
- fwrite(&bmp_dib_v3_header_t, sizeof(bmp_dib_v3_header_t), 1, fp);
-
- blocks = (unsigned int*)data;
- for (i = 0; i < height * width; i++)
- fwrite(&blocks[i], 4, 1, fp);
-
- fclose(fp);
- return 0;
-}
+++ /dev/null
-#ifndef __UTIL_H__
-#define __UTIL_H__
-
-extern int util_gem_create_mmap(int fd, struct drm_exynos_gem_create *gem,
- struct drm_exynos_gem_mmap *mmap,
- unsigned int size);
-extern void util_draw_buffer(void *addr, unsigned int stripe,
- unsigned int width, unsigned int height,
- unsigned int stride, unsigned int size);
-extern int util_write_bmp(const char *file, const void *data,
- unsigned int width, unsigned int height);
-#endif
--- /dev/null
+#
+# Update "-version-number M:m:r" whenever library interface changes.
+# Only "M" part has to be updated.
+#
+
+AM_CFLAGS = \
+ $(WARN_CFLAGS) \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/vigs \
+ $(PTHREADSTUBS_CFLAGS) \
+ -I$(top_srcdir)/include/drm
+
+libdrm_vigs_la_LTLIBRARIES = libdrm_vigs.la
+libdrm_vigs_ladir = $(libdir)
+libdrm_vigs_la_LDFLAGS = -version-number 9:0:0 -no-undefined
+libdrm_vigs_la_LIBADD = ../libdrm.la @PTHREADSTUBS_LIBS@
+
+libdrm_vigs_la_SOURCES = vigs.c
+
+libdrm_vigsincludedir = ${includedir}/libdrm
+libdrm_vigsinclude_HEADERS = vigs.h
+
+pkgconfigdir = @pkgconfigdir@
+pkgconfig_DATA = libdrm_vigs.pc
--- /dev/null
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: libdrm_vigs
+Description: Userspace interface to VIGS kernel DRM services
+Version: 2.4.35
+Libs: -L${libdir} -ldrm_vigs
+Cflags: -I${includedir} -I${includedir}/libdrm -I${includedir}/vigs
+Requires.private: libdrm
--- /dev/null
+/* vigs.c
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ * Authors:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ *
+ * 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <assert.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#include <sys/mman.h>
+#include <linux/stddef.h>
+
+#include <xf86drm.h>
+#include <xf86atomic.h>
+
+#include "vigs.h"
+#include "vigs_drm.h"
+
+#define vigs_offsetof(type, member) ((size_t)&((type*)0)->member)
+
+#define vigs_containerof(ptr, type, member) ((type*)((char*)(ptr) - vigs_offsetof(type, member)))
+
+struct vigs_drm_gem_info
+{
+ atomic_t ref_count;
+};
+
+struct vigs_drm_gem_impl
+{
+ struct vigs_drm_gem_info info;
+
+ struct vigs_drm_gem gem;
+};
+
+struct vigs_drm_surface_impl
+{
+ struct vigs_drm_gem_info gem_info;
+
+ struct vigs_drm_surface base;
+};
+
+struct vigs_drm_execbuffer_impl
+{
+ struct vigs_drm_gem_info gem_info;
+
+ struct vigs_drm_execbuffer base;
+};
+
+struct vigs_drm_fence_impl
+{
+ struct vigs_drm_fence base;
+
+ atomic_t ref_count;
+};
+
+static void vigs_drm_gem_close(struct vigs_drm_device *dev, uint32_t handle)
+{
+ struct drm_gem_close req =
+ {
+ .handle = handle,
+ };
+
+ if (handle) {
+ drmIoctl(dev->fd, DRM_IOCTL_GEM_CLOSE, &req);
+ }
+}
+
+static void vigs_drm_gem_impl_init(struct vigs_drm_gem_impl *gem_impl,
+ struct vigs_drm_device *dev,
+ uint32_t handle,
+ uint32_t size,
+ uint32_t name)
+{
+ atomic_set(&gem_impl->info.ref_count, 1);
+ gem_impl->gem.dev = dev;
+ gem_impl->gem.size = size;
+ gem_impl->gem.handle = handle;
+ gem_impl->gem.name = name;
+}
+
+int vigs_drm_device_create(int fd, struct vigs_drm_device **dev)
+{
+ drmVersionPtr version;
+ uint32_t major;
+ int ret;
+
+ *dev = calloc(sizeof(**dev), 1);
+
+ if (!*dev) {
+ ret = -ENOMEM;
+ goto fail1;
+ }
+
+ version = drmGetVersion(fd);
+
+ if (!version) {
+ ret = -EINVAL;
+ goto fail2;
+ }
+
+ major = version->version_major;
+
+ drmFreeVersion(version);
+
+ if (major != DRM_VIGS_DRIVER_VERSION) {
+ ret = -EINVAL;
+ goto fail2;
+ }
+
+ (*dev)->fd = fd;
+
+ return 0;
+
+fail2:
+ free(*dev);
+fail1:
+ *dev = NULL;
+
+ return ret;
+}
+
+void vigs_drm_device_destroy(struct vigs_drm_device *dev)
+{
+ free(dev);
+}
+
+int vigs_drm_device_get_protocol_version(struct vigs_drm_device *dev,
+ uint32_t *protocol_version)
+{
+ struct drm_vigs_get_protocol_version req;
+ int ret;
+
+ ret = drmIoctl(dev->fd, DRM_IOCTL_VIGS_GET_PROTOCOL_VERSION, &req);
+
+ if (ret != 0) {
+ return -errno;
+ }
+
+ if (protocol_version) {
+ *protocol_version = req.version;
+ }
+
+ return 0;
+}
+
+void vigs_drm_gem_ref(struct vigs_drm_gem *gem)
+{
+ struct vigs_drm_gem_impl *gem_impl;
+
+ if (!gem) {
+ return;
+ }
+
+ gem_impl = vigs_containerof(gem, struct vigs_drm_gem_impl, gem);
+
+ atomic_inc(&gem_impl->info.ref_count);
+}
+
+void vigs_drm_gem_unref(struct vigs_drm_gem *gem)
+{
+ struct vigs_drm_gem_impl *gem_impl;
+
+ if (!gem) {
+ return;
+ }
+
+ gem_impl = vigs_containerof(gem, struct vigs_drm_gem_impl, gem);
+
+ assert(atomic_read(&gem_impl->info.ref_count) > 0);
+ if (!atomic_dec_and_test(&gem_impl->info.ref_count)) {
+ return;
+ }
+
+ if (gem->vaddr) {
+ munmap(gem->vaddr, gem->size);
+ }
+
+ vigs_drm_gem_close(gem->dev, gem->handle);
+
+ free(gem_impl);
+}
+
+int vigs_drm_gem_get_name(struct vigs_drm_gem *gem)
+{
+ struct drm_gem_flink req =
+ {
+ .handle = gem->handle,
+ };
+ int ret;
+
+ if (gem->name) {
+ return 0;
+ }
+
+ ret = drmIoctl(gem->dev->fd, DRM_IOCTL_GEM_FLINK, &req);
+
+ if (ret != 0) {
+ return -errno;
+ }
+
+ gem->name = req.name;
+
+ return 0;
+}
+
+int vigs_drm_gem_map(struct vigs_drm_gem *gem, int track_access)
+{
+ struct drm_vigs_gem_map req =
+ {
+ .handle = gem->handle,
+ .track_access = track_access
+ };
+ int ret;
+
+ if (gem->vaddr) {
+ return 0;
+ }
+
+ ret = drmIoctl(gem->dev->fd, DRM_IOCTL_VIGS_GEM_MAP, &req);
+
+ if (ret != 0) {
+ return -errno;
+ }
+
+ gem->vaddr = (void*)req.address;
+
+ return 0;
+}
+
+void vigs_drm_gem_unmap(struct vigs_drm_gem *gem)
+{
+ if (!gem->vaddr) {
+ return;
+ }
+
+ munmap(gem->vaddr, gem->size);
+ gem->vaddr = NULL;
+}
+
+int vigs_drm_gem_wait(struct vigs_drm_gem *gem)
+{
+ struct drm_vigs_gem_wait req =
+ {
+ .handle = gem->handle,
+ };
+ int ret;
+
+ ret = drmIoctl(gem->dev->fd, DRM_IOCTL_VIGS_GEM_WAIT, &req);
+
+ if (ret != 0) {
+ return -errno;
+ }
+
+ return 0;
+}
+
+int vigs_drm_surface_create(struct vigs_drm_device *dev,
+ uint32_t width,
+ uint32_t height,
+ uint32_t stride,
+ uint32_t format,
+ int scanout,
+ struct vigs_drm_surface **sfc)
+{
+ struct vigs_drm_surface_impl *sfc_impl;
+ struct drm_vigs_create_surface req =
+ {
+ .width = width,
+ .height = height,
+ .stride = stride,
+ .format = format,
+ .scanout = scanout,
+ };
+ int ret;
+
+ sfc_impl = calloc(sizeof(*sfc_impl), 1);
+
+ if (!sfc_impl) {
+ ret = -ENOMEM;
+ goto fail1;
+ }
+
+ ret = drmIoctl(dev->fd, DRM_IOCTL_VIGS_CREATE_SURFACE, &req);
+
+ if (ret != 0) {
+ ret = -errno;
+ goto fail2;
+ }
+
+ vigs_drm_gem_impl_init((struct vigs_drm_gem_impl*)sfc_impl,
+ dev,
+ req.handle,
+ req.size,
+ 0);
+
+ sfc_impl->base.width = width;
+ sfc_impl->base.height = height;
+ sfc_impl->base.stride = stride;
+ sfc_impl->base.format = format;
+ sfc_impl->base.scanout = scanout;
+ sfc_impl->base.id = req.id;
+
+ *sfc = &sfc_impl->base;
+
+ return 0;
+
+fail2:
+ free(sfc_impl);
+fail1:
+ *sfc = NULL;
+
+ return ret;
+}
+
+int vigs_drm_surface_open(struct vigs_drm_device *dev,
+ uint32_t name,
+ struct vigs_drm_surface **sfc)
+{
+ struct vigs_drm_surface_impl *sfc_impl;
+ struct drm_gem_open req =
+ {
+ .name = name,
+ };
+ struct drm_vigs_surface_info info_req;
+ int ret;
+
+ sfc_impl = calloc(sizeof(*sfc_impl), 1);
+
+ if (!sfc_impl) {
+ ret = -ENOMEM;
+ goto fail1;
+ }
+
+ ret = drmIoctl(dev->fd, DRM_IOCTL_GEM_OPEN, &req);
+
+ if (ret != 0) {
+ ret = -errno;
+ goto fail2;
+ }
+
+ info_req.handle = req.handle;
+
+ ret = drmIoctl(dev->fd, DRM_IOCTL_VIGS_SURFACE_INFO, &info_req);
+
+ if (ret != 0) {
+ ret = -errno;
+ goto fail3;
+ }
+
+ vigs_drm_gem_impl_init((struct vigs_drm_gem_impl*)sfc_impl,
+ dev,
+ req.handle,
+ info_req.size,
+ name);
+
+ sfc_impl->base.width = info_req.width;
+ sfc_impl->base.height = info_req.height;
+ sfc_impl->base.stride = info_req.stride;
+ sfc_impl->base.format = info_req.format;
+ sfc_impl->base.scanout = info_req.scanout;
+ sfc_impl->base.id = info_req.id;
+
+ *sfc = &sfc_impl->base;
+
+ return 0;
+
+fail3:
+ vigs_drm_gem_close(dev, req.handle);
+fail2:
+ free(sfc_impl);
+fail1:
+ *sfc = NULL;
+
+ return ret;
+}
+
+int vigs_drm_surface_set_gpu_dirty(struct vigs_drm_surface *sfc)
+{
+ struct drm_vigs_surface_set_gpu_dirty req =
+ {
+ .handle = sfc->gem.handle
+ };
+ int ret;
+
+ ret = drmIoctl(sfc->gem.dev->fd, DRM_IOCTL_VIGS_SURFACE_SET_GPU_DIRTY, &req);
+
+ return (ret != 0) ? -errno : 0;
+}
+
+int vigs_drm_surface_start_access(struct vigs_drm_surface *sfc,
+ uint32_t saf)
+{
+ struct drm_vigs_surface_start_access req =
+ {
+ .address = (unsigned long)sfc->gem.vaddr,
+ .saf = saf
+ };
+ int ret;
+
+ ret = drmIoctl(sfc->gem.dev->fd, DRM_IOCTL_VIGS_SURFACE_START_ACCESS, &req);
+
+ return (ret != 0) ? -errno : 0;
+}
+
+int vigs_drm_surface_end_access(struct vigs_drm_surface *sfc,
+ int sync)
+{
+ struct drm_vigs_surface_end_access req =
+ {
+ .address = (unsigned long)sfc->gem.vaddr,
+ .sync = sync
+ };
+ int ret;
+
+ ret = drmIoctl(sfc->gem.dev->fd, DRM_IOCTL_VIGS_SURFACE_END_ACCESS, &req);
+
+ return (ret != 0) ? -errno : 0;
+}
+
+int vigs_drm_execbuffer_create(struct vigs_drm_device *dev,
+ uint32_t size,
+ struct vigs_drm_execbuffer **execbuffer)
+{
+ struct vigs_drm_execbuffer_impl *execbuffer_impl;
+ struct drm_vigs_create_execbuffer req =
+ {
+ .size = size
+ };
+ int ret;
+
+ execbuffer_impl = calloc(sizeof(*execbuffer_impl), 1);
+
+ if (!execbuffer_impl) {
+ ret = -ENOMEM;
+ goto fail1;
+ }
+
+ ret = drmIoctl(dev->fd, DRM_IOCTL_VIGS_CREATE_EXECBUFFER, &req);
+
+ if (ret != 0) {
+ ret = -errno;
+ goto fail2;
+ }
+
+ vigs_drm_gem_impl_init((struct vigs_drm_gem_impl*)execbuffer_impl,
+ dev,
+ req.handle,
+ req.size,
+ 0);
+
+ *execbuffer = &execbuffer_impl->base;
+
+ return 0;
+
+fail2:
+ free(execbuffer_impl);
+fail1:
+ *execbuffer = NULL;
+
+ return ret;
+}
+
+int vigs_drm_execbuffer_open(struct vigs_drm_device *dev,
+ uint32_t name,
+ struct vigs_drm_execbuffer **execbuffer)
+{
+ struct vigs_drm_execbuffer_impl *execbuffer_impl;
+ struct drm_gem_open req =
+ {
+ .name = name,
+ };
+ int ret;
+
+ execbuffer_impl = calloc(sizeof(*execbuffer_impl), 1);
+
+ if (!execbuffer_impl) {
+ ret = -ENOMEM;
+ goto fail1;
+ }
+
+ ret = drmIoctl(dev->fd, DRM_IOCTL_GEM_OPEN, &req);
+
+ if (ret != 0) {
+ ret = -errno;
+ goto fail2;
+ }
+
+ vigs_drm_gem_impl_init((struct vigs_drm_gem_impl*)execbuffer_impl,
+ dev,
+ req.handle,
+ req.size,
+ name);
+
+ *execbuffer = &execbuffer_impl->base;
+
+ return 0;
+
+fail2:
+ free(execbuffer_impl);
+fail1:
+ *execbuffer = NULL;
+
+ return ret;
+}
+
+int vigs_drm_execbuffer_exec(struct vigs_drm_execbuffer *execbuffer)
+{
+ struct drm_vigs_exec req =
+ {
+ .handle = execbuffer->gem.handle
+ };
+ int ret;
+
+ ret = drmIoctl(execbuffer->gem.dev->fd, DRM_IOCTL_VIGS_EXEC, &req);
+
+ return (ret != 0) ? -errno : 0;
+}
+
+int vigs_drm_fence_create(struct vigs_drm_device *dev,
+ int send,
+ struct vigs_drm_fence **fence)
+{
+ struct vigs_drm_fence_impl *fence_impl;
+ struct drm_vigs_create_fence req =
+ {
+ .send = send
+ };
+ int ret;
+
+ fence_impl = calloc(sizeof(*fence_impl), 1);
+
+ if (!fence_impl) {
+ ret = -ENOMEM;
+ goto fail1;
+ }
+
+ ret = drmIoctl(dev->fd, DRM_IOCTL_VIGS_CREATE_FENCE, &req);
+
+ if (ret != 0) {
+ ret = -errno;
+ goto fail2;
+ }
+
+ atomic_set(&fence_impl->ref_count, 1);
+ fence_impl->base.dev = dev;
+ fence_impl->base.handle = req.handle;
+ fence_impl->base.seq = req.seq;
+ fence_impl->base.signaled = 0;
+
+ *fence = &fence_impl->base;
+
+ return 0;
+
+fail2:
+ free(fence_impl);
+fail1:
+ *fence = NULL;
+
+ return ret;
+}
+
+void vigs_drm_fence_ref(struct vigs_drm_fence *fence)
+{
+ struct vigs_drm_fence_impl *fence_impl;
+
+ if (!fence) {
+ return;
+ }
+
+ fence_impl = vigs_containerof(fence, struct vigs_drm_fence_impl, base);
+
+ atomic_inc(&fence_impl->ref_count);
+}
+
+void vigs_drm_fence_unref(struct vigs_drm_fence *fence)
+{
+ struct vigs_drm_fence_impl *fence_impl;
+ struct drm_vigs_fence_unref req;
+
+ if (!fence) {
+ return;
+ }
+
+ fence_impl = vigs_containerof(fence, struct vigs_drm_fence_impl, base);
+
+ assert(atomic_read(&fence_impl->ref_count) > 0);
+ if (!atomic_dec_and_test(&fence_impl->ref_count)) {
+ return;
+ }
+
+ req.handle = fence->handle;
+
+ drmIoctl(fence->dev->fd, DRM_IOCTL_VIGS_FENCE_UNREF, &req);
+
+ free(fence_impl);
+}
+
+int vigs_drm_fence_wait(struct vigs_drm_fence *fence)
+{
+ struct drm_vigs_fence_wait req =
+ {
+ .handle = fence->handle
+ };
+ int ret;
+
+ ret = drmIoctl(fence->dev->fd, DRM_IOCTL_VIGS_FENCE_WAIT, &req);
+
+ return (ret != 0) ? -errno : 0;
+}
+
+int vigs_drm_fence_check(struct vigs_drm_fence *fence)
+{
+ struct drm_vigs_fence_signaled req =
+ {
+ .handle = fence->handle
+ };
+ int ret;
+
+ if (fence->signaled) {
+ return 0;
+ }
+
+ ret = drmIoctl(fence->dev->fd, DRM_IOCTL_VIGS_FENCE_SIGNALED, &req);
+
+ if (ret != 0) {
+ return -errno;
+ }
+
+ fence->signaled = req.signaled;
+
+ return 0;
+}
+
+int vigs_drm_plane_set_zpos(struct vigs_drm_device *dev,
+ uint32_t plane_id,
+ int zpos)
+{
+ struct drm_vigs_plane_set_zpos req =
+ {
+ .plane_id = plane_id,
+ .zpos = zpos
+ };
+ int ret;
+
+ ret = drmIoctl(dev->fd, DRM_IOCTL_VIGS_PLANE_SET_ZPOS, &req);
+
+ return (ret != 0) ? -errno : 0;
+}
+
+int vigs_drm_plane_set_transform(struct vigs_drm_device *dev,
+ uint32_t plane_id,
+ int hflip,
+ int vflip,
+ vigs_drm_rotation rotation)
+{
+ struct drm_vigs_plane_set_transform req =
+ {
+ .plane_id = plane_id,
+ .hflip = hflip,
+ .vflip = vflip,
+ .rotation = rotation
+ };
+ int ret;
+
+ ret = drmIoctl(dev->fd, DRM_IOCTL_VIGS_PLANE_SET_TRANSFORM, &req);
+
+ return (ret != 0) ? -errno : 0;
+}
+
+int vigs_drm_dp_surface_create(struct vigs_drm_device *dev,
+ uint32_t dp_plane,
+ uint32_t dp_fb_buf,
+ uint32_t dp_mem_flag,
+ uint32_t width,
+ uint32_t height,
+ uint32_t stride,
+ uint32_t format,
+ struct vigs_drm_surface **sfc)
+{
+ struct vigs_drm_surface_impl *sfc_impl;
+ struct drm_vigs_dp_create_surface req =
+ {
+ .dp_plane = dp_plane,
+ .dp_fb_buf = dp_fb_buf,
+ .dp_mem_flag = dp_mem_flag,
+ .width = width,
+ .height = height,
+ .stride = stride,
+ .format = format,
+ };
+ int ret;
+
+ sfc_impl = calloc(sizeof(*sfc_impl), 1);
+
+ if (!sfc_impl) {
+ ret = -ENOMEM;
+ goto fail1;
+ }
+
+ ret = drmIoctl(dev->fd, DRM_IOCTL_VIGS_DP_CREATE_SURFACE, &req);
+
+ if (ret != 0) {
+ ret = -errno;
+ goto fail2;
+ }
+
+ vigs_drm_gem_impl_init((struct vigs_drm_gem_impl*)sfc_impl,
+ dev,
+ req.handle,
+ req.size,
+ 0);
+
+ sfc_impl->base.width = width;
+ sfc_impl->base.height = height;
+ sfc_impl->base.stride = stride;
+ sfc_impl->base.format = format;
+ sfc_impl->base.scanout = 0;
+ sfc_impl->base.id = req.id;
+
+ *sfc = &sfc_impl->base;
+
+ return 0;
+
+fail2:
+ free(sfc_impl);
+fail1:
+ *sfc = NULL;
+
+ return ret;
+}
+
+int vigs_drm_dp_surface_open(struct vigs_drm_device *dev,
+ uint32_t dp_plane,
+ uint32_t dp_fb_buf,
+ uint32_t dp_mem_flag,
+ struct vigs_drm_surface **sfc)
+{
+ struct vigs_drm_surface_impl *sfc_impl;
+ struct drm_vigs_dp_open_surface req =
+ {
+ .dp_plane = dp_plane,
+ .dp_fb_buf = dp_fb_buf,
+ .dp_mem_flag = dp_mem_flag
+ };
+ struct drm_vigs_surface_info info_req;
+ int ret;
+
+ sfc_impl = calloc(sizeof(*sfc_impl), 1);
+
+ if (!sfc_impl) {
+ ret = -ENOMEM;
+ goto fail1;
+ }
+
+ ret = drmIoctl(dev->fd, DRM_IOCTL_VIGS_DP_OPEN_SURFACE, &req);
+
+ if (ret != 0) {
+ ret = -errno;
+ goto fail2;
+ }
+
+ info_req.handle = req.handle;
+
+ ret = drmIoctl(dev->fd, DRM_IOCTL_VIGS_SURFACE_INFO, &info_req);
+
+ if (ret != 0) {
+ ret = -errno;
+ goto fail3;
+ }
+
+ vigs_drm_gem_impl_init((struct vigs_drm_gem_impl*)sfc_impl,
+ dev,
+ req.handle,
+ info_req.size,
+ 0);
+
+ sfc_impl->base.width = info_req.width;
+ sfc_impl->base.height = info_req.height;
+ sfc_impl->base.stride = info_req.stride;
+ sfc_impl->base.format = info_req.format;
+ sfc_impl->base.scanout = info_req.scanout;
+ sfc_impl->base.id = info_req.id;
+
+ *sfc = &sfc_impl->base;
+
+ return 0;
+
+fail3:
+ vigs_drm_gem_close(dev, req.handle);
+fail2:
+ free(sfc_impl);
+fail1:
+ *sfc = NULL;
+
+ return ret;
+}
--- /dev/null
+/* vigs.h
+ *
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd.
+ * Authors:
+ * Stanislav Vorobiov <s.vorobiov@samsung.com>
+ *
+ * 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.
+ */
+
+#ifndef __VIGS_H__
+#define __VIGS_H__
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Surface formats.
+ */
+typedef enum
+{
+ vigs_drm_surface_bgrx8888 = 0x0,
+ vigs_drm_surface_bgra8888 = 0x1,
+} vigs_drm_surface_format;
+
+/*
+ * Rotations.
+ */
+typedef enum
+{
+ vigs_drm_rotation_0 = 0x0,
+ vigs_drm_rotation_90 = 0x1,
+ vigs_drm_rotation_180 = 0x2,
+ vigs_drm_rotation_270 = 0x3,
+} vigs_drm_rotation;
+
+/*
+ * Surface access flags.
+ */
+#define VIGS_DRM_SAF_READ 1
+#define VIGS_DRM_SAF_WRITE 2
+
+struct vigs_drm_device
+{
+ /* DRM fd. */
+ int fd;
+};
+
+struct vigs_drm_gem
+{
+ /* VIGS device object. */
+ struct vigs_drm_device *dev;
+
+ /* size of the buffer created. */
+ uint32_t size;
+
+ /* a gem handle to gem object created. */
+ uint32_t handle;
+
+ /* a gem global handle from flink request. initially 0. */
+ uint32_t name;
+
+ /* user space address to a gem buffer mmaped. initially NULL. */
+ void *vaddr;
+};
+
+struct vigs_drm_surface
+{
+ struct vigs_drm_gem gem;
+
+ uint32_t width;
+ uint32_t height;
+ uint32_t stride;
+ uint32_t format;
+ int scanout;
+ uint32_t id;
+};
+
+struct vigs_drm_execbuffer
+{
+ struct vigs_drm_gem gem;
+};
+
+struct vigs_drm_fence
+{
+ /* VIGS device object. */
+ struct vigs_drm_device *dev;
+
+ /* a handle to fence object. */
+ uint32_t handle;
+
+ /* fence sequence number. */
+ uint32_t seq;
+
+ /* is fence signaled ? updated on 'vigs_drm_fence_check'. */
+ int signaled;
+};
+
+/*
+ * All functions return 0 on success and < 0 on error, i.e. kernel style:
+ * return -ENOMEM;
+ */
+
+/*
+ * Device functions.
+ * @{
+ */
+
+/*
+ * Returns -EINVAL on driver version mismatch.
+ */
+int vigs_drm_device_create(int fd, struct vigs_drm_device **dev);
+
+void vigs_drm_device_destroy(struct vigs_drm_device *dev);
+
+int vigs_drm_device_get_protocol_version(struct vigs_drm_device *dev,
+ uint32_t *protocol_version);
+
+/*
+ * @}
+ */
+
+/*
+ * GEM functions.
+ * @{
+ */
+
+/*
+ * Passing NULL won't hurt, this is for convenience.
+ */
+void vigs_drm_gem_ref(struct vigs_drm_gem *gem);
+
+/*
+ * Passing NULL won't hurt, this is for convenience.
+ */
+void vigs_drm_gem_unref(struct vigs_drm_gem *gem);
+
+int vigs_drm_gem_get_name(struct vigs_drm_gem *gem);
+
+int vigs_drm_gem_map(struct vigs_drm_gem *gem, int track_access);
+
+void vigs_drm_gem_unmap(struct vigs_drm_gem *gem);
+
+int vigs_drm_gem_wait(struct vigs_drm_gem *gem);
+
+/*
+ * @}
+ */
+
+/*
+ * Surface functions.
+ * @{
+ */
+
+int vigs_drm_surface_create(struct vigs_drm_device *dev,
+ uint32_t width,
+ uint32_t height,
+ uint32_t stride,
+ uint32_t format,
+ int scanout,
+ struct vigs_drm_surface **sfc);
+
+int vigs_drm_surface_open(struct vigs_drm_device *dev,
+ uint32_t name,
+ struct vigs_drm_surface **sfc);
+
+int vigs_drm_surface_set_gpu_dirty(struct vigs_drm_surface *sfc);
+
+int vigs_drm_surface_start_access(struct vigs_drm_surface *sfc,
+ uint32_t saf);
+
+int vigs_drm_surface_end_access(struct vigs_drm_surface *sfc,
+ int sync);
+
+/*
+ * @}
+ */
+
+/*
+ * Execbuffer functions.
+ * @{
+ */
+
+int vigs_drm_execbuffer_create(struct vigs_drm_device *dev,
+ uint32_t size,
+ struct vigs_drm_execbuffer **execbuffer);
+
+int vigs_drm_execbuffer_open(struct vigs_drm_device *dev,
+ uint32_t name,
+ struct vigs_drm_execbuffer **execbuffer);
+
+int vigs_drm_execbuffer_exec(struct vigs_drm_execbuffer *execbuffer);
+
+/*
+ * @}
+ */
+
+/*
+ * Fence functions.
+ * @{
+ */
+
+int vigs_drm_fence_create(struct vigs_drm_device *dev,
+ int send,
+ struct vigs_drm_fence **fence);
+
+/*
+ * Passing NULL won't hurt, this is for convenience.
+ */
+void vigs_drm_fence_ref(struct vigs_drm_fence *fence);
+
+/*
+ * Passing NULL won't hurt, this is for convenience.
+ */
+void vigs_drm_fence_unref(struct vigs_drm_fence *fence);
+
+int vigs_drm_fence_wait(struct vigs_drm_fence *fence);
+
+int vigs_drm_fence_check(struct vigs_drm_fence *fence);
+
+/*
+ * @}
+ */
+
+/*
+ * Plane functions.
+ * @{
+ */
+
+int vigs_drm_plane_set_zpos(struct vigs_drm_device *dev,
+ uint32_t plane_id,
+ int zpos);
+
+int vigs_drm_plane_set_transform(struct vigs_drm_device *dev,
+ uint32_t plane_id,
+ int hflip,
+ int vflip,
+ vigs_drm_rotation rotation);
+
+/*
+ * @}
+ */
+
+/*
+ * DP functions.
+ * @{
+ */
+
+int vigs_drm_dp_surface_create(struct vigs_drm_device *dev,
+ uint32_t dp_plane,
+ uint32_t dp_fb_buf,
+ uint32_t dp_mem_flag,
+ uint32_t width,
+ uint32_t height,
+ uint32_t stride,
+ uint32_t format,
+ struct vigs_drm_surface **sfc);
+
+int vigs_drm_dp_surface_open(struct vigs_drm_device *dev,
+ uint32_t dp_plane,
+ uint32_t dp_fb_buf,
+ uint32_t dp_mem_flag,
+ struct vigs_drm_surface **sfc);
+
+/*
+ * @}
+ */
+
+#ifdef __cplusplus
+};
+#endif /* __cplusplus */
+
+#endif