summaryrefslogtreecommitdiff
path: root/driver/xf86-video-intel
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2010-05-23 21:28:36 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2010-05-23 21:28:36 +0000
commitba2f383e77776d85eb2bd3cc967a62a6e22bab82 (patch)
tree41a554f264163f154ab10cae22ac71a45b782e5b /driver/xf86-video-intel
parent53da33b453513847adcf98dad0bcd2442da4046f (diff)
Pull in the changes in rendering that I skipped when i backported
changes from later intel versions (after the UMS removal). 95% of this is the xvmc reworks that makes that code even halfway sane. xvmc is now enabled by default on 965+. Tested by many on tech@, thanks! ok matthieu@
Diffstat (limited to 'driver/xf86-video-intel')
-rw-r--r--driver/xf86-video-intel/Makefile.in28
-rw-r--r--driver/xf86-video-intel/aclocal.m4525
-rw-r--r--driver/xf86-video-intel/configure2937
-rw-r--r--driver/xf86-video-intel/configure.ac4
-rw-r--r--driver/xf86-video-intel/man/Makefile.in48
-rw-r--r--driver/xf86-video-intel/src/Makefile.am2
-rw-r--r--driver/xf86-video-intel/src/Makefile.in16
-rw-r--r--driver/xf86-video-intel/src/bios_reader/Makefile.in7
-rw-r--r--driver/xf86-video-intel/src/ch7017/Makefile.in7
-rw-r--r--driver/xf86-video-intel/src/ch7xxx/Makefile.in7
-rw-r--r--driver/xf86-video-intel/src/i810_video.c2
-rw-r--r--driver/xf86-video-intel/src/i830.h3
-rw-r--r--driver/xf86-video-intel/src/i830_dri.c30
-rw-r--r--driver/xf86-video-intel/src/i830_dri.h61
-rw-r--r--driver/xf86-video-intel/src/i830_driver.c8
-rw-r--r--driver/xf86-video-intel/src/i830_hwmc.c275
-rw-r--r--driver/xf86-video-intel/src/i830_hwmc.h62
-rw-r--r--driver/xf86-video-intel/src/i830_uxa.c2
-rw-r--r--driver/xf86-video-intel/src/i830_video.c455
-rw-r--r--driver/xf86-video-intel/src/i830_video.h5
-rw-r--r--driver/xf86-video-intel/src/i915_hwmc.c904
-rw-r--r--driver/xf86-video-intel/src/i915_hwmc.h59
-rw-r--r--driver/xf86-video-intel/src/i915_video.c2
-rw-r--r--driver/xf86-video-intel/src/i965_hwmc.c282
-rw-r--r--driver/xf86-video-intel/src/i965_hwmc.h28
-rw-r--r--driver/xf86-video-intel/src/i965_video.c6
-rw-r--r--driver/xf86-video-intel/src/ivch/Makefile.in7
-rw-r--r--driver/xf86-video-intel/src/reg_dumper/Makefile.in7
-rw-r--r--driver/xf86-video-intel/src/render_program/Makefile.in7
-rw-r--r--driver/xf86-video-intel/src/sil164/Makefile.in7
-rw-r--r--driver/xf86-video-intel/src/tfp410/Makefile.in7
-rw-r--r--driver/xf86-video-intel/src/xvmc/Makefile.am4
-rw-r--r--driver/xf86-video-intel/src/xvmc/Makefile.in21
-rw-r--r--driver/xf86-video-intel/src/xvmc/dri2.c298
-rw-r--r--driver/xf86-video-intel/src/xvmc/dri2.h65
-rw-r--r--driver/xf86-video-intel/src/xvmc/i915_structs.h121
-rw-r--r--driver/xf86-video-intel/src/xvmc/i915_xvmc.c1894
-rw-r--r--driver/xf86-video-intel/src/xvmc/i915_xvmc.h52
-rw-r--r--driver/xf86-video-intel/src/xvmc/i965_xvmc.c100
-rw-r--r--driver/xf86-video-intel/src/xvmc/i965_xvmc.h1
-rw-r--r--driver/xf86-video-intel/src/xvmc/intel_batchbuffer.c23
-rw-r--r--driver/xf86-video-intel/src/xvmc/intel_xvmc.c326
-rw-r--r--driver/xf86-video-intel/src/xvmc/intel_xvmc.h51
-rw-r--r--driver/xf86-video-intel/src/xvmc/intel_xvmc_dump.c10
-rw-r--r--driver/xf86-video-intel/src/xvmc/shader/Makefile.in7
-rw-r--r--driver/xf86-video-intel/src/xvmc/shader/mc/Makefile.in8
-rw-r--r--driver/xf86-video-intel/src/xvmc/shader/vld/Makefile.in13
-rw-r--r--driver/xf86-video-intel/src/xvmc/xvmc_vld.c157
-rw-r--r--driver/xf86-video-intel/src/xvmc/xvmc_vld.h1
-rw-r--r--driver/xf86-video-intel/uxa/Makefile.in12
50 files changed, 3006 insertions, 5958 deletions
diff --git a/driver/xf86-video-intel/Makefile.in b/driver/xf86-video-intel/Makefile.in
index e5aced424..0e5cfce5a 100644
--- a/driver/xf86-video-intel/Makefile.in
+++ b/driver/xf86-video-intel/Makefile.in
@@ -57,8 +57,9 @@ build_triplet = @build@
host_triplet = @host@
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/config.h.in \
- $(top_srcdir)/configure AUTHORS COPYING NEWS compile \
- config.guess config.sub depcomp install-sh ltmain.sh missing
+ $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
+ compile config.guess config.sub depcomp install-sh ltmain.sh \
+ missing
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
@@ -90,12 +91,14 @@ am__remove_distdir = \
DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ADMIN_MAN_DIR = @ADMIN_MAN_DIR@
ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -148,6 +151,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -222,7 +226,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -251,9 +254,8 @@ sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
-AUTOMAKE_OPTIONS = foreign
SUBDIRS = uxa src man
-EXTRA_DIST = README AUTHORS NEWS
+MAINTAINERCLEANFILES = ChangeLog INSTALL
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -495,6 +497,9 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-hook
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
@@ -621,6 +626,7 @@ distclean-generic:
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
@@ -676,7 +682,7 @@ uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
check-am clean clean-generic clean-libtool clean-recursive \
ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
- dist-shar dist-tarZ dist-zip distcheck distclean \
+ dist-hook dist-shar dist-tarZ dist-zip distcheck distclean \
distclean-generic distclean-hdr distclean-libtool \
distclean-recursive distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
@@ -688,6 +694,16 @@ uninstall-info: uninstall-info-recursive
mostlyclean-libtool mostlyclean-recursive pdf pdf-am ps ps-am \
tags tags-recursive uninstall uninstall-am uninstall-info-am
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/driver/xf86-video-intel/aclocal.m4 b/driver/xf86-video-intel/aclocal.m4
index 62077ea56..ec8edc72c 100644
--- a/driver/xf86-video-intel/aclocal.m4
+++ b/driver/xf86-video-intel/aclocal.m4
@@ -7664,29 +7664,23 @@ dnl
dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
-dnl copy of this software and associated documentation files (the
-dnl "Software"), to deal in the Software without restriction, including
-dnl without limitation the rights to use, copy, modify, merge, publish,
-dnl distribute, and/or sell copies of the Software, and to permit persons
-dnl to whom the Software is furnished to do so, provided that the above
-dnl copyright notice(s) and this permission notice appear in all copies of
-dnl the Software and that both the above copyright notice(s) and this
-dnl permission notice appear in supporting documentation.
+dnl copy of this software and associated documentation files (the "Software"),
+dnl to deal in the Software without restriction, including without limitation
+dnl the rights to use, copy, modify, merge, publish, distribute, sublicense,
+dnl and/or sell copies of the Software, and to permit persons to whom the
+dnl Software is furnished to do so, subject to the following conditions:
dnl
-dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
-dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
-dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
-dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+dnl The above copyright notice and this permission notice (including the next
+dnl paragraph) shall be included in all copies or substantial portions of the
+dnl Software.
dnl
-dnl Except as contained in this notice, the name of a copyright holder
-dnl shall not be used in advertising or otherwise to promote the sale, use
-dnl or other dealings in this Software without prior written authorization
-dnl of the copyright holder.
+dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+dnl FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+dnl THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+dnl DEALINGS IN THE SOFTWARE.
# XORG_MACROS_VERSION(required-version)
# -------------------------------------
@@ -7704,7 +7698,7 @@ dnl of the copyright holder.
# See the "minimum version" comment for each macro you use to see what
# version you require.
m4_defun([XORG_MACROS_VERSION],[
-m4_define([vers_have], [1.3.0])
+m4_define([vers_have], [1.6.1])
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.])))
m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
m4_if(m4_cmp(maj_have, maj_needed), 0,,
@@ -7868,7 +7862,7 @@ fi
AC_PATH_PROG(LINUXDOC, linuxdoc)
AC_PATH_PROG(PS2PDF, ps2pdf)
-AC_MSG_CHECKING([Whether to build documentation])
+AC_MSG_CHECKING([whether to build documentation])
if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
BUILDDOC=yes
@@ -7880,7 +7874,7 @@ AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
AC_MSG_RESULT([$BUILDDOC])
-AC_MSG_CHECKING([Whether to build pdf documentation])
+AC_MSG_CHECKING([whether to build pdf documentation])
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
BUILDPDFDOC=yes
@@ -7928,7 +7922,7 @@ AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
-AC_MSG_CHECKING([Whether to build text documentation])
+AC_MSG_CHECKING([whether to build text documentation])
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
test x$BUILD_TXTDOC != xno; then
BUILDTXTDOC=yes
@@ -7936,7 +7930,7 @@ fi
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
AC_MSG_RESULT([$BUILDTXTDOC])
-AC_MSG_CHECKING([Whether to build PDF documentation])
+AC_MSG_CHECKING([whether to build PDF documentation])
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
test x$BUILD_PDFDOC != xno; then
BUILDPDFDOC=yes
@@ -7944,7 +7938,7 @@ fi
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
AC_MSG_RESULT([$BUILDPDFDOC])
-AC_MSG_CHECKING([Whether to build PostScript documentation])
+AC_MSG_CHECKING([whether to build PostScript documentation])
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
test x$BUILD_PSDOC != xno; then
BUILDPSDOC=yes
@@ -7952,7 +7946,7 @@ fi
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
AC_MSG_RESULT([$BUILDPSDOC])
-AC_MSG_CHECKING([Whether to build HTML documentation])
+AC_MSG_CHECKING([whether to build HTML documentation])
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
test x$BUILD_HTMLDOC != xno; then
BUILDHTMLDOC=yes
@@ -7971,7 +7965,7 @@ AC_SUBST(MAKE_PDF)
AC_SUBST(MAKE_HTML)
]) # XORG_CHECK_DOCBOOK
-# XORG_WITH_XMLTO
+# XORG_WITH_XMLTO([MIN-VERSION])
# ----------------
# Minimum version: 1.5.0
#
@@ -8008,7 +8002,7 @@ if test "x$use_xmlto" = x"auto"; then
elif test "x$use_xmlto" = x"yes" ; then
AC_PATH_PROG([XMLTO], [xmlto])
if test "x$XMLTO" = "x"; then
- AC_MSG_WARN([--with-xmlto=yes specified but xmlto not found in PATH])
+ AC_MSG_ERROR([--with-xmlto=yes specified but xmlto not found in PATH])
fi
have_xmlto=yes
elif test "x$use_xmlto" = x"no" ; then
@@ -8019,8 +8013,441 @@ elif test "x$use_xmlto" = x"no" ; then
else
AC_MSG_ERROR([--with-xmlto expects 'yes' or 'no'])
fi
+m4_ifval([$1],
+[if test "$have_xmlto" = yes; then
+ # scrape the xmlto version
+ AC_MSG_CHECKING([the xmlto version])
+ xmlto_version=`$XMLTO --version 2>/dev/null | cut -d' ' -f3`
+ AC_MSG_RESULT([$xmlto_version])
+ AS_VERSION_COMPARE([$xmlto_version], [$1],
+ [if test "x$use_xmlto" = xauto; then
+ AC_MSG_WARN([xmlto version $xmlto_version found, but $1 needed])
+ have_xmlto=no
+ else
+ AC_MSG_ERROR([xmlto version $xmlto_version found, but $1 needed])
+ fi])
+fi])
AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes])
-]) # XORG_CHECK_XMLTO
+]) # XORG_WITH_XMLTO
+
+# XORG_WITH_ASCIIDOC([MIN-VERSION])
+# ----------------
+# Minimum version: 1.5.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-asciidoc option, it allows maximum flexibilty in making decisions
+# as whether or not to use the asciidoc package.
+#
+# Interface to module:
+# HAVE_ASCIIDOC: used in makefiles to conditionally generate documentation
+# ASCIIDOC: returns the path of the asciidoc program found
+# returns the path set by the user in the environment
+# --with-asciidoc: 'yes' user instructs the module to use asciidoc
+# 'no' user instructs the module not to use asciidoc
+#
+# If the user sets the value of ASCIIDOC, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_ASCIIDOC],[
+AC_ARG_VAR([ASCIIDOC], [Path to asciidoc command])
+AC_ARG_WITH(asciidoc,
+ AS_HELP_STRING([--with-asciidoc],
+ [Use asciidoc to regenerate documentation (default: yes, if installed)]),
+ [use_asciidoc=$withval], [use_asciidoc=auto])
+
+if test "x$use_asciidoc" = x"auto"; then
+ AC_PATH_PROG([ASCIIDOC], [asciidoc])
+ if test "x$ASCIIDOC" = "x"; then
+ AC_MSG_WARN([asciidoc not found - documentation targets will be skipped])
+ have_asciidoc=no
+ else
+ have_asciidoc=yes
+ fi
+elif test "x$use_asciidoc" = x"yes" ; then
+ AC_PATH_PROG([ASCIIDOC], [asciidoc])
+ if test "x$ASCIIDOC" = "x"; then
+ AC_MSG_ERROR([--with-asciidoc=yes specified but asciidoc not found in PATH])
+ fi
+ have_asciidoc=yes
+elif test "x$use_asciidoc" = x"no" ; then
+ if test "x$ASCIIDOC" != "x"; then
+ AC_MSG_WARN([ignoring ASCIIDOC environment variable since --with-asciidoc=no was specified])
+ fi
+ have_asciidoc=no
+else
+ AC_MSG_ERROR([--with-asciidoc expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_asciidoc" = yes; then
+ # scrape the asciidoc version
+ AC_MSG_CHECKING([the asciidoc version])
+ asciidoc_version=`$ASCIIDOC --version 2>/dev/null | cut -d' ' -f2`
+ AC_MSG_RESULT([$asciidoc_version])
+ AS_VERSION_COMPARE([$asciidoc_version], [$1],
+ [if test "x$use_asciidoc" = xauto; then
+ AC_MSG_WARN([asciidoc version $asciidoc_version found, but $1 needed])
+ have_asciidoc=no
+ else
+ AC_MSG_ERROR([asciidoc version $asciidoc_version found, but $1 needed])
+ fi])
+fi])
+AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
+]) # XORG_WITH_ASCIIDOC
+
+# XORG_WITH_DOXYGEN([MIN-VERSION])
+# --------------------------------
+# Minimum version: 1.5.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-doxygen option, it allows maximum flexibilty in making decisions
+# as whether or not to use the doxygen package.
+#
+# Interface to module:
+# HAVE_DOXYGEN: used in makefiles to conditionally generate documentation
+# DOXYGEN: returns the path of the doxygen program found
+# returns the path set by the user in the environment
+# --with-doxygen: 'yes' user instructs the module to use doxygen
+# 'no' user instructs the module not to use doxygen
+#
+# If the user sets the value of DOXYGEN, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_DOXYGEN],[
+AC_ARG_VAR([DOXYGEN], [Path to doxygen command])
+AC_ARG_WITH(doxygen,
+ AS_HELP_STRING([--with-doxygen],
+ [Use doxygen to regenerate documentation (default: yes, if installed)]),
+ [use_doxygen=$withval], [use_doxygen=auto])
+
+if test "x$use_doxygen" = x"auto"; then
+ AC_PATH_PROG([DOXYGEN], [doxygen])
+ if test "x$DOXYGEN" = "x"; then
+ AC_MSG_WARN([doxygen not found - documentation targets will be skipped])
+ have_doxygen=no
+ else
+ have_doxygen=yes
+ fi
+elif test "x$use_doxygen" = x"yes" ; then
+ AC_PATH_PROG([DOXYGEN], [doxygen])
+ if test "x$DOXYGEN" = "x"; then
+ AC_MSG_ERROR([--with-doxygen=yes specified but doxygen not found in PATH])
+ fi
+ have_doxygen=yes
+elif test "x$use_doxygen" = x"no" ; then
+ if test "x$DOXYGEN" != "x"; then
+ AC_MSG_WARN([ignoring DOXYGEN environment variable since --with-doxygen=no was specified])
+ fi
+ have_doxygen=no
+else
+ AC_MSG_ERROR([--with-doxygen expects 'yes' or 'no'])
+fi
+m4_ifval([$1],
+[if test "$have_doxygen" = yes; then
+ # scrape the doxygen version
+ AC_MSG_CHECKING([the doxygen version])
+ doxygen_version=`$DOXYGEN --version 2>/dev/null`
+ AC_MSG_RESULT([$doxygen_version])
+ AS_VERSION_COMPARE([$doxygen_version], [$1],
+ [if test "x$use_doxygen" = xauto; then
+ AC_MSG_WARN([doxygen version $doxygen_version found, but $1 needed])
+ have_doxygen=no
+ else
+ AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
+ fi])
+fi])
+AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
+]) # XORG_WITH_DOXYGEN
+
+# XORG_WITH_GROFF
+# ----------------
+# Minimum version: 1.6.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-groff option, it allows maximum flexibilty in making decisions
+# as whether or not to use the groff package.
+#
+# Interface to module:
+# HAVE_GROFF: used in makefiles to conditionally generate documentation
+# HAVE_GROFF_MM: the memorandum macros (-mm) package
+# HAVE_GROFF_MS: the -ms macros package
+# GROFF: returns the path of the groff program found
+# returns the path set by the user in the environment
+# --with-groff: 'yes' user instructs the module to use groff
+# 'no' user instructs the module not to use groff
+#
+# If the user sets the value of GROFF, AC_PATH_PROG skips testing the path.
+#
+# OS and distros often splits groff in a basic and full package, the former
+# having the groff program and the later having devices, fonts and macros
+# Checking for the groff executable is not enough.
+#
+# If macros are missing, we cannot assume that groff is useless, so we don't
+# unset HAVE_GROFF or GROFF env variables.
+# HAVE_GROFF_?? can never be true while HAVE_GROFF is false.
+#
+AC_DEFUN([XORG_WITH_GROFF],[
+AC_ARG_VAR([GROFF], [Path to groff command])
+AC_ARG_WITH(groff,
+ AS_HELP_STRING([--with-groff],
+ [Use groff to regenerate documentation (default: yes, if installed)]),
+ [use_groff=$withval], [use_groff=auto])
+
+if test "x$use_groff" = x"auto"; then
+ AC_PATH_PROG([GROFF], [groff])
+ if test "x$GROFF" = "x"; then
+ AC_MSG_WARN([groff not found - documentation targets will be skipped])
+ have_groff=no
+ else
+ have_groff=yes
+ fi
+elif test "x$use_groff" = x"yes" ; then
+ AC_PATH_PROG([GROFF], [groff])
+ if test "x$GROFF" = "x"; then
+ AC_MSG_ERROR([--with-groff=yes specified but groff not found in PATH])
+ fi
+ have_groff=yes
+elif test "x$use_groff" = x"no" ; then
+ if test "x$GROFF" != "x"; then
+ AC_MSG_WARN([ignoring GROFF environment variable since --with-groff=no was specified])
+ fi
+ have_groff=no
+else
+ AC_MSG_ERROR([--with-groff expects 'yes' or 'no'])
+fi
+# We have groff, test for the presence of the macro packages
+if test "x$have_groff" = x"yes"; then
+ AC_MSG_CHECKING([for ${GROFF} -ms macros])
+ if ${GROFF} -ms -I. /dev/null >/dev/null 2>&1 ; then
+ groff_ms_works=yes
+ else
+ groff_ms_works=no
+ fi
+ AC_MSG_RESULT([$groff_ms_works])
+ AC_MSG_CHECKING([for ${GROFF} -mm macros])
+ if ${GROFF} -mm -I. /dev/null >/dev/null 2>&1 ; then
+ groff_mm_works=yes
+ else
+ groff_mm_works=no
+ fi
+ AC_MSG_RESULT([$groff_mm_works])
+fi
+AM_CONDITIONAL([HAVE_GROFF], [test "$have_groff" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MS], [test "$groff_ms_works" = yes])
+AM_CONDITIONAL([HAVE_GROFF_MM], [test "$groff_mm_works" = yes])
+]) # XORG_WITH_GROFF
+
+# XORG_WITH_FOP
+# ----------------
+# Minimum version: 1.6.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-fop option, it allows maximum flexibilty in making decisions
+# as whether or not to use the fop package.
+#
+# Interface to module:
+# HAVE_FOP: used in makefiles to conditionally generate documentation
+# FOP: returns the path of the fop program found
+# returns the path set by the user in the environment
+# --with-fop: 'yes' user instructs the module to use fop
+# 'no' user instructs the module not to use fop
+#
+# If the user sets the value of FOP, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_FOP],[
+AC_ARG_VAR([FOP], [Path to fop command])
+AC_ARG_WITH(fop,
+ AS_HELP_STRING([--with-fop],
+ [Use fop to regenerate documentation (default: yes, if installed)]),
+ [use_fop=$withval], [use_fop=auto])
+
+if test "x$use_fop" = x"auto"; then
+ AC_PATH_PROG([FOP], [fop])
+ if test "x$FOP" = "x"; then
+ AC_MSG_WARN([fop not found - documentation targets will be skipped])
+ have_fop=no
+ else
+ have_fop=yes
+ fi
+elif test "x$use_fop" = x"yes" ; then
+ AC_PATH_PROG([FOP], [fop])
+ if test "x$FOP" = "x"; then
+ AC_MSG_ERROR([--with-fop=yes specified but fop not found in PATH])
+ fi
+ have_fop=yes
+elif test "x$use_fop" = x"no" ; then
+ if test "x$FOP" != "x"; then
+ AC_MSG_WARN([ignoring FOP environment variable since --with-fop=no was specified])
+ fi
+ have_fop=no
+else
+ AC_MSG_ERROR([--with-fop expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
+]) # XORG_WITH_FOP
+
+# XORG_WITH_PS2PDF
+# ----------------
+# Minimum version: 1.6.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a module to test for the
+# presence of the tool and obtain it's path in separate variables. Coupled with
+# the --with-ps2pdf option, it allows maximum flexibilty in making decisions
+# as whether or not to use the ps2pdf package.
+#
+# Interface to module:
+# HAVE_PS2PDF: used in makefiles to conditionally generate documentation
+# PS2PDF: returns the path of the ps2pdf program found
+# returns the path set by the user in the environment
+# --with-ps2pdf: 'yes' user instructs the module to use ps2pdf
+# 'no' user instructs the module not to use ps2pdf
+#
+# If the user sets the value of PS2PDF, AC_PATH_PROG skips testing the path.
+#
+AC_DEFUN([XORG_WITH_PS2PDF],[
+AC_ARG_VAR([PS2PDF], [Path to ps2pdf command])
+AC_ARG_WITH(ps2pdf,
+ AS_HELP_STRING([--with-ps2pdf],
+ [Use ps2pdf to regenerate documentation (default: yes, if installed)]),
+ [use_ps2pdf=$withval], [use_ps2pdf=auto])
+
+if test "x$use_ps2pdf" = x"auto"; then
+ AC_PATH_PROG([PS2PDF], [ps2pdf])
+ if test "x$PS2PDF" = "x"; then
+ AC_MSG_WARN([ps2pdf not found - documentation targets will be skipped])
+ have_ps2pdf=no
+ else
+ have_ps2pdf=yes
+ fi
+elif test "x$use_ps2pdf" = x"yes" ; then
+ AC_PATH_PROG([PS2PDF], [ps2pdf])
+ if test "x$PS2PDF" = "x"; then
+ AC_MSG_ERROR([--with-ps2pdf=yes specified but ps2pdf not found in PATH])
+ fi
+ have_ps2pdf=yes
+elif test "x$use_ps2pdf" = x"no" ; then
+ if test "x$PS2PDF" != "x"; then
+ AC_MSG_WARN([ignoring PS2PDF environment variable since --with-ps2pdf=no was specified])
+ fi
+ have_ps2pdf=no
+else
+ AC_MSG_ERROR([--with-ps2pdf expects 'yes' or 'no'])
+fi
+AM_CONDITIONAL([HAVE_PS2PDF], [test "$have_ps2pdf" = yes])
+]) # XORG_WITH_PS2PDF
+
+# XORG_ENABLE_DOCS (enable_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# Documentation tools are not always available on all platforms and sometimes
+# not at the appropriate level. This macro enables a builder to skip all
+# documentation targets except traditional man pages.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO --with-xmlto
+# XORG_WITH_ASCIIDOC --with-asciidoc
+# XORG_WITH_DOXYGEN --with-doxygen
+# XORG_WITH_FOP --with-fop
+# XORG_WITH_GROFF --with-groff
+# XORG_WITH_PS2PDF --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DOCS: used in makefiles to conditionally generate documentation
+# --enable-docs: 'yes' user instructs the module to generate docs
+# 'no' user instructs the module not to generate docs
+# parm1: specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DOCS],[
+default=$1
+if test "x$default" = x ; then
+ default="yes"
+fi
+AC_ARG_ENABLE(docs,
+ AS_HELP_STRING([--enable-docs],
+ [Enable building the documentation (default: yes)]),
+ [build_docs=$enableval], [build_docs=$default])
+AM_CONDITIONAL(ENABLE_DOCS, [test x$build_docs = xyes])
+AC_MSG_CHECKING([whether to build documentation])
+AC_MSG_RESULT([$build_docs])
+]) # XORG_ENABLE_DOCS
+
+# XORG_ENABLE_DEVEL_DOCS (enable_devel_docs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all developer documentation.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO --with-xmlto
+# XORG_WITH_ASCIIDOC --with-asciidoc
+# XORG_WITH_DOXYGEN --with-doxygen
+# XORG_WITH_FOP --with-fop
+# XORG_WITH_GROFF --with-groff
+# XORG_WITH_PS2PDF --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_DEVEL_DOCS: used in makefiles to conditionally generate developer docs
+# --enable-devel-docs: 'yes' user instructs the module to generate developer docs
+# 'no' user instructs the module not to generate developer docs
+# parm1: specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_DEVEL_DOCS],[
+devel_default=$1
+if test "x$devel_default" = x ; then
+ devel_default="yes"
+fi
+AC_ARG_ENABLE(devel-docs,
+ AS_HELP_STRING([--enable-devel-docs],
+ [Enable building the developer documentation (default: yes)]),
+ [build_devel_docs=$enableval], [build_devel_docs=$devel_default])
+AM_CONDITIONAL(ENABLE_DEVEL_DOCS, [test x$build_devel_docs = xyes])
+AC_MSG_CHECKING([whether to build developer documentation])
+AC_MSG_RESULT([$build_devel_docs])
+]) # XORG_ENABLE_DEVEL_DOCS
+
+# XORG_ENABLE_SPECS (enable_specs=yes)
+# ----------------
+# Minimum version: 1.6.0
+#
+# This macro enables a builder to skip all functional specification targets.
+# Combined with the specific tool checking macros XORG_WITH_*, it provides
+# maximum flexibilty in controlling documentation building.
+# Refer to:
+# XORG_WITH_XMLTO --with-xmlto
+# XORG_WITH_ASCIIDOC --with-asciidoc
+# XORG_WITH_DOXYGEN --with-doxygen
+# XORG_WITH_FOP --with-fop
+# XORG_WITH_GROFF --with-groff
+# XORG_WITH_PS2PDF --with-ps2pdf
+#
+# Interface to module:
+# ENABLE_SPECS: used in makefiles to conditionally generate specs
+# --enable-specs: 'yes' user instructs the module to generate specs
+# 'no' user instructs the module not to generate specs
+# parm1: specify the default value, yes or no.
+#
+AC_DEFUN([XORG_ENABLE_SPECS],[
+spec_default=$1
+if test "x$spec_default" = x ; then
+ spec_default="yes"
+fi
+AC_ARG_ENABLE(specs,
+ AS_HELP_STRING([--enable-specs],
+ [Enable building the specs (default: yes)]),
+ [build_specs=$enableval], [build_specs=$spec_default])
+AM_CONDITIONAL(ENABLE_SPECS, [test x$build_specs = xyes])
+AC_MSG_CHECKING([whether to build functional specifications])
+AC_MSG_RESULT([$build_specs])
+]) # XORG_ENABLE_SPECS
# XORG_CHECK_MALLOC_ZERO
# ----------------------
@@ -8051,7 +8478,8 @@ main() {
exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
}],
[MALLOC_ZERO_RETURNS_NULL=yes],
- [MALLOC_ZERO_RETURNS_NULL=no])
+ [MALLOC_ZERO_RETURNS_NULL=no],
+ [MALLOC_ZERO_RETURNS_NULL=yes])
fi
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
@@ -8153,7 +8581,7 @@ AC_REQUIRE([AC_PROG_CC])
if test "x$GCC" = xyes ; then
CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
--Wbad-function-cast"
+-Wbad-function-cast -Wformat=2"
case `$CC -dumpversion` in
3.4.* | 4.*)
CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
@@ -8166,7 +8594,6 @@ else
fi
fi
AC_SUBST(CWARNFLAGS)
-m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
]) # XORG_CWARNFLAGS
# XORG_STRICT_OPTION
@@ -8209,8 +8636,28 @@ XORG_CWARNFLAGS
XORG_STRICT_OPTION
XORG_RELEASE_VERSION
XORG_CHANGELOG
+XORG_INSTALL
XORG_MANPAGE_SECTIONS
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
+ [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
]) # XORG_DEFAULT_OPTIONS
+
+# XORG_INSTALL()
+# ----------------
+# Minimum version: 1.4.0
+#
+# Defines the variable INSTALL_CMD as the command to copy
+# INSTALL from $prefix/share/util-macros.
+#
+AC_DEFUN([XORG_INSTALL], [
+AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+AC_SUBST([INSTALL_CMD])
+]) # XORG_INSTALL
dnl Copyright 2005 Red Hat, Inc
dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
@@ -8280,14 +8727,13 @@ AC_DEFUN([XORG_RELEASE_VERSION],[
# Defines the variable CHANGELOG_CMD as the command to generate
# ChangeLog from git.
#
-# Arrange that distcleancheck ignores ChangeLog left over by distclean.
#
AC_DEFUN([XORG_CHANGELOG], [
-CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
-mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
echo 'git directory not found: installing possibly empty changelog.' >&2)"
AC_SUBST([CHANGELOG_CMD])
-AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
]) # XORG_CHANGELOG
dnl Copyright 2005 Red Hat, Inc
@@ -8321,8 +8767,9 @@ dnl
# is defined, then add $1 to $REQUIRED_MODULES.
AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
+ AC_REQUIRE([PKG_PROG_PKG_CONFIG])
SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
+ CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include "xorg-server.h"
#if !defined $1
diff --git a/driver/xf86-video-intel/configure b/driver/xf86-video-intel/configure
index c94c4a428..34a49ca4e 100644
--- a/driver/xf86-video-intel/configure
+++ b/driver/xf86-video-intel/configure
@@ -852,14 +852,6 @@ am__untar
MAINTAINER_MODE_TRUE
MAINTAINER_MODE_FALSE
MAINT
-build
-build_cpu
-build_vendor
-build_os
-host
-host_cpu
-host_vendor
-host_os
CC
CFLAGS
LDFLAGS
@@ -876,16 +868,41 @@ AMDEPBACKSLASH
CCDEPMODE
am__fastdepCC_TRUE
am__fastdepCC_FALSE
-SED
+CPP
GREP
EGREP
+CWARNFLAGS
+CHANGELOG_CMD
+PKG_CONFIG
+INSTALL_CMD
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+APP_MAN_SUFFIX
+LIB_MAN_SUFFIX
+FILE_MAN_SUFFIX
+MISC_MAN_SUFFIX
+DRIVER_MAN_SUFFIX
+ADMIN_MAN_SUFFIX
+APP_MAN_DIR
+LIB_MAN_DIR
+FILE_MAN_DIR
+MISC_MAN_DIR
+DRIVER_MAN_DIR
+ADMIN_MAN_DIR
+AM_DEFAULT_VERBOSITY
+SED
LN_S
ECHO
AR
RANLIB
DSYMUTIL
NMEDIT
-CPP
CXX
CXXFLAGS
ac_ct_CXX
@@ -897,7 +914,6 @@ F77
FFLAGS
ac_ct_F77
LIBTOOL
-PKG_CONFIG
GEN4ASM_CFLAGS
GEN4ASM_LIBS
HAVE_GEN4ASM_TRUE
@@ -926,21 +942,6 @@ KMS_ONLY_TRUE
KMS_ONLY_FALSE
DRIVER_NAME
moduledir
-CWARNFLAGS
-CHANGELOG_CMD
-distcleancheck_listfiles
-APP_MAN_SUFFIX
-LIB_MAN_SUFFIX
-FILE_MAN_SUFFIX
-MISC_MAN_SUFFIX
-DRIVER_MAN_SUFFIX
-ADMIN_MAN_SUFFIX
-APP_MAN_DIR
-LIB_MAN_DIR
-FILE_MAN_DIR
-MISC_MAN_DIR
-DRIVER_MAN_DIR
-ADMIN_MAN_DIR
LINUXDOC
PS2PDF
BUILD_LINUXDOC_TRUE
@@ -957,10 +958,12 @@ ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_maintainer_mode
+enable_dependency_tracking
+enable_strict_compilation
+with_release_version
enable_static
enable_shared
enable_fast_install
-enable_dependency_tracking
with_gnu_ld
enable_libtool_lock
with_pic
@@ -970,8 +973,6 @@ enable_dri
enable_video_debug
enable_xvmc
enable_kms_only
-enable_strict_compilation
-with_release_version
'
ac_precious_vars='build_alias
host_alias
@@ -982,13 +983,13 @@ LDFLAGS
LIBS
CPPFLAGS
CPP
+PKG_CONFIG
CXX
CXXFLAGS
CCC
CXXCPP
F77
FFLAGS
-PKG_CONFIG
GEN4ASM_CFLAGS
GEN4ASM_LIBS
XORG_CFLAGS
@@ -1636,24 +1637,26 @@ Optional Features:
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-maintainer-mode enable make rules and dependencies not useful
(and sometimes confusing) to the casual installer
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-strict-compilation
+ Enable all warnings from compiler and make them
+ errors (default: disabled)
--enable-static[=PKGS] build static libraries [default=no]
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
--disable-libtool-lock avoid locking (might break parallel builds)
--disable-dri Disable DRI support [default=auto]
--enable-video-debug Enable video debugging support [default=no]
--disable-xvmc Disable XvMC support [default=yes]
--enable-kms-only Assume KMS support [default=no]
- --enable-strict-compilation
- Enable all warnings from compiler and make them
- errors (default: disabled)
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-release-version=STRING
+ Use release version string in package name
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-pic try to use only PIC/non-PIC objects [default=use
both]
@@ -1661,8 +1664,6 @@ Optional Packages:
--with-xorg-module-dir=DIR
Default xorg module directory
[default=$libdir/xorg/modules]
- --with-release-version=STRING
- Use release version string in package name
Some influential environment variables:
CC C compiler command
@@ -1673,12 +1674,12 @@ Some influential environment variables:
CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
+ PKG_CONFIG path to pkg-config utility
CXX C++ compiler command
CXXFLAGS C++ compiler flags
CXXCPP C++ preprocessor
F77 Fortran 77 compiler command
FFLAGS Fortran 77 compiler flags
- PKG_CONFIG path to pkg-config utility
GEN4ASM_CFLAGS
C compiler flags for GEN4ASM, overriding pkg-config
GEN4ASM_LIBS
@@ -2606,161 +2607,16 @@ fi
-# Checks for programs.
-# Check whether --enable-static was given.
-if test "${enable_static+set}" = set; then
- enableval=$enable_static; p=${PACKAGE-default}
- case $enableval in
- yes) enable_static=yes ;;
- no) enable_static=no ;;
- *)
- enable_static=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_static=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_static=no
-fi
+# Require xorg-macros: XORG_DEFAULT_OPTIONS
-# Check whether --enable-shared was given.
-if test "${enable_shared+set}" = set; then
- enableval=$enable_shared; p=${PACKAGE-default}
- case $enableval in
- yes) enable_shared=yes ;;
- no) enable_shared=no ;;
- *)
- enable_shared=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_shared=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_shared=yes
-fi
-# Check whether --enable-fast-install was given.
-if test "${enable_fast_install+set}" = set; then
- enableval=$enable_fast_install; p=${PACKAGE-default}
- case $enableval in
- yes) enable_fast_install=yes ;;
- no) enable_fast_install=no ;;
- *)
- enable_fast_install=no
- # Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
- for pkg in $enableval; do
- IFS="$lt_save_ifs"
- if test "X$pkg" = "X$p"; then
- enable_fast_install=yes
- fi
- done
- IFS="$lt_save_ifs"
- ;;
- esac
-else
- enable_fast_install=yes
-fi
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
- { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
-$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
- { (exit 1); exit 1; }; }
-{ $as_echo "$as_me:$LINENO: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then
- $as_echo_n "(cached) " >&6
-else
- ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
- ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
- { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
-$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
- { (exit 1); exit 1; }; }
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
- { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
-$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
-$as_echo "$as_me: error: invalid value of canonical build" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:$LINENO: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then
- $as_echo_n "(cached) " >&6
-else
- if test "x$host_alias" = x; then
- ac_cv_host=$ac_cv_build
-else
- ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
- { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
-$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
-$as_echo "$as_me: error: invalid value of canonical host" >&2;}
- { (exit 1); exit 1; }; };;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
DEPDIR="${am__leading_dot}deps"
@@ -3868,64 +3724,241 @@ else
fi
-{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if test "${lt_cv_path_SED+set}" = set; then
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
$as_echo_n "(cached) " >&6
else
- # Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for lt_ac_prog in sed gsed; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then
- lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
- fi
- done
- done
-done
-IFS=$as_save_IFS
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
- cat /dev/null > conftest.in
- lt_ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >conftest.in
- # Check for GNU sed and select it if it is found.
- if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
- lt_cv_path_SED=$lt_ac_sed
- break
- fi
- while true; do
- cat conftest.in conftest.in >conftest.tmp
- mv conftest.tmp conftest.in
- cp conftest.in conftest.nl
- echo >>conftest.nl
- $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
- cmp -s conftest.out conftest.nl || break
- # 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
- lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
- lt_ac_max=$lt_ac_count
- lt_cv_path_SED=$lt_ac_sed
- fi
- done
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ :
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-SED=$lt_cv_path_SED
+ # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether nonexistent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
+ # Broken: success on invalid input.
+continue
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:$LINENO: result: $SED" >&5
-$as_echo "$SED" >&6; }
{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
@@ -4061,6 +4094,1144 @@ $as_echo "$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_header_stdc=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ return 2;
+ return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_link") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_try") 2>&5
+ ac_status=$?
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ eval "$as_ac_Header=yes"
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'`
+ { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if test `eval 'as_val=${'$as_ac_Header'}
+ $as_echo "$as_val"'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+ { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if test "${ac_cv_prog_cc_c99+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros. These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+ int x = 1234;
+ int y = 5678;
+ debug ("Flag");
+ debug ("X = %d\n", x);
+ showlist (The first, second, and third items.);
+ report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+ your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+ your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+ int datasize;
+ double data[];
+};
+
+struct named_init {
+ int number;
+ const wchar_t *name;
+ double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+ // See if C++-style comments work.
+ // Iterate through items via the restricted pointer.
+ // Also check for declarations in for loops.
+ for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+ continue;
+ return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+ va_list args;
+ va_start (args, format);
+ va_list args_copy;
+ va_copy (args_copy, args);
+
+ const char *str;
+ int number;
+ float fnumber;
+
+ while (*format)
+ {
+ switch (*format++)
+ {
+ case 's': // string
+ str = va_arg (args_copy, const char *);
+ break;
+ case 'd': // int
+ number = va_arg (args_copy, int);
+ break;
+ case 'f': // float
+ fnumber = va_arg (args_copy, double);
+ break;
+ default:
+ break;
+ }
+ }
+ va_end (args_copy);
+ va_end (args);
+}
+
+int
+main ()
+{
+
+ // Check bool.
+ _Bool success = false;
+
+ // Check restrict.
+ if (test_restrict ("String literal") == 0)
+ success = true;
+ char *restrict newvar = "Another string";
+
+ // Check varargs.
+ test_varargs ("s, d' f .", "string", 65, 34.234);
+ test_varargs_macros ();
+
+ // Check flexible array members.
+ struct incomplete_array *ia =
+ malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+ ia->datasize = 10;
+ for (int i = 0; i < ia->datasize; ++i)
+ ia->data[i] = i * 1.234;
+
+ // Check named initializers.
+ struct named_init ni = {
+ .number = 34,
+ .name = L"Test wide string",
+ .average = 543.34343,
+ };
+
+ ni.number = 58;
+
+ int dynamic_array[ni.number];
+ dynamic_array[ni.number - 1] = 543;
+
+ // work around unused variable warnings
+ return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+ || dynamic_array[ni.number - 1] != 543);
+
+ ;
+ return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_c99=$ac_arg
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+ x)
+ { $as_echo "$as_me:$LINENO: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+ xno)
+ { $as_echo "$as_me:$LINENO: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+ *)
+ CC="$CC $ac_cv_prog_cc_c99"
+ { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+ { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+ ac_pt_PKG_CONFIG=$PKG_CONFIG
+ # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ case $ac_pt_PKG_CONFIG in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+ $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+if test -n "$ac_pt_PKG_CONFIG"; then
+ { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_pt_PKG_CONFIG" = x; then
+ PKG_CONFIG=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ PKG_CONFIG=$ac_pt_PKG_CONFIG
+ fi
+else
+ PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=0.9.0
+ { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+ PKG_CONFIG=""
+ fi
+
+fi
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+ { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+{ $as_echo "$as_me:$LINENO: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if test "${ac_cv_build+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+ ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+ { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+$as_echo "$as_me: error: invalid value of canonical build" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:$LINENO: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if test "${ac_cv_host+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ if test "x$host_alias" = x; then
+ ac_cv_host=$ac_cv_build
+else
+ ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+ { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+$as_echo "$as_me: error: invalid value of canonical host" >&2;}
+ { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+if test "x$GCC" = xyes ; then
+ CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
+-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
+-Wbad-function-cast -Wformat=2"
+ case `$CC -dumpversion` in
+ 3.4.* | 4.*)
+ CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
+ ;;
+ esac
+else
+ { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5
+$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; }
+if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __SUNPRO_C
+ (void) __SUNPRO_C;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_have_decl___SUNPRO_C=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_have_decl___SUNPRO_C=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5
+$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; }
+if test $ac_cv_have_decl___SUNPRO_C = yes; then
+ SUNCC="yes"
+else
+ SUNCC="no"
+fi
+
+ if test "x$SUNCC" = "xyes"; then
+ CWARNFLAGS="-v"
+ fi
+fi
+
+
+
+
+
+
+
+# Check whether --enable-strict-compilation was given.
+if test "${enable_strict_compilation+set}" = set; then
+ enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
+else
+ STRICT_COMPILE=no
+fi
+
+if test "x$STRICT_COMPILE" = "xyes"; then
+ { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5
+$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; }
+if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __SUNPRO_C
+ (void) __SUNPRO_C;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_have_decl___SUNPRO_C=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_have_decl___SUNPRO_C=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5
+$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; }
+if test $ac_cv_have_decl___SUNPRO_C = yes; then
+ SUNCC="yes"
+else
+ SUNCC="no"
+fi
+
+ { $as_echo "$as_me:$LINENO: checking whether __INTEL_COMPILER is declared" >&5
+$as_echo_n "checking whether __INTEL_COMPILER is declared... " >&6; }
+if test "${ac_cv_have_decl___INTEL_COMPILER+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+#ifndef __INTEL_COMPILER
+ (void) __INTEL_COMPILER;
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+ (eval "$ac_compile") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_have_decl___INTEL_COMPILER=yes
+else
+ $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_cv_have_decl___INTEL_COMPILER=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___INTEL_COMPILER" >&5
+$as_echo "$ac_cv_have_decl___INTEL_COMPILER" >&6; }
+if test $ac_cv_have_decl___INTEL_COMPILER = yes; then
+ INTELCC="yes"
+else
+ INTELCC="no"
+fi
+
+ if test "x$GCC" = xyes ; then
+ STRICT_CFLAGS="-pedantic -Werror"
+ elif test "x$SUNCC" = "xyes"; then
+ STRICT_CFLAGS="-errwarn"
+ elif test "x$INTELCC" = "xyes"; then
+ STRICT_CFLAGS="-Werror"
+ fi
+fi
+CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
+
+
+
+
+# Check whether --with-release-version was given.
+if test "${with_release_version+set}" = set; then
+ withval=$with_release_version; RELEASE_VERSION="$withval"
+else
+ RELEASE_VERSION=""
+fi
+
+ if test "x$RELEASE_VERSION" != "x"; then
+ PACKAGE="$PACKAGE-$RELEASE_VERSION"
+ PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
+ { $as_echo "$as_me:$LINENO: Building with package name set to $PACKAGE" >&5
+$as_echo "$as_me: Building with package name set to $PACKAGE" >&6;}
+ fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
+_ACEOF
+
+ PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
+ if test "x$PVM" = "x"; then
+ PVM="0"
+ fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_MINOR $PVM
+_ACEOF
+
+ PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
+ if test "x$PVP" = "x"; then
+ PVP="0"
+ fi
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION_PATCHLEVEL $PVP
+_ACEOF
+
+
+
+CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > \$(top_srcdir)/.changelog.tmp && \
+mv \$(top_srcdir)/.changelog.tmp \$(top_srcdir)/ChangeLog) \
+|| (rm -f \$(top_srcdir)/.changelog.tmp; touch \$(top_srcdir)/ChangeLog; \
+echo 'git directory not found: installing possibly empty changelog.' >&2)"
+
+
+
+
+macros_datadir=`$PKG_CONFIG --print-errors --variable=pkgdatadir xorg-macros`
+INSTALL_CMD="(cp -f "$macros_datadir/INSTALL" \$(top_srcdir)/.INSTALL.tmp && \
+mv \$(top_srcdir)/.INSTALL.tmp \$(top_srcdir)/INSTALL) \
+|| (rm -f \$(top_srcdir)/.INSTALL.tmp; touch \$(top_srcdir)/INSTALL; \
+echo 'util-macros \"pkgdatadir\" from xorg-macros.pc not found: installing possibly empty INSTALL.' >&2)"
+
+
+
+
+
+if test x$APP_MAN_SUFFIX = x ; then
+ APP_MAN_SUFFIX=1
+fi
+if test x$APP_MAN_DIR = x ; then
+ APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
+fi
+
+if test x$LIB_MAN_SUFFIX = x ; then
+ LIB_MAN_SUFFIX=3
+fi
+if test x$LIB_MAN_DIR = x ; then
+ LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
+fi
+
+if test x$FILE_MAN_SUFFIX = x ; then
+ case $host_os in
+ solaris*) FILE_MAN_SUFFIX=4 ;;
+ *) FILE_MAN_SUFFIX=5 ;;
+ esac
+fi
+if test x$FILE_MAN_DIR = x ; then
+ FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
+fi
+
+if test x$MISC_MAN_SUFFIX = x ; then
+ case $host_os in
+ solaris*) MISC_MAN_SUFFIX=5 ;;
+ *) MISC_MAN_SUFFIX=7 ;;
+ esac
+fi
+if test x$MISC_MAN_DIR = x ; then
+ MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
+fi
+
+if test x$DRIVER_MAN_SUFFIX = x ; then
+ case $host_os in
+ solaris*) DRIVER_MAN_SUFFIX=7 ;;
+ *) DRIVER_MAN_SUFFIX=4 ;;
+ esac
+fi
+if test x$DRIVER_MAN_DIR = x ; then
+ DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
+fi
+
+if test x$ADMIN_MAN_SUFFIX = x ; then
+ case $host_os in
+ solaris*) ADMIN_MAN_SUFFIX=1m ;;
+ *) ADMIN_MAN_SUFFIX=8 ;;
+ esac
+fi
+if test x$ADMIN_MAN_DIR = x ; then
+ ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+AM_DEFAULT_VERBOSITY=1
+
+
+
+# Checks for programs.
+# Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then
+ enableval=$enable_static; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_static=yes ;;
+ no) enable_static=no ;;
+ *)
+ enable_static=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_static=no
+fi
+
+
+
+# Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then
+ enableval=$enable_shared; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_shared=yes ;;
+ no) enable_shared=no ;;
+ *)
+ enable_shared=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_shared=yes
+fi
+
+
+# Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then
+ enableval=$enable_fast_install; p=${PACKAGE-default}
+ case $enableval in
+ yes) enable_fast_install=yes ;;
+ no) enable_fast_install=no ;;
+ *)
+ enable_fast_install=no
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
+else
+ enable_fast_install=yes
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${lt_cv_path_SED+set}" = set; then
+ $as_echo_n "(cached) " >&6
+else
+ # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && continue
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+
+fi
+
+SED=$lt_cv_path_SED
+
+{ $as_echo "$as_me:$LINENO: result: $SED" >&5
+$as_echo "$SED" >&6; }
+
# Check whether --with-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then
@@ -4461,7 +5632,6 @@ LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
# Allow CC to be a program name with arguments.
compiler=$CC
-
# Check whether --enable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then
enableval=$enable_libtool_lock;
@@ -4493,7 +5663,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4496 "configure"' > conftest.$ac_ext
+ echo '#line 5666 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -4687,491 +5857,6 @@ esac
need_locks="$enable_libtool_lock"
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
- CPP=
-fi
-if test -z "$CPP"; then
- if test "${ac_cv_prog_CPP+set}" = set; then
- $as_echo_n "(cached) " >&6
-else
- # Double quotes because CPP needs to be expanded
- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
- do
- ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- break
-fi
-
- done
- ac_cv_prog_CPP=$CPP
-
-fi
- CPP=$ac_cv_prog_CPP
-else
- ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:$LINENO: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
- # Use a header file that comes with gcc, so configuring glibc
- # with a fresh cross-compiler works.
- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- # <limits.h> exists even on freestanding compilers.
- # On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp. "Syntax error" is here to catch this case.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
- Syntax error
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- :
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Broken: fails on valid input.
-continue
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
- # OK, works on sane cases. Now check whether nonexistent headers
- # can be detected and how.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ac_nonexistent.h>
-_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
- # Broken: success on invalid input.
-continue
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-
-rm -f conftest.err conftest.$ac_ext
-
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
- :
-else
- { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_header_stdc=yes
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_stdc=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "memchr" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- $EGREP "free" >/dev/null 2>&1; then
- :
-else
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
- if test "$cross_compiling" = yes; then
- :
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
- (('a' <= (c) && (c) <= 'i') \
- || ('j' <= (c) && (c) <= 'r') \
- || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
- int i;
- for (i = 0; i < 256; i++)
- if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_link") 2>&5
- ac_status=$?
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-
-
-
-
-
-
-
-
-
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- eval "$as_ac_Header=yes"
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- eval "$as_ac_Header=no"
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
- $as_echo "$as_val"'`
- { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if test `eval 'as_val=${'$as_ac_Header'}
- $as_echo "$as_val"'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
for ac_header in dlfcn.h
do
@@ -7601,11 +8286,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7604: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8289: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7608: \$? = $ac_status" >&5
+ echo "$as_me:8293: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7891,11 +8576,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7894: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8579: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:7898: \$? = $ac_status" >&5
+ echo "$as_me:8583: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -7995,11 +8680,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:7998: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:8683: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:8002: \$? = $ac_status" >&5
+ echo "$as_me:8687: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -10395,7 +11080,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10398 "configure"
+#line 11083 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -10495,7 +11180,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 10498 "configure"
+#line 11183 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -12904,11 +13589,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:12907: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13592: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:12911: \$? = $ac_status" >&5
+ echo "$as_me:13596: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -13008,11 +13693,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13011: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13696: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:13015: \$? = $ac_status" >&5
+ echo "$as_me:13700: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14591,11 +15276,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14594: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15279: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:14598: \$? = $ac_status" >&5
+ echo "$as_me:15283: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -14695,11 +15380,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:14698: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15383: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:14702: \$? = $ac_status" >&5
+ echo "$as_me:15387: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -16910,11 +17595,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16913: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17598: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:16917: \$? = $ac_status" >&5
+ echo "$as_me:17602: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -17200,11 +17885,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17203: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17888: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:17207: \$? = $ac_status" >&5
+ echo "$as_me:17892: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -17304,11 +17989,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:17307: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:17992: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:17311: \$? = $ac_status" >&5
+ echo "$as_me:17996: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -20919,126 +21604,6 @@ fi
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
- $as_echo_n "(cached) " >&6
-else
- case $PKG_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-if test -n "$PKG_CONFIG"; then
- { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
- { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
- ac_pt_PKG_CONFIG=$PKG_CONFIG
- # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
- $as_echo_n "(cached) " >&6
-else
- case $ac_pt_PKG_CONFIG in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
- $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-if test -n "$ac_pt_PKG_CONFIG"; then
- { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-else
- { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
- if test "x$ac_pt_PKG_CONFIG" = x; then
- PKG_CONFIG=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-$as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- PKG_CONFIG=$ac_pt_PKG_CONFIG
- fi
-else
- PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
-fi
-if test -n "$PKG_CONFIG"; then
- _pkg_min_version=0.9.0
- { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
- if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
- { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
- else
- { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
- PKG_CONFIG=""
- fi
-
-fi
-
pkg_failed=no
{ $as_echo "$as_me:$LINENO: checking for GEN4ASM" >&5
$as_echo_n "checking for GEN4ASM... " >&6; }
@@ -21595,67 +22160,9 @@ fi
# Checks for extensions
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-#include "xorg-server.h"
-#if !defined XINERAMA
-#error XINERAMA not defined
-#endif
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- _EXT_CHECK=yes
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- _EXT_CHECK=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$SAVE_CFLAGS"
- { $as_echo "$as_me:$LINENO: checking if XINERAMA is defined" >&5
-$as_echo_n "checking if XINERAMA is defined... " >&6; }
- { $as_echo "$as_me:$LINENO: result: $_EXT_CHECK" >&5
-$as_echo "$_EXT_CHECK" >&6; }
- if test "$_EXT_CHECK" != no; then
- REQUIRED_MODULES="$REQUIRED_MODULES xineramaproto"
- fi
-
SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
+ CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -21713,8 +22220,9 @@ $as_echo "$_EXT_CHECK" >&6; }
fi
+
SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
+ CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -21772,8 +22280,9 @@ $as_echo "$_EXT_CHECK" >&6; }
fi
+
SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
+ CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -21831,8 +22340,9 @@ $as_echo "$_EXT_CHECK" >&6; }
fi
+
SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
+ CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -22578,12 +23088,12 @@ if test -n "$PKG_CONFIG"; then
pkg_cv_XVMCLIB_CFLAGS="$XVMCLIB_CFLAGS"
else
if test -n "$PKG_CONFIG" && \
- { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xvmc xext xfixes dri2proto\"") >&5
- ($PKG_CONFIG --exists --print-errors "xvmc xext xfixes dri2proto") 2>&5
+ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xvmc xext xfixes dri2proto x11-xcb xcb-dri2 xcb-aux\"") >&5
+ ($PKG_CONFIG --exists --print-errors "xvmc xext xfixes dri2proto x11-xcb xcb-dri2 xcb-aux") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
- pkg_cv_XVMCLIB_CFLAGS=`$PKG_CONFIG --cflags "xvmc xext xfixes dri2proto" 2>/dev/null`
+ pkg_cv_XVMCLIB_CFLAGS=`$PKG_CONFIG --cflags "xvmc xext xfixes dri2proto x11-xcb xcb-dri2 xcb-aux" 2>/dev/null`
else
pkg_failed=yes
fi
@@ -22596,12 +23106,12 @@ if test -n "$PKG_CONFIG"; then
pkg_cv_XVMCLIB_LIBS="$XVMCLIB_LIBS"
else
if test -n "$PKG_CONFIG" && \
- { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xvmc xext xfixes dri2proto\"") >&5
- ($PKG_CONFIG --exists --print-errors "xvmc xext xfixes dri2proto") 2>&5
+ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"xvmc xext xfixes dri2proto x11-xcb xcb-dri2 xcb-aux\"") >&5
+ ($PKG_CONFIG --exists --print-errors "xvmc xext xfixes dri2proto x11-xcb xcb-dri2 xcb-aux") 2>&5
ac_status=$?
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
- pkg_cv_XVMCLIB_LIBS=`$PKG_CONFIG --libs "xvmc xext xfixes dri2proto" 2>/dev/null`
+ pkg_cv_XVMCLIB_LIBS=`$PKG_CONFIG --libs "xvmc xext xfixes dri2proto x11-xcb xcb-dri2 xcb-aux" 2>/dev/null`
else
pkg_failed=yes
fi
@@ -22620,9 +23130,9 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- XVMCLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xvmc xext xfixes dri2proto"`
+ XVMCLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "xvmc xext xfixes dri2proto x11-xcb xcb-dri2 xcb-aux"`
else
- XVMCLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xvmc xext xfixes dri2proto"`
+ XVMCLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "xvmc xext xfixes dri2proto x11-xcb xcb-dri2 xcb-aux"`
fi
# Put the nasty error message in config.log where it belongs
echo "$XVMCLIB_PKG_ERRORS" >&5
@@ -22687,559 +23197,6 @@ DRIVER_NAME=intel
-
-
-
-
-
-
-
-
-
-
- { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C99" >&5
-$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
-if test "${ac_cv_prog_cc_c99+set}" = set; then
- $as_echo_n "(cached) " >&6
-else
- ac_cv_prog_cc_c99=no
-ac_save_CC=$CC
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stdlib.h>
-#include <wchar.h>
-#include <stdio.h>
-
-// Check varargs macros. These examples are taken from C99 6.10.3.5.
-#define debug(...) fprintf (stderr, __VA_ARGS__)
-#define showlist(...) puts (#__VA_ARGS__)
-#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
-static void
-test_varargs_macros (void)
-{
- int x = 1234;
- int y = 5678;
- debug ("Flag");
- debug ("X = %d\n", x);
- showlist (The first, second, and third items.);
- report (x>y, "x is %d but y is %d", x, y);
-}
-
-// Check long long types.
-#define BIG64 18446744073709551615ull
-#define BIG32 4294967295ul
-#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
-#if !BIG_OK
- your preprocessor is broken;
-#endif
-#if BIG_OK
-#else
- your preprocessor is broken;
-#endif
-static long long int bignum = -9223372036854775807LL;
-static unsigned long long int ubignum = BIG64;
-
-struct incomplete_array
-{
- int datasize;
- double data[];
-};
-
-struct named_init {
- int number;
- const wchar_t *name;
- double average;
-};
-
-typedef const char *ccp;
-
-static inline int
-test_restrict (ccp restrict text)
-{
- // See if C++-style comments work.
- // Iterate through items via the restricted pointer.
- // Also check for declarations in for loops.
- for (unsigned int i = 0; *(text+i) != '\0'; ++i)
- continue;
- return 0;
-}
-
-// Check varargs and va_copy.
-static void
-test_varargs (const char *format, ...)
-{
- va_list args;
- va_start (args, format);
- va_list args_copy;
- va_copy (args_copy, args);
-
- const char *str;
- int number;
- float fnumber;
-
- while (*format)
- {
- switch (*format++)
- {
- case 's': // string
- str = va_arg (args_copy, const char *);
- break;
- case 'd': // int
- number = va_arg (args_copy, int);
- break;
- case 'f': // float
- fnumber = va_arg (args_copy, double);
- break;
- default:
- break;
- }
- }
- va_end (args_copy);
- va_end (args);
-}
-
-int
-main ()
-{
-
- // Check bool.
- _Bool success = false;
-
- // Check restrict.
- if (test_restrict ("String literal") == 0)
- success = true;
- char *restrict newvar = "Another string";
-
- // Check varargs.
- test_varargs ("s, d' f .", "string", 65, 34.234);
- test_varargs_macros ();
-
- // Check flexible array members.
- struct incomplete_array *ia =
- malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
- ia->datasize = 10;
- for (int i = 0; i < ia->datasize; ++i)
- ia->data[i] = i * 1.234;
-
- // Check named initializers.
- struct named_init ni = {
- .number = 34,
- .name = L"Test wide string",
- .average = 543.34343,
- };
-
- ni.number = 58;
-
- int dynamic_array[ni.number];
- dynamic_array[ni.number - 1] = 543;
-
- // work around unused variable warnings
- return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
- || dynamic_array[ni.number - 1] != 543);
-
- ;
- return 0;
-}
-_ACEOF
-for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
-do
- CC="$ac_save_CC $ac_arg"
- rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_c99=$ac_arg
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c99" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c99" in
- x)
- { $as_echo "$as_me:$LINENO: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
- xno)
- { $as_echo "$as_me:$LINENO: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
- *)
- CC="$CC $ac_cv_prog_cc_c99"
- { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c99" >&5
-$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
-esac
-
-
-
-
-
-
-if test "x$GCC" = xyes ; then
- CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
--Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
--Wbad-function-cast"
- case `$CC -dumpversion` in
- 3.4.* | 4.*)
- CWARNFLAGS="$CWARNFLAGS -Wold-style-definition -Wdeclaration-after-statement"
- ;;
- esac
-else
- { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5
-$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; }
-if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-#ifndef __SUNPRO_C
- (void) __SUNPRO_C;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl___SUNPRO_C=yes
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl___SUNPRO_C=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5
-$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; }
-if test $ac_cv_have_decl___SUNPRO_C = yes; then
- SUNCC="yes"
-else
- SUNCC="no"
-fi
-
- if test "x$SUNCC" = "xyes"; then
- CWARNFLAGS="-v"
- fi
-fi
-
-
-
-
-
-
-
-
-# Check whether --enable-strict-compilation was given.
-if test "${enable_strict_compilation+set}" = set; then
- enableval=$enable_strict_compilation; STRICT_COMPILE=$enableval
-else
- STRICT_COMPILE=no
-fi
-
-if test "x$STRICT_COMPILE" = "xyes"; then
- { $as_echo "$as_me:$LINENO: checking whether __SUNPRO_C is declared" >&5
-$as_echo_n "checking whether __SUNPRO_C is declared... " >&6; }
-if test "${ac_cv_have_decl___SUNPRO_C+set}" = set; then
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-#ifndef __SUNPRO_C
- (void) __SUNPRO_C;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl___SUNPRO_C=yes
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl___SUNPRO_C=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___SUNPRO_C" >&5
-$as_echo "$ac_cv_have_decl___SUNPRO_C" >&6; }
-if test $ac_cv_have_decl___SUNPRO_C = yes; then
- SUNCC="yes"
-else
- SUNCC="no"
-fi
-
- { $as_echo "$as_me:$LINENO: checking whether __INTEL_COMPILER is declared" >&5
-$as_echo_n "checking whether __INTEL_COMPILER is declared... " >&6; }
-if test "${ac_cv_have_decl___INTEL_COMPILER+set}" = set; then
- $as_echo_n "(cached) " >&6
-else
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-#ifndef __INTEL_COMPILER
- (void) __INTEL_COMPILER;
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_have_decl___INTEL_COMPILER=yes
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_have_decl___INTEL_COMPILER=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl___INTEL_COMPILER" >&5
-$as_echo "$ac_cv_have_decl___INTEL_COMPILER" >&6; }
-if test $ac_cv_have_decl___INTEL_COMPILER = yes; then
- INTELCC="yes"
-else
- INTELCC="no"
-fi
-
- if test "x$GCC" = xyes ; then
- STRICT_CFLAGS="-pedantic -Werror"
- elif test "x$SUNCC" = "xyes"; then
- STRICT_CFLAGS="-errwarn"
- elif test "x$INTELCC" = "xyes"; then
- STRICT_CFLAGS="-Werror"
- fi
-fi
-CWARNFLAGS="$CWARNFLAGS $STRICT_CFLAGS"
-
-
-
-
-# Check whether --with-release-version was given.
-if test "${with_release_version+set}" = set; then
- withval=$with_release_version; RELEASE_VERSION="$withval"
-else
- RELEASE_VERSION=""
-fi
-
- if test "x$RELEASE_VERSION" != "x"; then
- PACKAGE="$PACKAGE-$RELEASE_VERSION"
- PACKAGE_TARNAME="$PACKAGE_TARNAME-$RELEASE_VERSION"
- { $as_echo "$as_me:$LINENO: Building with package name set to $PACKAGE" >&5
-$as_echo "$as_me: Building with package name set to $PACKAGE" >&6;}
- fi
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION_MAJOR `echo $PACKAGE_VERSION | cut -d . -f 1`
-_ACEOF
-
- PVM=`echo $PACKAGE_VERSION | cut -d . -f 2 | cut -d - -f 1`
- if test "x$PVM" = "x"; then
- PVM="0"
- fi
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION_MINOR $PVM
-_ACEOF
-
- PVP=`echo $PACKAGE_VERSION | cut -d . -f 3 | cut -d - -f 1`
- if test "x$PVP" = "x"; then
- PVP="0"
- fi
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION_PATCHLEVEL $PVP
-_ACEOF
-
-
-
-CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
-mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
-echo 'git directory not found: installing possibly empty changelog.' >&2)"
-
-distcleancheck_listfiles='find . -type f ! -name ChangeLog -print'
-
-
-
-
-
-if test x$APP_MAN_SUFFIX = x ; then
- APP_MAN_SUFFIX=1
-fi
-if test x$APP_MAN_DIR = x ; then
- APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
-fi
-
-if test x$LIB_MAN_SUFFIX = x ; then
- LIB_MAN_SUFFIX=3
-fi
-if test x$LIB_MAN_DIR = x ; then
- LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
-fi
-
-if test x$FILE_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) FILE_MAN_SUFFIX=4 ;;
- *) FILE_MAN_SUFFIX=5 ;;
- esac
-fi
-if test x$FILE_MAN_DIR = x ; then
- FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
-fi
-
-if test x$MISC_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) MISC_MAN_SUFFIX=5 ;;
- *) MISC_MAN_SUFFIX=7 ;;
- esac
-fi
-if test x$MISC_MAN_DIR = x ; then
- MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
-fi
-
-if test x$DRIVER_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) DRIVER_MAN_SUFFIX=7 ;;
- *) DRIVER_MAN_SUFFIX=4 ;;
- esac
-fi
-if test x$DRIVER_MAN_DIR = x ; then
- DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
-fi
-
-if test x$ADMIN_MAN_SUFFIX = x ; then
- case $host_os in
- solaris*) ADMIN_MAN_SUFFIX=1m ;;
- *) ADMIN_MAN_SUFFIX=8 ;;
- esac
-fi
-if test x$ADMIN_MAN_DIR = x ; then
- ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
if test x$XORG_SGML_PATH = x ; then
XORG_SGML_PATH=$prefix/share/sgml
fi
@@ -23356,8 +23313,8 @@ fi
-{ $as_echo "$as_me:$LINENO: checking Whether to build documentation" >&5
-$as_echo_n "checking Whether to build documentation... " >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether to build documentation" >&5
+$as_echo_n "checking whether to build documentation... " >&6; }
if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
BUILDDOC=yes
@@ -23379,8 +23336,8 @@ fi
{ $as_echo "$as_me:$LINENO: result: $BUILDDOC" >&5
$as_echo "$BUILDDOC" >&6; }
-{ $as_echo "$as_me:$LINENO: checking Whether to build pdf documentation" >&5
-$as_echo_n "checking Whether to build pdf documentation... " >&6; }
+{ $as_echo "$as_me:$LINENO: checking whether to build pdf documentation" >&5
+$as_echo_n "checking whether to build pdf documentation... " >&6; }
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
BUILDPDFDOC=yes
diff --git a/driver/xf86-video-intel/configure.ac b/driver/xf86-video-intel/configure.ac
index 64aa0acba..58c9430db 100644
--- a/driver/xf86-video-intel/configure.ac
+++ b/driver/xf86-video-intel/configure.ac
@@ -136,7 +136,9 @@ if test "$VIDEO_DEBUG" = yes; then
fi
if test "$XVMC" = yes; then
- PKG_CHECK_MODULES(XVMCLIB, [xvmc xext xfixes dri2proto], [XVMC=yes], [XVMC=no])
+ PKG_CHECK_MODULES(XVMCLIB,
+ [xvmc xext xfixes dri2proto x11-xcb xcb-dri2 xcb-aux],
+ [XVMC=yes], [XVMC=no])
fi
AC_MSG_CHECKING([whether to include XvMC support])
AC_MSG_RESULT([$XVMC])
diff --git a/driver/xf86-video-intel/man/Makefile.in b/driver/xf86-video-intel/man/Makefile.in
index 793bc2242..64b843cdc 100644
--- a/driver/xf86-video-intel/man/Makefile.in
+++ b/driver/xf86-video-intel/man/Makefile.in
@@ -16,28 +16,25 @@
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation.
-#
-# 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 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
-# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
-# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-# OTHER DEALINGS IN THE SOFTWARE.
-#
-# Except as contained in this notice, the name of the copyright holders shall
-# not be used in advertising or otherwise to promote the sale, use or
-# other dealings in this Software without prior written authorization
-# from the copyright holders.
+#
+# 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.
#
srcdir = @srcdir@
@@ -89,6 +86,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -141,6 +139,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -215,7 +214,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -278,9 +276,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign man/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu man/Makefile
+ $(AUTOMAKE) --foreign man/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
diff --git a/driver/xf86-video-intel/src/Makefile.am b/driver/xf86-video-intel/src/Makefile.am
index 0bf13ac58..0ae81cd79 100644
--- a/driver/xf86-video-intel/src/Makefile.am
+++ b/driver/xf86-video-intel/src/Makefile.am
@@ -45,9 +45,7 @@ INTEL_DRI_SRCS = \
INTEL_XVMC_SRCS = \
i830_hwmc.h \
i830_hwmc.c \
- i915_hwmc.c \
i915_hwmc.h \
- i965_hwmc.c \
i965_hwmc.h
diff --git a/driver/xf86-video-intel/src/Makefile.in b/driver/xf86-video-intel/src/Makefile.in
index f6932f62e..44ca1d3a0 100644
--- a/driver/xf86-video-intel/src/Makefile.in
+++ b/driver/xf86-video-intel/src/Makefile.in
@@ -99,11 +99,10 @@ am__intel_drv_la_SOURCES_DIST = brw_defines.h brw_structs.h common.h \
i915_3d.h i915_reg.h i915_video.c i965_video.c i830_uxa.c \
i830_render.c i915_render.c i965_render.c drmmode_display.c \
i810_dri.c i810_dri.h i830_dri.c i810_hwmc.c i830_dri.h \
- i830_hwmc.h i830_hwmc.c i915_hwmc.c i915_hwmc.h i965_hwmc.c \
- i965_hwmc.h
+ i830_hwmc.h i830_hwmc.c i915_hwmc.h i965_hwmc.h
am__objects_1 = i810_dri.lo i830_dri.lo i810_hwmc.lo
@DRI_TRUE@am__objects_2 = $(am__objects_1)
-am__objects_3 = i830_hwmc.lo i915_hwmc.lo i965_hwmc.lo
+am__objects_3 = i830_hwmc.lo
@XVMC_TRUE@am__objects_4 = $(am__objects_3)
am_intel_drv_la_OBJECTS = i810_accel.lo i810_cursor.lo i810_dga.lo \
i810_driver.lo i810_io.lo i810_memory.lo i810_video.lo \
@@ -145,6 +144,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -197,6 +197,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -271,7 +272,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -325,9 +325,7 @@ INTEL_DRI_SRCS = \
INTEL_XVMC_SRCS = \
i830_hwmc.h \
i830_hwmc.c \
- i915_hwmc.c \
i915_hwmc.h \
- i965_hwmc.c \
i965_hwmc.h
intel_drv_la_SOURCES = brw_defines.h brw_structs.h common.h i2c_vid.h \
@@ -361,9 +359,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/Makefile
+ $(AUTOMAKE) --foreign src/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -452,10 +450,8 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i830_uxa.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i830_video.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i915_3d.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i915_hwmc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i915_render.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i915_video.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i965_hwmc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i965_render.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/i965_video.Plo@am__quote@
diff --git a/driver/xf86-video-intel/src/bios_reader/Makefile.in b/driver/xf86-video-intel/src/bios_reader/Makefile.in
index b2f9890be..6206b47fc 100644
--- a/driver/xf86-video-intel/src/bios_reader/Makefile.in
+++ b/driver/xf86-video-intel/src/bios_reader/Makefile.in
@@ -82,6 +82,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -134,6 +135,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -208,7 +210,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -259,9 +260,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/bios_reader/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/bios_reader/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/bios_reader/Makefile
+ $(AUTOMAKE) --foreign src/bios_reader/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
diff --git a/driver/xf86-video-intel/src/ch7017/Makefile.in b/driver/xf86-video-intel/src/ch7017/Makefile.in
index f32ac488d..875871386 100644
--- a/driver/xf86-video-intel/src/ch7017/Makefile.in
+++ b/driver/xf86-video-intel/src/ch7017/Makefile.in
@@ -79,6 +79,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -131,6 +132,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -205,7 +207,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -264,9 +265,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/ch7017/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/ch7017/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/ch7017/Makefile
+ $(AUTOMAKE) --foreign src/ch7017/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
diff --git a/driver/xf86-video-intel/src/ch7xxx/Makefile.in b/driver/xf86-video-intel/src/ch7xxx/Makefile.in
index 34ef5e839..2e98ecbd7 100644
--- a/driver/xf86-video-intel/src/ch7xxx/Makefile.in
+++ b/driver/xf86-video-intel/src/ch7xxx/Makefile.in
@@ -79,6 +79,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -131,6 +132,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -205,7 +207,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -265,9 +266,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/ch7xxx/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/ch7xxx/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/ch7xxx/Makefile
+ $(AUTOMAKE) --foreign src/ch7xxx/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
diff --git a/driver/xf86-video-intel/src/i810_video.c b/driver/xf86-video-intel/src/i810_video.c
index c82fcc92d..ee1a2326b 100644
--- a/driver/xf86-video-intel/src/i810_video.c
+++ b/driver/xf86-video-intel/src/i810_video.c
@@ -1085,7 +1085,7 @@ I810PutImage(
if(!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) {
REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes);
/* draw these */
- xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes);
+ xf86XVFillKeyHelperDrawable(pDraw, pPriv->colorKey, clipBoxes);
}
I810DisplayVideo(pScrn, id, width, height, dstPitch,
diff --git a/driver/xf86-video-intel/src/i830.h b/driver/xf86-video-intel/src/i830.h
index 7caeeb24f..6e4d5528f 100644
--- a/driver/xf86-video-intel/src/i830.h
+++ b/driver/xf86-video-intel/src/i830.h
@@ -66,7 +66,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define _XF86DRI_SERVER_
#include "dri.h"
#include "GL/glxint.h"
-#include "i830_dri.h"
#include "intel_bufmgr.h"
#include "i915_drm.h"
@@ -599,7 +598,7 @@ typedef struct intel_screen_private {
Bool directRenderingOpen;
int drmSubFD;
- char deviceName[64];
+ char *deviceName;
/* Broken-out options. */
OptionInfoPtr Options;
diff --git a/driver/xf86-video-intel/src/i830_dri.c b/driver/xf86-video-intel/src/i830_dri.c
index 08f8728c5..d6522649c 100644
--- a/driver/xf86-video-intel/src/i830_dri.c
+++ b/driver/xf86-video-intel/src/i830_dri.c
@@ -58,7 +58,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "GL/glxtokens.h"
#include "i830.h"
-#include "i830_dri.h"
#include "i915_drm.h"
@@ -390,10 +389,6 @@ Bool I830DRI2ScreenInit(ScreenPtr screen)
ScrnInfoPtr scrn = xf86Screens[screen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
DRI2InfoRec info;
- char *p;
- int i;
- struct stat sbuf;
- dev_t d;
#ifdef USE_DRI2_1_1_0
int dri2_major = 1;
int dri2_minor = 0;
@@ -411,30 +406,10 @@ Bool I830DRI2ScreenInit(ScreenPtr screen)
}
#endif
+ intel->deviceName = drmGetDeviceNameFromFd(intel->drmSubFD);
info.fd = intel->drmSubFD;
-
- /* The whole drmOpen thing is a fiasco and we need to find a way
- * back to just using open(2). For now, however, lets just make
- * things worse with even more ad hoc directory walking code to
- * discover the device file name. */
-
- fstat(info.fd, &sbuf);
- d = sbuf.st_rdev;
-
- p = intel->deviceName;
- for (i = 0; i < DRM_MAX_MINOR; i++) {
- sprintf(p, DRM_DEV_NAME, DRM_DIR_NAME, i);
- if (stat(p, &sbuf) == 0 && sbuf.st_rdev == d)
- break;
- }
- if (i == DRM_MAX_MINOR) {
- xf86DrvMsg(scrn->scrnIndex, X_WARNING,
- "DRI2: failed to open drm device\n");
- return FALSE;
- }
-
info.driverName = IS_I965G(intel) ? "i965" : "i915";
- info.deviceName = p;
+ info.deviceName = intel->deviceName;
#if DRI2INFOREC_VERSION >= 3
info.version = 3;
@@ -466,4 +441,5 @@ void I830DRI2CloseScreen(ScreenPtr screen)
DRI2CloseScreen(screen);
intel->directRenderingType = DRI_NONE;
+ drmFree(intel->deviceName);
}
diff --git a/driver/xf86-video-intel/src/i830_dri.h b/driver/xf86-video-intel/src/i830_dri.h
deleted file mode 100644
index 9802356ce..000000000
--- a/driver/xf86-video-intel/src/i830_dri.h
+++ /dev/null
@@ -1,61 +0,0 @@
-
-#ifndef _I830_DRI_H
-#define _I830_DRI_H
-
-#include "xf86drm.h"
-#include "i830_common.h"
-
-#define I830_MAX_DRAWABLES 256
-
-#define I830_MAJOR_VERSION 1
-#define I830_MINOR_VERSION 9
-#define I830_PATCHLEVEL 0
-
-#define I830_REG_SIZE 0x80000
-
-typedef struct _I830DRIRec {
- drm_handle_t regs;
- drmSize regsSize;
-
- drmSize unused1; /* backbufferSize */
- drm_handle_t unused2; /* backbuffer */
-
- drmSize unused3; /* depthbufferSize */
- drm_handle_t unused4; /* depthbuffer */
-
- drmSize unused5; /* rotatedSize / */
- drm_handle_t unused6; /* rotatedbuffer */
-
- drm_handle_t unused7; /* textures */
- int unused8; /* textureSize */
-
- drm_handle_t unused9; /* agp_buffers */
- drmSize unused10; /* agp_buf_size */
-
- int deviceID;
- int width;
- int height;
- int mem;
- int cpp;
- int bitsPerPixel;
-
- int unused11[8]; /* was front/back/depth/rotated offset/pitch */
-
- int unused12; /* logTextureGranularity */
- int unused13; /* textureOffset */
-
- int irq;
- int sarea_priv_offset;
-} I830DRIRec, *I830DRIPtr;
-
-typedef struct {
- /* Nothing here yet */
- int dummy;
-} I830ConfigPrivRec, *I830ConfigPrivPtr;
-
-typedef struct {
- /* Nothing here yet */
- int dummy;
-} I830DRIContextRec, *I830DRIContextPtr;
-
-#endif
diff --git a/driver/xf86-video-intel/src/i830_driver.c b/driver/xf86-video-intel/src/i830_driver.c
index 4d509037a..9da622043 100644
--- a/driver/xf86-video-intel/src/i830_driver.c
+++ b/driver/xf86-video-intel/src/i830_driver.c
@@ -2738,7 +2738,8 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
xf86DPMSInit(screen, xf86DPMSSet, 0);
#ifdef INTEL_XVMC
- intel->XvMCEnabled = FALSE;
+ if (IS_I965G(intel))
+ intel->XvMCEnabled = TRUE;
from = ((intel->directRenderingType == DRI_DRI2) &&
xf86GetOptValBool(intel->Options, OPTION_XVMC,
&intel->XvMCEnabled) ? X_CONFIG : X_DEFAULT);
@@ -2807,11 +2808,6 @@ static void i830AdjustFrame(int scrnIndex, int x, int y, int flags)
static void I830FreeScreen(int scrnIndex, int flags)
{
ScrnInfoPtr scrn = xf86Screens[scrnIndex];
-#ifdef INTEL_XVMC
- intel_screen_private *intel = intel_get_screen_private(scrn);
- if (intel && intel->XvMCEnabled)
- intel_xvmc_finish(xf86Screens[scrnIndex]);
-#endif
i830_close_drm_master(scrn);
diff --git a/driver/xf86-video-intel/src/i830_hwmc.c b/driver/xf86-video-intel/src/i830_hwmc.c
index 016eec05f..850bf8765 100644
--- a/driver/xf86-video-intel/src/i830_hwmc.c
+++ b/driver/xf86-video-intel/src/i830_hwmc.c
@@ -32,97 +32,216 @@
#include "i830.h"
#include "i830_hwmc.h"
-struct intel_xvmc_driver *xvmc_driver;
+#include <X11/extensions/Xv.h>
+#include <X11/extensions/XvMC.h>
+#include <fourcc.h>
-/* set global current driver for xvmc */
-static Bool intel_xvmc_set_driver(struct intel_xvmc_driver *d)
+static int create_subpicture(ScrnInfoPtr scrn, XvMCSubpicturePtr subpicture,
+ int *num_priv, CARD32 ** priv)
{
- if (xvmc_driver) {
- ErrorF("XvMC driver already set!\n");
- return FALSE;
- } else
- xvmc_driver = d;
- return TRUE;
+ return Success;
}
-/* check chip type and load xvmc driver */
-/* This must be first called! */
-Bool intel_xvmc_probe(ScrnInfoPtr scrn)
+static void destroy_subpicture(ScrnInfoPtr scrn, XvMCSubpicturePtr subpicture)
{
- intel_screen_private *intel = intel_get_screen_private(scrn);
- Bool ret = FALSE;
-
- if (!intel->XvMCEnabled)
- return FALSE;
-
- /* Needs KMS support. */
- if (intel->use_drm_mode && (IS_I915G(intel) || IS_I915GM(intel)))
- return FALSE;
+}
- if (IS_I9XX(intel)) {
- if (IS_I915(intel))
- ret = intel_xvmc_set_driver(&i915_xvmc_driver);
- else if (IS_G4X(intel) || IS_IGDNG(intel))
- ret = intel_xvmc_set_driver(&vld_xvmc_driver);
- else
- ret = intel_xvmc_set_driver(&i965_xvmc_driver);
- } else {
- ErrorF("Your chipset doesn't support XvMC.\n");
- return FALSE;
- }
- return TRUE;
+static int create_surface(ScrnInfoPtr scrn, XvMCSurfacePtr surface,
+ int *num_priv, CARD32 ** priv)
+{
+ return Success;
}
-void intel_xvmc_finish(ScrnInfoPtr scrn)
+static void destroy_surface(ScrnInfoPtr scrn, XvMCSurfacePtr surface)
{
- if (!xvmc_driver)
- return;
- (*xvmc_driver->fini) (scrn);
}
-Bool intel_xvmc_driver_init(ScreenPtr pScreen, XF86VideoAdaptorPtr xv_adaptor)
+static int create_context(ScrnInfoPtr scrn, XvMCContextPtr pContext,
+ int *num_priv, CARD32 **priv)
{
- ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
- struct drm_i915_setparam sp;
- int ret;
+ struct intel_xvmc_hw_context *contextRec;
- if (!xvmc_driver) {
- ErrorF("Failed to probe XvMC driver.\n");
- return FALSE;
+ *priv = xcalloc(1, sizeof(struct intel_xvmc_hw_context));
+ contextRec = (struct intel_xvmc_hw_context *) *priv;
+ if (!contextRec) {
+ *num_priv = 0;
+ return BadAlloc;
}
- if (!(*xvmc_driver->init) (scrn, xv_adaptor)) {
- ErrorF("XvMC driver initialize failed.\n");
- return FALSE;
+ *num_priv = sizeof(struct intel_xvmc_hw_context) >> 2;
+
+ if (IS_I915(intel)) {
+ contextRec->type = XVMC_I915_MPEG2_MC;
+ contextRec->i915.use_phys_addr = 0;
+ } else {
+ if (IS_G4X(intel) || IS_IGDNG(intel))
+ contextRec->type = XVMC_I965_MPEG2_VLD;
+ else
+ contextRec->type = XVMC_I965_MPEG2_MC;
+ contextRec->i965.is_g4x = IS_G4X(intel);
+ contextRec->i965.is_965_q = IS_965_Q(intel);
+ contextRec->i965.is_igdng = IS_IGDNG(intel);
}
- /* Currently XvMC uses batchbuffer */
- sp.param = I915_SETPARAM_ALLOW_BATCHBUFFER;
- sp.value = 1;
- ret = drmCommandWrite(intel->drmSubFD, DRM_I915_SETPARAM,
- &sp, sizeof(sp));
- if (ret == 0)
- return TRUE;
+ return Success;
+}
- return FALSE;
+static void destroy_context(ScrnInfoPtr scrn, XvMCContextPtr context)
+{
}
-Bool intel_xvmc_screen_init(ScreenPtr pScreen)
+/* i915 hwmc support */
+static XF86MCSurfaceInfoRec i915_YV12_mpg2_surface = {
+ FOURCC_YV12,
+ XVMC_CHROMA_FORMAT_420,
+ 0,
+ 720,
+ 576,
+ 720,
+ 576,
+ XVMC_MPEG_2,
+ /* XVMC_OVERLAID_SURFACE | XVMC_SUBPICTURE_INDEPENDENT_SCALING, */
+ 0,
+ /* &yv12_subpicture_list */
+ NULL,
+};
+
+static XF86MCSurfaceInfoRec i915_YV12_mpg1_surface = {
+ FOURCC_YV12,
+ XVMC_CHROMA_FORMAT_420,
+ 0,
+ 720,
+ 576,
+ 720,
+ 576,
+ XVMC_MPEG_1,
+ /* XVMC_OVERLAID_SURFACE | XVMC_SUBPICTURE_INDEPENDENT_SCALING, */
+ 0,
+ NULL,
+};
+
+static XF86MCSurfaceInfoPtr surface_info_i915[2] = {
+ (XF86MCSurfaceInfoPtr) & i915_YV12_mpg2_surface,
+ (XF86MCSurfaceInfoPtr) & i915_YV12_mpg1_surface
+};
+
+/* i965 and later hwmc support */
+#ifndef XVMC_VLD
+#define XVMC_VLD 0x00020000
+#endif
+
+static XF86MCSurfaceInfoRec yv12_mpeg2_vld_surface = {
+ FOURCC_YV12,
+ XVMC_CHROMA_FORMAT_420,
+ 0,
+ 1936,
+ 1096,
+ 1920,
+ 1080,
+ XVMC_MPEG_2 | XVMC_VLD,
+ XVMC_INTRA_UNSIGNED,
+ NULL
+};
+
+static XF86MCSurfaceInfoRec yv12_mpeg2_i965_surface = {
+ FOURCC_YV12,
+ XVMC_CHROMA_FORMAT_420,
+ 0,
+ 1936,
+ 1096,
+ 1920,
+ 1080,
+ XVMC_MPEG_2 | XVMC_MOCOMP,
+ /* XVMC_OVERLAID_SURFACE | XVMC_SUBPICTURE_INDEPENDENT_SCALING, */
+ XVMC_INTRA_UNSIGNED,
+ /* &yv12_subpicture_list */
+ NULL
+};
+
+static XF86MCSurfaceInfoRec yv12_mpeg1_i965_surface = {
+ FOURCC_YV12,
+ XVMC_CHROMA_FORMAT_420,
+ 0,
+ 1920,
+ 1080,
+ 1920,
+ 1080,
+ XVMC_MPEG_1 | XVMC_MOCOMP,
+ /*XVMC_OVERLAID_SURFACE | XVMC_SUBPICTURE_INDEPENDENT_SCALING |
+ XVMC_INTRA_UNSIGNED, */
+ XVMC_INTRA_UNSIGNED,
+
+ /*&yv12_subpicture_list */
+ NULL
+};
+
+static XF86MCSurfaceInfoPtr surface_info_i965[] = {
+ &yv12_mpeg2_i965_surface,
+ &yv12_mpeg1_i965_surface
+};
+
+static XF86MCSurfaceInfoPtr surface_info_vld[] = {
+ &yv12_mpeg2_vld_surface,
+ &yv12_mpeg2_i965_surface,
+};
+
+/* check chip type and load xvmc driver */
+Bool intel_xvmc_adaptor_init(ScreenPtr pScreen)
{
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
intel_screen_private *intel = intel_get_screen_private(scrn);
+ static XF86MCAdaptorRec *pAdapt;
+ char *name;
char buf[64];
- if (!xvmc_driver)
+ if (!intel->XvMCEnabled)
+ return FALSE;
+
+ /* Needs KMS support. */
+ if (IS_I915G(intel) || IS_I915GM(intel))
+ return FALSE;
+
+ if (!IS_I9XX(intel)) {
+ ErrorF("Your chipset doesn't support XvMC.\n");
return FALSE;
+ }
+
+ pAdapt = xcalloc(1, sizeof(XF86MCAdaptorRec));
+ if (!pAdapt) {
+ ErrorF("Allocation error.\n");
+ return FALSE;
+ }
+
+ pAdapt->name = "Intel(R) Textured Video";
+ pAdapt->num_subpictures = 0;
+ pAdapt->subpictures = NULL;
+ pAdapt->CreateContext = create_context;
+ pAdapt->DestroyContext = destroy_context;
+ pAdapt->CreateSurface = create_surface;
+ pAdapt->DestroySurface = destroy_surface;
+ pAdapt->CreateSubpicture = create_subpicture;
+ pAdapt->DestroySubpicture = destroy_subpicture;
+
+ if (IS_I915(intel)) {
+ name = "i915_xvmc",
+ pAdapt->num_surfaces = ARRAY_SIZE(surface_info_i915);
+ pAdapt->surfaces = surface_info_i915;
+ } else if (IS_G4X(intel) || IS_IGDNG(intel)) {
+ name = "xvmc_vld",
+ pAdapt->num_surfaces = ARRAY_SIZE(surface_info_vld);
+ pAdapt->surfaces = surface_info_vld;
+ } else {
+ name = "i965_xvmc",
+ pAdapt->num_surfaces = ARRAY_SIZE(surface_info_i965);
+ pAdapt->surfaces = surface_info_i965;
+ }
- if (xf86XvMCScreenInit(pScreen, 1, &xvmc_driver->adaptor)) {
+ if (xf86XvMCScreenInit(pScreen, 1, &pAdapt)) {
xf86DrvMsg(scrn->scrnIndex, X_INFO,
"[XvMC] %s driver initialized.\n",
- xvmc_driver->name);
+ name);
} else {
- intel_xvmc_finish(scrn);
intel->XvMCEnabled = FALSE;
xf86DrvMsg(scrn->scrnIndex, X_INFO,
"[XvMC] Failed to initialize XvMC.\n");
@@ -139,39 +258,3 @@ Bool intel_xvmc_screen_init(ScreenPtr pScreen)
INTEL_XVMC_PATCHLEVEL);
return TRUE;
}
-
-Bool intel_xvmc_init_batch(ScrnInfoPtr scrn)
-{
- intel_screen_private *intel = intel_get_screen_private(scrn);
- int size = KB(64);
-
- if (!i830_allocate_xvmc_buffer(scrn, "[XvMC] batch buffer",
- &(xvmc_driver->batch), size,
- ALIGN_BOTH_ENDS))
- return FALSE;
-
- if (drmAddMap(intel->drmSubFD,
- (drm_handle_t) (xvmc_driver->batch->offset +
- intel->LinearAddr),
- xvmc_driver->batch->size, DRM_AGP, 0,
- &xvmc_driver->batch_handle) < 0) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[drm] drmAddMap(batchbuffer_handle) failed!\n");
- return FALSE;
- }
- return TRUE;
-}
-
-void intel_xvmc_fini_batch(ScrnInfoPtr scrn)
-{
- intel_screen_private *intel = intel_get_screen_private(scrn);
-
- if (xvmc_driver->batch_handle) {
- drmRmMap(intel->drmSubFD, xvmc_driver->batch_handle);
- xvmc_driver->batch_handle = 0;
- }
- if (xvmc_driver->batch) {
- i830_free_xvmc_buffer(scrn, xvmc_driver->batch);
- xvmc_driver->batch = NULL;
- }
-}
diff --git a/driver/xf86-video-intel/src/i830_hwmc.h b/driver/xf86-video-intel/src/i830_hwmc.h
index 0b512b4ed..8682fe0ec 100644
--- a/driver/xf86-video-intel/src/i830_hwmc.h
+++ b/driver/xf86-video-intel/src/i830_hwmc.h
@@ -47,67 +47,29 @@
#define XVMC_I945_MPEG2_VLD 0x04
#define XVMC_I965_MPEG2_VLD 0x08
-/* supported surface types */
-enum {
- SURFACE_TYPE_MPEG2_MPML = FOURCC_XVMC, /* mpeg2 MP@ML */
- SURFACE_TYPE_MPEG1_MPML, /* mpeg1 MP@ML */
- SURFACE_TYPE_MAX
-};
-
-/* common header for context private */
-struct hwmc_buffer {
- drm_handle_t handle;
- unsigned long offset;
- unsigned long size;
- unsigned long bus_addr;
-};
-
-struct _intel_xvmc_common {
+struct intel_xvmc_hw_context {
unsigned int type;
- struct hwmc_buffer batchbuffer;
- unsigned int kernel_exec_fencing:1;
+ union {
+ struct {
+ unsigned int use_phys_addr : 1;
+ } i915;
+ struct {
+ unsigned int is_g4x:1;
+ unsigned int is_965_q:1;
+ unsigned int is_igdng:1;
+ } i965;
+ };
};
/* Intel private XvMC command to DDX driver */
struct intel_xvmc_command {
- unsigned int command;
- unsigned int ctxNo;
- unsigned int srfNo;
- unsigned int subPicNo;
- unsigned int flags;
- unsigned int real_id;
uint32_t handle;
- unsigned int pad[5];
};
#ifdef _INTEL_XVMC_SERVER_
#include <xf86xvmc.h>
-struct intel_xvmc_driver {
- char *name;
- XF86MCAdaptorPtr adaptor;
- unsigned int flag;
- i830_memory *batch;
- drm_handle_t batch_handle;
-
- /* more items for xvmv surface manage? */
- Bool(*init) (ScrnInfoPtr, XF86VideoAdaptorPtr);
- void (*fini) (ScrnInfoPtr);
- void *devPrivate;
-};
-
-extern struct intel_xvmc_driver *xvmc_driver;
-extern struct intel_xvmc_driver i915_xvmc_driver;
-extern struct intel_xvmc_driver i965_xvmc_driver;
-extern struct intel_xvmc_driver vld_xvmc_driver;
-
-extern Bool intel_xvmc_probe(ScrnInfoPtr);
-extern Bool intel_xvmc_driver_init(ScreenPtr, XF86VideoAdaptorPtr);
-extern Bool intel_xvmc_screen_init(ScreenPtr);
-extern void intel_xvmc_finish(ScrnInfoPtr);
-extern int intel_xvmc_put_image_size(ScrnInfoPtr);
-extern Bool intel_xvmc_init_batch(ScrnInfoPtr);
-extern void intel_xvmc_fini_batch(ScrnInfoPtr);
+extern Bool intel_xvmc_adaptor_init(ScreenPtr);
#endif
#endif
diff --git a/driver/xf86-video-intel/src/i830_uxa.c b/driver/xf86-video-intel/src/i830_uxa.c
index 78237046a..f974e40c3 100644
--- a/driver/xf86-video-intel/src/i830_uxa.c
+++ b/driver/xf86-video-intel/src/i830_uxa.c
@@ -953,6 +953,8 @@ i830_uxa_create_pixmap(ScreenPtr screen, int w, int h, int depth,
priv = xcalloc(1, sizeof (struct intel_pixmap));
if (priv == NULL) {
fbDestroyPixmap(pixmap);
+ if (errno == EFBIG)
+ return fbCreatePixmap(screen, w, h, depth, usage);
return NullPixmap;
}
diff --git a/driver/xf86-video-intel/src/i830_video.c b/driver/xf86-video-intel/src/i830_video.c
index 62f2399b7..23163684d 100644
--- a/driver/xf86-video-intel/src/i830_video.c
+++ b/driver/xf86-video-intel/src/i830_video.c
@@ -74,7 +74,6 @@
#ifdef INTEL_XVMC
#define _INTEL_XVMC_SERVER_
#include "i830_hwmc.h"
-#include "i915_hwmc.h"
#endif
#define OFF_DELAY 250 /* milliseconds */
@@ -95,7 +94,10 @@ static int I830GetPortAttribute(ScrnInfoPtr, Atom, INT32 *, pointer);
static void I830QueryBestSize(ScrnInfoPtr, Bool,
short, short, short, short, unsigned int *,
unsigned int *, pointer);
-static int I830PutImage(ScrnInfoPtr, short, short, short, short, short, short,
+static int I830PutImageTextured(ScrnInfoPtr, short, short, short, short, short, short,
+ short, short, int, unsigned char *, short, short,
+ Bool, RegionPtr, pointer, DrawablePtr);
+static int I830PutImageOverlay(ScrnInfoPtr, short, short, short, short, short, short,
short, short, int, unsigned char *, short, short,
Bool, RegionPtr, pointer, DrawablePtr);
static int I830QueryImageAttributes(ScrnInfoPtr, int, unsigned short *,
@@ -239,7 +241,13 @@ static XF86AttributeRec GammaAttributes[GAMMA_ATTRIBUTES] = {
{XvSettable | XvGettable, 0, 0xffffff, "XV_GAMMA5"}
};
+#ifdef INTEL_XVMC
#define NUM_IMAGES 5
+#define XVMC_IMAGE 1
+#else
+#define NUM_IMAGES 4
+#define XVMC_IMAGE 0
+#endif
static XF86ImageRec Images[NUM_IMAGES] = {
XVIMAGE_YUY2,
@@ -543,9 +551,6 @@ void I830InitVideo(ScreenPtr screen)
XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL;
XF86VideoAdaptorPtr overlayAdaptor = NULL, texturedAdaptor = NULL;
int num_adaptors;
-#ifdef INTEL_XVMC
- Bool xvmc_status = FALSE;
-#endif
num_adaptors = xf86XVListGenericAdaptors(scrn, &adaptors);
/* Give our adaptor list enough space for the overlay and/or texture video
@@ -602,14 +607,6 @@ void I830InitVideo(ScreenPtr screen)
if (overlayAdaptor && !intel->XvPreferOverlay)
adaptors[num_adaptors++] = overlayAdaptor;
-#ifdef INTEL_XVMC
- if (intel_xvmc_probe(scrn)) {
- if (texturedAdaptor)
- xvmc_status =
- intel_xvmc_driver_init(screen, texturedAdaptor);
- }
-#endif
-
if (num_adaptors) {
xf86XVScreenInit(screen, adaptors, num_adaptors);
} else {
@@ -619,8 +616,8 @@ void I830InitVideo(ScreenPtr screen)
}
#ifdef INTEL_XVMC
- if (xvmc_status)
- intel_xvmc_screen_init(screen);
+ if (texturedAdaptor)
+ intel_xvmc_adaptor_init(screen);
#endif
xfree(adaptors);
}
@@ -862,7 +859,8 @@ static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr screen)
sizeof(XF86AttributeRec) * GAMMA_ATTRIBUTES);
att += GAMMA_ATTRIBUTES;
}
- adapt->nImages = NUM_IMAGES;
+ adapt->nImages = NUM_IMAGES - XVMC_IMAGE;
+
adapt->pImages = Images;
adapt->PutVideo = NULL;
adapt->PutStill = NULL;
@@ -872,7 +870,7 @@ static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr screen)
adapt->SetPortAttribute = I830SetPortAttributeOverlay;
adapt->GetPortAttribute = I830GetPortAttribute;
adapt->QueryBestSize = I830QueryBestSize;
- adapt->PutImage = I830PutImage;
+ adapt->PutImage = I830PutImageOverlay;
adapt->QueryImageAttributes = I830QueryImageAttributes;
adaptor_priv->textured = FALSE;
@@ -939,6 +937,8 @@ static XF86VideoAdaptorPtr I830SetupImageVideoOverlay(ScreenPtr screen)
static XF86VideoAdaptorPtr I830SetupImageVideoTextured(ScreenPtr screen)
{
+ ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ intel_screen_private *intel = intel_get_screen_private(scrn);
XF86VideoAdaptorPtr adapt;
XF86AttributePtr attrs;
intel_adaptor_private *adaptor_privs;
@@ -976,7 +976,11 @@ static XF86VideoAdaptorPtr I830SetupImageVideoTextured(ScreenPtr screen)
adapt->pAttributes = attrs;
memcpy(attrs, TexturedAttributes,
nAttributes * sizeof(XF86AttributeRec));
- adapt->nImages = NUM_IMAGES;
+ if (IS_I915G(intel) || IS_I915GM(intel))
+ adapt->nImages = NUM_IMAGES - XVMC_IMAGE;
+ else
+ adapt->nImages = NUM_IMAGES;
+
adapt->pImages = Images;
adapt->PutVideo = NULL;
adapt->PutStill = NULL;
@@ -986,7 +990,7 @@ static XF86VideoAdaptorPtr I830SetupImageVideoTextured(ScreenPtr screen)
adapt->SetPortAttribute = I830SetPortAttributeTextured;
adapt->GetPortAttribute = I830GetPortAttribute;
adapt->QueryBestSize = I830QueryBestSize;
- adapt->PutImage = I830PutImage;
+ adapt->PutImage = I830PutImageTextured;
adapt->QueryImageAttributes = I830QueryImageAttributes;
for (i = 0; i < nports; i++) {
@@ -1409,12 +1413,12 @@ static void i830_memcpy_plane(unsigned char *dst, unsigned char *src,
static void
I830CopyPlanarData(intel_adaptor_private *adaptor_priv,
- unsigned char *buf, int srcPitch,
- int srcPitch2, int dstPitch, int srcH, int top, int left,
+ unsigned char *buf, int srcPitch, int srcPitch2,
+ int dstPitch, int dstPitch2,
+ int srcH, int top, int left,
int h, int w, int id)
{
unsigned char *src1, *src2, *src3, *dst_base, *dst1, *dst2, *dst3;
- int dstPitch2 = dstPitch << 1;
#if 0
ErrorF("I830CopyPlanarData: srcPitch %d, srcPitch %d, dstPitch %d\n"
@@ -1974,8 +1978,9 @@ static int xvmc_passthrough(int id)
static Bool
ums_overlay_put_image(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
int id, short width, short height,
- int dstPitch, int x1, int y1, int x2, int y2, BoxPtr dstBox,
- short src_w, short src_h, short drw_w, short drw_h)
+ int dstPitch, int dstPitch2,
+ BoxPtr dstBox, short src_w, short src_h, short drw_w,
+ short drw_h)
{
intel_screen_private *intel = intel_get_screen_private(scrn);
intel_adaptor_private *adaptor_priv = intel->adaptor->pPortPrivates[0].ptr;
@@ -2043,7 +2048,7 @@ ums_overlay_put_image(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
/* set UV vertical phase to -0.25 */
overlay->UV_VPH = 0x30003000;
#endif
- overlay->OSTRIDE = (dstPitch * 2) | (dstPitch << 16);
+ overlay->OSTRIDE = (dstPitch2) | (dstPitch << 16);
OVERLAY_DEBUG("UV stride is %d, Y stride is %d\n",
dstPitch, dstPitch * 2);
} else
@@ -2071,7 +2076,7 @@ ums_overlay_put_image(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
static Bool
i830_display_overlay(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
int id, short width, short height,
- int dstPitch, int x1, int y1, int x2, int y2,
+ int dstPitch, int dstPitch2,
BoxPtr dstBox, short src_w, short src_h, short drw_w,
short drw_h)
{
@@ -2111,7 +2116,7 @@ i830_display_overlay(ScrnInfoPtr scrn, xf86CrtcPtr crtc,
}
return ums_overlay_put_image(scrn, crtc, id, width, height, dstPitch,
- x1, y1, x2, y2, dstBox, src_w, src_h, drw_w, drw_h);
+ dstPitch2, dstBox, src_w, src_h, drw_w, drw_h);
}
static Bool
@@ -2119,73 +2124,62 @@ i830_clip_video_helper(ScrnInfoPtr scrn,
intel_adaptor_private *adaptor_priv,
xf86CrtcPtr * crtc_ret,
BoxPtr dst,
- INT32 * xa,
- INT32 * xb,
- INT32 * ya,
- INT32 * yb, RegionPtr reg, INT32 width, INT32 height)
+ short src_x, short src_y,
+ short drw_x, short drw_y,
+ short src_w, short src_h,
+ short drw_w, short drw_h,
+ int id,
+ int *top, int* left, int* npixels, int *nlines,
+ RegionPtr reg, INT32 width, INT32 height)
{
Bool ret;
RegionRec crtc_region_local;
RegionPtr crtc_region = reg;
+ BoxRec crtc_box;
+ INT32 x1, x2, y1, y2;
+ xf86CrtcPtr crtc;
+
+ x1 = src_x;
+ x2 = src_x + src_w;
+ y1 = src_y;
+ y2 = src_y + src_h;
+
+ dst->x1 = drw_x;
+ dst->x2 = drw_x + drw_w;
+ dst->y1 = drw_y;
+ dst->y2 = drw_y + drw_h;
/*
* For overlay video, compute the relevant CRTC and
* clip video to that
*/
- if (crtc_ret) {
- BoxRec crtc_box;
- xf86CrtcPtr crtc = i830_covering_crtc(scrn, dst,
- adaptor_priv->desired_crtc,
- &crtc_box);
-
- /* For textured video, we don't actually want to clip at all. */
- if (crtc && !adaptor_priv->textured) {
- REGION_INIT(screen, &crtc_region_local, &crtc_box, 1);
- crtc_region = &crtc_region_local;
- REGION_INTERSECT(screen, crtc_region, crtc_region,
- reg);
- }
- *crtc_ret = crtc;
+ crtc = i830_covering_crtc(scrn, dst, adaptor_priv->desired_crtc,
+ &crtc_box);
+
+ /* For textured video, we don't actually want to clip at all. */
+ if (crtc && !adaptor_priv->textured) {
+ REGION_INIT(screen, &crtc_region_local, &crtc_box, 1);
+ crtc_region = &crtc_region_local;
+ REGION_INTERSECT(screen, crtc_region, crtc_region,
+ reg);
}
- ret = xf86XVClipVideoHelper(dst, xa, xb, ya, yb,
+ *crtc_ret = crtc;
+
+ ret = xf86XVClipVideoHelper(dst, &x1, &x2, &y1, &y2,
crtc_region, width, height);
if (crtc_region != reg)
REGION_UNINIT(screen, &crtc_region_local);
- return ret;
-}
-
-static void
-i830_fill_colorkey(ScreenPtr screen, uint32_t key, RegionPtr clipboxes)
-{
- DrawablePtr root = &WindowTable[screen->myNum]->drawable;
- XID pval[2];
- BoxPtr pbox = REGION_RECTS(clipboxes);
- int i, nbox = REGION_NUM_RECTS(clipboxes);
- xRectangle *rects;
- GCPtr gc;
-
- if (!xf86Screens[screen->myNum]->vtSema)
- return;
-
- gc = GetScratchGC(root->depth, screen);
- pval[0] = key;
- pval[1] = IncludeInferiors;
- (void)ChangeGC(gc, GCForeground | GCSubwindowMode, pval);
- ValidateGC(root, gc);
-
- rects = xalloc(nbox * sizeof(xRectangle));
-
- for (i = 0; i < nbox; i++, pbox++) {
- rects[i].x = pbox->x1;
- rects[i].y = pbox->y1;
- rects[i].width = pbox->x2 - pbox->x1;
- rects[i].height = pbox->y2 - pbox->y1;
- }
- (*gc->ops->PolyFillRect) (root, gc, nbox, rects);
+ *top = y1 >> 16;
+ *left = (x1 >> 16) & ~1;
+ *npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - *left;
+ if (is_planar_fourcc(id)) {
+ *top &= ~1;
+ *nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - *top;
+ } else
+ *nlines = ((y2 + 0xffff) >> 16) - *top;
- xfree(rects);
- FreeScratchGC(gc);
+ return ret;
}
static void
@@ -2241,29 +2235,19 @@ i830_setup_video_buffer(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv,
adaptor_priv->buf = NULL;
}
- if (xvmc_passthrough(id)) {
- i830_free_video_buffers(adaptor_priv);
- if (IS_I965G(intel)) {
- adaptor_priv->buf =
- drm_intel_bo_gem_create_from_name(intel->bufmgr,
- "xvmc surface",
- (uintptr_t)buf);
- }
- } else {
- if (adaptor_priv->buf == NULL) {
- adaptor_priv->buf = drm_intel_bo_alloc(intel->bufmgr,
- "xv buffer", alloc_size,
- 4096);
- if (adaptor_priv->buf == NULL)
- return FALSE;
- }
+ if (adaptor_priv->buf == NULL) {
+ adaptor_priv->buf = drm_intel_bo_alloc(intel->bufmgr,
+ "xv buffer", alloc_size,
+ 4096);
+ if (adaptor_priv->buf == NULL)
+ return FALSE;
}
return TRUE;
}
static void
-i830_dst_pitch_and_size(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, short width,
+i830_setup_dst_params(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, short width,
short height, int *dstPitch, int *dstPitch2, int *size,
int id)
{
@@ -2275,37 +2259,40 @@ i830_dst_pitch_and_size(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, s
*/
if (adaptor_priv->textured) {
pitchAlignMask = 3;
-#ifdef INTEL_XVMC
- /* for i915 xvmc, hw requires at least 1kb aligned surface */
- if ((id == FOURCC_XVMC) && IS_I915(intel))
- pitchAlignMask = 0x3ff;
-#endif
} else {
if (IS_I965G(intel))
- pitchAlignMask = 255;
+ /* Actually the alignment is 64 bytes, too. But the
+ * stride must be at least 512 bytes. Take the easy fix
+ * and align on 512 bytes unconditionally. */
+ pitchAlignMask = 511;
else
pitchAlignMask = 63;
}
+#if INTEL_XVMC
+ /* for i915 xvmc, hw requires 1kb aligned surfaces */
+ if ((id == FOURCC_XVMC) && IS_I915(intel))
+ pitchAlignMask = 0x3ff;
+#endif
+
/* Determine the desired destination pitch (representing the chroma's pitch,
* in the planar case.
*/
- switch (id) {
- case FOURCC_YV12:
- case FOURCC_I420:
+ if (is_planar_fourcc(id)) {
if (adaptor_priv->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
*dstPitch =
((height / 2) + pitchAlignMask) & ~pitchAlignMask;
+ *dstPitch2 =
+ (height + pitchAlignMask) & ~pitchAlignMask;
*size = *dstPitch * width * 3;
} else {
*dstPitch =
((width / 2) + pitchAlignMask) & ~pitchAlignMask;
+ *dstPitch2 =
+ (width + pitchAlignMask) & ~pitchAlignMask;
*size = *dstPitch * height * 3;
}
- break;
- case FOURCC_UYVY:
- case FOURCC_YUY2:
-
+ } else {
if (adaptor_priv->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
*dstPitch =
((height << 1) + pitchAlignMask) & ~pitchAlignMask;
@@ -2315,36 +2302,36 @@ i830_dst_pitch_and_size(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv, s
((width << 1) + pitchAlignMask) & ~pitchAlignMask;
*size = *dstPitch * height;
}
- break;
-#ifdef INTEL_XVMC
- case FOURCC_XVMC:
- *dstPitch = ((width / 2) + pitchAlignMask) & ~pitchAlignMask;
- *dstPitch2 = (width + pitchAlignMask) & ~pitchAlignMask;
- *size = 0;
- break;
-#endif
- default:
- *dstPitch = 0;
- *size = 0;
- break;
+ *dstPitch2 = 0;
}
#if 0
ErrorF("srcPitch: %d, dstPitch: %d, size: %d\n", srcPitch, *dstPitch,
size);
#endif
+
+ adaptor_priv->YBufOffset = 0;
+
+ if (adaptor_priv->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
+ adaptor_priv->UBufOffset =
+ adaptor_priv->YBufOffset + (*dstPitch2 * width);
+ adaptor_priv->VBufOffset =
+ adaptor_priv->UBufOffset + (*dstPitch * width / 2);
+ } else {
+ adaptor_priv->UBufOffset =
+ adaptor_priv->YBufOffset + (*dstPitch2 * height);
+ adaptor_priv->VBufOffset =
+ adaptor_priv->UBufOffset + (*dstPitch * height / 2);
+ }
}
static Bool
i830_copy_video_data(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv,
short width, short height, int *dstPitch, int *dstPitch2,
- INT32 x1, INT32 y1, INT32 x2, INT32 y2,
+ int top, int left, int npixels, int nlines,
int id, unsigned char *buf)
{
-#ifdef INTEL_XVMC
- intel_screen_private *intel = intel_get_screen_private(scrn);
-#endif
int srcPitch = 0, srcPitch2 = 0;
- int top, left, npixels, nlines, size;
+ int size;
if (is_planar_fourcc(id)) {
srcPitch = (width + 0x3) & ~0x3;
@@ -2353,53 +2340,19 @@ i830_copy_video_data(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv,
srcPitch = width << 1;
}
- i830_dst_pitch_and_size(scrn, adaptor_priv, width, height, dstPitch,
+ i830_setup_dst_params(scrn, adaptor_priv, width, height, dstPitch,
dstPitch2, &size, id);
if (!i830_setup_video_buffer(scrn, adaptor_priv, size, id, buf))
return FALSE;
- /* fixup pointers */
-#ifdef INTEL_XVMC
- if (id == FOURCC_XVMC && IS_I915(intel)) {
- adaptor_priv->YBufOffset = (uint32_t) ((uintptr_t) buf);
- adaptor_priv->VBufOffset = adaptor_priv->YBufOffset + (*dstPitch2 * height);
- adaptor_priv->UBufOffset =
- adaptor_priv->VBufOffset + (*dstPitch * height / 2);
- } else {
-#endif
- adaptor_priv->YBufOffset = 0;
-
- if (adaptor_priv->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
- adaptor_priv->UBufOffset =
- adaptor_priv->YBufOffset + (*dstPitch * 2 * width);
- adaptor_priv->VBufOffset =
- adaptor_priv->UBufOffset + (*dstPitch * width / 2);
- } else {
- adaptor_priv->UBufOffset =
- adaptor_priv->YBufOffset + (*dstPitch * 2 * height);
- adaptor_priv->VBufOffset =
- adaptor_priv->UBufOffset + (*dstPitch * height / 2);
- }
-#ifdef INTEL_XVMC
- }
-#endif
-
/* copy data */
- top = y1 >> 16;
- left = (x1 >> 16) & ~1;
- npixels = ((((x2 + 0xffff) >> 16) + 1) & ~1) - left;
-
if (is_planar_fourcc(id)) {
- if (!xvmc_passthrough(id)) {
- top &= ~1;
- nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top;
- I830CopyPlanarData(adaptor_priv, buf, srcPitch, srcPitch2,
- *dstPitch, height, top, left, nlines,
- npixels, id);
- }
+ I830CopyPlanarData(adaptor_priv, buf, srcPitch, srcPitch2,
+ *dstPitch, *dstPitch2,
+ height, top, left, nlines,
+ npixels, id);
} else {
- nlines = ((y2 + 0xffff) >> 16) - top;
I830CopyPackedData(adaptor_priv, buf, srcPitch, *dstPitch, top, left,
nlines, npixels);
}
@@ -2421,7 +2374,7 @@ i830_copy_video_data(ScrnInfoPtr scrn, intel_adaptor_private *adaptor_priv,
* compositing. It's a new argument to the function in the 1.1 server.
*/
static int
-I830PutImage(ScrnInfoPtr scrn,
+I830PutImageTextured(ScrnInfoPtr scrn,
short src_x, short src_y,
short drw_x, short drw_y,
short src_w, short src_h,
@@ -2433,13 +2386,11 @@ I830PutImage(ScrnInfoPtr scrn,
{
intel_screen_private *intel = intel_get_screen_private(scrn);
intel_adaptor_private *adaptor_priv = (intel_adaptor_private *) data;
- ScreenPtr screen = screenInfo.screens[scrn->scrnIndex];
PixmapPtr pixmap = get_drawable_pixmap(drawable);
- INT32 x1, x2, y1, y2;
- int dstPitch;
- int dstPitch2 = 0;
+ int dstPitch, dstPitch2;
BoxRec dstBox;
xf86CrtcPtr crtc;
+ int top, left, npixels, nlines;
#if 0
ErrorF("I830PutImage: src: (%d,%d)(%d,%d), dst: (%d,%d)(%d,%d)\n"
@@ -2447,81 +2398,131 @@ I830PutImage(ScrnInfoPtr scrn,
drw_y, drw_w, drw_h, width, height);
#endif
- if (!adaptor_priv->textured) {
- /* If dst width and height are less than 1/8th the src size, the
- * src/dst scale factor becomes larger than 8 and doesn't fit in
- * the scale register. */
- if (src_w >= (drw_w * 8))
- drw_w = src_w / 7;
+ if (!i830_clip_video_helper(scrn,
+ adaptor_priv,
+ &crtc,
+ &dstBox,
+ src_x, src_y, drw_x, drw_y,
+ src_w, src_h, drw_w, drw_h,
+ id,
+ &top, &left, &npixels, &nlines, clipBoxes,
+ width, height))
+ return Success;
+
+ if (xvmc_passthrough(id)) {
+ int size;
+ uint32_t *gem_handle = (uint32_t *)buf;
+
+ i830_free_video_buffers(adaptor_priv);
+
+ i830_setup_dst_params(scrn, adaptor_priv, width, height,
+ &dstPitch, &dstPitch2, &size, id);
+
+ if (IS_I915G(intel) || IS_I915GM(intel)) {
+ /* XXX: i915 is not support and needs some
+ * serious care. grep for KMS in i915_hwmc.c */
+ return BadAlloc;
+ }
- if (src_h >= (drw_h * 8))
- drw_h = src_h / 7;
+ adaptor_priv->buf =
+ drm_intel_bo_gem_create_from_name(intel->bufmgr,
+ "xvmc surface",
+ *gem_handle);
+ } else {
+ if (!i830_copy_video_data(scrn, adaptor_priv, width, height,
+ &dstPitch, &dstPitch2,
+ top, left, npixels, nlines, id, buf))
+ return BadAlloc;
}
- /* Clip */
- x1 = src_x;
- x2 = src_x + src_w;
- y1 = src_y;
- y2 = src_y + src_h;
+ if (crtc && adaptor_priv->SyncToVblank != 0) {
+ i830_wait_for_scanline(scrn, pixmap, crtc, clipBoxes);
+ }
- dstBox.x1 = drw_x;
- dstBox.x2 = drw_x + drw_w;
- dstBox.y1 = drw_y;
- dstBox.y2 = drw_y + drw_h;
+ if (IS_I965G(intel)) {
+ I965DisplayVideoTextured(scrn, adaptor_priv, id, clipBoxes,
+ width, height, dstPitch, dstPitch2,
+ src_w, src_h,
+ drw_w, drw_h, pixmap);
+ } else {
+ I915DisplayVideoTextured(scrn, adaptor_priv, id, clipBoxes,
+ width, height, dstPitch, dstPitch2,
+ src_w, src_h, drw_w, drw_h,
+ pixmap);
+ }
+
+ DamageDamageRegion(drawable, clipBoxes);
+
+ return Success;
+}
+
+static int
+I830PutImageOverlay(ScrnInfoPtr scrn,
+ short src_x, short src_y,
+ short drw_x, short drw_y,
+ short src_w, short src_h,
+ short drw_w, short drw_h,
+ int id, unsigned char *buf,
+ short width, short height,
+ Bool sync, RegionPtr clipBoxes, pointer data,
+ DrawablePtr drawable)
+{
+ intel_adaptor_private *adaptor_priv = (intel_adaptor_private *) data;
+ int dstPitch, dstPitch2;
+ BoxRec dstBox;
+ xf86CrtcPtr crtc;
+ int top, left, npixels, nlines;
+
+#if 0
+ ErrorF("I830PutImage: src: (%d,%d)(%d,%d), dst: (%d,%d)(%d,%d)\n" "width %d, height %d\n", src_x, src_y, src_w, src_h, drw_x,
+ drw_y, drw_w, drw_h, width, height);
+#endif
+
+ /* If dst width and height are less than 1/8th the src size, the
+ * src/dst scale factor becomes larger than 8 and doesn't fit in
+ * the scale register. */
+ if (src_w >= (drw_w * 8))
+ drw_w = src_w / 7;
+
+ if (src_h >= (drw_h * 8))
+ drw_h = src_h / 7;
if (!i830_clip_video_helper(scrn,
adaptor_priv,
&crtc,
- &dstBox, &x1, &x2, &y1, &y2, clipBoxes,
+ &dstBox,
+ src_x, src_y, drw_x, drw_y,
+ src_w, src_h, drw_w, drw_h,
+ id,
+ &top, &left, &npixels, &nlines, clipBoxes,
width, height))
return Success;
- if (!adaptor_priv->textured) {
- /* texture video handles rotation differently. */
- if (crtc)
- adaptor_priv->rotation = crtc->rotation;
- else {
- xf86DrvMsg(scrn->scrnIndex, X_WARNING,
- "Fail to clip video to any crtc!\n");
- return Success;
- }
+ /* overlay can't handle rotation natively, store it for the copy func */
+ if (crtc)
+ adaptor_priv->rotation = crtc->rotation;
+ else {
+ xf86DrvMsg(scrn->scrnIndex, X_WARNING,
+ "Fail to clip video to any crtc!\n");
+ return Success;
}
if (!i830_copy_video_data(scrn, adaptor_priv, width, height,
&dstPitch, &dstPitch2,
- x1, y1, x2, y2, id, buf))
+ top, left, npixels, nlines, id, buf))
return BadAlloc;
- if (!adaptor_priv->textured) {
- if (!i830_display_overlay
- (scrn, crtc, id, width, height, dstPitch, x1, y1, x2, y2,
- &dstBox, src_w, src_h, drw_w, drw_h))
- return BadAlloc;
-
- /* update cliplist */
- if (!REGION_EQUAL(scrn->screen, &adaptor_priv->clip, clipBoxes)) {
- REGION_COPY(scrn->screen, &adaptor_priv->clip, clipBoxes);
- i830_fill_colorkey(screen, adaptor_priv->colorKey, clipBoxes);
- }
- } else {
- if (crtc && adaptor_priv->SyncToVblank != 0) {
- i830_wait_for_scanline(scrn, pixmap, crtc, clipBoxes);
- }
-
- if (IS_I965G(intel)) {
- I965DisplayVideoTextured(scrn, adaptor_priv, id, clipBoxes,
- width, height, dstPitch, x1,
- y1, x2, y2, src_w, src_h,
- drw_w, drw_h, pixmap);
- } else {
- I915DisplayVideoTextured(scrn, adaptor_priv, id, clipBoxes,
- width, height, dstPitch,
- dstPitch2, x1, y1, x2, y2,
- src_w, src_h, drw_w, drw_h,
- pixmap);
- }
+ if (!i830_display_overlay
+ (scrn, crtc, id, width, height, dstPitch, dstPitch2,
+ &dstBox, src_w, src_h, drw_w, drw_h))
+ return BadAlloc;
- DamageDamageRegion(drawable, clipBoxes);
+ /* update cliplist */
+ if (!REGION_EQUAL(scrn->pScreen, &adaptor_priv->clip, clipBoxes)) {
+ REGION_COPY(scrn->pScreen, &adaptor_priv->clip, clipBoxes);
+ xf86XVFillKeyHelperDrawable(drawable,
+ adaptor_priv->colorKey,
+ clipBoxes);
}
adaptor_priv->videoStatus = CLIENT_VIDEO_ON;
diff --git a/driver/xf86-video-intel/src/i830_video.h b/driver/xf86-video-intel/src/i830_video.h
index f3e9ed9bc..ec7b25597 100644
--- a/driver/xf86-video-intel/src/i830_video.h
+++ b/driver/xf86-video-intel/src/i830_video.h
@@ -48,6 +48,7 @@ typedef struct {
uint32_t gamma4;
uint32_t gamma5;
+ /* only used by the overlay */
uint32_t videoStatus;
Time offTime;
Time freeTime;
@@ -75,15 +76,13 @@ void I915DisplayVideoTextured(ScrnInfoPtr scrn,
intel_adaptor_private *adaptor_priv,
int id, RegionPtr dstRegion, short width,
short height, int video_pitch, int video_pitch2,
- int x1, int y1, int x2, int y2,
short src_w, short src_h,
short drw_w, short drw_h, PixmapPtr pixmap);
void I965DisplayVideoTextured(ScrnInfoPtr scrn,
intel_adaptor_private *adaptor_priv,
int id, RegionPtr dstRegion, short width,
- short height, int video_pitch,
- int x1, int y1, int x2, int y2,
+ short height, int video_pitch, int video_pitch2,
short src_w, short src_h,
short drw_w, short drw_h, PixmapPtr pixmap);
diff --git a/driver/xf86-video-intel/src/i915_hwmc.c b/driver/xf86-video-intel/src/i915_hwmc.c
deleted file mode 100644
index 20459abbd..000000000
--- a/driver/xf86-video-intel/src/i915_hwmc.c
+++ /dev/null
@@ -1,904 +0,0 @@
-/*
- * Copyright © 2006 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Authors:
- * Xiang Haihao <haihao.xiang@intel.com>
- *
- */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <string.h>
-
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include "compiler.h"
-#include "xf86PciInfo.h"
-#include "xf86Pci.h"
-#include "xf86fbman.h"
-#include "regionstr.h"
-
-#include "i830.h"
-#include "i830_dri.h"
-#include "i830_video.h"
-#include "xf86xv.h"
-#include "xf86xvmc.h"
-#include <X11/extensions/Xv.h>
-#include <X11/extensions/XvMC.h>
-#include "xaa.h"
-#include "xaalocal.h"
-#include "dixstruct.h"
-#include "fourcc.h"
-
-#if defined(X_NEED_XVPRIV_H) || defined (_XF86_FOURCC_H_)
-#include "xf86xvpriv.h"
-#endif
-
-#define _INTEL_XVMC_SERVER_
-#include "i915_hwmc.h"
-
-#define I915_XVMC_MAX_BUFFERS 2
-#define I915_XVMC_MAX_CONTEXTS 4
-#define I915_XVMC_MAX_SURFACES 20
-
-typedef struct _I915XvMCSurfacePriv {
- i830_memory *surface;
- unsigned long offsets[I915_XVMC_MAX_BUFFERS];
- drm_handle_t surface_handle;
-} I915XvMCSurfacePriv;
-
-typedef struct _I915XvMCContextPriv {
- i830_memory *mcStaticIndirectState;
- drm_handle_t sis_handle;
- i830_memory *mcSamplerState;
- drm_handle_t ssb_handle;
- i830_memory *mcMapState;
- drm_handle_t msb_handle;
- i830_memory *mcPixelShaderProgram;
- drm_handle_t psp_handle;
- i830_memory *mcPixelShaderConstants;
- drm_handle_t psc_handle;
- i830_memory *mcCorrdata;
- drm_handle_t corrdata_handle;
-} I915XvMCContextPriv;
-
-typedef struct _I915XvMC {
- XID contexts[I915_XVMC_MAX_CONTEXTS];
- XID surfaces[I915_XVMC_MAX_SURFACES];
- I915XvMCSurfacePriv *sfprivs[I915_XVMC_MAX_SURFACES];
- I915XvMCContextPriv *ctxprivs[I915_XVMC_MAX_CONTEXTS];
- int ncontexts, nsurfaces;
- PutImageFuncPtr savePutImage;
-} I915XvMC, *I915XvMCPtr;
-
-/*
-static int yv12_subpicture_index_list[2] =
-{
- FOURCC_IA44,
- FOURCC_AI44
-};
-
-static XF86MCImageIDList yv12_subpicture_list =
-{
- ARRARY_SIZE(yv12_subpicture_index_list),
- yv12_subpicture_index_list
-};
- */
-
-static XF86MCSurfaceInfoRec i915_YV12_mpg2_surface = {
- SURFACE_TYPE_MPEG2_MPML,
- XVMC_CHROMA_FORMAT_420,
- 0,
- 720,
- 576,
- 720,
- 576,
- XVMC_MPEG_2,
- /* XVMC_OVERLAID_SURFACE | XVMC_SUBPICTURE_INDEPENDENT_SCALING, */
- 0,
- /* &yv12_subpicture_list */
- NULL,
-};
-
-static XF86MCSurfaceInfoRec i915_YV12_mpg1_surface = {
- SURFACE_TYPE_MPEG1_MPML,
- XVMC_CHROMA_FORMAT_420,
- 0,
- 720,
- 576,
- 720,
- 576,
- XVMC_MPEG_1,
- /* XVMC_OVERLAID_SURFACE | XVMC_SUBPICTURE_INDEPENDENT_SCALING, */
- 0,
- /* &yv12_subpicture_list */
- NULL,
-};
-
-static XF86MCSurfaceInfoPtr ppSI[2] = {
- (XF86MCSurfaceInfoPtr) & i915_YV12_mpg2_surface,
- (XF86MCSurfaceInfoPtr) & i915_YV12_mpg1_surface
-};
-
-#if 0
-/* List of subpicture types that we support */
-static XF86ImageRec ia44_subpicture = XVIMAGE_IA44;
-static XF86ImageRec ai44_subpicture = XVIMAGE_AI44;
-
-static XF86ImagePtr i915_subpicture_list[2] = {
- (XF86ImagePtr) & ia44_subpicture,
- (XF86ImagePtr) & ai44_subpicture
-};
-#endif
-
-/* Check context size not exceed surface type max */
-static void i915_check_context_size(XvMCContextPtr ctx)
-{
- int i;
-
- for (i = 0; i < ARRAY_SIZE(ppSI); i++) {
- if (ctx->surface_type_id == ppSI[i]->surface_type_id) {
- if (ctx->width > ppSI[i]->max_width)
- ctx->width = ppSI[i]->max_width;
- if (ctx->height > ppSI[i]->max_height)
- ctx->height = ppSI[i]->max_height;
- }
- }
-}
-
-/*
- * Init and clean up the screen private parts of XvMC.
- */
-static void initI915XvMC(I915XvMCPtr xvmc)
-{
- unsigned int i;
-
- for (i = 0; i < I915_XVMC_MAX_CONTEXTS; i++) {
- xvmc->contexts[i] = 0;
- xvmc->ctxprivs[i] = NULL;
- }
-
- for (i = 0; i < I915_XVMC_MAX_SURFACES; i++) {
- xvmc->surfaces[i] = 0;
- xvmc->sfprivs[i] = NULL;
- }
- xvmc->ncontexts = 0;
- xvmc->nsurfaces = 0;
-}
-
-static void cleanupI915XvMC(I915XvMCPtr xvmc)
-{
- int i;
-
- for (i = 0; i < I915_XVMC_MAX_CONTEXTS; i++) {
- xvmc->contexts[i] = 0;
- if (xvmc->ctxprivs[i]) {
- xfree(xvmc->ctxprivs[i]);
- xvmc->ctxprivs[i] = NULL;
- }
- }
-
- for (i = 0; i < I915_XVMC_MAX_SURFACES; i++) {
- xvmc->surfaces[i] = 0;
- if (xvmc->sfprivs[i]) {
- xfree(xvmc->sfprivs[i]);
- xvmc->sfprivs[i] = NULL;
- }
- }
-}
-
-static Bool i915_map_xvmc_buffers(ScrnInfoPtr scrn,
- I915XvMCContextPriv * ctxpriv)
-{
- intel_screen_private *intel = intel_get_screen_private(scrn);
-
- if (drmAddMap(intel->drmSubFD,
- (drm_handle_t) (ctxpriv->mcStaticIndirectState->offset +
- intel->LinearAddr),
- ctxpriv->mcStaticIndirectState->size, DRM_AGP, 0,
- (drmAddress) & ctxpriv->sis_handle) < 0) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[drm] drmAddMap(sis_handle) failed!\n");
- return FALSE;
- }
-
- if (drmAddMap(intel->drmSubFD,
- (drm_handle_t) (ctxpriv->mcSamplerState->offset +
- intel->LinearAddr),
- ctxpriv->mcSamplerState->size, DRM_AGP, 0,
- (drmAddress) & ctxpriv->ssb_handle) < 0) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[drm] drmAddMap(ssb_handle) failed!\n");
- return FALSE;
- }
-
- if (drmAddMap(intel->drmSubFD,
- (drm_handle_t) (ctxpriv->mcMapState->offset +
- intel->LinearAddr),
- ctxpriv->mcMapState->size, DRM_AGP, 0,
- (drmAddress) & ctxpriv->msb_handle) < 0) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[drm] drmAddMap(msb_handle) failed!\n");
- return FALSE;
- }
-
- if (drmAddMap(intel->drmSubFD,
- (drm_handle_t) (ctxpriv->mcPixelShaderProgram->offset +
- intel->LinearAddr),
- ctxpriv->mcPixelShaderProgram->size, DRM_AGP, 0,
- (drmAddress) & ctxpriv->psp_handle) < 0) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[drm] drmAddMap(psp_handle) failed!\n");
- return FALSE;
- }
-
- if (drmAddMap(intel->drmSubFD,
- (drm_handle_t) (ctxpriv->mcPixelShaderConstants->offset +
- intel->LinearAddr),
- ctxpriv->mcPixelShaderConstants->size, DRM_AGP, 0,
- (drmAddress) & ctxpriv->psc_handle) < 0) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[drm] drmAddMap(psc_handle) failed!\n");
- return FALSE;
- }
-
- if (drmAddMap(intel->drmSubFD,
- (drm_handle_t) (ctxpriv->mcCorrdata->offset +
- intel->LinearAddr),
- ctxpriv->mcCorrdata->size, DRM_AGP, 0,
- (drmAddress) & ctxpriv->corrdata_handle) < 0) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[drm] drmAddMap(corrdata_handle) failed!\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-static void i915_unmap_xvmc_buffers(ScrnInfoPtr scrn,
- I915XvMCContextPriv * ctxpriv)
-{
- intel_screen_private *intel = intel_get_screen_private(scrn);
-
- if (ctxpriv->sis_handle) {
- drmRmMap(intel->drmSubFD, ctxpriv->sis_handle);
- ctxpriv->sis_handle = 0;
- }
-
- if (ctxpriv->ssb_handle) {
- drmRmMap(intel->drmSubFD, ctxpriv->ssb_handle);
- ctxpriv->ssb_handle = 0;
- }
-
- if (ctxpriv->msb_handle) {
- drmRmMap(intel->drmSubFD, ctxpriv->msb_handle);
- ctxpriv->msb_handle = 0;
- }
-
- if (ctxpriv->psp_handle) {
- drmRmMap(intel->drmSubFD, ctxpriv->psp_handle);
- ctxpriv->psp_handle = 0;
- }
-
- if (ctxpriv->psc_handle) {
- drmRmMap(intel->drmSubFD, ctxpriv->psc_handle);
- ctxpriv->psc_handle = 0;
- }
-
- if (ctxpriv->corrdata_handle) {
- drmRmMap(intel->drmSubFD, ctxpriv->corrdata_handle);
- ctxpriv->corrdata_handle = 0;
- }
-
-}
-
-static Bool i915_allocate_xvmc_buffers(ScrnInfoPtr scrn,
- I915XvMCContextPriv * ctxpriv)
-{
- intel_screen_private *intel = intel_get_screen_private(scrn);
- int flags = ALIGN_BOTH_ENDS;
-
- /* on 915G/GM, load indirect can only use physical address...sigh */
- if (IS_I915G(intel) || IS_I915GM(intel))
- flags |= NEED_PHYSICAL_ADDR;
-
- if (!i830_allocate_xvmc_buffer(scrn, "[XvMC]Static Indirect State",
- &(ctxpriv->mcStaticIndirectState),
- 4 * 1024, flags)) {
- return FALSE;
- }
-
- if (!i830_allocate_xvmc_buffer(scrn, "[XvMC]Sampler State",
- &(ctxpriv->mcSamplerState), 4 * 1024,
- flags)) {
- return FALSE;
- }
-
- if (!i830_allocate_xvmc_buffer(scrn, "[XvMC]Map State",
- &(ctxpriv->mcMapState), 4 * 1024,
- flags)) {
- return FALSE;
- }
-
- if (!i830_allocate_xvmc_buffer(scrn, "[XvMC]Pixel Shader Program",
- &(ctxpriv->mcPixelShaderProgram),
- 4 * 1024, flags)) {
- return FALSE;
- }
-
- if (!i830_allocate_xvmc_buffer(scrn, "[XvMC]Pixel Shader Constants",
- &(ctxpriv->mcPixelShaderConstants),
- 4 * 1024, flags)) {
- return FALSE;
- }
-
- if (!i830_allocate_xvmc_buffer(scrn, "[XvMC]Correction Data Buffer",
- &(ctxpriv->mcCorrdata), 512 * 1024,
- ALIGN_BOTH_ENDS)) {
- return FALSE;
- }
-
- if (1)
- i830_describe_allocations(scrn, 1, "i915_mc: ");
-
- return TRUE;
-}
-
-static void i915_free_xvmc_buffers(ScrnInfoPtr scrn,
- I915XvMCContextPriv * ctxpriv)
-{
- if (ctxpriv->mcStaticIndirectState) {
- i830_free_xvmc_buffer(scrn, ctxpriv->mcStaticIndirectState);
- ctxpriv->mcStaticIndirectState = NULL;
- }
-
- if (ctxpriv->mcSamplerState) {
- i830_free_xvmc_buffer(scrn, ctxpriv->mcSamplerState);
- ctxpriv->mcSamplerState = NULL;
- }
-
- if (ctxpriv->mcMapState) {
- i830_free_xvmc_buffer(scrn, ctxpriv->mcMapState);
- ctxpriv->mcMapState = NULL;
- }
-
- if (ctxpriv->mcPixelShaderProgram) {
- i830_free_xvmc_buffer(scrn, ctxpriv->mcPixelShaderProgram);
- ctxpriv->mcPixelShaderProgram = NULL;
- }
-
- if (ctxpriv->mcPixelShaderConstants) {
- i830_free_xvmc_buffer(scrn, ctxpriv->mcPixelShaderConstants);
- ctxpriv->mcPixelShaderConstants = NULL;
- }
-
- if (ctxpriv->mcCorrdata) {
- i830_free_xvmc_buffer(scrn, ctxpriv->mcCorrdata);
- ctxpriv->mcCorrdata = NULL;
- }
-
-}
-
-/*
- * i915_xvmc_create_context
- *
- * Some info about the private data:
- *
- * Set *num_priv to the number of 32bit words that make up the size of
- * of the data that priv will point to.
- *
- * *priv = (long *) xcalloc (elements, sizeof(element))
- * *num_priv = (elements * sizeof(element)) >> 2;
- *
- **************************************************************************/
-
-static int i915_xvmc_create_context(ScrnInfoPtr scrn, XvMCContextPtr pContext,
- int *num_priv, long **priv)
-{
- intel_screen_private *intel = intel_get_screen_private(scrn);
- I915XvMCCreateContextRec *contextRec = NULL;
- I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate;
- I915XvMCContextPriv *ctxpriv = NULL;
- int i;
-
- *priv = NULL;
- *num_priv = 0;
-
- if (!intel->XvMCEnabled) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[XvMC] i915: XvMC disabled!\n");
- return BadAlloc;
- }
-
- for (i = 0; i < I915_XVMC_MAX_CONTEXTS; i++) {
- if (!pXvMC->contexts[i])
- break;
- }
-
- if (i == I915_XVMC_MAX_CONTEXTS ||
- pXvMC->ncontexts >= I915_XVMC_MAX_CONTEXTS) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[XvMC] i915: Out of contexts.\n");
- return BadAlloc;
- }
-
- i915_check_context_size(pContext);
-
- *priv = xcalloc(1, sizeof(I915XvMCCreateContextRec));
- contextRec = (I915XvMCCreateContextRec *) * priv;
-
- if (!*priv) {
- *num_priv = 0;
- return BadAlloc;
- }
-
- *num_priv = sizeof(I915XvMCCreateContextRec) >> 2;
-
- ctxpriv =
- (I915XvMCContextPriv *) xcalloc(1, sizeof(I915XvMCContextPriv));
-
- if (!ctxpriv) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[XvMC] i915: Unable to allocate memory!\n");
- xfree(*priv);
- *priv = NULL;
- *num_priv = 0;
- return BadAlloc;
- }
-
- if (!i915_allocate_xvmc_buffers(scrn, ctxpriv)) {
- i915_free_xvmc_buffers(scrn, ctxpriv);
- xfree(ctxpriv);
- ctxpriv = NULL;
- xfree(*priv);
- *priv = NULL;
- *num_priv = 0;
- return BadAlloc;
- }
-
- if (!i915_map_xvmc_buffers(scrn, ctxpriv)) {
- i915_unmap_xvmc_buffers(scrn, ctxpriv);
- i915_free_xvmc_buffers(scrn, ctxpriv);
- xfree(ctxpriv);
- ctxpriv = NULL;
- xfree(*priv);
- *priv = NULL;
- *num_priv = 0;
- return BadAlloc;
- }
-
- /* common context items */
- contextRec->comm.type = xvmc_driver->flag;
- contextRec->comm.batchbuffer.offset = xvmc_driver->batch->offset;
- contextRec->comm.batchbuffer.size = xvmc_driver->batch->size;
- contextRec->comm.batchbuffer.handle = xvmc_driver->batch_handle;
-
- /* i915 private context */
- contextRec->ctxno = i;
- contextRec->sis.handle = ctxpriv->sis_handle;
- contextRec->sis.offset = ctxpriv->mcStaticIndirectState->offset;
- contextRec->sis.size = ctxpriv->mcStaticIndirectState->size;
- contextRec->ssb.handle = ctxpriv->ssb_handle;
- contextRec->ssb.offset = ctxpriv->mcSamplerState->offset;
- contextRec->ssb.size = ctxpriv->mcSamplerState->size;
- contextRec->msb.handle = ctxpriv->msb_handle;
- contextRec->msb.offset = ctxpriv->mcMapState->offset;
- contextRec->msb.size = ctxpriv->mcMapState->size;
- contextRec->psp.handle = ctxpriv->psp_handle;
- contextRec->psp.offset = ctxpriv->mcPixelShaderProgram->offset;
- contextRec->psp.size = ctxpriv->mcPixelShaderProgram->size;
- contextRec->psc.handle = ctxpriv->psc_handle;
- contextRec->psc.offset = ctxpriv->mcPixelShaderConstants->offset;
- contextRec->psc.size = ctxpriv->mcPixelShaderConstants->size;
- contextRec->corrdata.handle = ctxpriv->corrdata_handle;
- contextRec->corrdata.offset = ctxpriv->mcCorrdata->offset;
- contextRec->corrdata.size = ctxpriv->mcCorrdata->size;
- contextRec->deviceID = DEVICE_ID(intel->PciInfo);
-
- /* XXX: KMS */
- if (IS_I915G(intel) || IS_I915GM(intel)) {
- contextRec->sis.bus_addr =
- ctxpriv->mcStaticIndirectState->bus_addr;
- contextRec->ssb.bus_addr = ctxpriv->mcSamplerState->bus_addr;
- contextRec->msb.bus_addr = ctxpriv->mcMapState->bus_addr;
- contextRec->psp.bus_addr =
- ctxpriv->mcPixelShaderProgram->bus_addr;
- contextRec->psc.bus_addr =
- ctxpriv->mcPixelShaderConstants->bus_addr;
- }
-
- pXvMC->ncontexts++;
- pXvMC->contexts[i] = pContext->context_id;
- pXvMC->ctxprivs[i] = ctxpriv;
-
- return Success;
-}
-
-static int i915_xvmc_create_surface(ScrnInfoPtr scrn, XvMCSurfacePtr pSurf,
- int *num_priv, long **priv)
-{
- intel_screen_private *intel = intel_get_screen_private(scrn);
- I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate;
- I915XvMCSurfacePriv *sfpriv = NULL;
- I915XvMCCreateSurfaceRec *surfaceRec = NULL;
- XvMCContextPtr ctx = NULL;
- unsigned int srfno;
- unsigned long bufsize;
-
- if (!intel->XvMCEnabled) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[XvMC] i915: XvMC disabled!\n");
- return BadAlloc;
- }
-
- *priv = NULL;
- *num_priv = 0;
-
- for (srfno = 0; srfno < I915_XVMC_MAX_SURFACES; ++srfno) {
- if (!pXvMC->surfaces[srfno])
- break;
- }
-
- if (srfno == I915_XVMC_MAX_SURFACES ||
- pXvMC->nsurfaces >= I915_XVMC_MAX_SURFACES) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[XvMC] i915: Too many surfaces !\n");
- return BadAlloc;
- }
-
- *priv = xcalloc(1, sizeof(I915XvMCCreateSurfaceRec));
- surfaceRec = (I915XvMCCreateSurfaceRec *) * priv;
-
- if (!*priv) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[XvMC] i915:Unable to allocate surface priv ret memory!\n");
- return BadAlloc;
- }
-
- *num_priv = sizeof(I915XvMCCreateSurfaceRec) >> 2;
- sfpriv =
- (I915XvMCSurfacePriv *) xcalloc(1, sizeof(I915XvMCSurfacePriv));
-
- if (!sfpriv) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[XvMC] i915: Unable to allocate surface priv memory!\n");
- xfree(*priv);
- *priv = NULL;
- *num_priv = 0;
- return BadAlloc;
- }
-
- ctx = pSurf->context;
- bufsize = SIZE_YUV420(ctx->width, ctx->height);
-
- if (!i830_allocate_xvmc_buffer(scrn, "XvMC surface",
- &(sfpriv->surface), bufsize,
- ALIGN_BOTH_ENDS)) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[XvMC] i915 : Failed to allocate XvMC surface space!\n");
- xfree(sfpriv);
- xfree(*priv);
- *priv = NULL;
- *num_priv = 0;
- return BadAlloc;
- }
-
- if (0)
- i830_describe_allocations(scrn, 1, "");
-
- if (drmAddMap(intel->drmSubFD,
- (drm_handle_t) (sfpriv->surface->offset +
- intel->LinearAddr), sfpriv->surface->size,
- DRM_AGP, 0, (drmAddress) & sfpriv->surface_handle) < 0) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[drm] drmAddMap(surface_handle) failed!\n");
- i830_free_xvmc_buffer(scrn, sfpriv->surface);
- xfree(sfpriv);
- xfree(*priv);
- *priv = NULL;
- *num_priv = 0;
- return BadAlloc;
- }
-
- surfaceRec->srfno = srfno;
- surfaceRec->srf.handle = sfpriv->surface_handle;
- surfaceRec->srf.offset = sfpriv->surface->offset;
- surfaceRec->srf.size = sfpriv->surface->size;
-
- pXvMC->surfaces[srfno] = pSurf->surface_id;
- pXvMC->sfprivs[srfno] = sfpriv;
- pXvMC->nsurfaces++;
-
- return Success;
-}
-
-static int i915_xvmc_create_subpict(ScrnInfoPtr scrn, XvMCSubpicturePtr pSubp,
- int *num_priv, long **priv)
-{
- intel_screen_private *intel = intel_get_screen_private(scrn);
- I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate;
- I915XvMCSurfacePriv *sfpriv = NULL;
- I915XvMCCreateSurfaceRec *surfaceRec = NULL;
- XvMCContextPtr ctx = NULL;
- unsigned int srfno;
- unsigned int bufsize;
-
- *priv = NULL;
- *num_priv = 0;
-
- for (srfno = 0; srfno < I915_XVMC_MAX_SURFACES; ++srfno) {
- if (!pXvMC->surfaces[srfno])
- break;
- }
-
- if (srfno == I915_XVMC_MAX_SURFACES ||
- pXvMC->nsurfaces >= I915_XVMC_MAX_SURFACES) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[XvMC] i915: Too many surfaces !\n");
- return BadAlloc;
- }
-
- *priv = xcalloc(1, sizeof(I915XvMCCreateSurfaceRec));
- surfaceRec = (I915XvMCCreateSurfaceRec *) * priv;
-
- if (!*priv) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[XvMC] i915: Unable to allocate memory!\n");
- return BadAlloc;
- }
-
- *num_priv = sizeof(I915XvMCCreateSurfaceRec) >> 2;
- sfpriv =
- (I915XvMCSurfacePriv *) xcalloc(1, sizeof(I915XvMCSurfacePriv));
-
- if (!sfpriv) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[XvMC] i915: Unable to allocate memory!\n");
- xfree(*priv);
- *priv = NULL;
- *num_priv = 0;
- return BadAlloc;
- }
-
- ctx = pSubp->context;
- bufsize = SIZE_XX44(ctx->width, ctx->height);
-
- if (!i830_allocate_xvmc_buffer(scrn, "XvMC surface",
- &(sfpriv->surface), bufsize,
- ALIGN_BOTH_ENDS)) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[XvMC] I915XvMCCreateSurface: Failed to allocate XvMC surface space!\n");
- xfree(sfpriv);
- xfree(*priv);
- *priv = NULL;
- *num_priv = 0;
- return BadAlloc;
- }
-
- if (drmAddMap(intel->drmSubFD,
- (drm_handle_t) (sfpriv->surface->offset +
- intel->LinearAddr), sfpriv->surface->size,
- DRM_AGP, 0, (drmAddress) & sfpriv->surface_handle) < 0) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[drm] drmAddMap(surface_handle) failed!\n");
- i830_free_xvmc_buffer(scrn, sfpriv->surface);
- xfree(sfpriv);
- xfree(*priv);
- *priv = NULL;
- *num_priv = 0;
- return BadAlloc;
- }
-
- surfaceRec->srfno = srfno;
- surfaceRec->srf.handle = sfpriv->surface_handle;
- surfaceRec->srf.offset = sfpriv->surface->offset;
- surfaceRec->srf.size = sfpriv->surface->size;
-
- pXvMC->sfprivs[srfno] = sfpriv;
- pXvMC->surfaces[srfno] = pSubp->subpicture_id;
- pXvMC->nsurfaces++;
-
- return Success;
-}
-
-static void i915_xvmc_destroy_context(ScrnInfoPtr scrn,
- XvMCContextPtr pContext)
-{
- I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate;
- int i;
-
- for (i = 0; i < I915_XVMC_MAX_CONTEXTS; i++) {
- if (pXvMC->contexts[i] == pContext->context_id) {
- i915_unmap_xvmc_buffers(scrn, pXvMC->ctxprivs[i]);
- i915_free_xvmc_buffers(scrn, pXvMC->ctxprivs[i]);
- xfree(pXvMC->ctxprivs[i]);
- pXvMC->ctxprivs[i] = 0;
- pXvMC->ncontexts--;
- pXvMC->contexts[i] = 0;
- return;
- }
- }
-
- return;
-}
-
-static void i915_xvmc_destroy_surface(ScrnInfoPtr scrn, XvMCSurfacePtr pSurf)
-{
- intel_screen_private *intel = intel_get_screen_private(scrn);
- I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate;
- int i;
-
- for (i = 0; i < I915_XVMC_MAX_SURFACES; i++) {
- if (pXvMC->surfaces[i] == pSurf->surface_id) {
- drmRmMap(intel->drmSubFD,
- pXvMC->sfprivs[i]->surface_handle);
- i830_free_xvmc_buffer(scrn,
- pXvMC->sfprivs[i]->surface);
- xfree(pXvMC->sfprivs[i]);
- pXvMC->nsurfaces--;
- pXvMC->sfprivs[i] = 0;
- pXvMC->surfaces[i] = 0;
- return;
- }
- }
-
- return;
-}
-
-static void i915_xvmc_destroy_subpict(ScrnInfoPtr scrn,
- XvMCSubpicturePtr pSubp)
-{
- intel_screen_private *intel = intel_get_screen_private(scrn);
- I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate;
- int i;
-
- for (i = 0; i < I915_XVMC_MAX_SURFACES; i++) {
- if (pXvMC->surfaces[i] == pSubp->subpicture_id) {
- drmRmMap(intel->drmSubFD,
- pXvMC->sfprivs[i]->surface_handle);
- i830_free_xvmc_buffer(scrn,
- pXvMC->sfprivs[i]->surface);
- xfree(pXvMC->sfprivs[i]);
- pXvMC->nsurfaces--;
- pXvMC->sfprivs[i] = 0;
- pXvMC->surfaces[i] = 0;
- return;
- }
- }
-
- return;
-}
-
-static int i915_xvmc_put_image(ScrnInfoPtr scrn,
- short src_x, short src_y,
- short drw_x, short drw_y, short src_w,
- short src_h, short drw_w, short drw_h,
- int id, unsigned char *buf, short width,
- short height, Bool sync, RegionPtr clipBoxes,
- pointer data, DrawablePtr pDraw)
-{
- I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate;
- struct intel_xvmc_command *xvmc_cmd = (struct intel_xvmc_command *)buf;
- int ret;
-
- if (FOURCC_XVMC == id) {
- switch (xvmc_cmd->command) {
- case INTEL_XVMC_COMMAND_DISPLAY:
- if ((xvmc_cmd->srfNo >= I915_XVMC_MAX_SURFACES) ||
- !pXvMC->surfaces[xvmc_cmd->srfNo] ||
- !pXvMC->sfprivs[xvmc_cmd->srfNo]) {
- xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "[XvMC] i915 put image: Invalid parameters!\n");
- return 1;
- }
-
- /* use char *buf to hold our surface offset...hacky! */
- buf =
- (unsigned char *)pXvMC->sfprivs[xvmc_cmd->srfNo]->
- surface->offset;
- break;
- default:
- return 0;
- }
- }
-
- ret =
- pXvMC->savePutImage(scrn, src_x, src_y, drw_x, drw_y, src_w, src_h,
- drw_w, drw_h, id, buf, width, height, sync,
- clipBoxes, data, pDraw);
- return ret;
-}
-
-static Bool i915_xvmc_init(ScrnInfoPtr scrn, XF86VideoAdaptorPtr XvAdapt)
-{
- I915XvMCPtr pXvMC;
-
- pXvMC = (I915XvMCPtr) xcalloc(1, sizeof(I915XvMC));
- if (!pXvMC) {
- xf86DrvMsg(scrn->scrnIndex, X_WARNING,
- "[XvMC] alloc driver private failed!\n");
- return FALSE;
- }
- xvmc_driver->devPrivate = (void *)pXvMC;
- if (!intel_xvmc_init_batch(scrn)) {
- xf86DrvMsg(scrn->scrnIndex, X_WARNING,
- "[XvMC] fail to init batch buffer\n");
- xfree(pXvMC);
- return FALSE;
- }
- initI915XvMC(pXvMC);
-
- /* set up wrappers */
- pXvMC->savePutImage = XvAdapt->PutImage;
- XvAdapt->PutImage = i915_xvmc_put_image;
- return TRUE;
-}
-
-static void i915_xvmc_fini(ScrnInfoPtr scrn)
-{
- I915XvMCPtr pXvMC = (I915XvMCPtr) xvmc_driver->devPrivate;
-
- cleanupI915XvMC(pXvMC);
- intel_xvmc_fini_batch(scrn);
- xfree(xvmc_driver->devPrivate);
-}
-
-/* Fill in the device dependent adaptor record.
- * This is named "Intel(R) Textured Video" because this code falls under the
- * XV extenstion, the name must match or it won't be used.
- *
- * Surface and Subpicture - see above
- * Function pointers to functions below
- */
-static XF86MCAdaptorRec pAdapt = {
- .name = "Intel(R) Textured Video",
- .num_surfaces = ARRAY_SIZE(ppSI),
- .surfaces = ppSI,
-#if 0
- .num_subpictures = ARRARY_SIZE(i915_subpicture_list),
- .subpictures = i915_subpicture_list,
-#endif
- .num_subpictures = 0,
- .subpictures = NULL,
- .CreateContext =
- (xf86XvMCCreateContextProcPtr) i915_xvmc_create_context,
- .DestroyContext =
- (xf86XvMCDestroyContextProcPtr) i915_xvmc_destroy_context,
- .CreateSurface =
- (xf86XvMCCreateSurfaceProcPtr) i915_xvmc_create_surface,
- .DestroySurface =
- (xf86XvMCDestroySurfaceProcPtr) i915_xvmc_destroy_surface,
- .CreateSubpicture =
- (xf86XvMCCreateSubpictureProcPtr) i915_xvmc_create_subpict,
- .DestroySubpicture =
- (xf86XvMCDestroySubpictureProcPtr) i915_xvmc_destroy_subpict,
-};
-
-/* new xvmc driver interface */
-struct intel_xvmc_driver i915_xvmc_driver = {
- .name = "i915_xvmc",
- .adaptor = &pAdapt,
- .flag = XVMC_I915_MPEG2_MC,
- .init = i915_xvmc_init,
- .fini = i915_xvmc_fini,
-};
diff --git a/driver/xf86-video-intel/src/i915_hwmc.h b/driver/xf86-video-intel/src/i915_hwmc.h
deleted file mode 100644
index 59940ea17..000000000
--- a/driver/xf86-video-intel/src/i915_hwmc.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright © 2006 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Authors:
- * Xiang Haihao <haihao.xiang@intel.com>
- *
- */
-#ifndef _I915_HWMC_H
-#define _I915_HWMC_H
-
-#include "i830_hwmc.h"
-
-/* i915 hw requires surface to be at least 1KB aligned */
-#define STRIDE(w) (((w) + 0x3ff) & ~0x3ff)
-#define SIZE_Y420(w, h) (h * STRIDE(w))
-#define SIZE_UV420(w, h) ((h >> 1) * STRIDE(w >> 1))
-#define SIZE_YUV420(w, h) (SIZE_Y420(w,h) + SIZE_UV420(w,h) * 2)
-#define SIZE_XX44(w, h) (h * STRIDE(w))
-
-#define I915_NUM_XVMC_ATTRIBUTES 0x02
-#define I915_XVMC_VALID 0x80000000
-
-typedef struct {
- struct _intel_xvmc_common comm;
- unsigned int ctxno; /* XvMC private context reference number */
- struct hwmc_buffer sis;
- struct hwmc_buffer ssb;
- struct hwmc_buffer msb;
- struct hwmc_buffer psp;
- struct hwmc_buffer psc;
- struct hwmc_buffer corrdata; /* Correction Data Buffer */
- int deviceID;
-} I915XvMCCreateContextRec;
-
-typedef struct {
- unsigned int srfno;
- struct hwmc_buffer srf;
-} I915XvMCCreateSurfaceRec;
-
-#endif /* _I915_HWMC_H */
diff --git a/driver/xf86-video-intel/src/i915_video.c b/driver/xf86-video-intel/src/i915_video.c
index 4e4ec03a4..927047be7 100644
--- a/driver/xf86-video-intel/src/i915_video.c
+++ b/driver/xf86-video-intel/src/i915_video.c
@@ -44,7 +44,7 @@ I915DisplayVideoTextured(ScrnInfoPtr scrn,
intel_adaptor_private *adaptor_priv, int id,
RegionPtr dstRegion,
short width, short height, int video_pitch,
- int video_pitch2, int x1, int y1, int x2, int y2,
+ int video_pitch2,
short src_w, short src_h, short drw_w, short drw_h,
PixmapPtr pixmap)
{
diff --git a/driver/xf86-video-intel/src/i965_hwmc.c b/driver/xf86-video-intel/src/i965_hwmc.c
deleted file mode 100644
index 5b24f3be6..000000000
--- a/driver/xf86-video-intel/src/i965_hwmc.c
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright © 2008 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Author:
- * Zou Nan hai <nanhai.zou@intel.com>
- *
- */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <X11/extensions/Xv.h>
-#include <X11/extensions/XvMC.h>
-#include <fourcc.h>
-
-#include "i830.h"
-#include "i830_dri.h"
-#define _INTEL_XVMC_SERVER_
-#include "i830_hwmc.h"
-#include "i965_hwmc.h"
-#include "intel_bufmgr.h"
-
-#define STRIDE(w) (w)
-#define SIZE_YUV420(w, h) (h * (STRIDE(w) + STRIDE(w >> 1)))
-#define VLD_MAX_SLICE_LEN (32*1024)
-
-#ifndef XVMC_VLD
-#define XVMC_VLD 0x00020000
-#endif
-
-static PutImageFuncPtr savedXvPutImage;
-
-static int create_context(ScrnInfoPtr scrn,
- XvMCContextPtr context, int *num_privates,
- CARD32 ** private)
-{
- struct i965_xvmc_context *private_context, *context_dup;
- intel_screen_private *intel = intel_get_screen_private(scrn);
-
- unsigned int blocknum =
- (((context->width + 15) / 16) * ((context->height + 15) / 16));
- unsigned int blocksize = 6 * blocknum * 64 * sizeof(short);
- blocksize = (blocksize + 4095) & (~4095);
- if ((private_context = Xcalloc(sizeof(*private_context))) == NULL) {
- ErrorF("XVMC Can not allocate private context\n");
- return BadAlloc;
- }
-
- if ((context_dup = Xcalloc(sizeof(*private_context))) == NULL) {
- ErrorF("XVMC Can not allocate private context\n");
- return BadAlloc;
- }
-
- private_context->is_g4x = IS_G4X(intel);
- private_context->is_965_q = IS_965_Q(intel);
- private_context->is_igdng = IS_IGDNG(intel);
- private_context->comm.kernel_exec_fencing = 1;
- private_context->comm.type = xvmc_driver->flag;
-
- *num_privates = sizeof(*private_context) / sizeof(CARD32);
- *private = (CARD32 *) private_context;
- memcpy(context_dup, private_context, sizeof(*private_context));
- context->driver_priv = context_dup;
-
- return Success;
-}
-
-static void destroy_context(ScrnInfoPtr scrn, XvMCContextPtr context)
-{
- struct i965_xvmc_context *private_context;
- private_context = context->driver_priv;
- Xfree(private_context);
-}
-
-static int create_surface(ScrnInfoPtr scrn, XvMCSurfacePtr surface,
- int *num_priv, CARD32 ** priv)
-{
- XvMCContextPtr ctx = surface->context;
-
- struct i965_xvmc_surface *priv_surface, *surface_dup;
- struct i965_xvmc_context *priv_ctx = ctx->driver_priv;
- int i;
- for (i = 0; i < I965_MAX_SURFACES; i++) {
- if (priv_ctx->surfaces[i] == NULL) {
- priv_surface = Xcalloc(sizeof(*priv_surface));
- if (priv_surface == NULL)
- return BadAlloc;
- surface_dup = Xcalloc(sizeof(*priv_surface));
- if (surface_dup == NULL)
- return BadAlloc;
-
- priv_surface->no = i;
- priv_surface->handle = priv_surface;
- priv_surface->w = ctx->width;
- priv_surface->h = ctx->height;
- priv_ctx->surfaces[i] = surface->driver_priv
- = priv_surface;
- memcpy(surface_dup, priv_surface,
- sizeof(*priv_surface));
- *num_priv = sizeof(*priv_surface) / sizeof(CARD32);
- *priv = (CARD32 *) surface_dup;
- break;
- }
- }
-
- if (i >= I965_MAX_SURFACES) {
- ErrorF("I965 XVMC too many surfaces in one context\n");
- return BadAlloc;
- }
-
- return Success;
-}
-
-static void destory_surface(ScrnInfoPtr scrn, XvMCSurfacePtr surface)
-{
- XvMCContextPtr ctx = surface->context;
- struct i965_xvmc_surface *priv_surface = surface->driver_priv;
- struct i965_xvmc_context *priv_ctx = ctx->driver_priv;
- priv_ctx->surfaces[priv_surface->no] = NULL;
- Xfree(priv_surface);
-}
-
-static int create_subpicture(ScrnInfoPtr scrn, XvMCSubpicturePtr subpicture,
- int *num_priv, CARD32 ** priv)
-{
- return Success;
-}
-
-static void destroy_subpicture(ScrnInfoPtr scrn, XvMCSubpicturePtr subpicture)
-{
-}
-
-static int put_image(ScrnInfoPtr scrn,
- short src_x, short src_y,
- short drw_x, short drw_y, short src_w,
- short src_h, short drw_w, short drw_h,
- int id, unsigned char *buf, short width,
- short height, Bool sync, RegionPtr clipBoxes, pointer data,
- DrawablePtr drawable)
-{
- struct intel_xvmc_command *cmd = (struct intel_xvmc_command *)buf;
-
- if (id == FOURCC_XVMC) {
- /* Pass the GEM object name through the pointer arg. */
- buf = (void *)(uintptr_t)cmd->handle;
- }
-
- savedXvPutImage(scrn, src_x, src_y, drw_x, drw_y, src_w, src_h,
- drw_w, drw_h, id, buf,
- width, height, sync, clipBoxes,
- data, drawable);
-
- return Success;
-}
-
-static Bool init(ScrnInfoPtr screen_info, XF86VideoAdaptorPtr adaptor)
-{
- savedXvPutImage = adaptor->PutImage;
- adaptor->PutImage = put_image;
-
- return TRUE;
-}
-
-static void fini(ScrnInfoPtr screen_info)
-{
-}
-
-static XF86MCSurfaceInfoRec yv12_mpeg2_vld_surface = {
- FOURCC_YV12,
- XVMC_CHROMA_FORMAT_420,
- 0,
- 1936,
- 1096,
- 1920,
- 1080,
- XVMC_MPEG_2 | XVMC_VLD,
- XVMC_INTRA_UNSIGNED,
- NULL
-};
-
-static XF86MCSurfaceInfoRec yv12_mpeg2_surface = {
- FOURCC_YV12,
- XVMC_CHROMA_FORMAT_420,
- 0,
- 1936,
- 1096,
- 1920,
- 1080,
- XVMC_MPEG_2 | XVMC_MOCOMP,
- /* XVMC_OVERLAID_SURFACE | XVMC_SUBPICTURE_INDEPENDENT_SCALING, */
- XVMC_INTRA_UNSIGNED,
- /* &yv12_subpicture_list */
- NULL
-};
-
-static XF86MCSurfaceInfoRec yv12_mpeg1_surface = {
- FOURCC_YV12,
- XVMC_CHROMA_FORMAT_420,
- 0,
- 1920,
- 1080,
- 1920,
- 1080,
- XVMC_MPEG_1 | XVMC_MOCOMP,
- /*XVMC_OVERLAID_SURFACE | XVMC_SUBPICTURE_INDEPENDENT_SCALING |
- XVMC_INTRA_UNSIGNED, */
- XVMC_INTRA_UNSIGNED,
-
- /*&yv12_subpicture_list */
- NULL
-};
-
-static XF86MCSurfaceInfoPtr surface_info[] = {
- &yv12_mpeg2_surface,
- &yv12_mpeg1_surface
-};
-
-static XF86MCSurfaceInfoPtr surface_info_vld[] = {
- &yv12_mpeg2_vld_surface,
- &yv12_mpeg2_surface,
-};
-
-static XF86MCAdaptorRec adaptor_vld = {
- .name = "Intel(R) Textured Video",
- .num_surfaces = sizeof(surface_info_vld) / sizeof(surface_info_vld[0]),
- .surfaces = surface_info_vld,
-
- .CreateContext = create_context,
- .DestroyContext = destroy_context,
- .CreateSurface = create_surface,
- .DestroySurface = destory_surface,
- .CreateSubpicture = create_subpicture,
- .DestroySubpicture = destroy_subpicture
-};
-
-static XF86MCAdaptorRec adaptor = {
- .name = "Intel(R) Textured Video",
- .num_surfaces = sizeof(surface_info) / sizeof(surface_info[0]),
- .surfaces = surface_info,
-
- .CreateContext = create_context,
- .DestroyContext = destroy_context,
- .CreateSurface = create_surface,
- .DestroySurface = destory_surface,
- .CreateSubpicture = create_subpicture,
- .DestroySubpicture = destroy_subpicture
-};
-
-struct intel_xvmc_driver i965_xvmc_driver = {
- .name = "i965_xvmc",
- .adaptor = &adaptor,
- .flag = XVMC_I965_MPEG2_MC,
- .init = init,
- .fini = fini
-};
-
-struct intel_xvmc_driver vld_xvmc_driver = {
- .name = "xvmc_vld",
- .adaptor = &adaptor_vld,
- .flag = XVMC_I965_MPEG2_VLD,
- .init = init,
- .fini = fini
-};
diff --git a/driver/xf86-video-intel/src/i965_hwmc.h b/driver/xf86-video-intel/src/i965_hwmc.h
deleted file mode 100644
index 5bdd45259..000000000
--- a/driver/xf86-video-intel/src/i965_hwmc.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#define I965_MC_STATIC_BUFFER_SIZE (1024*512)
-#define I965_MAX_SURFACES 12
-struct _i830_memory;
-struct drm_memory_block {
- struct _i830_memory *buffer;
- drm_handle_t handle;
- drmAddress ptr;
- size_t size;
- unsigned long offset;
-};
-
-struct i965_xvmc_surface {
- int w, h;
- unsigned int no;
- void *handle;
- dri_bo *bo;
-};
-
-struct i965_xvmc_context {
- struct _intel_xvmc_common comm;
- struct drm_memory_block static_buffer;
- struct drm_memory_block blocks;
- struct drm_memory_block slice;
- struct i965_xvmc_surface *surfaces[I965_MAX_SURFACES];
- unsigned int is_g4x:1;
- unsigned int is_965_q:1;
- unsigned int is_igdng:1;
-};
diff --git a/driver/xf86-video-intel/src/i965_video.c b/driver/xf86-video-intel/src/i965_video.c
index f38c0311b..c5378608e 100644
--- a/driver/xf86-video-intel/src/i965_video.c
+++ b/driver/xf86-video-intel/src/i965_video.c
@@ -980,8 +980,8 @@ void
I965DisplayVideoTextured(ScrnInfoPtr scrn,
intel_adaptor_private *adaptor_priv, int id,
RegionPtr dstRegion,
- short width, short height, int video_pitch,
- int x1, int y1, int x2, int y2,
+ short width, short height,
+ int video_pitch, int video_pitch2,
short src_w, short src_h,
short drw_w, short drw_h, PixmapPtr pixmap)
{
@@ -1024,7 +1024,7 @@ I965DisplayVideoTextured(ScrnInfoPtr scrn,
src_surf_format = BRW_SURFACEFORMAT_R8_UNORM;
src_width[1] = src_width[0] = width;
src_height[1] = src_height[0] = height;
- src_pitch[1] = src_pitch[0] = video_pitch * 2;
+ src_pitch[1] = src_pitch[0] = video_pitch2;
src_width[4] = src_width[5] = src_width[2] = src_width[3] =
width / 2;
src_height[4] = src_height[5] = src_height[2] = src_height[3] =
diff --git a/driver/xf86-video-intel/src/ivch/Makefile.in b/driver/xf86-video-intel/src/ivch/Makefile.in
index 14898f6fc..a21e621c0 100644
--- a/driver/xf86-video-intel/src/ivch/Makefile.in
+++ b/driver/xf86-video-intel/src/ivch/Makefile.in
@@ -79,6 +79,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -131,6 +132,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -205,7 +207,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -264,9 +265,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/ivch/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/ivch/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/ivch/Makefile
+ $(AUTOMAKE) --foreign src/ivch/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
diff --git a/driver/xf86-video-intel/src/reg_dumper/Makefile.in b/driver/xf86-video-intel/src/reg_dumper/Makefile.in
index a9268bc75..ca905c3d0 100644
--- a/driver/xf86-video-intel/src/reg_dumper/Makefile.in
+++ b/driver/xf86-video-intel/src/reg_dumper/Makefile.in
@@ -90,6 +90,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -142,6 +143,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -216,7 +218,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -291,9 +292,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/reg_dumper/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/reg_dumper/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/reg_dumper/Makefile
+ $(AUTOMAKE) --foreign src/reg_dumper/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
diff --git a/driver/xf86-video-intel/src/render_program/Makefile.in b/driver/xf86-video-intel/src/render_program/Makefile.in
index af7972504..3519c545b 100644
--- a/driver/xf86-video-intel/src/render_program/Makefile.in
+++ b/driver/xf86-video-intel/src/render_program/Makefile.in
@@ -53,6 +53,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -105,6 +106,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -179,7 +181,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -292,9 +293,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/render_program/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/render_program/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/render_program/Makefile
+ $(AUTOMAKE) --foreign src/render_program/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
diff --git a/driver/xf86-video-intel/src/sil164/Makefile.in b/driver/xf86-video-intel/src/sil164/Makefile.in
index 9daebcba1..14d711b8b 100644
--- a/driver/xf86-video-intel/src/sil164/Makefile.in
+++ b/driver/xf86-video-intel/src/sil164/Makefile.in
@@ -79,6 +79,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -131,6 +132,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -205,7 +207,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -265,9 +266,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/sil164/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/sil164/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/sil164/Makefile
+ $(AUTOMAKE) --foreign src/sil164/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
diff --git a/driver/xf86-video-intel/src/tfp410/Makefile.in b/driver/xf86-video-intel/src/tfp410/Makefile.in
index 922d8234c..1a37cb799 100644
--- a/driver/xf86-video-intel/src/tfp410/Makefile.in
+++ b/driver/xf86-video-intel/src/tfp410/Makefile.in
@@ -79,6 +79,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -131,6 +132,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -205,7 +207,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -265,9 +266,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/tfp410/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/tfp410/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/tfp410/Makefile
+ $(AUTOMAKE) --foreign src/tfp410/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
diff --git a/driver/xf86-video-intel/src/xvmc/Makefile.am b/driver/xf86-video-intel/src/xvmc/Makefile.am
index 41351bb71..be8824b82 100644
--- a/driver/xf86-video-intel/src/xvmc/Makefile.am
+++ b/driver/xf86-video-intel/src/xvmc/Makefile.am
@@ -24,9 +24,7 @@ libIntelXvMC_la_SOURCES = intel_xvmc.c \
xvmc_vld.c \
xvmc_vld.h \
intel_batchbuffer.c \
- intel_batchbuffer.h \
- dri2.c \
- dri2.h
+ intel_batchbuffer.h
libIntelXvMC_la_CFLAGS = @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ \
@XVMCLIB_CFLAGS@ -I$(top_srcdir)/src -DTRUE=1 -DFALSE=0
diff --git a/driver/xf86-video-intel/src/xvmc/Makefile.in b/driver/xf86-video-intel/src/xvmc/Makefile.in
index 9b247b0b2..a4b2751a0 100644
--- a/driver/xf86-video-intel/src/xvmc/Makefile.in
+++ b/driver/xf86-video-intel/src/xvmc/Makefile.in
@@ -63,7 +63,7 @@ am_libIntelXvMC_la_OBJECTS = libIntelXvMC_la-intel_xvmc.lo \
libIntelXvMC_la-intel_xvmc_dump.lo \
libIntelXvMC_la-i915_xvmc.lo libIntelXvMC_la-i965_xvmc.lo \
libIntelXvMC_la-xvmc_vld.lo \
- libIntelXvMC_la-intel_batchbuffer.lo libIntelXvMC_la-dri2.lo
+ libIntelXvMC_la-intel_batchbuffer.lo
libIntelXvMC_la_OBJECTS = $(am_libIntelXvMC_la_OBJECTS)
@XVMC_TRUE@am_libIntelXvMC_la_rpath = -rpath $(libdir)
DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
@@ -95,6 +95,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -147,6 +148,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -221,7 +223,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -272,9 +273,7 @@ libIntelXvMC_la_SOURCES = intel_xvmc.c \
xvmc_vld.c \
xvmc_vld.h \
intel_batchbuffer.c \
- intel_batchbuffer.h \
- dri2.c \
- dri2.h
+ intel_batchbuffer.h
libIntelXvMC_la_CFLAGS = @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ \
@XVMCLIB_CFLAGS@ -I$(top_srcdir)/src -DTRUE=1 -DFALSE=0
@@ -294,9 +293,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/xvmc/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/xvmc/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/xvmc/Makefile
+ $(AUTOMAKE) --foreign src/xvmc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
@@ -353,7 +352,6 @@ distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libI810XvMC_la-I810XvMC.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIntelXvMC_la-dri2.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIntelXvMC_la-i915_xvmc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIntelXvMC_la-i965_xvmc.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libIntelXvMC_la-intel_batchbuffer.Plo@am__quote@
@@ -431,13 +429,6 @@ libIntelXvMC_la-intel_batchbuffer.lo: intel_batchbuffer.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIntelXvMC_la_CFLAGS) $(CFLAGS) -c -o libIntelXvMC_la-intel_batchbuffer.lo `test -f 'intel_batchbuffer.c' || echo '$(srcdir)/'`intel_batchbuffer.c
-libIntelXvMC_la-dri2.lo: dri2.c
-@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIntelXvMC_la_CFLAGS) $(CFLAGS) -MT libIntelXvMC_la-dri2.lo -MD -MP -MF "$(DEPDIR)/libIntelXvMC_la-dri2.Tpo" -c -o libIntelXvMC_la-dri2.lo `test -f 'dri2.c' || echo '$(srcdir)/'`dri2.c; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libIntelXvMC_la-dri2.Tpo" "$(DEPDIR)/libIntelXvMC_la-dri2.Plo"; else rm -f "$(DEPDIR)/libIntelXvMC_la-dri2.Tpo"; exit 1; fi
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='dri2.c' object='libIntelXvMC_la-dri2.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libIntelXvMC_la_CFLAGS) $(CFLAGS) -c -o libIntelXvMC_la-dri2.lo `test -f 'dri2.c' || echo '$(srcdir)/'`dri2.c
-
mostlyclean-libtool:
-rm -f *.lo
diff --git a/driver/xf86-video-intel/src/xvmc/dri2.c b/driver/xf86-video-intel/src/xvmc/dri2.c
deleted file mode 100644
index 1ba948231..000000000
--- a/driver/xf86-video-intel/src/xvmc/dri2.c
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * Copyright © 2008 Red Hat, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Soft-
- * ware"), to deal in the Software without restriction, including without
- * limitation the rights to use, copy, modify, merge, publish, distribute,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, provided that the above copyright
- * notice(s) and this permission notice appear in all copies of the Soft-
- * ware and that both the above copyright notice(s) and this permission
- * notice appear in supporting documentation.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
- * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
- * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
- * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
- * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
- * MANCE OF THIS SOFTWARE.
- *
- * Except as contained in this notice, the name of a copyright holder shall
- * not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization of
- * the copyright holder.
- *
- * Authors:
- * Kristian Høgsberg (krh@redhat.com)
- */
-
-#define NEED_REPLIES
-#include <X11/Xlibint.h>
-#include <X11/extensions/Xext.h>
-#include <X11/extensions/extutil.h>
-#include <X11/extensions/dri2proto.h>
-#include "xf86drm.h"
-#include "dri2.h"
-
-static char dri2ExtensionName[] = DRI2_NAME;
-static XExtensionInfo *dri2Info;
-static XEXT_GENERATE_CLOSE_DISPLAY(DRI2CloseDisplay, dri2Info)
-static /* const */ XExtensionHooks dri2ExtensionHooks = {
- NULL, /* create_gc */
- NULL, /* copy_gc */
- NULL, /* flush_gc */
- NULL, /* free_gc */
- NULL, /* create_font */
- NULL, /* free_font */
- DRI2CloseDisplay, /* close_display */
- NULL, /* wire_to_event */
- NULL, /* event_to_wire */
- NULL, /* error */
- NULL, /* error_string */
-};
-
-static XEXT_GENERATE_FIND_DISPLAY(DRI2FindDisplay, dri2Info,
- dri2ExtensionName,
- &dri2ExtensionHooks, 0, NULL)
-
-Bool DRI2QueryExtension(Display * dpy, int *eventBase, int *errorBase)
-{
- XExtDisplayInfo *info = DRI2FindDisplay(dpy);
-
- if (XextHasExtension(info)) {
- *eventBase = info->codes->first_event;
- *errorBase = info->codes->first_error;
- return True;
- }
-
- return False;
-}
-
-Bool DRI2QueryVersion(Display * dpy, int *major, int *minor)
-{
- XExtDisplayInfo *info = DRI2FindDisplay(dpy);
- xDRI2QueryVersionReply rep;
- xDRI2QueryVersionReq *req;
-
- XextCheckExtension(dpy, info, dri2ExtensionName, False);
-
- LockDisplay(dpy);
- GetReq(DRI2QueryVersion, req);
- req->reqType = info->codes->major_opcode;
- req->dri2ReqType = X_DRI2QueryVersion;
- req->majorVersion = DRI2_MAJOR;
- req->minorVersion = DRI2_MINOR;
- if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- *major = rep.majorVersion;
- *minor = rep.minorVersion;
- UnlockDisplay(dpy);
- SyncHandle();
-
- return True;
-}
-
-Bool DRI2Connect(Display * dpy, XID window,
- char **driverName, char **deviceName)
-{
- XExtDisplayInfo *info = DRI2FindDisplay(dpy);
- xDRI2ConnectReply rep;
- xDRI2ConnectReq *req;
-
- XextCheckExtension(dpy, info, dri2ExtensionName, False);
-
- LockDisplay(dpy);
- GetReq(DRI2Connect, req);
- req->reqType = info->codes->major_opcode;
- req->dri2ReqType = X_DRI2Connect;
- req->window = window;
- req->driverType = DRI2DriverDRI;
- if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
-
- if (rep.driverNameLength == 0 && rep.deviceNameLength == 0) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
-
- *driverName = Xmalloc(rep.driverNameLength + 1);
- if (*driverName == NULL) {
- _XEatData(dpy,
- ((rep.driverNameLength + 3) & ~3) +
- ((rep.deviceNameLength + 3) & ~3));
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- _XReadPad(dpy, *driverName, rep.driverNameLength);
- (*driverName)[rep.driverNameLength] = '\0';
-
- *deviceName = Xmalloc(rep.deviceNameLength + 1);
- if (*deviceName == NULL) {
- Xfree(*driverName);
- _XEatData(dpy, ((rep.deviceNameLength + 3) & ~3));
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
- _XReadPad(dpy, *deviceName, rep.deviceNameLength);
- (*deviceName)[rep.deviceNameLength] = '\0';
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return True;
-}
-
-Bool DRI2Authenticate(Display * dpy, XID window, drm_magic_t magic)
-{
- XExtDisplayInfo *info = DRI2FindDisplay(dpy);
- xDRI2AuthenticateReq *req;
- xDRI2AuthenticateReply rep;
-
- XextCheckExtension(dpy, info, dri2ExtensionName, False);
-
- LockDisplay(dpy);
- GetReq(DRI2Authenticate, req);
- req->reqType = info->codes->major_opcode;
- req->dri2ReqType = X_DRI2Authenticate;
- req->window = window;
- req->magic = magic;
-
- if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return False;
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return rep.authenticated;
-}
-
-void DRI2CreateDrawable(Display * dpy, XID drawable)
-{
- XExtDisplayInfo *info = DRI2FindDisplay(dpy);
- xDRI2CreateDrawableReq *req;
-
- XextSimpleCheckExtension(dpy, info, dri2ExtensionName);
-
- LockDisplay(dpy);
- GetReq(DRI2CreateDrawable, req);
- req->reqType = info->codes->major_opcode;
- req->dri2ReqType = X_DRI2CreateDrawable;
- req->drawable = drawable;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-void DRI2DestroyDrawable(Display * dpy, XID drawable)
-{
- XExtDisplayInfo *info = DRI2FindDisplay(dpy);
- xDRI2DestroyDrawableReq *req;
-
- XextSimpleCheckExtension(dpy, info, dri2ExtensionName);
-
- XSync(dpy, False);
-
- LockDisplay(dpy);
- GetReq(DRI2DestroyDrawable, req);
- req->reqType = info->codes->major_opcode;
- req->dri2ReqType = X_DRI2DestroyDrawable;
- req->drawable = drawable;
- UnlockDisplay(dpy);
- SyncHandle();
-}
-
-DRI2Buffer *DRI2GetBuffers(Display * dpy, XID drawable,
- int *width, int *height,
- unsigned int *attachments, int count, int *outCount)
-{
- XExtDisplayInfo *info = DRI2FindDisplay(dpy);
- xDRI2GetBuffersReply rep;
- xDRI2GetBuffersReq *req;
- DRI2Buffer *buffers;
- xDRI2Buffer repBuffer;
- CARD32 *p;
- int i;
-
- XextCheckExtension(dpy, info, dri2ExtensionName, False);
-
- LockDisplay(dpy);
- GetReqExtra(DRI2GetBuffers, count * 4, req);
- req->reqType = info->codes->major_opcode;
- req->dri2ReqType = X_DRI2GetBuffers;
- req->drawable = drawable;
- req->count = count;
- p = (CARD32 *) & req[1];
- for (i = 0; i < count; i++)
- p[i] = attachments[i];
-
- if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) {
- UnlockDisplay(dpy);
- SyncHandle();
- return NULL;
- }
-
- *width = rep.width;
- *height = rep.height;
- *outCount = rep.count;
-
- buffers = Xmalloc(rep.count * sizeof buffers[0]);
- if (buffers == NULL) {
- _XEatData(dpy, rep.count * sizeof repBuffer);
- UnlockDisplay(dpy);
- SyncHandle();
- return NULL;
- }
-
- for (i = 0; i < rep.count; i++) {
- _XReadPad(dpy, (char *)&repBuffer, sizeof repBuffer);
- buffers[i].attachment = repBuffer.attachment;
- buffers[i].name = repBuffer.name;
- buffers[i].pitch = repBuffer.pitch;
- buffers[i].cpp = repBuffer.cpp;
- buffers[i].flags = repBuffer.flags;
- }
-
- UnlockDisplay(dpy);
- SyncHandle();
-
- return buffers;
-}
-
-void DRI2CopyRegion(Display * dpy, XID drawable, XserverRegion region,
- CARD32 dest, CARD32 src)
-{
- XExtDisplayInfo *info = DRI2FindDisplay(dpy);
- xDRI2CopyRegionReq *req;
- xDRI2CopyRegionReply rep;
-
- XextSimpleCheckExtension(dpy, info, dri2ExtensionName);
-
- LockDisplay(dpy);
- GetReq(DRI2CopyRegion, req);
- req->reqType = info->codes->major_opcode;
- req->dri2ReqType = X_DRI2CopyRegion;
- req->drawable = drawable;
- req->region = region;
- req->dest = dest;
- req->src = src;
-
- _XReply(dpy, (xReply *) & rep, 0, xFalse);
-
- UnlockDisplay(dpy);
- SyncHandle();
-}
diff --git a/driver/xf86-video-intel/src/xvmc/dri2.h b/driver/xf86-video-intel/src/xvmc/dri2.h
deleted file mode 100644
index ac6ce58d7..000000000
--- a/driver/xf86-video-intel/src/xvmc/dri2.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright © 2007,2008 Red Hat, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Soft-
- * ware"), to deal in the Software without restriction, including without
- * limitation the rights to use, copy, modify, merge, publish, distribute,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, provided that the above copyright
- * notice(s) and this permission notice appear in all copies of the Soft-
- * ware and that both the above copyright notice(s) and this permission
- * notice appear in supporting documentation.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
- * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
- * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
- * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
- * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
- * MANCE OF THIS SOFTWARE.
- *
- * Except as contained in this notice, the name of a copyright holder shall
- * not be used in advertising or otherwise to promote the sale, use or
- * other dealings in this Software without prior written authorization of
- * the copyright holder.
- *
- * Authors:
- * Kristian Høgsberg (krh@redhat.com)
- */
-
-#ifndef _DRI2_H_
-#define _DRI2_H_
-
-#include <X11/extensions/Xfixes.h>
-#include <X11/extensions/dri2tokens.h>
-
-typedef struct {
- unsigned int attachment;
- unsigned int name;
- unsigned int pitch;
- unsigned int cpp;
- unsigned int flags;
-} DRI2Buffer;
-
-extern Bool
-DRI2QueryExtension(Display * display, int *eventBase, int *errorBase);
-extern Bool DRI2QueryVersion(Display * display, int *major, int *minor);
-extern Bool
-DRI2Connect(Display * display, XID window,
- char **driverName, char **deviceName);
-extern Bool DRI2Authenticate(Display * display, XID window, drm_magic_t magic);
-extern void DRI2CreateDrawable(Display * display, XID drawable);
-extern void DRI2DestroyDrawable(Display * display, XID handle);
-extern DRI2Buffer *DRI2GetBuffers(Display * dpy, XID drawable,
- int *width, int *height,
- unsigned int *attachments, int count,
- int *outCount);
-
-extern void
-DRI2CopyRegion(Display * dpy, XID drawable, XserverRegion region,
- CARD32 dest, CARD32 src);
-
-#endif
diff --git a/driver/xf86-video-intel/src/xvmc/i915_structs.h b/driver/xf86-video-intel/src/xvmc/i915_structs.h
index f9e674772..2aa9d2393 100644
--- a/driver/xf86-video-intel/src/xvmc/i915_structs.h
+++ b/driver/xf86-video-intel/src/xvmc/i915_structs.h
@@ -30,24 +30,6 @@
#include <stdint.h>
-/* MI_INSTRUCTION */
-#define CMD_MI 0x00
-
-#define OPC_MI_FLUSH (0x04)
-
-struct i915_mi_flush {
- struct {
- unsigned map_cache_invalidate:1;
- unsigned pad0:1;
- unsigned render_cache_flush_inhibit:1;
- unsigned scene_count:1;
- unsigned end_scene:1;
- unsigned pad1:18;
- unsigned opcode:6;
- unsigned type:3;
- } dw0;
-};
-
/* BLT */
#define CMD_2D 0x02
#define OPC_COLOR_BLT (0x40)
@@ -84,6 +66,7 @@ struct i915_color_blt {
/* 3D_INSTRUCTION */
#define CMD_3D 0x03
+#define OPCODE_3D(x) (CMD_3D << 29 | (x) << 16)
#define OPC_3DMPEG_MACROBLOCK_IPICTURE (0x01 + (0x1e << 5))
#define OPC_3DMPEG_SET_ORIGIN (0x10 + (0x1e << 5))
@@ -96,9 +79,11 @@ struct i915_color_blt {
#define OPC_3DSTATE_MAP_STATE (0x00 + (0x1d << 8))
#define OPC_3DSTATE_SAMPLER_STATE (0x01 + (0x1d << 8))
#define OPC_3DSTATE_LOAD_STATE_IMMEDIATE_1 (0x04 + (0x1d << 8))
+#define OP_3D_LOAD_STATE_IMMEDIATE_1 OPCODE_3D(OPC_3DSTATE_LOAD_STATE_IMMEDIATE_1)
#define OPC_3DSTATE_PIXEL_SHADER_PROGRAM (0x05 + (0x1d << 8))
#define OPC_3DSTATE_PIXEL_SHADER_CONSTANTS (0x06 + (0x1d << 8))
#define OPC_3DSTATE_LOAD_INDIRECT (0x07 + (0x1d << 8))
+#define OP_3D_LOAD_INDIRECT OPCODE_3D(OPC_3DSTATE_LOAD_INDIRECT)
#define OPC_3DSTATE_MODES_5 (0x0c)
#define OPC_3DSTATE_COORD_SET_BINDINGS (0x16)
@@ -746,6 +731,7 @@ struct i915_3dstate_pixel_shader_constants {
#define BLOCK_MSB 0x08
#define BLOCK_PSP 0x10
#define BLOCK_PSC 0x20
+#define BLOCK_MASK_SHIFT 8
typedef struct _state_ddword {
struct {
@@ -758,15 +744,9 @@ typedef struct _state_ddword {
unsigned length:9;
unsigned pad0:23;
} dw1;
-} sis_state, ssb_state, msb_state, psp_state, psc_state;
-
-typedef struct _state_dword {
- struct {
- unsigned valid:1;
- unsigned reset:1;
- unsigned buffer_address:30;
- } dw0;
-} dis_state;
+} sis_state, msb_state;
+#define STATE_VALID 0x1
+#define STATE_FORCE 0x2
struct i915_3dstate_load_indirect {
struct {
@@ -779,6 +759,8 @@ struct i915_3dstate_load_indirect {
} dw0;
};
+#define OP_3D_LOAD_INDIRECT_GFX_ADDR (1 << 14)
+
#define TEXCOORDFMT_2FP 0x00
#define TEXCOORDFMT_3FP 0x01
#define TEXCOORDFMT_4FP 0x02
@@ -797,40 +779,14 @@ struct s2_dword {
unsigned set7_texcoord_fmt:4;
};
-struct s3_dword {
- unsigned set0_pcd:1;
- unsigned set0_ws_tcz:1;
- unsigned set0_ws_tcy:1;
- unsigned set0_ws_tcx:1;
- unsigned set1_pcd:1;
- unsigned set1_ws_tcz:1;
- unsigned set1_ws_tcy:1;
- unsigned set1_ws_tcx:1;
- unsigned set2_pcd:1;
- unsigned set2_ws_tcz:1;
- unsigned set2_ws_tcy:1;
- unsigned set2_ws_tcx:1;
- unsigned set3_pcd:1;
- unsigned set3_ws_tcz:1;
- unsigned set3_ws_tcy:1;
- unsigned set3_ws_tcx:1;
- unsigned set4_pcd:1;
- unsigned set4_ws_tcz:1;
- unsigned set4_ws_tcy:1;
- unsigned set4_ws_tcx:1;
- unsigned set5_pcd:1;
- unsigned set5_ws_tcz:1;
- unsigned set5_ws_tcy:1;
- unsigned set5_ws_tcx:1;
- unsigned set6_pcd:1;
- unsigned set6_ws_tcz:1;
- unsigned set6_ws_tcy:1;
- unsigned set6_ws_tcx:1;
- unsigned set7_pcd:1;
- unsigned set7_ws_tcz:1;
- unsigned set7_ws_tcy:1;
- unsigned set7_ws_tcx:1;
-};
+#define S3_SET0_PCD (1 << 0*4)
+#define S3_SET1_PCD (1 << 1*4)
+#define S3_SET2_PCD (1 << 2*4)
+#define S3_SET3_PCD (1 << 3*4)
+#define S3_SET4_PCD (1 << 4*4)
+#define S3_SET5_PCD (1 << 5*4)
+#define S3_SET6_PCD (1 << 6*4)
+#define S3_SET7_PCD (1 << 7*4)
#define VERTEXHAS_XYZ 1
#define VERTEXHAS_XYZW 2
@@ -882,42 +838,23 @@ struct s5_dword {
unsigned color_buffer_component_write_disable:4;
};
-struct s6_dword {
- unsigned triangle_pv:2;
- unsigned color_buffer_write:1;
- unsigned depth_buffer_write:1;
- unsigned dest_blend_factor:4;
- unsigned src_blend_factor:4;
- unsigned color_blend_function:3;
- unsigned color_buffer_blend:1;
- unsigned depth_test_function:3;
- unsigned depth_test_enable:1;
- unsigned alpha_reference_value:8;
- unsigned alpha_test_function:3;
- unsigned alpha_test_enable:1;
-
-};
+#define S6_COLOR_BUFFER_WRITE (1 << 2)
+#define S6_DST_BLEND_FACTOR_SHIFT 4
+#define S6_SRC_BLEND_FACTOR_SHIFT 8
+#define S6_DEPTH_TEST_ENABLE (1 << 19)
struct s7_dword {
unsigned global_depth_offset_const;
};
-struct i915_3dstate_load_state_immediate_1 {
- struct {
- unsigned length:4;
- unsigned load_s0:1;
- unsigned load_s1:1;
- unsigned load_s2:1;
- unsigned load_s3:1;
- unsigned load_s4:1;
- unsigned load_s5:1;
- unsigned load_s6:1;
- unsigned load_s7:1;
- unsigned pad0:4;
- unsigned opcode:13;
- unsigned type:3;
- } dw0;
-};
+#define OP_3D_LOAD_STATE_IMM_LOAD_S0 (1 << 4)
+#define OP_3D_LOAD_STATE_IMM_LOAD_S1 (1 << 5)
+#define OP_3D_LOAD_STATE_IMM_LOAD_S2 (1 << 6)
+#define OP_3D_LOAD_STATE_IMM_LOAD_S3 (1 << 7)
+#define OP_3D_LOAD_STATE_IMM_LOAD_S4 (1 << 8)
+#define OP_3D_LOAD_STATE_IMM_LOAD_S5 (1 << 9)
+#define OP_3D_LOAD_STATE_IMM_LOAD_S6 (1 << 10)
+#define OP_3D_LOAD_STATE_IMM_LOAD_S7 (1 << 11)
struct i915_3dstate_scissor_rectangle {
struct {
diff --git a/driver/xf86-video-intel/src/xvmc/i915_xvmc.c b/driver/xf86-video-intel/src/xvmc/i915_xvmc.c
index 84bdaf265..9ad8d01a3 100644
--- a/driver/xf86-video-intel/src/xvmc/i915_xvmc.c
+++ b/driver/xf86-video-intel/src/xvmc/i915_xvmc.c
@@ -31,56 +31,19 @@
#include "i915_structs.h"
#include "i915_program.h"
-#define YOFFSET(surface) (surface->srf.offset)
-#define UOFFSET(surface) (surface->srf.offset + \
- SIZE_Y420(surface->width, surface->height) + \
- SIZE_UV420(surface->width, surface->height))
-#define VOFFSET(surface) (surface->srf.offset + \
- SIZE_Y420(surface->width, surface->height))
+#define STRIDE(w) (((w) + 0x3ff) & ~0x3ff)
+#define SIZE_Y420(w, h) (h * STRIDE(w))
+#define SIZE_UV420(w, h) ((h >> 1) * STRIDE(w >> 1))
+#define SIZE_YUV420(w, h) (SIZE_Y420(w,h) + SIZE_UV420(w,h) * 2)
+#define UOFFSET(context) (SIZE_Y420(context->width, context->height))
+#define VOFFSET(context) (SIZE_Y420(context->width, context->height) + \
+ SIZE_UV420(context->width, context->height))
typedef union {
int16_t component[2];
int32_t v;
} vector_t;
-#if 0
-static int findOverlap(unsigned int width, unsigned int height,
- short *dstX, short *dstY,
- short *srcX, short *srcY,
- unsigned short *areaW, unsigned short *areaH)
-{
- int w, h;
- unsigned int mWidth, mHeight;
-
- w = *areaW;
- h = *areaH;
-
- if ((*dstX >= width) || (*dstY >= height))
- return 1;
-
- if (*dstX < 0) {
- w += *dstX;
- *srcX -= *dstX;
- *dstX = 0;
- }
-
- if (*dstY < 0) {
- h += *dstY;
- *srcY -= *dstY;
- *dstY = 0;
- }
-
- if ((w <= 0) || ((h <= 0)))
- return 1;
-
- mWidth = width - *dstX;
- mHeight = height - *dstY;
- *areaW = (w <= mWidth) ? w : mWidth;
- *areaH = (h <= mHeight) ? h : mHeight;
- return 0;
-}
-#endif
-
static void i915_inst_arith(unsigned int *inst,
unsigned int op,
unsigned int dest,
@@ -123,20 +86,6 @@ static void i915_inst_texld(unsigned int *inst,
*inst = T2_MBZ;
}
-static void i915_emit_batch(void *data, int size, int flag)
-{
- intelBatchbufferData(data, size, flag);
-}
-
-/* one time context initialization buffer */
-static uint32_t *one_time_load_state_imm1;
-static uint32_t *one_time_load_indirect;
-static int one_time_load_state_imm1_size, one_time_load_indirect_size;
-
-/* load indirect buffer for mc rendering */
-static uint32_t *mc_render_load_indirect;
-static int mc_render_load_indirect_size;
-
static void i915_mc_one_time_context_init(XvMCContext * context)
{
unsigned int dest, src0, src1, src2;
@@ -147,13 +96,8 @@ static void i915_mc_one_time_context_init(XvMCContext * context)
struct i915_3dstate_pixel_shader_constants *pixel_shader_constants;
/* sampler static state */
- sampler_state = (struct i915_3dstate_sampler_state *)pI915XvMC->ssb.map;
- /* pixel shader static state */
- pixel_shader_program =
- (struct i915_3dstate_pixel_shader_program *)pI915XvMC->psp.map;
- /* pixel shader contant static state */
- pixel_shader_constants =
- (struct i915_3dstate_pixel_shader_constants *)pI915XvMC->psc.map;
+ drm_intel_gem_bo_map_gtt(pI915XvMC->ssb_bo);
+ sampler_state = pI915XvMC->ssb_bo->virtual;
memset(sampler_state, 0, sizeof(*sampler_state));
sampler_state->dw0.type = CMD_3D;
@@ -209,6 +153,12 @@ static void i915_mc_one_time_context_init(XvMCContext * context)
sampler_state->sampler1.ts1.east_deinterlacer = 0;
sampler_state->sampler1.ts2.default_color = 0;
+ drm_intel_gem_bo_unmap_gtt(pI915XvMC->ssb_bo);
+
+ /* pixel shader static state */
+ drm_intel_gem_bo_map_gtt(pI915XvMC->psp_bo);
+ pixel_shader_program = pI915XvMC->psp_bo->virtual;
+
memset(pixel_shader_program, 0, sizeof(*pixel_shader_program));
pixel_shader_program->shader0.type = CMD_3D;
pixel_shader_program->shader0.opcode = OPC_3DSTATE_PIXEL_SHADER_PROGRAM;
@@ -350,6 +300,12 @@ static void i915_mc_one_time_context_init(XvMCContext * context)
A0_DEST_CHANNEL_ALL, A0_DEST_SATURATE, src0, src1,
src2);
+ drm_intel_gem_bo_unmap_gtt(pI915XvMC->psp_bo);
+
+ /* pixel shader contant static state */
+ drm_intel_gem_bo_map_gtt(pI915XvMC->psc_bo);
+ pixel_shader_constants = pI915XvMC->psc_bo->virtual;
+
memset(pixel_shader_constants, 0, sizeof(*pixel_shader_constants));
pixel_shader_constants->dw0.type = CMD_3D;
pixel_shader_constants->dw0.opcode = OPC_3DSTATE_PIXEL_SHADER_CONSTANTS;
@@ -360,133 +316,86 @@ static void i915_mc_one_time_context_init(XvMCContext * context)
pixel_shader_constants->value.z = 0.5;
pixel_shader_constants->value.w = 0.5;
+ drm_intel_gem_bo_unmap_gtt(pI915XvMC->psc_bo);
}
-static void i915_mc_one_time_state_init(XvMCContext * context)
+static void i915_mc_one_time_state_emit(XvMCContext * context)
{
- struct s3_dword *s3 = NULL;
- struct s6_dword *s6 = NULL;
- dis_state *dis = NULL;
- ssb_state *ssb = NULL;
- psp_state *psp = NULL;
- psc_state *psc = NULL;
i915XvMCContext *pI915XvMC = (i915XvMCContext *) context->privData;
- struct i915_3dstate_load_state_immediate_1 *load_state_immediate_1;
- struct i915_3dstate_load_indirect *load_indirect;
+ uint32_t load_state_immediate_1, load_indirect, s3_dword, s6_dword;
int mem_select;
+ BATCH_LOCALS;
/* 3DSTATE_LOAD_STATE_IMMEDIATE_1 */
- one_time_load_state_imm1_size =
- sizeof(*load_state_immediate_1) + sizeof(*s3) + sizeof(*s6);
- one_time_load_state_imm1 = calloc(1, one_time_load_state_imm1_size);
- load_state_immediate_1 = (struct i915_3dstate_load_state_immediate_1 *)
- one_time_load_state_imm1;
- load_state_immediate_1->dw0.type = CMD_3D;
- load_state_immediate_1->dw0.opcode = OPC_3DSTATE_LOAD_STATE_IMMEDIATE_1;
- load_state_immediate_1->dw0.load_s3 = 1;
- load_state_immediate_1->dw0.load_s6 = 1;
- load_state_immediate_1->dw0.length =
- (one_time_load_state_imm1_size >> 2) - 2;
-
- s3 = (struct s3_dword *)(++load_state_immediate_1);
- s3->set0_pcd = 1;
- s3->set1_pcd = 1;
- s3->set2_pcd = 1;
- s3->set3_pcd = 1;
- s3->set4_pcd = 1;
- s3->set5_pcd = 1;
- s3->set6_pcd = 1;
- s3->set7_pcd = 1;
-
- s6 = (struct s6_dword *)(++s3);
- s6->alpha_test_enable = 0;
- s6->alpha_test_function = 0;
- s6->alpha_reference_value = 0;
- s6->depth_test_enable = 1;
- s6->depth_test_function = 0;
- s6->color_buffer_blend = 0;
- s6->color_blend_function = 0;
- s6->src_blend_factor = 1;
- s6->dest_blend_factor = 1;
- s6->depth_buffer_write = 0;
- s6->color_buffer_write = 1;
- s6->triangle_pv = 0;
+ BEGIN_BATCH(3 + 8);
+ load_state_immediate_1 = OP_3D_LOAD_STATE_IMMEDIATE_1;
+ load_state_immediate_1 |= OP_3D_LOAD_STATE_IMM_LOAD_S3;
+ load_state_immediate_1 |= OP_3D_LOAD_STATE_IMM_LOAD_S6;
+ load_state_immediate_1 |= 3 - 2; /* length */
+ OUT_BATCH(load_state_immediate_1);
+
+ s3_dword = S3_SET0_PCD | S3_SET1_PCD |
+ S3_SET2_PCD | S3_SET3_PCD |
+ S3_SET4_PCD | S3_SET5_PCD |
+ S3_SET6_PCD | S3_SET7_PCD;
+ OUT_BATCH(s3_dword);
+
+ s6_dword = S6_COLOR_BUFFER_WRITE | S6_DEPTH_TEST_ENABLE;
+ s6_dword |= 1 << S6_SRC_BLEND_FACTOR_SHIFT;
+ s6_dword |= 1 << S6_DST_BLEND_FACTOR_SHIFT;
+ OUT_BATCH(s6_dword);
/* 3DSTATE_LOAD_INDIRECT */
- one_time_load_indirect_size =
- sizeof(*load_indirect) + sizeof(*dis) + sizeof(*ssb) +
- sizeof(*psp) + sizeof(*psc);
- one_time_load_indirect = calloc(1, one_time_load_indirect_size);
- load_indirect =
- (struct i915_3dstate_load_indirect *)one_time_load_indirect;
- load_indirect->dw0.type = CMD_3D;
- load_indirect->dw0.opcode = OPC_3DSTATE_LOAD_INDIRECT;
- load_indirect->dw0.block_mask =
- BLOCK_DIS | BLOCK_SSB | BLOCK_PSP | BLOCK_PSC;
- load_indirect->dw0.length = (one_time_load_indirect_size >> 2) - 2;
-
- if (pI915XvMC->deviceID == PCI_CHIP_I915_G ||
- pI915XvMC->deviceID == PCI_CHIP_I915_GM)
+ load_indirect = OP_3D_LOAD_INDIRECT;
+ load_indirect |= (BLOCK_DIS | BLOCK_SSB | BLOCK_PSP | BLOCK_PSC)
+ << BLOCK_MASK_SHIFT;
+ load_indirect |= 8 - 2; /* length */
+
+ if (pI915XvMC->use_phys_addr)
mem_select = 0; /* use physical address */
- else
+ else {
+ load_indirect |= OP_3D_LOAD_INDIRECT_GFX_ADDR;
mem_select = 1; /* use gfx address */
+ }
- load_indirect->dw0.mem_select = mem_select;
+ OUT_BATCH(load_indirect);
/* Dynamic indirect state buffer */
- dis = (dis_state *) (++load_indirect);
- dis->dw0.valid = 0;
- dis->dw0.reset = 0;
- dis->dw0.buffer_address = 0;
+ OUT_BATCH(0); /* no dynamic indirect state */
/* Sample state buffer */
- ssb = (ssb_state *) (++dis);
- ssb->dw0.valid = 1;
- ssb->dw0.force = 1;
- ssb->dw1.length = 7; /* 8 - 1 */
-
- if (mem_select)
- ssb->dw0.buffer_address = (pI915XvMC->ssb.offset >> 2);
- else
- ssb->dw0.buffer_address = (pI915XvMC->ssb.bus_addr >> 2);
+ OUT_RELOC(pI915XvMC->ssb_bo, I915_GEM_DOMAIN_INSTRUCTION, 0,
+ STATE_VALID | STATE_FORCE);
+ OUT_BATCH(7); /* 8 - 1 */
/* Pixel shader program buffer */
- psp = (psp_state *) (++ssb);
- psp->dw0.valid = 1;
- psp->dw0.force = 1;
- psp->dw1.length = 66; /* 4 + 16 + 16 + 31 - 1 */
-
- if (mem_select)
- psp->dw0.buffer_address = (pI915XvMC->psp.offset >> 2);
- else
- psp->dw0.buffer_address = (pI915XvMC->psp.bus_addr >> 2);
+ OUT_RELOC(pI915XvMC->psp_bo, I915_GEM_DOMAIN_INSTRUCTION, 0,
+ STATE_VALID | STATE_FORCE);
+ OUT_BATCH(66); /* 4 + 16 + 16 + 31 - 1 */
/* Pixel shader constant buffer */
- psc = (psc_state *) (++psp);
- psc->dw0.valid = 1;
- psc->dw0.force = 1;
- psc->dw1.length = 5; /* 6 - 1 */
-
- if (mem_select)
- psc->dw0.buffer_address = (pI915XvMC->psc.offset >> 2);
- else
- psc->dw0.buffer_address = (pI915XvMC->psc.bus_addr >> 2);
+ OUT_RELOC(pI915XvMC->psc_bo, I915_GEM_DOMAIN_INSTRUCTION, 0,
+ STATE_VALID | STATE_FORCE);
+ OUT_BATCH(5); /* 6 - 1 */
+ ADVANCE_BATCH();
}
-static void i915_mc_one_time_state_emit(void)
-{
- i915_emit_batch(one_time_load_state_imm1, one_time_load_state_imm1_size,
- 0);
- i915_emit_batch(one_time_load_indirect, one_time_load_indirect_size, 0);
-}
-
-static void i915_mc_static_indirect_state_init(XvMCContext * context)
+static void i915_mc_static_indirect_state_set(XvMCContext * context,
+ XvMCSurface * dest,
+ unsigned int picture_structure,
+ unsigned int flags,
+ unsigned int picture_coding_type)
{
i915XvMCContext *pI915XvMC = (i915XvMCContext *) context->privData;
- struct i915_mc_static_indirect_state_buffer *buffer_info =
- (struct i915_mc_static_indirect_state_buffer *)pI915XvMC->sis.map;
+ struct intel_xvmc_surface *intel_surf = dest->privData;
+ struct i915_mc_static_indirect_state_buffer *buffer_info;
+ unsigned int w = dest->width;
+
+ drm_intel_gem_bo_map_gtt(pI915XvMC->sis_bo);
+ buffer_info = pI915XvMC->sis_bo->virtual;
memset(buffer_info, 0, sizeof(*buffer_info));
+
/* dest Y */
buffer_info->dest_y.dw0.type = CMD_3D;
buffer_info->dest_y.dw0.opcode = OPC_3DSTATE_BUFFER_INFO;
@@ -496,6 +405,13 @@ static void i915_mc_static_indirect_state_init(XvMCContext * context)
buffer_info->dest_y.dw1.fence_regs = 0; /* disabled *//* FIXME: tiled y for performance */
buffer_info->dest_y.dw1.tiled_surface = 0; /* linear */
buffer_info->dest_y.dw1.walk = TILEWALK_XMAJOR;
+ buffer_info->dest_y.dw1.pitch = (pI915XvMC->yStride >> 2); /* in DWords */
+ buffer_info->dest_y.dw2.base_address = intel_surf->bo->offset >> 2; /* starting DWORD address */
+ drm_intel_bo_emit_reloc(pI915XvMC->sis_bo,
+ offsetof(typeof(*buffer_info),dest_y.dw2),
+ intel_surf->bo, 0,
+ I915_GEM_DOMAIN_RENDER,
+ I915_GEM_DOMAIN_RENDER);
/* dest U */
buffer_info->dest_u.dw0.type = CMD_3D;
@@ -506,6 +422,14 @@ static void i915_mc_static_indirect_state_init(XvMCContext * context)
buffer_info->dest_u.dw1.fence_regs = 0;
buffer_info->dest_u.dw1.tiled_surface = 0;
buffer_info->dest_u.dw1.walk = TILEWALK_XMAJOR;
+ buffer_info->dest_u.dw1.pitch = (pI915XvMC->uvStride >> 2); /* in DWords */
+ buffer_info->dest_u.dw2.base_address =
+ (intel_surf->bo->offset + UOFFSET(context)) >> 2;
+ drm_intel_bo_emit_reloc(pI915XvMC->sis_bo,
+ offsetof(typeof(*buffer_info),dest_u.dw2),
+ intel_surf->bo, UOFFSET(context),
+ I915_GEM_DOMAIN_RENDER,
+ I915_GEM_DOMAIN_RENDER);
/* dest V */
buffer_info->dest_v.dw0.type = CMD_3D;
@@ -516,7 +440,16 @@ static void i915_mc_static_indirect_state_init(XvMCContext * context)
buffer_info->dest_v.dw1.fence_regs = 0;
buffer_info->dest_v.dw1.tiled_surface = 0;
buffer_info->dest_v.dw1.walk = TILEWALK_XMAJOR;
-
+ buffer_info->dest_v.dw1.pitch = (pI915XvMC->uvStride >> 2); /* in Dwords */
+ buffer_info->dest_v.dw2.base_address =
+ (intel_surf->bo->offset + VOFFSET(context)) >> 2;
+ drm_intel_bo_emit_reloc(pI915XvMC->sis_bo,
+ offsetof(typeof(*buffer_info),dest_v.dw2),
+ intel_surf->bo, VOFFSET(context),
+ I915_GEM_DOMAIN_RENDER,
+ I915_GEM_DOMAIN_RENDER);
+
+ /* Dest buffer parameters */
buffer_info->dest_buf.dw0.type = CMD_3D;
buffer_info->dest_buf.dw0.opcode = OPC_3DSTATE_DEST_BUFFER_VARIABLES;
buffer_info->dest_buf.dw0.length = 0;
@@ -525,7 +458,17 @@ static void i915_mc_static_indirect_state_init(XvMCContext * context)
buffer_info->dest_buf.dw1.color_fmt = COLORBUFFER_8BIT;
buffer_info->dest_buf.dw1.v_ls = 0; /* fill later */
buffer_info->dest_buf.dw1.v_ls_offset = 0; /* fill later */
+ if ((picture_structure & XVMC_FRAME_PICTURE) == XVMC_FRAME_PICTURE) {
+ ;
+ } else if ((picture_structure & XVMC_FRAME_PICTURE) == XVMC_TOP_FIELD) {
+ buffer_info->dest_buf.dw1.v_ls = 1;
+ } else if ((picture_structure & XVMC_FRAME_PICTURE) ==
+ XVMC_BOTTOM_FIELD) {
+ buffer_info->dest_buf.dw1.v_ls = 1;
+ buffer_info->dest_buf.dw1.v_ls_offset = 1;
+ }
+ /* MPEG buffer parameters */
buffer_info->dest_buf_mpeg.dw0.type = CMD_3D;
buffer_info->dest_buf_mpeg.dw0.opcode =
OPC_3DSTATE_DEST_BUFFER_VARIABLES_MPEG;
@@ -540,48 +483,6 @@ static void i915_mc_static_indirect_state_init(XvMCContext * context)
buffer_info->dest_buf_mpeg.dw1.v_subsample_factor = MC_SUB_1V;
buffer_info->dest_buf_mpeg.dw1.h_subsample_factor = MC_SUB_1H;
- buffer_info->corr.dw0.type = CMD_3D;
- buffer_info->corr.dw0.opcode = OPC_3DSTATE_BUFFER_INFO;
- buffer_info->corr.dw0.length = 1;
- buffer_info->corr.dw1.aux_id = 0;
- buffer_info->corr.dw1.buffer_id = BUFFERID_MC_INTRA_CORR;
- buffer_info->corr.dw1.aux_id = 0;
- buffer_info->corr.dw1.fence_regs = 0;
- buffer_info->corr.dw1.tiled_surface = 0;
- buffer_info->corr.dw1.walk = 0;
- buffer_info->corr.dw1.pitch = 0;
- buffer_info->corr.dw2.base_address = (pI915XvMC->corrdata.offset >> 2); /* starting DWORD address */
-}
-
-static void i915_mc_static_indirect_state_set(XvMCContext * context,
- XvMCSurface * dest,
- unsigned int picture_structure,
- unsigned int flags,
- unsigned int picture_coding_type)
-{
- i915XvMCContext *pI915XvMC = (i915XvMCContext *) context->privData;
- i915XvMCSurface *pI915Surface = (i915XvMCSurface *) dest->privData;
- struct i915_mc_static_indirect_state_buffer *buffer_info =
- (struct i915_mc_static_indirect_state_buffer *)pI915XvMC->sis.map;
- unsigned int w = dest->width;
-
- buffer_info->dest_y.dw1.pitch = (pI915Surface->yStride >> 2); /* in DWords */
- buffer_info->dest_y.dw2.base_address = (YOFFSET(pI915Surface) >> 2); /* starting DWORD address */
- buffer_info->dest_u.dw1.pitch = (pI915Surface->uvStride >> 2); /* in DWords */
- buffer_info->dest_u.dw2.base_address = (UOFFSET(pI915Surface) >> 2); /* starting DWORD address */
- buffer_info->dest_v.dw1.pitch = (pI915Surface->uvStride >> 2); /* in Dwords */
- buffer_info->dest_v.dw2.base_address = (VOFFSET(pI915Surface) >> 2); /* starting DWORD address */
-
- if ((picture_structure & XVMC_FRAME_PICTURE) == XVMC_FRAME_PICTURE) {
- ;
- } else if ((picture_structure & XVMC_FRAME_PICTURE) == XVMC_TOP_FIELD) {
- buffer_info->dest_buf.dw1.v_ls = 1;
- } else if ((picture_structure & XVMC_FRAME_PICTURE) ==
- XVMC_BOTTOM_FIELD) {
- buffer_info->dest_buf.dw1.v_ls = 1;
- buffer_info->dest_buf.dw1.v_ls_offset = 1;
- }
-
if (picture_structure & XVMC_FRAME_PICTURE) {
;
} else if (picture_structure & XVMC_TOP_FIELD) {
@@ -599,16 +500,37 @@ static void i915_mc_static_indirect_state_set(XvMCContext * context,
buffer_info->dest_buf_mpeg.dw1.picture_width = (dest->width >> 4); /* in macroblocks */
buffer_info->dest_buf_mpeg.dw2.picture_coding_type =
picture_coding_type;
+
+ buffer_info->corr.dw0.type = CMD_3D;
+ buffer_info->corr.dw0.opcode = OPC_3DSTATE_BUFFER_INFO;
+ buffer_info->corr.dw0.length = 1;
+ buffer_info->corr.dw1.aux_id = 0;
+ buffer_info->corr.dw1.buffer_id = BUFFERID_MC_INTRA_CORR;
+ buffer_info->corr.dw1.aux_id = 0;
+ buffer_info->corr.dw1.fence_regs = 0;
+ buffer_info->corr.dw1.tiled_surface = 0;
+ buffer_info->corr.dw1.walk = 0;
+ buffer_info->corr.dw1.pitch = 0;
+ buffer_info->corr.dw2.base_address = pI915XvMC->corrdata_bo->offset >> 2; /* starting DWORD address */
+ drm_intel_bo_emit_reloc(pI915XvMC->sis_bo,
+ offsetof(typeof(*buffer_info),corr.dw2),
+ pI915XvMC->corrdata_bo, 0,
+ I915_GEM_DOMAIN_RENDER, 0);
+
+ drm_intel_gem_bo_unmap_gtt(pI915XvMC->sis_bo);
}
-static void i915_mc_map_state_init(XvMCContext * context)
+static void i915_mc_map_state_set(XvMCContext * context,
+ struct intel_xvmc_surface * privPast,
+ struct intel_xvmc_surface * privFuture)
{
i915XvMCContext *pI915XvMC = (i915XvMCContext *) context->privData;
+ struct i915_mc_map_state *map_state;
unsigned int w = context->width;
unsigned int h = context->height;
- struct i915_mc_map_state *map_state;
- map_state = (struct i915_mc_map_state *)pI915XvMC->msb.map;
+ drm_intel_gem_bo_map_gtt(pI915XvMC->msb_bo);
+ map_state = pI915XvMC->msb_bo->virtual;
memset(map_state, 0, sizeof(*map_state));
@@ -632,6 +554,12 @@ static void i915_mc_map_state_init(XvMCContext * context)
map_state->y_forward.tm2.depth = 0;
map_state->y_forward.tm2.max_lod = 0;
map_state->y_forward.tm2.cube_face = 0;
+ map_state->y_forward.tm0.base_address = privPast->bo->offset >> 2;
+ drm_intel_bo_emit_reloc(pI915XvMC->msb_bo,
+ offsetof(typeof(*map_state),y_forward.tm0),
+ privPast->bo, 0,
+ I915_GEM_DOMAIN_SAMPLER, 0);
+ map_state->y_forward.tm2.pitch = (pI915XvMC->yStride >> 2) - 1; /* in DWords - 1 */
/* Y Backward (Future) */
map_state->y_backward.tm0.v_ls_offset = 0;
@@ -646,6 +574,12 @@ static void i915_mc_map_state_init(XvMCContext * context)
map_state->y_backward.tm2.depth = 0;
map_state->y_backward.tm2.max_lod = 0;
map_state->y_backward.tm2.cube_face = 0;
+ map_state->y_backward.tm0.base_address = privFuture->bo->offset >> 2;
+ drm_intel_bo_emit_reloc(pI915XvMC->msb_bo,
+ offsetof(typeof(*map_state),y_backward.tm0),
+ privFuture->bo, 0,
+ I915_GEM_DOMAIN_SAMPLER, 0);
+ map_state->y_backward.tm2.pitch = (pI915XvMC->yStride >> 2) - 1;
/* 3DSATE_MAP_STATE: U */
map_state->u_map.dw0.type = CMD_3D;
@@ -667,6 +601,13 @@ static void i915_mc_map_state_init(XvMCContext * context)
map_state->u_forward.tm2.depth = 0;
map_state->u_forward.tm2.max_lod = 0;
map_state->u_forward.tm2.cube_face = 0;
+ map_state->u_forward.tm0.base_address =
+ (privPast->bo->offset + UOFFSET(context)) >> 2;
+ drm_intel_bo_emit_reloc(pI915XvMC->msb_bo,
+ offsetof(typeof(*map_state),u_forward.tm0),
+ privPast->bo, UOFFSET(context),
+ I915_GEM_DOMAIN_SAMPLER, 0);
+ map_state->u_forward.tm2.pitch = (pI915XvMC->uvStride >> 2) - 1; /* in DWords - 1 */
/* U Backward */
map_state->u_backward.tm0.v_ls_offset = 0;
@@ -681,6 +622,13 @@ static void i915_mc_map_state_init(XvMCContext * context)
map_state->u_backward.tm2.depth = 0;
map_state->u_backward.tm2.max_lod = 0;
map_state->u_backward.tm2.cube_face = 0;
+ map_state->u_backward.tm0.base_address =
+ (privFuture->bo->offset + UOFFSET(context)) >> 2;
+ drm_intel_bo_emit_reloc(pI915XvMC->msb_bo,
+ offsetof(typeof(*map_state),u_backward.tm0),
+ privFuture->bo, UOFFSET(context),
+ I915_GEM_DOMAIN_SAMPLER, 0);
+ map_state->u_backward.tm2.pitch = (pI915XvMC->uvStride >> 2) - 1;
/* 3DSATE_MAP_STATE: V */
map_state->v_map.dw0.type = CMD_3D;
@@ -702,6 +650,13 @@ static void i915_mc_map_state_init(XvMCContext * context)
map_state->v_forward.tm2.depth = 0;
map_state->v_forward.tm2.max_lod = 0;
map_state->v_forward.tm2.cube_face = 0;
+ map_state->v_forward.tm0.base_address =
+ (privPast->bo->offset + VOFFSET(context)) >> 2;
+ drm_intel_bo_emit_reloc(pI915XvMC->msb_bo,
+ offsetof(typeof(*map_state),v_forward.tm0),
+ privPast->bo, VOFFSET(context),
+ I915_GEM_DOMAIN_SAMPLER, 0);
+ map_state->v_forward.tm2.pitch = (pI915XvMC->uvStride >> 2) - 1; /* in DWords - 1 */
/* V Backward */
map_state->v_backward.tm0.v_ls_offset = 0;
@@ -716,98 +671,47 @@ static void i915_mc_map_state_init(XvMCContext * context)
map_state->v_backward.tm2.depth = 0;
map_state->v_backward.tm2.max_lod = 0;
map_state->v_backward.tm2.cube_face = 0;
+ map_state->v_backward.tm0.base_address =
+ (privFuture->bo->offset + VOFFSET(context)) >> 2;
+ drm_intel_bo_emit_reloc(pI915XvMC->msb_bo,
+ offsetof(typeof(*map_state),v_backward.tm0),
+ privFuture->bo, VOFFSET(context),
+ I915_GEM_DOMAIN_SAMPLER, 0);
+ map_state->v_backward.tm2.pitch = (pI915XvMC->uvStride >> 2) - 1;
+
+ drm_intel_gem_bo_unmap_gtt(pI915XvMC->msb_bo);
}
-static void i915_mc_map_state_set(XvMCContext * context,
- i915XvMCSurface * privPast,
- i915XvMCSurface * privFuture)
+static void i915_mc_load_indirect_render_emit(XvMCContext * context)
{
i915XvMCContext *pI915XvMC = (i915XvMCContext *) context->privData;
- struct i915_mc_map_state *map_state;
-
- map_state = (struct i915_mc_map_state *)pI915XvMC->msb.map;
-
- map_state->y_forward.tm0.base_address = (YOFFSET(privPast) >> 2);
- map_state->y_forward.tm2.pitch = (privPast->yStride >> 2) - 1; /* in DWords - 1 */
- map_state->y_backward.tm0.base_address = (YOFFSET(privFuture) >> 2);
- map_state->y_backward.tm2.pitch = (privFuture->yStride >> 2) - 1;
- map_state->u_forward.tm0.base_address = (UOFFSET(privPast) >> 2);
- map_state->u_forward.tm2.pitch = (privPast->uvStride >> 2) - 1; /* in DWords - 1 */
- map_state->u_backward.tm0.base_address = (UOFFSET(privFuture) >> 2);
- map_state->u_backward.tm2.pitch = (privFuture->uvStride >> 2) - 1;
- map_state->v_forward.tm0.base_address = (VOFFSET(privPast) >> 2);
- map_state->v_forward.tm2.pitch = (privPast->uvStride >> 2) - 1; /* in DWords - 1 */
- map_state->v_backward.tm0.base_address = (VOFFSET(privFuture) >> 2);
- map_state->v_backward.tm2.pitch = (privFuture->uvStride >> 2) - 1;
-}
-
-static void i915_flush(int map, int render)
-{
- struct i915_mi_flush mi_flush;
-
- memset(&mi_flush, 0, sizeof(mi_flush));
- mi_flush.dw0.type = CMD_MI;
- mi_flush.dw0.opcode = OPC_MI_FLUSH;
- mi_flush.dw0.map_cache_invalidate = map;
- mi_flush.dw0.render_cache_flush_inhibit = render;
-
- intelBatchbufferData(&mi_flush, sizeof(mi_flush), 0);
-}
-
-static void i915_mc_load_indirect_render_init(XvMCContext * context)
-{
- i915XvMCContext *pI915XvMC = (i915XvMCContext *) context->privData;
- sis_state *sis;
- msb_state *msb;
- struct i915_3dstate_load_indirect *load_indirect;
int mem_select;
+ uint32_t load_indirect, buffer_address;
+ BATCH_LOCALS;
- mc_render_load_indirect_size = sizeof(*load_indirect) + sizeof(*sis)
- + sizeof(*msb);
- mc_render_load_indirect = calloc(1, mc_render_load_indirect_size);
-
- load_indirect =
- (struct i915_3dstate_load_indirect *)mc_render_load_indirect;
- load_indirect->dw0.type = CMD_3D;
- load_indirect->dw0.opcode = OPC_3DSTATE_LOAD_INDIRECT;
- load_indirect->dw0.block_mask = BLOCK_SIS | BLOCK_MSB;
- load_indirect->dw0.length = (mc_render_load_indirect_size >> 2) - 2;
-
- if (pI915XvMC->deviceID == PCI_CHIP_I915_G ||
- pI915XvMC->deviceID == PCI_CHIP_I915_GM)
- mem_select = 0;
- else
- mem_select = 1;
+ BEGIN_BATCH(5);
+ load_indirect = OP_3D_LOAD_INDIRECT;
+ load_indirect |= (BLOCK_SIS | BLOCK_MSB) << BLOCK_MASK_SHIFT;
+ load_indirect |= 5 - 2; /* length */
- load_indirect->dw0.mem_select = mem_select;
+ if (pI915XvMC->use_phys_addr)
+ mem_select = 0; /* use physical address */
+ else {
+ load_indirect |= OP_3D_LOAD_INDIRECT_GFX_ADDR;
+ mem_select = 1; /* use gfx address */
+ }
+ OUT_BATCH(load_indirect);
/* Static Indirect state buffer (dest buffer info) */
- sis = (sis_state *) (++load_indirect);
- sis->dw0.valid = 1;
- sis->dw0.force = 1;
- sis->dw1.length = 16; /* 4 * 3 + 2 + 3 - 1 */
-
- if (mem_select)
- sis->dw0.buffer_address = (pI915XvMC->sis.offset >> 2);
- else
- sis->dw0.buffer_address = (pI915XvMC->sis.bus_addr >> 2);
+ OUT_RELOC(pI915XvMC->sis_bo, I915_GEM_DOMAIN_INSTRUCTION, 0,
+ STATE_VALID | STATE_FORCE);
+ OUT_BATCH(16); /* 4 * 3 + 2 + 3 - 1 */
/* Map state buffer (reference buffer info) */
- msb = (msb_state *) (++sis);
- msb->dw0.valid = 1;
- msb->dw0.force = 1;
- msb->dw1.length = 23; /* 3 * 8 - 1 */
-
- if (mem_select)
- msb->dw0.buffer_address = (pI915XvMC->msb.offset >> 2);
- else
- msb->dw0.buffer_address = (pI915XvMC->msb.bus_addr >> 2);
-}
-
-static void i915_mc_load_indirect_render_emit(void)
-{
- i915_emit_batch(mc_render_load_indirect, mc_render_load_indirect_size,
- 0);
+ OUT_RELOC(pI915XvMC->msb_bo, I915_GEM_DOMAIN_INSTRUCTION, 0,
+ STATE_VALID | STATE_FORCE);
+ OUT_BATCH(23); /* 3 * 8 - 1 */
+ ADVANCE_BATCH();
}
static void i915_mc_mpeg_set_origin(XvMCContext * context, XvMCMacroBlock * mb)
@@ -841,38 +745,6 @@ static void i915_mc_mpeg_macroblock_ipicture(XvMCContext * context,
0);
}
-#if 0
-static void i915_mc_mpeg_macroblock_0mv(XvMCContext * context,
- XvMCMacroBlock * mb)
-{
- struct i915_3dmpeg_macroblock_0mv macroblock_0mv;
-
- /* 3DMPEG_MACROBLOCK(0mv) */
- memset(&macroblock_0mv, 0, sizeof(macroblock_0mv));
- macroblock_0mv.header.dw0.type = CMD_3D;
- macroblock_0mv.header.dw0.opcode = OPC_3DMPEG_MACROBLOCK;
- macroblock_0mv.header.dw0.length = 0;
- macroblock_0mv.header.dw1.mb_intra = 1; /* should be 1 */
- macroblock_0mv.header.dw1.forward = 0; /* should be 0 */
- macroblock_0mv.header.dw1.backward = 0; /* should be 0 */
- macroblock_0mv.header.dw1.h263_4mv = 0; /* should be 0 */
- macroblock_0mv.header.dw1.dct_type =
- (mb->dct_type == XVMC_DCT_TYPE_FIELD);
-
-/*
- if (!mb->coded_block_pattern)
- macroblock_0mv.header.dw1.dct_type = XVMC_DCT_TYPE_FRAME;
-*/
-
- macroblock_0mv.header.dw1.motion_type = 0; // (mb->motion_type & 0x3);
- macroblock_0mv.header.dw1.vertical_field_select = 0; // mb->motion_vertical_field_select & 0xf;
- macroblock_0mv.header.dw1.coded_block_pattern = mb->coded_block_pattern;
- macroblock_0mv.header.dw1.skipped_macroblocks = 0;
-
- intelBatchbufferData(&macroblock_0mv, sizeof(macroblock_0mv), 0);
-}
-#endif
-
static void i915_mc_mpeg_macroblock_1fbmv(XvMCContext * context,
XvMCMacroBlock * mb)
{
@@ -976,634 +848,38 @@ static void i915_mc_mpeg_macroblock_2fbmv(XvMCContext * context,
intelBatchbufferData(&macroblock_2fbmv, sizeof(macroblock_2fbmv), 0);
}
-#if 0
-static void i915_mc_invalidate_subcontext_buffers(XvMCContext * context,
- unsigned int mask)
-{
- struct i915_3dstate_load_indirect *load_indirect = NULL;
- sis_state *sis = NULL;
- dis_state *dis = NULL;
- ssb_state *ssb = NULL;
- msb_state *msb = NULL;
- psp_state *psp = NULL;
- psc_state *psc = NULL;
- i915XvMCContext *pI915XvMC = (i915XvMCContext *) context->privData;
- unsigned int size;
- void *base = NULL, *ptr = NULL;
-
- size = sizeof(*load_indirect);
- if (mask & BLOCK_SIS)
- size += sizeof(*sis);
- if (mask & BLOCK_DIS)
- size += sizeof(*dis);
- if (mask & BLOCK_SSB)
- size += sizeof(*ssb);
- if (mask & BLOCK_MSB)
- size += sizeof(*msb);
- if (mask & BLOCK_PSP)
- size += sizeof(*psp);
- if (mask & BLOCK_PSC)
- size += sizeof(*psc);
-
- if (size == sizeof(*load_indirect)) {
- XVMC_ERR("There must be at least one bit set\n");
- return;
- }
-
- /* 3DSTATE_LOAD_INDIRECT */
- base = calloc(1, size);
- load_indirect = (struct i915_3dstate_load_indirect *)base;
- load_indirect->dw0.type = CMD_3D;
- load_indirect->dw0.opcode = OPC_3DSTATE_LOAD_INDIRECT;
-
- if (pI915XvMC->deviceID == PCI_CHIP_I915_G ||
- pI915XvMC->deviceID == PCI_CHIP_I915_GM ||
- pI915XvMC->deviceID == PCI_CHIP_I945_G ||
- pI915XvMC->deviceID == PCI_CHIP_I945_GM)
- load_indirect->dw0.mem_select = 0;
- else
- load_indirect->dw0.mem_select = 1;
-
- load_indirect->dw0.block_mask = mask;
- load_indirect->dw0.length = (size >> 2) - 2;
- ptr = ++load_indirect;
-
- /* SIS */
- if (mask & BLOCK_SIS) {
- sis = (sis_state *) ptr;
- sis->dw0.valid = 0;
- sis->dw0.buffer_address = 0;
- sis->dw1.length = 0;
- ptr = ++sis;
- }
-
- /* DIS */
- if (mask & BLOCK_DIS) {
- dis = (dis_state *) ptr;
- dis->dw0.valid = 0;
- dis->dw0.reset = 0;
- dis->dw0.buffer_address = 0;
- ptr = ++dis;
- }
-
- /* SSB */
- if (mask & BLOCK_SSB) {
- ssb = (ssb_state *) ptr;
- ssb->dw0.valid = 0;
- ssb->dw0.buffer_address = 0;
- ssb->dw1.length = 0;
- ptr = ++ssb;
- }
-
- /* MSB */
- if (mask & BLOCK_MSB) {
- msb = (msb_state *) ptr;
- msb->dw0.valid = 0;
- msb->dw0.buffer_address = 0;
- msb->dw1.length = 0;
- ptr = ++msb;
- }
-
- /* PSP */
- if (mask & BLOCK_PSP) {
- psp = (psp_state *) ptr;
- psp->dw0.valid = 0;
- psp->dw0.buffer_address = 0;
- psp->dw1.length = 0;
- ptr = ++psp;
- }
-
- /* PSC */
- if (mask & BLOCK_PSC) {
- psc = (psc_state *) ptr;
- psc->dw0.valid = 0;
- psc->dw0.buffer_address = 0;
- psc->dw1.length = 0;
- ptr = ++psc;
- }
-
- intelBatchbufferData(base, size, 0);
- free(base);
-}
-#endif
-
-static int i915_xvmc_map_buffers(i915XvMCContext * pI915XvMC)
-{
- if (drmMap(xvmc_driver->fd,
- pI915XvMC->sis.handle,
- pI915XvMC->sis.size,
- (drmAddress *) & pI915XvMC->sis.map) != 0) {
- return -1;
- }
-
- if (drmMap(xvmc_driver->fd,
- pI915XvMC->ssb.handle,
- pI915XvMC->ssb.size,
- (drmAddress *) & pI915XvMC->ssb.map) != 0) {
- return -1;
- }
-
- if (drmMap(xvmc_driver->fd,
- pI915XvMC->msb.handle,
- pI915XvMC->msb.size,
- (drmAddress *) & pI915XvMC->msb.map) != 0) {
- return -1;
- }
-
- if (drmMap(xvmc_driver->fd,
- pI915XvMC->psp.handle,
- pI915XvMC->psp.size,
- (drmAddress *) & pI915XvMC->psp.map) != 0) {
- return -1;
- }
-
- if (drmMap(xvmc_driver->fd,
- pI915XvMC->psc.handle,
- pI915XvMC->psc.size,
- (drmAddress *) & pI915XvMC->psc.map) != 0) {
- return -1;
- }
-
- if (drmMap(xvmc_driver->fd,
- pI915XvMC->corrdata.handle,
- pI915XvMC->corrdata.size,
- (drmAddress *) & pI915XvMC->corrdata.map) != 0) {
- return -1;
- }
-
- return 0;
-}
-
-static void i915_xvmc_unmap_buffers(i915XvMCContext * pI915XvMC)
-{
- if (pI915XvMC->sis.map) {
- drmUnmap(pI915XvMC->sis.map, pI915XvMC->sis.size);
- pI915XvMC->sis.map = NULL;
- }
-
- if (pI915XvMC->ssb.map) {
- drmUnmap(pI915XvMC->ssb.map, pI915XvMC->ssb.size);
- pI915XvMC->ssb.map = NULL;
- }
-
- if (pI915XvMC->msb.map) {
- drmUnmap(pI915XvMC->msb.map, pI915XvMC->msb.size);
- pI915XvMC->msb.map = NULL;
- }
-
- if (pI915XvMC->psp.map) {
- drmUnmap(pI915XvMC->psp.map, pI915XvMC->psp.size);
- pI915XvMC->psp.map = NULL;
- }
-
- if (pI915XvMC->psc.map) {
- drmUnmap(pI915XvMC->psc.map, pI915XvMC->psc.size);
- pI915XvMC->psc.map = NULL;
- }
-
- if (pI915XvMC->corrdata.map) {
- drmUnmap(pI915XvMC->corrdata.map, pI915XvMC->corrdata.size);
- pI915XvMC->corrdata.map = NULL;
- }
-}
-
-#if 0
-/*
- * Video post processing
- */
-static void i915_yuv2rgb_map_state_buffer(XvMCSurface * target_surface)
-{
- struct i915_3dstate_map_state *map_state;
- struct texture_map *tm;
- i915XvMCSurface *privTarget = NULL;
- i915XvMCContext *pI915XvMC = NULL;
- unsigned int w = target_surface->width, h = target_surface->height;
-
- privTarget = (i915XvMCSurface *) target_surface->privData;
- pI915XvMC = (i915XvMCContext *) privTarget->privContext;
- /* 3DSATE_MAP_STATE */
- map_state = (struct i915_3dstate_map_state *)pI915XvMC->msb.map;
- memset(map_state, 0, sizeof(*map_state));
- map_state->dw0.type = CMD_3D;
- map_state->dw0.opcode = OPC_3DSTATE_MAP_STATE;
- map_state->dw0.retain = 0;
- map_state->dw0.length = 9;
- map_state->dw1.map_mask = MAP_MAP0 | MAP_MAP1 | MAP_MAP2;
-
- /* texture map 0: V Plane */
- tm = (struct texture_map *)(++map_state);
- memset(tm, 0, sizeof(*tm));
- tm->tm0.v_ls_offset = 0;
- tm->tm0.v_ls = 0;
- tm->tm0.base_address = VOFFSET(privTarget);
- tm->tm1.tile_walk = TILEWALK_XMAJOR;
- tm->tm1.tiled_surface = 0;
- tm->tm1.utilize_fence_regs = 1;
- tm->tm1.texel_fmt = 0;
- tm->tm1.surface_fmt = 1;
- tm->tm1.width = (w >> 1) - 1;
- tm->tm1.height = (h >> 1) - 1;
- tm->tm2.depth = 0;
- tm->tm2.max_lod = 0;
- tm->tm2.cube_face = 0;
- tm->tm2.pitch = (privTarget->uvStride >> 2) - 1; /* in DWords - 1 */
-
- /* texture map 1: Y Plane */
- ++tm;
- memset(tm, 0, sizeof(*tm));
- tm->tm0.v_ls_offset = 0;
- tm->tm0.v_ls = 0;
- tm->tm0.base_address = YOFFSET(privTarget);
- tm->tm1.tile_walk = TILEWALK_XMAJOR;
- tm->tm1.tiled_surface = 0;
- tm->tm1.utilize_fence_regs = 1;
- tm->tm1.texel_fmt = 0;
- tm->tm1.surface_fmt = 1;
- tm->tm1.width = w - 1;
- tm->tm1.height = h - 1;
- tm->tm2.depth = 0;
- tm->tm2.max_lod = 0;
- tm->tm2.cube_face = 0;
- tm->tm2.pitch = (privTarget->yStride >> 2) - 1; /* in DWords - 1 */
-
- /* texture map 2: U Plane */
- ++tm;
- memset(tm, 0, sizeof(*tm));
- tm->tm0.v_ls_offset = 0;
- tm->tm0.v_ls = 0;
- tm->tm0.base_address = UOFFSET(privTarget);
- tm->tm1.tile_walk = TILEWALK_XMAJOR;
- tm->tm1.tiled_surface = 0;
- tm->tm1.utilize_fence_regs = 1;
- tm->tm1.texel_fmt = 0;
- tm->tm1.surface_fmt = 1;
- tm->tm1.width = (w >> 1) - 1;
- tm->tm1.height = (h >> 1) - 1;
- tm->tm2.depth = 0;
- tm->tm2.max_lod = 0;
- tm->tm2.cube_face = 0;
- tm->tm2.pitch = (privTarget->uvStride >> 2) - 1; /* in DWords - 1 */
-}
-#endif
-
-#if 0
-static void i915_yuv2rgb_sampler_state_buffer(XvMCSurface * surface)
-{
- struct i915_3dstate_sampler_state *sampler_state;
- struct texture_sampler *ts;
- i915XvMCSurface *privSurface = (i915XvMCSurface *) surface->privData;
- i915XvMCContext *pI915XvMC =
- (i915XvMCContext *) privSurface->privContext;
-
- /* 3DSATE_SAMPLER_STATE */
- sampler_state = (struct i915_3dstate_sampler_state *)pI915XvMC->ssb.map;
- memset(sampler_state, 0, sizeof(*sampler_state));
- sampler_state->dw0.type = CMD_3D;
- sampler_state->dw0.opcode = OPC_3DSTATE_SAMPLER_STATE;
- sampler_state->dw0.length = 9;
- sampler_state->dw1.sampler_masker =
- SAMPLER_SAMPLER0 | SAMPLER_SAMPLER1 | SAMPLER_SAMPLER2;
-
- /* Sampler 0 */
- ts = (struct texture_sampler *)(++sampler_state);
- memset(ts, 0, sizeof(*ts));
- ts->ts0.reverse_gamma = 0;
- ts->ts0.planar2packet = 1;
- ts->ts0.color_conversion = 1;
- ts->ts0.chromakey_index = 0;
- ts->ts0.base_level = 0;
- ts->ts0.mip_filter = MIPFILTER_NONE; /* NONE */
- ts->ts0.mag_filter = MAPFILTER_LINEAR; /* LINEAR */
- ts->ts0.min_filter = MAPFILTER_LINEAR; /* LINEAR */
- ts->ts0.lod_bias = 0;
- ts->ts0.shadow_enable = 0;
- ts->ts0.max_anisotropy = ANISORATIO_2;
- ts->ts0.shadow_function = PREFILTEROP_ALWAYS;
- ts->ts1.min_lod = 0; /* Maximum Mip Level */
- ts->ts1.kill_pixel = 0;
- ts->ts1.keyed_texture_filter = 0;
- ts->ts1.chromakey_enable = 0;
- ts->ts1.tcx_control = TEXCOORDMODE_CLAMP;
- ts->ts1.tcy_control = TEXCOORDMODE_CLAMP;
- ts->ts1.tcz_control = TEXCOORDMODE_CLAMP;
- ts->ts1.normalized_coor = 0;
- ts->ts1.map_index = 0;
- ts->ts1.east_deinterlacer = 0;
- ts->ts2.default_color = 0;
-
- /* Sampler 1 */
- ++ts;
- memset(ts, 0, sizeof(*ts));
- ts->ts0.reverse_gamma = 0;
- ts->ts0.planar2packet = 1;
- ts->ts0.color_conversion = 1;
- ts->ts0.chromakey_index = 0;
- ts->ts0.base_level = 0;
- ts->ts0.mip_filter = MIPFILTER_NONE; /* NONE */
- ts->ts0.mag_filter = MAPFILTER_LINEAR; /* LINEAR */
- ts->ts0.min_filter = MAPFILTER_LINEAR; /* LINEAR */
- ts->ts0.lod_bias = 0;
- ts->ts0.shadow_enable = 0;
- ts->ts0.max_anisotropy = ANISORATIO_2;
- ts->ts0.shadow_function = PREFILTEROP_ALWAYS;
- ts->ts1.min_lod = 0; /* Maximum Mip Level */
- ts->ts1.kill_pixel = 0;
- ts->ts1.keyed_texture_filter = 0;
- ts->ts1.chromakey_enable = 0;
- ts->ts1.tcx_control = TEXCOORDMODE_CLAMP;
- ts->ts1.tcy_control = TEXCOORDMODE_CLAMP;
- ts->ts1.tcz_control = TEXCOORDMODE_CLAMP;
- ts->ts1.normalized_coor = 0;
- ts->ts1.map_index = 1;
- ts->ts1.east_deinterlacer = 0;
- ts->ts2.default_color = 0;
-
- /* Sampler 2 */
- ++ts;
- memset(ts, 0, sizeof(*ts));
- ts->ts0.reverse_gamma = 0;
- ts->ts0.planar2packet = 1;
- ts->ts0.color_conversion = 1;
- ts->ts0.chromakey_index = 0;
- ts->ts0.base_level = 0;
- ts->ts0.mip_filter = MIPFILTER_NONE; /* NONE */
- ts->ts0.mag_filter = MAPFILTER_LINEAR; /* LINEAR */
- ts->ts0.min_filter = MAPFILTER_LINEAR; /* LINEAR */
- ts->ts0.lod_bias = 0;
- ts->ts0.shadow_enable = 0;
- ts->ts0.max_anisotropy = ANISORATIO_2;
- ts->ts0.shadow_function = PREFILTEROP_ALWAYS;
- ts->ts1.min_lod = 0; /* Maximum Mip Level */
- ts->ts1.kill_pixel = 0;
- ts->ts1.keyed_texture_filter = 0;
- ts->ts1.chromakey_enable = 0;
- ts->ts1.tcx_control = TEXCOORDMODE_CLAMP;
- ts->ts1.tcy_control = TEXCOORDMODE_CLAMP;
- ts->ts1.tcz_control = TEXCOORDMODE_CLAMP;
- ts->ts1.normalized_coor = 0;
- ts->ts1.map_index = 2;
- ts->ts1.east_deinterlacer = 0;
- ts->ts2.default_color = 0;
-}
-#endif
-
-#if 0
-static void i915_yuv2rgb_static_indirect_state_buffer(XvMCSurface * surface,
- unsigned int dstaddr,
- int dstpitch)
+static int i915_xvmc_alloc_one_time_buffers(i915XvMCContext *pI915XvMC)
{
- struct i915_3dstate_buffer_info *buffer_info;
- struct i915_3dstate_dest_buffer_variables *dest_buffer_variables;
- i915XvMCSurface *privSurface = (i915XvMCSurface *) surface->privData;
- i915XvMCContext *pI915XvMC =
- (i915XvMCContext *) privSurface->privContext;
-
- /* 3DSTATE_BUFFER_INFO */
- buffer_info = (struct i915_3dstate_buffer_info *)pI915XvMC->sis.map;
- memset(buffer_info, 0, sizeof(*buffer_info));
- buffer_info->dw0.type = CMD_3D;
- buffer_info->dw0.opcode = OPC_3DSTATE_BUFFER_INFO;
- buffer_info->dw0.length = 1;
- buffer_info->dw1.aux_id = 0;
- buffer_info->dw1.buffer_id = BUFFERID_COLOR_BACK;
- buffer_info->dw1.fence_regs = 1;
- buffer_info->dw1.tiled_surface = 0; /* linear */
- buffer_info->dw1.walk = TILEWALK_XMAJOR;
- buffer_info->dw1.pitch = dstpitch;
- buffer_info->dw2.base_address = dstaddr;
-
- /* 3DSTATE_DEST_BUFFER_VARIABLES */
- dest_buffer_variables =
- (struct i915_3dstate_dest_buffer_variables *)(++buffer_info);
- memset(dest_buffer_variables, 0, sizeof(*dest_buffer_variables));
- dest_buffer_variables->dw0.type = CMD_3D;
- dest_buffer_variables->dw0.opcode = OPC_3DSTATE_DEST_BUFFER_VARIABLES;
- dest_buffer_variables->dw0.length = 0;
- dest_buffer_variables->dw1.dest_v_bias = 8; /* FIXME 0x1000 .5 ??? */
- dest_buffer_variables->dw1.dest_h_bias = 8;
- dest_buffer_variables->dw1.color_fmt = COLORBUFFER_A8R8G8B8; /* FIXME */
+ pI915XvMC->ssb_bo = drm_intel_bo_alloc(xvmc_driver->bufmgr,
+ "ssb",
+ GTT_PAGE_SIZE,
+ GTT_PAGE_SIZE);
+ if (!pI915XvMC->ssb_bo)
+ return 0;
+
+ pI915XvMC->psp_bo = drm_intel_bo_alloc(xvmc_driver->bufmgr,
+ "psp",
+ GTT_PAGE_SIZE,
+ GTT_PAGE_SIZE);
+ if (!pI915XvMC->psp_bo)
+ return 0;
+
+ pI915XvMC->psc_bo = drm_intel_bo_alloc(xvmc_driver->bufmgr,
+ "psc",
+ GTT_PAGE_SIZE,
+ GTT_PAGE_SIZE);
+ if (!pI915XvMC->psc_bo)
+ return 0;
+
+ return 1;
}
-#endif
-#if 0
-static void i915_yuv2rgb_pixel_shader_program_buffer(XvMCSurface * surface)
+static void i915_xvmc_free_one_time_buffers(i915XvMCContext *pI915XvMC)
{
- struct i915_3dstate_pixel_shader_program *pixel_shader_program;
- i915XvMCSurface *privSurface = (i915XvMCSurface *) surface->privData;
- i915XvMCContext *pI915XvMC =
- (i915XvMCContext *) privSurface->privContext;
- unsigned int *inst;
- unsigned int dest, src0, src1;
-
- /* Shader 0 */
- pixel_shader_program =
- (struct i915_3dstate_pixel_shader_program *)pI915XvMC->psp.map;
- memset(pixel_shader_program, 0, sizeof(*pixel_shader_program));
- pixel_shader_program->dw0.type = CMD_3D;
- pixel_shader_program->dw0.opcode = OPC_3DSTATE_PIXEL_SHADER_PROGRAM;
- pixel_shader_program->dw0.retain = 0;
- pixel_shader_program->dw0.length = 23;
- /* dcl t0.xy */
- inst = (unsigned int *)(++pixel_shader_program);
- i915_inst_decl(inst, REG_TYPE_T, T_TEX0, D0_CHANNEL_XY);
- /* dcl t1.xy */
- inst += 3;
- i915_inst_decl(inst, REG_TYPE_T, T_TEX1, D0_CHANNEL_XY);
- /* dcl_2D s0 */
- inst += 3;
- i915_inst_decl(inst, REG_TYPE_S, 0, D0_SAMPLE_TYPE_2D);
- /* dcl_2D s1 */
- inst += 3;
- i915_inst_decl(inst, REG_TYPE_S, 1, D0_SAMPLE_TYPE_2D);
- /* dcl_2D s2 */
- inst += 3;
- i915_inst_decl(inst, REG_TYPE_S, 2, D0_SAMPLE_TYPE_2D);
- /* texld r0 t1 s0 */
- inst += 3;
- dest = UREG(REG_TYPE_R, 0);
- src0 = UREG(REG_TYPE_T, 1); /* COORD */
- src1 = UREG(REG_TYPE_S, 0); /* SAMPLER */
- i915_inst_texld(inst, T0_TEXLD, dest, src0, src1);
- /* texld r0 t0 s1 */
- inst += 3;
- dest = UREG(REG_TYPE_R, 0);
- src0 = UREG(REG_TYPE_T, 0); /* COORD */
- src1 = UREG(REG_TYPE_S, 1); /* SAMPLER */
- i915_inst_texld(inst, T0_TEXLD, dest, src0, src1);
- /* texld oC t1 s2 */
- inst += 3;
- dest = UREG(REG_TYPE_OC, 0);
- src0 = UREG(REG_TYPE_T, 1); /* COORD */
- src1 = UREG(REG_TYPE_S, 2); /* SAMPLER */
- i915_inst_texld(inst, T0_TEXLD, dest, src0, src1);
+ drm_intel_bo_unreference(pI915XvMC->ssb_bo);
+ drm_intel_bo_unreference(pI915XvMC->psp_bo);
+ drm_intel_bo_unreference(pI915XvMC->psc_bo);
}
-#endif
-
-#if 0
-static void i915_yuv2rgb_proc(XvMCSurface * surface)
-{
- i915XvMCSurface *privSurface = (i915XvMCSurface *) surface->privData;
- i915XvMCContext *pI915XvMC =
- (i915XvMCContext *) privSurface->privContext;
- struct i915_3dstate_load_state_immediate_1 *load_state_immediate_1 =
- NULL;
- struct s2_dword *s2 = NULL;
- struct s3_dword *s3 = NULL;
- struct s4_dword *s4 = NULL;
- struct s5_dword *s5 = NULL;
- struct s6_dword *s6 = NULL;
- struct s7_dword *s7 = NULL;
- struct i915_3dstate_scissor_rectangle scissor_rectangle;
- struct i915_3dstate_load_indirect *load_indirect = NULL;
- sis_state *sis = NULL;
- ssb_state *ssb = NULL;
- msb_state *msb = NULL;
- psp_state *psp = NULL;
- struct i915_3dprimitive *_3dprimitive = NULL;
- struct vertex_data *vd = NULL;
- unsigned int size;
- void *base = NULL;
-
- /* 3DSTATE_LOAD_STATE_IMMEDIATE_1 */
- size = sizeof(*load_state_immediate_1) + sizeof(*s2) + sizeof(*s3) +
- sizeof(*s4) + sizeof(*s5) + sizeof(*s6) + sizeof(*s7);
- base = calloc(1, size);
- load_state_immediate_1 =
- (struct i915_3dstate_load_state_immediate_1 *)base;
- load_state_immediate_1->dw0.type = CMD_3D;
- load_state_immediate_1->dw0.opcode = OPC_3DSTATE_LOAD_STATE_IMMEDIATE_1;
- load_state_immediate_1->dw0.load_s2 = 1;
- load_state_immediate_1->dw0.load_s3 = 1;
- load_state_immediate_1->dw0.load_s4 = 1;
- load_state_immediate_1->dw0.load_s5 = 1;
- load_state_immediate_1->dw0.load_s6 = 1;
- load_state_immediate_1->dw0.load_s7 = 1;
- load_state_immediate_1->dw0.length = 5;
-
- s2 = (struct s2_dword *)(++load_state_immediate_1);
- s2->set0_texcoord_fmt = TEXCOORDFMT_2FP;
- s2->set1_texcoord_fmt = TEXCOORDFMT_2FP;
- s2->set2_texcoord_fmt = TEXCOORDFMT_NOT_PRESENT;
- s2->set3_texcoord_fmt = TEXCOORDFMT_NOT_PRESENT;
- s2->set4_texcoord_fmt = TEXCOORDFMT_NOT_PRESENT;
- s2->set5_texcoord_fmt = TEXCOORDFMT_NOT_PRESENT;
- s2->set6_texcoord_fmt = TEXCOORDFMT_NOT_PRESENT;
- s2->set7_texcoord_fmt = TEXCOORDFMT_NOT_PRESENT;
-
- s3 = (struct s3_dword *)(++s2);
- s4 = (struct s4_dword *)(++s3);
- s4->position_mask = VERTEXHAS_XY;
- s4->cull_mode = CULLMODE_NONE;
- s4->color_shade_mode = SHADEMODE_FLAT;
- s4->specular_shade_mode = SHADEMODE_FLAT;
- s4->fog_shade_mode = SHADEMODE_FLAT;
- s4->alpha_shade_mode = SHADEMODE_FLAT;
- s4->line_width = 0x2; /* FIXME: 1.0??? */
- s4->point_width = 0x1;
-
- s5 = (struct s5_dword *)(++s4);
- s6 = (struct s6_dword *)(++s5);
- s6->src_blend_factor = 1;
- s6->dest_blend_factor = 1;
- s6->color_buffer_write = 1;
-
- s7 = (struct s7_dword *)(++s6);
- intelBatchbufferData(base, size, 0);
- free(base);
-
- /* 3DSTATE_3DSTATE_SCISSOR_RECTANGLE */
- scissor_rectangle.dw0.type = CMD_3D;
- scissor_rectangle.dw0.opcode = OPC_3DSTATE_SCISSOR_RECTANGLE;
- scissor_rectangle.dw0.length = 1;
- scissor_rectangle.dw1.min_x = 0;
- scissor_rectangle.dw1.min_y = 0;
- scissor_rectangle.dw2.max_x = 2047;
- scissor_rectangle.dw2.max_y = 2047;
- intelBatchbufferData(&scissor_rectangle, sizeof(scissor_rectangle), 0);
-
- /* 3DSTATE_LOAD_INDIRECT */
- size =
- sizeof(*load_indirect) + sizeof(*sis) + sizeof(*ssb) +
- sizeof(*msb) + sizeof(*psp);
- base = calloc(1, size);
- load_indirect = (struct i915_3dstate_load_indirect *)base;
- load_indirect->dw0.type = CMD_3D;
- load_indirect->dw0.opcode = OPC_3DSTATE_LOAD_INDIRECT;
- load_indirect->dw0.mem_select = 1; /* Bearlake only */
- load_indirect->dw0.block_mask =
- BLOCK_SIS | BLOCK_SSB | BLOCK_MSB | BLOCK_PSP;
- load_indirect->dw0.length = 7;
-
- /* SIS */
- sis = (sis_state *) (++load_indirect);
- sis->dw0.valid = 1;
- sis->dw0.buffer_address = pI915XvMC->sis.offset;
- sis->dw1.length = ((sizeof(struct i915_3dstate_buffer_info) +
- sizeof(struct i915_3dstate_dest_buffer_variables))
- >> 2) - 1;
-
- /* SSB */
- ssb = (ssb_state *) (++sis);
- ssb->dw0.valid = 1;
- ssb->dw0.buffer_address = pI915XvMC->ssb.offset;
- ssb->dw1.length = ((sizeof(struct i915_3dstate_sampler_state) +
- sizeof(struct texture_sampler) * 3) >> 2) - 1;
-
- /* MSB */
- msb = (msb_state *) (++ssb);
- msb->dw0.valid = 1;
- msb->dw0.buffer_address = pI915XvMC->msb.offset;
- msb->dw1.length = ((sizeof(struct i915_3dstate_map_state) +
- sizeof(struct texture_map) * 3) >> 2) - 1;
-
- /* PSP */
- psp = (psp_state *) (++msb);
- psp->dw0.valid = 1;
- psp->dw0.buffer_address = pI915XvMC->psp.offset;
- psp->dw1.length = ((sizeof(struct i915_3dstate_pixel_shader_program) +
- sizeof(union shader_inst)) >> 2) - 1;
-
- intelBatchbufferData(base, size, 0);
- free(base);
-
- /* 3DPRIMITIVE */
- size = sizeof(*_3dprimitive) + sizeof(*vd) * 3;
- base = calloc(1, size);
- _3dprimitive = (struct i915_3dprimitive *)base;
- _3dprimitive->dw0.inline_prim.type = CMD_3D;
- _3dprimitive->dw0.inline_prim.opcode = OPC_3DPRIMITIVE;
- _3dprimitive->dw0.inline_prim.vertex_location = VERTEX_INLINE;
- _3dprimitive->dw0.inline_prim.prim = PRIM_RECTLIST;
- _3dprimitive->dw0.inline_prim.length = size - 2;
-
- vd = (struct vertex_data *)(++_3dprimitive);
- vd->x = 0; /* FIXME!!! */
- vd->x = 0; /* FIXME */
- vd->tc0.tcx = 0;
- vd->tc0.tcy = 0;
- vd->tc1.tcx = 0;
- vd->tc1.tcy = 0;
-
- ++vd;
- vd->x = 0; /* FIXME!!! */
- vd->x = 0; /* FIXME */
- vd->tc0.tcx = 0;
- vd->tc0.tcy = 0;
- vd->tc1.tcx = 0;
- vd->tc1.tcy = 0;
-
- ++vd;
- vd->x = 0; /* FIXME!!! */
- vd->x = 0; /* FIXME */
- vd->tc0.tcx = 0;
- vd->tc0.tcy = 0;
- vd->tc1.tcx = 0;
- vd->tc1.tcy = 0;
-
- intelBatchbufferData(base, size, 0);
- free(base);
-}
-#endif
/*
* Function: i915_release_resource
@@ -1615,8 +891,7 @@ static void i915_release_resource(Display * display, XvMCContext * context)
if (!(pI915XvMC = context->privData))
return;
- pI915XvMC->ref--;
- i915_xvmc_unmap_buffers(pI915XvMC);
+ i915_xvmc_free_one_time_buffers(pI915XvMC);
free(pI915XvMC);
context->privData = NULL;
@@ -1627,15 +902,13 @@ static Status i915_xvmc_mc_create_context(Display * display,
CARD32 * priv_data)
{
i915XvMCContext *pI915XvMC = NULL;
- I915XvMCCreateContextRec *tmpComm = NULL;
-
- XVMC_DBG("%s\n", __FUNCTION__);
+ struct intel_xvmc_hw_context *tmpComm = NULL;
- if (priv_count != (sizeof(I915XvMCCreateContextRec) >> 2)) {
+ if (priv_count != (sizeof(struct intel_xvmc_hw_context) >> 2)) {
XVMC_ERR
("_xvmc_create_context() returned incorrect data size!");
XVMC_INFO("\tExpected %d, got %d",
- (int)(sizeof(I915XvMCCreateContextRec) >> 2),
+ (int)(sizeof(struct intel_xvmc_hw_context) >> 2),
priv_count);
_xvmc_destroy_context(display, context);
XFree(priv_data);
@@ -1650,68 +923,32 @@ static Status i915_xvmc_mc_create_context(Display * display,
}
pI915XvMC = (i915XvMCContext *) context->privData;
- tmpComm = (I915XvMCCreateContextRec *) priv_data;
- pI915XvMC->ctxno = tmpComm->ctxno;
- pI915XvMC->deviceID = tmpComm->deviceID;
- pI915XvMC->sis.handle = tmpComm->sis.handle;
- pI915XvMC->sis.offset = tmpComm->sis.offset;
- pI915XvMC->sis.size = tmpComm->sis.size;
- pI915XvMC->ssb.handle = tmpComm->ssb.handle;
- pI915XvMC->ssb.offset = tmpComm->ssb.offset;
- pI915XvMC->ssb.size = tmpComm->ssb.size;
- pI915XvMC->msb.handle = tmpComm->msb.handle;
- pI915XvMC->msb.offset = tmpComm->msb.offset;
- pI915XvMC->msb.size = tmpComm->msb.size;
- pI915XvMC->psp.handle = tmpComm->psp.handle;
- pI915XvMC->psp.offset = tmpComm->psp.offset;
- pI915XvMC->psp.size = tmpComm->psp.size;
- pI915XvMC->psc.handle = tmpComm->psc.handle;
- pI915XvMC->psc.offset = tmpComm->psc.offset;
- pI915XvMC->psc.size = tmpComm->psc.size;
-
- if (pI915XvMC->deviceID == PCI_CHIP_I915_G ||
- pI915XvMC->deviceID == PCI_CHIP_I915_GM) {
- pI915XvMC->sis.bus_addr = tmpComm->sis.bus_addr;
- pI915XvMC->ssb.bus_addr = tmpComm->ssb.bus_addr;
- pI915XvMC->msb.bus_addr = tmpComm->msb.bus_addr;
- pI915XvMC->psp.bus_addr = tmpComm->psp.bus_addr;
- pI915XvMC->psc.bus_addr = tmpComm->psc.bus_addr;
- }
-
- pI915XvMC->corrdata.handle = tmpComm->corrdata.handle;
- pI915XvMC->corrdata.offset = tmpComm->corrdata.offset;
- pI915XvMC->corrdata.size = tmpComm->corrdata.size;
+ tmpComm = (struct intel_xvmc_hw_context *) priv_data;
+ pI915XvMC->use_phys_addr = tmpComm->i915.use_phys_addr;
+ pI915XvMC->comm.surface_bo_size = SIZE_YUV420(context->width,
+ context->height);
/* Must free the private data we were passed from X */
XFree(priv_data);
priv_data = NULL;
- if (i915_xvmc_map_buffers(pI915XvMC)) {
- i915_xvmc_unmap_buffers(pI915XvMC);
- free(pI915XvMC);
- context->privData = NULL;
- return BadAlloc;
- }
+ if (!i915_xvmc_alloc_one_time_buffers(pI915XvMC))
+ goto free_one_time_buffers;
/* Initialize private context values */
pI915XvMC->yStride = STRIDE(context->width);
pI915XvMC->uvStride = STRIDE(context->width >> 1);
- pI915XvMC->haveXv = 0;
- pI915XvMC->dual_prime = 0;
- pI915XvMC->last_flip = 0;
- pI915XvMC->port = context->port;
- pI915XvMC->ref = 1;
/* pre-init state buffers */
i915_mc_one_time_context_init(context);
- i915_mc_one_time_state_init(context);
-
- i915_mc_static_indirect_state_init(context);
- i915_mc_map_state_init(context);
-
- i915_mc_load_indirect_render_init(context);
return Success;
+
+free_one_time_buffers:
+ i915_xvmc_free_one_time_buffers(pI915XvMC);
+ free(pI915XvMC);
+ context->privData = NULL;
+ return BadAlloc;
}
static int i915_xvmc_mc_destroy_context(Display * display,
@@ -1725,108 +962,40 @@ static int i915_xvmc_mc_destroy_context(Display * display,
/* Pass Control to the X server to destroy the drm_context_t */
i915_release_resource(display, context);
- free(one_time_load_state_imm1);
- free(one_time_load_indirect);
- free(mc_render_load_indirect);
return Success;
}
-static Status i915_xvmc_mc_create_surface(Display * display,
- XvMCContext * context,
- XvMCSurface * surface, int priv_count,
- CARD32 * priv_data)
+static int i915_xvmc_alloc_render_state_buffers(i915XvMCContext *pI915XvMC)
{
- i915XvMCContext *pI915XvMC;
- i915XvMCSurface *pI915Surface;
- I915XvMCCreateSurfaceRec *tmpComm = NULL;
-
- if (!(pI915XvMC = context->privData))
- return XvMCBadContext;
-
- XVMC_DBG("%s\n", __FUNCTION__);
-
- if (priv_count != (sizeof(I915XvMCCreateSurfaceRec) >> 2)) {
- XVMC_ERR
- ("_xvmc_create_surface() returned incorrect data size!");
- XVMC_INFO("\tExpected %d, got %d",
- (int)(sizeof(I915XvMCCreateSurfaceRec) >> 2),
- priv_count);
- _xvmc_destroy_surface(display, surface);
- XFree(priv_data);
- return BadAlloc;
- }
-
- PPTHREAD_MUTEX_LOCK();
- surface->privData = (i915XvMCSurface *) malloc(sizeof(i915XvMCSurface));
-
- if (!(pI915Surface = surface->privData)) {
- PPTHREAD_MUTEX_UNLOCK();
- return BadAlloc;
- }
-
- /* Initialize private values */
- pI915Surface->last_render = 0;
- pI915Surface->last_flip = 0;
- pI915Surface->yStride = pI915XvMC->yStride;
- pI915Surface->uvStride = pI915XvMC->uvStride;
- pI915Surface->width = context->width;
- pI915Surface->height = context->height;
- pI915Surface->privContext = pI915XvMC;
- pI915Surface->privSubPic = NULL;
- pI915Surface->srf.map = NULL;
-
- tmpComm = (I915XvMCCreateSurfaceRec *) priv_data;
-
- pI915Surface->srfNo = tmpComm->srfno;
- pI915Surface->srf.handle = tmpComm->srf.handle;
- pI915Surface->srf.offset = tmpComm->srf.offset;
- pI915Surface->srf.size = tmpComm->srf.size;
-
- XFree(priv_data);
-
- if (drmMap(xvmc_driver->fd,
- pI915Surface->srf.handle,
- pI915Surface->srf.size,
- (drmAddress *) & pI915Surface->srf.map) != 0) {
- XVMC_ERR("mapping surface memory failed!\n");
- _xvmc_destroy_surface(display, surface);
- free(pI915Surface);
- surface->privData = NULL;
- PPTHREAD_MUTEX_UNLOCK();
- return BadAlloc;
- }
-
- pI915XvMC->ref++;
- PPTHREAD_MUTEX_UNLOCK();
- return 0;
+ pI915XvMC->sis_bo = drm_intel_bo_alloc(xvmc_driver->bufmgr,
+ "sis",
+ GTT_PAGE_SIZE,
+ GTT_PAGE_SIZE);
+ if (!pI915XvMC->sis_bo)
+ return 0;
+
+ pI915XvMC->msb_bo = drm_intel_bo_alloc(xvmc_driver->bufmgr,
+ "msb",
+ GTT_PAGE_SIZE,
+ GTT_PAGE_SIZE);
+ if (!pI915XvMC->msb_bo)
+ return 0;
+
+ pI915XvMC->corrdata_bo = drm_intel_bo_alloc(xvmc_driver->bufmgr,
+ "corrdata",
+ CORRDATA_SIZE,
+ GTT_PAGE_SIZE);
+ if (!pI915XvMC->corrdata_bo)
+ return 0;
+
+ return 1;
}
-static int i915_xvmc_mc_destroy_surface(Display * display,
- XvMCSurface * surface)
+static void i915_xvmc_free_render_state_buffers(i915XvMCContext *pI915XvMC)
{
- i915XvMCSurface *pI915Surface;
- i915XvMCContext *pI915XvMC;
-
- if (!display || !surface)
- return BadValue;
-
- if (!(pI915Surface = surface->privData))
- return XvMCBadSurface;
-
- if (!(pI915XvMC = pI915Surface->privContext))
- return XvMCBadSurface;
-
- if (pI915Surface->last_flip)
- XvMCSyncSurface(display, surface);
-
- if (pI915Surface->srf.map)
- drmUnmap(pI915Surface->srf.map, pI915Surface->srf.size);
-
- free(pI915Surface);
- surface->privData = NULL;
- pI915XvMC->ref--;
-
- return Success;
+ drm_intel_bo_unreference(pI915XvMC->sis_bo);
+ drm_intel_bo_unreference(pI915XvMC->msb_bo);
+ drm_intel_bo_unreference(pI915XvMC->corrdata_bo);
}
static int i915_xvmc_mc_render_surface(Display * display, XvMCContext * context,
@@ -1853,13 +1022,11 @@ static int i915_xvmc_mc_render_surface(Display * display, XvMCContext * context,
intel_xvmc_context_ptr intel_ctx;
- i915XvMCSurface *privTarget = NULL;
- i915XvMCSurface *privFuture = NULL;
- i915XvMCSurface *privPast = NULL;
+ struct intel_xvmc_surface *privTarget = NULL;
+ struct intel_xvmc_surface *privFuture = NULL;
+ struct intel_xvmc_surface *privPast = NULL;
i915XvMCContext *pI915XvMC = NULL;
- XVMC_DBG("%s\n", __FUNCTION__);
-
/* Check Parameters for validity */
if (!display || !context || !target_surface) {
XVMC_ERR("Invalid Display, Context or Target!");
@@ -1885,13 +1052,10 @@ static int i915_xvmc_mc_render_surface(Display * display, XvMCContext * context,
if (!(privTarget = target_surface->privData))
return XvMCBadSurface;
- if (context->surface_type_id >= SURFACE_TYPE_MAX) {
- XVMC_ERR("Unsupprted surface_type_id %d.",
- context->surface_type_id);
- return BadValue;
- }
+ if (!i915_xvmc_alloc_render_state_buffers(pI915XvMC))
+ return BadAlloc;
- intel_ctx = intel_xvmc_find_context(context->context_id);
+ intel_ctx = context->privData;
if (!intel_ctx) {
XVMC_ERR("Can't find intel xvmc context\n");
return BadValue;
@@ -1903,7 +1067,6 @@ static int i915_xvmc_mc_render_surface(Display * display, XvMCContext * context,
privPast = privTarget;
} else {
if (!(privPast = past_surface->privData)) {
- XVMC_ERR("Invalid Past Surface!");
return XvMCBadSurface;
}
picture_coding_type = MPEG_P_PICTURE;
@@ -1927,7 +1090,8 @@ static int i915_xvmc_mc_render_surface(Display * display, XvMCContext * context,
}
LOCK_HARDWARE(intel_ctx->hw_context);
- corrdata_ptr = pI915XvMC->corrdata.map;
+ drm_intel_gem_bo_map_gtt(pI915XvMC->corrdata_bo);
+ corrdata_ptr = pI915XvMC->corrdata_bo->virtual;
corrdata_size = 0;
for (i = first_macroblock; i < (num_macroblocks + first_macroblock);
@@ -1962,7 +1126,7 @@ static int i915_xvmc_mc_render_surface(Display * display, XvMCContext * context,
corrdata_size += bspm;
- if (corrdata_size > pI915XvMC->corrdata.size) {
+ if (corrdata_size > CORRDATA_SIZE) {
XVMC_ERR("correction data buffer overflow.");
break;
}
@@ -1970,11 +1134,12 @@ static int i915_xvmc_mc_render_surface(Display * display, XvMCContext * context,
corrdata_ptr += bspm;
}
- i915_flush(1, 0);
+ drm_intel_gem_bo_unmap_gtt(pI915XvMC->corrdata_bo);
+
// i915_mc_invalidate_subcontext_buffers(context, BLOCK_SIS | BLOCK_DIS | BLOCK_SSB
// | BLOCK_MSB | BLOCK_PSP | BLOCK_PSC);
- i915_mc_one_time_state_emit();
+ i915_mc_one_time_state_emit(context);
i915_mc_static_indirect_state_set(context, target_surface,
picture_structure, flags,
@@ -1982,7 +1147,7 @@ static int i915_xvmc_mc_render_surface(Display * display, XvMCContext * context,
/* setup reference surfaces */
i915_mc_map_state_set(context, privPast, privFuture);
- i915_mc_load_indirect_render_emit();
+ i915_mc_load_indirect_render_emit(context);
i915_mc_mpeg_set_origin(context,
&macroblock_array->macro_blocks
@@ -2042,513 +1207,18 @@ static int i915_xvmc_mc_render_surface(Display * display, XvMCContext * context,
}
intelFlushBatch(TRUE);
- xvmc_driver->last_render = xvmc_driver->alloc.irq_emitted;
- privTarget->last_render = xvmc_driver->last_render;
- UNLOCK_HARDWARE(intel_ctx->hw_context);
- return 0;
-}
-
-static int i915_xvmc_mc_put_surface(Display * display, XvMCSurface * surface,
- Drawable draw, short srcx, short srcy,
- unsigned short srcw, unsigned short srch,
- short destx, short desty,
- unsigned short destw, unsigned short desth,
- int flags, struct intel_xvmc_command *data)
-{
- i915XvMCContext *pI915XvMC;
- i915XvMCSurface *pI915Surface;
- i915XvMCSubpicture *pI915SubPic;
-
- if (!(pI915Surface = surface->privData))
- return XvMCBadSurface;
-
- if (!(pI915XvMC = pI915Surface->privContext))
- return XvMCBadSurface;
-
- PPTHREAD_MUTEX_LOCK();
-
- data->command = INTEL_XVMC_COMMAND_DISPLAY;
- data->ctxNo = pI915XvMC->ctxno;
- data->srfNo = pI915Surface->srfNo;
- pI915SubPic = pI915Surface->privSubPic;
- data->subPicNo = (!pI915SubPic ? 0 : pI915SubPic->srfNo);
- data->real_id = FOURCC_YV12;
- data->flags = flags;
-
- PPTHREAD_MUTEX_UNLOCK();
-
- return 0;
-}
-
-static int i915_xvmc_mc_get_surface_status(Display * display,
- XvMCSurface * surface, int *stat)
-{
- i915XvMCSurface *pI915Surface;
- i915XvMCContext *pI915XvMC;
-
- if (!display || !surface || !stat)
- return BadValue;
-
- *stat = 0;
-
- if (!(pI915Surface = surface->privData))
- return XvMCBadSurface;
-
- if (!(pI915XvMC = pI915Surface->privContext))
- return XvMCBadSurface;
-
- PPTHREAD_MUTEX_LOCK();
- if (pI915Surface->last_flip) {
- /* This can not happen */
- if (pI915XvMC->last_flip < pI915Surface->last_flip) {
- XVMC_ERR
- ("Context last flip is less than surface last flip.");
- PPTHREAD_MUTEX_UNLOCK();
- return BadValue;
- }
-
- /*
- If the context has 2 or more flips after this surface it
- cannot be displaying. Don't bother to check.
- */
- if (!(pI915XvMC->last_flip > (pI915Surface->last_flip + 1))) {
- /*
- If this surface was the last flipped it is either displaying
- or about to be so don't bother checking.
- */
- if (pI915XvMC->last_flip == pI915Surface->last_flip) {
- *stat |= XVMC_DISPLAYING;
- }
- }
- }
+ i915_xvmc_free_render_state_buffers(pI915XvMC);
- PPTHREAD_MUTEX_UNLOCK();
+ UNLOCK_HARDWARE(intel_ctx->hw_context);
return 0;
}
-/* XXX WIP code */
-#if 0
-Status XvMCHideSurface(Display * display, XvMCSurface * surface)
-{
- i915XvMCSurface *pI915Surface;
- i915XvMCContext *pI915XvMC;
- int stat = 0, ret;
-
- if (!display || !surface)
- return BadValue;
-
- if (!(pI915Surface = surface->privData))
- return XvMCBadSurface;
-
- /* Get the associated context pointer */
- if (!(pI915XvMC = pI915Surface->privContext))
- return XvMCBadSurface;
-
- XvMCSyncSurface(display, surface);
-
- /*
- Get the status of the surface, if it is not currently displayed
- we don't need to worry about it.
- */
- if ((ret = XvMCGetSurfaceStatus(display, surface, &stat)) != Success)
- return ret;
-
- if (!(stat & XVMC_DISPLAYING))
- return Success;
-
- /* FIXME: */
- return Success;
-}
-
-Status i915_xvmc_create_subpict(Display * display, XvMCContext * context,
- XvMCSubpicture * subpicture,
- unsigned short width, unsigned short height,
- int xvimage_id)
-{
- Status ret;
- i915XvMCContext *pI915XvMC;
- i915XvMCSubpicture *pI915Subpicture;
- I915XvMCCreateSurfaceRec *tmpComm = NULL;
- int priv_count;
- uint *priv_data;
-
- if (!subpicture || !context || !display)
- return BadValue;
-
- pI915XvMC = (i915XvMCContext *) context->privData;
-
- if (!pI915XvMC)
- return XvMCBadContext;
-
- subpicture->privData =
- (i915XvMCSubpicture *) malloc(sizeof(i915XvMCSubpicture));
-
- if (!subpicture->privData)
- return BadAlloc;
-
- PPTHREAD_MUTEX_LOCK();
- subpicture->context_id = context->context_id;
- subpicture->xvimage_id = xvimage_id;
- subpicture->width = width;
- subpicture->height = height;
- pI915Subpicture = (i915XvMCSubpicture *) subpicture->privData;
-
- XLockDisplay(display);
- if ((ret = _xvmc_create_subpicture(display, context, subpicture,
- &priv_count, &priv_data))) {
- XUnlockDisplay(display);
- XVMC_ERR("Unable to create XvMCSubpicture.");
- free(pI915Subpicture);
- subpicture->privData = NULL;
- PPTHREAD_MUTEX_UNLOCK();
- return ret;
- }
- XUnlockDisplay(display);
-
- if (priv_count != (sizeof(I915XvMCCreateSurfaceRec) >> 2)) {
- XVMC_ERR
- ("_xvmc_create_subpicture() returned incorrect data size!");
- XVMC_INFO("\tExpected %d, got %d",
- (int)(sizeof(I915XvMCCreateSurfaceRec) >> 2),
- priv_count);
- XLockDisplay(display);
- _xvmc_destroy_subpicture(display, subpicture);
- XUnlockDisplay(display);
- XFree(priv_data);
- free(pI915Subpicture);
- subpicture->privData = NULL;
- PPTHREAD_MUTEX_UNLOCK();
- return BadAlloc;
- }
-
- tmpComm = (I915XvMCCreateSurfaceRec *) priv_data;
- pI915Subpicture->srfNo = tmpComm->srfno;
- pI915Subpicture->srf.handle = tmpComm->srf.handle;
- pI915Subpicture->srf.offset = tmpComm->srf.offset;
- pI915Subpicture->srf.size = tmpComm->srf.size;
- XFree(priv_data);
-
- if (drmMap(pI915XvMC->fd,
- pI915Subpicture->srf.handle,
- pI915Subpicture->srf.size,
- (drmAddress *) & pI915Subpicture->srf.map) != 0) {
- XLockDisplay(display);
- _xvmc_destroy_subpicture(display, subpicture);
- XUnlockDisplay(display);
- free(pI915Subpicture);
- subpicture->privData = NULL;
- PPTHREAD_MUTEX_UNLOCK();
- return BadAlloc;
- }
-
- /* subpicture */
- subpicture->num_palette_entries = I915_SUBPIC_PALETTE_SIZE;
- subpicture->entry_bytes = 3;
- strncpy(subpicture->component_order, "YUV", 4);
-
- /* Initialize private values */
- pI915Subpicture->privContext = pI915XvMC;
- pI915Subpicture->last_render = 0;
- pI915Subpicture->last_flip = 0;
- pI915Subpicture->pitch = ((subpicture->width + 3) & ~3);
-
- switch (subpicture->xvimage_id) {
- case FOURCC_IA44:
- case FOURCC_AI44:
- break;
-
- default:
- drmUnmap(pI915Subpicture->srf.map, pI915Subpicture->srf.size);
- XLockDisplay(display);
- _xvmc_destroy_subpicture(display, subpicture);
- XUnlockDisplay(display);
- free(pI915Subpicture);
- subpicture->privData = NULL;
- PPTHREAD_MUTEX_UNLOCK();
- return BadMatch;
- }
-
- pI915XvMC->ref++;
- PPTHREAD_MUTEX_UNLOCK();
- return Success;
-}
-
-Status i915_xvmc_clear_subpict(Display * display, XvMCSubpicture * subpicture,
- short x, short y,
- unsigned short width, unsigned short height,
- unsigned int color)
-{
- i915XvMCContext *pI915XvMC;
- i915XvMCSubpicture *pI915Subpicture;
-
- if (!display || !subpicture)
- return BadValue;
-
- if (!(pI915Subpicture = subpicture->privData))
- return XvMCBadSubpicture;
-
- if (!(pI915XvMC = pI915Subpicture->privContext))
- return XvMCBadSubpicture;
-
- if ((x < 0) || (x + width) > subpicture->width)
- return BadValue;
-
- if ((y < 0) || (y + height) > subpicture->height)
- return BadValue;
-
- /* FIXME: clear the area */
-
- return Success;
-}
-
-Status i915_xvmc_composite_subpict(Display * display,
- XvMCSubpicture * subpicture, XvImage * image,
- short srcx, short srcy, unsigned short width,
- unsigned short height, short dstx,
- short dsty)
-{
- i915XvMCContext *pI915XvMC;
- i915XvMCSubpicture *pI915Subpicture;
-
- if (!display || !subpicture)
- return BadValue;
-
- if (!(pI915Subpicture = subpicture->privData))
- return XvMCBadSubpicture;
-
- if (!(pI915XvMC = pI915Subpicture->privContext))
- return XvMCBadSubpicture;
-
- if ((srcx < 0) || (srcx + width) > subpicture->width)
- return BadValue;
-
- if ((srcy < 0) || (srcy + height) > subpicture->height)
- return BadValue;
-
- if ((dstx < 0) || (dstx + width) > subpicture->width)
- return BadValue;
-
- if ((dsty < 0) || (dsty + width) > subpicture->height)
- return BadValue;
-
- if (image->id != subpicture->xvimage_id)
- return BadMatch;
-
- /* FIXME */
- return Success;
-}
-
-Status i915_xvmc_destroy_subpict(Display * display, XvMCSubpicture * subpicture)
-{
- i915XvMCSubpicture *pI915Subpicture;
- i915XvMCContext *pI915XvMC;
-
- if (!display || !subpicture)
- return BadValue;
-
- if (!(pI915Subpicture = subpicture->privData))
- return XvMCBadSubpicture;
-
- if (!(pI915XvMC = pI915Subpicture->privContext))
- return XvMCBadSubpicture;
-
- if (pI915Subpicture->last_render)
- XvMCSyncSubpicture(display, subpicture);
-
- if (pI915Subpicture->srf.map)
- drmUnmap(pI915Subpicture->srf.map, pI915Subpicture->srf.size);
-
- PPTHREAD_MUTEX_LOCK();
- XLockDisplay(display);
- _xvmc_destroy_subpicture(display, subpicture);
- XUnlockDisplay(display);
-
- free(pI915Subpicture);
- subpicture->privData = NULL;
- pI915XvMC->ref--;
- PPTHREAD_MUTEX_UNLOCK();
-
- return Success;
-}
-
-Status i915_xvmc_set_subpict_palette(Display * display,
- XvMCSubpicture * subpicture,
- unsigned char *palette)
-{
- i915XvMCSubpicture *pI915Subpicture;
- int i, j;
-
- if (!display || !subpicture)
- return BadValue;
-
- if (!(pI915Subpicture = subpicture->privData))
- return XvMCBadSubpicture;
-
- j = 0;
- for (i = 0; i < 16; i++) {
- pI915Subpicture->palette[0][i] = palette[j++];
- pI915Subpicture->palette[1][i] = palette[j++];
- pI915Subpicture->palette[2][i] = palette[j++];
- }
-
- /* FIXME: Update the subpicture with the new palette */
- return Success;
-}
-
-Status i915_xvmc_blend_subpict(Display * display, XvMCSurface * target_surface,
- XvMCSubpicture * subpicture,
- short subx, short suby,
- unsigned short subw, unsigned short subh,
- short surfx, short surfy,
- unsigned short surfw, unsigned short surfh)
-{
- i915XvMCSubpicture *pI915Subpicture;
- i915XvMCSurface *privTargetSurface;
-
- if (!display || !target_surface)
- return BadValue;
-
- if (!(privTargetSurface = target_surface->privData))
- return XvMCBadSurface;
-
- if (subpicture) {
- if (!(pI915Subpicture = subpicture->privData))
- return XvMCBadSubpicture;
-
- if ((FOURCC_AI44 != subpicture->xvimage_id) &&
- (FOURCC_IA44 != subpicture->xvimage_id))
- return XvMCBadSubpicture;
-
- privTargetSurface->privSubPic = pI915Subpicture;
- } else {
- privTargetSurface->privSubPic = NULL;
- }
-
- return Success;
-}
-
-Status i915_xvmc_blend_subpict2(Display * display,
- XvMCSurface * source_surface,
- XvMCSurface * target_surface,
- XvMCSubpicture * subpicture,
- short subx, short suby,
- unsigned short subw, unsigned short subh,
- short surfx, short surfy,
- unsigned short surfw, unsigned short surfh)
-{
- i915XvMCContext *pI915XvMC;
- i915XvMCSubpicture *pI915Subpicture;
- i915XvMCSurface *privSourceSurface;
- i915XvMCSurface *privTargetSurface;
-
- if (!display || !source_surface || !target_surface)
- return BadValue;
-
- if (!(privSourceSurface = source_surface->privData))
- return XvMCBadSurface;
-
- if (!(privTargetSurface = target_surface->privData))
- return XvMCBadSurface;
-
- if (!(pI915XvMC = privTargetSurface->privContext))
- return XvMCBadSurface;
-
- if (((surfx + surfw) > privTargetSurface->width) ||
- ((surfy + surfh) > privTargetSurface->height))
- return BadValue;
-
- if ((privSourceSurface->width != privTargetSurface->width) ||
- (privTargetSurface->height != privTargetSurface->height))
- return BadValue;
-
- if (XvMCSyncSurface(display, source_surface))
- return BadValue;
-
- /* FIXME: update Target Surface */
-
- if (subpicture) {
- if (((subx + subw) > subpicture->width) ||
- ((suby + subh) > subpicture->height))
- return BadValue;
-
- if (!(pI915Subpicture = subpicture->privData))
- return XvMCBadSubpicture;
-
- if ((FOURCC_AI44 != subpicture->xvimage_id) &&
- (FOURCC_IA44 != subpicture->xvimage_id))
- return XvMCBadSubpicture;
-
- privTargetSurface->privSubPic = pI915Subpicture;
- } else {
- privTargetSurface->privSubPic = NULL;
- }
-
- return Success;
-}
-
-Status i915_xvmc_sync_subpict(Display * display, XvMCSubpicture * subpicture)
-{
- Status ret;
- int stat = 0;
-
- if (!display || !subpicture)
- return BadValue;
-
- do {
- ret = XvMCGetSubpictureStatus(display, subpicture, &stat);
- } while (!ret && (stat & XVMC_RENDERING));
-
- return ret;
-}
-
-Status i915_xvmc_flush_subpict(Display * display, XvMCSubpicture * subpicture)
-{
- i915XvMCSubpicture *pI915Subpicture;
-
- if (!display || !subpicture)
- return BadValue;
-
- if (!(pI915Subpicture = subpicture->privData))
- return XvMCBadSubpicture;
-
- return Success;
-}
-
-Status i915_xvmc_get_subpict_status(Display * display,
- XvMCSubpicture * subpicture, int *stat)
-{
- i915XvMCSubpicture *pI915Subpicture;
- i915XvMCContext *pI915XvMC;
-
- if (!display || !subpicture || stat)
- return BadValue;
-
- *stat = 0;
-
- if (!(pI915Subpicture = subpicture->privData))
- return XvMCBadSubpicture;
-
- if (!(pI915XvMC = pI915Subpicture->privContext))
- return XvMCBadSubpicture;
-
- PPTHREAD_MUTEX_LOCK();
-
- PPTHREAD_MUTEX_UNLOCK();
- return Success;
-}
-
-#endif
-
struct _intel_xvmc_driver i915_xvmc_mc_driver = {
.type = XVMC_I915_MPEG2_MC,
.num_ctx = 0,
.ctx_list = NULL,
.create_context = i915_xvmc_mc_create_context,
.destroy_context = i915_xvmc_mc_destroy_context,
- .create_surface = i915_xvmc_mc_create_surface,
- .destroy_surface = i915_xvmc_mc_destroy_surface,
.render_surface = i915_xvmc_mc_render_surface,
- .put_surface = i915_xvmc_mc_put_surface,
- .get_surface_status = i915_xvmc_mc_get_surface_status,
};
diff --git a/driver/xf86-video-intel/src/xvmc/i915_xvmc.h b/driver/xf86-video-intel/src/xvmc/i915_xvmc.h
index f0e8d3e47..96dd3ce8c 100644
--- a/driver/xf86-video-intel/src/xvmc/i915_xvmc.h
+++ b/driver/xf86-video-intel/src/xvmc/i915_xvmc.h
@@ -29,7 +29,7 @@
#define _I915XVMC_H
#include "intel_xvmc.h"
-#include "i915_hwmc.h"
+#include "i830_hwmc.h"
#define I915_SUBPIC_PALETTE_SIZE 16
#define MAX_SUBCONTEXT_LEN 1024
@@ -43,35 +43,24 @@
#define PCI_CHIP_Q35_G 0x29B2
#define PCI_CHIP_Q33_G 0x29D2
+#define CORRDATA_SIZE 128*GTT_PAGE_SIZE
/*
* i915XvMCContext:
* Private Context data referenced via the privData
* pointer in the XvMCContext structure.
*/
typedef struct _i915XvMCContext {
- unsigned int ctxno;
- unsigned int last_flip;
- unsigned int dual_prime; /* Flag to identify when dual prime is in use. */
+ struct intel_xvmc_context comm;
unsigned int yStride;
unsigned int uvStride;
- unsigned short ref;
- unsigned int depth;
- XvPortID port; /* Xv Port ID when displaying */
- int haveXv; /* Have I initialized the Xv
- * connection for this surface? */
- XvImage *xvImage; /* Fake Xv Image used for command
- * buffer transport to the X server */
- GC gc; /* X GC needed for displaying */
- Drawable draw; /* Drawable to undisplay from */
- void *drawHash;
- int deviceID;
+ unsigned int use_phys_addr;
- intel_xvmc_drm_map_t sis;
- intel_xvmc_drm_map_t msb;
- intel_xvmc_drm_map_t ssb;
- intel_xvmc_drm_map_t psp;
- intel_xvmc_drm_map_t psc;
- intel_xvmc_drm_map_t corrdata;
+ drm_intel_bo *sis_bo;
+ drm_intel_bo *msb_bo;
+ drm_intel_bo *ssb_bo;
+ drm_intel_bo *psp_bo;
+ drm_intel_bo *psc_bo;
+ drm_intel_bo *corrdata_bo;
} i915XvMCContext;
/*
@@ -82,8 +71,6 @@ typedef struct _i915XvMCContext {
*/
typedef struct _i915XvMCSubpicture {
unsigned int srfNo;
- unsigned int last_render;
- unsigned int last_flip;
unsigned int pitch;
unsigned char palette[3][16];
intel_xvmc_drm_map_t srf;
@@ -93,23 +80,4 @@ typedef struct _i915XvMCSubpicture {
/* Number of YUV buffers per surface */
#define I830_MAX_BUFS 2
-/*
- * i915XvMCSurface: Private data structure for each XvMCSurface. This
- * structure is referenced by the privData pointer in the XvMCSurface
- * structure.
- */
-typedef struct _i915XvMCSurface {
- unsigned int srfNo; /* XvMC private surface numbers */
- unsigned int last_render;
- unsigned int last_flip;
- unsigned int yStride; /* Stride of YUV420 Y component. */
- unsigned int uvStride;
- unsigned int width; /* Dimensions */
- unsigned int height;
- intel_xvmc_drm_map_t srf;
- i915XvMCContext *privContext;
- i915XvMCSubpicture *privSubPic; /* Subpicture to be blended when
- * displaying. NULL if none. */
-} i915XvMCSurface;
-
#endif /* _I915XVMC_H */
diff --git a/driver/xf86-video-intel/src/xvmc/i965_xvmc.c b/driver/xf86-video-intel/src/xvmc/i965_xvmc.c
index ff67995fa..1665f6d00 100644
--- a/driver/xf86-video-intel/src/xvmc/i965_xvmc.c
+++ b/driver/xf86-video-intel/src/xvmc/i965_xvmc.c
@@ -24,12 +24,12 @@
* Zou Nan hai <nanhai.zou@intel.com>
*
*/
-#include "i965_xvmc.h"
+#include "intel_xvmc.h"
#include "i810_reg.h"
#include "brw_defines.h"
#include "brw_structs.h"
#include "intel_batchbuffer.h"
-#include "i965_hwmc.h"
+#include "i830_hwmc.h"
#define BATCH_STRUCT(x) intelBatchbufferData(&x, sizeof(x), 0)
#define URB_SIZE 256 /* XXX */
@@ -241,39 +241,16 @@ out:
static Status destroy_context(Display * display, XvMCContext * context)
{
- struct i965_xvmc_context *private_context;
- private_context = context->privData;
-
- free_object(&media_state);
- Xfree(private_context);
+ struct intel_xvmc_context *intel_ctx;
+ intel_ctx = context->privData;
+ Xfree(intel_ctx->hw);
+ free(intel_ctx);
return Success;
}
#define STRIDE(w) (w)
#define SIZE_YUV420(w, h) (h * (STRIDE(w) + STRIDE(w >> 1)))
-static Status create_surface(Display * display,
- XvMCContext * context, XvMCSurface * surface,
- int priv_count, CARD32 * priv_data)
-{
- struct i965_xvmc_surface *priv_surface =
- (struct i965_xvmc_surface *)priv_data;
- size_t size = SIZE_YUV420(priv_surface->w, priv_surface->h);
- surface->privData = priv_data;
- priv_surface->bo = drm_intel_bo_alloc(xvmc_driver->bufmgr, "surface",
- size, 0x1000);
- return Success;
-}
-
-static Status destroy_surface(Display * display, XvMCSurface * surface)
-{
- struct i965_xvmc_surface *priv_surface = surface->privData;
- XSync(display, False);
-
- drm_intel_bo_unreference(priv_surface->bo);
- return Success;
-}
-
static void flush()
{
struct brw_mi_flush flush;
@@ -716,14 +693,14 @@ static Status render_surface(Display * display,
int i, j;
struct i965_xvmc_context *i965_ctx;
XvMCMacroBlock *mb;
- struct i965_xvmc_surface *priv_target_surface =
+ struct intel_xvmc_surface *priv_target_surface =
target_surface->privData;
- struct i965_xvmc_surface *priv_past_surface =
+ struct intel_xvmc_surface *priv_past_surface =
past_surface ? past_surface->privData : 0;
- struct i965_xvmc_surface *priv_future_surface =
+ struct intel_xvmc_surface *priv_future_surface =
future_surface ? future_surface->privData : 0;
unsigned short *block_ptr;
- intel_ctx = intel_xvmc_find_context(context->context_id);
+ intel_ctx = context->privData;
i965_ctx = context->privData;
if (!intel_ctx) {
XVMC_ERR("Can't find intel xvmc context\n");
@@ -731,11 +708,8 @@ static Status render_surface(Display * display,
}
if (media_state.indirect_data.bo) {
- if (xvmc_driver->kernel_exec_fencing)
- drm_intel_gem_bo_unmap_gtt(media_state.
- indirect_data.bo);
- else
- drm_intel_bo_unmap(media_state.indirect_data.bo);
+ drm_intel_gem_bo_unmap_gtt(media_state.
+ indirect_data.bo);
drm_intel_bo_unreference(media_state.indirect_data.bo);
}
@@ -755,10 +729,7 @@ static Status render_surface(Display * display,
interface_descriptor(&media_state);
vfe_state(&media_state);
- if (xvmc_driver->kernel_exec_fencing)
- drm_intel_gem_bo_map_gtt(media_state.indirect_data.bo);
- else
- drm_intel_bo_map(media_state.indirect_data.bo, 1);
+ drm_intel_gem_bo_map_gtt(media_state.indirect_data.bo);
block_ptr = media_state.indirect_data.bo->virtual;
for (i = first_macroblock; i < num_macroblocks + first_macroblock; i++) {
@@ -877,38 +848,23 @@ static Status render_surface(Display * display,
return Success;
}
-static Status put_surface(Display * display, XvMCSurface * surface,
- Drawable draw, short srcx, short srcy,
- unsigned short srcw, unsigned short srch,
- short destx, short desty,
- unsigned short destw, unsigned short desth,
- int flags, struct intel_xvmc_command *data)
-{
- struct i965_xvmc_surface *private_surface = surface->privData;
- uint32_t handle = 0;
-
- drm_intel_bo_flink(private_surface->bo, &handle);
- data->handle = handle;
-
- return Success;
-}
-
-static Status get_surface_status(Display * display,
- XvMCSurface * surface, int *stats)
-{
- *stats = 0;
- return 0;
-}
-
static Status create_context(Display * display, XvMCContext * context,
int priv_count, CARD32 * priv_data)
{
- struct i965_xvmc_context *i965_ctx;
- i965_ctx = (struct i965_xvmc_context *)priv_data;
- context->privData = i965_ctx;
+ struct intel_xvmc_context *intel_ctx;
+ struct intel_xvmc_hw_context *hw_ctx;
+ hw_ctx = (struct intel_xvmc_hw_context *)priv_data;
+
+ intel_ctx = calloc(1, sizeof(struct intel_xvmc_context));
+ if (!intel_ctx)
+ return BadAlloc;
+ intel_ctx->hw = hw_ctx;
+ intel_ctx->surface_bo_size
+ = SIZE_YUV420(context->width, context->height);
+ context->privData = intel_ctx;
- media_state.is_g4x = i965_ctx->is_g4x;
- media_state.is_965_q = i965_ctx->is_965_q;
+ media_state.is_g4x = hw_ctx->i965.is_g4x;
+ media_state.is_965_q = hw_ctx->i965.is_965_q;
if (alloc_object(&media_state))
return BadAlloc;
@@ -921,9 +877,5 @@ struct _intel_xvmc_driver i965_xvmc_mc_driver = {
.type = XVMC_I965_MPEG2_MC,
.create_context = create_context,
.destroy_context = destroy_context,
- .create_surface = create_surface,
- .destroy_surface = destroy_surface,
.render_surface = render_surface,
- .put_surface = put_surface,
- .get_surface_status = get_surface_status,
};
diff --git a/driver/xf86-video-intel/src/xvmc/i965_xvmc.h b/driver/xf86-video-intel/src/xvmc/i965_xvmc.h
deleted file mode 100644
index ed201c897..000000000
--- a/driver/xf86-video-intel/src/xvmc/i965_xvmc.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "intel_xvmc.h"
diff --git a/driver/xf86-video-intel/src/xvmc/intel_batchbuffer.c b/driver/xf86-video-intel/src/xvmc/intel_batchbuffer.c
index ebaac7a46..873cd4ac7 100644
--- a/driver/xf86-video-intel/src/xvmc/intel_batchbuffer.c
+++ b/driver/xf86-video-intel/src/xvmc/intel_batchbuffer.c
@@ -108,10 +108,7 @@ Bool intelInitBatchBuffer(void)
return False;
}
- if (xvmc_driver->kernel_exec_fencing)
- drm_intel_gem_bo_map_gtt(xvmc_driver->batch.buf);
- else
- drm_intel_bo_map(xvmc_driver->batch.buf, 1);
+ drm_intel_gem_bo_map_gtt(xvmc_driver->batch.buf);
xvmc_driver->batch.init_ptr = xvmc_driver->batch.buf->virtual;
xvmc_driver->batch.size = BATCH_SIZE;
@@ -122,10 +119,7 @@ Bool intelInitBatchBuffer(void)
void intelFiniBatchBuffer(void)
{
- if (xvmc_driver->kernel_exec_fencing)
- drm_intel_gem_bo_unmap_gtt(xvmc_driver->batch.buf);
- else
- drm_intel_bo_unmap(xvmc_driver->batch.buf);
+ drm_intel_gem_bo_unmap_gtt(xvmc_driver->batch.buf);
drm_intel_bo_unreference(xvmc_driver->batch.buf);
}
@@ -134,18 +128,12 @@ void intelFlushBatch(Bool refill)
{
i965_end_batch();
- if (xvmc_driver->kernel_exec_fencing)
- drm_intel_gem_bo_unmap_gtt(xvmc_driver->batch.buf);
- else
- drm_intel_bo_unmap(xvmc_driver->batch.buf);
+ drm_intel_gem_bo_unmap_gtt(xvmc_driver->batch.buf);
drm_intel_bo_exec(xvmc_driver->batch.buf,
xvmc_driver->batch.ptr - xvmc_driver->batch.init_ptr,
0, 0, 0);
- if (xvmc_driver == &i915_xvmc_mc_driver)
- dri_bo_wait_rendering(xvmc_driver->batch.buf);
-
drm_intel_bo_unreference(xvmc_driver->batch.buf);
if ((xvmc_driver->batch.buf =
drm_intel_bo_alloc(xvmc_driver->bufmgr,
@@ -153,10 +141,7 @@ void intelFlushBatch(Bool refill)
fprintf(stderr, "unable to alloc batch buffer\n");
}
- if (xvmc_driver->kernel_exec_fencing)
- drm_intel_gem_bo_map_gtt(xvmc_driver->batch.buf);
- else
- drm_intel_bo_map(xvmc_driver->batch.buf, 1);
+ drm_intel_gem_bo_map_gtt(xvmc_driver->batch.buf);
xvmc_driver->batch.init_ptr = xvmc_driver->batch.buf->virtual;
xvmc_driver->batch.size = BATCH_SIZE;
diff --git a/driver/xf86-video-intel/src/xvmc/intel_xvmc.c b/driver/xf86-video-intel/src/xvmc/intel_xvmc.c
index 947f97d4e..6cbec8076 100644
--- a/driver/xf86-video-intel/src/xvmc/intel_xvmc.c
+++ b/driver/xf86-video-intel/src/xvmc/intel_xvmc.c
@@ -25,7 +25,11 @@
*
*/
#include "intel_xvmc.h"
-#include "dri2.h"
+#include <xcb/xcb.h>
+#include <xcb/xcb_aux.h>
+#include <xcb/dri2.h>
+#include <X11/Xlib-xcb.h>
+#include <X11/extensions/dri2tokens.h>
/* global */
struct _intel_xvmc_driver *xvmc_driver = NULL;
@@ -99,14 +103,6 @@ unsigned int mb_bytes_420[] = {
768 /* 111111 */
};
-int DEBUG;
-
-static void intel_xvmc_debug_init(void)
-{
- if (getenv("INTEL_XVMC_DEBUG"))
- DEBUG = 1;
-}
-
void LOCK_HARDWARE(drm_context_t ctx)
{
char __ret = 0;
@@ -124,115 +120,75 @@ void UNLOCK_HARDWARE(drm_context_t ctx)
PPTHREAD_MUTEX_UNLOCK();
}
-static intel_xvmc_context_ptr intel_xvmc_new_context(Display * dpy)
+static int
+dri2_connect(Display *display)
{
- intel_xvmc_context_ptr ret;
-
- ret = (intel_xvmc_context_ptr) calloc(1, sizeof(intel_xvmc_context_t));
- if (!ret)
- return NULL;
-
- if (!xvmc_driver->ctx_list)
- ret->next = NULL;
- else
- ret->next = xvmc_driver->ctx_list;
- xvmc_driver->ctx_list = ret;
- xvmc_driver->num_ctx++;
+ xcb_dri2_query_version_cookie_t query_version_cookie;
+ xcb_dri2_query_version_reply_t *query_version_reply;
+ xcb_dri2_connect_cookie_t connect_cookie;
+ xcb_dri2_connect_reply_t *connect_reply;
+ xcb_dri2_authenticate_cookie_t auth_cookie;
+ xcb_dri2_authenticate_reply_t *auth_reply;
+ xcb_screen_t *root;
+ xcb_connection_t *c = XGetXCBConnection(display);
+ drm_magic_t magic;
+ const xcb_query_extension_reply_t *dri2_reply;
+ char *device_name;
+ int len;
- return ret;
+ root = xcb_aux_get_screen(c, DefaultScreen(display));
-}
+ dri2_reply = xcb_get_extension_data(c, &xcb_dri2_id);
-static void intel_xvmc_free_context(XID id)
-{
- intel_xvmc_context_ptr p = xvmc_driver->ctx_list;
- intel_xvmc_context_ptr pre = p;
-
- while (p) {
- if (p->context && p->context->context_id == id) {
- if (p == xvmc_driver->ctx_list)
- xvmc_driver->ctx_list = p->next;
- else
- pre->next = p->next;
- break;
- }
- pre = p;
- p = p->next;
+ if (!dri2_reply) {
+ XVMC_ERR("DRI2 required");
+ return BadValue;
}
- if (p) {
- free(p);
- xvmc_driver->num_ctx--;
- }
-}
+ /* Query the extension and make our first use of it at the same time. */
+ query_version_cookie = xcb_dri2_query_version(c, 1, 0);
+ connect_cookie = xcb_dri2_connect(c, root->root, DRI2DriverDRI);
-intel_xvmc_context_ptr intel_xvmc_find_context(XID id)
-{
- intel_xvmc_context_ptr p = xvmc_driver->ctx_list;
+ query_version_reply =
+ xcb_dri2_query_version_reply(c, query_version_cookie, NULL);
+ connect_reply = xcb_dri2_connect_reply(c, connect_cookie, NULL);
- while (p) {
- if (p->context && p->context->context_id == id)
- return p;
- p = p->next;
+ if (!query_version_reply) {
+ XVMC_ERR("DRI2 required");
+ return BadValue;
}
- return NULL;
-}
-
-static intel_xvmc_surface_ptr intel_xvmc_new_surface(Display * dpy)
-{
- intel_xvmc_surface_ptr ret;
-
- ret = (intel_xvmc_surface_ptr) calloc(1, sizeof(intel_xvmc_surface_t));
- if (!ret)
- return NULL;
-
- if (!xvmc_driver->surf_list)
- ret->next = NULL;
- else
- ret->next = xvmc_driver->surf_list;
- xvmc_driver->surf_list = ret;
- xvmc_driver->num_surf++;
-
- ret->image = NULL;
- ret->gc_init = FALSE;
-
- return ret;
-
-}
+ free(query_version_reply);
-static void intel_xvmc_free_surface(XID id)
-{
- intel_xvmc_surface_ptr p = xvmc_driver->surf_list;
- intel_xvmc_surface_ptr pre = p;
-
- while (p) {
- if (p->surface && p->surface->surface_id == id) {
- if (p == xvmc_driver->surf_list)
- xvmc_driver->surf_list = p->next;
- else
- pre->next = p->next;
- break;
- }
- pre = p;
- p = p->next;
+ len = xcb_dri2_connect_device_name_length(connect_reply);
+ device_name = malloc(len + 1);
+ if (!device_name) {
+ XVMC_ERR("malloc failure");
+ return BadAlloc;
}
-
- if (p) {
- free(p);
- xvmc_driver->num_surf--;
+ strncpy(device_name, xcb_dri2_connect_device_name(connect_reply), len);
+ device_name[len] = 0;
+ xvmc_driver->fd = open(device_name, O_RDWR);
+ free(device_name);
+ free(connect_reply);
+ if (xvmc_driver->fd < 0) {
+ XVMC_ERR("Failed to open drm device: %s\n", strerror(errno));
+ return BadValue;
}
-}
-intel_xvmc_surface_ptr intel_xvmc_find_surface(XID id)
-{
- intel_xvmc_surface_ptr p = xvmc_driver->surf_list;
+ if (drmGetMagic(xvmc_driver->fd, &magic)) {
+ XVMC_ERR("Failed to get magic\n");
+ return BadValue;
+ }
- while (p) {
- if (p->surface && p->surface->surface_id == id)
- return p;
- p = p->next;
+ auth_cookie = xcb_dri2_authenticate(c, root->root, magic);
+ auth_reply = xcb_dri2_authenticate_reply(c, auth_cookie, NULL);
+ if (!auth_reply) {
+ XVMC_ERR("Failed to authenticate magic %d\n", magic);
+ return BadValue;
}
- return NULL;
+ free(auth_reply);
+
+ return Success;
}
/*
@@ -257,8 +213,7 @@ _X_EXPORT Status XvMCCreateContext(Display * display, XvPortID port,
{
Status ret;
CARD32 *priv_data = NULL;
- struct _intel_xvmc_common *comm;
- drm_magic_t magic;
+ struct intel_xvmc_hw_context *comm;
int major, minor;
int error_base;
int event_base;
@@ -278,8 +233,6 @@ _X_EXPORT Status XvMCCreateContext(Display * display, XvPortID port,
return BadValue;
}
- intel_xvmc_debug_init();
-
/*
Width, Height, and flags are checked against surface_type_id
and port for validity inside the X server, no need to check
@@ -295,6 +248,7 @@ _X_EXPORT Status XvMCCreateContext(Display * display, XvPortID port,
XVMC_ERR("XvMCExtension is not available!");
return BadValue;
}
+
ret = XvMCQueryVersion(display, &major, &minor);
if (ret) {
XVMC_ERR
@@ -315,9 +269,8 @@ _X_EXPORT Status XvMCCreateContext(Display * display, XvPortID port,
XVMC_ERR("Unable to create XvMC Context.");
return ret;
}
- XVMC_DBG("new context %d created\n", (int)context->context_id);
- comm = (struct _intel_xvmc_common *)priv_data;
+ comm = (struct intel_xvmc_hw_context *)priv_data;
if (xvmc_driver == NULL || xvmc_driver->type != comm->type) {
switch (comm->type) {
@@ -346,70 +299,16 @@ _X_EXPORT Status XvMCCreateContext(Display * display, XvPortID port,
XVMC_INFO("decoder type is %s", intel_xvmc_decoder_string(comm->type));
- xvmc_driver->kernel_exec_fencing = comm->kernel_exec_fencing;
-
- /* assign local ctx info */
- intel_ctx = intel_xvmc_new_context(display);
- if (!intel_ctx) {
- XVMC_ERR("Intel XvMC context create fail\n");
- return BadAlloc;
- }
- intel_ctx->context = context;
-
/* check DRI2 */
ret = Success;
xvmc_driver->fd = -1;
- do {
- if (!DRI2QueryExtension(display, &event_base, &error_base)) {
- ret = BadValue;
- break;
- }
-
- if (!DRI2QueryVersion(display, &major, &minor)) {
- ret = BadValue;
- break;
- }
-
- if (!DRI2Connect(display, RootWindow(display, screen),
- &driverName, &deviceName)) {
- ret = BadValue;
- break;
- }
-
- xvmc_driver->fd = open(deviceName, O_RDWR);
-
- if (xvmc_driver->fd < 0) {
- XVMC_ERR("Failed to open drm device: %s\n",
- strerror(errno));
- ret = BadValue;
- break;
- }
-
- if (drmGetMagic(xvmc_driver->fd, &magic)) {
- XVMC_ERR("Failed to get magic\n");
- ret = BadValue;
- break;
- }
-
- if (!DRI2Authenticate
- (display, RootWindow(display, screen), magic)) {
- XVMC_ERR("Failed to authenticate magic %d\n", magic);
- ret = BadValue;
- break;
- }
- } while (0);
-
- XFree(driverName);
- XFree(deviceName);
-
+ ret = dri2_connect(display);
if (ret != Success) {
XFree(priv_data);
context->privData = NULL;
-
if (xvmc_driver->fd >= 0)
close(xvmc_driver->fd);
-
xvmc_driver = NULL;
return ret;
}
@@ -468,8 +367,6 @@ _X_EXPORT Status XvMCDestroyContext(Display * display, XvMCContext * context)
dri_bufmgr_destroy(xvmc_driver->bufmgr);
- intel_xvmc_free_context(context->context_id);
-
ret = _xvmc_destroy_context(display, context);
if (ret != Success) {
XVMC_ERR("_xvmc_destroy_context fail\n");
@@ -498,6 +395,7 @@ _X_EXPORT Status XvMCCreateSurface(Display * display, XvMCContext * context,
int priv_count;
CARD32 *priv_data;
intel_xvmc_surface_ptr intel_surf = NULL;
+ struct intel_xvmc_context *intel_ctx;
if (!display || !context)
return XvMCBadContext;
@@ -505,10 +403,7 @@ _X_EXPORT Status XvMCCreateSurface(Display * display, XvMCContext * context,
if (!surface)
return XvMCBadSurface;
- intel_surf = intel_xvmc_new_surface(display);
- if (!intel_surf)
- return BadAlloc;
- intel_surf->surface = surface;
+ intel_ctx = context->privData;
if ((ret = _xvmc_create_surface(display, context, surface,
&priv_count, &priv_data))) {
@@ -516,25 +411,39 @@ _X_EXPORT Status XvMCCreateSurface(Display * display, XvMCContext * context,
return ret;
}
+ XFree(priv_data);
+
+ surface->privData = calloc(1, sizeof(struct intel_xvmc_surface));
+
+ if (!(intel_surf = surface->privData)) {
+ PPTHREAD_MUTEX_UNLOCK();
+ return BadAlloc;
+ }
+
+ intel_surf->bo = drm_intel_bo_alloc(xvmc_driver->bufmgr,
+ "surface",
+ intel_ctx->surface_bo_size,
+ GTT_PAGE_SIZE);
+ if (!intel_surf->bo) {
+ free(intel_surf);
+ return BadAlloc;
+ }
+
+ drm_intel_bo_disable_reuse(intel_surf->bo);
+
+ intel_surf = surface->privData;
+ intel_surf->context = context;
+
intel_surf->image = XvCreateImage(display, context->port,
FOURCC_XVMC,
- (char *)&intel_surf->data,
+ (char *) &intel_surf->gem_handle,
surface->width, surface->height);
if (!intel_surf->image) {
XVMC_ERR("Can't create XvImage for surface\n");
+ free(intel_surf);
_xvmc_destroy_surface(display, surface);
- intel_xvmc_free_surface(surface->surface_id);
return BadAlloc;
}
- intel_surf->image->data = (char *)&intel_surf->data;
-
- ret =
- (xvmc_driver->create_surface) (display, context, surface,
- priv_count, priv_data);
- if (ret) {
- XVMC_ERR("create surface failed\n");
- return ret;
- }
return Success;
}
@@ -549,16 +458,17 @@ _X_EXPORT Status XvMCDestroySurface(Display * display, XvMCSurface * surface)
if (!display || !surface)
return XvMCBadSurface;
- intel_surf = intel_xvmc_find_surface(surface->surface_id);
+ intel_surf = surface->privData;
if (!intel_surf)
return XvMCBadSurface;
XFree(intel_surf->image);
if (intel_surf->gc_init)
XFreeGC(display, intel_surf->gc);
- intel_xvmc_free_surface(surface->surface_id);
- (xvmc_driver->destroy_surface) (display, surface);
+ drm_intel_bo_unreference(intel_surf->bo);
+
+ free(intel_surf);
_xvmc_destroy_surface(display, surface);
@@ -733,17 +643,15 @@ _X_EXPORT Status XvMCPutSurface(Display * display, XvMCSurface * surface,
{
Status ret = Success;
XvMCContext *context;
- intel_xvmc_context_ptr intel_ctx;
intel_xvmc_surface_ptr intel_surf;
if (!display || !surface)
return XvMCBadSurface;
- intel_ctx = intel_xvmc_find_context(surface->context_id);
- intel_surf = intel_xvmc_find_surface(surface->surface_id);
- if (!intel_ctx || !intel_surf)
+ intel_surf = surface->privData;
+ context = intel_surf->context;
+ if (!context || !intel_surf)
return XvMCBadSurface;
- context = intel_ctx->context;
if (intel_surf->gc_init == FALSE) {
intel_surf->gc = XCreateGC(display, draw, 0, NULL);
@@ -753,14 +661,9 @@ _X_EXPORT Status XvMCPutSurface(Display * display, XvMCSurface * surface,
intel_surf->gc = XCreateGC(display, draw, 0, NULL);
}
intel_surf->last_draw = draw;
- /* fill intel_surf->data */
- ret = (xvmc_driver->put_surface) (display, surface, draw, srcx, srcy,
- srcw, srch, destx, desty, destw,
- desth, flags, &intel_surf->data);
- if (ret) {
- XVMC_ERR("put surface fail\n");
- return ret;
- }
+
+ drm_intel_bo_flink(intel_surf->bo, &intel_surf->gem_handle);
+
ret = XvPutImage(display, context->port, draw, intel_surf->gc,
intel_surf->image, srcx, srcy, srcw, srch, destx,
desty, destw, desth);
@@ -781,10 +684,6 @@ _X_EXPORT Status XvMCSyncSurface(Display * display, XvMCSurface * surface)
if (!display || !surface)
return XvMCBadSurface;
- do {
- ret = XvMCGetSurfaceStatus(display, surface, &stat);
- } while (!ret && (stat & XVMC_RENDERING));
-
return ret;
}
@@ -802,6 +701,7 @@ _X_EXPORT Status XvMCFlushSurface(Display * display, XvMCSurface * surface)
{
if (!display || !surface)
return XvMCBadSurface;
+
return Success;
}
@@ -820,16 +720,10 @@ _X_EXPORT Status XvMCFlushSurface(Display * display, XvMCSurface * surface)
_X_EXPORT Status XvMCGetSurfaceStatus(Display * display, XvMCSurface * surface,
int *stat)
{
- Status ret;
-
if (!display || !surface || !stat)
return XvMCBadSurface;
- ret = (xvmc_driver->get_surface_status) (display, surface, stat);
- if (ret) {
- XVMC_ERR("get surface status fail\n");
- return ret;
- }
+ *stat = 0;
return Success;
}
@@ -851,21 +745,7 @@ _X_EXPORT Status XvMCHideSurface(Display * display, XvMCSurface * surface)
if (!display || !surface)
return XvMCBadSurface;
- XvMCSyncSurface(display, surface);
-
- /*
- Get the status of the surface, if it is not currently displayed
- we don't need to worry about it.
- */
- if ((ret = XvMCGetSurfaceStatus(display, surface, &stat)) != Success)
- return ret;
-
- if (!(stat & XVMC_DISPLAYING))
- return Success;
-
- /* FIXME: */
- XVMC_ERR("XvMCHideSurface not implemented!\n");
- return BadValue;
+ return Success;
}
/*
diff --git a/driver/xf86-video-intel/src/xvmc/intel_xvmc.h b/driver/xf86-video-intel/src/xvmc/intel_xvmc.h
index 67c7b3803..90b623594 100644
--- a/driver/xf86-video-intel/src/xvmc/intel_xvmc.h
+++ b/driver/xf86-video-intel/src/xvmc/intel_xvmc.h
@@ -58,7 +58,7 @@
#include "intel_batchbuffer.h"
-extern int DEBUG;
+#define GTT_PAGE_SIZE 4*1024
#define XVMC_ERR(s, arg...) \
do { \
@@ -70,12 +70,6 @@ extern int DEBUG;
fprintf(stderr, "[intel_xvmc] info: " s "\n", ##arg); \
} while (0)
-#define XVMC_DBG(s, arg...) \
- do { \
- if (DEBUG) \
- fprintf(stderr, "[intel_xvmc] debug: " s "\n", ##arg); \
- } while (0)
-
/* Subpicture fourcc */
#define FOURCC_IA44 0x34344149
@@ -101,21 +95,23 @@ extern Status _xvmc_create_subpicture(Display * dpy, XvMCContext * context,
extern Status _xvmc_destroy_subpicture(Display * dpy,
XvMCSubpicture * subpicture);
-typedef struct _intel_xvmc_context {
- XvMCContext *context;
+struct intel_xvmc_context {
+ struct intel_xvmc_hw_context *hw;
+ uint32_t surface_bo_size;
drm_context_t hw_context; /* context id to kernel drm */
- struct _intel_xvmc_context *next;
-} intel_xvmc_context_t, *intel_xvmc_context_ptr;
+};
+typedef struct intel_xvmc_context *intel_xvmc_context_ptr;
-typedef struct _intel_xvmc_surface {
- XvMCSurface *surface;
+struct intel_xvmc_surface {
+ XvMCContext *context;
XvImage *image;
GC gc;
Bool gc_init;
Drawable last_draw;
- struct intel_xvmc_command data;
- struct _intel_xvmc_surface *next;
-} intel_xvmc_surface_t, *intel_xvmc_surface_ptr;
+ drm_intel_bo *bo;
+ uint32_t gem_handle;
+};
+typedef struct intel_xvmc_surface *intel_xvmc_surface_ptr;
typedef struct _intel_xvmc_drm_map {
drm_handle_t handle;
@@ -132,7 +128,6 @@ typedef struct _intel_xvmc_driver {
int fd; /* drm file handler */
dri_bufmgr *bufmgr;
- unsigned int kernel_exec_fencing:1;
struct {
unsigned int init_offset;
@@ -151,7 +146,6 @@ typedef struct _intel_xvmc_driver {
unsigned int irq_emitted;
} alloc;
intel_xvmc_drm_map_t batchbuffer;
- unsigned int last_render;
sigset_t sa_mask;
pthread_mutex_t ctxmutex;
@@ -160,7 +154,7 @@ typedef struct _intel_xvmc_driver {
int num_ctx;
intel_xvmc_context_ptr ctx_list;
int num_surf;
- intel_xvmc_surface_ptr surf_list;
+ struct intel_xvmc_surface * surf_list;
void *private;
@@ -170,12 +164,6 @@ typedef struct _intel_xvmc_driver {
Status(*destroy_context) (Display * display, XvMCContext * context);
- Status(*create_surface) (Display * display, XvMCContext * context,
- XvMCSurface * surface, int priv_count,
- CARD32 * priv_data);
-
- Status(*destroy_surface) (Display * display, XvMCSurface * surface);
-
Status(*render_surface) (Display * display, XvMCContext * context,
unsigned int picture_structure,
XvMCSurface * target_surface,
@@ -187,16 +175,6 @@ typedef struct _intel_xvmc_driver {
XvMCMacroBlockArray * macroblock_array,
XvMCBlockArray * blocks);
- Status(*put_surface) (Display * display, XvMCSurface * surface,
- Drawable draw, short srcx, short srcy,
- unsigned short srcw, unsigned short srch,
- short destx, short desty,
- unsigned short destw, unsigned short desth,
- int flags, struct intel_xvmc_command * data);
-
- Status(*get_surface_status) (Display * display, XvMCSurface * surface,
- int *stat);
-
Status(*begin_surface) (Display * display, XvMCContext * context,
XvMCSurface * target_surface,
XvMCSurface * past_surface,
@@ -260,9 +238,6 @@ static inline const char *intel_xvmc_decoder_string(int flag)
}
}
-extern intel_xvmc_context_ptr intel_xvmc_find_context(XID id);
-extern intel_xvmc_surface_ptr intel_xvmc_find_surface(XID id);
-
extern unsigned int mb_bytes_420[64];
/* dump function */
diff --git a/driver/xf86-video-intel/src/xvmc/intel_xvmc_dump.c b/driver/xf86-video-intel/src/xvmc/intel_xvmc_dump.c
index 015d4828c..974bcbb0a 100644
--- a/driver/xf86-video-intel/src/xvmc/intel_xvmc_dump.c
+++ b/driver/xf86-video-intel/src/xvmc/intel_xvmc_dump.c
@@ -74,8 +74,8 @@ void intel_xvmc_dump_render(XvMCContext * context,
fprintf(fp, "========== new surface rendering ==========\n");
fprintf(fp,
"Context (id:%d) (surface_type_id:%d) (width:%d) (height:%d)\n",
- context->context_id, context->surface_type_id, context->width,
- context->height);
+ (int)context->context_id, context->surface_type_id,
+ context->width, context->height);
if (picture_structure == XVMC_FRAME_PICTURE)
fprintf(fp, "picture structure: frame picture\n");
@@ -96,13 +96,13 @@ void intel_xvmc_dump_render(XvMCContext * context,
fprintf(fp, "picture type: Bad!\n");
fprintf(fp, "target picture: id (%d) width (%d) height (%d)\n",
- target->surface_id, target->width, target->height);
+ (int)target->surface_id, target->width, target->height);
if (past)
fprintf(fp, "past picture: id (%d) width (%d) height (%d)\n",
- past->surface_id, past->width, past->height);
+ (int)past->surface_id, past->width, past->height);
if (future)
fprintf(fp, "future picture: id (%d) width (%d) height (%d)\n",
- future->surface_id, future->width, future->height);
+ (int)future->surface_id, future->width, future->height);
fprintf(fp, "num macroblocks: %d, first macroblocks %d\n",
num_macroblocks, first_macroblock);
diff --git a/driver/xf86-video-intel/src/xvmc/shader/Makefile.in b/driver/xf86-video-intel/src/xvmc/shader/Makefile.in
index 1d5963135..0a8aca009 100644
--- a/driver/xf86-video-intel/src/xvmc/shader/Makefile.in
+++ b/driver/xf86-video-intel/src/xvmc/shader/Makefile.in
@@ -62,6 +62,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -114,6 +115,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -188,7 +190,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -230,9 +231,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/xvmc/shader/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/xvmc/shader/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/xvmc/shader/Makefile
+ $(AUTOMAKE) --foreign src/xvmc/shader/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
diff --git a/driver/xf86-video-intel/src/xvmc/shader/mc/Makefile.in b/driver/xf86-video-intel/src/xvmc/shader/mc/Makefile.in
index fca5807d0..6e958f97d 100644
--- a/driver/xf86-video-intel/src/xvmc/shader/mc/Makefile.in
+++ b/driver/xf86-video-intel/src/xvmc/shader/mc/Makefile.in
@@ -53,6 +53,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -105,6 +106,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -179,7 +181,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -228,6 +229,7 @@ INTEL_G4A = dual_prime_igd.g4a \
null.g4a
INTEL_G4I = addidct.g4i \
+ addidct_igd.g4i \
block_clear.g4i \
read_frame_x0y0_y.g4i \
read_frame_x0y1_y.g4i \
@@ -329,9 +331,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/xvmc/shader/mc/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/xvmc/shader/mc/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/xvmc/shader/mc/Makefile
+ $(AUTOMAKE) --foreign src/xvmc/shader/mc/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
diff --git a/driver/xf86-video-intel/src/xvmc/shader/vld/Makefile.in b/driver/xf86-video-intel/src/xvmc/shader/vld/Makefile.in
index faa69d868..8cf7664b6 100644
--- a/driver/xf86-video-intel/src/xvmc/shader/vld/Makefile.in
+++ b/driver/xf86-video-intel/src/xvmc/shader/vld/Makefile.in
@@ -53,6 +53,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -105,6 +106,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -179,7 +181,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -219,11 +220,17 @@ INTEL_G4I = addidct.g4i \
motion_frame_uv.g4i \
motion_frame_y.g4i \
read_field_x0y0_uv.g4i \
+ read_field_x0y1_uv.g4i \
+ read_field_x1y0_uv.g4i \
+ read_field_x1y1_uv.g4i \
read_field_x0y0_y.g4i \
read_field_x0y1_y.g4i \
read_field_x1y0_y.g4i \
read_field_x1y1_y.g4i \
read_frame_x0y0_uv.g4i \
+ read_frame_x0y1_uv.g4i \
+ read_frame_x1y0_uv.g4i \
+ read_frame_x1y1_uv.g4i \
read_frame_x0y0_y.g4i \
read_frame_x0y1_y.g4i \
read_frame_x1y0_y.g4i \
@@ -277,9 +284,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/xvmc/shader/vld/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/xvmc/shader/vld/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu src/xvmc/shader/vld/Makefile
+ $(AUTOMAKE) --foreign src/xvmc/shader/vld/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
diff --git a/driver/xf86-video-intel/src/xvmc/xvmc_vld.c b/driver/xf86-video-intel/src/xvmc/xvmc_vld.c
index dca057377..5687593a7 100644
--- a/driver/xf86-video-intel/src/xvmc/xvmc_vld.c
+++ b/driver/xf86-video-intel/src/xvmc/xvmc_vld.c
@@ -23,8 +23,8 @@
* Author:
* Zou Nan hai <nanhai.zou@intel.com>
*/
-#include "xvmc_vld.h"
-#include "i965_hwmc.h"
+#include "intel_xvmc.h"
+#include "i830_hwmc.h"
#include "i810_reg.h"
#include "brw_defines.h"
#include "brw_structs.h"
@@ -325,9 +325,10 @@ struct surface_state_obj {
dri_bo *bo;
};
+#define MAX_SURFACES 12
struct binding_table_obj {
dri_bo *bo;
- struct surface_state_obj surface_states[I965_MAX_SURFACES];
+ struct surface_state_obj surface_states[MAX_SURFACES];
};
struct slice_data_obj {
@@ -364,7 +365,7 @@ static int free_object(struct media_state *s)
for (i = 0; i < MEDIA_KERNEL_NUM; i++)
FREE_ONE_BO(s->vfe_state.interface.kernels[i].bo);
FREE_ONE_BO(s->binding_table.bo);
- for (i = 0; i < I965_MAX_SURFACES; i++)
+ for (i = 0; i < MAX_SURFACES; i++)
FREE_ONE_BO(s->binding_table.surface_states[i].bo);
FREE_ONE_BO(s->slice_data.bo);
FREE_ONE_BO(s->mb_data.bo);
@@ -376,7 +377,7 @@ static int alloc_object(struct media_state *s)
{
int i;
- for (i = 0; i < I965_MAX_SURFACES; i++) {
+ for (i = 0; i < MAX_SURFACES; i++) {
s->binding_table.surface_states[i].bo =
drm_intel_bo_alloc(xvmc_driver->bufmgr, "surface_state",
sizeof(struct brw_surface_state),
@@ -461,7 +462,7 @@ static Status interface_descriptor()
desc->desc1.const_urb_entry_read_offset = 0;
desc->desc1.const_urb_entry_read_len = 30;
- desc->desc3.binding_table_entry_count = I965_MAX_SURFACES - 1;
+ desc->desc3.binding_table_entry_count = MAX_SURFACES - 1;
desc->desc3.binding_table_pointer =
media_state.binding_table.bo->offset >> 5;
@@ -488,7 +489,7 @@ static Status interface_descriptor()
return Success;
}
-static int setup_media_kernels(struct i965_xvmc_context *i965_ctx)
+static int setup_media_kernels(struct intel_xvmc_hw_context *ctx)
{
int i;
@@ -496,7 +497,7 @@ static int setup_media_kernels(struct i965_xvmc_context *i965_ctx)
sizeof(media_gen5_kernels) / sizeof(media_gen5_kernels[0]));
for (i = 0; i < MEDIA_KERNEL_NUM; i++) {
- if (i965_ctx->is_igdng)
+ if (ctx->i965.is_igdng)
media_state.vfe_state.interface.kernels[i].bo =
drm_intel_bo_alloc(xvmc_driver->bufmgr, "kernel",
media_gen5_kernels[i].size,
@@ -513,7 +514,7 @@ static int setup_media_kernels(struct i965_xvmc_context *i965_ctx)
for (i = 0; i < MEDIA_KERNEL_NUM; i++) {
dri_bo *bo = media_state.vfe_state.interface.kernels[i].bo;
- if (i965_ctx->is_igdng)
+ if (ctx->i965.is_igdng)
drm_intel_bo_subdata(bo, 0, media_gen5_kernels[i].size,
media_gen5_kernels[i].bin);
else
@@ -528,18 +529,18 @@ out:
static Status binding_tables()
{
- unsigned int table[I965_MAX_SURFACES];
+ unsigned int table[MAX_SURFACES];
int i;
if (media_state.binding_table.bo)
drm_intel_bo_unreference(media_state.binding_table.bo);
media_state.binding_table.bo =
drm_intel_bo_alloc(xvmc_driver->bufmgr, "binding_table",
- I965_MAX_SURFACES * 4, 0x1000);
+ MAX_SURFACES * 4, 0x1000);
if (!media_state.binding_table.bo)
return BadAlloc;
- for (i = 0; i < I965_MAX_SURFACES; i++) {
+ for (i = 0; i < MAX_SURFACES; i++) {
table[i] =
media_state.binding_table.surface_states[i].bo->offset;
drm_intel_bo_emit_reloc(media_state.binding_table.bo,
@@ -591,50 +592,37 @@ static Status cs_init(int interface_offset)
return Success;
}
+#define STRIDE(w) (w)
+#define SIZE_YUV420(w, h) (h * (STRIDE(w) + STRIDE(w >> 1)))
static Status create_context(Display * display, XvMCContext * context,
int priv_count, CARD32 * priv_data)
{
- struct i965_xvmc_context *i965_ctx;
- i965_ctx = (struct i965_xvmc_context *)priv_data;
- context->privData = priv_data;
+ struct intel_xvmc_context *intel_ctx;
+ struct intel_xvmc_hw_context *hw_ctx;
+ hw_ctx = (struct intel_xvmc_hw_context *)priv_data;
+
+ intel_ctx = calloc(1, sizeof(struct intel_xvmc_context));
+ if (!intel_ctx)
+ return BadAlloc;
+ intel_ctx->hw = hw_ctx;
+ context->privData = intel_ctx;
+ intel_ctx->surface_bo_size
+ = SIZE_YUV420(context->width, context->height);
if (alloc_object(&media_state))
return BadAlloc;
- if (setup_media_kernels(i965_ctx))
+ if (setup_media_kernels(hw_ctx))
return BadAlloc;
return Success;
}
static Status destroy_context(Display * display, XvMCContext * context)
{
- struct i965_xvmc_context *i965_ctx;
- i965_ctx = context->privData;
- Xfree(i965_ctx);
- return Success;
-}
-
-#define STRIDE(w) (w)
-#define SIZE_YUV420(w, h) (h * (STRIDE(w) + STRIDE(w >> 1)))
-static Status create_surface(Display * display,
- XvMCContext * context, XvMCSurface * surface,
- int priv_count, CARD32 * priv_data)
-{
- struct i965_xvmc_surface *priv_surface =
- (struct i965_xvmc_surface *)priv_data;
- size_t size = SIZE_YUV420(priv_surface->w, priv_surface->h);
- surface->privData = priv_data;
- priv_surface->bo = drm_intel_bo_alloc(xvmc_driver->bufmgr, "surface",
- size, 0x1000);
-
- return Success;
-}
-
-static Status destroy_surface(Display * display, XvMCSurface * surface)
-{
- struct i965_xvmc_surface *priv_surface = surface->privData;
- XSync(display, False);
- drm_intel_bo_unreference(priv_surface->bo);
+ struct intel_xvmc_context *intel_ctx;
+ intel_ctx = context->privData;
+ Xfree(intel_ctx->hw);
+ free(intel_ctx);
return Success;
}
@@ -653,13 +641,6 @@ static Status load_qmatrix(Display * display, XvMCContext * context,
return Success;
}
-static Status get_surface_status(Display * display, XvMCSurface * surface,
- int *status)
-{
- *status = 0;
- return Success;
-}
-
static Status vld_state(const XvMCMpegControl * control)
{
struct brw_vld_state tmp, *vld = &tmp;
@@ -748,9 +729,9 @@ static Status setup_media_surface(int index, dri_bo * bo,
return Success;
}
-static Status setup_surface(struct i965_xvmc_surface *target,
- struct i965_xvmc_surface *past,
- struct i965_xvmc_surface *future, int w, int h)
+static Status setup_surface(struct intel_xvmc_surface *target,
+ struct intel_xvmc_surface *past,
+ struct intel_xvmc_surface *future, int w, int h)
{
Status ret;
ret = setup_media_surface(0, target->bo, 0, w, h, TRUE);
@@ -804,11 +785,10 @@ static Status begin_surface(Display * display, XvMCContext * context,
const XvMCMpegControl * control)
{
struct i965_xvmc_contex *i965_ctx;
- struct i965_xvmc_surface *priv_target, *priv_past, *priv_future;
- intel_xvmc_context_ptr intel_ctx;
+ struct intel_xvmc_surface *priv_target, *priv_past, *priv_future;
+ intel_xvmc_context_ptr intel_ctx = context->privData;
Status ret;
- intel_ctx = intel_xvmc_find_context(context->context_id);
priv_target = target->privData;
priv_past = past ? past->privData : NULL;
priv_future = future ? future->privData : NULL;
@@ -842,11 +822,11 @@ static Status put_slice(Display * display, XvMCContext * context,
return Success;
}
-static void state_base_address(struct i965_xvmc_context *i965_ctx)
+static void state_base_address(struct intel_xvmc_hw_context *ctx)
{
BATCH_LOCALS;
- if (i965_ctx->is_igdng) {
+ if (ctx->i965.is_igdng) {
BEGIN_BATCH(8);
OUT_BATCH(BRW_STATE_BASE_ADDRESS | 6);
OUT_BATCH(0 | BASE_ADDRESS_MODIFY);
@@ -998,11 +978,10 @@ static Status put_slice2(Display * display, XvMCContext * context,
unsigned char *slice, int nbytes, int sliceCode)
{
unsigned int bit_buf;
- intel_xvmc_context_ptr intel_ctx;
- struct i965_xvmc_context *i965_ctx;
+ intel_xvmc_context_ptr intel_ctx = context->privData;
+ struct intel_xvmc_hw_context *hw_ctx = intel_ctx->hw;
int q_scale_code, mb_row;
- i965_ctx = (struct i965_xvmc_context *)context->privData;
mb_row = *(slice - 1) - 1;
bit_buf =
(slice[0] << 24) | (slice[1] << 16) | (slice[2] << 8) | (slice[3]);
@@ -1010,10 +989,7 @@ static Status put_slice2(Display * display, XvMCContext * context,
q_scale_code = bit_buf >> 27;
if (media_state.slice_data.bo) {
- if (xvmc_driver->kernel_exec_fencing)
- drm_intel_gem_bo_unmap_gtt(media_state.slice_data.bo);
- else
- drm_intel_bo_unmap(media_state.slice_data.bo);
+ drm_intel_gem_bo_unmap_gtt(media_state.slice_data.bo);
drm_intel_bo_unreference(media_state.slice_data.bo);
}
@@ -1022,16 +998,12 @@ static Status put_slice2(Display * display, XvMCContext * context,
VLD_MAX_SLICE_SIZE, 64);
if (!media_state.slice_data.bo)
return BadAlloc;
- if (xvmc_driver->kernel_exec_fencing)
- drm_intel_gem_bo_map_gtt(media_state.slice_data.bo);
- else
- drm_intel_bo_map(media_state.slice_data.bo, 1);
+ drm_intel_gem_bo_map_gtt(media_state.slice_data.bo);
memcpy(media_state.slice_data.bo->virtual, slice, nbytes);
- intel_ctx = intel_xvmc_find_context(context->context_id);
LOCK_HARDWARE(intel_ctx->hw_context);
- state_base_address(i965_ctx);
+ state_base_address(hw_ctx);
pipeline_select();
media_state_pointers(VFE_VLD_MODE);
urb_layout();
@@ -1045,21 +1017,6 @@ static Status put_slice2(Display * display, XvMCContext * context,
return Success;
}
-static Status put_surface(Display * display, XvMCSurface * surface,
- Drawable draw, short srcx, short srcy,
- unsigned short srcw, unsigned short srch,
- short destx, short desty,
- unsigned short destw, unsigned short desth,
- int flags, struct intel_xvmc_command *data)
-{
- struct i965_xvmc_surface *private_surface = surface->privData;
- uint32_t handle;
-
- drm_intel_bo_flink(private_surface->bo, &handle);
- data->handle = handle;
- return Success;
-}
-
static Status render_surface(Display * display,
XvMCContext * context,
unsigned int picture_structure,
@@ -1072,22 +1029,18 @@ static Status render_surface(Display * display,
XvMCMacroBlockArray * macroblock_array,
XvMCBlockArray * blocks)
{
- struct i965_xvmc_surface *priv_target, *priv_past, *priv_future;
+ struct intel_xvmc_surface *priv_target, *priv_past, *priv_future;
intel_xvmc_context_ptr intel_ctx;
XvMCMacroBlock *mb;
Status ret;
unsigned short *block_ptr;
int i, j;
int block_offset = 0;
- struct i965_xvmc_context *i965_ctx;
+ struct intel_xvmc_hw_context *hw_ctx;
- intel_ctx = intel_xvmc_find_context(context->context_id);
- if (!intel_ctx) {
- XVMC_ERR("Can't find intel xvmc context\n");
- return BadValue;
- }
+ intel_ctx = context->privData;
- i965_ctx = (struct i965_xvmc_context *)context->privData;
+ hw_ctx = (struct intel_xvmc_hw_context *)context->privData;
priv_target = target_surface->privData;
priv_past = past_surface ? past_surface->privData : NULL;
priv_future = future_surface ? future_surface->privData : NULL;
@@ -1110,10 +1063,7 @@ static Status render_surface(Display * display,
return ret;
if (media_state.mb_data.bo) {
- if (xvmc_driver->kernel_exec_fencing)
- drm_intel_gem_bo_unmap_gtt(media_state.mb_data.bo);
- else
- drm_intel_bo_unmap(media_state.mb_data.bo);
+ drm_intel_gem_bo_unmap_gtt(media_state.mb_data.bo);
drm_intel_bo_unreference(media_state.mb_data.bo);
}
@@ -1125,10 +1075,7 @@ static Status render_surface(Display * display,
surface_size, 64);
if (!media_state.mb_data.bo)
return BadAlloc;
- if (xvmc_driver->kernel_exec_fencing)
- drm_intel_gem_bo_map_gtt(media_state.mb_data.bo);
- else
- drm_intel_bo_map(media_state.mb_data.bo, 1);
+ drm_intel_gem_bo_map_gtt(media_state.mb_data.bo);
block_ptr = media_state.mb_data.bo->virtual;
unsigned short *mb_block_ptr;
@@ -1176,7 +1123,7 @@ static Status render_surface(Display * display,
}
LOCK_HARDWARE(intel_ctx->hw_context);
- state_base_address(i965_ctx);
+ state_base_address(hw_ctx);
flush();
pipeline_select();
urb_layout();
@@ -1270,13 +1217,9 @@ struct _intel_xvmc_driver xvmc_vld_driver = {
.type = XVMC_I965_MPEG2_VLD,
.create_context = create_context,
.destroy_context = destroy_context,
- .create_surface = create_surface,
- .destroy_surface = destroy_surface,
.load_qmatrix = load_qmatrix,
- .get_surface_status = get_surface_status,
.begin_surface = begin_surface,
.render_surface = render_surface,
- .put_surface = put_surface,
.put_slice = put_slice,
.put_slice2 = put_slice2
};
diff --git a/driver/xf86-video-intel/src/xvmc/xvmc_vld.h b/driver/xf86-video-intel/src/xvmc/xvmc_vld.h
deleted file mode 100644
index ad2b470c6..000000000
--- a/driver/xf86-video-intel/src/xvmc/xvmc_vld.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "i965_xvmc.h"
diff --git a/driver/xf86-video-intel/uxa/Makefile.in b/driver/xf86-video-intel/uxa/Makefile.in
index f73f8b346..b50b9cb3f 100644
--- a/driver/xf86-video-intel/uxa/Makefile.in
+++ b/driver/xf86-video-intel/uxa/Makefile.in
@@ -72,6 +72,7 @@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
APP_MAN_DIR = @APP_MAN_DIR@
APP_MAN_SUFFIX = @APP_MAN_SUFFIX@
AR = @AR@
@@ -124,6 +125,7 @@ HAVE_GEN4ASM_FALSE = @HAVE_GEN4ASM_FALSE@
HAVE_GEN4ASM_TRUE = @HAVE_GEN4ASM_TRUE@
HAVE_XEXTPROTO_71_FALSE = @HAVE_XEXTPROTO_71_FALSE@
HAVE_XEXTPROTO_71_TRUE = @HAVE_XEXTPROTO_71_TRUE@
+INSTALL_CMD = @INSTALL_CMD@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -198,7 +200,6 @@ build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
-distcleancheck_listfiles = @distcleancheck_listfiles@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
@@ -232,10 +233,7 @@ noinst_LTLIBRARIES = libuxa.la
# Override these since UXA doesn't need them and the needed files aren't
# built (in hw/xfree86/os-support/solaris) until after UXA is built
SOLARIS_ASM_CFLAGS = ""
-INCLUDES = \
- $(XORG_INCS)
-
-AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) $(DIX_CFLAGS)
+AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS)
libuxa_la_SOURCES = \
uxa.c \
uxa.h \
@@ -258,9 +256,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \
esac; \
done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu uxa/Makefile'; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign uxa/Makefile'; \
cd $(top_srcdir) && \
- $(AUTOMAKE) --gnu uxa/Makefile
+ $(AUTOMAKE) --foreign uxa/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \