diff -Nru xserver-xorg-video-intel-2.99.910/aclocal.m4 xserver-xorg-video-intel-2.99.914/aclocal.m4 --- xserver-xorg-video-intel-2.99.910/aclocal.m4 2014-02-10 09:34:13.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/aclocal.m4 2014-07-23 15:44:33.000000000 +0000 @@ -1,8 +1,7 @@ -# generated automatically by aclocal 1.11.3 -*- Autoconf -*- +# generated automatically by aclocal 1.14.1 -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, -# Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -12,13 +11,14 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],, -[m4_warning([this file was generated for autoconf 2.68. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, +[m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. -To do so, use the procedure documented by the package, typically `autoreconf'.])]) +To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) @@ -2083,25 +2083,22 @@ fi ]) -# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.11' +[am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.3], [], +m4_if([$1], [1.14.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -2117,24 +2114,22 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.3])dnl +[AM_AUTOMAKE_VERSION([1.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets -# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to -# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to +# '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and @@ -2153,7 +2148,7 @@ # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually -# harmless because $srcdir is `.', but things will broke when you +# harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, @@ -2179,22 +2174,19 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 9 - # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +[AC_PREREQ([2.52])dnl + m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl @@ -2213,16 +2205,14 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009, -# 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 12 -# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing @@ -2232,7 +2222,7 @@ # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. -# NAME is "CC", "CXX", "GCJ", or "OBJC". +# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was @@ -2245,12 +2235,13 @@ AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl -ifelse([$1], CC, [depcc="$CC" am_compiler_list=], - [$1], CXX, [depcc="$CXX" am_compiler_list=], - [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], - [$1], UPC, [depcc="$UPC" am_compiler_list=], - [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], - [depcc="$$1" am_compiler_list=]) +m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], + [$1], [CXX], [depcc="$CXX" am_compiler_list=], + [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], + [$1], [UPC], [depcc="$UPC" am_compiler_list=], + [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], @@ -2258,8 +2249,8 @@ # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're @@ -2299,16 +2290,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -2317,8 +2308,8 @@ test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else @@ -2326,7 +2317,7 @@ fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -2374,7 +2365,7 @@ # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES +# This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl @@ -2384,9 +2375,13 @@ # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) +[AC_ARG_ENABLE([dependency-tracking], [dnl +AS_HELP_STRING( + [--enable-dependency-tracking], + [do not reject slow dependency extractors]) +AS_HELP_STRING( + [--disable-dependency-tracking], + [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' @@ -2401,20 +2396,18 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 5 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in @@ -2427,7 +2420,7 @@ # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -2439,21 +2432,19 @@ continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` @@ -2471,7 +2462,7 @@ # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will +# is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], @@ -2481,18 +2472,21 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 16 - # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. +dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. +m4_define([AC_PROG_CC], +m4_defn([AC_PROG_CC]) +[_AM_PROG_CC_C_O +]) + # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- @@ -2505,7 +2499,7 @@ # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.62])dnl +[AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl @@ -2534,31 +2528,40 @@ # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl +[AC_DIAGNOSE([obsolete], + [$0: two- and three-arguments forms are deprecated.]) +m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, +m4_if( + m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), + [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl +[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) + AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +AM_MISSING_PROG([AUTOCONF], [autoconf]) +AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +AM_MISSING_PROG([AUTOHEADER], [autoheader]) +AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AM_PROG_MKDIR_P])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl @@ -2569,34 +2572,78 @@ [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl + [_AM_DEPENDENCIES([CC])], + [m4_define([AC_PROG_CC], + m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl + [_AM_DEPENDENCIES([CXX])], + [m4_define([AC_PROG_CXX], + m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl + [_AM_DEPENDENCIES([OBJC])], + [m4_define([AC_PROG_OBJC], + m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], + [_AM_DEPENDENCIES([OBJCXX])], + [m4_define([AC_PROG_OBJCXX], + m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_REQUIRE([AM_SILENT_RULES])dnl +dnl The testsuite driver may need to know about EXEEXT, so add the +dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This +dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) + fi +fi]) + +dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. @@ -2618,15 +2665,12 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation, -# Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. @@ -2640,16 +2684,14 @@ install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi -AC_SUBST(install_sh)]) +AC_SUBST([install_sh])]) -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], @@ -2665,14 +2707,12 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 4 - # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. @@ -2690,7 +2730,7 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -2717,15 +2757,12 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 6 - # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], @@ -2733,11 +2770,10 @@ $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) - # AM_MISSING_HAS_RUN # ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. +# Define MISSING if not defined so far and test if it is modern enough. +# If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl @@ -2750,54 +2786,22 @@ esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) + AC_MSG_WARN(['missing' script is too old or missing]) fi ]) -# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation, -# Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 1 - -# AM_PROG_MKDIR_P -# --------------- -# Check for `mkdir -p'. -AC_DEFUN([AM_PROG_MKDIR_P], -[AC_PREREQ([2.60])dnl -AC_REQUIRE([AC_PROG_MKDIR_P])dnl -dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, -dnl while keeping a definition of mkdir_p for backward compatibility. -dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. -dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of -dnl Makefile.ins that do not define MKDIR_P, so we do our own -dnl adjustment using top_builddir (which is defined more often than -dnl MKDIR_P). -AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl -case $mkdir_p in - [[\\/$]]* | ?:[[\\/]]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac -]) - # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 - # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], @@ -2807,7 +2811,7 @@ # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], -[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +[m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ @@ -2821,24 +2825,82 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Check to make sure that the build environment is sane. -*- Autoconf -*- +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_PROG_CC_C_O +# --------------- +# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC +# to automatically call this. +AC_DEFUN([_AM_PROG_CC_C_O], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +AC_LANG_PUSH([C])dnl +AC_CACHE_CHECK( + [whether $CC understands -c and -o together], + [am_cv_prog_cc_c_o], + [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i]) +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +AC_LANG_POP([C])]) -# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008 -# Free Software Foundation, Inc. +# For backward compatibility. +AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) + +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 5 +# AM_RUN_LOG(COMMAND) +# ------------------- +# Run COMMAND, save the exit status in ac_status, and log it. +# (This has been adapted from Autoconf's _AC_RUN_LOG macro.) +AC_DEFUN([AM_RUN_LOG], +[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD + ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + (exit $ac_status); }]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2849,32 +2911,40 @@ esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; + AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken + alias in your environment]) + fi + if test "$[2]" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$[2]" = conftest.file ) then @@ -2884,31 +2954,50 @@ AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi -AC_MSG_RESULT(yes)]) +AC_MSG_RESULT([yes]) +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi +AC_CONFIG_COMMANDS_PRE( + [AC_MSG_CHECKING([that generated files are newer than configure]) + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + AC_MSG_RESULT([done])]) +rm -f conftest.file +]) -# Copyright (C) 2009, 2011 Free Software Foundation, Inc. +# Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT -# (`yes' being less verbose, `no' or empty being verbose). +# ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], -[AC_ARG_ENABLE([silent-rules], -[ --enable-silent-rules less verbose build output (undo: `make V=1') - --disable-silent-rules verbose build output (undo: `make V=0')]) -case $enable_silent_rules in -yes) AM_DEFAULT_VERBOSITY=0;; -no) AM_DEFAULT_VERBOSITY=1;; -*) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; +[AC_ARG_ENABLE([silent-rules], [dnl +AS_HELP_STRING( + [--enable-silent-rules], + [less verbose build output (undo: "make V=1")]) +AS_HELP_STRING( + [--disable-silent-rules], + [verbose build output (undo: "make V=0")])dnl +]) +case $enable_silent_rules in @%:@ ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl -dnl A few `make' implementations (e.g., NonStop OS and NextStep) +dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} @@ -2926,7 +3015,7 @@ am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then - dnl Using `$V' instead of `$(V)' breaks IRIX make. + dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else @@ -2943,44 +3032,40 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc. +# Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 1 - # AM_PROG_INSTALL_STRIP # --------------------- -# One issue with vendor `install' (even GNU) is that you can't +# One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we -# always use install-sh in `make install-strip', and initialize +# always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +# will honor the 'STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 3 - # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. @@ -2994,18 +3079,16 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc. +# Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 2 - # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. +# FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory @@ -3015,76 +3098,114 @@ # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar +# AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) -m4_if([$1], [v7], - [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. + +# We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break +m4_if([$1], [v7], + [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + [m4_case([$1], + [ustar], + [# The POSIX 1988 'ustar' format is defined with fixed-size fields. + # There is notably a 21 bits limit for the UID and the GID. In fact, + # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 + # and bug#13588). + am_max_uid=2097151 # 2^21 - 1 + am_max_gid=$am_max_uid + # The $UID and $GID variables are not portable, so we need to resort + # to the POSIX-mandated id(1) utility. Errors in the 'id' calls + # below are definitely unexpected, so allow the users to see them + # (that is, avoid stderr redirection). + am_uid=`id -u || echo unknown` + am_gid=`id -g || echo unknown` + AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) + if test $am_uid -le $am_max_uid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi + AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) + if test $am_gid -le $am_max_gid; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + _am_tools=none + fi], + + [pax], + [], + + [m4_fatal([Unknown tar format])]) + + AC_MSG_CHECKING([how to create a $1 tar archive]) + + # Go ahead even if we have the value already cached. We do so because we + # need to set the values for the 'am__tar' and 'am__untar' variables. + _am_tools=${am_cv_prog_tar_$1-$_am_tools} + + for _am_tool in $_am_tools; do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works. + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi + done rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) + AC_MSG_RESULT([$am_cv_prog_tar_$1])]) + AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR diff -Nru xserver-xorg-video-intel-2.99.910/AUTHORS xserver-xorg-video-intel-2.99.914/AUTHORS --- xserver-xorg-video-intel-2.99.910/AUTHORS 2013-08-12 21:18:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/AUTHORS 2014-06-25 10:31:36.000000000 +0000 @@ -55,7 +55,7 @@ The X.Org version of this driver is maintained by Intel Corporation: - http://www.intellinuxgraphics.org + https://01.org/linuxgraphics/ The X11R6 version of this driver originally came from XFree86 4.4 rc2. diff -Nru xserver-xorg-video-intel-2.99.910/ChangeLog xserver-xorg-video-intel-2.99.914/ChangeLog --- xserver-xorg-video-intel-2.99.910/ChangeLog 2014-02-10 09:39:42.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/ChangeLog 2014-07-23 15:44:51.000000000 +0000 @@ -1,3 +1,7426 @@ +commit 8d95e90b7b4bf5d6bae5443f92d77d30f4443f24 +Author: Chris Wilson +Date: Wed Jul 23 15:45:31 2014 +0100 + + 2.99.914 snapshot + +commit 57f0e65d5186412835f282af59141626e4a87a00 +Author: Chris Wilson +Date: Wed Jul 23 16:42:46 2014 +0100 + + sna/dri2: Compile fix for old xorg/dri2 + + We have to do conditional compilation as we touch structure members that + may not exist in older Xserver headers. + + Signed-off-by: Chris Wilson + +commit 4ed0937640b54246440421114b697f75d1b8c835 +Author: Chris Wilson +Date: Wed Jul 23 15:41:29 2014 +0100 + + Add automake magic required for libobj/ + + So libobj/ wasn't included in the tarball, and nor was the compatability + functions being added to the driver when they were needed. The oddity is + that using the ./configure script (and thus make distcheck) succeeds. It + was only when 'autoreconf -fi' was run was the first error encoutered. + + Signed-off-by: Chris Wilson + Reported-by: Tobias Klausmann + +commit dcf9ce4a9f16c01f58797e4f899d51e23506aa6c +Author: Chris Wilson +Date: Wed Jul 23 14:19:44 2014 +0000 + + Fix compile failure on old Xorg with XF86_ALLOCATE_GPU_SCREEN + + Sigh, a late fix was not compile checked against xorg-1.7. + + Signed-off-by: Chris Wilson + +commit 1c5e20716f192f0c38b4edd879d28e11126f7f01 +Author: Chris Wilson +Date: Sat Jul 5 08:47:16 2014 +0100 + + 2.99.913 snapshot + +commit d242965979cf251383a6230dbd65cdc1d9e231ea +Author: Chris Wilson +Date: Wed Jul 23 14:25:25 2014 +0100 + + sna: Skip performing an async flip after fixup + + After the first async failure and we fix up the CRTC, ordinary we queue + a no-op flip in order to queue the event. For async flips, we do not + want that event so just skip the flip. + + Signed-off-by: Chris Wilson + +commit 4153d4b43004cd90c0d9a7a7db399dac4d30721e +Author: Chris Wilson +Date: Wed Jul 23 13:54:19 2014 +0100 + + sna/dri2: Tidy freeing the queued frame events + + Signed-off-by: Chris Wilson + +commit f2b2b6eda009924e5ec6974bb31be9d3749c9cf8 +Author: Chris Wilson +Date: Wed Jul 23 13:45:27 2014 +0100 + + test/dri2: Use the right device node + + Use the device node as instructed by Xorg. + + Signed-off-by: Chris Wilson + +commit 65c2376730e86d7502d8c47d49386be5f51e47ba +Author: Chris Wilson +Date: Wed Jul 23 12:12:03 2014 +0100 + + sna: Add a DBG message for slave damage propagation + + Signed-off-by: Chris Wilson + +commit 95c059b330e705ecd0e575e98d8edf5707e84a05 +Author: Chris Wilson +Date: Wed Jul 23 11:01:07 2014 +0100 + + sna: Reorder disabling scanout pixmap when updating slave + + The assertion caught that we would unregister an invalid drawable on + older Xorg. + + Signed-off-by: Chris Wilson + +commit d6830190bc9956f485db6c3420f7a4a79793a693 +Author: Chris Wilson +Date: Wed Jul 23 10:53:40 2014 +0100 + + sna: Disable all outputs when initializing as a slaved output provider + + When we are constructed as a slaved device, we need to disable all + outputs or else they are not correctly hooked into the master device + upon startup. + + Signed-off-by: Chris Wilson + +commit 70868c7aa881b15b7478f7ee4543fde0268a4ba6 +Author: Chris Wilson +Date: Wed Jul 23 08:37:46 2014 +0100 + + sna/dri2: Recreate buffer in reuse rather than force recreate + + By marking the buffer->attachment as invalid we forced the recreation of + the buffer on the next DRI2GetBuffers. The only small problem with that + was that the client didn't always immediately call DRI2GetBuffers after + the invalidation - and if they did a DRI2CopyRegion with its stale + buffers the unfound attachment would generate a BadValue and kill the + client. So instead of messing around with the attachment, explicitly + recreate the buffer if we attempt to reuse a buffer of the wrong size. + + Signed-off-by: Chris Wilson + +commit aa5351dbbe0a50080efee35a3d494b3a20b7c9f6 +Author: Chris Wilson +Date: Tue Jul 22 09:40:14 2014 +0100 + + sna: Ensure errno is set after failure before reporting a modeset failure + + A few paths we report a sanity check failure which do not set errno, but + we then print out the errno as part of our message to the user. Set it + to a sane value in those cases. + + Signed-off-by: Chris Wilson + +commit feba651db8dd61356fb6296b55d46168bd4d7011 +Author: Chris Wilson +Date: Tue Jul 22 09:15:01 2014 +0100 + + sna: Remove %# from DBG messages + + LogF doesn't support the 0x-prefix instruction. + + Signed-off-by: Chris Wilson + +commit 13e20c7f61d8b21b33c02d8b737cf9c06bf50f17 +Author: Chris Wilson +Date: Tue Jul 22 08:52:10 2014 +0100 + + sna: Assert that we do not overwrite an earlier COW entry + + Signed-off-by: Chris Wilson + +commit d8b0a8fa033848543e0b39566b531fdfdd078087 +Author: Chris Wilson +Date: Tue Jul 22 08:48:58 2014 +0100 + + sna/dri3: Don't forget to add SHM pixmaps to the list of exported DRI3 bo + + Signed-off-by: Chris Wilson + +commit bfccacf745d054756661be3edd8898ac6aceb878 +Author: Chris Wilson +Date: Sun Jul 20 07:29:21 2014 +0100 + + sna/video: Bump the maximum size for sprites + + A sprite plane is limited by the display engine who's maximum resolution + has increased since the 2kx2k limitations of 8xx, so let's set it + correctly to the reported maximum CRTC size (since we have no individual + query for maximum sprite plane sizes). + + Signed-off-by: Chris Wilson + +commit 9bb2818a7db1c9dc89379996415511b6cff4bb33 +Author: Chris Wilson +Date: Sun Jul 20 07:27:58 2014 +0100 + + dri3-test: Print line number for shm failures + + Signed-off-by: Chris Wilson + +commit 4ae346e7647fd2c01324f1a6d3b37674e858486d +Author: Chris Wilson +Date: Fri Jul 18 07:31:25 2014 +0100 + + configure: Double check xinerama's headers + + Having the pkgconfig present doesn't always necessarily imply the + headers are installed correctly - just fail over gracefully for xinerama + and intel-virtual-output + + Signed-off-by: Chris Wilson + +commit fac6845820e49dbbea2a625b7bb745d8f9159b56 +Author: Chris Wilson +Date: Fri Jul 18 07:14:19 2014 +0100 + + sna/dri2: Protect compsiteext.h include with build check + + We shouldn't include calls to the composite extension if it has not been + built. + + Reported-by: Ben Widawsky + Signed-off-by: Chris Wilson + +commit 923e098f5f830c30b93d6f85d4f812201bdcb206 +Author: Chris Wilson +Date: Thu Jul 17 17:10:39 2014 +0100 + + sna: Fix compilation with older Xorg + + sna_display.c: In function 'sna_crtc_disable_shadow': + sna_display.c:1375:39: error: dereferencing pointer to incomplete type + DamageUnregister(&crtc->slave_damage->drawable, crtc->slave_damage); + + Signed-off-by: Chris Wilson + +commit 7026ffe56005bbc36dc37cafc7ebb2a7f09fefdd +Author: Chris Wilson +Date: Thu Jul 17 17:04:02 2014 +0100 + + sna: Support TearFree on slaved outputs + + By always forcing the shadow intermediatory, we can enable TearFree even + ona slave scanout. + + Signed-off-by: Chris Wilson + +commit 3140d72826b5227f7f7ac9a428faa4bcfd4b377b +Author: Chris Wilson +Date: Thu Jul 17 16:14:16 2014 +0100 + + backlight: Prevent dereference of potential NULL argv + + Adam Sampson spotted that + + "It's possible (but not very sensible) to exec a program with an empty + argument list, so argv[0] is not necessarily a valid pointer. For + example: + + $ cat exec0.c + + int main(int argc, char *argv[]) { + char *empty[1] = { NULL }; + execvp(argv[1], empty); + perror("execvp"); + return 1; + } + $ ./exec0 /usr/libexec/xf86-video-intel-backlight-helper + Usage: (null) + " + + He sensibly suggested that we hardcode the program name to avoid the + NULL dereference. Being the paranoid type, we should also be careful not + to write to any file descriptors outside of our control (i.e. stderr), + so disable the messages unless we are debugging. + + Reported-by: Adam Sampson + Signed-off-by: Chris Wilson + +commit bcd09ff6eb76bc4df046ece4da29b1455fed8dff +Author: Chris Wilson +Date: Thu Jul 17 15:23:46 2014 +0100 + + sna: Assert that we never attempt to flip the slave scanout + + Signed-off-by: Chris Wilson + +commit 129656e4a82d4bf799e5c1d75d0dcb4480f6eb09 +Author: Chris Wilson +Date: Thu Jul 17 15:01:06 2014 +0100 + + sna/dri2: Disable SwapLimit buffers with buggy prime implementations + + If there is a GPU screen, we have to assume that the DRI2 code may pass + around the wrong pointers to ReuseBufferNotify until the fix is + released: + + commit 4d92fab39c4225e89f2d157a1f559cb0618a6eaa + Author: Chris Wilson + Date: Wed Jun 18 11:14:43 2014 +0100 + + dri2: Use the PrimeScreen when creating/reusing buffers + + Signed-off-by: Chris Wilson + +commit a45b2ea11c15f35c36330ff27cb45854a29c2e2c +Author: Chris Wilson +Date: Thu Jul 17 14:40:51 2014 +0100 + + sna: Handle rotated slaved scanouts + + As per the usual handling of rotated scanouts with unsupported + rotations, we stage the drawing onto a backbuffer then rotate onto the + crtc later. The difference here is that we must read the contents from + the master pixmap rather than our own screen pixmap. + + Spotted was looking at slaved scanouts mistakenly setting the CRTC + transformed flag. + + Reported-by: Tomas Pruzina + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81383 + Signed-off-by: Chris Wilson + +commit 339c9dd0d5206180995731ab22304776e544f2f7 +Author: Chris Wilson +Date: Thu Jul 17 12:54:47 2014 +0100 + + sna: Add missing DBG parameters + + Signed-off-by: Chris Wilson + +commit 62f62f70eda97a3ef18c5144031fdf1cb2b7dad0 +Author: Chris Wilson +Date: Thu Jul 17 10:06:06 2014 +0100 + + sna: Avoid confusing failure to flip and flipping zero CRTC + + During the present unflip path we blindly try to restore the original + mode after a flip failure. However, it confuses flipping zero CRTC with + a genuine failure. This has the result of undoing a DPMS change (e.g. + xset dpms force dpms) under a DRI3 compositor. + + Reported-by: Jiri Slaby + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81456 + Signed-off-by: Chris Wilson + +commit 95f08c171ebd9b594112ab006c4460702a22bec1 +Author: Chris Wilson +Date: Thu Jul 17 09:20:35 2014 +0100 + + sna: Busy-wait for the kernel to catch up when flipping + + If the kernel reports that it is busy, it has not yet finished + processing a pending flip and we have multiple CRTC queued, just wait + for the kernel to clear its backlog before submitting the next flip. On + the other hand, if we can just overwrite the pending flip results. + However, the EBUSY may actually be a genuine report by the kernel of an + error, so check for an invalid CRTC first. + + Signed-off-by: Chris Wilson + +commit 0a9d3dd8c83749992e643675f16486092f2b00fa +Author: Chris Wilson +Date: Thu Jul 17 08:53:13 2014 +0100 + + sna: Silence valgrind when reading plane properties + + Signed-off-by: Chris Wilson + +commit 0a57b55f0fcfa93b38015535002cb11eeaf1dd3a +Author: Chris Wilson +Date: Thu Jul 17 08:32:14 2014 +0100 + + sna: Remove extraneous function wrapping + + Since we only have the single callsite for do_page_flip, the wrapper is + not adding any meaningful information. + + Signed-off-by: Chris Wilson + +commit f33d44f41ef0f287375b7a6b1c117abff5a23b19 +Author: Chris Wilson +Date: Wed Jul 16 12:53:02 2014 +0100 + + sna: And remove new bogus assertion + + We assert that damage is valid as we delete the Pixmap, and so we cannot + assert that the Pixmap is still valid itself. + + Reported-by: Jiri Slaby + Signed-off-by: Chris Wilson + +commit dd9df24eb5234c96e499063904ab7bd85a332fd8 +Author: Chris Wilson +Date: Wed Jul 16 08:05:34 2014 +0100 + + sna: Make the damage check more verbose + + Print out the pixmap number and the damage extents for when the + assertion fails. + + Signed-off-by: Chris Wilson + +commit 34ada63118680bf8ad2ef737fd4a8edfd8246e37 +Author: Chris Wilson +Date: Wed Jul 16 07:19:03 2014 +0100 + + sna/gen2+: Remove assertion on draw->type for fills + + I overlooked the tiling-fill path passing down a temporary DrawableRec + into the fill_boxes callback - invalidating the assertion. + + Fixes regression from + commit 43176b9bfafe389c4b9ed676f4e50e3b06f858c4 + Author: Chris Wilson + Date: Mon Jun 30 21:01:11 2014 +0100 + + sna/dri2: Pass around the correct DrawableRec for sampling from the foriegn bo + + Reported-by: Jiri Slaby + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c62 + Signed-off-by: Chris Wilson + +commit 4422b1854209a2cdf023c1fbc60834fde2fbc0c7 +Author: Chris Wilson +Date: Fri Jul 11 22:23:55 2014 +0100 + + sna: Use a stricter test for determining CRTC off before updating the cursor + + Signed-off-by: Chris Wilson + +commit e0523ade28fa0da00d0bd70d8b22d53ed4e49f73 +Author: Chris Wilson +Date: Wed Jul 9 12:10:15 2014 +0100 + + sna: Reduce reflections onto rotations + + In order to support a wider range of rotation/reflections, perform a + simple reduction of the requested rotation first. + + Signed-off-by: Chris Wilson + +commit 251bcc32eed37ee10eb14ce2278ecbdcc40a7cde +Author: Chris Wilson +Date: Thu Jul 10 21:01:57 2014 +0100 + + configure: Provide a poor man's replacement for getline() + + uClibc is one such library that doesn't implement getline() + + Reported-by: Ben Widawsky + Signed-off-by: Chris Wilson + +commit 8587b2fff218537c6ff568ac3ef561f0d39f03ff +Author: Chris Wilson +Date: Tue Jul 8 11:53:13 2014 +0100 + + sna: Rewrite rotation setup on top of universal drm planes + + The kernel interface has changed slightly since the early proposals. Now + the rotation property is only on the plane and so we have to lookup the + primary prime as well. + + Signed-off-by: Chris Wilson + +commit f24a9d335273fec20679397abcc3d5405d9613df +Author: Chris Wilson +Date: Sat Jul 5 14:40:38 2014 +0100 + + sna: Fix a couple of DBG messages + + Signed-off-by: Chris Wilson + +commit 790e7492bdb5c0c77c53ae769f0d408b04d5c99b +Author: Chris Wilson +Date: Sat Jul 5 09:46:00 2014 +0100 + + test/lowlevel-blt-bench: Add common PDF operators + + Applications are starting to use PDF operators, so far I have spotted + multiply, dodge and lighten. + + Signed-off-by: Chris Wilson + +commit 8fa22964f69d3ec8700f177dd7cb3cbc396a9f35 +Author: Matthieu Herrb +Date: Fri Jul 4 18:26:09 2014 +0200 + + backlight: Fix security issues in handling of the interface path name. + + - don't allow '/' in the interface name to avoid escaping the /sys + hierarchy + - check snprintf() return value for overflow. + + Problems reported by Adam Sampson. Thanks. + + Signed-off-by: Matthieu Herrb + Reviewed-by: Reviewed-by: Hans de Goede + +commit 6a64a3ae55ad5f743d2b7a4852b6ca7b54d2a142 +Author: Chris Wilson +Date: Fri Jul 4 13:04:02 2014 +0100 + + sna: Discard operations to either CPU or GPU bo when overwriting with RenderRectangles + + Signed-off-by: Chris Wilson + +commit 2c8ab77fcd71b7f96ad7bc379e5c68b3b45a5069 +Author: Chris Wilson +Date: Fri Jul 4 12:43:55 2014 +0100 + + sna: Tweak number of threads for short areas + + Signed-off-by: Chris Wilson + +commit d3ccb3f3b2a3cb4c8b51d58d185dd10b85e025eb +Author: Chris Wilson +Date: Fri Jul 4 12:39:01 2014 +0100 + + sna: Convert a clear tile into a solid fill + + Signed-off-by: Chris Wilson + +commit 2e0763088f8e159b414cec5c056cc4c91a34766e +Author: Chris Wilson +Date: Fri Jul 4 12:26:43 2014 +0100 + + sna: Fix typo s/num_threads/max_threads/ + + Signed-off-by: Chris Wilson + +commit 04ddea075e9e07cf3158594130d5ba7d1f50f7f1 +Author: Chris Wilson +Date: Fri Jul 4 12:14:11 2014 +0100 + + sna: Do a quirk early check for short areas before threading + + Signed-off-by: Chris Wilson + +commit 228a22fe8db044a18556a9fdb989323274817771 +Author: Chris Wilson +Date: Fri Jul 4 12:10:10 2014 +0100 + + sna: Disable use of threaded compositor when using threaded renderer + + Reported-by: Zdenek Kabelac + Signed-off-by: Chris Wilson + +commit 64bcb91f58fba3956f2c66fa37707b9e496da936 +Author: Chris Wilson +Date: Fri Jul 4 11:02:39 2014 +0100 + + sna: Utilise existing cached upload for promoting to GPU bo + + If we already have a buffer that represents the data on the GPU, we can + simply use that when we need to promote the pixmap onto the GPU. + + Signed-off-by: Chris Wilson + +commit 821ef20b27f84cc26aec266b0f616a7f39ba9e3d +Author: Chris Wilson +Date: Fri Jul 4 10:43:35 2014 +0100 + + sna: Promote tile pixmaps to GPU when reused + + Signed-off-by: Chris Wilson + +commit c6407f7380829f822a462100d26bc531aed0fd6f +Author: Chris Wilson +Date: Fri Jul 4 10:14:54 2014 +0100 + + sna/gen8: Disable the unaligned check + + Note sure if this is strictly required -- but at the moment it fails for + 1x1R solids, causing us to skip glyphs. The simulator doesn't complain, + so just skip the check for now. + + Reported-by: Ben Widawsky + Signed-off-by: Chris Wilson + +commit e64d14d7bc72fe7b150e5427feeb1a163ec600a7 +Author: Chris Wilson +Date: Fri Jul 4 09:55:04 2014 +0100 + + sna: Tighten assertions for using upload proxies concurrently with CPU reads + + After relaxing some of the rules on when to discard the upload proxies, + we also need to relax some of the complementary asserts. + + Reported-by: Zdenek Kabelac + Signed-off-by: Chris Wilson + +commit 4e12d5ca26bdfafd7b9cd02c36e6d991f068f29b +Author: Chris Wilson +Date: Fri Jul 4 09:48:53 2014 +0100 + + sna: Prevent creating a GPU bo for an inplace read + + Signed-off-by: Chris Wilson + +commit 18ae7722dbdf6ab61560962ed6ca8d39f353b1f9 +Author: Chris Wilson +Date: Thu Jul 3 18:18:04 2014 +0000 + + sna: Wrap xf86DPMSSet + + We need to wrap xf86DPMSSet() so that we can reintialize our bookkeeping + and auxiliary planes after disabling/re-enabling CRTC during DPMS + operations. + + Signed-off-by: Chris Wilson + +commit 57d0cc82d851b95d4e3b1821287dd3ffd1cf6e3b +Author: Chris Wilson +Date: Thu Jul 3 09:07:44 2014 +0100 + + sna: Clear the cursor reference from the CRTC if the update fails + + This should allow it to be restored correctly the next time it gets + shown. + + Signed-off-by: Chris Wilson + +commit 24c9bac7eb6e17b55044d719bab74d16fd68c450 +Author: Chris Wilson +Date: Wed Jul 2 21:17:54 2014 +0100 + + sna: Limit the size of the tiling object to be smaller than either the originals + + When we tile, we do so in order to fit an operation involving two + objects larger than the aperture. If we then choose an intermediate + tiling object that is larger than either of those two, the error will + persist and we will be forced to recuse. + + In the worst case, this will provide an upper bound to the recursion. + + Reported-by: Bruno Prémont + Signed-off-by: Chris Wilson + +commit 710bb0d37c681f2ffdeaf263b6ee7d9488670bc0 +Author: Chris Wilson +Date: Wed Jul 2 09:16:07 2014 +0000 + + test: Create separate SHM segments for ref/out + + Signed-off-by: Chris Wilson + +commit 87e659b887f4c738cfc91439efdac0d48fd294f0 +Author: Chris Wilson +Date: Wed Jul 2 10:47:32 2014 +0000 + + sna: Use the threaded compositor for picture conversions + + Signed-off-by: Chris Wilson + +commit 2bf36d54ebdfa2a59bf7ef71134b953628ae5d50 +Author: Chris Wilson +Date: Wed Jul 2 11:31:54 2014 +0100 + + sna/gen6+: Tweak consideration of compositing on BLT + + Signed-off-by: Chris Wilson + +commit 732cd11cf0ca813fdc06f9f09fab120ea4e3a7da +Author: Chris Wilson +Date: Tue Jul 1 17:54:49 2014 +0100 + + sna: Fix typo in LinearFramebuffer handling + + Eeek, when not using LinearFramebuffer we still want to create the GPU + bo: s/,/;/ + + Reported-by: Ilia Mirkin + Signed-off-by: Chris Wilson + +commit b5fa463b90c49ebc635d79b1561c94a4857e9cf6 +Author: Chris Wilson +Date: Tue Jul 1 17:53:56 2014 +0100 + + sna: Correct migration flags for initial scanout creation + + We want to preserve any contents preloaded (not that there should be + any...) + + Signed-off-by: Chris Wilson + +commit b88866aa5ebf813a999e194dec24e9ef2ac4f59d +Author: Chris Wilson +Date: Tue Jul 1 16:59:31 2014 +0100 + + sna/dri2: Add a DBG option to select copy method + + Often when debugging it is useful to force either use of the BLT or 3D + pipelines for copies. + + Signed-off-by: Chris Wilson + +commit a10781b70f222f3997928fa979f6292617f79316 +Author: Chris Wilson +Date: Tue Jul 1 15:11:07 2014 +0100 + + sna: Enforce LinearFramebuffer option + + This option should only be used for compatibility. Previously this was + done at a high level, this changes it to enforce the tiling as we apply + the CRTC. + + Signed-off-by: Chris Wilson + +commit 75745cd5861481c5a9a31125d357f339349dd0f8 +Author: Chris Wilson +Date: Tue Jul 1 14:31:32 2014 +0100 + + sna/dri2: Use CPU fallback if possible + + Signed-off-by: Chris Wilson + +commit 02715490db13dcd47c5e4bef713f400838d94b99 +Author: Chris Wilson +Date: Tue Jul 1 13:10:32 2014 +0100 + + sna/dri2: Set depth/bpp on scratch DrawableRec + + We need to initialise both depth and bitsPerPixel on the drawable struct + we pass around as they are used for selecting for the format when + copying. + + Reported-by: Vedran Rodic + Signed-off-by: Chris Wilson + +commit e6e5330857097eb2caafa89d571d12e4bb15f539 +Author: Damien Lespiau +Date: Mon Jun 30 19:24:13 2014 +0100 + + intel: Use the i845 info structure for INTEL_I845G_IDS() + + I assume the intention was to provide a different structure for each of + the gen 2 devices. + + This doesn't change anything really. + + Signed-off-by: Damien Lespiau + +commit e1c3e6ce79c73d12c814cfda76dbc0df184902ee +Author: Chris Wilson +Date: Mon Jun 30 19:56:39 2014 +0100 + + sna: Add DBG breadcrumbs before flushes in BLT + + Signed-off-by: Chris Wilson + +commit 43176b9bfafe389c4b9ed676f4e50e3b06f858c4 +Author: Chris Wilson +Date: Mon Jun 30 21:01:11 2014 +0100 + + sna/dri2: Pass around the correct DrawableRec for sampling from the foriegn bo + + One day, we will move the width/height/bpp to the bo itself... + + Reported-by: Ilia Mirkin + Signed-off-by: Chris Wilson + +commit 6c3399715e316be970c696b8949e3c14e83ea5df +Author: Chris Wilson +Date: Mon Jun 30 16:32:45 2014 +0100 + + sna/dri2: Apply the paraniod buffer clip in the correct coordinate system + + We need to only clip to the extents of the copy in the buffer space - + which implies that we need to translate the region into that space before + doing the clip. + + Reported-by: Ilia Mirkin + Signed-off-by: Chris Wilson + +commit c25fa2216a3674f564a7e35d263a5d405aa97816 +Author: Chris Wilson +Date: Mon Jun 30 14:13:13 2014 +0100 + + sna: Tweak preference for small GPU bo + + Signed-off-by: Chris Wilson + +commit 19a62e088f5202026bdfde7a8af36598b69f8243 +Author: Chris Wilson +Date: Mon Jun 30 11:20:54 2014 +0100 + + test/lowlevel-blt-bench: Update progress more frequently + + Signed-off-by: Chris Wilson + +commit fab3bc70a450d94104c96ddbe7fa6e6ace1bb8f8 +Author: Chris Wilson +Date: Mon Jun 30 11:05:33 2014 +0100 + + sna: Reduce assertion when using asynchronous CPU access + + If we are not actually accessing the memory through the pointer, we do + not care if it not currently coherent. + + Signed-off-by: Chris Wilson + +commit ffe8bd4d6e296a0ded0e118aee05aa6cb3051c56 +Author: Chris Wilson +Date: Mon Jun 30 10:55:20 2014 +0100 + + sna: Silence snarky compliers + + 0 != (void *)0 + + Signed-off-by: Chris Wilson + +commit 05f6183075867d582b7f9f74aec42e632e3d83dd +Author: Chris Wilson +Date: Mon Jun 30 10:46:00 2014 +0100 + + sna: Mollify assert to be consistent with the scanout flush + + Signed-off-by: Chris Wilson + +commit 2e0000688d034535083950b98bc61745dd965352 +Author: Chris Wilson +Date: Mon Jun 30 08:44:33 2014 +0100 + + test/lowlevel-blt-bench: Exercise masks + + Signed-off-by: Chris Wilson + +commit 37ac34c4e4500bfc272222754949edc1dbb8c7e2 +Author: Chris Wilson +Date: Mon Jun 30 08:44:33 2014 +0100 + + test/lowlevel-blt-bench: Exercise SHM pixmaps + + Signed-off-by: Chris Wilson + +commit 901d889dd7397dfa4c291f96af657e4b3433d795 +Author: Chris Wilson +Date: Mon Jun 30 07:44:25 2014 +0100 + + intel-virtual-output: Remove one redundant cleanup on error + + Signed-off-by: Chris Wilson + +commit a8b0ba0ed5f27e0d671b650d6f4bfe2fd86a0f3f +Author: Chris Wilson +Date: Sun Jun 29 15:25:19 2014 +0100 + + intel-virtual-output: Cleanup singleton on failure + + Signed-off-by: Chris Wilson + +commit 81889664851e3a2218d1ac5d39ebd2bd3b6a4954 +Author: Chris Wilson +Date: Sun Jun 29 08:29:36 2014 +0100 + + intel-virtual-output: Convert debugging messages to verbosity + + Original patch by main.haarp: + "A verbose switch is quite useful for debugging, it shouldn't require + editing and recompilation to gain more useful output. I added it." + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80664 + Signed-off-by: Chris Wilson + +commit 665d012b8e1b9666e535a3081404406f31b8a3ef +Author: Chris Wilson +Date: Sun Jun 29 09:26:10 2014 +0100 + + sna: Ensure CPU bo is synchronized before writing + + Signed-off-by: Chris Wilson + +commit 6b906ae742ec96eeef403191d3cdded6a23a70b7 +Author: Chris Wilson +Date: Sun Jun 29 07:02:44 2014 +0100 + + sna: Update allocation of CPU bo to avoid creating active buffers + + Since we now prefer CPU detiling, exactly when we want active/inactive + buffers is a little more complex - and we also need to take into account + when we want to use the CPU bo as a render target. + + Signed-off-by: Chris Wilson + +commit b961d7323369284ea2c3db47d30c27ffe01a9040 +Author: Chris Wilson +Date: Sun Jun 29 07:00:58 2014 +0100 + + sna: Sync CPU bo before writes + + Fixes regression from + + commit 961139f5878572ebea268a0bbf47caf05af9093f [2.99.912] + Author: Chris Wilson + Date: Fri May 30 09:45:15 2014 +0100 + + sna: Use manual detiling for downloads + + Reported-by: Harald Judt + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80560 + Signed-off-by: Chris Wilson + +commit 53ef9e762a6e7802b3d5f8fba9ac17ff95545c10 +Author: Chris Wilson +Date: Sat Jun 28 21:07:08 2014 +0100 + + sna: Only preferentially upload through the GTT for large transfers + + Signed-off-by: Chris Wilson + +commit 0955f12ae04011593b71817e3151b8fb7c228899 +Author: Chris Wilson +Date: Sat Jun 28 17:38:54 2014 +0100 + + sna: Prefer linear if below tile_width + + Be stricter in order to allow greater use of CPU bo. + + Signed-off-by: Chris Wilson + +commit 3ef966f4c5bae07108ce2720f4da3c3c4e41e1aa +Author: Chris Wilson +Date: Sat Jun 28 14:23:29 2014 +0100 + + sna/io: Prefer CPU copies on LLC + + Signed-off-by: Chris Wilson + +commit 9fc052da5c4246402d2707b3a91efffa7dd81e08 +Author: Chris Wilson +Date: Sat Jun 28 14:22:17 2014 +0100 + + sna: Don't discard damage for SHM pixmaps + + We don't really want to rendering into SHM pixmaps except for copying + back due to the strict serialisation requirements. + + Signed-off-by: Chris Wilson + +commit 0f8b39d24ff15cf3373ac7293f12772ebe16b68b +Author: Chris Wilson +Date: Sat Jun 28 14:21:36 2014 +0100 + + sna: Check for a mappable GPU bo before migrating damage + + Signed-off-by: Chris Wilson + +commit cfdaee4a7e45689b0fbbc8c3166d28d69797e759 +Author: Chris Wilson +Date: Sat Jun 28 14:20:00 2014 +0100 + + sna: Skip adding damage if it is already contained + + Signed-off-by: Chris Wilson + +commit 80752fb2794faa581d891b24148eaf51c42afd25 +Author: Chris Wilson +Date: Sat Jun 28 14:19:22 2014 +0100 + + sna: Tidy calling memcpy_from_tiled + + Signed-off-by: Chris Wilson + +commit 2a0176379f0ff290d276adc72d44dfddafd96da5 +Author: Chris Wilson +Date: Sat Jun 28 14:18:23 2014 +0100 + + sna: Micro-optimise unswizzling tiling/detiling + + Signed-off-by: Chris Wilson + +commit 24cb50e53c789cb7a05d59ad103dda1c3a009485 +Author: Chris Wilson +Date: Sat Jun 28 07:05:55 2014 +0100 + + sna/trapezoids: Handle mono traps just in case + + I disabled a few paths and ended up in an assert that mono trapezoids + shouldn't get that far... + + Signed-off-by: Chris Wilson + +commit 72c041e57b99367f327c51c50fce2a55d618fc63 +Author: Chris Wilson +Date: Fri Jun 27 16:26:24 2014 +0100 + + uxa: Update Screen Pixmap width/height first + + Since commit dd6db82680b05cde4a47116b7096c054f3837e20 [2.99.912] + Author: Chris Wilson + Date: Fri May 9 20:26:19 2014 +0100 + + uxa: Add DRI3 and miSyncShm support + + we verify that the attaching bo meets the constraints required for the + Pixmap. However, when updating the ScreenPixmap following a resize, we + did not update the Pixmap size until after we tried to update the bo, + resulting in a validation failure when shrinking the screen. + + Signed-off-by: Chris Wilson + +commit 0584604b53c8676adfa1f8f4d3def22c93ea822f +Author: Chris Wilson +Date: Fri Jun 27 16:12:35 2014 +0100 + + test: Expand number of sources for basic benchmarking + + Signed-off-by: Chris Wilson + +commit edd2b789568b14c29a004a64b6ff82bb6e4e9620 +Author: Chris Wilson +Date: Fri Jun 27 16:00:03 2014 +0100 + + sna/dri2: DBG compile fixes + + Signed-off-by: Chris Wilson + +commit a6ba93283b20a50ff36758624d2967562b7bdae9 +Author: Chris Wilson +Date: Fri Jun 27 13:42:37 2014 +0100 + + sna/glyphs: Add DBG option for glyph tolerance + + And bump it to 3 so that glyph filtering doesn't force us to use the + mask too often. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit ee5c74deee77db4292ce197ab7facca422f86021 +Author: Chris Wilson +Date: Fri Jun 27 12:56:43 2014 +0100 + + sna/glyphs: Add DBG option for forcing glyphs-to-dst + + Signed-off-by: Chris Wilson + +commit 6ba4ee1fe842e975c94a01f93c6d39c20eadadbe +Author: Chris Wilson +Date: Fri Jun 27 10:38:59 2014 +0100 + + sna: Check source bo is suitable for BLT before doing so + + Signed-off-by: Chris Wilson + +commit 157e22cb8e96b0a9ffa7d58625fe2396f6084ff9 +Author: Chris Wilson +Date: Thu Jun 26 20:19:52 2014 +0100 + + sna: Only reuse pinned batches for 830/845 + + Trying to fly too close to the sun. :( + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80558 + Signed-off-by: Chris Wilson + +commit f027b4f628b6d0f4c00f8aba7b27dcf51f91211d +Author: Chris Wilson +Date: Thu Jun 26 20:24:05 2014 +0100 + + sna/dri2: Slightly improved DBG messages + + Missing git add from + + commit 2e8c09f3fe468abba9c307ba3d7b2d22908e1172 + Author: Chris Wilson + Date: Wed Jun 25 22:19:23 2014 +0100 + + sna/dri2: Hook into ClientGone callback to clear dangling references + + Signed-off-by: Chris Wilson + +commit 2ae5d7d9415a77c76078bc340066df73dce72d27 +Author: Chris Wilson +Date: Thu Jun 26 20:21:12 2014 +0100 + + sna: Tidy selection of a near-miss active buffer. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80560 + Signed-off-by: Chris Wilson + +commit 8cad98eca64224534887efbcd1c60604cd491c35 +Author: Chris Wilson +Date: Thu Jun 26 12:42:30 2014 +0100 + + sna: Fix userptr defines to match i915_drm.h + + Now that we are starting to see userptr in the headers, we see that the + definitions slightly changed. + + Signed-off-by: Chris Wilson + +commit c5c7dd24a55f04322d5eec10dc4352d8a8e92b1e +Author: Chris Wilson +Date: Thu Jun 26 09:25:06 2014 +0100 + + sna: Remove scare quotes from hotplug detection "enabled" + + Tidy up the log message by improving its formatting, and making it more + accurate. + + Signed-off-by: Chris Wilson + +commit 2e8c09f3fe468abba9c307ba3d7b2d22908e1172 +Author: Chris Wilson +Date: Wed Jun 25 22:19:23 2014 +0100 + + sna/dri2: Hook into ClientGone callback to clear dangling references + + As the Window may exist for multiple Clients, we cannot rely on the + destruction of the Window decoupling all outstanding events and + preventing chasing a stale Client pointer. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80157 + Signed-off-by: Chris Wilson + +commit 12a349974b63a47ad55384abe0d7a839af48f31a +Author: Chris Wilson +Date: Thu Jun 26 06:59:07 2014 +0100 + + sna: Make output destroy more defensive + + We may never create the properties as it may be ignored or the + allocation may fail, so we need to be careful when freeing we do not + stumble over invalid pointers. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80355#c28 + Signed-off-by: Chris Wilson + +commit 2ec2164ba4bd3a266949cdb379b6da1090475c08 +Author: Chris Wilson +Date: Wed Jun 25 18:05:46 2014 +0100 + + sna/dri2: Compile fixes for ancient Xorg + + Signed-off-by: Chris Wilson + +commit 258f8983daa3a8fe315c440f5e298ae1b02fd678 +Author: Chris Wilson +Date: Wed Jun 25 17:20:52 2014 +0100 + + sna: Fix uninitialisable variable + + sna_render.c: In function 'sna_render_picture_downsample': + sna_render.c:822: warning: 'priv' may be used uninitialized in this function + + introduced in + + commit ded05e8abb248664124d2b86f77c27497a252c4e + Author: Chris Wilson + Date: Mon Jun 23 22:15:56 2014 +0100 + + sna: Allow scratch pixmap to allocate linear GPU bo + + Signed-off-by: Chris Wilson + +commit ca0d06add926eb17fcec6c031adabb656498d744 +Author: Chris Wilson +Date: Wed Jun 25 14:19:33 2014 +0100 + + sna: Improve throttling during bo allocation + + By controlling how long we may block during buffer allocation, we can + relax the throttle elsewhere to prevent render lag buildup. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit 5ad1661b870b5b189e52383e45a9b8f570b40501 +Author: Chris Wilson +Date: Wed Jun 25 13:21:58 2014 +0100 + + sna: Only mark throttle as done after success + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit c3e4518e84300aeb8e12a0af56c2d66a1df9d8d7 +Author: Chris Wilson +Date: Wed Jun 25 11:18:01 2014 +0100 + + sna: Track desired flushes better after starting a new batch + + Signed-off-by: Chris Wilson + +commit 85bb55e4a62666fa51af34d08699950be362aa57 +Author: Chris Wilson +Date: Wed Jun 25 11:45:55 2014 +0100 + + intel: Fix weblinks (again) + + Julien pointed out that I fail at checking links. + + Reported-by: Julien Cristau + Signed-off-by: Chris Wilson + +commit ff31d49bfa48a74eb9d8cb0afb1e2882ffbc7573 +Author: Chris Wilson +Date: Wed Jun 25 11:31:58 2014 +0100 + + intel: Fix weblinks + + Matti reported a few outdated links to intellinuxgraphics.org, now + superseded by 01.org. + + Reported-by: Matti Hämäläinen + Signed-off-by: Chris Wilson + +commit 8c1729aab6b49e7d4a3f48516a629b0d23e8591b +Author: Chris Wilson +Date: Wed Jun 25 09:00:04 2014 +0100 + + sna: Tweak scanout flush + + We now distinguish gpu_dirty whilst the bo is not flushed within a batch + and needs_flush for when it is dirty and still busy. + + Signed-off-by: Chris Wilson + +commit 26c4e850b8a7d13afc351097ee6f6b2f3f90e2b9 +Author: Chris Wilson +Date: Wed Jun 25 08:18:25 2014 +0100 + + sna: Throttle before doing a TearFree buffer replacement + + If the client is rendering fast, he may be rendering too fast and + starting to build up a backlog. + + Signed-off-by: Chris Wilson + +commit ea6b0bb8e1b358d728d80daac936ec6521154302 +Author: Chris Wilson +Date: Wed Jun 25 08:05:22 2014 +0100 + + sna: And fix the typo... + + Signed-off-by: Chris Wilson + +commit 3f4da671b0a570de8734cc668d8e8975c2fdbd90 +Author: Chris Wilson +Date: Wed Jun 25 08:01:57 2014 +0100 + + sna: Disable userptr for bdw + + Something fishy is afoot. But let's kill this particularly worrisome + regression so that we can do a full round of testing. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=79053 + Signed-off-by: Chris Wilson + +commit 204ec74a61ba0b9628c686b98c48fa1220866c2d +Author: Chris Wilson +Date: Wed Jun 25 07:31:33 2014 +0100 + + sna: Check all connectors for reuse + + Do not rely on the MST path being present to indicate a connector that + may be reused. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80355 + Signed-off-by: Chris Wilson + +commit 43ad5dbc60e1f50a9cdcfc035bc271f1f28438c2 +Author: Rodrigo Vivi +Date: Tue Jun 24 03:14:54 2014 -0700 + + Add marketing names for Broadwell + + Even the unknown/reserved ones will stay with HD Graphics. + + v2: Add missing names to intel.man and README files as well. (Chris) + + Cc: Chris Wilson + Signed-off-by: Rodrigo Vivi + +commit 78053bb84217e842615669dfa2f1e7e971ce9860 +Author: Chris Wilson +Date: Tue Jun 24 20:51:54 2014 +0100 + + Add reserved PCD IDs for Broadwell + + Updating using kernel commit fb7023e0e248a33cb00d0a9cdce0bcedaa1ad284 + Author: Rodrigo Vivi + Date: Tue Jun 10 10:09:52 2014 -0700 + + drm/i915: BDW: Adding Reserved PCI IDs. + + Signed-off-by: Chris Wilson + +commit 74c1cf60a7ce7e79bc727780151f4f233798e5f4 +Author: Chris Wilson +Date: Tue Jun 24 20:49:18 2014 +0100 + + sna: Add yet more DBG messages to MST discovery + + Signed-off-by: Chris Wilson + +commit ca296c18316a3ce1682beefd5daa4702593cd529 +Author: Chris Wilson +Date: Tue Jun 24 16:37:52 2014 +0100 + + configure: Display our README before the summary + + Signed-off-by: Chris Wilson + +commit d14d7efb28c3e323203139b7c1562b1e0bc526f0 +Author: Chris Wilson +Date: Tue Jun 24 16:33:43 2014 +0100 + + intel: Add a note about the myriad places we have identifier strings + + Signed-off-by: Chris Wilson + +commit 0c7cf7a6bb1c91b59ad326198f3364554e3dfeb5 +Author: Chris Wilson +Date: Tue Jun 24 11:50:55 2014 +0100 + + intel: Wait for our expected device node to appear + + If the path we want to open for the KMS device is not yet available, + wait a short while and try again. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80397 + Signed-off-by: Chris Wilson + +commit 5c8829b30ad3acd2e59dac9ffa2aba8aadcada61 +Author: Chris Wilson +Date: Tue Jun 24 11:35:23 2014 +0100 + + sna: Add some more DBG around connector discovery + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80355 + Signed-off-by: Chris Wilson + +commit 271ed88e517745505c133bd68c40a8566ec8a625 +Author: Chris Wilson +Date: Tue Jun 24 11:24:26 2014 +0100 + + sna: Ensure serial is not 0 for runtime MST discovery + + We reserve serial==0 for the initial setup that is run before RandR is + configured. After the server is running, we have to take extra steps to + make the outputs visible to userspace. + + Signed-off-by: Chris Wilson + +commit 92dd13ae8dbddc31d0291dd12683fc7e3f65ffde +Author: Chris Wilson +Date: Tue Jun 24 11:04:01 2014 +0100 + + sna: Fix the usual "x = y" typos in creating boxes + + Fixes regression from + + commit 1d74b2e07d125ad95b9db6c9c032e90faf2bfa60 + Author: Chris Wilson + Date: Tue Jun 24 08:58:51 2014 +0100 + + sna: Decompose self-copy into overlapping/non-overlapping regions + + Signed-off-by: Chris Wilson + +commit 92119ef0939897dd1850b417d04a2ba558aee8ca +Author: Chris Wilson +Date: Tue Jun 24 10:23:03 2014 +0100 + + sna/glyphs: Clip damage to dst + + We only check if the hardware will automatically discard writes outside + of the target pixmap, but we must manually clip the damage before adding + it to our tracker. + + Reported-by: Jiri Slaby + Reported-by: Zdenek Kabelac + References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c58 + Signed-off-by: Chris Wilson + +commit b33be7fbac005eb222302ffbb533ded1cd700953 +Author: Chris Wilson +Date: Tue Jun 24 10:17:47 2014 +0100 + + sna: Trim composite region against dst clip extents + + Signed-off-by: Chris Wilson + +commit f66e25def3431a900068cc1c23a6b1e8322ef046 +Author: Chris Wilson +Date: Mon Jun 23 16:14:28 2014 +0100 + + intel: Wait for the DRM device to load + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80397 + Signed-off-by: Chris Wilson + +commit 1d74b2e07d125ad95b9db6c9c032e90faf2bfa60 +Author: Chris Wilson +Date: Tue Jun 24 08:58:51 2014 +0100 + + sna: Decompose self-copy into overlapping/non-overlapping regions + + We only need to stage the copy for the overlapping portion of the + self-copy, for the rest we can do in a single pass. + + Signed-off-by: Chris Wilson + +commit 6e2cee27c379278b0321fd1db34ed80c439115a7 +Author: Chris Wilson +Date: Tue Jun 24 07:34:46 2014 +0100 + + sna/dri2: Add a dash more asserts + + References: https://bugs.freedesktop.org/attachment.cgi?id=101618 + Signed-off-by: Chris Wilson + +commit 706480bde6120f84388a99085ed3d1cc3b759697 +Author: Chris Wilson +Date: Mon Jun 23 22:50:23 2014 +0100 + + sna: Disable CRTC after MST topology change + + In order to disable CRTC after marking outputs as removed after probing + MST topology updates, we must manually mark the CRTCs as no longer + enabled. + + Signed-off-by: Chris Wilson + +commit 5530cb4165da60f7b929b84d733d5eefcf4ec5fe +Author: Chris Wilson +Date: Mon Jun 23 15:47:13 2014 +0100 + + sna: Silence compiler warning for shadowed variable + + sna_display.c: In function 'sna_mode_redisplay': + sna_display.c:6322:12: warning: declaration of 'fb_id' shadows a global declaration [-Wshadow] + sna_display.c:223:24: warning: shadowed declaration is here [-Wshadow] + CC sna_display_fake.lo + + Signed-off-by: Chris Wilson + +commit ded05e8abb248664124d2b86f77c27497a252c4e +Author: Chris Wilson +Date: Mon Jun 23 22:15:56 2014 +0100 + + sna: Allow scratch pixmap to allocate linear GPU bo + + When allocating a scratch pixmap, we do so in the expectation that + rendering on the GPU is always preferrable, so even allocate a small + linear bo. + + Signed-off-by: Chris Wilson + +commit 6c5658b14451239b8e4333702a227d83eed09f96 +Author: Chris Wilson +Date: Mon Jun 23 14:11:27 2014 +0100 + + sna: Promote to full GPU bo after forced migration away from CPU bo + + Signed-off-by: Chris Wilson + +commit 25776547bb7d76010f948769c8c08a7f418b15fd +Author: Chris Wilson +Date: Mon Jun 23 14:02:51 2014 +0100 + + sna: Prefer rendering on the CPU to avoid damage migration + + Signed-off-by: Chris Wilson + +commit a3c9cbefcb9971900638144286b59112e3cfd404 +Author: Chris Wilson +Date: Mon Jun 23 12:27:30 2014 +0100 + + sna: Force creation of GPU bo for drawing if need be + + Now that we are more eager to transfer to the GPU bo if we expect + rendering to the CPU bo to be either slow or risk potential corruption, + we can find ourselves in a recursive loop when we also decide not to + create the GPU bo. Prevent that by explicitly creating the GPU bo if + desired. + + Signed-off-by: Chris Wilson + +commit 827b89fa2d5fca0ffd709c17bcdbfdaf95da918f +Author: Chris Wilson +Date: Mon Jun 23 11:44:22 2014 +0100 + + sna/gen6+: Initialise src offset before use + + Fixes regression from + + commit 30348efd57135edee41fccb87133c572b6473aa8 + Author: Chris Wilson + Date: Mon Jun 23 11:14:25 2014 +0100 + + sna/gen6+: Avoid adjusting copy coordinates until commited to using them + + which assumed that the render state was being zeroed. + + Reported-by: Jiri Slaby + Signed-off-by: Chris Wilson + +commit 6848fb235b1bac84e91d1efde4094540180c4d48 +Author: Chris Wilson +Date: Mon Jun 23 11:27:20 2014 +0100 + + sna: Fix flushing empty batches + + A logic inversion in + + commit 1909910fdf89216d18703e50728f4604f75d5d66 + Author: Chris Wilson + Date: Sun Jun 22 20:19:22 2014 +0100 + + sna: Inject a batch flush before adding a fresh bo + + also applied the injection to when the batch was empty. + + Reported-by: Jiri Slaby + References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c48 + Signed-off-by: Chris Wilson + +commit 60fd6764eba05f51bb83efba5593975cf8d1285b +Author: Chris Wilson +Date: Mon Jun 23 11:25:47 2014 +0100 + + sna: Handle old busy_ioctl not reporting the active ring + + If we have an old kernel, just presume that the bo was last active on the + render ring. + + Signed-off-by: Chris Wilson + +commit 30348efd57135edee41fccb87133c572b6473aa8 +Author: Chris Wilson +Date: Mon Jun 23 11:14:25 2014 +0100 + + sna/gen6+: Avoid adjusting copy coordinates until commited to using them + + If we need to fallback to the BLT unit, we need to pass it the original + source/dest coordinates and not our transformed render coordinates. So + keep the original values intact until we start emitting the render + operation. + + Signed-off-by: Chris Wilson + +commit e1e853edee67c3ced43d5e4b1fbd52ca4c92966d +Author: Chris Wilson +Date: Mon Jun 23 10:14:09 2014 +0100 + + sna/gen4+: Add some more asserts around recreating vertex buffers + + References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c46 + Signed-off-by: Chris Wilson + +commit 978790dc52fa9551b3bccbd91988b93988e937df +Author: Chris Wilson +Date: Mon Jun 23 09:47:34 2014 +0100 + + sna: Allow the CPU bo to be created if GPU rendering is forced + + Signed-off-by: Chris Wilson + +commit b2206eca00e497aff0d79a6e9feae3d9c5070dcc +Author: Chris Wilson +Date: Mon Jun 23 09:42:37 2014 +0100 + + sna/gen6+: Encourage the compiler to inline a couple of key functions + + Signed-off-by: Chris Wilson + +commit bb4c057620fb0558a77a9b7db538786ffda7cf13 +Author: Chris Wilson +Date: Mon Jun 23 09:22:13 2014 +0100 + + sna: Prefer to render over damage into the GPU bo + + Signed-off-by: Chris Wilson + +commit 416c223861aaeb61c6408e6537315b78e908df43 +Author: Chris Wilson +Date: Mon Jun 23 09:20:55 2014 +0100 + + sna: Do not set CAN_CREATE_GPU flag for untiled allocations + + Signed-off-by: Chris Wilson + +commit fb51ec44f4b6069ab854233d5d0da34eb79f754c +Author: Chris Wilson +Date: Mon Jun 23 09:07:13 2014 +0100 + + sna: Rename IGNORE_CPU to IGNORE_DAMAGE to better reflect its purpose + + Signed-off-by: Chris Wilson + +commit 96d2749660e1738847222f2d9dbb7303b7deb5bf +Author: Chris Wilson +Date: Mon Jun 23 08:18:23 2014 +0100 + + sna: Add DBG breadcrumbs to sna_output_discover() + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80355 + Signed-off-by: Chris Wilson + +commit a33aa554fa3df8ca34012cf1c6ecb11fa69ac7fc +Author: Chris Wilson +Date: Mon Jun 23 07:42:30 2014 +0100 + + sna/gen4+: Add box emitters for the generic vertex paths + + Signed-off-by: Chris Wilson + +commit 1909910fdf89216d18703e50728f4604f75d5d66 +Author: Chris Wilson +Date: Sun Jun 22 20:19:22 2014 +0100 + + sna: Inject a batch flush before adding a fresh bo + + Fresh bo (those without a reservation already defined, ala + presumed_offset) will cause the kernel to do a full relocation pass. So, + if possible flush the already correct batch in the hope of trimming the + amount of checking the kernel has to perform on this new batch. + + Signed-off-by: Chris Wilson + +commit 83cbbcd816e449402f3d49aeba3c099a20b8bc1b +Author: Chris Wilson +Date: Mon Jun 23 07:29:20 2014 +0100 + + sna: Add missing string for DBG + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80355#c12 + Signed-off-by: Chris Wilson + +commit f22ea4e821a33eccd3a9283d7ab048857008f7e8 +Author: Chris Wilson +Date: Sun Jun 22 17:53:59 2014 +0100 + + sna: Disable unused CRTC after undock events + + If undocking removes output (as the MST topology changes and some + outputs then become unreachable), we may leave dangling CRTC. This + confuses us, so disable any enabled but unconnected CRTC after the + undock event. + + Reported-by: Sree Harsha Totakura + References: https://bugs.freedesktop.org/show_bug.cgi?id=80355#c5 + Signed-off-by: Chris Wilson + +commit dca0f1c2ccf14df38764ed12b971dc491cf22608 +Author: Chris Wilson +Date: Sun Jun 22 17:53:59 2014 +0100 + + sna: Track CRTC mode changes and discard old flips + + If we have a pending flip across a modeset we must be careful to drop + the stale flip_bo after the modeset. + + Reported-by: Sree Harsha Totakura + References: https://bugs.freedesktop.org/show_bug.cgi?id=80355#c8 + Signed-off-by: Chris Wilson + +commit dae370423ad85b9d9c576277da5a9fb92ab3d3df +Author: Chris Wilson +Date: Sun Jun 22 11:45:35 2014 +0100 + + sna: Clean up CRTC on CloseScreen + + We need to do this to stop any stray references escaping through kernel + events now that we are passing the CRTC through the event. + + Signed-off-by: Chris Wilson + +commit 923dc207df7b05c138c628983ccaf2493dd63b62 +Author: Chris Wilson +Date: Thu Jun 19 10:17:11 2014 +0100 + + sna: Discard write hint from a couple more move-to-gpu + + Signed-off-by: Chris Wilson + +commit 2046a49be59866a16db776ba53a588dbf6c02b12 +Author: Chris Wilson +Date: Sat Jun 21 15:43:32 2014 +0100 + + sna: Clear the transform flag on disabling the CRTC + + In places, we assume that if the flag is set, we must have an active + CRTC. However, we were not clearing when disabling the CRTC. + + Reported-by: Sree Harsha Totakura + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80325 + Signed-off-by: Chris Wilson + +commit b3d3c0e8e75a963262e4dc463fef60d7e9f1f01a +Author: Chris Wilson +Date: Fri Jun 20 20:01:23 2014 +0100 + + sna: Avoid blending with the render engine on snoopable bo + + This seems slightly weird, as there is nothing to indicate that this + would generate incorrect results only for snoopable bo. But no many of + flushes make my pnv box happy, so adjust the placement logic to move the + blending operation away from the snoopable target. This is sensible for + reasons of avoiding snoops from the render pipeline anyway. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80253 + Reported-and-tested-by: Matti Hämäläinen + Signed-off-by: Chris Wilson + +commit 219f6bd9e863f9c89cc4168895f89741ce6dbcbb +Author: Chris Wilson +Date: Fri Jun 20 17:06:55 2014 +0100 + + sna: Be more flexible in converting random subsamples to 8x8 tiles + + Signed-off-by: Chris Wilson + +commit 91bc9e42e434abd56ce2e4fc5e08d07376fe8bd3 +Author: Chris Wilson +Date: Fri Jun 20 16:13:49 2014 +0100 + + sna: Mark up const boxes to keep the compiler happy + + Pass around const to suppress a few compiler warnings. + + Signed-off-by: Chris Wilson + +commit e5c68b4358ce541929681c8c1e0ad3ef8c1dc9ed +Author: Chris Wilson +Date: Fri Jun 20 14:31:19 2014 +0100 + + sna: Feed more operations into the 8x8 BLT tiler + + Signed-off-by: Chris Wilson + +commit d2b90ac969656de35ec86973f66074654b0e9b4b +Author: Chris Wilson +Date: Fri Jun 20 14:29:43 2014 +0100 + + sna: Color patterns for BLT are required to be aligned to 256 byte boundaries + + This so far appears to be the most restrictive alignment required, so + simply increase the upload alignment to 256 bytes. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80033 + Signed-off-by: Chris Wilson + +commit 8d7e7010e33d73a7d99948403b62d859d7a4dfaa +Author: Chris Wilson +Date: Fri Jun 20 08:28:32 2014 +0100 + + test: Increase number of tiled sources + + Significantly improve the stress impose upon the tiled BLT operations. + Also start dumping pngs of the failures. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80033 + Signed-off-by: Chris Wilson + +commit db6dfc3227155a4792ba3831681daf16839b14bb +Author: Chris Wilson +Date: Fri Jun 20 07:28:02 2014 +0100 + + sna/dri2: Don't decouple front buffer tracking for invalid SwapBuffer calls + + Signed-off-by: Chris Wilson + +commit 113a8b9be9dd7ffbc6f7c713bc40561bdf38e8b0 +Author: Chris Wilson +Date: Thu Jun 19 20:39:59 2014 +0100 + + sna: Mark upload from SHM segment as read-only + + As this may be mapped by the Xserver using a read-only SHM segment, we + are forced to treat it always as read-only. And this being X, that it is + using a SHM segment is opaque to the driver. Fantastic middlelayer. + + This was incorrectly removed in + commit e680e54eab6ffa72e5e1eb6cc0e3fe4b235b06a1 + Author: Chris Wilson + Date: Wed Jun 11 10:48:26 2014 +0100 + + sna: Ignore setting read-only for temporary userptr maps + + Also let's not forget the ShmPutImage -> CopyArea path. + + Reported-by: Christoph Haag + Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78411 + Signed-off-by: Chris Wilson + +commit df89b4941130b5ff020c6ef3e244dcf5fec45f2a +Author: Chris Wilson +Date: Thu Jun 19 20:39:59 2014 +0100 + + sna: Mark upload from SHM segment as read-only + + As this may be mapped by the Xserver using a read-only SHM segment, we + are forced to treat it always as read-only. And this being X, that it is + using a SHM segment is opaque to the driver. Fantastic middlelayer. + + This was incorrectly removed in + commit e680e54eab6ffa72e5e1eb6cc0e3fe4b235b06a1 + Author: Chris Wilson + Date: Wed Jun 11 10:48:26 2014 +0100 + + sna: Ignore setting read-only for temporary userptr maps + + Reported-by: Christoph Haag + Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78411 + Signed-off-by: Chris Wilson + +commit 6b32cf3a3c908bd29496fcf5d190fd0f8c657ae6 +Author: Chris Wilson +Date: Thu Jun 19 12:29:58 2014 +0100 + + sna: Missed fixing y tile offset in last commit + + Signed-off-by: Chris Wilson + +commit edeb2ddd170a1817ced45abada53346c5cd8c30b +Author: Chris Wilson +Date: Thu Jun 19 11:51:00 2014 +0100 + + sna: Use the right pattern origin for tiled 8x8 extraction + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80033 + Signed-off-by: Chris Wilson + +commit 1752e2d647cdb7cbff0ae7d0f0d0b761b5942965 +Author: Chris Wilson +Date: Thu Jun 19 11:14:25 2014 +0100 + + sna: Fix up small extents for 8x8 tile construction + + Signed-off-by: Chris Wilson + +commit f866a20c991d52fd2cf4ce63acc3cd44534ce5be +Author: Chris Wilson +Date: Thu Jun 19 10:49:09 2014 +0100 + + sna: Wrap pointer access for 8x8 tile construction + + The kernel can quite happily send a SIGBUS whenever we read from an bo + (due to oom), so catch it and handle it. + + Signed-off-by: Chris Wilson + +commit b1aab55d594f03e51c3abf1743d00c56ef6d7797 +Author: Chris Wilson +Date: Thu Jun 19 09:47:02 2014 +0100 + + sna: Always readback shadow damage after replacing the buffer + + Instead track what we explicitly want to discard for the next operation, + so that we don't have to copy back the whole buffer if we have to + replace the shadow and intend to overwrite it all. + + Signed-off-by: Chris Wilson + +commit f4b930318c68e0e07d677ebc7b4caa27912561db +Author: Chris Wilson +Date: Thu Jun 19 07:40:16 2014 +0100 + + sna/dri2: Replace assertion with code to skip updating the back buffer + + After a window resize or redirection, the DRI2BufferPtr become stale but + it may take a while for the Client to notice and reconfigure. Just + skip touching stale backbuffers and let the Client catch up. + + Signed-off-by: Chris Wilson + +commit c257c936b42b92827b784cee0b7caa54e6040364 +Author: Chris Wilson +Date: Wed Jun 18 22:15:42 2014 +0100 + + sna: Fix modulus for partial conversion of tiles to 8x8 patterns + + Signed-off-by: Chris Wilson + +commit 9489cc6c70abf53d9ca45228b0aa9fb1fc3f9b72 +Author: Chris Wilson +Date: Wed Jun 18 21:28:11 2014 +0100 + + sna: Delete the silly typo + + Not checking DAMAGE_IS_ALL() correctly leads to an assertion failure. + + Signed-off-by: Chris Wilson + +commit 51a0559b120dd0a57a938b300bccefbf1142e495 +Author: Chris Wilson +Date: Wed Jun 18 20:55:02 2014 +0100 + + sna: Do not treat both src/dst having no clones as being the same + + Fixes regression from + commit 62aaf2ff4f8597067cf387865707baa00ed9a123 + Author: Chris Wilson + Date: Wed Jun 18 18:41:15 2014 +0100 + + sna: Skip redundant copies when already cloned + + Signed-off-by: Chris Wilson + +commit 377b0e8657aab13dc90134853a03feb95f515567 +Author: Chris Wilson +Date: Wed Jun 18 19:59:14 2014 +0100 + + sna: Add log breadcrumbs with valgrind + + Signed-off-by: Chris Wilson + +commit 273c82a574896885f9f4a78a7463cc4620803624 +Author: Chris Wilson +Date: Wed Jun 18 18:47:14 2014 +0100 + + sna: Fix DBG compilation + + Missed updaing the DBG message in + + commit 83c0f034454ef0f474126a3398e5e790ac5ef842 + Author: Chris Wilson + Date: Wed Jun 18 16:51:46 2014 +0100 + + sna: Pass desired CRTC viewport for completing single CRTC flips + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80157 + Signed-off-by: Chris Wilson + +commit 62aaf2ff4f8597067cf387865707baa00ed9a123 +Author: Chris Wilson +Date: Wed Jun 18 18:41:15 2014 +0100 + + sna: Skip redundant copies when already cloned + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit 83c0f034454ef0f474126a3398e5e790ac5ef842 +Author: Chris Wilson +Date: Wed Jun 18 16:51:46 2014 +0100 + + sna: Pass desired CRTC viewport for completing single CRTC flips + + We cannot simply compare against the crtc->shadow_bo for all our needs, + so pass in exactly the setup we want and apply that. In particular this + is required when flipping away from the single CRTC setup on secondary + pipes. + + Fixes TearFree multi-monitor regression from + commit 3932e97057fca16615adaefbc1eb25a0d51a1d8b [2.99.912] + Author: Chris Wilson + Date: Mon Jun 9 08:58:15 2014 +0100 + + sna/dri2: Allow TearFree flipping to individual CRTC + + Reported-by: Leo Wolf + Signed-off-by: Chris Wilson + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80191 + +commit 7119d394a673f40eb467d040c6febf3749924394 +Author: Hans de Goede +Date: Wed Jun 18 15:01:37 2014 +0200 + + uxa: Mark the output as off before making pipe changes + + This is a partial "backport" of commit c6cd10f536, which makes the same + change for sna, to avoid users still using uxa ending up with a blackscreen + after plugging in an external monitor. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1032978 + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1103806 + Signed-off-by: Hans de Goede + +commit 52af321a11b5672194bc0bad033b0866221bf4c7 +Author: Hans de Goede +Date: Wed Jun 18 15:01:36 2014 +0200 + + uxa: When the output is off, report the cached backlight value + + This is a "backport" of commit b545e10c50cb to uxa, so that users who are + still using uxa, don't end up with a black screen after suspend / resume. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1032978 + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1103806 + Signed-off-by: Hans de Goede + +commit 44b5912ffcf8dcf4b4b8d3518dd0b62a284f6ee4 +Author: Chris Wilson +Date: Wed Jun 18 14:48:33 2014 +0100 + + sna/gen8: Fix cleanup after failing to convert channel + + Signed-off-by: Chris Wilson + +commit 21b6e551528fdd939004cfb02a4f192e750a33a1 +Author: Chris Wilson +Date: Wed Jun 18 14:44:09 2014 +0100 + + sna/gen8: Fix unaligned() to return true when not aligned + + Signed-off-by: Chris Wilson + +commit c5b063b8cc23cc43be458cb3b0d1b28652a24951 +Author: Chris Wilson +Date: Wed Jun 18 14:34:04 2014 +0100 + + sna: Assert that we do not try to mmap a proxy + + Signed-off-by: Chris Wilson + +commit 40bd45fb802366aa013b9089848b67a28bf3b1ee +Author: Hans de Goede +Date: Wed Jun 18 14:11:05 2014 +0100 + + backlight: Fix compiler error + + /usr/include/xorg/os.h around line 579 reads: + + extern _X_EXPORT char * + strndup(const char *str, size_t n); + + However strndup is already defined by glibc, and this redefine causes a + compile error. + + This gets triggered because backlight.c does: + + Without first doing: + + Causing HAVE_STRNDUP to not be defined. + + Signed-off-by: Hans de Goede + +commit e52f917a2370026073ed6851161393a69ee94abe +Author: Chris Wilson +Date: Wed Jun 18 10:18:26 2014 +0100 + + sna: Use nxm tiled blits for small regions of large tiles + + If the region we are blitting is either narrow or short, we may be able + to construct a tiling pattern out of a large pixmap. + + In the process, spot a regression due to + + commit 542aeca6e67fc64f9133ca3e27ac8eca28af6d25 + Author: Chris Wilson + Date: Tue Jun 17 12:26:30 2014 +0100 + + sna: Tweak creation 8x8 tiled patterns + + which copied too much from the source line. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=79888 + Signed-off-by: Chris Wilson + +commit b90f6c5aa7359ea6936ae4a7951fcd3bdad05d58 +Author: Chris Wilson +Date: Wed Jun 18 10:17:02 2014 +0100 + + sna: Simplify sna_pixmap_get_source + + kgem_bo_upload_image was open-coded, so replace it with a call to the + common function + + Signed-off-by: Chris Wilson + +commit 8ea2dd23ab85dc2d4ad0de326c2176354d61cf20 +Author: Chris Wilson +Date: Wed Jun 18 10:16:26 2014 +0100 + + sna: Add DBG option to disable snoop bo cacheing + + Signed-off-by: Chris Wilson + +commit b2081345843152dadcaa4fbc843b38240d1a3484 +Author: Chris Wilson +Date: Wed Jun 18 07:37:00 2014 +0100 + + sna/dri2: fix invalid DBG string + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80157 + Signed-off-by: Chris Wilson + +commit 77f1a16f1145e69d69a76f2db4b1c60d9a7a4d53 +Author: Chris Wilson +Date: Tue Jun 17 23:27:16 2014 +0100 + + sna: Set the correct mapping type after calling mmap__async + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80001 + Signed-off-by: Chris Wilson + +commit d49f53cc00258e3b1e1a898c02e219b336716002 +Author: Chris Wilson +Date: Tue Jun 17 22:23:02 2014 +0100 + + sna: Fix computing source bo for BLT operations + + If we migrate the pixmap to the GPU, use the GPU bo. This may fix an issue + where we might end up using the CPU bo in a rare circumstance. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80033 + Signed-off-by: Chris Wilson + +commit 475562d713a00e2f60f7ca067d753fd965d71717 +Author: Chris Wilson +Date: Tue Jun 17 22:25:05 2014 +0100 + + sna: Align some function parameters + + Signed-off-by: Chris Wilson + +commit c91fc0aad843ffc2660f6a3bf9b875d190e0b0dd +Author: Chris Wilson +Date: Tue Jun 17 17:06:05 2014 +0100 + + sna: Remove invalid assert + + Present and flip fallback may queue self-flips, so the assertion that + the crtc->flip_bo != crtc->bo is false. + + Signed-off-by: Chris Wilson + +commit 0ca25c7b49efa9c83a3ce5b727e5a339a73d8ee0 +Author: Chris Wilson +Date: Tue Jun 17 14:08:06 2014 +0100 + + sna: Cache small pixmaps rather than forcing a large fallback for BLT operations + + Signed-off-by: Chris Wilson + +commit 322e51a3a552d89e5e5ecbb82a9243f134c8d36f +Author: Chris Wilson +Date: Tue Jun 17 13:47:32 2014 +0100 + + sna: Relax PREFER_GPU so that we don't needless create small GPU bo + + Signed-off-by: Chris Wilson + +commit 542aeca6e67fc64f9133ca3e27ac8eca28af6d25 +Author: Chris Wilson +Date: Tue Jun 17 12:26:30 2014 +0100 + + sna: Tweak creation 8x8 tiled patterns + + Avoid reading back from a GTT mmapping. + + Signed-off-by: Chris Wilson + +commit 4ff5cc539bc3f88ab9c05dc67c25aab08cbdf859 +Author: Chris Wilson +Date: Tue Jun 17 10:54:39 2014 +0100 + + sna/dri2: Fixup failure to do a render copy for DRI2CopyRegion + + Signed-off-by: Chris Wilson + +commit 96d1fe314c4bb4d862b057a440e575bd32d63460 +Author: Chris Wilson +Date: Tue Jun 17 08:51:00 2014 +0100 + + sna: Add a few missing checks for all-damaged + + Signed-off-by: Chris Wilson + +commit 30f521c717f7301004e7cb77ba66b840b3f773c6 +Author: Chris Wilson +Date: Tue Jun 17 08:30:55 2014 +0100 + + sna: Discard GPU damage for the magic upload proxy + + The magic upload proxy is initially considered damaged in both the GPU + and CPU. + + Signed-off-by: Chris Wilson + +commit e5b94c2d9b29b78432aa72049934e365a2913710 +Author: Chris Wilson +Date: Tue Jun 17 08:12:42 2014 +0100 + + sna/glyphs: DBG compile fix + + Signed-off-by: Chris Wilson + +commit a4d845bc8f77e4a36064f132720ce462d0bdd5b4 +Author: Chris Wilson +Date: Mon Jun 16 14:25:16 2014 +0100 + + sna: Regularly check the cache level on bo + + Signed-off-by: Chris Wilson + +commit 09f0fe9b3943ae2ba1e0ebd679ea04177427a8cf +Author: Chris Wilson +Date: Mon Jun 16 12:53:34 2014 +0100 + + sna/dri2: Allow single crtc exchanges to be queued up + + Signed-off-by: Chris Wilson + +commit 4ab99d67990d5834061a10b0bd1dd220d4611248 +Author: Chris Wilson +Date: Mon Jun 16 12:51:08 2014 +0100 + + uxa: Allocate frontbuffer to meet old fence constaints + + libdrm is a little lax and does not allocate sufficient space for us to + safely use buffers on old gen. So compute the size we want for + ourselves. + + Reported-by: Cem Aydin + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80088 + Signed-off-by: Chris Wilson + +commit 10cb36e1ddc6f4bf41941b24d6557343aa595a13 +Author: Chris Wilson +Date: Mon Jun 16 10:33:07 2014 +0100 + + sna/glyphs: Add DBG option to force use of the glyph image mask + + Signed-off-by: Chris Wilson + +commit 8f0fc2ed4cc19c90dd2f519080915ca0c54e1baf +Author: Chris Wilson +Date: Mon Jun 16 10:27:16 2014 +0100 + + uxa: Add some explanation to why bo were rejected + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80088 + Signed-off-by: Chris Wilson + +commit 6b82962e58c0959c94f2df1f0ebd9a478b15cb6b +Author: Chris Wilson +Date: Mon Jun 16 10:13:09 2014 +0100 + + sna: Fix logic inversion for final placement in is_gpu_dst() + + Signed-off-by: Chris Wilson + +commit 62102f505cd13840e4c910adbe762b3fb46dfaec +Author: Chris Wilson +Date: Mon Jun 16 09:46:54 2014 +0100 + + sna: Promote better active buffer reuse + + Signed-off-by: Chris Wilson + +commit 2877d018d3510e415f273ce955eb5c272c340e7d +Author: Chris Wilson +Date: Mon Jun 16 09:24:45 2014 +0100 + + sna/glyphs: Show number of glyphs in DBG + + Signed-off-by: Chris Wilson + +commit 38434b29f4a7b324704bbb1e772371be3c0e397b +Author: Chris Wilson +Date: Mon Jun 16 08:03:21 2014 +0100 + + sna: Fix some batch DBG + + Helps to check for a successful read when we want to show the batch + after execution. + + Signed-off-by: Chris Wilson + +commit 243bd26ad31776b2dc45563107e669cf7b45fd91 +Author: Chris Wilson +Date: Sun Jun 15 21:42:10 2014 +0100 + + sna: Clear our private hints about front rendering exported bo + + Unlike GLXWindows, GLXPixmaps are rendered directly into, without a + staging copy. Therefore we must treat those carefully when exported and + clear our hints everytime control passes back to the Client. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79999 + Signed-off-by: Chris Wilson + +commit 500e77d765580e8581c95117b941a4daa940c21e +Author: Chris Wilson +Date: Sun Jun 15 20:55:30 2014 +0100 + + sna: Add more DBG to track transitions between CRTC and its shadow or flip bo + + Signed-off-by: Chris Wilson + +commit 0a6a94630f4fec26bed2aefb25de1a165193ff10 +Author: Chris Wilson +Date: Sun Jun 15 14:04:50 2014 +0100 + + test: Add a simple SHM test skeleton + + Signed-off-by: Chris Wilson + +commit 981aafe797f25aca4977a22f271d387b7fb4ae63 +Author: Chris Wilson +Date: Fri Jun 13 21:41:36 2014 +0100 + + sna: Enable TearFree by default for systems with PSR + + Panel Self-Refresh requires us to avoid frontbuffer rendering in order + to be power efficient. This is a job for TearFree! + + Signed-off-by: Chris Wilson + +commit b27837d5372facde0f9f69eb8df664d2798f0911 +Author: Chris Wilson +Date: Sat Jun 14 06:51:34 2014 +0100 + + sna: Fix assertions for discarding upload caches + + The upload caches are special, along with having a bo->proxy, they also + claim to be completely damaged on both the GPU and CPU. Allow that to + pass through when discarding the proxy. + + Reported-by: Nick Bowler + Bugzilla; https://bugs.freedesktop.org/show_bug.cgi?id=79992 + Signed-off-by: Chris Wilson + +commit 15485602d8451bcf6c2e979ccbd9cdc11111bcce +Author: Chris Wilson +Date: Fri Jun 13 20:30:25 2014 +0100 + + sna: Use the right is-clipped hint + + The region here has yet to be clipped, and so the only valid is-clipped + hint is from the flags computed from the PolyRect extents. Make sure we + use those when determining whether it is valid to discard damage. + + Fixes regression from + commit ad0390068832ad4727371902fe41a85a53de1894 [2.99.903] + Author: Chris Wilson + Date: Tue Sep 24 10:00:03 2013 +0100 + + sna: Separate out copy preferrence from operating in place decision + + Reported-by: Nick Bowler + Tested-by: Nick Bowler + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79992 + Signed-off-by: Chris Wilson + +commit b082a07a69ba5490fba47766c4f608b1cdf2427e +Author: Chris Wilson +Date: Fri Jun 13 18:56:57 2014 +0100 + + sna: Only discard the CPU bo if we have a GPU bo to transfer the damage to + + References: https://bugs.freedesktop.org/show_bug.cgi?id=79992 + Signed-off-by: Chris Wilson + +commit 05fdfe3b2813495ea122471ed6dde340e538aa65 +Author: Chris Wilson +Date: Fri Jun 13 21:41:16 2014 +0100 + + intel-virtual-output: Compile fixes + + Signed-off-by: Chris Wilson + +commit 8a92261b22a8c134a48d1491627ac05136563603 +Author: Chris Wilson +Date: Fri Jun 13 19:59:16 2014 +0100 + + intel-virtual-output: Disable outputs on remote displays upon shutdown + + References: https://bugs.freedesktop.org/show_bug.cgi?id=79994 + Signed-off-by: Chris Wilson + +commit 0c6fa0cdf0cebcd592281e578da7a7f53cbfe186 +Author: Chris Wilson +Date: Fri Jun 13 19:29:41 2014 +0100 + + intel-virtual-output: Initialise image after clone + + As the image inherits its width/height from the clone, we need to set + those first on the clone. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79994 + Signed-off-by: Chris Wilson + +commit 79b4e45ebe3a61f9b5937ad226eead9eebce87ac +Author: Chris Wilson +Date: Fri Jun 13 19:15:08 2014 +0100 + + intel-virtual-output: Only call XShmDetach on a valid SHM segment + + Saves a couple of extraneous XErrors. + + Signed-off-by: Chris Wilson + +commit c8074b6bcfa8c208433574721135faa4d919d32a +Author: Chris Wilson +Date: Fri Jun 13 18:37:15 2014 +0100 + + intel-virtual-output: Check for an error creating the DRI3 fd + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79994 + Signed-off-by: Chris Wilson + +commit 0a0b9dc3538ef731463fb321852b8802cd04e457 +Author: Chris Wilson +Date: Fri Jun 13 16:14:43 2014 +0100 + + sna: Refine decision whether to use the GPU or render inplace + + Signed-off-by: Chris Wilson + +commit dd87aa8f85c4bafa105fd881a0cce45bda6143df +Author: Chris Wilson +Date: Fri Jun 13 15:06:13 2014 +0100 + + sna: Track the pageflip bo's busyness + + Signed-off-by: Chris Wilson + +commit 8322e3e5c6ed19e029f365d869c80388863c424d +Author: Chris Wilson +Date: Fri Jun 13 13:50:34 2014 +0100 + + intel: Check that the fd points to i915 after authorising + + The call to GETPARAM requires either a rendernode or authorisation. + Therefore we can only assert that the fd is a valid i915 handle after + authorise() and not before. + + Reported-by: Hans de Goede + Signed-off-by: Chris Wilson + +commit 97003b1a2d6c8beb5c4df4bece5a2d5b03b5ae2f +Author: Chris Wilson +Date: Fri Jun 13 12:32:12 2014 +0100 + + sna/gen6+: Prefer the BLT for large overlapping copies + + Signed-off-by: Chris Wilson + +commit 87fc78ac4f6bbfa8e9427d392356ee26942bf955 +Author: Chris Wilson +Date: Fri Jun 13 10:52:47 2014 +0100 + + sna: Try to reuse the current cursor if we fail to update + + As a last resort, continue to display the old cursor if we tried and + failed to create a new cursor. + + Signed-off-by: Chris Wilson + +commit cd381ad96eadb72eb1a983c973a5dd47f547fc8b +Author: Chris Wilson +Date: Fri Jun 13 09:31:50 2014 +0100 + + xvmc: Refactor mutex locking + + Signed-off-by: Chris Wilson + +commit bccfb768ee14348b6db5b140fdd6df5fdbfcad0c +Author: Chris Wilson +Date: Fri Jun 13 09:14:47 2014 +0100 + + xvmc: Sanitize compile and library flags + + Signed-off-by: Chris Wilson + +commit 5a0cb1049c2fa0586708719210a2d2cffa7a4491 +Author: Chris Wilson +Date: Fri Jun 13 09:15:30 2014 +0100 + + configure: Fix DRI2 build + + One s/DRI2/have_dri2/ too far. + + Signed-off-by: Chris Wilson + +commit d47a01fce4d3d9c043a45fc034dc436c0af41981 +Author: Chris Wilson +Date: Fri Jun 13 08:51:20 2014 +0100 + + sna: Reorder ignore_cpu_damage() to avoid asserts + + Tricksy asserts making sure that the correct arguments are passed + around! + + Reported-by: Arkadiusz Miskiewicz + +commit c4d4bd5d92c7e53a7be6fa7fe119e4507af213ec +Author: Chris Wilson +Date: Fri Jun 13 08:32:34 2014 +0100 + + sna/gen8: Allow reads from scanout to be cached + + Signed-off-by: Chris Wilson + +commit 8e743ccef8f19b1226ceb8d6a5ceab65584a620d +Author: Chris Wilson +Date: Fri Jun 13 08:27:05 2014 +0100 + + sna/gen8: Check for WT support before attempting to use the WT mocs + + It appears the kernel has a better idea when WT is supported on which + gen8 parts. I assumed it was always supported, but experience suggests + otherwise, so only use WT support when advertised. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79967 + Signed-off-by: Chris Wilson + +commit 7bc669dd4b7e3e5978e95e4131d1f9215afbc041 +Author: Chris Wilson +Date: Fri Jun 13 07:48:15 2014 +0100 + + configure: Allow manual disabling of each DRI level + + Signed-off-by: Chris Wilson + +commit ffe067705b524930d243b18e97508219ed26390c +Author: Chris Wilson +Date: Thu Jun 12 09:52:50 2014 +0100 + + sna: Try to use CPU uploads before BLT uploads + + As the BLT upload implies a sync (and a likely GPU boost), only do so if + we cannot do an immediate upload with the CPU, either directly to + backing memory or through the GTT. + + Signed-off-by: Chris Wilson + +commit 93444ea673be0ac11092a13ab3354f886f4aad63 +Author: Chris Wilson +Date: Thu Jun 12 09:26:14 2014 +0100 + + sna: Refactor USE_INPLACE debug macro + + Signed-off-by: Chris Wilson + +commit abbf6d6b7962650607dc3517939991de56ce8a91 +Author: Chris Wilson +Date: Wed Jun 11 21:14:00 2014 +0100 + + sna/gen8: Clear a couple more push constants + + Signed-off-by: Chris Wilson + +commit 7f9b015d87300810712a0b6f2680249fb0576f90 +Author: Chris Wilson +Date: Wed Jun 11 19:10:22 2014 +0100 + + sna: Remove bogus assertion + + The sna_pixmap is cleared afterwards, it does not need to be clear on + free. + + Signed-off-by: Chris Wilson + +commit e3a0e40310b6c46b2f887bc0d75b11cc06ec8fa0 +Author: Chris Wilson +Date: Wed Jun 11 18:07:46 2014 +0100 + + sna: Fix direction flags for memmove + + Under a compositor, the current deltas may invert the sense of the copy + direction, causing scrolling corruption. Simplify handling those flags + by making them invariant for the function. + + Reported-by: Bruno Prémont + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79843 + Signed-off-by: Chris Wilson + +commit 55660376d555131348e7efaaec66d6d27ffc1e6e +Author: Chris Wilson +Date: Wed Jun 11 17:43:33 2014 +0100 + + sna: Use the pixmap header creation routine + + A few more places could use the common pixmap creator, just remember to + handle the SHMPixmap complication! + + Signed-off-by: Chris Wilson + +commit 1beaa980ea6a9617f7dd4dc87b881c37cc7a277b +Author: Chris Wilson +Date: Wed Jun 11 16:41:22 2014 +0100 + + sna/gen6+: On small GT avoid the intermediate copy for overlaps + + If the memory bw is constrained on the GPU avoid doing the 2-pass copy + for overlaps on the render ring, and do the single pass slower BLT copy + instead - as since it has to transfer less data it will be faster. + + Reported-by: Ildar Nurislamov + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit 31467b01e3f5ece0c8f8d4c03b52fc3f238b3d7e +Author: Chris Wilson +Date: Wed Jun 11 16:21:13 2014 +0100 + + sna/gen6+: Overlapping bo by definition have compatible depths + + Signed-off-by: Chris Wilson + +commit 0dfe7d93de893b3ead6c3be662b3a17d9335c2ca +Author: Chris Wilson +Date: Wed Jun 11 16:12:26 2014 +0100 + + sna: First copy to overlap temporary must be using GXcopy + + Signed-off-by: Chris Wilson + +commit ad076b394028c40fc6cb88c64b72e46702a936b3 +Author: Chris Wilson +Date: Wed Jun 11 15:49:43 2014 +0100 + + sna: Remove debugging hunk + + Stray hunk in self-copy boxes. + + Signed-off-by: Chris Wilson + +commit a90160dcecf0a3df21a04b4f467e660f69ddae54 +Author: Chris Wilson +Date: Wed Jun 11 15:40:25 2014 +0100 + + sna: Update damage pointer after the implicit reduction + + sna_damage_contains_box() routine implicitly reduces the damage before + performing its check. This may alter and even destroy the damage entry, + so pass in the handle so that it can be updated correctly. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit c9003c6d9602dba682e577ea7ce39990ea378db3 +Author: Chris Wilson +Date: Wed Jun 11 15:29:59 2014 +0100 + + sna: Fix scanout creation routine for old kernels <= 3.11 + + With an old kernel, we would fail to actually mark the display as part + of the scanout domain, but proceed to assign it a fb id. This caused our + asserts to report our bookkeeping error. + + Reported-by: Pavel Ondračka + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79909 + Signed-off-by: Chris Wilson + +commit 5705e66a329273c478f6ecd8f41b8f5633095581 +Author: Chris Wilson +Date: Wed Jun 11 14:34:33 2014 +0100 + + sna: Add some DBG to the memmove path + + Signed-off-by: Chris Wilson + +commit b41a51e0f54c983ef72bc31125419382d666d48c +Author: Chris Wilson +Date: Wed Jun 11 14:22:26 2014 +0100 + + sna: Tweak self-copy boxes to hit the GPU more often + + Signed-off-by: Chris Wilson + +commit b879de6246d3f2e66e9c7e326db93e5ff390159f +Author: Chris Wilson +Date: Wed Jun 11 14:08:31 2014 +0100 + + sna: Recheck source bo after migrating dst (in case of src == dst) + + Signed-off-by: Chris Wilson + +commit 21c150a873a77f983fad29b4517844a0b92e0609 +Author: Chris Wilson +Date: Wed Jun 11 14:00:04 2014 +0100 + + sna: Skip redundant clears + + Signed-off-by: Chris Wilson + +commit e1a4438f074f9cd5eba946cc1172c419c31b03c9 +Author: Chris Wilson +Date: Wed Jun 11 13:59:46 2014 +0100 + + sna/glyphs: Always print some DBG when performing fallback + + Signed-off-by: Chris Wilson + +commit 040eccb9b10d0941c7d81fc9c66c259563370f2a +Author: Chris Wilson +Date: Wed Jun 11 13:18:33 2014 +0100 + + sna: Add some asserts to track redundant damage operations + + Signed-off-by: Chris Wilson + +commit 4fccfe3a516ab8383dfd99ccd7fe1840c88bbc01 +Author: Chris Wilson +Date: Fri Jun 6 08:30:59 2014 +0100 + + sna/gen8: Check offset alignment before using a userptr for RENDER + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79053 + Signed-off-by: Chris Wilson + +commit 1217dbc88e0901e4a657ee51e2e3b7d00bb72b77 +Author: Chris Wilson +Date: Thu Apr 17 21:04:15 2014 +0100 + + sna: Support efficient cursor updates for old machines + + Given a kernel patch to fix coherency of physical objects, we can use a + more efficient method for updating cursors. + + Signed-off-by: Chris Wilson + +commit ee7d2e0a8ef882c1d4e0e77a0148b54dcfbf4236 +Author: Chris Wilson +Date: Fri Jun 6 12:00:35 2014 +0100 + + sna: MST topologies may change on any hotplug event + + As the kernel does not send out an explicit DISCOVER event, we have to + reinspect every connector after every hotplug event to detect topology + changes. + + Signed-off-by: Chris Wilson + +commit 782c920b01d5144125f2fe954e29fd7b07a1913e +Author: Chris Wilson +Date: Thu May 8 08:04:58 2014 +0100 + + sna: Create a stable output name based on MST topology + + In order to provide persistent names for MST devices, which may change + topology dynamically, the kernel exports a PATH blob. We can then use + this path to generate the output name, and so reuse existing XID when a + monitor is plugged back in. + + Based on the patch for -modesetting by Dave Airlie. + Signed-off-by: Chris Wilson + +commit e680e54eab6ffa72e5e1eb6cc0e3fe4b235b06a1 +Author: Chris Wilson +Date: Wed Jun 11 10:48:26 2014 +0100 + + sna: Ignore setting read-only for temporary userptr maps + + Signed-off-by: Chris Wilson + +commit d9bf6f3fecb3d691937da086a5270334c6c0e69a +Author: Chris Wilson +Date: Wed Jun 11 10:35:50 2014 +0100 + + sna: Prefer to operate inplace on the GPU rather than stall on the CPU + + Signed-off-by: Chris Wilson + +commit 277e6ab84bb0c692358a34a76e7962c64efb0362 +Author: Chris Wilson +Date: Wed Jun 11 10:12:01 2014 +0100 + + sna: Discard TearFree damage before checking for an overwriting upload + + Signed-off-by: Chris Wilson + +commit eb9de37daaea45e917fa7f44444a9782070f7333 +Author: Chris Wilson +Date: Wed Jun 11 09:29:50 2014 +0100 + + sna: Silence compiler warnings for discarding const Region points + + Signed-off-by: Chris Wilson + +commit 085141348cfe8386059062a58172855f72d5e5b6 +Author: Chris Wilson +Date: Wed Jun 11 08:39:42 2014 +0100 + + sna: Squelch log messages for fb/pixmap tiling in the default case + + The output is confusing, so hide it unless it is modified by the user. + + Signed-off-by: Chris Wilson + +commit 53c1faa5093f8a0c969e3ebe9f27ee1ce5137e14 +Author: Chris Wilson +Date: Wed Jun 11 07:59:41 2014 +0100 + + sna: Mark the GPU as all damaged when discarding CPU bo during uploads + + Signed-off-by: Chris Wilson + +commit e2bfa715a9e115921263d572b9f4c496b550a494 +Author: Chris Wilson +Date: Tue Jun 10 21:28:32 2014 +0100 + + sna/dri2: Check that the window covers the whole CRTC before xchg + + Fixes TearFre regression from + + commit 3932e97057fca16615adaefbc1eb25a0d51a1d8b [2.99.912] + Author: Chris Wilson + Date: Mon Jun 9 08:58:15 2014 +0100 + + sna/dri2: Allow TearFree flipping to individual CRTC + + Signed-off-by: Chris Wilson + +commit d0f32a9d3afed4ea45644723fa1134957b981125 +Author: Chris Wilson +Date: Tue Jun 10 16:37:24 2014 +0100 + + sna: Cast away compiler warning + + sna_display.c: In function 'has_user_backlight_override': + sna_display.c:595:3: warning: return discards 'const' qualifier from pointer target type [enabled by default] + + Signed-off-by: Chris Wilson + +commit 216beed6dfcb3a8d6b0b480d0281fcadb0cd3036 +Author: Chris Wilson +Date: Tue Jun 10 09:09:30 2014 +0100 + + sna: Expand debugging to cover gen8 BLT variations + + Signed-off-by: Chris Wilson + +commit f19195f7ea317f5601543724c725c4b63fdc3f60 +Author: Chris Wilson +Date: Tue Jun 10 14:25:42 2014 +0100 + + sna: Fix arguments when flipping transformed TearFree outputs + + Signed-off-by: Chris Wilson + +commit c16b2a125929c9027b62c07d47e9602553153eef +Author: Chris Wilson +Date: Tue Jun 10 13:25:57 2014 +0100 + + sna: Tidy a few asserts on the state of crtc->flip_bo + + Signed-off-by: Chris Wilson + +commit fd6aaec33d8ad70544cc02e061c9c5e68cf83414 +Author: Chris Wilson +Date: Tue Jun 10 11:01:38 2014 +0100 + + sna: Handle the user passing "Backlight" "" + + Allow the user to disable the backlight control by passing the empty + string in the xorg.conf. + + Signed-off-by: Chris Wilson + +commit cb7b27a705b477ae1b369786eea13fb14506d54a +Author: Chris Wilson +Date: Mon Jun 2 09:36:13 2014 +0100 + + 2.99.912 snapshot + +commit 52e2aa0939eee3566e4d6ee3a34f8acd93570530 +Author: Chris Wilson +Date: Tue Jun 10 08:49:41 2014 +0100 + + sna: Queue a flip after fixing up a failed flip + + After a flip fails, we try to update the CRTC manually to new fb. + However, the caller is still expecting to receive an event though the + drm device to notify when the flips are complete. In order to maintain + that ABI, we need to queue another flip after the fixup (to the + currently bound fb). + + Signed-off-by: Chris Wilson + +commit 68ac3039e4170b318952213311534cd213cbaff7 +Author: Chris Wilson +Date: Mon Jun 9 22:01:05 2014 +0100 + + sna: Fix the typo in the last commit + + Rewording the sentence and reordering the arguments was a mistake! + + Signed-off-by: Chris Wilson + +commit fdb8f490441b0ba91fdf530b982cedc2f2acf122 +Author: Chris Wilson +Date: Mon Jun 9 21:46:37 2014 +0100 + + sna: Add an extra error message before disabling a CRTC + + One of the error paths to disable a pipe was lacking a log message. + + Signed-off-by: Chris Wilson + +commit c1154ae1070806b8da1aad29f75c9659f2a403df +Author: Chris Wilson +Date: Mon Jun 9 17:04:47 2014 +0100 + + configure: Allow disabling control over the backlight + + Some OS prefer to control the backlight themselves through another + daemon and so do not want X interfering. + + Signed-off-by: Chris Wilson + +commit bb2d5e3696b52835770a62a951f7ed7e51291f88 +Author: Chris Wilson +Date: Mon Jun 9 16:30:15 2014 +0100 + + sna: Defer the copy back from the shadow CRTC bo until we allocate the target + + Signed-off-by: Chris Wilson + +commit b00a60b41736c399f849217626f246e6e7d1f7eb +Author: Chris Wilson +Date: Mon Jun 9 15:03:23 2014 +0100 + + sna: Fix cut'n'paste DBG error + + Signed-off-by: Chris Wilson + +commit 8901a99afb7be4f6f377a8e84e62e5d768c8443d +Author: Chris Wilson +Date: Mon Jun 9 14:56:02 2014 +0100 + + sna/dri2: Avoid trying to flip between bo with different pitches + + It could happen that we create front/back buffers with different + pitches. The kernel refuses to flip between such buffers, and so we will + hit some fallback paths that try to fix up the failed flips. Circumvent + such by avoiding the flip. + + Signed-off-by: Chris Wilson + +commit 16574754a99c4472c1c90c426d9c1665a898f1d6 +Author: Chris Wilson +Date: Mon Jun 9 14:54:26 2014 +0100 + + sna: Fixup normal flips between different pitches + + Apply the manual CRTC fixup in case pageflipping fails. This can happen + if the pitches between the front and back differ for example. + + Signed-off-by: Chris Wilson + +commit 3932e97057fca16615adaefbc1eb25a0d51a1d8b +Author: Chris Wilson +Date: Mon Jun 9 08:58:15 2014 +0100 + + sna/dri2: Allow TearFree flipping to individual CRTC + + Baby step. We first take advantage of TearFree to allow us to redirect a + single CRTC to the DRI2 frontbuffer and so allow a fullscreen game + covering a single monitor to avoid expensive blits when running in a + multi-monitor setup. + + Signed-off-by: Chris Wilson + +commit af3130cbba8375b9060a3a8cef5b03189d01c419 +Author: Chris Wilson +Date: Mon Jun 9 13:13:25 2014 +0100 + + sna: Do not rely on udev_monitor_receive_device() being non-blocking + + The libudev documentation says that is it non-blocking by default, but + experience shows otherwise. + + Reported-by: Sedat Dilek + Signed-off-by: Chris Wilson + +commit 981af18190be772b469761bc124b9f46c19d5093 +Author: Chris Wilson +Date: Sun Jun 8 16:55:07 2014 +0100 + + uxa: Do not FreePixmap(screen->devPrivate) + + Prevent the crash caused by + + commit 444a1f7a8802999e27ecf5f6eb598df2206f7277 + Author: Brendan King + Date: Thu Apr 24 11:37:45 2014 +0100 + + fb: fix screen pixmap leak on server reset + + Call FreePixmap() instead of free() to destroy the screen pixmap in + fbCloseScreen(). + + Signed-off-by: Frank Binns + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + + Signed-off-by: Chris Wilson + +commit 86f2cae45048158154eb2b1dbb181c3e1d6a8bf7 +Author: Chris Wilson +Date: Sun Jun 8 15:18:34 2014 +0100 + + sna/dri2: DBG compile fix + + Typo in DBG message. + + Signed-off-by: Chris Wilson + +commit 6153141fa6e1328a007efe6862ff2d7b4adaaf83 +Author: Chris Wilson +Date: Sun Jun 8 14:48:20 2014 +0100 + + sna/dri2: Allow xchg to replace the frontbuffer when all outputs are off + + Signed-off-by: Chris Wilson + +commit 9306a148cbf1a2471540f3301136d57e93197593 +Author: Chris Wilson +Date: Sun Jun 8 09:40:19 2014 +0100 + + sna/dri2: Use xchg for offscreen drawables where applicable + + Signed-off-by: Chris Wilson + +commit 22cd7c873edd0b641e54e81d643ec6b0ea921f88 +Author: Chris Wilson +Date: Sun Jun 8 08:46:27 2014 +0100 + + sna/dri2: Explicitly drain the pending event queue before swapping + + As there may be some latency between the wakeup and the queue, do a + final check if there is a pending vblank event before we decide whether + to chain up or perform an immediate flip. + + Signed-off-by: Chris Wilson + +commit 258e0cda1d69f74736d0e0be014996173e275543 +Author: Chris Wilson +Date: Sun Jun 8 08:21:38 2014 +0100 + + sna/dri2: Mark frames under construction + + As we may recurse into the vblank handler whilst waiting for the + TearFree shadow, we need to be careful that we do not queue the frame + from the vblank handler that we are in the process of constructing. + + Signed-off-by: Chris Wilson + +commit eb8f3a9b345c75023b49512c2db57527d906db7f +Author: Chris Wilson +Date: Sun Jun 8 07:45:52 2014 +0100 + + sna/dri2: Check the xchg against the Pixmap size + + As the Window may be resized between the client sending the swap request + and the xchg being processed, we need to validate the swap against the + final target not the buffers supplied originally by the client. + + Signed-off-by: Chris Wilson + +commit fc64ba821749ed0a0197a69d9bae81957aceb55f +Author: Chris Wilson +Date: Sat Jun 7 23:27:49 2014 +0100 + + sna: Restore backlight when switching to VT + + fbcon doesn't adjust the backlight when it takes over. Therefore if X + performs a VT switch whilst its outputs are off, fbcon wakes up with no + backlight and users are unhappy. Make the assumption that whoever takes + over the VT will set the outputs as it desires, and that the failsafe + value is to then turn the backlight to full. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67025 + Signed-off-by: Chris Wilson + +commit ecd80a3a997b11307445c50621d4e86e241a5b22 +Author: Chris Wilson +Date: Sat Jun 7 14:57:10 2014 +0100 + + sna: Fix reporting of TearFree + + The switch was moved after we checked whether pageflips are supported, + but the log message was left in the old location. + + Signed-off-by: Chris Wilson + +commit 035be60f332e4729fb90261605ef6c06a9d9c903 +Author: Chris Wilson +Date: Sat Jun 7 13:26:12 2014 +0100 + + sna: Release CRTC on VT switch + + In order to free up memory and improve our bookkeeping when the X server + is switched away from the current VT, disable the CRTC. + + Signed-off-by: Chris Wilson + +commit 717e00facd27696c6b8a1a6c343b2f94bfa2b59b +Author: Chris Wilson +Date: Sat Jun 7 09:07:16 2014 +0100 + + sna: Allow TearFree to be enabled by default via configure + + Signed-off-by: Chris Wilson + +commit dcb64b55092ea3da6adf357305d65b58d848db7b +Author: Chris Wilson +Date: Sat Jun 7 08:30:38 2014 +0100 + + sna: Fix TearFree for non-compositors + + The tearfree code forgot to update the shadow bo, so after the first + flip it would be rendering to the scanout anyway and flip to itself + periodically. + + Signed-off-by: Chris Wilson + +commit c65fab07402a338f015c2b339e996beca783c2bf +Author: Chris Wilson +Date: Fri Jun 6 22:07:44 2014 +0100 + + sna: Fix no relaxed delta path for gen4+ + + This is for debug purposes only. + + Signed-off-by: Chris Wilson + +commit a378196fddcf3043257a7e56225060e5e36cfa7b +Author: Chris Wilson +Date: Fri Jun 6 16:58:45 2014 +0100 + + sna: Auto-retire upload proxies + + This was disabled in + + commit 9f4f855ba37966fb91d31e9081d03cf72affb154 + Author: Chris Wilson + Date: Mon May 26 07:06:18 2014 +0100 + + sna: Implicit release of upload buffers considered bad + + as retiring the buffers during the command setup could free one of the + earlier bo used in the command. But discarding the snooped bo could + still be advantageous. So restore the automatic discard of upload + proxies, but make sure we only do between operations. + + Signed-off-by: Chris Wilson + Cc: Matti Hämäläinen + +commit 23840bd329cf4da3a4bdd5a1a466125a95473534 +Author: Chris Wilson +Date: Fri Jun 6 16:10:29 2014 +0100 + + sna: Only allow the inplace copy to replace a complete overwritten GPU bo + + And double check after recreating the new GPU bo that is still mappable. + + Signed-off-by: Chris Wilson + +commit 283ff8cbe4137f46cc027dd6aadc69d0270cb33d +Author: Chris Wilson +Date: Fri Jun 6 15:04:25 2014 +0100 + + sna: Rearrange scanout_flush checking to avoid potential crash + + With a shadow, we may never attach a GPU bo to the frontbuffer, so be + careful when checking the scanout not to dereference that NULL pointer. + + Signed-off-by: Chris Wilson + +commit 694ff54aca16ccf39e94d505942eb857b3101d7d +Author: Chris Wilson +Date: Fri Jun 6 13:34:18 2014 +0100 + + sna: Report KMS driver version + + Signed-off-by: Chris Wilson + +commit 0ebcef4f2ebe82e9b90589aa4266a9228e2b5fdb +Author: Chris Wilson +Date: Fri Jun 6 11:39:57 2014 +0100 + + man: Update notes about TearFree + + Signed-off-by: Chris Wilson + +commit 1f943a7d92d0e3a8895ba7d539cfc5e726bcc8b7 +Author: Chris Wilson +Date: Fri Jun 6 11:25:47 2014 +0100 + + sna/dri2: Restore flush on front buffers after swapping bo + + Fallout from commit 8369166349c92a20d9a2e7d0256e63f66fe2682b + Author: Chris Wilson + Date: Wed Jun 4 08:29:51 2014 +0100 + + sna/dri2: Enable immediate buffer exchanges + + We set the flush hint too early, as we may need to swap the GPU bo for a + more appropriate buffer for DRI. + + Signed-off-by: Chris Wilson + +commit c6cd10f536e099277cdc46643725a5a50ea8b525 +Author: Chris Wilson +Date: Thu Jun 5 22:43:37 2014 +0100 + + sna: Hook up a backlight udev monitor for external changes + + Changes to the backlights are notified through uevents. Hooking up a + udev monitor to listen out for external changes to the backlight (e.g. + through ACPI function keys, or by the user writing to + /sys/class/backlight directly) is easier than enabling polling on the + backlight sysfs file using X's select() mechanism. + + Since we listen to backlight changes, we have to be careful not to + confuse the side-effects of disabling connectors (which may cause either + ourselves or the kernel to turn off the backlight) with the user value. + + Many thanks to Alexander Mezin for the suggestion to use udev for + tracking the notifications for external changes to the backlight. + + Reported-by: Alexander Mezin + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79699 + Signed-off-by: Chris Wilson + +commit b545e10c50cbb2dd6f9fd53369667bed0d8f1b51 +Author: Chris Wilson +Date: Thu Jun 5 15:54:32 2014 +0100 + + sna: When the output is off, report the cached backlight value + + Signed-off-by: Chris Wilson + +commit f0b8720807d9c1994e6db91a607efe4711b0d1ca +Author: Chris Wilson +Date: Thu Jun 5 15:31:54 2014 +0100 + + sna: Inline calls to save/restore backlight around output DPMS + + The intertwined logic was a little confusing to read mixed between the + functions, so inline it. + + Signed-off-by: Chris Wilson + +commit 9f7775158341c8384da870e06cab200deddf48c1 +Author: Chris Wilson +Date: Thu Jun 5 15:31:27 2014 +0100 + + sna: Set initial output DPMS state from kernel + + Signed-off-by: Chris Wilson + +commit 9e02fe269dc79ff867d1d2cb3a8673ee2861bd56 +Author: Chris Wilson +Date: Thu Jun 5 15:49:03 2014 +0100 + + sna: Make sure we recompute the vblank interval after reconfiguring the CRTC + + Signed-off-by: Chris Wilson + +commit 51909f37ed6405c38f1c46a4012952be79031994 +Author: Chris Wilson +Date: Thu Jun 5 14:54:55 2014 +0100 + + sna: Skip marking the CRTC as damaged for TearFree + + As we have reorder the application of damage on a TearFree frontbuffer + to before we attach the CRTC, we do not need to then schedule the update + afterwards (until it gets drawn by the client). + + Signed-off-by: Chris Wilson + +commit c7efe88a895a692e5f840562a09dac385508db57 +Author: Chris Wilson +Date: Thu Jun 5 14:50:04 2014 +0100 + + sna: Fix DBG compilation + + Update the DBG to reflect the new arguments to sna_damage_reduce_all() + + Signed-off-by: Chris Wilson + +commit 9566fc0ccc71bc4fcd6bf83b567a41cc5366f5ee +Author: Chris Wilson +Date: Thu Jun 5 12:26:23 2014 +0100 + + sna: Curry parameters to sna_damage_all() + + It is far easily to pass the PixmapPtr into the function and have it + pluck out the width and height than do so in all callers. + + Signed-off-by: Chris Wilson + +commit 1327918f91dce2051b809594db5a3ed555934612 +Author: Chris Wilson +Date: Thu Jun 5 12:04:29 2014 +0100 + + sna: Mark CPU as all damaged when discarding a busy GPU bo + + When we discard a GPU bo, we need to make sure that the remaining + content is marked as only accessible via the CPU shadow pointer. + + Regression from commit 65301412ecf2d55ab55a2d7faeaa048d4ee8b1d0 + Author: Chris Wilson + Date: Sat May 17 20:59:38 2014 +0100 + + sna: Discard active GPU buffers before uploading into them + + Reported-by: Jan Alexander Steffens + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79517 + Signed-off-by: Chris Wilson + +commit 8369166349c92a20d9a2e7d0256e63f66fe2682b +Author: Chris Wilson +Date: Wed Jun 4 08:29:51 2014 +0100 + + sna/dri2: Enable immediate buffer exchanges + + The primary benefit of this is avoid the extra blit when using a + compositor and instead propagate the compositor flip on the frontbuffer + to the scanout, or equivalently allows a fullscreen game to flip onto + the scanout without intervention by TearFree. + + Signed-off-by: Chris Wilson + +commit 08148896196443a8582c30b47ff546acca78d69c +Author: Chris Wilson +Date: Tue Jun 3 15:48:55 2014 +0100 + + configure: XORG_DRIVER_CHECK_EXT does not create CFLAGS/LIBS variables + + XORG_DRIVER_CHECK_EXT only adds the package name to the list of + REQUIRED_MODULES (which is later passed to pkg-config). For our optional + dependencies, we must do a later call to pkg-config to verify the + package is available and then remember to include the includes with the + CFLAGS. + + Signed-off-by: Chris Wilson + +commit 0c81041e9b42f9df0c86c88c8648dd20ed26d0ab +Author: Chris Wilson +Date: Tue Jun 3 15:39:50 2014 +0100 + + configure: Remove xf86driproto from REQUIRED_MODULES + + We only depend upon the original DRI1 infrastructure when building i810 + with DRI support. So unless that is true, do not throw an error if the + legacy protocol is absent. + + Signed-off-by: Chris Wilson + +commit 689ee76a14da7e5f98997ac427f457af840dea3f +Author: Adam Jackson +Date: Tue Jun 3 10:26:46 2014 -0400 + + configure: Don't link the driver against libX11 + + 78dc0c04745ad4485b994f67833f4a155749f01d added REQUIRED_MODULES to the + driver link line for... some reason. That pulled in the libs from the + XF86DRI check, which near as I can tell has always been wrong, all of + the other extension checks just look for the protocol module and + xextproto doesn't define dri1 protocol in any case. + + Signed-off-by: Adam Jackson + +commit 8297c969ae749ef58d259b2ded2231b928efba43 +Author: Chris Wilson +Date: Tue Jun 3 09:47:27 2014 +0100 + + sna: Replace the bo for tiled uploads if not suitable and being replaced + + Signed-off-by: Chris Wilson + +commit 1c55d0447dba5bbde5be3903b273e04e3c9d084f +Author: Chris Wilson +Date: Tue Jun 3 12:43:51 2014 +0100 + + sna: Allow replacements to cancel operations between both bo under a Pixmap + + Signed-off-by: Chris Wilson + +commit a82bfb033448eb61bf8cc7f5358be019f0cc28e6 +Author: Chris Wilson +Date: Tue Jun 3 09:28:24 2014 +0100 + + sna: Discard unwanted damage when promoting to a full CPU migration + + Signed-off-by: Chris Wilson + +commit 4cafd1fbb1a2441a9ba5dac7f2a0e1b3f5957c62 +Author: Chris Wilson +Date: Mon Jun 2 16:01:10 2014 +0100 + + sna: Fix early return in download using the GPU + + In commit 961139f5878572ebea268a0bbf47caf05af9093f + Author: Chris Wilson + Date: Fri May 30 09:45:15 2014 +0100 + + sna: Use manual detiling for downloads + + the code for deciding when to use the GPU was refactored into a new + function that also performed the transfer, but failed to notice the + early return. + + Signed-off-by: Chris Wilson + +commit d6a412812c19fe4698752d2589ead4965048b107 +Author: Chris Wilson +Date: Mon Jun 2 10:32:11 2014 +0100 + + sna: Use CPU mmappings for linear uploads + + The other half of the commit that accidentally got included with + + commit bb49222a514b1d6041f3d9530a22f5701377118b + Author: Chris Wilson + Date: Mon Jun 2 08:25:52 2014 +0100 + + sna: Add DBG hints for using inplace CPU mmappings + + Signed-off-by: Chris Wilson + +commit 454367f5945dd17a7cfc566b1986654fc976cabe +Author: Chris Wilson +Date: Mon Jun 2 09:25:01 2014 +0100 + + Only enable the new Cursor API for the next pre-release of Xorg + + Make sure we can compile against the pre-release tarballs at the expense + of an innocuous compile warning if compiled against xserver.git + + Signed-off-by: Chris Wilson + +commit ff36e1f7546e0ac4d6e831e5cf8d1317792ed7af +Author: Keith Packard +Date: Tue Nov 19 15:20:44 2013 -0800 + + uxa: Add Present extension support + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + + Conflicts: + configure.ac + src/uxa/intel.h + src/uxa/intel_driver.c + +commit 14ff08c2827d36f7f08256dc57b84aaf80d17ab4 +Author: Keith Packard +Date: Tue Nov 19 23:20:38 2013 -0800 + + uxa: Restructure DRM event handling. + + This refactors the drm interrupt handling logic quite a bit, both to + allow for either DRI2 or Present handlers, but also to eliminate + passing pointers through the kernel. Passing pointers left the kernel + holding the only reference to some internal X server data structures. + + After a server reset, the X server would end up using stale pointers + stored in those structures. Using simple integers makes it possible to + empty the queue of pending interrupt data and then ignore the stale + kernel data. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 7f28b1cfa20eb4fc11c1a9c1e0c0fac7847be72e +Author: Keith Packard +Date: Tue Nov 19 22:58:33 2013 -0800 + + uxa: Support 64-bit MSC values. Handle kernel vageries about MSC reporting + + The kernel sometimes reports bogus MSC values, especially when + suspending and resuming the machine. Deal with this by tracking an + offset to ensure that the MSC seen by applications increases + monotonically, and at a reasonable pace. + + Also, provide a full 64 bits of MSC value by noticing wrapping and + tracking the high 32-bits of MSC separately. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + + Conflicts: + src/uxa/intel_dri.c + +commit dd6db82680b05cde4a47116b7096c054f3837e20 +Author: Chris Wilson +Date: Fri May 9 20:26:19 2014 +0100 + + uxa: Add DRI3 and miSyncShm support + + Based on a patch by Keith Packard. + + Signed-off-by: Chris Wilson + +commit 975b9798be77b30cbed485583d0ccb48318708f7 +Author: Chris Wilson +Date: Wed May 21 08:58:24 2014 +0100 + + sna: Add support for Present + + Signed-off-by: Chris Wilson + +commit d8eb87f84f88ad2df42c6fed1d93df76589a14e3 +Author: Chris Wilson +Date: Thu May 8 16:25:32 2014 +0100 + + sna: Add support for DRI3 + + Signed-off-by: Chris Wilson + +commit 0fbe8995d51b4643f1cf06c07da8b4b5ac5ae7c3 +Author: Chris Wilson +Date: Thu May 22 11:17:35 2014 +0100 + + sna: Relax tiling height restrictions + + Only force the even-tile-row alignment if we have an old GPU with an old + kernel that doesn't perform conservative alignment for us (as required). + + Signed-off-by: Chris Wilson + +commit 67b37332bd45dd4cea297107bfdc9df21984fdcd +Author: Chris Wilson +Date: Tue May 20 15:37:13 2014 +0100 + + intel-virtual-output: Add DRI3 xfer path + + Just as proof-of-principle. + + Signed-off-by: Chris Wilson + +commit 9cf6cd9726ed5ba73bb8c38c06f7b5c78706309b +Author: Chris Wilson +Date: Wed May 21 12:52:18 2014 +0100 + + Add rudimentary tests for Present + + Signed-off-by: Chris Wilson + +commit 6ab6734369fbd902a23109f4c3626df9d529891c +Author: Chris Wilson +Date: Fri May 9 11:08:15 2014 +0100 + + Add rudimentary tests for DRI3 + + This is a simple little test to create a pixmap from a local bo, copy it + to a normal pixmap, then read it back by importing it into anther local + bo. It tests the fundamental mechanisms of opening a DRI3 render device, + importing into pixmaps, exporting into /buffers and a read-barrier. + + Signed-off-by: Chris Wilson + +commit d6240d197be1e752c0de26fbf84fc8fa8d55383c +Author: Chris Wilson +Date: Wed May 14 07:55:03 2014 +0100 + + intel: Clear structs for valgrind + + When probing the module, clear structs passed into unknown ioctls to + keep valgrind quiet. + + Signed-off-by: Chris Wilson + +commit d27c948a4382c4024ce5e76f1ea82103fc8e9d66 +Author: Chris Wilson +Date: Fri May 9 13:58:37 2014 +0100 + + intel: Add common routines and configure probing for DRI3 + + Signed-off-by: Chris Wilson + +commit 8a02886a24c8699374a39a9363e72bec0e7bbe30 +Author: Chris Wilson +Date: Fri May 30 21:09:34 2014 +0100 + + sna/dri2: Use real async flips + + Presuming that we have both kernel support and Xorg support, of course. + + Signed-off-by: Chris Wilson + +commit c17d704a5baa0c902994f035d3da39d77d31fef3 +Author: Chris Wilson +Date: Fri May 30 21:21:00 2014 +0100 + + sna: Enable kernel support for asynchronous flips + + If a flip fails, attempt to restore the previous working configuration + (using a modeset) then disable further flipping. + + Signed-off-by: Chris Wilson + +commit c95a4002d1d27937731c59e84254ccb3b1246ccd +Author: Chris Wilson +Date: Sun Jun 1 08:44:13 2014 +0100 + + sna/dri2: Hide MSC reported as going backwards + + OML_sync_control mandates that MSC must be monotonic, so if the kernel + reports that they go backwards, lie. + + Signed-off-by: Chris Wilson + +commit b1c07c20a371795a8dc4102f83fe542d62d8a4e6 +Author: Chris Wilson +Date: Sat May 31 21:58:13 2014 +0100 + + sna/dri2: Always force the async blits to be immediate + + Signed-off-by: Chris Wilson + +commit 1b5f91e14226799ef4ec6461de93fa9193ef2ebc +Author: Chris Wilson +Date: Sat May 31 21:41:45 2014 +0100 + + sna/dri2: Decouple spent flip + + If the flip is already completed before we finish the previous flip, the + drawable has been replaced already and we can unchain the flip queue. + + Signed-off-by: Chris Wilson + +commit 0ee1940a4ffc1901534fa3bf15adb427527a8c20 +Author: Chris Wilson +Date: Sat May 31 13:21:04 2014 +0100 + + sna/dri2: Mark queued flip MSC as the one after next + + Signed-off-by: Chris Wilson + +commit 2df4466adae7f299eac3f7fd3e5f33ee4b22e53f +Author: Chris Wilson +Date: Fri May 30 13:27:32 2014 +0100 + + sna/gen8: Clear all URB push constant allocations + + A little paranoia to clear the unused portion of the URB and dedicate it + to VS entries. + + Signed-off-by: Chris Wilson + +commit 1618d6cfa63e31ebaedadf575dcbdf5b07451bde +Author: Chris Wilson +Date: Fri May 30 12:14:40 2014 +0100 + + sna/gen8: Set GT level + + We use the GT level to decide how favourable it is to use the GPU in + various circumstances, now set it. + + Signed-off-by: Chris Wilson + +commit bb49222a514b1d6041f3d9530a22f5701377118b +Author: Chris Wilson +Date: Mon Jun 2 08:25:52 2014 +0100 + + sna: Add DBG hints for using inplace CPU mmappings + + Signed-off-by: Chris Wilson + +commit 487df2e7b105b996c4d620ec2af6331ebc167f47 +Author: Chris Wilson +Date: Mon Jun 2 08:30:57 2014 +0100 + + sna: Silence a DBG compiler warning + + kgem.c: In function '_kgem_submit': + kgem.c:3243:12: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result] + write(fd, kgem->batch, batch_end*sizeof(uint32_t)); + + Signed-off-by: Chris Wilson + +commit ffbe0aa1851c35cc2403633ca493e9fc6a471fd4 +Author: Chris Wilson +Date: Fri May 30 18:41:39 2014 +0100 + + sna: Reuse the first scanout bo + + The path of last resort is meant to reuse the first scanout bo if they + all busy (since it will be the oldest). It chased a dangling pointer + instead. + + Signed-off-by: Chris Wilson + +commit 40fe1f2c09a98ac75b05db3663d29ee1a64ed280 +Author: Chris Wilson +Date: Fri May 30 18:30:47 2014 +0100 + + sna: Do not allow imported buffers to be cached + + Signed-off-by: Chris Wilson + +commit fc1f9b91ae2c761e4b126daecab13e13ae2534d3 +Author: Chris Wilson +Date: Fri May 30 18:11:16 2014 +0100 + + sna: Mark all caches for expiration + + Signed-off-by: Chris Wilson + +commit 3dac734bb0fb0ae1febfef9a9289cf830a87be1c +Author: Chris Wilson +Date: Fri May 30 10:31:37 2014 +0100 + + test: Only compute the masked pixel value if depth!=32 + + Minor saving for when we use a8r8g8b8. + + Signed-off-by: Chris Wilson + +commit 961139f5878572ebea268a0bbf47caf05af9093f +Author: Chris Wilson +Date: Fri May 30 09:45:15 2014 +0100 + + sna: Use manual detiling for downloads + + If we can CPU mmap the GPU bo, prefer to do so for migration to the CPU + as this saves an extra serialisation step. + + Signed-off-by: Chris Wilson + +commit 93d3df493d359f76ea710441d891a0333e755fb8 +Author: Chris Wilson +Date: Fri May 30 22:49:05 2014 +0100 + + sna: Unexport kgem_get_unique_id() + + This should always be set during bo creation + + Signed-off-by: Chris Wilson + +commit 792584fa740dbc81b72fd4f4bdf27d65b9c046cf +Author: Chris Wilson +Date: Wed May 28 14:00:26 2014 +0100 + + sna/dri2: Reorder declarations to compile on old Xorg + + Signed-off-by: Chris Wilson + +commit 562c47fc21b9029ebff29b53d2be590df4329264 +Author: Chris Wilson +Date: Wed May 28 12:51:18 2014 +0100 + + Silence CLang (almost) + + Fix up all the warnings about implicit enum conversions. The + container_of() macro remains defunct. + + Signed-off-by: Chris Wilson + +commit 6282fc9d0d3b2899be52ca4a43a3d9313e9049a6 +Author: Chris Wilson +Date: Wed May 28 10:42:58 2014 +0100 + + sna/dri2: Fix the continuation mode for old style triple buffering + + Otherwise we end up sending too many SwapCompletes back to the client + and confusing ourselves. + + Signed-off-by: Chris Wilson + +commit 916354164bcb149e1323a3219d85e7bba6e61e04 +Author: Chris Wilson +Date: Tue May 27 20:16:55 2014 +0100 + + sna: Fix the depth/format on the temporary shadow Pictures + + When scaling the output, we re-render onto the scanout using a call to + Composite, for which we create temporary Pictures. In most cases, the + mismatching depth/format goes unnoticed, but along one particular + fallback path, we use those to create a new Picture but the mismatching + format results in a segfault. + + Reported-by: Matti Hämäläinen + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79320 + Signed-off-by: Chris Wilson + +commit d8360bd74f5b62a27c019c65ed9001cac8bf43ed +Author: Chris Wilson +Date: Tue May 27 20:14:02 2014 +0100 + + sna: Handle bad picture format/depth mismatches + + Scaling the output feed in an invalid picture->format/depth combination + which causes the fallback downsampling function to explode. Whilst this + is a bug in the higher layer, we can handle the error anyway. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=79320 + Signed-off-by: Chris Wilson + +commit 93b319cf9a355e8400b864046cdb4cfb56b657a0 +Author: Chris Wilson +Date: Fri May 23 13:16:50 2014 +0100 + + uxa: Silence the compiler over a couple of unused variables + + intel_driver.c: In function 'I830LeaveVT': + intel_driver.c:1085:24: warning: unused variable 'intel' [-Wunused-variable] + intel_screen_private *intel = intel_get_screen_private(scrn); + ^ + intel_driver.c: In function 'I830EnterVT': + intel_driver.c:1102:24: warning: unused variable 'intel' [-Wunused-variable] + intel_screen_private *intel = intel_get_screen_private(scrn); + + Signed-off-by: Chris Wilson + +commit e6ee0679374f8fc80cb34693f80affe6ea676ddb +Author: Chris Wilson +Date: Fri May 23 14:29:42 2014 +0100 + + uxa: Silence compiler for warnings in Cursor API changes + + Signed-off-by: Chris Wilson + +commit 4321e8decd7be9daaa49c6ab4e8bb9bd66faae31 +Author: Chris Wilson +Date: Fri May 23 14:29:42 2014 +0100 + + sna: Silence compiler for warnings in Cursor API changes + + The API changed again in the RC, so update to keep the compiler quiet. + At the same time, protect against the ARGB_CURSOR struct changes. + + Signed-off-by: Chris Wilson + +commit 2a0dc7ed4961d5bda08bb583a7a6a2cc633b27e4 +Author: Chris Wilson +Date: Mon May 26 08:23:45 2014 +0100 + + sna/dri2: Move scanout processing from frame event to global + + The scanout is a global property, track it as so. The primary benefit to + this is it strengthens our assertions that we never hand out an active + scanout for use as a back buffer. + + Signed-off-by: Chris Wilson + +commit 05f149285b429c7b3f25ac8049477230aaef512c +Author: Chris Wilson +Date: Sun May 25 07:14:53 2014 +0100 + + sna/dri2: Defer reallocation of backbuffer until request + + If we defer the reallocation of the backbuffer until the client requests + the set of current buffers (with GetBuffers), then we can often avoid + allocating the fresh backbuffer as the flip often retires before the + client is ready. + + Signed-off-by: Chris Wilson + +commit e8d8f754ebf77f17a4666c8f649907bee50313bd +Author: Chris Wilson +Date: Fri May 23 15:52:20 2014 +0100 + + sna/dri2: Make the swap-limit transitions more obvious + + Signed-off-by: Chris Wilson + +commit 9f4f855ba37966fb91d31e9081d03cf72affb154 +Author: Chris Wilson +Date: Mon May 26 07:06:18 2014 +0100 + + sna: Implicit release of upload buffers considered bad + + Currently upload buffers are automatically decoupled when the buffer is + retired. As retiring can happen during command setup after we have + selected which bo to render with, this can free the bo we plan to use. + Which is bad. + + Instead of making the release of upload buffers automatic, we manually + check whether the buffer is idle before use as a source to consider + scrapping it and replacing it with a real GPU bo. This is likely to keep + upload buffers alive for longer (limiting reuse between Pixmaps but + making reuse of the buffer within a Pixmap more likely) which is both + good and bad. (Good - may improve the content cache, bad - may increase + the amount of memory used by upload buffers for arbitrary long periods.) + + Reported-by: Matti Hämäläinen + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79238 + Signed-off-by: Chris Wilson + +commit b508d8f3318c42a2a87b7731789b1d03610e9b46 +Author: Chris Wilson +Date: Mon May 26 06:54:03 2014 +0100 + + sna: Assert that we do not replace active IO buffers + + References: https://bugs.freedesktop.org/show_bug.cgi?id=79238 + Signed-off-by: Chris Wilson + +commit 605fcd9050efc816ac8163e8d626f466d98261c2 +Author: Chris Wilson +Date: Fri May 23 13:34:38 2014 +0100 + + sna/dri2: Handle allocation failure adding frame events gracefully + + Now that we do not preallocate the storage for the chain in the Window + devPrivates, we need to check for an allocation failure. + + Signed-off-by: Chris Wilson + +commit 36a4a654da87b22f7ce31d1ca99389cedb57eee8 +Author: Chris Wilson +Date: Fri May 23 12:48:10 2014 +0100 + + sna/dri2: Tidy add/remove chain to use the common DRI2 private + + The code is more readable directly updating the private rather than + hiding the pointer chasing through the opaque lookups. + + Signed-off-by: Chris Wilson + +commit 417997f3892b3a5fe43f5951dbde1476092ec82c +Author: Chris Wilson +Date: Fri May 23 12:40:10 2014 +0100 + + sna/dri2: Handle offscreen Window and Pixmap with CRTC tracking + + Signed-off-by: Chris Wilson + +commit d3781e19cfc3edf61b69617cd60da1e421de8ffc +Author: Chris Wilson +Date: Fri May 23 11:16:56 2014 +0100 + + test/dri2: Restore original configuration after testing + + Signed-off-by: Chris Wilson + +commit 1d6106c2893f2783611715960a0f5099ef54b4a0 +Author: Chris Wilson +Date: Fri May 23 10:11:10 2014 +0100 + + sna/dri2: Combine the DRI2 Window privates together into a single struct + + Signed-off-by: Chris Wilson + +commit d6c4e72f1a8008818fc0e5c19c9dc147f1794777 +Author: Chris Wilson +Date: Fri May 23 10:03:39 2014 +0100 + + sna/dri2: Free the private CRTC tracker on each window + + Remember to clean up our privates when the window is destroyed. + + Signed-off-by: Chris Wilson + +commit 43fd06ee7d95db4114ce7b0261685380a48a8708 +Author: Chris Wilson +Date: Fri May 23 09:03:17 2014 +0100 + + sna/dri2: Adjust current msc / target seq between CRTCs + + The target_msc supplied by the client is required to be monotonic. Since + the client does not know which CRTC the window is on, they do not + control from which pipe we derive the MSC, and so we need to adjust the + hardware values such that the client only ever sees a monotonic value. + + Signed-off-by: Chris Wilson + +commit c8decdbccdefa87b635d871a8295608961f0d22e +Author: Chris Wilson +Date: Fri May 23 09:13:31 2014 +0100 + + test/dri2: Check validity of MSC across CRTC + + Signed-off-by: Chris Wilson + +commit a6613a8fe3908433ee33a167f57a0fae4e785a22 +Author: Chris Wilson +Date: Thu May 22 23:48:20 2014 +0100 + + sna/dri2: Queue the flip immediately for the next frame + + If we compute that we want to flip on the next frame, queue it + immediately rather than take a round trip through the kernel and risk + missing the vblank. + + Signed-off-by: Chris Wilson + +commit 24443c6c897278a8a196bf4a8df9fab4485f38b4 +Author: Chris Wilson +Date: Thu May 22 22:47:35 2014 +0100 + + sna/dri2: Tidy computation of target sequence + + Signed-off-by: Chris Wilson + +commit a767ad2e50a503e2b979c976a502ff358064b820 +Author: Chris Wilson +Date: Thu May 22 21:18:10 2014 +0100 + + sna/dri2: Use the timestamps stored on the CRTC + + Now that we store the information for the swap completion on the CRTC, + we don't need to pass it around inside the frame event. + + Signed-off-by: Chris Wilson + +commit 5d80af306677b6d0c52487707bbbcf8de065803b +Author: Chris Wilson +Date: Thu May 22 13:04:31 2014 +0100 + + sna/dri2: Tweak flip continuation + + Minor tidying to the returned target_msc and a useful assertion. + + Signed-off-by: Chris Wilson + +commit 8d1e9afb60a61bf490a282a16db1c15a9ad7d077 +Author: Chris Wilson +Date: Thu May 22 12:34:05 2014 +0100 + + intel-virtual-output: Probe after claiming virtual output + + Rerun a detection cycle after claiming the virtual output so that it is + hidden again. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=78293 + Signed-off-by: Chris Wilson + +commit 0f0cd87c66a4e373ab9b26626514d43b5f4978e5 +Author: Chris Wilson +Date: Thu May 22 10:04:09 2014 +0100 + + sna/dri2: DBG fixes + + Update the DBG statements to match current code. + + Signed-off-by: Chris Wilson + +commit 80dfbaa3c39e1c56aaa9f8951e3bbcc30a9b748d +Author: Chris Wilson +Date: Thu May 22 00:24:07 2014 +0100 + + sna/dri2: Move fixed array allocations to per-crtc + + Replace the fixed size MAX_PIPES array by moving the vblank handling to + per-crtc. + + Signed-off-by: Chris Wilson + +commit 9b21237a1caa369133e6ba972e2ec39feac21bcc +Author: Chris Wilson +Date: Wed May 21 23:40:36 2014 +0100 + + sna/dri2: Maintain sequence calculation in 64bits + + Avoid casting down to 32bits at the begining of the calculation to only + then compare against the full 64bit values later. + + Signed-off-by: Chris Wilson + +commit c548f231c1d59f578dfb113c549b5b6e015e7c5a +Author: Chris Wilson +Date: Wed May 21 23:35:19 2014 +0100 + + sna/dri2: Fix WaitMSC to maintain the vblank counters + + Fix WaitMSC to also use 64 bit counters and maintain the last vblank + notifications. + + Signed-off-by: Chris Wilson + +commit 1f237bb6db9724358eca0467362c03dc6a41dc4a +Author: Chris Wilson +Date: Wed May 21 23:02:52 2014 +0100 + + sna/dri2: Apply a margin of error to the sequence wrap detection + + If we have a queue of events, we may set the msc from a recent vblank + query only to then process an older vblank event and declare the counter + wrapped. + + Signed-off-by: Chris Wilson + +commit 00d9396f6bf0bbbdfca7cdb1cbdbde8f0b2ad59c +Author: Chris Wilson +Date: Wed May 21 20:00:56 2014 +0100 + + sna: Fix attachment of the default monitor to the first output + + Broke during code motion in + + commit add84cd8a8dc6d285912d0ea3a3a3e7faa9e0942 + Author: Chris Wilson + Date: Fri May 2 13:21:02 2014 +0100 + + sna: Perform dynamic connector discovery + + Reported-and-tested-by: Jay Little + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79015 + Signed-off-by: Chris Wilson + +commit 5168a160a1385c23d275d616f2649d5cae7c15d9 +Author: Chris Wilson +Date: Wed May 21 19:16:32 2014 +0100 + + sna/dri2: Decouple queued events + + Becareful when reaping a chain on a destroyed window as some events may + be queued ahead. + + Signed-off-by: Chris Wilson + +commit 66e14c96d0ddede90e36084a80a97c3f16c2b386 +Author: Chris Wilson +Date: Wed May 21 18:38:36 2014 +0100 + + sna/dri2: Limit pending swaps to 1 when queueing a future blit + + Signed-off-by: Chris Wilson + +commit bf4475d29de589a0d0e71dfb895d19a635f8cc3e +Author: Chris Wilson +Date: Wed May 21 11:31:29 2014 +0100 + + sna/dri2: Tidy conditional use of XORG_CAN_TRIPLE_BUFFER + + Signed-off-by: Chris Wilson + +commit 0b3ea29727075bf2b0d86bbeca7dd78201936913 +Author: Chris Wilson +Date: Wed May 21 08:26:21 2014 +0100 + + sna/dri2: Tidy recording of the last swap sequence number and time + + Signed-off-by: Chris Wilson + +commit 183a0728ba52be9d052f5a5f6e6b54c4a9ee8253 +Author: Dave Airlie +Date: Wed May 21 12:41:58 2014 +1000 + + uxa: fix getmsc to not fail hard + + If some outputs go away we race with this call and apps + get X errors and fall over. Do what SNA does and don't + bother trying. + + Signed-off-by: Dave Airlie + +commit 2dbe76c4925e02b8ec20b986069e2ff38cea5bba +Author: Chris Wilson +Date: Wed May 21 07:38:35 2014 +0100 + + sna/dri2: Tidy computation of 64bit ust + + Signed-off-by: Chris Wilson + +commit a82f6a7594ee13170aba5bac7fb57cd5550b27ee +Author: Chris Wilson +Date: Tue May 20 12:20:38 2014 +0100 + + sna/dri2: Client cannot be NULL, so drop the checks + + Signed-off-by: Chris Wilson + +commit c548427e6d3a3fb50acec4b405b9d0ea977d3cc9 +Author: Chris Wilson +Date: Tue May 20 16:36:31 2014 +0100 + + sna: Only mark the scanout as being busy for writes (not solitary reads) + + Signed-off-by: Chris Wilson + +commit 61df0ffc0be8d934d86ac45c67da910479998cc7 +Author: Chris Wilson +Date: Tue May 20 12:07:50 2014 +0100 + + sna/dri2: Verify that the reference pipe is still active for flipping + + We rely on the reference pipe to drive the event wake up. If we issue a + deferred flip, there is a chance that the user could rearrange the + screen on another crtc whilst otherwise preserving the screen geometry. + + Signed-off-by: Chris Wilson + +commit 197ab0cda06c44aa1a2b17bf69ac08612811b107 +Author: Dave Airlie +Date: Tue May 20 07:45:14 2014 +0100 + + uxa: fix pageflips on 3 head scenarios + + While fixing up UXA for MST I eventually fell over this bug. + + Signed-off-by: Dave Airlie + [ickle: replace constant with macro to track pipe-dependent code] + +commit bfd0e41d5c7b8bff28ff429b26f4c977e4c37d12 +Author: Chris Wilson +Date: Mon May 19 12:31:49 2014 +0100 + + sna: Fix assertions for combining shadow transforms and TearFree + + When the RandR shadow buffer is enabled we set the sna_crtc->transform + flag. We set the crtc->transform_in_use only when coordinate transforms + are required - i.e. we may enable the shadow buffer if a CRTC is out of + bounds, but otherwise has no transformation. That confused the asserts. + + Reported-by: Zdenek Kabelac + Signed-off-by: Chris Wilson + +commit 1a84875c21b7113f55e6ce0c4a1f914524aa3f97 +Author: Chris Wilson +Date: Fri May 16 15:05:31 2014 +0100 + + sna: Switch iterators over to real CRTCs only + + Many loops only want to walk the real CRTCs, so update the loop bounds + to be explicit and assert that they are the real ones. + + Signed-off-by: Chris Wilson + +commit 65301412ecf2d55ab55a2d7faeaa048d4ee8b1d0 +Author: Chris Wilson +Date: Sat May 17 20:59:38 2014 +0100 + + sna: Discard active GPU buffers before uploading into them + + Signed-off-by: Chris Wilson + +commit f5e43058465d33025d99d83927d1ce6a8e103ff9 +Author: Chris Wilson +Date: Fri May 16 22:45:45 2014 +0100 + + sna: Do not mark an upload as a potential replace if the dst is pinned + + This saves us from trying to optimise for an operation that cannot + happen as we cannot replace the destination buffer. + + Signed-off-by: Chris Wilson + +commit df297e9fafe1a7de1036f3151f93de67661c2a4e +Author: Chris Wilson +Date: Fri May 16 18:20:06 2014 +0100 + + sna: Userptr lands upstream, enable. + + No longer an optional feature of an experimental kernel! + + Signed-off-by: Chris Wilson + +commit 89e8f2b35bbbcaac23dd1d3fc42e83d8214a9130 +Author: Chris Wilson +Date: Fri May 16 10:14:57 2014 +0100 + + sna/dri2: Update the swap type for chained flips + + We stash the pending flip mode into the closure, but failed to copy that + over to the right field when continuing with a chain of flips. The + impact was that we would fail to issue the required SwapComplete to + unblock the clients. + + Fixes regression from + commit 96ce362ba40bf9560fb1aa27a6ae5fdd2a8bd428 + Author: Chris Wilson + Date: Tue May 13 09:46:45 2014 +0100 + + sna/dri2: Do not rate-limit vblank=0 swaps + + Reported-by: francisbrwn + Signed-off-by: Chris Wilson + +commit e73d51247be5018fe53346f991e2f178c917cb13 +Author: Chris Wilson +Date: Thu May 15 23:00:53 2014 +0100 + + sna/video: Only migrate the destination window + + By using move-area-to-gpu and specifying that we overwrite the target + area, we can optimize away any needless damage migration. + + Signed-off-by: Chris Wilson + +commit 10c18b1a4631ebab5508f4308c73129f2111e964 +Author: Chris Wilson +Date: Thu May 15 21:50:41 2014 +0100 + + intel-virtual-output: Mark the source SHMPixmap as writeable + + This is fortunately a no-op, as it gets initialized to zero already + (that is the pixmap is writeable). However, we may as well do the right + thing... + + Signed-off-by: Chris Wilson + +commit b21fc65b23fcbb2b9a04eb92e3719d88e2d026dc +Author: Chris Wilson +Date: Thu May 15 11:23:16 2014 +0100 + + intel: Update PCI IDs for Cherryview + + Copied from kernel commit 7d87a7f709650bde4d7d63117f25ee1c095da5dd + Author: Ville Syrjälä + Date: Wed Apr 9 18:19:04 2014 +0300 + + srm/i915/chv: Add Cherryview PCI IDs + + and also includes non-functional changes from + + commit fd3c269f8ff940cc0fbb3b7f7e84c0572f6f759a + Author: Zhao Yakui + Date: Thu Apr 17 10:37:35 2014 +0800 + + drm/i915: Split the BDW device definition to prepare for dual BSD rings on BDW GT3 + + Signed-off-by: Chris Wilson + +commit 2afeef0c3ffeae768198fc08c9f365ccd28b7f5d +Author: Chris Wilson +Date: Thu May 15 11:28:48 2014 +0100 + + sna: Mark the CHV vsync method as unknown + + Similar to the story with Baytrail, vsync is a lost art. + + Signed-off-by: Chris Wilson + +commit d33e77d58a6f6f23e87943530197f8dc2b076981 +Author: Chris Wilson +Date: Fri May 16 09:59:25 2014 +0100 + + sna: Handle driver failures more gracefully + + Avoid busy-spinning waiting for the cache to expire after a failure. Try + to free up any overdue expiration, then if we still fail, we free the + entire cache. Currently, it would spin over the expiration until all + items were overdue and then freed. + + Signed-off-by: Chris Wilson + +commit 0625185f4772f1c7f8e8d7f265432fd77cdd27fc +Author: Chris Wilson +Date: Wed May 14 12:40:18 2014 +0100 + + intel-virtual-output: Make it possible to disable building via configure + + Signed-off-by: Chris Wilson + +commit c179003b10845b43a7a8958a99b1bf1c6617252c +Author: Chris Wilson +Date: Wed May 14 16:15:24 2014 +0100 + + sna/dri2: Ensure new immediate blits are queued behind outstanding swaps + + OML_sync_control: + If there are multiple outstanding swaps for the same window, at most + one such swap can be satisfied per increment of MSC. The order of + satisfying outstanding swaps of a window must be the order they were + issued. + + The only challenge is to keep both this behaviour and vblank_mode=0 + benchmarking. + + Signed-off-by: Chris Wilson + +commit 84d0790453089be5d1034037065df1ea37ad48fe +Author: Chris Wilson +Date: Wed May 14 11:37:51 2014 +0100 + + sna: After disabling the TearFree shadow, flush any pending flips + + If we complete a flip after resizing and recreating the TearFree shadow, + we may process the flip completion events whilst the output is only + partially reconfigured. + + Signed-off-by: Chris Wilson + +commit 68181f0b530934d74f48cb36022c17b29a76cb75 +Author: Chris Wilson +Date: Wed May 14 07:46:43 2014 +0100 + + sna/dri2: Carefully check for a completed swap + + We have to open-code kgem_bo_is_busy() in order to avoid prematurely + retiring the rq->bo. The unfortunate outcome here is that the bo may be + recycled for a new batch before it is finally released from the request. + + Reported-by: Zdenek Kabelac + Signed-off-by: Chris Wilson + +commit 9f76133e71f1a7cb44ed2f98762ba8626f1e85e6 +Author: Chris Wilson +Date: Tue May 13 12:46:39 2014 +0100 + + sna/dri2: Tighten reporting of faked flip events + + GetDrawableMSC is specified as returning the frame counter and timestamp + of the last flip event associated with the drawable, not the current + hardware timestamp. + + Signed-off-by: Chris Wilson + +commit 96ce362ba40bf9560fb1aa27a6ae5fdd2a8bd428 +Author: Chris Wilson +Date: Tue May 13 09:46:45 2014 +0100 + + sna/dri2: Do not rate-limit vblank=0 swaps + + Signed-off-by: Chris Wilson + +commit b7316feeda552a88245dadde9dadd9b40b8a4992 +Author: Chris Wilson +Date: Wed May 14 07:46:00 2014 +0100 + + sna: Add some DBG to track rogue requests + + In particular allow the pointer cache to be disabled for valgrind. + + Signed-off-by: Chris Wilson + +commit 692555cc03c3a3632d2eaacdbbe800afdefd9f77 +Author: Chris Wilson +Date: Thu May 8 15:22:44 2014 +0100 + + sna: Rename DRI2 files, functions and variables + + Signed-off-by: Chris Wilson + +commit 09e26d38e9eca33e27fd0b30524e75814d5d3ad9 +Author: Chris Wilson +Date: Wed May 14 08:42:48 2014 +0100 + + sna: Avoid promoting SHM Pixmaps for DRI + + Signed-off-by: Chris Wilson + +commit 7303c6c75df135d2d01f126f240a270ad26201c6 +Author: Chris Wilson +Date: Mon May 12 09:56:51 2014 +0100 + + sna: Check for PRIME scanouts + + Query the cache level on imported dma-bufs to see if they need special + handling. + + Signed-off-by: Chris Wilson + +commit ad01e1c8700caeaf0288b72450646d7ebe7cce93 +Author: Chris Wilson +Date: Thu May 8 13:02:15 2014 +0100 + + sna: Fix another assignment inside an assert + + Another recent introduction, spotted by Rinat Ibragimov. + + Signed-off-by: Chris Wilson + +commit e78a00c5da922024ac64270fae0797d98d1d6e57 +Author: Chris Wilson +Date: Thu May 8 06:45:43 2014 +0100 + + sna: Add an xorg.conf option for removing unused outputs + + Clients are not yet ready for outputs that disappear at runtime, often + unexpectedly dieing with asynchronous BadOutput errors. A simple + workaround is to not remove any output just yet - but allow users to opt + in via xorg.conf, i.e. + + Section "Device" + Option "DeleteUnusedDP12Displays" "true" + EndSection + + The name chosen is to be consistent with the nvidia driver, which did + MST first and encountered all of these issues first, and has also been + adopted for -modesetting. If this is combined with persistent output + naming (i.e. based on DisplayPort branch topology), the number of + outputs presented to the user should be static. + + Instead of removing the outputs, we have to mark them detached instead + to avoid throwing errors from the kernel. + + Based on the patch for -modesetting by Dave Airlie. + Signed-off-by: Chris Wilson + +commit a93157587a82c699e7df76fb482c49569f0686b9 +Author: Chris Wilson +Date: Wed May 7 21:20:56 2014 +0100 + + sna: Tidy thread handling under valgrind + + If valgrind is running, keep it simple and avoid using unknown + instructions (causing valgrind to die with SIGILL). + + Signed-off-by: Chris Wilson + +commit efd9e9c3eeb83b9e5725fa642066925d608c059d +Author: Chris Wilson +Date: Wed May 7 21:19:57 2014 +0100 + + sna/dri: Use move-area-to-gpu to handle clipped regions more efficiently + + Signed-off-by: Chris Wilson + +commit 1385ca9eeb26b0b82b623da619a65036830ccceb +Author: Chris Wilson +Date: Wed May 7 21:19:32 2014 +0100 + + sna: Initialize value read through ioctl to please valgrind + + Signed-off-by: Chris Wilson + +commit 7d516589ba9d0325e57e08d41becff64f81e2d00 +Author: Chris Wilson +Date: Wed May 7 17:49:15 2014 +0100 + + sna/dri: Implement TripleBuffering using DRI2SwapLimit + + An addition to DRI2 that was overlooked at the time, was the support + added for having multiple outstanding swap requests in the core. The + importance of this is that we can then send the SwapComplete reply after + the pageflip is completed and not before as we currently do to fake + triple buffering - in clear violation of OML_sync_control. + + Signed-off-by: Chris Wilson + +commit 18416b5162e6d6e5415916c55c935b08c980d7f3 +Author: Chris Wilson +Date: Wed May 7 13:49:13 2014 +0100 + + sna: Don't assign in an assert + + That just nullifies the point of the assert in the first place. + + Spotted-by: Joakim Tjernlund + Signed-off-by: Chris Wilson + +commit 0250a4f4ba5b765fe4e9be585e03c92aa2376402 +Author: Chris Wilson +Date: Wed May 7 12:40:01 2014 +0100 + + sna: Fix bogus assertion about conn->encoder_id + + The connector's encoder_id is only set if the output is active. + + Signed-off-by: Chris Wilson + +commit c410f0cd982cad8de440727b0ad7d9268b89a704 +Author: Chris Wilson +Date: Wed May 7 11:04:10 2014 +0100 + + sna: Set desired mode after rediscover during VT switch + + When switching back to the VT, rerun the output discovery (if such an + event was pending) before we attempt to set the desired modes. + + Signed-off-by: Chris Wilson + +commit c38512e12e879ae8932528a9cac5ffbf4ea138c0 +Author: Chris Wilson +Date: Wed May 7 11:01:30 2014 +0100 + + sna: Run output discovery before modes query + + If we keep the separate discovery uevent, we need to run it first in the + cases where we get combined discovery+hotplug events. + + Signed-off-by: Chris Wilson + +commit 7aefd003bb65cc52a74dfcfd8af4b67a364343ff +Author: Chris Wilson +Date: Wed May 7 10:13:53 2014 +0100 + + sna: Fix unattached outputs for ZaphodHeads + + We need to preserve possible_crtcs for the later check that we can use + the output with the particular ZaphodHead (which owns a CRTC). + + Signed-off-by: Chris Wilson + +commit c5bad6daaaa60fa8970eaf4a1ce485cd4c72c2fd +Author: Chris Wilson +Date: Wed May 7 07:53:11 2014 +0100 + + intel-virtual-output: Disable remote CRTC using the remote Display! + + Reported-by: Kirill Müller + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78293 + Signed-off-by: Chris Wilson + +commit 632d3dfe215c38f2dd052625ea8ec34582dfafef +Author: Chris Wilson +Date: Tue May 6 12:24:37 2014 +0100 + + sna: Treat encoder id array as invariant + + Signed-off-by: Chris Wilson + +commit f62dfd8f518bb4117d395f81b684340dc4f1ede5 +Author: Chris Wilson +Date: Tue May 6 07:37:59 2014 +0100 + + sna: Allow connectors without an associated encoder + + In the future, we may see a setup where connectors are created without + being attached to a specific encoder, instead associated with multiple + generic encoders - such as DP MST sink devices. To handle this, we need + to recheck their active encoder at runtime after branch configuration + events (or possibly hotplug). + + Signed-off-by: Chris Wilson + +commit ea602f7e10c6319c4213776b49f2ae25739af316 +Author: Chris Wilson +Date: Tue May 6 06:58:35 2014 +0100 + + sna: Discard the TearFree damage when doing a full CPU migration + + Signed-off-by: Chris Wilson + +commit b8d71e029cec5c8d1c7e344331b86d2e27f6bc24 +Author: Chris Wilson +Date: Mon May 5 20:59:24 2014 +0100 + + sna: Tidy computation of clone/crtcs for fake outputs + + Signed-off-by: Chris Wilson + +commit 77507909a18b687698f6d4e436ef66d942308fc3 +Author: Chris Wilson +Date: Mon May 5 19:43:25 2014 +0100 + + intel-virtual-output: Grab the server whilst cleanging up the local output + + Signed-off-by: Chris Wilson + +commit 56126d00503fd9bc6fe30781ecddb2fb67de817b +Author: Chris Wilson +Date: Mon May 5 18:17:01 2014 +0100 + + sna: Refine hints to allow inplace writes whilst compositing aligned traps + + Signed-off-by: Chris Wilson + +commit 464ef44ab1d691a4bffecbe88be8182adf9fd4ff +Author: Chris Wilson +Date: Mon May 5 14:49:31 2014 +0100 + + intel-virtual-output: Copy existing CRTC information + + If we fail to disable the remote output during initialisation, copy the + current configuration in order to try and keep the bookkeeping in order. + + Signed-off-by: Chris Wilson + +commit 194f9332d35601178ae3595bc17a3f52f5644cb9 +Author: Chris Wilson +Date: Mon May 5 14:29:16 2014 +0100 + + intel-virtual-output: Try disabling Panning after disabling CRTC + + Signed-off-by: Chris Wilson + +commit 5279ebf56449a9b9edd28ff23e9c8a20af792795 +Author: Chris Wilson +Date: Mon May 5 13:06:11 2014 +0100 + + intel-virtual-output: Mark ShmPixmap destinations as writeable + + In order to prevent a subsequent BadAccess when we try to use it as a + ShmPixmap, we need to mark the segment as writeable. + + Signed-off-by: Chris Wilson + References: https://bugs.freedesktop.org/show_bug.cgi?id=78293 + +commit a93d2d4f910dc66fe7114a4f44bf8098e3f7ae7a +Author: Chris Wilson +Date: Mon May 5 13:03:14 2014 +0100 + + intel-virtual-output: Check for errors whilst creating ShmPixmaps + + Creating a ShmPixmap may cause an asynchronous BadAccess error, so wrap + the construction with XSync and check for an error before proceeding. + + Signed-off-by: Chris Wilson + References: https://bugs.freedesktop.org/show_bug.cgi?id=78293 + +commit 45892b3a63613af67e249e9ad006f2b2002570c0 +Author: Chris Wilson +Date: Mon May 5 12:41:06 2014 +0100 + + intel-virtual-output: Record shm/randr/xinerama queries in DBG log + + Signed-off-by: Chris Wilson + +commit 6c9f216d7ce7c329b1008cb09c9de55396e0e6b1 +Author: Chris Wilson +Date: Mon May 5 12:38:51 2014 +0100 + + intel-virtual-output: Check error state when disabling CRTC + + Only mark an output as disabled if we do successfully disable it. This + will require a little more work to make sure that such errors are + cleanly propagated back to the host... + + Signed-off-by: Chris Wilson + +commit ef178f7d6955e12383c64ad9ee706db0e931992e +Author: Chris Wilson +Date: Mon May 5 09:37:56 2014 +0100 + + sna: Fix loop iteration whilst deleting connectors + + If we remove a connector/output, we need to not advance the iterator or + else we skip over an output (as the array is reduces inside the loop). + + Signed-off-by: Chris Wilson + +commit 8fd13a52072c2f8f12f934deaba1ef9ddb16d5f9 +Author: Chris Wilson +Date: Mon May 5 09:32:59 2014 +0100 + + sna: Reorder connector initialisation to avoid leak + + If the output was ignored, we would leak the allocations. However, we + can check the output name after the first GETCONNECTOR/GETENCODER + request before any allocations. + + Signed-off-by: Chris Wilson + +commit 55f567f9d8dd1bbc21acf30f02d394e54ddc8157 +Author: Chris Wilson +Date: Sun May 4 12:13:25 2014 +0100 + + sna/dri: Report the last known MSC whilst the pipe is off + + From OML_sync_control: + "The graphics MSC value is incremented once for each screen refresh. + For a non-interlaced display, this means that the graphics MSC value + is incremented for each frame." + + When the pipe is disabled, return the last known MSC such that the + reported value is always monotonic and consistent with the pipe when it + is active again. That also is consistent with OML_sync_control which + says that the MSC is a vertical refresh counter, and by implication does + not increase whilst the pipe is off. + + Signed-off-by: Chris Wilson + +commit 080e9f99857081bca063c67afb7c98854d1f61f4 +Author: Chris Wilson +Date: Sun May 4 11:59:40 2014 +0100 + + sna: Prefer PrimaryOutput for timing signals + + If the drawable is even partially on the PrimaryOutput, use that pipe + for determining synchronisation counters and synchronised updates. + + OML_sync_control: + "For a multi-monitor system, the monitor used to + determine MSC is screen 0 of ." + + The PrimaryOutput is the nearest approximation we have to "screen 0". We + also deviate in handling what hapens when that screen is off, which is + not mentioned at all in OML_sync_control. + + Signed-off-by: Chris Wilson + +commit 828bd9e250b7d9dd1dc4185c0179237e9b21d8bf +Author: Chris Wilson +Date: Fri May 2 17:13:29 2014 +0100 + + sna: Reorder cursor initialisation + + It helps to initialise the cursors after we setup one of the values we + depend on. + + Signed-off-by: Chris Wilson + +commit 38f82655e0bc8f26250f56e9a25aedd30b46360c +Author: Chris Wilson +Date: Fri May 2 12:30:43 2014 +0100 + + sna: Remove incorrect cursor assertion + + Ideally, we want to assert that we have sufficient stashed cursors to + allocate for the unused CRTCS, so something like + assert(num_stash + num_active_cursors >= 0); + + Reported-by: Zdenek Kabelac + Signed-off-by: Chris Wilson + +commit 430152da82f496ac47f33ce1eca65d154af38752 +Author: Chris Wilson +Date: Fri May 2 16:57:27 2014 +0100 + + compat: Add missing wrapper for RegionSubtract + + Signed-off-by: Chris Wilson + +commit add84cd8a8dc6d285912d0ea3a3a3e7faa9e0942 +Author: Chris Wilson +Date: Fri May 2 13:21:02 2014 +0100 + + sna: Perform dynamic connector discovery + + One of the side-effects of MST is that we need to support dynamic + attachment and removal of displays as the branch hierachy changes. + + Signed-off-by: Chris Wilson + +commit 3123dec3dfc55fbca32d32eaaa8ac29396b28c49 +Author: Chris Wilson +Date: Fri May 2 10:40:47 2014 +0100 + + sna: Do not stash drmModeResPtr + + In the near future we will be dealing with dynamic discovery of + connectors, and so we cannot assume that the mode resources will be + static for our lifetime. The first step is to not keep that struct + around, but pull out the useful information and discard it. + + Signed-off-by: Chris Wilson + +commit 7b072074aa2b08c09a3d920d67f38ae73009ced6 +Author: Chris Wilson +Date: Fri May 2 08:27:07 2014 +0100 + + sna: Refactor hints for GPU promotion of composite fills + + The major change here is not do a full promotion if we are filling + through a clip region. The original intention was to catch doing the + initial clear of the background, but it was also triggering for drawing + rectangular outlines etc. + + Signed-off-by: Chris Wilson + +commit 81608b4da5b35993cd2071098235c14920b7236d +Author: Chris Wilson +Date: Thu May 1 13:15:11 2014 +0100 + + sna: Do not discard damage when using the CPU to perform BLT spans + + The BLT paths are only taken when we know we are overwriting the target + contents, and so we do not have to worry about reads along those paths. + However, in terms of migrating the damage for a pixmap, we have to be + careful in case we do not write to the full area of the composite + rectangle, in which case we have to treat it as a read to that area and + migrate the damage. + + Regression from + commit a13781d19defc97af6a279c11a85e33ef825020e [2.20.10] + Author: Chris Wilson + Date: Sun Aug 19 09:45:12 2012 +0100 + + sna: Enable BLT composite functions to target CPU buffers + + Signed-off-by: Chris Wilson + + Reported-by: Matti Hämäläinen + Signed-off-by: Chris Wilson + +commit 150458c402f2a93e87924dacd3d0e99def512b85 +Author: Chris Wilson +Date: Thu May 1 09:42:07 2014 +0100 + + sna: Refactor migration DBG code + + And add a new DBG option to disable partial-cpu migrations. + + Signed-off-by: Chris Wilson + +commit ca57ee723497b07396646e567fd87dfce8d779fa +Author: Chris Wilson +Date: Thu May 1 09:15:28 2014 +0100 + + sna: Add some DBG for tracing vblanks across modeset/resume + + Signed-off-by: Chris Wilson + +commit bcbb2f222c39ab8732bf1daa248c77ce22cc173e +Author: Chris Wilson +Date: Wed Apr 30 14:43:01 2014 +0100 + + sna/dri: Tidy call to vblank ioctl for MSC waiting + + Signed-off-by: Chris Wilson + +commit 4430703619dc6012407ab703f211dc1181ba6ec8 +Author: Chris Wilson +Date: Wed Apr 30 11:10:49 2014 +0100 + + sna: Be more lenient and allow tiled uploads to replace CPU buffers + + Signed-off-by: Chris Wilson + +commit 2fd1a05ac50ac4ba7cf09225f9133a8141aef302 +Author: Chris Wilson +Date: Tue Apr 29 13:51:33 2014 +0100 + + sna/video: Initialise pitch before query + + Signed-off-by: Chris Wilson + +commit 41a573c15ca1a1e775a2060be117374a5bc6f9b9 +Author: Chris Wilson +Date: Tue Apr 29 13:30:14 2014 +0100 + + sna: Discard TearFree damage on partial migration + + If we are overwriting part of the framebuffer, we know we do not need to + read that portion back from the scanout. + + Signed-off-by: Chris Wilson + +commit d75501572a4ea95fc126314718468345630723a1 +Author: Chris Wilson +Date: Tue Apr 29 13:29:45 2014 +0100 + + sna: Preserve cpu hint for compatible mmapping of the GPU bo + + Signed-off-by: Chris Wilson + +commit 94e39323772ef6561efcc0620f67cabd2462a0d0 +Author: Chris Wilson +Date: Tue Apr 29 09:02:50 2014 +0100 + + sna: Recycle physical cursors + + A side-effect of the workaround for incoherent physical cursors is that + we never reused a cursor after disabling. As such moving the cursor off + the pipe and back on would eventually consume all the preallocated + structs leading to a segfault. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78002 + Signed-off-by: Chris Wilson + +commit 0b23011c27736d0ae2b33d8ea147c16b909baa57 +Author: Chris Wilson +Date: Mon Apr 28 15:59:18 2014 +0100 + + sna: Tweaks to cursor DBG logging + + Signed-off-by: Chris Wilson + +commit d4bd452caa335a54076fa003ee616c2efe93bca3 +Author: Chris Wilson +Date: Mon Apr 28 14:01:43 2014 +0100 + + sna: Assert against underflows in BLT command lengths + + Signed-off-by: Chris Wilson + +commit 2a993c8aa9e8594c32d5e67329b0dbed0d92c761 +Author: Chris Wilson +Date: Mon Apr 28 12:53:00 2014 +0100 + + sna: Initialise pointer before use + + commit 534a0e6433a37c95f7181f7ce9046a4e7c82532d + Author: Chris Wilson + Date: Mon Apr 28 07:53:13 2014 +0100 + + sna: Factor in destination sizes for choosing intermediate tiling bo size + + assumed that the target bo was being initialisation for the tiling + composite; it was not. + + Signed-off-by: Chris Wilson + +commit f0042850494ac16149ba310c910ca08f86c191fa +Author: Chris Wilson +Date: Mon Apr 28 08:37:11 2014 +0100 + + sna: Rearrange final aperture check + + If we cross the high water mark, first flush the batch, then check the + remaining pages to see if they fit into the aperture. + + Reported-by: Bruno Prémont + Signed-off-by: Chris Wilson + +commit 7a685d1d7b63a1589ba0fd09168d4f95d18fcae5 +Author: Chris Wilson +Date: Mon Apr 28 08:31:59 2014 +0100 + + sna: Add a minor DBG for tiled copies + + Signed-off-by: Chris Wilson + +commit 3e330f3980b7bacad30b25ff144e4162acc854bb +Author: Chris Wilson +Date: Mon Apr 28 08:15:35 2014 +0100 + + sna: Refine fence packing estimates + + Signed-off-by: Chris Wilson + +commit 534a0e6433a37c95f7181f7ce9046a4e7c82532d +Author: Chris Wilson +Date: Mon Apr 28 07:53:13 2014 +0100 + + sna: Factor in destination sizes for choosing intermediate tiling bo size + + When tiling, factor in the destination usage of the aperture in case + that reduces the available aperture for the intermediate bo. + + Signed-off-by: Chris Wilson + +commit 11cc397cb1cded40f7ab43c1add3fd00b97c6bdc +Author: Chris Wilson +Date: Sun Apr 27 07:55:09 2014 +0100 + + sna: Preallocate cursors + + We need to avoid all allocations within the signal handlers, so + preallocate the cursor structs. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77975 + Signed-off-by: Chris Wilson + +commit 9417f13cc4074ea6e5dad88e054337e93b461a4c +Author: Chris Wilson +Date: Sun Apr 27 07:55:09 2014 +0100 + + sna: Preallocate pwrite scratch buffer for old fashioned cursor updates + + We need to avoid all allocations within the signal handlers, so + preallocate the transfer buffer. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77975 + Signed-off-by: Chris Wilson + +commit 795cebf053e8457b998522ab7eea80b0819cb46b +Author: Chris Wilson +Date: Sun Apr 27 07:52:14 2014 +0100 + + sna: Replace cursor gen test with feature flag + + Signed-off-by: Chris Wilson + +commit 1b76a1f6fb046353b1e2f553dfcb03978807272d +Author: Chris Wilson +Date: Sun Apr 27 08:32:17 2014 +0100 + + sna: Initialise cursors after checking for KMS + + Signed-off-by: Chris Wilson + +commit b3c5a524965958b5b11a1195e773d10ac9fc6611 +Author: Chris Wilson +Date: Wed Apr 23 14:23:55 2014 +0100 + + sna: Tweak use inplace CPU maps for writing + + Allow us to write into a GPU bo without any pending CPU damage. + + Signed-off-by: Chris Wilson + +commit c872be6cbef3b07dc79fc8f83d719543c0adcdee +Author: Chris Wilson +Date: Wed Apr 23 14:23:55 2014 +0100 + + sna: INPLACE has early exits in move-to-cpu + + We can update the priv->cpu flag more accurately by accounting for the + early exits for the INPLACE accessors. + + Signed-off-by: Chris Wilson + +commit 05cf93287419992208493f5098fc7b089e95b20c +Author: Chris Wilson +Date: Wed Apr 23 14:21:39 2014 +0100 + + sna: Be more selective of reusing bo for inplace uploads on !LLC + + On older architectures, we can only do the inplace upload into a GPU bo + into a new unused bo (that is still in the GPU domain). + + Signed-off-by: Chris Wilson + +commit cf7efedb32b63901f7e42a90f756899b9ba60e65 +Author: Chris Wilson +Date: Wed Apr 23 14:20:47 2014 +0100 + + sna: Tweak untiled limits + + Allow more small pixmaps to use untiled for linear mmappings. + + Signed-off-by: Chris Wilson + +commit 5fbbfd4dd35c5e5381897b7e5d4c16c1f182ef2b +Author: Chris Wilson +Date: Wed Apr 23 11:34:06 2014 +0100 + + sna/video: Show sprites across all outputs + + If an overlay video (using the sprite interface) is visible on multiple + outputs, we have to create and show a sprite for each. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77802 + Signed-off-by: Chris Wilson + +commit 3508f809c40bc59d67deb7182807664bc0648639 +Author: Chris Wilson +Date: Wed Apr 23 11:46:12 2014 +0100 + + sna: Fix assertions for mmapping stolen buffers + + Signed-off-by: Chris Wilson + +commit aec3cbb1aba8bae5537534754ea57d21896d591b +Author: Chris Wilson +Date: Wed Apr 23 09:17:22 2014 +0100 + + sna: Reuse any output not explicitly disconnected + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77768 + Signed-off-by: Chris Wilson + +commit 4ed733d16a6ce35b1426bddd993a360f0a7387a8 +Author: Chris Wilson +Date: Wed Apr 23 09:17:01 2014 +0100 + + sna: Improve DBG messages for rejecting outputs during initial config + + Signed-off-by: Chris Wilson + +commit bb5b21e34f6cbe44a249e566471754b45c500e60 +Author: Chris Wilson +Date: Tue Apr 22 21:22:37 2014 +0100 + + sna: Apply defense against a rogue call to move a SW cursor + + So the sna_set_cursor_postion() assertion was reported to have caught us + trying to adjust the position of an absent cursor. That should be + impossible as we should only arrive there if we claim we can support a + HW cursor and so have a registered cursor. However, changing the + assertion into a guard is trivial, and preserves peace of mind. + + Signed-off-by: Chris Wilson + +commit b12bc035fb8ee40bb382e66604e869b729270189 +Author: Chris Wilson +Date: Tue Apr 22 12:30:29 2014 +0100 + + sna: Add a DBG aide to disable hardware execution + + Submit a dummy batch so that we still build, submit batches and perform + relocations, but do not actually invoke the GPU. This can be useful when + looking at mysterious hardware hangs. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77263 + Signed-off-by: Chris Wilson + +commit f6bc0e390bcba97f7aacab4d87251867ca309c17 +Author: Chris Wilson +Date: Tue Apr 22 09:41:21 2014 +0100 + + sna: Use a global pixman glyph cache + + In Zaphod mode, we use a common pool of glyph images but insert them + individually into a cache for each head. However, we only remove the + image from the first cache, leaving a stale slot in the second head. + Upon subsequent reuse of the glyph id, the second head renders garbage. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54707 + Signed-off-by: Chris Wilson + +commit b259cbffcfb41a20c8b0cf1c32f6ff3e9872a472 +Author: Chris Wilson +Date: Sun Apr 20 16:39:37 2014 +0100 + + sna: Avoid copying from tiled source for an overwritten fill + + Signed-off-by: Chris Wilson + +commit 935ec0abcb3b92b1aad00885be59644bf775f5dd +Author: Chris Wilson +Date: Mon Apr 21 08:20:39 2014 +0100 + + uxa: Remove misnomer from ATI logs + + Signed-off-by: Chris Wilson + +commit 08e71e1820d6fcb6829b4ebd360beadc1f250295 +Author: Chris Wilson +Date: Sat Apr 19 16:27:49 2014 +0100 + + sna: Initialise thread->arg + + If we launch less than the maximum number of threads, we may read the + thread->arg value never having set it after a malloc. + + ==8207== Conditional jump or move depends on uninitialised value(s) + ==8207== at 0xA986B7F: sna_threads_wait (sna_threads.c:216) + ==8207== by 0xA986EFE: sna_image_composite (sna_threads.c:350) + ==8207== by 0xA93DD0D: sna_composite_fb (sna_composite.c:598) + ==8207== by 0xA93E66C: sna_composite (sna_composite.c:742) + ==8207== by 0x23A773: damageComposite (damage.c:503) + ==8207== by 0x2309A9: ProcRenderComposite (render.c:708) + ==8207== by 0x15D86D: Dispatch (dispatch.c:433) + ==8207== by 0x161689: dix_main (main.c:294) + ==8207== by 0x6FB1B44: (below main) (libc-start.c:287) + + Signed-off-by: Chris Wilson + +commit 58a757b64927d8e27c4ac38cc15f8291037ec905 +Author: Chris Wilson +Date: Fri Apr 18 09:28:02 2014 +0100 + + sna: Do not reuse physical cursors for the kernel is broken, harder + + commit 154f7e9668bffdf565b6914a3a3e5bdfe17aa1b9 + Author: Chris Wilson + Date: Fri Apr 18 09:28:02 2014 +0100 + + sna: Do not reuse physical cursors for the kernel is broken + + was insufficient as it ended up reusing a stale cursor that was still + attached, and so after updating the cursor the second pipe found itself + with a valid cursor. Hey presto, we had a shared physical cursor, once + again demonstrating the buggy kernel. + + This time, disable all cursor reuse except for the once currently + attached to the pipe - this should prevent all sharing. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77351 + Signed-off-by: Chris Wilson + +commit fb0ed43cbc6f34bde670ab846e7ba9e7dbf9b660 +Author: Chris Wilson +Date: Fri Apr 18 20:55:49 2014 +0100 + + sna: Refine detection of when shadow is active during BlockHandler + + Signed-off-by: Chris Wilson + +commit 2d9ae02c647f93be58d3f77168752774868008f5 +Author: Chris Wilson +Date: Fri Apr 18 11:43:45 2014 +0100 + + sna/video: Provide a fallback path for pwrite failure + + Stranger things have happened. + + Signed-off-by: Chris Wilson + +commit fdc28205d590d560a6f3886189ef974d1d00f2cd +Author: Chris Wilson +Date: Fri Apr 18 11:34:07 2014 +0100 + + sna: Always flush the shadow scanout + + When the shadow scanout is active, make sure we call the BlockHandler + every time, not just when we about to sleep. This is in case we are + swamped by clients trying to render and forgo the important step of + ensuring that their output reaches the screen. + + Reported-by: Ildar Nurislamov + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit 924237efbddb167efc7f9f3bde42b32ffc538ee3 +Author: Chris Wilson +Date: Fri Apr 18 11:33:42 2014 +0100 + + sna: Fix some DBG formats + + Signed-off-by: Chris Wilson + +commit fa56f1062b926b15e554f46eb268a69b43dd8b9f +Author: Chris Wilson +Date: Fri Apr 18 09:52:26 2014 +0100 + + sna/video: Only try to set the color key once + + So that we only report the error to the user a single time, and not + every frame. + + Signed-off-by: Chris Wilson + +commit 154f7e9668bffdf565b6914a3a3e5bdfe17aa1b9 +Author: Chris Wilson +Date: Fri Apr 18 09:28:02 2014 +0100 + + sna: Do not reuse physical cursors for the kernel is broken + + Big bug in the kernel that prevents the sharing of cursors across pipes + when they are backed by a phys_obj. To prevent hitting that bug, don't + do that! + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77351 + Signed-off-by: Chris Wilson + +commit 83f49767f8ed9dd49c40ebc65ed22c288a386edd +Author: Chris Wilson +Date: Tue Apr 15 16:27:44 2014 +0100 + + sna: Pre-emptively bind framebuffers into the GTT + + In order to avoid rendering to the bo and then stalling before we can + pin it the display plane, bind the framebuffer into the GTT (by using a + GTT mmap) during the initial allocation. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit fd0579016be9e0385c0cdd07a9f9e17f93b93a4f +Author: Chris Wilson +Date: Tue Apr 15 16:27:44 2014 +0100 + + sna: Pre-emptively move framebuffers into the DISPLAY cache domain + + In order to avoid rendering to the bo and then stalling before we can + pin it the display plane, allocate bo for fb from uncached and change + the cache level during the initial allocation. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit b0472af1f3c6832838b0cfea38e261c908afd04e +Author: Chris Wilson +Date: Tue Apr 15 16:31:08 2014 +0100 + + sna: Mark partial composite operations upfront + + Rather than guess in the backend when we are going to be called for + multiple boxes, rely on the frontend declaring it correctly. + + Signed-off-by: Chris Wilson + +commit 49e72bd4e59085aa940e5af63381c5394ee670ad +Author: Chris Wilson +Date: Tue Apr 15 11:24:10 2014 +0100 + + sna: Discard TearFree readback when overdrawing + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit 13054a00dadedae6495eb5cdf586b7916b82053e +Author: Chris Wilson +Date: Tue Apr 15 10:28:32 2014 +0100 + + sna: Fix up cut'n'paste typo in assertion + + sna_display.c:3176:43: error: 'struct ' has no member named 'rotation' + assert(cursor->rotation != sna->cursor.rotation); + + Reported-by: Ildar Nurislamov + Signed-off-by: Chris Wilson + +commit 1ed8647aef012d30c602f86fc6f97a0a92d7710f +Author: Chris Wilson +Date: Tue Apr 15 06:55:26 2014 +0100 + + sna: Add a cursor DBG for a failed pwrite update + + Signed-off-by: Chris Wilson + +commit cb35b397395cff8ff7f5155759f58c1840bfeeb5 +Author: Chris Wilson +Date: Mon Apr 14 17:12:37 2014 +0100 + + sna: Rearrange cursor reuse to avoid sharing rotations + + Try not to steal a rotated cursor that is currently in use, or else we + may see a brief flash of corruption. + + Signed-off-by: Chris Wilson + +commit fd700c37ee2a68262b1ccfff332dd41ba8599e2c +Author: Chris Wilson +Date: Mon Apr 14 16:48:05 2014 +0100 + + sna: Add some bounds checking asserts to damage + + References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1300640 + Signed-off-by: Chris Wilson + +commit 9ae82134ad14085e80d93592e155978a5056f44a +Author: Chris Wilson +Date: Fri Apr 11 18:36:16 2014 +0100 + + sna: Restrict WHOLE hint to PutImage on a complete Pixmap + + Signed-off-by: Chris Wilson + +commit 6883f5a64498880425d47871323642409282d9ab +Author: Chris Wilson +Date: Fri Apr 11 08:02:49 2014 +0100 + + sna: Perform 2-color to ARGB cursor conversion inplace + + Signed-off-by: Chris Wilson + +commit 2eddc60a5fe1fabefcad93783d58354570132af3 +Author: Chris Wilson +Date: Fri Apr 11 07:52:30 2014 +0100 + + sna: Don't redraw cursor if the fg/bg colors do not change + + Signed-off-by: Chris Wilson + +commit a79eb2e29a158910785580409c51a585f25876a7 +Author: Chris Wilson +Date: Thu Apr 10 20:41:57 2014 +0100 + + sna/gen2: Fix CA/a8 blend factors + + This is a revert of + + commit 142f8461944b294dbc3fb0a7bf607bccf0bccc1f [2.99.911] + Author: Chris Wilson + Date: Mon Mar 10 15:20:16 2014 +0000 + + sna/gen2: Tidy blend factor selection for the source + + as that broke glyph rendering in firefox for instance. + + Reported-by: Carl Eitsger <4607vrfcr84spd21f08@weg-werf-email.de> + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77201 + Signed-off-by: Chris Wilson + +commit 25fa4f5bb4c9ed12755edfeec38b9bdc134736f1 +Author: Chris Wilson +Date: Thu Apr 10 23:14:32 2014 +0100 + + sna: Don't set cursor bits to an invalid pointer + + The xf86Cursor core simply frees it, so it has to be NULL. + + Signed-off-by: Chris Wilson + +commit 7b2753f9cc6a1a7ca353f57d78bdf3d52f32864b +Author: Chris Wilson +Date: Thu Apr 10 23:11:18 2014 +0100 + + sna: Only mark the transform_in_use when required for shadow fb + + Signed-off-by: Chris Wilson + +commit 4950bc4fea80d44dde798f3f8b5a07eee1555a63 +Author: Chris Wilson +Date: Thu Apr 10 22:26:42 2014 +0100 + + sna: Only reload an active HW cursor + + Do not attempt to restore the cursor handle if a SW cursor is currently + active. In particular, this prevents a crash after modesetting if we + never had a real cursor (for example output offloading). + + Reported-by: Tomas Pruzina + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77283 + Signed-off-by: Chris Wilson + +commit 8e6e7dbc9257a223ab284198e92f263a1a8b5553 +Author: Chris Wilson +Date: Thu Apr 10 21:44:35 2014 +0100 + + sna: Don't create slave pixmaps for the virtual CRTC + + They only exist as placeholders for remote outputs in the framebuffer + and do not need to take part in actually output offloading, so we can + forgo creating slave pixmaps and remove the stub function entirely. + + Signed-off-by: Chris Wilson + +commit f94684db1a694820ff508d8aec77bf19cea86fbd +Author: Chris Wilson +Date: Thu Apr 10 16:08:48 2014 +0100 + + sna: Validate the cursor everytime for hw support + + Signed-off-by: Chris Wilson + +commit d364a881effb2fd87f11648b10d126eb18fcb6be +Author: Chris Wilson +Date: Thu Apr 10 09:12:02 2014 +0100 + + configure: Report which version (lib or module) of glamor is used + + Signed-off-by: Chris Wilson + +commit b771b41f0a945fc580d532524cc744b01dd36d5f +Author: Eric Anholt +Date: Wed Apr 9 15:24:23 2014 -0700 + + uxa: Fix load_cursor_argb for the new Xorg ABI. + + Returning an undefined value meant we might get sw cursors. + +commit d812afc1d4476ba987883fad2ef8b7c002638077 +Author: Eric Anholt +Date: Wed Apr 9 15:24:22 2014 -0700 + + Use fbpict.h instead of defining its prototypes ourselves. + + fbpict.h has been an installed header since 2008, shortly after uxa + landed. This fixes compiler warnings when other headers happen to + include fbpict.h. + +commit a6919aa980883cf2828dc0cf813f315e3035d0cf +Author: Eric Anholt +Date: Wed Apr 9 15:24:21 2014 -0700 + + Update for glamor in the 1.16 server. + + We should link against the server's copy, insted of using the external + library. + +commit be7c166a017cee3ef8a1b7b290b7fb14b4009314 +Author: Chris Wilson +Date: Thu Apr 10 08:22:02 2014 +0100 + + sna: Remove defunct Cursor interface on fake CRTC + + As we no longer user the xf86Cursor helper, we can forgo filling in stub + routines for the fake CRTC. + + Signed-off-by: Chris Wilson + +commit 1d2872dd0830c8858621402328aa1a9322b66ea8 +Author: Chris Wilson +Date: Thu Apr 10 07:35:50 2014 +0100 + + sna: Prepare for an upcoming Cursor API change + + 1.16 now expects load-cursor-argb to return a boolean reporting + success/failure. + + Signed-off-by: Chris Wilson + +commit f9a279b2dc8417b6504478ac96514125d6136523 +Author: Chris Wilson +Date: Wed Apr 9 22:15:19 2014 +0100 + + intel-virtual-output: Fix damage bounds + + Sigh. A serious mixup of integer promotion rules and wraparound caused + the damage computation for small regions to be completely bogus. + + Signed-off-by: Chris Wilson + +commit e0c93a3e53a624beb5d3a15631237ac33b8c92cd +Author: Chris Wilson +Date: Wed Apr 9 18:51:23 2014 +0100 + + intel: If a non-root user starts X, don't release master + + SET_MASTER and DROP_MASTER are only available to the root user. If we + are started as an ordinary user, and we are master by virtue of being + the first user of the device, never release our fd or master. + + Signed-off-by: Chris Wilson + +commit dba43d370b984e262f6fe5920b38b433f4bd392b +Author: Chris Wilson +Date: Wed Apr 9 16:11:26 2014 +0100 + + sna: Use pwrite to update physical cursors + + Older hardware uses physical addresses for its cursor, which are + implemented by the kernel in an incoherent fashion. Maybe with stolen + support this would be different... + + Fixes regression on [845g, 945g] from + commit 25ca8f136cef9e1bdf06967bf8e78c87b54ffce2 + Author: Chris Wilson + Date: Thu Mar 27 14:15:30 2014 +0000 + + sna: Support variable sized cursors + + Reported-by: Knut Petersen + Signed-off-by: Chris Wilson + +commit f14d6cbff3b9766f5fa834282a4eca6636b6fd7d +Author: Chris Wilson +Date: Wed Apr 9 13:14:37 2014 +0100 + + sna: Handle clipped PutImage uploads more carefully + + If the upload is clipped, we do not want to apply the WHOLE migration hints. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77178 + Signed-off-by: Chris Wilson + +commit 510e5cf3fa4e1db8297be62461b602b13d18d8fc +Author: Chris Wilson +Date: Wed Apr 9 12:26:53 2014 +0100 + + sna: Tweak application of WHOLE hint for uploads + + This help with the continuing saga of + commit 1de1104064b5898cbed37e836901694a381c1266 [2.99.911] + Author: Chris Wilson + Date: Fri Feb 21 22:43:04 2014 +0000 + + sna: Use a hint to do whole image uploads inplace + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77178 + Signed-off-by: Chris Wilson + +commit f05552cd7a43ea46ac1a37b68b05be2a82abaeb1 +Author: Chris Wilson +Date: Wed Apr 9 11:54:49 2014 +0100 + + sna: Add some DBG for whole CPU pixmap migration + + Signed-off-by: Chris Wilson + +commit cf4eb827861bf70d4d45a2ffe062d4c05a1564a6 +Author: Chris Wilson +Date: Wed Apr 9 10:22:49 2014 +0100 + + sna: Restore empty region checking + + commit 8ef81d676c52e42a6d9048fd92b2843470b62945 + Author: Chris Wilson + Date: Mon Apr 7 07:59:42 2014 +0100 + + sna: Simplify checking for singular damage + + overlooked that we were also checking for empty regions as well as + singular regions. + + Signed-off-by: Chris Wilson + +commit 9f40d7e91281b74df43f49885472ee352ea4b389 +Author: Chris Wilson +Date: Tue Apr 8 18:28:46 2014 +0100 + + sna: Fix build for older Xorg without OsBlockSIGIO support + + OsBlockSIGIO/OsReleaseSIGIO was only introduced in xorg-server-1.13.0, + so we need a compat layer. + + Signed-off-by: Chris Wilson + +commit 5db8717b8d9f089412b9a7529725c9c41e3e44fb +Author: Chris Wilson +Date: Tue Apr 8 18:00:47 2014 +0100 + + sna: Refactor 3 similar CPU migration promotion checks into one + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77178 + Signed-off-by: Chris Wilson + +commit 617e96f3af861dd797f98d5a74978f9ba595a981 +Author: Chris Wilson +Date: Tue Apr 8 08:47:05 2014 +0100 + + sna: Add more assertions before dereferencing sna_crtc + + Signed-off-by: Chris Wilson + +commit e6b03269d01e61527641639c6fb7b796205e6ed8 +Author: Chris Wilson +Date: Tue Apr 8 08:44:56 2014 +0100 + + sna: Continue to reprobe for ZaphodHeads with a mixed up configuration + + Fixes regresion from + commit 35b03b3fe6213eb3e08f05efe3428bd6bc5421d2 + Author: Chris Wilson + Date: Fri Mar 28 09:14:59 2014 +0000 + + sna: Virtual CRTCs are last, so break loops early + + as the conflicting Zaphod detection requires on searching all potential + CRTCs without finding the match. By breaking early on the virtual CRTC, + we concluded that the setup was actually valid, but disabled. + + Reported-by: Nick Bowler + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77156 + Signed-off-by: Chris Wilson + +commit bf1875139817c5b00d63a743e262c8f3552058ab +Author: Chris Wilson +Date: Mon Apr 7 08:28:55 2014 +0100 + + intel-virtual-output: Fixup DBG messages + + Use the right variables and it may even compile. + + Signed-off-by: Chris Wilson + +commit 8ef81d676c52e42a6d9048fd92b2843470b62945 +Author: Chris Wilson +Date: Mon Apr 7 07:59:42 2014 +0100 + + sna: Simplify checking for singular damage + + Signed-off-by: Chris Wilson + +commit f5014b3fddf6c79f5ca01a91eec5ca92184c8829 +Author: Chris Wilson +Date: Mon Apr 7 07:59:01 2014 +0100 + + sna: Avoid double application of pixel widening for degenerate lines + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77074 + Signed-off-by: Chris Wilson + +commit 3310ee89c1f1a663de5f5b12b8125809a213996f +Author: Chris Wilson +Date: Sat Apr 5 12:18:31 2014 +0100 + + sna: Avoid discarding damage when applying WHOLE hint to pixmap migration + + Once again, we must be careful when promoting from a region to whole + pixmap migration that we do not discard required damage. + + Fixes regression from + commit 27ac9f574f65cbd535751c925e9b2e2d7c8a6b3a [2.99.911] + Author: Chris Wilson + Date: Thu Feb 27 08:33:52 2014 +0000 + + sna: Avoid promoting region-to-whole migration and discarding damage + + Reported-by: gedgon@gmail.com + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77063 + Signed-off-by: Chris Wilson + +commit 7e9ff48ddbe61ad2edbaefde7b94c84637a85291 +Author: Chris Wilson +Date: Sat Apr 5 10:44:48 2014 +0100 + + sna/gen8: Shrink 3DSTATE_SAMPLE_PATTERN packet + + This is now smaller than originally specified. + + Signed-off-by: Chris Wilson + +commit 878ed2d6250701e9ccceacb102b5542986976437 +Author: Chris Wilson +Date: Sat Apr 5 10:43:25 2014 +0100 + + sna/gen8: w/a for NULL depth buffer + + Instead of using a NULL type depth buffer, it is strongly suggested to + use a 1x1 16-bit depth buffer instead (with address 0). + + Signed-off-by: Chris Wilson + +commit 02862faeae21bd445d61006c9aeb966fbe6a7670 +Author: Chris Wilson +Date: Fri Apr 4 16:03:08 2014 +0100 + + sna: Remove unitialized use of 'cursor' + + The earlier query of cursor (simply to find out the hw size) was + replaced by an invariant determined when the cursor was first set. + However, not all uses of cursor->size were fixed. + + Fixes regression from + commit f98b2e164637292c2425f6e6d2c22bd9a2800f8e + Author: Chris Wilson + Date: Wed Apr 2 08:36:14 2014 +0100 + + sna: Prevent signal re-entrancy into cursor update routines + + Reported-by: Christoph Haag + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77053 + Signed-off-by: Chris Wilson + +commit 938eea6dee0be153fcf007549a50213f6c957305 +Author: Chris Wilson +Date: Fri Apr 4 15:56:38 2014 +0100 + + sna/gen2+: Beware the unattached ShmPixmap + + When dereferences priv, make sure it exists first. ShmPixmaps for + example, may not have one, nor do very small buffers. + + Signed-off-by: Chris Wilson + +commit 564e4a9878503c880e0cbd09d88b4c246a0267b6 +Author: Chris Wilson +Date: Fri Apr 4 14:04:38 2014 +0100 + + sna/gen7: Move constants MOCS into chipset specific info blocks + + Signed-off-by: Chris Wilson + +commit 6e86e84da1c8049a150eb6b5780526fea57e0f9d +Author: Chris Wilson +Date: Fri Apr 4 12:41:25 2014 +0100 + + sna: Precompute OVER/ADD with solids to convert it into a BLT operation + + Signed-off-by: Chris Wilson + +commit 31a4c7bc13c5f4560482b450b9ee4788a58930cd +Author: Chris Wilson +Date: Fri Apr 4 10:46:48 2014 +0100 + + sna/gen2+: Replace composite sources with solids where possible + + If the composite reads entirely from within a large pixmap which is a + clear color, just replace the source with a solid. + + Signed-off-by: Chris Wilson + +commit f0565852b668832d4988e875bc12e23abb6e1829 +Author: Chris Wilson +Date: Thu Apr 3 16:27:47 2014 +0100 + + sna: Short-circuit repeated clearing to the same color + + Spotted in amongst a KDE debug log was a series of clear; copy; repeat + using Composite(). + + Signed-off-by: Chris Wilson + +commit baef2201f752da5d0c6322547d925fcbd86c6de4 +Author: Chris Wilson +Date: Wed Apr 2 11:37:17 2014 +0100 + + sna: Silence compiler warning + + Simplify the dependency logic so that even the compiler can understand + what is going on. + + Signed-off-by: Chris Wilson + +commit f98b2e164637292c2425f6e6d2c22bd9a2800f8e +Author: Chris Wilson +Date: Wed Apr 2 08:36:14 2014 +0100 + + sna: Prevent signal re-entrancy into cursor update routines + + As we may need to allocate from within the cursor update, we are prone + to re-entrancy issues within malloc()/free(). To avoid these we need to + block SigIO (for pointer updates) whilst in the critical section. + + Signed-off-by: Chris Wilson + +commit a926d9f68231ac0f2a1f54c7a722979a8ed6e9e1 +Author: Chris Wilson +Date: Mon Mar 31 14:07:41 2014 +0100 + + sna: Update tiling flags after reusing inactive VMA + + Signed-off-by: Chris Wilson + +commit 644c274b2cd398c8236d36423677317cbc82308a +Author: Chris Wilson +Date: Mon Mar 31 14:03:49 2014 +0100 + + sna: Fix predicate inversion for assertion + + The assertion was checking that the invalid condition was true, rather + than that it never happened. Oops. + + Signed-off-by: Chris Wilson + +commit 4b97bf7e6e9e315cc77d940e3be97832a326e702 +Author: Chris Wilson +Date: Mon Mar 31 13:32:45 2014 +0100 + + sna: Use a cheaper check for a replacement operation + + Signed-off-by: Chris Wilson + +commit 76380bcc3c23d75575d37c0436369a8014bd5a3e +Author: Chris Wilson +Date: Mon Mar 31 12:46:58 2014 +0100 + + sna: Allow reassignment of inactive VMA if not mapped into the GTT + + Signed-off-by: Chris Wilson + +commit c4c8a1b180a9d4c1126ee4fe3120128aa560306c +Author: Chris Wilson +Date: Mon Mar 31 11:23:45 2014 +0100 + + sna: Discard damage tracking for operations to the whole pixmap + + Signed-off-by: Chris Wilson + +commit 8f796d4586507a0a6e9ca3608f43448983a3b965 +Author: Chris Wilson +Date: Mon Mar 31 11:14:46 2014 +0100 + + sna: Promote to the GPU operations that cover the whole pixmap + + If the pixmap is already partially on the GPU, and the next operation + touches the entire pixmap, promote that operation back to the whole GPU. + + Signed-off-by: Chris Wilson + +commit 27c086a89d838fe0060e5ddd0fb2f37434078e4d +Author: Chris Wilson +Date: Mon Mar 31 10:01:38 2014 +0100 + + sna: Regularly check that damage does exceed the pixmap + + Signed-off-by: Chris Wilson + +commit a8a5a5a58786445d393c3d6388904c0975c364a6 +Author: Chris Wilson +Date: Mon Mar 31 09:36:05 2014 +0100 + + sna: Search cursor cache first + + We can reuse the current cursor size rather than determine it every + time. + + Signed-off-by: Chris Wilson + +commit e892b789c4c6359e4fb2e11f552b3e43a466c49e +Author: Chris Wilson +Date: Fri Mar 28 11:34:03 2014 +0000 + + sna: Suppress a compiler warning + + sna_display.c: In function '__sna_get_cursor': + sna_display.c:3153:6: warning: assignment from incompatible pointer type [enabled by default] + src = sna->cursor.ref->bits->argb; + ^ + sna_display.c:3209:10: warning: comparison of distinct pointer types lacks a cast [enabled by default] + if (src != sna->cursor.ref->bits->argb) + + Signed-off-by: Chris Wilson + +commit 5c0623b5f36cd1a1a2e3280ab2bea35a7899281b +Author: Chris Wilson +Date: Fri Mar 28 09:53:49 2014 +0000 + + sna: Only transform the temporary cursor coordinates + + As we need to recompute them for each CRTC, we need to reset the + computation each time or else we screw up the coordinates and hide + the cursors at random. + + Breakage from commit 25ca8f136cef9e1bdf06967bf8e78c87b54ffce2 + Author: Chris Wilson + Date: Thu Mar 27 14:15:30 2014 +0000 + + sna: Support variable sized cursors + + Reported-by: Jan Alexander Steffens + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76724 + Signed-off-by: Chris Wilson + +commit 80792a3f490578735065d9f67ca6ebac00b5bb75 +Author: Chris Wilson +Date: Fri Mar 28 09:43:34 2014 +0000 + + sna: Our cursors are always square. + + Signed-off-by: Chris Wilson + +commit 35b03b3fe6213eb3e08f05efe3428bd6bc5421d2 +Author: Chris Wilson +Date: Fri Mar 28 09:14:59 2014 +0000 + + sna: Virtual CRTCs are last, so break loops early + + We know that all the virtual CRTCs are at the end of the CRTC array, so + when we see the first one, we can stop the processing of real CRTCs. + + Signed-off-by: Chris Wilson + +commit 929ac66558be96a039eadd8604d444598259a0aa +Author: Chris Wilson +Date: Fri Mar 28 08:48:06 2014 +0000 + + sna: Cursors are invariant + + Once created, a Cursor has a fixed size and content, so avoid upload + unnecessarily. + + Signed-off-by: Chris Wilson + +commit 26cc3cec982d316b8fe1700eae885ae2767c0110 +Author: Chris Wilson +Date: Fri Mar 28 08:40:47 2014 +0000 + + sna: drmGetCap is too recent for our supported versions of libdrm + + Signed-off-by: Chris Wilson + +commit 78805163c5f8a40a649c973ab2a08b682879f16d +Author: Chris Wilson +Date: Fri Mar 28 08:45:39 2014 +0000 + + sna: RefCursor is too recent + + Replace RefCursor with the simple refcnt manipulation for compilation + against older stacks. + + Signed-off-by: Chris Wilson + +commit e07f8e2e625fb34f9ad795ca8fffc9a9e88e25b2 +Author: Chris Wilson +Date: Thu Mar 27 23:06:15 2014 +0000 + + sna: Fix 2-color to ARGB cursor conversion + + It helps to remember to advance through the source/mask images after + each row. + + Signed-off-by: Chris Wilson + +commit e501aa667699787daf7dc0dfd22c397a785564ce +Author: Chris Wilson +Date: Thu Mar 27 21:57:39 2014 +0000 + + sna: Cursors only need to be cleared when they are shrunk + + If we completely overwrite the old contents, we do not need to clear it + first. + + Signed-off-by: Chris Wilson + +commit 5c4d6d1ad748fe5301fa88d9c15c19a07c55149f +Author: Chris Wilson +Date: Thu Mar 27 21:16:31 2014 +0000 + + sna: Reorder the cursor cache search + + Search for an exact match first, before looking for a cursor we can + reuse. This should help reuse with multiple rotated screens not stealing + the others' cursor on every pass. + + Signed-off-by: Chris Wilson + +commit e8be2a438d7a413ba6c64005971ce814b0076fc7 +Author: Chris Wilson +Date: Thu Mar 27 21:09:45 2014 +0000 + + sna: Clear the surrounding areas of small cursors + + If the cursor does not completely fill the size of the hardware cursor, + we will retain whatever contents already filled that area. + + Signed-off-by: Chris Wilson + +commit 25ca8f136cef9e1bdf06967bf8e78c87b54ffce2 +Author: Chris Wilson +Date: Thu Mar 27 14:15:30 2014 +0000 + + sna: Support variable sized cursors + + One of the downsides with supporting large cursors is that the full size + is very rarely used leading to a waste of permanently allocated + resources. Refactor our cursor handling so that we can allocate fresh + cursors on the fly that are appropriately sized. + + Signed-off-by: Chris Wilson + +commit e3810cff42bca1badc5844002694a6f582c0f423 +Author: Chris Wilson +Date: Wed Mar 26 16:15:07 2014 +0000 + + sna: Move cursor reload into crtc notify + + This only needs to be done once per-screen reconfiguration. + + Signed-off-by: Chris Wilson + +commit 6bdd3b39bfddf1369656a6d182303e2058f6eb8f +Author: Chris Wilson +Date: Tue Mar 25 14:44:49 2014 +0000 + + sna: Tighten detection of GCs that translate to solid fills + + Signed-off-by: Chris Wilson + +commit 771b86e2a808bd74e7e2c316f8414766c2b267c6 +Author: Chris Wilson +Date: Tue Mar 25 10:27:23 2014 +0000 + + intel-virtual-output: Add DBG option to force 16 bit transfers + + Signed-off-by: Chris Wilson + +commit e46c196ecc8ad83f78f4f948b5dcb07906f249c2 +Author: Chris Wilson +Date: Wed Mar 26 12:17:37 2014 +0000 + + sna: Print probed maximum cursor size + + Signed-off-by: Chris Wilson + +commit a273b207b94933713b3dfd7edd3f6bb9b3e959b9 +Author: Chris Wilson +Date: Tue Mar 25 09:40:40 2014 +0000 + + intel-virtual-output: Fix damage iteration over active list + + When iterating over the active list to mark the current damage, we need + to chase the ->active pointer rather than ->next or else we walk the + wrong list from the wrong starting point. + + Reported-by: Kirill Müller + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76271 + Signed-off-by: Chris Wilson + +commit bfd51e205639b468479985c3c631e5d9c76d5fa7 +Author: Chris Wilson +Date: Tue Mar 25 08:59:58 2014 +0000 + + intel-virtual-output: Add a little more DBG around damaging clones + + Signed-off-by: Chris Wilson + +commit 278ef8f7bc0c7f63737ad5f5e967ca253c2571cb +Author: Chris Wilson +Date: Tue Mar 25 08:33:46 2014 +0000 + + intel-virtual-output: Do not detach with DBG enabled + + Since DBG is sent to stdout, we only see it if we do not daemonize + (which closes stdout). + + Signed-off-by: Chris Wilson + +commit 7addfcbf0f2f609ce2a5b8e9a75ee7efb483531c +Author: Chris Wilson +Date: Mon Mar 24 12:51:11 2014 +0000 + + sna: Remove one conditional from rendering glyphs into a mask + + Signed-off-by: Chris Wilson + +commit d3050dbaf74d6a5b5123eea13bc7710efea6257f +Author: Chris Wilson +Date: Mon Mar 24 12:39:37 2014 +0000 + + sna: Consolidate handling of uncacheable glyphs + + Signed-off-by: Chris Wilson + +commit 79399ff9264ff23da0ab95131a67d2ac85651b3d +Author: Chris Wilson +Date: Mon Mar 24 10:46:57 2014 +0000 + + sna: Eliminate a few conditionals in glyph fast path + + Signed-off-by: Chris Wilson + +commit 220accd828c5a0054ae9e3b491a434f7a6c750e0 +Author: Chris Wilson +Date: Thu Mar 20 09:03:31 2014 +0000 + + sna: Only enable cursor support if the hw cursor is supported + + Under a host, we naturally will not setup the cursor capability, and + this provides a safeguard in case we have a machine that does not + support hardware cursors. + + Signed-off-by: Chris Wilson + +commit 7cf0676ff868e7d8cdbfb264e5822250b1f59882 +Author: Chris Wilson +Date: Thu Mar 20 08:51:05 2014 +0000 + + intel: Do not close server fds + + If we are given an fd by the Xserver, then it is not our responsibility + to close it during CloseScreen. + + Signed-off-by: Chris Wilson + Cc: Hans de Goede + +commit 9f4c121974abcec77e7f920e3258a337260200b3 +Author: Chris Wilson +Date: Thu Mar 20 08:48:40 2014 +0000 + + intel: Refactor finding device path if unknown + + Since we already lookup the device path if we do not know it after + opening the fd, we can remove the special case along the legacy PCI + probe path. + + Signed-off-by: Chris Wilson + +commit 582adf067c275a18f55bb43945348b84cb7eb3c4 +Author: Chris Wilson +Date: Wed Mar 19 14:57:25 2014 +0000 + + 2.99.911 snapshot + +commit 6802ee00e52515ca886b956f6c0a0e27d708fb31 +Author: Chris Wilson +Date: Wed Mar 19 10:25:05 2014 +0000 + + sna: Assert after applying clipping that the draw rectangle is wholly contained + + Otherwise we ignore the purpose of applying the clip! + + Signed-off-by: Chris Wilson + +commit 15be6b7c9a89bfdac923d2a27649f539c430366f +Author: Chris Wilson +Date: Tue Mar 18 16:31:07 2014 +0000 + + uxa: Implement minimal flushing for bdw+ + + Based on the patch by Kenneth Graunke, + "Several places (such as intel_cache_expire) call intel_emit_batch_flush, + so it needs to work on Broadwell. Sometimes the batch is empty, in + which case current_batch may not yet be BLT_RING. + + The PIPE_CONTROL code has not been ported to work on Broadwell, so + trying to do a render ring flush will hang the GPU. It also doesn't + make any sense to do a render ring flush, given that we never use the + render ring for UXA on Broadwell." + + Cc: Kenneth Graunke + Signed-off-by: Chris Wilson + +commit 6446bf96f0cc01e730c240f7ed5c91f5d2292139 +Author: Hans de Goede +Date: Tue Mar 18 15:16:30 2014 +0100 + + intel: Don't close the fd on probe failure if it is server managed + + I hit this corner case when testing a single X server spanning both intel + gfx + an usb display link adapter driven by xf86-video-modesetting. + + In this scenario the intel driver gets its platformProbe method called first, + and if it then closes the server managed fd, the xf86-video-modesetting gets + EBADFD errors. + + Signed-off-by: Hans de Goede + +commit 4a6e09c6cdb13773bca5f6831f9f5164008699c9 +Author: Chris Wilson +Date: Tue Mar 18 15:52:19 2014 +0000 + + uxa: Add support for server managed fds (via intel_device) + + Based on the patch by Hans de Goede, this removes the handling of + drmOpen() and DRM_MASTER from within uxa and instead uses the common + routines. This reduces the duplicate code from within uxa, and enables + new features such as server managed fds. + + Cc: Hans de Goede + Signed-off-by: Chris Wilson + +commit dc66e663a06f2ce7685eba1fdf9fad01786bcb4f +Author: Chris Wilson +Date: Mon Mar 17 13:46:05 2014 +0000 + + sna: Improve guard against loading palettes whilst headless + + Whilst hosted, which is very similar to being headless, we do not even + have the kmode pointer and so checking kmode->count_crtcs is fatal. + + Signed-off-by: Chris Wilson + +commit 28ebbe8fa902a1d3ee4ecbda5041de5e7b68ada7 +Author: Chris Wilson +Date: Mon Mar 17 07:56:39 2014 +0000 + + sna: Fix logic inversion in use of imprecise transform conversion + + An accidental drop of the if (!is_translation) broke composite copies + under a transform. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76244 + Signed-off-by: Chris Wilson + +commit 57e63221ec0fa304a02beed356549cadb28bcf19 +Author: Chris Wilson +Date: Fri Mar 14 19:49:59 2014 +0000 + + intel-virtual-output: Minor DBG fixes + + Improve the summary after failing to detect MIT-SHM, and fix a DBG + + Signed-off-by: Chris Wilson + +commit 8cc1f005c69786243ac69f6505087071787e6f87 +Author: Chris Wilson +Date: Fri Mar 14 15:55:41 2014 +0000 + + intel-virtual-output: Iterate over remote outputs in the same order as listed + + If we walk the output lists in the same order as they are listed by + RandR, we are more likely to hit favourable priority sorting. E.g. the + user is likely to setup the outputs in the same order as listed, meaning + fewer CRTC transitions etc. + + Signed-off-by: Chris Wilson + +commit a55bbe3b598616ef4464e50cb9364c8cdf0b513a +Author: Chris Wilson +Date: Fri Mar 14 15:47:20 2014 +0000 + + intel-virtual-output: Disable panning before setting mode on CRTC + + For whatever reason, presumably to do with the switch between CRTCs, we + need to disable the panning before setting the mode in order for our + desired CRTC position to take effect. + + Reported-by: Jeff Katz + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76146 + Signed-off-by: Chris Wilson + +commit 5079830bd5f01740c4cbf84888bdf7a93bb2868e +Author: Chris Wilson +Date: Fri Mar 14 14:34:48 2014 +0000 + + intel-virtual-output: Mode names are freed with ScreenResources + + So we have to be careful not to continue to reference the strings after + they may be freed. + + Signed-off-by: Chris Wilson + +commit c64d2572bafeacae25e9b58c8372ce91858c3832 +Author: Chris Wilson +Date: Fri Mar 14 13:08:43 2014 +0000 + + sna: Allow some leeway when deciding to discard common translations + + Under PictFilterNearest, we can ignore fractional translations (not all + renderers discard those.) And if we are being approximate, we can loosen + our tolerance as well. + + Signed-off-by: Chris Wilson + +commit b61e6398f0cf94d3c483e30c05ceae4a8383d16c +Author: Chris Wilson +Date: Fri Mar 14 11:32:38 2014 +0000 + + sna: Ensure we flush SHM pixmaps if rendering to a GPU shadow + + Normally, we try to render into the CPU bo of a SHM pixmap. However, under + the right circumstances we may try to do a series of rendering into the + GPU bo and then copy it back to the CPU bo. In that case, we need to be + sure to mark the pixmap as requiring the flush. + + Signed-off-by: Chris Wilson + +commit f47f192f2240d19ede0a3a59b7970e4f563f3195 +Author: Chris Wilson +Date: Fri Mar 14 09:17:36 2014 +0000 + + intel-virtual-output: Include extra debug information for modesets + + Signed-off-by: Chris Wilson + +commit 0ad54325e94c4fd144c9fbcba25c3d167b6c5e18 +Author: Chris Wilson +Date: Fri Mar 14 07:42:32 2014 +0000 + + intel-virtual-output: Disable remote CRTCs at startup + + Signed-off-by: Chris Wilson + +commit cbcc1b6190ab733c9ab11543af4a4eb1890225e4 +Author: Kenneth Graunke +Date: Thu Mar 6 13:12:32 2014 -0800 + + uxa: Enable BLT acceleration on Broadwell. + + This supports solid, copy, put_image, and get_image acceleration via the + BLT engine. RENDER acceleration (composite) and Xv would be piles of work, + which is not worth doing since SNA exists, and Glamor is coming. + + Signed-off-by: Kenneth Graunke + +commit c1d7abadbb0009e9f2b9d8d3744d4ae5c13a1c8f +Author: Kenneth Graunke +Date: Thu Mar 6 13:12:31 2014 -0800 + + uxa: Remove implicit length from BLT command #defines. + + These command packets grew on Gen8. + + Signed-off-by: Kenneth Graunke + +commit 44fe21018330e0ce750ce25be36cc780ccdb78eb +Author: Chris Wilson +Date: Thu Mar 13 08:52:45 2014 +0000 + + sna/gen6+: Simplify BLT vs RENDER decisions for fill ops + + Signed-off-by: Chris Wilson + +commit 5d8ded0dd671fbcbd212e06afbea88a7a56a8f0d +Author: Chris Wilson +Date: Thu Mar 13 08:51:29 2014 +0000 + + sna: Nullify extra fill.ops + + I forgot that the initial memset(&fill, 0, sizeof(fill)) was no longer + performed and we rely on explicit initialisation during the setup, so + add the missing fields. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76088 + Signed-off-by: Chris Wilson + +commit 923b158e5c5dd50f943fe315a058410aeaa76269 +Author: Chris Wilson +Date: Thu Mar 13 08:14:48 2014 +0000 + + intel: Fallback to drmGetDeviceNameFromFd() + + If we are not supplied the path, call the libdrm function to search for + the canonical name for our device. + + Signed-off-by: Chris Wilson + +commit 202787ffa2bae5b1455137a344dabb9d85ee3aa0 +Author: Chris Wilson +Date: Wed Mar 12 23:57:04 2014 +0000 + + sna: Restore asserts that we do not map a freed buffer + + The complication comes with stolen bo that we treat as purged (because + they have no backing storage we can access) and so require an extra + caveat. + + Signed-off-by: Chris Wilson + +commit 4368a74b1c904625158f0b6baf98ef2a60bb54d4 +Author: Chris Wilson +Date: Wed Mar 12 17:37:01 2014 +0000 + + sna: Add DBG around using pixman's glyph cache + + Signed-off-by: Chris Wilson + +commit 08d73f1a4499cfe7c3121ff2ecdd36729c5f3544 +Author: Chris Wilson +Date: Wed Mar 12 12:17:55 2014 +0000 + + sna: Only couple up a proxy->rq when inserting into the request->buffers list + + Otherwise, we may never decouple it again afterwards leading to a + dangling pointer dereference. + + Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1289923 + Signed-off-by: Chris Wilson + +commit 2f50261539618c30c8470a5795fe5c2440e2318f +Author: Chris Wilson +Date: Wed Mar 12 10:51:56 2014 +0000 + + sna: Simplify code when no 64-bit registers are available in the ISA + + Signed-off-by: Chris Wilson + +commit 20026626d28b304a6156fb2c49752e18f2498de5 +Author: Chris Wilson +Date: Fri Mar 7 13:18:07 2014 +0000 + + sna: Missing fixes for using BLT points + + On a lone machine I had a vital fix for setting the destination tiling + bit inside the XY_PIXEL_BLT command. Sadly, I forgot about the fix before + the patch from another machine. + + Signed-off-by: Chris Wilson + +commit fd189c868908c81e7c57abf442ec1659efc2637a +Author: Chris Wilson +Date: Tue Mar 11 11:37:01 2014 +0000 + + sna/glyphs: Add a smattering of DBG for validating the glyph mask + + Signed-off-by: Chris Wilson + +commit d31569455ca25b7050a240cad58bea492c58194a +Author: Chris Wilson +Date: Tue Mar 11 10:46:06 2014 +0000 + + sna: Avoid using the wrong pitch for comparing replacement sizes + + Signed-off-by: Chris Wilson + +commit 8c5593037f31159532da992ae3b503c3b4a42f8e +Author: Chris Wilson +Date: Tue Mar 11 10:44:52 2014 +0000 + + sna: Assert that the pixmap pitch is initialised before use + + This is a sanity check that the pixmap is mapped for use by the CPU + prior to us actually using it. + + Signed-off-by: Chris Wilson + +commit dd1ff3230292a31d366c96b97711d7df97362093 +Author: Chris Wilson +Date: Tue Mar 11 10:06:24 2014 +0000 + + intel: Protect against a NULL platform device with server fd + + Signed-off-by: Chris Wilson + +commit 59f2f4885dbead3f2aece668f48c3ac749f724c2 +Author: Chris Wilson +Date: Tue Mar 11 10:00:27 2014 +0000 + + intel: Fix versioning of SUPPORTS_SERVER_FD + + The current snapshot is 1.15.99.901, which means that the new feature + will first be available in 1.15.99.902. + + Signed-off-by: Chris Wilson + +commit 78970676e79d462cf99509012db54479ba93c01a +Author: Chris Wilson +Date: Tue Mar 11 07:33:09 2014 +0000 + + sna: Be defensive when applying size restrictions to bo + + The assumption that all paths prevalidate the restrictions upon creation + the bo are false. Some important paths try to force the bo creation in + order to meet client expectations (e.g. DRI). So we are faced with + impossible requests which must fail, so make sure we do report those + failures. + + Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1289049 + Signed-off-by: Chris Wilson + +commit d10a5abcbd7c751adc08e24d9f4bdc33596b6f12 +Author: Chris Wilson +Date: Fri Mar 7 19:44:07 2014 +0000 + + intel: Supply a fallback guess for the device path + + If for some reason we have an fd, but no device path, use the likely + default path (derived from and validated against the major/minor of the + open device fd). + + Signed-off-by: Chris Wilson + +commit 28cab948f50b1d67468edbd9c8e10d3d696155f5 +Author: Hans de Goede +Date: Fri Mar 7 14:13:38 2014 +0100 + + intel: Add support for server managed fds + + In the post-modern world, the platform device nodes are handed to a + non-privileged Xserver by systemd/logind. We can then query the core for + our assigned fd rather than try to open the device for ourselves (which + would fail when trying to obtain DRM_MASTER status). A consequence is + that we then do not directly control DRM_MASTER status and must act as a + delegate of systemd. + + Signed-off-by: Hans de Goede + +commit e5f8118bdbc4655d987ab1c52e0a46fa85cc92c4 +Author: Chris Wilson +Date: Mon Mar 10 22:12:39 2014 +0000 + + sna: DBG compilation fixups + + Signed-off-by: Chris Wilson + +commit 6ed8570f6aa01fdd4edc3df7585f01083b4a9778 +Author: Chris Wilson +Date: Mon Mar 10 16:39:50 2014 +0000 + + sna: Pass render hints for migration based on source location + + Signed-off-by: Chris Wilson + +commit 955b5de4ba103fb115ec0b45f9b59eb2628ca3dd +Author: Chris Wilson +Date: Mon Mar 10 16:38:54 2014 +0000 + + sna/glyph: Release the pixman glyph cache along the error paths + + If we lock the glyph cache and then hit an error, we must make sure we + release our lock. An easy way would be not to lock when we may err. + + Signed-off-by: Chris Wilson + +commit e1cb0284218aaf248e251ac0d12fee4bcd3c7650 +Author: Chris Wilson +Date: Mon Mar 10 15:01:10 2014 +0000 + + sna/gen2: Fix build after last minute patch editing + + Whoops, the selective editing of the patch left a trailing '{' and + breaking the build. + + Signed-off-by: Chris Wilson + +commit 142f8461944b294dbc3fb0a7bf607bccf0bccc1f +Author: Chris Wilson +Date: Mon Mar 10 15:20:16 2014 +0000 + + sna/gen2: Tidy blend factor selection for the source + + Signed-off-by: Chris Wilson + +commit 0075c90d3192ba90ff1ae8a7b04bfc3ff4fccda7 +Author: Chris Wilson +Date: Mon Mar 10 15:17:51 2014 +0000 + + sna/gen2: Fix alpha blending with 8bit destination surfaces + + On gen2 (like gen3), 8-bit destination surfaces are read into the Green + channel (and written to from the Green channel). Therefore the expected + alpha blending must instead be converted to colour blending. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75818 + Signed-off-by: Chris Wilson + +commit f0b70ca660416af42be8b3f76f9e38a81dcac464 +Author: Chris Wilson +Date: Fri Mar 7 08:16:50 2014 +0000 + + sna: Unroll finding bbox of points + + Signed-off-by: Chris Wilson + +commit 928453b1bc5a059a87fbcdba9156d318a0310073 +Author: Chris Wilson +Date: Fri Mar 7 08:15:21 2014 +0000 + + sna: Emit points using the BLT primitive when appropriate + + Signed-off-by: Chris Wilson + +commit a2b4f2657f8cd503fce4e3b8cc3240d7b45d36ce +Author: Chris Wilson +Date: Wed Mar 5 09:51:24 2014 +0000 + + sna/gen8: Correct MOCS settings for render targets + + Signed-off-by: Chris Wilson + +commit a7123410a33f29c67a11f26d17ce8b0dc09cc594 +Author: Chris Wilson +Date: Mon Mar 3 10:12:11 2014 +0000 + + NEWS: Fix dates for 2014 + + It has come to my attention that between December and January is + traditionally a New Year. + + Signed-off-by: Chris Wilson + +commit a3bfb4d3c15e6a37aba5d2f5ba92134c5186e3a4 +Author: Chris Wilson +Date: Fri Feb 28 08:47:21 2014 +0000 + + sna: Reorder writes during thread task decoupling + + So that the lockless reads do not see the task complete signal prior to + marking the task as successful. Otherwise, we falsely detect that the + thread trapped a signal and kill them all. + + Signed-off-by: Chris Wilson + +commit 37d080929a20bd969749c6c12d1ef4ebe236063f +Author: Chris Wilson +Date: Thu Feb 27 08:36:40 2014 +0000 + + sna: Limit the WHOLE_HINT to large PutImages + + The goal here is to predict when we are uploading an entire image though + multiple PutImage requests. If the image is small enough, then the + PutImage will be contained within a single request and the damage + tracking will be accurate. + + Signed-off-by: Chris Wilson + +commit 27ac9f574f65cbd535751c925e9b2e2d7c8a6b3a +Author: Chris Wilson +Date: Thu Feb 27 08:33:52 2014 +0000 + + sna: Avoid promoting region-to-whole migration and discarding damage + + Fixes regression from + commit 1de1104064b5898cbed37e836901694a381c1266 + Author: Chris Wilson + Date: Fri Feb 21 22:43:04 2014 +0000 + + sna: Use a hint to do whole image uploads inplace + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75549 + Signed-off-by: Chris Wilson + +commit ff49944928c7399527b11bb0da7699711591c21a +Author: Chris Wilson +Date: Fri Feb 21 21:21:46 2014 +0000 + + sna: Tighten assertion for tiling blt fallbacks + + Signed-off-by: Chris Wilson + +commit cf4683209d11ca7382079feb242cc0c07fefc402 +Author: Chris Wilson +Date: Sat Feb 22 20:17:08 2014 +0000 + + sna/gen6+: Add missing DBG argument + + Signed-off-by: Chris Wilson + +commit a4d23ff3b2a75cc5a1c65b6b8464fc639c9f90b8 +Author: Chris Wilson +Date: Sat Feb 22 19:35:40 2014 +0000 + + sna: Add DBG for why trapezoids may be preferred inplace + + Signed-off-by: Chris Wilson + +commit d316d14283d8af86e4c5020f9974280570a78959 +Author: Chris Wilson +Date: Sat Feb 22 19:31:39 2014 +0000 + + sna: Include mono/precise hints in trapezoids DBG + + Signed-off-by: Chris Wilson + +commit 2a144baec87b17ead36373a8c5fd80f37be3ac19 +Author: Chris Wilson +Date: Sat Feb 22 19:19:11 2014 +0000 + + sna: Add a little more DBG to watch the flow of allocated bo sizes + + Signed-off-by: Chris Wilson + +commit 921e9aff3f8e7c4a33c352241311aeb4df3011fc +Author: Chris Wilson +Date: Sat Feb 22 18:29:27 2014 +0000 + + sna: Avoid signed overflow when printing allocated bytes in DBG + + Signed-off-by: Chris Wilson + +commit b0b6c043c997732559a971a788c24a5a73812df4 +Author: Chris Wilson +Date: Sat Feb 22 18:22:38 2014 +0000 + + sna: Cleanup caches if execbuf fails + + One of the failure modes for execbuf is running out of memory - often + this is reported as a false ENOSPC (thanks shmemfs!). Because of this, + we should try to resubmit after we purge our caches. + + Signed-off-by: Chris Wilson + +commit bfef9916124973b5e08f9b32eb1fcfb400ee4e8b +Author: Chris Wilson +Date: Sat Feb 22 18:12:24 2014 +0000 + + sna: Propagate thread signals for extra DBG + + Signed-off-by: Chris Wilson + +commit 64fc1bb9c87e95ff484ecd11f391b1c0d556d584 +Author: Chris Wilson +Date: Sat Feb 22 14:34:05 2014 +0000 + + sna: Allow SIGBUS/SEGV to kill the thread + + To handle sigtrapping of the threads, we allow the threads to handle + their async signals and upon hitting the trap, we kill the thread. All + the rest of the threads are reaped by the main xserver thread + afterwards. + + Signed-off-by: Chris Wilson + +commit 900499bff962a63e1d9b5f808d1deb65d55754a2 +Author: Chris Wilson +Date: Sat Feb 22 13:58:11 2014 +0000 + + sna: Move sigtrap wrapping closer to threaded sw composite + + Signed-off-by: Chris Wilson + +commit aae3bfeb28ca86b416a6a4de71eb23cdb46cf9de +Author: Chris Wilson +Date: Sat Feb 22 12:44:16 2014 +0000 + + sna: Assert that sigtrap is active + + Curiouser and curiouser. + + Signed-off-by: Chris Wilson + +commit 75cff26ebad33aca7ade7aa5a650235a7d42e47c +Author: Chris Wilson +Date: Sat Feb 22 10:05:41 2014 +0000 + + sna: Apply the dst offset for pixman fills + + Along one of the sw blt paths we failed to apply the offset for + Composite redirection. + + Reported-by: Jiri Slaby + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73811 + Signed-off-by: Chris Wilson + +commit 59d471de7fc7581b112f37a68714d0e1f8728dfd +Author: Chris Wilson +Date: Sat Feb 22 08:35:50 2014 +0000 + + sna: Handle asynchronous signals from threads + + By killing the threads and leaking their allocations - marginally + preferrable to losing the entire Xserver. + + Signed-off-by: Chris Wilson + +commit 1de1104064b5898cbed37e836901694a381c1266 +Author: Chris Wilson +Date: Fri Feb 21 22:43:04 2014 +0000 + + sna: Use a hint to do whole image uploads inplace + + Signed-off-by: Chris Wilson + +commit 2c0aacb869bea34620a2b0029ddfa7f2a9513dc7 +Author: Chris Wilson +Date: Fri Feb 21 21:48:36 2014 +0000 + + sna: Allow allocation to fail even when debugging + + Let the malloc failure propagate rather than assert. + + Signed-off-by: Chris Wilson + +commit cb87b179532a9b533df458f3367fde7fc3d64d0c +Author: Chris Wilson +Date: Fri Feb 21 21:41:52 2014 +0000 + + sna: Wrap inplace trapezoid operators with SIGBUS protection + + For the moment, this still leaves open the vexing question of how to + protect the multi-threaded variants, but it should provide more shelter + for extreme OOM. + + Signed-off-by: Chris Wilson + +commit b6fc46d63c5b7bc1347d4e03e71df9e6fdbcaaab +Author: Chris Wilson +Date: Fri Feb 21 21:21:46 2014 +0000 + + sna: Tighten assertion for tiling blt fallbacks + + Signed-off-by: Chris Wilson + +commit be6d218c6888bce41e15a8e4899618b5e6eacd99 +Author: Chris Wilson +Date: Fri Feb 21 19:43:30 2014 +0000 + + sna: Do not attempt fallback configuration without any CRTCs + + The fallback xf86InitialConfiguration() is another function that may + explode if called without any CRTCs attached. + + Signed-off-by: Chris Wilson + +commit 769a959d84d7e573b11cc1a7d85c122f17dfeea0 +Author: Chris Wilson +Date: Fri Feb 21 13:43:09 2014 +0000 + + sna: Do not register colormaps without any CRTCs + + The xserver may crash if we try to setup colormap handling without any + CRTCs, so don't. + + Suggested-by: Dave Airlie + Signed-off-by: Chris Wilson + +commit 0b92b1285ce553c4f475c7fb8ac57ba418009682 +Author: Chris Wilson +Date: Thu Feb 20 19:18:46 2014 +0000 + + backlight: Make search routine for device specific backlight common + + Signed-off-by: Chris Wilson + +commit caaf52834015c084704cf638f453b1fc3316eaa9 +Author: Chris Wilson +Date: Thu Feb 20 07:51:40 2014 +0000 + + sna: Query cursor size from the kernel + + Signed-off-by: Chris Wilson + +commit c91af569ee90a832899c9038badd84921e9a87fc +Author: Mark Kettenis +Date: Tue Feb 18 19:02:14 2014 +0000 + + backlight: Build fixes for OpenBSD + + Chris would like to humbly apologise for making these changes to the + OpenBSD code blind, and to thank Mark and Jonathan for their support + and understanding. + +commit ecc20fbcf8d5adb6c3b7d005c01788e35bba9d3c +Author: Chris Wilson +Date: Tue Feb 18 07:56:07 2014 +0000 + + intel-virtual-output: Discard unwanted events from the mouse recorder + + X always sends MappingNotify events (there is no way for the client + to ignore them). In particular, MappingNotify would be sent after a VT + switch, and this would knock out our ability to track the cursor.. + + Reported-by: Raul Dias + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75115 + Signed-off-by: Chris Wilson + +commit e860b3eaedcb5d56745d5bcc9ce720e9a0e9c293 +Author: Hans de Goede +Date: Mon Feb 17 13:16:54 2014 +0100 + + backlight-helper: Simplify reading the level from stdin + + Since the helper is a standalone app, the usual xserver rules of not using + stdio because of signal handling don't apply. + + And since the helper does run with elevated rights, it is important to keep + the code KISS so that it can be audited easily. + + This commit replaces the hard to read "raw" read loop with a much simpler + loop using fgets, improving readability of the code. + + Signed-off-by: Hans de Goede + +commit b5229c6e15964e723a7bb99d3c2c20a2fa168e3b +Author: Hans de Goede +Date: Mon Feb 17 13:16:53 2014 +0100 + + backlight: Drop rights before executing pkexec + + Event though we've failed to open the backlight normally, we may still be + running under a suid-root xserver, so drop any elevated rights before + executing what we hope will be pkxec. + + Signed-off-by: Hans de Goede + +commit 27a9dc4ce8fa3ba56f68e04d11a6272348772039 +Author: Hans de Goede +Date: Mon Feb 17 13:16:52 2014 +0100 + + backlight: Use System instead of system when checking for pkexec + + Even though we've failed to open the backlight normally, we may still be + running under a suid-root xserver, so use the servers build in System instead + of system so as to properly drop root rights. + + Signed-off-by: Hans de Goede + +commit 06066b7269b5ccf502c27466ad0434adfd9e3866 +Author: Hans de Goede +Date: Mon Feb 17 13:16:51 2014 +0100 + + backlight: Explain better why we support both pkexec and suid root for the helper + + Update the comment about trying suid-root first with some explanations of + why pkexec may be preferable in some cases. + + Signed-off-by: Hans de Goede + +commit 6b5c2b4515b646db6be0f9307f53651620516521 +Author: Chris Wilson +Date: Sat Feb 15 21:03:49 2014 +0000 + + backlight: tidy use of BACKLIGHT_CLASS + + Use string concantenation to simply the sprintf slightly. + + Signed-off-by: Chris Wilson + +commit eb7d2b19e2829b00317991fba05352e3ba1a1902 +Author: Chris Wilson +Date: Sat Feb 15 21:00:57 2014 +0000 + + backlight: Reject user overrides on OpenBSD + + We only handle the singular wscons OpenBSD interface for backlight, so + explicitly reject any user requests for something else. + + Signed-off-by: Chris Wilson + +commit 268842a47f05508fc7e1c69cd21e8e66a000dcde +Author: Chris Wilson +Date: Sat Feb 15 19:54:30 2014 +0000 + + backlight: Amalgamate hardcoded priority tables + + Our fallback path for finding the backlight interface uses a hardcoded + table of known backlight controllers in proirity order. Rather than + maintain this table twice in the midst of the KMS logic, push it to the + new set of common backlight routines. + + This incorporates bugfixes from SNA to handle unknown backlights, but + usable, gracefully. + + Signed-off-by: Chris Wilson + +commit b71f3d8bd4d6773899c1bdc903911cf240e68ead +Author: Jan Alexander Steffens (heftig) +Date: Sat Feb 15 17:53:16 2014 +0100 + + Backlight helper build fixes + + Don't hardcode $(prefix)/libexec + + Fix install hook when DESTDIR is set + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75028 + +commit 3d629c91cfa98b75c6685c2a2003e64fd1b612c4 +Author: Chris Wilson +Date: Sat Feb 15 14:55:09 2014 +0000 + + intel: Add a helper for setting backlight without root rights + + Once the xserver stops running as root on kms capabable systems, we will need + some other way to access the backlight. + + The approach taken in this patch moves most of the heavy lifting to a + helper that runs with root privileges and pipes our requested brightness + into the sysfs backlight interface. Where required, we use pkexec to + launch the helper with the elevated privilege. + + v2: Amalgamate much more of the duplicate code. + Keep the daemon and pipe alive for the lifetime of the backlight interface. + Provide an alternative for systems without PolicyKit. + + Signed-off-by: Hans de Goede [v1] + Signed-off-by: Chris Wilson + +commit a01548ccf192a5b1fa1f4a3e31e1634db39f6b39 +Author: Hans de Goede +Date: Sat Feb 15 00:02:36 2014 +0100 + + intel: export fd_set_cloexec / fd_set_nonblock + + Allow fd_set_cloexec / fd_set_nonblock to be used outside of intel_device.c. + + Signed-off-by: Hans de Goede + +commit 5601f8cc330fe88eadfa7238659c5abb223e3b28 +Author: Hans de Goede +Date: Sat Feb 15 00:02:35 2014 +0100 + + intel: Fix fd_set_nonblock + + O_NONBLOCK is a status flag not a descriptor flag, so F_GETFL / F_SETFL should + be used to modify it. + + Signed-off-by: Hans de Goede + +commit 8eb6335653e6e38228ecf95c3eef82ca2a864e45 +Author: Chris Wilson +Date: Fri Feb 14 19:36:47 2014 +0000 + + sna: Inherit the native rotation on initial output probing + + Signed-off-by: Chris Wilson + +commit 5f8714335729b4fbbb33d89dbaf0f13aa3d8427b +Author: Chris Wilson +Date: Fri Feb 14 16:18:34 2014 +0000 + + sna: Reorganise native rotation ioctls to compile on old Linux + + It is not just the BSDs that lack these ioctls in their userspace + headers, but everything older than about a year... + + Signed-off-by: Chris Wilson + +commit 699bde3991624c25d3b731caf7129ed87710b3b3 +Author: Chris Wilson +Date: Fri Feb 14 15:11:21 2014 +0000 + + sna: Guard use of DRM_MODE_OBJECT type ids + + These are not currently exported on OpenBSD and cause the build to fail. + Hide their use behind an ifdef guard for the time being. + + "I noticed the following when trying to compile xf86-video-intel git on OpenBSD: + + /usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: 'DRM_MODE_OBJECT_CRTC' undeclared (first use in this function) + /usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: (Each undeclared identifier is reported only once + /usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: for each function it appears in.) + /usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2107: error: 'DRM_MODE_OBJECT_PLANE' undeclared (first use in this function)" + + Reported-by: Jonathan Gray + Signed-off-by: Chris Wilson + +commit 37dbd669415ac82a79b3699da0450aaf68cb1c4c +Author: Chris Wilson +Date: Fri Feb 14 14:53:14 2014 +0000 + + sna: Check that the backlight interface is in sysfs before access + + Before we write values into the file, we want to be sure that it is our + sysfs backlight interface, and not some ordinary file we are about to + destroy. + + Signed-off-by: Chris Wilson + +commit 3a893d14cd227454826a9a86cb3ce227d04bc352 +Author: Chris Wilson +Date: Thu Feb 13 22:46:22 2014 +0000 + + sna: Increase the acceptable screen size range + + Signed-off-by: Chris Wilson + +commit 2d9fcb3f729e3959dd30b7d7859438894b806b34 +Author: Chris Wilson +Date: Thu Feb 13 22:36:36 2014 +0000 + + sna: Filter out requests to create a 0x0 frontbuffer + + Attempting to create a 0x0 frontbuffer results in erroneous pixmap + generation, and is liable to explode at a random point in future, so + just reject it outright. + + Signed-off-by: Chris Wilson + +commit 1037a1a3f6a8dbde017a28a7b59ef5398c84dba1 +Author: Chris Wilson +Date: Thu Feb 13 21:36:26 2014 +0000 + + sna: Fix comparison of previous BLT commands + + After altering the command bits to accommodate Broadwell, we needed to + fixup the comparison of previous BLT commands to detect overwritten + commands. + + Signed-off-by: Chris Wilson + +commit 9a9f6a9487201e4c80338e771eec28067f044240 +Author: Chris Wilson +Date: Thu Feb 13 16:18:43 2014 +0000 + + uxa: Check for access to backlight interface + + Before attaching properties to any connector, check that we can indeed + control the backlight through the sysfs interface by doing an access + check. If the xserver is started without root privileges, we cannot + write through /sys/class/backlight and so should take care not to + advertise that we can. + + Reported-by: Hans de Geode + Signed-off-by: Chris Wilson + +commit 611490a176d9bfd136f4340f7c31e0e0f0beea4e +Author: Chris Wilson +Date: Thu Feb 13 16:18:43 2014 +0000 + + sna: Check for access to backlight interface + + Before attaching properties to any connector, check that we can indeed + control the backlight through the sysfs interface by doing an access + check. If the xserver is started without root privileges, we cannot + write through /sys/class/backlight and so should take care not to + advertise that we can. + + Reported-by: Hans de Geode + Signed-off-by: Chris Wilson + +commit 83d17cded854871fd41cd3fcf25f38c9b67a4705 +Author: Chris Wilson +Date: Thu Feb 13 12:57:50 2014 +0000 + + sna: Clear DPMS tracking on VT switch + + Assume the worst and force us to reset the property when we restore + control. + + Signed-off-by: Chris Wilson + +commit 135da294106f7158bb68eeeb9e6c171bcddd94f3 +Author: Chris Wilson +Date: Thu Feb 13 11:58:15 2014 +0000 + + sna: Extend native rotation support to sprites + + The sprite plane can be independently rotated to the CRTC primary plane. + To rotate the sprite plane, we just set a property on the plane similar + to how we rotate the CRTC, so we can refactor them together to use the + same routines. + + Signed-off-by: Chris Wilson + +commit e35017e36e45c57ea9847eb5c8466cac3c4d2cc4 +Author: Chris Wilson +Date: Thu Feb 13 14:46:39 2014 +0000 + + sna: Enable coordinate transforms for native CRTC rotation + + Otherwise X tells Clients that the cursor is still in the unrotated + location when it appears rotated on the display. + + Signed-off-by: Chris Wilson + +commit 72e909953c1865f86fbd6325ff807d7c7357af5f +Author: Chris Wilson +Date: Thu Feb 13 09:46:13 2014 +0000 + + Revert "uxa: Do not change DPMS mode on unconnected outputs" + + This reverts commit 4497212307dee5e35bc6836201738a2fdb559020. + + Unfortunately, this simple fix does not work for UXA as DPMS is used by + the xserver to turn off CRTCs and outputs. Since UXA does not implement + CRTC DPMS, this commit causes us to fail to turn off outputs. + + The kernel has been fixed up in the meantime and that commit has been + recommended to be backported to all stable kernels: + + commit c9976dcf55c8aaa7037427b239f15e5acfc01a3a + Author: Chris Wilson + Date: Sun Sep 29 19:15:07 2013 +0100 + + drm/i915: Only apply DPMS to the encoder if enabled + + so it should be safe for UXA to rely on its old behaviour. + + Bugzilla: https://code.google.com/p/chromium/issues/detail?id=341135 + References: https://bugs.freedesktop.org/show_bug.cgi?id=68030 + Suggested-by: Dominik Behr + Signed-off-by: Chris Wilson + +commit 1c5ccf5d9d8beb7e8343eb2d07bbf97f53c1a224 +Author: Chris Wilson +Date: Thu Feb 13 01:06:41 2014 +0000 + + sna: Always assign a name to the modes + + In some cases, such as querying the mode from the CRTC, we may not have + a name associated with the mode. However, RandR always expects a valid + name. To satisfy this requirement, always generate the canonical mode + name if no other is specified. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=70132 + Signed-off-by: Chris Wilson + +commit fb89bfc73f4103ca6116c8f91970f4bfa491636c +Author: Chris Wilson +Date: Wed Feb 12 16:41:51 2014 +0000 + + sna/gen5: Flush the render cache between operations + + When we change the blend mode between operations, it appears that we + must flush the render cache or else we risk render corruption. This is + usually noticeable in rendering of single glyphs. + + This was originally fixed for bug 51422, but was reintroduced by + commit 37eb7343be1aeeb90a860096756603a577df1a77 + Author: Chris Wilson + Date: Sat Dec 1 09:40:11 2012 +0000 + + sna/gen5: Inspired by gen4, reorder the flushing + and the desire to reduce the impact of this w/a. + + Reported-by: itumaykin@gmail.com + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74882 + Signed-off-by: Chris Wilson + +commit 564a766a6bbe8bcf2480248a54059e7d6727440d +Author: Chris Wilson +Date: Wed Feb 12 16:19:25 2014 +0000 + + intel-virtual-output: Do not resize the screen whilst all outputs are off + + If all the outputs are off, we try to resize the screen to 1x1, which is + typically illegal. So, just keep the existing screen and xfer buffer for + next time it is enabled. + + Signed-off-by: Chris Wilson + +commit 87b9d9f507885ed98d7249940218631b775d30ea +Author: Chris Wilson +Date: Wed Feb 12 15:48:20 2014 +0000 + + intel-virtual-output: Force an output probe on initial connection to remote display + + Signed-off-by: Chris Wilson + +commit dda57f2e28e01ea254cb2aba9e0846b755c4175a +Author: Chris Wilson +Date: Wed Feb 12 15:47:00 2014 +0000 + + intel-virtual-output: Fix checking for no change in output modes + + Signed-off-by: Chris Wilson + +commit 94e5ca3d5ab33c8e9b86a4f60c712da72df15b3d +Author: Chris Wilson +Date: Wed Feb 12 15:13:42 2014 +0000 + + intel-virtual-output: Always requery modes after OutputNotify + + References: https://bugs.freedesktop.org/show_bug.cgi?id=74800 + Signed-off-by: Chris Wilson + +commit d84940cc9d297df00477c838b4f53883c19a1da4 +Author: Chris Wilson +Date: Wed Feb 12 14:48:24 2014 +0000 + + intel-virtul-output: Double check timestamps + + Compare both res->timestamp and res->configTimestamp for changes in + state. + + Signed-off-by: Chris Wilson + +commit 607737cc47788e2a8896fddfece907a3cfb24f7f +Author: Chris Wilson +Date: Wed Feb 12 11:33:45 2014 +0000 + + sna: Support native primary plane rotations + + Use the display hardware for simple rotations, when exported through the + rotation property on the CRTC. + + As the kernel support is not yet merged upstream, the feature is hidden + behind --enable-rotation. + + Signed-off-by: Chris Wilson + +commit 3b43630f5525a60e935dbc46e70354bb45444814 +Author: Chris Wilson +Date: Wed Feb 12 10:43:46 2014 +0000 + + Revert "sna/gen6: Serialise write to DERRMR register using STORE_REGISTER_MEM" + + This reverts commit 2a5ad9c015bbb41550536dd3cf4ad18b7f21fd80. + + Oops, pushed from the wrong machine and merged in a incomplete bugfix + branch. + + Signed-off-by: Chris Wilson + +commit fb69bd16a30cd0449fa9bb603dacd001e777b5bb +Author: Chris Wilson +Date: Wed Feb 12 10:34:34 2014 +0000 + + sna/gen5: Use the DBG option ALWAYS_FLUSH to force a full flush + + When flushing between operations, we can choose between doing a full + flush to memory, or just a pipeline flush. For debugging it is better to + do the full flush to rule out cache effects. + + Signed-off-by: Chris Wilson + +commit 77f8d9ca84342b256de1e118edfd14ddae4d593f +Merge: 3fb39d4 27663f3 +Author: Chris Wilson +Date: Wed Feb 12 10:32:50 2014 +0000 + + Merge branch 'master' of hsw:/usr/src/xf86-video-intel + +commit 27663f31163c22f7dfaf8f5a3e45fa1c93a7d9e4 +Author: Chris Wilson +Date: Wed Feb 12 09:58:06 2014 +0000 + + sna/gen5: Add a DBG option to force flushes between operations + + Signed-off-by: Chris Wilson + +commit 834e8078fc1b8d3acba9fa887d6dcdd861e3c15a +Author: Chris Wilson +Date: Wed Feb 12 09:50:35 2014 +0000 + + sna: Retrieve tiling for fbcon + + Yikes, there appear to be tiled fbcon framebuffers on the horizon. + + Signed-off-by: Chris Wilson + +commit 69d4c15d525065374de50d624388252152a36b8b +Author: Chris Wilson +Date: Wed Feb 12 07:56:10 2014 +0000 + + sna: Delete redundant branch + + The MOVE_READ else branch is repeated immediately below when marking up + damage for MOVE_WRITE, so remove it for simplicity. + + Signed-off-by: Chris Wilson + +commit ec39adc93a4a127b34704a2012182b5c72b3a9b3 +Author: Chris Wilson +Date: Tue Feb 11 23:08:35 2014 +0000 + + Record Video ABI version that we configure against + + Signed-off-by: Chris Wilson + +commit 3fb39d477909a433ae67bdfc69ad870ddabee3a7 +Merge: 2a5ad9c c02067d +Author: Chris Wilson +Date: Tue Feb 11 21:57:23 2014 +0000 + + Merge branch 'master' of hsw:/usr/src/xf86-video-intel + +commit c02067dcf514f19beb0e17b5765826148386e673 +Author: Chris Wilson +Date: Tue Feb 11 21:21:17 2014 +0000 + + sna: Defer move-to-gpu until we need to transfer GPU damage to CPU + + When preparing a pixmap for CPU rendering, one of the last steps is to + copy the outstanding GPU damage back to the CPU. Currently, we flush any + outstanding pageflips (for TearFree) and in the process accidentally + destroy the shadow buffer if there is no outstanding GPU damage. Rearrange + the code to avoid tripping over that by only processing the move-to-gpu if + we need to touch the GPU bo. + + Signed-off-by: Chris Wilson + +commit 2a5ad9c015bbb41550536dd3cf4ad18b7f21fd80 +Author: Chris Wilson +Date: Tue Feb 11 11:23:37 2014 +0000 + + sna/gen6: Serialise write to DERRMR register using STORE_REGISTER_MEM + + Signed-off-by: Chris Wilson + +commit 5142d1ca3fd877f2ca9277af314f6432580370de +Author: Chris Wilson +Date: Mon Feb 10 16:42:06 2014 +0000 + + sna: Remove damaged region after converting CPU bo to GPU bo + + Reported-by: Jiri Slaby + References: https://bugs.freedesktop.org/show_bug.cgi?id=70461 + Signed-off-by: Chris Wilson + +commit 1267235fd474c5249d45a7015e3d741dc607e57f +Author: Chris Wilson +Date: Mon Feb 10 16:37:38 2014 +0000 + + sna: Check for overwriting damage before applying clear + + Signed-off-by: Chris Wilson + +commit 2f99070708ce8f591c31e1e908809a0ce551c13f +Author: Chris Wilson +Date: Mon Feb 10 14:19:53 2014 +0000 + + sna: Clear GPU damage flag for 1x1 writes onto a clear buffer + + An optimisation for 1x1 reads of a clear buffer lead to a bug whereby + the damage for a 1x1 write would not be tracked correctly (conflicting + full GPU damage vs partial CPU damage). + + Signed-off-by: Chris Wilson + commit 2fb2cd092dadba40b5ad2da57943c660a0c9bc14 Author: Chris Wilson Date: Mon Feb 10 09:35:11 2014 +0000 diff -Nru xserver-xorg-video-intel-2.99.910/compile xserver-xorg-video-intel-2.99.914/compile --- xserver-xorg-video-intel-2.99.910/compile 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/compile 2014-07-23 14:26:40.000000000 +0000 @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff -Nru xserver-xorg-video-intel-2.99.910/config.guess xserver-xorg-video-intel-2.99.914/config.guess --- xserver-xorg-video-intel-2.99.910/config.guess 2013-08-12 21:20:05.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/config.guess 2014-07-23 14:26:40.000000000 +0000 @@ -1,14 +1,12 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. +# Copyright 1992-2013 Free Software Foundation, Inc. -timestamp='2012-02-10' +timestamp='2013-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -22,19 +20,17 @@ # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). # -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. +# Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# +# Please send patches with a ChangeLog entry to config-patches@gnu.org. + me=`echo "$0" | sed -e 's,.*/,,'` @@ -54,9 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -138,6 +132,27 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +case "${UNAME_SYSTEM}" in +Linux|GNU|GNU/*) + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + LIBC=gnu + + eval $set_cc_for_build + cat <<-EOF > $dummy.c + #include + #if defined(__UCLIBC__) + LIBC=uclibc + #elif defined(__dietlibc__) + LIBC=dietlibc + #else + LIBC=gnu + #endif + EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + ;; +esac + # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in @@ -200,6 +215,10 @@ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; + *:Bitrig:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} @@ -302,7 +321,7 @@ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -801,6 +820,9 @@ i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; @@ -852,21 +874,21 @@ exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -879,59 +901,54 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; + arc:Linux:*:* | arceb:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-gnueabi + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-gnueabihf + echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-gnu + echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build @@ -950,54 +967,63 @@ #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; + or1k:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; or32:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-gnu + echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; + PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; + PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; + *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu + echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu + echo powerpc-unknown-linux-${LIBC} + exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-${LIBC} + exit ;; + ppcle:Linux:*:*) + echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux + echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-gnu + echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1201,6 +1227,9 @@ BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1227,19 +1256,21 @@ exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac + eval $set_cc_for_build + if test "$UNAME_PROCESSOR" = unknown ; then + UNAME_PROCESSOR=powerpc + fi + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) @@ -1256,7 +1287,7 @@ NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; - NSE-?:NONSTOP_KERNEL:*:*) + NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) @@ -1330,9 +1361,6 @@ exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - eval $set_cc_for_build cat >$dummy.c < header file. */ #undef HAVE_DRI2_H +/* Enable DRI3 driver support */ +#undef HAVE_DRI3 + /* Define to 1 if you have the header file. */ #undef HAVE_DRISTRUCT_H /* Define to 1 if you have the header file. */ #undef HAVE_DRI_H +/* Define to 1 if you have the `getline' function. */ +#undef HAVE_GETLINE + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H @@ -66,6 +72,18 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H +/* Define to 1 if you have the header file. */ +#undef HAVE_MISYNCSHM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MISYNCSTR_H + +/* Enable PRESENT driver support */ +#undef HAVE_PRESENT + +/* Define to 1 if you have the header file. */ +#undef HAVE_PRESENT_H + /* Define to 1 if you have the header file. */ #undef HAVE_SAREA_H @@ -84,6 +102,9 @@ /* Define to 1 if `totalram' is a member of `struct sysinfo'. */ #undef HAVE_STRUCT_SYSINFO_TOTALRAM +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_IPC_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H @@ -114,6 +135,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_X11_EXTENSIONS_SHMSTR_H +/* Define to 1 if you have the header file. */ +#undef HAVE_X11_EXTENSIONS_XINERAMA_H + /* Define to 1 if you have the header file. */ #undef HAVE_X11_EXTENSIONS_XSHM_H @@ -126,6 +150,9 @@ /* Assume KMS support */ #undef KMS +/* libexec directory */ +#undef LIBEXEC_PATH + /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR @@ -163,15 +190,27 @@ /* Patch version of this package */ #undef PACKAGE_VERSION_PATCHLEVEL +/* installation prefix */ +#undef PREFIX_PATH + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Enable "TearFree" by default */ +#undef TEARFREE + /* Assume UMS support */ #undef UMS /* Assume asynchronous swap support */ #undef USE_ASYNC_SWAP +/* Enable control of the backlight */ +#undef USE_BACKLIGHT + +/* Enable use of the backlight helper interfaces */ +#undef USE_BACKLIGHT_HELPER + /* Assume "create2" support */ #undef USE_CREATE2 @@ -184,18 +223,23 @@ /* Assume "rendernode" support */ #undef USE_RENDERNODE +/* Assume "rotation" support */ +#undef USE_ROTATION + /* Enable SNA support */ #undef USE_SNA -/* Assume "userptr" support */ -#undef USE_USERPTR - /* Enable UXA support */ #undef USE_UXA /* Version number of package */ #undef VERSION +/* Enable large inode numbers on Mac OS X 10.5. */ +#ifndef _DARWIN_USE_64_BIT_INODE +# define _DARWIN_USE_64_BIT_INODE 1 +#endif + /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS diff -Nru xserver-xorg-video-intel-2.99.910/config.sub xserver-xorg-video-intel-2.99.914/config.sub --- xserver-xorg-video-intel-2.99.910/config.sub 2013-08-12 21:20:05.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/config.sub 2014-07-23 14:26:40.000000000 +0000 @@ -1,24 +1,18 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011, 2012 Free Software Foundation, Inc. - -timestamp='2012-02-10' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# Copyright 1992-2013 Free Software Foundation, Inc. + +timestamp='2013-08-10' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . @@ -26,11 +20,12 @@ # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. +# the same distribution terms that you use for the rest of that +# program. This Exception is an additional permission under section 7 +# of the GNU General Public License, version 3 ("GPLv3"). -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. +# Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. @@ -73,9 +68,7 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 -Free Software Foundation, Inc. +Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -123,7 +116,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) @@ -156,7 +149,7 @@ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) + -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; @@ -225,6 +218,12 @@ -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; + -lynx*178) + os=-lynxos178 + ;; + -lynx*5) + os=-lynxos5 + ;; -lynx*) os=-lynxos ;; @@ -253,10 +252,12 @@ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | be32 | be64 \ + | arc | arceb \ + | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ + | avr | avr32 \ + | be32 | be64 \ | bfin \ - | c4x | clipper \ + | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ @@ -267,7 +268,7 @@ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ + | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ @@ -285,16 +286,17 @@ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ - | nios | nios2 \ + | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ - | or32 \ + | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ @@ -364,13 +366,13 @@ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ + | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ @@ -383,7 +385,8 @@ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -401,12 +404,13 @@ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ + | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ @@ -782,11 +786,15 @@ basic_machine=ns32k-utek os=-sysv ;; - microblaze) + microblaze*) basic_machine=microblaze-xilinx ;; + mingw64) + basic_machine=x86_64-pc + os=-mingw64 + ;; mingw32) - basic_machine=i386-pc + basic_machine=i686-pc os=-mingw32 ;; mingw32ce) @@ -822,7 +830,7 @@ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) - basic_machine=i386-pc + basic_machine=i686-pc os=-msys ;; mvs) @@ -1013,7 +1021,11 @@ basic_machine=i586-unknown os=-pw32 ;; - rdos) + rdos | rdos64) + basic_machine=x86_64-pc + os=-rdos + ;; + rdos32) basic_machine=i386-pc os=-rdos ;; @@ -1340,21 +1352,21 @@ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ + | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ + | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ + | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1486,9 +1498,6 @@ -aros*) os=-aros ;; - -kaos*) - os=-kaos - ;; -zvmoe) os=-zvmoe ;; @@ -1537,6 +1546,12 @@ c4x-* | tic4x-*) os=-coff ;; + c8051-*) + os=-elf + ;; + hexagon-*) + os=-elf + ;; tic54x-*) os=-coff ;; @@ -1577,6 +1592,9 @@ mips*-*) os=-elf ;; + or1k-*) + os=-elf + ;; or32-*) os=-coff ;; diff -Nru xserver-xorg-video-intel-2.99.910/configure xserver-xorg-video-intel-2.99.914/configure --- xserver-xorg-video-intel-2.99.910/configure 2014-02-10 09:34:14.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/configure 2014-07-23 15:44:36.000000000 +0000 @@ -1,13 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for xf86-video-intel 2.99.910. +# Generated by GNU Autoconf 2.69 for xf86-video-intel 2.99.914. # # Report bugs to . # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -136,6 +134,31 @@ # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -169,7 +192,8 @@ else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -222,21 +246,25 @@ if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -340,6 +368,14 @@ } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -461,6 +497,10 @@ chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -495,16 +535,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -516,28 +556,8 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -571,8 +591,8 @@ # Identity of this package. PACKAGE_NAME='xf86-video-intel' PACKAGE_TARNAME='xf86-video-intel' -PACKAGE_VERSION='2.99.910' -PACKAGE_STRING='xf86-video-intel 2.99.910' +PACKAGE_VERSION='2.99.914' +PACKAGE_STRING='xf86-video-intel 2.99.914' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_URL='' @@ -613,12 +633,15 @@ # include #endif" +ac_config_libobj_dir=libobj ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS -LIBOBJS +LIBEXEC_PATH +PREFIX_PATH moduledir DRIVER_NAME +LIBOBJS VALGRIND_FALSE VALGRIND_TRUE VALGRIND_LIBS @@ -630,16 +653,14 @@ CLOCK_GETTIME_LIBS USE_ASYNC_SWAP_FALSE USE_ASYNC_SWAP_TRUE -USE_USERPTR_FALSE -USE_USERPTR_TRUE +USE_ROTATION_FALSE +USE_ROTATION_TRUE USE_CREATE2_FALSE USE_CREATE2_TRUE USE_RENDERNODE_FALSE USE_RENDERNODE_TRUE XVMC_FALSE XVMC_TRUE -XCB_LIBS -XCB_CFLAGS XVMCLIB_LIBS XVMCLIB_CFLAGS SNA_FALSE @@ -648,8 +669,16 @@ GLAMOR_TRUE UXA_FALSE UXA_TRUE +PRESENT_FALSE +PRESENT_TRUE +PRESENT_LIBS +PRESENT_CFLAGS +DRI3_FALSE +DRI3_TRUE DRI2_FALSE DRI2_TRUE +DRI3_LIBS +DRI3_CFLAGS DRI_DRIVER_PATH DRI2_LIBS DRI2_CFLAGS @@ -679,8 +708,14 @@ DRM_CFLAGS BUILD_TOOLS_FALSE BUILD_TOOLS_TRUE -TOOL_LIBS -TOOL_CFLAGS +IVO_LIBS +IVO_CFLAGS +IVO_EXTRA_LIBS +IVO_EXTRA_CFLAGS +X11_DRI3_FALSE +X11_DRI3_TRUE +X11_DRI3_LIBS +X11_DRI3_CFLAGS HAVE_X11_FALSE HAVE_X11_TRUE X11_LIBS @@ -694,6 +729,8 @@ GEN4ASM_CFLAGS HAVE_DOT_GIT_FALSE HAVE_DOT_GIT_TRUE +BUILD_BACKLIGHT_HELPER_FALSE +BUILD_BACKLIGHT_HELPER_TRUE OTOOL64 OTOOL LIPO @@ -713,10 +750,6 @@ FGREP LIBTOOL NOWARNFLAGS -AM_BACKSLASH -AM_DEFAULT_VERBOSITY -AM_DEFAULT_V -AM_V MAN_SUBSTS XORG_MAN_PAGE ADMIN_MAN_DIR @@ -768,6 +801,10 @@ LDFLAGS CFLAGS CC +AM_BACKSLASH +AM_DEFAULT_VERBOSITY +AM_DEFAULT_V +AM_V am__untar am__tar AMTAR @@ -832,10 +869,10 @@ ac_subst_files='' ac_user_opts=' enable_option_checking +enable_silent_rules enable_dependency_tracking enable_selective_werror enable_strict_compilation -enable_silent_rules enable_static enable_shared with_pic @@ -844,12 +881,18 @@ with_sysroot enable_libtool_lock enable_largefile +enable_backlight +enable_backlight_helper with_builderstring enable_gen4asm with_gen4asm enable_udev +enable_tools with_xorg_module_dir enable_dri +enable_dri1 +enable_dri2 +enable_dri3 enable_xvmc enable_kms enable_ums @@ -861,9 +904,10 @@ enable_xaa enable_dga with_default_accel +enable_tear_free enable_rendernode enable_create2 -enable_userptr +enable_rotation enable_async_swap enable_debug enable_valgrind @@ -886,8 +930,12 @@ UDEV_LIBS X11_CFLAGS X11_LIBS -TOOL_CFLAGS -TOOL_LIBS +X11_DRI3_CFLAGS +X11_DRI3_LIBS +IVO_EXTRA_CFLAGS +IVO_EXTRA_LIBS +IVO_CFLAGS +IVO_LIBS DRM_CFLAGS DRM_LIBS PCIACCESS_CFLAGS @@ -904,10 +952,12 @@ DRI1_LIBS DRI2_CFLAGS DRI2_LIBS +DRI3_CFLAGS +DRI3_LIBS +PRESENT_CFLAGS +PRESENT_LIBS XVMCLIB_CFLAGS XVMCLIB_LIBS -XCB_CFLAGS -XCB_LIBS VALGRIND_CFLAGS VALGRIND_LIBS' @@ -1365,8 +1415,6 @@ if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1452,7 +1500,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xf86-video-intel 2.99.910 to adapt to many kinds of systems. +\`configure' configures xf86-video-intel 2.99.914 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1523,7 +1571,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xf86-video-intel 2.99.910:";; + short | recursive ) echo "Configuration of xf86-video-intel 2.99.914:";; esac cat <<\_ACEOF @@ -1531,27 +1579,38 @@ --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors + --enable-silent-rules less verbose build output (undo: "make V=1") + --disable-silent-rules verbose build output (undo: "make V=0") + --enable-dependency-tracking + do not reject slow dependency extractors + --disable-dependency-tracking + speeds up one-time build --disable-selective-werror Turn off selective compiler errors. (default: enabled) --enable-strict-compilation Enable all warnings from compiler and make them errors (default: disabled) - --enable-silent-rules less verbose build output (undo: `make V=1') - --disable-silent-rules verbose build output (undo: `make V=0') --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-libtool-lock avoid locking (might break parallel builds) --disable-largefile omit support for large files + --disable-backlight Enable control over the backlight [default=yes] + --disable-backlight-helper + Enable building the backlight helper executable for + running X under a normal user [default=auto] --enable-gen4asm Enable rebuilding the gen4 assembly files [default=no] --disable-udev Disable udev-based monitor hotplug detection [default=auto] + --disable-tools Enable building and installing the miscellaneous + tools [default=auto] --disable-dri Disable DRI support [[default=auto]] + --disable-dri1 Disable DRI1 support [[default=yes]] + --disable-dri2 Disable DRI2 support [[default=yes]] + --disable-dri3 Disable DRI3 support [[default=yes]] --disable-xvmc Disable XvMC support [[default=yes]] --enable-kms Assume KMS support [[default=yes]] --enable-ums Assume UMS support [[default=auto]] @@ -1560,18 +1619,20 @@ --enable-sna Enable SandyBridge\'s New Acceleration (SNA) [default=auto] --enable-uxa Enable Unified Acceleration Architecture (UXA) - [default=yes] + [default=auto] --enable-glamor Enable glamor, a new GL-based acceleration [default=no] --enable-xaa Enable legacy X Acceleration Architecture (XAA) for i810 chipsets [default=auto] --enable-dga Enable legacy Direct Graphics Access (DGA) for i810 chipsets [default=auto] + --enable-tear-free Enable use of TearFree by default [default=no] --enable-rendernode Enable use of render nodes (experimental) [default=no] --enable-create2 Enable use of create2 ioctl (experimental) [default=no] - --enable-userptr Enable use of userptr (experimental) [default=no] + --enable-rotation Enable use of native rotations (experimental) + [default=no] --enable-async-swap Enable use of asynchronous swaps (experimental) [default=no] --enable-debug Enables internal debugging [default=no] @@ -1618,8 +1679,16 @@ UDEV_LIBS linker flags for UDEV, overriding pkg-config X11_CFLAGS C compiler flags for X11, overriding pkg-config X11_LIBS linker flags for X11, overriding pkg-config - TOOL_CFLAGS C compiler flags for TOOL, overriding pkg-config - TOOL_LIBS linker flags for TOOL, overriding pkg-config + X11_DRI3_CFLAGS + C compiler flags for X11_DRI3, overriding pkg-config + X11_DRI3_LIBS + linker flags for X11_DRI3, overriding pkg-config + IVO_EXTRA_CFLAGS + C compiler flags for IVO_EXTRA, overriding pkg-config + IVO_EXTRA_LIBS + linker flags for IVO_EXTRA, overriding pkg-config + IVO_CFLAGS C compiler flags for IVO, overriding pkg-config + IVO_LIBS linker flags for IVO, overriding pkg-config DRM_CFLAGS C compiler flags for DRM, overriding pkg-config DRM_LIBS linker flags for DRM, overriding pkg-config PCIACCESS_CFLAGS @@ -1644,12 +1713,16 @@ DRI1_LIBS linker flags for DRI1, overriding pkg-config DRI2_CFLAGS C compiler flags for DRI2, overriding pkg-config DRI2_LIBS linker flags for DRI2, overriding pkg-config + DRI3_CFLAGS C compiler flags for DRI3, overriding pkg-config + DRI3_LIBS linker flags for DRI3, overriding pkg-config + PRESENT_CFLAGS + C compiler flags for PRESENT, overriding pkg-config + PRESENT_LIBS + linker flags for PRESENT, overriding pkg-config XVMCLIB_CFLAGS C compiler flags for XVMCLIB, overriding pkg-config XVMCLIB_LIBS linker flags for XVMCLIB, overriding pkg-config - XCB_CFLAGS C compiler flags for XCB, overriding pkg-config - XCB_LIBS linker flags for XCB, overriding pkg-config VALGRIND_CFLAGS C compiler flags for VALGRIND, overriding pkg-config VALGRIND_LIBS @@ -1721,10 +1794,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xf86-video-intel configure 2.99.910 -generated by GNU Autoconf 2.68 +xf86-video-intel configure 2.99.914 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1956,7 +2029,7 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -2136,8 +2209,8 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xf86-video-intel $as_me 2.99.910, which was -generated by GNU Autoconf 2.68. Invocation command line was +It was created by xf86-video-intel $as_me 2.99.914, which was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2519,7 +2592,7 @@ # Initialize Automake -am__api_version='1.11' +am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2558,7 +2631,7 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2616,9 +2689,6 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2629,32 +2699,40 @@ esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac -# Do `set' in a subshell so we don't clobber the current shell's +# Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi + am_has_slept=no + for am_try in 1 2; do + echo "timestamp, slept: $am_has_slept" > conftest.file + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken + alias in your environment" "$LINENO" 5 + fi + if test "$2" = conftest.file || test $am_try -eq 2; then + break + fi + # Just in case. + sleep 1 + am_has_slept=yes + done test "$2" = conftest.file ) then @@ -2666,6 +2744,16 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } +# If we didn't sleep, we still need to ensure time stamps of config.status and +# generated files are strictly newer. +am_sleep_pid= +if grep 'slept: no' conftest.file >/dev/null 2>&1; then + ( sleep 1 ) & + am_sleep_pid=$! +fi + +rm -f conftest.file + test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. @@ -2688,12 +2776,12 @@ esac fi # Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " +if eval "$MISSING --is-lightweight"; then + am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then @@ -2705,10 +2793,10 @@ esac fi -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right +# Installed binaries are usually stripped using 'strip' when the user +# run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. +# will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. @@ -2727,7 +2815,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2767,7 +2855,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2818,7 +2906,7 @@ test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ @@ -2847,12 +2935,6 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -2871,7 +2953,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2935,6 +3017,45 @@ fi rmdir .tst 2>/dev/null +# Check whether --enable-silent-rules was given. +if test "${enable_silent_rules+set}" = set; then : + enableval=$enable_silent_rules; +fi + +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=1;; +esac +am_make=${MAKE-make} +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +$as_echo_n "checking whether $am_make supports nested variables... " >&6; } +if ${am_cv_make_support_nested_variables+:} false; then : + $as_echo_n "(cached) " >&6 +else + if $as_echo 'TRUE=$(BAR$(V)) +BAR0=false +BAR1=true +V=1 +am__doit: + @$(TRUE) +.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then + am_cv_make_support_nested_variables=yes +else + am_cv_make_support_nested_variables=no +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +$as_echo "$am_cv_make_support_nested_variables" >&6; } +if test $am_cv_make_support_nested_variables = yes; then + AM_V='$(V)' + AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' +else + AM_V=$AM_DEFAULT_VERBOSITY + AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY +fi +AM_BACKSLASH='\' + if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." @@ -2957,7 +3078,7 @@ # Define the identity of the package. PACKAGE='xf86-video-intel' - VERSION='2.99.910' + VERSION='2.99.914' cat >>confdefs.h <<_ACEOF @@ -2985,12 +3106,22 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} +# For better backward compatibility. To be removed once Automake 1.9.x +# dies out for good. For more background, see: +# +# +mkdir_p='$(MKDIR_P)' + # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' + +# We'll loop over all known methods to create a tar archive until one works. +_am_tools='gnutar pax cpio none' + am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' @@ -2998,6 +3129,48 @@ +# POSIX will say in a future version that running "rm -f" with no argument +# is OK; and we want to be able to make that assumption in our Makefile +# recipes. So use an aggressive probe to check that the usage we want is +# actually supported "in the wild" to an acceptable degree. +# See automake bug#10828. +# To make any issue more visible, cause the running configure to be aborted +# by default if the 'rm' program in use doesn't match our expectations; the +# user can still override this though. +if rm -f && rm -fr && rm -rf; then : OK; else + cat >&2 <<'END' +Oops! + +Your 'rm' program seems unable to run without file operands specified +on the command line, even when the '-f' option is present. This is contrary +to the behaviour of most rm programs out there, and not conforming with +the upcoming POSIX standard: + +Please tell bug-automake@gnu.org about your system, including the value +of your $PATH and any error possibly output before this message. This +can help us improve future automake versions. + +END + if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then + echo 'Configuration will proceed anyway, since you have set the' >&2 + echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 + echo >&2 + else + cat >&2 <<'END' +Aborting the configuration process, to ensure you take notice of the issue. + +You can download and install GNU coreutils to get an 'rm' implementation +that behaves properly: . + +If you want to complete the configuration process using your problematic +'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM +to "yes", and re-run configure. + +END + as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 + fi +fi + # Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS @@ -3030,7 +3203,7 @@ _am_result=none # First try GNU make style include. echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. +# Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include @@ -3096,7 +3269,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3136,7 +3309,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3189,7 +3362,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3230,7 +3403,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -3288,7 +3461,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3332,7 +3505,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3778,8 +3951,7 @@ /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3864,6 +4036,65 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu +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:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } +if ${am_cv_prog_cc_c_o+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +$as_echo "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +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 + + depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 @@ -3875,8 +4106,8 @@ # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named `D' -- because `-MD' means `put the output - # in D'. + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're @@ -3911,16 +4142,16 @@ : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - # We check with `-c' and `-o' for the sake of the "dashmstdout" + # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in @@ -3929,8 +4160,8 @@ test "$am__universal" = false || continue ;; nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else @@ -3938,7 +4169,7 @@ fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has + # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} @@ -4138,7 +4369,7 @@ return 0; } _ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99 +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : @@ -4324,7 +4555,7 @@ for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -4390,7 +4621,7 @@ for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -4620,7 +4851,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4663,7 +4894,7 @@ 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 + if as_fn_executable_p "$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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4806,7 +5037,7 @@ for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in @@ -5312,7 +5543,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wformat=2" >&5 $as_echo_n "checking if $CC supports-Wformat=2... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Wformat=2" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Wformat_2 if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -7031,7 +7262,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=implicit" >&5 $as_echo_n "checking if $CC supports-Werror=implicit... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=implicit" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Werror_implicit if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -7080,7 +7311,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" >&5 $as_echo_n "checking if $CC supports-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__errwarn_E_NO_EXPLICIT_TYPE_GIVEN__errwarn_E_NO_IMPLICIT_DECL_ALLOWED if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -7198,7 +7429,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=nonnull" >&5 $as_echo_n "checking if $CC supports-Werror=nonnull... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=nonnull" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Werror_nonnull if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -7316,7 +7547,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=init-self" >&5 $as_echo_n "checking if $CC supports-Werror=init-self... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=init-self" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Werror_init_self if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -7434,7 +7665,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=main" >&5 $as_echo_n "checking if $CC supports-Werror=main... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=main" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Werror_main if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -7552,7 +7783,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=missing-braces" >&5 $as_echo_n "checking if $CC supports-Werror=missing-braces... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=missing-braces" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Werror_missing_braces if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -7670,7 +7901,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=sequence-point" >&5 $as_echo_n "checking if $CC supports-Werror=sequence-point... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=sequence-point" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Werror_sequence_point if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -7788,7 +8019,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=return-type" >&5 $as_echo_n "checking if $CC supports-Werror=return-type... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=return-type" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Werror_return_type if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -7837,7 +8068,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-errwarn=E_FUNC_HAS_NO_RETURN_STMT" >&5 $as_echo_n "checking if $CC supports-errwarn=E_FUNC_HAS_NO_RETURN_STMT... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-errwarn=E_FUNC_HAS_NO_RETURN_STMT" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__errwarn_E_FUNC_HAS_NO_RETURN_STMT if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -7955,7 +8186,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=trigraphs" >&5 $as_echo_n "checking if $CC supports-Werror=trigraphs... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=trigraphs" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Werror_trigraphs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8073,7 +8304,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=array-bounds" >&5 $as_echo_n "checking if $CC supports-Werror=array-bounds... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=array-bounds" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Werror_array_bounds if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8191,7 +8422,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=write-strings" >&5 $as_echo_n "checking if $CC supports-Werror=write-strings... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=write-strings" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Werror_write_strings if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8309,7 +8540,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=address" >&5 $as_echo_n "checking if $CC supports-Werror=address... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=address" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Werror_address if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8427,7 +8658,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=int-to-pointer-cast" >&5 $as_echo_n "checking if $CC supports-Werror=int-to-pointer-cast... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=int-to-pointer-cast" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Werror_int_to_pointer_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8476,7 +8707,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-errwarn=E_BAD_PTR_INT_COMBINATION" >&5 $as_echo_n "checking if $CC supports-errwarn=E_BAD_PTR_INT_COMBINATION... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-errwarn=E_BAD_PTR_INT_COMBINATION" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__errwarn_E_BAD_PTR_INT_COMBINATION if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8594,7 +8825,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=pointer-to-int-cast" >&5 $as_echo_n "checking if $CC supports-Werror=pointer-to-int-cast... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=pointer-to-int-cast" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Werror_pointer_to_int_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -10570,7 +10801,7 @@ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=attributes" >&5 $as_echo_n "checking if $CC supports-Werror=attributes... " >&6; } - cacheid=`$as_echo "xorg_cv_cc_flag_-Werror=attributes" | $as_tr_sh` + cacheid=xorg_cv_cc_flag__Werror_attributes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -10752,10 +10983,10 @@ enableval=$enable_silent_rules; fi -case $enable_silent_rules in -yes) AM_DEFAULT_VERBOSITY=0;; -no) AM_DEFAULT_VERBOSITY=1;; -*) AM_DEFAULT_VERBOSITY=0;; +case $enable_silent_rules in # ((( + yes) AM_DEFAULT_VERBOSITY=0;; + no) AM_DEFAULT_VERBOSITY=1;; + *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 @@ -11298,7 +11529,7 @@ for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue + as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in @@ -11377,7 +11608,7 @@ for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue + as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in @@ -11633,7 +11864,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11677,7 +11908,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -11866,7 +12097,8 @@ ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else @@ -12101,7 +12333,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12141,7 +12373,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12267,10 +12499,6 @@ fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -12309,7 +12537,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; @@ -12447,7 +12675,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12487,7 +12715,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12590,7 +12818,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12634,7 +12862,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12759,7 +12987,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12799,7 +13027,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12858,7 +13086,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -12898,7 +13126,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13390,7 +13618,7 @@ rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -13406,9 +13634,19 @@ LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -13427,7 +13665,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -13547,7 +13788,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13587,7 +13828,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13667,7 +13908,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13707,7 +13948,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13759,7 +14000,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13799,7 +14040,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13851,7 +14092,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13891,7 +14132,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13943,7 +14184,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -13983,7 +14224,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -14035,7 +14276,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -14075,7 +14316,7 @@ 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 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -14938,7 +15179,7 @@ lt_prog_compiler_static='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -17108,17 +17349,6 @@ esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -17235,7 +17465,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -18306,7 +18536,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -18352,7 +18582,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -18376,7 +18606,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -18421,7 +18651,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -18445,7 +18675,7 @@ We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) +#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -18477,8 +18707,50 @@ esac rm -rf conftest* fi + + +fi + + +# Platform specific settings +case $host_os in + *linux*) + backlight_helper=yes + ;; +esac + +# Check whether --enable-backlight was given. +if test "${enable_backlight+set}" = set; then : + enableval=$enable_backlight; backlight="$enableval" +else + backlight="yes" +fi + +if test "x$backlight" = "xyes"; then + +$as_echo "#define USE_BACKLIGHT 1" >>confdefs.h + +fi + +# Check whether --enable-backlight-helper was given. +if test "${enable_backlight_helper+set}" = set; then : + enableval=$enable_backlight_helper; backlight_helper="$enableval" +fi + + if test "x$backlight" = "xyes" -a "x$backlight_helper" = "xyes"; then + BUILD_BACKLIGHT_HELPER_TRUE= + BUILD_BACKLIGHT_HELPER_FALSE='#' +else + BUILD_BACKLIGHT_HELPER_TRUE='#' + BUILD_BACKLIGHT_HELPER_FALSE= fi +if test "x$backlight_helper" = "xyes"; then + tools_msg="$tools_msg xf86-video-intel-backlight-helper" + +$as_echo "#define USE_BACKLIGHT_HELPER 1" >>confdefs.h + +fi # Are we in a git checkout? dot_git=no @@ -18811,12 +19083,12 @@ pkg_cv_X11_CFLAGS="$X11_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xrender xrandr xext xfixes pixman-1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "x11 xrender xrandr xext xfixes pixman-1") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xrender xrandr xext xfixes pixman-1 libpng\""; } >&5 + ($PKG_CONFIG --exists --print-errors "x11 xrender xrandr xext xfixes pixman-1 libpng") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_X11_CFLAGS=`$PKG_CONFIG --cflags "x11 xrender xrandr xext xfixes pixman-1" 2>/dev/null` + pkg_cv_X11_CFLAGS=`$PKG_CONFIG --cflags "x11 xrender xrandr xext xfixes pixman-1 libpng" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -18828,12 +19100,12 @@ pkg_cv_X11_LIBS="$X11_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xrender xrandr xext xfixes pixman-1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "x11 xrender xrandr xext xfixes pixman-1") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xrender xrandr xext xfixes pixman-1 libpng\""; } >&5 + ($PKG_CONFIG --exists --print-errors "x11 xrender xrandr xext xfixes pixman-1 libpng") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_X11_LIBS=`$PKG_CONFIG --libs "x11 xrender xrandr xext xfixes pixman-1" 2>/dev/null` + pkg_cv_X11_LIBS=`$PKG_CONFIG --libs "x11 xrender xrandr xext xfixes pixman-1 libpng" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -18854,9 +19126,9 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11 xrender xrandr xext xfixes pixman-1" 2>&1` + X11_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11 xrender xrandr xext xfixes pixman-1 libpng" 2>&1` else - X11_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11 xrender xrandr xext xfixes pixman-1" 2>&1` + X11_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11 xrender xrandr xext xfixes pixman-1 libpng" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$X11_PKG_ERRORS" >&5 @@ -18882,108 +19154,65 @@ fi +shm=yes +for ac_header in sys/ipc.h sys/ipc.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for TOOL" >&5 -$as_echo_n "checking for TOOL... " >&6; } - -if test -n "$TOOL_CFLAGS"; then - pkg_cv_TOOL_CFLAGS="$TOOL_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xinerama xrandr xdamage xfixes xcursor xtst xrender xext x11 pixman-1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "xinerama xrandr xdamage xfixes xcursor xtst xrender xext x11 pixman-1") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_TOOL_CFLAGS=`$PKG_CONFIG --cflags "xinerama xrandr xdamage xfixes xcursor xtst xrender xext x11 pixman-1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$TOOL_LIBS"; then - pkg_cv_TOOL_LIBS="$TOOL_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xinerama xrandr xdamage xfixes xcursor xtst xrender xext x11 pixman-1\""; } >&5 - ($PKG_CONFIG --exists --print-errors "xinerama xrandr xdamage xfixes xcursor xtst xrender xext x11 pixman-1") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_TOOL_LIBS=`$PKG_CONFIG --libs "xinerama xrandr xdamage xfixes xcursor xtst xrender xext x11 pixman-1" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes else - pkg_failed=yes -fi - else - pkg_failed=untried + shm="no" fi +done +for ac_header in X11/extensions/XShm.h +do : + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/XShm.h" "ac_cv_header_X11_extensions_XShm_h" " +#include +#include -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - TOOL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xinerama xrandr xdamage xfixes xcursor xtst xrender xext x11 pixman-1" 2>&1` - else - TOOL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xinerama xrandr xdamage xfixes xcursor xtst xrender xext x11 pixman-1" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$TOOL_PKG_ERRORS" >&5 +" +if test "x$ac_cv_header_X11_extensions_XShm_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_X11_EXTENSIONS_XSHM_H 1 +_ACEOF - tools="no" -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - tools="no" else - TOOL_CFLAGS=$pkg_cv_TOOL_CFLAGS - TOOL_LIBS=$pkg_cv_TOOL_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - tools="yes" + shm="no" fi -if test "x$tools" = "xyes"; then - ac_fn_c_check_header_mongrel "$LINENO" "sys/ipc.h" "ac_cv_header_sys_ipc_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_ipc_h" = xyes; then : - -else - tools=no -fi +done +for ac_header in X11/extensions/shmproto.h X11/extensions/shmstr.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " +#include +#include - ac_fn_c_check_header_mongrel "$LINENO" "sys/shm.h" "ac_cv_header_sys_shm_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_shm_h" = xyes; then : +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF -else - tools=no fi +done - ac_fn_c_check_header_mongrel "$LINENO" "sys/timerfd.h" "ac_cv_header_sys_timerfd_h" "$ac_includes_default" -if test "x$ac_cv_header_sys_timerfd_h" = xyes; then : - -else - tools=no +if test "x$ac_cv_header_X11_extensions_shmproto_h" != "xyes" -a "x$ac_cv_header_X11_extensions_shmstr_h" != "xyes"; then + shm="no" fi - - - if test "$ac_cv_header_sys_ipc_h" = "yes" -a "$ac_cv_header_sys_shm_h" = "yes"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether shmctl IPC_RMID allows subsequent attaches" >&5 +if test "x$shm" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether shmctl IPC_RMID allows subsequent attaches" >&5 $as_echo_n "checking whether shmctl IPC_RMID allows subsequent attaches... " >&6; } - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming no" >&5 $as_echo "assuming no" >&6; } else @@ -19024,38 +19253,371 @@ conftest.$ac_objext conftest.beam conftest.$ac_ext fi - fi - - for ac_header in X11/extensions/XShm.h X11/extensions/shmproto.h X11/extensions/shmstr.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#include - #include -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else - tools=no fi -done -fi +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for X11_DRI3" >&5 +$as_echo_n "checking for X11_DRI3... " >&6; } - if test "x$tools" = "xyes"; then - BUILD_TOOLS_TRUE= - BUILD_TOOLS_FALSE='#' +if test -n "$X11_DRI3_CFLAGS"; then + pkg_cv_X11_DRI3_CFLAGS="$X11_DRI3_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm\""; } >&5 + ($PKG_CONFIG --exists --print-errors "xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_X11_DRI3_CFLAGS=`$PKG_CONFIG --cflags "xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes else - BUILD_TOOLS_TRUE='#' - BUILD_TOOLS_FALSE= + pkg_failed=yes fi + else + pkg_failed=untried +fi +if test -n "$X11_DRI3_LIBS"; then + pkg_cv_X11_DRI3_LIBS="$X11_DRI3_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm\""; } >&5 + ($PKG_CONFIG --exists --print-errors "xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_X11_DRI3_LIBS=`$PKG_CONFIG --libs "xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + X11_DRI3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm" 2>&1` + else + X11_DRI3_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$X11_DRI3_PKG_ERRORS" >&5 + + x11_dri3="no" +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + x11_dri3="no" +else + X11_DRI3_CFLAGS=$pkg_cv_X11_DRI3_CFLAGS + X11_DRI3_LIBS=$pkg_cv_X11_DRI3_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + x11_dri3="yes" +fi + if test "x$x11_dri3" = "xyes" -a "x$shm" = "xyes"; then + X11_DRI3_TRUE= + X11_DRI3_FALSE='#' +else + X11_DRI3_TRUE='#' + X11_DRI3_FALSE= +fi + + +# Check whether --enable-tools was given. +if test "${enable_tools+set}" = set; then : + enableval=$enable_tools; tools="$enableval" +else + tools="auto" +fi + +if test "x$shm" != "xyes"; then + if test "x$tools" = "xyes"; then + as_fn_error $? "Incomplete requirements for extra tools, X11 MIT-SHM extension required" "$LINENO" 5 + fi + tools="no" +fi +if test "x$tools" != "xno"; then + ivo_requires="xrandr xdamage xfixes xcursor xtst xrender xext x11 pixman-1" + extra_cflags="" + + ignore="xinerama" + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IVO_EXTRA" >&5 +$as_echo_n "checking for IVO_EXTRA... " >&6; } + +if test -n "$IVO_EXTRA_CFLAGS"; then + pkg_cv_IVO_EXTRA_CFLAGS="$IVO_EXTRA_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$ignore\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$ignore") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_IVO_EXTRA_CFLAGS=`$PKG_CONFIG --cflags "$ignore" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$IVO_EXTRA_LIBS"; then + pkg_cv_IVO_EXTRA_LIBS="$IVO_EXTRA_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$ignore\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$ignore") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_IVO_EXTRA_LIBS=`$PKG_CONFIG --libs "$ignore" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + IVO_EXTRA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$ignore" 2>&1` + else + IVO_EXTRA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$ignore" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$IVO_EXTRA_PKG_ERRORS" >&5 + + ignore="" +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ignore="" +else + IVO_EXTRA_CFLAGS=$pkg_cv_IVO_EXTRA_CFLAGS + IVO_EXTRA_LIBS=$pkg_cv_IVO_EXTRA_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + for ac_header in X11/extensions/Xinerama.h +do : + ac_fn_c_check_header_compile "$LINENO" "X11/extensions/Xinerama.h" "ac_cv_header_X11_extensions_Xinerama_h" "#include + #include + +" +if test "x$ac_cv_header_X11_extensions_Xinerama_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_X11_EXTENSIONS_XINERAMA_H 1 +_ACEOF + ivo_requires="$ignore $ivo_requires" +fi + +done + +fi + + ignore="xcb-dri3 xcb-sync x11-xcb xshmfence x11" + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IVO_EXTRA" >&5 +$as_echo_n "checking for IVO_EXTRA... " >&6; } + +if test -n "$IVO_EXTRA_CFLAGS"; then + pkg_cv_IVO_EXTRA_CFLAGS="$IVO_EXTRA_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$ignore\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$ignore") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_IVO_EXTRA_CFLAGS=`$PKG_CONFIG --cflags "$ignore" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$IVO_EXTRA_LIBS"; then + pkg_cv_IVO_EXTRA_LIBS="$IVO_EXTRA_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$ignore\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$ignore") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_IVO_EXTRA_LIBS=`$PKG_CONFIG --libs "$ignore" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + IVO_EXTRA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$ignore" 2>&1` + else + IVO_EXTRA_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$ignore" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$IVO_EXTRA_PKG_ERRORS" >&5 + + ignore="" +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ignore="" +else + IVO_EXTRA_CFLAGS=$pkg_cv_IVO_EXTRA_CFLAGS + IVO_EXTRA_LIBS=$pkg_cv_IVO_EXTRA_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ivo_requires="$ivo_requires $ignore"; extra_cflags="-DDRI3" +fi + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IVO" >&5 +$as_echo_n "checking for IVO... " >&6; } + +if test -n "$IVO_CFLAGS"; then + pkg_cv_IVO_CFLAGS="$IVO_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$ivo_requires\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$ivo_requires") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_IVO_CFLAGS=`$PKG_CONFIG --cflags "$ivo_requires" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$IVO_LIBS"; then + pkg_cv_IVO_LIBS="$IVO_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$ivo_requires\""; } >&5 + ($PKG_CONFIG --exists --print-errors "$ivo_requires") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_IVO_LIBS=`$PKG_CONFIG --libs "$ivo_requires" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + IVO_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$ivo_requires" 2>&1` + else + IVO_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$ivo_requires" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$IVO_PKG_ERRORS" >&5 + + ivo="no" +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ivo="no" +else + IVO_CFLAGS=$pkg_cv_IVO_CFLAGS + IVO_LIBS=$pkg_cv_IVO_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + ivo="yes" +fi + ac_fn_c_check_header_mongrel "$LINENO" "sys/timerfd.h" "ac_cv_header_sys_timerfd_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_timerfd_h" = xyes; then : + +else + ivo="no" +fi + + + if test "x$ivo" = "xno"; then + if test "x$tools" = "xyes"; then + as_fn_error $? "Incomplete requirements for intel-virtual-output, requires $ivo_requires" "$LINENO" 5 + fi + tools="no" + fi + + IVO_CFLAGS="$IVO_CFLAGS $extra_cflags" +fi +if test "x$tools" != "xno"; then + tools_msg="$tools_msg intel-virtual-output" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build additional tools" >&5 +$as_echo_n "checking whether to build additional tools... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $tools" >&5 +$as_echo "$tools" >&6; } + if test "x$tools" != "xno"; then + BUILD_TOOLS_TRUE= + BUILD_TOOLS_FALSE='#' +else + BUILD_TOOLS_TRUE='#' + BUILD_TOOLS_FALSE= +fi + + +# Define a configure option for an alternate module directory - -# Define a configure option for an alternate module directory - # Check whether --with-xorg-module-dir was given. if test "${with_xorg_module_dir+set}" = set; then : withval=$with_xorg_module_dir; moduledir="$withval" @@ -19066,7 +19628,30 @@ # Check whether --enable-dri was given. if test "${enable_dri+set}" = set; then : - enableval=$enable_dri; + enableval=$enable_dri; DRI=$enableval +else + DRI=auto +fi + +# Check whether --enable-dri1 was given. +if test "${enable_dri1+set}" = set; then : + enableval=$enable_dri1; DRI1=$enableval +else + DRI1=yes +fi + +# Check whether --enable-dri2 was given. +if test "${enable_dri2+set}" = set; then : + enableval=$enable_dri2; DRI2=$enableval +else + DRI2=yes +fi + +# Check whether --enable-dri3 was given. +if test "${enable_dri3+set}" = set; then : + enableval=$enable_dri3; DRI3=$enableval +else + DRI3=yes fi @@ -19203,8 +19788,8 @@ /* end confdefs.h. */ #include "xorg-server.h" -#if !defined XF86DRI -#error XF86DRI not defined +#if !defined DPMSExtension +#error DPMSExtension not defined #endif int @@ -19222,51 +19807,16 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$SAVE_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if XF86DRI is defined" >&5 -$as_echo_n "checking if XF86DRI is defined... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if DPMSExtension is defined" >&5 +$as_echo_n "checking if DPMSExtension is defined... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 $as_echo "$_EXT_CHECK" >&6; } if test "$_EXT_CHECK" != no; then - REQUIRED_MODULES="$REQUIRED_MODULES xextproto x11" + REQUIRED_MODULES="$REQUIRED_MODULES xextproto" fi - - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include "xorg-server.h" -#if !defined DPMSExtension -#error DPMSExtension not defined -#endif - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - _EXT_CHECK=yes -else - _EXT_CHECK=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$SAVE_CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if DPMSExtension is defined" >&5 -$as_echo_n "checking if DPMSExtension is defined... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 -$as_echo "$_EXT_CHECK" >&6; } - if test "$_EXT_CHECK" != no; then - REQUIRED_MODULES="$REQUIRED_MODULES xextproto" - fi - - -# Obtain compiler/linker options for the driver dependencies +# Obtain compiler/linker options for the driver dependencies pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRM" >&5 @@ -19543,6 +20093,7 @@ fi +uxa_requires_libdrm=2.4.52 # Check whether --enable-uxa was given. if test "${enable_uxa+set}" = set; then : enableval=$enable_uxa; UXA="$enableval" @@ -19551,7 +20102,7 @@ fi if test "x$UXA" = "xauto"; then - if ! pkg-config --exists 'libdrm_intel >= 2.4.29'; then + if ! pkg-config --exists "libdrm_intel >= $uxa_requires_libdrm"; then UXA=no fi if ! pkg-config --exists 'pixman-1 >= 0.24.0'; then @@ -19571,12 +20122,12 @@ pkg_cv_DRMINTEL_CFLAGS="$DRMINTEL_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm_intel >= 2.4.29\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libdrm_intel >= 2.4.29") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm_intel >= \$uxa_requires_libdrm\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libdrm_intel >= $uxa_requires_libdrm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_DRMINTEL_CFLAGS=`$PKG_CONFIG --cflags "libdrm_intel >= 2.4.29" 2>/dev/null` + pkg_cv_DRMINTEL_CFLAGS=`$PKG_CONFIG --cflags "libdrm_intel >= $uxa_requires_libdrm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -19588,12 +20139,12 @@ pkg_cv_DRMINTEL_LIBS="$DRMINTEL_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm_intel >= 2.4.29\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libdrm_intel >= 2.4.29") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm_intel >= \$uxa_requires_libdrm\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libdrm_intel >= $uxa_requires_libdrm") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_DRMINTEL_LIBS=`$PKG_CONFIG --libs "libdrm_intel >= 2.4.29" 2>/dev/null` + pkg_cv_DRMINTEL_LIBS=`$PKG_CONFIG --libs "libdrm_intel >= $uxa_requires_libdrm" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -19614,14 +20165,14 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - DRMINTEL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdrm_intel >= 2.4.29" 2>&1` + DRMINTEL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdrm_intel >= $uxa_requires_libdrm" 2>&1` else - DRMINTEL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdrm_intel >= 2.4.29" 2>&1` + DRMINTEL_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdrm_intel >= $uxa_requires_libdrm" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$DRMINTEL_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (libdrm_intel >= 2.4.29) were not met: + as_fn_error $? "Package requirements (libdrm_intel >= $uxa_requires_libdrm) were not met: $DRMINTEL_PKG_ERRORS @@ -19668,6 +20219,9 @@ if test "x$UXA" != "xyes"; then as_fn_error $? "Glamor acceleration requested but UXA is not enabled" "$LINENO" 5 fi + if pkg-config --exists "xorg-server >= 1.15.99.901"; then + GLAMOR="yes (using Xorg glamor module)" + else pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBGLAMOR" >&5 @@ -19850,6 +20404,8 @@ $as_echo "yes" >&6; } fi + GLAMOR="yes (using libglamor)" + fi $as_echo "#define USE_GLAMOR 1" >>confdefs.h @@ -19946,6 +20502,7 @@ $as_echo "yes" >&6; } fi +ABI_VERSION=`$PKG_CONFIG --variable=abi_videodrv xorg-server` if test "x$ONLY_UMS" = "xyes"; then UMS="yes" @@ -20089,9 +20646,43 @@ fi +have_dri1=no -DRI1=no -if test "x$enable_dri" != "xno" -a "x$UMS" = "xyes"; then + + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include "xorg-server.h" +#if !defined XF86DRI +#error XF86DRI not defined +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + _EXT_CHECK=yes +else + _EXT_CHECK=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$SAVE_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if XF86DRI is defined" >&5 +$as_echo_n "checking if XF86DRI is defined... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 +$as_echo "$_EXT_CHECK" >&6; } + if test "$_EXT_CHECK" != no; then + REQUIRED_MODULES="$REQUIRED_MODULES xf86driproto" + fi + +if test "x$_EXT_CHECK" != "xno" -a "x$DRI" != "xno" -a "x$DRI1" != "xno" -a "x$UMS" = "xyes"; then pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRI1" >&5 @@ -20151,17 +20742,17 @@ # Put the nasty error message in config.log where it belongs echo "$DRI1_PKG_ERRORS" >&5 - DRI1="no" + have_dri1=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - DRI1="no" + have_dri1=no else DRI1_CFLAGS=$pkg_cv_DRI1_CFLAGS DRI1_LIBS=$pkg_cv_DRI1_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - DRI1="yes" + have_dri1=$DRI fi save_CFLAGS="$CFLAGS" save_CPPFLAGS="$CPPFLAGS" @@ -20184,63 +20775,448 @@ " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + have_dri1=no +fi + +done + + CFLAGS="$save_CFLAGS" + CPPFLAGS="$save_CPPFLAGS" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include DRI1 support" >&5 +$as_echo_n "checking whether to include DRI1 support... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_dri1" >&5 +$as_echo "$have_dri1" >&6; } + + if test "x$have_dri1" != "xno"; then + DRI1_TRUE= + DRI1_FALSE='#' +else + DRI1_TRUE='#' + DRI1_FALSE= +fi + +if test "x$have_dri1" != "xno"; then + +$as_echo "#define HAVE_DRI1 1" >>confdefs.h + + dri_msg="$dri_msg DRI1" +else + DRI1_CFLAGS="" + DRI1_LIBS="" + + if test "x$DRI" = "xyes" -a "x$UMS" = "xyes" -a "x$DRI1" != "xno"; then + as_fn_error $? "DRI1 requested but prerequisites not found" "$LINENO" 5 + fi +fi + +have_dri2=no +have_dri3=no +if test "x$DRI" != "xno"; then + if test "x$DRI2" != "xno"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRI2" >&5 +$as_echo_n "checking for DRI2... " >&6; } + +if test -n "$DRI2_CFLAGS"; then + pkg_cv_DRI2_CFLAGS="$DRI2_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dri2proto >= 2.6\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dri2proto >= 2.6") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DRI2_CFLAGS=`$PKG_CONFIG --cflags "dri2proto >= 2.6" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$DRI2_LIBS"; then + pkg_cv_DRI2_LIBS="$DRI2_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dri2proto >= 2.6\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dri2proto >= 2.6") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DRI2_LIBS=`$PKG_CONFIG --libs "dri2proto >= 2.6" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + DRI2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dri2proto >= 2.6" 2>&1` + else + DRI2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dri2proto >= 2.6" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$DRI2_PKG_ERRORS" >&5 + + have_dri2=no +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_dri2=no +else + DRI2_CFLAGS=$pkg_cv_DRI2_CFLAGS + DRI2_LIBS=$pkg_cv_DRI2_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_dri2=$DRI +fi + fi + if test "x$have_dri2" != "xno"; then + save_CFLAGS=$CFLAGS + CFLAGS="$XORG_CFLAGS $DRM_CFLAGS $DRI1_CFLAGS $DRI2_CFLAGS" + for ac_header in dri2.h +do : + ac_fn_c_check_header_compile "$LINENO" "dri2.h" "ac_cv_header_dri2_h" " +#include +#include + +" +if test "x$ac_cv_header_dri2_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DRI2_H 1 +_ACEOF + +else + have_dri2=no +fi + +done + + CFLAGS=$save_CFLAGS + fi + if test "x$have_dri2" != "xno"; then + dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri` + if test "x$dridriverdir" = "x"; then + dridriverdir="$libdir/dri" + fi + + prefix_NONE= + exec_prefix_NONE= + test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix + eval ac_define_dir="\"$dridriverdir\"" + eval ac_define_dir="\"$ac_define_dir\"" + DRI_DRIVER_PATH="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define DRI_DRIVER_PATH "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + fi + + if test "x$DRI3" != "xno"; then + + + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include "xorg-server.h" +#if !defined DRI3 +#error DRI3 not defined +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + _EXT_CHECK=yes +else + _EXT_CHECK=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$SAVE_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if DRI3 is defined" >&5 +$as_echo_n "checking if DRI3 is defined... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 +$as_echo "$_EXT_CHECK" >&6; } + if test "$_EXT_CHECK" != no; then + REQUIRED_MODULES="$REQUIRED_MODULES dri3proto" + fi + + if test "x$_EXT_CHECK" != "xno"; then + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRI3" >&5 +$as_echo_n "checking for DRI3... " >&6; } + +if test -n "$DRI3_CFLAGS"; then + pkg_cv_DRI3_CFLAGS="$DRI3_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dri3proto\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dri3proto") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DRI3_CFLAGS=`$PKG_CONFIG --cflags "dri3proto" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$DRI3_LIBS"; then + pkg_cv_DRI3_LIBS="$DRI3_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dri3proto\""; } >&5 + ($PKG_CONFIG --exists --print-errors "dri3proto") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_DRI3_LIBS=`$PKG_CONFIG --libs "dri3proto" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + DRI3_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dri3proto" 2>&1` + else + DRI3_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dri3proto" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$DRI3_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (dri3proto) were not met: + +$DRI3_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +Alternatively, you may set the environment variables DRI3_CFLAGS +and DRI3_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables DRI3_CFLAGS +and DRI3_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } +else + DRI3_CFLAGS=$pkg_cv_DRI3_CFLAGS + DRI3_LIBS=$pkg_cv_DRI3_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_dri3=$DRI +fi + fi + fi + if test "x$have_dri3" != "xno"; then + save_CFLAGS=$CFLAGS + CFLAGS="$XORG_CFLAGS $DRI3_CFLAGS" + ac_fn_c_check_decl "$LINENO" "DRI3" "ac_cv_have_decl_DRI3" "#include +" +if test "x$ac_cv_have_decl_DRI3" = xyes; then : + +else + have_dri3=no +fi + + for ac_header in misyncstr.h misyncshm.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" " +#include +#include +#include + +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + have_dri3=no +fi + +done + + CFLAGS=$save_CFLAGS + fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include DRI2 support" >&5 +$as_echo_n "checking whether to include DRI2 support... " >&6; } + if test "x$have_dri2" != "xno"; then + DRI2_TRUE= + DRI2_FALSE='#' +else + DRI2_TRUE='#' + DRI2_FALSE= +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_dri2" >&5 +$as_echo "$have_dri2" >&6; } +if test "x$have_dri2" != "xno"; then + +$as_echo "#define HAVE_DRI2 1" >>confdefs.h + + dri_msg="$dri_msg DRI2" +else + if test "x$DRI" = "xyes" -a "x$DRI2" != "xno" -a "x$KMS" = "xyes"; then + as_fn_error $? "DRI2 requested but prerequisites not found" "$LINENO" 5 + fi + + # UXA doesn't build without DRI2 headers, too late to fix + UXA=no +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include DRI3 support" >&5 +$as_echo_n "checking whether to include DRI3 support... " >&6; } + if test "x$have_dri3" != "xno"; then + DRI3_TRUE= + DRI3_FALSE='#' +else + DRI3_TRUE='#' + DRI3_FALSE= +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_dri3" >&5 +$as_echo "$have_dri3" >&6; } +if test "x$have_dri3" != "xno"; then + +$as_echo "#define HAVE_DRI3 1" >>confdefs.h + + dri_msg="$dri_msg DRI3" +else + if test "x$DRI" = "xyes" -a "x$DRI3" != "xno" -a "x$KMS" = "xyes"; then + as_fn_error $? "DRI3 requested but prerequisites not found" "$LINENO" 5 + fi +fi + +for ac_header in X11/extensions/dpmsconst.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/dpmsconst.h" "ac_cv_header_X11_extensions_dpmsconst_h" "$ac_includes_default" +if test "x$ac_cv_header_X11_extensions_dpmsconst_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_X11_EXTENSIONS_DPMSCONST_H 1 _ACEOF - DRI1="yes" -else - DRI1="no" + fi done - CFLAGS="$save_CFLAGS $DEBUGFLAGS" - CPPFLAGS="$save_CPPFLAGS" -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include DRI1 support" >&5 -$as_echo_n "checking whether to include DRI1 support... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DRI1" >&5 -$as_echo "$DRI1" >&6; } +PRESENT="no" - if test "x$DRI1" != "xno"; then - DRI1_TRUE= - DRI1_FALSE='#' -else - DRI1_TRUE='#' - DRI1_FALSE= -fi -if test "x$DRI1" != "xno"; then + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -$as_echo "#define HAVE_DRI1 1" >>confdefs.h +#include "xorg-server.h" +#if !defined PRESENT +#error PRESENT not defined +#endif - dri_msg="$dri_msg DRI1" -else - DRI1_CFLAGS="" - DRI1_LIBS="" +int +main () +{ - if test "x$enable_dri" = "xyes" -a "x$UMS" = "xyes"; then - as_fn_error $? "DRI1 requested but prerequisites not found" "$LINENO" 5 - fi + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + _EXT_CHECK=yes +else + _EXT_CHECK=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$SAVE_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if PRESENT is defined" >&5 +$as_echo_n "checking if PRESENT is defined... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_EXT_CHECK" >&5 +$as_echo "$_EXT_CHECK" >&6; } + if test "$_EXT_CHECK" != no; then + REQUIRED_MODULES="$REQUIRED_MODULES presentproto" + fi -DRI2=no -if test "x$enable_dri" != "xno"; then +if test "x$_EXT_CHECK" != "xno"; then pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRI2" >&5 -$as_echo_n "checking for DRI2... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PRESENT" >&5 +$as_echo_n "checking for PRESENT... " >&6; } -if test -n "$DRI2_CFLAGS"; then - pkg_cv_DRI2_CFLAGS="$DRI2_CFLAGS" +if test -n "$PRESENT_CFLAGS"; then + pkg_cv_PRESENT_CFLAGS="$PRESENT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dri2proto >= 2.6\""; } >&5 - ($PKG_CONFIG --exists --print-errors "dri2proto >= 2.6") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"presentproto\""; } >&5 + ($PKG_CONFIG --exists --print-errors "presentproto") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_DRI2_CFLAGS=`$PKG_CONFIG --cflags "dri2proto >= 2.6" 2>/dev/null` + pkg_cv_PRESENT_CFLAGS=`$PKG_CONFIG --cflags "presentproto" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -20248,16 +21224,16 @@ else pkg_failed=untried fi -if test -n "$DRI2_LIBS"; then - pkg_cv_DRI2_LIBS="$DRI2_LIBS" +if test -n "$PRESENT_LIBS"; then + pkg_cv_PRESENT_LIBS="$PRESENT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"dri2proto >= 2.6\""; } >&5 - ($PKG_CONFIG --exists --print-errors "dri2proto >= 2.6") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"presentproto\""; } >&5 + ($PKG_CONFIG --exists --print-errors "presentproto") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_DRI2_LIBS=`$PKG_CONFIG --libs "dri2proto >= 2.6" 2>/dev/null` + pkg_cv_PRESENT_LIBS=`$PKG_CONFIG --libs "presentproto" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -20278,109 +21254,88 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - DRI2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "dri2proto >= 2.6" 2>&1` + PRESENT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "presentproto" 2>&1` else - DRI2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "dri2proto >= 2.6" 2>&1` + PRESENT_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "presentproto" 2>&1` fi # Put the nasty error message in config.log where it belongs - echo "$DRI2_PKG_ERRORS" >&5 + echo "$PRESENT_PKG_ERRORS" >&5 + + as_fn_error $? "Package requirements (presentproto) were not met: + +$PRESENT_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. - DRI2="no" +Alternatively, you may set the environment variables PRESENT_CFLAGS +and PRESENT_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - DRI2="no" + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +Alternatively, you may set the environment variables PRESENT_CFLAGS +and PRESENT_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details. + +To get pkg-config, see . +See \`config.log' for more details" "$LINENO" 5; } else - DRI2_CFLAGS=$pkg_cv_DRI2_CFLAGS - DRI2_LIBS=$pkg_cv_DRI2_LIBS + PRESENT_CFLAGS=$pkg_cv_PRESENT_CFLAGS + PRESENT_LIBS=$pkg_cv_PRESENT_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - DRI2="yes" + PRESENT="yes" fi - dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri` - if test "x$dridriverdir" = "x"; then - dridriverdir="$libdir/dri" - fi - - prefix_NONE= - exec_prefix_NONE= - test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix - test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix - eval ac_define_dir="\"$dridriverdir\"" - eval ac_define_dir="\"$ac_define_dir\"" - DRI_DRIVER_PATH="$ac_define_dir" - - -cat >>confdefs.h <<_ACEOF -#define DRI_DRIVER_PATH "$ac_define_dir" -_ACEOF - - test "$prefix_NONE" && prefix=NONE - test "$exec_prefix_NONE" && exec_prefix=NONE - - if test "x$DRI2" != "xno"; then - save_CFLAGS=$CFLAGS - CFLAGS="$XORG_CFLAGS $DRM_CFLAGS $DRI1_CFLAGS $DRI2_CFLAGS" - for ac_header in dri2.h +fi +if test "x$PRESENT" != "xno"; then + save_CFLAGS=$CFLAGS + CFLAGS="$XORG_CFLAGS $PRESENT_CFLAGS" + for ac_header in present.h do : - ac_fn_c_check_header_compile "$LINENO" "dri2.h" "ac_cv_header_dri2_h" " -#include -#include + ac_fn_c_check_header_compile "$LINENO" "present.h" "ac_cv_header_present_h" " +#include +#include " -if test "x$ac_cv_header_dri2_h" = xyes; then : +if test "x$ac_cv_header_present_h" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DRI2_H 1 +#define HAVE_PRESENT_H 1 _ACEOF - DRI2="yes" + else - DRI2="no" + PRESENT="no" fi done - CFLAGS=$save_CFLAGS - fi + CFLAGS=$save_CFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include DRI2 support" >&5 -$as_echo_n "checking whether to include DRI2 support... " >&6; } - if test "x$DRI2" = "xyes"; then - DRI2_TRUE= - DRI2_FALSE='#' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include PRESENT support" >&5 +$as_echo_n "checking whether to include PRESENT support... " >&6; } + if test "x$PRESENT" != "xno"; then + PRESENT_TRUE= + PRESENT_FALSE='#' else - DRI2_TRUE='#' - DRI2_FALSE= + PRESENT_TRUE='#' + PRESENT_FALSE= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $DRI2" >&5 -$as_echo "$DRI2" >&6; } -if test "x$DRI2" != "xno"; then - -$as_echo "#define HAVE_DRI2 1" >>confdefs.h - - dri_msg="$dri_msg DRI2" -else - if test "x$enable_dri" = "xyes" -a "x$KMS" = "xyes"; then - as_fn_error $? "DRI2 requested but prerequisites not found" "$LINENO" 5 - fi - - # UXA doesn't build without DRI2 headers, too late to fix - UXA=no -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRESENT" >&5 +$as_echo "$PRESENT" >&6; } +if test "x$PRESENT" != "xno"; then -for ac_header in X11/extensions/dpmsconst.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "X11/extensions/dpmsconst.h" "ac_cv_header_X11_extensions_dpmsconst_h" "$ac_includes_default" -if test "x$ac_cv_header_X11_extensions_dpmsconst_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_X11_EXTENSIONS_DPMSCONST_H 1 -_ACEOF +$as_echo "#define HAVE_PRESENT 1" >>confdefs.h + dri_msg="$dri_msg Present" fi -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include UXA support" >&5 $as_echo_n "checking whether to include UXA support... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UXA" >&5 @@ -20430,12 +21385,12 @@ pkg_cv_XVMCLIB_CFLAGS="$XVMCLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xvmc dri2proto x11\""; } >&5 - ($PKG_CONFIG --exists --print-errors "xvmc dri2proto x11") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xvmc dri2proto x11 x11-xcb xcb-dri2 xcb-aux libdrm_intel\""; } >&5 + ($PKG_CONFIG --exists --print-errors "xvmc dri2proto x11 x11-xcb xcb-dri2 xcb-aux libdrm_intel") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_XVMCLIB_CFLAGS=`$PKG_CONFIG --cflags "xvmc dri2proto x11" 2>/dev/null` + pkg_cv_XVMCLIB_CFLAGS=`$PKG_CONFIG --cflags "xvmc dri2proto x11 x11-xcb xcb-dri2 xcb-aux libdrm_intel" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -20447,12 +21402,12 @@ pkg_cv_XVMCLIB_LIBS="$XVMCLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xvmc dri2proto x11\""; } >&5 - ($PKG_CONFIG --exists --print-errors "xvmc dri2proto x11") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xvmc dri2proto x11 x11-xcb xcb-dri2 xcb-aux libdrm_intel\""; } >&5 + ($PKG_CONFIG --exists --print-errors "xvmc dri2proto x11 x11-xcb xcb-dri2 xcb-aux libdrm_intel") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_XVMCLIB_LIBS=`$PKG_CONFIG --libs "xvmc dri2proto x11" 2>/dev/null` + pkg_cv_XVMCLIB_LIBS=`$PKG_CONFIG --libs "xvmc dri2proto x11 x11-xcb xcb-dri2 xcb-aux libdrm_intel" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -20473,9 +21428,9 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - XVMCLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xvmc dri2proto x11" 2>&1` + XVMCLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "xvmc dri2proto x11 x11-xcb xcb-dri2 xcb-aux libdrm_intel" 2>&1` else - XVMCLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xvmc dri2proto x11" 2>&1` + XVMCLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "xvmc dri2proto x11 x11-xcb xcb-dri2 xcb-aux libdrm_intel" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$XVMCLIB_PKG_ERRORS" >&5 @@ -20492,77 +21447,6 @@ $as_echo "yes" >&6; } fi - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XCB" >&5 -$as_echo_n "checking for XCB... " >&6; } - -if test -n "$XCB_CFLAGS"; then - pkg_cv_XCB_CFLAGS="$XCB_CFLAGS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11-xcb xcb-dri2 xcb-aux\""; } >&5 - ($PKG_CONFIG --exists --print-errors "x11-xcb xcb-dri2 xcb-aux") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_XCB_CFLAGS=`$PKG_CONFIG --cflags "x11-xcb xcb-dri2 xcb-aux" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi -if test -n "$XCB_LIBS"; then - pkg_cv_XCB_LIBS="$XCB_LIBS" - elif test -n "$PKG_CONFIG"; then - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11-xcb xcb-dri2 xcb-aux\""; } >&5 - ($PKG_CONFIG --exists --print-errors "x11-xcb xcb-dri2 xcb-aux") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_XCB_LIBS=`$PKG_CONFIG --libs "x11-xcb xcb-dri2 xcb-aux" 2>/dev/null` - test "x$?" != "x0" && pkg_failed=yes -else - pkg_failed=yes -fi - else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - XCB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11-xcb xcb-dri2 xcb-aux" 2>&1` - else - XCB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11-xcb xcb-dri2 xcb-aux" 2>&1` - fi - # Put the nasty error message in config.log where it belongs - echo "$XCB_PKG_ERRORS" >&5 - - XVMC="no" -elif test $pkg_failed = untried; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - XVMC="no" -else - XCB_CFLAGS=$pkg_cv_XCB_CFLAGS - XCB_LIBS=$pkg_cv_XCB_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include XvMC support" >&5 $as_echo_n "checking whether to include XvMC support... " >&6; } @@ -20660,6 +21544,20 @@ xp_msg="" +# Check whether --enable-tear-free was given. +if test "${enable_tear_free+set}" = set; then : + enableval=$enable_tear_free; TEARFREE="$enableval" +else + TEARFREE="no" +fi + +if test "x$TEARFREE" = "xyes"; then + +$as_echo "#define TEARFREE 1" >>confdefs.h + + xp_msg="$xp_msg TearFree" +fi + # Check whether --enable-rendernode was given. if test "${enable_rendernode+set}" = set; then : enableval=$enable_rendernode; RENDERNODE="$enableval" @@ -20704,26 +21602,26 @@ xp_msg="$xp_msg create2" fi -# Check whether --enable-userptr was given. -if test "${enable_userptr+set}" = set; then : - enableval=$enable_userptr; USERPTR="$enableval" +# Check whether --enable-rotation was given. +if test "${enable_rotation+set}" = set; then : + enableval=$enable_rotation; ROTATION="$enableval" else - USERPTR="no" + ROTATION="no" fi - if test "x$USERPTR" = "xyes"; then - USE_USERPTR_TRUE= - USE_USERPTR_FALSE='#' + if test "x$ROTATION" = "xyes"; then + USE_ROTATION_TRUE= + USE_ROTATION_FALSE='#' else - USE_USERPTR_TRUE='#' - USE_USERPTR_FALSE= + USE_ROTATION_TRUE='#' + USE_ROTATION_FALSE= fi -if test "x$USERPTR" = "xyes"; then +if test "x$ROTATION" = "xyes"; then -$as_echo "#define USE_USERPTR 1" >>confdefs.h +$as_echo "#define USE_ROTATION 1" >>confdefs.h - xp_msg="$xp_msg userptr" + xp_msg="$xp_msg rotation" fi # Check whether --enable-async-swap was given. @@ -20983,11 +21881,61 @@ debug_msg=" none" fi + +ac_fn_c_check_func "$LINENO" "getline" "ac_cv_func_getline" +if test "x$ac_cv_func_getline" = xyes; then : + $as_echo "#define HAVE_GETLINE 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" getline.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getline.$ac_objext" + ;; +esac + +fi + + + DRIVER_NAME="intel" -ac_config_files="$ac_config_files Makefile man/Makefile src/Makefile src/legacy/Makefile src/legacy/i810/Makefile src/legacy/i810/xvmc/Makefile src/render_program/Makefile src/sna/Makefile src/sna/brw/Makefile src/sna/fb/Makefile src/uxa/Makefile xvmc/Makefile xvmc/shader/Makefile xvmc/shader/mc/Makefile xvmc/shader/vld/Makefile test/Makefile tools/Makefile" + prefix_NONE= + exec_prefix_NONE= + test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix + eval ac_define_dir="\"$prefix\"" + eval ac_define_dir="\"$ac_define_dir\"" + PREFIX_PATH="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define PREFIX_PATH "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + + prefix_NONE= + exec_prefix_NONE= + test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix + test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix + eval ac_define_dir="\"$libexecdir\"" + eval ac_define_dir="\"$ac_define_dir\"" + LIBEXEC_PATH="$ac_define_dir" + + +cat >>confdefs.h <<_ACEOF +#define LIBEXEC_PATH "$ac_define_dir" +_ACEOF + + test "$prefix_NONE" && prefix=NONE + test "$exec_prefix_NONE" && exec_prefix=NONE + + +ac_config_files="$ac_config_files Makefile man/Makefile libobj/Makefile src/Makefile src/legacy/Makefile src/legacy/i810/Makefile src/legacy/i810/xvmc/Makefile src/render_program/Makefile src/sna/Makefile src/sna/brw/Makefile src/sna/fb/Makefile src/uxa/Makefile xvmc/Makefile xvmc/shader/Makefile xvmc/shader/mc/Makefile xvmc/shader/vld/Makefile test/Makefile tools/Makefile tools/org.x.xf86-video-intel.backlight-helper.policy" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -21098,6 +22046,14 @@ LTLIBOBJS=$ac_ltlibobjs +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +$as_echo_n "checking that generated files are newer than configure... " >&6; } + if test -n "$am_sleep_pid"; then + # Hide warnings about reused PIDs. + wait $am_sleep_pid 2>/dev/null + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 +$as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -21114,6 +22070,10 @@ as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${BUILD_BACKLIGHT_HELPER_TRUE}" && test -z "${BUILD_BACKLIGHT_HELPER_FALSE}"; then + as_fn_error $? "conditional \"BUILD_BACKLIGHT_HELPER\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_DOT_GIT_TRUE}" && test -z "${HAVE_DOT_GIT_FALSE}"; then as_fn_error $? "conditional \"HAVE_DOT_GIT\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -21126,6 +22086,10 @@ as_fn_error $? "conditional \"HAVE_X11\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${X11_DRI3_TRUE}" && test -z "${X11_DRI3_FALSE}"; then + as_fn_error $? "conditional \"X11_DRI3\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${BUILD_TOOLS_TRUE}" && test -z "${BUILD_TOOLS_FALSE}"; then as_fn_error $? "conditional \"BUILD_TOOLS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -21154,6 +22118,14 @@ as_fn_error $? "conditional \"DRI2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${DRI3_TRUE}" && test -z "${DRI3_FALSE}"; then + as_fn_error $? "conditional \"DRI3\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${PRESENT_TRUE}" && test -z "${PRESENT_FALSE}"; then + as_fn_error $? "conditional \"PRESENT\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${UXA_TRUE}" && test -z "${UXA_FALSE}"; then as_fn_error $? "conditional \"UXA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -21178,8 +22150,8 @@ as_fn_error $? "conditional \"USE_CREATE2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${USE_USERPTR_TRUE}" && test -z "${USE_USERPTR_FALSE}"; then - as_fn_error $? "conditional \"USE_USERPTR\" was never defined. +if test -z "${USE_ROTATION_TRUE}" && test -z "${USE_ROTATION_FALSE}"; then + as_fn_error $? "conditional \"USE_ROTATION\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_ASYNC_SWAP_TRUE}" && test -z "${USE_ASYNC_SWAP_FALSE}"; then @@ -21496,16 +22468,16 @@ # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -21565,28 +22537,16 @@ as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -21607,8 +22567,8 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xf86-video-intel $as_me 2.99.910, which was -generated by GNU Autoconf 2.68. Invocation command line was +This file was extended by xf86-video-intel $as_me 2.99.914, which was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -21673,11 +22633,11 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -xf86-video-intel config.status 2.99.910 -configured by $0, generated by GNU Autoconf 2.68, +xf86-video-intel config.status 2.99.914 +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -21768,7 +22728,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' @@ -22084,6 +23044,7 @@ "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "libobj/Makefile") CONFIG_FILES="$CONFIG_FILES libobj/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/legacy/Makefile") CONFIG_FILES="$CONFIG_FILES src/legacy/Makefile" ;; "src/legacy/i810/Makefile") CONFIG_FILES="$CONFIG_FILES src/legacy/i810/Makefile" ;; @@ -22099,6 +23060,7 @@ "xvmc/shader/vld/Makefile") CONFIG_FILES="$CONFIG_FILES xvmc/shader/vld/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; + "tools/org.x.xf86-video-intel.backlight-helper.policy") CONFIG_FILES="$CONFIG_FILES tools/org.x.xf86-video-intel.backlight-helper.policy" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac @@ -22695,7 +23657,7 @@ case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files + # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in @@ -22708,7 +23670,7 @@ # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but + # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. @@ -22742,21 +23704,19 @@ continue fi # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. + # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue + test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || @@ -23458,6 +24418,10 @@ fi +echo "" +echo "" +test -e `pwd $0`/README && cat `pwd $0`/README + accel_msg="" if test "x$SNA" != "xno"; then if test "$accel" = "sna"; then @@ -23485,14 +24449,13 @@ dri_msg=" none" fi -if test "x$tools" = "xyes"; then - tools_msg=" intel-virtual-output" -else +if test "x$tools_msg" = "x"; then tools_msg=" none" fi echo "" -echo "xf86-video-intel 2.99.910 will be compiled with:" +echo "xf86-video-intel 2.99.914 will be compiled with:" +echo " Xorg Video ABI version: $ABI_VERSION" echo " Acceleration backends:$accel_msg" echo " Additional debugging support?$debug_msg" echo " Support for Kernel Mode Setting? $KMS" diff -Nru xserver-xorg-video-intel-2.99.910/configure.ac xserver-xorg-video-intel-2.99.914/configure.ac --- xserver-xorg-video-intel-2.99.910/configure.ac 2014-02-10 09:34:10.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/configure.ac 2014-07-23 15:43:38.000000000 +0000 @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-video-intel], - [2.99.910], + [2.99.914], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-video-intel]) AC_CONFIG_SRCDIR([Makefile.am]) @@ -62,6 +62,32 @@ AC_PROG_LIBTOOL AC_SYS_LARGEFILE +# Platform specific settings +case $host_os in + *linux*) + backlight_helper=yes + ;; +esac + +AC_ARG_ENABLE(backlight, + AS_HELP_STRING([--disable-backlight], + [Enable control over the backlight [default=yes]]), + [backlight="$enableval"], + [backlight="yes"]) +if test "x$backlight" = "xyes"; then + AC_DEFINE(USE_BACKLIGHT, 1, [Enable control of the backlight]) +fi + +AC_ARG_ENABLE(backlight-helper, + AS_HELP_STRING([--disable-backlight-helper], + [Enable building the backlight helper executable for running X under a normal user [default=auto]]), + [backlight_helper="$enableval"],) +AM_CONDITIONAL(BUILD_BACKLIGHT_HELPER, [test "x$backlight" = "xyes" -a "x$backlight_helper" = "xyes"]) +if test "x$backlight_helper" = "xyes"; then + tools_msg="$tools_msg xf86-video-intel-backlight-helper" + AC_DEFINE(USE_BACKLIGHT_HELPER, 1, [Enable use of the backlight helper interfaces]) +fi + # Are we in a git checkout? dot_git=no if test -e .git; then @@ -176,19 +202,26 @@ fi fi -PKG_CHECK_MODULES(X11, [x11 xrender xrandr xext xfixes pixman-1], [x11="yes"], [x11="no"]) +PKG_CHECK_MODULES(X11, [x11 xrender xrandr xext xfixes pixman-1 libpng], [x11="yes"], [x11="no"]) AM_CONDITIONAL(HAVE_X11, test "x$x11" = "xyes") -PKG_CHECK_MODULES(TOOL, [xinerama xrandr xdamage xfixes xcursor xtst xrender xext x11 pixman-1], [tools="yes"], [tools="no"]) +shm=yes +AC_CHECK_HEADERS([sys/ipc.h sys/ipc.h], [], [shm="no"]) +AC_CHECK_HEADERS([X11/extensions/XShm.h], [], [shm="no"], [ +#include +#include +]) +AC_CHECK_HEADERS([X11/extensions/shmproto.h X11/extensions/shmstr.h], [], [], [ +#include +#include +]) +if test "x$ac_cv_header_X11_extensions_shmproto_h" != "xyes" -a "x$ac_cv_header_X11_extensions_shmstr_h" != "xyes"; then + shm="no" +fi -if test "x$tools" = "xyes"; then - AC_CHECK_HEADER([sys/ipc.h], [], [tools=no]) - AC_CHECK_HEADER([sys/shm.h], [], [tools=no]) - AC_CHECK_HEADER([sys/timerfd.h], [], [tools=no]) - - if test "$ac_cv_header_sys_ipc_h" = "yes" -a "$ac_cv_header_sys_shm_h" = "yes"; then - AC_MSG_CHECKING(whether shmctl IPC_RMID allows subsequent attaches) - AC_TRY_RUN([ +if test "x$shm" = "xyes"; then + AC_MSG_CHECKING(whether shmctl IPC_RMID allows subsequent attaches) + AC_TRY_RUN([ #include #include #include @@ -213,14 +246,52 @@ AC_MSG_RESULT(yes), AC_MSG_RESULT(no), AC_MSG_RESULT(assuming no)) - fi - - AC_CHECK_HEADERS([X11/extensions/XShm.h X11/extensions/shmproto.h X11/extensions/shmstr.h], [], [tools=no], - [#include - #include ]) fi -AM_CONDITIONAL(BUILD_TOOLS, test "x$tools" = "xyes") +PKG_CHECK_MODULES(X11_DRI3, [xcb-dri3 xcb-sync xcb-present x11-xcb xshmfence x11 xrender xext libdrm], [x11_dri3="yes"], [x11_dri3="no"]) +AM_CONDITIONAL(X11_DRI3, test "x$x11_dri3" = "xyes" -a "x$shm" = "xyes") + +AC_ARG_ENABLE(tools, + AS_HELP_STRING([--disable-tools], + [Enable building and installing the miscellaneous tools [default=auto]]), + [tools="$enableval"], [tools="auto"]) +if test "x$shm" != "xyes"; then + if test "x$tools" = "xyes"; then + AC_MSG_ERROR([Incomplete requirements for extra tools, X11 MIT-SHM extension required]) + fi + tools="no" +fi +if test "x$tools" != "xno"; then + ivo_requires="xrandr xdamage xfixes xcursor xtst xrender xext x11 pixman-1" + extra_cflags="" + + ignore="xinerama" + PKG_CHECK_MODULES(IVO_EXTRA, [$ignore], + [AC_CHECK_HEADERS([X11/extensions/Xinerama.h], [ivo_requires="$ignore $ivo_requires"], [], + [#include + #include + ])], [ignore=""]) + + ignore="xcb-dri3 xcb-sync x11-xcb xshmfence x11" + PKG_CHECK_MODULES(IVO_EXTRA, [$ignore], [ivo_requires="$ivo_requires $ignore"; extra_cflags="-DDRI3"], [ignore=""]) + + PKG_CHECK_MODULES(IVO, [$ivo_requires], [ivo="yes"], [ivo="no"]) + AC_CHECK_HEADER([sys/timerfd.h], [], [ivo="no"]) + if test "x$ivo" = "xno"; then + if test "x$tools" = "xyes"; then + AC_MSG_ERROR([Incomplete requirements for intel-virtual-output, requires $ivo_requires]) + fi + tools="no" + fi + + IVO_CFLAGS="$IVO_CFLAGS $extra_cflags" +fi +if test "x$tools" != "xno"; then + tools_msg="$tools_msg intel-virtual-output" +fi +AC_MSG_CHECKING([whether to build additional tools]) +AC_MSG_RESULT([$tools]) +AM_CONDITIONAL(BUILD_TOOLS, test "x$tools" != "xno") # Define a configure option for an alternate module directory AC_ARG_WITH(xorg-module-dir, @@ -231,7 +302,24 @@ AC_ARG_ENABLE(dri, AS_HELP_STRING([--disable-dri], - [Disable DRI support [[default=auto]]])) + [Disable DRI support [[default=auto]]]), + [DRI=$enableval], + [DRI=auto]) +AC_ARG_ENABLE(dri1, + AS_HELP_STRING([--disable-dri1], + [Disable DRI1 support [[default=yes]]]), + [DRI1=$enableval], + [DRI1=yes]) +AC_ARG_ENABLE(dri2, + AS_HELP_STRING([--disable-dri2], + [Disable DRI2 support [[default=yes]]]), + [DRI2=$enableval], + [DRI2=yes]) +AC_ARG_ENABLE(dri3, + AS_HELP_STRING([--disable-dri3], + [Disable DRI3 support [[default=yes]]]), + [DRI3=$enableval], + [DRI3=yes]) AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc], [Disable XvMC support [[default=yes]]]), @@ -275,7 +363,6 @@ # Store the list of server defined optional extensions in REQUIRED_MODULES XORG_DRIVER_CHECK_EXT(RANDR, randrproto) XORG_DRIVER_CHECK_EXT(RENDER, renderproto) -XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11) XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) # Obtain compiler/linker options for the driver dependencies @@ -293,13 +380,14 @@ AC_CHECK_HEADERS([sys/sysinfo.h], AC_CHECK_MEMBERS([struct sysinfo.totalram], [], [], [[#include ]])) fi +uxa_requires_libdrm=2.4.52 AC_ARG_ENABLE(uxa, AS_HELP_STRING([--enable-uxa], - [Enable Unified Acceleration Architecture (UXA) [default=yes]]), + [Enable Unified Acceleration Architecture (UXA) [default=auto]]), [UXA="$enableval"], [UXA=auto]) if test "x$UXA" = "xauto"; then - if ! pkg-config --exists 'libdrm_intel >= 2.4.29'; then + if ! pkg-config --exists "libdrm_intel >= $uxa_requires_libdrm"; then UXA=no fi if ! pkg-config --exists 'pixman-1 >= 0.24.0'; then @@ -308,7 +396,7 @@ fi if test "x$UXA" != "xno"; then AC_DEFINE(USE_UXA, 1, [Enable UXA support]) - PKG_CHECK_MODULES(DRMINTEL, [libdrm_intel >= 2.4.29]) + PKG_CHECK_MODULES(DRMINTEL, [libdrm_intel >= $uxa_requires_libdrm]) required_pixman_version=0.24 UXA=yes fi @@ -322,12 +410,18 @@ if test "x$UXA" != "xyes"; then AC_MSG_ERROR([Glamor acceleration requested but UXA is not enabled]) fi - PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.6.0]) - PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl]) + if pkg-config --exists "xorg-server >= 1.15.99.901"; then + GLAMOR="yes (using Xorg glamor module)" + else + PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.6.0]) + PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl]) + GLAMOR="yes (using libglamor)" + fi AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration]) fi PKG_CHECK_MODULES(XORG, [xorg-server >= $required_xorg_server_version xproto fontsproto pixman-1 >= $required_pixman_version $REQUIRED_MODULES]) +ABI_VERSION=`$PKG_CONFIG --variable=abi_videodrv xorg-server` if test "x$ONLY_UMS" = "xyes"; then UMS="yes" @@ -391,15 +485,15 @@ AC_DEFINE(UMS,1,[Assume UMS support]) fi - -DRI1=no -if test "x$enable_dri" != "xno" -a "x$UMS" = "xyes"; then - PKG_CHECK_MODULES(DRI1, [xf86driproto], [DRI1="yes"], [DRI1="no"]) +have_dri1=no +XORG_DRIVER_CHECK_EXT(XF86DRI, xf86driproto) +if test "x$_EXT_CHECK" != "xno" -a "x$DRI" != "xno" -a "x$DRI1" != "xno" -a "x$UMS" = "xyes"; then + PKG_CHECK_MODULES(DRI1, [xf86driproto], [have_dri1=$DRI], [have_dri1=no]) save_CFLAGS="$CFLAGS" save_CPPFLAGS="$CPPFLAGS" CFLAGS="$CFLAGS $XORG_CFLAGS $DRI1_CFLAGS $DRM_CFLAGS" CPPFLAGS="$CPPFLAGS $XORG_CFLAGS $DRI1_CFLAGS $DRM_CFLAGS" - AC_CHECK_HEADERS([dri.h sarea.h dristruct.h], [DRI1="yes"], [DRI1="no"], + AC_CHECK_HEADERS([dri.h sarea.h dristruct.h], [], [have_dri1=no], [/* for dri.h */ #include /* for dristruct.h */ @@ -411,52 +505,76 @@ # include #endif ]) - CFLAGS="$save_CFLAGS $DEBUGFLAGS" + CFLAGS="$save_CFLAGS" CPPFLAGS="$save_CPPFLAGS" fi AC_MSG_CHECKING([whether to include DRI1 support]) -AC_MSG_RESULT([$DRI1]) +AC_MSG_RESULT([$have_dri1]) -AM_CONDITIONAL(DRI1, test "x$DRI1" != "xno") -if test "x$DRI1" != "xno"; then +AM_CONDITIONAL(DRI1, test "x$have_dri1" != "xno") +if test "x$have_dri1" != "xno"; then AC_DEFINE(HAVE_DRI1,1,[Enable DRI1 driver support]) dri_msg="$dri_msg DRI1" else DRI1_CFLAGS="" DRI1_LIBS="" - if test "x$enable_dri" = "xyes" -a "x$UMS" = "xyes"; then + if test "x$DRI" = "xyes" -a "x$UMS" = "xyes" -a "x$DRI1" != "xno"; then AC_MSG_ERROR([DRI1 requested but prerequisites not found]) fi fi -DRI2=no -if test "x$enable_dri" != "xno"; then - PKG_CHECK_MODULES(DRI2, [dri2proto >= 2.6], DRI2="yes", DRI2="no") - dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri` - if test "x$dridriverdir" = "x"; then - dridriverdir="$libdir/dri" - fi - AC_DEFINE_DIR(DRI_DRIVER_PATH, dridriverdir, [Default DRI2 driver path]) +have_dri2=no +have_dri3=no +if test "x$DRI" != "xno"; then if test "x$DRI2" != "xno"; then + PKG_CHECK_MODULES(DRI2, [dri2proto >= 2.6], [have_dri2=$DRI], [have_dri2=no]) + fi + if test "x$have_dri2" != "xno"; then save_CFLAGS=$CFLAGS CFLAGS="$XORG_CFLAGS $DRM_CFLAGS $DRI1_CFLAGS $DRI2_CFLAGS" - AC_CHECK_HEADERS([dri2.h], DRI2="yes", DRI2="no", [ + AC_CHECK_HEADERS([dri2.h], [], [have_dri2=no], [ #include #include ]) CFLAGS=$save_CFLAGS fi + if test "x$have_dri2" != "xno"; then + dridriverdir=`$PKG_CONFIG --variable=dridriverdir dri` + if test "x$dridriverdir" = "x"; then + dridriverdir="$libdir/dri" + fi + AC_DEFINE_DIR(DRI_DRIVER_PATH, dridriverdir, [Default have_dri2 driver path]) + fi + + if test "x$DRI3" != "xno"; then + XORG_DRIVER_CHECK_EXT(DRI3, dri3proto) + if test "x$_EXT_CHECK" != "xno"; then + PKG_CHECK_MODULES(DRI3, [dri3proto], [have_dri3=$DRI], []) + fi + fi + if test "x$have_dri3" != "xno"; then + save_CFLAGS=$CFLAGS + CFLAGS="$XORG_CFLAGS $DRI3_CFLAGS" + AC_CHECK_DECL(DRI3, [], [have_dri3=no], [#include ]) + AC_CHECK_HEADERS([misyncstr.h misyncshm.h], [], [have_dri3=no], [ +#include +#include +#include +]) + CFLAGS=$save_CFLAGS + fi fi + AC_MSG_CHECKING([whether to include DRI2 support]) -AM_CONDITIONAL(DRI2, test "x$DRI2" = "xyes") -AC_MSG_RESULT([$DRI2]) -if test "x$DRI2" != "xno"; then +AM_CONDITIONAL(DRI2, test "x$have_dri2" != "xno") +AC_MSG_RESULT([$have_dri2]) +if test "x$have_dri2" != "xno"; then AC_DEFINE(HAVE_DRI2,1,[Enable DRI2 driver support]) dri_msg="$dri_msg DRI2" else - if test "x$enable_dri" = "xyes" -a "x$KMS" = "xyes"; then + if test "x$DRI" = "xyes" -a "x$DRI2" != "xno" -a "x$KMS" = "xyes"; then AC_MSG_ERROR([DRI2 requested but prerequisites not found]) fi @@ -464,8 +582,42 @@ UXA=no fi +AC_MSG_CHECKING([whether to include DRI3 support]) +AM_CONDITIONAL(DRI3, test "x$have_dri3" != "xno") +AC_MSG_RESULT([$have_dri3]) +if test "x$have_dri3" != "xno"; then + AC_DEFINE(HAVE_DRI3,1,[Enable DRI3 driver support]) + dri_msg="$dri_msg DRI3" +else + if test "x$DRI" = "xyes" -a "x$DRI3" != "xno" -a "x$KMS" = "xyes"; then + AC_MSG_ERROR([DRI3 requested but prerequisites not found]) + fi +fi + AC_CHECK_HEADERS([X11/extensions/dpmsconst.h]) +PRESENT="no" +XORG_DRIVER_CHECK_EXT(PRESENT, presentproto) +if test "x$_EXT_CHECK" != "xno"; then + PKG_CHECK_MODULES(PRESENT, [presentproto], [PRESENT="yes"], []) +fi +if test "x$PRESENT" != "xno"; then + save_CFLAGS=$CFLAGS + CFLAGS="$XORG_CFLAGS $PRESENT_CFLAGS" + AC_CHECK_HEADERS([present.h], [], [PRESENT="no"], [ +#include +#include +]) + CFLAGS=$save_CFLAGS +fi +AC_MSG_CHECKING([whether to include PRESENT support]) +AM_CONDITIONAL(PRESENT, test "x$PRESENT" != "xno") +AC_MSG_RESULT([$PRESENT]) +if test "x$PRESENT" != "xno"; then + AC_DEFINE(HAVE_PRESENT,1,[Enable PRESENT driver support]) + dri_msg="$dri_msg Present" +fi + AC_MSG_CHECKING([whether to include UXA support]) AC_MSG_RESULT([$UXA]) AM_CONDITIONAL(UXA, test "x$UXA" != "xno") @@ -479,8 +631,7 @@ AC_MSG_RESULT([$SNA]) if test "$XVMC" = "yes"; then - PKG_CHECK_MODULES(XVMCLIB, [xvmc dri2proto x11], [], [XVMC="no"]) - PKG_CHECK_MODULES(XCB, [x11-xcb xcb-dri2 xcb-aux], [], [XVMC="no"]) + PKG_CHECK_MODULES(XVMCLIB, [xvmc dri2proto x11 x11-xcb xcb-dri2 xcb-aux libdrm_intel], [], [XVMC="no"]) fi AC_MSG_CHECKING([whether to include XvMC support]) AC_MSG_RESULT([$XVMC]) @@ -555,6 +706,16 @@ xp_msg="" +AC_ARG_ENABLE(tear-free, + AS_HELP_STRING([--enable-tear-free], + [Enable use of TearFree by default [default=no]]), + [TEARFREE="$enableval"], + [TEARFREE="no"]) +if test "x$TEARFREE" = "xyes"; then + AC_DEFINE(TEARFREE,1,[Enable "TearFree" by default]) + xp_msg="$xp_msg TearFree" +fi + AC_ARG_ENABLE(rendernode, AS_HELP_STRING([--enable-rendernode], [Enable use of render nodes (experimental) [default=no]]), @@ -577,15 +738,15 @@ xp_msg="$xp_msg create2" fi -AC_ARG_ENABLE(userptr, - AS_HELP_STRING([--enable-userptr], - [Enable use of userptr (experimental) [default=no]]), - [USERPTR="$enableval"], - [USERPTR="no"]) -AM_CONDITIONAL(USE_USERPTR, test "x$USERPTR" = "xyes") -if test "x$USERPTR" = "xyes"; then - AC_DEFINE(USE_USERPTR,1,[Assume "userptr" support]) - xp_msg="$xp_msg userptr" +AC_ARG_ENABLE(rotation, + AS_HELP_STRING([--enable-rotation], + [Enable use of native rotations (experimental) [default=no]]), + [ROTATION="$enableval"], + [ROTATION="no"]) +AM_CONDITIONAL(USE_ROTATION, test "x$ROTATION" = "xyes") +if test "x$ROTATION" = "xyes"; then + AC_DEFINE(USE_ROTATION,1,[Assume "rotation" support]) + xp_msg="$xp_msg rotation" fi AC_ARG_ENABLE(async-swap, @@ -666,13 +827,19 @@ debug_msg=" none" fi +AC_CONFIG_LIBOBJ_DIR(libobj) +AC_REPLACE_FUNCS(getline) + DRIVER_NAME="intel" AC_SUBST([DRIVER_NAME]) AC_SUBST([moduledir]) +AC_DEFINE_DIR([PREFIX_PATH], prefix, [installation prefix]) +AC_DEFINE_DIR([LIBEXEC_PATH], libexecdir, [libexec directory]) AC_CONFIG_FILES([ Makefile man/Makefile + libobj/Makefile src/Makefile src/legacy/Makefile src/legacy/i810/Makefile @@ -688,9 +855,14 @@ xvmc/shader/vld/Makefile test/Makefile tools/Makefile + tools/org.x.xf86-video-intel.backlight-helper.policy ]) AC_OUTPUT +echo "" +echo "" +test -e `pwd $0`/README && cat `pwd $0`/README + accel_msg="" if test "x$SNA" != "xno"; then if test "$accel" = "sna"; then @@ -718,14 +890,13 @@ dri_msg=" none" fi -if test "x$tools" = "xyes"; then - tools_msg=" intel-virtual-output" -else +if test "x$tools_msg" = "x"; then tools_msg=" none" fi echo "" echo "AC_PACKAGE_STRING will be compiled with:" +echo " Xorg Video ABI version: $ABI_VERSION" echo " Acceleration backends:$accel_msg" echo " Additional debugging support?$debug_msg" echo " Support for Kernel Mode Setting? $KMS" diff -Nru xserver-xorg-video-intel-2.99.910/debian/changelog xserver-xorg-video-intel-2.99.914/debian/changelog --- xserver-xorg-video-intel-2.99.910/debian/changelog 2014-11-03 20:42:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/debian/changelog 2014-11-03 20:42:16.000000000 +0000 @@ -1,14 +1,97 @@ -xserver-xorg-video-intel (2:2.99.910-0ubuntu1) trusty; urgency=medium +xserver-xorg-video-intel (2:2.99.914-1~exp1ubuntu4~trusty1) trusty; urgency=medium - * Merge from Debian git. (LP: #1277143) + * lp: 1361007 - -- Timo Aaltonen Mon, 10 Feb 2014 14:03:01 +0200 + -- Robert Hooker Mon, 03 Nov 2014 15:30:37 -0500 + +xserver-xorg-video-intel (2:2.99.914-1~exp1ubuntu4) utopic; urgency=medium + + * Fix a crash when fglrx steals the screen in DGPU or IGPU mode. + - fix-uxa-fglrx-stealing.diff + + -- Maarten Lankhorst Thu, 09 Oct 2014 09:39:17 +0200 + +xserver-xorg-video-intel (2:2.99.914-1~exp1ubuntu3) utopic; urgency=medium + + * Add patch to enable SNA with fglrx. (LP: #1359105) + + -- Maarten Lankhorst Mon, 22 Sep 2014 15:29:05 +0200 + +xserver-xorg-video-intel (2:2.99.914-1~exp1ubuntu2) utopic; urgency=medium + + * Rebuild for xorg 1.16 abi. + + -- Maarten Lankhorst Wed, 10 Sep 2014 16:55:48 +0200 + +xserver-xorg-video-intel (2:2.99.914-1~exp1ubuntu1) utopic; urgency=medium + + * Merge from released experimental. + * Add patch to fix broken flushing with dri3/sna. + - dri3-flush-broken.patch (fd.org #81551) + + -- Maarten Lankhorst Tue, 29 Jul 2014 12:57:26 +0200 + +xserver-xorg-video-intel (2:2.99.914-1~exp1) experimental; urgency=medium + + * New upstream prerelease 2.99.914. + * Update upstream changelog. + * Fix FTBFS on kfreebsd by not installing non-existent files. + + -- Vincent Cheng Wed, 23 Jul 2014 22:49:08 -0700 + +xserver-xorg-video-intel (2:2.99.912+git20140719-1~exp1) experimental; urgency=medium + + * New upstream snapshot. -xserver-xorg-video-intel (2:2.99.910-1) UNRELEASED; urgency=low + -- maximilian attems Sat, 19 Jul 2014 14:18:15 +0200 + +xserver-xorg-video-intel (2:2.99.912+git20140705-1~exp1) experimental; urgency=medium + + * New upstream snapshot. + + [ Julien Cristau ] + * Remove Cyril from Uploaders. + + -- maximilian attems Sat, 05 Jul 2014 20:47:01 +0200 + +xserver-xorg-video-intel (2:2.99.912-1~exp1) experimental; urgency=medium + + * New upstream prerelease 2.99.912. + * Update upstream changelog. + + -- maximilian attems Tue, 10 Jun 2014 21:59:57 +0200 + +xserver-xorg-video-intel (2:2.99.911+git20140607-1~exp1) experimental; urgency=medium * New upstream prerelease. - -- Timo Aaltonen Tue, 01 Oct 2013 14:07:22 +0300 + -- maximilian attems Sat, 07 Jun 2014 10:33:52 +0200 + +xserver-xorg-video-intel (2:2.99.911+git20140529-1~exp2) experimental; urgency=medium + + * Add myself to Uploaders. + * Install intel-virtual-output. (Closes: #749925) + - New build-deps added: libxinerama-dev, libxrandr-dev, libxdamage-dev, + libxcursor-dev, libxtst-dev, libxrender-dev, libpixman-1-dev + * Stop overriding default upstream acceleration method (i.e. default to SNA + instead of UXA). + + -- Vincent Cheng Mon, 02 Jun 2014 23:47:23 -0700 + +xserver-xorg-video-intel (2:2.99.911+git20140529-1~exp1) experimental; urgency=low + + * New upstream prerelease. (closes: #748753) + * Install new backlight helper. + * Add myself to Uploaders. + * Bump Standards-Version to 3.9.5 (no changes necessary) + + -- maximilian attems Fri, 30 May 2014 11:15:58 +0200 + +xserver-xorg-video-intel (2:2.99.910-0ubuntu1) trusty; urgency=medium + + * Merge from Debian git. (LP: #1277143) + + -- Timo Aaltonen Mon, 10 Feb 2014 14:03:01 +0200 xserver-xorg-video-intel (2:2.99.909-0ubuntu2) trusty; urgency=medium diff -Nru xserver-xorg-video-intel-2.99.910/debian/control xserver-xorg-video-intel-2.99.914/debian/control --- xserver-xorg-video-intel-2.99.910/debian/control 2014-11-03 20:42:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/debian/control 2014-11-03 20:42:16.000000000 +0000 @@ -3,7 +3,11 @@ Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian X Strike Force -Uploaders: Drew Parsons , Cyril Brulebois +Uploaders: + Drew Parsons , + Michael Stapelberg , + maximilian attems , + Vincent Cheng , Build-Depends: debhelper (>= 8), dh-autoreconf, @@ -37,7 +41,15 @@ quilt (>= 0.46-7~), xutils-dev (>= 1:7.5+4), valgrind [amd64 armel armhf i386 mips mipsel powerpc s390x], -Standards-Version: 3.9.4 +# intel-virtual-output: + libxinerama-dev, + libxrandr-dev, + libxdamage-dev, + libxcursor-dev, + libxtst-dev, + libxrender-dev, + libpixman-1-dev, +Standards-Version: 3.9.5 Vcs-Git: git://anonscm.debian.org/pkg-xorg/driver/xserver-xorg-video-intel Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-xorg/driver/xserver-xorg-video-intel.git Homepage: http://www.x.org/ diff -Nru xserver-xorg-video-intel-2.99.910/debian/patches/dri3-flush-broken.patch xserver-xorg-video-intel-2.99.914/debian/patches/dri3-flush-broken.patch --- xserver-xorg-video-intel-2.99.910/debian/patches/dri3-flush-broken.patch 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/debian/patches/dri3-flush-broken.patch 2014-11-03 20:42:16.000000000 +0000 @@ -0,0 +1,82 @@ +--- a/src/sna/sna_accel.c ++++ b/src/sna/sna_accel.c +@@ -1408,6 +1408,9 @@ + + __sna_pixmap_free_cpu(sna, priv); + ++ if (priv->flush) ++ sna_accel_watch_flush(sna, -1); ++ + if (priv->header) { + assert(pixmap->drawable.pScreen == sna->scrn->pScreen); + assert(!priv->shm); +--- a/src/sna/sna_dri3.c ++++ b/src/sna/sna_dri3.c +@@ -39,6 +39,8 @@ + #include + #include + ++#define MESA_HAS_NO_FENCES 1 ++ + static DevPrivateKeyRec sna_sync_fence_private_key; + struct sna_sync_fence { + SyncFenceSetTriggeredFunc set_triggered; +@@ -49,6 +51,22 @@ + return dixLookupPrivate(&fence->devPrivates, &sna_sync_fence_private_key); + } + ++static inline void mark_dri3_pixmap(struct sna *sna, struct sna_pixmap *priv, struct kgem_bo *bo) ++{ ++ if (!MESA_HAS_NO_FENCES) ++ return; ++ ++ bo->flush = true; ++ if (bo->exec) ++ sna->kgem.flush = 1; ++ if (bo == priv->gpu_bo) ++ priv->flush |= 3; ++ else ++ priv->shm = true; ++ ++ sna_accel_watch_flush(sna, 1); ++} ++ + static void sna_sync_flush(struct sna *sna, struct sna_pixmap *priv) + { + struct kgem_bo *bo = NULL; +@@ -94,11 +112,13 @@ + DBG(("%s: associated pixmap=%ld\n", __FUNCTION__, get_drawable_pixmap(draw)->drawable.serialNumber)); + sna_sync_flush(sna, sna_pixmap(get_drawable_pixmap(draw))); + } else { /* SyncFence are currently per-screen, sigh */ +- struct sna_pixmap *priv; ++ if (!MESA_HAS_NO_FENCES) { ++ struct sna_pixmap *priv; + +- DBG(("%s: flushing all DRI3 pixmaps\n", __FUNCTION__)); +- list_for_each_entry(priv, &sna->dri3.pixmaps, cow_list) +- sna_sync_flush(sna, priv); ++ DBG(("%s: flushing all DRI3 pixmaps\n", __FUNCTION__)); ++ list_for_each_entry(priv, &sna->dri3.pixmaps, cow_list) ++ sna_sync_flush(sna, priv); ++ } + + sna_accel_flush(sna); + } +@@ -278,6 +298,8 @@ + } + list_add(&priv->cow_list, &sna->dri3.pixmaps); + ++ mark_dri3_pixmap(sna, priv, bo); ++ + return pixmap; + + free_pixmap: +@@ -337,6 +359,8 @@ + priv->pinned |= PIN_DRI3; + list_move(&priv->cow_list, &sna->dri3.pixmaps); + ++ mark_dri3_pixmap(sna, priv, bo); ++ + *stride = (priv->pinned & PIN_DRI3) ? priv->gpu_bo->pitch : priv->cpu_bo->pitch; + *size = kgem_bo_size((priv->pinned & PIN_DRI3) ? priv->gpu_bo : priv->cpu_bo); + DBG(("%s: exporting %s pixmap=%ld, handle=%d, stride=%d, size=%d\n", diff -Nru xserver-xorg-video-intel-2.99.910/debian/patches/fix-uxa-fglrx-stealing.diff xserver-xorg-video-intel-2.99.914/debian/patches/fix-uxa-fglrx-stealing.diff --- xserver-xorg-video-intel-2.99.910/debian/patches/fix-uxa-fglrx-stealing.diff 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/debian/patches/fix-uxa-fglrx-stealing.diff 2014-11-03 20:42:16.000000000 +0000 @@ -0,0 +1,646 @@ +commit c139e2fb95f2db0b39aadcd58cc63b316a278951 +Author: Chris Wilson +Date: Wed Oct 8 13:59:55 2014 +0100 + + intel: Store pointer to struct intel_device + + Beware the barbarians at the gate, who invade and steal your ScrnInfoPtr + and its Entity from underneath you. In some configurations, we lose + access to the struct intel_device stored on the Entity after + initialisation, causing havoc. Workaround this by storing the + intel_device that we open in our driverPrivate. + + Signed-off-by: Chris Wilson + +--- a/src/intel_device.c ++++ b/src/intel_device.c +@@ -65,9 +65,11 @@ + #include "fd.h" + + struct intel_device { ++ int idx; + char *master_node; + char *render_node; + int fd; ++ int device_id; + int open_count; + int master_count; + }; +@@ -97,7 +99,7 @@ + if (dev == NULL) + return 0; + +- return __intel_get_device_id(dev->fd); ++ return dev->device_id; + } + + static inline struct intel_device *intel_device(ScrnInfoPtr scrn) +@@ -108,11 +110,6 @@ + return xf86GetEntityPrivate(scrn->entityList[0], intel_device_key)->ptr; + } + +-static inline void intel_set_device(ScrnInfoPtr scrn, struct intel_device *dev) +-{ +- xf86GetEntityPrivate(scrn->entityList[0], intel_device_key)->ptr = dev; +-} +- + static int is_i915_device(int fd) + { + drm_version_t version; +@@ -511,6 +508,12 @@ + if (geteuid() && is_master(fd)) + master_count++; + ++ if (pci) ++ dev->device_id = pci->device_id; ++ else ++ dev->device_id = __intel_get_device_id(fd); ++ ++ dev->idx = entity_num; + dev->fd = fd; + dev->open_count = master_count; + dev->master_count = master_count; +@@ -541,13 +544,15 @@ + return dev->fd; + } + +-int intel_get_device(ScrnInfoPtr scrn) ++struct intel_device *intel_get_device(ScrnInfoPtr scrn, int *fd) + { + struct intel_device *dev; + int ret; + + dev = intel_device(scrn); +- assert(dev && dev->fd != -1); ++ if (dev == NULL) ++ return NULL; ++ assert(dev->fd != -1); + + if (dev->open_count++ == 0) { + drmSetVersion sv; +@@ -575,16 +580,16 @@ + "[drm] failed to set drm interface version: %s [%d].\n", + strerror(errno), errno); + dev->open_count--; +- return -1; ++ return NULL; + } + } + +- return dev->fd; ++ *fd = dev->fd; ++ return dev; + } + +-const char *intel_get_client_name(ScrnInfoPtr scrn) ++const char *intel_get_client_name(struct intel_device *dev) + { +- struct intel_device *dev = intel_device(scrn); + assert(dev && dev->render_node); + return dev->render_node; + } +@@ -600,14 +605,11 @@ + return drmGetMagic(fd, &magic) == 0 && drmAuthMagic(dev->fd, magic) == 0; + } + +-int intel_get_client_fd(ScrnInfoPtr scrn) ++int intel_get_client_fd(struct intel_device *dev) + { +- struct intel_device *dev; + int fd = -1; + +- dev = intel_device(scrn); +- assert(dev); +- assert(dev->fd != -1); ++ assert(dev && dev->fd != -1); + assert(dev->render_node); + + #ifdef O_CLOEXEC +@@ -628,16 +630,14 @@ + return fd; + } + +-int intel_get_device_id(ScrnInfoPtr scrn) ++int intel_get_device_id(struct intel_device *dev) + { +- struct intel_device *dev = intel_device(scrn); + assert(dev && dev->fd != -1); +- return __intel_get_device_id(dev->fd); ++ return dev->device_id; + } + +-int intel_get_master(ScrnInfoPtr scrn) ++int intel_get_master(struct intel_device *dev) + { +- struct intel_device *dev = intel_device(scrn); + int ret; + + assert(dev && dev->fd != -1); +@@ -658,9 +658,8 @@ + return ret; + } + +-int intel_put_master(ScrnInfoPtr scrn) ++int intel_put_master(struct intel_device *dev) + { +- struct intel_device *dev = intel_device(scrn); + int ret; + + assert(dev && dev->fd != -1); +@@ -676,10 +675,8 @@ + return ret; + } + +-void intel_put_device(ScrnInfoPtr scrn) ++void intel_put_device(struct intel_device *dev) + { +- struct intel_device *dev = intel_device(scrn); +- + assert(dev && dev->fd != -1); + + assert(dev->open_count); +@@ -687,7 +684,7 @@ + return; + + assert(!hosted()); +- intel_set_device(scrn, NULL); ++ xf86GetEntityPrivate(dev->idx, intel_device_key)->ptr = NULL; + + drmClose(dev->fd); + if (dev->render_node != dev->master_node) +--- a/src/intel_driver.h ++++ b/src/intel_driver.h +@@ -119,22 +119,24 @@ + struct intel_device_info { + int gen; + }; ++struct intel_device; + + int intel_entity_get_devid(int index); + +-void intel_detect_chipset(ScrnInfoPtr scrn, EntityInfoPtr ent); +- + int intel_open_device(int entity_num, + const struct pci_device *pci, + struct xf86_platform_device *dev); + int __intel_peek_fd(ScrnInfoPtr scrn); +-int intel_get_device(ScrnInfoPtr scrn); +-const char *intel_get_client_name(ScrnInfoPtr scrn); +-int intel_get_client_fd(ScrnInfoPtr scrn); +-int intel_get_device_id(ScrnInfoPtr scrn); +-int intel_get_master(ScrnInfoPtr scrn); +-int intel_put_master(ScrnInfoPtr scrn); +-void intel_put_device(ScrnInfoPtr scrn); ++ ++struct intel_device *intel_get_device(ScrnInfoPtr scrn, int *fd); ++const char *intel_get_client_name(struct intel_device *dev); ++int intel_get_client_fd(struct intel_device *dev); ++int intel_get_device_id(struct intel_device *dev); ++int intel_get_master(struct intel_device *dev); ++int intel_put_master(struct intel_device *dev); ++void intel_put_device(struct intel_device *dev); ++ ++void intel_detect_chipset(ScrnInfoPtr scrn, struct intel_device *dev); + + #define hosted() (xorgMir) + +--- a/src/intel_module.c ++++ b/src/intel_module.c +@@ -318,27 +318,31 @@ + }; + + void +-intel_detect_chipset(ScrnInfoPtr scrn, EntityInfoPtr ent) ++intel_detect_chipset(ScrnInfoPtr scrn, struct intel_device *dev) + { +- MessageType from = X_PROBED; +- const char *name = NULL; + int devid; ++ const char *name = NULL; + int i; + +- if (ent->device->chipID >= 0) { +- xf86DrvMsg(scrn->scrnIndex, from = X_CONFIG, +- "ChipID override: 0x%04X\n", +- ent->device->chipID); +- devid = ent->device->chipID; +- } else { ++ if (dev == NULL) { ++ EntityInfoPtr ent; + struct pci_device *pci; + +- pci = xf86GetPciInfoForEntity(ent->index); +- if (pci != NULL) +- devid = pci->device_id; +- else +- devid = intel_get_device_id(scrn); +- } ++ ent = xf86GetEntityInfo(scrn->entityList[0]); ++ if (ent->device->chipID >= 0) { ++ xf86DrvMsg(scrn->scrnIndex, X_CONFIG, ++ "ChipID override: 0x%04X\n", ++ ent->device->chipID); ++ devid = ent->device->chipID; ++ } else { ++ pci = xf86GetPciInfoForEntity(ent->index); ++ if (pci) ++ devid = pci->device_id; ++ else ++ devid = ~0; ++ } ++ } else ++ devid = intel_get_device_id(dev); + + for (i = 0; intel_chipsets[i].name != NULL; i++) { + if (devid == intel_chipsets[i].token) { +@@ -358,7 +362,7 @@ + } + + if (gen) { +- xf86DrvMsg(scrn->scrnIndex, from, ++ xf86DrvMsg(scrn->scrnIndex, X_PROBED, + "gen%d engineering sample\n", gen); + } else { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, +@@ -367,7 +371,7 @@ + + name = "unknown"; + } else { +- xf86DrvMsg(scrn->scrnIndex, from, ++ xf86DrvMsg(scrn->scrnIndex, X_PROBED, + "Integrated Graphics Chipset: Intel(R) %s\n", + name); + } +--- a/src/legacy/i810/i810_driver.c ++++ b/src/legacy/i810/i810_driver.c +@@ -364,7 +364,7 @@ + */ + I810DoDDC(scrn, pI810->pEnt->index); + +- intel_detect_chipset(scrn, pI810->pEnt); ++ intel_detect_chipset(scrn, NULL); + + pI810->LinearAddr = pI810->PciInfo->regions[0].base_addr; + xf86DrvMsg(scrn->scrnIndex, X_PROBED, "Linear framebuffer at 0x%lX\n", +--- a/src/sna/gen5_render.c ++++ b/src/sna/gen5_render.c +@@ -3333,7 +3333,7 @@ + #if !NO_COMPOSITE_SPANS + sna->render.check_composite_spans = gen5_check_composite_spans; + sna->render.composite_spans = gen5_render_composite_spans; +- if (intel_get_device_id(sna->scrn) == 0x0044) ++ if (intel_get_device_id(sna->dev) == 0x0044) + sna->render.prefer_gpu |= PREFER_GPU_SPANS; + #endif + sna->render.video = gen5_render_video; +--- a/src/sna/gen6_render.c ++++ b/src/sna/gen6_render.c +@@ -3633,7 +3633,7 @@ + + const char *gen6_render_init(struct sna *sna, const char *backend) + { +- int devid = intel_get_device_id(sna->scrn); ++ int devid = intel_get_device_id(sna->dev); + + if (!gen6_render_setup(sna, devid)) + return backend; +--- a/src/sna/gen7_render.c ++++ b/src/sna/gen7_render.c +@@ -3885,7 +3885,7 @@ + + const char *gen7_render_init(struct sna *sna, const char *backend) + { +- int devid = intel_get_device_id(sna->scrn); ++ int devid = intel_get_device_id(sna->dev); + + if (!gen7_render_setup(sna, devid)) + return backend; +--- a/src/sna/gen8_render.c ++++ b/src/sna/gen8_render.c +@@ -3887,7 +3887,7 @@ + int i, j, k, l, m; + uint32_t devid; + +- devid = intel_get_device_id(sna->scrn); ++ devid = intel_get_device_id(sna->dev); + if (devid & 0xf) + state->gt = ((devid >> 4) & 0xf) + 1; + DBG(("%s: gt=%d\n", __FUNCTION__, state->gt)); +--- a/src/sna/sna.h ++++ b/src/sna/sna.h +@@ -239,6 +239,7 @@ + struct kgem kgem; + + ScrnInfoPtr scrn; ++ struct intel_device *dev; + + unsigned flags; + #define SNA_IS_SLAVED 0x1 +--- a/src/sna/sna_dri2.c ++++ b/src/sna/sna_dri2.c +@@ -3232,7 +3232,7 @@ + memset(&info, '\0', sizeof(info)); + info.fd = sna->kgem.fd; + info.driverName = dri_driver_name(sna); +- info.deviceName = intel_get_client_name(sna->scrn); ++ info.deviceName = intel_get_client_name(sna->dev); + + DBG(("%s: loading dri driver '%s' [gen=%d] for device '%s'\n", + __FUNCTION__, info.driverName, sna->kgem.gen, info.deviceName)); +--- a/src/sna/sna_dri3.c ++++ b/src/sna/sna_dri3.c +@@ -178,7 +178,7 @@ + int fd; + + DBG(("%s()\n", __FUNCTION__)); +- fd = intel_get_client_fd(xf86ScreenToScrn(screen)); ++ fd = intel_get_client_fd(to_sna_from_screen(screen)->dev); + if (fd < 0) + return -fd; + +--- a/src/sna/sna_driver.c ++++ b/src/sna/sna_driver.c +@@ -264,7 +264,7 @@ + assert(sna->front == new_front); + screen->DestroyPixmap(new_front); /* transfer ownership to screen */ + +- if (intel_get_master(sna->scrn)) { ++ if (intel_get_master(sna->dev)) { + xf86DrvMsg(screen->myNum, X_ERROR, + "[intel] Failed to become DRM master\n"); + screen->DestroyPixmap(sna->front); +@@ -595,8 +595,8 @@ + scrn->progClock = TRUE; + scrn->rgbBits = 8; + +- fd = intel_get_device(scrn); +- if (fd == -1) { ++ sna->dev = intel_get_device(scrn, &fd); ++ if (sna->dev == NULL) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Failed to claim DRM device.\n"); + goto cleanup; +@@ -612,7 +612,7 @@ + goto cleanup; + } + +- intel_detect_chipset(scrn, pEnt); ++ intel_detect_chipset(scrn, sna->dev); + xf86DrvMsg(scrn->scrnIndex, X_PROBED, "CPU: %s\n", + sna_cpu_features_to_string(sna->cpu_features, buf)); + +@@ -720,6 +720,8 @@ + + cleanup: + scrn->driverPrivate = (void *)((uintptr_t)sna->info | (sna->flags & SNA_IS_SLAVED) | 2); ++ if (sna->dev) ++ intel_put_device(sna->dev); + free(sna); + return FALSE; + } +@@ -901,12 +903,13 @@ + static void sna_leave_vt(VT_FUNC_ARGS_DECL) + { + SCRN_INFO_PTR(arg); ++ struct sna *sna = to_sna(scrn); + + DBG(("%s\n", __FUNCTION__)); + +- sna_mode_reset(to_sna(scrn)); ++ sna_mode_reset(sna); + +- if (intel_put_master(scrn)) ++ if (intel_put_master(sna->dev)) + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "drmDropMaster failed: %s\n", strerror(errno)); + } +@@ -944,7 +947,7 @@ + } + + if (scrn->vtSema) { +- intel_put_master(scrn); ++ intel_put_master(sna->dev); + scrn->vtSema = FALSE; + } + +@@ -1197,9 +1200,9 @@ + + sna_mode_fini(sna); + sna_acpi_fini(sna); +- free(sna); + +- intel_put_device(scrn); ++ intel_put_device(sna->dev); ++ free(sna); + } + + static Bool sna_enter_vt(VT_FUNC_ARGS_DECL) +@@ -1208,7 +1211,7 @@ + struct sna *sna = to_sna(scrn); + + DBG(("%s\n", __FUNCTION__)); +- if (intel_get_master(scrn)) ++ if (intel_get_master(sna->dev)) + return FALSE; + + if (sna->flags & SNA_REPROBE) { +--- a/src/sna/sna_video_hwmc.c ++++ b/src/sna/sna_video_hwmc.c +@@ -81,7 +81,7 @@ + return BadAlloc; + + if (sna->kgem.gen >= 040) { +- int devid = intel_get_device_id(sna->scrn); ++ int devid = intel_get_device_id(sna->dev); + + if (sna->kgem.gen >= 045) + priv->type = XVMC_I965_MPEG2_VLD; +--- a/src/uxa/intel.h ++++ b/src/uxa/intel.h +@@ -54,7 +54,6 @@ + #include "xorg-server.h" + #include "xf86_OSproc.h" + #include "compiler.h" +-#include "xf86Pci.h" + #include "xf86Cursor.h" + #include "xf86xv.h" + #include "xf86Crtc.h" +@@ -171,6 +170,7 @@ + + typedef struct intel_screen_private { + ScrnInfoPtr scrn; ++ struct intel_device *dev; + int cpp; + + #define RENDER_BATCH I915_EXEC_RENDER +@@ -223,7 +223,6 @@ + + int Chipset; + EntityInfoPtr pEnt; +- struct pci_device *PciInfo; + const struct intel_device_info *info; + + unsigned int BR[20]; +@@ -378,14 +377,14 @@ + #define IS_HSW(intel) (INTEL_INFO(intel)->gen == 075) + + /* Some chips have specific errata (or limits) that we need to workaround. */ +-#define IS_I830(intel) ((intel)->PciInfo->device_id == PCI_CHIP_I830_M) +-#define IS_845G(intel) ((intel)->PciInfo->device_id == PCI_CHIP_845_G) +-#define IS_I865G(intel) ((intel)->PciInfo->device_id == PCI_CHIP_I865_G) ++#define IS_I830(intel) (intel_get_device_id((intel)->dev) == PCI_CHIP_I830_M) ++#define IS_845G(intel) (intel_get_device_id((intel)->dev) == PCI_CHIP_845_G) ++#define IS_I865G(intel) (intel_get_device_id((intel)->dev) == PCI_CHIP_I865_G) + +-#define IS_I915G(pI810) ((intel)->PciInfo->device_id == PCI_CHIP_I915_G || (intel)->PciInfo->device_id == PCI_CHIP_E7221_G) +-#define IS_I915GM(pI810) ((intel)->PciInfo->device_id == PCI_CHIP_I915_GM) ++#define IS_I915G(pI810) (intel_get_device_id((intel)->dev) == PCI_CHIP_I915_G || intel_get_device_id((intel)->dev) == PCI_CHIP_E7221_G) ++#define IS_I915GM(pI810) (intel_get_device_id((intel)->dev) == PCI_CHIP_I915_GM) + +-#define IS_965_Q(pI810) ((intel)->PciInfo->device_id == PCI_CHIP_I965_Q) ++#define IS_965_Q(pI810) (intel_get_device_id((intel)->dev) == PCI_CHIP_I965_Q) + + /* supports Y tiled surfaces (pre-965 Mesa isn't ready yet) */ + #define SUPPORTS_YTILING(pI810) (INTEL_INFO(intel)->gen >= 040) +--- a/src/uxa/intel_dri3.c ++++ b/src/uxa/intel_dri3.c +@@ -36,9 +36,11 @@ + RRProviderPtr provider, + int *out) + { ++ ScrnInfoPtr scrn = xf86ScreenToScrn(screen); ++ intel_screen_private *intel = intel_get_screen_private(scrn); + int fd; + +- fd = intel_get_client_fd(xf86ScreenToScrn(screen)); ++ fd = intel_get_client_fd(intel->dev); + if (fd < 0) + return -fd; + +--- a/src/uxa/intel_driver.c ++++ b/src/uxa/intel_driver.c +@@ -181,7 +181,7 @@ + static void intel_check_chipset_option(ScrnInfoPtr scrn) + { + intel_screen_private *intel = intel_get_screen_private(scrn); +- intel_detect_chipset(scrn, intel->pEnt); ++ intel_detect_chipset(scrn, intel->dev); + } + + static Bool I830GetEarlyOptions(ScrnInfoPtr scrn) +@@ -247,9 +247,8 @@ + static Bool intel_open_drm_master(ScrnInfoPtr scrn) + { + intel_screen_private *intel = intel_get_screen_private(scrn); +- +- intel->drmSubFD = intel_get_device(scrn); +- return intel->drmSubFD != -1; ++ intel->dev = intel_get_device(scrn, &intel->drmSubFD); ++ return intel->dev != NULL; + } + + static int intel_init_bufmgr(intel_screen_private *intel) +@@ -360,7 +359,7 @@ + } + + if (INTEL_INFO(intel)->gen == 060) { +- struct pci_device *const device = intel->PciInfo; ++ struct pci_device *const device = xf86GetPciInfoForEntity(intel->pEnt->index); + + /* Sandybridge rev07 locks up easily, even with the + * BLT ring workaround in place. +@@ -461,8 +460,6 @@ + + scrn->displayWidth = 640; /* default it */ + +- intel->PciInfo = xf86GetPciInfoForEntity(intel->pEnt->index); +- + if (!intel_open_drm_master(scrn)) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Failed to become DRM master.\n"); +@@ -862,7 +859,7 @@ + #ifdef INTEL_XVMC + MessageType from; + #endif +- struct pci_device *const device = intel->PciInfo; ++ struct pci_device *const device = xf86GetPciInfoForEntity(intel->pEnt->index); + int fb_bar = IS_GEN2(intel) ? 0 : 2; + + scrn->videoRam = device->regions[fb_bar].size / 1024; +@@ -1072,7 +1069,7 @@ + if (intel && !((uintptr_t)intel & 3)) { + intel_mode_fini(intel); + intel_bufmgr_fini(intel); +- intel_put_device(scrn); ++ intel_put_device(intel->dev); + + free(intel); + scrn->driverPrivate = NULL; +@@ -1082,12 +1079,13 @@ + static void I830LeaveVT(VT_FUNC_ARGS_DECL) + { + SCRN_INFO_PTR(arg); ++ intel_screen_private *intel = intel_get_screen_private(scrn); + + xf86RotateFreeShadow(scrn); + + xf86_hide_cursors(scrn); + +- if (intel_put_master(scrn)) ++ if (intel_put_master(intel->dev)) + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "drmDropMaster failed: %s\n", strerror(errno)); + } +@@ -1098,8 +1096,9 @@ + static Bool I830EnterVT(VT_FUNC_ARGS_DECL) + { + SCRN_INFO_PTR(arg); ++ intel_screen_private *intel = intel_get_screen_private(scrn); + +- if (intel_get_master(scrn)) { ++ if (intel_get_master(intel->dev)) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "drmSetMaster failed: %s\n", + strerror(errno)); +--- a/src/uxa/intel_hwmc.c ++++ b/src/uxa/intel_hwmc.c +@@ -191,6 +191,7 @@ + { + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); + intel_screen_private *intel = intel_get_screen_private(scrn); ++ struct pci_device *pci; + static XF86MCAdaptorRec *pAdapt; + char *name; + char buf[64]; +@@ -207,6 +208,10 @@ + return FALSE; + } + ++ pci = xf86GetPciInfoForEntity(intel->pEnt->index); ++ if (pci == NULL) ++ return FALSE; ++ + pAdapt = calloc(1, sizeof(XF86MCAdaptorRec)); + if (!pAdapt) { + ErrorF("Allocation error.\n"); +@@ -249,8 +254,7 @@ + } + + sprintf(buf, "pci:%04x:%02x:%02x.%d", +- intel->PciInfo->domain, +- intel->PciInfo->bus, intel->PciInfo->dev, intel->PciInfo->func); ++ pci->domain, pci->bus, pci->dev, pci->func); + + xf86XvMCRegisterDRInfo(pScreen, INTEL_XVMC_LIBNAME, + buf, +--- a/src/uxa/intel_memory.c ++++ b/src/uxa/intel_memory.c +@@ -168,7 +168,7 @@ + void intel_set_gem_max_sizes(ScrnInfoPtr scrn) + { + intel_screen_private *intel = intel_get_screen_private(scrn); +- size_t agp_size = agp_aperture_size(intel->PciInfo, ++ size_t agp_size = agp_aperture_size(xf86GetPciInfoForEntity(intel->pEnt->index), + INTEL_INFO(intel)->gen); + + /* The chances of being able to mmap an object larger than diff -Nru xserver-xorg-video-intel-2.99.910/debian/patches/series xserver-xorg-video-intel-2.99.914/debian/patches/series --- xserver-xorg-video-intel-2.99.910/debian/patches/series 2014-11-03 20:42:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/debian/patches/series 2014-11-03 20:42:16.000000000 +0000 @@ -1,3 +1,7 @@ +dri3-flush-broken.patch + # XMir series xmir.patch +sna-freescreen.diff +fix-uxa-fglrx-stealing.diff diff -Nru xserver-xorg-video-intel-2.99.910/debian/patches/sna-freescreen.diff xserver-xorg-video-intel-2.99.914/debian/patches/sna-freescreen.diff --- xserver-xorg-video-intel-2.99.910/debian/patches/sna-freescreen.diff 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/debian/patches/sna-freescreen.diff 2014-11-03 20:42:16.000000000 +0000 @@ -0,0 +1,19 @@ +commit f5469681b620d9d6ccaf53e92ed31f931cb03b0d +Author: Chris Wilson +Date: Mon Aug 18 14:37:44 2014 +0100 + + sna: Be defensive during FreeScreen() + + Signed-off-by: Chris Wilson + +--- a/src/sna/sna_driver.c ++++ b/src/sna/sna_driver.c +@@ -1190,7 +1190,7 @@ + struct sna *sna = to_sna(scrn); + + DBG(("%s\n", __FUNCTION__)); +- if ((uintptr_t)sna & 1) ++ if (sna == NULL || (uintptr_t)sna & 3) /* beware thieves */ + return; + + scrn->driverPrivate = (void *)((uintptr_t)sna->info | (sna->flags & SNA_IS_SLAVED) | 2); diff -Nru xserver-xorg-video-intel-2.99.910/debian/patches/xmir.patch xserver-xorg-video-intel-2.99.914/debian/patches/xmir.patch --- xserver-xorg-video-intel-2.99.910/debian/patches/xmir.patch 2014-11-03 20:42:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/debian/patches/xmir.patch 2014-11-03 20:42:16.000000000 +0000 @@ -1,21 +1,21 @@ -commit 67c072065118115112d06e77c43b6ac225dbcf56 +commit 80db93ed6b05fade9e0c7a581cc2b503f66d2416 Author: Chris Wilson Date: Wed Jul 24 01:44:30 2013 +0100 - sna: Preliminary patch for XMir - - For the intrepid explorer, who is desperate to encounter all the bugs we - fixed long ago. /o\ + sna: Add XMir support With lots of updates by Christopher James Halse Rogers as he updated the - XMir API. + XMir API - but now supposedly frozen! + + " ickle: I think the xmir api should be pretty much stable now, + barring people coming up with more awesome ways of doing things." Signed-off-by: Christopher James Halse Rogers Signed-off-by: Chris Wilson --- a/src/Makefile.am +++ b/src/Makefile.am -@@ -59,6 +59,7 @@ intel_drv_la_SOURCES = \ +@@ -67,6 +67,7 @@ intel_driver.h \ intel_options.c \ intel_module.c \ @@ -25,39 +25,28 @@ --- a/src/intel_device.c +++ b/src/intel_device.c -@@ -175,10 +175,34 @@ static int fd_set_nonblock(int fd) - return fd; +@@ -162,10 +162,23 @@ + return ret; } -+static int __intel_open_xmir(const struct pci_device *pci, -+ char **path) ++static int __intel_open_xmir(const struct pci_device *pci) +{ + char id[20]; -+ int fd; + + snprintf(id, sizeof(id), + "pci:%04x:%02x:%02x.%d", + pci->domain, pci->bus, pci->dev, pci->func); -+ fd = xmir_get_drm_fd(id); -+ if (fd == -1) -+ return -1; -+ -+ if (*path == NULL) /* XXX Fix Xmir - it knows both the fd and path */ -+ *path = drmGetDeviceNameFromFd(fd); -+ if (*path == NULL) -+ fd = -1; -+ -+ return fd; ++ return xmir_get_drm_fd(id); +} + - static int __intel_open_device(const struct pci_device *pci, char **path) + static int __intel_open_device(const struct pci_device *pci, const char *path) { int fd; + if (xorgMir) -+ return __intel_open_xmir(pci, path); ++ return __intel_open_xmir(pci); + - if (*path == NULL) { + if (path == NULL) { char id[20]; int ret; --- a/src/intel_driver.h @@ -71,9 +60,9 @@ struct xf86_platform_device; #define INTEL_VERSION 4000 -@@ -134,6 +136,6 @@ void intel_put_device(ScrnInfoPtr scrn); - - void __intel_uxa_release_device(ScrnInfoPtr scrn); +@@ -134,6 +136,6 @@ + int intel_put_master(ScrnInfoPtr scrn); + void intel_put_device(ScrnInfoPtr scrn); -#define hosted() (0) +#define hosted() (xorgMir) @@ -99,7 +88,7 @@ +#endif /* INTEL_XMIR_H */ --- a/src/sna/Makefile.am +++ b/src/sna/Makefile.am -@@ -81,6 +81,7 @@ libsna_la_SOURCES = \ +@@ -80,6 +80,7 @@ sna_video_overlay.c \ sna_video_sprite.c \ sna_video_textured.c \ @@ -109,7 +98,7 @@ gen3_render.c \ --- a/src/sna/sna.h +++ b/src/sna/sna.h -@@ -289,6 +289,7 @@ struct sna { +@@ -365,6 +365,7 @@ EntityInfoPtr pEnt; const struct intel_device_info *info; @@ -117,9 +106,9 @@ ScreenBlockHandlerProcPtr BlockHandler; ScreenWakeupHandlerProcPtr WakeupHandler; -@@ -987,4 +988,18 @@ static inline void sigtrap_put(void) - sigtrap_assert(); - } +@@ -1215,4 +1216,18 @@ + #define RR_Rotate_All (RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270) + #define RR_Reflect_All (RR_Reflect_X | RR_Reflect_Y) +/* sna_xmir.c */ + @@ -136,260 +125,10 @@ +#endif + #endif /* _SNA_H */ ---- a/src/sna/sna_dri.c -+++ b/src/sna/sna_dri.c -@@ -596,7 +596,6 @@ static void sna_dri_select_mode(struct s - if (busy.busy & (1 << 17)) - mode = KGEM_BLT; - kgem_bo_mark_busy(busy.handle == src->handle ? src : dst, mode); -- _kgem_set_mode(&sna->kgem, mode); - } - - static void -@@ -1107,10 +1106,10 @@ sna_dri_page_flip(struct sna *sna, struc - } - - static bool --can_flip(struct sna * sna, -- DrawablePtr draw, -- DRI2BufferPtr front, -- DRI2BufferPtr back) -+can_exchange(struct sna * sna, -+ DrawablePtr draw, -+ DRI2BufferPtr front, -+ DRI2BufferPtr back) - { - WindowPtr win = (WindowPtr)draw; - PixmapPtr pixmap; -@@ -1120,15 +1119,12 @@ can_flip(struct sna * sna, - if (draw->type == DRAWABLE_PIXMAP) - return false; - -- if (!sna->scrn->vtSema) { -- DBG(("%s: no, not attached to VT\n", __FUNCTION__)); -+ if ((sna->flags & SNA_IS_HOSTED) == 0) { -+ DBG(("%s: no, not hosted\n", __FUNCTION__)); - return false; - } - -- if (sna->flags & SNA_NO_FLIP) { -- DBG(("%s: no, pageflips disabled\n", __FUNCTION__)); -- return false; -- } -+ assert(!sna->mode.shadow_active); - - if (front->format != back->format) { - DBG(("%s: no, format mismatch, front = %d, back = %d\n", -@@ -1144,11 +1140,6 @@ can_flip(struct sna * sna, - return false; - } - -- if (sna->mode.shadow_active) { -- DBG(("%s: no, shadow enabled\n", __FUNCTION__)); -- return false; -- } -- - pixmap = get_window_pixmap(win); - if (pixmap != sna->front) { - DBG(("%s: no, window (pixmap=%ld) is not attached to the front buffer (pixmap=%ld)\n", -@@ -1226,21 +1217,6 @@ can_flip(struct sna * sna, - return true; - } - --inline static uint32_t pipe_select(int pipe) --{ -- /* The third pipe was introduced with IvyBridge long after -- * multiple pipe support was added to the kernel, hence -- * we can safely ignore the capability check - if we have more -- * than two pipes, we can assume that they are fully supported. -- */ -- if (pipe > 1) -- return pipe << DRM_VBLANK_HIGH_CRTC_SHIFT; -- else if (pipe > 0) -- return DRM_VBLANK_SECONDARY; -- else -- return 0; --} -- - static void - sna_dri_exchange_buffers(DrawablePtr draw, - DRI2BufferPtr front, -@@ -1284,6 +1260,160 @@ sna_dri_exchange_buffers(DrawablePtr dra - back->name = tmp; - } - -+static bool -+sna_dri_exchange_flip(ClientPtr client, DrawablePtr draw, -+ DRI2BufferPtr front, DRI2BufferPtr back, -+ CARD64 *target_msc, CARD64 divisor, CARD64 remainder, -+ DRI2SwapEventPtr func, void *data) -+{ -+ DBG(("%s: target_msc=%u, divisor=%u\n", __FUNCTION__, -+ (uint32_t)*target_msc, (uint32_t)divisor)); -+ -+ /* XXX delay */ -+ -+ sna_dri_exchange_buffers(draw, front, back); -+ -+ /* XXX ratelimit */ -+ -+ DRI2SwapComplete(client, draw, 0, 0, 0, DRI2_EXCHANGE_COMPLETE, func, data); -+ *target_msc = 0; -+ -+ return true; -+} -+ -+static bool -+can_flip(struct sna * sna, -+ DrawablePtr draw, -+ DRI2BufferPtr front, -+ DRI2BufferPtr back) -+{ -+ WindowPtr win = (WindowPtr)draw; -+ PixmapPtr pixmap; -+ -+ if (draw->type == DRAWABLE_PIXMAP) -+ return false; -+ -+ if (!sna->scrn->vtSema) { -+ DBG(("%s: no, not attached to VT\n", __FUNCTION__)); -+ return false; -+ } -+ -+ if (sna->flags & SNA_NO_FLIP) { -+ DBG(("%s: no, pageflips disabled\n", __FUNCTION__)); -+ return false; -+ } -+ -+ if (front->format != back->format) { -+ DBG(("%s: no, format mismatch, front = %d, back = %d\n", -+ __FUNCTION__, front->format, back->format)); -+ return false; -+ } -+ -+ if (front->attachment != DRI2BufferFrontLeft) { -+ DBG(("%s: no, front attachment [%d] is not FrontLeft [%d]\n", -+ __FUNCTION__, -+ front->attachment, -+ DRI2BufferFrontLeft)); -+ return false; -+ } -+ -+ if (sna->mode.shadow_active) { -+ DBG(("%s: no, shadow enabled\n", __FUNCTION__)); -+ return false; -+ } -+ -+ pixmap = get_window_pixmap(win); -+ if (pixmap != sna->front) { -+ DBG(("%s: no, window is not attached to the front buffer\n", -+ __FUNCTION__)); -+ return false; -+ } -+ -+ if (sna_pixmap_get_buffer(pixmap) != front) { -+ DBG(("%s: no, DRI2 drawable is no longer attached (old name=%d, new name=%d) to pixmap=%ld\n", -+ __FUNCTION__, front->name, -+ sna_pixmap_get_buffer(pixmap) ? ((DRI2BufferPtr)sna_pixmap_get_buffer(pixmap))->name : 0, -+ pixmap->drawable.serialNumber)); -+ return false; -+ } -+ -+ assert(get_private(front)->pixmap == sna->front); -+ assert(sna_pixmap(sna->front)->gpu_bo == get_private(front)->bo); -+ -+ if (!get_private(back)->scanout) { -+ DBG(("%s: no, DRI2 drawable was too small at time of creation)\n", -+ __FUNCTION__)); -+ return false; -+ } -+ -+ if (get_private(back)->size != get_private(front)->size) { -+ DBG(("%s: no, DRI2 drawable does not fit into scanout\n", -+ __FUNCTION__)); -+ return false; -+ } -+ -+ DBG(("%s: window size: %dx%d, clip=(%d, %d), (%d, %d) x %d\n", -+ __FUNCTION__, -+ win->drawable.width, win->drawable.height, -+ win->clipList.extents.x1, win->clipList.extents.y1, -+ win->clipList.extents.x2, win->clipList.extents.y2, -+ RegionNumRects(&win->clipList))); -+ if (!RegionEqual(&win->clipList, &draw->pScreen->root->winSize)) { -+ DBG(("%s: no, window is clipped: clip region=(%d, %d), (%d, %d), root size=(%d, %d), (%d, %d)\n", -+ __FUNCTION__, -+ win->clipList.extents.x1, -+ win->clipList.extents.y1, -+ win->clipList.extents.x2, -+ win->clipList.extents.y2, -+ draw->pScreen->root->winSize.extents.x1, -+ draw->pScreen->root->winSize.extents.y1, -+ draw->pScreen->root->winSize.extents.x2, -+ draw->pScreen->root->winSize.extents.y2)); -+ return false; -+ } -+ -+ if (draw->x != 0 || draw->y != 0 || -+#ifdef COMPOSITE -+ draw->x != pixmap->screen_x || -+ draw->y != pixmap->screen_y || -+#endif -+ draw->width != pixmap->drawable.width || -+ draw->height != pixmap->drawable.height) { -+ DBG(("%s: no, window is not full size (%dx%d)!=(%dx%d)\n", -+ __FUNCTION__, -+ draw->width, draw->height, -+ pixmap->drawable.width, -+ pixmap->drawable.height)); -+ return false; -+ } -+ -+ /* prevent an implicit tiling mode change */ -+ if (get_private(front)->bo->tiling != get_private(back)->bo->tiling) { -+ DBG(("%s -- no, tiling mismatch: front %d, back=%d\n", -+ __FUNCTION__, -+ get_private(front)->bo->tiling, -+ get_private(back)->bo->tiling)); -+ return false; -+ } -+ -+ return true; -+} -+ -+inline static uint32_t pipe_select(int pipe) -+{ -+ /* The third pipe was introduced with IvyBridge long after -+ * multiple pipe support was added to the kernel, hence -+ * we can safely ignore the capability check - if we have more -+ * than two pipes, we can assume that they are fully supported. -+ */ -+ if (pipe > 1) -+ return pipe << DRM_VBLANK_HIGH_CRTC_SHIFT; -+ else if (pipe > 0) -+ return DRM_VBLANK_SECONDARY; -+ else -+ return 0; -+} -+ - static void chain_swap(struct sna *sna, - DrawablePtr draw, - int frame, unsigned int tv_sec, unsigned int tv_usec, -@@ -2033,6 +2163,12 @@ sna_dri_schedule_swap(ClientPtr client, - - assert(sna_pixmap_from_drawable(draw)->flush); - -+ if (can_exchange(sna, draw, front, back) && -+ sna_dri_exchange_flip(client, draw, front, back, -+ target_msc, divisor, remainder, -+ func, data)) -+ return TRUE; -+ - /* Drawable not displayed... just complete the swap */ - pipe = -1; - if ((sna->flags & SNA_NO_WAIT) == 0) -@@ -2325,6 +2461,13 @@ out_complete: - void sna_dri_destroy_window(WindowPtr win) { } +--- a/src/sna/sna_dri2.c ++++ b/src/sna/sna_dri2.c +@@ -2873,6 +2873,13 @@ + void sna_dri2_destroy_window(WindowPtr win) { } #endif +#if DRI2INFOREC_VERSION >= 8 && XMIR @@ -402,8 +141,8 @@ static bool has_i830_dri(void) { return access(DRI_DRIVER_PATH "/i830_dri.so", R_OK) == 0; -@@ -2474,6 +2617,13 @@ bool sna_dri_open(struct sna *sna, Scree - info.ReuseBufferNotify = NULL; +@@ -3027,6 +3034,13 @@ + info.ReuseBufferNotify = sna_dri2_reuse_buffer; #endif +#if DRI2INFOREC_VERSION >= 8 && XMIR @@ -418,7 +157,7 @@ info.scheduleSwap0 = 1; --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c -@@ -512,6 +512,9 @@ static Bool sna_pre_init(ScrnInfoPtr scr +@@ -548,6 +548,9 @@ goto cleanup; } @@ -428,9 +167,17 @@ /* Sanity check */ if (hosted() && (sna->flags & SNA_IS_HOSTED) == 0) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, -@@ -558,9 +566,13 @@ static Bool sna_pre_init(ScrnInfoPtr scr +@@ -559,6 +562,7 @@ + xf86DrvMsg(scrn->scrnIndex, X_PROBED, "CPU: %s\n", + sna_cpu_features_to_string(sna->cpu_features, buf)); + ++ /* XXX query depth from host */ + if (!xf86SetDepthBpp(scrn, 24, 0, 0, + Support32bppFb | + SupportConvert24to32 | PreferConvert24to32)) +@@ -592,6 +596,9 @@ - intel_detect_chipset(scrn, pEnt); + sna_setup_capabilities(scrn, fd); + if (!sna_xmir_pre_init(sna)) + goto cleanup; @@ -438,31 +185,27 @@ kgem_init(&sna->kgem, fd, xf86GetPciInfoForEntity(pEnt->index), sna->info->gen); -+ - if (xf86ReturnOptValBool(sna->Options, OPTION_ACCEL_DISABLE, FALSE) || - !sna_option_cast_to_bool(sna, OPTION_ACCEL_METHOD, TRUE)) { - xf86DrvMsg(sna->scrn->scrnIndex, X_CONFIG, -@@ -659,6 +671,8 @@ sna_block_handler(BLOCKHANDLER_ARGS_DECL +@@ -710,6 +717,8 @@ - if (*tv == NULL || ((*tv)->tv_usec | (*tv)->tv_sec)) + if (*tv == NULL || ((*tv)->tv_usec | (*tv)->tv_sec) || has_shadow(sna)) sna_accel_block_handler(sna, tv); + + sna_xmir_post_damage(sna); } static void -@@ -1015,6 +1029,8 @@ sna_screen_init(SCREEN_INIT_ARGS_DECL) +@@ -1090,6 +1099,8 @@ if (!miDCInitialize(screen, xf86GetPointerScreenFuncs())) return FALSE; + sna_xmir_init(sna, screen); /* after DirectCursor is initialised */ + - if ((sna->flags & SNA_IS_HOSTED) == 0 && - xf86_cursors_init(screen, SNA_CURSOR_X, SNA_CURSOR_Y, - HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | + if (sna_cursors_init(screen, sna)) + xf86DrvMsg(scrn->scrnIndex, X_INFO, "HW Cursor enabled\n"); + --- /dev/null +++ b/src/sna/sna_xmir.c -@@ -0,0 +1,186 @@ +@@ -0,0 +1,183 @@ +/*************************************************************************** + + Copyright 2013 Intel Corporation. All Rights Reserved. @@ -549,7 +292,6 @@ + if (n == 0) + return; + -+ /* XXX size is bogus, but only used for sanity checks */ + dst = kgem_create_for_prime(&sna->kgem, + xmir_window_get_fd(xmir_win), + pitch * (dst_box->y2 - dst_box->y1)); @@ -557,7 +299,6 @@ + return; + + dst->pitch = pitch; -+ dst->scanout = true; /* presume the worst (almost always true) */ + + if (get_window_deltas(pixmap, &sx, &sy)) + RegionTranslate(region, sx, sy); @@ -601,7 +342,6 @@ + if (n == 0) + xmir_submit_rendering_for_window(xmir_win, region); + -+ dst->scanout = false; /* but don't confuse our caching! */ + kgem_bo_destroy(&sna->kgem, dst); +} + diff -Nru xserver-xorg-video-intel-2.99.910/debian/upstream.changelog xserver-xorg-video-intel-2.99.914/debian/upstream.changelog --- xserver-xorg-video-intel-2.99.910/debian/upstream.changelog 2014-11-03 20:42:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/debian/upstream.changelog 2014-11-03 20:42:16.000000000 +0000 @@ -1,3 +1,9602 @@ +commit 8d95e90b7b4bf5d6bae5443f92d77d30f4443f24 +Author: Chris Wilson +Date: Wed Jul 23 15:45:31 2014 +0100 + + 2.99.914 snapshot + +commit 57f0e65d5186412835f282af59141626e4a87a00 +Author: Chris Wilson +Date: Wed Jul 23 16:42:46 2014 +0100 + + sna/dri2: Compile fix for old xorg/dri2 + + We have to do conditional compilation as we touch structure members that + may not exist in older Xserver headers. + + Signed-off-by: Chris Wilson + +commit 4ed0937640b54246440421114b697f75d1b8c835 +Author: Chris Wilson +Date: Wed Jul 23 15:41:29 2014 +0100 + + Add automake magic required for libobj/ + + So libobj/ wasn't included in the tarball, and nor was the compatability + functions being added to the driver when they were needed. The oddity is + that using the ./configure script (and thus make distcheck) succeeds. It + was only when 'autoreconf -fi' was run was the first error encoutered. + + Signed-off-by: Chris Wilson + Reported-by: Tobias Klausmann + +commit dcf9ce4a9f16c01f58797e4f899d51e23506aa6c +Author: Chris Wilson +Date: Wed Jul 23 14:19:44 2014 +0000 + + Fix compile failure on old Xorg with XF86_ALLOCATE_GPU_SCREEN + + Sigh, a late fix was not compile checked against xorg-1.7. + + Signed-off-by: Chris Wilson + +commit 1c5e20716f192f0c38b4edd879d28e11126f7f01 +Author: Chris Wilson +Date: Sat Jul 5 08:47:16 2014 +0100 + + 2.99.913 snapshot + +commit d242965979cf251383a6230dbd65cdc1d9e231ea +Author: Chris Wilson +Date: Wed Jul 23 14:25:25 2014 +0100 + + sna: Skip performing an async flip after fixup + + After the first async failure and we fix up the CRTC, ordinary we queue + a no-op flip in order to queue the event. For async flips, we do not + want that event so just skip the flip. + + Signed-off-by: Chris Wilson + +commit 4153d4b43004cd90c0d9a7a7db399dac4d30721e +Author: Chris Wilson +Date: Wed Jul 23 13:54:19 2014 +0100 + + sna/dri2: Tidy freeing the queued frame events + + Signed-off-by: Chris Wilson + +commit f2b2b6eda009924e5ec6974bb31be9d3749c9cf8 +Author: Chris Wilson +Date: Wed Jul 23 13:45:27 2014 +0100 + + test/dri2: Use the right device node + + Use the device node as instructed by Xorg. + + Signed-off-by: Chris Wilson + +commit 65c2376730e86d7502d8c47d49386be5f51e47ba +Author: Chris Wilson +Date: Wed Jul 23 12:12:03 2014 +0100 + + sna: Add a DBG message for slave damage propagation + + Signed-off-by: Chris Wilson + +commit 95c059b330e705ecd0e575e98d8edf5707e84a05 +Author: Chris Wilson +Date: Wed Jul 23 11:01:07 2014 +0100 + + sna: Reorder disabling scanout pixmap when updating slave + + The assertion caught that we would unregister an invalid drawable on + older Xorg. + + Signed-off-by: Chris Wilson + +commit d6830190bc9956f485db6c3420f7a4a79793a693 +Author: Chris Wilson +Date: Wed Jul 23 10:53:40 2014 +0100 + + sna: Disable all outputs when initializing as a slaved output provider + + When we are constructed as a slaved device, we need to disable all + outputs or else they are not correctly hooked into the master device + upon startup. + + Signed-off-by: Chris Wilson + +commit 70868c7aa881b15b7478f7ee4543fde0268a4ba6 +Author: Chris Wilson +Date: Wed Jul 23 08:37:46 2014 +0100 + + sna/dri2: Recreate buffer in reuse rather than force recreate + + By marking the buffer->attachment as invalid we forced the recreation of + the buffer on the next DRI2GetBuffers. The only small problem with that + was that the client didn't always immediately call DRI2GetBuffers after + the invalidation - and if they did a DRI2CopyRegion with its stale + buffers the unfound attachment would generate a BadValue and kill the + client. So instead of messing around with the attachment, explicitly + recreate the buffer if we attempt to reuse a buffer of the wrong size. + + Signed-off-by: Chris Wilson + +commit aa5351dbbe0a50080efee35a3d494b3a20b7c9f6 +Author: Chris Wilson +Date: Tue Jul 22 09:40:14 2014 +0100 + + sna: Ensure errno is set after failure before reporting a modeset failure + + A few paths we report a sanity check failure which do not set errno, but + we then print out the errno as part of our message to the user. Set it + to a sane value in those cases. + + Signed-off-by: Chris Wilson + +commit feba651db8dd61356fb6296b55d46168bd4d7011 +Author: Chris Wilson +Date: Tue Jul 22 09:15:01 2014 +0100 + + sna: Remove %# from DBG messages + + LogF doesn't support the 0x-prefix instruction. + + Signed-off-by: Chris Wilson + +commit 13e20c7f61d8b21b33c02d8b737cf9c06bf50f17 +Author: Chris Wilson +Date: Tue Jul 22 08:52:10 2014 +0100 + + sna: Assert that we do not overwrite an earlier COW entry + + Signed-off-by: Chris Wilson + +commit d8b0a8fa033848543e0b39566b531fdfdd078087 +Author: Chris Wilson +Date: Tue Jul 22 08:48:58 2014 +0100 + + sna/dri3: Don't forget to add SHM pixmaps to the list of exported DRI3 bo + + Signed-off-by: Chris Wilson + +commit bfccacf745d054756661be3edd8898ac6aceb878 +Author: Chris Wilson +Date: Sun Jul 20 07:29:21 2014 +0100 + + sna/video: Bump the maximum size for sprites + + A sprite plane is limited by the display engine who's maximum resolution + has increased since the 2kx2k limitations of 8xx, so let's set it + correctly to the reported maximum CRTC size (since we have no individual + query for maximum sprite plane sizes). + + Signed-off-by: Chris Wilson + +commit 9bb2818a7db1c9dc89379996415511b6cff4bb33 +Author: Chris Wilson +Date: Sun Jul 20 07:27:58 2014 +0100 + + dri3-test: Print line number for shm failures + + Signed-off-by: Chris Wilson + +commit 4ae346e7647fd2c01324f1a6d3b37674e858486d +Author: Chris Wilson +Date: Fri Jul 18 07:31:25 2014 +0100 + + configure: Double check xinerama's headers + + Having the pkgconfig present doesn't always necessarily imply the + headers are installed correctly - just fail over gracefully for xinerama + and intel-virtual-output + + Signed-off-by: Chris Wilson + +commit fac6845820e49dbbea2a625b7bb745d8f9159b56 +Author: Chris Wilson +Date: Fri Jul 18 07:14:19 2014 +0100 + + sna/dri2: Protect compsiteext.h include with build check + + We shouldn't include calls to the composite extension if it has not been + built. + + Reported-by: Ben Widawsky + Signed-off-by: Chris Wilson + +commit 923e098f5f830c30b93d6f85d4f812201bdcb206 +Author: Chris Wilson +Date: Thu Jul 17 17:10:39 2014 +0100 + + sna: Fix compilation with older Xorg + + sna_display.c: In function 'sna_crtc_disable_shadow': + sna_display.c:1375:39: error: dereferencing pointer to incomplete type + DamageUnregister(&crtc->slave_damage->drawable, crtc->slave_damage); + + Signed-off-by: Chris Wilson + +commit 7026ffe56005bbc36dc37cafc7ebb2a7f09fefdd +Author: Chris Wilson +Date: Thu Jul 17 17:04:02 2014 +0100 + + sna: Support TearFree on slaved outputs + + By always forcing the shadow intermediatory, we can enable TearFree even + ona slave scanout. + + Signed-off-by: Chris Wilson + +commit 3140d72826b5227f7f7ac9a428faa4bcfd4b377b +Author: Chris Wilson +Date: Thu Jul 17 16:14:16 2014 +0100 + + backlight: Prevent dereference of potential NULL argv + + Adam Sampson spotted that + + "It's possible (but not very sensible) to exec a program with an empty + argument list, so argv[0] is not necessarily a valid pointer. For + example: + + $ cat exec0.c + + int main(int argc, char *argv[]) { + char *empty[1] = { NULL }; + execvp(argv[1], empty); + perror("execvp"); + return 1; + } + $ ./exec0 /usr/libexec/xf86-video-intel-backlight-helper + Usage: (null) + " + + He sensibly suggested that we hardcode the program name to avoid the + NULL dereference. Being the paranoid type, we should also be careful not + to write to any file descriptors outside of our control (i.e. stderr), + so disable the messages unless we are debugging. + + Reported-by: Adam Sampson + Signed-off-by: Chris Wilson + +commit bcd09ff6eb76bc4df046ece4da29b1455fed8dff +Author: Chris Wilson +Date: Thu Jul 17 15:23:46 2014 +0100 + + sna: Assert that we never attempt to flip the slave scanout + + Signed-off-by: Chris Wilson + +commit 129656e4a82d4bf799e5c1d75d0dcb4480f6eb09 +Author: Chris Wilson +Date: Thu Jul 17 15:01:06 2014 +0100 + + sna/dri2: Disable SwapLimit buffers with buggy prime implementations + + If there is a GPU screen, we have to assume that the DRI2 code may pass + around the wrong pointers to ReuseBufferNotify until the fix is + released: + + commit 4d92fab39c4225e89f2d157a1f559cb0618a6eaa + Author: Chris Wilson + Date: Wed Jun 18 11:14:43 2014 +0100 + + dri2: Use the PrimeScreen when creating/reusing buffers + + Signed-off-by: Chris Wilson + +commit a45b2ea11c15f35c36330ff27cb45854a29c2e2c +Author: Chris Wilson +Date: Thu Jul 17 14:40:51 2014 +0100 + + sna: Handle rotated slaved scanouts + + As per the usual handling of rotated scanouts with unsupported + rotations, we stage the drawing onto a backbuffer then rotate onto the + crtc later. The difference here is that we must read the contents from + the master pixmap rather than our own screen pixmap. + + Spotted was looking at slaved scanouts mistakenly setting the CRTC + transformed flag. + + Reported-by: Tomas Pruzina + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81383 + Signed-off-by: Chris Wilson + +commit 339c9dd0d5206180995731ab22304776e544f2f7 +Author: Chris Wilson +Date: Thu Jul 17 12:54:47 2014 +0100 + + sna: Add missing DBG parameters + + Signed-off-by: Chris Wilson + +commit 62f62f70eda97a3ef18c5144031fdf1cb2b7dad0 +Author: Chris Wilson +Date: Thu Jul 17 10:06:06 2014 +0100 + + sna: Avoid confusing failure to flip and flipping zero CRTC + + During the present unflip path we blindly try to restore the original + mode after a flip failure. However, it confuses flipping zero CRTC with + a genuine failure. This has the result of undoing a DPMS change (e.g. + xset dpms force dpms) under a DRI3 compositor. + + Reported-by: Jiri Slaby + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81456 + Signed-off-by: Chris Wilson + +commit 95f08c171ebd9b594112ab006c4460702a22bec1 +Author: Chris Wilson +Date: Thu Jul 17 09:20:35 2014 +0100 + + sna: Busy-wait for the kernel to catch up when flipping + + If the kernel reports that it is busy, it has not yet finished + processing a pending flip and we have multiple CRTC queued, just wait + for the kernel to clear its backlog before submitting the next flip. On + the other hand, if we can just overwrite the pending flip results. + However, the EBUSY may actually be a genuine report by the kernel of an + error, so check for an invalid CRTC first. + + Signed-off-by: Chris Wilson + +commit 0a9d3dd8c83749992e643675f16486092f2b00fa +Author: Chris Wilson +Date: Thu Jul 17 08:53:13 2014 +0100 + + sna: Silence valgrind when reading plane properties + + Signed-off-by: Chris Wilson + +commit 0a57b55f0fcfa93b38015535002cb11eeaf1dd3a +Author: Chris Wilson +Date: Thu Jul 17 08:32:14 2014 +0100 + + sna: Remove extraneous function wrapping + + Since we only have the single callsite for do_page_flip, the wrapper is + not adding any meaningful information. + + Signed-off-by: Chris Wilson + +commit f33d44f41ef0f287375b7a6b1c117abff5a23b19 +Author: Chris Wilson +Date: Wed Jul 16 12:53:02 2014 +0100 + + sna: And remove new bogus assertion + + We assert that damage is valid as we delete the Pixmap, and so we cannot + assert that the Pixmap is still valid itself. + + Reported-by: Jiri Slaby + Signed-off-by: Chris Wilson + +commit dd9df24eb5234c96e499063904ab7bd85a332fd8 +Author: Chris Wilson +Date: Wed Jul 16 08:05:34 2014 +0100 + + sna: Make the damage check more verbose + + Print out the pixmap number and the damage extents for when the + assertion fails. + + Signed-off-by: Chris Wilson + +commit 34ada63118680bf8ad2ef737fd4a8edfd8246e37 +Author: Chris Wilson +Date: Wed Jul 16 07:19:03 2014 +0100 + + sna/gen2+: Remove assertion on draw->type for fills + + I overlooked the tiling-fill path passing down a temporary DrawableRec + into the fill_boxes callback - invalidating the assertion. + + Fixes regression from + commit 43176b9bfafe389c4b9ed676f4e50e3b06f858c4 + Author: Chris Wilson + Date: Mon Jun 30 21:01:11 2014 +0100 + + sna/dri2: Pass around the correct DrawableRec for sampling from the foriegn bo + + Reported-by: Jiri Slaby + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c62 + Signed-off-by: Chris Wilson + +commit 4422b1854209a2cdf023c1fbc60834fde2fbc0c7 +Author: Chris Wilson +Date: Fri Jul 11 22:23:55 2014 +0100 + + sna: Use a stricter test for determining CRTC off before updating the cursor + + Signed-off-by: Chris Wilson + +commit e0523ade28fa0da00d0bd70d8b22d53ed4e49f73 +Author: Chris Wilson +Date: Wed Jul 9 12:10:15 2014 +0100 + + sna: Reduce reflections onto rotations + + In order to support a wider range of rotation/reflections, perform a + simple reduction of the requested rotation first. + + Signed-off-by: Chris Wilson + +commit 251bcc32eed37ee10eb14ce2278ecbdcc40a7cde +Author: Chris Wilson +Date: Thu Jul 10 21:01:57 2014 +0100 + + configure: Provide a poor man's replacement for getline() + + uClibc is one such library that doesn't implement getline() + + Reported-by: Ben Widawsky + Signed-off-by: Chris Wilson + +commit 8587b2fff218537c6ff568ac3ef561f0d39f03ff +Author: Chris Wilson +Date: Tue Jul 8 11:53:13 2014 +0100 + + sna: Rewrite rotation setup on top of universal drm planes + + The kernel interface has changed slightly since the early proposals. Now + the rotation property is only on the plane and so we have to lookup the + primary prime as well. + + Signed-off-by: Chris Wilson + +commit f24a9d335273fec20679397abcc3d5405d9613df +Author: Chris Wilson +Date: Sat Jul 5 14:40:38 2014 +0100 + + sna: Fix a couple of DBG messages + + Signed-off-by: Chris Wilson + +commit 790e7492bdb5c0c77c53ae769f0d408b04d5c99b +Author: Chris Wilson +Date: Sat Jul 5 09:46:00 2014 +0100 + + test/lowlevel-blt-bench: Add common PDF operators + + Applications are starting to use PDF operators, so far I have spotted + multiply, dodge and lighten. + + Signed-off-by: Chris Wilson + +commit 8fa22964f69d3ec8700f177dd7cb3cbc396a9f35 +Author: Matthieu Herrb +Date: Fri Jul 4 18:26:09 2014 +0200 + + backlight: Fix security issues in handling of the interface path name. + + - don't allow '/' in the interface name to avoid escaping the /sys + hierarchy + - check snprintf() return value for overflow. + + Problems reported by Adam Sampson. Thanks. + + Signed-off-by: Matthieu Herrb + Reviewed-by: Reviewed-by: Hans de Goede + +commit 6a64a3ae55ad5f743d2b7a4852b6ca7b54d2a142 +Author: Chris Wilson +Date: Fri Jul 4 13:04:02 2014 +0100 + + sna: Discard operations to either CPU or GPU bo when overwriting with RenderRectangles + + Signed-off-by: Chris Wilson + +commit 2c8ab77fcd71b7f96ad7bc379e5c68b3b45a5069 +Author: Chris Wilson +Date: Fri Jul 4 12:43:55 2014 +0100 + + sna: Tweak number of threads for short areas + + Signed-off-by: Chris Wilson + +commit d3ccb3f3b2a3cb4c8b51d58d185dd10b85e025eb +Author: Chris Wilson +Date: Fri Jul 4 12:39:01 2014 +0100 + + sna: Convert a clear tile into a solid fill + + Signed-off-by: Chris Wilson + +commit 2e0763088f8e159b414cec5c056cc4c91a34766e +Author: Chris Wilson +Date: Fri Jul 4 12:26:43 2014 +0100 + + sna: Fix typo s/num_threads/max_threads/ + + Signed-off-by: Chris Wilson + +commit 04ddea075e9e07cf3158594130d5ba7d1f50f7f1 +Author: Chris Wilson +Date: Fri Jul 4 12:14:11 2014 +0100 + + sna: Do a quirk early check for short areas before threading + + Signed-off-by: Chris Wilson + +commit 228a22fe8db044a18556a9fdb989323274817771 +Author: Chris Wilson +Date: Fri Jul 4 12:10:10 2014 +0100 + + sna: Disable use of threaded compositor when using threaded renderer + + Reported-by: Zdenek Kabelac + Signed-off-by: Chris Wilson + +commit 64bcb91f58fba3956f2c66fa37707b9e496da936 +Author: Chris Wilson +Date: Fri Jul 4 11:02:39 2014 +0100 + + sna: Utilise existing cached upload for promoting to GPU bo + + If we already have a buffer that represents the data on the GPU, we can + simply use that when we need to promote the pixmap onto the GPU. + + Signed-off-by: Chris Wilson + +commit 821ef20b27f84cc26aec266b0f616a7f39ba9e3d +Author: Chris Wilson +Date: Fri Jul 4 10:43:35 2014 +0100 + + sna: Promote tile pixmaps to GPU when reused + + Signed-off-by: Chris Wilson + +commit c6407f7380829f822a462100d26bc531aed0fd6f +Author: Chris Wilson +Date: Fri Jul 4 10:14:54 2014 +0100 + + sna/gen8: Disable the unaligned check + + Note sure if this is strictly required -- but at the moment it fails for + 1x1R solids, causing us to skip glyphs. The simulator doesn't complain, + so just skip the check for now. + + Reported-by: Ben Widawsky + Signed-off-by: Chris Wilson + +commit e64d14d7bc72fe7b150e5427feeb1a163ec600a7 +Author: Chris Wilson +Date: Fri Jul 4 09:55:04 2014 +0100 + + sna: Tighten assertions for using upload proxies concurrently with CPU reads + + After relaxing some of the rules on when to discard the upload proxies, + we also need to relax some of the complementary asserts. + + Reported-by: Zdenek Kabelac + Signed-off-by: Chris Wilson + +commit 4e12d5ca26bdfafd7b9cd02c36e6d991f068f29b +Author: Chris Wilson +Date: Fri Jul 4 09:48:53 2014 +0100 + + sna: Prevent creating a GPU bo for an inplace read + + Signed-off-by: Chris Wilson + +commit 18ae7722dbdf6ab61560962ed6ca8d39f353b1f9 +Author: Chris Wilson +Date: Thu Jul 3 18:18:04 2014 +0000 + + sna: Wrap xf86DPMSSet + + We need to wrap xf86DPMSSet() so that we can reintialize our bookkeeping + and auxiliary planes after disabling/re-enabling CRTC during DPMS + operations. + + Signed-off-by: Chris Wilson + +commit 57d0cc82d851b95d4e3b1821287dd3ffd1cf6e3b +Author: Chris Wilson +Date: Thu Jul 3 09:07:44 2014 +0100 + + sna: Clear the cursor reference from the CRTC if the update fails + + This should allow it to be restored correctly the next time it gets + shown. + + Signed-off-by: Chris Wilson + +commit 24c9bac7eb6e17b55044d719bab74d16fd68c450 +Author: Chris Wilson +Date: Wed Jul 2 21:17:54 2014 +0100 + + sna: Limit the size of the tiling object to be smaller than either the originals + + When we tile, we do so in order to fit an operation involving two + objects larger than the aperture. If we then choose an intermediate + tiling object that is larger than either of those two, the error will + persist and we will be forced to recuse. + + In the worst case, this will provide an upper bound to the recursion. + + Reported-by: Bruno Prémont + Signed-off-by: Chris Wilson + +commit 710bb0d37c681f2ffdeaf263b6ee7d9488670bc0 +Author: Chris Wilson +Date: Wed Jul 2 09:16:07 2014 +0000 + + test: Create separate SHM segments for ref/out + + Signed-off-by: Chris Wilson + +commit 87e659b887f4c738cfc91439efdac0d48fd294f0 +Author: Chris Wilson +Date: Wed Jul 2 10:47:32 2014 +0000 + + sna: Use the threaded compositor for picture conversions + + Signed-off-by: Chris Wilson + +commit 2bf36d54ebdfa2a59bf7ef71134b953628ae5d50 +Author: Chris Wilson +Date: Wed Jul 2 11:31:54 2014 +0100 + + sna/gen6+: Tweak consideration of compositing on BLT + + Signed-off-by: Chris Wilson + +commit 732cd11cf0ca813fdc06f9f09fab120ea4e3a7da +Author: Chris Wilson +Date: Tue Jul 1 17:54:49 2014 +0100 + + sna: Fix typo in LinearFramebuffer handling + + Eeek, when not using LinearFramebuffer we still want to create the GPU + bo: s/,/;/ + + Reported-by: Ilia Mirkin + Signed-off-by: Chris Wilson + +commit b5fa463b90c49ebc635d79b1561c94a4857e9cf6 +Author: Chris Wilson +Date: Tue Jul 1 17:53:56 2014 +0100 + + sna: Correct migration flags for initial scanout creation + + We want to preserve any contents preloaded (not that there should be + any...) + + Signed-off-by: Chris Wilson + +commit b88866aa5ebf813a999e194dec24e9ef2ac4f59d +Author: Chris Wilson +Date: Tue Jul 1 16:59:31 2014 +0100 + + sna/dri2: Add a DBG option to select copy method + + Often when debugging it is useful to force either use of the BLT or 3D + pipelines for copies. + + Signed-off-by: Chris Wilson + +commit a10781b70f222f3997928fa979f6292617f79316 +Author: Chris Wilson +Date: Tue Jul 1 15:11:07 2014 +0100 + + sna: Enforce LinearFramebuffer option + + This option should only be used for compatibility. Previously this was + done at a high level, this changes it to enforce the tiling as we apply + the CRTC. + + Signed-off-by: Chris Wilson + +commit 75745cd5861481c5a9a31125d357f339349dd0f8 +Author: Chris Wilson +Date: Tue Jul 1 14:31:32 2014 +0100 + + sna/dri2: Use CPU fallback if possible + + Signed-off-by: Chris Wilson + +commit 02715490db13dcd47c5e4bef713f400838d94b99 +Author: Chris Wilson +Date: Tue Jul 1 13:10:32 2014 +0100 + + sna/dri2: Set depth/bpp on scratch DrawableRec + + We need to initialise both depth and bitsPerPixel on the drawable struct + we pass around as they are used for selecting for the format when + copying. + + Reported-by: Vedran Rodic + Signed-off-by: Chris Wilson + +commit e6e5330857097eb2caafa89d571d12e4bb15f539 +Author: Damien Lespiau +Date: Mon Jun 30 19:24:13 2014 +0100 + + intel: Use the i845 info structure for INTEL_I845G_IDS() + + I assume the intention was to provide a different structure for each of + the gen 2 devices. + + This doesn't change anything really. + + Signed-off-by: Damien Lespiau + +commit e1c3e6ce79c73d12c814cfda76dbc0df184902ee +Author: Chris Wilson +Date: Mon Jun 30 19:56:39 2014 +0100 + + sna: Add DBG breadcrumbs before flushes in BLT + + Signed-off-by: Chris Wilson + +commit 43176b9bfafe389c4b9ed676f4e50e3b06f858c4 +Author: Chris Wilson +Date: Mon Jun 30 21:01:11 2014 +0100 + + sna/dri2: Pass around the correct DrawableRec for sampling from the foriegn bo + + One day, we will move the width/height/bpp to the bo itself... + + Reported-by: Ilia Mirkin + Signed-off-by: Chris Wilson + +commit 6c3399715e316be970c696b8949e3c14e83ea5df +Author: Chris Wilson +Date: Mon Jun 30 16:32:45 2014 +0100 + + sna/dri2: Apply the paraniod buffer clip in the correct coordinate system + + We need to only clip to the extents of the copy in the buffer space - + which implies that we need to translate the region into that space before + doing the clip. + + Reported-by: Ilia Mirkin + Signed-off-by: Chris Wilson + +commit c25fa2216a3674f564a7e35d263a5d405aa97816 +Author: Chris Wilson +Date: Mon Jun 30 14:13:13 2014 +0100 + + sna: Tweak preference for small GPU bo + + Signed-off-by: Chris Wilson + +commit 19a62e088f5202026bdfde7a8af36598b69f8243 +Author: Chris Wilson +Date: Mon Jun 30 11:20:54 2014 +0100 + + test/lowlevel-blt-bench: Update progress more frequently + + Signed-off-by: Chris Wilson + +commit fab3bc70a450d94104c96ddbe7fa6e6ace1bb8f8 +Author: Chris Wilson +Date: Mon Jun 30 11:05:33 2014 +0100 + + sna: Reduce assertion when using asynchronous CPU access + + If we are not actually accessing the memory through the pointer, we do + not care if it not currently coherent. + + Signed-off-by: Chris Wilson + +commit ffe8bd4d6e296a0ded0e118aee05aa6cb3051c56 +Author: Chris Wilson +Date: Mon Jun 30 10:55:20 2014 +0100 + + sna: Silence snarky compliers + + 0 != (void *)0 + + Signed-off-by: Chris Wilson + +commit 05f6183075867d582b7f9f74aec42e632e3d83dd +Author: Chris Wilson +Date: Mon Jun 30 10:46:00 2014 +0100 + + sna: Mollify assert to be consistent with the scanout flush + + Signed-off-by: Chris Wilson + +commit 2e0000688d034535083950b98bc61745dd965352 +Author: Chris Wilson +Date: Mon Jun 30 08:44:33 2014 +0100 + + test/lowlevel-blt-bench: Exercise masks + + Signed-off-by: Chris Wilson + +commit 37ac34c4e4500bfc272222754949edc1dbb8c7e2 +Author: Chris Wilson +Date: Mon Jun 30 08:44:33 2014 +0100 + + test/lowlevel-blt-bench: Exercise SHM pixmaps + + Signed-off-by: Chris Wilson + +commit 901d889dd7397dfa4c291f96af657e4b3433d795 +Author: Chris Wilson +Date: Mon Jun 30 07:44:25 2014 +0100 + + intel-virtual-output: Remove one redundant cleanup on error + + Signed-off-by: Chris Wilson + +commit a8b0ba0ed5f27e0d671b650d6f4bfe2fd86a0f3f +Author: Chris Wilson +Date: Sun Jun 29 15:25:19 2014 +0100 + + intel-virtual-output: Cleanup singleton on failure + + Signed-off-by: Chris Wilson + +commit 81889664851e3a2218d1ac5d39ebd2bd3b6a4954 +Author: Chris Wilson +Date: Sun Jun 29 08:29:36 2014 +0100 + + intel-virtual-output: Convert debugging messages to verbosity + + Original patch by main.haarp: + "A verbose switch is quite useful for debugging, it shouldn't require + editing and recompilation to gain more useful output. I added it." + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80664 + Signed-off-by: Chris Wilson + +commit 665d012b8e1b9666e535a3081404406f31b8a3ef +Author: Chris Wilson +Date: Sun Jun 29 09:26:10 2014 +0100 + + sna: Ensure CPU bo is synchronized before writing + + Signed-off-by: Chris Wilson + +commit 6b906ae742ec96eeef403191d3cdded6a23a70b7 +Author: Chris Wilson +Date: Sun Jun 29 07:02:44 2014 +0100 + + sna: Update allocation of CPU bo to avoid creating active buffers + + Since we now prefer CPU detiling, exactly when we want active/inactive + buffers is a little more complex - and we also need to take into account + when we want to use the CPU bo as a render target. + + Signed-off-by: Chris Wilson + +commit b961d7323369284ea2c3db47d30c27ffe01a9040 +Author: Chris Wilson +Date: Sun Jun 29 07:00:58 2014 +0100 + + sna: Sync CPU bo before writes + + Fixes regression from + + commit 961139f5878572ebea268a0bbf47caf05af9093f [2.99.912] + Author: Chris Wilson + Date: Fri May 30 09:45:15 2014 +0100 + + sna: Use manual detiling for downloads + + Reported-by: Harald Judt + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80560 + Signed-off-by: Chris Wilson + +commit 53ef9e762a6e7802b3d5f8fba9ac17ff95545c10 +Author: Chris Wilson +Date: Sat Jun 28 21:07:08 2014 +0100 + + sna: Only preferentially upload through the GTT for large transfers + + Signed-off-by: Chris Wilson + +commit 0955f12ae04011593b71817e3151b8fb7c228899 +Author: Chris Wilson +Date: Sat Jun 28 17:38:54 2014 +0100 + + sna: Prefer linear if below tile_width + + Be stricter in order to allow greater use of CPU bo. + + Signed-off-by: Chris Wilson + +commit 3ef966f4c5bae07108ce2720f4da3c3c4e41e1aa +Author: Chris Wilson +Date: Sat Jun 28 14:23:29 2014 +0100 + + sna/io: Prefer CPU copies on LLC + + Signed-off-by: Chris Wilson + +commit 9fc052da5c4246402d2707b3a91efffa7dd81e08 +Author: Chris Wilson +Date: Sat Jun 28 14:22:17 2014 +0100 + + sna: Don't discard damage for SHM pixmaps + + We don't really want to rendering into SHM pixmaps except for copying + back due to the strict serialisation requirements. + + Signed-off-by: Chris Wilson + +commit 0f8b39d24ff15cf3373ac7293f12772ebe16b68b +Author: Chris Wilson +Date: Sat Jun 28 14:21:36 2014 +0100 + + sna: Check for a mappable GPU bo before migrating damage + + Signed-off-by: Chris Wilson + +commit cfdaee4a7e45689b0fbbc8c3166d28d69797e759 +Author: Chris Wilson +Date: Sat Jun 28 14:20:00 2014 +0100 + + sna: Skip adding damage if it is already contained + + Signed-off-by: Chris Wilson + +commit 80752fb2794faa581d891b24148eaf51c42afd25 +Author: Chris Wilson +Date: Sat Jun 28 14:19:22 2014 +0100 + + sna: Tidy calling memcpy_from_tiled + + Signed-off-by: Chris Wilson + +commit 2a0176379f0ff290d276adc72d44dfddafd96da5 +Author: Chris Wilson +Date: Sat Jun 28 14:18:23 2014 +0100 + + sna: Micro-optimise unswizzling tiling/detiling + + Signed-off-by: Chris Wilson + +commit 24cb50e53c789cb7a05d59ad103dda1c3a009485 +Author: Chris Wilson +Date: Sat Jun 28 07:05:55 2014 +0100 + + sna/trapezoids: Handle mono traps just in case + + I disabled a few paths and ended up in an assert that mono trapezoids + shouldn't get that far... + + Signed-off-by: Chris Wilson + +commit 72c041e57b99367f327c51c50fce2a55d618fc63 +Author: Chris Wilson +Date: Fri Jun 27 16:26:24 2014 +0100 + + uxa: Update Screen Pixmap width/height first + + Since commit dd6db82680b05cde4a47116b7096c054f3837e20 [2.99.912] + Author: Chris Wilson + Date: Fri May 9 20:26:19 2014 +0100 + + uxa: Add DRI3 and miSyncShm support + + we verify that the attaching bo meets the constraints required for the + Pixmap. However, when updating the ScreenPixmap following a resize, we + did not update the Pixmap size until after we tried to update the bo, + resulting in a validation failure when shrinking the screen. + + Signed-off-by: Chris Wilson + +commit 0584604b53c8676adfa1f8f4d3def22c93ea822f +Author: Chris Wilson +Date: Fri Jun 27 16:12:35 2014 +0100 + + test: Expand number of sources for basic benchmarking + + Signed-off-by: Chris Wilson + +commit edd2b789568b14c29a004a64b6ff82bb6e4e9620 +Author: Chris Wilson +Date: Fri Jun 27 16:00:03 2014 +0100 + + sna/dri2: DBG compile fixes + + Signed-off-by: Chris Wilson + +commit a6ba93283b20a50ff36758624d2967562b7bdae9 +Author: Chris Wilson +Date: Fri Jun 27 13:42:37 2014 +0100 + + sna/glyphs: Add DBG option for glyph tolerance + + And bump it to 3 so that glyph filtering doesn't force us to use the + mask too often. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit ee5c74deee77db4292ce197ab7facca422f86021 +Author: Chris Wilson +Date: Fri Jun 27 12:56:43 2014 +0100 + + sna/glyphs: Add DBG option for forcing glyphs-to-dst + + Signed-off-by: Chris Wilson + +commit 6ba4ee1fe842e975c94a01f93c6d39c20eadadbe +Author: Chris Wilson +Date: Fri Jun 27 10:38:59 2014 +0100 + + sna: Check source bo is suitable for BLT before doing so + + Signed-off-by: Chris Wilson + +commit 157e22cb8e96b0a9ffa7d58625fe2396f6084ff9 +Author: Chris Wilson +Date: Thu Jun 26 20:19:52 2014 +0100 + + sna: Only reuse pinned batches for 830/845 + + Trying to fly too close to the sun. :( + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80558 + Signed-off-by: Chris Wilson + +commit f027b4f628b6d0f4c00f8aba7b27dcf51f91211d +Author: Chris Wilson +Date: Thu Jun 26 20:24:05 2014 +0100 + + sna/dri2: Slightly improved DBG messages + + Missing git add from + + commit 2e8c09f3fe468abba9c307ba3d7b2d22908e1172 + Author: Chris Wilson + Date: Wed Jun 25 22:19:23 2014 +0100 + + sna/dri2: Hook into ClientGone callback to clear dangling references + + Signed-off-by: Chris Wilson + +commit 2ae5d7d9415a77c76078bc340066df73dce72d27 +Author: Chris Wilson +Date: Thu Jun 26 20:21:12 2014 +0100 + + sna: Tidy selection of a near-miss active buffer. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80560 + Signed-off-by: Chris Wilson + +commit 8cad98eca64224534887efbcd1c60604cd491c35 +Author: Chris Wilson +Date: Thu Jun 26 12:42:30 2014 +0100 + + sna: Fix userptr defines to match i915_drm.h + + Now that we are starting to see userptr in the headers, we see that the + definitions slightly changed. + + Signed-off-by: Chris Wilson + +commit c5c7dd24a55f04322d5eec10dc4352d8a8e92b1e +Author: Chris Wilson +Date: Thu Jun 26 09:25:06 2014 +0100 + + sna: Remove scare quotes from hotplug detection "enabled" + + Tidy up the log message by improving its formatting, and making it more + accurate. + + Signed-off-by: Chris Wilson + +commit 2e8c09f3fe468abba9c307ba3d7b2d22908e1172 +Author: Chris Wilson +Date: Wed Jun 25 22:19:23 2014 +0100 + + sna/dri2: Hook into ClientGone callback to clear dangling references + + As the Window may exist for multiple Clients, we cannot rely on the + destruction of the Window decoupling all outstanding events and + preventing chasing a stale Client pointer. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80157 + Signed-off-by: Chris Wilson + +commit 12a349974b63a47ad55384abe0d7a839af48f31a +Author: Chris Wilson +Date: Thu Jun 26 06:59:07 2014 +0100 + + sna: Make output destroy more defensive + + We may never create the properties as it may be ignored or the + allocation may fail, so we need to be careful when freeing we do not + stumble over invalid pointers. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80355#c28 + Signed-off-by: Chris Wilson + +commit 2ec2164ba4bd3a266949cdb379b6da1090475c08 +Author: Chris Wilson +Date: Wed Jun 25 18:05:46 2014 +0100 + + sna/dri2: Compile fixes for ancient Xorg + + Signed-off-by: Chris Wilson + +commit 258f8983daa3a8fe315c440f5e298ae1b02fd678 +Author: Chris Wilson +Date: Wed Jun 25 17:20:52 2014 +0100 + + sna: Fix uninitialisable variable + + sna_render.c: In function 'sna_render_picture_downsample': + sna_render.c:822: warning: 'priv' may be used uninitialized in this function + + introduced in + + commit ded05e8abb248664124d2b86f77c27497a252c4e + Author: Chris Wilson + Date: Mon Jun 23 22:15:56 2014 +0100 + + sna: Allow scratch pixmap to allocate linear GPU bo + + Signed-off-by: Chris Wilson + +commit ca0d06add926eb17fcec6c031adabb656498d744 +Author: Chris Wilson +Date: Wed Jun 25 14:19:33 2014 +0100 + + sna: Improve throttling during bo allocation + + By controlling how long we may block during buffer allocation, we can + relax the throttle elsewhere to prevent render lag buildup. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit 5ad1661b870b5b189e52383e45a9b8f570b40501 +Author: Chris Wilson +Date: Wed Jun 25 13:21:58 2014 +0100 + + sna: Only mark throttle as done after success + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit c3e4518e84300aeb8e12a0af56c2d66a1df9d8d7 +Author: Chris Wilson +Date: Wed Jun 25 11:18:01 2014 +0100 + + sna: Track desired flushes better after starting a new batch + + Signed-off-by: Chris Wilson + +commit 85bb55e4a62666fa51af34d08699950be362aa57 +Author: Chris Wilson +Date: Wed Jun 25 11:45:55 2014 +0100 + + intel: Fix weblinks (again) + + Julien pointed out that I fail at checking links. + + Reported-by: Julien Cristau + Signed-off-by: Chris Wilson + +commit ff31d49bfa48a74eb9d8cb0afb1e2882ffbc7573 +Author: Chris Wilson +Date: Wed Jun 25 11:31:58 2014 +0100 + + intel: Fix weblinks + + Matti reported a few outdated links to intellinuxgraphics.org, now + superseded by 01.org. + + Reported-by: Matti Hämäläinen + Signed-off-by: Chris Wilson + +commit 8c1729aab6b49e7d4a3f48516a629b0d23e8591b +Author: Chris Wilson +Date: Wed Jun 25 09:00:04 2014 +0100 + + sna: Tweak scanout flush + + We now distinguish gpu_dirty whilst the bo is not flushed within a batch + and needs_flush for when it is dirty and still busy. + + Signed-off-by: Chris Wilson + +commit 26c4e850b8a7d13afc351097ee6f6b2f3f90e2b9 +Author: Chris Wilson +Date: Wed Jun 25 08:18:25 2014 +0100 + + sna: Throttle before doing a TearFree buffer replacement + + If the client is rendering fast, he may be rendering too fast and + starting to build up a backlog. + + Signed-off-by: Chris Wilson + +commit ea6b0bb8e1b358d728d80daac936ec6521154302 +Author: Chris Wilson +Date: Wed Jun 25 08:05:22 2014 +0100 + + sna: And fix the typo... + + Signed-off-by: Chris Wilson + +commit 3f4da671b0a570de8734cc668d8e8975c2fdbd90 +Author: Chris Wilson +Date: Wed Jun 25 08:01:57 2014 +0100 + + sna: Disable userptr for bdw + + Something fishy is afoot. But let's kill this particularly worrisome + regression so that we can do a full round of testing. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=79053 + Signed-off-by: Chris Wilson + +commit 204ec74a61ba0b9628c686b98c48fa1220866c2d +Author: Chris Wilson +Date: Wed Jun 25 07:31:33 2014 +0100 + + sna: Check all connectors for reuse + + Do not rely on the MST path being present to indicate a connector that + may be reused. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80355 + Signed-off-by: Chris Wilson + +commit 43ad5dbc60e1f50a9cdcfc035bc271f1f28438c2 +Author: Rodrigo Vivi +Date: Tue Jun 24 03:14:54 2014 -0700 + + Add marketing names for Broadwell + + Even the unknown/reserved ones will stay with HD Graphics. + + v2: Add missing names to intel.man and README files as well. (Chris) + + Cc: Chris Wilson + Signed-off-by: Rodrigo Vivi + +commit 78053bb84217e842615669dfa2f1e7e971ce9860 +Author: Chris Wilson +Date: Tue Jun 24 20:51:54 2014 +0100 + + Add reserved PCD IDs for Broadwell + + Updating using kernel commit fb7023e0e248a33cb00d0a9cdce0bcedaa1ad284 + Author: Rodrigo Vivi + Date: Tue Jun 10 10:09:52 2014 -0700 + + drm/i915: BDW: Adding Reserved PCI IDs. + + Signed-off-by: Chris Wilson + +commit 74c1cf60a7ce7e79bc727780151f4f233798e5f4 +Author: Chris Wilson +Date: Tue Jun 24 20:49:18 2014 +0100 + + sna: Add yet more DBG messages to MST discovery + + Signed-off-by: Chris Wilson + +commit ca296c18316a3ce1682beefd5daa4702593cd529 +Author: Chris Wilson +Date: Tue Jun 24 16:37:52 2014 +0100 + + configure: Display our README before the summary + + Signed-off-by: Chris Wilson + +commit d14d7efb28c3e323203139b7c1562b1e0bc526f0 +Author: Chris Wilson +Date: Tue Jun 24 16:33:43 2014 +0100 + + intel: Add a note about the myriad places we have identifier strings + + Signed-off-by: Chris Wilson + +commit 0c7cf7a6bb1c91b59ad326198f3364554e3dfeb5 +Author: Chris Wilson +Date: Tue Jun 24 11:50:55 2014 +0100 + + intel: Wait for our expected device node to appear + + If the path we want to open for the KMS device is not yet available, + wait a short while and try again. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80397 + Signed-off-by: Chris Wilson + +commit 5c8829b30ad3acd2e59dac9ffa2aba8aadcada61 +Author: Chris Wilson +Date: Tue Jun 24 11:35:23 2014 +0100 + + sna: Add some more DBG around connector discovery + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80355 + Signed-off-by: Chris Wilson + +commit 271ed88e517745505c133bd68c40a8566ec8a625 +Author: Chris Wilson +Date: Tue Jun 24 11:24:26 2014 +0100 + + sna: Ensure serial is not 0 for runtime MST discovery + + We reserve serial==0 for the initial setup that is run before RandR is + configured. After the server is running, we have to take extra steps to + make the outputs visible to userspace. + + Signed-off-by: Chris Wilson + +commit 92dd13ae8dbddc31d0291dd12683fc7e3f65ffde +Author: Chris Wilson +Date: Tue Jun 24 11:04:01 2014 +0100 + + sna: Fix the usual "x = y" typos in creating boxes + + Fixes regression from + + commit 1d74b2e07d125ad95b9db6c9c032e90faf2bfa60 + Author: Chris Wilson + Date: Tue Jun 24 08:58:51 2014 +0100 + + sna: Decompose self-copy into overlapping/non-overlapping regions + + Signed-off-by: Chris Wilson + +commit 92119ef0939897dd1850b417d04a2ba558aee8ca +Author: Chris Wilson +Date: Tue Jun 24 10:23:03 2014 +0100 + + sna/glyphs: Clip damage to dst + + We only check if the hardware will automatically discard writes outside + of the target pixmap, but we must manually clip the damage before adding + it to our tracker. + + Reported-by: Jiri Slaby + Reported-by: Zdenek Kabelac + References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c58 + Signed-off-by: Chris Wilson + +commit b33be7fbac005eb222302ffbb533ded1cd700953 +Author: Chris Wilson +Date: Tue Jun 24 10:17:47 2014 +0100 + + sna: Trim composite region against dst clip extents + + Signed-off-by: Chris Wilson + +commit f66e25def3431a900068cc1c23a6b1e8322ef046 +Author: Chris Wilson +Date: Mon Jun 23 16:14:28 2014 +0100 + + intel: Wait for the DRM device to load + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80397 + Signed-off-by: Chris Wilson + +commit 1d74b2e07d125ad95b9db6c9c032e90faf2bfa60 +Author: Chris Wilson +Date: Tue Jun 24 08:58:51 2014 +0100 + + sna: Decompose self-copy into overlapping/non-overlapping regions + + We only need to stage the copy for the overlapping portion of the + self-copy, for the rest we can do in a single pass. + + Signed-off-by: Chris Wilson + +commit 6e2cee27c379278b0321fd1db34ed80c439115a7 +Author: Chris Wilson +Date: Tue Jun 24 07:34:46 2014 +0100 + + sna/dri2: Add a dash more asserts + + References: https://bugs.freedesktop.org/attachment.cgi?id=101618 + Signed-off-by: Chris Wilson + +commit 706480bde6120f84388a99085ed3d1cc3b759697 +Author: Chris Wilson +Date: Mon Jun 23 22:50:23 2014 +0100 + + sna: Disable CRTC after MST topology change + + In order to disable CRTC after marking outputs as removed after probing + MST topology updates, we must manually mark the CRTCs as no longer + enabled. + + Signed-off-by: Chris Wilson + +commit 5530cb4165da60f7b929b84d733d5eefcf4ec5fe +Author: Chris Wilson +Date: Mon Jun 23 15:47:13 2014 +0100 + + sna: Silence compiler warning for shadowed variable + + sna_display.c: In function 'sna_mode_redisplay': + sna_display.c:6322:12: warning: declaration of 'fb_id' shadows a global declaration [-Wshadow] + sna_display.c:223:24: warning: shadowed declaration is here [-Wshadow] + CC sna_display_fake.lo + + Signed-off-by: Chris Wilson + +commit ded05e8abb248664124d2b86f77c27497a252c4e +Author: Chris Wilson +Date: Mon Jun 23 22:15:56 2014 +0100 + + sna: Allow scratch pixmap to allocate linear GPU bo + + When allocating a scratch pixmap, we do so in the expectation that + rendering on the GPU is always preferrable, so even allocate a small + linear bo. + + Signed-off-by: Chris Wilson + +commit 6c5658b14451239b8e4333702a227d83eed09f96 +Author: Chris Wilson +Date: Mon Jun 23 14:11:27 2014 +0100 + + sna: Promote to full GPU bo after forced migration away from CPU bo + + Signed-off-by: Chris Wilson + +commit 25776547bb7d76010f948769c8c08a7f418b15fd +Author: Chris Wilson +Date: Mon Jun 23 14:02:51 2014 +0100 + + sna: Prefer rendering on the CPU to avoid damage migration + + Signed-off-by: Chris Wilson + +commit a3c9cbefcb9971900638144286b59112e3cfd404 +Author: Chris Wilson +Date: Mon Jun 23 12:27:30 2014 +0100 + + sna: Force creation of GPU bo for drawing if need be + + Now that we are more eager to transfer to the GPU bo if we expect + rendering to the CPU bo to be either slow or risk potential corruption, + we can find ourselves in a recursive loop when we also decide not to + create the GPU bo. Prevent that by explicitly creating the GPU bo if + desired. + + Signed-off-by: Chris Wilson + +commit 827b89fa2d5fca0ffd709c17bcdbfdaf95da918f +Author: Chris Wilson +Date: Mon Jun 23 11:44:22 2014 +0100 + + sna/gen6+: Initialise src offset before use + + Fixes regression from + + commit 30348efd57135edee41fccb87133c572b6473aa8 + Author: Chris Wilson + Date: Mon Jun 23 11:14:25 2014 +0100 + + sna/gen6+: Avoid adjusting copy coordinates until commited to using them + + which assumed that the render state was being zeroed. + + Reported-by: Jiri Slaby + Signed-off-by: Chris Wilson + +commit 6848fb235b1bac84e91d1efde4094540180c4d48 +Author: Chris Wilson +Date: Mon Jun 23 11:27:20 2014 +0100 + + sna: Fix flushing empty batches + + A logic inversion in + + commit 1909910fdf89216d18703e50728f4604f75d5d66 + Author: Chris Wilson + Date: Sun Jun 22 20:19:22 2014 +0100 + + sna: Inject a batch flush before adding a fresh bo + + also applied the injection to when the batch was empty. + + Reported-by: Jiri Slaby + References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c48 + Signed-off-by: Chris Wilson + +commit 60fd6764eba05f51bb83efba5593975cf8d1285b +Author: Chris Wilson +Date: Mon Jun 23 11:25:47 2014 +0100 + + sna: Handle old busy_ioctl not reporting the active ring + + If we have an old kernel, just presume that the bo was last active on the + render ring. + + Signed-off-by: Chris Wilson + +commit 30348efd57135edee41fccb87133c572b6473aa8 +Author: Chris Wilson +Date: Mon Jun 23 11:14:25 2014 +0100 + + sna/gen6+: Avoid adjusting copy coordinates until commited to using them + + If we need to fallback to the BLT unit, we need to pass it the original + source/dest coordinates and not our transformed render coordinates. So + keep the original values intact until we start emitting the render + operation. + + Signed-off-by: Chris Wilson + +commit e1e853edee67c3ced43d5e4b1fbd52ca4c92966d +Author: Chris Wilson +Date: Mon Jun 23 10:14:09 2014 +0100 + + sna/gen4+: Add some more asserts around recreating vertex buffers + + References: https://bugs.freedesktop.org/show_bug.cgi?id=70461#c46 + Signed-off-by: Chris Wilson + +commit 978790dc52fa9551b3bccbd91988b93988e937df +Author: Chris Wilson +Date: Mon Jun 23 09:47:34 2014 +0100 + + sna: Allow the CPU bo to be created if GPU rendering is forced + + Signed-off-by: Chris Wilson + +commit b2206eca00e497aff0d79a6e9feae3d9c5070dcc +Author: Chris Wilson +Date: Mon Jun 23 09:42:37 2014 +0100 + + sna/gen6+: Encourage the compiler to inline a couple of key functions + + Signed-off-by: Chris Wilson + +commit bb4c057620fb0558a77a9b7db538786ffda7cf13 +Author: Chris Wilson +Date: Mon Jun 23 09:22:13 2014 +0100 + + sna: Prefer to render over damage into the GPU bo + + Signed-off-by: Chris Wilson + +commit 416c223861aaeb61c6408e6537315b78e908df43 +Author: Chris Wilson +Date: Mon Jun 23 09:20:55 2014 +0100 + + sna: Do not set CAN_CREATE_GPU flag for untiled allocations + + Signed-off-by: Chris Wilson + +commit fb51ec44f4b6069ab854233d5d0da34eb79f754c +Author: Chris Wilson +Date: Mon Jun 23 09:07:13 2014 +0100 + + sna: Rename IGNORE_CPU to IGNORE_DAMAGE to better reflect its purpose + + Signed-off-by: Chris Wilson + +commit 96d2749660e1738847222f2d9dbb7303b7deb5bf +Author: Chris Wilson +Date: Mon Jun 23 08:18:23 2014 +0100 + + sna: Add DBG breadcrumbs to sna_output_discover() + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80355 + Signed-off-by: Chris Wilson + +commit a33aa554fa3df8ca34012cf1c6ecb11fa69ac7fc +Author: Chris Wilson +Date: Mon Jun 23 07:42:30 2014 +0100 + + sna/gen4+: Add box emitters for the generic vertex paths + + Signed-off-by: Chris Wilson + +commit 1909910fdf89216d18703e50728f4604f75d5d66 +Author: Chris Wilson +Date: Sun Jun 22 20:19:22 2014 +0100 + + sna: Inject a batch flush before adding a fresh bo + + Fresh bo (those without a reservation already defined, ala + presumed_offset) will cause the kernel to do a full relocation pass. So, + if possible flush the already correct batch in the hope of trimming the + amount of checking the kernel has to perform on this new batch. + + Signed-off-by: Chris Wilson + +commit 83cbbcd816e449402f3d49aeba3c099a20b8bc1b +Author: Chris Wilson +Date: Mon Jun 23 07:29:20 2014 +0100 + + sna: Add missing string for DBG + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80355#c12 + Signed-off-by: Chris Wilson + +commit f22ea4e821a33eccd3a9283d7ab048857008f7e8 +Author: Chris Wilson +Date: Sun Jun 22 17:53:59 2014 +0100 + + sna: Disable unused CRTC after undock events + + If undocking removes output (as the MST topology changes and some + outputs then become unreachable), we may leave dangling CRTC. This + confuses us, so disable any enabled but unconnected CRTC after the + undock event. + + Reported-by: Sree Harsha Totakura + References: https://bugs.freedesktop.org/show_bug.cgi?id=80355#c5 + Signed-off-by: Chris Wilson + +commit dca0f1c2ccf14df38764ed12b971dc491cf22608 +Author: Chris Wilson +Date: Sun Jun 22 17:53:59 2014 +0100 + + sna: Track CRTC mode changes and discard old flips + + If we have a pending flip across a modeset we must be careful to drop + the stale flip_bo after the modeset. + + Reported-by: Sree Harsha Totakura + References: https://bugs.freedesktop.org/show_bug.cgi?id=80355#c8 + Signed-off-by: Chris Wilson + +commit dae370423ad85b9d9c576277da5a9fb92ab3d3df +Author: Chris Wilson +Date: Sun Jun 22 11:45:35 2014 +0100 + + sna: Clean up CRTC on CloseScreen + + We need to do this to stop any stray references escaping through kernel + events now that we are passing the CRTC through the event. + + Signed-off-by: Chris Wilson + +commit 923dc207df7b05c138c628983ccaf2493dd63b62 +Author: Chris Wilson +Date: Thu Jun 19 10:17:11 2014 +0100 + + sna: Discard write hint from a couple more move-to-gpu + + Signed-off-by: Chris Wilson + +commit 2046a49be59866a16db776ba53a588dbf6c02b12 +Author: Chris Wilson +Date: Sat Jun 21 15:43:32 2014 +0100 + + sna: Clear the transform flag on disabling the CRTC + + In places, we assume that if the flag is set, we must have an active + CRTC. However, we were not clearing when disabling the CRTC. + + Reported-by: Sree Harsha Totakura + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80325 + Signed-off-by: Chris Wilson + +commit b3d3c0e8e75a963262e4dc463fef60d7e9f1f01a +Author: Chris Wilson +Date: Fri Jun 20 20:01:23 2014 +0100 + + sna: Avoid blending with the render engine on snoopable bo + + This seems slightly weird, as there is nothing to indicate that this + would generate incorrect results only for snoopable bo. But no many of + flushes make my pnv box happy, so adjust the placement logic to move the + blending operation away from the snoopable target. This is sensible for + reasons of avoiding snoops from the render pipeline anyway. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80253 + Reported-and-tested-by: Matti Hämäläinen + Signed-off-by: Chris Wilson + +commit 219f6bd9e863f9c89cc4168895f89741ce6dbcbb +Author: Chris Wilson +Date: Fri Jun 20 17:06:55 2014 +0100 + + sna: Be more flexible in converting random subsamples to 8x8 tiles + + Signed-off-by: Chris Wilson + +commit 91bc9e42e434abd56ce2e4fc5e08d07376fe8bd3 +Author: Chris Wilson +Date: Fri Jun 20 16:13:49 2014 +0100 + + sna: Mark up const boxes to keep the compiler happy + + Pass around const to suppress a few compiler warnings. + + Signed-off-by: Chris Wilson + +commit e5c68b4358ce541929681c8c1e0ad3ef8c1dc9ed +Author: Chris Wilson +Date: Fri Jun 20 14:31:19 2014 +0100 + + sna: Feed more operations into the 8x8 BLT tiler + + Signed-off-by: Chris Wilson + +commit d2b90ac969656de35ec86973f66074654b0e9b4b +Author: Chris Wilson +Date: Fri Jun 20 14:29:43 2014 +0100 + + sna: Color patterns for BLT are required to be aligned to 256 byte boundaries + + This so far appears to be the most restrictive alignment required, so + simply increase the upload alignment to 256 bytes. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80033 + Signed-off-by: Chris Wilson + +commit 8d7e7010e33d73a7d99948403b62d859d7a4dfaa +Author: Chris Wilson +Date: Fri Jun 20 08:28:32 2014 +0100 + + test: Increase number of tiled sources + + Significantly improve the stress impose upon the tiled BLT operations. + Also start dumping pngs of the failures. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80033 + Signed-off-by: Chris Wilson + +commit db6dfc3227155a4792ba3831681daf16839b14bb +Author: Chris Wilson +Date: Fri Jun 20 07:28:02 2014 +0100 + + sna/dri2: Don't decouple front buffer tracking for invalid SwapBuffer calls + + Signed-off-by: Chris Wilson + +commit 113a8b9be9dd7ffbc6f7c713bc40561bdf38e8b0 +Author: Chris Wilson +Date: Thu Jun 19 20:39:59 2014 +0100 + + sna: Mark upload from SHM segment as read-only + + As this may be mapped by the Xserver using a read-only SHM segment, we + are forced to treat it always as read-only. And this being X, that it is + using a SHM segment is opaque to the driver. Fantastic middlelayer. + + This was incorrectly removed in + commit e680e54eab6ffa72e5e1eb6cc0e3fe4b235b06a1 + Author: Chris Wilson + Date: Wed Jun 11 10:48:26 2014 +0100 + + sna: Ignore setting read-only for temporary userptr maps + + Also let's not forget the ShmPutImage -> CopyArea path. + + Reported-by: Christoph Haag + Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78411 + Signed-off-by: Chris Wilson + +commit df89b4941130b5ff020c6ef3e244dcf5fec45f2a +Author: Chris Wilson +Date: Thu Jun 19 20:39:59 2014 +0100 + + sna: Mark upload from SHM segment as read-only + + As this may be mapped by the Xserver using a read-only SHM segment, we + are forced to treat it always as read-only. And this being X, that it is + using a SHM segment is opaque to the driver. Fantastic middlelayer. + + This was incorrectly removed in + commit e680e54eab6ffa72e5e1eb6cc0e3fe4b235b06a1 + Author: Chris Wilson + Date: Wed Jun 11 10:48:26 2014 +0100 + + sna: Ignore setting read-only for temporary userptr maps + + Reported-by: Christoph Haag + Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=78411 + Signed-off-by: Chris Wilson + +commit 6b32cf3a3c908bd29496fcf5d190fd0f8c657ae6 +Author: Chris Wilson +Date: Thu Jun 19 12:29:58 2014 +0100 + + sna: Missed fixing y tile offset in last commit + + Signed-off-by: Chris Wilson + +commit edeb2ddd170a1817ced45abada53346c5cd8c30b +Author: Chris Wilson +Date: Thu Jun 19 11:51:00 2014 +0100 + + sna: Use the right pattern origin for tiled 8x8 extraction + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80033 + Signed-off-by: Chris Wilson + +commit 1752e2d647cdb7cbff0ae7d0f0d0b761b5942965 +Author: Chris Wilson +Date: Thu Jun 19 11:14:25 2014 +0100 + + sna: Fix up small extents for 8x8 tile construction + + Signed-off-by: Chris Wilson + +commit f866a20c991d52fd2cf4ce63acc3cd44534ce5be +Author: Chris Wilson +Date: Thu Jun 19 10:49:09 2014 +0100 + + sna: Wrap pointer access for 8x8 tile construction + + The kernel can quite happily send a SIGBUS whenever we read from an bo + (due to oom), so catch it and handle it. + + Signed-off-by: Chris Wilson + +commit b1aab55d594f03e51c3abf1743d00c56ef6d7797 +Author: Chris Wilson +Date: Thu Jun 19 09:47:02 2014 +0100 + + sna: Always readback shadow damage after replacing the buffer + + Instead track what we explicitly want to discard for the next operation, + so that we don't have to copy back the whole buffer if we have to + replace the shadow and intend to overwrite it all. + + Signed-off-by: Chris Wilson + +commit f4b930318c68e0e07d677ebc7b4caa27912561db +Author: Chris Wilson +Date: Thu Jun 19 07:40:16 2014 +0100 + + sna/dri2: Replace assertion with code to skip updating the back buffer + + After a window resize or redirection, the DRI2BufferPtr become stale but + it may take a while for the Client to notice and reconfigure. Just + skip touching stale backbuffers and let the Client catch up. + + Signed-off-by: Chris Wilson + +commit c257c936b42b92827b784cee0b7caa54e6040364 +Author: Chris Wilson +Date: Wed Jun 18 22:15:42 2014 +0100 + + sna: Fix modulus for partial conversion of tiles to 8x8 patterns + + Signed-off-by: Chris Wilson + +commit 9489cc6c70abf53d9ca45228b0aa9fb1fc3f9b72 +Author: Chris Wilson +Date: Wed Jun 18 21:28:11 2014 +0100 + + sna: Delete the silly typo + + Not checking DAMAGE_IS_ALL() correctly leads to an assertion failure. + + Signed-off-by: Chris Wilson + +commit 51a0559b120dd0a57a938b300bccefbf1142e495 +Author: Chris Wilson +Date: Wed Jun 18 20:55:02 2014 +0100 + + sna: Do not treat both src/dst having no clones as being the same + + Fixes regression from + commit 62aaf2ff4f8597067cf387865707baa00ed9a123 + Author: Chris Wilson + Date: Wed Jun 18 18:41:15 2014 +0100 + + sna: Skip redundant copies when already cloned + + Signed-off-by: Chris Wilson + +commit 377b0e8657aab13dc90134853a03feb95f515567 +Author: Chris Wilson +Date: Wed Jun 18 19:59:14 2014 +0100 + + sna: Add log breadcrumbs with valgrind + + Signed-off-by: Chris Wilson + +commit 273c82a574896885f9f4a78a7463cc4620803624 +Author: Chris Wilson +Date: Wed Jun 18 18:47:14 2014 +0100 + + sna: Fix DBG compilation + + Missed updaing the DBG message in + + commit 83c0f034454ef0f474126a3398e5e790ac5ef842 + Author: Chris Wilson + Date: Wed Jun 18 16:51:46 2014 +0100 + + sna: Pass desired CRTC viewport for completing single CRTC flips + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80157 + Signed-off-by: Chris Wilson + +commit 62aaf2ff4f8597067cf387865707baa00ed9a123 +Author: Chris Wilson +Date: Wed Jun 18 18:41:15 2014 +0100 + + sna: Skip redundant copies when already cloned + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit 83c0f034454ef0f474126a3398e5e790ac5ef842 +Author: Chris Wilson +Date: Wed Jun 18 16:51:46 2014 +0100 + + sna: Pass desired CRTC viewport for completing single CRTC flips + + We cannot simply compare against the crtc->shadow_bo for all our needs, + so pass in exactly the setup we want and apply that. In particular this + is required when flipping away from the single CRTC setup on secondary + pipes. + + Fixes TearFree multi-monitor regression from + commit 3932e97057fca16615adaefbc1eb25a0d51a1d8b [2.99.912] + Author: Chris Wilson + Date: Mon Jun 9 08:58:15 2014 +0100 + + sna/dri2: Allow TearFree flipping to individual CRTC + + Reported-by: Leo Wolf + Signed-off-by: Chris Wilson + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80191 + +commit 7119d394a673f40eb467d040c6febf3749924394 +Author: Hans de Goede +Date: Wed Jun 18 15:01:37 2014 +0200 + + uxa: Mark the output as off before making pipe changes + + This is a partial "backport" of commit c6cd10f536, which makes the same + change for sna, to avoid users still using uxa ending up with a blackscreen + after plugging in an external monitor. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1032978 + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1103806 + Signed-off-by: Hans de Goede + +commit 52af321a11b5672194bc0bad033b0866221bf4c7 +Author: Hans de Goede +Date: Wed Jun 18 15:01:36 2014 +0200 + + uxa: When the output is off, report the cached backlight value + + This is a "backport" of commit b545e10c50cb to uxa, so that users who are + still using uxa, don't end up with a black screen after suspend / resume. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1032978 + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1103806 + Signed-off-by: Hans de Goede + +commit 44b5912ffcf8dcf4b4b8d3518dd0b62a284f6ee4 +Author: Chris Wilson +Date: Wed Jun 18 14:48:33 2014 +0100 + + sna/gen8: Fix cleanup after failing to convert channel + + Signed-off-by: Chris Wilson + +commit 21b6e551528fdd939004cfb02a4f192e750a33a1 +Author: Chris Wilson +Date: Wed Jun 18 14:44:09 2014 +0100 + + sna/gen8: Fix unaligned() to return true when not aligned + + Signed-off-by: Chris Wilson + +commit c5b063b8cc23cc43be458cb3b0d1b28652a24951 +Author: Chris Wilson +Date: Wed Jun 18 14:34:04 2014 +0100 + + sna: Assert that we do not try to mmap a proxy + + Signed-off-by: Chris Wilson + +commit 40bd45fb802366aa013b9089848b67a28bf3b1ee +Author: Hans de Goede +Date: Wed Jun 18 14:11:05 2014 +0100 + + backlight: Fix compiler error + + /usr/include/xorg/os.h around line 579 reads: + + extern _X_EXPORT char * + strndup(const char *str, size_t n); + + However strndup is already defined by glibc, and this redefine causes a + compile error. + + This gets triggered because backlight.c does: + + Without first doing: + + Causing HAVE_STRNDUP to not be defined. + + Signed-off-by: Hans de Goede + +commit e52f917a2370026073ed6851161393a69ee94abe +Author: Chris Wilson +Date: Wed Jun 18 10:18:26 2014 +0100 + + sna: Use nxm tiled blits for small regions of large tiles + + If the region we are blitting is either narrow or short, we may be able + to construct a tiling pattern out of a large pixmap. + + In the process, spot a regression due to + + commit 542aeca6e67fc64f9133ca3e27ac8eca28af6d25 + Author: Chris Wilson + Date: Tue Jun 17 12:26:30 2014 +0100 + + sna: Tweak creation 8x8 tiled patterns + + which copied too much from the source line. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=79888 + Signed-off-by: Chris Wilson + +commit b90f6c5aa7359ea6936ae4a7951fcd3bdad05d58 +Author: Chris Wilson +Date: Wed Jun 18 10:17:02 2014 +0100 + + sna: Simplify sna_pixmap_get_source + + kgem_bo_upload_image was open-coded, so replace it with a call to the + common function + + Signed-off-by: Chris Wilson + +commit 8ea2dd23ab85dc2d4ad0de326c2176354d61cf20 +Author: Chris Wilson +Date: Wed Jun 18 10:16:26 2014 +0100 + + sna: Add DBG option to disable snoop bo cacheing + + Signed-off-by: Chris Wilson + +commit b2081345843152dadcaa4fbc843b38240d1a3484 +Author: Chris Wilson +Date: Wed Jun 18 07:37:00 2014 +0100 + + sna/dri2: fix invalid DBG string + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80157 + Signed-off-by: Chris Wilson + +commit 77f1a16f1145e69d69a76f2db4b1c60d9a7a4d53 +Author: Chris Wilson +Date: Tue Jun 17 23:27:16 2014 +0100 + + sna: Set the correct mapping type after calling mmap__async + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80001 + Signed-off-by: Chris Wilson + +commit d49f53cc00258e3b1e1a898c02e219b336716002 +Author: Chris Wilson +Date: Tue Jun 17 22:23:02 2014 +0100 + + sna: Fix computing source bo for BLT operations + + If we migrate the pixmap to the GPU, use the GPU bo. This may fix an issue + where we might end up using the CPU bo in a rare circumstance. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80033 + Signed-off-by: Chris Wilson + +commit 475562d713a00e2f60f7ca067d753fd965d71717 +Author: Chris Wilson +Date: Tue Jun 17 22:25:05 2014 +0100 + + sna: Align some function parameters + + Signed-off-by: Chris Wilson + +commit c91fc0aad843ffc2660f6a3bf9b875d190e0b0dd +Author: Chris Wilson +Date: Tue Jun 17 17:06:05 2014 +0100 + + sna: Remove invalid assert + + Present and flip fallback may queue self-flips, so the assertion that + the crtc->flip_bo != crtc->bo is false. + + Signed-off-by: Chris Wilson + +commit 0ca25c7b49efa9c83a3ce5b727e5a339a73d8ee0 +Author: Chris Wilson +Date: Tue Jun 17 14:08:06 2014 +0100 + + sna: Cache small pixmaps rather than forcing a large fallback for BLT operations + + Signed-off-by: Chris Wilson + +commit 322e51a3a552d89e5e5ecbb82a9243f134c8d36f +Author: Chris Wilson +Date: Tue Jun 17 13:47:32 2014 +0100 + + sna: Relax PREFER_GPU so that we don't needless create small GPU bo + + Signed-off-by: Chris Wilson + +commit 542aeca6e67fc64f9133ca3e27ac8eca28af6d25 +Author: Chris Wilson +Date: Tue Jun 17 12:26:30 2014 +0100 + + sna: Tweak creation 8x8 tiled patterns + + Avoid reading back from a GTT mmapping. + + Signed-off-by: Chris Wilson + +commit 4ff5cc539bc3f88ab9c05dc67c25aab08cbdf859 +Author: Chris Wilson +Date: Tue Jun 17 10:54:39 2014 +0100 + + sna/dri2: Fixup failure to do a render copy for DRI2CopyRegion + + Signed-off-by: Chris Wilson + +commit 96d1fe314c4bb4d862b057a440e575bd32d63460 +Author: Chris Wilson +Date: Tue Jun 17 08:51:00 2014 +0100 + + sna: Add a few missing checks for all-damaged + + Signed-off-by: Chris Wilson + +commit 30f521c717f7301004e7cb77ba66b840b3f773c6 +Author: Chris Wilson +Date: Tue Jun 17 08:30:55 2014 +0100 + + sna: Discard GPU damage for the magic upload proxy + + The magic upload proxy is initially considered damaged in both the GPU + and CPU. + + Signed-off-by: Chris Wilson + +commit e5b94c2d9b29b78432aa72049934e365a2913710 +Author: Chris Wilson +Date: Tue Jun 17 08:12:42 2014 +0100 + + sna/glyphs: DBG compile fix + + Signed-off-by: Chris Wilson + +commit a4d845bc8f77e4a36064f132720ce462d0bdd5b4 +Author: Chris Wilson +Date: Mon Jun 16 14:25:16 2014 +0100 + + sna: Regularly check the cache level on bo + + Signed-off-by: Chris Wilson + +commit 09f0fe9b3943ae2ba1e0ebd679ea04177427a8cf +Author: Chris Wilson +Date: Mon Jun 16 12:53:34 2014 +0100 + + sna/dri2: Allow single crtc exchanges to be queued up + + Signed-off-by: Chris Wilson + +commit 4ab99d67990d5834061a10b0bd1dd220d4611248 +Author: Chris Wilson +Date: Mon Jun 16 12:51:08 2014 +0100 + + uxa: Allocate frontbuffer to meet old fence constaints + + libdrm is a little lax and does not allocate sufficient space for us to + safely use buffers on old gen. So compute the size we want for + ourselves. + + Reported-by: Cem Aydin + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80088 + Signed-off-by: Chris Wilson + +commit 10cb36e1ddc6f4bf41941b24d6557343aa595a13 +Author: Chris Wilson +Date: Mon Jun 16 10:33:07 2014 +0100 + + sna/glyphs: Add DBG option to force use of the glyph image mask + + Signed-off-by: Chris Wilson + +commit 8f0fc2ed4cc19c90dd2f519080915ca0c54e1baf +Author: Chris Wilson +Date: Mon Jun 16 10:27:16 2014 +0100 + + uxa: Add some explanation to why bo were rejected + + References: https://bugs.freedesktop.org/show_bug.cgi?id=80088 + Signed-off-by: Chris Wilson + +commit 6b82962e58c0959c94f2df1f0ebd9a478b15cb6b +Author: Chris Wilson +Date: Mon Jun 16 10:13:09 2014 +0100 + + sna: Fix logic inversion for final placement in is_gpu_dst() + + Signed-off-by: Chris Wilson + +commit 62102f505cd13840e4c910adbe762b3fb46dfaec +Author: Chris Wilson +Date: Mon Jun 16 09:46:54 2014 +0100 + + sna: Promote better active buffer reuse + + Signed-off-by: Chris Wilson + +commit 2877d018d3510e415f273ce955eb5c272c340e7d +Author: Chris Wilson +Date: Mon Jun 16 09:24:45 2014 +0100 + + sna/glyphs: Show number of glyphs in DBG + + Signed-off-by: Chris Wilson + +commit 38434b29f4a7b324704bbb1e772371be3c0e397b +Author: Chris Wilson +Date: Mon Jun 16 08:03:21 2014 +0100 + + sna: Fix some batch DBG + + Helps to check for a successful read when we want to show the batch + after execution. + + Signed-off-by: Chris Wilson + +commit 243bd26ad31776b2dc45563107e669cf7b45fd91 +Author: Chris Wilson +Date: Sun Jun 15 21:42:10 2014 +0100 + + sna: Clear our private hints about front rendering exported bo + + Unlike GLXWindows, GLXPixmaps are rendered directly into, without a + staging copy. Therefore we must treat those carefully when exported and + clear our hints everytime control passes back to the Client. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79999 + Signed-off-by: Chris Wilson + +commit 500e77d765580e8581c95117b941a4daa940c21e +Author: Chris Wilson +Date: Sun Jun 15 20:55:30 2014 +0100 + + sna: Add more DBG to track transitions between CRTC and its shadow or flip bo + + Signed-off-by: Chris Wilson + +commit 0a6a94630f4fec26bed2aefb25de1a165193ff10 +Author: Chris Wilson +Date: Sun Jun 15 14:04:50 2014 +0100 + + test: Add a simple SHM test skeleton + + Signed-off-by: Chris Wilson + +commit 981aafe797f25aca4977a22f271d387b7fb4ae63 +Author: Chris Wilson +Date: Fri Jun 13 21:41:36 2014 +0100 + + sna: Enable TearFree by default for systems with PSR + + Panel Self-Refresh requires us to avoid frontbuffer rendering in order + to be power efficient. This is a job for TearFree! + + Signed-off-by: Chris Wilson + +commit b27837d5372facde0f9f69eb8df664d2798f0911 +Author: Chris Wilson +Date: Sat Jun 14 06:51:34 2014 +0100 + + sna: Fix assertions for discarding upload caches + + The upload caches are special, along with having a bo->proxy, they also + claim to be completely damaged on both the GPU and CPU. Allow that to + pass through when discarding the proxy. + + Reported-by: Nick Bowler + Bugzilla; https://bugs.freedesktop.org/show_bug.cgi?id=79992 + Signed-off-by: Chris Wilson + +commit 15485602d8451bcf6c2e979ccbd9cdc11111bcce +Author: Chris Wilson +Date: Fri Jun 13 20:30:25 2014 +0100 + + sna: Use the right is-clipped hint + + The region here has yet to be clipped, and so the only valid is-clipped + hint is from the flags computed from the PolyRect extents. Make sure we + use those when determining whether it is valid to discard damage. + + Fixes regression from + commit ad0390068832ad4727371902fe41a85a53de1894 [2.99.903] + Author: Chris Wilson + Date: Tue Sep 24 10:00:03 2013 +0100 + + sna: Separate out copy preferrence from operating in place decision + + Reported-by: Nick Bowler + Tested-by: Nick Bowler + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79992 + Signed-off-by: Chris Wilson + +commit b082a07a69ba5490fba47766c4f608b1cdf2427e +Author: Chris Wilson +Date: Fri Jun 13 18:56:57 2014 +0100 + + sna: Only discard the CPU bo if we have a GPU bo to transfer the damage to + + References: https://bugs.freedesktop.org/show_bug.cgi?id=79992 + Signed-off-by: Chris Wilson + +commit 05fdfe3b2813495ea122471ed6dde340e538aa65 +Author: Chris Wilson +Date: Fri Jun 13 21:41:16 2014 +0100 + + intel-virtual-output: Compile fixes + + Signed-off-by: Chris Wilson + +commit 8a92261b22a8c134a48d1491627ac05136563603 +Author: Chris Wilson +Date: Fri Jun 13 19:59:16 2014 +0100 + + intel-virtual-output: Disable outputs on remote displays upon shutdown + + References: https://bugs.freedesktop.org/show_bug.cgi?id=79994 + Signed-off-by: Chris Wilson + +commit 0c6fa0cdf0cebcd592281e578da7a7f53cbfe186 +Author: Chris Wilson +Date: Fri Jun 13 19:29:41 2014 +0100 + + intel-virtual-output: Initialise image after clone + + As the image inherits its width/height from the clone, we need to set + those first on the clone. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79994 + Signed-off-by: Chris Wilson + +commit 79b4e45ebe3a61f9b5937ad226eead9eebce87ac +Author: Chris Wilson +Date: Fri Jun 13 19:15:08 2014 +0100 + + intel-virtual-output: Only call XShmDetach on a valid SHM segment + + Saves a couple of extraneous XErrors. + + Signed-off-by: Chris Wilson + +commit c8074b6bcfa8c208433574721135faa4d919d32a +Author: Chris Wilson +Date: Fri Jun 13 18:37:15 2014 +0100 + + intel-virtual-output: Check for an error creating the DRI3 fd + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79994 + Signed-off-by: Chris Wilson + +commit 0a0b9dc3538ef731463fb321852b8802cd04e457 +Author: Chris Wilson +Date: Fri Jun 13 16:14:43 2014 +0100 + + sna: Refine decision whether to use the GPU or render inplace + + Signed-off-by: Chris Wilson + +commit dd87aa8f85c4bafa105fd881a0cce45bda6143df +Author: Chris Wilson +Date: Fri Jun 13 15:06:13 2014 +0100 + + sna: Track the pageflip bo's busyness + + Signed-off-by: Chris Wilson + +commit 8322e3e5c6ed19e029f365d869c80388863c424d +Author: Chris Wilson +Date: Fri Jun 13 13:50:34 2014 +0100 + + intel: Check that the fd points to i915 after authorising + + The call to GETPARAM requires either a rendernode or authorisation. + Therefore we can only assert that the fd is a valid i915 handle after + authorise() and not before. + + Reported-by: Hans de Goede + Signed-off-by: Chris Wilson + +commit 97003b1a2d6c8beb5c4df4bece5a2d5b03b5ae2f +Author: Chris Wilson +Date: Fri Jun 13 12:32:12 2014 +0100 + + sna/gen6+: Prefer the BLT for large overlapping copies + + Signed-off-by: Chris Wilson + +commit 87fc78ac4f6bbfa8e9427d392356ee26942bf955 +Author: Chris Wilson +Date: Fri Jun 13 10:52:47 2014 +0100 + + sna: Try to reuse the current cursor if we fail to update + + As a last resort, continue to display the old cursor if we tried and + failed to create a new cursor. + + Signed-off-by: Chris Wilson + +commit cd381ad96eadb72eb1a983c973a5dd47f547fc8b +Author: Chris Wilson +Date: Fri Jun 13 09:31:50 2014 +0100 + + xvmc: Refactor mutex locking + + Signed-off-by: Chris Wilson + +commit bccfb768ee14348b6db5b140fdd6df5fdbfcad0c +Author: Chris Wilson +Date: Fri Jun 13 09:14:47 2014 +0100 + + xvmc: Sanitize compile and library flags + + Signed-off-by: Chris Wilson + +commit 5a0cb1049c2fa0586708719210a2d2cffa7a4491 +Author: Chris Wilson +Date: Fri Jun 13 09:15:30 2014 +0100 + + configure: Fix DRI2 build + + One s/DRI2/have_dri2/ too far. + + Signed-off-by: Chris Wilson + +commit d47a01fce4d3d9c043a45fc034dc436c0af41981 +Author: Chris Wilson +Date: Fri Jun 13 08:51:20 2014 +0100 + + sna: Reorder ignore_cpu_damage() to avoid asserts + + Tricksy asserts making sure that the correct arguments are passed + around! + + Reported-by: Arkadiusz Miskiewicz + +commit c4d4bd5d92c7e53a7be6fa7fe119e4507af213ec +Author: Chris Wilson +Date: Fri Jun 13 08:32:34 2014 +0100 + + sna/gen8: Allow reads from scanout to be cached + + Signed-off-by: Chris Wilson + +commit 8e743ccef8f19b1226ceb8d6a5ceab65584a620d +Author: Chris Wilson +Date: Fri Jun 13 08:27:05 2014 +0100 + + sna/gen8: Check for WT support before attempting to use the WT mocs + + It appears the kernel has a better idea when WT is supported on which + gen8 parts. I assumed it was always supported, but experience suggests + otherwise, so only use WT support when advertised. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79967 + Signed-off-by: Chris Wilson + +commit 7bc669dd4b7e3e5978e95e4131d1f9215afbc041 +Author: Chris Wilson +Date: Fri Jun 13 07:48:15 2014 +0100 + + configure: Allow manual disabling of each DRI level + + Signed-off-by: Chris Wilson + +commit ffe067705b524930d243b18e97508219ed26390c +Author: Chris Wilson +Date: Thu Jun 12 09:52:50 2014 +0100 + + sna: Try to use CPU uploads before BLT uploads + + As the BLT upload implies a sync (and a likely GPU boost), only do so if + we cannot do an immediate upload with the CPU, either directly to + backing memory or through the GTT. + + Signed-off-by: Chris Wilson + +commit 93444ea673be0ac11092a13ab3354f886f4aad63 +Author: Chris Wilson +Date: Thu Jun 12 09:26:14 2014 +0100 + + sna: Refactor USE_INPLACE debug macro + + Signed-off-by: Chris Wilson + +commit abbf6d6b7962650607dc3517939991de56ce8a91 +Author: Chris Wilson +Date: Wed Jun 11 21:14:00 2014 +0100 + + sna/gen8: Clear a couple more push constants + + Signed-off-by: Chris Wilson + +commit 7f9b015d87300810712a0b6f2680249fb0576f90 +Author: Chris Wilson +Date: Wed Jun 11 19:10:22 2014 +0100 + + sna: Remove bogus assertion + + The sna_pixmap is cleared afterwards, it does not need to be clear on + free. + + Signed-off-by: Chris Wilson + +commit e3a0e40310b6c46b2f887bc0d75b11cc06ec8fa0 +Author: Chris Wilson +Date: Wed Jun 11 18:07:46 2014 +0100 + + sna: Fix direction flags for memmove + + Under a compositor, the current deltas may invert the sense of the copy + direction, causing scrolling corruption. Simplify handling those flags + by making them invariant for the function. + + Reported-by: Bruno Prémont + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79843 + Signed-off-by: Chris Wilson + +commit 55660376d555131348e7efaaec66d6d27ffc1e6e +Author: Chris Wilson +Date: Wed Jun 11 17:43:33 2014 +0100 + + sna: Use the pixmap header creation routine + + A few more places could use the common pixmap creator, just remember to + handle the SHMPixmap complication! + + Signed-off-by: Chris Wilson + +commit 1beaa980ea6a9617f7dd4dc87b881c37cc7a277b +Author: Chris Wilson +Date: Wed Jun 11 16:41:22 2014 +0100 + + sna/gen6+: On small GT avoid the intermediate copy for overlaps + + If the memory bw is constrained on the GPU avoid doing the 2-pass copy + for overlaps on the render ring, and do the single pass slower BLT copy + instead - as since it has to transfer less data it will be faster. + + Reported-by: Ildar Nurislamov + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit 31467b01e3f5ece0c8f8d4c03b52fc3f238b3d7e +Author: Chris Wilson +Date: Wed Jun 11 16:21:13 2014 +0100 + + sna/gen6+: Overlapping bo by definition have compatible depths + + Signed-off-by: Chris Wilson + +commit 0dfe7d93de893b3ead6c3be662b3a17d9335c2ca +Author: Chris Wilson +Date: Wed Jun 11 16:12:26 2014 +0100 + + sna: First copy to overlap temporary must be using GXcopy + + Signed-off-by: Chris Wilson + +commit ad076b394028c40fc6cb88c64b72e46702a936b3 +Author: Chris Wilson +Date: Wed Jun 11 15:49:43 2014 +0100 + + sna: Remove debugging hunk + + Stray hunk in self-copy boxes. + + Signed-off-by: Chris Wilson + +commit a90160dcecf0a3df21a04b4f467e660f69ddae54 +Author: Chris Wilson +Date: Wed Jun 11 15:40:25 2014 +0100 + + sna: Update damage pointer after the implicit reduction + + sna_damage_contains_box() routine implicitly reduces the damage before + performing its check. This may alter and even destroy the damage entry, + so pass in the handle so that it can be updated correctly. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit c9003c6d9602dba682e577ea7ce39990ea378db3 +Author: Chris Wilson +Date: Wed Jun 11 15:29:59 2014 +0100 + + sna: Fix scanout creation routine for old kernels <= 3.11 + + With an old kernel, we would fail to actually mark the display as part + of the scanout domain, but proceed to assign it a fb id. This caused our + asserts to report our bookkeeping error. + + Reported-by: Pavel Ondračka + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79909 + Signed-off-by: Chris Wilson + +commit 5705e66a329273c478f6ecd8f41b8f5633095581 +Author: Chris Wilson +Date: Wed Jun 11 14:34:33 2014 +0100 + + sna: Add some DBG to the memmove path + + Signed-off-by: Chris Wilson + +commit b41a51e0f54c983ef72bc31125419382d666d48c +Author: Chris Wilson +Date: Wed Jun 11 14:22:26 2014 +0100 + + sna: Tweak self-copy boxes to hit the GPU more often + + Signed-off-by: Chris Wilson + +commit b879de6246d3f2e66e9c7e326db93e5ff390159f +Author: Chris Wilson +Date: Wed Jun 11 14:08:31 2014 +0100 + + sna: Recheck source bo after migrating dst (in case of src == dst) + + Signed-off-by: Chris Wilson + +commit 21c150a873a77f983fad29b4517844a0b92e0609 +Author: Chris Wilson +Date: Wed Jun 11 14:00:04 2014 +0100 + + sna: Skip redundant clears + + Signed-off-by: Chris Wilson + +commit e1a4438f074f9cd5eba946cc1172c419c31b03c9 +Author: Chris Wilson +Date: Wed Jun 11 13:59:46 2014 +0100 + + sna/glyphs: Always print some DBG when performing fallback + + Signed-off-by: Chris Wilson + +commit 040eccb9b10d0941c7d81fc9c66c259563370f2a +Author: Chris Wilson +Date: Wed Jun 11 13:18:33 2014 +0100 + + sna: Add some asserts to track redundant damage operations + + Signed-off-by: Chris Wilson + +commit 4fccfe3a516ab8383dfd99ccd7fe1840c88bbc01 +Author: Chris Wilson +Date: Fri Jun 6 08:30:59 2014 +0100 + + sna/gen8: Check offset alignment before using a userptr for RENDER + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79053 + Signed-off-by: Chris Wilson + +commit 1217dbc88e0901e4a657ee51e2e3b7d00bb72b77 +Author: Chris Wilson +Date: Thu Apr 17 21:04:15 2014 +0100 + + sna: Support efficient cursor updates for old machines + + Given a kernel patch to fix coherency of physical objects, we can use a + more efficient method for updating cursors. + + Signed-off-by: Chris Wilson + +commit ee7d2e0a8ef882c1d4e0e77a0148b54dcfbf4236 +Author: Chris Wilson +Date: Fri Jun 6 12:00:35 2014 +0100 + + sna: MST topologies may change on any hotplug event + + As the kernel does not send out an explicit DISCOVER event, we have to + reinspect every connector after every hotplug event to detect topology + changes. + + Signed-off-by: Chris Wilson + +commit 782c920b01d5144125f2fe954e29fd7b07a1913e +Author: Chris Wilson +Date: Thu May 8 08:04:58 2014 +0100 + + sna: Create a stable output name based on MST topology + + In order to provide persistent names for MST devices, which may change + topology dynamically, the kernel exports a PATH blob. We can then use + this path to generate the output name, and so reuse existing XID when a + monitor is plugged back in. + + Based on the patch for -modesetting by Dave Airlie. + Signed-off-by: Chris Wilson + +commit e680e54eab6ffa72e5e1eb6cc0e3fe4b235b06a1 +Author: Chris Wilson +Date: Wed Jun 11 10:48:26 2014 +0100 + + sna: Ignore setting read-only for temporary userptr maps + + Signed-off-by: Chris Wilson + +commit d9bf6f3fecb3d691937da086a5270334c6c0e69a +Author: Chris Wilson +Date: Wed Jun 11 10:35:50 2014 +0100 + + sna: Prefer to operate inplace on the GPU rather than stall on the CPU + + Signed-off-by: Chris Wilson + +commit 277e6ab84bb0c692358a34a76e7962c64efb0362 +Author: Chris Wilson +Date: Wed Jun 11 10:12:01 2014 +0100 + + sna: Discard TearFree damage before checking for an overwriting upload + + Signed-off-by: Chris Wilson + +commit eb9de37daaea45e917fa7f44444a9782070f7333 +Author: Chris Wilson +Date: Wed Jun 11 09:29:50 2014 +0100 + + sna: Silence compiler warnings for discarding const Region points + + Signed-off-by: Chris Wilson + +commit 085141348cfe8386059062a58172855f72d5e5b6 +Author: Chris Wilson +Date: Wed Jun 11 08:39:42 2014 +0100 + + sna: Squelch log messages for fb/pixmap tiling in the default case + + The output is confusing, so hide it unless it is modified by the user. + + Signed-off-by: Chris Wilson + +commit 53c1faa5093f8a0c969e3ebe9f27ee1ce5137e14 +Author: Chris Wilson +Date: Wed Jun 11 07:59:41 2014 +0100 + + sna: Mark the GPU as all damaged when discarding CPU bo during uploads + + Signed-off-by: Chris Wilson + +commit e2bfa715a9e115921263d572b9f4c496b550a494 +Author: Chris Wilson +Date: Tue Jun 10 21:28:32 2014 +0100 + + sna/dri2: Check that the window covers the whole CRTC before xchg + + Fixes TearFre regression from + + commit 3932e97057fca16615adaefbc1eb25a0d51a1d8b [2.99.912] + Author: Chris Wilson + Date: Mon Jun 9 08:58:15 2014 +0100 + + sna/dri2: Allow TearFree flipping to individual CRTC + + Signed-off-by: Chris Wilson + +commit d0f32a9d3afed4ea45644723fa1134957b981125 +Author: Chris Wilson +Date: Tue Jun 10 16:37:24 2014 +0100 + + sna: Cast away compiler warning + + sna_display.c: In function 'has_user_backlight_override': + sna_display.c:595:3: warning: return discards 'const' qualifier from pointer target type [enabled by default] + + Signed-off-by: Chris Wilson + +commit 216beed6dfcb3a8d6b0b480d0281fcadb0cd3036 +Author: Chris Wilson +Date: Tue Jun 10 09:09:30 2014 +0100 + + sna: Expand debugging to cover gen8 BLT variations + + Signed-off-by: Chris Wilson + +commit f19195f7ea317f5601543724c725c4b63fdc3f60 +Author: Chris Wilson +Date: Tue Jun 10 14:25:42 2014 +0100 + + sna: Fix arguments when flipping transformed TearFree outputs + + Signed-off-by: Chris Wilson + +commit c16b2a125929c9027b62c07d47e9602553153eef +Author: Chris Wilson +Date: Tue Jun 10 13:25:57 2014 +0100 + + sna: Tidy a few asserts on the state of crtc->flip_bo + + Signed-off-by: Chris Wilson + +commit fd6aaec33d8ad70544cc02e061c9c5e68cf83414 +Author: Chris Wilson +Date: Tue Jun 10 11:01:38 2014 +0100 + + sna: Handle the user passing "Backlight" "" + + Allow the user to disable the backlight control by passing the empty + string in the xorg.conf. + + Signed-off-by: Chris Wilson + +commit cb7b27a705b477ae1b369786eea13fb14506d54a +Author: Chris Wilson +Date: Mon Jun 2 09:36:13 2014 +0100 + + 2.99.912 snapshot + +commit 52e2aa0939eee3566e4d6ee3a34f8acd93570530 +Author: Chris Wilson +Date: Tue Jun 10 08:49:41 2014 +0100 + + sna: Queue a flip after fixing up a failed flip + + After a flip fails, we try to update the CRTC manually to new fb. + However, the caller is still expecting to receive an event though the + drm device to notify when the flips are complete. In order to maintain + that ABI, we need to queue another flip after the fixup (to the + currently bound fb). + + Signed-off-by: Chris Wilson + +commit 68ac3039e4170b318952213311534cd213cbaff7 +Author: Chris Wilson +Date: Mon Jun 9 22:01:05 2014 +0100 + + sna: Fix the typo in the last commit + + Rewording the sentence and reordering the arguments was a mistake! + + Signed-off-by: Chris Wilson + +commit fdb8f490441b0ba91fdf530b982cedc2f2acf122 +Author: Chris Wilson +Date: Mon Jun 9 21:46:37 2014 +0100 + + sna: Add an extra error message before disabling a CRTC + + One of the error paths to disable a pipe was lacking a log message. + + Signed-off-by: Chris Wilson + +commit c1154ae1070806b8da1aad29f75c9659f2a403df +Author: Chris Wilson +Date: Mon Jun 9 17:04:47 2014 +0100 + + configure: Allow disabling control over the backlight + + Some OS prefer to control the backlight themselves through another + daemon and so do not want X interfering. + + Signed-off-by: Chris Wilson + +commit bb2d5e3696b52835770a62a951f7ed7e51291f88 +Author: Chris Wilson +Date: Mon Jun 9 16:30:15 2014 +0100 + + sna: Defer the copy back from the shadow CRTC bo until we allocate the target + + Signed-off-by: Chris Wilson + +commit b00a60b41736c399f849217626f246e6e7d1f7eb +Author: Chris Wilson +Date: Mon Jun 9 15:03:23 2014 +0100 + + sna: Fix cut'n'paste DBG error + + Signed-off-by: Chris Wilson + +commit 8901a99afb7be4f6f377a8e84e62e5d768c8443d +Author: Chris Wilson +Date: Mon Jun 9 14:56:02 2014 +0100 + + sna/dri2: Avoid trying to flip between bo with different pitches + + It could happen that we create front/back buffers with different + pitches. The kernel refuses to flip between such buffers, and so we will + hit some fallback paths that try to fix up the failed flips. Circumvent + such by avoiding the flip. + + Signed-off-by: Chris Wilson + +commit 16574754a99c4472c1c90c426d9c1665a898f1d6 +Author: Chris Wilson +Date: Mon Jun 9 14:54:26 2014 +0100 + + sna: Fixup normal flips between different pitches + + Apply the manual CRTC fixup in case pageflipping fails. This can happen + if the pitches between the front and back differ for example. + + Signed-off-by: Chris Wilson + +commit 3932e97057fca16615adaefbc1eb25a0d51a1d8b +Author: Chris Wilson +Date: Mon Jun 9 08:58:15 2014 +0100 + + sna/dri2: Allow TearFree flipping to individual CRTC + + Baby step. We first take advantage of TearFree to allow us to redirect a + single CRTC to the DRI2 frontbuffer and so allow a fullscreen game + covering a single monitor to avoid expensive blits when running in a + multi-monitor setup. + + Signed-off-by: Chris Wilson + +commit af3130cbba8375b9060a3a8cef5b03189d01c419 +Author: Chris Wilson +Date: Mon Jun 9 13:13:25 2014 +0100 + + sna: Do not rely on udev_monitor_receive_device() being non-blocking + + The libudev documentation says that is it non-blocking by default, but + experience shows otherwise. + + Reported-by: Sedat Dilek + Signed-off-by: Chris Wilson + +commit 981af18190be772b469761bc124b9f46c19d5093 +Author: Chris Wilson +Date: Sun Jun 8 16:55:07 2014 +0100 + + uxa: Do not FreePixmap(screen->devPrivate) + + Prevent the crash caused by + + commit 444a1f7a8802999e27ecf5f6eb598df2206f7277 + Author: Brendan King + Date: Thu Apr 24 11:37:45 2014 +0100 + + fb: fix screen pixmap leak on server reset + + Call FreePixmap() instead of free() to destroy the screen pixmap in + fbCloseScreen(). + + Signed-off-by: Frank Binns + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + + Signed-off-by: Chris Wilson + +commit 86f2cae45048158154eb2b1dbb181c3e1d6a8bf7 +Author: Chris Wilson +Date: Sun Jun 8 15:18:34 2014 +0100 + + sna/dri2: DBG compile fix + + Typo in DBG message. + + Signed-off-by: Chris Wilson + +commit 6153141fa6e1328a007efe6862ff2d7b4adaaf83 +Author: Chris Wilson +Date: Sun Jun 8 14:48:20 2014 +0100 + + sna/dri2: Allow xchg to replace the frontbuffer when all outputs are off + + Signed-off-by: Chris Wilson + +commit 9306a148cbf1a2471540f3301136d57e93197593 +Author: Chris Wilson +Date: Sun Jun 8 09:40:19 2014 +0100 + + sna/dri2: Use xchg for offscreen drawables where applicable + + Signed-off-by: Chris Wilson + +commit 22cd7c873edd0b641e54e81d643ec6b0ea921f88 +Author: Chris Wilson +Date: Sun Jun 8 08:46:27 2014 +0100 + + sna/dri2: Explicitly drain the pending event queue before swapping + + As there may be some latency between the wakeup and the queue, do a + final check if there is a pending vblank event before we decide whether + to chain up or perform an immediate flip. + + Signed-off-by: Chris Wilson + +commit 258e0cda1d69f74736d0e0be014996173e275543 +Author: Chris Wilson +Date: Sun Jun 8 08:21:38 2014 +0100 + + sna/dri2: Mark frames under construction + + As we may recurse into the vblank handler whilst waiting for the + TearFree shadow, we need to be careful that we do not queue the frame + from the vblank handler that we are in the process of constructing. + + Signed-off-by: Chris Wilson + +commit eb8f3a9b345c75023b49512c2db57527d906db7f +Author: Chris Wilson +Date: Sun Jun 8 07:45:52 2014 +0100 + + sna/dri2: Check the xchg against the Pixmap size + + As the Window may be resized between the client sending the swap request + and the xchg being processed, we need to validate the swap against the + final target not the buffers supplied originally by the client. + + Signed-off-by: Chris Wilson + +commit fc64ba821749ed0a0197a69d9bae81957aceb55f +Author: Chris Wilson +Date: Sat Jun 7 23:27:49 2014 +0100 + + sna: Restore backlight when switching to VT + + fbcon doesn't adjust the backlight when it takes over. Therefore if X + performs a VT switch whilst its outputs are off, fbcon wakes up with no + backlight and users are unhappy. Make the assumption that whoever takes + over the VT will set the outputs as it desires, and that the failsafe + value is to then turn the backlight to full. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67025 + Signed-off-by: Chris Wilson + +commit ecd80a3a997b11307445c50621d4e86e241a5b22 +Author: Chris Wilson +Date: Sat Jun 7 14:57:10 2014 +0100 + + sna: Fix reporting of TearFree + + The switch was moved after we checked whether pageflips are supported, + but the log message was left in the old location. + + Signed-off-by: Chris Wilson + +commit 035be60f332e4729fb90261605ef6c06a9d9c903 +Author: Chris Wilson +Date: Sat Jun 7 13:26:12 2014 +0100 + + sna: Release CRTC on VT switch + + In order to free up memory and improve our bookkeeping when the X server + is switched away from the current VT, disable the CRTC. + + Signed-off-by: Chris Wilson + +commit 717e00facd27696c6b8a1a6c343b2f94bfa2b59b +Author: Chris Wilson +Date: Sat Jun 7 09:07:16 2014 +0100 + + sna: Allow TearFree to be enabled by default via configure + + Signed-off-by: Chris Wilson + +commit dcb64b55092ea3da6adf357305d65b58d848db7b +Author: Chris Wilson +Date: Sat Jun 7 08:30:38 2014 +0100 + + sna: Fix TearFree for non-compositors + + The tearfree code forgot to update the shadow bo, so after the first + flip it would be rendering to the scanout anyway and flip to itself + periodically. + + Signed-off-by: Chris Wilson + +commit c65fab07402a338f015c2b339e996beca783c2bf +Author: Chris Wilson +Date: Fri Jun 6 22:07:44 2014 +0100 + + sna: Fix no relaxed delta path for gen4+ + + This is for debug purposes only. + + Signed-off-by: Chris Wilson + +commit a378196fddcf3043257a7e56225060e5e36cfa7b +Author: Chris Wilson +Date: Fri Jun 6 16:58:45 2014 +0100 + + sna: Auto-retire upload proxies + + This was disabled in + + commit 9f4f855ba37966fb91d31e9081d03cf72affb154 + Author: Chris Wilson + Date: Mon May 26 07:06:18 2014 +0100 + + sna: Implicit release of upload buffers considered bad + + as retiring the buffers during the command setup could free one of the + earlier bo used in the command. But discarding the snooped bo could + still be advantageous. So restore the automatic discard of upload + proxies, but make sure we only do between operations. + + Signed-off-by: Chris Wilson + Cc: Matti Hämäläinen + +commit 23840bd329cf4da3a4bdd5a1a466125a95473534 +Author: Chris Wilson +Date: Fri Jun 6 16:10:29 2014 +0100 + + sna: Only allow the inplace copy to replace a complete overwritten GPU bo + + And double check after recreating the new GPU bo that is still mappable. + + Signed-off-by: Chris Wilson + +commit 283ff8cbe4137f46cc027dd6aadc69d0270cb33d +Author: Chris Wilson +Date: Fri Jun 6 15:04:25 2014 +0100 + + sna: Rearrange scanout_flush checking to avoid potential crash + + With a shadow, we may never attach a GPU bo to the frontbuffer, so be + careful when checking the scanout not to dereference that NULL pointer. + + Signed-off-by: Chris Wilson + +commit 694ff54aca16ccf39e94d505942eb857b3101d7d +Author: Chris Wilson +Date: Fri Jun 6 13:34:18 2014 +0100 + + sna: Report KMS driver version + + Signed-off-by: Chris Wilson + +commit 0ebcef4f2ebe82e9b90589aa4266a9228e2b5fdb +Author: Chris Wilson +Date: Fri Jun 6 11:39:57 2014 +0100 + + man: Update notes about TearFree + + Signed-off-by: Chris Wilson + +commit 1f943a7d92d0e3a8895ba7d539cfc5e726bcc8b7 +Author: Chris Wilson +Date: Fri Jun 6 11:25:47 2014 +0100 + + sna/dri2: Restore flush on front buffers after swapping bo + + Fallout from commit 8369166349c92a20d9a2e7d0256e63f66fe2682b + Author: Chris Wilson + Date: Wed Jun 4 08:29:51 2014 +0100 + + sna/dri2: Enable immediate buffer exchanges + + We set the flush hint too early, as we may need to swap the GPU bo for a + more appropriate buffer for DRI. + + Signed-off-by: Chris Wilson + +commit c6cd10f536e099277cdc46643725a5a50ea8b525 +Author: Chris Wilson +Date: Thu Jun 5 22:43:37 2014 +0100 + + sna: Hook up a backlight udev monitor for external changes + + Changes to the backlights are notified through uevents. Hooking up a + udev monitor to listen out for external changes to the backlight (e.g. + through ACPI function keys, or by the user writing to + /sys/class/backlight directly) is easier than enabling polling on the + backlight sysfs file using X's select() mechanism. + + Since we listen to backlight changes, we have to be careful not to + confuse the side-effects of disabling connectors (which may cause either + ourselves or the kernel to turn off the backlight) with the user value. + + Many thanks to Alexander Mezin for the suggestion to use udev for + tracking the notifications for external changes to the backlight. + + Reported-by: Alexander Mezin + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79699 + Signed-off-by: Chris Wilson + +commit b545e10c50cbb2dd6f9fd53369667bed0d8f1b51 +Author: Chris Wilson +Date: Thu Jun 5 15:54:32 2014 +0100 + + sna: When the output is off, report the cached backlight value + + Signed-off-by: Chris Wilson + +commit f0b8720807d9c1994e6db91a607efe4711b0d1ca +Author: Chris Wilson +Date: Thu Jun 5 15:31:54 2014 +0100 + + sna: Inline calls to save/restore backlight around output DPMS + + The intertwined logic was a little confusing to read mixed between the + functions, so inline it. + + Signed-off-by: Chris Wilson + +commit 9f7775158341c8384da870e06cab200deddf48c1 +Author: Chris Wilson +Date: Thu Jun 5 15:31:27 2014 +0100 + + sna: Set initial output DPMS state from kernel + + Signed-off-by: Chris Wilson + +commit 9e02fe269dc79ff867d1d2cb3a8673ee2861bd56 +Author: Chris Wilson +Date: Thu Jun 5 15:49:03 2014 +0100 + + sna: Make sure we recompute the vblank interval after reconfiguring the CRTC + + Signed-off-by: Chris Wilson + +commit 51909f37ed6405c38f1c46a4012952be79031994 +Author: Chris Wilson +Date: Thu Jun 5 14:54:55 2014 +0100 + + sna: Skip marking the CRTC as damaged for TearFree + + As we have reorder the application of damage on a TearFree frontbuffer + to before we attach the CRTC, we do not need to then schedule the update + afterwards (until it gets drawn by the client). + + Signed-off-by: Chris Wilson + +commit c7efe88a895a692e5f840562a09dac385508db57 +Author: Chris Wilson +Date: Thu Jun 5 14:50:04 2014 +0100 + + sna: Fix DBG compilation + + Update the DBG to reflect the new arguments to sna_damage_reduce_all() + + Signed-off-by: Chris Wilson + +commit 9566fc0ccc71bc4fcd6bf83b567a41cc5366f5ee +Author: Chris Wilson +Date: Thu Jun 5 12:26:23 2014 +0100 + + sna: Curry parameters to sna_damage_all() + + It is far easily to pass the PixmapPtr into the function and have it + pluck out the width and height than do so in all callers. + + Signed-off-by: Chris Wilson + +commit 1327918f91dce2051b809594db5a3ed555934612 +Author: Chris Wilson +Date: Thu Jun 5 12:04:29 2014 +0100 + + sna: Mark CPU as all damaged when discarding a busy GPU bo + + When we discard a GPU bo, we need to make sure that the remaining + content is marked as only accessible via the CPU shadow pointer. + + Regression from commit 65301412ecf2d55ab55a2d7faeaa048d4ee8b1d0 + Author: Chris Wilson + Date: Sat May 17 20:59:38 2014 +0100 + + sna: Discard active GPU buffers before uploading into them + + Reported-by: Jan Alexander Steffens + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79517 + Signed-off-by: Chris Wilson + +commit 8369166349c92a20d9a2e7d0256e63f66fe2682b +Author: Chris Wilson +Date: Wed Jun 4 08:29:51 2014 +0100 + + sna/dri2: Enable immediate buffer exchanges + + The primary benefit of this is avoid the extra blit when using a + compositor and instead propagate the compositor flip on the frontbuffer + to the scanout, or equivalently allows a fullscreen game to flip onto + the scanout without intervention by TearFree. + + Signed-off-by: Chris Wilson + +commit 08148896196443a8582c30b47ff546acca78d69c +Author: Chris Wilson +Date: Tue Jun 3 15:48:55 2014 +0100 + + configure: XORG_DRIVER_CHECK_EXT does not create CFLAGS/LIBS variables + + XORG_DRIVER_CHECK_EXT only adds the package name to the list of + REQUIRED_MODULES (which is later passed to pkg-config). For our optional + dependencies, we must do a later call to pkg-config to verify the + package is available and then remember to include the includes with the + CFLAGS. + + Signed-off-by: Chris Wilson + +commit 0c81041e9b42f9df0c86c88c8648dd20ed26d0ab +Author: Chris Wilson +Date: Tue Jun 3 15:39:50 2014 +0100 + + configure: Remove xf86driproto from REQUIRED_MODULES + + We only depend upon the original DRI1 infrastructure when building i810 + with DRI support. So unless that is true, do not throw an error if the + legacy protocol is absent. + + Signed-off-by: Chris Wilson + +commit 689ee76a14da7e5f98997ac427f457af840dea3f +Author: Adam Jackson +Date: Tue Jun 3 10:26:46 2014 -0400 + + configure: Don't link the driver against libX11 + + 78dc0c04745ad4485b994f67833f4a155749f01d added REQUIRED_MODULES to the + driver link line for... some reason. That pulled in the libs from the + XF86DRI check, which near as I can tell has always been wrong, all of + the other extension checks just look for the protocol module and + xextproto doesn't define dri1 protocol in any case. + + Signed-off-by: Adam Jackson + +commit 8297c969ae749ef58d259b2ded2231b928efba43 +Author: Chris Wilson +Date: Tue Jun 3 09:47:27 2014 +0100 + + sna: Replace the bo for tiled uploads if not suitable and being replaced + + Signed-off-by: Chris Wilson + +commit 1c55d0447dba5bbde5be3903b273e04e3c9d084f +Author: Chris Wilson +Date: Tue Jun 3 12:43:51 2014 +0100 + + sna: Allow replacements to cancel operations between both bo under a Pixmap + + Signed-off-by: Chris Wilson + +commit a82bfb033448eb61bf8cc7f5358be019f0cc28e6 +Author: Chris Wilson +Date: Tue Jun 3 09:28:24 2014 +0100 + + sna: Discard unwanted damage when promoting to a full CPU migration + + Signed-off-by: Chris Wilson + +commit 4cafd1fbb1a2441a9ba5dac7f2a0e1b3f5957c62 +Author: Chris Wilson +Date: Mon Jun 2 16:01:10 2014 +0100 + + sna: Fix early return in download using the GPU + + In commit 961139f5878572ebea268a0bbf47caf05af9093f + Author: Chris Wilson + Date: Fri May 30 09:45:15 2014 +0100 + + sna: Use manual detiling for downloads + + the code for deciding when to use the GPU was refactored into a new + function that also performed the transfer, but failed to notice the + early return. + + Signed-off-by: Chris Wilson + +commit d6a412812c19fe4698752d2589ead4965048b107 +Author: Chris Wilson +Date: Mon Jun 2 10:32:11 2014 +0100 + + sna: Use CPU mmappings for linear uploads + + The other half of the commit that accidentally got included with + + commit bb49222a514b1d6041f3d9530a22f5701377118b + Author: Chris Wilson + Date: Mon Jun 2 08:25:52 2014 +0100 + + sna: Add DBG hints for using inplace CPU mmappings + + Signed-off-by: Chris Wilson + +commit 454367f5945dd17a7cfc566b1986654fc976cabe +Author: Chris Wilson +Date: Mon Jun 2 09:25:01 2014 +0100 + + Only enable the new Cursor API for the next pre-release of Xorg + + Make sure we can compile against the pre-release tarballs at the expense + of an innocuous compile warning if compiled against xserver.git + + Signed-off-by: Chris Wilson + +commit ff36e1f7546e0ac4d6e831e5cf8d1317792ed7af +Author: Keith Packard +Date: Tue Nov 19 15:20:44 2013 -0800 + + uxa: Add Present extension support + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + + Conflicts: + configure.ac + src/uxa/intel.h + src/uxa/intel_driver.c + +commit 14ff08c2827d36f7f08256dc57b84aaf80d17ab4 +Author: Keith Packard +Date: Tue Nov 19 23:20:38 2013 -0800 + + uxa: Restructure DRM event handling. + + This refactors the drm interrupt handling logic quite a bit, both to + allow for either DRI2 or Present handlers, but also to eliminate + passing pointers through the kernel. Passing pointers left the kernel + holding the only reference to some internal X server data structures. + + After a server reset, the X server would end up using stale pointers + stored in those structures. Using simple integers makes it possible to + empty the queue of pending interrupt data and then ignore the stale + kernel data. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + +commit 7f28b1cfa20eb4fc11c1a9c1e0c0fac7847be72e +Author: Keith Packard +Date: Tue Nov 19 22:58:33 2013 -0800 + + uxa: Support 64-bit MSC values. Handle kernel vageries about MSC reporting + + The kernel sometimes reports bogus MSC values, especially when + suspending and resuming the machine. Deal with this by tracking an + offset to ensure that the MSC seen by applications increases + monotonically, and at a reasonable pace. + + Also, provide a full 64 bits of MSC value by noticing wrapping and + tracking the high 32-bits of MSC separately. + + Signed-off-by: Keith Packard + Reviewed-by: Eric Anholt + + Conflicts: + src/uxa/intel_dri.c + +commit dd6db82680b05cde4a47116b7096c054f3837e20 +Author: Chris Wilson +Date: Fri May 9 20:26:19 2014 +0100 + + uxa: Add DRI3 and miSyncShm support + + Based on a patch by Keith Packard. + + Signed-off-by: Chris Wilson + +commit 975b9798be77b30cbed485583d0ccb48318708f7 +Author: Chris Wilson +Date: Wed May 21 08:58:24 2014 +0100 + + sna: Add support for Present + + Signed-off-by: Chris Wilson + +commit d8eb87f84f88ad2df42c6fed1d93df76589a14e3 +Author: Chris Wilson +Date: Thu May 8 16:25:32 2014 +0100 + + sna: Add support for DRI3 + + Signed-off-by: Chris Wilson + +commit 0fbe8995d51b4643f1cf06c07da8b4b5ac5ae7c3 +Author: Chris Wilson +Date: Thu May 22 11:17:35 2014 +0100 + + sna: Relax tiling height restrictions + + Only force the even-tile-row alignment if we have an old GPU with an old + kernel that doesn't perform conservative alignment for us (as required). + + Signed-off-by: Chris Wilson + +commit 67b37332bd45dd4cea297107bfdc9df21984fdcd +Author: Chris Wilson +Date: Tue May 20 15:37:13 2014 +0100 + + intel-virtual-output: Add DRI3 xfer path + + Just as proof-of-principle. + + Signed-off-by: Chris Wilson + +commit 9cf6cd9726ed5ba73bb8c38c06f7b5c78706309b +Author: Chris Wilson +Date: Wed May 21 12:52:18 2014 +0100 + + Add rudimentary tests for Present + + Signed-off-by: Chris Wilson + +commit 6ab6734369fbd902a23109f4c3626df9d529891c +Author: Chris Wilson +Date: Fri May 9 11:08:15 2014 +0100 + + Add rudimentary tests for DRI3 + + This is a simple little test to create a pixmap from a local bo, copy it + to a normal pixmap, then read it back by importing it into anther local + bo. It tests the fundamental mechanisms of opening a DRI3 render device, + importing into pixmaps, exporting into /buffers and a read-barrier. + + Signed-off-by: Chris Wilson + +commit d6240d197be1e752c0de26fbf84fc8fa8d55383c +Author: Chris Wilson +Date: Wed May 14 07:55:03 2014 +0100 + + intel: Clear structs for valgrind + + When probing the module, clear structs passed into unknown ioctls to + keep valgrind quiet. + + Signed-off-by: Chris Wilson + +commit d27c948a4382c4024ce5e76f1ea82103fc8e9d66 +Author: Chris Wilson +Date: Fri May 9 13:58:37 2014 +0100 + + intel: Add common routines and configure probing for DRI3 + + Signed-off-by: Chris Wilson + +commit 8a02886a24c8699374a39a9363e72bec0e7bbe30 +Author: Chris Wilson +Date: Fri May 30 21:09:34 2014 +0100 + + sna/dri2: Use real async flips + + Presuming that we have both kernel support and Xorg support, of course. + + Signed-off-by: Chris Wilson + +commit c17d704a5baa0c902994f035d3da39d77d31fef3 +Author: Chris Wilson +Date: Fri May 30 21:21:00 2014 +0100 + + sna: Enable kernel support for asynchronous flips + + If a flip fails, attempt to restore the previous working configuration + (using a modeset) then disable further flipping. + + Signed-off-by: Chris Wilson + +commit c95a4002d1d27937731c59e84254ccb3b1246ccd +Author: Chris Wilson +Date: Sun Jun 1 08:44:13 2014 +0100 + + sna/dri2: Hide MSC reported as going backwards + + OML_sync_control mandates that MSC must be monotonic, so if the kernel + reports that they go backwards, lie. + + Signed-off-by: Chris Wilson + +commit b1c07c20a371795a8dc4102f83fe542d62d8a4e6 +Author: Chris Wilson +Date: Sat May 31 21:58:13 2014 +0100 + + sna/dri2: Always force the async blits to be immediate + + Signed-off-by: Chris Wilson + +commit 1b5f91e14226799ef4ec6461de93fa9193ef2ebc +Author: Chris Wilson +Date: Sat May 31 21:41:45 2014 +0100 + + sna/dri2: Decouple spent flip + + If the flip is already completed before we finish the previous flip, the + drawable has been replaced already and we can unchain the flip queue. + + Signed-off-by: Chris Wilson + +commit 0ee1940a4ffc1901534fa3bf15adb427527a8c20 +Author: Chris Wilson +Date: Sat May 31 13:21:04 2014 +0100 + + sna/dri2: Mark queued flip MSC as the one after next + + Signed-off-by: Chris Wilson + +commit 2df4466adae7f299eac3f7fd3e5f33ee4b22e53f +Author: Chris Wilson +Date: Fri May 30 13:27:32 2014 +0100 + + sna/gen8: Clear all URB push constant allocations + + A little paranoia to clear the unused portion of the URB and dedicate it + to VS entries. + + Signed-off-by: Chris Wilson + +commit 1618d6cfa63e31ebaedadf575dcbdf5b07451bde +Author: Chris Wilson +Date: Fri May 30 12:14:40 2014 +0100 + + sna/gen8: Set GT level + + We use the GT level to decide how favourable it is to use the GPU in + various circumstances, now set it. + + Signed-off-by: Chris Wilson + +commit bb49222a514b1d6041f3d9530a22f5701377118b +Author: Chris Wilson +Date: Mon Jun 2 08:25:52 2014 +0100 + + sna: Add DBG hints for using inplace CPU mmappings + + Signed-off-by: Chris Wilson + +commit 487df2e7b105b996c4d620ec2af6331ebc167f47 +Author: Chris Wilson +Date: Mon Jun 2 08:30:57 2014 +0100 + + sna: Silence a DBG compiler warning + + kgem.c: In function '_kgem_submit': + kgem.c:3243:12: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result] + write(fd, kgem->batch, batch_end*sizeof(uint32_t)); + + Signed-off-by: Chris Wilson + +commit ffbe0aa1851c35cc2403633ca493e9fc6a471fd4 +Author: Chris Wilson +Date: Fri May 30 18:41:39 2014 +0100 + + sna: Reuse the first scanout bo + + The path of last resort is meant to reuse the first scanout bo if they + all busy (since it will be the oldest). It chased a dangling pointer + instead. + + Signed-off-by: Chris Wilson + +commit 40fe1f2c09a98ac75b05db3663d29ee1a64ed280 +Author: Chris Wilson +Date: Fri May 30 18:30:47 2014 +0100 + + sna: Do not allow imported buffers to be cached + + Signed-off-by: Chris Wilson + +commit fc1f9b91ae2c761e4b126daecab13e13ae2534d3 +Author: Chris Wilson +Date: Fri May 30 18:11:16 2014 +0100 + + sna: Mark all caches for expiration + + Signed-off-by: Chris Wilson + +commit 3dac734bb0fb0ae1febfef9a9289cf830a87be1c +Author: Chris Wilson +Date: Fri May 30 10:31:37 2014 +0100 + + test: Only compute the masked pixel value if depth!=32 + + Minor saving for when we use a8r8g8b8. + + Signed-off-by: Chris Wilson + +commit 961139f5878572ebea268a0bbf47caf05af9093f +Author: Chris Wilson +Date: Fri May 30 09:45:15 2014 +0100 + + sna: Use manual detiling for downloads + + If we can CPU mmap the GPU bo, prefer to do so for migration to the CPU + as this saves an extra serialisation step. + + Signed-off-by: Chris Wilson + +commit 93d3df493d359f76ea710441d891a0333e755fb8 +Author: Chris Wilson +Date: Fri May 30 22:49:05 2014 +0100 + + sna: Unexport kgem_get_unique_id() + + This should always be set during bo creation + + Signed-off-by: Chris Wilson + +commit 792584fa740dbc81b72fd4f4bdf27d65b9c046cf +Author: Chris Wilson +Date: Wed May 28 14:00:26 2014 +0100 + + sna/dri2: Reorder declarations to compile on old Xorg + + Signed-off-by: Chris Wilson + +commit 562c47fc21b9029ebff29b53d2be590df4329264 +Author: Chris Wilson +Date: Wed May 28 12:51:18 2014 +0100 + + Silence CLang (almost) + + Fix up all the warnings about implicit enum conversions. The + container_of() macro remains defunct. + + Signed-off-by: Chris Wilson + +commit 6282fc9d0d3b2899be52ca4a43a3d9313e9049a6 +Author: Chris Wilson +Date: Wed May 28 10:42:58 2014 +0100 + + sna/dri2: Fix the continuation mode for old style triple buffering + + Otherwise we end up sending too many SwapCompletes back to the client + and confusing ourselves. + + Signed-off-by: Chris Wilson + +commit 916354164bcb149e1323a3219d85e7bba6e61e04 +Author: Chris Wilson +Date: Tue May 27 20:16:55 2014 +0100 + + sna: Fix the depth/format on the temporary shadow Pictures + + When scaling the output, we re-render onto the scanout using a call to + Composite, for which we create temporary Pictures. In most cases, the + mismatching depth/format goes unnoticed, but along one particular + fallback path, we use those to create a new Picture but the mismatching + format results in a segfault. + + Reported-by: Matti Hämäläinen + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79320 + Signed-off-by: Chris Wilson + +commit d8360bd74f5b62a27c019c65ed9001cac8bf43ed +Author: Chris Wilson +Date: Tue May 27 20:14:02 2014 +0100 + + sna: Handle bad picture format/depth mismatches + + Scaling the output feed in an invalid picture->format/depth combination + which causes the fallback downsampling function to explode. Whilst this + is a bug in the higher layer, we can handle the error anyway. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=79320 + Signed-off-by: Chris Wilson + +commit 93b319cf9a355e8400b864046cdb4cfb56b657a0 +Author: Chris Wilson +Date: Fri May 23 13:16:50 2014 +0100 + + uxa: Silence the compiler over a couple of unused variables + + intel_driver.c: In function 'I830LeaveVT': + intel_driver.c:1085:24: warning: unused variable 'intel' [-Wunused-variable] + intel_screen_private *intel = intel_get_screen_private(scrn); + ^ + intel_driver.c: In function 'I830EnterVT': + intel_driver.c:1102:24: warning: unused variable 'intel' [-Wunused-variable] + intel_screen_private *intel = intel_get_screen_private(scrn); + + Signed-off-by: Chris Wilson + +commit e6ee0679374f8fc80cb34693f80affe6ea676ddb +Author: Chris Wilson +Date: Fri May 23 14:29:42 2014 +0100 + + uxa: Silence compiler for warnings in Cursor API changes + + Signed-off-by: Chris Wilson + +commit 4321e8decd7be9daaa49c6ab4e8bb9bd66faae31 +Author: Chris Wilson +Date: Fri May 23 14:29:42 2014 +0100 + + sna: Silence compiler for warnings in Cursor API changes + + The API changed again in the RC, so update to keep the compiler quiet. + At the same time, protect against the ARGB_CURSOR struct changes. + + Signed-off-by: Chris Wilson + +commit 2a0dc7ed4961d5bda08bb583a7a6a2cc633b27e4 +Author: Chris Wilson +Date: Mon May 26 08:23:45 2014 +0100 + + sna/dri2: Move scanout processing from frame event to global + + The scanout is a global property, track it as so. The primary benefit to + this is it strengthens our assertions that we never hand out an active + scanout for use as a back buffer. + + Signed-off-by: Chris Wilson + +commit 05f149285b429c7b3f25ac8049477230aaef512c +Author: Chris Wilson +Date: Sun May 25 07:14:53 2014 +0100 + + sna/dri2: Defer reallocation of backbuffer until request + + If we defer the reallocation of the backbuffer until the client requests + the set of current buffers (with GetBuffers), then we can often avoid + allocating the fresh backbuffer as the flip often retires before the + client is ready. + + Signed-off-by: Chris Wilson + +commit e8d8f754ebf77f17a4666c8f649907bee50313bd +Author: Chris Wilson +Date: Fri May 23 15:52:20 2014 +0100 + + sna/dri2: Make the swap-limit transitions more obvious + + Signed-off-by: Chris Wilson + +commit 9f4f855ba37966fb91d31e9081d03cf72affb154 +Author: Chris Wilson +Date: Mon May 26 07:06:18 2014 +0100 + + sna: Implicit release of upload buffers considered bad + + Currently upload buffers are automatically decoupled when the buffer is + retired. As retiring can happen during command setup after we have + selected which bo to render with, this can free the bo we plan to use. + Which is bad. + + Instead of making the release of upload buffers automatic, we manually + check whether the buffer is idle before use as a source to consider + scrapping it and replacing it with a real GPU bo. This is likely to keep + upload buffers alive for longer (limiting reuse between Pixmaps but + making reuse of the buffer within a Pixmap more likely) which is both + good and bad. (Good - may improve the content cache, bad - may increase + the amount of memory used by upload buffers for arbitrary long periods.) + + Reported-by: Matti Hämäläinen + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79238 + Signed-off-by: Chris Wilson + +commit b508d8f3318c42a2a87b7731789b1d03610e9b46 +Author: Chris Wilson +Date: Mon May 26 06:54:03 2014 +0100 + + sna: Assert that we do not replace active IO buffers + + References: https://bugs.freedesktop.org/show_bug.cgi?id=79238 + Signed-off-by: Chris Wilson + +commit 605fcd9050efc816ac8163e8d626f466d98261c2 +Author: Chris Wilson +Date: Fri May 23 13:34:38 2014 +0100 + + sna/dri2: Handle allocation failure adding frame events gracefully + + Now that we do not preallocate the storage for the chain in the Window + devPrivates, we need to check for an allocation failure. + + Signed-off-by: Chris Wilson + +commit 36a4a654da87b22f7ce31d1ca99389cedb57eee8 +Author: Chris Wilson +Date: Fri May 23 12:48:10 2014 +0100 + + sna/dri2: Tidy add/remove chain to use the common DRI2 private + + The code is more readable directly updating the private rather than + hiding the pointer chasing through the opaque lookups. + + Signed-off-by: Chris Wilson + +commit 417997f3892b3a5fe43f5951dbde1476092ec82c +Author: Chris Wilson +Date: Fri May 23 12:40:10 2014 +0100 + + sna/dri2: Handle offscreen Window and Pixmap with CRTC tracking + + Signed-off-by: Chris Wilson + +commit d3781e19cfc3edf61b69617cd60da1e421de8ffc +Author: Chris Wilson +Date: Fri May 23 11:16:56 2014 +0100 + + test/dri2: Restore original configuration after testing + + Signed-off-by: Chris Wilson + +commit 1d6106c2893f2783611715960a0f5099ef54b4a0 +Author: Chris Wilson +Date: Fri May 23 10:11:10 2014 +0100 + + sna/dri2: Combine the DRI2 Window privates together into a single struct + + Signed-off-by: Chris Wilson + +commit d6c4e72f1a8008818fc0e5c19c9dc147f1794777 +Author: Chris Wilson +Date: Fri May 23 10:03:39 2014 +0100 + + sna/dri2: Free the private CRTC tracker on each window + + Remember to clean up our privates when the window is destroyed. + + Signed-off-by: Chris Wilson + +commit 43fd06ee7d95db4114ce7b0261685380a48a8708 +Author: Chris Wilson +Date: Fri May 23 09:03:17 2014 +0100 + + sna/dri2: Adjust current msc / target seq between CRTCs + + The target_msc supplied by the client is required to be monotonic. Since + the client does not know which CRTC the window is on, they do not + control from which pipe we derive the MSC, and so we need to adjust the + hardware values such that the client only ever sees a monotonic value. + + Signed-off-by: Chris Wilson + +commit c8decdbccdefa87b635d871a8295608961f0d22e +Author: Chris Wilson +Date: Fri May 23 09:13:31 2014 +0100 + + test/dri2: Check validity of MSC across CRTC + + Signed-off-by: Chris Wilson + +commit a6613a8fe3908433ee33a167f57a0fae4e785a22 +Author: Chris Wilson +Date: Thu May 22 23:48:20 2014 +0100 + + sna/dri2: Queue the flip immediately for the next frame + + If we compute that we want to flip on the next frame, queue it + immediately rather than take a round trip through the kernel and risk + missing the vblank. + + Signed-off-by: Chris Wilson + +commit 24443c6c897278a8a196bf4a8df9fab4485f38b4 +Author: Chris Wilson +Date: Thu May 22 22:47:35 2014 +0100 + + sna/dri2: Tidy computation of target sequence + + Signed-off-by: Chris Wilson + +commit a767ad2e50a503e2b979c976a502ff358064b820 +Author: Chris Wilson +Date: Thu May 22 21:18:10 2014 +0100 + + sna/dri2: Use the timestamps stored on the CRTC + + Now that we store the information for the swap completion on the CRTC, + we don't need to pass it around inside the frame event. + + Signed-off-by: Chris Wilson + +commit 5d80af306677b6d0c52487707bbbcf8de065803b +Author: Chris Wilson +Date: Thu May 22 13:04:31 2014 +0100 + + sna/dri2: Tweak flip continuation + + Minor tidying to the returned target_msc and a useful assertion. + + Signed-off-by: Chris Wilson + +commit 8d1e9afb60a61bf490a282a16db1c15a9ad7d077 +Author: Chris Wilson +Date: Thu May 22 12:34:05 2014 +0100 + + intel-virtual-output: Probe after claiming virtual output + + Rerun a detection cycle after claiming the virtual output so that it is + hidden again. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=78293 + Signed-off-by: Chris Wilson + +commit 0f0cd87c66a4e373ab9b26626514d43b5f4978e5 +Author: Chris Wilson +Date: Thu May 22 10:04:09 2014 +0100 + + sna/dri2: DBG fixes + + Update the DBG statements to match current code. + + Signed-off-by: Chris Wilson + +commit 80dfbaa3c39e1c56aaa9f8951e3bbcc30a9b748d +Author: Chris Wilson +Date: Thu May 22 00:24:07 2014 +0100 + + sna/dri2: Move fixed array allocations to per-crtc + + Replace the fixed size MAX_PIPES array by moving the vblank handling to + per-crtc. + + Signed-off-by: Chris Wilson + +commit 9b21237a1caa369133e6ba972e2ec39feac21bcc +Author: Chris Wilson +Date: Wed May 21 23:40:36 2014 +0100 + + sna/dri2: Maintain sequence calculation in 64bits + + Avoid casting down to 32bits at the begining of the calculation to only + then compare against the full 64bit values later. + + Signed-off-by: Chris Wilson + +commit c548f231c1d59f578dfb113c549b5b6e015e7c5a +Author: Chris Wilson +Date: Wed May 21 23:35:19 2014 +0100 + + sna/dri2: Fix WaitMSC to maintain the vblank counters + + Fix WaitMSC to also use 64 bit counters and maintain the last vblank + notifications. + + Signed-off-by: Chris Wilson + +commit 1f237bb6db9724358eca0467362c03dc6a41dc4a +Author: Chris Wilson +Date: Wed May 21 23:02:52 2014 +0100 + + sna/dri2: Apply a margin of error to the sequence wrap detection + + If we have a queue of events, we may set the msc from a recent vblank + query only to then process an older vblank event and declare the counter + wrapped. + + Signed-off-by: Chris Wilson + +commit 00d9396f6bf0bbbdfca7cdb1cbdbde8f0b2ad59c +Author: Chris Wilson +Date: Wed May 21 20:00:56 2014 +0100 + + sna: Fix attachment of the default monitor to the first output + + Broke during code motion in + + commit add84cd8a8dc6d285912d0ea3a3a3e7faa9e0942 + Author: Chris Wilson + Date: Fri May 2 13:21:02 2014 +0100 + + sna: Perform dynamic connector discovery + + Reported-and-tested-by: Jay Little + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79015 + Signed-off-by: Chris Wilson + +commit 5168a160a1385c23d275d616f2649d5cae7c15d9 +Author: Chris Wilson +Date: Wed May 21 19:16:32 2014 +0100 + + sna/dri2: Decouple queued events + + Becareful when reaping a chain on a destroyed window as some events may + be queued ahead. + + Signed-off-by: Chris Wilson + +commit 66e14c96d0ddede90e36084a80a97c3f16c2b386 +Author: Chris Wilson +Date: Wed May 21 18:38:36 2014 +0100 + + sna/dri2: Limit pending swaps to 1 when queueing a future blit + + Signed-off-by: Chris Wilson + +commit bf4475d29de589a0d0e71dfb895d19a635f8cc3e +Author: Chris Wilson +Date: Wed May 21 11:31:29 2014 +0100 + + sna/dri2: Tidy conditional use of XORG_CAN_TRIPLE_BUFFER + + Signed-off-by: Chris Wilson + +commit 0b3ea29727075bf2b0d86bbeca7dd78201936913 +Author: Chris Wilson +Date: Wed May 21 08:26:21 2014 +0100 + + sna/dri2: Tidy recording of the last swap sequence number and time + + Signed-off-by: Chris Wilson + +commit 183a0728ba52be9d052f5a5f6e6b54c4a9ee8253 +Author: Dave Airlie +Date: Wed May 21 12:41:58 2014 +1000 + + uxa: fix getmsc to not fail hard + + If some outputs go away we race with this call and apps + get X errors and fall over. Do what SNA does and don't + bother trying. + + Signed-off-by: Dave Airlie + +commit 2dbe76c4925e02b8ec20b986069e2ff38cea5bba +Author: Chris Wilson +Date: Wed May 21 07:38:35 2014 +0100 + + sna/dri2: Tidy computation of 64bit ust + + Signed-off-by: Chris Wilson + +commit a82f6a7594ee13170aba5bac7fb57cd5550b27ee +Author: Chris Wilson +Date: Tue May 20 12:20:38 2014 +0100 + + sna/dri2: Client cannot be NULL, so drop the checks + + Signed-off-by: Chris Wilson + +commit c548427e6d3a3fb50acec4b405b9d0ea977d3cc9 +Author: Chris Wilson +Date: Tue May 20 16:36:31 2014 +0100 + + sna: Only mark the scanout as being busy for writes (not solitary reads) + + Signed-off-by: Chris Wilson + +commit 61df0ffc0be8d934d86ac45c67da910479998cc7 +Author: Chris Wilson +Date: Tue May 20 12:07:50 2014 +0100 + + sna/dri2: Verify that the reference pipe is still active for flipping + + We rely on the reference pipe to drive the event wake up. If we issue a + deferred flip, there is a chance that the user could rearrange the + screen on another crtc whilst otherwise preserving the screen geometry. + + Signed-off-by: Chris Wilson + +commit 197ab0cda06c44aa1a2b17bf69ac08612811b107 +Author: Dave Airlie +Date: Tue May 20 07:45:14 2014 +0100 + + uxa: fix pageflips on 3 head scenarios + + While fixing up UXA for MST I eventually fell over this bug. + + Signed-off-by: Dave Airlie + [ickle: replace constant with macro to track pipe-dependent code] + +commit bfd0e41d5c7b8bff28ff429b26f4c977e4c37d12 +Author: Chris Wilson +Date: Mon May 19 12:31:49 2014 +0100 + + sna: Fix assertions for combining shadow transforms and TearFree + + When the RandR shadow buffer is enabled we set the sna_crtc->transform + flag. We set the crtc->transform_in_use only when coordinate transforms + are required - i.e. we may enable the shadow buffer if a CRTC is out of + bounds, but otherwise has no transformation. That confused the asserts. + + Reported-by: Zdenek Kabelac + Signed-off-by: Chris Wilson + +commit 1a84875c21b7113f55e6ce0c4a1f914524aa3f97 +Author: Chris Wilson +Date: Fri May 16 15:05:31 2014 +0100 + + sna: Switch iterators over to real CRTCs only + + Many loops only want to walk the real CRTCs, so update the loop bounds + to be explicit and assert that they are the real ones. + + Signed-off-by: Chris Wilson + +commit 65301412ecf2d55ab55a2d7faeaa048d4ee8b1d0 +Author: Chris Wilson +Date: Sat May 17 20:59:38 2014 +0100 + + sna: Discard active GPU buffers before uploading into them + + Signed-off-by: Chris Wilson + +commit f5e43058465d33025d99d83927d1ce6a8e103ff9 +Author: Chris Wilson +Date: Fri May 16 22:45:45 2014 +0100 + + sna: Do not mark an upload as a potential replace if the dst is pinned + + This saves us from trying to optimise for an operation that cannot + happen as we cannot replace the destination buffer. + + Signed-off-by: Chris Wilson + +commit df297e9fafe1a7de1036f3151f93de67661c2a4e +Author: Chris Wilson +Date: Fri May 16 18:20:06 2014 +0100 + + sna: Userptr lands upstream, enable. + + No longer an optional feature of an experimental kernel! + + Signed-off-by: Chris Wilson + +commit 89e8f2b35bbbcaac23dd1d3fc42e83d8214a9130 +Author: Chris Wilson +Date: Fri May 16 10:14:57 2014 +0100 + + sna/dri2: Update the swap type for chained flips + + We stash the pending flip mode into the closure, but failed to copy that + over to the right field when continuing with a chain of flips. The + impact was that we would fail to issue the required SwapComplete to + unblock the clients. + + Fixes regression from + commit 96ce362ba40bf9560fb1aa27a6ae5fdd2a8bd428 + Author: Chris Wilson + Date: Tue May 13 09:46:45 2014 +0100 + + sna/dri2: Do not rate-limit vblank=0 swaps + + Reported-by: francisbrwn + Signed-off-by: Chris Wilson + +commit e73d51247be5018fe53346f991e2f178c917cb13 +Author: Chris Wilson +Date: Thu May 15 23:00:53 2014 +0100 + + sna/video: Only migrate the destination window + + By using move-area-to-gpu and specifying that we overwrite the target + area, we can optimize away any needless damage migration. + + Signed-off-by: Chris Wilson + +commit 10c18b1a4631ebab5508f4308c73129f2111e964 +Author: Chris Wilson +Date: Thu May 15 21:50:41 2014 +0100 + + intel-virtual-output: Mark the source SHMPixmap as writeable + + This is fortunately a no-op, as it gets initialized to zero already + (that is the pixmap is writeable). However, we may as well do the right + thing... + + Signed-off-by: Chris Wilson + +commit b21fc65b23fcbb2b9a04eb92e3719d88e2d026dc +Author: Chris Wilson +Date: Thu May 15 11:23:16 2014 +0100 + + intel: Update PCI IDs for Cherryview + + Copied from kernel commit 7d87a7f709650bde4d7d63117f25ee1c095da5dd + Author: Ville Syrjälä + Date: Wed Apr 9 18:19:04 2014 +0300 + + srm/i915/chv: Add Cherryview PCI IDs + + and also includes non-functional changes from + + commit fd3c269f8ff940cc0fbb3b7f7e84c0572f6f759a + Author: Zhao Yakui + Date: Thu Apr 17 10:37:35 2014 +0800 + + drm/i915: Split the BDW device definition to prepare for dual BSD rings on BDW GT3 + + Signed-off-by: Chris Wilson + +commit 2afeef0c3ffeae768198fc08c9f365ccd28b7f5d +Author: Chris Wilson +Date: Thu May 15 11:28:48 2014 +0100 + + sna: Mark the CHV vsync method as unknown + + Similar to the story with Baytrail, vsync is a lost art. + + Signed-off-by: Chris Wilson + +commit d33e77d58a6f6f23e87943530197f8dc2b076981 +Author: Chris Wilson +Date: Fri May 16 09:59:25 2014 +0100 + + sna: Handle driver failures more gracefully + + Avoid busy-spinning waiting for the cache to expire after a failure. Try + to free up any overdue expiration, then if we still fail, we free the + entire cache. Currently, it would spin over the expiration until all + items were overdue and then freed. + + Signed-off-by: Chris Wilson + +commit 0625185f4772f1c7f8e8d7f265432fd77cdd27fc +Author: Chris Wilson +Date: Wed May 14 12:40:18 2014 +0100 + + intel-virtual-output: Make it possible to disable building via configure + + Signed-off-by: Chris Wilson + +commit c179003b10845b43a7a8958a99b1bf1c6617252c +Author: Chris Wilson +Date: Wed May 14 16:15:24 2014 +0100 + + sna/dri2: Ensure new immediate blits are queued behind outstanding swaps + + OML_sync_control: + If there are multiple outstanding swaps for the same window, at most + one such swap can be satisfied per increment of MSC. The order of + satisfying outstanding swaps of a window must be the order they were + issued. + + The only challenge is to keep both this behaviour and vblank_mode=0 + benchmarking. + + Signed-off-by: Chris Wilson + +commit 84d0790453089be5d1034037065df1ea37ad48fe +Author: Chris Wilson +Date: Wed May 14 11:37:51 2014 +0100 + + sna: After disabling the TearFree shadow, flush any pending flips + + If we complete a flip after resizing and recreating the TearFree shadow, + we may process the flip completion events whilst the output is only + partially reconfigured. + + Signed-off-by: Chris Wilson + +commit 68181f0b530934d74f48cb36022c17b29a76cb75 +Author: Chris Wilson +Date: Wed May 14 07:46:43 2014 +0100 + + sna/dri2: Carefully check for a completed swap + + We have to open-code kgem_bo_is_busy() in order to avoid prematurely + retiring the rq->bo. The unfortunate outcome here is that the bo may be + recycled for a new batch before it is finally released from the request. + + Reported-by: Zdenek Kabelac + Signed-off-by: Chris Wilson + +commit 9f76133e71f1a7cb44ed2f98762ba8626f1e85e6 +Author: Chris Wilson +Date: Tue May 13 12:46:39 2014 +0100 + + sna/dri2: Tighten reporting of faked flip events + + GetDrawableMSC is specified as returning the frame counter and timestamp + of the last flip event associated with the drawable, not the current + hardware timestamp. + + Signed-off-by: Chris Wilson + +commit 96ce362ba40bf9560fb1aa27a6ae5fdd2a8bd428 +Author: Chris Wilson +Date: Tue May 13 09:46:45 2014 +0100 + + sna/dri2: Do not rate-limit vblank=0 swaps + + Signed-off-by: Chris Wilson + +commit b7316feeda552a88245dadde9dadd9b40b8a4992 +Author: Chris Wilson +Date: Wed May 14 07:46:00 2014 +0100 + + sna: Add some DBG to track rogue requests + + In particular allow the pointer cache to be disabled for valgrind. + + Signed-off-by: Chris Wilson + +commit 692555cc03c3a3632d2eaacdbbe800afdefd9f77 +Author: Chris Wilson +Date: Thu May 8 15:22:44 2014 +0100 + + sna: Rename DRI2 files, functions and variables + + Signed-off-by: Chris Wilson + +commit 09e26d38e9eca33e27fd0b30524e75814d5d3ad9 +Author: Chris Wilson +Date: Wed May 14 08:42:48 2014 +0100 + + sna: Avoid promoting SHM Pixmaps for DRI + + Signed-off-by: Chris Wilson + +commit 7303c6c75df135d2d01f126f240a270ad26201c6 +Author: Chris Wilson +Date: Mon May 12 09:56:51 2014 +0100 + + sna: Check for PRIME scanouts + + Query the cache level on imported dma-bufs to see if they need special + handling. + + Signed-off-by: Chris Wilson + +commit ad01e1c8700caeaf0288b72450646d7ebe7cce93 +Author: Chris Wilson +Date: Thu May 8 13:02:15 2014 +0100 + + sna: Fix another assignment inside an assert + + Another recent introduction, spotted by Rinat Ibragimov. + + Signed-off-by: Chris Wilson + +commit e78a00c5da922024ac64270fae0797d98d1d6e57 +Author: Chris Wilson +Date: Thu May 8 06:45:43 2014 +0100 + + sna: Add an xorg.conf option for removing unused outputs + + Clients are not yet ready for outputs that disappear at runtime, often + unexpectedly dieing with asynchronous BadOutput errors. A simple + workaround is to not remove any output just yet - but allow users to opt + in via xorg.conf, i.e. + + Section "Device" + Option "DeleteUnusedDP12Displays" "true" + EndSection + + The name chosen is to be consistent with the nvidia driver, which did + MST first and encountered all of these issues first, and has also been + adopted for -modesetting. If this is combined with persistent output + naming (i.e. based on DisplayPort branch topology), the number of + outputs presented to the user should be static. + + Instead of removing the outputs, we have to mark them detached instead + to avoid throwing errors from the kernel. + + Based on the patch for -modesetting by Dave Airlie. + Signed-off-by: Chris Wilson + +commit a93157587a82c699e7df76fb482c49569f0686b9 +Author: Chris Wilson +Date: Wed May 7 21:20:56 2014 +0100 + + sna: Tidy thread handling under valgrind + + If valgrind is running, keep it simple and avoid using unknown + instructions (causing valgrind to die with SIGILL). + + Signed-off-by: Chris Wilson + +commit efd9e9c3eeb83b9e5725fa642066925d608c059d +Author: Chris Wilson +Date: Wed May 7 21:19:57 2014 +0100 + + sna/dri: Use move-area-to-gpu to handle clipped regions more efficiently + + Signed-off-by: Chris Wilson + +commit 1385ca9eeb26b0b82b623da619a65036830ccceb +Author: Chris Wilson +Date: Wed May 7 21:19:32 2014 +0100 + + sna: Initialize value read through ioctl to please valgrind + + Signed-off-by: Chris Wilson + +commit 7d516589ba9d0325e57e08d41becff64f81e2d00 +Author: Chris Wilson +Date: Wed May 7 17:49:15 2014 +0100 + + sna/dri: Implement TripleBuffering using DRI2SwapLimit + + An addition to DRI2 that was overlooked at the time, was the support + added for having multiple outstanding swap requests in the core. The + importance of this is that we can then send the SwapComplete reply after + the pageflip is completed and not before as we currently do to fake + triple buffering - in clear violation of OML_sync_control. + + Signed-off-by: Chris Wilson + +commit 18416b5162e6d6e5415916c55c935b08c980d7f3 +Author: Chris Wilson +Date: Wed May 7 13:49:13 2014 +0100 + + sna: Don't assign in an assert + + That just nullifies the point of the assert in the first place. + + Spotted-by: Joakim Tjernlund + Signed-off-by: Chris Wilson + +commit 0250a4f4ba5b765fe4e9be585e03c92aa2376402 +Author: Chris Wilson +Date: Wed May 7 12:40:01 2014 +0100 + + sna: Fix bogus assertion about conn->encoder_id + + The connector's encoder_id is only set if the output is active. + + Signed-off-by: Chris Wilson + +commit c410f0cd982cad8de440727b0ad7d9268b89a704 +Author: Chris Wilson +Date: Wed May 7 11:04:10 2014 +0100 + + sna: Set desired mode after rediscover during VT switch + + When switching back to the VT, rerun the output discovery (if such an + event was pending) before we attempt to set the desired modes. + + Signed-off-by: Chris Wilson + +commit c38512e12e879ae8932528a9cac5ffbf4ea138c0 +Author: Chris Wilson +Date: Wed May 7 11:01:30 2014 +0100 + + sna: Run output discovery before modes query + + If we keep the separate discovery uevent, we need to run it first in the + cases where we get combined discovery+hotplug events. + + Signed-off-by: Chris Wilson + +commit 7aefd003bb65cc52a74dfcfd8af4b67a364343ff +Author: Chris Wilson +Date: Wed May 7 10:13:53 2014 +0100 + + sna: Fix unattached outputs for ZaphodHeads + + We need to preserve possible_crtcs for the later check that we can use + the output with the particular ZaphodHead (which owns a CRTC). + + Signed-off-by: Chris Wilson + +commit c5bad6daaaa60fa8970eaf4a1ce485cd4c72c2fd +Author: Chris Wilson +Date: Wed May 7 07:53:11 2014 +0100 + + intel-virtual-output: Disable remote CRTC using the remote Display! + + Reported-by: Kirill Müller + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78293 + Signed-off-by: Chris Wilson + +commit 632d3dfe215c38f2dd052625ea8ec34582dfafef +Author: Chris Wilson +Date: Tue May 6 12:24:37 2014 +0100 + + sna: Treat encoder id array as invariant + + Signed-off-by: Chris Wilson + +commit f62dfd8f518bb4117d395f81b684340dc4f1ede5 +Author: Chris Wilson +Date: Tue May 6 07:37:59 2014 +0100 + + sna: Allow connectors without an associated encoder + + In the future, we may see a setup where connectors are created without + being attached to a specific encoder, instead associated with multiple + generic encoders - such as DP MST sink devices. To handle this, we need + to recheck their active encoder at runtime after branch configuration + events (or possibly hotplug). + + Signed-off-by: Chris Wilson + +commit ea602f7e10c6319c4213776b49f2ae25739af316 +Author: Chris Wilson +Date: Tue May 6 06:58:35 2014 +0100 + + sna: Discard the TearFree damage when doing a full CPU migration + + Signed-off-by: Chris Wilson + +commit b8d71e029cec5c8d1c7e344331b86d2e27f6bc24 +Author: Chris Wilson +Date: Mon May 5 20:59:24 2014 +0100 + + sna: Tidy computation of clone/crtcs for fake outputs + + Signed-off-by: Chris Wilson + +commit 77507909a18b687698f6d4e436ef66d942308fc3 +Author: Chris Wilson +Date: Mon May 5 19:43:25 2014 +0100 + + intel-virtual-output: Grab the server whilst cleanging up the local output + + Signed-off-by: Chris Wilson + +commit 56126d00503fd9bc6fe30781ecddb2fb67de817b +Author: Chris Wilson +Date: Mon May 5 18:17:01 2014 +0100 + + sna: Refine hints to allow inplace writes whilst compositing aligned traps + + Signed-off-by: Chris Wilson + +commit 464ef44ab1d691a4bffecbe88be8182adf9fd4ff +Author: Chris Wilson +Date: Mon May 5 14:49:31 2014 +0100 + + intel-virtual-output: Copy existing CRTC information + + If we fail to disable the remote output during initialisation, copy the + current configuration in order to try and keep the bookkeeping in order. + + Signed-off-by: Chris Wilson + +commit 194f9332d35601178ae3595bc17a3f52f5644cb9 +Author: Chris Wilson +Date: Mon May 5 14:29:16 2014 +0100 + + intel-virtual-output: Try disabling Panning after disabling CRTC + + Signed-off-by: Chris Wilson + +commit 5279ebf56449a9b9edd28ff23e9c8a20af792795 +Author: Chris Wilson +Date: Mon May 5 13:06:11 2014 +0100 + + intel-virtual-output: Mark ShmPixmap destinations as writeable + + In order to prevent a subsequent BadAccess when we try to use it as a + ShmPixmap, we need to mark the segment as writeable. + + Signed-off-by: Chris Wilson + References: https://bugs.freedesktop.org/show_bug.cgi?id=78293 + +commit a93d2d4f910dc66fe7114a4f44bf8098e3f7ae7a +Author: Chris Wilson +Date: Mon May 5 13:03:14 2014 +0100 + + intel-virtual-output: Check for errors whilst creating ShmPixmaps + + Creating a ShmPixmap may cause an asynchronous BadAccess error, so wrap + the construction with XSync and check for an error before proceeding. + + Signed-off-by: Chris Wilson + References: https://bugs.freedesktop.org/show_bug.cgi?id=78293 + +commit 45892b3a63613af67e249e9ad006f2b2002570c0 +Author: Chris Wilson +Date: Mon May 5 12:41:06 2014 +0100 + + intel-virtual-output: Record shm/randr/xinerama queries in DBG log + + Signed-off-by: Chris Wilson + +commit 6c9f216d7ce7c329b1008cb09c9de55396e0e6b1 +Author: Chris Wilson +Date: Mon May 5 12:38:51 2014 +0100 + + intel-virtual-output: Check error state when disabling CRTC + + Only mark an output as disabled if we do successfully disable it. This + will require a little more work to make sure that such errors are + cleanly propagated back to the host... + + Signed-off-by: Chris Wilson + +commit ef178f7d6955e12383c64ad9ee706db0e931992e +Author: Chris Wilson +Date: Mon May 5 09:37:56 2014 +0100 + + sna: Fix loop iteration whilst deleting connectors + + If we remove a connector/output, we need to not advance the iterator or + else we skip over an output (as the array is reduces inside the loop). + + Signed-off-by: Chris Wilson + +commit 8fd13a52072c2f8f12f934deaba1ef9ddb16d5f9 +Author: Chris Wilson +Date: Mon May 5 09:32:59 2014 +0100 + + sna: Reorder connector initialisation to avoid leak + + If the output was ignored, we would leak the allocations. However, we + can check the output name after the first GETCONNECTOR/GETENCODER + request before any allocations. + + Signed-off-by: Chris Wilson + +commit 55f567f9d8dd1bbc21acf30f02d394e54ddc8157 +Author: Chris Wilson +Date: Sun May 4 12:13:25 2014 +0100 + + sna/dri: Report the last known MSC whilst the pipe is off + + From OML_sync_control: + "The graphics MSC value is incremented once for each screen refresh. + For a non-interlaced display, this means that the graphics MSC value + is incremented for each frame." + + When the pipe is disabled, return the last known MSC such that the + reported value is always monotonic and consistent with the pipe when it + is active again. That also is consistent with OML_sync_control which + says that the MSC is a vertical refresh counter, and by implication does + not increase whilst the pipe is off. + + Signed-off-by: Chris Wilson + +commit 080e9f99857081bca063c67afb7c98854d1f61f4 +Author: Chris Wilson +Date: Sun May 4 11:59:40 2014 +0100 + + sna: Prefer PrimaryOutput for timing signals + + If the drawable is even partially on the PrimaryOutput, use that pipe + for determining synchronisation counters and synchronised updates. + + OML_sync_control: + "For a multi-monitor system, the monitor used to + determine MSC is screen 0 of ." + + The PrimaryOutput is the nearest approximation we have to "screen 0". We + also deviate in handling what hapens when that screen is off, which is + not mentioned at all in OML_sync_control. + + Signed-off-by: Chris Wilson + +commit 828bd9e250b7d9dd1dc4185c0179237e9b21d8bf +Author: Chris Wilson +Date: Fri May 2 17:13:29 2014 +0100 + + sna: Reorder cursor initialisation + + It helps to initialise the cursors after we setup one of the values we + depend on. + + Signed-off-by: Chris Wilson + +commit 38f82655e0bc8f26250f56e9a25aedd30b46360c +Author: Chris Wilson +Date: Fri May 2 12:30:43 2014 +0100 + + sna: Remove incorrect cursor assertion + + Ideally, we want to assert that we have sufficient stashed cursors to + allocate for the unused CRTCS, so something like + assert(num_stash + num_active_cursors >= 0); + + Reported-by: Zdenek Kabelac + Signed-off-by: Chris Wilson + +commit 430152da82f496ac47f33ce1eca65d154af38752 +Author: Chris Wilson +Date: Fri May 2 16:57:27 2014 +0100 + + compat: Add missing wrapper for RegionSubtract + + Signed-off-by: Chris Wilson + +commit add84cd8a8dc6d285912d0ea3a3a3e7faa9e0942 +Author: Chris Wilson +Date: Fri May 2 13:21:02 2014 +0100 + + sna: Perform dynamic connector discovery + + One of the side-effects of MST is that we need to support dynamic + attachment and removal of displays as the branch hierachy changes. + + Signed-off-by: Chris Wilson + +commit 3123dec3dfc55fbca32d32eaaa8ac29396b28c49 +Author: Chris Wilson +Date: Fri May 2 10:40:47 2014 +0100 + + sna: Do not stash drmModeResPtr + + In the near future we will be dealing with dynamic discovery of + connectors, and so we cannot assume that the mode resources will be + static for our lifetime. The first step is to not keep that struct + around, but pull out the useful information and discard it. + + Signed-off-by: Chris Wilson + +commit 7b072074aa2b08c09a3d920d67f38ae73009ced6 +Author: Chris Wilson +Date: Fri May 2 08:27:07 2014 +0100 + + sna: Refactor hints for GPU promotion of composite fills + + The major change here is not do a full promotion if we are filling + through a clip region. The original intention was to catch doing the + initial clear of the background, but it was also triggering for drawing + rectangular outlines etc. + + Signed-off-by: Chris Wilson + +commit 81608b4da5b35993cd2071098235c14920b7236d +Author: Chris Wilson +Date: Thu May 1 13:15:11 2014 +0100 + + sna: Do not discard damage when using the CPU to perform BLT spans + + The BLT paths are only taken when we know we are overwriting the target + contents, and so we do not have to worry about reads along those paths. + However, in terms of migrating the damage for a pixmap, we have to be + careful in case we do not write to the full area of the composite + rectangle, in which case we have to treat it as a read to that area and + migrate the damage. + + Regression from + commit a13781d19defc97af6a279c11a85e33ef825020e [2.20.10] + Author: Chris Wilson + Date: Sun Aug 19 09:45:12 2012 +0100 + + sna: Enable BLT composite functions to target CPU buffers + + Signed-off-by: Chris Wilson + + Reported-by: Matti Hämäläinen + Signed-off-by: Chris Wilson + +commit 150458c402f2a93e87924dacd3d0e99def512b85 +Author: Chris Wilson +Date: Thu May 1 09:42:07 2014 +0100 + + sna: Refactor migration DBG code + + And add a new DBG option to disable partial-cpu migrations. + + Signed-off-by: Chris Wilson + +commit ca57ee723497b07396646e567fd87dfce8d779fa +Author: Chris Wilson +Date: Thu May 1 09:15:28 2014 +0100 + + sna: Add some DBG for tracing vblanks across modeset/resume + + Signed-off-by: Chris Wilson + +commit bcbb2f222c39ab8732bf1daa248c77ce22cc173e +Author: Chris Wilson +Date: Wed Apr 30 14:43:01 2014 +0100 + + sna/dri: Tidy call to vblank ioctl for MSC waiting + + Signed-off-by: Chris Wilson + +commit 4430703619dc6012407ab703f211dc1181ba6ec8 +Author: Chris Wilson +Date: Wed Apr 30 11:10:49 2014 +0100 + + sna: Be more lenient and allow tiled uploads to replace CPU buffers + + Signed-off-by: Chris Wilson + +commit 2fd1a05ac50ac4ba7cf09225f9133a8141aef302 +Author: Chris Wilson +Date: Tue Apr 29 13:51:33 2014 +0100 + + sna/video: Initialise pitch before query + + Signed-off-by: Chris Wilson + +commit 41a573c15ca1a1e775a2060be117374a5bc6f9b9 +Author: Chris Wilson +Date: Tue Apr 29 13:30:14 2014 +0100 + + sna: Discard TearFree damage on partial migration + + If we are overwriting part of the framebuffer, we know we do not need to + read that portion back from the scanout. + + Signed-off-by: Chris Wilson + +commit d75501572a4ea95fc126314718468345630723a1 +Author: Chris Wilson +Date: Tue Apr 29 13:29:45 2014 +0100 + + sna: Preserve cpu hint for compatible mmapping of the GPU bo + + Signed-off-by: Chris Wilson + +commit 94e39323772ef6561efcc0620f67cabd2462a0d0 +Author: Chris Wilson +Date: Tue Apr 29 09:02:50 2014 +0100 + + sna: Recycle physical cursors + + A side-effect of the workaround for incoherent physical cursors is that + we never reused a cursor after disabling. As such moving the cursor off + the pipe and back on would eventually consume all the preallocated + structs leading to a segfault. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78002 + Signed-off-by: Chris Wilson + +commit 0b23011c27736d0ae2b33d8ea147c16b909baa57 +Author: Chris Wilson +Date: Mon Apr 28 15:59:18 2014 +0100 + + sna: Tweaks to cursor DBG logging + + Signed-off-by: Chris Wilson + +commit d4bd452caa335a54076fa003ee616c2efe93bca3 +Author: Chris Wilson +Date: Mon Apr 28 14:01:43 2014 +0100 + + sna: Assert against underflows in BLT command lengths + + Signed-off-by: Chris Wilson + +commit 2a993c8aa9e8594c32d5e67329b0dbed0d92c761 +Author: Chris Wilson +Date: Mon Apr 28 12:53:00 2014 +0100 + + sna: Initialise pointer before use + + commit 534a0e6433a37c95f7181f7ce9046a4e7c82532d + Author: Chris Wilson + Date: Mon Apr 28 07:53:13 2014 +0100 + + sna: Factor in destination sizes for choosing intermediate tiling bo size + + assumed that the target bo was being initialisation for the tiling + composite; it was not. + + Signed-off-by: Chris Wilson + +commit f0042850494ac16149ba310c910ca08f86c191fa +Author: Chris Wilson +Date: Mon Apr 28 08:37:11 2014 +0100 + + sna: Rearrange final aperture check + + If we cross the high water mark, first flush the batch, then check the + remaining pages to see if they fit into the aperture. + + Reported-by: Bruno Prémont + Signed-off-by: Chris Wilson + +commit 7a685d1d7b63a1589ba0fd09168d4f95d18fcae5 +Author: Chris Wilson +Date: Mon Apr 28 08:31:59 2014 +0100 + + sna: Add a minor DBG for tiled copies + + Signed-off-by: Chris Wilson + +commit 3e330f3980b7bacad30b25ff144e4162acc854bb +Author: Chris Wilson +Date: Mon Apr 28 08:15:35 2014 +0100 + + sna: Refine fence packing estimates + + Signed-off-by: Chris Wilson + +commit 534a0e6433a37c95f7181f7ce9046a4e7c82532d +Author: Chris Wilson +Date: Mon Apr 28 07:53:13 2014 +0100 + + sna: Factor in destination sizes for choosing intermediate tiling bo size + + When tiling, factor in the destination usage of the aperture in case + that reduces the available aperture for the intermediate bo. + + Signed-off-by: Chris Wilson + +commit 11cc397cb1cded40f7ab43c1add3fd00b97c6bdc +Author: Chris Wilson +Date: Sun Apr 27 07:55:09 2014 +0100 + + sna: Preallocate cursors + + We need to avoid all allocations within the signal handlers, so + preallocate the cursor structs. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77975 + Signed-off-by: Chris Wilson + +commit 9417f13cc4074ea6e5dad88e054337e93b461a4c +Author: Chris Wilson +Date: Sun Apr 27 07:55:09 2014 +0100 + + sna: Preallocate pwrite scratch buffer for old fashioned cursor updates + + We need to avoid all allocations within the signal handlers, so + preallocate the transfer buffer. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77975 + Signed-off-by: Chris Wilson + +commit 795cebf053e8457b998522ab7eea80b0819cb46b +Author: Chris Wilson +Date: Sun Apr 27 07:52:14 2014 +0100 + + sna: Replace cursor gen test with feature flag + + Signed-off-by: Chris Wilson + +commit 1b76a1f6fb046353b1e2f553dfcb03978807272d +Author: Chris Wilson +Date: Sun Apr 27 08:32:17 2014 +0100 + + sna: Initialise cursors after checking for KMS + + Signed-off-by: Chris Wilson + +commit b3c5a524965958b5b11a1195e773d10ac9fc6611 +Author: Chris Wilson +Date: Wed Apr 23 14:23:55 2014 +0100 + + sna: Tweak use inplace CPU maps for writing + + Allow us to write into a GPU bo without any pending CPU damage. + + Signed-off-by: Chris Wilson + +commit c872be6cbef3b07dc79fc8f83d719543c0adcdee +Author: Chris Wilson +Date: Wed Apr 23 14:23:55 2014 +0100 + + sna: INPLACE has early exits in move-to-cpu + + We can update the priv->cpu flag more accurately by accounting for the + early exits for the INPLACE accessors. + + Signed-off-by: Chris Wilson + +commit 05cf93287419992208493f5098fc7b089e95b20c +Author: Chris Wilson +Date: Wed Apr 23 14:21:39 2014 +0100 + + sna: Be more selective of reusing bo for inplace uploads on !LLC + + On older architectures, we can only do the inplace upload into a GPU bo + into a new unused bo (that is still in the GPU domain). + + Signed-off-by: Chris Wilson + +commit cf7efedb32b63901f7e42a90f756899b9ba60e65 +Author: Chris Wilson +Date: Wed Apr 23 14:20:47 2014 +0100 + + sna: Tweak untiled limits + + Allow more small pixmaps to use untiled for linear mmappings. + + Signed-off-by: Chris Wilson + +commit 5fbbfd4dd35c5e5381897b7e5d4c16c1f182ef2b +Author: Chris Wilson +Date: Wed Apr 23 11:34:06 2014 +0100 + + sna/video: Show sprites across all outputs + + If an overlay video (using the sprite interface) is visible on multiple + outputs, we have to create and show a sprite for each. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77802 + Signed-off-by: Chris Wilson + +commit 3508f809c40bc59d67deb7182807664bc0648639 +Author: Chris Wilson +Date: Wed Apr 23 11:46:12 2014 +0100 + + sna: Fix assertions for mmapping stolen buffers + + Signed-off-by: Chris Wilson + +commit aec3cbb1aba8bae5537534754ea57d21896d591b +Author: Chris Wilson +Date: Wed Apr 23 09:17:22 2014 +0100 + + sna: Reuse any output not explicitly disconnected + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77768 + Signed-off-by: Chris Wilson + +commit 4ed733d16a6ce35b1426bddd993a360f0a7387a8 +Author: Chris Wilson +Date: Wed Apr 23 09:17:01 2014 +0100 + + sna: Improve DBG messages for rejecting outputs during initial config + + Signed-off-by: Chris Wilson + +commit bb5b21e34f6cbe44a249e566471754b45c500e60 +Author: Chris Wilson +Date: Tue Apr 22 21:22:37 2014 +0100 + + sna: Apply defense against a rogue call to move a SW cursor + + So the sna_set_cursor_postion() assertion was reported to have caught us + trying to adjust the position of an absent cursor. That should be + impossible as we should only arrive there if we claim we can support a + HW cursor and so have a registered cursor. However, changing the + assertion into a guard is trivial, and preserves peace of mind. + + Signed-off-by: Chris Wilson + +commit b12bc035fb8ee40bb382e66604e869b729270189 +Author: Chris Wilson +Date: Tue Apr 22 12:30:29 2014 +0100 + + sna: Add a DBG aide to disable hardware execution + + Submit a dummy batch so that we still build, submit batches and perform + relocations, but do not actually invoke the GPU. This can be useful when + looking at mysterious hardware hangs. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77263 + Signed-off-by: Chris Wilson + +commit f6bc0e390bcba97f7aacab4d87251867ca309c17 +Author: Chris Wilson +Date: Tue Apr 22 09:41:21 2014 +0100 + + sna: Use a global pixman glyph cache + + In Zaphod mode, we use a common pool of glyph images but insert them + individually into a cache for each head. However, we only remove the + image from the first cache, leaving a stale slot in the second head. + Upon subsequent reuse of the glyph id, the second head renders garbage. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54707 + Signed-off-by: Chris Wilson + +commit b259cbffcfb41a20c8b0cf1c32f6ff3e9872a472 +Author: Chris Wilson +Date: Sun Apr 20 16:39:37 2014 +0100 + + sna: Avoid copying from tiled source for an overwritten fill + + Signed-off-by: Chris Wilson + +commit 935ec0abcb3b92b1aad00885be59644bf775f5dd +Author: Chris Wilson +Date: Mon Apr 21 08:20:39 2014 +0100 + + uxa: Remove misnomer from ATI logs + + Signed-off-by: Chris Wilson + +commit 08e71e1820d6fcb6829b4ebd360beadc1f250295 +Author: Chris Wilson +Date: Sat Apr 19 16:27:49 2014 +0100 + + sna: Initialise thread->arg + + If we launch less than the maximum number of threads, we may read the + thread->arg value never having set it after a malloc. + + ==8207== Conditional jump or move depends on uninitialised value(s) + ==8207== at 0xA986B7F: sna_threads_wait (sna_threads.c:216) + ==8207== by 0xA986EFE: sna_image_composite (sna_threads.c:350) + ==8207== by 0xA93DD0D: sna_composite_fb (sna_composite.c:598) + ==8207== by 0xA93E66C: sna_composite (sna_composite.c:742) + ==8207== by 0x23A773: damageComposite (damage.c:503) + ==8207== by 0x2309A9: ProcRenderComposite (render.c:708) + ==8207== by 0x15D86D: Dispatch (dispatch.c:433) + ==8207== by 0x161689: dix_main (main.c:294) + ==8207== by 0x6FB1B44: (below main) (libc-start.c:287) + + Signed-off-by: Chris Wilson + +commit 58a757b64927d8e27c4ac38cc15f8291037ec905 +Author: Chris Wilson +Date: Fri Apr 18 09:28:02 2014 +0100 + + sna: Do not reuse physical cursors for the kernel is broken, harder + + commit 154f7e9668bffdf565b6914a3a3e5bdfe17aa1b9 + Author: Chris Wilson + Date: Fri Apr 18 09:28:02 2014 +0100 + + sna: Do not reuse physical cursors for the kernel is broken + + was insufficient as it ended up reusing a stale cursor that was still + attached, and so after updating the cursor the second pipe found itself + with a valid cursor. Hey presto, we had a shared physical cursor, once + again demonstrating the buggy kernel. + + This time, disable all cursor reuse except for the once currently + attached to the pipe - this should prevent all sharing. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77351 + Signed-off-by: Chris Wilson + +commit fb0ed43cbc6f34bde670ab846e7ba9e7dbf9b660 +Author: Chris Wilson +Date: Fri Apr 18 20:55:49 2014 +0100 + + sna: Refine detection of when shadow is active during BlockHandler + + Signed-off-by: Chris Wilson + +commit 2d9ae02c647f93be58d3f77168752774868008f5 +Author: Chris Wilson +Date: Fri Apr 18 11:43:45 2014 +0100 + + sna/video: Provide a fallback path for pwrite failure + + Stranger things have happened. + + Signed-off-by: Chris Wilson + +commit fdc28205d590d560a6f3886189ef974d1d00f2cd +Author: Chris Wilson +Date: Fri Apr 18 11:34:07 2014 +0100 + + sna: Always flush the shadow scanout + + When the shadow scanout is active, make sure we call the BlockHandler + every time, not just when we about to sleep. This is in case we are + swamped by clients trying to render and forgo the important step of + ensuring that their output reaches the screen. + + Reported-by: Ildar Nurislamov + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit 924237efbddb167efc7f9f3bde42b32ffc538ee3 +Author: Chris Wilson +Date: Fri Apr 18 11:33:42 2014 +0100 + + sna: Fix some DBG formats + + Signed-off-by: Chris Wilson + +commit fa56f1062b926b15e554f46eb268a69b43dd8b9f +Author: Chris Wilson +Date: Fri Apr 18 09:52:26 2014 +0100 + + sna/video: Only try to set the color key once + + So that we only report the error to the user a single time, and not + every frame. + + Signed-off-by: Chris Wilson + +commit 154f7e9668bffdf565b6914a3a3e5bdfe17aa1b9 +Author: Chris Wilson +Date: Fri Apr 18 09:28:02 2014 +0100 + + sna: Do not reuse physical cursors for the kernel is broken + + Big bug in the kernel that prevents the sharing of cursors across pipes + when they are backed by a phys_obj. To prevent hitting that bug, don't + do that! + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77351 + Signed-off-by: Chris Wilson + +commit 83f49767f8ed9dd49c40ebc65ed22c288a386edd +Author: Chris Wilson +Date: Tue Apr 15 16:27:44 2014 +0100 + + sna: Pre-emptively bind framebuffers into the GTT + + In order to avoid rendering to the bo and then stalling before we can + pin it the display plane, bind the framebuffer into the GTT (by using a + GTT mmap) during the initial allocation. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit fd0579016be9e0385c0cdd07a9f9e17f93b93a4f +Author: Chris Wilson +Date: Tue Apr 15 16:27:44 2014 +0100 + + sna: Pre-emptively move framebuffers into the DISPLAY cache domain + + In order to avoid rendering to the bo and then stalling before we can + pin it the display plane, allocate bo for fb from uncached and change + the cache level during the initial allocation. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit b0472af1f3c6832838b0cfea38e261c908afd04e +Author: Chris Wilson +Date: Tue Apr 15 16:31:08 2014 +0100 + + sna: Mark partial composite operations upfront + + Rather than guess in the backend when we are going to be called for + multiple boxes, rely on the frontend declaring it correctly. + + Signed-off-by: Chris Wilson + +commit 49e72bd4e59085aa940e5af63381c5394ee670ad +Author: Chris Wilson +Date: Tue Apr 15 11:24:10 2014 +0100 + + sna: Discard TearFree readback when overdrawing + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 + Signed-off-by: Chris Wilson + +commit 13054a00dadedae6495eb5cdf586b7916b82053e +Author: Chris Wilson +Date: Tue Apr 15 10:28:32 2014 +0100 + + sna: Fix up cut'n'paste typo in assertion + + sna_display.c:3176:43: error: 'struct ' has no member named 'rotation' + assert(cursor->rotation != sna->cursor.rotation); + + Reported-by: Ildar Nurislamov + Signed-off-by: Chris Wilson + +commit 1ed8647aef012d30c602f86fc6f97a0a92d7710f +Author: Chris Wilson +Date: Tue Apr 15 06:55:26 2014 +0100 + + sna: Add a cursor DBG for a failed pwrite update + + Signed-off-by: Chris Wilson + +commit cb35b397395cff8ff7f5155759f58c1840bfeeb5 +Author: Chris Wilson +Date: Mon Apr 14 17:12:37 2014 +0100 + + sna: Rearrange cursor reuse to avoid sharing rotations + + Try not to steal a rotated cursor that is currently in use, or else we + may see a brief flash of corruption. + + Signed-off-by: Chris Wilson + +commit fd700c37ee2a68262b1ccfff332dd41ba8599e2c +Author: Chris Wilson +Date: Mon Apr 14 16:48:05 2014 +0100 + + sna: Add some bounds checking asserts to damage + + References: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1300640 + Signed-off-by: Chris Wilson + +commit 9ae82134ad14085e80d93592e155978a5056f44a +Author: Chris Wilson +Date: Fri Apr 11 18:36:16 2014 +0100 + + sna: Restrict WHOLE hint to PutImage on a complete Pixmap + + Signed-off-by: Chris Wilson + +commit 6883f5a64498880425d47871323642409282d9ab +Author: Chris Wilson +Date: Fri Apr 11 08:02:49 2014 +0100 + + sna: Perform 2-color to ARGB cursor conversion inplace + + Signed-off-by: Chris Wilson + +commit 2eddc60a5fe1fabefcad93783d58354570132af3 +Author: Chris Wilson +Date: Fri Apr 11 07:52:30 2014 +0100 + + sna: Don't redraw cursor if the fg/bg colors do not change + + Signed-off-by: Chris Wilson + +commit a79eb2e29a158910785580409c51a585f25876a7 +Author: Chris Wilson +Date: Thu Apr 10 20:41:57 2014 +0100 + + sna/gen2: Fix CA/a8 blend factors + + This is a revert of + + commit 142f8461944b294dbc3fb0a7bf607bccf0bccc1f [2.99.911] + Author: Chris Wilson + Date: Mon Mar 10 15:20:16 2014 +0000 + + sna/gen2: Tidy blend factor selection for the source + + as that broke glyph rendering in firefox for instance. + + Reported-by: Carl Eitsger <4607vrfcr84spd21f08@weg-werf-email.de> + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77201 + Signed-off-by: Chris Wilson + +commit 25fa4f5bb4c9ed12755edfeec38b9bdc134736f1 +Author: Chris Wilson +Date: Thu Apr 10 23:14:32 2014 +0100 + + sna: Don't set cursor bits to an invalid pointer + + The xf86Cursor core simply frees it, so it has to be NULL. + + Signed-off-by: Chris Wilson + +commit 7b2753f9cc6a1a7ca353f57d78bdf3d52f32864b +Author: Chris Wilson +Date: Thu Apr 10 23:11:18 2014 +0100 + + sna: Only mark the transform_in_use when required for shadow fb + + Signed-off-by: Chris Wilson + +commit 4950bc4fea80d44dde798f3f8b5a07eee1555a63 +Author: Chris Wilson +Date: Thu Apr 10 22:26:42 2014 +0100 + + sna: Only reload an active HW cursor + + Do not attempt to restore the cursor handle if a SW cursor is currently + active. In particular, this prevents a crash after modesetting if we + never had a real cursor (for example output offloading). + + Reported-by: Tomas Pruzina + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77283 + Signed-off-by: Chris Wilson + +commit 8e6e7dbc9257a223ab284198e92f263a1a8b5553 +Author: Chris Wilson +Date: Thu Apr 10 21:44:35 2014 +0100 + + sna: Don't create slave pixmaps for the virtual CRTC + + They only exist as placeholders for remote outputs in the framebuffer + and do not need to take part in actually output offloading, so we can + forgo creating slave pixmaps and remove the stub function entirely. + + Signed-off-by: Chris Wilson + +commit f94684db1a694820ff508d8aec77bf19cea86fbd +Author: Chris Wilson +Date: Thu Apr 10 16:08:48 2014 +0100 + + sna: Validate the cursor everytime for hw support + + Signed-off-by: Chris Wilson + +commit d364a881effb2fd87f11648b10d126eb18fcb6be +Author: Chris Wilson +Date: Thu Apr 10 09:12:02 2014 +0100 + + configure: Report which version (lib or module) of glamor is used + + Signed-off-by: Chris Wilson + +commit b771b41f0a945fc580d532524cc744b01dd36d5f +Author: Eric Anholt +Date: Wed Apr 9 15:24:23 2014 -0700 + + uxa: Fix load_cursor_argb for the new Xorg ABI. + + Returning an undefined value meant we might get sw cursors. + +commit d812afc1d4476ba987883fad2ef8b7c002638077 +Author: Eric Anholt +Date: Wed Apr 9 15:24:22 2014 -0700 + + Use fbpict.h instead of defining its prototypes ourselves. + + fbpict.h has been an installed header since 2008, shortly after uxa + landed. This fixes compiler warnings when other headers happen to + include fbpict.h. + +commit a6919aa980883cf2828dc0cf813f315e3035d0cf +Author: Eric Anholt +Date: Wed Apr 9 15:24:21 2014 -0700 + + Update for glamor in the 1.16 server. + + We should link against the server's copy, insted of using the external + library. + +commit be7c166a017cee3ef8a1b7b290b7fb14b4009314 +Author: Chris Wilson +Date: Thu Apr 10 08:22:02 2014 +0100 + + sna: Remove defunct Cursor interface on fake CRTC + + As we no longer user the xf86Cursor helper, we can forgo filling in stub + routines for the fake CRTC. + + Signed-off-by: Chris Wilson + +commit 1d2872dd0830c8858621402328aa1a9322b66ea8 +Author: Chris Wilson +Date: Thu Apr 10 07:35:50 2014 +0100 + + sna: Prepare for an upcoming Cursor API change + + 1.16 now expects load-cursor-argb to return a boolean reporting + success/failure. + + Signed-off-by: Chris Wilson + +commit f9a279b2dc8417b6504478ac96514125d6136523 +Author: Chris Wilson +Date: Wed Apr 9 22:15:19 2014 +0100 + + intel-virtual-output: Fix damage bounds + + Sigh. A serious mixup of integer promotion rules and wraparound caused + the damage computation for small regions to be completely bogus. + + Signed-off-by: Chris Wilson + +commit e0c93a3e53a624beb5d3a15631237ac33b8c92cd +Author: Chris Wilson +Date: Wed Apr 9 18:51:23 2014 +0100 + + intel: If a non-root user starts X, don't release master + + SET_MASTER and DROP_MASTER are only available to the root user. If we + are started as an ordinary user, and we are master by virtue of being + the first user of the device, never release our fd or master. + + Signed-off-by: Chris Wilson + +commit dba43d370b984e262f6fe5920b38b433f4bd392b +Author: Chris Wilson +Date: Wed Apr 9 16:11:26 2014 +0100 + + sna: Use pwrite to update physical cursors + + Older hardware uses physical addresses for its cursor, which are + implemented by the kernel in an incoherent fashion. Maybe with stolen + support this would be different... + + Fixes regression on [845g, 945g] from + commit 25ca8f136cef9e1bdf06967bf8e78c87b54ffce2 + Author: Chris Wilson + Date: Thu Mar 27 14:15:30 2014 +0000 + + sna: Support variable sized cursors + + Reported-by: Knut Petersen + Signed-off-by: Chris Wilson + +commit f14d6cbff3b9766f5fa834282a4eca6636b6fd7d +Author: Chris Wilson +Date: Wed Apr 9 13:14:37 2014 +0100 + + sna: Handle clipped PutImage uploads more carefully + + If the upload is clipped, we do not want to apply the WHOLE migration hints. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77178 + Signed-off-by: Chris Wilson + +commit 510e5cf3fa4e1db8297be62461b602b13d18d8fc +Author: Chris Wilson +Date: Wed Apr 9 12:26:53 2014 +0100 + + sna: Tweak application of WHOLE hint for uploads + + This help with the continuing saga of + commit 1de1104064b5898cbed37e836901694a381c1266 [2.99.911] + Author: Chris Wilson + Date: Fri Feb 21 22:43:04 2014 +0000 + + sna: Use a hint to do whole image uploads inplace + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77178 + Signed-off-by: Chris Wilson + +commit f05552cd7a43ea46ac1a37b68b05be2a82abaeb1 +Author: Chris Wilson +Date: Wed Apr 9 11:54:49 2014 +0100 + + sna: Add some DBG for whole CPU pixmap migration + + Signed-off-by: Chris Wilson + +commit cf4eb827861bf70d4d45a2ffe062d4c05a1564a6 +Author: Chris Wilson +Date: Wed Apr 9 10:22:49 2014 +0100 + + sna: Restore empty region checking + + commit 8ef81d676c52e42a6d9048fd92b2843470b62945 + Author: Chris Wilson + Date: Mon Apr 7 07:59:42 2014 +0100 + + sna: Simplify checking for singular damage + + overlooked that we were also checking for empty regions as well as + singular regions. + + Signed-off-by: Chris Wilson + +commit 9f40d7e91281b74df43f49885472ee352ea4b389 +Author: Chris Wilson +Date: Tue Apr 8 18:28:46 2014 +0100 + + sna: Fix build for older Xorg without OsBlockSIGIO support + + OsBlockSIGIO/OsReleaseSIGIO was only introduced in xorg-server-1.13.0, + so we need a compat layer. + + Signed-off-by: Chris Wilson + +commit 5db8717b8d9f089412b9a7529725c9c41e3e44fb +Author: Chris Wilson +Date: Tue Apr 8 18:00:47 2014 +0100 + + sna: Refactor 3 similar CPU migration promotion checks into one + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77178 + Signed-off-by: Chris Wilson + +commit 617e96f3af861dd797f98d5a74978f9ba595a981 +Author: Chris Wilson +Date: Tue Apr 8 08:47:05 2014 +0100 + + sna: Add more assertions before dereferencing sna_crtc + + Signed-off-by: Chris Wilson + +commit e6b03269d01e61527641639c6fb7b796205e6ed8 +Author: Chris Wilson +Date: Tue Apr 8 08:44:56 2014 +0100 + + sna: Continue to reprobe for ZaphodHeads with a mixed up configuration + + Fixes regresion from + commit 35b03b3fe6213eb3e08f05efe3428bd6bc5421d2 + Author: Chris Wilson + Date: Fri Mar 28 09:14:59 2014 +0000 + + sna: Virtual CRTCs are last, so break loops early + + as the conflicting Zaphod detection requires on searching all potential + CRTCs without finding the match. By breaking early on the virtual CRTC, + we concluded that the setup was actually valid, but disabled. + + Reported-by: Nick Bowler + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77156 + Signed-off-by: Chris Wilson + +commit bf1875139817c5b00d63a743e262c8f3552058ab +Author: Chris Wilson +Date: Mon Apr 7 08:28:55 2014 +0100 + + intel-virtual-output: Fixup DBG messages + + Use the right variables and it may even compile. + + Signed-off-by: Chris Wilson + +commit 8ef81d676c52e42a6d9048fd92b2843470b62945 +Author: Chris Wilson +Date: Mon Apr 7 07:59:42 2014 +0100 + + sna: Simplify checking for singular damage + + Signed-off-by: Chris Wilson + +commit f5014b3fddf6c79f5ca01a91eec5ca92184c8829 +Author: Chris Wilson +Date: Mon Apr 7 07:59:01 2014 +0100 + + sna: Avoid double application of pixel widening for degenerate lines + + References: https://bugs.freedesktop.org/show_bug.cgi?id=77074 + Signed-off-by: Chris Wilson + +commit 3310ee89c1f1a663de5f5b12b8125809a213996f +Author: Chris Wilson +Date: Sat Apr 5 12:18:31 2014 +0100 + + sna: Avoid discarding damage when applying WHOLE hint to pixmap migration + + Once again, we must be careful when promoting from a region to whole + pixmap migration that we do not discard required damage. + + Fixes regression from + commit 27ac9f574f65cbd535751c925e9b2e2d7c8a6b3a [2.99.911] + Author: Chris Wilson + Date: Thu Feb 27 08:33:52 2014 +0000 + + sna: Avoid promoting region-to-whole migration and discarding damage + + Reported-by: gedgon@gmail.com + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77063 + Signed-off-by: Chris Wilson + +commit 7e9ff48ddbe61ad2edbaefde7b94c84637a85291 +Author: Chris Wilson +Date: Sat Apr 5 10:44:48 2014 +0100 + + sna/gen8: Shrink 3DSTATE_SAMPLE_PATTERN packet + + This is now smaller than originally specified. + + Signed-off-by: Chris Wilson + +commit 878ed2d6250701e9ccceacb102b5542986976437 +Author: Chris Wilson +Date: Sat Apr 5 10:43:25 2014 +0100 + + sna/gen8: w/a for NULL depth buffer + + Instead of using a NULL type depth buffer, it is strongly suggested to + use a 1x1 16-bit depth buffer instead (with address 0). + + Signed-off-by: Chris Wilson + +commit 02862faeae21bd445d61006c9aeb966fbe6a7670 +Author: Chris Wilson +Date: Fri Apr 4 16:03:08 2014 +0100 + + sna: Remove unitialized use of 'cursor' + + The earlier query of cursor (simply to find out the hw size) was + replaced by an invariant determined when the cursor was first set. + However, not all uses of cursor->size were fixed. + + Fixes regression from + commit f98b2e164637292c2425f6e6d2c22bd9a2800f8e + Author: Chris Wilson + Date: Wed Apr 2 08:36:14 2014 +0100 + + sna: Prevent signal re-entrancy into cursor update routines + + Reported-by: Christoph Haag + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77053 + Signed-off-by: Chris Wilson + +commit 938eea6dee0be153fcf007549a50213f6c957305 +Author: Chris Wilson +Date: Fri Apr 4 15:56:38 2014 +0100 + + sna/gen2+: Beware the unattached ShmPixmap + + When dereferences priv, make sure it exists first. ShmPixmaps for + example, may not have one, nor do very small buffers. + + Signed-off-by: Chris Wilson + +commit 564e4a9878503c880e0cbd09d88b4c246a0267b6 +Author: Chris Wilson +Date: Fri Apr 4 14:04:38 2014 +0100 + + sna/gen7: Move constants MOCS into chipset specific info blocks + + Signed-off-by: Chris Wilson + +commit 6e86e84da1c8049a150eb6b5780526fea57e0f9d +Author: Chris Wilson +Date: Fri Apr 4 12:41:25 2014 +0100 + + sna: Precompute OVER/ADD with solids to convert it into a BLT operation + + Signed-off-by: Chris Wilson + +commit 31a4c7bc13c5f4560482b450b9ee4788a58930cd +Author: Chris Wilson +Date: Fri Apr 4 10:46:48 2014 +0100 + + sna/gen2+: Replace composite sources with solids where possible + + If the composite reads entirely from within a large pixmap which is a + clear color, just replace the source with a solid. + + Signed-off-by: Chris Wilson + +commit f0565852b668832d4988e875bc12e23abb6e1829 +Author: Chris Wilson +Date: Thu Apr 3 16:27:47 2014 +0100 + + sna: Short-circuit repeated clearing to the same color + + Spotted in amongst a KDE debug log was a series of clear; copy; repeat + using Composite(). + + Signed-off-by: Chris Wilson + +commit baef2201f752da5d0c6322547d925fcbd86c6de4 +Author: Chris Wilson +Date: Wed Apr 2 11:37:17 2014 +0100 + + sna: Silence compiler warning + + Simplify the dependency logic so that even the compiler can understand + what is going on. + + Signed-off-by: Chris Wilson + +commit f98b2e164637292c2425f6e6d2c22bd9a2800f8e +Author: Chris Wilson +Date: Wed Apr 2 08:36:14 2014 +0100 + + sna: Prevent signal re-entrancy into cursor update routines + + As we may need to allocate from within the cursor update, we are prone + to re-entrancy issues within malloc()/free(). To avoid these we need to + block SigIO (for pointer updates) whilst in the critical section. + + Signed-off-by: Chris Wilson + +commit a926d9f68231ac0f2a1f54c7a722979a8ed6e9e1 +Author: Chris Wilson +Date: Mon Mar 31 14:07:41 2014 +0100 + + sna: Update tiling flags after reusing inactive VMA + + Signed-off-by: Chris Wilson + +commit 644c274b2cd398c8236d36423677317cbc82308a +Author: Chris Wilson +Date: Mon Mar 31 14:03:49 2014 +0100 + + sna: Fix predicate inversion for assertion + + The assertion was checking that the invalid condition was true, rather + than that it never happened. Oops. + + Signed-off-by: Chris Wilson + +commit 4b97bf7e6e9e315cc77d940e3be97832a326e702 +Author: Chris Wilson +Date: Mon Mar 31 13:32:45 2014 +0100 + + sna: Use a cheaper check for a replacement operation + + Signed-off-by: Chris Wilson + +commit 76380bcc3c23d75575d37c0436369a8014bd5a3e +Author: Chris Wilson +Date: Mon Mar 31 12:46:58 2014 +0100 + + sna: Allow reassignment of inactive VMA if not mapped into the GTT + + Signed-off-by: Chris Wilson + +commit c4c8a1b180a9d4c1126ee4fe3120128aa560306c +Author: Chris Wilson +Date: Mon Mar 31 11:23:45 2014 +0100 + + sna: Discard damage tracking for operations to the whole pixmap + + Signed-off-by: Chris Wilson + +commit 8f796d4586507a0a6e9ca3608f43448983a3b965 +Author: Chris Wilson +Date: Mon Mar 31 11:14:46 2014 +0100 + + sna: Promote to the GPU operations that cover the whole pixmap + + If the pixmap is already partially on the GPU, and the next operation + touches the entire pixmap, promote that operation back to the whole GPU. + + Signed-off-by: Chris Wilson + +commit 27c086a89d838fe0060e5ddd0fb2f37434078e4d +Author: Chris Wilson +Date: Mon Mar 31 10:01:38 2014 +0100 + + sna: Regularly check that damage does exceed the pixmap + + Signed-off-by: Chris Wilson + +commit a8a5a5a58786445d393c3d6388904c0975c364a6 +Author: Chris Wilson +Date: Mon Mar 31 09:36:05 2014 +0100 + + sna: Search cursor cache first + + We can reuse the current cursor size rather than determine it every + time. + + Signed-off-by: Chris Wilson + +commit e892b789c4c6359e4fb2e11f552b3e43a466c49e +Author: Chris Wilson +Date: Fri Mar 28 11:34:03 2014 +0000 + + sna: Suppress a compiler warning + + sna_display.c: In function '__sna_get_cursor': + sna_display.c:3153:6: warning: assignment from incompatible pointer type [enabled by default] + src = sna->cursor.ref->bits->argb; + ^ + sna_display.c:3209:10: warning: comparison of distinct pointer types lacks a cast [enabled by default] + if (src != sna->cursor.ref->bits->argb) + + Signed-off-by: Chris Wilson + +commit 5c0623b5f36cd1a1a2e3280ab2bea35a7899281b +Author: Chris Wilson +Date: Fri Mar 28 09:53:49 2014 +0000 + + sna: Only transform the temporary cursor coordinates + + As we need to recompute them for each CRTC, we need to reset the + computation each time or else we screw up the coordinates and hide + the cursors at random. + + Breakage from commit 25ca8f136cef9e1bdf06967bf8e78c87b54ffce2 + Author: Chris Wilson + Date: Thu Mar 27 14:15:30 2014 +0000 + + sna: Support variable sized cursors + + Reported-by: Jan Alexander Steffens + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76724 + Signed-off-by: Chris Wilson + +commit 80792a3f490578735065d9f67ca6ebac00b5bb75 +Author: Chris Wilson +Date: Fri Mar 28 09:43:34 2014 +0000 + + sna: Our cursors are always square. + + Signed-off-by: Chris Wilson + +commit 35b03b3fe6213eb3e08f05efe3428bd6bc5421d2 +Author: Chris Wilson +Date: Fri Mar 28 09:14:59 2014 +0000 + + sna: Virtual CRTCs are last, so break loops early + + We know that all the virtual CRTCs are at the end of the CRTC array, so + when we see the first one, we can stop the processing of real CRTCs. + + Signed-off-by: Chris Wilson + +commit 929ac66558be96a039eadd8604d444598259a0aa +Author: Chris Wilson +Date: Fri Mar 28 08:48:06 2014 +0000 + + sna: Cursors are invariant + + Once created, a Cursor has a fixed size and content, so avoid upload + unnecessarily. + + Signed-off-by: Chris Wilson + +commit 26cc3cec982d316b8fe1700eae885ae2767c0110 +Author: Chris Wilson +Date: Fri Mar 28 08:40:47 2014 +0000 + + sna: drmGetCap is too recent for our supported versions of libdrm + + Signed-off-by: Chris Wilson + +commit 78805163c5f8a40a649c973ab2a08b682879f16d +Author: Chris Wilson +Date: Fri Mar 28 08:45:39 2014 +0000 + + sna: RefCursor is too recent + + Replace RefCursor with the simple refcnt manipulation for compilation + against older stacks. + + Signed-off-by: Chris Wilson + +commit e07f8e2e625fb34f9ad795ca8fffc9a9e88e25b2 +Author: Chris Wilson +Date: Thu Mar 27 23:06:15 2014 +0000 + + sna: Fix 2-color to ARGB cursor conversion + + It helps to remember to advance through the source/mask images after + each row. + + Signed-off-by: Chris Wilson + +commit e501aa667699787daf7dc0dfd22c397a785564ce +Author: Chris Wilson +Date: Thu Mar 27 21:57:39 2014 +0000 + + sna: Cursors only need to be cleared when they are shrunk + + If we completely overwrite the old contents, we do not need to clear it + first. + + Signed-off-by: Chris Wilson + +commit 5c4d6d1ad748fe5301fa88d9c15c19a07c55149f +Author: Chris Wilson +Date: Thu Mar 27 21:16:31 2014 +0000 + + sna: Reorder the cursor cache search + + Search for an exact match first, before looking for a cursor we can + reuse. This should help reuse with multiple rotated screens not stealing + the others' cursor on every pass. + + Signed-off-by: Chris Wilson + +commit e8be2a438d7a413ba6c64005971ce814b0076fc7 +Author: Chris Wilson +Date: Thu Mar 27 21:09:45 2014 +0000 + + sna: Clear the surrounding areas of small cursors + + If the cursor does not completely fill the size of the hardware cursor, + we will retain whatever contents already filled that area. + + Signed-off-by: Chris Wilson + +commit 25ca8f136cef9e1bdf06967bf8e78c87b54ffce2 +Author: Chris Wilson +Date: Thu Mar 27 14:15:30 2014 +0000 + + sna: Support variable sized cursors + + One of the downsides with supporting large cursors is that the full size + is very rarely used leading to a waste of permanently allocated + resources. Refactor our cursor handling so that we can allocate fresh + cursors on the fly that are appropriately sized. + + Signed-off-by: Chris Wilson + +commit e3810cff42bca1badc5844002694a6f582c0f423 +Author: Chris Wilson +Date: Wed Mar 26 16:15:07 2014 +0000 + + sna: Move cursor reload into crtc notify + + This only needs to be done once per-screen reconfiguration. + + Signed-off-by: Chris Wilson + +commit 6bdd3b39bfddf1369656a6d182303e2058f6eb8f +Author: Chris Wilson +Date: Tue Mar 25 14:44:49 2014 +0000 + + sna: Tighten detection of GCs that translate to solid fills + + Signed-off-by: Chris Wilson + +commit 771b86e2a808bd74e7e2c316f8414766c2b267c6 +Author: Chris Wilson +Date: Tue Mar 25 10:27:23 2014 +0000 + + intel-virtual-output: Add DBG option to force 16 bit transfers + + Signed-off-by: Chris Wilson + +commit e46c196ecc8ad83f78f4f948b5dcb07906f249c2 +Author: Chris Wilson +Date: Wed Mar 26 12:17:37 2014 +0000 + + sna: Print probed maximum cursor size + + Signed-off-by: Chris Wilson + +commit a273b207b94933713b3dfd7edd3f6bb9b3e959b9 +Author: Chris Wilson +Date: Tue Mar 25 09:40:40 2014 +0000 + + intel-virtual-output: Fix damage iteration over active list + + When iterating over the active list to mark the current damage, we need + to chase the ->active pointer rather than ->next or else we walk the + wrong list from the wrong starting point. + + Reported-by: Kirill Müller + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76271 + Signed-off-by: Chris Wilson + +commit bfd51e205639b468479985c3c631e5d9c76d5fa7 +Author: Chris Wilson +Date: Tue Mar 25 08:59:58 2014 +0000 + + intel-virtual-output: Add a little more DBG around damaging clones + + Signed-off-by: Chris Wilson + +commit 278ef8f7bc0c7f63737ad5f5e967ca253c2571cb +Author: Chris Wilson +Date: Tue Mar 25 08:33:46 2014 +0000 + + intel-virtual-output: Do not detach with DBG enabled + + Since DBG is sent to stdout, we only see it if we do not daemonize + (which closes stdout). + + Signed-off-by: Chris Wilson + +commit 7addfcbf0f2f609ce2a5b8e9a75ee7efb483531c +Author: Chris Wilson +Date: Mon Mar 24 12:51:11 2014 +0000 + + sna: Remove one conditional from rendering glyphs into a mask + + Signed-off-by: Chris Wilson + +commit d3050dbaf74d6a5b5123eea13bc7710efea6257f +Author: Chris Wilson +Date: Mon Mar 24 12:39:37 2014 +0000 + + sna: Consolidate handling of uncacheable glyphs + + Signed-off-by: Chris Wilson + +commit 79399ff9264ff23da0ab95131a67d2ac85651b3d +Author: Chris Wilson +Date: Mon Mar 24 10:46:57 2014 +0000 + + sna: Eliminate a few conditionals in glyph fast path + + Signed-off-by: Chris Wilson + +commit 220accd828c5a0054ae9e3b491a434f7a6c750e0 +Author: Chris Wilson +Date: Thu Mar 20 09:03:31 2014 +0000 + + sna: Only enable cursor support if the hw cursor is supported + + Under a host, we naturally will not setup the cursor capability, and + this provides a safeguard in case we have a machine that does not + support hardware cursors. + + Signed-off-by: Chris Wilson + +commit 7cf0676ff868e7d8cdbfb264e5822250b1f59882 +Author: Chris Wilson +Date: Thu Mar 20 08:51:05 2014 +0000 + + intel: Do not close server fds + + If we are given an fd by the Xserver, then it is not our responsibility + to close it during CloseScreen. + + Signed-off-by: Chris Wilson + Cc: Hans de Goede + +commit 9f4c121974abcec77e7f920e3258a337260200b3 +Author: Chris Wilson +Date: Thu Mar 20 08:48:40 2014 +0000 + + intel: Refactor finding device path if unknown + + Since we already lookup the device path if we do not know it after + opening the fd, we can remove the special case along the legacy PCI + probe path. + + Signed-off-by: Chris Wilson + +commit 582adf067c275a18f55bb43945348b84cb7eb3c4 +Author: Chris Wilson +Date: Wed Mar 19 14:57:25 2014 +0000 + + 2.99.911 snapshot + +commit 6802ee00e52515ca886b956f6c0a0e27d708fb31 +Author: Chris Wilson +Date: Wed Mar 19 10:25:05 2014 +0000 + + sna: Assert after applying clipping that the draw rectangle is wholly contained + + Otherwise we ignore the purpose of applying the clip! + + Signed-off-by: Chris Wilson + +commit 15be6b7c9a89bfdac923d2a27649f539c430366f +Author: Chris Wilson +Date: Tue Mar 18 16:31:07 2014 +0000 + + uxa: Implement minimal flushing for bdw+ + + Based on the patch by Kenneth Graunke, + "Several places (such as intel_cache_expire) call intel_emit_batch_flush, + so it needs to work on Broadwell. Sometimes the batch is empty, in + which case current_batch may not yet be BLT_RING. + + The PIPE_CONTROL code has not been ported to work on Broadwell, so + trying to do a render ring flush will hang the GPU. It also doesn't + make any sense to do a render ring flush, given that we never use the + render ring for UXA on Broadwell." + + Cc: Kenneth Graunke + Signed-off-by: Chris Wilson + +commit 6446bf96f0cc01e730c240f7ed5c91f5d2292139 +Author: Hans de Goede +Date: Tue Mar 18 15:16:30 2014 +0100 + + intel: Don't close the fd on probe failure if it is server managed + + I hit this corner case when testing a single X server spanning both intel + gfx + an usb display link adapter driven by xf86-video-modesetting. + + In this scenario the intel driver gets its platformProbe method called first, + and if it then closes the server managed fd, the xf86-video-modesetting gets + EBADFD errors. + + Signed-off-by: Hans de Goede + +commit 4a6e09c6cdb13773bca5f6831f9f5164008699c9 +Author: Chris Wilson +Date: Tue Mar 18 15:52:19 2014 +0000 + + uxa: Add support for server managed fds (via intel_device) + + Based on the patch by Hans de Goede, this removes the handling of + drmOpen() and DRM_MASTER from within uxa and instead uses the common + routines. This reduces the duplicate code from within uxa, and enables + new features such as server managed fds. + + Cc: Hans de Goede + Signed-off-by: Chris Wilson + +commit dc66e663a06f2ce7685eba1fdf9fad01786bcb4f +Author: Chris Wilson +Date: Mon Mar 17 13:46:05 2014 +0000 + + sna: Improve guard against loading palettes whilst headless + + Whilst hosted, which is very similar to being headless, we do not even + have the kmode pointer and so checking kmode->count_crtcs is fatal. + + Signed-off-by: Chris Wilson + +commit 28ebbe8fa902a1d3ee4ecbda5041de5e7b68ada7 +Author: Chris Wilson +Date: Mon Mar 17 07:56:39 2014 +0000 + + sna: Fix logic inversion in use of imprecise transform conversion + + An accidental drop of the if (!is_translation) broke composite copies + under a transform. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76244 + Signed-off-by: Chris Wilson + +commit 57e63221ec0fa304a02beed356549cadb28bcf19 +Author: Chris Wilson +Date: Fri Mar 14 19:49:59 2014 +0000 + + intel-virtual-output: Minor DBG fixes + + Improve the summary after failing to detect MIT-SHM, and fix a DBG + + Signed-off-by: Chris Wilson + +commit 8cc1f005c69786243ac69f6505087071787e6f87 +Author: Chris Wilson +Date: Fri Mar 14 15:55:41 2014 +0000 + + intel-virtual-output: Iterate over remote outputs in the same order as listed + + If we walk the output lists in the same order as they are listed by + RandR, we are more likely to hit favourable priority sorting. E.g. the + user is likely to setup the outputs in the same order as listed, meaning + fewer CRTC transitions etc. + + Signed-off-by: Chris Wilson + +commit a55bbe3b598616ef4464e50cb9364c8cdf0b513a +Author: Chris Wilson +Date: Fri Mar 14 15:47:20 2014 +0000 + + intel-virtual-output: Disable panning before setting mode on CRTC + + For whatever reason, presumably to do with the switch between CRTCs, we + need to disable the panning before setting the mode in order for our + desired CRTC position to take effect. + + Reported-by: Jeff Katz + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76146 + Signed-off-by: Chris Wilson + +commit 5079830bd5f01740c4cbf84888bdf7a93bb2868e +Author: Chris Wilson +Date: Fri Mar 14 14:34:48 2014 +0000 + + intel-virtual-output: Mode names are freed with ScreenResources + + So we have to be careful not to continue to reference the strings after + they may be freed. + + Signed-off-by: Chris Wilson + +commit c64d2572bafeacae25e9b58c8372ce91858c3832 +Author: Chris Wilson +Date: Fri Mar 14 13:08:43 2014 +0000 + + sna: Allow some leeway when deciding to discard common translations + + Under PictFilterNearest, we can ignore fractional translations (not all + renderers discard those.) And if we are being approximate, we can loosen + our tolerance as well. + + Signed-off-by: Chris Wilson + +commit b61e6398f0cf94d3c483e30c05ceae4a8383d16c +Author: Chris Wilson +Date: Fri Mar 14 11:32:38 2014 +0000 + + sna: Ensure we flush SHM pixmaps if rendering to a GPU shadow + + Normally, we try to render into the CPU bo of a SHM pixmap. However, under + the right circumstances we may try to do a series of rendering into the + GPU bo and then copy it back to the CPU bo. In that case, we need to be + sure to mark the pixmap as requiring the flush. + + Signed-off-by: Chris Wilson + +commit f47f192f2240d19ede0a3a59b7970e4f563f3195 +Author: Chris Wilson +Date: Fri Mar 14 09:17:36 2014 +0000 + + intel-virtual-output: Include extra debug information for modesets + + Signed-off-by: Chris Wilson + +commit 0ad54325e94c4fd144c9fbcba25c3d167b6c5e18 +Author: Chris Wilson +Date: Fri Mar 14 07:42:32 2014 +0000 + + intel-virtual-output: Disable remote CRTCs at startup + + Signed-off-by: Chris Wilson + +commit cbcc1b6190ab733c9ab11543af4a4eb1890225e4 +Author: Kenneth Graunke +Date: Thu Mar 6 13:12:32 2014 -0800 + + uxa: Enable BLT acceleration on Broadwell. + + This supports solid, copy, put_image, and get_image acceleration via the + BLT engine. RENDER acceleration (composite) and Xv would be piles of work, + which is not worth doing since SNA exists, and Glamor is coming. + + Signed-off-by: Kenneth Graunke + +commit c1d7abadbb0009e9f2b9d8d3744d4ae5c13a1c8f +Author: Kenneth Graunke +Date: Thu Mar 6 13:12:31 2014 -0800 + + uxa: Remove implicit length from BLT command #defines. + + These command packets grew on Gen8. + + Signed-off-by: Kenneth Graunke + +commit 44fe21018330e0ce750ce25be36cc780ccdb78eb +Author: Chris Wilson +Date: Thu Mar 13 08:52:45 2014 +0000 + + sna/gen6+: Simplify BLT vs RENDER decisions for fill ops + + Signed-off-by: Chris Wilson + +commit 5d8ded0dd671fbcbd212e06afbea88a7a56a8f0d +Author: Chris Wilson +Date: Thu Mar 13 08:51:29 2014 +0000 + + sna: Nullify extra fill.ops + + I forgot that the initial memset(&fill, 0, sizeof(fill)) was no longer + performed and we rely on explicit initialisation during the setup, so + add the missing fields. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76088 + Signed-off-by: Chris Wilson + +commit 923b158e5c5dd50f943fe315a058410aeaa76269 +Author: Chris Wilson +Date: Thu Mar 13 08:14:48 2014 +0000 + + intel: Fallback to drmGetDeviceNameFromFd() + + If we are not supplied the path, call the libdrm function to search for + the canonical name for our device. + + Signed-off-by: Chris Wilson + +commit 202787ffa2bae5b1455137a344dabb9d85ee3aa0 +Author: Chris Wilson +Date: Wed Mar 12 23:57:04 2014 +0000 + + sna: Restore asserts that we do not map a freed buffer + + The complication comes with stolen bo that we treat as purged (because + they have no backing storage we can access) and so require an extra + caveat. + + Signed-off-by: Chris Wilson + +commit 4368a74b1c904625158f0b6baf98ef2a60bb54d4 +Author: Chris Wilson +Date: Wed Mar 12 17:37:01 2014 +0000 + + sna: Add DBG around using pixman's glyph cache + + Signed-off-by: Chris Wilson + +commit 08d73f1a4499cfe7c3121ff2ecdd36729c5f3544 +Author: Chris Wilson +Date: Wed Mar 12 12:17:55 2014 +0000 + + sna: Only couple up a proxy->rq when inserting into the request->buffers list + + Otherwise, we may never decouple it again afterwards leading to a + dangling pointer dereference. + + Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1289923 + Signed-off-by: Chris Wilson + +commit 2f50261539618c30c8470a5795fe5c2440e2318f +Author: Chris Wilson +Date: Wed Mar 12 10:51:56 2014 +0000 + + sna: Simplify code when no 64-bit registers are available in the ISA + + Signed-off-by: Chris Wilson + +commit 20026626d28b304a6156fb2c49752e18f2498de5 +Author: Chris Wilson +Date: Fri Mar 7 13:18:07 2014 +0000 + + sna: Missing fixes for using BLT points + + On a lone machine I had a vital fix for setting the destination tiling + bit inside the XY_PIXEL_BLT command. Sadly, I forgot about the fix before + the patch from another machine. + + Signed-off-by: Chris Wilson + +commit fd189c868908c81e7c57abf442ec1659efc2637a +Author: Chris Wilson +Date: Tue Mar 11 11:37:01 2014 +0000 + + sna/glyphs: Add a smattering of DBG for validating the glyph mask + + Signed-off-by: Chris Wilson + +commit d31569455ca25b7050a240cad58bea492c58194a +Author: Chris Wilson +Date: Tue Mar 11 10:46:06 2014 +0000 + + sna: Avoid using the wrong pitch for comparing replacement sizes + + Signed-off-by: Chris Wilson + +commit 8c5593037f31159532da992ae3b503c3b4a42f8e +Author: Chris Wilson +Date: Tue Mar 11 10:44:52 2014 +0000 + + sna: Assert that the pixmap pitch is initialised before use + + This is a sanity check that the pixmap is mapped for use by the CPU + prior to us actually using it. + + Signed-off-by: Chris Wilson + +commit dd1ff3230292a31d366c96b97711d7df97362093 +Author: Chris Wilson +Date: Tue Mar 11 10:06:24 2014 +0000 + + intel: Protect against a NULL platform device with server fd + + Signed-off-by: Chris Wilson + +commit 59f2f4885dbead3f2aece668f48c3ac749f724c2 +Author: Chris Wilson +Date: Tue Mar 11 10:00:27 2014 +0000 + + intel: Fix versioning of SUPPORTS_SERVER_FD + + The current snapshot is 1.15.99.901, which means that the new feature + will first be available in 1.15.99.902. + + Signed-off-by: Chris Wilson + +commit 78970676e79d462cf99509012db54479ba93c01a +Author: Chris Wilson +Date: Tue Mar 11 07:33:09 2014 +0000 + + sna: Be defensive when applying size restrictions to bo + + The assumption that all paths prevalidate the restrictions upon creation + the bo are false. Some important paths try to force the bo creation in + order to meet client expectations (e.g. DRI). So we are faced with + impossible requests which must fail, so make sure we do report those + failures. + + Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1289049 + Signed-off-by: Chris Wilson + +commit d10a5abcbd7c751adc08e24d9f4bdc33596b6f12 +Author: Chris Wilson +Date: Fri Mar 7 19:44:07 2014 +0000 + + intel: Supply a fallback guess for the device path + + If for some reason we have an fd, but no device path, use the likely + default path (derived from and validated against the major/minor of the + open device fd). + + Signed-off-by: Chris Wilson + +commit 28cab948f50b1d67468edbd9c8e10d3d696155f5 +Author: Hans de Goede +Date: Fri Mar 7 14:13:38 2014 +0100 + + intel: Add support for server managed fds + + In the post-modern world, the platform device nodes are handed to a + non-privileged Xserver by systemd/logind. We can then query the core for + our assigned fd rather than try to open the device for ourselves (which + would fail when trying to obtain DRM_MASTER status). A consequence is + that we then do not directly control DRM_MASTER status and must act as a + delegate of systemd. + + Signed-off-by: Hans de Goede + +commit e5f8118bdbc4655d987ab1c52e0a46fa85cc92c4 +Author: Chris Wilson +Date: Mon Mar 10 22:12:39 2014 +0000 + + sna: DBG compilation fixups + + Signed-off-by: Chris Wilson + +commit 6ed8570f6aa01fdd4edc3df7585f01083b4a9778 +Author: Chris Wilson +Date: Mon Mar 10 16:39:50 2014 +0000 + + sna: Pass render hints for migration based on source location + + Signed-off-by: Chris Wilson + +commit 955b5de4ba103fb115ec0b45f9b59eb2628ca3dd +Author: Chris Wilson +Date: Mon Mar 10 16:38:54 2014 +0000 + + sna/glyph: Release the pixman glyph cache along the error paths + + If we lock the glyph cache and then hit an error, we must make sure we + release our lock. An easy way would be not to lock when we may err. + + Signed-off-by: Chris Wilson + +commit e1cb0284218aaf248e251ac0d12fee4bcd3c7650 +Author: Chris Wilson +Date: Mon Mar 10 15:01:10 2014 +0000 + + sna/gen2: Fix build after last minute patch editing + + Whoops, the selective editing of the patch left a trailing '{' and + breaking the build. + + Signed-off-by: Chris Wilson + +commit 142f8461944b294dbc3fb0a7bf607bccf0bccc1f +Author: Chris Wilson +Date: Mon Mar 10 15:20:16 2014 +0000 + + sna/gen2: Tidy blend factor selection for the source + + Signed-off-by: Chris Wilson + +commit 0075c90d3192ba90ff1ae8a7b04bfc3ff4fccda7 +Author: Chris Wilson +Date: Mon Mar 10 15:17:51 2014 +0000 + + sna/gen2: Fix alpha blending with 8bit destination surfaces + + On gen2 (like gen3), 8-bit destination surfaces are read into the Green + channel (and written to from the Green channel). Therefore the expected + alpha blending must instead be converted to colour blending. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75818 + Signed-off-by: Chris Wilson + +commit f0b70ca660416af42be8b3f76f9e38a81dcac464 +Author: Chris Wilson +Date: Fri Mar 7 08:16:50 2014 +0000 + + sna: Unroll finding bbox of points + + Signed-off-by: Chris Wilson + +commit 928453b1bc5a059a87fbcdba9156d318a0310073 +Author: Chris Wilson +Date: Fri Mar 7 08:15:21 2014 +0000 + + sna: Emit points using the BLT primitive when appropriate + + Signed-off-by: Chris Wilson + +commit a2b4f2657f8cd503fce4e3b8cc3240d7b45d36ce +Author: Chris Wilson +Date: Wed Mar 5 09:51:24 2014 +0000 + + sna/gen8: Correct MOCS settings for render targets + + Signed-off-by: Chris Wilson + +commit a7123410a33f29c67a11f26d17ce8b0dc09cc594 +Author: Chris Wilson +Date: Mon Mar 3 10:12:11 2014 +0000 + + NEWS: Fix dates for 2014 + + It has come to my attention that between December and January is + traditionally a New Year. + + Signed-off-by: Chris Wilson + +commit a3bfb4d3c15e6a37aba5d2f5ba92134c5186e3a4 +Author: Chris Wilson +Date: Fri Feb 28 08:47:21 2014 +0000 + + sna: Reorder writes during thread task decoupling + + So that the lockless reads do not see the task complete signal prior to + marking the task as successful. Otherwise, we falsely detect that the + thread trapped a signal and kill them all. + + Signed-off-by: Chris Wilson + +commit 37d080929a20bd969749c6c12d1ef4ebe236063f +Author: Chris Wilson +Date: Thu Feb 27 08:36:40 2014 +0000 + + sna: Limit the WHOLE_HINT to large PutImages + + The goal here is to predict when we are uploading an entire image though + multiple PutImage requests. If the image is small enough, then the + PutImage will be contained within a single request and the damage + tracking will be accurate. + + Signed-off-by: Chris Wilson + +commit 27ac9f574f65cbd535751c925e9b2e2d7c8a6b3a +Author: Chris Wilson +Date: Thu Feb 27 08:33:52 2014 +0000 + + sna: Avoid promoting region-to-whole migration and discarding damage + + Fixes regression from + commit 1de1104064b5898cbed37e836901694a381c1266 + Author: Chris Wilson + Date: Fri Feb 21 22:43:04 2014 +0000 + + sna: Use a hint to do whole image uploads inplace + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75549 + Signed-off-by: Chris Wilson + +commit ff49944928c7399527b11bb0da7699711591c21a +Author: Chris Wilson +Date: Fri Feb 21 21:21:46 2014 +0000 + + sna: Tighten assertion for tiling blt fallbacks + + Signed-off-by: Chris Wilson + +commit cf4683209d11ca7382079feb242cc0c07fefc402 +Author: Chris Wilson +Date: Sat Feb 22 20:17:08 2014 +0000 + + sna/gen6+: Add missing DBG argument + + Signed-off-by: Chris Wilson + +commit a4d23ff3b2a75cc5a1c65b6b8464fc639c9f90b8 +Author: Chris Wilson +Date: Sat Feb 22 19:35:40 2014 +0000 + + sna: Add DBG for why trapezoids may be preferred inplace + + Signed-off-by: Chris Wilson + +commit d316d14283d8af86e4c5020f9974280570a78959 +Author: Chris Wilson +Date: Sat Feb 22 19:31:39 2014 +0000 + + sna: Include mono/precise hints in trapezoids DBG + + Signed-off-by: Chris Wilson + +commit 2a144baec87b17ead36373a8c5fd80f37be3ac19 +Author: Chris Wilson +Date: Sat Feb 22 19:19:11 2014 +0000 + + sna: Add a little more DBG to watch the flow of allocated bo sizes + + Signed-off-by: Chris Wilson + +commit 921e9aff3f8e7c4a33c352241311aeb4df3011fc +Author: Chris Wilson +Date: Sat Feb 22 18:29:27 2014 +0000 + + sna: Avoid signed overflow when printing allocated bytes in DBG + + Signed-off-by: Chris Wilson + +commit b0b6c043c997732559a971a788c24a5a73812df4 +Author: Chris Wilson +Date: Sat Feb 22 18:22:38 2014 +0000 + + sna: Cleanup caches if execbuf fails + + One of the failure modes for execbuf is running out of memory - often + this is reported as a false ENOSPC (thanks shmemfs!). Because of this, + we should try to resubmit after we purge our caches. + + Signed-off-by: Chris Wilson + +commit bfef9916124973b5e08f9b32eb1fcfb400ee4e8b +Author: Chris Wilson +Date: Sat Feb 22 18:12:24 2014 +0000 + + sna: Propagate thread signals for extra DBG + + Signed-off-by: Chris Wilson + +commit 64fc1bb9c87e95ff484ecd11f391b1c0d556d584 +Author: Chris Wilson +Date: Sat Feb 22 14:34:05 2014 +0000 + + sna: Allow SIGBUS/SEGV to kill the thread + + To handle sigtrapping of the threads, we allow the threads to handle + their async signals and upon hitting the trap, we kill the thread. All + the rest of the threads are reaped by the main xserver thread + afterwards. + + Signed-off-by: Chris Wilson + +commit 900499bff962a63e1d9b5f808d1deb65d55754a2 +Author: Chris Wilson +Date: Sat Feb 22 13:58:11 2014 +0000 + + sna: Move sigtrap wrapping closer to threaded sw composite + + Signed-off-by: Chris Wilson + +commit aae3bfeb28ca86b416a6a4de71eb23cdb46cf9de +Author: Chris Wilson +Date: Sat Feb 22 12:44:16 2014 +0000 + + sna: Assert that sigtrap is active + + Curiouser and curiouser. + + Signed-off-by: Chris Wilson + +commit 75cff26ebad33aca7ade7aa5a650235a7d42e47c +Author: Chris Wilson +Date: Sat Feb 22 10:05:41 2014 +0000 + + sna: Apply the dst offset for pixman fills + + Along one of the sw blt paths we failed to apply the offset for + Composite redirection. + + Reported-by: Jiri Slaby + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73811 + Signed-off-by: Chris Wilson + +commit 59d471de7fc7581b112f37a68714d0e1f8728dfd +Author: Chris Wilson +Date: Sat Feb 22 08:35:50 2014 +0000 + + sna: Handle asynchronous signals from threads + + By killing the threads and leaking their allocations - marginally + preferrable to losing the entire Xserver. + + Signed-off-by: Chris Wilson + +commit 1de1104064b5898cbed37e836901694a381c1266 +Author: Chris Wilson +Date: Fri Feb 21 22:43:04 2014 +0000 + + sna: Use a hint to do whole image uploads inplace + + Signed-off-by: Chris Wilson + +commit 2c0aacb869bea34620a2b0029ddfa7f2a9513dc7 +Author: Chris Wilson +Date: Fri Feb 21 21:48:36 2014 +0000 + + sna: Allow allocation to fail even when debugging + + Let the malloc failure propagate rather than assert. + + Signed-off-by: Chris Wilson + +commit cb87b179532a9b533df458f3367fde7fc3d64d0c +Author: Chris Wilson +Date: Fri Feb 21 21:41:52 2014 +0000 + + sna: Wrap inplace trapezoid operators with SIGBUS protection + + For the moment, this still leaves open the vexing question of how to + protect the multi-threaded variants, but it should provide more shelter + for extreme OOM. + + Signed-off-by: Chris Wilson + +commit b6fc46d63c5b7bc1347d4e03e71df9e6fdbcaaab +Author: Chris Wilson +Date: Fri Feb 21 21:21:46 2014 +0000 + + sna: Tighten assertion for tiling blt fallbacks + + Signed-off-by: Chris Wilson + +commit be6d218c6888bce41e15a8e4899618b5e6eacd99 +Author: Chris Wilson +Date: Fri Feb 21 19:43:30 2014 +0000 + + sna: Do not attempt fallback configuration without any CRTCs + + The fallback xf86InitialConfiguration() is another function that may + explode if called without any CRTCs attached. + + Signed-off-by: Chris Wilson + +commit 769a959d84d7e573b11cc1a7d85c122f17dfeea0 +Author: Chris Wilson +Date: Fri Feb 21 13:43:09 2014 +0000 + + sna: Do not register colormaps without any CRTCs + + The xserver may crash if we try to setup colormap handling without any + CRTCs, so don't. + + Suggested-by: Dave Airlie + Signed-off-by: Chris Wilson + +commit 0b92b1285ce553c4f475c7fb8ac57ba418009682 +Author: Chris Wilson +Date: Thu Feb 20 19:18:46 2014 +0000 + + backlight: Make search routine for device specific backlight common + + Signed-off-by: Chris Wilson + +commit caaf52834015c084704cf638f453b1fc3316eaa9 +Author: Chris Wilson +Date: Thu Feb 20 07:51:40 2014 +0000 + + sna: Query cursor size from the kernel + + Signed-off-by: Chris Wilson + +commit c91af569ee90a832899c9038badd84921e9a87fc +Author: Mark Kettenis +Date: Tue Feb 18 19:02:14 2014 +0000 + + backlight: Build fixes for OpenBSD + + Chris would like to humbly apologise for making these changes to the + OpenBSD code blind, and to thank Mark and Jonathan for their support + and understanding. + +commit ecc20fbcf8d5adb6c3b7d005c01788e35bba9d3c +Author: Chris Wilson +Date: Tue Feb 18 07:56:07 2014 +0000 + + intel-virtual-output: Discard unwanted events from the mouse recorder + + X always sends MappingNotify events (there is no way for the client + to ignore them). In particular, MappingNotify would be sent after a VT + switch, and this would knock out our ability to track the cursor.. + + Reported-by: Raul Dias + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75115 + Signed-off-by: Chris Wilson + +commit e860b3eaedcb5d56745d5bcc9ce720e9a0e9c293 +Author: Hans de Goede +Date: Mon Feb 17 13:16:54 2014 +0100 + + backlight-helper: Simplify reading the level from stdin + + Since the helper is a standalone app, the usual xserver rules of not using + stdio because of signal handling don't apply. + + And since the helper does run with elevated rights, it is important to keep + the code KISS so that it can be audited easily. + + This commit replaces the hard to read "raw" read loop with a much simpler + loop using fgets, improving readability of the code. + + Signed-off-by: Hans de Goede + +commit b5229c6e15964e723a7bb99d3c2c20a2fa168e3b +Author: Hans de Goede +Date: Mon Feb 17 13:16:53 2014 +0100 + + backlight: Drop rights before executing pkexec + + Event though we've failed to open the backlight normally, we may still be + running under a suid-root xserver, so drop any elevated rights before + executing what we hope will be pkxec. + + Signed-off-by: Hans de Goede + +commit 27a9dc4ce8fa3ba56f68e04d11a6272348772039 +Author: Hans de Goede +Date: Mon Feb 17 13:16:52 2014 +0100 + + backlight: Use System instead of system when checking for pkexec + + Even though we've failed to open the backlight normally, we may still be + running under a suid-root xserver, so use the servers build in System instead + of system so as to properly drop root rights. + + Signed-off-by: Hans de Goede + +commit 06066b7269b5ccf502c27466ad0434adfd9e3866 +Author: Hans de Goede +Date: Mon Feb 17 13:16:51 2014 +0100 + + backlight: Explain better why we support both pkexec and suid root for the helper + + Update the comment about trying suid-root first with some explanations of + why pkexec may be preferable in some cases. + + Signed-off-by: Hans de Goede + +commit 6b5c2b4515b646db6be0f9307f53651620516521 +Author: Chris Wilson +Date: Sat Feb 15 21:03:49 2014 +0000 + + backlight: tidy use of BACKLIGHT_CLASS + + Use string concantenation to simply the sprintf slightly. + + Signed-off-by: Chris Wilson + +commit eb7d2b19e2829b00317991fba05352e3ba1a1902 +Author: Chris Wilson +Date: Sat Feb 15 21:00:57 2014 +0000 + + backlight: Reject user overrides on OpenBSD + + We only handle the singular wscons OpenBSD interface for backlight, so + explicitly reject any user requests for something else. + + Signed-off-by: Chris Wilson + +commit 268842a47f05508fc7e1c69cd21e8e66a000dcde +Author: Chris Wilson +Date: Sat Feb 15 19:54:30 2014 +0000 + + backlight: Amalgamate hardcoded priority tables + + Our fallback path for finding the backlight interface uses a hardcoded + table of known backlight controllers in proirity order. Rather than + maintain this table twice in the midst of the KMS logic, push it to the + new set of common backlight routines. + + This incorporates bugfixes from SNA to handle unknown backlights, but + usable, gracefully. + + Signed-off-by: Chris Wilson + +commit b71f3d8bd4d6773899c1bdc903911cf240e68ead +Author: Jan Alexander Steffens (heftig) +Date: Sat Feb 15 17:53:16 2014 +0100 + + Backlight helper build fixes + + Don't hardcode $(prefix)/libexec + + Fix install hook when DESTDIR is set + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75028 + +commit 3d629c91cfa98b75c6685c2a2003e64fd1b612c4 +Author: Chris Wilson +Date: Sat Feb 15 14:55:09 2014 +0000 + + intel: Add a helper for setting backlight without root rights + + Once the xserver stops running as root on kms capabable systems, we will need + some other way to access the backlight. + + The approach taken in this patch moves most of the heavy lifting to a + helper that runs with root privileges and pipes our requested brightness + into the sysfs backlight interface. Where required, we use pkexec to + launch the helper with the elevated privilege. + + v2: Amalgamate much more of the duplicate code. + Keep the daemon and pipe alive for the lifetime of the backlight interface. + Provide an alternative for systems without PolicyKit. + + Signed-off-by: Hans de Goede [v1] + Signed-off-by: Chris Wilson + +commit a01548ccf192a5b1fa1f4a3e31e1634db39f6b39 +Author: Hans de Goede +Date: Sat Feb 15 00:02:36 2014 +0100 + + intel: export fd_set_cloexec / fd_set_nonblock + + Allow fd_set_cloexec / fd_set_nonblock to be used outside of intel_device.c. + + Signed-off-by: Hans de Goede + +commit 5601f8cc330fe88eadfa7238659c5abb223e3b28 +Author: Hans de Goede +Date: Sat Feb 15 00:02:35 2014 +0100 + + intel: Fix fd_set_nonblock + + O_NONBLOCK is a status flag not a descriptor flag, so F_GETFL / F_SETFL should + be used to modify it. + + Signed-off-by: Hans de Goede + +commit 8eb6335653e6e38228ecf95c3eef82ca2a864e45 +Author: Chris Wilson +Date: Fri Feb 14 19:36:47 2014 +0000 + + sna: Inherit the native rotation on initial output probing + + Signed-off-by: Chris Wilson + +commit 5f8714335729b4fbbb33d89dbaf0f13aa3d8427b +Author: Chris Wilson +Date: Fri Feb 14 16:18:34 2014 +0000 + + sna: Reorganise native rotation ioctls to compile on old Linux + + It is not just the BSDs that lack these ioctls in their userspace + headers, but everything older than about a year... + + Signed-off-by: Chris Wilson + +commit 699bde3991624c25d3b731caf7129ed87710b3b3 +Author: Chris Wilson +Date: Fri Feb 14 15:11:21 2014 +0000 + + sna: Guard use of DRM_MODE_OBJECT type ids + + These are not currently exported on OpenBSD and cause the build to fail. + Hide their use behind an ifdef guard for the time being. + + "I noticed the following when trying to compile xf86-video-intel git on OpenBSD: + + /usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: 'DRM_MODE_OBJECT_CRTC' undeclared (first use in this function) + /usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: (Each undeclared identifier is reported only once + /usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2106: error: for each function it appears in.) + /usr/users/jsg/src/xf86-video-intel/src/sna/sna_display.c:2107: error: 'DRM_MODE_OBJECT_PLANE' undeclared (first use in this function)" + + Reported-by: Jonathan Gray + Signed-off-by: Chris Wilson + +commit 37dbd669415ac82a79b3699da0450aaf68cb1c4c +Author: Chris Wilson +Date: Fri Feb 14 14:53:14 2014 +0000 + + sna: Check that the backlight interface is in sysfs before access + + Before we write values into the file, we want to be sure that it is our + sysfs backlight interface, and not some ordinary file we are about to + destroy. + + Signed-off-by: Chris Wilson + +commit 3a893d14cd227454826a9a86cb3ce227d04bc352 +Author: Chris Wilson +Date: Thu Feb 13 22:46:22 2014 +0000 + + sna: Increase the acceptable screen size range + + Signed-off-by: Chris Wilson + +commit 2d9fcb3f729e3959dd30b7d7859438894b806b34 +Author: Chris Wilson +Date: Thu Feb 13 22:36:36 2014 +0000 + + sna: Filter out requests to create a 0x0 frontbuffer + + Attempting to create a 0x0 frontbuffer results in erroneous pixmap + generation, and is liable to explode at a random point in future, so + just reject it outright. + + Signed-off-by: Chris Wilson + +commit 1037a1a3f6a8dbde017a28a7b59ef5398c84dba1 +Author: Chris Wilson +Date: Thu Feb 13 21:36:26 2014 +0000 + + sna: Fix comparison of previous BLT commands + + After altering the command bits to accommodate Broadwell, we needed to + fixup the comparison of previous BLT commands to detect overwritten + commands. + + Signed-off-by: Chris Wilson + +commit 9a9f6a9487201e4c80338e771eec28067f044240 +Author: Chris Wilson +Date: Thu Feb 13 16:18:43 2014 +0000 + + uxa: Check for access to backlight interface + + Before attaching properties to any connector, check that we can indeed + control the backlight through the sysfs interface by doing an access + check. If the xserver is started without root privileges, we cannot + write through /sys/class/backlight and so should take care not to + advertise that we can. + + Reported-by: Hans de Geode + Signed-off-by: Chris Wilson + +commit 611490a176d9bfd136f4340f7c31e0e0f0beea4e +Author: Chris Wilson +Date: Thu Feb 13 16:18:43 2014 +0000 + + sna: Check for access to backlight interface + + Before attaching properties to any connector, check that we can indeed + control the backlight through the sysfs interface by doing an access + check. If the xserver is started without root privileges, we cannot + write through /sys/class/backlight and so should take care not to + advertise that we can. + + Reported-by: Hans de Geode + Signed-off-by: Chris Wilson + +commit 83d17cded854871fd41cd3fcf25f38c9b67a4705 +Author: Chris Wilson +Date: Thu Feb 13 12:57:50 2014 +0000 + + sna: Clear DPMS tracking on VT switch + + Assume the worst and force us to reset the property when we restore + control. + + Signed-off-by: Chris Wilson + +commit 135da294106f7158bb68eeeb9e6c171bcddd94f3 +Author: Chris Wilson +Date: Thu Feb 13 11:58:15 2014 +0000 + + sna: Extend native rotation support to sprites + + The sprite plane can be independently rotated to the CRTC primary plane. + To rotate the sprite plane, we just set a property on the plane similar + to how we rotate the CRTC, so we can refactor them together to use the + same routines. + + Signed-off-by: Chris Wilson + +commit e35017e36e45c57ea9847eb5c8466cac3c4d2cc4 +Author: Chris Wilson +Date: Thu Feb 13 14:46:39 2014 +0000 + + sna: Enable coordinate transforms for native CRTC rotation + + Otherwise X tells Clients that the cursor is still in the unrotated + location when it appears rotated on the display. + + Signed-off-by: Chris Wilson + +commit 72e909953c1865f86fbd6325ff807d7c7357af5f +Author: Chris Wilson +Date: Thu Feb 13 09:46:13 2014 +0000 + + Revert "uxa: Do not change DPMS mode on unconnected outputs" + + This reverts commit 4497212307dee5e35bc6836201738a2fdb559020. + + Unfortunately, this simple fix does not work for UXA as DPMS is used by + the xserver to turn off CRTCs and outputs. Since UXA does not implement + CRTC DPMS, this commit causes us to fail to turn off outputs. + + The kernel has been fixed up in the meantime and that commit has been + recommended to be backported to all stable kernels: + + commit c9976dcf55c8aaa7037427b239f15e5acfc01a3a + Author: Chris Wilson + Date: Sun Sep 29 19:15:07 2013 +0100 + + drm/i915: Only apply DPMS to the encoder if enabled + + so it should be safe for UXA to rely on its old behaviour. + + Bugzilla: https://code.google.com/p/chromium/issues/detail?id=341135 + References: https://bugs.freedesktop.org/show_bug.cgi?id=68030 + Suggested-by: Dominik Behr + Signed-off-by: Chris Wilson + +commit 1c5ccf5d9d8beb7e8343eb2d07bbf97f53c1a224 +Author: Chris Wilson +Date: Thu Feb 13 01:06:41 2014 +0000 + + sna: Always assign a name to the modes + + In some cases, such as querying the mode from the CRTC, we may not have + a name associated with the mode. However, RandR always expects a valid + name. To satisfy this requirement, always generate the canonical mode + name if no other is specified. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=70132 + Signed-off-by: Chris Wilson + +commit fb89bfc73f4103ca6116c8f91970f4bfa491636c +Author: Chris Wilson +Date: Wed Feb 12 16:41:51 2014 +0000 + + sna/gen5: Flush the render cache between operations + + When we change the blend mode between operations, it appears that we + must flush the render cache or else we risk render corruption. This is + usually noticeable in rendering of single glyphs. + + This was originally fixed for bug 51422, but was reintroduced by + commit 37eb7343be1aeeb90a860096756603a577df1a77 + Author: Chris Wilson + Date: Sat Dec 1 09:40:11 2012 +0000 + + sna/gen5: Inspired by gen4, reorder the flushing + and the desire to reduce the impact of this w/a. + + Reported-by: itumaykin@gmail.com + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74882 + Signed-off-by: Chris Wilson + +commit 564a766a6bbe8bcf2480248a54059e7d6727440d +Author: Chris Wilson +Date: Wed Feb 12 16:19:25 2014 +0000 + + intel-virtual-output: Do not resize the screen whilst all outputs are off + + If all the outputs are off, we try to resize the screen to 1x1, which is + typically illegal. So, just keep the existing screen and xfer buffer for + next time it is enabled. + + Signed-off-by: Chris Wilson + +commit 87b9d9f507885ed98d7249940218631b775d30ea +Author: Chris Wilson +Date: Wed Feb 12 15:48:20 2014 +0000 + + intel-virtual-output: Force an output probe on initial connection to remote display + + Signed-off-by: Chris Wilson + +commit dda57f2e28e01ea254cb2aba9e0846b755c4175a +Author: Chris Wilson +Date: Wed Feb 12 15:47:00 2014 +0000 + + intel-virtual-output: Fix checking for no change in output modes + + Signed-off-by: Chris Wilson + +commit 94e5ca3d5ab33c8e9b86a4f60c712da72df15b3d +Author: Chris Wilson +Date: Wed Feb 12 15:13:42 2014 +0000 + + intel-virtual-output: Always requery modes after OutputNotify + + References: https://bugs.freedesktop.org/show_bug.cgi?id=74800 + Signed-off-by: Chris Wilson + +commit d84940cc9d297df00477c838b4f53883c19a1da4 +Author: Chris Wilson +Date: Wed Feb 12 14:48:24 2014 +0000 + + intel-virtul-output: Double check timestamps + + Compare both res->timestamp and res->configTimestamp for changes in + state. + + Signed-off-by: Chris Wilson + +commit 607737cc47788e2a8896fddfece907a3cfb24f7f +Author: Chris Wilson +Date: Wed Feb 12 11:33:45 2014 +0000 + + sna: Support native primary plane rotations + + Use the display hardware for simple rotations, when exported through the + rotation property on the CRTC. + + As the kernel support is not yet merged upstream, the feature is hidden + behind --enable-rotation. + + Signed-off-by: Chris Wilson + +commit 3b43630f5525a60e935dbc46e70354bb45444814 +Author: Chris Wilson +Date: Wed Feb 12 10:43:46 2014 +0000 + + Revert "sna/gen6: Serialise write to DERRMR register using STORE_REGISTER_MEM" + + This reverts commit 2a5ad9c015bbb41550536dd3cf4ad18b7f21fd80. + + Oops, pushed from the wrong machine and merged in a incomplete bugfix + branch. + + Signed-off-by: Chris Wilson + +commit fb69bd16a30cd0449fa9bb603dacd001e777b5bb +Author: Chris Wilson +Date: Wed Feb 12 10:34:34 2014 +0000 + + sna/gen5: Use the DBG option ALWAYS_FLUSH to force a full flush + + When flushing between operations, we can choose between doing a full + flush to memory, or just a pipeline flush. For debugging it is better to + do the full flush to rule out cache effects. + + Signed-off-by: Chris Wilson + +commit 77f8d9ca84342b256de1e118edfd14ddae4d593f +Merge: 3fb39d4 27663f3 +Author: Chris Wilson +Date: Wed Feb 12 10:32:50 2014 +0000 + + Merge branch 'master' of hsw:/usr/src/xf86-video-intel + +commit 27663f31163c22f7dfaf8f5a3e45fa1c93a7d9e4 +Author: Chris Wilson +Date: Wed Feb 12 09:58:06 2014 +0000 + + sna/gen5: Add a DBG option to force flushes between operations + + Signed-off-by: Chris Wilson + +commit 834e8078fc1b8d3acba9fa887d6dcdd861e3c15a +Author: Chris Wilson +Date: Wed Feb 12 09:50:35 2014 +0000 + + sna: Retrieve tiling for fbcon + + Yikes, there appear to be tiled fbcon framebuffers on the horizon. + + Signed-off-by: Chris Wilson + +commit 69d4c15d525065374de50d624388252152a36b8b +Author: Chris Wilson +Date: Wed Feb 12 07:56:10 2014 +0000 + + sna: Delete redundant branch + + The MOVE_READ else branch is repeated immediately below when marking up + damage for MOVE_WRITE, so remove it for simplicity. + + Signed-off-by: Chris Wilson + +commit ec39adc93a4a127b34704a2012182b5c72b3a9b3 +Author: Chris Wilson +Date: Tue Feb 11 23:08:35 2014 +0000 + + Record Video ABI version that we configure against + + Signed-off-by: Chris Wilson + +commit 3fb39d477909a433ae67bdfc69ad870ddabee3a7 +Merge: 2a5ad9c c02067d +Author: Chris Wilson +Date: Tue Feb 11 21:57:23 2014 +0000 + + Merge branch 'master' of hsw:/usr/src/xf86-video-intel + +commit c02067dcf514f19beb0e17b5765826148386e673 +Author: Chris Wilson +Date: Tue Feb 11 21:21:17 2014 +0000 + + sna: Defer move-to-gpu until we need to transfer GPU damage to CPU + + When preparing a pixmap for CPU rendering, one of the last steps is to + copy the outstanding GPU damage back to the CPU. Currently, we flush any + outstanding pageflips (for TearFree) and in the process accidentally + destroy the shadow buffer if there is no outstanding GPU damage. Rearrange + the code to avoid tripping over that by only processing the move-to-gpu if + we need to touch the GPU bo. + + Signed-off-by: Chris Wilson + +commit 2a5ad9c015bbb41550536dd3cf4ad18b7f21fd80 +Author: Chris Wilson +Date: Tue Feb 11 11:23:37 2014 +0000 + + sna/gen6: Serialise write to DERRMR register using STORE_REGISTER_MEM + + Signed-off-by: Chris Wilson + +commit 5142d1ca3fd877f2ca9277af314f6432580370de +Author: Chris Wilson +Date: Mon Feb 10 16:42:06 2014 +0000 + + sna: Remove damaged region after converting CPU bo to GPU bo + + Reported-by: Jiri Slaby + References: https://bugs.freedesktop.org/show_bug.cgi?id=70461 + Signed-off-by: Chris Wilson + +commit 1267235fd474c5249d45a7015e3d741dc607e57f +Author: Chris Wilson +Date: Mon Feb 10 16:37:38 2014 +0000 + + sna: Check for overwriting damage before applying clear + + Signed-off-by: Chris Wilson + +commit 2f99070708ce8f591c31e1e908809a0ce551c13f +Author: Chris Wilson +Date: Mon Feb 10 14:19:53 2014 +0000 + + sna: Clear GPU damage flag for 1x1 writes onto a clear buffer + + An optimisation for 1x1 reads of a clear buffer lead to a bug whereby + the damage for a 1x1 write would not be tracked correctly (conflicting + full GPU damage vs partial CPU damage). + + Signed-off-by: Chris Wilson + +commit 2fb2cd092dadba40b5ad2da57943c660a0c9bc14 +Author: Chris Wilson +Date: Mon Feb 10 09:35:11 2014 +0000 + + 2.99.910 snapshot + +commit 37d8566ee78c67647b159a96ddb2675d1506b967 +Author: Chris Wilson +Date: Sun Feb 9 12:28:27 2014 +0000 + + sna/gen6: Restore stall dropped when not flushing instead + + commit 82e6d41c2f4f343bd1854d3d8ee4b624b5d68971 + Author: Chris Wilson + Date: Thu Oct 31 13:35:59 2013 +0000 + + sna/gen6: Tweak flush around CC state changes + + Replaced the pipeline stall with a flush - but only when the target was + dirty. The missing stall however seems to be required as well. + + v2: Actually emit the stall for all CC state changes [Ilia Mirkin] + + Reported-by: Ilia Mirkin + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72375 + Signed-off-by: Chris Wilson + +commit 823382d28944a319c207f20ecef25ce1707a8021 +Author: Chris Wilson +Date: Thu Feb 6 10:13:41 2014 +0000 + + sna: And clear drawable->id on reused pixmaps + + References: https://bugs.freedesktop.org/show_bug.cgi?id=74550 + Signed-off-by: Chris Wilson + +commit 6fc46adb18a8410074c12d6e8979ef01813ebdf2 +Author: Chris Wilson +Date: Thu Feb 6 09:24:17 2014 +0000 + + uxa: Do not expose TextureVideo Xv adapters when acceleration is disabled + + Signed-off-by: Chris Wilson + +commit 1eadd1d0b1c8bcbf11eb7c0e112d1e424b63c25e +Author: Chris Wilson +Date: Thu Feb 6 09:04:30 2014 +0000 + + sna: Add some DBG to clarify the source pixmap (for tiles) + + Signed-off-by: Chris Wilson + +commit 4d1a2ef9553c663bb97b56adde6f6b41241ff528 +Author: Chris Wilson +Date: Thu Feb 6 08:29:20 2014 +0000 + + sna: Reset composite offsets when reusing freed pixmaps + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74550 + Signed-off-by: Chris Wilson + +commit 79d2f96bdfa0d7ae1567bf4b57b4f86aae424f50 +Author: Chris Wilson +Date: Wed Feb 5 15:30:30 2014 +0000 + + sna: Add some DBG around tiled blts + + References: https://bugs.freedesktop.org/show_bug.cgi?id=74550 + Signed-off-by: Chris Wilson + +commit 02eceefa2909075aca0ba3df7fdba835079aeb78 +Author: Chris Wilson +Date: Wed Feb 5 11:41:42 2014 +0000 + + sna: Pass read hints from move-to-cpu to wait_for_shadow + + Signed-off-by: Chris Wilson + +commit de73c5fd1cd4f948b8bd3582ae788f6f855c5b16 +Author: Chris Wilson +Date: Tue Feb 4 20:57:24 2014 +0000 + + sna: Tweak assert_bo_retired() to be callable on cached bo + + References: https://bugs.freedesktop.org/show_bug.cgi?id=73406 + Signed-off-by: Chris Wilson + +commit 0906769c1b92520351729c4d8f2ab684d3ddf2eb +Author: Chris Wilson +Date: Tue Feb 4 17:51:51 2014 +0000 + + sna: Rearrange assertion to ease use of substitute cached bo + + Since we call kgem_bo_submit() along one path when synchronising a + cached bo (which is known to be inactive) but still want to keep the + assertion on the refcnt, simply rearrange the code to only assert on the + active path. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=73406 + Reported-by: Matti Hamalainen + Signed-off-by: Chris Wilson + +commit fc001615ff78df4dab6ee0d5dd966b723326c358 +Author: Chris Wilson +Date: Tue Feb 4 10:36:21 2014 +0000 + + sna/gen4: Disable use of pipecontrol invalidates again + + One day, just not today, we may make gen4 work correctly, efficiently and + fast. Today, we can barely pick one. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=55500 + Signed-off-by: Chris Wilson + +commit c6a21f0355447d398a8b857ad046cd27141d4744 +Author: Chris Wilson +Date: Tue Feb 4 08:51:17 2014 +0000 + + sna/glyphs: Reset composite state between switching glyph formats + + One path uses the mask channel, the other does not. We cannot rely on + overwriting all reused state in this case, and so we must clear the + composite state prior to use each time. + + Reported-by: Arkadiusz Miskiewicz + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74494 + Signed-off-by: Chris Wilson + Tested-by: Arkadiusz Miskiewicz + +commit 1cbc59a917e7352fc68aa0e26b1575cbd0ceab0d +Author: Edward Sheldrake +Date: Mon Feb 3 09:34:33 2014 +0000 + + sna/gen4,5: Fix setting pipe control cache flush bits + + Cache flush bits are on dword 0, not 1, on gen4 and gen5. Also texture + cache invalidate is only available from Cantiga onwards. + +commit 7f08250a8960f90f6bd34de8c4a17870703bfa60 +Author: Chris Wilson +Date: Sun Feb 2 03:52:11 2014 +0000 + + sna: Reconstruct damage for the partially replaced discarded CPU bo + + Signed-off-by: Chris Wilson + +commit 853588ad5be9407d2123f6055458ca84e72b8eb9 +Author: Chris Wilson +Date: Sat Feb 1 21:55:09 2014 +0000 + + sna: If IGNORE_CPU is not set we must mark the move as MOVE_READ + + Logic reversal in discarding CPU damage. An old bug revealed by the more + aggressive attempts to discard CPU damage. + + Signed-off-by: Chris Wilson + +commit 8b0748c57ee4c38ea98c4b6ca18cb2b99f8f9ed4 +Author: Chris Wilson +Date: Sat Feb 1 21:54:43 2014 +0000 + + sna: Add some more DBG for choosing render targets + + Signed-off-by: Chris Wilson + +commit ed8d4f0ce3bff662d02063528df64d478ac0dc00 +Author: Chris Wilson +Date: Sat Feb 1 21:38:47 2014 +0000 + + sna: Skip discarding CPU bo when using as a render target + + The issue with unwanted serialisation does not affect the async + move-to-cpu of a render target. + + Signed-off-by: Chris Wilson + +commit 26613b046012f0ad968a15ab6bdfa8f6a6652e77 +Author: Chris Wilson +Date: Sat Feb 1 21:37:41 2014 +0000 + + sna: Allow more inplace promotions of CPU to GPU bo + + If the CPU bo is wholly damaged, then it makes an ideal candidate for + simply converting into the GPU bo. + + Signed-off-by: Chris Wilson + +commit 699b4fd3139d1d6d02911d6c8f193ead3445f613 +Author: Chris Wilson +Date: Sat Feb 1 20:13:53 2014 +0000 + + sna: Undo region translation before returning + + Signed-off-by: Chris Wilson + +commit 2c4b2ed558bec3b71077fb12cc4e008cccc819fa +Author: Chris Wilson +Date: Sat Feb 1 17:59:29 2014 +0000 + + 2.99.909 snapshot + +commit 495bf89496a96eff0b2c5b6a95aa29df8d7fbc81 +Author: Chris Wilson +Date: Sat Feb 1 18:57:06 2014 +0000 + + sna: Apply drawable offsets to partial CPU damage being replaced + + Signed-off-by: Chris Wilson + +commit 2ba8d40bf7e4d3e8fa541c001f82aa65f26bed3a +Author: Chris Wilson +Date: Sat Feb 1 18:13:04 2014 +0000 + + sna: Don't discard the GPU prior to using it for stashing CPU damage + + Signed-off-by: Chris Wilson + +commit 534f19dc5a302828fe60d0f4747ad0dc9617e1a9 +Author: Chris Wilson +Date: Sat Feb 1 17:56:58 2014 +0000 + + sna: Remark the region as damaged after uploading the rest to the GPU + + If we upload outside of the replaced region to the GPU, we need to + remark the region of operation as dirty. + + Signed-off-by: Chris Wilson + +commit 2814748b91c80c8935ea2f366e954a80bef69bb0 +Author: Chris Wilson +Date: Sat Feb 1 17:37:42 2014 +0000 + + sna: Only discard CPU damage for an replacing region + + When considering move-region-to-cpu, we need to take into account that + the region may not replace the whole drawable, in which case we cannot + simply dispose of an active CPU bo. + + Reported-by: Bas Nieuwenhuizen + Reported-by: Conley Moorhous + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74327 + Signed-off-by: Chris Wilson + +commit 3e784832a52686cd29d62bdeac7b1c539c640c5b +Author: Chris Wilson +Date: Sat Feb 1 16:55:32 2014 +0000 + + glamor: Enable Xv support + + In addition to the UXA texture paths (which in theory support VSync) and + direct overlay support, create a textured video paths that utilize the + glamor acceleration code. + + Requested-by: Fabio Pedretti + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74311 + Signed-off-by: Chris Wilson + +commit 3f2e199b6b4ce86ba3922f9f2dea5f6cba053453 +Author: Chris Wilson +Date: Fri Jan 31 17:59:30 2014 +0000 + + 2.99.908 snapshot + +commit 1f9a6156e9240a1efa8785ab5bca0a3b1757d08e +Author: Chris Wilson +Date: Fri Jan 31 20:02:44 2014 +0000 + + sna: remove short-circuit for move-to-CPU when damage covers region + + The short-circuit path missed translating the damage from drawable space + into the pixmap (for Composite setups) which may have resulted in + corruption. The path was also failing to consider the impact of reusing + an active CPU bo when it could be discarding the unwanted damage and + reallocating. + + Signed-off-by: Chris Wilson + +commit 539b749416b275d84e05e2a5b62d946903aa3d29 +Author: Chris Wilson +Date: Fri Jan 31 18:02:51 2014 +0000 + + sna: Use 24bpp rendering by default for gen2 again + + Too many users where unhappy that their software was broken. Too bad the + same software is also broken at high bit depths as well. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=73877 + Signed-off-by: Chris Wilson + +commit bdb1a62ce21f3eb5e27e411b78f13ad2aea963a4 +Author: Chris Wilson +Date: Fri Jan 31 16:42:46 2014 +0000 + + sna: Balance memory accounting for buffer objects + + A couple bugs ended up with CPU bo gradually accumulating whilst the + overall number of bo vanished. + + Signed-off-by: Chris Wilson + +commit f934ee78a000815e14e36bd0caa279cb35d07bfe +Author: Chris Wilson +Date: Fri Jan 31 15:39:23 2014 +0000 + + sna: Reorder assignments vs DBG + + It helps reading the debug log if what we print is correct. + + Signed-off-by: Chris Wilson + +commit bdbb928ea38977bd2784f454f35db2ac2c13c34c +Author: Chris Wilson +Date: Fri Jan 31 15:03:43 2014 +0000 + + sna: Actually reuse pixmap headers for ordinary pixmaps + + commit 3dbf17f00e200e864818b0b8ca762183cff9085f [2.99.907] + Author: Chris Wilson + Date: Tue Dec 3 12:10:01 2013 +0000 + + sna: Mark up an ordinary pixmap for reuse + + started to put the frequently allocated pixmaps into the object cache - + but as those frequent allocations themselves did not use the cache, the + cache kept growing. + + Bugzilla: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1272338 + Signed-off-by: Chris Wilson + +commit dfac4650e621055c5504c1bcf6df6449afa6d8d2 +Author: Chris Wilson +Date: Fri Jan 31 14:28:56 2014 +0000 + + sna: Tidy up pixmap header allocations + + Refactor some more of the common code, and add some debug tracking. + + Signed-off-by: Chris Wilson + +commit 098a1163e9730b428351fa54e8765261f5350d21 +Author: Chris Wilson +Date: Fri Jan 31 14:10:36 2014 +0000 + + sna: Show the memory debug info again + + This needs to be visible whenever we --enable-debug=memory. Make it so, + and trim it to a single line in the process. + + Signed-off-by: Chris Wilson + +commit 166e8e9e5d79f64e30230d9520b9f6cafa7dd0d0 +Author: Chris Wilson +Date: Thu Jan 30 12:19:04 2014 +0000 + + sna: Silence a compiler warning for mismatching const strings + + sna_display.c: In function 'preferred_mode': + sna_display.c:3393:7: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] + mode = xf86GetOptValString(output->options, OPTION_PREFERRED_MODE); + + Signed-off-by: Chris Wilson + +commit ca2d9e69d08f5438a34dbf55ab058f5c4c3b3650 +Author: Chris Wilson +Date: Thu Jan 30 12:18:05 2014 +0000 + + sna: Suppress warning for freeing a "constant" string + + We allocated and own the string, so we can free it! + + sna_display.c: In function 'sna_output_get_modes': + sna_display.c:2314:4: warning: passing argument 1 of 'free' discards 'const' qualifier from pointer target type [enabled by default] + free(current->name); + + Signed-off-by: Chris Wilson + +commit 5ef675159fd83ee393a86220eb4f8c514da8d0e7 +Author: Chris Wilson +Date: Thu Jan 30 12:17:02 2014 +0000 + + sna: Handle char *backlight_iface + + The backlight_iface is a freeable string, in places we were assigning a + constant string and later freeing it. + + Signed-off-by: Chris Wilson + +commit 76e430e92c19ea799547e4e6ae1f389ebc6eaac5 +Author: Chris Wilson +Date: Thu Jan 30 12:13:16 2014 +0000 + + sna: Constify GCFunc to quieten the compiler. + + We keep a pointer to the old funcs when wrapping, this now needs to be const. + + sna_accel.c: In function 'sna_gc_move_to_cpu': + sna_accel.c:4008:17: warning: assignment discards 'const' qualifier from pointer target type [enabled by default] + sgc->old_funcs = gc->funcs; + + Signed-off-by: Chris Wilson + +commit 57445e57d4dfc080620ff0e4f9ec9a63b0feb355 +Author: Chris Wilson +Date: Wed Jan 29 16:48:21 2014 +0000 + + sna: Fix format specifier typo ('%D') in DBG + + Signed-off-by: Chris Wilson + +commit 139fc76260ebeb4f4cc04c56b9ebf7f70bed660d +Author: Chris Wilson +Date: Wed Jan 29 13:42:50 2014 +0000 + + sna: Always clear the domain even only a potential sync + + It helps to keep the domain-tracking bookkeeping consistent. + + Signed-off-by: Chris Wilson + +commit d70620d9789da1cf983dac318d9ca9149f11ff20 +Author: Chris Wilson +Date: Wed Jan 29 13:39:20 2014 +0000 + + sna: We can only retire a bo if is not referenced by the current batch + + Fixes regression from + commit 8b0ebebcab21647348f769c25ca0c1d81d169e75 + Author: Chris Wilson + Date: Tue Jan 28 16:30:47 2014 +0000 + + sna: Be a little more assertive in retiring after set-domain + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74176 + Reported-by: Jan Alexander Steffens + Signed-off-by: Chris Wilson + +commit 971a5e64f574f09ef43bcca9e0bd02cb0e42aa03 +Author: Chris Wilson +Date: Wed Jan 29 13:15:43 2014 +0000 + + sna: Add assertions for set/get binding + + Signed-off-by: Chris Wilson + +commit 7df3da10e744d7f168ea3f30b21c434f99beae17 +Author: Chris Wilson +Date: Wed Jan 29 13:06:08 2014 +0000 + + sna/gen4+: Assert that the cached binding location is valid + + We can at least check that it is in the right region (i.e. not past + where the current surface has been allocated from). + + References: https://bugs.freedesktop.org/show_bug.cgi?id=74176 + Signed-off-by: Chris Wilson + +commit 001dd080e15157961188c96718669dd1b4d6b939 +Author: Chris Wilson +Date: Wed Jan 29 11:15:45 2014 +0000 + + sna: Do not use color corrected pixel values for comparing against gc + + Dashed zero-width lines devolve into two passes (first to draw the + foreground dashes, and then to draw the gaps). The code was using the + pixel value to decide which phase was being drawn -- however the color + on the gc is not always bit exact (e.g. alpha channel) with the pixel + value. As a result, we would oft miss drawing anything when rendering + into the scanout. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1059152 + Signed-off-by: Chris Wilson + +commit 872468a059e164235527d1501940b2740d3da2ff +Author: Chris Wilson +Date: Wed Jan 29 05:40:00 2014 +0000 + + sna/gen6+: Encourage inplace uploads for Composite + + First try using the blt path for a potential inplace upload for a + simple composite operation copying from a ShmPixmap. + + Signed-off-by: Chris Wilson + +commit 4b73a0ea22b43807c0118f4d7e9dcac3f0626463 +Author: Chris Wilson +Date: Wed Jan 29 05:32:25 2014 +0000 + + sna: Skip undamaged TearFree redisplays + + If we have not had cause to flush the wait_for_shadow buffer during the + course of the rendering, then we never wrote to the backbuffer and its + contents are still identical to the current frontbuffer. So if the + wait_for_shadow is still flagged as required on the scanout, we know we + can safely discard the redisplay request. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=70905 + Signed-off-by: Chris Wilson + +commit 9f3fc9ec49f0caf53344577896ef9b6468cd3d4f +Author: Chris Wilson +Date: Tue Jan 28 21:56:23 2014 +0000 + + Allow selection of glamor as the default acceleration method + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74162 + Signed-off-by: Chris Wilson + +commit 2425f03432de9bedeeda14ddbc5742cf7ce22874 +Author: Chris Wilson +Date: Tue Jan 28 19:17:14 2014 +0000 + + sna: Check for a hang after a spurious error return from set-domain-ioctl + + set-domain-ioctl should only ever fail for invalid user input, beyond + the normal signal handling. As such if we do find a spurious error + return from the kernel, check for a GPU hang. + + Signed-off-by: Chris Wilson + +commit 8b0ebebcab21647348f769c25ca0c1d81d169e75 +Author: Chris Wilson +Date: Tue Jan 28 16:30:47 2014 +0000 + + sna: Be a little more assertive in retiring after set-domain + + After a successful set-domain for writing with the CPU, we know that the + buffer is idle so remove it from our request tracking. (External clients + complicate matters in that they may keep the bo active even after our + set-domain.) On the contrary, because of read-read optimisations a bo + may still be active after a set-domain for reading by the CPU, in which + we need to remain conservative in retiring the bo. + + Signed-off-by: Chris Wilson + +commit b99c8cbefdd8fec686ad81fbffebb70d43880779 +Author: Chris Wilson +Date: Tue Jan 28 12:51:00 2014 +0000 + + sna: Cancel the backlight change if set-property(DPMS) fails + + If the kernel reports an error from setting the DPMS property, we need + to undo the local changes and propagate back the error to the caller. + Although the latter is prevented by the RandR API, we can at least + restore the backlight. + + Signed-off-by: Chris Wilson + +commit 47effa1854e331643302146db238e6b092de8a9a +Author: Chris Wilson +Date: Mon Jan 27 21:48:33 2014 +0000 + + sna: Rearrange damage allocation to handle malloc failure more gracefully + + If we fail to allocate new damage boxes, first try collescing the + existing boxes to free up memory. + + Signed-off-by: Chris Wilson + +commit ad7daf9aae487af13c0578de95652675d4d2ed7d +Author: Chris Wilson +Date: Mon Jan 27 21:20:40 2014 +0000 + + sna: Use signal-safe DBG + + Otherwise we end up confusing the core Xserver functions when called + from auxilliary threads. + + Signed-off-by: Chris Wilson + +commit 294180b3bf78f2c0ae2f1197e1c0819d99009356 +Author: Chris Wilson +Date: Fri Jan 24 14:21:44 2014 +0000 + + sna/gen3+: Allow for spill when aligning vertices + + We need to flush the batch if we run out of space aligning our vertex + buffer - but the test must anticipate the space required for the new + alignment. + + Reported-by: Arkadiusz Miskiewicz + Signed-off-by: Chris Wilson + +commit 4385724dc49dd090e0a5956e287f80b92ebd70e8 +Author: Chris Wilson +Date: Fri Jan 24 11:29:26 2014 +0000 + + sna/gen2+: Inspect composite flags to discard unneeded CPU damage + + We can now check whether the Composite operation will require existing + CPU damage and if not discard it. + + Signed-off-by: Chris Wilson + +commit c9e9c85fc7b21e231c2532fe1c75b92307e112ed +Author: Chris Wilson +Date: Thu Jan 23 19:04:27 2014 +0000 + + sna/gen2,3: Don't set BLT_DST_TILED + + This bit only exists for gen4+ so avoid setting it on gen2 and gen3, + whilst setting it doesn't seem to cause any harm, there is no reason to + risk it... + + Signed-off-by: Chris Wilson + +commit 6914b3af7f26c7b61e4ee6ea3a6ccda5011fa4da +Author: Chris Wilson +Date: Thu Jan 23 16:30:07 2014 +0000 + + sna: Protect against fake CRTCs during initial probe + + Reported-by: Nick Bowler + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73981 + Signed-off-by: Chris Wilson + +commit e916c922ce3913712cd8a9b76ab037840b7f07f1 +Author: Chris Wilson +Date: Thu Jan 23 17:30:29 2014 +0000 + + sna: Avoid erroneous discarding operations for partial composites + + Composite operations were presumed to cover their entire width x height + area. However, a few paths submit boxes that do not cover the clip + region and so the optimisation made during prepare to discard completely + overwritten data is incorrect (and leads to corruption - stale data is + seen which the client expected to have been overdrawn). So along these + more unusual paths, we must add a flag to prevent the overzealous + discard. Notably, xfce4 triggers this as it uses a lot of unantialiased + trapezoids in its theme drawing. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=69528 + Signed-off-by: Chris Wilson + +commit 59e769e1b1eede466482a950b242ce81c52b276b +Author: Chris Wilson +Date: Thu Jan 23 12:57:48 2014 +0000 + + glamor: Don't require the glamoregl module to be pre-loaded with xserver >= 1.15 + + Inspired by (ok, copied from): + + xf86-video-ati commit f2a0a5cf6c5a21e2a02280e110a4eb8e6609dace + Author: Michel Dänzer + Date: Wed Jan 22 11:04:42 2014 +0900 + + Don't require the glamoregl module to be pre-loaded with xserver >= 1.15 + + The issues with loading it on demand have been fixed in xserver 1.15. + + Inspired by Jérôme Glisse on IRC. + + Signed-off-by: Chris Wilson + +commit 32010ed86bb8f28d3b02e1e54a592d79b92b2b98 +Author: Chris Wilson +Date: Wed Jan 22 16:26:14 2014 +0000 + + sna: Assert that the fill box is within bounds + + References: https://bugs.freedesktop.org/show_bug.cgi?id=73811 + Signed-off-by: Chris Wilson + +commit 29e11e2e6f80f6485ed69ea72e09e8d9b31fd8e8 +Author: Chris Wilson +Date: Tue Jan 21 22:40:11 2014 +0000 + + sna: Restore gc->serialNumber correctly after falling back + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73856 + Signed-off-by: Chris Wilson + +commit 2c441079cbd52902d356b652659e2be84726940e +Author: Chris Wilson +Date: Tue Jan 21 10:17:03 2014 +0000 + + sna: Initialise the TearFree shadow output from the current front buffer + + Otherwise we may end up in a sitation where we show stale contents for a + (sometimes signification) fraction of a second before it is refreshed + with the correct contents. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73842 + Signed-off-by: Chris Wilson + +commit ac22dd4292841e27bb6147cf1aa7867f36bb2118 +Author: Chris Wilson +Date: Fri Jan 17 14:33:26 2014 +0000 + + sna/gen4: Add an ALWAYS_FLUSH debugging option + + Still gen4 is cursed. This should restore the plateau we reached with + 2.99.907 by forcing a full GPU flush between every operation. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=55500 + Signed-off-by: Chris Wilson + +commit 720d131963b5c4d8f9e63c8852dbc133544ad312 +Author: Chris Wilson +Date: Tue Jan 21 10:35:30 2014 +0000 + + sna: Drop bogus assert added in recent patches + + The intention was to detect if the gc->pCompositeClip still pointed to + the temporary region. However, the assert failed to accomplish that + goal. + + Signed-off-by: Chris Wilson + +commit 36b743aa8e246c7361436d93a41a1f844c168a7a +Author: Chris Wilson +Date: Tue Jan 21 10:00:07 2014 +0000 + + sna: Reduce zeal of new gc->pCompositeClip + + gc->pCompositeClip starts off NULL, just like sna_gc->priv. + + Reported-by: Arkadiusz Miskiewicz + Signed-off-by: Chris Wilson + +commit 6a757eaa0903139183d16c3437bf86d58e62145e +Author: Chris Wilson +Date: Tue Jan 21 09:25:45 2014 +0000 + + sna: Fix typo in assertion from previous commit + + Sigh. It helps to remember to do compile testing with the right + configuration. + + Signed-off-by: Chris Wilson + +commit b9ebb016833df5b70336c66993a871e850fd0f61 +Author: Chris Wilson +Date: Tue Jan 21 09:05:54 2014 +0000 + + sna: More assertions for tracking gc->pCompositeClip + + Tracking down who leaves it modified... + + Signed-off-by: Chris Wilson + +commit f7121bf733e9b02248fa0b7bb62a902622dd8f10 +Author: Mark Kettenis +Date: Mon Jan 20 22:33:16 2014 +0000 + + sna: build fix for OpenBSD + + Commit 50a45a1cdd4d8319ba9358974d241069689591c5 introduced the use of + "struct stat" but doesn't include . Presumably that leaks + in trough some other header on Linux, but on OpenBSD compilation fails + because the struct isn't known. + +commit 50f6701aa5ce8be96e216a942880a8db967c7a6a +Author: Chris Wilson +Date: Mon Jan 20 20:47:15 2014 +0000 + + sna: Include serial numbers in ValidateGC DBG + + Signed-off-by: Chris Wilson + +commit 4c7b183fd21b461f9f18662c3b9d9732b6bef13d +Author: Chris Wilson +Date: Mon Jan 20 14:35:55 2014 +0000 + + sna: Short-cut the fallback for XCopyArea with depth < 8 + + Signed-off-by: Chris Wilson + +commit 671658499bf432666a96b31ac96d2c66e2168c4c +Author: Chris Wilson +Date: Mon Jan 20 14:35:35 2014 +0000 + + sna: Add some more DBG output around the clipping in sna_do_copy() + + Signed-off-by: Chris Wilson + +commit 55a933aa29434f23674c851f02dce0ce983a0730 +Author: Chris Wilson +Date: Mon Jan 20 13:29:22 2014 +0000 + + intel-virtual-output: Tidy some DBG for copying new modes + + Signed-off-by: Chris Wilson + +commit 04ee452439d14e2f8941e989823cb81fb62858e7 +Author: Chris Wilson +Date: Mon Jan 20 12:19:25 2014 +0000 + + sna: Increase limit on number of possible outputs + + Signed-off-by: Chris Wilson + +commit 637e7c2186ccde65bed74dfd28f53a2a808e4101 +Author: Chris Wilson +Date: Mon Jan 20 12:33:19 2014 +0000 + + intel-virtual-output: Print error events for debugging + + Signed-off-by: Chris Wilson + +commit 92e9bf82b22ca59ac0009a6a4a641a1056c34bf4 +Author: Chris Wilson +Date: Mon Jan 20 12:25:34 2014 +0000 + + intel-virtual-output: Disable remote display if SetCrtcConfig fails + + Signed-off-by: Chris Wilson + +commit 3138d06893b3380473cfab60ee19e80cb3b61192 +Author: Chris Wilson +Date: Mon Jan 20 10:38:23 2014 +0000 + + intel-virtual-output: Clone modes onto remote display + + If the user adds a mode to the VIRTUAL display and then attempts to use + it, add that mode to the remote display. + + Reported-by: Christoph Bessei + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73816 + Signed-off-by: Chris Wilson + +commit de0797edac67e00b720dcc99d70b8e0f033a90b1 +Author: Chris Wilson +Date: Mon Jan 20 09:32:50 2014 +0000 + + sna: Yield the processor if the kernel reports EAGAIN + + An artifact of our kernel/userspace interaction is that under certain + circumstances the kernel will report EAGAIN in order for it to have CPU + time to run its own workqueues before it can process the userspace + request. We can be cooperative and yield ourselves rather than busy-spin + waiting for the scheduler to demote us. + + Signed-off-by: Chris Wilson + +commit 50a45a1cdd4d8319ba9358974d241069689591c5 +Author: Chris Wilson +Date: Sun Jan 19 15:59:42 2014 +0000 + + sna: Use device minor to narrow search for debugfs files + + Also vital in case we ever have two Intel GPUs! + + Signed-off-by: Chris Wilson + +commit d41bbfc97c46b01227f193d7e938390691a8b581 +Author: Chris Wilson +Date: Sun Jan 19 15:18:44 2014 +0000 + + sna: Always emit an error message when an execbuffer fails + + So that we are not left with a puzzled user with a mysteriously slow + machine. + + Signed-off-by: Chris Wilson + +commit d7f753ba89c928f141f1feb750733f53130c3bfb +Author: Chris Wilson +Date: Sun Jan 19 12:52:20 2014 +0000 + + sna: Discard pending wait_for_shadow updates before the TearFree flip + + Rather than just assert that we have used the pending update in + wait_for_shadow, discard it first. + + Reported-by: Joe Peterson + References: https://bugs.freedesktop.org/show_bug.cgi?id=70905 + Signed-off-by: Chris Wilson + +commit 498fcb001358af8f15bd129f8d1edf2530edf412 +Author: Chris Wilson +Date: Sat Jan 18 22:38:40 2014 +0000 + + sna: Refactor common routines for debugfs file dumping + + Signed-off-by: Chris Wilson + +commit b68c35a11da849a2680ba77bf565038fd8f30dd0 +Author: Chris Wilson +Date: Sat Jan 18 22:21:35 2014 +0000 + + sna: Fix typo in debugfs paths + + Signed-off-by: Chris Wilson + +commit 9342bc3dfd64b338c0802793f311574323067652 +Author: Chris Wilson +Date: Sat Jan 18 21:38:59 2014 +0000 + + sna: Dump fence registers upon starvation + + References: https://bugs.freedesktop.org/show_bug.cgi?id=73696 + Signed-off-by: Chris Wilson + +commit 35ea7b2dd5904d5d8f7c355368c82bb12f1b83a0 +Author: Chris Wilson +Date: Fri Jan 17 12:55:33 2014 +0000 + + intel: Silence a compiler warning (-Wshadow) + + intel_device.c: In function 'intel_entity_get_devid': + intel_device.c:82:32: warning: declaration of 'index' shadows a global declaration [-Wshadow] + + Signed-off-by: Chris Wilson + +commit f23ab963c4f4ada2051588dfc85264aa2798dbf7 +Author: Rinat +Date: Fri Jan 17 10:47:44 2014 +0000 + + Provide DRI2DriverVDPAU for future compatibility + + Since 2010, DRI2 supports multiple driver names. That was added to ease + selection of appropriate driver by libvdpau. As for today, intel driver + support only DRI2DriverDRI (== 0), but not DRI2DriverVDPAU (== 1). + + Although there is no any hardware-specific VDPAU driver for intel video + adapters at the moment, it would be easier to use generic drivers like + libvdpau-va-gl by creating symlink named libvdpau_i965.so.1. That way + appropriate driver will be selected in run time automatically: + libvdpau_i965.so.1 on i965 equipped machines, and libvdpau_nvidia.so.1 + on nvidia equipped ones. + + [ickle: Whilst I think this is a workaround for a brainfart in libvdpau + that it defaults to libvdpau_nvidia.so rather than first to + libdvpau_${DRI2DriverDRI} and then to a hardcoded libvdpau_backend.so, + I have no better solution, and this does seem in accordance with the + spec.] + + Signed-off-by: Rinat + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73507 + +commit 5f3ee21a307a4ff4db189bd53e58a70ec01ee6bc +Author: Chris Wilson +Date: Fri Jan 17 08:40:34 2014 +0000 + + sna: Nullify pixmap->devPrivate.ptr after promoting CPU bo to GPU + + When we convert a CPU bo into a GPU bo, we need to remove any dangling + shadow pointers we use for devPrivate.ptr. Whilst the bo remains alive + these are incoherent, but if we ever replace the GPU bo (for example to + change tiling for DRI2) then the dangling pointer becomes invalid and + will explode on next use. + + Reported-by: Mike Aury + Reported-by: Marti Raudsepp + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73351 + Signed-off-by: Chris Wilson + +commit 34192006c65640327bc81e2765f5ef5db3c539e3 +Author: Chris Wilson +Date: Fri Jan 17 09:02:55 2014 +0000 + + sna: Intensify the move-to-cpu pointer paranoia + + Rather than just state that the final pixmap->devPrivate.ptr is + non-NULL, we can assert that it matches the shadow value. + + Signed-off-by: Chris Wilson + +commit cea442c0d0d7f1ef95d9d8048668eecbdcbc9a4e +Author: Chris Wilson +Date: Thu Jan 16 22:37:41 2014 +0000 + + sna: Cull the DBG spew to stderr + + Reduce the logging verbosity of DBG so that it only appears in the + logfile by default - makes debugging much more pleasant. + + Signed-off-by: Chris Wilson + +commit 6db99169a99393a8a669f89682bb8df13a7c5677 +Author: Chris Wilson +Date: Thu Jan 16 11:20:30 2014 +0000 + + sna: Regularly check that the devPrivate.ptr is valid + + Signed-off-by: Chris Wilson + +commit 242d7503ddd98c59feda4bcc25e70cac06d3325e +Author: Chris Wilson +Date: Thu Jan 16 11:08:05 2014 +0000 + + sna: Avoid allocating temporary storage for TearFree rotations + + Signed-off-by: Chris Wilson + +commit 587452a6ad7ac57e37820c72220c4944451315a8 +Author: Chris Wilson +Date: Thu Jan 16 10:27:50 2014 +0000 + + sna: Make the temporary upload pixmap as having a statically allocated pointer + + Signed-off-by: Chris Wilson + +commit 40beee995e71b1fa4cd146a986f53e03595a4378 +Author: Chris Wilson +Date: Wed Jan 15 10:07:32 2014 +0000 + + sna: Add some more paranoia around dangling pointers + + References: https://bugs.freedesktop.org/show_bug.cgi?id=73351 + Signed-off-by: Chris Wilson + +commit 9a0a1329391cc7d3047fea4b3d968afc7c6099b4 +Author: Chris Wilson +Date: Fri Jan 10 21:08:28 2014 +0000 + + sna: Handle release of active stolen scanouts + + If the scanout is still active we want to defer our release until the + request is retired. + + Signed-off-by: Chris Wilson + +commit b351f4a0009ce0eddb5866bd49ac59860a44f522 +Author: Chris Wilson +Date: Fri Jan 10 12:01:29 2014 +0000 + + sna/dri: Handle TearFree vblanks whilst the pipe is off + + As an extra complication for handling TearFree is that if we attempt to + requeue a swap whilst the pipe is off, that fails. As we have recursed + from the pixmap migration path, we have to abort the blit but still send + the event back to the client so that they unblock. + + Reported-by: Harald Judt + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73469 + Signed-off-by: Chris Wilson + +commit b1694c8ea5c0f2ce1ded2ab25aecfde80da16346 +Author: Chris Wilson +Date: Thu Jan 9 15:53:42 2014 +0000 + + sna: Include the deferred hotplug uevent propagation in DBG + + Signed-off-by: Chris Wilson + +commit bfabdb7ebf5e491da1e74f8b362f9c2f0b6f1ac5 +Author: Chris Wilson +Date: Thu Jan 9 12:34:58 2014 +0000 + + sna: Add regular refcnt checks on pixmap bo + + References: https://bugs.freedesktop.org/show_bug.cgi?id=73406 + Signed-off-by: Chris Wilson + +commit a2fc9e5f86096dbc2461eaf7e5ad5cf071f8d472 +Author: Chris Wilson +Date: Wed Jan 8 11:08:47 2014 +0000 + + Revert "sna: Remove spurious SAMPLER writemask for gen4" + + This reverts commit 4966f8374a068ca2a533e30594bfd333551ffd37. + + Not so spurious after all! + + Reported-by: Michal Suchanek + Signed-off-by: Chris Wilson + +commit b858c28d04dfd353a99f9d15c39599adbf5cb25f +Author: Chris Wilson +Date: Tue Jan 7 14:42:41 2014 +0000 + + sna/gen4: Tidy URB_FENCE command + + Signed-off-by: Chris Wilson + +commit b7565a26401e283df94b68019e8093f8104428f4 +Author: Chris Wilson +Date: Tue Jan 7 14:05:09 2014 +0000 + + sna/gen4: Use PIPE_CONTROL for a smaller hammer + + Using MI_FLUSH to break up primitive is overkill when a top-of-pipe + PIPE_CONTROL will suffice. + + Signed-off-by: Chris Wilson + +commit 9d8473c5d9489db439aca73f470bda29a22ebab6 +Author: Chris Wilson +Date: Tue Jan 7 13:43:35 2014 +0000 + + sna/gen4: Check for available batch space before restoring state after CA pass + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73348 + References: https://bugs.freedesktop.org/show_bug.cgi?id=55500 + Signed-off-by: Chris Wilson + +commit 3b177a5e972a8eed63f99b0cd7b048a1229683f5 +Author: Chris Wilson +Date: Wed Nov 20 14:22:05 2013 +0000 + + sna/gen4: Reduce flushes between primitive continuations + + Signed-off-by: Chris Wilson + +commit 4966f8374a068ca2a533e30594bfd333551ffd37 +Author: Chris Wilson +Date: Wed Nov 20 14:20:54 2013 +0000 + + sna: Remove spurious SAMPLER writemask for gen4 + + Signed-off-by: Chris Wilson + +commit 82fa7ec352426c7e3d5210aac8ea1030232cc0f3 +Author: Chris Wilson +Date: Mon Jan 6 14:30:56 2014 +0000 + + uxa: Always treat DPMSModeSuspend/Standby similar to DPMSModeOff + + As we assume that Suspend, Standby alias to Off and disable the crtc + when switching to any mode other than On, we need to also perform the + backlight updates for Suspend,Standby prior to passing the DPMS value + onto the kernel. + + Suggested-by: Alexander Monakov + Signed-off-by: Chris Wilson + +commit 28a057105b6974803aee0d68c2a71f322095dfde +Author: Chris Wilson +Date: Mon Jan 6 14:37:09 2014 +0000 + + uxa: Disable updating properties upon reading their values + + Backport commit e76b08cad2770015346fd4cd757de3bb3b6ff37c + Author: Chris Wilson + Date: Tue Oct 15 12:46:09 2013 +0100 + + sna: Disable updating properties upon reading their values + + in order to prevent random screen blanking upon return from DPMS. + + Reported-by: Alexander Monakov + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73181 + Signed-off-by: Chris Wilson + +commit 0138b38dfcd933d080f86cfd33664eeb3f5558a0 +Author: Chris Wilson +Date: Mon Jan 6 14:30:56 2014 +0000 + + sna: Always treat DPMSModeSuspend/Standby similar to DPMSModeOff + + As we assume that Suspend, Standby alias to Off and disable the crtc + when switching to any mode other than On, we need to also perform the + backlight updates for Suspend,Standby prior to passing the DPMS value + onto the kernel. + + Suggested-by: Alexander Monakov + Signed-off-by: Chris Wilson + +commit 28810d5b367942c96acbc696f27105259422a0d1 +Author: Chris Wilson +Date: Mon Jan 6 14:26:38 2014 +0000 + + uxa/dri: Pixmap are offscreen and not attached to any display + + As the code current assumes that pixmaps are located at screen origin + (0,0), it assumes that they are all on the first CRTC. However, since + they are offscreen, this leads to such complications as attempting to + emit vsync swapbuffers, and even worse attempting to swap a GLXPixmap + onto the scanout following a DRI2SwapBuffers. + + Reported-by: Alexander Monakov + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73282 + Signed-off-by: Chris Wilson + +commit 4d8f78bc95f8dd36693f74365dbc3c442fbbf8a9 +Author: Chris Wilson +Date: Thu Jan 2 15:01:38 2014 +0000 + + sna/gen7+: Emit invalidate between operations if rendering to source/mask + + Fixes regression from + commit c79cb18407273dc7798618390bd0b7d69b0f80d6 [2.99.907] + Author: Chris Wilson + Date: Wed Nov 20 11:17:20 2013 +0000 + + sna/gen7: Try to reduce flushes between primitive continuations + + Reported-by: Simon Munton + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73208 + Signed-off-by: Chris Wilson + +commit c4b88d602640b3e2e46c61928ab194dc9f6b390d +Author: Chris Wilson +Date: Wed Dec 18 10:33:52 2013 +0000 + + 2.99.907 snapshot + +commit 9289e2c56b7f0cc78c5123691ad96611f0e04bed +Author: Chris Wilson +Date: Mon Dec 16 11:39:20 2013 +0000 + + sna/gen4: Sacrifice performance to workaround render corruption + + The long running saga of trying to find an acceptable workaround for the + gen4 rendering corruption (seems to be a read-write hazard failure inside + the gpu) is failing, the only w/a found so far is to send a single + rectangle through the GPU at a time. + + Signed-off-by: Chris Wilson + +commit 660fbdac8da1f43749007f126201681023a677e1 +Author: Chris Wilson +Date: Sun Dec 15 10:41:22 2013 +0000 + + sna: Remove stale assertion + + Now that we do not remove the move-to-gpu for a plain read from the + TearFree buffer, it is viable to use that buffer as source for cloning. + So we need to kill the stale assertion. + + Signed-off-by: Chris Wilson + +commit 989198f3ddc763000702bd1eaeb54002e18a8f04 +Author: Chris Wilson +Date: Sun Dec 15 09:45:24 2013 +0000 + + intel-virtual-output: Disable build if timerfd is not present + + Otherwise the build breaks on *BSD. + + Reported-by: Yuta SATOH + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72707 + Signed-off-by: Chris Wilson + +commit c8e339edd31859820907115c8d618b0fec3ef227 +Author: Chris Wilson +Date: Sun Dec 15 09:39:54 2013 +0000 + + sna: Avoid recursive out-of-order operations in the middle of TearFree + + During TearFree, if we have to wait for the shadow flip to complete, we + run the event handler for the device. This can then cause us to evaluate + pending completed vblank events, which may in turn then attempt to use + the shadow bo and recurse into the TearFree handler. Try to prevent this + and requeue the vblank event. + + Reported-by: Pascal de Bruijn + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72690 + Signed-off-by: Chris Wilson + +commit f350a1369b3bd39ba0db8639f036864fe5df2f98 +Author: Chris Wilson +Date: Thu Dec 12 16:49:02 2013 +0000 + + sna/gen4+: Drop new assertion that we only finish a vbo after use in this batch + + A full vbo might not be discarded and so upon first use in the following + batch we decided to finish the old vbo and allocate a new. This can + happen before we even emit any relocations and so the assert is bogus. + + Reported-by: Jiri Slaby + Signed-off-by: Chris Wilson + +commit 7c62925ba7f18f55ee34b946bddba84a07b83985 +Author: Chris Wilson +Date: Wed Dec 11 21:30:06 2013 +0000 + + sna: Remove unused variable + + sna_display.c: In function 'sna_crtc_redisplay__fallback': + sna_display.c:4104:19: warning: unused variable 'sna_crtc' [-Wunused-variable] + struct sna_crtc *sna_crtc = to_sna_crtc(crtc); + + Signed-off-by: Chris Wilson + +commit 7e76f21a4d9d8f5424c257e6e7686d5bb0bb6cf7 +Author: Chris Wilson +Date: Mon Jul 22 18:56:03 2013 +0100 + + intel: Recognise gen8 + + Assign gen=8 to the Broadwell PCI IDs, no marketing names are known at + this point in time. + + Signed-off-by: Chris Wilson + +commit f7d1c2b8d1883280e7916bb4473ff6436b186950 +Author: Chris Wilson +Date: Tue Jul 23 08:17:58 2013 +0100 + + sna: Enable scanline waits for Broadwell + + Broadwell uses the same mechanism as Haswell for vsync. + + Signed-off-by: Chris Wilson + +commit e017542d10e875260e3eef1b0369f4ea106df0f5 +Author: Chris Wilson +Date: Thu Dec 6 22:11:32 2012 +0000 + + sna/gen8: Initial backend for Broadwell + + Should match the functionality of the earlier generations, but untuned. + + Signed-off-by: Chris Wilson + +commit 610af0c70e755062b36ba9756fbc4288518b7c35 +Author: Chris Wilson +Date: Wed Nov 13 11:50:52 2013 +0000 + + Update i915_pciids.h + + Pulling in changes from: + + kernel commit 4d4dead67a4ab1d5de393f15ed5e4e2aa63d3bcf + Author: Ben Widawsky + Date: Sun Nov 3 16:47:33 2013 -0800 + + drm/i915/bdw: Add device IDs + + Signed-off-by: Chris Wilson + +commit 628b68f3a07ee619642521e0992eee81b9edd76f +Author: Chris Wilson +Date: Tue Dec 10 10:25:56 2013 +0000 + + sna/gen2,3: Replace stale bo replacement with simple asserts + + The surface creation routines should ensure that the minimum pitch + alignments are met. However, when rendering to a CPU bo, the pitch is + not under our control so we need to be more careful. + + Signed-off-by: Chris Wilson + +commit 6c91ec29807e96682c2e752744b60c06bf3f02d9 +Author: Chris Wilson +Date: Tue Dec 10 12:37:44 2013 +0000 + + sna: Set minimum pitch alignment to 8 bytes + + This prevents render corruption on gen3 and should not adversely affect + BLT pitch requirements or other GPUs. + + Signed-off-by: Chris Wilson + +commit ade25f4f95994b565a8ed8eb3811ff7453a8b0e5 +Author: Chris Wilson +Date: Mon Dec 9 10:49:56 2013 +0000 + + sna: Only discard READ hint for TearFree copy iff it subsumes the pixmap + + Remembering that the target window may be smaller than its backing + pixmap. + + Reported-by: Andreas Klauer + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72430 + Signed-off-by: Chris Wilson + +commit a66db75bf370549f438796433f3e3fb5f7f0b2a3 +Author: Chris Wilson +Date: Mon Dec 9 10:32:05 2013 +0000 + + sna: Fallback gracefully when redisplaying after a GPU hang + + Signed-off-by: Chris Wilson + +commit cf89fb8b731dd541bde16277c52264ba1e150424 +Author: Chris Wilson +Date: Sun Dec 8 16:35:27 2013 +0000 + + sna: Simplify kgem_bo_can_map() + + Remove the attempt to trick us into mapping large bo. + + Signed-off-by: Chris Wilson + +commit 46256fa5a0ca4230ae7c226781c78c525e2648c6 +Author: Chris Wilson +Date: Thu Dec 5 16:12:22 2013 +0000 + + sna: Pass MOVE_READ for partial TearFree move-to-gpu + + When fixing up a pending shadow pageflip for TearFree, we must tell it + that it needs to flush the damage for a partial move-to-gpu. Even though + the current area does not read from the destination, the move-to-gpu + callback is a global pass, and we need to assume the worst for the + region outside of the target. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72343 + Signed-off-by: Chris Wilson + +commit 693c1343ed29d8779ce3ad5c0e80fbe6d7d0689f +Author: Chris Wilson +Date: Thu Dec 5 11:09:39 2013 +0000 + + sna: OsRegisterSigWrapper was only introduced in 1.6.99.900 + + Signed-off-by: Chris Wilson + +commit ba9a173d81514152cd1dac4f1df765be11a478ea +Author: Chris Wilson +Date: Thu Dec 5 11:06:59 2013 +0000 + + configure: Correct closing ']' + + Too many closed, too few opened. + + Signed-off-by: Chris Wilson + +commit 845b03ac110c22cff8b2653e76f6d974a628b776 +Author: Chris Wilson +Date: Thu Dec 5 11:00:44 2013 +0000 + + sna: Compilation fixes for squeeze + + Older version of glibc and valgrind require a slight massage. + + Signed-off-by: Chris Wilson + +commit bd22abee8f33b20ff6bc7297b0a9ae8708d18727 +Author: Chris Wilson +Date: Thu Nov 7 22:27:50 2013 +0000 + + sna: Update Baytrail VSync logic + + My current best guess at the glaring hole in the spec that is + synchronisation to vertical refresh. + + Note that this leaves VSync disabled for BYT for now as it is + ineffective - but at least it now doesn't hang! + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=69869 + Signed-off-by: Chris Wilson + +commit 6c37ab3ddc5910fdf4ed663a8dc620edc9fec931 +Author: Chris Wilson +Date: Wed Dec 4 11:55:54 2013 +0000 + + sna: Print detected GPU first + + This should make the GPU identification easier to find in future. + + Signed-off-by: Chris Wilson + +commit 255025d8d342610ddc75f510ea795bf8785f1578 +Author: Chris Wilson +Date: Wed Dec 4 11:06:08 2013 +0000 + + intel: Tidy up driver identification string + + Split the identification strings between the older integrated graphic + chipsets and the more recent integrated processor graphics. This helps + to emphasis the recent branding and should reduce confusion about which + processors are supported by the driver. + + Signed-off-by: Chris Wilson + +commit 23f8802857d64212dc8df39da2c1f6f362f9d053 +Author: Chris Wilson +Date: Tue Dec 3 15:06:10 2013 +0000 + + sna/dri: Always clear the clear hint after pageflipping + + commit 3fd116782bb1c05a140f4783e92a8ee6a57143cd + Author: Chris Wilson + Date: Mon Sep 23 21:03:07 2013 +0100 + + sna/dri: Clear the clear hint upon applying DRI damage + + missed the short-circuit path for an already all-damaged pixmap - which + is quite common for the clear pixmaps... + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72194 + Signed-off-by: Chris Wilson + +commit 0420adfb9d92b691aabef4e0ccba3782417b4bf0 +Author: Chris Wilson +Date: Tue Dec 3 12:10:23 2013 +0000 + + sna/gen2,3: Unmap the old GPU bo when replacing due to render target constaints + + Signed-off-by: Chris Wilson + +commit 3dbf17f00e200e864818b0b8ca762183cff9085f +Author: Chris Wilson +Date: Tue Dec 3 12:10:01 2013 +0000 + + sna: Mark up an ordinary pixmap for reuse + + Signed-off-by: Chris Wilson + +commit 5a353ed151d175a757af6f8d5216bf2370dd3917 +Author: Chris Wilson +Date: Tue Dec 3 11:14:53 2013 +0000 + + sna: More assertions around tracking mapped state + + Signed-off-by: Chris Wilson + +commit 4274110b78f8962b921f773e67c981b033c3f664 +Author: Chris Wilson +Date: Tue Dec 3 11:03:39 2013 +0000 + + sna: Clear the clear hint after performing a userptr upload + + Signed-off-by: Chris Wilson + +commit 33f3ddd73da5f553accf78ce7e03a76b12f71393 +Author: Chris Wilson +Date: Tue Dec 3 09:37:37 2013 +0000 + + sna: Include Pineview in fence over-allocation checks + + When creating the object, we need to take account that fenced regions + in the aperture are in power-of-two sizes and so can be much larger than + the actual object. This includes Pineview, which although is more + relaxed with regards to fence alignment of GPU operations, still imposes + the same restrictions on the fence registers. + + Signed-off-by: Chris Wilson + +commit 9a8478dae681212bd7a86640f90e6d47c9393b1a +Author: Chris Wilson +Date: Mon Dec 2 15:48:50 2013 +0000 + + sna: Fix stipple offset for drawing into child windows + + Signed-off-by: Chris Wilson + +commit 32b942d0ff4f1d389ac643bfe6b18029d266dc13 +Author: Chris Wilson +Date: Mon Dec 2 10:43:51 2013 +0000 + + tests: Exercise stippled fills + + Signed-off-by: Chris Wilson + +commit 463ab7f4faf46f6530423b6b10f2cd1bb6d0aa83 +Author: Chris Wilson +Date: Mon Dec 2 11:08:05 2013 +0000 + + sna: Fix tile origin for pattern blits + + References: https://bugs.freedesktop.org/show_bug.cgi?id=71260 + Signed-off-by: Chris Wilson + +commit 6889ba38ab2bb050dec3057dbc584619dbe6d2e2 +Author: Chris Wilson +Date: Mon Dec 2 14:20:51 2013 +0000 + + sna: Drop forced alignment to 64 on pre-gen4 devices + + Some linear GPU bo that we create must be naturally aligned, and the + extra alignment imposed for pure paranoia is counter productive. + + Signed-off-by: Chris Wilson + +commit 49af22ee5533b1afbf30f50fcfd7245f1c8d98bc +Author: Chris Wilson +Date: Mon Dec 2 10:43:51 2013 +0000 + + tests: Exercise tiled fills + + Signed-off-by: Chris Wilson + +commit 3dae8b97151f1d08942ec690dac5a5008901d7d0 +Author: Chris Wilson +Date: Fri Nov 29 14:46:54 2013 +0000 + + sna: Dump GTT info if we fail to execute a batch due to ENOSPC + + Signed-off-by: Chris Wilson + +commit 2497fc332eafe31a0156ac5f66ec98f77ce0f647 +Author: Chris Wilson +Date: Thu Nov 28 22:03:39 2013 +0000 + + sna: Fix typo inside DBG message + + Signed-off-by: Chris Wilson + +commit fd007d9d465b9b3ddbbaf769931ec921a6f5ecb8 +Author: Chris Wilson +Date: Thu Nov 28 21:13:33 2013 +0000 + + sna/video: Correct handling of cropped images along packed fast path + + In particular, it was offseting the read from the source image, but not + correcting the length to read - causing a read from beyond the end of + the source and a segfault. + + Reported-by: Jan Engelhardt + Signed-off-by: Chris Wilson + +commit b85051ae480499dd8a6a6d07d5ce0feca7b844b4 +Author: Chris Wilson +Date: Thu Nov 28 16:25:52 2013 +0000 + + sna: Fallback from partial to full move-to-cpu + + Signed-off-by: Chris Wilson + +commit faedf266d7b476954574db2cb1274e677cf42bf4 +Author: Chris Wilson +Date: Thu Nov 28 14:12:56 2013 +0000 + + sna: Tidy up an assertion on an uninitialised variable + + Signed-off-by: Chris Wilson + +commit 1e382c6ece84f3040b21980a303fe00be667c4e2 +Author: Chris Wilson +Date: Thu Nov 28 14:02:18 2013 +0000 + + sna: Harden GetImage for use with very large buffers + + That risk causing SIGBUS due to oom. + + Signed-off-by: Chris Wilson + +commit 569b06abeae9b3dcaa611facdd3ec30c67de765b +Author: Chris Wilson +Date: Thu Nov 28 13:14:27 2013 +0000 + + sna: Wrap glyph composition with sigtrap handling + + Signed-off-by: Chris Wilson + +commit 974abd0c3acca7d3b782251d562bf00fd34b395d +Author: Chris Wilson +Date: Thu Nov 28 13:03:54 2013 +0000 + + sna: Prefer using userptr for PutImage into large GPU bo + + Signed-off-by: Chris Wilson + +commit 64f1fbb465bdd092c4ea4aafe10382ebe7b84ecb +Author: Chris Wilson +Date: Thu Nov 28 13:03:29 2013 +0000 + + sna: Tidy a split conditional in an picture upload + + Signed-off-by: Chris Wilson + +commit 1200aae4815cdbc6a4f242c264b2736e6fe0fa12 +Author: Chris Wilson +Date: Thu Nov 28 13:03:06 2013 +0000 + + sna: Wrap image upload with sigtrap + + Signed-off-by: Chris Wilson + +commit 0fb7c366a58ec9b9cdc0b330e53716ab04b24c96 +Author: Chris Wilson +Date: Wed Nov 27 22:06:27 2013 +0000 + + sna: Add a few more refcnt asserts + + Signed-off-by: Chris Wilson + +commit d65b57cd332ca4435867afa31b6da85481635d52 +Author: Chris Wilson +Date: Wed Nov 27 12:59:25 2013 +0000 + + intel-virtual-output: Trim remote framebuffer to fit + + Signed-off-by: Chris Wilson + +commit dd7c556072978822c1110346354acfa3362b012e +Author: Chris Wilson +Date: Wed Nov 27 12:57:09 2013 +0000 + + intel-virtual-output: Workaround mutter always using the same timestamp + + Signed-off-by: Chris Wilson + +commit 1085e6c93288de2275791ce9c585142870dc0877 +Author: Chris Wilson +Date: Tue Nov 26 16:13:23 2013 +0000 + + sna: Update connector-type-to-string mapping + + Add in a couple of newcomers to the connector type and make it easier to + track updates in future. + + Signed-off-by: Chris Wilson + +commit 80d1dee70ba3bdf38e0dd68a39380f4f3d9f22b5 +Author: Kirill Müller +Date: Tue Nov 26 11:36:54 2013 +0100 + + intel-virtual-output: mute spurious warnings + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72027 + +commit 36ac68bedd3b30d7bdf0f40b438b45a7c4dec9e5 +Author: Chris Wilson +Date: Tue Nov 26 09:41:42 2013 +0000 + + intel-virtual-output: Clone remote EDID for virtual outputs + + References: https://bugs.freedesktop.org/show_bug.cgi?id=72020 + Signed-off-by: Chris Wilson + +commit 63a964d6d0cb0e4ffce70d8e1b672dd65fae6703 +Author: Chris Wilson +Date: Tue Nov 26 08:52:39 2013 +0000 + + intel-virtual-output: Correct clip region of rotated outputs in source framebuffer + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71846 + Signed-off-by: Chris Wilson + +commit 13f3b24babba61e4d8b10661accc032169f04645 +Author: Chris Wilson +Date: Mon Nov 25 18:56:49 2013 +0000 + + sna: Correct plurization of axis for modesetting log message + + Signed-off-by: Chris Wilson + +commit 5580df729f4d3b2498a6dae19dac938f06bf602d +Author: Chris Wilson +Date: Mon Nov 25 16:55:47 2013 +0000 + + intel-virtual-output: Include transforms when computing required fb size + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71846 + Signed-off-by: Chris Wilson + +commit ded23af3cdf68ab94446b8774d6bc4d52b21907a +Author: Chris Wilson +Date: Mon Nov 25 16:49:58 2013 +0000 + + sna: Include reflections when logging mode changes + + Signed-off-by: Chris Wilson + +commit 5fa1b0a2c5e5d3e7f25bca5b79925a956253a24f +Author: Chris Wilson +Date: Mon Nov 25 16:13:45 2013 +0000 + + intel-virtual-output: Tweak DBG messages for copying rotation + + Signed-off-by: Chris Wilson + +commit 98efd7f5d94586f8d7c5b2e9c5515f4b37149b08 +Author: Chris Wilson +Date: Mon Nov 25 15:33:13 2013 +0000 + + sna: Log mode switches on virtual outputs + + Signed-off-by: Chris Wilson + +commit 42f325a87c336211ebb3ebcafc9130eff10cee93 +Author: Chris Wilson +Date: Mon Nov 25 11:14:15 2013 +0000 + + sna: Keep @NOWARNFLAGS@ last + + As the last option overrides the earlier options, make sure these + particular overrides always take effect by adding them last. + + Signed-off-by: Chris Wilson + +commit 4c4458e8a30920d065ca5db5d3ca3cc49454b869 +Author: Chris Wilson +Date: Mon Nov 25 10:01:00 2013 +0000 + + sna/trapezoids: trapezoids_bounds() reports not-empty, so use it + + Reported-by: Zdenek Kabelac + Signed-off-by: Chris Wilson + +commit af4995d74bd3ee3ed8f17c7c04c8d3acaaecebc6 +Author: Zdenek Kabelac +Date: Mon Nov 25 09:57:19 2013 +0000 + + sna: Handle failure to disable old plane when switching CRTCs + + If we fail to disable the old plane, abort the PutImage and report the + error. + + Signed-off-by: Zdenek Kabelac + +commit 00dcb4f22942b2d40253a7b43105e73e260216cf +Author: Zdenek Kabelac +Date: Mon Nov 25 09:09:35 2013 +0100 + + uxa: fix order of inline Bool + + Signed-off-by: Zdenek Kabelac + +commit 175b8711f8c90e7977aec5564f5c29588fa14469 +Author: Zdenek Kabelac +Date: Mon Nov 25 09:09:34 2013 +0100 + + uxa,legacy: use unsigned for comparition of unsigned + + Signed-off-by: Zdenek Kabelac + +commit 7b235c92bbc6c7306ffef8caac5f07448c78d956 +Author: Zdenek Kabelac +Date: Mon Nov 25 09:09:32 2013 +0100 + + sna: Add missing va_end + + Put va_end() into error paths + + Signed-off-by: Zdenek Kabelac + +commit 318f100d7337955c099fecb86d206c406779fafe +Author: Zdenek Kabelac +Date: Mon Nov 25 09:09:31 2013 +0100 + + uxa: Avoid relying on an assert and cleanup iterator + + Signed-off-by: Zdenek Kabelac + +commit a110637ef2a37505ee68447cf66763af4cabfc00 +Author: Zdenek Kabelac +Date: Mon Nov 25 09:09:30 2013 +0100 + + Fix indentation for incorrectly shifted statements + + Signed-off-by: Zdenek Kabelac + +commit b419691e277af0881baa7daac17af424dc1337b1 +Author: Zdenek Kabelac +Date: Mon Nov 25 09:09:29 2013 +0100 + + uxa: rename some local variable to not shadow global ones + + Signed-off-by: Zdenek Kabelac + +commit 6f066b6714df850c5ea42dbde2296803c5b06da0 +Author: Zdenek Kabelac +Date: Mon Nov 25 09:09:28 2013 +0100 + + uxa: Ensure mask_picture is defined + + Signed-off-by: Zdenek Kabelac + +commit ea18b7780e7d0d7fcd36b656a4fd974fb9d7137d +Author: Zdenek Kabelac +Date: Mon Nov 25 09:09:27 2013 +0100 + + Cast to use unsigned math + + Signed-off-by: Zdenek Kabelac + +commit 34057611c67b751c43d6bd70a7d5993708262cd2 +Author: Chris Wilson +Date: Mon Nov 25 09:36:32 2013 +0000 + + Correct type of uevent_handler + + xf86AddGeneralHandler returns an opaque pointer, not a function pointer. + + Reported-by: Zdenek Kabelac + Signed-off-by: Chris Wilson + +commit d2df10e28fa35d29b539dc52c61f710910b75831 +Author: Zdenek Kabelac +Date: Mon Nov 25 09:09:25 2013 +0100 + + Remove uneeded headers + + Signed-off-by: Zdenek Kabelac + +commit 41be7e9d490633a65aa1e0c9f76acfb67869288f +Author: Zdenek Kabelac +Date: Mon Nov 25 09:09:24 2013 +0100 + + config apostrophe + + Signed-off-by: Zdenek Kabelac + +commit 2275ef581ee1a1c45a45df40f952779f62fb53ed +Author: Zdenek Kabelac +Date: Mon Nov 25 09:09:20 2013 +0100 + + Makefile convert @var@ to $(var) + + Avoid using @var@ since this could not be easily overwritten through + 'make var=xxx' option which is normally available. + For Makefile.am users should avoid using @var@. + + Signed-off-by: Zdenek Kabelac + +commit 12e974c7bc8c85dbccd3d9ef91c1315e85bbeb6c +Author: Chris Wilson +Date: Fri Nov 22 17:37:57 2013 +0000 + + Revert "intel-virtual-output: Only track the most recent visibility status of the cursor" + + This reverts commit abf1a16914d993cc150005879375d4bb17fdccf3. + + We need to track visibility over all clones on a display, not just the + last. + + Regression from + commit abf1a16914d993cc150005879375d4bb17fdccf3 [2.99.906] + Author: Chris Wilson + Date: Fri Nov 8 17:09:35 2013 +0000 + + intel-virtual-output: Only track the most recent visibility status of the curso + + Reported-by: Kirill Müller + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71838 + Signed-off-by: Chris Wilson + +commit 0ee29c4ea3b05e9361635a2ef6e7b92c160d68cf +Author: Chris Wilson +Date: Fri Nov 22 13:34:35 2013 +0000 + + uxa,sna: Prevent bo exchange when pinned for non-DRI2 clients + + With the advent of DRI3 (and previously with Prime and Glamor) we have + external clients who rely on the pixmap<->bo mapping being invariant. + + Signed-off-by: Chris Wilson + +commit f0021ab2a66fb7c84758ad482f47f023b862360b +Author: Chris Wilson +Date: Fri Nov 22 12:07:06 2013 +0000 + + sna: Tidy up fallback from render composite to blt composite + + Signed-off-by: Chris Wilson + +commit 38ef572d68380db407039fe12d62426939030010 +Author: Chris Wilson +Date: Thu Nov 21 21:52:46 2013 +0000 + + sna: XY_SETUP_* expects the dst tiling to be set on gen4+ + + A few paths failed to set the tiling flag when setting up the BLT + engine, leaving the engine in a potentially inconsistent state. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71260 + Signed-off-by: Chris Wilson + +commit dee2db883954d9ce3560b81f84d5c805edfd3977 +Author: Chris Wilson +Date: Thu Nov 21 14:48:23 2013 +0000 + + sna: Fix typo in sna_blt_fill_begin() + + Reported-by: intelgraphics7@gmx-topmail.de + Signed-off-by: Chris Wilson + +commit 7d9edc9a717cfc6fbdbe468f7e32a68ac674a207 +Author: Chris Wilson +Date: Wed Nov 20 18:50:40 2013 +0000 + + sna: Set supported rotations on virtual outputs + + As the virtual outputs are created later, they do not get automatically + populated with RR properties and we must do that instantiation + ourselves. + + Reported-by: Kirill Müller + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71846 + Signed-off-by: Chris Wilson + +commit c79cb18407273dc7798618390bd0b7d69b0f80d6 +Author: Chris Wilson +Date: Wed Nov 20 11:17:20 2013 +0000 + + sna/gen7: Try to reduce flushes between primitive continuations + + Signed-off-by: Chris Wilson + +commit b14228fafb654fe7d8f8783475aa0c0ba87e4fea +Author: Chris Wilson +Date: Tue Nov 19 12:15:24 2013 +0000 + + intel-virtual-output: Check for failure to create a clone + + Signed-off-by: Chris Wilson + +commit 9e6979b67afdd8122a29135d752c6ea84e9af6dc +Author: Chris Wilson +Date: Tue Nov 19 12:13:26 2013 +0000 + + intel-virtual-output: Fix trivial and unlikely fd leak from bumblebee failure + + Signed-off-by: Chris Wilson + +commit 9ed5f83fe7ec71faf40147271aef1cf4a5a38329 +Author: Chris Wilson +Date: Tue Nov 19 12:09:35 2013 +0000 + + sna: Fix use before assignment + + mono.sna was being used the line before it was assigned. + + Signed-off-by: Chris Wilson + +commit a9d6f897e6d6dc388de24f7b49ba79bf1f6125c3 +Author: Chris Wilson +Date: Tue Nov 19 12:03:33 2013 +0000 + + sna: Free composite boxes in the unlikely all-invalid path + + Signed-off-by: Chris Wilson + +commit 0782d4e57e4ba33aee30925ad276ee4a1ec15feb +Author: Chris Wilson +Date: Tue Nov 19 12:01:33 2013 +0000 + + sna: Correct check for overwriting last BLT fill + + Typo crept in from the reloc rework. + + Signed-off-by: Chris Wilson + +commit 31f559820dbde1a028a76b9eeaeb1848aec3cc2b +Author: Chris Wilson +Date: Tue Nov 19 12:00:08 2013 +0000 + + sna/gen4+: Clear redirect bo before falling back to BLT paths + + Just in case we later try to take action on the already freed + redirection. + + Signed-off-by: Chris Wilson + +commit bb3ea102ca6b8aa843a10607fa140f5694cc4898 +Author: Chris Wilson +Date: Tue Nov 19 09:47:15 2013 +0000 + + test: Fix compilation of render-trapezoid-image + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71768 + Signed-off-by: Chris Wilson + +commit 12f4c48d39b939a3a26a1504910b5f16ee6c86b8 +Author: Chris Wilson +Date: Mon Nov 18 16:59:08 2013 +0000 + + sna/gen7: Rework random GPU flushing + + There seems to be no clear rationale for these flushes. They have been + empirically derived to pass test/render-copyarea and rendercheck, + without impacting upon a few simple benchmarks. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=68410 + Signed-off-by: Chris Wilson + +commit 04e4bae02c409853c95f43ba4b2b69e50940ec72 +Author: Chris Wilson +Date: Mon Nov 18 14:16:07 2013 +0000 + + sna: Tell valgrind about the returned mode list + + Reported-by: Zdenek Kabelac + Signed-off-by: Chris Wilson + +commit 4194100691347ccec4b1863f3f62987d9286707b +Author: Chris Wilson +Date: Mon Nov 18 12:33:05 2013 +0000 + + sna: Process Damage relative to dst->pDrawable not its pixmap->drawable + + References: https://bugs.freedesktop.org/show_bug.cgi?id=32734 + Signed-off-by: Chris Wilson + +commit e99e643ed1f2856109426f791a7615ee122d7c42 +Author: Chris Wilson +Date: Mon Nov 18 12:04:29 2013 +0000 + + tests: Avoid dependence on undefined C + + Right-shifting by a negative value is undefined. + + Signed-off-by: Chris Wilson + +commit b6924161108214b4e50c25f4168564ead4000430 +Author: Chris Wilson +Date: Mon Nov 18 11:58:43 2013 +0000 + + sna/damage: Tidy up a tail return + + Signed-off-by: Chris Wilson + +commit 52612185c60605542beb3745a2500ed65a8ffff0 +Author: Chris Wilson +Date: Fri Nov 15 21:20:30 2013 +0000 + + sna/damage: Guard against integer overflow before malloc + + Check that the multiplication to compute the allocation will not + overflow. + + Signed-off-by: Chris Wilson + +commit 95c3892dd3911ba44ae3170573de1153857b15a8 +Author: Chris Wilson +Date: Fri Nov 15 11:55:51 2013 +0000 + + sna: Include valgrind leakchecks for --enable-debug=memory + + Signed-off-by: Chris Wilson + +commit 6e9a8c5ae2883ca21d117ac672dd8a55b3429dc1 +Author: Chris Wilson +Date: Thu Nov 14 16:14:09 2013 +0000 + + sna: Add the missing braces around the conditional block + + Fixes regression from + commit f3225fcb38686f3b9701725bf3a11ecf1c100c3f + Author: Chris Wilson + Date: Tue Nov 5 08:38:22 2013 +0000 + + sna: Be move conservative with tiling sizes for older fenced gen + + Reported-by: Jay Little + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71605 + Signed-off-by: Chris Wilson + +commit 23f47c8b4b4825b9219e1f515015635a7c48ec35 +Author: Chris Wilson +Date: Thu Nov 14 10:17:49 2013 +0000 + + tests: Exercise render copies under a mask + + Signed-off-by: Chris Wilson + +commit aa5a5684ebada60a1b103624a9b49aa085a406c1 +Author: Chris Wilson +Date: Wed Nov 13 16:25:54 2013 +0000 + + sna/gen6+: Only substitute SRC for CLEAR if using the correct source + + If the source has not been verified to be clear, then using the SRC + operator will paint the wrong color. + + Signed-off-by: Chris Wilson + +commit 97e684ab3c887c1992733d0031f0256e9692d452 +Author: Chris Wilson +Date: Wed Nov 13 15:28:37 2013 +0000 + + sna/gen6+: Improve debug PREFER_RENDER to cover all decision points + + Signed-off-by: Chris Wilson + +commit 7358ba83a3d4ab37459b4e510704bd0be4438dcd +Author: Chris Wilson +Date: Wed Nov 13 15:27:05 2013 +0000 + + tests: Add render-composite-solid-mask + + Another reference test to exercise simple composite pathways clearly. + + Signed-off-by: Chris Wilson + +commit f08f9cb28efa1b82f196695c66c3ec3a2b63361c +Author: Chris Wilson +Date: Wed Nov 13 14:17:51 2013 +0000 + + sna: Eliminate a compiler warning for a shadowed variable + + sna_driver.c: In function 'sna_load_palette': + sna_driver.c:86:12: warning: declaration of 'index' shadows a global declaration [-Wshadow] + + Signed-off-by: Chris Wilson + +commit 501dbf45cd85b0008e599637ad3ca76c044d39d5 +Author: Chris Wilson +Date: Wed Nov 13 14:17:51 2013 +0000 + + sna: Eliminate a compiler warning for a shadowed variable + + We don't strictly need that local structure, so do without and keep the + compiler quiet. + + sna_driver.c: In function 'fb_supports_depth': + sna_driver.c:414:23: warning: declaration of 'close' shadows a global declaration [-Wshadow] + + Signed-off-by: Chris Wilson + commit 7468a6b740af14d95e8f9bacd2e352ec98a9acf2 Author: Chris Wilson Date: Tue Nov 12 14:43:28 2013 +0000 diff -Nru xserver-xorg-video-intel-2.99.910/debian/xserver-xorg-video-intel.install xserver-xorg-video-intel-2.99.914/debian/xserver-xorg-video-intel.install --- xserver-xorg-video-intel-2.99.910/debian/xserver-xorg-video-intel.install 2014-11-03 20:42:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/debian/xserver-xorg-video-intel.install 2014-11-03 20:42:16.000000000 +0000 @@ -1,4 +1,7 @@ +usr/bin/intel-virtual-output usr/lib/xorg/modules/drivers/*.so usr/lib/libI810XvMC.so* usr/lib/libIntelXvMC.so* +usr/lib/xserver-xorg-video-intel/xf86-video-intel-backlight-helper +usr/share/polkit-1/actions/org.x.xf86-video-intel.backlight-helper.policy usr/share/man diff -Nru xserver-xorg-video-intel-2.99.910/debian/xserver-xorg-video-intel.install.kfreebsd-amd64 xserver-xorg-video-intel-2.99.914/debian/xserver-xorg-video-intel.install.kfreebsd-amd64 --- xserver-xorg-video-intel-2.99.910/debian/xserver-xorg-video-intel.install.kfreebsd-amd64 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/debian/xserver-xorg-video-intel.install.kfreebsd-amd64 2014-11-03 20:42:16.000000000 +0000 @@ -0,0 +1,4 @@ +usr/lib/xorg/modules/drivers/*.so +usr/lib/libI810XvMC.so* +usr/lib/libIntelXvMC.so* +usr/share/man diff -Nru xserver-xorg-video-intel-2.99.910/debian/xserver-xorg-video-intel.install.kfreebsd-i386 xserver-xorg-video-intel-2.99.914/debian/xserver-xorg-video-intel.install.kfreebsd-i386 --- xserver-xorg-video-intel-2.99.910/debian/xserver-xorg-video-intel.install.kfreebsd-i386 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/debian/xserver-xorg-video-intel.install.kfreebsd-i386 2014-11-03 20:42:16.000000000 +0000 @@ -0,0 +1,4 @@ +usr/lib/xorg/modules/drivers/*.so +usr/lib/libI810XvMC.so* +usr/lib/libIntelXvMC.so* +usr/share/man diff -Nru xserver-xorg-video-intel-2.99.910/depcomp xserver-xorg-video-intel-2.99.914/depcomp --- xserver-xorg-video-intel-2.99.910/depcomp 2013-08-12 21:20:11.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/depcomp 2014-07-23 14:26:41.000000000 +0000 @@ -1,10 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2011-12-04.11; # UTC +scriptversion=2013-05-30.07; # UTC -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009, 2010, -# 2011 Free Software Foundation, Inc. +# Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -28,9 +27,9 @@ case $1 in '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] @@ -40,8 +39,8 @@ Environment variables: depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. + source Source file read by 'PROGRAMS ARGS'. + object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. @@ -57,6 +56,66 @@ ;; esac +# Get the directory component of the given path, and save it in the +# global variables '$dir'. Note that this directory component will +# be either empty or ending with a '/' character. This is deliberate. +set_dir_from () +{ + case $1 in + */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; + *) dir=;; + esac +} + +# Get the suffix-stripped basename of the given path, and save it the +# global variable '$base'. +set_base_from () +{ + base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` +} + +# If no dependency file was actually created by the compiler invocation, +# we still have to create a dummy depfile, to avoid errors with the +# Makefile "include basename.Plo" scheme. +make_dummy_depfile () +{ + echo "#dummy" > "$depfile" +} + +# Factor out some common post-processing of the generated depfile. +# Requires the auxiliary global variable '$tmpdepfile' to be set. +aix_post_process_depfile () +{ + # If the compiler actually managed to produce a dependency file, + # post-process it. + if test -f "$tmpdepfile"; then + # Each line is of the form 'foo.o: dependency.h'. + # Do two passes, one to just change these to + # $object: dependency.h + # and one to simply output + # dependency.h: + # which is needed to avoid the deleted-header problem. + { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" + sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" + } > "$depfile" + rm -f "$tmpdepfile" + else + make_dummy_depfile + fi +} + +# A tabulation character. +tab=' ' +# A newline character. +nl=' +' +# Character ranges might be problematic outside the C locale. +# These definitions help. +upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ +lower=abcdefghijklmnopqrstuvwxyz +digits=0123456789 +alpha=${upper}${lower} + if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 @@ -69,6 +128,9 @@ rm -f "$tmpdepfile" +# Avoid interferences from the environment. +gccflag= dashmflag= + # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case @@ -80,26 +142,32 @@ fi if test "$depmode" = dashXmstdout; then - # This is just like dashmstdout with a different argument. - dashmflag=-xM - depmode=dashmstdout + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvisualcpp + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then - # This is just like msvc7 but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u='sed s,\\\\,/,g' - depmode=msvc7 + # This is just like msvc7 but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u='sed s,\\\\,/,g' + depmode=msvc7 +fi + +if test "$depmode" = xlc; then + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. + gccflag=-qmakedep=gcc,-MF + depmode=gcc fi case "$depmode" in @@ -122,8 +190,7 @@ done "$@" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -131,13 +198,17 @@ ;; gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then @@ -145,33 +216,31 @@ fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" - alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz -## The second -e expression handles DOS-style file names with drive letters. + # The second -e expression handles DOS-style file names with drive + # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" -## This next piece of magic avoids the `deleted header file' problem. +## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. - tr ' ' ' -' < "$tmpdepfile" | -## Some versions of gcc put a space before the `:'. On the theory +## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ - | sed -e 's/$/ :/' >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -189,8 +258,7 @@ "$@" -MDupdate "$tmpdepfile" fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -198,43 +266,41 @@ if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" - # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; - # the IRIX cc adds comments like `#:fec' to the end of the + # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ - tr ' -' ' ' >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ + | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" - # The second pass generates a dummy entry for each header file. - tr ' ' ' -' < "$tmpdepfile" \ - | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ - >> "$depfile" + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> "$depfile" else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" ;; +xlc) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the - # current directory. Also, the AIX compiler puts `$object:' at the + # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u @@ -247,9 +313,7 @@ "$@" -M fi stat=$? - - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi @@ -258,44 +322,100 @@ do test -f "$tmpdepfile" && break done - if test -f "$tmpdepfile"; then - # Each line is of the form `foo.o: dependent.h'. - # Do two passes, one to just change these to - # `$object: dependent.h' and one to simply `dependent.h:'. - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - # The sourcefile does not contain any dependencies, so just - # store a dummy comment line, to avoid errors with the Makefile - # "include basename.Plo" scheme. - echo "#dummy" > "$depfile" + aix_post_process_depfile + ;; + +tcc) + # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 + # FIXME: That version still under development at the moment of writing. + # Make that this statement remains true also for stable, released + # versions. + # It will wrap lines (doesn't matter whether long or short) with a + # trailing '\', as in: + # + # foo.o : \ + # foo.c \ + # foo.h \ + # + # It will put a trailing '\' even on the last line, and will use leading + # spaces rather than leading tabs (at least since its commit 0394caf7 + # "Emit spaces for -MD"). + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile" + exit $stat fi + rm -f "$depfile" + # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. + # We have to change lines of the first kind to '$object: \'. + sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" + # And for each line of the second kind, we have to emit a 'dep.h:' + # dummy dependency, to avoid the deleted-header problem. + sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; -icc) - # Intel's C compiler understands `-MD -MF file'. However on - # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c - # ICC 7.0 will fill foo.d with something like - # foo.o: sub/foo.c - # foo.o: sub/foo.h - # which is wrong. We want: - # sub/foo.o: sub/foo.c - # sub/foo.o: sub/foo.h - # sub/foo.c: - # sub/foo.h: - # ICC 7.1 will output +## The order of this option in the case statement is important, since the +## shell code in configure will try each of these formats in the order +## listed in this file. A plain '-MD' option would be understood by many +## compilers, so we must ensure this comes after the gcc and icc options. +pgcc) + # Portland's C compiler understands '-MD'. + # Will always output deps to 'file.d' where file is the root name of the + # source file under compilation, even if file resides in a subdirectory. + # The object file name does not affect the name of the '.d' file. + # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h - # and will wrap long lines using \ : + # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... + set_dir_from "$object" + # Use the source, not the object, to determine the base name, since + # that's sadly what pgcc will do too. + set_base_from "$source" + tmpdepfile=$base.d + + # For projects that build the same source file twice into different object + # files, the pgcc approach of using the *source* file root name can cause + # problems in parallel builds. Use a locking strategy to avoid stomping on + # the same $tmpdepfile. + lockdir=$base.d-lock + trap " + echo '$0: caught signal, cleaning up...' >&2 + rmdir '$lockdir' + exit 1 + " 1 2 13 15 + numtries=100 + i=$numtries + while test $i -gt 0; do + # mkdir is a portable test-and-set. + if mkdir "$lockdir" 2>/dev/null; then + # This process acquired the lock. + "$@" -MD + stat=$? + # Release the lock. + rmdir "$lockdir" + break + else + # If the lock is being held by a different process, wait + # until the winning process is done or we timeout. + while test -d "$lockdir" && test $i -gt 0; do + sleep 1 + i=`expr $i - 1` + done + fi + i=`expr $i - 1` + done + trap - 1 2 13 15 + if test $i -le 0; then + echo "$0: failed to acquire lock after $numtries attempts" >&2 + echo "$0: check lockdir '$lockdir'" >&2 + exit 1 + fi - "$@" -MD -MF "$tmpdepfile" - stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -307,8 +427,8 @@ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. - sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | - sed -e 's/$/ :/' >> "$depfile" + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -319,9 +439,8 @@ # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + set_dir_from "$object" + set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d @@ -332,8 +451,7 @@ "$@" +Maked fi stat=$? - if test $stat -eq 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi @@ -343,77 +461,61 @@ test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" - # Add `dependent.h:' lines. + sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" + # Add 'dependent.h:' lines. sed -ne '2,${ - s/^ *// - s/ \\*$// - s/$/:/ - p - }' "$tmpdepfile" >> "$depfile" + s/^ *// + s/ \\*$// + s/$/:/ + p + }' "$tmpdepfile" >> "$depfile" else - echo "#dummy" > "$depfile" + make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) - # The Tru64 compiler uses -MD to generate dependencies as a side - # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. - # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put - # dependencies in `foo.d' instead, so we check for that too. - # Subdirectories are respected. - dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` - test "x$dir" = "x$object" && dir= - base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` - - if test "$libtool" = yes; then - # With Tru64 cc, shared objects can also be used to make a - # static library. This mechanism is used in libtool 1.4 series to - # handle both shared and static libraries in a single compilation. - # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. - # - # With libtool 1.5 this exception was removed, and libtool now - # generates 2 separate objects for the 2 libraries. These two - # compilations output dependencies in $dir.libs/$base.o.d and - # in $dir$base.o.d. We have to check for both files, because - # one of the two compilations can be disabled. We should prefer - # $dir$base.o.d over $dir.libs/$base.o.d because the latter is - # automatically cleaned when .libs/ is deleted, while ignoring - # the former would cause a distcleancheck panic. - tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 - tmpdepfile2=$dir$base.o.d # libtool 1.5 - tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 - tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 - "$@" -Wc,-MD - else - tmpdepfile1=$dir$base.o.d - tmpdepfile2=$dir$base.d - tmpdepfile3=$dir$base.d - tmpdepfile4=$dir$base.d - "$@" -MD - fi + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in 'foo.d' instead, so we check for that too. + # Subdirectories are respected. + set_dir_from "$object" + set_base_from "$object" - stat=$? - if test $stat -eq 0; then : - else - rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - exit $stat - fi - - for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" - do - test -f "$tmpdepfile" && break - done - if test -f "$tmpdepfile"; then - sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" - # That's a tab and a space in the []. - sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" - else - echo "#dummy" > "$depfile" - fi - rm -f "$tmpdepfile" - ;; + if test "$libtool" = yes; then + # Libtool generates 2 separate objects for the 2 libraries. These + # two compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir$base.o.d # libtool 1.5 + tmpdepfile2=$dir.libs/$base.o.d # Likewise. + tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -ne 0; then + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + # Same post-processing that is required for AIX mode. + aix_post_process_depfile + ;; msvc7) if test "$libtool" = yes; then @@ -424,8 +526,7 @@ "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" - if test "$stat" = 0; then : - else + if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi @@ -443,14 +544,15 @@ p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g -s/\(.*\)/ \1 \\/p +s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { - s/.*/ / + s/.*/'"$tab"'/ G p }' >> "$depfile" + echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; @@ -478,7 +580,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -498,18 +600,18 @@ done test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' + # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" - tr ' ' ' -' < "$tmpdepfile" | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process this sed invocation + # correctly. Breaking it into two sed invocations is a workaround. + tr ' ' "$nl" < "$tmpdepfile" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; @@ -562,11 +664,12 @@ # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" - sed '1,2d' "$tmpdepfile" | tr ' ' ' -' | \ -## Some versions of the HPUX 10.20 sed can't process this invocation -## correctly. Breaking it into two sed invocations is a workaround. - sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + # Some versions of the HPUX 10.20 sed can't process the last invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed '1,2d' "$tmpdepfile" \ + | tr ' ' "$nl" \ + | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ + | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; @@ -583,7 +686,7 @@ shift fi - # Remove `-o $object'. + # Remove '-o $object'. IFS=" " for arg do @@ -602,10 +705,10 @@ esac done - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" + "$@" -E \ + | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" @@ -637,23 +740,23 @@ shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; + set fnord "$@" + shift + shift + ;; *) - set fnord "$@" "$arg" - shift - shift - ;; + set fnord "$@" "$arg" + shift + shift + ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" + echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; diff -Nru xserver-xorg-video-intel-2.99.910/install-sh xserver-xorg-video-intel-2.99.914/install-sh --- xserver-xorg-video-intel-2.99.910/install-sh 2013-08-12 21:20:05.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/install-sh 2014-07-23 14:26:40.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2009-04-28.21; # UTC +scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -35,7 +35,7 @@ # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it +# 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written @@ -156,6 +156,10 @@ -s) stripcmd=$stripprog;; -t) dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac shift;; -T) no_target_directory=true;; @@ -186,6 +190,10 @@ fi shift # arg dst_arg=$arg + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac done fi @@ -194,13 +202,17 @@ echo "$0: no input file specified." >&2 exit 1 fi - # It's OK to call `install-sh -d' without argument. + # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then - trap '(exit $?); exit' 1 2 13 15 + do_exit='(exit $ret); exit $ret' + trap "ret=129; $do_exit" 1 + trap "ret=130; $do_exit" 2 + trap "ret=141; $do_exit" 13 + trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. @@ -228,9 +240,9 @@ for src do - # Protect names starting with `-'. + # Protect names problematic for 'test' and other utilities. case $src in - -*) src=./$src;; + -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then @@ -252,12 +264,7 @@ echo "$0: no destination specified." >&2 exit 1 fi - dst=$dst_arg - # Protect names starting with `-'. - case $dst in - -*) dst=./$dst;; - esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. @@ -347,7 +354,7 @@ if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writeable bit of parent directory when it shouldn't. + # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in @@ -385,7 +392,7 @@ case $dstdir in /*) prefix='/';; - -*) prefix='./';; + [-=\(\)!]*) prefix='./';; *) prefix='';; esac @@ -403,7 +410,7 @@ for d do - test -z "$d" && continue + test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then diff -Nru xserver-xorg-video-intel-2.99.910/libobj/getline.c xserver-xorg-video-intel-2.99.914/libobj/getline.c --- xserver-xorg-video-intel-2.99.910/libobj/getline.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/libobj/getline.c 2014-07-11 07:06:08.000000000 +0000 @@ -0,0 +1,51 @@ +#include +#include +#include + +extern int getline(char **line, size_t *len, FILE *file); + +int getline(char **line, size_t *len, FILE *file) +{ + char *ptr, *end; + int c; + + if (*line == NULL) { + errno = EINVAL; + if (*len == 0) + *line = malloc(4096); + if (*line == NULL) + return -1; + + *len = 4096; + } + + ptr = *line; + end = *line + *len; + + while ((c = fgetc(file)) != EOF) { + if (ptr + 1 >= end) { + char *newline; + int offset; + + newline = realloc(*line, *len + 4096); + if (newline == NULL) + return -1; + + offset = ptr - *line; + + *line = newline; + *len += 4096; + + ptr = *line + offset; + end = *line + *len; + } + + *ptr++ = c; + if (c == '\n') { + *ptr = '\0'; + return ptr - *line; + } + } + *ptr = '\0'; + return -1; +} diff -Nru xserver-xorg-video-intel-2.99.910/libobj/ignore.c xserver-xorg-video-intel-2.99.914/libobj/ignore.c --- xserver-xorg-video-intel-2.99.910/libobj/ignore.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/libobj/ignore.c 2014-07-23 15:02:47.000000000 +0000 @@ -0,0 +1,6 @@ +extern void ignore(void); + +void ignore(void) +{ + /* libcompat.a cannot be empty therefore I exist */ +} diff -Nru xserver-xorg-video-intel-2.99.910/libobj/Makefile.am xserver-xorg-video-intel-2.99.914/libobj/Makefile.am --- xserver-xorg-video-intel-2.99.910/libobj/Makefile.am 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/libobj/Makefile.am 2014-07-23 15:02:47.000000000 +0000 @@ -0,0 +1,3 @@ +noinst_LTLIBRARIES = libcompat.la +libcompat_la_SOURCES = ignore.c # for portability, always build something +libcompat_la_LIBADD = $(LIBOBJS) $(ALLOCA) diff -Nru xserver-xorg-video-intel-2.99.910/libobj/Makefile.in xserver-xorg-video-intel-2.99.914/libobj/Makefile.in --- xserver-xorg-video-intel-2.99.910/libobj/Makefile.in 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/libobj/Makefile.in 2014-07-23 15:44:37.000000000 +0000 @@ -0,0 +1,638 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = libobj +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am getline.c \ + $(top_srcdir)/depcomp +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libcompat_la_DEPENDENCIES = $(LIBOBJS) +am_libcompat_la_OBJECTS = ignore.lo +libcompat_la_OBJECTS = $(am_libcompat_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libcompat_la_SOURCES) +DIST_SOURCES = $(libcompat_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ +ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +APP_MAN_DIR = @APP_MAN_DIR@ +APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +BASE_CFLAGS = @BASE_CFLAGS@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHANGELOG_CMD = @CHANGELOG_CMD@ +CLOCK_GETTIME_LIBS = @CLOCK_GETTIME_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CWARNFLAGS = @CWARNFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DRI1_CFLAGS = @DRI1_CFLAGS@ +DRI1_LIBS = @DRI1_LIBS@ +DRI2_CFLAGS = @DRI2_CFLAGS@ +DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ +DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ +DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ +DRIVER_NAME = @DRIVER_NAME@ +DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ +DRMINTEL_CFLAGS = @DRMINTEL_CFLAGS@ +DRMINTEL_LIBS = @DRMINTEL_LIBS@ +DRM_CFLAGS = @DRM_CFLAGS@ +DRM_LIBS = @DRM_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FILE_MAN_DIR = @FILE_MAN_DIR@ +FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ +GEN4ASM_CFLAGS = @GEN4ASM_CFLAGS@ +GEN4ASM_LIBS = @GEN4ASM_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_CMD = @INSTALL_CMD@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ +LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ +LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ +LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ +LIBGLAMOR_LIBS = @LIBGLAMOR_LIBS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_MAN_DIR = @LIB_MAN_DIR@ +LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MAN_SUBSTS = @MAN_SUBSTS@ +MISC_MAN_DIR = @MISC_MAN_DIR@ +MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ +MKDIR_P = @MKDIR_P@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NOWARNFLAGS = @NOWARNFLAGS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ +PCIACCESS_LIBS = @PCIACCESS_LIBS@ +PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRICT_CFLAGS = @STRICT_CFLAGS@ +STRIP = @STRIP@ +UDEV_CFLAGS = @UDEV_CFLAGS@ +UDEV_LIBS = @UDEV_LIBS@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VERSION = @VERSION@ +X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ +X11_LIBS = @X11_LIBS@ +XORG_CFLAGS = @XORG_CFLAGS@ +XORG_LIBS = @XORG_LIBS@ +XORG_MAN_PAGE = @XORG_MAN_PAGE@ +XVMCLIB_CFLAGS = @XVMCLIB_CFLAGS@ +XVMCLIB_LIBS = @XVMCLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +moduledir = @moduledir@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LTLIBRARIES = libcompat.la +libcompat_la_SOURCES = ignore.c # for portability, always build something +libcompat_la_LIBADD = $(LIBOBJS) $(ALLOCA) +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libobj/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign libobj/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + +libcompat.la: $(libcompat_la_OBJECTS) $(libcompat_la_DEPENDENCIES) $(EXTRA_libcompat_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(libcompat_la_OBJECTS) $(libcompat_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getline.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ignore.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LTLIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am + + +# 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 -Nru xserver-xorg-video-intel-2.99.910/ltmain.sh xserver-xorg-video-intel-2.99.914/ltmain.sh --- xserver-xorg-video-intel-2.99.910/ltmain.sh 2013-08-12 21:20:05.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/ltmain.sh 2014-07-23 14:26:36.000000000 +0000 @@ -70,7 +70,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu1 +# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 # automake: $automake_version # autoconf: $autoconf_version # @@ -80,7 +80,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1ubuntu1" +VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" TIMESTAMP="" package_revision=1.3337 diff -Nru xserver-xorg-video-intel-2.99.910/m4/libtool.m4 xserver-xorg-video-intel-2.99.914/m4/libtool.m4 --- xserver-xorg-video-intel-2.99.910/m4/libtool.m4 2013-08-12 21:20:05.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/m4/libtool.m4 2014-07-23 14:26:36.000000000 +0000 @@ -1312,7 +1312,7 @@ rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -1324,9 +1324,19 @@ LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) - LD="${LD-ld} -m elf_i386" + case `/usr/bin/file conftest.o` in + *x86-64*) + LD="${LD-ld} -m elf32_x86_64" + ;; + *) + LD="${LD-ld} -m elf_i386" + ;; + esac + ;; + powerpc64le-*) + LD="${LD-ld} -m elf32lppclinux" ;; - ppc64-*linux*|powerpc64-*linux*) + powerpc64-*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -1345,7 +1355,10 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + powerpcle-*) + LD="${LD-ld} -m elf64lppc" + ;; + powerpc-*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -1688,7 +1701,8 @@ ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` - if test -n "$lt_cv_sys_max_cmd_len"; then + if test -n "$lt_cv_sys_max_cmd_len" && \ + test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else @@ -2512,17 +2526,6 @@ esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -2639,7 +2642,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -3255,10 +3258,6 @@ fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -3297,7 +3296,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; @@ -4049,7 +4048,7 @@ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4348,7 +4347,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -6241,9 +6240,6 @@ _LT_TAGVAR(ld_shlibs, $1)=yes ;; - gnu*) - ;; - haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -6405,7 +6401,7 @@ _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler diff -Nru xserver-xorg-video-intel-2.99.910/Makefile.am xserver-xorg-video-intel-2.99.914/Makefile.am --- xserver-xorg-video-intel-2.99.910/Makefile.am 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/Makefile.am 2014-07-23 15:02:47.000000000 +0000 @@ -20,11 +20,7 @@ ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 -SUBDIRS = man xvmc src - -if BUILD_TOOLS -SUBDIRS += tools -endif +SUBDIRS = man libobj xvmc src tools MAINTAINERCLEANFILES = ChangeLog INSTALL diff -Nru xserver-xorg-video-intel-2.99.910/Makefile.in xserver-xorg-video-intel-2.99.914/Makefile.in --- xserver-xorg-video-intel-2.99.910/Makefile.in 2014-02-10 09:34:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/Makefile.in 2014-07-23 15:44:37.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -35,6 +34,51 @@ # 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. VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -53,13 +97,13 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@BUILD_TOOLS_TRUE@am__append_1 = tools -@HAVE_X11_TRUE@am__append_2 = test +@HAVE_X11_TRUE@am__append_1 = test subdir = . -DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(srcdir)/config.h.in \ - $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ - config.guess config.sub depcomp install-sh ltmain.sh missing +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/configure $(am__configure_deps) \ + $(srcdir)/config.h.in AUTHORS COPYING ChangeLog INSTALL NEWS \ + README compile config.guess config.sub depcomp install-sh \ + missing ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -73,29 +117,63 @@ CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir dist dist-all distcheck +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ + cscope distdir dist dist-all distcheck +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ + $(LISP)config.h.in +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = man xvmc src tools test +CSCOPE = cscope +DIST_SUBDIRS = man libobj xvmc src tools test DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -105,6 +183,7 @@ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi +am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ @@ -132,6 +211,7 @@ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best +DIST_TARGETS = dist-bzip2 dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -165,6 +245,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -193,8 +275,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -233,23 +320,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -309,7 +397,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} -I m4 -SUBDIRS = man xvmc src $(am__append_1) $(am__append_2) +SUBDIRS = man libobj xvmc src tools $(am__append_1) MAINTAINERCLEANFILES = ChangeLog INSTALL all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -351,8 +439,8 @@ $(am__aclocal_m4_deps): config.h: stamp-h1 - @if test ! -f $@; then rm -f stamp-h1; else :; fi - @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi + @test -f $@ || rm -f stamp-h1 + @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 @@ -375,22 +463,25 @@ -rm -f libtool config.lt # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -405,57 +496,12 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -471,12 +517,7 @@ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -488,15 +529,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -505,9 +542,31 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscope: cscope.files + test ! -s cscope.files \ + || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) +clean-cscope: + -rm -f cscope.files +cscope.files: clean-cscope cscopelist +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) @@ -543,13 +602,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -581,40 +637,41 @@ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) + $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz - $(am__remove_distdir) - -dist-lzma: distdir - tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma - $(am__remove_distdir) + $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-tarZ: distdir + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) + $(am__post_remove_distdir) dist-shar: distdir + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) + $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) + $(am__post_remove_distdir) -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 - $(am__remove_distdir) +dist dist-all: + $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' + $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another @@ -625,8 +682,6 @@ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ @@ -638,18 +693,19 @@ *.zip*) \ unzip $(distdir).zip ;;\ esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst + chmod -R a-w $(distdir) + chmod u+w $(distdir) + mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + && ../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ + --srcdir=.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -672,7 +728,7 @@ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 - $(am__remove_distdir) + $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' @@ -808,25 +864,24 @@ uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all \ - ctags-recursive install-am install-strip tags-recursive +.MAKE: $(am__recursive_targets) all install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am am--refresh check check-am clean clean-generic \ - clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \ - dist-gzip dist-hook dist-lzip dist-lzma dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-generic \ - distclean-hdr distclean-libtool distclean-tags distcleancheck \ - distdir distuninstallcheck dvi dvi-am html html-am info \ - info-am install install-am install-data install-data-am \ - install-dvi install-dvi-am install-exec install-exec-am \ - install-html install-html-am install-info install-info-am \ - install-man install-pdf install-pdf-am install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ + am--refresh check check-am clean clean-cscope clean-generic \ + clean-libtool cscope cscopelist-am ctags ctags-am dist \ + dist-all dist-bzip2 dist-gzip dist-hook dist-lzip dist-shar \ + dist-tarZ dist-xz dist-zip distcheck distclean \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am .PHONY: ChangeLog INSTALL diff -Nru xserver-xorg-video-intel-2.99.910/man/intel.man xserver-xorg-video-intel-2.99.914/man/intel.man --- xserver-xorg-video-intel-2.99.910/man/intel.man 2014-02-01 18:37:13.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/man/intel.man 2014-06-25 10:45:20.000000000 +0000 @@ -25,8 +25,11 @@ .B intel supports the i810, i810-DC100, i810e, i815, i830M, 845G, 852GM, 855GM, 865G, 915G, 915GM, 945G, 945GM, 965G, 965Q, 946GZ, 965GM, 945GME, -G33, Q33, Q35, G35, GM45, G45, Q45, G43, G41 chipsets, and Pineview-M in -Atom N400 series, Pineview-D in Atom D400/D500 series. +G33, Q33, Q35, G35, GM45, G45, Q45, G43, G41 chipsets, Pineview-M in +Atom N400 series, Pineview-D in Atom D400/D500 series, +Intel(R) HD Graphics: 2000-6000, +Intel(R) Iris(TM) Graphics: 5100/6100, and +Intel(R) Iris(TM) Pro Graphics: 5200/6200/P6300. .SH CONFIGURATION DETAILS Please refer to __xconfigfile__(__filemansuffix__) for general configuration @@ -121,6 +124,11 @@ .IP Default: acceleration is enabled. .TP +.BI "Option \*qPresent\*q \*q" boolean \*q +Enable use of hardware counters and flow control for the Present extension. +.IP +Default: Enabled +.TP .BI "Option \*qAccelMethod\*q \*q" string \*q Select acceleration method. There are a couple of backends available for accelerating the DDX. \*qUXA\*q (Unified @@ -145,9 +153,11 @@ display so that the entire update is completed before the display starts its refresh. That is only one frame is ever visible, preventing an unsightly tear between two visible and differing frames. Note that this replicates what the -compositing manager should be doing, so it is not advisable to enable both. -However, some compositing managers do cause tearing, and if the outputs are -rotated, there may will still be tearing without TearFree enabled. +compositing manager should be doing, however TearFree will redirect the +compositor updates (and those of fullscreen games) directly on to the scanout +thus incurring no additional overhead in the composited case. Also note that +not all compositing managers prevent tearing, and if the outputs are +rotated, there will still be tearing without TearFree enabled. .IP Default: TearFree is disabled. .TP @@ -491,7 +501,7 @@ The xf86-video-intel driver is part of the X.Org and Freedesktop.org umbrella projects. Details on bug reporting can be found at -http://www.intellinuxgraphics.org/how_to_report_bug.html. Mailing +https://01.org/linuxgraphics/documentation/how-report-bugs. Mailing lists are also commonly used to report experiences and ask questions about configuration and other topics. See lists.freedesktop.org for more information (the xorg@lists.freedesktop.org mailing list is the diff -Nru xserver-xorg-video-intel-2.99.910/man/Makefile.in xserver-xorg-video-intel-2.99.914/man/Makefile.in --- xserver-xorg-video-intel-2.99.910/man/Makefile.in 2014-02-10 09:34:14.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/man/Makefile.in 2014-07-23 15:44:37.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -39,6 +38,51 @@ # VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -58,7 +102,7 @@ build_triplet = @build@ host_triplet = @host@ subdir = man -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -70,14 +114,25 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -107,6 +162,7 @@ } am__installdirs = "$(DESTDIR)$(drivermandir)" DATA = $(driverman_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ @@ -137,6 +193,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -165,8 +223,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -205,23 +268,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -329,8 +393,11 @@ -rm -rf .libs _libs install-drivermanDATA: $(driverman_DATA) @$(NORMAL_INSTALL) - test -z "$(drivermandir)" || $(MKDIR_P) "$(DESTDIR)$(drivermandir)" @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(drivermandir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -345,11 +412,11 @@ @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir) -tags: TAGS -TAGS: +tags TAGS: + +ctags CTAGS: -ctags: CTAGS -CTAGS: +cscope cscopelist: distdir: $(DISTFILES) @@ -489,16 +556,17 @@ .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - distclean distclean-generic distclean-libtool distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-drivermanDATA install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am uninstall-drivermanDATA + cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am \ + install-drivermanDATA install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \ + uninstall-am uninstall-drivermanDATA .man.$(DRIVER_MAN_SUFFIX): diff -Nru xserver-xorg-video-intel-2.99.910/missing xserver-xorg-video-intel-2.99.914/missing --- xserver-xorg-video-intel-2.99.910/missing 2013-08-12 21:20:11.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/missing 2014-07-23 14:26:40.000000000 +0000 @@ -1,11 +1,10 @@ #! /bin/sh -# Common stub for a few missing GNU programs while installing. +# Common wrapper for a few potentially missing GNU programs. -scriptversion=2012-01-06.13; # UTC +scriptversion=2013-10-28.13; # UTC -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. +# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,68 +25,40 @@ # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "Try '$0 --help' for more information" exit 1 fi -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi +case $1 in -msg="missing on your system" + --is-lightweight) + # Used by our autoconf macros to check whether the available missing + # script is modern enough. + exit 0 + ;; -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; + --run) + # Back-compat with the calling convention used by older automake. + shift + ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. +Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due +to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch] + aclocal autoconf autoheader autom4te automake makeinfo + bison yacc flex lex help2man -Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and -\`g' are ignored when checking the name. +Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and +'g' are ignored when checking the name. Send bug reports to ." exit $? @@ -99,228 +70,141 @@ ;; -*) - echo 1>&2 "$0: Unknown \`$1' option" - echo 1>&2 "Try \`$0 --help' for more information" + echo 1>&2 "$0: unknown '$1' option" + echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac -# normalize program name to check for. -program=`echo "$1" | sed ' - s/^gnu-//; t - s/^gnu//; t - s/^g//; t'` - -# Now exit if we have it, but it failed. Also exit now if we -# don't have it and --version was passed (most likely to detect -# the program). This is about non-GNU programs, so use $1 not -# $program. -case $1 in - lex*|yacc*) - # Not GNU programs, they don't have --version. - ;; +# Run the given program, remember its exit status. +"$@"; st=$? - *) - if test -z "$run" && ($1 --version) > /dev/null 2>&1; then - # We have it, but it failed. - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - # Could not run --version or --help. This is probably someone - # running `$TOOL --version' or `$TOOL --help' to check whether - # $TOOL exists and not knowing $TOOL uses missing. - exit 1 - fi - ;; -esac - -# If it does not exist, or fails to run (possibly an outdated version), -# try to emulate it. -case $program in - aclocal*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acinclude.m4' or \`${configure_ac}'. You might want - to install the \`Automake' and \`Perl' packages. Grab them from - any GNU archive site." - touch aclocal.m4 - ;; - - autoconf*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`${configure_ac}'. You might want to install the - \`Autoconf' and \`GNU m4' packages. Grab them from any GNU - archive site." - touch configure - ;; - - autoheader*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`acconfig.h' or \`${configure_ac}'. You might want - to install the \`Autoconf' and \`GNU m4' packages. Grab them - from any GNU archive site." - files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` - test -z "$files" && files="config.h" - touch_files= - for f in $files; do - case $f in - *:*) touch_files="$touch_files "`echo "$f" | - sed -e 's/^[^:]*://' -e 's/:.*//'`;; - *) touch_files="$touch_files $f.in";; - esac - done - touch $touch_files - ;; +# If it succeeded, we are done. +test $st -eq 0 && exit 0 - automake*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. - You might want to install the \`Automake' and \`Perl' packages. - Grab them from any GNU archive site." - find . -type f -name Makefile.am -print | - sed 's/\.am$/.in/' | - while read f; do touch "$f"; done - ;; - - autom4te*) - echo 1>&2 "\ -WARNING: \`$1' is needed, but is $msg. - You might have modified some files without having the - proper tools for further handling them. - You can get \`$1' as part of \`Autoconf' from any GNU - archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo "#! /bin/sh" - echo "# Created by GNU Automake missing as a replacement of" - echo "# $ $@" - echo "exit 0" - chmod +x $file - exit 1 - fi - ;; - - bison*|yacc*) - echo 1>&2 "\ -WARNING: \`$1' $msg. You should only need it if - you modified a \`.y' file. You may need the \`Bison' package - in order for those modifications to take effect. You can get - \`Bison' from any GNU archive site." - rm -f y.tab.c y.tab.h - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.y) - SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.c - fi - SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" y.tab.h - fi - ;; - esac - fi - if test ! -f y.tab.h; then - echo >y.tab.h - fi - if test ! -f y.tab.c; then - echo 'main() { return 0; }' >y.tab.c - fi - ;; - - lex*|flex*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.l' file. You may need the \`Flex' package - in order for those modifications to take effect. You can get - \`Flex' from any GNU archive site." - rm -f lex.yy.c - if test $# -ne 1; then - eval LASTARG=\${$#} - case $LASTARG in - *.l) - SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` - if test -f "$SRCFILE"; then - cp "$SRCFILE" lex.yy.c - fi - ;; - esac - fi - if test ! -f lex.yy.c; then - echo 'main() { return 0; }' >lex.yy.c - fi - ;; - - help2man*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a dependency of a manual page. You may need the - \`Help2man' package in order for those modifications to take - effect. You can get \`Help2man' from any GNU archive site." - - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -f "$file"; then - touch $file - else - test -z "$file" || exec >$file - echo ".ab help2man is required to generate this page" - exit $? - fi - ;; - - makeinfo*) - echo 1>&2 "\ -WARNING: \`$1' is $msg. You should only need it if - you modified a \`.texi' or \`.texinfo' file, or any other file - indirectly affecting the aspect of the manual. The spurious - call might also be the consequence of using a buggy \`make' (AIX, - DU, IRIX). You might want to install the \`Texinfo' package or - the \`GNU make' package. Grab either from any GNU archive site." - # The file to touch is that specified with -o ... - file=`echo "$*" | sed -n "$sed_output"` - test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` - if test -z "$file"; then - # ... or it is the one specified with @setfilename ... - infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` - file=`sed -n ' - /^@setfilename/{ - s/.* \([^ ]*\) *$/\1/ - p - q - }' $infile` - # ... or it is derived from the source name (dir/f.texi becomes f.info) - test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info - fi - # If the file does not exist, the user really needs makeinfo; - # let's fail without touching anything. - test -f $file || exit 1 - touch $file - ;; - - *) - echo 1>&2 "\ -WARNING: \`$1' is needed, and is $msg. - You might have modified some files without having the - proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequisites for installing - this package. You may also peek at any GNU archive site, in case - some other package would contain this missing \`$1' program." - exit 1 - ;; -esac +# Also exit now if we it failed (or wasn't found), and '--version' was +# passed; such an option is passed most likely to detect whether the +# program is present and works. +case $2 in --version|--help) exit $st;; esac + +# Exit code 63 means version mismatch. This often happens when the user +# tries to use an ancient version of a tool on a file that requires a +# minimum version. +if test $st -eq 63; then + msg="probably too old" +elif test $st -eq 127; then + # Program was missing. + msg="missing on your system" +else + # Program was found and executed, but failed. Give up. + exit $st +fi -exit 0 +perl_URL=http://www.perl.org/ +flex_URL=http://flex.sourceforge.net/ +gnu_software_URL=http://www.gnu.org/software + +program_details () +{ + case $1 in + aclocal|automake) + echo "The '$1' program is part of the GNU Automake package:" + echo "<$gnu_software_URL/automake>" + echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/autoconf>" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + autoconf|autom4te|autoheader) + echo "The '$1' program is part of the GNU Autoconf package:" + echo "<$gnu_software_URL/autoconf/>" + echo "It also requires GNU m4 and Perl in order to run:" + echo "<$gnu_software_URL/m4/>" + echo "<$perl_URL>" + ;; + esac +} + +give_advice () +{ + # Normalize program name to check for. + normalized_program=`echo "$1" | sed ' + s/^gnu-//; t + s/^gnu//; t + s/^g//; t'` + + printf '%s\n' "'$1' is $msg." + + configure_deps="'configure.ac' or m4 files included by 'configure.ac'" + case $normalized_program in + autoconf*) + echo "You should only need it if you modified 'configure.ac'," + echo "or m4 files included by it." + program_details 'autoconf' + ;; + autoheader*) + echo "You should only need it if you modified 'acconfig.h' or" + echo "$configure_deps." + program_details 'autoheader' + ;; + automake*) + echo "You should only need it if you modified 'Makefile.am' or" + echo "$configure_deps." + program_details 'automake' + ;; + aclocal*) + echo "You should only need it if you modified 'acinclude.m4' or" + echo "$configure_deps." + program_details 'aclocal' + ;; + autom4te*) + echo "You might have modified some maintainer files that require" + echo "the 'autom4te' program to be rebuilt." + program_details 'autom4te' + ;; + bison*|yacc*) + echo "You should only need it if you modified a '.y' file." + echo "You may want to install the GNU Bison package:" + echo "<$gnu_software_URL/bison/>" + ;; + lex*|flex*) + echo "You should only need it if you modified a '.l' file." + echo "You may want to install the Fast Lexical Analyzer package:" + echo "<$flex_URL>" + ;; + help2man*) + echo "You should only need it if you modified a dependency" \ + "of a man page." + echo "You may want to install the GNU Help2man package:" + echo "<$gnu_software_URL/help2man/>" + ;; + makeinfo*) + echo "You should only need it if you modified a '.texi' file, or" + echo "any other file indirectly affecting the aspect of the manual." + echo "You might want to install the Texinfo package:" + echo "<$gnu_software_URL/texinfo/>" + echo "The spurious makeinfo call might also be the consequence of" + echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" + echo "want to install GNU make:" + echo "<$gnu_software_URL/make/>" + ;; + *) + echo "You might have modified some files without having the proper" + echo "tools for further handling them. Check the 'README' file, it" + echo "often tells you about the needed prerequisites for installing" + echo "this package. You may also peek at any GNU archive site, in" + echo "case some other package contains this missing '$1' program." + ;; + esac +} + +give_advice "$1" | sed -e '1s/^/WARNING: /' \ + -e '2,$s/^/ /' >&2 + +# Propagate the correct exit status (expected to be 127 for a program +# not found, 63 for a program that failed due to version mismatch). +exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) diff -Nru xserver-xorg-video-intel-2.99.910/NEWS xserver-xorg-video-intel-2.99.914/NEWS --- xserver-xorg-video-intel-2.99.910/NEWS 2014-02-10 09:38:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/NEWS 2014-07-23 15:43:38.000000000 +0000 @@ -1,4 +1,210 @@ -Snapshot 2.99.910 (2013-02-10) +Snapshot 2.99.914 (2014-07-23) +============================== +And a brown paper bag to hide the rebuilding from the tarball with +'autoreconf -fi' error that arose from not distributing the libobj/ +directory. + + +Snapshot 2.99.913 (2014-07-23) +============================== +This should be it... A few fixes from testing the new code, we should be +ready for the final release. However, we do have one standout feature in +this snapshot, we now officially recognise HD Graphics 5300/5500/5600, +Iris Graphics 6100 and Iris Pro Graphics 6200/P6300 (formerly known as +Broadwell). + + * Check the window actually covers the CRTC before doing a single CRTC flip, + and then restore the right framebuffer after completing CRTC flips. + Otherwise we would detect an error and disable an output under TearFree + Regression in 2.99.912 + https://bugs.freedesktop.org/show_bug.cgi?id=80191 + + * Fix framebuffer creation on kernels older than 3.11 + Regression in 2.99.912 + + * Check that the damage still exists after implicit reduction + Regression in 2.99.912 + https://bugs.freedesktop.org/show_bug.cgi?id=77436 + + * Fix direction flags for fallback composited CopyAreas which + caused scrolling corruption in a few configurations + Regression from 2.20.0 + https://bugs.freedesktop.org/show_bug.cgi?id=79843 + + * Do not throw away damage if there is no redundant copy + https://bugs.freedesktop.org/show_bug.cgi?id=79992 + + * Check clipping on PolyRect before discarding the clipped damage + Regression from 2.99.903 + https://bugs.freedesktop.org/show_bug.cgi?id=79992 + + * Fix hints for GLXPixmapa, as these are never swapped and so + miss invalidating the hints on SwapBuffers with the result + that they are often presumed blank + Regression in 2.99.912 + https://bugs.freedesktop.org/show_bug.cgi?id=79999 + + * Fix incoherent choice of source bo when constructing 8x8 tiles, + incorrect pattern origin when extracting, and then fix the + alignment of colour patterns for BLT operations + https://bugs.freedesktop.org/show_bug.cgi?id=80033 + + * Disable blending with the render engine on snoopable buffers + https://bugs.freedesktop.org/show_bug.cgi?id=80253 + + * Restore throttling to prevent client lag under heavy GPU load + Regression from 2.21.10 + https://bugs.freedesktop.org/show_bug.cgi?id=77436 + + * Use ClientGone for notifications on shared DRI2 windows to prevent + rare crashes due to use-after-free of the swap requests + https://bugs.freedesktop.org/show_bug.cgi?id=80157 + + * Ensure the mmaped CPU bo is idle before migrating damage + https://bugs.freedesktop.org/show_bug.cgi?id=80560 + + * Fix incorrect clipping by the render engine for large DRI2 windows + + * Ensure that the aperture tiling fallbacks are bounded + + * Validate parameter to xf86-video-intel-backlight-helper more carefully + (CVE-2014-4910) + + * Fix slaved scanouts for reverse optimus, though rotated slaves will + require further patches to Xorg. + https://bugs.freedesktop.org/show_bug.cgi?id=81383 + + * Fix build without Composite extension. + + * Fix build without gettline(). + + * UXA: Allocate and resize frontbuffer consistently to pass sanity checks + https://bugs.freedesktop.org/show_bug.cgi?id=80088 + + * UXA: Report cached backlight value when the output is off (like sna) + https://bugzilla.redhat.com/show_bug.cgi?id=1032978 + + * UXA: Mark outputs as off before the kernel does (like sna) + This will prevent the internal panel from starting up blank in some + multi-monitor configurations + https://bugzilla.redhat.com/show_bug.cgi?id=1103806 + +Note that the DRI2 exchange mechanism introduced in 2.99.912 exposes bugs +in some compositors, at least kwin and comptom, which discard DRI2 buffer +invalidates rather than resourcing their texture. For example, +https://bugs.kde.org/show_bug.cgi?id=336589 + +Note that the improved triple buffering introduced in DRI2 requires a patch +to Xorg (now released upstream) to prevent crashes with DRI_PRIME. +https://bugs.freedesktop.org/show_bug.cgi?id=80001 + +Note that DRI3/Present require tracking the relevant development trees for +mesa and the xserver as they are very much still under early testing. Also +be aware that Mesa provides no support for explicit fencing so Damage +tracking between compositors and clients is unserialised. + + +Snapshot 2.99.912 (2014-06-10) +============================== +A final round of features. We have everything from support for variable +cursor sizes, support for the DRI3 and Present extensions, improved DRI2 +support, support for Xserver 1.16, userptr from kernel 3.16, and +precursory support for DP multistream transport, + + * Avoid discarding dirty pixels when promoting a migration to cover the + whole pixmap. + Regression in 2.99.911 + https://bugs.freedesktop.org/show_bug.cgi?id=77063 + https://bugs.freedesktop.org/show_bug.cgi?id=77178 + + * Avoid overextending degenerate lines (and consequentially accessing + pixels outside of our damaged area). + https://bugs.freedesktop.org/show_bug.cgi?id=77074 + + * Fix subpixel glyph rendering on gen2 devices (830-865 chipsets) + Regression in 2.99.911 + https://bugs.freedesktop.org/show_bug.cgi?id=77201 + + * Share the global pixman glyph cache between ZaphodHeads + https://bugs.freedesktop.org/show_bug.cgi?id=54707 + + * Light up all connected outputs, even if their status is unknown, on + takeover from fbcon. This prevents loss of display after a resume + on recent kernels, for example. + https://bugs.freedesktop.org/show_bug.cgi?id=77768 + + * Show the video overlay (when supported by the hardware) across all + outputs. + https://bugs.freedesktop.org/show_bug.cgi?id=77802 + + * Do not discard damage when performing "BLT" spans inplace with the CPU. + Regression from 2.20.10 + + * Avoid discarding IO buffers too early during their preparation for a + new batch + https://bugs.freedesktop.org/show_bug.cgi?id=79238 + + * Fix fallback handling for displaying large scaled framebuffers (that + are too large to be scaled by the GPU in a single pass) + https://bugs.freedesktop.org/show_bug.cgi?id=79320 + + * Listen to external modifications of backlight value and propagate + the notifications to RandR clients. This should make the GUI report + ACPI keypresses to change the backlight correctly. + https://bugs.freedesktop.org/show_bug.cgi?id=79699 + + * UXA: fix pageflips with 3 heads. + + * UXA: do not report a BadMatch error for DRI2GetMsc - as clients are + often unprepared and die when they get the unexpected error. + + +Snapshot 2.99.911 (2014-03-19) +============================== +Hans de Geode has been working on making the Xserver work without +privileges under the supervision of systemd/logind. This necessitated a +few new features for us: server fds (where we are passed which fd to use +to talk to our device by the Xserver who may in turn receive it from +logind or other host) and a small backlight helper so that we can continue +to provide a RandR backlight property when running without root privileges. + + * Flush when changing blend modes on Ironlake, or else single glyphs + are sometimes rendered incorrectly + Regression from 2.20.15 + https://bugs.freedesktop.org/show_bug.cgi?id=74882 + + * Fix pixmap offsets for pixman fallbacks onto Composite redirected + windows + https://bugs.freedesktop.org/show_bug.cgi?id=73811 + + * Fix blending onto 8-bit destinations, typically used for generating + masks in complex Render operations, on gen2 + https://bugs.freedesktop.org/show_bug.cgi?id=75818 + + * Handle failure to create DRI bo more carefully. For example on gen3, + the DDX supports pixmaps that are much, much larger than OpenGL can + use and do not support the tiling modes that we request for OpenGL. + https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1289049 + + * Fix a bookkeeping bug with proxy buffers that are marked active but + not actually inserted into a request (so they end up permanently + active and confuse everybody). + https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/1289923 + + * Actually turn off displays with DPMS off for UXA. + Regression from 2.99.903, but requires + + kernel commit c9976dcf55c8aaa7037427b239f15e5acfc01a3a + Author: Chris Wilson + Date: Sun Sep 29 19:15:07 2013 +0100 + + drm/i915: Only apply DPMS to the encoder if enabled + + instead for correct behaviour on Haswell. + https://code.google.com/p/chromium/issues/detail?id=341135 + + +Snapshot 2.99.910 (2014-02-10) ============================== Another latent bug exposed by recent changes merit another snapshot for final testing. @@ -23,7 +229,7 @@ https://bugs.freedesktop.org/show_bug.cgi?id=7237 -Snapshot 2.99.909 (2013-02-01) +Snapshot 2.99.909 (2014-02-01) ============================== Pass the brown paper bag. Ridiculously stupid bug in last minute coding. @@ -35,7 +241,7 @@ https://bugs.freedesktop.org/show_bug.cgi?id=74327 -Snapshot 2.99.908 (2013-01-31) +Snapshot 2.99.908 (2014-01-31) ============================== A couple of regressions dashed the hopes that .907 was to be the final release candidate, so time to start the cycle again after applying a few diff -Nru xserver-xorg-video-intel-2.99.910/README xserver-xorg-video-intel-2.99.914/README --- xserver-xorg-video-intel-2.99.910/README 2013-11-25 11:57:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/README 2014-06-25 10:31:36.000000000 +0000 @@ -1,6 +1,6 @@ xf86-video-intel Open-source X.org graphics driver for Intel graphics -http://www.intellinuxgraphics.com/ +https://01.org/linuxgraphics/ What is xf86-video-intel ------------------------ @@ -15,13 +15,16 @@ G/Q33,G/Q35,G41,G/Q43,G/GM/Q45 PineView-M (Atom N400 series) PineView-D (Atom D400/D500 series) + Intel(R) HD Graphics: 2000-6000, + Intel(R) Iris(TM) Graphics: 5100/6100, and + Intel(R) Iris(TM) Pro Graphics: 5200/6200/P6300. Where to get more information about the driver ---------------------------------------------- The primary source of information about this and other open-source drivers for Intel graphics is: - http://intellinuxgraphics.org/ + https://01.org/linuxgraphics/ Documentation specific to the xf86-video-intel driver including possible configuration options for the xorg.conf file can be found in @@ -42,7 +45,7 @@ To report bugs encountered with the driver, see: - http://intellinuxgraphics.org/how_to_report_bug.html + https://01.org/linuxgraphics/documentation/how-report-bugs To see bugs that are targeted to be fixed in the next release: diff -Nru xserver-xorg-video-intel-2.99.910/src/backlight.c xserver-xorg-video-intel-2.99.914/src/backlight.c --- xserver-xorg-video-intel-2.99.910/src/backlight.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/backlight.c 2014-06-18 13:10:37.000000000 +0000 @@ -0,0 +1,494 @@ +/*************************************************************************** + + Copyright 2014 Intel Corporation. All Rights Reserved. + Copyright 2014 Red Hat, Inc. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sub license, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice (including the + next paragraph) shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + IN NO EVENT SHALL INTEL, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + **************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "backlight.h" +#include "fd.h" + +#define BACKLIGHT_CLASS "/sys/class/backlight" + +/* Enough for 10 digits of backlight + '\n' + '\0' */ +#define BACKLIGHT_VALUE_LEN 12 + +#ifndef ARRAY_SIZE +#define ARRAY_SIZE(A) (sizeof(A)/sizeof(A[0])) +#endif + +/* + * Unfortunately this is not as simple as I would like it to be. If selinux is + * dropping dbus messages pkexec may block *forever*. + * + * Backgrounding pkexec by doing System("pkexec ...&") does not work because + * that detaches pkexec from its parent at which point its security checks + * fail and it refuses to execute the helper. + * + * So we're left with spawning a helper child which gets levels to set written + * to it through a pipe. This turns the blocking forever problem from a hung + * machine problem into a simple backlight control not working problem. + * + * If only things were as simple as on OpenBSD! :) + */ + +#ifdef __OpenBSD__ + +#include +#include + +int backlight_set(struct backlight *b, int level) +{ + struct wsdisplay_param param; + + if (b->iface == NULL) + return -1; + + if ((unsigned)level > b->max) + level = b->max; + + memset(¶m, 0, sizeof(param)); + param.param = WSDISPLAYIO_PARAM_BRIGHTNESS; + param.curval = level; + + return ioctl(xf86Info.consoleFd, WSDISPLAYIO_SETPARAM, ¶m); +} + +int backlight_get(struct backlight *b) +{ + struct wsdisplay_param param; + + if (b->iface == NULL) + return -1; + + memset(¶m, 0, sizeof(param)); + param.param = WSDISPLAYIO_PARAM_BRIGHTNESS; + + if (ioctl(xf86Info.consoleFd, WSDISPLAYIO_GETPARAM, ¶m)) + return -1; + + return param.curval; +} + +int backlight_open(struct backlight *b, char *iface) +{ + struct wsdisplay_param param; + + if (iface != NULL) + return -1; + + memset(¶m, 0, sizeof(param)); + param.param = WSDISPLAYIO_PARAM_BRIGHTNESS; + + if (ioctl(xf86Info.consoleFd, WSDISPLAYIO_GETPARAM, ¶m) == -1) + return -1; + + b->iface = strdup("wscons"); + if (b->iface == NULL) + return -1; + + b->max = param.max; + b->fd = -1; + b->type = BL_PLATFORM; + + return param.curval; +} + +enum backlight_type backlight_exists(const char *iface) +{ + if (iface != NULL) + return BL_NONE; + + return BL_PLATFORM; +} + +#else + +static int +is_sysfs_fd(int fd) +{ + struct stat st; + return fstat(fd, &st) == 0 && major(st.st_dev) == 0; +} + +static int +__backlight_open(const char *iface, const char *file, int mode) +{ + char buf[1024]; + int fd; + + snprintf(buf, sizeof(buf), BACKLIGHT_CLASS "/%s/%s", iface, file); + fd = open(buf, mode); + if (fd == -1) + return -1; + + if (!is_sysfs_fd(fd)) { + close(fd); + return -1; + } + + return fd; +} + +static int +__backlight_read(const char *iface, const char *file) +{ + char buf[BACKLIGHT_VALUE_LEN]; + int fd, val; + + fd = __backlight_open(iface, file, O_RDONLY); + if (fd < 0) + return -1; + + val = read(fd, buf, BACKLIGHT_VALUE_LEN - 1); + if (val > 0) { + buf[val] = '\0'; + val = atoi(buf); + } else + val = -1; + close(fd); + + return val; +} + +/* List of available kernel interfaces in priority order */ +static const char *known_interfaces[] = { + "dell_backlight", + "gmux_backlight", + "asus-laptop", + "asus-nb-wmi", + "eeepc", + "thinkpad_screen", + "mbp_backlight", + "fujitsu-laptop", + "sony", + "samsung", + "acpi_video1", + "acpi_video0", + "intel_backlight", +}; + +static enum backlight_type __backlight_type(const char *iface) +{ + char buf[1024]; + int fd, v; + + v = -1; + fd = __backlight_open(iface, "type", O_RDONLY); + if (fd >= 0) { + v = read(fd, buf, sizeof(buf)-1); + close(fd); + } + if (v > 0) { + while (v > 0 && isspace(buf[v-1])) + v--; + buf[v] = '\0'; + + if (strcmp(buf, "raw") == 0) + v = BL_RAW; + else if (strcmp(buf, "platform") == 0) + v = BL_PLATFORM; + else if (strcmp(buf, "firmware") == 0) + v = BL_FIRMWARE; + else + v = BL_NAMED; + } else + v = BL_NAMED; + + if (v == BL_NAMED) { + int i; + for (i = 0; i < ARRAY_SIZE(known_interfaces); i++) { + if (strcmp(iface, known_interfaces[i]) == 0) + break; + } + v += i; + } + + return v; +} + +enum backlight_type backlight_exists(const char *iface) +{ + if (__backlight_read(iface, "brightness") < 0) + return BL_NONE; + + if (__backlight_read(iface, "max_brightness") <= 0) + return BL_NONE; + + return __backlight_type(iface); +} + +static int __backlight_init(struct backlight *b, char *iface, int fd) +{ + b->fd = fd_set_cloexec(fd_set_nonblock(fd)); + b->iface = iface; + return 1; +} + +static int __backlight_direct_init(struct backlight *b, char *iface) +{ + int fd; + + fd = __backlight_open(iface, "brightness", O_RDWR); + if (fd < 0) + return 0; + + return __backlight_init(b, iface, fd); +} + +static int __backlight_helper_init(struct backlight *b, char *iface) +{ +#if USE_BACKLIGHT_HELPER + struct stat st; + char *env[] = { NULL }; + int use_pkexec = 0; + int fds[2]; + + /* + * Some systems may prefer using PolicyKit's pkexec over + * making the helper suid root, since the suid option will allow + * anyone to control the backlight. However, as pkexec + * is quite troublesome and not universally available, we + * still try the old fashioned and simple method first. + * Either way, we have to trust that it is our backlight-helper + * that is run and that we have scrutinised it carefully. + */ + if (stat(LIBEXEC_PATH "/xf86-video-intel-backlight-helper", &st)) + return 0; + + if ((st.st_mode & (S_IFREG | S_ISUID | S_IXUSR)) != (S_IFREG | S_ISUID | S_IXUSR)) { + if (System("pkexec --version")) + return 0; + + use_pkexec = 1; + } + + if (pipe(fds)) + return 0; + + switch ((b->pid = fork())) { + case 0: + if (setgid(getgid()) || setuid(getuid())) + _exit(127); + + close(fds[1]); + if (dup2(fds[0], 0)) + _exit(127); + close(fds[0]); + + if (use_pkexec) { + execlp("pkexec", "pkexec", + LIBEXEC_PATH "/xf86-video-intel-backlight-helper", + iface, (char *)0); + } else { + execle(LIBEXEC_PATH "/xf86-video-intel-backlight-helper", + "xf86-video-intel-backlight-helper", + iface, (char *)0, env); + } + _exit(1); + /* unreachable fallthrough */ + case -1: + close(fds[1]); + close(fds[0]); + return 0; + + default: + close(fds[0]); + return __backlight_init(b, iface, fds[1]); + } +#else + return 0; +#endif +} + +static char * +__backlight_find(void) +{ + char *best_iface = NULL; + unsigned best_type = INT_MAX; + DIR *dir; + struct dirent *de; + + dir = opendir(BACKLIGHT_CLASS); + if (dir == NULL) + return NULL; + + while ((de = readdir(dir))) { + int v; + + if (*de->d_name == '.') + continue; + + /* Fallback to priority list of known iface for old kernels */ + v = backlight_exists(de->d_name); + if (v < best_type) { + char *copy = strdup(de->d_name); + if (copy) { + free(best_iface); + best_iface = copy; + best_type = v; + } + } + } + closedir(dir); + + return best_iface; +} + +int backlight_open(struct backlight *b, char *iface) +{ + int level; + + if (iface == NULL) + iface = __backlight_find(); + if (iface == NULL) + return -1; + + b->type = __backlight_type(iface); + + b->max = __backlight_read(iface, "max_brightness"); + if (b->max <= 0) + return -1; + + level = __backlight_read(iface, "brightness"); + if (level < 0) + return -1; + + if (!__backlight_direct_init(b, iface) && + !__backlight_helper_init(b, iface)) + return -1; + + return level; +} + +int backlight_set(struct backlight *b, int level) +{ + char val[BACKLIGHT_VALUE_LEN]; + int len, ret = 0; + + if (b->iface == NULL) + return 0; + + if ((unsigned)level > b->max) + level = b->max; + + len = snprintf(val, BACKLIGHT_VALUE_LEN, "%d\n", level); + if (write(b->fd, val, len) != len) + ret = -1; + + return ret; +} + +int backlight_get(struct backlight *b) +{ + int level; + + if (b->iface == NULL) + return -1; + + level = __backlight_read(b->iface, "brightness"); + if (level > b->max) + level = b->max; + else if (level < 0) + level = -1; + return level; +} +#endif + +void backlight_disable(struct backlight *b) +{ + if (b->iface == NULL) + return; + + if (b->fd != -1) + close(b->fd); + + free(b->iface); + b->iface = NULL; +} + +void backlight_close(struct backlight *b) +{ + backlight_disable(b); + if (b->pid) + waitpid(b->pid, NULL, 0); +} + +char *backlight_find_for_device(struct pci_device *pci) +{ + char path[200]; + unsigned best_type = INT_MAX; + char *best_iface = NULL; + DIR *dir; + struct dirent *de; + + snprintf(path, sizeof(path), + "/sys/bus/pci/devices/%04x:%02x:%02x.%d/backlight", + pci->domain, pci->bus, pci->dev, pci->func); + + dir = opendir(path); + if (dir == NULL) + return NULL; + + while ((de = readdir(dir))) { + int v; + + if (*de->d_name == '.') + continue; + + v = backlight_exists(de->d_name); + if (v < best_type) { + char *copy = strdup(de->d_name); + if (copy) { + free(best_iface); + best_iface = copy; + best_type = v; + } + } + } + closedir(dir); + + return best_iface; +} diff -Nru xserver-xorg-video-intel-2.99.910/src/backlight.h xserver-xorg-video-intel-2.99.914/src/backlight.h --- xserver-xorg-video-intel-2.99.910/src/backlight.h 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/backlight.h 2014-04-09 17:41:18.000000000 +0000 @@ -0,0 +1,56 @@ +/*************************************************************************** + + Copyright 2014 Intel Corporation. All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sub license, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice (including the + next paragraph) shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + IN NO EVENT SHALL INTEL, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + **************************************************************************/ + +#ifndef BACKLIGHT_H +#define BACKLIGHT_H + +enum backlight_type { + BL_NONE = -1, + BL_PLATFORM, + BL_FIRMWARE, + BL_RAW, + BL_NAMED, +}; + +struct backlight { + char *iface; + enum backlight_type type; + int max; + int pid, fd; +}; + +enum backlight_type backlight_exists(const char *iface); + +int backlight_open(struct backlight *backlight, char *iface); +int backlight_set(struct backlight *backlight, int level); +int backlight_get(struct backlight *backlight); +void backlight_disable(struct backlight *backlight); +void backlight_close(struct backlight *backlight); + +struct pci_device; +char *backlight_find_for_device(struct pci_device *pci); + +#endif /* BACKLIGHT_H */ diff -Nru xserver-xorg-video-intel-2.99.910/src/compat-api.h xserver-xorg-video-intel-2.99.914/src/compat-api.h --- xserver-xorg-video-intel-2.99.910/src/compat-api.h 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/compat-api.h 2014-06-21 14:45:39.000000000 +0000 @@ -107,6 +107,30 @@ #endif +static inline int +region_num_rects(const RegionRec *r) +{ + return r->data ? r->data->numRects : 1; +} + +static inline int +region_nil(const RegionRec *r) +{ + return region_num_rects(r) == 0; +} + +static inline BoxPtr +region_boxptr(const RegionRec *r) +{ + return (BoxPtr)(r->data + 1); +} + +static inline const BoxRec * +region_rects(const RegionRec *r) +{ + return r->data ? (const BoxRec *)(r->data + 1) : &r->extents; +} + #ifndef INCLUDE_LEGACY_REGION_DEFINES #define RegionCreate(r, s) REGION_CREATE(NULL, r, s) #define RegionBreak(r) REGION_BREAK(NULL, r) @@ -121,6 +145,7 @@ #define RegionCopy(res, r) REGION_COPY(NULL, res, r) #define RegionIntersect(res, r1, r2) REGION_INTERSECT(NULL, res, r1, r2) #define RegionUnion(res, r1, r2) REGION_UNION(NULL, res, r1, r2) +#define RegionSubtract(res, r1, r2) REGION_SUBTRACT(NULL, res, r1, r2) #define RegionTranslate(r, x, y) REGION_TRANSLATE(NULL, r, x, y) #define RegionUninit(r) REGION_UNINIT(NULL, r) #define region_from_bitmap BITMAP_TO_REGION diff -Nru xserver-xorg-video-intel-2.99.910/src/fd.c xserver-xorg-video-intel-2.99.914/src/fd.c --- xserver-xorg-video-intel-2.99.910/src/fd.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/fd.c 2014-04-09 17:41:18.000000000 +0000 @@ -0,0 +1,69 @@ +/*************************************************************************** + + Copyright 2013 Intel Corporation. All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sub license, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice (including the + next paragraph) shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + IN NO EVENT SHALL INTEL, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + **************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include + +#include "fd.h" + +int fd_set_cloexec(int fd) +{ + int flags; + + if (fd == -1) + return fd; + +#ifdef FD_CLOEXEC + flags = fcntl(fd, F_GETFD); + if (flags != -1) { + flags |= FD_CLOEXEC; + fcntl(fd, F_SETFD, flags); + } +#endif + + return fd; +} + +int fd_set_nonblock(int fd) +{ + int flags; + + if (fd == -1) + return fd; + + flags = fcntl(fd, F_GETFL); + if (flags != -1) { + flags |= O_NONBLOCK; + fcntl(fd, F_SETFL, flags); + } + + return fd; +} + diff -Nru xserver-xorg-video-intel-2.99.910/src/fd.h xserver-xorg-video-intel-2.99.914/src/fd.h --- xserver-xorg-video-intel-2.99.910/src/fd.h 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/fd.h 2014-04-09 17:41:18.000000000 +0000 @@ -0,0 +1,33 @@ +/*************************************************************************** + + Copyright 2013 Intel Corporation. All Rights Reserved. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sub license, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice (including the + next paragraph) shall be included in all copies or substantial portions + of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + IN NO EVENT SHALL INTEL, AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR + THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + **************************************************************************/ + +#ifndef FD_H +#define FD_H + +int fd_set_cloexec(int fd); +int fd_set_nonblock(int fd); + +#endif /* FD_H */ diff -Nru xserver-xorg-video-intel-2.99.910/src/i915_pciids.h xserver-xorg-video-intel-2.99.914/src/i915_pciids.h --- xserver-xorg-video-intel-2.99.910/src/i915_pciids.h 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/i915_pciids.h 2014-06-24 19:52:58.000000000 +0000 @@ -191,8 +191,8 @@ INTEL_VGA_DEVICE(0x0A06, info), /* ULT GT1 mobile */ \ INTEL_VGA_DEVICE(0x0A16, info), /* ULT GT2 mobile */ \ INTEL_VGA_DEVICE(0x0A26, info), /* ULT GT3 mobile */ \ - INTEL_VGA_DEVICE(0x0A0E, info), /* ULT GT1 reserved */ \ - INTEL_VGA_DEVICE(0x0A1E, info), /* ULT GT2 reserved */ \ + INTEL_VGA_DEVICE(0x0A0E, info), /* ULX GT1 mobile */ \ + INTEL_VGA_DEVICE(0x0A1E, info), /* ULX GT2 mobile */ \ INTEL_VGA_DEVICE(0x0A2E, info), /* ULT GT3 reserved */ \ INTEL_VGA_DEVICE(0x0D06, info), /* CRW GT1 mobile */ \ INTEL_VGA_DEVICE(0x0D16, info), /* CRW GT2 mobile */ \ @@ -223,14 +223,40 @@ _INTEL_BDW_D(gt, 0x160A, info), /* Server */ \ _INTEL_BDW_D(gt, 0x160D, info) /* Workstation */ -#define INTEL_BDW_M_IDS(info) \ +#define INTEL_BDW_GT12M_IDS(info) \ _INTEL_BDW_M_IDS(1, info), \ - _INTEL_BDW_M_IDS(2, info), \ - _INTEL_BDW_M_IDS(3, info) + _INTEL_BDW_M_IDS(2, info) -#define INTEL_BDW_D_IDS(info) \ +#define INTEL_BDW_GT12D_IDS(info) \ _INTEL_BDW_D_IDS(1, info), \ - _INTEL_BDW_D_IDS(2, info), \ + _INTEL_BDW_D_IDS(2, info) + +#define INTEL_BDW_GT3M_IDS(info) \ + _INTEL_BDW_M_IDS(3, info) + +#define INTEL_BDW_GT3D_IDS(info) \ _INTEL_BDW_D_IDS(3, info) +#define INTEL_BDW_RSVDM_IDS(info) \ + _INTEL_BDW_M_IDS(4, info) + +#define INTEL_BDW_RSVDD_IDS(info) \ + _INTEL_BDW_D_IDS(4, info) + +#define INTEL_BDW_M_IDS(info) \ + INTEL_BDW_GT12M_IDS(info), \ + INTEL_BDW_GT3M_IDS(info), \ + INTEL_BDW_RSVDM_IDS(info) + +#define INTEL_BDW_D_IDS(info) \ + INTEL_BDW_GT12D_IDS(info), \ + INTEL_BDW_GT3D_IDS(info), \ + INTEL_BDW_RSVDD_IDS(info) + +#define INTEL_CHV_IDS(info) \ + INTEL_VGA_DEVICE(0x22b0, info), \ + INTEL_VGA_DEVICE(0x22b1, info), \ + INTEL_VGA_DEVICE(0x22b2, info), \ + INTEL_VGA_DEVICE(0x22b3, info) + #endif /* _I915_PCIIDS_H */ diff -Nru xserver-xorg-video-intel-2.99.910/src/intel_device.c xserver-xorg-video-intel-2.99.914/src/intel_device.c --- xserver-xorg-video-intel-2.99.910/src/intel_device.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/intel_device.c 2014-06-24 11:30:56.000000000 +0000 @@ -35,10 +35,9 @@ #include #include #include +#include #include -#include - #include #include @@ -52,7 +51,18 @@ #include #endif +#ifdef HAVE_VALGRIND +#include +#include +#define VG(x) x +#else +#define VG(x) +#endif + +#define VG_CLEAR(s) VG(memset(&s, 0, sizeof(s))) + #include "intel_driver.h" +#include "fd.h" struct intel_device { char *master_node; @@ -69,11 +79,11 @@ struct drm_i915_getparam gp; int devid = 0; - memset(&gp, 0, sizeof(gp)); + VG_CLEAR(gp); gp.param = I915_PARAM_CHIPSET_ID; gp.value = &devid; - if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp))) + if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) return 0; return devid; @@ -103,7 +113,7 @@ xf86GetEntityPrivate(scrn->entityList[0], intel_device_key)->ptr = dev; } -static Bool is_i915_device(int fd) +static int is_i915_device(int fd) { drm_version_t version; char name[5] = ""; @@ -113,130 +123,266 @@ version.name = name; if (drmIoctl(fd, DRM_IOCTL_VERSION, &version)) - return FALSE; + return 0; return strcmp("i915", name) == 0; } -static int __intel_check_device(int fd) +static int is_i915_gem(int fd) { - int ret; + int ret = is_i915_device(fd); - /* Confirm that this is a i915.ko device with GEM/KMS enabled */ - ret = is_i915_device(fd); if (ret) { struct drm_i915_getparam gp; + + VG_CLEAR(gp); gp.param = I915_PARAM_HAS_GEM; gp.value = &ret; + if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) - ret = FALSE; + ret = 0; } + + return ret; +} + +static int __intel_check_device(int fd) +{ + int ret; + + /* Confirm that this is a i915.ko device with GEM/KMS enabled */ + ret = is_i915_gem(fd); if (ret && !hosted()) { struct drm_mode_card_res res; memset(&res, 0, sizeof(res)); if (drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res)) - ret = FALSE; + ret = 0; } return ret; } -static int fd_set_cloexec(int fd) +static int open_cloexec(const char *path) { - int flags; + struct stat st; + int loop = 1000; + int fd; - if (fd == -1) - return fd; + /* No file? Assume the driver is loading slowly */ + while (stat(path, &st) == -1 && errno == ENOENT && --loop) + usleep(50000); + + if (loop != 1000) + ErrorF("intel: waited %d ms for '%s' to appear\n", + (1000 - loop) * 50, path); -#ifdef FD_CLOEXEC - flags = fcntl(fd, F_GETFD); - if (flags != -1) { - flags |= FD_CLOEXEC; - fcntl(fd, F_SETFD, flags); - } + fd = -1; +#ifdef O_CLOEXEC + fd = open(path, O_RDWR | O_NONBLOCK | O_CLOEXEC); #endif + if (fd == -1) + fd = fd_set_cloexec(open(path, O_RDWR | O_NONBLOCK)); return fd; } -static int fd_set_nonblock(int fd) +#ifdef __linux__ +static int __intel_open_device__major_minor(int _major, int _minor) { - int flags; + char path[256]; + DIR *dir; + struct dirent *de; + int base, fd = -1; - if (fd == -1) - return fd; + base = sprintf(path, "/dev/dri/"); + + dir = opendir(path); + if (dir == NULL) + return -1; - flags = fcntl(fd, F_GETFD); - if (flags != -1) { - flags |= O_NONBLOCK; - fcntl(fd, F_SETFD, flags); + while ((de = readdir(dir)) != NULL) { + struct stat st; + + if (*de->d_name == '.') + continue; + + sprintf(path + base, "%s", de->d_name); + if (stat(path, &st) == 0 && + major(st.st_rdev) == _major && + minor(st.st_rdev) == _minor) { + fd = open_cloexec(path); + break; + } } + closedir(dir); + return fd; } -static int __intel_open_device(const struct pci_device *pci, char **path) +static int __intel_open_device__pci(const struct pci_device *pci) { + struct stat st; + char path[256]; + DIR *dir; + struct dirent *de; + int base; int fd; - if (*path == NULL) { - char id[20]; - int ret; - - if (pci == NULL) - return -1; + /* Look up the major:minor for the drm device through sysfs. + * First we need to check that sysfs is available, then + * check that we have loaded our driver. When we are happy + * that our KMS module is loaded, we can then search for our + * device node. We make the assumption that it uses the same + * name, but after that we read the major:minor assigned to us + * and search for a matching entry in /dev. + */ + + base = sprintf(path, + "/sys/bus/pci/devices/%04x:%02x:%02x.%d/", + pci->domain, pci->bus, pci->dev, pci->func); + if (stat(path, &st)) + return -1; - snprintf(id, sizeof(id), - "pci:%04x:%02x:%02x.%d", - pci->domain, pci->bus, pci->dev, pci->func); + sprintf(path + base, "drm"); + dir = opendir(path); + if (dir == NULL) { + int loop = 0; - ret = drmCheckModesettingSupported(id); - if (ret) { + sprintf(path + base, "driver"); + if (stat(path, &st)) { if (xf86LoadKernelModule("i915")) - ret = drmCheckModesettingSupported(id); - if (ret) return -1; - /* Be nice to the user and load fbcon too */ (void)xf86LoadKernelModule("fbcon"); } - fd = drmOpen(NULL, id); - if (fd != -1) { - *path = drmGetDeviceNameFromFd(fd); - if (*path == NULL) { - close(fd); - fd = -1; + sprintf(path + base, "drm"); + while ((dir = opendir(path)) == NULL && loop++ < 100) + usleep(20000); + + ErrorF("intel: waited %d ms for i915.ko driver to load\n", loop * 20000 / 1000); + + if (dir == NULL) + return -1; + } + + fd = -1; + while ((de = readdir(dir)) != NULL) { + if (*de->d_name == '.') + continue; + + if (strncmp(de->d_name, "card", 4) == 0) { + sprintf(path + base + 4, "/dev/dri/%s", de->d_name); + fd = open_cloexec(path + base + 4); + if (fd != -1) + break; + + sprintf(path + base + 3, "/%s/dev", de->d_name); + fd = open(path, O_RDONLY); + if (fd == -1) + break; + + base = read(fd, path, 256); + close(fd); + + fd = -1; + if (base > 0) { + int major, minor; + path[base] = '\0'; + if (sscanf(path, "%d:%d", &major, &minor) == 2) + fd = __intel_open_device__major_minor(major, minor); } + break; } - fd = fd_set_nonblock(fd); - } else { -#ifdef O_CLOEXEC - fd = open(*path, O_RDWR | O_NONBLOCK | O_CLOEXEC); + } + closedir(dir); + + return fd; +} #else - fd = -1; +static int __intel_open_device__pci(const struct pci_device *pci) { return -1; } #endif - if (fd == -1) - fd = fd_set_cloexec(open(*path, O_RDWR | O_NONBLOCK)); + +static int __intel_open_device__legacy(const struct pci_device *pci) +{ + char id[20]; + int ret; + + snprintf(id, sizeof(id), + "pci:%04x:%02x:%02x.%d", + pci->domain, pci->bus, pci->dev, pci->func); + + ret = drmCheckModesettingSupported(id); + if (ret) { + if (xf86LoadKernelModule("i915")) + ret = drmCheckModesettingSupported(id); + if (ret) + return -1; + /* Be nice to the user and load fbcon too */ + (void)xf86LoadKernelModule("fbcon"); } + return fd_set_nonblock(drmOpen(NULL, id)); +} + +static int __intel_open_device(const struct pci_device *pci, const char *path) +{ + int fd; + + if (path == NULL) { + if (pci == NULL) + return -1; + + fd = __intel_open_device__pci(pci); + if (fd == -1) + fd = __intel_open_device__legacy(pci); + } else + fd = open_cloexec(path); + return fd; } -static char *find_render_node(int fd) +static char *find_master_node(int fd) { -#if defined(USE_RENDERNODE) - struct stat master, render; + struct stat st, master; char buf[128]; - if (fstat(fd, &master)) + if (fstat(fd, &st)) return NULL; - if (!S_ISCHR(master.st_mode)) + if (!S_ISCHR(st.st_mode)) return NULL; + sprintf(buf, "/dev/dri/card%d", (int)(st.st_rdev & 0x7f)); + if (stat(buf, &master) == 0 && + st.st_mode == master.st_mode && + (st.st_rdev & 0x7f) == master.st_rdev) + return strdup(buf); + + /* Fallback to iterating over the usual suspects */ + return drmGetDeviceNameFromFd(fd); +} + +static int is_render_node(int fd, struct stat *st) +{ + if (fstat(fd, st)) + return 0; + + if (!S_ISCHR(st->st_mode)) + return 0; + + return st->st_rdev & 0x80; +} + +static char *find_render_node(int fd) +{ +#if defined(USE_RENDERNODE) + struct stat master, render; + char buf[128]; + /* Are we a render-node ourselves? */ - if (master.st_rdev & 0x80) + if (is_render_node(fd, &master)) return NULL; sprintf(buf, "/dev/dri/renderD%d", (int)((master.st_rdev | 0x80) & 0xbf)); @@ -273,19 +419,13 @@ #endif -#if defined(ODEV_ATTRIB_FD) && 0 +#if defined(ODEV_ATTRIB_FD) static int get_fd(struct xf86_platform_device *dev) { - const char *str; - if (dev == NULL) return -1; - str = xf86_get_platform_device_attrib(dev, ODEV_ATTRIB_FD); - if (str == NULL) - return -1; - - return atoi(str); + return xf86_get_platform_device_int_attrib(dev, ODEV_ATTRIB_FD, -1); } #else @@ -294,16 +434,27 @@ { return -1; } - #endif +static int is_master(int fd) +{ + drmSetVersion sv; + + sv.drm_di_major = 1; + sv.drm_di_minor = 1; + sv.drm_dd_major = -1; + sv.drm_dd_minor = -1; + + return drmIoctl(fd, DRM_IOCTL_SET_VERSION, &sv) == 0; +} + int intel_open_device(int entity_num, const struct pci_device *pci, struct xf86_platform_device *platform) { struct intel_device *dev; - char *local_path; - int fd; + char *path; + int fd, master_count; if (intel_device_key == -1) intel_device_key = xf86AllocateEntityPrivateIndex(); @@ -314,13 +465,23 @@ if (dev) return dev->fd; - local_path = get_path(platform); + path = get_path(platform); + master_count = 1; /* DRM_MASTER is managed by Xserver */ fd = get_fd(platform); - if (fd == -1) - fd = __intel_open_device(pci, &local_path); - if (fd == -1) - goto err_path; + if (fd == -1) { + fd = __intel_open_device(pci, path); + if (fd == -1) + goto err_path; + + master_count = 0; + } + + if (path == NULL) { + path = find_master_node(fd); + if (path == NULL) + goto err_close; + } if (!__intel_check_device(fd)) goto err_close; @@ -329,31 +490,44 @@ if (dev == NULL) goto err_close; + /* If hosted under a system compositor, just pretend to be master */ + if (hosted()) + master_count++; + + /* Non-root user holding MASTER, don't let go */ + if (geteuid() && is_master(fd)) + master_count++; + dev->fd = fd; - dev->open_count = 0; - dev->master_count = 0; - dev->master_node = local_path; + dev->open_count = master_count; + dev->master_count = master_count; + dev->master_node = path; dev->render_node = find_render_node(fd); if (dev->render_node == NULL) dev->render_node = dev->master_node; - /* If hosted under a system compositor, just pretend to be master */ - if (hosted()) { - dev->open_count++; - dev->master_count++; - } - xf86GetEntityPrivate(entity_num, intel_device_key)->ptr = dev; return fd; err_close: - close(fd); + if (master_count == 0) /* Don't close server-fds */ + close(fd); err_path: - free(local_path); + free(path); return -1; } +int __intel_peek_fd(ScrnInfoPtr scrn) +{ + struct intel_device *dev; + + dev = intel_device(scrn); + assert(dev && dev->fd != -1); + + return dev->fd; +} + int intel_get_device(ScrnInfoPtr scrn) { struct intel_device *dev; @@ -402,6 +576,45 @@ return dev->render_node; } +static int authorise(struct intel_device *dev, int fd) +{ + struct stat st; + drm_magic_t magic; + + if (is_render_node(fd, &st)) /* restricted authority, do not elevate */ + return 1; + + return drmGetMagic(fd, &magic) == 0 && drmAuthMagic(dev->fd, magic) == 0; +} + +int intel_get_client_fd(ScrnInfoPtr scrn) +{ + struct intel_device *dev; + int fd = -1; + + dev = intel_device(scrn); + assert(dev); + assert(dev->fd != -1); + assert(dev->render_node); + +#ifdef O_CLOEXEC + fd = open(dev->render_node, O_RDWR | O_CLOEXEC); +#endif + if (fd < 0) + fd = fd_set_cloexec(open(dev->render_node, O_RDWR)); + if (fd < 0) + return -BadAlloc; + + if (!authorise(dev, fd)) { + close(fd); + return -BadMatch; + } + + assert(is_i915_gem(fd)); + + return fd; +} + int intel_get_device_id(ScrnInfoPtr scrn) { struct intel_device *dev = intel_device(scrn); @@ -450,20 +663,6 @@ return ret; } -void __intel_uxa_release_device(ScrnInfoPtr scrn) -{ - struct intel_device *dev = intel_device(scrn); - if (dev && dev->open_count == 0) { - intel_set_device(scrn, NULL); - - drmClose(dev->fd); - if (dev->render_node != dev->master_node) - free(dev->render_node); - free(dev->master_node); - free(dev); - } -} - void intel_put_device(ScrnInfoPtr scrn) { struct intel_device *dev = intel_device(scrn); diff -Nru xserver-xorg-video-intel-2.99.910/src/intel_driver.h xserver-xorg-video-intel-2.99.914/src/intel_driver.h --- xserver-xorg-video-intel-2.99.910/src/intel_driver.h 2014-01-17 12:53:40.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/intel_driver.h 2014-06-06 12:30:01.000000000 +0000 @@ -125,15 +125,15 @@ int intel_open_device(int entity_num, const struct pci_device *pci, struct xf86_platform_device *dev); +int __intel_peek_fd(ScrnInfoPtr scrn); int intel_get_device(ScrnInfoPtr scrn); const char *intel_get_client_name(ScrnInfoPtr scrn); +int intel_get_client_fd(ScrnInfoPtr scrn); int intel_get_device_id(ScrnInfoPtr scrn); int intel_get_master(ScrnInfoPtr scrn); int intel_put_master(ScrnInfoPtr scrn); void intel_put_device(ScrnInfoPtr scrn); -void __intel_uxa_release_device(ScrnInfoPtr scrn); - #define hosted() (0) #endif /* INTEL_DRIVER_H */ diff -Nru xserver-xorg-video-intel-2.99.910/src/intel_list.h xserver-xorg-video-intel-2.99.914/src/intel_list.h --- xserver-xorg-video-intel-2.99.910/src/intel_list.h 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/intel_list.h 2014-06-25 15:58:52.000000000 +0000 @@ -403,5 +403,10 @@ #define container_of(ptr, type, member) \ ((type *)((char *)(ptr) - (char *) &((type *)0)->member)) +static inline int list_is_singular(const struct list *list) +{ + return list->next == list->prev; +} + #endif /* _INTEL_LIST_H_ */ diff -Nru xserver-xorg-video-intel-2.99.910/src/intel_module.c xserver-xorg-video-intel-2.99.914/src/intel_module.c --- xserver-xorg-video-intel-2.99.910/src/intel_module.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/intel_module.c 2014-07-23 14:44:21.000000000 +0000 @@ -50,6 +50,10 @@ #include #endif +#ifndef XF86_ALLOCATE_GPU_SCREEN +#define XF86_ALLOCATE_GPU_SCREEN 0 +#endif + static const struct intel_device_info intel_generic_info = { .gen = -1, }; @@ -114,6 +118,10 @@ .gen = 0100, }; +static const struct intel_device_info intel_cherryview_info = { + .gen = 0101, +}; + static const SymTabRec intel_chipsets[] = { {PCI_CHIP_I810, "i810"}, {PCI_CHIP_I810_DC100, "i810-dc100"}, @@ -220,6 +228,38 @@ {0x0155, "HD Graphics"}, {0x0157, "HD Graphics"}, + /* Broadwell Marketing names */ + {0x1602, "HD graphics"}, + {0x1606, "HD graphics"}, + {0x160B, "HD graphics"}, + {0x160A, "HD graphics"}, + {0x160D, "HD graphics"}, + {0x160E, "HD graphics"}, + {0x1612, "HD graphics 5600"}, + {0x1616, "HD graphics 5500"}, + {0x161B, "HD graphics"}, + {0x161A, "HD graphics"}, + {0x161D, "HD graphics"}, + {0x161E, "HD graphics 5300"}, + {0x1622, "Iris Pro graphics 6200"}, + {0x1626, "HD graphics 6000"}, + {0x162B, "Iris graphics 6100"}, + {0x162A, "Iris Pro graphics P6300"}, + {0x162D, "HD graphics"}, + {0x162E, "HD graphics"}, + {0x1632, "HD graphics"}, + {0x1636, "HD graphics"}, + {0x163B, "HD graphics"}, + {0x163A, "HD graphics"}, + {0x163D, "HD graphics"}, + {0x163E, "HD graphics"}, + + /* When adding new identifiers, also update: + * 1. intel_identify() + * 2. man/intel.man + * 3. README + */ + {-1, NULL} /* Sentinel */ }; @@ -233,7 +273,7 @@ #if KMS INTEL_I830_IDS(&intel_i830_info), - INTEL_I845G_IDS(&intel_i830_info), + INTEL_I845G_IDS(&intel_i845_info), INTEL_I85X_IDS(&intel_i855_info), INTEL_I865G_IDS(&intel_i865_info), @@ -269,6 +309,8 @@ INTEL_BDW_D_IDS(&intel_broadwell_info), INTEL_BDW_M_IDS(&intel_broadwell_info), + INTEL_CHV_IDS(&intel_cherryview_info), + INTEL_VGA_DEVICE(PCI_MATCH_ANY, &intel_generic_info), #endif @@ -395,9 +437,9 @@ if (unique != stack) free(unique); - xf86Msg(X_INFO, INTEL_NAME ": Driver for Intel(R) HD Graphics: 2000-5000\n"); - xf86Msg(X_INFO, INTEL_NAME ": Driver for Intel(R) Iris(TM) Graphics: 5100\n"); - xf86Msg(X_INFO, INTEL_NAME ": Driver for Intel(R) Iris(TM) Pro Graphics: 5200\n"); + xf86Msg(X_INFO, INTEL_NAME ": Driver for Intel(R) HD Graphics: 2000-6000\n"); + xf86Msg(X_INFO, INTEL_NAME ": Driver for Intel(R) Iris(TM) Graphics: 5100, 6100\n"); + xf86Msg(X_INFO, INTEL_NAME ": Driver for Intel(R) Iris(TM) Pro Graphics: 5200, 6200, P6300\n"); } static Bool intel_driver_func(ScrnInfoPtr pScrn, @@ -419,6 +461,12 @@ #endif return TRUE; + +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,902,0) + case SUPPORTS_SERVER_FDS: + return TRUE; +#endif + default: /* Unknown or deprecated function */ return FALSE; @@ -499,7 +547,7 @@ scrn->driverVersion = INTEL_VERSION; scrn->driverName = (char *)INTEL_DRIVER_NAME; scrn->name = (char *)INTEL_NAME; - scrn->driverPrivate = (void *)(match_data | 1); + scrn->driverPrivate = (void *)(match_data | (flags & XF86_ALLOCATE_GPU_SCREEN) | 2); scrn->Probe = NULL; if (xf86IsEntitySharable(entity_num)) diff -Nru xserver-xorg-video-intel-2.99.910/src/intel_options.c xserver-xorg-video-intel-2.99.914/src/intel_options.c --- xserver-xorg-video-intel-2.99.910/src/intel_options.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/intel_options.c 2014-05-20 07:55:39.000000000 +0000 @@ -9,6 +9,7 @@ {OPTION_ACCEL_METHOD, "AccelMethod", OPTV_STRING, {0}, 0}, {OPTION_BACKLIGHT, "Backlight", OPTV_STRING, {0}, 0}, {OPTION_DRI, "DRI", OPTV_STRING, {0}, 0}, + {OPTION_PRESENT, "Present", OPTV_BOOLEAN, {0}, 1}, {OPTION_COLOR_KEY, "ColorKey", OPTV_INTEGER, {0}, 0}, {OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, 0}, {OPTION_TILING_2D, "Tiling", OPTV_BOOLEAN, {0}, 1}, @@ -20,6 +21,7 @@ {OPTION_PREFER_OVERLAY, "XvPreferOverlay", OPTV_BOOLEAN, {0}, 0}, {OPTION_HOTPLUG, "HotPlug", OPTV_BOOLEAN, {0}, 1}, {OPTION_REPROBE, "ReprobeOutputs", OPTV_BOOLEAN, {0}, 0}, + {OPTION_DELETE_DP12, "DeleteUnusedDP12Displays", OPTV_BOOLEAN, {0}, 0}, #ifdef INTEL_XVMC {OPTION_XVMC, "XvMC", OPTV_BOOLEAN, {0}, 1}, #endif diff -Nru xserver-xorg-video-intel-2.99.910/src/intel_options.h xserver-xorg-video-intel-2.99.914/src/intel_options.h --- xserver-xorg-video-intel-2.99.910/src/intel_options.h 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/intel_options.h 2014-05-20 07:55:39.000000000 +0000 @@ -16,6 +16,7 @@ OPTION_ACCEL_METHOD, OPTION_BACKLIGHT, OPTION_DRI, + OPTION_PRESENT, OPTION_VIDEO_KEY, OPTION_COLOR_KEY, OPTION_TILING_2D, @@ -27,6 +28,7 @@ OPTION_PREFER_OVERLAY, OPTION_HOTPLUG, OPTION_REPROBE, + OPTION_DELETE_DP12, #if defined(XvMCExtension) && defined(ENABLE_XVMC) OPTION_XVMC, #define INTEL_XVMC 1 diff -Nru xserver-xorg-video-intel-2.99.910/src/legacy/i810/Makefile.am xserver-xorg-video-intel-2.99.914/src/legacy/i810/Makefile.am --- xserver-xorg-video-intel-2.99.910/src/legacy/i810/Makefile.am 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/legacy/i810/Makefile.am 2014-06-03 14:38:11.000000000 +0000 @@ -2,7 +2,7 @@ noinst_LTLIBRARIES = liblegacy-i810.la -AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) $(DRM_CFLAGS) $(DRI1_CFLAGS) $(PCIACCESS_CFLAGS) \ +AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) $(DRM_CFLAGS) $(PCIACCESS_CFLAGS) \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/legacy \ $(NULL) @@ -34,6 +34,7 @@ i810_dri.c \ i810_dri.h \ $(NULL) +AM_CFLAGS += $(DRI1_CFLAGS) if XVMC liblegacy_i810_la_SOURCES += \ diff -Nru xserver-xorg-video-intel-2.99.910/src/legacy/i810/Makefile.in xserver-xorg-video-intel-2.99.914/src/legacy/i810/Makefile.in --- xserver-xorg-video-intel-2.99.910/src/legacy/i810/Makefile.in 2014-02-10 09:34:14.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/legacy/i810/Makefile.in 2014-07-23 15:44:37.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -45,12 +89,14 @@ @DRI1_TRUE@ i810_dri.h \ @DRI1_TRUE@ $(NULL) -@DRI1_TRUE@@XVMC_TRUE@am__append_4 = \ +@DRI1_TRUE@am__append_4 = $(DRI1_CFLAGS) +@DRI1_TRUE@@XVMC_TRUE@am__append_5 = \ @DRI1_TRUE@@XVMC_TRUE@ i810_hwmc.c \ @DRI1_TRUE@@XVMC_TRUE@ $(NULL) subdir = src/legacy/i810 -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -80,6 +126,19 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -92,34 +151,56 @@ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(liblegacy_i810_la_SOURCES) DIST_SOURCES = $(am__liblegacy_i810_la_SOURCES_DIST) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -178,6 +259,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -206,8 +289,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -246,23 +334,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -323,15 +412,13 @@ top_srcdir = @top_srcdir@ SUBDIRS = xvmc noinst_LTLIBRARIES = liblegacy-i810.la -AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) $(DRM_CFLAGS) $(DRI1_CFLAGS) $(PCIACCESS_CFLAGS) \ - -I$(top_srcdir)/src \ - -I$(top_srcdir)/src/legacy \ - $(NULL) - +AM_CFLAGS = $(CWARNFLAGS) $(XORG_CFLAGS) $(DRM_CFLAGS) \ + $(PCIACCESS_CFLAGS) -I$(top_srcdir)/src \ + -I$(top_srcdir)/src/legacy $(NULL) $(am__append_4) liblegacy_i810_la_SOURCES = i810_accel.c i810_common.h i810_cursor.c \ i810_driver.c i810.h i810_memory.c i810_reg.h i810_ring.h \ i810_video.c i810_wmark.c $(am__append_1) $(am__append_2) \ - $(am__append_3) $(am__append_4) + $(am__append_3) $(am__append_5) all: all-recursive .SUFFIXES: @@ -369,12 +456,15 @@ clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + liblegacy-i810.la: $(liblegacy_i810_la_OBJECTS) $(liblegacy_i810_la_DEPENDENCIES) $(EXTRA_liblegacy_i810_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(liblegacy_i810_la_OBJECTS) $(liblegacy_i810_la_LIBADD) $(LIBS) @@ -400,14 +490,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -423,22 +513,25 @@ -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -453,57 +546,12 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -519,12 +567,7 @@ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -536,15 +579,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -553,6 +592,21 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -589,13 +643,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -721,12 +772,11 @@ uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive +.MAKE: $(am__recursive_targets) install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic clean-libtool \ - clean-noinstLTLIBRARIES ctags ctags-recursive distclean \ +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool \ + clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ @@ -736,8 +786,8 @@ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru xserver-xorg-video-intel-2.99.910/src/legacy/i810/xvmc/Makefile.in xserver-xorg-video-intel-2.99.914/src/legacy/i810/xvmc/Makefile.in --- xserver-xorg-video-intel-2.99.910/src/legacy/i810/xvmc/Makefile.in 2014-02-10 09:34:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/legacy/i810/xvmc/Makefile.in 2014-07-23 15:44:37.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -35,7 +79,8 @@ build_triplet = @build@ host_triplet = @host@ subdir = src/legacy/i810/xvmc -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -84,11 +129,24 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = libI810XvMC_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libI810XvMC_la_LDFLAGS) $(LDFLAGS) -o \ $@ @XVMC_TRUE@am_libI810XvMC_la_rpath = -rpath $(libdir) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -101,22 +159,40 @@ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libI810XvMC_la_SOURCES) DIST_SOURCES = $(libI810XvMC_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -149,6 +225,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -177,8 +255,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -217,23 +300,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -333,9 +417,9 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): + install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -343,6 +427,8 @@ else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } @@ -358,12 +444,15 @@ clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + libI810XvMC.la: $(libI810XvMC_la_OBJECTS) $(libI810XvMC_la_DEPENDENCIES) $(EXTRA_libI810XvMC_la_DEPENDENCIES) $(AM_V_CCLD)$(libI810XvMC_la_LINK) $(am_libI810XvMC_la_rpath) $(libI810XvMC_la_OBJECTS) $(libI810XvMC_la_LIBADD) $(LIBS) @@ -380,14 +469,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -402,26 +491,15 @@ clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -433,15 +511,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -450,6 +524,21 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -594,19 +683,19 @@ .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am \ - install-libLTLIBRARIES install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-libLTLIBRARIES install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-libLTLIBRARIES + tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru xserver-xorg-video-intel-2.99.910/src/legacy/Makefile.in xserver-xorg-video-intel-2.99.914/src/legacy/Makefile.in --- xserver-xorg-video-intel-2.99.910/src/legacy/Makefile.in 2014-02-10 09:34:14.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/legacy/Makefile.in 2014-07-23 15:44:37.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -41,7 +85,7 @@ @UMS_TRUE@ $(NULL) subdir = src/legacy -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -64,6 +108,19 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -73,34 +130,56 @@ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(liblegacy_la_SOURCES) DIST_SOURCES = $(liblegacy_la_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = i810 @@ -159,6 +238,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -187,8 +268,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -227,23 +313,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -344,12 +431,15 @@ clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + liblegacy.la: $(liblegacy_la_OBJECTS) $(liblegacy_la_DEPENDENCIES) $(EXTRA_liblegacy_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(liblegacy_la_OBJECTS) $(liblegacy_la_LIBADD) $(LIBS) @@ -366,22 +456,25 @@ -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -396,57 +489,12 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -462,12 +510,7 @@ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -479,15 +522,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -496,6 +535,21 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -532,13 +586,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -662,12 +713,11 @@ uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive +.MAKE: $(am__recursive_targets) install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic clean-libtool \ - clean-noinstLTLIBRARIES ctags ctags-recursive distclean \ +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool \ + clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ @@ -677,8 +727,8 @@ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru xserver-xorg-video-intel-2.99.910/src/Makefile.am xserver-xorg-video-intel-2.99.914/src/Makefile.am --- xserver-xorg-video-intel-2.99.910/src/Makefile.am 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/Makefile.am 2014-05-14 11:00:32.000000000 +0000 @@ -34,6 +34,10 @@ @NOWARNFLAGS@ \ $(NULL) +if VALGRIND +AM_CFLAGS += $(VALGRIND_CFLAGS) +endif + intel_drv_la_LTLIBRARIES = intel_drv.la intel_drv_la_LDFLAGS = -module -avoid-version intel_drv_ladir = $(moduledir)/drivers @@ -52,6 +56,10 @@ NULL:=# intel_drv_la_SOURCES = \ + backlight.c \ + backlight.h \ + fd.h \ + fd.c \ i915_pciids.h \ intel_list.h \ intel_options.h \ diff -Nru xserver-xorg-video-intel-2.99.910/src/Makefile.in xserver-xorg-video-intel-2.99.914/src/Makefile.in --- xserver-xorg-video-intel-2.99.910/src/Makefile.in 2014-02-10 09:34:14.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/Makefile.in 2014-07-23 15:44:37.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -36,6 +35,51 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -54,12 +98,14 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@SNA_TRUE@am__append_1 = sna -@SNA_TRUE@am__append_2 = sna/libsna.la -@UXA_TRUE@am__append_3 = uxa -@UXA_TRUE@am__append_4 = uxa/libuxa.la +@VALGRIND_TRUE@am__append_1 = $(VALGRIND_CFLAGS) +@SNA_TRUE@am__append_2 = sna +@SNA_TRUE@am__append_3 = sna/libsna.la +@UXA_TRUE@am__append_4 = uxa +@UXA_TRUE@am__append_5 = uxa/libuxa.la subdir = src -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -102,17 +148,30 @@ LTLIBRARIES = $(intel_drv_la_LTLIBRARIES) am__DEPENDENCIES_1 = intel_drv_la_DEPENDENCIES = legacy/liblegacy.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__append_2) $(am__append_4) + $(am__DEPENDENCIES_1) $(am__append_3) $(am__append_5) am__objects_1 = -am_intel_drv_la_OBJECTS = intel_device.lo intel_options.lo \ - intel_module.lo $(am__objects_1) +am_intel_drv_la_OBJECTS = backlight.lo fd.lo intel_device.lo \ + intel_options.lo intel_module.lo $(am__objects_1) intel_drv_la_OBJECTS = $(am_intel_drv_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = intel_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(intel_drv_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -125,34 +184,56 @@ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(intel_drv_la_SOURCES) DIST_SOURCES = $(intel_drv_la_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = render_program legacy sna uxa @@ -211,6 +292,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -239,8 +322,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -279,23 +367,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -354,28 +443,26 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = render_program legacy $(am__append_1) $(am__append_3) +SUBDIRS = render_program legacy $(am__append_2) $(am__append_4) # this is obnoxious: # -module lets us name the module exactly how we want # -avoid-version prevents gratuitous .0.0.0 version numbers on the end # _ladir passes a dummy rpath to libtool so the thing will actually link # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc. -AM_CFLAGS = \ - @CWARNFLAGS@ \ - $(XORG_CFLAGS) \ - $(DRM_CFLAGS) \ - $(PCIACCESS_CFLAGS) \ - @NOWARNFLAGS@ \ - $(NULL) - +AM_CFLAGS = @CWARNFLAGS@ $(XORG_CFLAGS) $(DRM_CFLAGS) \ + $(PCIACCESS_CFLAGS) @NOWARNFLAGS@ $(NULL) $(am__append_1) intel_drv_la_LTLIBRARIES = intel_drv.la intel_drv_la_LDFLAGS = -module -avoid-version intel_drv_ladir = $(moduledir)/drivers intel_drv_la_LIBADD = legacy/liblegacy.la $(PCIACCESS_LIBS) \ - $(XORG_LIBS) $(am__append_2) $(am__append_4) + $(XORG_LIBS) $(am__append_3) $(am__append_5) NULL := # intel_drv_la_SOURCES = \ + backlight.c \ + backlight.h \ + fd.h \ + fd.c \ i915_pciids.h \ intel_list.h \ intel_options.h \ @@ -427,9 +514,9 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): + install-intel_drv_laLTLIBRARIES: $(intel_drv_la_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(intel_drv_ladir)" || $(MKDIR_P) "$(DESTDIR)$(intel_drv_ladir)" @list='$(intel_drv_la_LTLIBRARIES)'; test -n "$(intel_drv_ladir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -437,6 +524,8 @@ else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(intel_drv_ladir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(intel_drv_ladir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(intel_drv_ladir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(intel_drv_ladir)"; \ } @@ -452,12 +541,15 @@ clean-intel_drv_laLTLIBRARIES: -test -z "$(intel_drv_la_LTLIBRARIES)" || rm -f $(intel_drv_la_LTLIBRARIES) - @list='$(intel_drv_la_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(intel_drv_la_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + intel_drv.la: $(intel_drv_la_OBJECTS) $(intel_drv_la_DEPENDENCIES) $(EXTRA_intel_drv_la_DEPENDENCIES) $(AM_V_CCLD)$(intel_drv_la_LINK) -rpath $(intel_drv_ladir) $(intel_drv_la_OBJECTS) $(intel_drv_la_LIBADD) $(LIBS) @@ -467,6 +559,8 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backlight.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_device.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_options.Plo@am__quote@ @@ -476,14 +570,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -499,22 +593,25 @@ -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -529,57 +626,12 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -595,12 +647,7 @@ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -612,15 +659,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -629,6 +672,21 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -665,13 +723,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -800,24 +855,23 @@ uninstall-am: uninstall-intel_drv_laLTLIBRARIES -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive +.MAKE: $(am__recursive_targets) install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic \ - clean-intel_drv_laLTLIBRARIES clean-libtool ctags \ - ctags-recursive distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-intel_drv_laLTLIBRARIES install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am uninstall-intel_drv_laLTLIBRARIES +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-intel_drv_laLTLIBRARIES \ + clean-libtool cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-intel_drv_laLTLIBRARIES install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-intel_drv_laLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru xserver-xorg-video-intel-2.99.910/src/render_program/Makefile.in xserver-xorg-video-intel-2.99.914/src/render_program/Makefile.in --- xserver-xorg-video-intel-2.99.910/src/render_program/Makefile.in 2014-02-10 09:34:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/render_program/Makefile.in 2014-07-23 15:44:37.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,6 +14,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -34,7 +78,7 @@ build_triplet = @build@ host_triplet = @host@ subdir = src/render_program -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -46,14 +90,26 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ @@ -84,6 +140,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -112,8 +170,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -152,23 +215,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -467,11 +531,11 @@ clean-libtool: -rm -rf .libs _libs -tags: TAGS -TAGS: +tags TAGS: + +ctags CTAGS: -ctags: CTAGS -CTAGS: +cscope cscopelist: distdir: $(DISTFILES) @@ -611,16 +675,16 @@ .MAKE: all check install install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - clean-local distclean distclean-generic distclean-libtool \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-dvi \ + clean-local cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am + tags-am uninstall uninstall-am @HAVE_GEN4ASM_TRUE@.g4a.g4b: @HAVE_GEN4ASM_TRUE@ $(AM_V_GEN)m4 -I$(srcdir) -s $< > $*.g4m && @INTEL_GEN4ASM@ -o $@ $*.g4m && @INTEL_GEN4ASM@ -g 5 -o $@.gen5 $*.g4m && rm $*.g4m diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/blt.c xserver-xorg-video-intel-2.99.914/src/sna/blt.c --- xserver-xorg-video-intel-2.99.910/src/sna/blt.c 2014-02-01 18:42:22.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/blt.c 2014-06-29 07:07:55.000000000 +0000 @@ -233,55 +233,47 @@ const unsigned tile_size = 4096; const unsigned cpp = bpp / 8; - const unsigned stride_tiles = dst_stride / tile_width; - const unsigned swizzle_pixels = tile_width / cpp; - const unsigned tile_pixels = ffs(tile_width / cpp) - 1; - const unsigned tile_mask = (1 << tile_pixels) - 1; - - unsigned x, y; + const unsigned tile_pixels = tile_width / cpp; + const unsigned tile_shift = ffs(tile_pixels) - 1; + const unsigned tile_mask = tile_pixels - 1; DBG(("%s(bpp=%d): src=(%d, %d), dst=(%d, %d), size=%dx%d, pitch=%d/%d\n", __FUNCTION__, bpp, src_x, src_y, dst_x, dst_y, width, height, src_stride, dst_stride)); + assert(src != dst); - src = (const uint8_t *)src + src_y * src_stride + src_x * cpp; - - for (y = 0; y < height; ++y) { - const uint32_t dy = y + dst_y; - const uint32_t tile_row = - (dy / tile_height * stride_tiles * tile_size + - (dy & (tile_height-1)) * tile_width); - const uint8_t *src_row = (const uint8_t *)src + src_stride * y; - uint32_t dx = dst_x, offset; - - x = width * cpp; - if (dx & (swizzle_pixels - 1)) { - const uint32_t swizzle_bound_pixels = ALIGN(dx + 1, swizzle_pixels); - const uint32_t length = min(dst_x + width, swizzle_bound_pixels) - dx; - offset = tile_row + - (dx >> tile_pixels) * tile_size + - (dx & tile_mask) * cpp; - memcpy((char *)dst + offset, src_row, length * cpp); - - src_row += length * cpp; - x -= length * cpp; - dx += length; + if (src_x | src_y) + src = (const uint8_t *)src + src_y * src_stride + src_x * cpp; + assert(src_stride >= width * cpp); + src_stride -= width * cpp; + + while (height--) { + unsigned w = width * cpp; + uint8_t *tile_row = dst; + + tile_row += dst_y / tile_height * dst_stride * tile_height; + tile_row += (dst_y & (tile_height-1)) * tile_width; + if (dst_x) { + tile_row += (dst_x >> tile_shift) * tile_size; + if (dst_x & tile_mask) { + const unsigned x = (dst_x & tile_mask) * cpp; + const unsigned len = min(tile_width - x, w); + memcpy(tile_row + x, src, len); + + tile_row += tile_size; + src = (const uint8_t *)src + len; + w -= len; + } } - while (x >= 512) { - assert((dx & tile_mask) == 0); - offset = tile_row + (dx >> tile_pixels) * tile_size; + while (w >= tile_width) { + memcpy(tile_row, src, tile_width); - memcpy((char *)dst + offset, src_row, 512); - - src_row += 512; - x -= 512; - dx += swizzle_pixels; - } - if (x) { - offset = tile_row + - (dx >> tile_pixels) * tile_size + - (dx & tile_mask) * cpp; - memcpy((char *)dst + offset, src_row, x); - } + tile_row += tile_size; + src = (const uint8_t *)src + tile_width; + w -= tile_width; + } + memcpy(tile_row, src, w); + src = (const uint8_t *)src + src_stride + w; + dst_y++; } } @@ -297,55 +289,47 @@ const unsigned tile_size = 4096; const unsigned cpp = bpp / 8; - const unsigned stride_tiles = src_stride / tile_width; - const unsigned swizzle_pixels = tile_width / cpp; - const unsigned tile_pixels = ffs(tile_width / cpp) - 1; - const unsigned tile_mask = (1 << tile_pixels) - 1; - - unsigned x, y; + const unsigned tile_pixels = tile_width / cpp; + const unsigned tile_shift = ffs(tile_pixels) - 1; + const unsigned tile_mask = tile_pixels - 1; DBG(("%s(bpp=%d): src=(%d, %d), dst=(%d, %d), size=%dx%d, pitch=%d/%d\n", __FUNCTION__, bpp, src_x, src_y, dst_x, dst_y, width, height, src_stride, dst_stride)); + assert(src != dst); - dst = (uint8_t *)dst + dst_y * dst_stride + dst_x * cpp; - - for (y = 0; y < height; ++y) { - const uint32_t sy = y + src_y; - const uint32_t tile_row = - (sy / tile_height * stride_tiles * tile_size + - (sy & (tile_height-1)) * tile_width); - uint8_t *dst_row = (uint8_t *)dst + dst_stride * y; - uint32_t sx = src_x, offset; - - x = width * cpp; - if (sx & (swizzle_pixels - 1)) { - const uint32_t swizzle_bound_pixels = ALIGN(sx + 1, swizzle_pixels); - const uint32_t length = min(src_x + width, swizzle_bound_pixels) - sx; - offset = tile_row + - (sx >> tile_pixels) * tile_size + - (sx & tile_mask) * cpp; - memcpy(dst_row, (const char *)src + offset, length * cpp); - - dst_row += length * cpp; - x -= length * cpp; - sx += length; + if (dst_x | dst_y) + dst = (uint8_t *)dst + dst_y * dst_stride + dst_x * cpp; + assert(dst_stride >= width * cpp); + dst_stride -= width * cpp; + + while (height--) { + unsigned w = width * cpp; + const uint8_t *tile_row = src; + + tile_row += src_y / tile_height * src_stride * tile_height; + tile_row += (src_y & (tile_height-1)) * tile_width; + if (src_x) { + tile_row += (src_x >> tile_shift) * tile_size; + if (src_x & tile_mask) { + const unsigned x = (src_x & tile_mask) * cpp; + const unsigned len = min(tile_width - x, w); + memcpy(dst, tile_row + x, len); + + tile_row += tile_size; + dst = (uint8_t *)dst + len; + w -= len; + } } - while (x >= 512) { - assert((sx & tile_mask) == 0); - offset = tile_row + (sx >> tile_pixels) * tile_size; + while (w >= tile_width) { + memcpy(dst, tile_row, tile_width); - memcpy(dst_row, (const char *)src + offset, 512); - - dst_row += 512; - x -= 512; - sx += swizzle_pixels; - } - if (x) { - offset = tile_row + - (sx >> tile_pixels) * tile_size + - (sx & tile_mask) * cpp; - memcpy(dst_row, (const char *)src + offset, x); - } + tile_row += tile_size; + dst = (uint8_t *)dst + tile_width; + w -= tile_width; + } + memcpy(dst, tile_row, w); + dst = (uint8_t *)dst + dst_stride + w; + src_y++; } } @@ -796,6 +780,7 @@ const BoxRec *box, int dx, int dy) { +#define FORCE_MEMMOVE 0 union { uint8_t u8; uint16_t u16; @@ -808,6 +793,7 @@ assert(src); assert(dst); + assert(src != dst); assert(bpp >= 8); assert(box->x2 > box->x1); assert(box->y2 > box->y1); @@ -821,10 +807,11 @@ width = box->y1 * stride + box->x1 * bpp; src_bytes = (const uint8_t *)src + width; dst_bytes = (uint8_t *)dst + width; + assert(dst_bytes != src_bytes); width = (box->x2 - box->x1) * bpp; height = (box->y2 - box->y1); - assert(width <= 8*stride); + assert(width <= stride); if (width == stride) { width *= height; height = 1; @@ -865,8 +852,9 @@ break; default: - if (dst_bytes < src_bytes + width && - src_bytes < dst_bytes + width) { + if (FORCE_MEMMOVE || + (dst_bytes < src_bytes + width && + src_bytes < dst_bytes + width)) { do { memmove(dst_bytes, src_bytes, width); src_bytes += stride; @@ -919,8 +907,9 @@ break; default: - if (dst_bytes < src_bytes + width && - src_bytes < dst_bytes + width) { + if (FORCE_MEMMOVE || + (dst_bytes < src_bytes + width && + src_bytes < dst_bytes + width)) { do { memmove(dst_bytes, src_bytes, width); src_bytes -= stride; diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/brw/Makefile.in xserver-xorg-video-intel-2.99.914/src/sna/brw/Makefile.in --- xserver-xorg-video-intel-2.99.910/src/sna/brw/Makefile.in 2014-02-10 09:34:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/brw/Makefile.in 2014-07-23 15:44:37.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -37,6 +36,51 @@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -58,7 +102,8 @@ noinst_PROGRAMS = brw_test$(EXEEXT) @DEBUG_TRUE@am__append_1 = @VALGRIND_CFLAGS@ subdir = src/sna/brw -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -78,12 +123,25 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = PROGRAMS = $(noinst_PROGRAMS) am_brw_test_OBJECTS = brw_test.$(OBJEXT) brw_test_gen4.$(OBJEXT) \ brw_test_gen5.$(OBJEXT) brw_test_gen6.$(OBJEXT) \ brw_test_gen7.$(OBJEXT) brw_test_OBJECTS = $(am_brw_test_OBJECTS) brw_test_DEPENDENCIES = libbrw.la +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -96,22 +154,40 @@ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libbrw_la_SOURCES) $(brw_test_SOURCES) DIST_SOURCES = $(libbrw_la_SOURCES) $(brw_test_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -144,6 +220,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -172,8 +250,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -212,23 +295,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -351,12 +435,15 @@ clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + libbrw.la: $(libbrw_la_OBJECTS) $(libbrw_la_DEPENDENCIES) $(EXTRA_libbrw_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libbrw_la_OBJECTS) $(libbrw_la_LIBADD) $(LIBS) @@ -368,6 +455,7 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list + brw_test$(EXEEXT): $(brw_test_OBJECTS) $(brw_test_DEPENDENCIES) $(EXTRA_brw_test_DEPENDENCIES) @rm -f brw_test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(brw_test_OBJECTS) $(brw_test_LDADD) $(LIBS) @@ -394,14 +482,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -416,26 +504,15 @@ clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -447,15 +524,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -464,6 +537,21 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -605,19 +693,19 @@ .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstLTLIBRARIES clean-noinstPROGRAMS \ - ctags distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + cscopelist-am ctags ctags-am distclean distclean-compile \ + distclean-generic distclean-libtool distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am + tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/fb/fbbitmap.c xserver-xorg-video-intel-2.99.914/src/sna/fb/fbbitmap.c --- xserver-xorg-video-intel-2.99.910/src/sna/fb/fbbitmap.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/fb/fbbitmap.c 2014-06-11 11:25:09.000000000 +0000 @@ -178,11 +178,11 @@ } else region->extents.x1 = region->extents.x2 = 0; - DBG(("%s: region extents=(%d, %d), (%d, %d) x %ld\n", + DBG(("%s: region extents=(%d, %d), (%d, %d) x %d\n", __FUNCTION__, region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2, - (long)RegionNumRects(region))); + region_num_rects(region))); return region; } diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/fb/fblinebits.h xserver-xorg-video-intel-2.99.914/src/sna/fb/fblinebits.h --- xserver-xorg-video-intel-2.99.910/src/sna/fb/fblinebits.h 2014-02-01 18:37:13.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/fb/fblinebits.h 2014-06-11 11:25:09.000000000 +0000 @@ -30,8 +30,8 @@ int xoff = drawable->x; int yoff = drawable->y; unsigned int bias = miGetZeroLineBias(drawable->pScreen); - const BoxRec *clip = RegionRects(gc->pCompositeClip); - const BoxRec *const last_clip = clip + RegionNumRects(gc->pCompositeClip); + const BoxRec *clip = region_rects(gc->pCompositeClip); + const BoxRec *const last_clip = clip + region_num_rects(gc->pCompositeClip); FbBits *dst; int dstStride; @@ -148,8 +148,8 @@ int xoff = drawable->x; int yoff = drawable->y; unsigned int bias = miGetZeroLineBias(drawable->pScreen); - const BoxRec *clip = RegionRects(gc->pCompositeClip); - const BoxRec *const last_clip = clip + RegionNumRects(gc->pCompositeClip); + const BoxRec *clip = region_rects(gc->pCompositeClip); + const BoxRec *const last_clip = clip + region_num_rects(gc->pCompositeClip); FbBits *dst; int dstStride; diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/fb/fbpointbits.h xserver-xorg-video-intel-2.99.914/src/sna/fb/fbpointbits.h --- xserver-xorg-video-intel-2.99.910/src/sna/fb/fbpointbits.h 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/fb/fbpointbits.h 2014-04-09 17:41:18.000000000 +0000 @@ -116,32 +116,35 @@ FbBits and, FbBits xor) { uint32_t *pts = (uint32_t *) ptsOrig; - BITS *bits = (BITS *) dst, *p; + BITS *bits = (BITS *) dst; BITS bxor = (BITS) xor; - FbStride bitsStride = dstStride * (sizeof(FbBits) / sizeof(BITS)); + unsigned bitsStride = dstStride * (sizeof(FbBits) / sizeof(BITS)); bits += bitsStride * (yorg + yoff) + (xorg + xoff); +#if __x86_64__ while (npt >= 2) { union { uint32_t pt32[2]; uint64_t pt64; } pt; - pt.pt64 = *(uint64_t *)pts; - - p = bits + intToY(pt.pt32[0]) * bitsStride + intToX(pt.pt32[0]); - WRITE(p, bxor); - p = bits + intToY(pt.pt32[1]) * bitsStride + intToX(pt.pt32[1]); - WRITE(p, bxor); + pt.pt64 = *(uint64_t *)pts; + bits[intToY(pt.pt32[0]) * bitsStride + intToX(pt.pt32[0])] = bxor; + bits[intToY(pt.pt32[1]) * bitsStride + intToX(pt.pt32[1])] = bxor; pts += 2; npt -= 2; } if (npt) { uint32_t pt = *pts; - p = bits + intToY(pt) * bitsStride + intToX(pt); - WRITE(p, bxor); + bits[intToY(pt) * bitsStride + intToX(pt)] = bxor; + } +#else + while (npt--) { + uint32_t pt = *pts++; + bits[intToY(pt) * bitsStride + intToX(pt)] = bxor; } +#endif } #undef RROP diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/fb/fbpoint.c xserver-xorg-video-intel-2.99.914/src/sna/fb/fbpoint.c --- xserver-xorg-video-intel-2.99.910/src/sna/fb/fbpoint.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/fb/fbpoint.c 2014-06-11 11:25:09.000000000 +0000 @@ -93,10 +93,10 @@ int xoff, int yoff, FbBits and, FbBits xor); - DBG(("%s x %d, clip=[(%d, %d), (%d, %d)]x%ld\n", __FUNCTION__, n, + DBG(("%s x %d, clip=[(%d, %d), (%d, %d)]x%d\n", __FUNCTION__, n, gc->pCompositeClip->extents.x1, gc->pCompositeClip->extents.y1, gc->pCompositeClip->extents.x2, gc->pCompositeClip->extents.y2, - (long)RegionNumRects(gc->pCompositeClip))); + region_num_rects(gc->pCompositeClip))); if (mode == CoordModePrevious) fbFixCoordModePrevious(n, pt); diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/fb/Makefile.in xserver-xorg-video-intel-2.99.914/src/sna/fb/Makefile.in --- xserver-xorg-video-intel-2.99.910/src/sna/fb/Makefile.in 2014-02-10 09:34:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/fb/Makefile.in 2014-07-23 15:44:37.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -35,7 +79,8 @@ build_triplet = @build@ host_triplet = @host@ subdir = src/sna/fb -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -60,9 +105,22 @@ AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = libfb_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libfb_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -75,22 +133,40 @@ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libfb_la_SOURCES) DIST_SOURCES = $(libfb_la_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -123,6 +199,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -151,8 +229,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -191,23 +274,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -339,12 +423,15 @@ clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + libfb.la: $(libfb_la_OBJECTS) $(libfb_la_DEPENDENCIES) $(EXTRA_libfb_la_DEPENDENCIES) $(AM_V_CCLD)$(libfb_la_LINK) $(libfb_la_OBJECTS) $(libfb_la_LIBADD) $(LIBS) @@ -379,14 +466,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -534,26 +621,15 @@ clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -565,15 +641,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -582,6 +654,21 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -723,18 +810,19 @@ .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/gen2_render.c xserver-xorg-video-intel-2.99.914/src/sna/gen2_render.c --- xserver-xorg-video-intel-2.99.910/src/sna/gen2_render.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/gen2_render.c 2014-07-17 20:26:45.000000000 +0000 @@ -350,7 +350,6 @@ cblend = TB0C_LAST_STAGE | TB0C_RESULT_SCALE_1X | TB0C_OUTPUT_WRITE_CURRENT; ablend = TB0A_RESULT_SCALE_1X | TB0A_OUTPUT_WRITE_CURRENT; - /* Get the source picture's channels into TBx_ARG1 */ if ((op->has_component_alpha && gen2_blend_op[blend].src_alpha) || op->dst.format == PICT_a8) { @@ -359,11 +358,14 @@ * is a8, in which case src.G is what's written, and the other * channels are ignored. */ - if (op->src.is_solid) { - ablend |= TB0A_ARG1_SEL_DIFFUSE; + if (op->src.is_opaque) { + ablend |= TB0C_ARG1_SEL_ONE; + cblend |= TB0C_ARG1_SEL_ONE; + } else if (op->src.is_solid) { + ablend |= TB0C_ARG1_SEL_DIFFUSE; cblend |= TB0C_ARG1_SEL_DIFFUSE | TB0C_ARG1_REPLICATE_ALPHA; } else { - ablend |= TB0A_ARG1_SEL_TEXEL0; + ablend |= TB0C_ARG1_SEL_TEXEL0; cblend |= TB0C_ARG1_SEL_TEXEL0 | TB0C_ARG1_REPLICATE_ALPHA; } } else { @@ -373,10 +375,11 @@ cblend |= TB0C_ARG1_SEL_TEXEL0; else cblend |= TB0C_ARG1_SEL_ONE | TB0C_ARG1_INVERT; /* 0.0 */ - if (op->src.is_solid) - ablend |= TB0A_ARG1_SEL_DIFFUSE; - else if (op->src.is_opaque) + + if (op->src.is_opaque) ablend |= TB0A_ARG1_SEL_ONE; + else if (op->src.is_solid) + ablend |= TB0A_ARG1_SEL_DIFFUSE; else ablend |= TB0A_ARG1_SEL_TEXEL0; } @@ -425,14 +428,28 @@ sblend = gen2_blend_op[op].src_blend; dblend = gen2_blend_op[op].dst_blend; - /* If there's no dst alpha channel, adjust the blend op so that - * we'll treat it as always 1. - */ - if (PICT_FORMAT_A(dst_format) == 0 && gen2_blend_op[op].dst_alpha) { - if (sblend == BLENDFACTOR_DST_ALPHA) - sblend = BLENDFACTOR_ONE; - else if (sblend == BLENDFACTOR_INV_DST_ALPHA) - sblend = BLENDFACTOR_ZERO; + if (gen2_blend_op[op].dst_alpha) { + /* If there's no dst alpha channel, adjust the blend op so that + * we'll treat it as always 1. + */ + if (PICT_FORMAT_A(dst_format) == 0) { + if (sblend == BLENDFACTOR_DST_ALPHA) + sblend = BLENDFACTOR_ONE; + else if (sblend == BLENDFACTOR_INV_DST_ALPHA) + sblend = BLENDFACTOR_ZERO; + } + + /* gen2 engine reads 8bit color buffer into green channel + * in cases like color buffer blending etc., and also writes + * back green channel. So with dst_alpha blend we should use + * color factor. + */ + if (dst_format == PICT_a8) { + if (sblend == BLENDFACTOR_DST_ALPHA) + sblend = BLENDFACTOR_DST_COLR; + else if (sblend == BLENDFACTOR_INV_DST_ALPHA) + sblend = BLENDFACTOR_INV_DST_COLR; + } } /* If the source alpha is being used, then we should only be in a case @@ -585,6 +602,7 @@ assert(op->dst.bo->pitch >= 8 && op->dst.bo->pitch <= MAX_3D_PITCH); assert(sna->render.vertex_offset == 0); + assert(op->dst.bo->unique_id); if (sna->render_state.gen2.target == op->dst.bo->unique_id) { kgem_bo_mark_dirty(op->dst.bo); return; @@ -1543,13 +1561,25 @@ y += dy + picture->pDrawable->y; channel->is_affine = sna_transform_is_affine(picture->transform); - if (sna_transform_is_integer_translation(picture->transform, &dx, &dy)) { + if (sna_transform_is_imprecise_integer_translation(picture->transform, picture->filter, precise, &dx, &dy)) { DBG(("%s: integer translation (%d, %d), removing\n", __FUNCTION__, dx, dy)); x += dx; y += dy; channel->transform = NULL; channel->filter = PictFilterNearest; + + if (channel->repeat && + (x >= 0 && + y >= 0 && + x + w < pixmap->drawable.width && + y + h < pixmap->drawable.height)) { + struct sna_pixmap *priv = sna_pixmap(pixmap); + if (priv && priv->clear) { + DBG(("%s: converting large pixmap source into solid [%08x]\n", __FUNCTION__, priv->clear_color)); + return gen2_composite_solid_init(sna, channel, priv->clear_color); + } + } } else channel->transform = picture->transform; @@ -1591,7 +1621,7 @@ hint = PREFER_GPU | FORCE_GPU | RENDER_GPU; if (!partial) { - hint |= IGNORE_CPU; + hint |= IGNORE_DAMAGE; if (w == op->dst.width && h == op->dst.height) hint |= REPLACES; } @@ -1600,6 +1630,11 @@ if (op->dst.bo == NULL) return false; + if (hint & REPLACES) { + struct sna_pixmap *priv = sna_pixmap(op->dst.pixmap); + kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo); + } + assert((op->dst.bo->pitch & 7) == 0); get_drawable_deltas(dst->pDrawable, op->dst.pixmap, @@ -1874,7 +1909,7 @@ if (!gen2_composite_set_target(sna, tmp, dst, dst_x, dst_y, width, height, - flags & COMPOSITE_PARTIAL || op > PictOpSrc || dst->pCompositeClip->data != NULL)) { + flags & COMPOSITE_PARTIAL || op > PictOpSrc)) { DBG(("%s: unable to set render target\n", __FUNCTION__)); goto fallback; @@ -2699,7 +2734,7 @@ gen2_render_fill_boxes_try_blt(struct sna *sna, CARD8 op, PictFormat format, const xRenderColor *color, - PixmapPtr dst, struct kgem_bo *dst_bo, + const DrawableRec *dst, struct kgem_bo *dst_bo, const BoxRec *box, int n) { uint8_t alu; @@ -2722,7 +2757,7 @@ alu = GXcopy; return sna_blt_fill_boxes(sna, alu, - dst_bo, dst->drawable.bitsPerPixel, + dst_bo, dst->bitsPerPixel, pixel, box, n); } @@ -2731,7 +2766,7 @@ CARD8 op, PictFormat format, const xRenderColor *color, - PixmapPtr dst, struct kgem_bo *dst_bo, + const DrawableRec *dst, struct kgem_bo *dst_bo, const BoxRec *box, int n) { struct sna_composite_op tmp; @@ -2758,7 +2793,7 @@ __FUNCTION__, op, (int)format, color->red, color->green, color->blue, color->alpha)); - if (too_large(dst->drawable.width, dst->drawable.height) || + if (too_large(dst->width, dst->height) || dst_bo->pitch < 8 || dst_bo->pitch > MAX_3D_PITCH || !gen2_check_dst_format(format)) { DBG(("%s: try blt, too large or incompatible destination\n", @@ -2786,9 +2821,9 @@ memset(&tmp, 0, sizeof(tmp)); tmp.op = op; - tmp.dst.pixmap = dst; - tmp.dst.width = dst->drawable.width; - tmp.dst.height = dst->drawable.height; + tmp.dst.pixmap = (PixmapPtr)dst; + tmp.dst.width = dst->width; + tmp.dst.height = dst->height; tmp.dst.format = format; tmp.dst.bo = dst_bo; tmp.floats_per_vertex = 2; @@ -2978,6 +3013,7 @@ tmp->blt = gen2_render_fill_op_blt; tmp->box = gen2_render_fill_op_box; tmp->boxes = gen2_render_fill_op_boxes; + tmp->points = NULL; tmp->done = gen2_render_fill_op_done; gen2_emit_fill_state(sna, &tmp->base); @@ -3067,20 +3103,20 @@ static void gen2_render_copy_setup_source(struct sna_composite_channel *channel, - PixmapPtr pixmap, + const DrawableRec *draw, struct kgem_bo *bo) { - assert(pixmap->drawable.width && pixmap->drawable.height); + assert(draw->width && draw->height); channel->filter = PictFilterNearest; channel->repeat = RepeatNone; - channel->width = pixmap->drawable.width; - channel->height = pixmap->drawable.height; - channel->scale[0] = 1.f/pixmap->drawable.width; - channel->scale[1] = 1.f/pixmap->drawable.height; + channel->width = draw->width; + channel->height = draw->height; + channel->scale[0] = 1.f/draw->width; + channel->scale[1] = 1.f/draw->height; channel->offset[0] = 0; channel->offset[1] = 0; - channel->pict_format = sna_format_for_depth(pixmap->drawable.depth); + channel->pict_format = sna_format_for_depth(draw->depth); channel->bo = bo; channel->is_affine = 1; @@ -3169,8 +3205,8 @@ static bool gen2_render_copy_boxes(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const DrawableRec *src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, + const DrawableRec *dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int n, unsigned flags) { struct sna_composite_op tmp; @@ -3189,16 +3225,16 @@ DBG(("%s (%d, %d)->(%d, %d) x %d\n", __FUNCTION__, src_dx, src_dy, dst_dx, dst_dy, n)); - if (sna_blt_compare_depth(&src->drawable, &dst->drawable) && + if (sna_blt_compare_depth(src, dst) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; if (src_bo == dst_bo || /* XXX handle overlap using 3D ? */ - too_large(src->drawable.width, src->drawable.height) || + too_large(src->width, src->height) || src_bo->pitch > MAX_3D_PITCH || dst_bo->pitch < 8) { fallback: return sna_blt_copy_boxes_fallback(sna, alu, @@ -3218,10 +3254,10 @@ memset(&tmp, 0, sizeof(tmp)); tmp.op = alu; - tmp.dst.pixmap = dst; - tmp.dst.width = dst->drawable.width; - tmp.dst.height = dst->drawable.height; - tmp.dst.format = sna_format_for_depth(dst->drawable.depth); + tmp.dst.pixmap = (PixmapPtr)dst; + tmp.dst.width = dst->width; + tmp.dst.height = dst->height; + tmp.dst.format = sna_format_for_depth(dst->depth); tmp.dst.bo = dst_bo; tmp.dst.x = tmp.dst.y = 0; tmp.damage = NULL; @@ -3392,7 +3428,7 @@ tmp->base.dst.format = sna_format_for_depth(dst->drawable.depth); tmp->base.dst.bo = dst_bo; - gen2_render_copy_setup_source(&tmp->base.src, src, src_bo); + gen2_render_copy_setup_source(&tmp->base.src, &src->drawable, src_bo); tmp->base.mask.bo = NULL; tmp->base.floats_per_vertex = 4; diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/gen3_render.c xserver-xorg-video-intel-2.99.914/src/sna/gen3_render.c --- xserver-xorg-video-intel-2.99.910/src/sna/gen3_render.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/gen3_render.c 2014-07-17 20:26:45.000000000 +0000 @@ -2859,7 +2859,7 @@ channel->card_format = MAPSURF_32BIT | MT_32BIT_ARGB8888; channel->filter = PictFilterNearest; channel->is_affine = sna_transform_is_affine(picture->transform); - if (sna_transform_is_integer_translation(picture->transform, &dx, &dy)) { + if (sna_transform_is_imprecise_integer_translation(picture->transform, PictFilterNearest, false, &dx, &dy)) { DBG(("%s: integer translation (%d, %d), removing\n", __FUNCTION__, dx, dy)); ox += dx; @@ -3086,13 +3086,25 @@ x += dx + picture->pDrawable->x; y += dy + picture->pDrawable->y; - if (sna_transform_is_integer_translation(picture->transform, &dx, &dy)) { + if (sna_transform_is_imprecise_integer_translation(picture->transform, picture->filter, precise, &dx, &dy)) { DBG(("%s: integer translation (%d, %d), removing\n", __FUNCTION__, dx, dy)); x += dx; y += dy; channel->transform = NULL; channel->filter = PictFilterNearest; + + if (channel->repeat || + (x >= 0 && + y >= 0 && + x + w < pixmap->drawable.width && + y + h < pixmap->drawable.height)) { + struct sna_pixmap *priv = sna_pixmap(pixmap); + if (priv && priv->clear) { + DBG(("%s: converting large pixmap source into solid [%08x]\n", __FUNCTION__, priv->clear_color)); + return gen3_init_solid(channel, priv->clear_color); + } + } } else { channel->transform = picture->transform; channel->is_affine = sna_transform_is_affine(picture->transform); @@ -3172,7 +3184,7 @@ hint = PREFER_GPU | FORCE_GPU | RENDER_GPU; if (!partial) { - hint |= IGNORE_CPU; + hint |= IGNORE_DAMAGE; if (w == op->dst.width && h == op->dst.height) hint |= REPLACES; } @@ -3181,6 +3193,11 @@ if (op->dst.bo == NULL) return false; + if (hint & REPLACES) { + struct sna_pixmap *priv = sna_pixmap(op->dst.pixmap); + kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo); + } + assert(op->dst.bo->unique_id); /* For single-stream mode there should be no minimum alignment @@ -3503,7 +3520,7 @@ if (!gen3_composite_set_target(sna, tmp, dst, dst_x, dst_y, width, height, - flags & COMPOSITE_PARTIAL || op > PictOpSrc || dst->pCompositeClip->data)) { + flags & COMPOSITE_PARTIAL || op > PictOpSrc)) { DBG(("%s: unable to set render target\n", __FUNCTION__)); goto fallback; @@ -5370,8 +5387,8 @@ PixmapPtr pixmap) { struct sna_pixmap *priv = sna_pixmap(pixmap); - BoxPtr pbox = REGION_RECTS(dstRegion); - int nbox = REGION_NUM_RECTS(dstRegion); + const BoxRec *pbox = region_rects(dstRegion); + int nbox = region_num_rects(dstRegion); int dst_width = dstRegion->extents.x2 - dstRegion->extents.x1; int dst_height = dstRegion->extents.y2 - dstRegion->extents.y1; int src_width = frame->src.x2 - frame->src.x1; @@ -5386,9 +5403,8 @@ DBG(("%s: src:%dx%d (frame:%dx%d) -> dst:%dx%d\n", __FUNCTION__, src_width, src_height, frame->width, frame->height, dst_width, dst_height)); + assert(priv->gpu_bo); dst_bo = priv->gpu_bo; - if (dst_bo == NULL) - return false; bilinear = src_width != dst_width || src_height != dst_height; @@ -5497,8 +5513,8 @@ dst_bo, -dstRegion->extents.x1, -dstRegion->extents.y1, priv->gpu_bo, pix_xoff, pix_yoff, pixmap->drawable.bitsPerPixel, - REGION_RECTS(dstRegion), - REGION_NUM_RECTS(dstRegion)); + region_rects(dstRegion), + region_num_rects(dstRegion)); kgem_bo_destroy(&sna->kgem, dst_bo); } @@ -5509,12 +5525,12 @@ sna_damage_subtract(&priv->cpu_damage, dstRegion); } else { sna_damage_add_boxes(&priv->gpu_damage, - REGION_RECTS(dstRegion), - REGION_NUM_RECTS(dstRegion), + region_rects(dstRegion), + region_num_rects(dstRegion), pix_xoff, pix_yoff); sna_damage_subtract_boxes(&priv->cpu_damage, - REGION_RECTS(dstRegion), - REGION_NUM_RECTS(dstRegion), + region_rects(dstRegion), + region_num_rects(dstRegion), pix_xoff, pix_yoff); } } @@ -5524,7 +5540,7 @@ static void gen3_render_copy_setup_source(struct sna_composite_channel *channel, - PixmapPtr pixmap, + const DrawableRec *draw, struct kgem_bo *bo) { int i; @@ -5532,14 +5548,14 @@ channel->u.gen3.type = SHADER_TEXTURE; channel->filter = gen3_filter(PictFilterNearest); channel->repeat = gen3_texture_repeat(RepeatNone); - channel->width = pixmap->drawable.width; - channel->height = pixmap->drawable.height; - channel->scale[0] = 1.f/pixmap->drawable.width; - channel->scale[1] = 1.f/pixmap->drawable.height; + channel->width = draw->width; + channel->height = draw->height; + channel->scale[0] = 1.f/draw->width; + channel->scale[1] = 1.f/draw->height; channel->offset[0] = 0; channel->offset[1] = 0; - channel->pict_format = sna_format_for_depth(pixmap->drawable.depth); + channel->pict_format = sna_format_for_depth(draw->depth); if (!gen3_composite_channel_set_format(channel, channel->pict_format)) { for (i = 0; i < ARRAY_SIZE(gen3_tex_formats); i++) { if (gen3_tex_formats[i].xfmt == channel->pict_format) { @@ -5558,38 +5574,38 @@ static bool gen3_render_copy_boxes(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const DrawableRec *src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, + const DrawableRec *dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int n, unsigned flags) { struct sna_composite_op tmp; #if NO_COPY_BOXES - if (!sna_blt_compare_depth(&src->drawable, &dst->drawable)) + if (!sna_blt_compare_depth(src, dst)) return false; return sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n); #endif DBG(("%s (%d, %d)->(%d, %d) x %d\n", __FUNCTION__, src_dx, src_dy, dst_dx, dst_dy, n)); - if (sna_blt_compare_depth(&src->drawable, &dst->drawable) && + if (sna_blt_compare_depth(src, dst) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; if (!(alu == GXcopy || alu == GXclear) || src_bo == dst_bo || /* XXX handle overlap using 3D ? */ src_bo->pitch > MAX_3D_PITCH || - too_large(src->drawable.width, src->drawable.height)) { + too_large(src->width, src->height)) { fallback_blt: if (!kgem_bo_can_blt(&sna->kgem, src_bo) || !kgem_bo_can_blt(&sna->kgem, dst_bo)) @@ -5610,10 +5626,10 @@ memset(&tmp, 0, sizeof(tmp)); tmp.op = alu == GXcopy ? PictOpSrc : PictOpClear; - tmp.dst.pixmap = dst; - tmp.dst.width = dst->drawable.width; - tmp.dst.height = dst->drawable.height; - tmp.dst.format = sna_format_for_depth(dst->drawable.depth); + tmp.dst.pixmap = (PixmapPtr)dst; + tmp.dst.width = dst->width; + tmp.dst.height = dst->height; + tmp.dst.format = sna_format_for_depth(dst->depth); tmp.dst.bo = dst_bo; tmp.dst.x = tmp.dst.y = 0; tmp.damage = NULL; @@ -5777,7 +5793,7 @@ tmp->base.dst.format = sna_format_for_depth(dst->drawable.depth); tmp->base.dst.bo = dst_bo; - gen3_render_copy_setup_source(&tmp->base.src, src, src_bo); + gen3_render_copy_setup_source(&tmp->base.src, &src->drawable, src_bo); tmp->base.floats_per_vertex = 4; tmp->base.floats_per_rect = 12; @@ -5802,7 +5818,7 @@ gen3_render_fill_boxes_try_blt(struct sna *sna, CARD8 op, PictFormat format, const xRenderColor *color, - PixmapPtr dst, struct kgem_bo *dst_bo, + const DrawableRec *dst, struct kgem_bo *dst_bo, const BoxRec *box, int n) { uint8_t alu; @@ -5810,7 +5826,7 @@ if (dst_bo->tiling == I915_TILING_Y) { DBG(("%s: y-tiling, can't blit\n", __FUNCTION__)); - assert(!too_large(dst->drawable.width, dst->drawable.height)); + assert(!too_large(dst->width, dst->height)); return false; } @@ -5831,7 +5847,7 @@ alu = GXcopy; return sna_blt_fill_boxes(sna, alu, - dst_bo, dst->drawable.bitsPerPixel, + dst_bo, dst->bitsPerPixel, pixel, box, n); } @@ -5849,7 +5865,7 @@ CARD8 op, PictFormat format, const xRenderColor *color, - PixmapPtr dst, struct kgem_bo *dst_bo, + const DrawableRec *dst, struct kgem_bo *dst_bo, const BoxRec *box, int n) { struct sna_composite_op tmp; @@ -5871,7 +5887,7 @@ __FUNCTION__, op, (int)format, color->red, color->green, color->blue, color->alpha)); - if (too_large(dst->drawable.width, dst->drawable.height) || + if (too_large(dst->width, dst->height) || dst_bo->pitch > MAX_3D_PITCH || !gen3_check_dst_format(format)) { DBG(("%s: try blt, too large or incompatible destination\n", @@ -5911,9 +5927,9 @@ __FUNCTION__, op, (int)format, pixel)); tmp.op = op; - tmp.dst.pixmap = dst; - tmp.dst.width = dst->drawable.width; - tmp.dst.height = dst->drawable.height; + tmp.dst.pixmap = (PixmapPtr)dst; + tmp.dst.width = dst->width; + tmp.dst.height = dst->height; tmp.dst.format = format; tmp.dst.bo = dst_bo; tmp.damage = NULL; @@ -6084,6 +6100,7 @@ tmp->blt = gen3_render_fill_op_blt; tmp->box = gen3_render_fill_op_box; tmp->boxes = gen3_render_fill_op_boxes; + tmp->points = NULL; tmp->done = gen3_render_fill_op_done; gen3_align_vertex(sna, &tmp->base); diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/gen4_render.c xserver-xorg-video-intel-2.99.914/src/sna/gen4_render.c --- xserver-xorg-video-intel-2.99.910/src/sna/gen4_render.c 2014-02-04 10:36:06.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/gen4_render.c 2014-07-17 20:26:45.000000000 +0000 @@ -1398,6 +1398,7 @@ PixmapPtr pixmap) { struct sna_composite_op tmp; + struct sna_pixmap *priv = sna_pixmap(pixmap); int dst_width = dstRegion->extents.x2 - dstRegion->extents.x1; int dst_height = dstRegion->extents.y2 - dstRegion->extents.y1; int src_width = frame->src.x2 - frame->src.x1; @@ -1405,16 +1406,12 @@ float src_offset_x, src_offset_y; float src_scale_x, src_scale_y; int nbox, pix_xoff, pix_yoff; - struct sna_pixmap *priv; - BoxPtr box; + const BoxRec *box; DBG(("%s: %dx%d -> %dx%d\n", __FUNCTION__, src_width, src_height, dst_width, dst_height)); - priv = sna_pixmap_force_to_gpu(pixmap, MOVE_READ | MOVE_WRITE); - if (priv == NULL) - return false; - + assert(priv->gpu_bo); memset(&tmp, 0, sizeof(tmp)); tmp.op = PictOpSrc; @@ -1465,8 +1462,8 @@ src_scale_y = (float)src_height / dst_height / frame->height; src_offset_y = (float)frame->src.y1 / frame->height - dstRegion->extents.y1 * src_scale_y; - box = REGION_RECTS(dstRegion); - nbox = REGION_NUM_RECTS(dstRegion); + box = region_rects(dstRegion); + nbox = region_num_rects(dstRegion); do { int n; @@ -1577,13 +1574,25 @@ y += dy + picture->pDrawable->y; channel->is_affine = sna_transform_is_affine(picture->transform); - if (sna_transform_is_integer_translation(picture->transform, &dx, &dy)) { + if (sna_transform_is_imprecise_integer_translation(picture->transform, picture->filter, precise, &dx, &dy)) { DBG(("%s: integer translation (%d, %d), removing\n", __FUNCTION__, dx, dy)); x += dx; y += dy; channel->transform = NULL; channel->filter = PictFilterNearest; + + if (channel->repeat && + (x >= 0 && + y >= 0 && + x + w < pixmap->drawable.width && + y + h < pixmap->drawable.height)) { + struct sna_pixmap *priv = sna_pixmap(pixmap); + if (priv && priv->clear) { + DBG(("%s: converting large pixmap source into solid [%08x]\n", __FUNCTION__, priv->clear_color)); + return gen4_channel_init_solid(sna, channel, priv->clear_color); + } + } } else channel->transform = picture->transform; @@ -1657,7 +1666,7 @@ hint = PREFER_GPU | FORCE_GPU | RENDER_GPU; if (!partial) { - hint |= IGNORE_CPU; + hint |= IGNORE_DAMAGE; if (w == op->dst.width && h == op->dst.height) hint |= REPLACES; } @@ -1666,6 +1675,11 @@ if (op->dst.bo == NULL) return false; + if (hint & REPLACES) { + struct sna_pixmap *priv = sna_pixmap(op->dst.pixmap); + kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo); + } + get_drawable_deltas(dst->pDrawable, op->dst.pixmap, &op->dst.x, &op->dst.y); @@ -1936,7 +1950,7 @@ if (!gen4_composite_set_target(sna, tmp, dst, dst_x, dst_y, width, height, - flags & COMPOSITE_PARTIAL || op > PictOpSrc || dst->pCompositeClip->data)) { + flags & COMPOSITE_PARTIAL || op > PictOpSrc)) { DBG(("%s: failed to set composite target\n", __FUNCTION__)); goto fallback; } @@ -2367,25 +2381,25 @@ static bool gen4_render_copy_boxes(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const DrawableRec *src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, + const DrawableRec *dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int n, unsigned flags) { struct sna_composite_op tmp; DBG(("%s x %d\n", __FUNCTION__, n)); - if (sna_blt_compare_depth(&src->drawable, &dst->drawable) && + if (sna_blt_compare_depth(src, dst) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; if (!(alu == GXcopy || alu == GXclear) || src_bo == dst_bo) { fallback_blt: - if (!sna_blt_compare_depth(&src->drawable, &dst->drawable)) + if (!sna_blt_compare_depth(src, dst)) return false; return sna_blt_copy_boxes_fallback(sna, alu, @@ -2399,21 +2413,21 @@ DBG(("%s (%d, %d)->(%d, %d) x %d\n", __FUNCTION__, src_dx, src_dy, dst_dx, dst_dy, n)); - if (dst->drawable.depth == src->drawable.depth) { - tmp.dst.format = sna_render_format_for_depth(dst->drawable.depth); + if (dst->depth == src->depth) { + tmp.dst.format = sna_render_format_for_depth(dst->depth); tmp.src.pict_format = tmp.dst.format; } else { - tmp.dst.format = sna_format_for_depth(dst->drawable.depth); - tmp.src.pict_format = sna_format_for_depth(src->drawable.depth); + tmp.dst.format = sna_format_for_depth(dst->depth); + tmp.src.pict_format = sna_format_for_depth(src->depth); } if (!gen4_check_format(tmp.src.pict_format)) goto fallback_blt; tmp.op = alu == GXcopy ? PictOpSrc : PictOpClear; - tmp.dst.pixmap = dst; - tmp.dst.width = dst->drawable.width; - tmp.dst.height = dst->drawable.height; + tmp.dst.pixmap = (PixmapPtr)dst; + tmp.dst.width = dst->width; + tmp.dst.height = dst->height; tmp.dst.x = tmp.dst.y = 0; tmp.dst.bo = dst_bo; tmp.damage = NULL; @@ -2446,7 +2460,7 @@ tmp.src.filter = SAMPLER_FILTER_NEAREST; tmp.src.repeat = SAMPLER_EXTEND_NONE; tmp.src.card_format = gen4_get_card_format(tmp.src.pict_format); - if (too_large(src->drawable.width, src->drawable.height)) { + if (too_large(src->width, src->height)) { BoxRec extents = box[0]; int i; @@ -2470,11 +2484,11 @@ goto fallback_tiled_dst; } else { tmp.src.bo = kgem_bo_reference(src_bo); - tmp.src.width = src->drawable.width; - tmp.src.height = src->drawable.height; + tmp.src.width = src->width; + tmp.src.height = src->height; tmp.src.offset[0] = tmp.src.offset[1] = 0; - tmp.src.scale[0] = 1.f/src->drawable.width; - tmp.src.scale[1] = 1.f/src->drawable.height; + tmp.src.scale[0] = 1.f/src->width; + tmp.src.scale[1] = 1.f/src->height; } tmp.is_affine = true; @@ -2521,11 +2535,11 @@ if (tmp.redirect.real_bo) kgem_bo_destroy(&sna->kgem, tmp.dst.bo); fallback_tiled: - if (sna_blt_compare_depth(&src->drawable, &dst->drawable) && + if (sna_blt_compare_depth(src, dst) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; @@ -2661,7 +2675,7 @@ CARD8 op, PictFormat format, const xRenderColor *color, - PixmapPtr dst, struct kgem_bo *dst_bo, + const DrawableRec *dst, struct kgem_bo *dst_bo, const BoxRec *box, int n) { struct sna_composite_op tmp; @@ -2689,14 +2703,14 @@ if (alu != GXinvalid && sna_blt_fill_boxes(sna, alu, - dst_bo, dst->drawable.bitsPerPixel, + dst_bo, dst->bitsPerPixel, pixel, box, n)) return true; if (!gen4_check_dst_format(format)) return false; - if (too_large(dst->drawable.width, dst->drawable.height)) + if (too_large(dst->width, dst->height)) return sna_tiling_fill_boxes(sna, op, format, color, dst, dst_bo, box, n); } @@ -2718,9 +2732,9 @@ tmp.op = op; - tmp.dst.pixmap = dst; - tmp.dst.width = dst->drawable.width; - tmp.dst.height = dst->drawable.height; + tmp.dst.pixmap = (PixmapPtr)dst; + tmp.dst.width = dst->width; + tmp.dst.height = dst->height; tmp.dst.format = format; tmp.dst.bo = dst_bo; @@ -2852,6 +2866,7 @@ op->blt = gen4_render_fill_op_blt; op->box = gen4_render_fill_op_box; op->boxes = gen4_render_fill_op_boxes; + op->points = NULL; op->done = gen4_render_fill_op_done; return true; } diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/gen4_vertex.c xserver-xorg-video-intel-2.99.914/src/sna/gen4_vertex.c --- xserver-xorg-video-intel-2.99.910/src/sna/gen4_vertex.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/gen4_vertex.c 2014-06-23 12:03:13.000000000 +0000 @@ -42,7 +42,9 @@ { int vertex_index; + assert(op->floats_per_vertex); assert(op->floats_per_rect == 3*op->floats_per_vertex); + assert(sna->render.vertex_used <= sna->render.vertex_size); vertex_index = (sna->render.vertex_used + op->floats_per_vertex - 1) / op->floats_per_vertex; if ((int)sna->render.vertex_size - vertex_index * op->floats_per_vertex < 2*op->floats_per_rect) { @@ -52,6 +54,7 @@ kgem_submit(&sna->kgem); _kgem_set_mode(&sna->kgem, KGEM_RENDER); } + assert(sna->render.vertex_used < sna->render.vertex_size); vertex_index = (sna->render.vertex_used + op->floats_per_vertex - 1) / op->floats_per_vertex; assert(vertex_index * op->floats_per_vertex <= sna->render.vertex_size); @@ -118,25 +121,25 @@ kgem_bo_destroy(&sna->kgem, bo); hint |= CREATE_CACHED | CREATE_NO_THROTTLE; } else { - if (kgem_is_idle(&sna->kgem)) { - sna->render.vertices = sna->render.vertex_data; - sna->render.vertex_size = ARRAY_SIZE(sna->render.vertex_data); + assert(sna->render.vertex_size == ARRAY_SIZE(sna->render.vertex_data)); + assert(sna->render.vertices == sna->render.vertex_data); + if (kgem_is_idle(&sna->kgem)) return 0; - } } size = 256*1024; assert(!sna->render.active); sna->render.vertices = NULL; sna->render.vbo = kgem_create_linear(&sna->kgem, size, hint); - while (sna->render.vbo == NULL && size > 16*1024) { + while (sna->render.vbo == NULL && size > sizeof(sna->render.vertex_data)) { size /= 2; sna->render.vbo = kgem_create_linear(&sna->kgem, size, hint); } if (sna->render.vbo == NULL) sna->render.vbo = kgem_create_linear(&sna->kgem, 256*1024, CREATE_GTT_MAP); - if (sna->render.vbo) + if (sna->render.vbo && + kgem_check_bo(&sna->kgem, sna->render.vbo, NULL)) sna->render.vertices = kgem_bo_map(&sna->kgem, sna->render.vbo); if (sna->render.vertices == NULL) { if (sna->render.vbo) { @@ -164,11 +167,12 @@ if (size >= UINT16_MAX) size = UINT16_MAX - 1; - DBG(("%s: create vbo handle=%d, size=%d\n", - __FUNCTION__, sna->render.vbo->handle, size)); + DBG(("%s: create vbo handle=%d, size=%d floats [%d bytes]\n", + __FUNCTION__, sna->render.vbo->handle, size, __kgem_bo_size(sna->render.vbo))); + assert(size > sna->render.vertex_used); sna->render.vertex_size = size; - return sna->render.vertex_size - sna->render.vertex_used; + return size - sna->render.vertex_used; } void gen4_vertex_close(struct sna *sna) @@ -319,7 +323,7 @@ int16_t x, int16_t y) { if (channel->is_solid) { - OUT_VERTEX_F(x); + OUT_VERTEX_F(0.5); return; } @@ -376,6 +380,63 @@ r->dst.x, r->dst.y); } +sse2 inline static float * +vemit_texcoord(float *v, + const struct sna_composite_channel *channel, + int16_t x, int16_t y) +{ + if (channel->is_solid) { + *v++ = 0.5; + } else { + x += channel->offset[0]; + y += channel->offset[1]; + + if (channel->is_affine) { + float s, t; + + sna_get_transformed_coordinates(x, y, + channel->transform, + &s, &t); + *v++ = s * channel->scale[0]; + *v++ = t * channel->scale[1]; + } else { + float s, t, w; + + sna_get_transformed_coordinates_3d(x, y, + channel->transform, + &s, &t, &w); + *v++ = s * channel->scale[0]; + *v++ = t * channel->scale[1]; + *v++ = w; + } + } + + return v; +} + +sse2 force_inline static float * +vemit_vertex(float *v, + const struct sna_composite_op *op, + int16_t x, int16_t y) +{ + *v++ = pack_2s(x, y); + return vemit_texcoord(v, &op->src, x, y); +} + +sse2 fastcall static void +emit_boxes(const struct sna_composite_op *op, + const BoxRec *box, int nbox, + float *v) +{ + do { + v = vemit_vertex(v, op, box->x2, box->y2); + v = vemit_vertex(v, op, box->x1, box->y2); + v = vemit_vertex(v, op, box->x1, box->y1); + + box++; + } while (--nbox); +} + sse2 force_inline static void emit_vertex_mask(struct sna *sna, const struct sna_composite_op *op, @@ -407,6 +468,32 @@ r->dst.x, r->dst.y); } +sse2 force_inline static float * +vemit_vertex_mask(float *v, + const struct sna_composite_op *op, + int16_t x, int16_t y) +{ + *v++ = pack_2s(x, y); + v = vemit_texcoord(v, &op->src, x, y); + v = vemit_texcoord(v, &op->mask, x, y); + return v; +} + +sse2 fastcall static void +emit_boxes_mask(const struct sna_composite_op *op, + const BoxRec *box, int nbox, + float *v) +{ + do { + v = vemit_vertex_mask(v, op, box->x2, box->y2); + v = vemit_vertex_mask(v, op, box->x1, box->y2); + v = vemit_vertex_mask(v, op, box->x1, box->y1); + + box++; + } while (--nbox); +} + + sse2 fastcall static void emit_primitive_solid(struct sna *sna, const struct sna_composite_op *op, @@ -1836,6 +1923,7 @@ } } else { tmp->prim_emit = emit_primitive_mask; + tmp->emit_boxes = emit_boxes_mask; tmp->floats_per_vertex = 1; vb = 0; if (tmp->mask.is_solid) { @@ -1942,6 +2030,7 @@ DBG(("%s: projective src, no mask\n", __FUNCTION__)); assert(!tmp->src.is_solid); tmp->prim_emit = emit_primitive; + tmp->emit_boxes = emit_boxes; tmp->floats_per_vertex = 4; vb = 3; } @@ -1961,10 +2050,10 @@ } sse2 fastcall static void -emit_composite_spans_primitive(struct sna *sna, - const struct sna_composite_spans_op *op, - const BoxRec *box, - float opacity) +emit_span_primitive(struct sna *sna, + const struct sna_composite_spans_op *op, + const BoxRec *box, + float opacity) { emit_span_vertex(sna, op, box->x2, box->y2); OUT_VERTEX_F(opacity); @@ -1977,6 +2066,25 @@ } sse2 fastcall static void +emit_span_boxes(const struct sna_composite_spans_op *op, + const struct sna_opacity_box *b, int nbox, + float *v) +{ + do { + v = vemit_vertex(v, &op->base, b->box.x2, b->box.y2); + *v++ = b->alpha; + + v = vemit_vertex(v, &op->base, b->box.x1, b->box.y2); + *v++ = b->alpha; + + v = vemit_vertex(v, &op->base, b->box.x1, b->box.y1); + *v++ = b->alpha; + + b++; + } while (--nbox); +} + +sse2 fastcall static void emit_span_solid(struct sna *sna, const struct sna_composite_spans_op *op, const BoxRec *box, @@ -3084,7 +3192,8 @@ vb = 1 << 2 | 2; } else { DBG(("%s: projective transform\n", __FUNCTION__)); - tmp->prim_emit = emit_composite_spans_primitive; + tmp->prim_emit = emit_span_primitive; + tmp->emit_boxes = emit_span_boxes; tmp->base.floats_per_vertex = 5; vb = 1 << 2 | 3; } diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/gen5_render.c xserver-xorg-video-intel-2.99.914/src/sna/gen5_render.c --- xserver-xorg-video-intel-2.99.910/src/sna/gen5_render.c 2014-02-03 10:48:44.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/gen5_render.c 2014-07-17 20:26:45.000000000 +0000 @@ -54,6 +54,8 @@ #define DBG_NO_STATE_CACHE 0 #define DBG_NO_SURFACE_CACHE 0 +#define ALWAYS_FLUSH 0 + #define MAX_3D_SIZE 8192 #define GEN5_GRF_BLOCKS(nreg) ((nreg + 15) / 16 - 1) @@ -1015,7 +1017,7 @@ inline static void gen5_emit_pipe_flush(struct sna *sna) { -#if 0 +#if 1 OUT_BATCH(GEN5_PIPE_CONTROL | GEN5_PIPE_CONTROL_WC_FLUSH | (4 - 2)); @@ -1047,7 +1049,7 @@ } gen5_emit_vertex_elements(sna, op); - if (kgem_bo_is_dirty(op->src.bo) || kgem_bo_is_dirty(op->mask.bo)) { + if (ALWAYS_FLUSH || kgem_bo_is_dirty(op->src.bo) || kgem_bo_is_dirty(op->mask.bo)) { DBG(("%s: flushing dirty (%d, %d)\n", __FUNCTION__, kgem_bo_is_dirty(op->src.bo), kgem_bo_is_dirty(op->mask.bo))); @@ -1346,6 +1348,7 @@ PixmapPtr pixmap) { struct sna_composite_op tmp; + struct sna_pixmap *priv = sna_pixmap(pixmap); int dst_width = dstRegion->extents.x2 - dstRegion->extents.x1; int dst_height = dstRegion->extents.y2 - dstRegion->extents.y1; int src_width = frame->src.x2 - frame->src.x1; @@ -1353,16 +1356,12 @@ float src_offset_x, src_offset_y; float src_scale_x, src_scale_y; int nbox, pix_xoff, pix_yoff; - struct sna_pixmap *priv; - BoxPtr box; + const BoxRec *box; DBG(("%s: %dx%d -> %dx%d\n", __FUNCTION__, src_width, src_height, dst_width, dst_height)); - priv = sna_pixmap_force_to_gpu(pixmap, MOVE_READ | MOVE_WRITE); - if (priv == NULL) - return false; - + assert(priv->gpu_bo); memset(&tmp, 0, sizeof(tmp)); tmp.op = PictOpSrc; @@ -1413,8 +1412,8 @@ src_scale_y = (float)src_height / dst_height / frame->height; src_offset_y = (float)frame->src.y1 / frame->height - dstRegion->extents.y1 * src_scale_y; - box = REGION_RECTS(dstRegion); - nbox = REGION_NUM_RECTS(dstRegion); + box = region_rects(dstRegion); + nbox = region_num_rects(dstRegion); while (nbox--) { BoxRec r; @@ -1514,13 +1513,25 @@ y += dy + picture->pDrawable->y; channel->is_affine = sna_transform_is_affine(picture->transform); - if (sna_transform_is_integer_translation(picture->transform, &dx, &dy)) { + if (sna_transform_is_imprecise_integer_translation(picture->transform, picture->filter, precise, &dx, &dy)) { DBG(("%s: integer translation (%d, %d), removing\n", __FUNCTION__, dx, dy)); x += dx; y += dy; channel->transform = NULL; channel->filter = PictFilterNearest; + + if (channel->repeat || + (x >= 0 && + y >= 0 && + x + w < pixmap->drawable.width && + y + h < pixmap->drawable.height)) { + struct sna_pixmap *priv = sna_pixmap(pixmap); + if (priv && priv->clear) { + DBG(("%s: converting large pixmap source into solid [%08x]\n", __FUNCTION__, priv->clear_color)); + return gen4_channel_init_solid(sna, channel, priv->clear_color); + } + } } else channel->transform = picture->transform; @@ -1535,6 +1546,25 @@ return sna_render_picture_extract(sna, picture, channel, x, y, w, h, dst_x, dst_y); + DBG(("%s: pixmap, repeat=%d, filter=%d, transform?=%d [affine? %d], format=%08x\n", + __FUNCTION__, + channel->repeat, channel->filter, + channel->transform != NULL, channel->is_affine, + channel->pict_format)); + if (channel->transform) { + DBG(("%s: transform=[%f %f %f, %f %f %f, %f %f %f]\n", + __FUNCTION__, + channel->transform->matrix[0][0] / 65536., + channel->transform->matrix[0][1] / 65536., + channel->transform->matrix[0][2] / 65536., + channel->transform->matrix[1][0] / 65536., + channel->transform->matrix[1][1] / 65536., + channel->transform->matrix[1][2] / 65536., + channel->transform->matrix[2][0] / 65536., + channel->transform->matrix[2][1] / 65536., + channel->transform->matrix[2][2] / 65536.)); + } + return sna_render_pixmap_bo(sna, channel, pixmap, x, y, w, h, dst_x, dst_y); } @@ -1590,7 +1620,7 @@ hint = PREFER_GPU | FORCE_GPU | RENDER_GPU; if (!partial) { - hint |= IGNORE_CPU; + hint |= IGNORE_DAMAGE; if (w == op->dst.width && h == op->dst.height) hint |= REPLACES; } @@ -1599,6 +1629,11 @@ if (op->dst.bo == NULL) return false; + if (hint & REPLACES) { + struct sna_pixmap *priv = sna_pixmap(op->dst.pixmap); + kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo); + } + get_drawable_deltas(dst->pDrawable, op->dst.pixmap, &op->dst.x, &op->dst.y); @@ -1872,7 +1907,7 @@ if (!gen5_composite_set_target(sna, tmp, dst, dst_x, dst_y, width, height, - flags & COMPOSITE_PARTIAL || op > PictOpSrc || dst->pCompositeClip->data)) { + flags & COMPOSITE_PARTIAL || op > PictOpSrc)) { DBG(("%s: failed to set composite target\n", __FUNCTION__)); goto fallback; } @@ -2265,30 +2300,30 @@ static bool gen5_render_copy_boxes(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const DrawableRec *src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, + const DrawableRec *dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int n, unsigned flags) { struct sna_composite_op tmp; DBG(("%s alu=%d, src=%ld:handle=%d, dst=%ld:handle=%d boxes=%d x [((%d, %d), (%d, %d))...], flags=%x\n", __FUNCTION__, alu, - src->drawable.serialNumber, src_bo->handle, - dst->drawable.serialNumber, dst_bo->handle, + src->serialNumber, src_bo->handle, + dst->serialNumber, dst_bo->handle, n, box->x1, box->y1, box->x2, box->y2, flags)); - if (sna_blt_compare_depth(&src->drawable, &dst->drawable) && + if (sna_blt_compare_depth(src, dst) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; if (!(alu == GXcopy || alu == GXclear) || src_bo == dst_bo) { fallback_blt: - if (!sna_blt_compare_depth(&src->drawable, &dst->drawable)) + if (!sna_blt_compare_depth(src, dst)) return false; return sna_blt_copy_boxes_fallback(sna, alu, @@ -2299,12 +2334,12 @@ memset(&tmp, 0, sizeof(tmp)); - if (dst->drawable.depth == src->drawable.depth) { - tmp.dst.format = sna_render_format_for_depth(dst->drawable.depth); + if (dst->depth == src->depth) { + tmp.dst.format = sna_render_format_for_depth(dst->depth); tmp.src.pict_format = tmp.dst.format; } else { - tmp.dst.format = sna_format_for_depth(dst->drawable.depth); - tmp.src.pict_format = sna_format_for_depth(src->drawable.depth); + tmp.dst.format = sna_format_for_depth(dst->depth); + tmp.src.pict_format = sna_format_for_depth(src->depth); } if (!gen5_check_format(tmp.src.pict_format)) { DBG(("%s: unsupported source format, %x, use BLT\n", @@ -2317,9 +2352,9 @@ tmp.op = alu == GXcopy ? PictOpSrc : PictOpClear; - tmp.dst.pixmap = dst; - tmp.dst.width = dst->drawable.width; - tmp.dst.height = dst->drawable.height; + tmp.dst.pixmap = (PixmapPtr)dst; + tmp.dst.width = dst->width; + tmp.dst.height = dst->height; tmp.dst.x = tmp.dst.y = 0; tmp.dst.bo = dst_bo; tmp.damage = NULL; @@ -2352,7 +2387,7 @@ tmp.src.filter = SAMPLER_FILTER_NEAREST; tmp.src.repeat = SAMPLER_EXTEND_NONE; tmp.src.card_format = gen5_get_card_format(tmp.src.pict_format); - if (too_large(src->drawable.width, src->drawable.height)) { + if (too_large(src->width, src->height)) { BoxRec extents = box[0]; int i; @@ -2376,11 +2411,11 @@ goto fallback_tiled_dst; } else { tmp.src.bo = kgem_bo_reference(src_bo); - tmp.src.width = src->drawable.width; - tmp.src.height = src->drawable.height; + tmp.src.width = src->width; + tmp.src.height = src->height; tmp.src.offset[0] = tmp.src.offset[1] = 0; - tmp.src.scale[0] = 1.f/src->drawable.width; - tmp.src.scale[1] = 1.f/src->drawable.height; + tmp.src.scale[0] = 1.f/src->width; + tmp.src.scale[1] = 1.f/src->height; } tmp.is_affine = true; @@ -2448,11 +2483,11 @@ if (tmp.redirect.real_bo) kgem_bo_destroy(&sna->kgem, tmp.dst.bo); fallback_tiled: - if (sna_blt_compare_depth(&src->drawable, &dst->drawable) && + if (sna_blt_compare_depth(src, dst) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; @@ -2628,7 +2663,7 @@ CARD8 op, PictFormat format, const xRenderColor *color, - PixmapPtr dst, struct kgem_bo *dst_bo, + const DrawableRec *dst, struct kgem_bo *dst_bo, const BoxRec *box, int n) { struct sna_composite_op tmp; @@ -2647,7 +2682,7 @@ if (op <= PictOpSrc && (prefer_blt_fill(sna) || - too_large(dst->drawable.width, dst->drawable.height) || + too_large(dst->width, dst->height) || !gen5_check_dst_format(format))) { uint8_t alu = GXinvalid; @@ -2664,14 +2699,14 @@ if (alu != GXinvalid && sna_blt_fill_boxes(sna, alu, - dst_bo, dst->drawable.bitsPerPixel, + dst_bo, dst->bitsPerPixel, pixel, box, n)) return true; if (!gen5_check_dst_format(format)) return false; - if (too_large(dst->drawable.width, dst->drawable.height)) + if (too_large(dst->width, dst->height)) return sna_tiling_fill_boxes(sna, op, format, color, dst, dst_bo, box, n); } @@ -2693,9 +2728,9 @@ tmp.op = op; - tmp.dst.pixmap = dst; - tmp.dst.width = dst->drawable.width; - tmp.dst.height = dst->drawable.height; + tmp.dst.pixmap = (PixmapPtr)dst; + tmp.dst.width = dst->width; + tmp.dst.height = dst->height; tmp.dst.format = format; tmp.dst.bo = dst_bo; @@ -2896,6 +2931,7 @@ op->blt = gen5_render_fill_op_blt; op->box = gen5_render_fill_op_box; op->boxes = gen5_render_fill_op_boxes; + op->points = NULL; op->done = gen5_render_fill_op_done; return true; } diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/gen6_common.h xserver-xorg-video-intel-2.99.914/src/sna/gen6_common.h --- xserver-xorg-video-intel-2.99.910/src/sna/gen6_common.h 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/gen6_common.h 2014-06-13 08:15:49.000000000 +0000 @@ -36,7 +36,7 @@ static inline bool is_uncached(struct sna *sna, struct kgem_bo *bo) { - return bo->scanout && !sna->kgem.has_wt; + return bo->io || (bo->scanout && !sna->kgem.has_wt); } inline static bool can_switch_to_blt(struct sna *sna, @@ -58,6 +58,9 @@ if (bo && RQ_IS_BLT(bo->rq)) return true; + if (sna->render_state.gt < 2) + return true; + return kgem_ring_is_idle(&sna->kgem, KGEM_BLT); } @@ -173,24 +176,25 @@ if (PREFER_RENDER) return PREFER_RENDER < 0; - if (flags & (FILL_POINTS | FILL_SPANS) && - can_switch_to_blt(sna, bo, 0)) - return true; - if (untiled_tlb_miss(bo)) return true; if (force_blt_ring(sna)) return true; - if (kgem_bo_is_render(bo)) - return false; - - if (prefer_render_ring(sna, bo)) - return false; - - if (!prefer_blt_ring(sna, bo, 0)) - return false; + if ((flags & (FILL_POINTS | FILL_SPANS)) == 0) { + if (kgem_bo_is_render(bo)) + return false; + + if (prefer_render_ring(sna, bo)) + return false; + + if (!prefer_blt_ring(sna, bo, 0)) + return false; + } else { + if (can_switch_to_blt(sna, bo, 0)) + return true; + } return prefer_blt_bo(sna, bo); } diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/gen6_render.c xserver-xorg-video-intel-2.99.914/src/sna/gen6_render.c --- xserver-xorg-video-intel-2.99.910/src/sna/gen6_render.c 2014-02-10 09:24:57.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/gen6_render.c 2014-07-17 20:26:45.000000000 +0000 @@ -720,6 +720,8 @@ 64)); OUT_BATCH(0); + DBG(("%s: offset=(%d, %d), limit=(%d, %d)\n", + __FUNCTION__, op->dst.x, op->dst.y, op->dst.width, op->dst.width)); OUT_BATCH(GEN6_3DSTATE_DRAWING_RECTANGLE | (4 - 2)); OUT_BATCH(0); OUT_BATCH(limit); @@ -1585,6 +1587,7 @@ PixmapPtr pixmap) { struct sna_composite_op tmp; + struct sna_pixmap *priv = sna_pixmap(pixmap); int dst_width = dstRegion->extents.x2 - dstRegion->extents.x1; int dst_height = dstRegion->extents.y2 - dstRegion->extents.y1; int src_width = frame->src.x2 - frame->src.x1; @@ -1592,23 +1595,19 @@ float src_offset_x, src_offset_y; float src_scale_x, src_scale_y; int nbox, pix_xoff, pix_yoff; - struct sna_pixmap *priv; unsigned filter; - BoxPtr box; + const BoxRec *box; - DBG(("%s: src=(%d, %d), dst=(%d, %d), %ldx[(%d, %d), (%d, %d)...]\n", + DBG(("%s: src=(%d, %d), dst=(%d, %d), %dx[(%d, %d), (%d, %d)...]\n", __FUNCTION__, src_width, src_height, dst_width, dst_height, - (long)REGION_NUM_RECTS(dstRegion), + region_num_rects(dstRegion), REGION_EXTENTS(NULL, dstRegion)->x1, REGION_EXTENTS(NULL, dstRegion)->y1, REGION_EXTENTS(NULL, dstRegion)->x2, REGION_EXTENTS(NULL, dstRegion)->y2)); - priv = sna_pixmap_force_to_gpu(pixmap, MOVE_READ | MOVE_WRITE); - if (priv == NULL) - return false; - + assert(priv->gpu_bo); memset(&tmp, 0, sizeof(tmp)); tmp.dst.pixmap = pixmap; @@ -1665,8 +1664,8 @@ src_scale_y = (float)src_height / dst_height / frame->height; src_offset_y = (float)frame->src.y1 / frame->height - dstRegion->extents.y1 * src_scale_y; - box = REGION_RECTS(dstRegion); - nbox = REGION_NUM_RECTS(dstRegion); + box = region_rects(dstRegion); + nbox = region_num_rects(dstRegion); while (nbox--) { BoxRec r; @@ -1713,8 +1712,8 @@ uint32_t color; int16_t dx, dy; - DBG(("%s: (%d, %d)x(%d, %d), dst=(%d, %d)\n", - __FUNCTION__, x, y, w, h, dst_x, dst_y)); + DBG(("%s: (%d, %d)x(%d, %d), dst=(%d, %d), precise=%d\n", + __FUNCTION__, x, y, w, h, dst_x, dst_y, precise)); channel->is_solid = false; channel->card_format = -1; @@ -1766,13 +1765,25 @@ y += dy + picture->pDrawable->y; channel->is_affine = sna_transform_is_affine(picture->transform); - if (sna_transform_is_integer_translation(picture->transform, &dx, &dy)) { + if (sna_transform_is_imprecise_integer_translation(picture->transform, picture->filter, precise, &dx, &dy)) { DBG(("%s: integer translation (%d, %d), removing\n", __FUNCTION__, dx, dy)); x += dx; y += dy; channel->transform = NULL; channel->filter = PictFilterNearest; + + if (channel->repeat && + (x >= 0 && + y >= 0 && + x + w < pixmap->drawable.width && + y + h < pixmap->drawable.height)) { + struct sna_pixmap *priv = sna_pixmap(pixmap); + if (priv && priv->clear) { + DBG(("%s: converting large pixmap source into solid [%08x]\n", __FUNCTION__, priv->clear_color)); + return gen4_channel_init_solid(sna, channel, priv->clear_color); + } + } } else channel->transform = picture->transform; @@ -1790,6 +1801,36 @@ x, y, w, h, dst_x, dst_y); } + DBG(("%s: pixmap, repeat=%d, filter=%d, transform?=%d [affine? %d], format=%08x\n", + __FUNCTION__, + channel->repeat, channel->filter, + channel->transform != NULL, channel->is_affine, + channel->pict_format)); + if (channel->transform) { +#define f2d(x) (((double)(x))/65536.) + DBG(("%s: transform=[%f %f %f, %f %f %f, %f %f %f] (raw [%x %x %x, %x %x %x, %x %x %x])\n", + __FUNCTION__, + f2d(channel->transform->matrix[0][0]), + f2d(channel->transform->matrix[0][1]), + f2d(channel->transform->matrix[0][2]), + f2d(channel->transform->matrix[1][0]), + f2d(channel->transform->matrix[1][1]), + f2d(channel->transform->matrix[1][2]), + f2d(channel->transform->matrix[2][0]), + f2d(channel->transform->matrix[2][1]), + f2d(channel->transform->matrix[2][2]), + channel->transform->matrix[0][0], + channel->transform->matrix[0][1], + channel->transform->matrix[0][2], + channel->transform->matrix[1][0], + channel->transform->matrix[1][1], + channel->transform->matrix[1][2], + channel->transform->matrix[2][0], + channel->transform->matrix[2][1], + channel->transform->matrix[2][2])); +#undef f2d + } + return sna_render_pixmap_bo(sna, channel, pixmap, x, y, w, h, dst_x, dst_y); } @@ -1822,7 +1863,7 @@ sna_render_composite_redirect_done(sna, op); } -static bool +inline static bool gen6_composite_set_target(struct sna *sna, struct sna_composite_op *op, PicturePtr dst, @@ -1832,7 +1873,7 @@ BoxRec box; unsigned int hint; - DBG(("%s: (%d, %d)x(%d, %d), partial?=%d\n", __FUNCTION__, x, y, w, h)); + DBG(("%s: (%d, %d)x(%d, %d), partial?=%d\n", __FUNCTION__, x, y, w, h, partial)); op->dst.pixmap = get_drawable_pixmap(dst->pDrawable); op->dst.format = dst->format; @@ -1849,7 +1890,7 @@ hint = PREFER_GPU | FORCE_GPU | RENDER_GPU; if (!partial) { - hint |= IGNORE_CPU; + hint |= IGNORE_DAMAGE; if (w == op->dst.width && h == op->dst.height) hint |= REPLACES; } @@ -1858,6 +1899,11 @@ if (op->dst.bo == NULL) return false; + if (hint & REPLACES) { + struct sna_pixmap *priv = sna_pixmap(op->dst.pixmap); + kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo); + } + get_drawable_deltas(dst->pDrawable, op->dst.pixmap, &op->dst.x, &op->dst.y); @@ -1897,18 +1943,21 @@ } bo = __sna_drawable_peek_bo(dst->pDrawable); - if (bo && bo->rq) + if (bo == NULL) + return true; + if (bo->rq) return RQ_IS_BLT(bo->rq); - if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, NULL, 0)) + if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, bo, 0)) return true; if (src->pDrawable) { bo = __sna_drawable_peek_bo(src->pDrawable); if (bo == NULL) return true; - else if (bo->rq) - return RQ_IS_BLT(bo->rq); + + if (prefer_blt_bo(sna, bo)) + return true; } if (sna->kgem.ring == KGEM_BLT) { @@ -2171,7 +2220,7 @@ tmp->op = op; if (!gen6_composite_set_target(sna, tmp, dst, dst_x, dst_y, width, height, - flags & COMPOSITE_PARTIAL || op > PictOpSrc || dst->pCompositeClip->data)) + flags & COMPOSITE_PARTIAL || op > PictOpSrc)) goto fallback; switch (gen6_composite_picture(sna, src, &tmp->src, @@ -2611,44 +2660,10 @@ return prefer_blt_bo(sna, src_bo) || prefer_blt_bo(sna, dst_bo); } -inline static void boxes_extents(const BoxRec *box, int n, BoxRec *extents) -{ - *extents = box[0]; - while (--n) { - box++; - - if (box->x1 < extents->x1) - extents->x1 = box->x1; - if (box->x2 > extents->x2) - extents->x2 = box->x2; - - if (box->y1 < extents->y1) - extents->y1 = box->y1; - if (box->y2 > extents->y2) - extents->y2 = box->y2; - } -} - -static inline bool -overlaps(struct sna *sna, - struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, - const BoxRec *box, int n, BoxRec *extents) -{ - if (src_bo != dst_bo) - return false; - - boxes_extents(box, n, extents); - return (extents->x2 + src_dx > extents->x1 + dst_dx && - extents->x1 + src_dx < extents->x2 + dst_dx && - extents->y2 + src_dy > extents->y1 + dst_dy && - extents->y1 + src_dy < extents->y2 + dst_dy); -} - static bool gen6_render_copy_boxes(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const DrawableRec *src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, + const DrawableRec *dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int n, unsigned flags) { struct sna_composite_op tmp; @@ -2660,20 +2675,20 @@ overlaps(sna, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - box, n, &extents))); + box, n, flags, &extents))); if (prefer_blt_copy(sna, src_bo, dst_bo, flags) && - sna_blt_compare_depth(&src->drawable, &dst->drawable) && + sna_blt_compare_depth(src, dst) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; if (!(alu == GXcopy || alu == GXclear)) { fallback_blt: - if (!sna_blt_compare_depth(&src->drawable, &dst->drawable)) + if (!sna_blt_compare_depth(src, dst)) return false; return sna_blt_copy_boxes_fallback(sna, alu, @@ -2685,38 +2700,45 @@ if (overlaps(sna, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - box, n, &extents)) { - if (too_large(extents.x2-extents.x1, extents.y2-extents.y1)) - goto fallback_blt; + box, n, flags, + &extents)) { + bool big = too_large(extents.x2-extents.x1, extents.y2-extents.y1); - if (can_switch_to_blt(sna, dst_bo, flags) && - sna_blt_compare_depth(&src->drawable, &dst->drawable) && + if ((big || can_switch_to_blt(sna, dst_bo, flags)) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; + if (big) + goto fallback_blt; + + assert(src_bo == dst_bo); + assert(src->depth == dst->depth); + assert(src->width == dst->width); + assert(src->height == dst->height); return sna_render_copy_boxes__overlap(sna, alu, - src, src_bo, src_dx, src_dy, - dst, dst_bo, dst_dx, dst_dy, + src, src_bo, + src_dx, src_dy, + dst_dx, dst_dy, box, n, &extents); } - if (dst->drawable.depth == src->drawable.depth) { - tmp.dst.format = sna_render_format_for_depth(dst->drawable.depth); + if (dst->depth == src->depth) { + tmp.dst.format = sna_render_format_for_depth(dst->depth); tmp.src.pict_format = tmp.dst.format; } else { - tmp.dst.format = sna_format_for_depth(dst->drawable.depth); - tmp.src.pict_format = sna_format_for_depth(src->drawable.depth); + tmp.dst.format = sna_format_for_depth(dst->depth); + tmp.src.pict_format = sna_format_for_depth(src->depth); } if (!gen6_check_format(tmp.src.pict_format)) goto fallback_blt; - tmp.dst.pixmap = dst; - tmp.dst.width = dst->drawable.width; - tmp.dst.height = dst->drawable.height; + tmp.dst.pixmap = (PixmapPtr)dst; + tmp.dst.width = dst->width; + tmp.dst.height = dst->height; tmp.dst.bo = dst_bo; tmp.dst.x = tmp.dst.y = 0; tmp.damage = NULL; @@ -2745,15 +2767,10 @@ extents.y2 - extents.y1, n > 1)) goto fallback_tiled; - - dst_dx += tmp.dst.x; - dst_dy += tmp.dst.y; - - tmp.dst.x = tmp.dst.y = 0; } tmp.src.card_format = gen6_get_card_format(tmp.src.pict_format); - if (too_large(src->drawable.width, src->drawable.height)) { + if (too_large(src->width, src->height)) { int i; extents = box[0]; @@ -2777,13 +2794,11 @@ DBG(("%s: unable to extract partial pixmap\n", __FUNCTION__)); goto fallback_tiled_dst; } - - src_dx += tmp.src.offset[0]; - src_dy += tmp.src.offset[1]; } else { tmp.src.bo = src_bo; - tmp.src.width = src->drawable.width; - tmp.src.height = src->drawable.height; + tmp.src.width = src->width; + tmp.src.height = src->height; + tmp.src.offset[0] = tmp.src.offset[1] = 0; } tmp.mask.bo = NULL; @@ -2812,6 +2827,14 @@ _kgem_set_mode(&sna->kgem, KGEM_RENDER); } + src_dx += tmp.src.offset[0]; + src_dy += tmp.src.offset[1]; + + dst_dx += tmp.dst.x; + dst_dy += tmp.dst.y; + + tmp.dst.x = tmp.dst.y = 0; + gen6_align_vertex(sna, &tmp); gen6_emit_copy_state(sna, &tmp); @@ -2854,11 +2877,11 @@ if (tmp.redirect.real_bo) kgem_bo_destroy(&sna->kgem, tmp.dst.bo); fallback_tiled: - if (sna_blt_compare_depth(&src->drawable, &dst->drawable) && + if (sna_blt_compare_depth(src, dst) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; @@ -3016,7 +3039,7 @@ CARD8 op, PictFormat format, const xRenderColor *color, - PixmapPtr dst, struct kgem_bo *dst_bo, + const DrawableRec *dst, struct kgem_bo *dst_bo, const BoxRec *box, int n) { struct sna_composite_op tmp; @@ -3051,7 +3074,7 @@ if (alu != GXinvalid && sna_blt_fill_boxes(sna, alu, - dst_bo, dst->drawable.bitsPerPixel, + dst_bo, dst->bitsPerPixel, pixel, box, n)) return true; @@ -3074,16 +3097,16 @@ __FUNCTION__, pixel, n, box[0].x1, box[0].y1, box[0].x2, box[0].y2)); - tmp.dst.pixmap = dst; - tmp.dst.width = dst->drawable.width; - tmp.dst.height = dst->drawable.height; + tmp.dst.pixmap = (PixmapPtr)dst; + tmp.dst.width = dst->width; + tmp.dst.height = dst->height; tmp.dst.format = format; tmp.dst.bo = dst_bo; tmp.dst.x = tmp.dst.y = 0; tmp.damage = NULL; sna_render_composite_redirect_init(&tmp); - if (too_large(dst->drawable.width, dst->drawable.height)) { + if (too_large(dst->width, dst->height)) { BoxRec extents; boxes_extents(box, n, &extents); @@ -3300,6 +3323,7 @@ op->blt = gen6_render_op_fill_blt; op->box = gen6_render_op_fill_box; op->boxes = gen6_render_op_fill_boxes; + op->points = NULL; op->done = gen6_render_op_fill_done; return true; } diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/gen7_render.c xserver-xorg-video-intel-2.99.914/src/sna/gen7_render.c --- xserver-xorg-video-intel-2.99.910/src/sna/gen7_render.c 2014-02-01 22:26:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/gen7_render.c 2014-07-17 20:26:45.000000000 +0000 @@ -92,6 +92,7 @@ int push_ps_size; /* in 1KBs */ } urb; int gt; + uint32_t mocs; }; static const struct gt_info ivb_gt_info = { @@ -110,6 +111,7 @@ .max_wm_threads = (48-1) << IVB_PS_MAX_THREADS_SHIFT, .urb = { 128, 512, 192, 8 }, .gt = 1, + .mocs = 3, }; static const struct gt_info ivb_gt2_info = { @@ -119,11 +121,11 @@ .max_wm_threads = (172-1) << IVB_PS_MAX_THREADS_SHIFT, .urb = { 256, 704, 320, 8 }, .gt = 2, + .mocs = 3, }; static const struct gt_info byt_gt_info = { .name = "Baytrail (gen7)", - .urb = { 128, 64, 64 }, .max_vs_threads = 36, .max_gs_threads = 36, .max_wm_threads = (48-1) << IVB_PS_MAX_THREADS_SHIFT, @@ -151,6 +153,7 @@ 1 << HSW_PS_SAMPLE_MASK_SHIFT, .urb = { 128, 640, 256, 8 }, .gt = 1, + .mocs = 5, }; static const struct gt_info hsw_gt2_info = { @@ -162,6 +165,7 @@ 1 << HSW_PS_SAMPLE_MASK_SHIFT, .urb = { 256, 1664, 640, 8 }, .gt = 2, + .mocs = 5, }; static const struct gt_info hsw_gt3_info = { @@ -173,6 +177,7 @@ 1 << HSW_PS_SAMPLE_MASK_SHIFT, .urb = { 512, 3328, 1280, 16 }, .gt = 3, + .mocs = 5, }; inline static bool is_ivb(struct sna *sna) @@ -519,9 +524,7 @@ static void gen7_emit_state_base_address(struct sna *sna) { - uint32_t mocs; - - mocs = is_hsw(sna) ? 5 << 8 : 3 << 8; + uint32_t mocs = sna->render_state.gen7.info->mocs << 8; OUT_BATCH(GEN7_STATE_BASE_ADDRESS | (10 - 2)); OUT_BATCH(0); /* general */ @@ -1310,7 +1313,7 @@ (height - 1) << GEN7_SURFACE_HEIGHT_SHIFT); ss[3] = (bo->pitch - 1) << GEN7_SURFACE_PITCH_SHIFT; ss[4] = 0; - ss[5] = (is_scanout || bo->io) ? 0 : is_hsw(sna) ? 5 << 16 : 3 << 16; + ss[5] = (is_scanout || bo->io) ? 0 : sna->render_state.gen7.info->mocs << 16; ss[6] = 0; ss[7] = 0; if (is_hsw(sna)) @@ -1824,6 +1827,7 @@ PixmapPtr pixmap) { struct sna_composite_op tmp; + struct sna_pixmap *priv = sna_pixmap(pixmap); int dst_width = dstRegion->extents.x2 - dstRegion->extents.x1; int dst_height = dstRegion->extents.y2 - dstRegion->extents.y1; int src_width = frame->src.x2 - frame->src.x1; @@ -1831,23 +1835,19 @@ float src_offset_x, src_offset_y; float src_scale_x, src_scale_y; int nbox, pix_xoff, pix_yoff; - struct sna_pixmap *priv; unsigned filter; - BoxPtr box; + const BoxRec *box; - DBG(("%s: src=(%d, %d), dst=(%d, %d), %ldx[(%d, %d), (%d, %d)...]\n", + DBG(("%s: src=(%d, %d), dst=(%d, %d), %dx[(%d, %d), (%d, %d)...]\n", __FUNCTION__, src_width, src_height, dst_width, dst_height, - (long)REGION_NUM_RECTS(dstRegion), + region_num_rects(dstRegion), REGION_EXTENTS(NULL, dstRegion)->x1, REGION_EXTENTS(NULL, dstRegion)->y1, REGION_EXTENTS(NULL, dstRegion)->x2, REGION_EXTENTS(NULL, dstRegion)->y2)); - priv = sna_pixmap_force_to_gpu(pixmap, MOVE_READ | MOVE_WRITE); - if (priv == NULL) - return false; - + assert(priv->gpu_bo); memset(&tmp, 0, sizeof(tmp)); tmp.dst.pixmap = pixmap; @@ -1918,8 +1918,8 @@ src_scale_x, src_scale_y, src_offset_x, src_offset_y)); - box = REGION_RECTS(dstRegion); - nbox = REGION_NUM_RECTS(dstRegion); + box = region_rects(dstRegion); + nbox = region_num_rects(dstRegion); while (nbox--) { BoxRec r; @@ -2022,6 +2022,7 @@ channel->repeat = picture->repeat ? picture->repeatType : RepeatNone; channel->filter = picture->filter; + assert(picture->pDrawable); pixmap = get_drawable_pixmap(picture->pDrawable); get_drawable_deltas(picture->pDrawable, pixmap, &dx, &dy); @@ -2029,13 +2030,25 @@ y += dy + picture->pDrawable->y; channel->is_affine = sna_transform_is_affine(picture->transform); - if (sna_transform_is_integer_translation(picture->transform, &dx, &dy)) { + if (sna_transform_is_imprecise_integer_translation(picture->transform, picture->filter, precise, &dx, &dy)) { DBG(("%s: integer translation (%d, %d), removing\n", __FUNCTION__, dx, dy)); x += dx; y += dy; channel->transform = NULL; channel->filter = PictFilterNearest; + + if (channel->repeat || + (x >= 0 && + y >= 0 && + x + w < pixmap->drawable.width && + y + h < pixmap->drawable.height)) { + struct sna_pixmap *priv = sna_pixmap(pixmap); + if (priv && priv->clear) { + DBG(("%s: converting large pixmap source into solid [%08x]\n", __FUNCTION__, priv->clear_color)); + return gen4_channel_init_solid(sna, channel, priv->clear_color); + } + } } else channel->transform = picture->transform; @@ -2076,7 +2089,7 @@ x, y, w, h, dst_x, dst_y); } -static void gen7_composite_channel_convert(struct sna_composite_channel *channel) +inline static void gen7_composite_channel_convert(struct sna_composite_channel *channel) { channel->repeat = gen7_repeat(channel->repeat); channel->filter = gen7_filter(channel->filter); @@ -2101,7 +2114,7 @@ sna_render_composite_redirect_done(sna, op); } -static bool +inline static bool gen7_composite_set_target(struct sna *sna, struct sna_composite_op *op, PicturePtr dst, @@ -2111,7 +2124,7 @@ BoxRec box; unsigned int hint; - DBG(("%s: (%d, %d)x(%d, %d), partial?=%d\n", __FUNCTION__, x, y, w, h)); + DBG(("%s: (%d, %d)x(%d, %d), partial?=%d\n", __FUNCTION__, x, y, w, h, partial)); op->dst.pixmap = get_drawable_pixmap(dst->pDrawable); op->dst.format = dst->format; @@ -2129,7 +2142,7 @@ hint = PREFER_GPU | FORCE_GPU | RENDER_GPU; if (!partial) { - hint |= IGNORE_CPU; + hint |= IGNORE_DAMAGE; if (w == op->dst.width && h == op->dst.height) hint |= REPLACES; } @@ -2138,6 +2151,11 @@ if (op->dst.bo == NULL) return false; + if (hint & REPLACES) { + struct sna_pixmap *priv = sna_pixmap(op->dst.pixmap); + kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo); + } + get_drawable_deltas(dst->pDrawable, op->dst.pixmap, &op->dst.x, &op->dst.y); @@ -2177,18 +2195,21 @@ } bo = __sna_drawable_peek_bo(dst->pDrawable); - if (bo && bo->rq) + if (bo == NULL) + return true; + if (bo->rq) return RQ_IS_BLT(bo->rq); - if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, NULL, 0)) + if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, bo, 0)) return true; if (src->pDrawable) { bo = __sna_drawable_peek_bo(src->pDrawable); if (bo == NULL) return true; - else if (bo->rq) - return RQ_IS_BLT(bo->rq); + + if (prefer_blt_bo(sna, bo)) + return true; } if (sna->kgem.ring == KGEM_BLT) { @@ -2451,7 +2472,7 @@ tmp->op = op; if (!gen7_composite_set_target(sna, tmp, dst, dst_x, dst_y, width, height, - flags & COMPOSITE_PARTIAL || op > PictOpSrc || dst->pCompositeClip->data)) + flags & COMPOSITE_PARTIAL || op > PictOpSrc)) goto fallback; switch (gen7_composite_picture(sna, src, &tmp->src, @@ -2873,44 +2894,10 @@ return prefer_blt_bo(sna, src_bo) || prefer_blt_bo(sna, dst_bo); } -inline static void boxes_extents(const BoxRec *box, int n, BoxRec *extents) -{ - *extents = box[0]; - while (--n) { - box++; - - if (box->x1 < extents->x1) - extents->x1 = box->x1; - if (box->x2 > extents->x2) - extents->x2 = box->x2; - - if (box->y1 < extents->y1) - extents->y1 = box->y1; - if (box->y2 > extents->y2) - extents->y2 = box->y2; - } -} - -static inline bool -overlaps(struct sna *sna, - struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, - const BoxRec *box, int n, BoxRec *extents) -{ - if (src_bo != dst_bo) - return false; - - boxes_extents(box, n, extents); - return (extents->x2 + src_dx > extents->x1 + dst_dx && - extents->x1 + src_dx < extents->x2 + dst_dx && - extents->y2 + src_dy > extents->y1 + dst_dy && - extents->y1 + src_dy < extents->y2 + dst_dy); -} - static bool gen7_render_copy_boxes(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const DrawableRec *src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, + const DrawableRec *dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int n, unsigned flags) { struct sna_composite_op tmp; @@ -2922,21 +2909,21 @@ overlaps(sna, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - box, n, &extents))); + box, n, flags, &extents))); if (prefer_blt_copy(sna, src_bo, dst_bo, flags) && - sna_blt_compare_depth(&src->drawable, &dst->drawable) && + sna_blt_compare_depth(src, dst) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; if (!(alu == GXcopy || alu == GXclear)) { fallback_blt: DBG(("%s: fallback blt\n", __FUNCTION__)); - if (!sna_blt_compare_depth(&src->drawable, &dst->drawable)) + if (!sna_blt_compare_depth(src, dst)) return false; return sna_blt_copy_boxes_fallback(sna, alu, @@ -2948,38 +2935,45 @@ if (overlaps(sna, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - box, n, &extents)) { - if (too_large(extents.x2-extents.x1, extents.y2-extents.y1)) - goto fallback_blt; + box, n, flags, + &extents)) { + bool big = too_large(extents.x2-extents.x1, extents.y2-extents.y1); - if (can_switch_to_blt(sna, dst_bo, flags) && - sna_blt_compare_depth(&src->drawable, &dst->drawable) && + if ((big || can_switch_to_blt(sna, dst_bo, flags)) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; + if (big) + goto fallback_blt; + + assert(src_bo == dst_bo); + assert(src->depth == dst->depth); + assert(src->width == dst->width); + assert(src->height == dst->height); return sna_render_copy_boxes__overlap(sna, alu, - src, src_bo, src_dx, src_dy, - dst, dst_bo, dst_dx, dst_dy, + src, src_bo, + src_dx, src_dy, + dst_dx, dst_dy, box, n, &extents); } - if (dst->drawable.depth == src->drawable.depth) { - tmp.dst.format = sna_render_format_for_depth(dst->drawable.depth); + if (dst->depth == src->depth) { + tmp.dst.format = sna_render_format_for_depth(dst->depth); tmp.src.pict_format = tmp.dst.format; } else { - tmp.dst.format = sna_format_for_depth(dst->drawable.depth); - tmp.src.pict_format = sna_format_for_depth(src->drawable.depth); + tmp.dst.format = sna_format_for_depth(dst->depth); + tmp.src.pict_format = sna_format_for_depth(src->depth); } if (!gen7_check_format(tmp.src.pict_format)) goto fallback_blt; - tmp.dst.pixmap = dst; - tmp.dst.width = dst->drawable.width; - tmp.dst.height = dst->drawable.height; + tmp.dst.pixmap = (PixmapPtr)dst; + tmp.dst.width = dst->width; + tmp.dst.height = dst->height; tmp.dst.bo = dst_bo; tmp.dst.x = tmp.dst.y = 0; tmp.damage = NULL; @@ -3008,15 +3002,10 @@ extents.y2 - extents.y1, n > 1)) goto fallback_tiled; - - dst_dx += tmp.dst.x; - dst_dy += tmp.dst.y; - - tmp.dst.x = tmp.dst.y = 0; } tmp.src.card_format = gen7_get_card_format(tmp.src.pict_format); - if (too_large(src->drawable.width, src->drawable.height)) { + if (too_large(src->width, src->height)) { int i; extents = box[0]; @@ -3038,13 +3027,11 @@ extents.x2 - extents.x1, extents.y2 - extents.y1)) goto fallback_tiled_dst; - - src_dx += tmp.src.offset[0]; - src_dy += tmp.src.offset[1]; } else { tmp.src.bo = src_bo; - tmp.src.width = src->drawable.width; - tmp.src.height = src->drawable.height; + tmp.src.width = src->width; + tmp.src.height = src->height; + tmp.src.offset[0] = tmp.src.offset[1] = 0; } tmp.mask.bo = NULL; @@ -3068,6 +3055,14 @@ _kgem_set_mode(&sna->kgem, KGEM_RENDER); } + src_dx += tmp.src.offset[0]; + src_dy += tmp.src.offset[1]; + + dst_dx += tmp.dst.x; + dst_dy += tmp.dst.y; + + tmp.dst.x = tmp.dst.y = 0; + gen7_align_vertex(sna, &tmp); gen7_emit_copy_state(sna, &tmp); @@ -3111,11 +3106,11 @@ kgem_bo_destroy(&sna->kgem, tmp.dst.bo); fallback_tiled: DBG(("%s: fallback tiled\n", __FUNCTION__)); - if (sna_blt_compare_depth(&src->drawable, &dst->drawable) && + if (sna_blt_compare_depth(src, dst) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; @@ -3278,7 +3273,7 @@ CARD8 op, PictFormat format, const xRenderColor *color, - PixmapPtr dst, struct kgem_bo *dst_bo, + const DrawableRec *dst, struct kgem_bo *dst_bo, const BoxRec *box, int n) { struct sna_composite_op tmp; @@ -3313,7 +3308,7 @@ if (alu != GXinvalid && sna_blt_fill_boxes(sna, alu, - dst_bo, dst->drawable.bitsPerPixel, + dst_bo, dst->bitsPerPixel, pixel, box, n)) return true; @@ -3336,16 +3331,16 @@ __FUNCTION__, pixel, n, box[0].x1, box[0].y1, box[0].x2, box[0].y2)); - tmp.dst.pixmap = dst; - tmp.dst.width = dst->drawable.width; - tmp.dst.height = dst->drawable.height; + tmp.dst.pixmap = (PixmapPtr)dst; + tmp.dst.width = dst->width; + tmp.dst.height = dst->height; tmp.dst.format = format; tmp.dst.bo = dst_bo; tmp.dst.x = tmp.dst.y = 0; tmp.damage = NULL; sna_render_composite_redirect_init(&tmp); - if (too_large(dst->drawable.width, dst->drawable.height)) { + if (too_large(dst->width, dst->height)) { BoxRec extents; boxes_extents(box, n, &extents); @@ -3565,6 +3560,7 @@ op->blt = gen7_render_fill_op_blt; op->box = gen7_render_fill_op_box; op->boxes = gen7_render_fill_op_boxes; + op->points = NULL; op->done = gen7_render_fill_op_done; return true; } diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/gen8_render.c xserver-xorg-video-intel-2.99.914/src/sna/gen8_render.c --- xserver-xorg-video-intel-2.99.910/src/sna/gen8_render.c 2014-02-01 22:26:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/gen8_render.c 2014-07-17 20:26:45.000000000 +0000 @@ -214,6 +214,40 @@ return width > GEN8_MAX_SIZE || height > GEN8_MAX_SIZE; } +static inline bool unaligned(struct kgem_bo *bo, int bpp) +{ + /* XXX What exactly do we need to meet H_ALIGN and V_ALIGN? */ +#if 0 + int x, y; + + if (bo->proxy == NULL) + return false; + + /* Assume that all tiled proxies are constructed correctly. */ + if (bo->tiling) + return false; + + DBG(("%s: checking alignment of a linear proxy, offset=%d, pitch=%d, bpp=%d: => (%d, %d)\n", + __FUNCTION__, bo->delta, bo->pitch, bpp, + 8 * (bo->delta % bo->pitch) / bpp, bo->delta / bo->pitch)); + + /* This may be a random userptr map, check that it meets the + * render alignment of SURFACE_VALIGN_4 | SURFACE_HALIGN_4. + */ + y = bo->delta / bo->pitch; + if (y & 3) + return true; + + x = 8 * (bo->delta - y * bo->pitch); + if (x & (4*bpp - 1)) + return true; + + return false; +#else + return false; +#endif +} + static uint32_t gen8_get_blend(int op, bool has_component_alpha, uint32_t dst_format) @@ -407,19 +441,34 @@ } static void -gen8_emit_urb(struct sna *sna) +gen8_emit_push_constants(struct sna *sna) { #if SIM + OUT_BATCH(GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_VS | (2 - 2)); + OUT_BATCH(0); + + OUT_BATCH(GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_HS | (2 - 2)); + OUT_BATCH(0); + + OUT_BATCH(GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_DS | (2 - 2)); + OUT_BATCH(0); + + OUT_BATCH(GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_GS | (2 - 2)); + OUT_BATCH(0); + OUT_BATCH(GEN8_3DSTATE_PUSH_CONSTANT_ALLOC_PS | (2 - 2)); - OUT_BATCH(0 << PUSH_CONSTANT_BUFFER_OFFSET_SHIFT | - 4 << PUSH_CONSTANT_BUFFER_SIZE_SHIFT); /* 8KiB */ + OUT_BATCH(0); #endif +} +static void +gen8_emit_urb(struct sna *sna) +{ /* num of VS entries must be divisible by 8 if size < 9 */ OUT_BATCH(GEN8_3DSTATE_URB_VS | (2 - 2)); - OUT_BATCH(960 << URB_ENTRY_NUMBER_SHIFT | + OUT_BATCH(1024 << URB_ENTRY_NUMBER_SHIFT | (2 - 1) << URB_ENTRY_SIZE_SHIFT | - 1 << URB_STARTING_ADDRESS_SHIFT); + 0 << URB_STARTING_ADDRESS_SHIFT); OUT_BATCH(GEN8_3DSTATE_URB_HS | (2 - 2)); OUT_BATCH(0 << URB_ENTRY_SIZE_SHIFT | @@ -640,8 +689,13 @@ gen8_emit_null_depth_buffer(struct sna *sna) { OUT_BATCH(GEN8_3DSTATE_DEPTH_BUFFER | (8 - 2)); +#if 0 OUT_BATCH(SURFACE_NULL << DEPTH_BUFFER_TYPE_SHIFT | DEPTHFORMAT_D32_FLOAT << DEPTH_BUFFER_FORMAT_SHIFT); +#else + OUT_BATCH(SURFACE_2D << DEPTH_BUFFER_TYPE_SHIFT | + DEPTHFORMAT_D16_UNORM << DEPTH_BUFFER_FORMAT_SHIFT); +#endif OUT_BATCH64(0); OUT_BATCH(0); OUT_BATCH(0); @@ -761,6 +815,12 @@ { OUT_BATCH(GEN8_PIPELINE_SELECT | PIPELINE_SELECT_3D); +#if SIM + OUT_BATCH(GEN8_STATE_SIP | (3 - 2)); + OUT_BATCH64(0); + +#endif + OUT_BATCH(GEN8_3DSTATE_MULTISAMPLE | (2 - 2)); OUT_BATCH(MULTISAMPLE_PIXEL_LOCATION_CENTER | MULTISAMPLE_NUMSAMPLES_1); /* 1 sample/pixel */ @@ -769,11 +829,7 @@ OUT_BATCH(1); #if SIM - OUT_BATCH(GEN8_3DSTATE_SAMPLE_PATTERN | (9 - 2)); - OUT_BATCH(0); - OUT_BATCH(0); - OUT_BATCH(0); - OUT_BATCH(0); + OUT_BATCH(GEN8_3DSTATE_SAMPLE_PATTERN | (5 - 2)); OUT_BATCH(0); OUT_BATCH(0); OUT_BATCH(0); @@ -781,6 +837,7 @@ OUT_BATCH(0); #endif + gen8_emit_push_constants(sna); gen8_emit_urb(sna); gen8_emit_state_base_address(sna); @@ -1281,6 +1338,13 @@ } } +#define MOCS_WT (2 << 5) +#define MOCS_WB (3 << 5) +#define MOCS_eLLC_ONLY (0 << 3) +#define MOCS_LLC_ONLY (1 << 3) +#define MOCS_eLLC_LLC (2 << 3) +#define MOCS_ALL_CACHES (3 << 3) + /** * Sets up the common fields for a surface state buffer for the given * picture in the given surface state buffer. @@ -1318,7 +1382,7 @@ domains = I915_GEM_DOMAIN_RENDER << 16 |I915_GEM_DOMAIN_RENDER; } else domains = I915_GEM_DOMAIN_SAMPLER << 16; - ss[1] = (is_scanout || bo->io) ? 0 : 3 << 24; + ss[1] = (is_dst && is_uncached(sna, bo)) ? 0 : is_scanout ? (MOCS_WT | MOCS_ALL_CACHES) << 24 : (MOCS_WB | MOCS_ALL_CACHES) << 24; ss[2] = ((width - 1) << SURFACE_WIDTH_SHIFT | (height - 1) << SURFACE_HEIGHT_SHIFT); ss[3] = (bo->pitch - 1) << SURFACE_PITCH_SHIFT; @@ -1799,13 +1863,25 @@ y += dy + picture->pDrawable->y; channel->is_affine = sna_transform_is_affine(picture->transform); - if (sna_transform_is_integer_translation(picture->transform, &dx, &dy)) { + if (sna_transform_is_imprecise_integer_translation(picture->transform, picture->filter, precise, &dx, &dy)) { DBG(("%s: integer translation (%d, %d), removing\n", __FUNCTION__, dx, dy)); x += dx; y += dy; channel->transform = NULL; channel->filter = PictFilterNearest; + + if (channel->repeat || + (x >= 0 && + y >= 0 && + x + w < pixmap->drawable.width && + y + h < pixmap->drawable.height)) { + struct sna_pixmap *priv = sna_pixmap(pixmap); + if (priv && priv->clear) { + DBG(("%s: converting large pixmap source into solid [%08x]\n", __FUNCTION__, priv->clear_color)); + return gen4_channel_init_solid(sna, channel, priv->clear_color); + } + } } else channel->transform = picture->transform; @@ -1827,13 +1903,18 @@ x, y, w, h, dst_x, dst_y); } -static void gen8_composite_channel_convert(struct sna_composite_channel *channel) +inline static bool gen8_composite_channel_convert(struct sna_composite_channel *channel) { + if (unaligned(channel->bo, PICT_FORMAT_BPP(channel->pict_format))) + return false; + channel->repeat = gen8_repeat(channel->repeat); channel->filter = gen8_filter(channel->filter); if (channel->card_format == (unsigned)-1) channel->card_format = gen8_get_card_format(channel->pict_format); assert(channel->card_format != (unsigned)-1); + + return true; } static void gen8_render_composite_done(struct sna *sna, @@ -1852,7 +1933,7 @@ sna_render_composite_redirect_done(sna, op); } -static bool +inline static bool gen8_composite_set_target(struct sna *sna, struct sna_composite_op *op, PicturePtr dst, @@ -1862,7 +1943,7 @@ BoxRec box; unsigned int hint; - DBG(("%s: (%d, %d)x(%d, %d), partial?=%d\n", __FUNCTION__, x, y, w, h)); + DBG(("%s: (%d, %d)x(%d, %d), partial?=%d\n", __FUNCTION__, x, y, w, h, partial)); op->dst.pixmap = get_drawable_pixmap(dst->pDrawable); op->dst.format = dst->format; @@ -1880,7 +1961,7 @@ hint = PREFER_GPU | FORCE_GPU | RENDER_GPU; if (!partial) { - hint |= IGNORE_CPU; + hint |= IGNORE_DAMAGE; if (w == op->dst.width && h == op->dst.height) hint |= REPLACES; } @@ -1889,6 +1970,14 @@ if (op->dst.bo == NULL) return false; + if (unaligned(op->dst.bo, dst->pDrawable->bitsPerPixel)) + return false; + + if (hint & REPLACES) { + struct sna_pixmap *priv = sna_pixmap(op->dst.pixmap); + kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo); + } + get_drawable_deltas(dst->pDrawable, op->dst.pixmap, &op->dst.x, &op->dst.y); @@ -1928,17 +2017,20 @@ } bo = __sna_drawable_peek_bo(dst->pDrawable); - if (bo && bo->rq) + if (bo == NULL) + return true; + if (bo->rq) return RQ_IS_BLT(bo->rq); - if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, NULL, 0)) + if (sna_picture_is_solid(src, NULL) && can_switch_to_blt(sna, bo, 0)) return true; if (src->pDrawable) { bo = __sna_drawable_peek_bo(src->pDrawable); if (bo == NULL) return true; - else if (bo->rq) + + if (prefer_blt_bo(sna, bo)) return RQ_IS_BLT(bo->rq); } @@ -2202,7 +2294,7 @@ tmp->op = op; if (!gen8_composite_set_target(sna, tmp, dst, dst_x, dst_y, width, height, - flags & COMPOSITE_PARTIAL || op > PictOpSrc || dst->pCompositeClip->data)) + flags & COMPOSITE_PARTIAL || op > PictOpSrc)) goto fallback; switch (gen8_composite_picture(sna, src, &tmp->src, @@ -2219,13 +2311,16 @@ case 1: /* Did we just switch rings to prepare the source? */ if (mask == NULL && - prefer_blt_composite(sna, tmp) && + (prefer_blt_composite(sna, tmp) || + unaligned(tmp->src.bo, PICT_FORMAT_BPP(tmp->src.pict_format))) && sna_blt_composite__convert(sna, dst_x, dst_y, width, height, tmp)) return true; - gen8_composite_channel_convert(&tmp->src); + if (!gen8_composite_channel_convert(&tmp->src)) + goto cleanup_src; + break; } @@ -2270,7 +2365,8 @@ goto cleanup_src; /* fall through to fixup */ case 1: - gen8_composite_channel_convert(&tmp->mask); + if (!gen8_composite_channel_convert(&tmp->mask)) + goto cleanup_mask; break; } } @@ -2504,7 +2600,8 @@ goto cleanup_dst; /* fall through to fixup */ case 1: - gen8_composite_channel_convert(&tmp->base.src); + if (!gen8_composite_channel_convert(&tmp->base.src)) + goto cleanup_src; break; } tmp->base.mask.bo = NULL; @@ -2624,44 +2721,10 @@ return prefer_blt_bo(sna, src_bo) || prefer_blt_bo(sna, dst_bo); } -inline static void boxes_extents(const BoxRec *box, int n, BoxRec *extents) -{ - *extents = box[0]; - while (--n) { - box++; - - if (box->x1 < extents->x1) - extents->x1 = box->x1; - if (box->x2 > extents->x2) - extents->x2 = box->x2; - - if (box->y1 < extents->y1) - extents->y1 = box->y1; - if (box->y2 > extents->y2) - extents->y2 = box->y2; - } -} - -static inline bool -overlaps(struct sna *sna, - struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, - const BoxRec *box, int n, BoxRec *extents) -{ - if (src_bo != dst_bo) - return false; - - boxes_extents(box, n, extents); - return (extents->x2 + src_dx > extents->x1 + dst_dx && - extents->x1 + src_dx < extents->x2 + dst_dx && - extents->y2 + src_dy > extents->y1 + dst_dy && - extents->y1 + src_dy < extents->y2 + dst_dy); -} - static bool gen8_render_copy_boxes(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const DrawableRec *src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, + const DrawableRec *dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int n, unsigned flags) { struct sna_composite_op tmp; @@ -2673,21 +2736,23 @@ overlaps(sna, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - box, n, &extents))); + box, n, flags, &extents))); if (prefer_blt_copy(sna, src_bo, dst_bo, flags) && - sna_blt_compare_depth(&src->drawable, &dst->drawable) && + sna_blt_compare_depth(src, dst) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; - if (!(alu == GXcopy || alu == GXclear)) { + if (!(alu == GXcopy || alu == GXclear) || + unaligned(src_bo, src->bitsPerPixel) || + unaligned(dst_bo, dst->bitsPerPixel)) { fallback_blt: DBG(("%s: fallback blt\n", __FUNCTION__)); - if (!sna_blt_compare_depth(&src->drawable, &dst->drawable)) + if (!sna_blt_compare_depth(src, dst)) return false; return sna_blt_copy_boxes_fallback(sna, alu, @@ -2699,38 +2764,45 @@ if (overlaps(sna, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - box, n, &extents)) { - if (too_large(extents.x2-extents.x1, extents.y2-extents.y1)) - goto fallback_blt; + box, n, flags, + &extents)) { + bool big = too_large(extents.x2-extents.x1, extents.y2-extents.y1); - if (can_switch_to_blt(sna, dst_bo, flags) && - sna_blt_compare_depth(&src->drawable, &dst->drawable) && + if ((big || can_switch_to_blt(sna, dst_bo, flags)) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; + if (big) + goto fallback_blt; + + assert(src_bo == dst_bo); + assert(src->depth == dst->depth); + assert(src->width == dst->width); + assert(src->height == dst->height); return sna_render_copy_boxes__overlap(sna, alu, - src, src_bo, src_dx, src_dy, - dst, dst_bo, dst_dx, dst_dy, + src, src_bo, + src_dx, src_dy, + dst_dx, dst_dy, box, n, &extents); } - if (dst->drawable.depth == src->drawable.depth) { - tmp.dst.format = sna_render_format_for_depth(dst->drawable.depth); + if (dst->depth == src->depth) { + tmp.dst.format = sna_render_format_for_depth(dst->depth); tmp.src.pict_format = tmp.dst.format; } else { - tmp.dst.format = sna_format_for_depth(dst->drawable.depth); - tmp.src.pict_format = sna_format_for_depth(src->drawable.depth); + tmp.dst.format = sna_format_for_depth(dst->depth); + tmp.src.pict_format = sna_format_for_depth(src->depth); } if (!gen8_check_format(tmp.src.pict_format)) goto fallback_blt; - tmp.dst.pixmap = dst; - tmp.dst.width = dst->drawable.width; - tmp.dst.height = dst->drawable.height; + tmp.dst.pixmap = (PixmapPtr)dst; + tmp.dst.width = dst->width; + tmp.dst.height = dst->height; tmp.dst.bo = dst_bo; tmp.dst.x = tmp.dst.y = 0; tmp.damage = NULL; @@ -2759,15 +2831,10 @@ extents.y2 - extents.y1, n > 1)) goto fallback_tiled; - - dst_dx += tmp.dst.x; - dst_dy += tmp.dst.y; - - tmp.dst.x = tmp.dst.y = 0; } tmp.src.card_format = gen8_get_card_format(tmp.src.pict_format); - if (too_large(src->drawable.width, src->drawable.height)) { + if (too_large(src->width, src->height)) { int i; extents = box[0]; @@ -2789,13 +2856,11 @@ extents.x2 - extents.x1, extents.y2 - extents.y1)) goto fallback_tiled_dst; - - src_dx += tmp.src.offset[0]; - src_dy += tmp.src.offset[1]; } else { tmp.src.bo = src_bo; - tmp.src.width = src->drawable.width; - tmp.src.height = src->drawable.height; + tmp.src.width = src->width; + tmp.src.height = src->height; + tmp.src.offset[0] = tmp.src.offset[1] = 0; } tmp.mask.bo = NULL; @@ -2819,6 +2884,14 @@ _kgem_set_mode(&sna->kgem, KGEM_RENDER); } + src_dx += tmp.src.offset[0]; + src_dy += tmp.src.offset[1]; + + dst_dx += tmp.dst.x; + dst_dy += tmp.dst.y; + + tmp.dst.x = tmp.dst.y = 0; + gen8_align_vertex(sna, &tmp); gen8_emit_copy_state(sna, &tmp); @@ -2862,11 +2935,11 @@ kgem_bo_destroy(&sna->kgem, tmp.dst.bo); fallback_tiled: DBG(("%s: fallback tiled\n", __FUNCTION__)); - if (sna_blt_compare_depth(&src->drawable, &dst->drawable) && + if (sna_blt_compare_depth(src, dst) && sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n)) return true; @@ -2927,7 +3000,9 @@ if (!(alu == GXcopy || alu == GXclear) || src_bo == dst_bo || too_large(src->drawable.width, src->drawable.height) || - too_large(dst->drawable.width, dst->drawable.height)) { + too_large(dst->drawable.width, dst->drawable.height) || + unaligned(src_bo, src->drawable.bitsPerPixel) || + unaligned(dst_bo, dst->drawable.bitsPerPixel)) { fallback: if (!sna_blt_compare_depth(&src->drawable, &dst->drawable)) return false; @@ -3027,7 +3102,7 @@ CARD8 op, PictFormat format, const xRenderColor *color, - PixmapPtr dst, struct kgem_bo *dst_bo, + const DrawableRec *dst, struct kgem_bo *dst_bo, const BoxRec *box, int n) { struct sna_composite_op tmp; @@ -3044,7 +3119,8 @@ } if (prefer_blt_fill(sna, dst_bo, FILL_BOXES) || - !gen8_check_dst_format(format)) { + !gen8_check_dst_format(format) || + unaligned(dst_bo, PICT_FORMAT_BPP(format))) { uint8_t alu = GXinvalid; if (op <= PictOpSrc) { @@ -3062,7 +3138,7 @@ if (alu != GXinvalid && sna_blt_fill_boxes(sna, alu, - dst_bo, dst->drawable.bitsPerPixel, + dst_bo, dst->bitsPerPixel, pixel, box, n)) return true; @@ -3085,16 +3161,16 @@ __FUNCTION__, pixel, n, box[0].x1, box[0].y1, box[0].x2, box[0].y2)); - tmp.dst.pixmap = dst; - tmp.dst.width = dst->drawable.width; - tmp.dst.height = dst->drawable.height; + tmp.dst.pixmap = (PixmapPtr)dst; + tmp.dst.width = dst->width; + tmp.dst.height = dst->height; tmp.dst.format = format; tmp.dst.bo = dst_bo; tmp.dst.x = tmp.dst.y = 0; tmp.damage = NULL; sna_render_composite_redirect_init(&tmp); - if (too_large(dst->drawable.width, dst->drawable.height)) { + if (too_large(dst->width, dst->height)) { BoxRec extents; boxes_extents(box, n, &extents); @@ -3273,7 +3349,8 @@ return true; if (!(alu == GXcopy || alu == GXclear) || - too_large(dst->drawable.width, dst->drawable.height)) + too_large(dst->drawable.width, dst->drawable.height) || + unaligned(dst_bo, dst->drawable.bitsPerPixel)) return sna_blt_fill(sna, alu, dst_bo, dst->drawable.bitsPerPixel, color, @@ -3318,6 +3395,7 @@ op->blt = gen8_render_fill_op_blt; op->box = gen8_render_fill_op_box; op->boxes = gen8_render_fill_op_boxes; + op->points = NULL; op->done = gen8_render_fill_op_done; return true; } @@ -3358,7 +3436,8 @@ /* Must use the BLT if we can't RENDER... */ if (!(alu == GXcopy || alu == GXclear) || - too_large(dst->drawable.width, dst->drawable.height)) + too_large(dst->drawable.width, dst->drawable.height) || + unaligned(bo, dst->drawable.bitsPerPixel)) return gen8_render_fill_one_try_blt(sna, dst, bo, color, x1, y1, x2, y2, alu); @@ -3450,7 +3529,8 @@ return true; /* Must use the BLT if we can't RENDER... */ - if (too_large(dst->drawable.width, dst->drawable.height)) + if (too_large(dst->drawable.width, dst->drawable.height) || + unaligned(bo, dst->drawable.bitsPerPixel)) return gen8_render_clear_try_blt(sna, dst, bo); tmp.dst.pixmap = dst; @@ -3623,6 +3703,7 @@ PixmapPtr pixmap) { struct sna_composite_op tmp; + struct sna_pixmap *priv = sna_pixmap(pixmap); int dst_width = dstRegion->extents.x2 - dstRegion->extents.x1; int dst_height = dstRegion->extents.y2 - dstRegion->extents.y1; int src_width = frame->src.x2 - frame->src.x1; @@ -3630,22 +3711,21 @@ float src_offset_x, src_offset_y; float src_scale_x, src_scale_y; int nbox, pix_xoff, pix_yoff; - struct sna_pixmap *priv; unsigned filter; - BoxPtr box; + const BoxRec *box; - DBG(("%s: src=(%d, %d), dst=(%d, %d), %ldx[(%d, %d), (%d, %d)...]\n", + DBG(("%s: src=(%d, %d), dst=(%d, %d), %dx[(%d, %d), (%d, %d)...]\n", __FUNCTION__, src_width, src_height, dst_width, dst_height, - (long)REGION_NUM_RECTS(dstRegion), + region_num_rects(dstRegion), REGION_EXTENTS(NULL, dstRegion)->x1, REGION_EXTENTS(NULL, dstRegion)->y1, REGION_EXTENTS(NULL, dstRegion)->x2, REGION_EXTENTS(NULL, dstRegion)->y2)); - priv = sna_pixmap_force_to_gpu(pixmap, MOVE_READ | MOVE_WRITE); - if (priv == NULL) - return false; + assert(priv->gpu_bo); + assert(!too_large(pixmap->drawable.width, pixmap->drawable.height)); + assert(!unaligned(priv->gpu_bo, pixmap->drawable.bitsPerPixel)); memset(&tmp, 0, sizeof(tmp)); @@ -3715,8 +3795,8 @@ src_scale_x, src_scale_y, src_offset_x, src_offset_y)); - box = REGION_RECTS(dstRegion); - nbox = REGION_NUM_RECTS(dstRegion); + box = region_rects(dstRegion); + nbox = region_num_rects(dstRegion); while (nbox--) { BoxRec r; @@ -3805,6 +3885,12 @@ struct sna_static_stream general; struct gen8_sampler_state *ss; int i, j, k, l, m; + uint32_t devid; + + devid = intel_get_device_id(sna->scrn); + if (devid & 0xf) + state->gt = ((devid >> 4) & 0xf) + 1; + DBG(("%s: gt=%d\n", __FUNCTION__, state->gt)); sna_static_stream_init(&general); diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/kgem.c xserver-xorg-video-intel-2.99.914/src/sna/kgem.c --- xserver-xorg-video-intel-2.99.910/src/sna/kgem.c 2014-02-04 21:48:50.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/kgem.c 2014-07-17 20:26:45.000000000 +0000 @@ -61,8 +61,10 @@ search_snoop_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags); #define DBG_NO_HW 0 +#define DBG_NO_EXEC 0 #define DBG_NO_TILING 0 #define DBG_NO_CACHE 0 +#define DBG_NO_SNOOP_CACHE 0 #define DBG_NO_CACHE_LEVEL 0 #define DBG_NO_CPU 0 #define DBG_NO_CREATE2 0 @@ -81,6 +83,7 @@ #define DBG_NO_HANDLE_LUT 0 #define DBG_NO_WT 0 #define DBG_DUMP 0 +#define DBG_NO_MALLOC_CACHE 0 #define FORCE_MMAP_SYNC 0 /* ((1 << DOMAIN_CPU) | (1 << DOMAIN_GTT)) */ @@ -88,7 +91,8 @@ #define DEBUG_SYNC 0 #endif -#define SHOW_BATCH 0 +#define SHOW_BATCH_BEFORE 0 +#define SHOW_BATCH_AFTER 0 #if 0 #define ASSERT_IDLE(kgem__, handle__) assert(!__kgem_busy(kgem__, handle__)) @@ -102,8 +106,12 @@ * is being simultaneously being read by the GPU, or within the sampler * prefetch. In general, the chipsets seem to have a requirement that sampler * offsets be aligned to a cacheline (64 bytes). + * + * Actually, it turns out the BLT color pattern (BR15) has the most severe + * alignment restrictions, 64 bytes for 8-bpp, 128 bytes for 16-bpp and 256 + * bytes for 32-bpp. */ -#define UPLOAD_ALIGNMENT 128 +#define UPLOAD_ALIGNMENT 256 #define PAGE_ALIGN(x) ALIGN(x, PAGE_SIZE) #define NUM_PAGES(x) (((x) + PAGE_SIZE-1) / PAGE_SIZE) @@ -115,8 +123,6 @@ #define MAKE_USER_MAP(ptr) ((void*)((uintptr_t)(ptr) | 1)) #define IS_USER_MAP(ptr) ((uintptr_t)(ptr) & 1) -#define MAKE_REQUEST(rq, ring) ((struct kgem_request *)((uintptr_t)(rq) | (ring))) - #define LOCAL_I915_PARAM_HAS_BLT 11 #define LOCAL_I915_PARAM_HAS_RELAXED_FENCING 12 #define LOCAL_I915_PARAM_HAS_RELAXED_DELTA 15 @@ -131,7 +137,7 @@ #define LOCAL_I915_EXEC_NO_RELOC (1<<11) #define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) -#define LOCAL_I915_GEM_CREATE2 0x33 +#define LOCAL_I915_GEM_CREATE2 0x34 #define LOCAL_IOCTL_I915_GEM_CREATE2 DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_CREATE2, struct local_i915_gem_create2) struct local_i915_gem_create2 { uint64_t size; @@ -147,14 +153,14 @@ uint32_t handle; }; -#define LOCAL_I915_GEM_USERPTR 0x34 +#define LOCAL_I915_GEM_USERPTR 0x33 #define LOCAL_IOCTL_I915_GEM_USERPTR DRM_IOWR (DRM_COMMAND_BASE + LOCAL_I915_GEM_USERPTR, struct local_i915_gem_userptr) struct local_i915_gem_userptr { uint64_t user_ptr; uint64_t user_size; uint32_t flags; -#define I915_USERPTR_READ_ONLY (1<<0) -#define I915_USERPTR_UNSYNCHRONIZED (1<<31) +#define I915_USERPTR_READ_ONLY 0x1 +#define I915_USERPTR_UNSYNCHRONIZED 0x80000000 uint32_t handle; }; @@ -168,7 +174,9 @@ }; #define LOCAL_I915_GEM_SET_CACHING 0x2f +#define LOCAL_I915_GEM_GET_CACHING 0x30 #define LOCAL_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + LOCAL_I915_GEM_SET_CACHING, struct local_i915_gem_caching) +#define LOCAL_IOCTL_I915_GEM_GET_CACHING DRM_IOW(DRM_COMMAND_BASE + LOCAL_I915_GEM_GET_CACHING, struct local_i915_gem_caching) struct kgem_buffer { struct kgem_bo base; @@ -240,11 +248,25 @@ VG_CLEAR(tiling); tiling.handle = bo->handle; - tiling.tiling_mode = -1; + tiling.tiling_mode = bo->tiling; (void)do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_GET_TILING, &tiling); assert(tiling.tiling_mode == bo->tiling); } +static void assert_cacheing(struct kgem *kgem, struct kgem_bo *bo) +{ + struct local_i915_gem_caching arg; + int expect = kgem->has_llc ? SNOOPED : UNCACHED; + + VG_CLEAR(arg); + arg.handle = bo->handle; + arg.caching = expect; + + (void)do_ioctl(kgem->fd, LOCAL_IOCTL_I915_GEM_GET_CACHING, &arg); + + assert(arg.caching == expect); +} + static void assert_bo_retired(struct kgem_bo *bo) { DBG(("%s: handle=%d, domain: %d exec? %d, rq? %d\n", __FUNCTION__, @@ -254,9 +276,9 @@ assert(bo->exec == NULL); assert(list_is_empty(&bo->request)); } - #else #define assert_tiling(kgem, bo) +#define assert_cacheing(kgem, bo) #define assert_bo_retired(bo) #endif @@ -341,15 +363,29 @@ return arg.handle; } -static bool __kgem_throttle_retire(struct kgem *kgem, unsigned flags) +static bool __kgem_throttle(struct kgem *kgem, bool harder) { - if (flags & CREATE_NO_RETIRE) { - DBG(("%s: not retiring per-request\n", __FUNCTION__)); - return false; - } + /* Let this be woken up by sigtimer so that we don't block here + * too much and completely starve X. We will sleep again shortly, + * and so catch up or detect the hang. + */ + do { + if (ioctl(kgem->fd, DRM_IOCTL_I915_GEM_THROTTLE) == 0) { + kgem->need_throttle = 0; + return false; + } + + if (errno == EIO) + return true; + } while (harder); - if (!kgem->need_retire) { - DBG(("%s: nothing to retire\n", __FUNCTION__)); + return false; +} + +static bool __kgem_throttle_retire(struct kgem *kgem, unsigned flags) +{ + if (flags & CREATE_NO_RETIRE || !kgem->need_retire) { + DBG(("%s: not retiring\n", __FUNCTION__)); return false; } @@ -361,7 +397,7 @@ return false; } - kgem_throttle(kgem); + __kgem_throttle(kgem, false); return kgem_retire(kgem); } @@ -540,7 +576,6 @@ int err; assert(bo->refcnt); - assert(!bo->purged); assert(bo->proxy == NULL); ASSERT_IDLE(kgem, bo->handle); @@ -683,6 +718,8 @@ static struct kgem_bo *__kgem_bo_init(struct kgem_bo *bo, int handle, int num_pages) { + DBG(("%s(handle=%d, num_pages=%d)\n", __FUNCTION__, handle, num_pages)); + assert(num_pages); memset(bo, 0, sizeof(*bo)); @@ -739,8 +776,12 @@ static void __kgem_request_free(struct kgem_request *rq) { _list_del(&rq->list); - *(struct kgem_request **)rq = __kgem_freed_request; - __kgem_freed_request = rq; + if (DBG_NO_MALLOC_CACHE) { + free(rq); + } else { + *(struct kgem_request **)rq = __kgem_freed_request; + __kgem_freed_request = rq; + } } static struct list *inactive(struct kgem *kgem, int num_pages) @@ -801,11 +842,12 @@ unsigned int eax, ebx, ecx, edx; unsigned int llc_size = 0; - int cnt = 0; + int cnt; if (__get_cpuid_max(BASIC_CPUID, NULL) < 4) return 0; + cnt = 0; do { unsigned associativity, line_partitions, line_size, sets; @@ -933,18 +975,6 @@ return detected; } -static bool __kgem_throttle(struct kgem *kgem) -{ - /* Let this be woken up by sigtimer so that we don't block here - * too much and completely starve X. We will sleep again shortly, - * and so catch up or detect the hang. - */ - if (ioctl(kgem->fd, DRM_IOCTL_I915_GEM_THROTTLE) == 0) - return false; - - return errno == EIO; -} - static bool is_hw_supported(struct kgem *kgem, struct pci_device *dev) { @@ -1025,7 +1055,6 @@ static bool test_has_userptr(struct kgem *kgem) { -#if defined(USE_USERPTR) uint32_t handle; void *ptr; @@ -1036,6 +1065,9 @@ if (kgem->gen == 040) return false; + if (kgem->gen >= 0100) + return false; /* FIXME https://bugs.freedesktop.org/show_bug.cgi?id=79053 */ + if (posix_memalign(&ptr, PAGE_SIZE, PAGE_SIZE)) return false; @@ -1044,9 +1076,6 @@ free(ptr); return handle != 0; -#else - return false; -#endif } static bool test_has_create2(struct kgem *kgem) @@ -1323,7 +1352,7 @@ xf86DrvMsg(kgem_get_screen_index(kgem), X_WARNING, "Detected unsupported/dysfunctional hardware, disabling acceleration.\n"); kgem->wedged = 1; - } else if (__kgem_throttle(kgem)) { + } else if (__kgem_throttle(kgem, false)) { xf86DrvMsg(kgem_get_screen_index(kgem), X_WARNING, "Detected a hung GPU, disabling acceleration.\n"); kgem->wedged = 1; @@ -1497,7 +1526,7 @@ } /* XXX hopefully a good approximation */ -uint32_t kgem_get_unique_id(struct kgem *kgem) +static uint32_t kgem_get_unique_id(struct kgem *kgem) { uint32_t id; id = ++kgem->unique_id; @@ -1578,16 +1607,16 @@ if (tiling) { if (kgem->gen < 030) { tile_width = 128; - tile_height = 32; + tile_height = 16; } else { tile_width = 512; - tile_height = 16; + tile_height = 8; } } else { tile_width = 2 * bpp >> 3; tile_width = ALIGN(tile_width, kgem_pitch_alignment(kgem, flags)); - tile_height = 2; + tile_height = 1; } } else switch (tiling) { default: @@ -1595,22 +1624,27 @@ tile_width = 2 * bpp >> 3; tile_width = ALIGN(tile_width, kgem_pitch_alignment(kgem, flags)); - tile_height = 2; + tile_height = 1; break; - /* XXX align to an even tile row */ case I915_TILING_X: tile_width = 512; - tile_height = 16; + tile_height = 8; break; case I915_TILING_Y: tile_width = 128; - tile_height = 64; + tile_height = 32; break; } + /* XXX align to an even tile row */ + if (!kgem->has_relaxed_fencing) + tile_height *= 2; *pitch = ALIGN(width * bpp / 8, tile_width); height = ALIGN(height, tile_height); + DBG(("%s: tile_width=%d, tile_height=%d => aligned pitch=%d, height=%d\n", + __FUNCTION__, tile_width, tile_height, *pitch, height)); + if (kgem->gen >= 040) return PAGE_ALIGN(*pitch * height); @@ -1641,13 +1675,54 @@ return tile_width; } +bool kgem_check_surface_size(struct kgem *kgem, + uint32_t width, + uint32_t height, + uint32_t bpp, + uint32_t tiling, + uint32_t pitch, + uint32_t size) +{ + uint32_t min_size, min_pitch; + int tile_width, tile_height, tile_size; + + DBG(("%s(width=%d, height=%d, bpp=%d, tiling=%d, pitch=%d, size=%d)\n", + __FUNCTION__, width, height, bpp, tiling, pitch, size)); + + if (pitch & 3) + return false; + + min_size = kgem_surface_size(kgem, kgem->has_relaxed_fencing, 0, + width, height, bpp, tiling, + &min_pitch); + + DBG(("%s: min_pitch=%d, min_size=%d\n", __FUNCTION__, min_pitch, min_size)); + + if (size < min_size) + return false; + + if (pitch < min_pitch) + return false; + + kgem_get_tile_size(kgem, tiling, min_pitch, + &tile_width, &tile_height, &tile_size); + + DBG(("%s: tile_width=%d, tile_size=%d\n", __FUNCTION__, tile_width, tile_size)); + if (pitch & (tile_width - 1)) + return false; + if (size & (tile_size - 1)) + return false; + + return true; +} + static uint32_t kgem_aligned_height(struct kgem *kgem, uint32_t height, uint32_t tiling) { uint32_t tile_height; if (kgem->gen <= 030) { - tile_height = tiling ? kgem->gen < 030 ? 32 : 16 : 1; + tile_height = tiling ? kgem->gen < 030 ? 16 : 8 : 1; } else switch (tiling) { /* XXX align to an even tile row */ default: @@ -1655,13 +1730,17 @@ tile_height = 1; break; case I915_TILING_X: - tile_height = 16; + tile_height = 8; break; case I915_TILING_Y: - tile_height = 64; + tile_height = 32; break; } + /* XXX align to an even tile row */ + if (!kgem->has_relaxed_fencing) + tile_height *= 2; + return ALIGN(height, tile_height); } @@ -1737,7 +1816,6 @@ } } - } static void kgem_bo_binding_free(struct kgem *kgem, struct kgem_bo *bo) @@ -1752,9 +1830,20 @@ } } +static void kgem_bo_rmfb(struct kgem *kgem, struct kgem_bo *bo) +{ + if (bo->scanout && bo->delta) { + DBG(("%s: releasing fb=%d for handle=%d\n", + __FUNCTION__, bo->delta, bo->handle)); + /* XXX will leak if we are not DRM_MASTER. *shrug* */ + do_ioctl(kgem->fd, DRM_IOCTL_MODE_RMFB, &bo->delta); + bo->delta = 0; + } +} + static void kgem_bo_free(struct kgem *kgem, struct kgem_bo *bo) { - DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle)); + DBG(("%s: handle=%d, size=%d\n", __FUNCTION__, bo->handle, bytes(bo))); assert(bo->refcnt == 0); assert(bo->proxy == NULL); assert(bo->exec == NULL); @@ -1766,6 +1855,7 @@ #endif kgem_bo_binding_free(kgem, bo); + kgem_bo_rmfb(kgem, bo); if (IS_USER_MAP(bo->map__cpu)) { assert(bo->rq == NULL); @@ -1797,7 +1887,7 @@ _list_del(&bo->request); gem_close(kgem->fd, bo->handle); - if (!bo->io) { + if (!bo->io && !DBG_NO_MALLOC_CACHE) { *(struct kgem_bo **)bo = __kgem_freed_bo; __kgem_freed_bo = bo; } else @@ -1822,10 +1912,9 @@ assert(!bo->needs_flush); assert(list_is_empty(&bo->vma)); assert_tiling(kgem, bo); + assert_cacheing(kgem, bo); ASSERT_IDLE(kgem, bo->handle); - kgem->need_expire = true; - if (bucket(bo) >= NUM_CACHE_BUCKETS) { if (bo->map__gtt) { munmap(MAP(bo->map__gtt), bytes(bo)); @@ -1851,6 +1940,8 @@ kgem->vma[1].count++; } } + + kgem->need_expire = true; } static struct kgem_bo *kgem_bo_replace_io(struct kgem_bo *bo) @@ -1954,7 +2045,6 @@ { assert(bo->refcnt == 0); assert(bo->scanout); - assert(bo->delta); assert(!bo->flush); assert(!bo->snoop); assert(!bo->io); @@ -1974,16 +2064,25 @@ list_move_tail(&bo->list, &kgem->scanout); else list_move(&bo->list, &kgem->scanout); + + kgem->need_expire = true; + } static void kgem_bo_move_to_snoop(struct kgem *kgem, struct kgem_bo *bo) { assert(bo->reusable); + assert(!bo->scanout); assert(!bo->flush); assert(!bo->needs_flush); assert(bo->refcnt == 0); assert(bo->exec == NULL); + if (DBG_NO_SNOOP_CACHE) { + kgem_bo_free(kgem, bo); + return; + } + if (num_pages(bo) > kgem->max_cpu_size >> 13) { DBG(("%s handle=%d discarding large CPU buffer (%d >%d pages)\n", __FUNCTION__, bo->handle, num_pages(bo), kgem->max_cpu_size >> 13)); @@ -1996,6 +2095,31 @@ DBG(("%s: moving %d to snoop cachee\n", __FUNCTION__, bo->handle)); list_add(&bo->list, &kgem->snoop); + kgem->need_expire = true; +} + +static bool kgem_bo_move_to_cache(struct kgem *kgem, struct kgem_bo *bo) +{ + bool retired = false; + + DBG(("%s: release handle=%d\n", __FUNCTION__, bo->handle)); + + if (bo->prime) { + DBG(("%s: discarding imported prime handle=%d\n", + __FUNCTION__, bo->handle)); + kgem_bo_free(kgem, bo); + } else if (bo->snoop) { + kgem_bo_move_to_snoop(kgem, bo); + } else if (bo->scanout) { + kgem_bo_move_to_scanout(kgem, bo); + } else if ((bo = kgem_bo_replace_io(bo))->reusable && + kgem_bo_set_purgeable(kgem, bo)) { + kgem_bo_move_to_inactive(kgem, bo); + retired = true; + } else + kgem_bo_free(kgem, bo); + + return retired; } static struct kgem_bo * @@ -2079,14 +2203,54 @@ assert(bo->exec == NULL); } +void kgem_bo_pair_undo(struct kgem *kgem, struct kgem_bo *a, struct kgem_bo *b) +{ + if (kgem->nexec > 2) + return; + + if (kgem->nexec == 1) { + if (a) + kgem_bo_undo(kgem, a); + if (b) + kgem_bo_undo(kgem, b); + return; + } + + if (a == NULL || b == NULL) + return; + if (a->exec == NULL || b->exec == NULL) + return; + + DBG(("%s: only handles in batch, discarding last operations for handle=%d and handle=%d\n", + __FUNCTION__, a->handle, b->handle)); + + assert(a->exec == &kgem->exec[0] || a->exec == &kgem->exec[1]); + assert(a->handle == kgem->exec[0].handle || a->handle == kgem->exec[1].handle); + assert(RQ(a->rq) == kgem->next_request); + assert(b->exec == &kgem->exec[0] || b->exec == &kgem->exec[1]); + assert(b->handle == kgem->exec[0].handle || b->handle == kgem->exec[1].handle); + assert(RQ(b->rq) == kgem->next_request); + + a->refcnt++; + b->refcnt++; + kgem_reset(kgem); + b->refcnt--; + a->refcnt--; + + assert(kgem->nreloc == 0); + assert(kgem->nexec == 0); + assert(a->exec == NULL); + assert(b->exec == NULL); +} + static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo) { - DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle)); + DBG(("%s: handle=%d, size=%d\n", __FUNCTION__, bo->handle, bytes(bo))); assert(list_is_empty(&bo->list)); assert(bo->refcnt == 0); - assert(!bo->purged || !bo->reusable); assert(bo->proxy == NULL); + assert(bo->active_scanout == 0); assert_tiling(kgem, bo); bo->binding.offset = 0; @@ -2094,6 +2258,9 @@ if (DBG_NO_CACHE) goto destroy; + if (bo->prime) + goto destroy; + if (bo->snoop && !bo->flush) { DBG(("%s: handle=%d is snooped\n", __FUNCTION__, bo->handle)); assert(bo->reusable); @@ -2126,6 +2293,7 @@ assert(bo->snoop == false); assert(bo->io == false); assert(bo->scanout == false); + assert_cacheing(kgem, bo); kgem_bo_undo(kgem, bo); assert(bo->refcnt == 0); @@ -2193,10 +2361,8 @@ } } -static bool kgem_retire__buffers(struct kgem *kgem) +void kgem_retire__buffers(struct kgem *kgem) { - bool retired = false; - while (!list_is_empty(&kgem->active_buffers)) { struct kgem_buffer *bo = list_last_entry(&kgem->active_buffers, @@ -2215,10 +2381,7 @@ list_del(&bo->base.list); kgem_buffer_release(kgem, bo); kgem_bo_unref(kgem, &bo->base); - retired = true; } - - return retired; } static bool kgem_retire__flushing(struct kgem *kgem) @@ -2238,16 +2401,7 @@ if (bo->refcnt) continue; - if (bo->snoop) { - kgem_bo_move_to_snoop(kgem, bo); - } else if (bo->scanout) { - kgem_bo_move_to_scanout(kgem, bo); - } else if ((bo = kgem_bo_replace_io(bo))->reusable && - kgem_bo_set_purgeable(kgem, bo)) { - kgem_bo_move_to_inactive(kgem, bo); - retired = true; - } else - kgem_bo_free(kgem, bo); + retired |= kgem_bo_move_to_cache(kgem, bo); } #if HAS_DEBUG_FULL { @@ -2263,13 +2417,13 @@ return retired; } - static bool __kgem_retire_rq(struct kgem *kgem, struct kgem_request *rq) { bool retired = false; DBG(("%s: request %d complete\n", __FUNCTION__, rq->bo->handle)); + assert(RQ(rq->bo->rq) == rq); while (!list_is_empty(&rq->buffers)) { struct kgem_bo *bo; @@ -2300,24 +2454,13 @@ if (bo->refcnt) continue; - if (bo->snoop) { - kgem_bo_move_to_snoop(kgem, bo); - } else if (bo->scanout) { - kgem_bo_move_to_scanout(kgem, bo); - } else if ((bo = kgem_bo_replace_io(bo))->reusable && - kgem_bo_set_purgeable(kgem, bo)) { - kgem_bo_move_to_inactive(kgem, bo); - retired = true; - } else { - DBG(("%s: closing %d\n", - __FUNCTION__, bo->handle)); - kgem_bo_free(kgem, bo); - } + retired |= kgem_bo_move_to_cache(kgem, bo); } assert(rq->bo->rq == NULL); assert(rq->bo->exec == NULL); assert(list_is_empty(&rq->bo->request)); + assert(rq->bo->refcnt > 0); if (--rq->bo->refcnt == 0) { if (kgem_bo_set_purgeable(kgem, rq->bo)) { @@ -2344,6 +2487,7 @@ rq = list_first_entry(&kgem->requests[ring], struct kgem_request, list); + assert(rq->ring == ring); if (__kgem_busy(kgem, rq->bo->handle)) break; @@ -2395,7 +2539,6 @@ retired |= kgem_retire__flushing(kgem); retired |= kgem_retire__requests(kgem); - retired |= kgem_retire__buffers(kgem); DBG(("%s -- retired=%d, need_retire=%d\n", __FUNCTION__, retired, kgem->need_retire)); @@ -2414,6 +2557,7 @@ rq = list_last_entry(&kgem->requests[ring], struct kgem_request, list); + assert(rq->ring == ring); if (__kgem_busy(kgem, rq->bo->handle)) { DBG(("%s: last requests handle=%d still busy\n", __FUNCTION__, rq->bo->handle)); @@ -2424,12 +2568,34 @@ __FUNCTION__, ring, rq->bo->handle)); kgem_retire__requests_ring(kgem, ring); - kgem_retire__buffers(kgem); assert(list_is_empty(&kgem->requests[ring])); return true; } +#if 0 +static void kgem_commit__check_reloc(struct kgem *kgem) +{ + struct kgem_request *rq = kgem->next_request; + struct kgem_bo *bo; + bool has_64bit = kgem->gen >= 0100; + int i; + + for (i = 0; i < kgem->nreloc; i++) { + list_for_each_entry(bo, &rq->buffers, request) { + if (bo->target_handle == kgem->reloc[i].target_handle) { + uint64_t value = 0; + gem_read(kgem->fd, rq->bo->handle, &value, kgem->reloc[i].offset, has_64bit ? 8 : 4); + assert(bo->exec->offset == -1 || value == bo->exec->offset + (int)kgem->reloc[i].delta); + break; + } + } + } +} +#else +#define kgem_commit__check_reloc(kgem) +#endif + #ifndef NDEBUG static void kgem_commit__check_buffers(struct kgem *kgem) { @@ -2447,6 +2613,8 @@ struct kgem_request *rq = kgem->next_request; struct kgem_bo *bo, *next; + kgem_commit__check_reloc(kgem); + list_for_each_entry_safe(bo, next, &rq->buffers, request) { assert(next->request.prev == &bo->request); @@ -2479,7 +2647,7 @@ __kgem_bo_clear_busy(bo); } - kgem->scanout_busy |= bo->scanout; + kgem->scanout_busy |= bo->scanout && bo->needs_flush; } if (rq == &kgem->static_request) { @@ -2504,6 +2672,7 @@ gem_close(kgem->fd, rq->bo->handle); kgem_cleanup_cache(kgem); } else { + assert(rq->ring < ARRAY_SIZE(kgem->requests)); list_add_tail(&rq->list, &kgem->requests[rq->ring]); kgem->need_throttle = kgem->need_retire = 1; } @@ -2715,6 +2884,7 @@ rq = list_first_entry(&kgem->requests[n], struct kgem_request, list); + assert(rq->ring == n); while (!list_is_empty(&rq->buffers)) { struct kgem_bo *bo; @@ -2742,6 +2912,14 @@ ASSERT_IDLE(kgem, handle); +#if DBG_NO_EXEC + { + uint32_t batch[] = { MI_BATCH_BUFFER_END, 0}; + return gem_write(kgem->fd, handle, 0, sizeof(batch), batch); + } +#endif + + retry: /* If there is no surface data, just upload the batch */ if (kgem->surface == kgem->batch_size) { @@ -2825,18 +3003,7 @@ if (bo->refcnt || bo->rq) continue; - if (bo->snoop) { - kgem_bo_move_to_snoop(kgem, bo); - } else if (bo->scanout) { - kgem_bo_move_to_scanout(kgem, bo); - } else if ((bo = kgem_bo_replace_io(bo))->reusable && - kgem_bo_set_purgeable(kgem, bo)) { - kgem_bo_move_to_inactive(kgem, bo); - } else { - DBG(("%s: closing %d\n", - __FUNCTION__, bo->handle)); - kgem_bo_free(kgem, bo); - } + kgem_bo_move_to_cache(kgem, bo); } if (rq != &kgem->static_request) { @@ -2855,6 +3022,8 @@ kgem->nbatch = 0; kgem->surface = kgem->batch_size; kgem->mode = KGEM_NONE; + kgem->needs_semaphore = false; + kgem->needs_reservation = false; kgem->flush = 0; kgem->batch_flags = kgem->batch_flags_base; @@ -2868,7 +3037,7 @@ int size, shrink, n; if (!kgem->has_relaxed_delta) - return kgem->batch_size; + return kgem->batch_size * sizeof(uint32_t); /* See if we can pack the contents into one or two pages */ n = ALIGN(kgem->batch_size, 1024); @@ -2905,12 +3074,12 @@ list); if (!bo->rq) { out_4096: + assert(bo->refcnt > 0); list_move_tail(&bo->list, &kgem->pinned_batches[0]); return kgem_bo_reference(bo); } if (!__kgem_busy(kgem, bo->handle)) { - assert(RQ(bo->rq)->bo == bo); __kgem_retire_rq(kgem, RQ(bo->rq)); goto out_4096; } @@ -2922,40 +3091,44 @@ list); if (!bo->rq) { out_16384: + assert(bo->refcnt > 0); list_move_tail(&bo->list, &kgem->pinned_batches[1]); return kgem_bo_reference(bo); } if (!__kgem_busy(kgem, bo->handle)) { - assert(RQ(bo->rq)->bo == bo); __kgem_retire_rq(kgem, RQ(bo->rq)); goto out_16384; } } - if (kgem->gen == 020 && !kgem->has_pinned_batches) { - assert(size <= 16384); + if (kgem->gen == 020) { + bo = kgem_create_linear(kgem, size, CREATE_CACHED | CREATE_TEMPORARY); + if (bo) + return bo; - bo = list_first_entry(&kgem->pinned_batches[size > 4096], - struct kgem_bo, - list); - list_move_tail(&bo->list, &kgem->pinned_batches[size > 4096]); + if (size < 16384) { + bo = list_first_entry(&kgem->pinned_batches[size > 4096], + struct kgem_bo, + list); + list_move_tail(&bo->list, &kgem->pinned_batches[size > 4096]); - DBG(("%s: syncing due to busy batches\n", __FUNCTION__)); + DBG(("%s: syncing due to busy batches\n", __FUNCTION__)); - VG_CLEAR(set_domain); - set_domain.handle = bo->handle; - set_domain.read_domains = I915_GEM_DOMAIN_GTT; - set_domain.write_domain = I915_GEM_DOMAIN_GTT; - if (do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain)) { - DBG(("%s: sync: GPU hang detected\n", __FUNCTION__)); - kgem_throttle(kgem); - return NULL; - } + VG_CLEAR(set_domain); + set_domain.handle = bo->handle; + set_domain.read_domains = I915_GEM_DOMAIN_GTT; + set_domain.write_domain = I915_GEM_DOMAIN_GTT; + if (do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain)) { + DBG(("%s: sync: GPU hang detected\n", __FUNCTION__)); + kgem_throttle(kgem); + return NULL; + } - kgem_retire(kgem); - assert(bo->rq == NULL); - return kgem_bo_reference(bo); + kgem_retire(kgem); + assert(bo->rq == NULL); + return kgem_bo_reference(bo); + } } return kgem_create_linear(kgem, size, CREATE_NO_THROTTLE); @@ -3008,6 +3181,26 @@ } #endif +static int do_execbuf(struct kgem *kgem, struct drm_i915_gem_execbuffer2 *execbuf) +{ + int ret; + +retry: + ret = do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, execbuf); + if (ret == 0) + return 0; + + DBG(("%s: failed ret=%d, throttling and discarding cache\n", __FUNCTION__, ret)); + (void)__kgem_throttle_retire(kgem, 0); + if (kgem_expire_cache(kgem)) + goto retry; + + if (kgem_cleanup_cache(kgem)) + goto retry; + + return ret; +} + void _kgem_submit(struct kgem *kgem) { struct kgem_request *rq; @@ -3037,7 +3230,7 @@ kgem_finish_buffers(kgem); -#if SHOW_BATCH +#if SHOW_BATCH_BEFORE __kgem_batch_debug(kgem, batch_end); #endif @@ -3073,7 +3266,7 @@ if (kgem_batch_write(kgem, handle, size) == 0) { struct drm_i915_gem_execbuffer2 execbuf; - int ret, retry = 3; + int ret; memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = (uintptr_t)kgem->exec; @@ -3091,15 +3284,7 @@ } } - ret = do_ioctl(kgem->fd, - DRM_IOCTL_I915_GEM_EXECBUFFER2, - &execbuf); - while (ret == -EBUSY && retry--) { - __kgem_throttle(kgem); - ret = do_ioctl(kgem->fd, - DRM_IOCTL_I915_GEM_EXECBUFFER2, - &execbuf); - } + ret = do_execbuf(kgem, &execbuf); if (DEBUG_SYNC && ret == 0) { struct drm_i915_gem_set_domain set_domain; @@ -3169,7 +3354,8 @@ if (DEBUG_SYNC) { int fd = open("/tmp/batchbuffer", O_WRONLY | O_CREAT | O_APPEND, 0666); if (fd != -1) { - write(fd, kgem->batch, batch_end*sizeof(uint32_t)); + int ignored = write(fd, kgem->batch, batch_end*sizeof(uint32_t)); + assert(ignored == batch_end*sizeof(uint32_t)); close(fd); } @@ -3179,6 +3365,10 @@ } } } +#if SHOW_BATCH_AFTER + if (gem_read(kgem->fd, rq->bo->handle, kgem->batch, 0, batch_end*sizeof(uint32_t) == 0)) + __kgem_batch_debug(kgem, batch_end); +#endif kgem_commit(kgem); if (kgem->wedged) kgem_cleanup(kgem); @@ -3214,11 +3404,10 @@ void kgem_throttle(struct kgem *kgem) { - kgem->need_throttle = 0; if (kgem->wedged) return; - kgem->wedged = __kgem_throttle(kgem); + kgem->wedged = __kgem_throttle(kgem, true); if (kgem->wedged) { char path[128]; @@ -3230,6 +3419,8 @@ xf86DrvMsg(kgem_get_screen_index(kgem), X_ERROR, "When reporting this, please include %s and the full dmesg.\n", path); + + kgem->need_throttle = false; } } @@ -3259,8 +3450,8 @@ bo = list_first_entry(&kgem->scanout, struct kgem_bo, list); assert(bo->scanout); - assert(bo->delta); assert(!bo->refcnt); + assert(!bo->prime); assert(bo->proxy == NULL); if (bo->exec || __kgem_busy(kgem, bo->handle)) @@ -3270,9 +3461,7 @@ __FUNCTION__, bo->handle, bo->delta, bo->reusable)); list_del(&bo->list); - /* XXX will leak if we are not DRM_MASTER. *shrug* */ - do_ioctl(kgem->fd, DRM_IOCTL_MODE_RMFB, &bo->delta); - bo->delta = 0; + kgem_bo_rmfb(kgem, bo); bo->scanout = false; if (!bo->purged) { @@ -3362,9 +3551,11 @@ if (kgem->need_purge) kgem_purge_cache(kgem); - expire = 0; + if (kgem->need_retire) + kgem_retire(kgem); - idle = !kgem->need_retire; + expire = 0; + idle = true; for (i = 0; i < ARRAY_SIZE(kgem->inactive); i++) { idle &= list_is_empty(&kgem->inactive[i]); list_for_each_entry(bo, &kgem->inactive[i], list) { @@ -3376,15 +3567,13 @@ bo->delta = now; } } - if (idle) { - DBG(("%s: idle\n", __FUNCTION__)); - kgem->need_expire = false; + if (expire == 0) { + DBG(("%s: idle? %d\n", __FUNCTION__, idle)); + kgem->need_expire = !idle; return false; } - if (expire == 0) - return true; - idle = !kgem->need_retire; + idle = true; for (i = 0; i < ARRAY_SIZE(kgem->inactive); i++) { struct list preserve; @@ -3433,7 +3622,7 @@ __FUNCTION__, count, size, idle)); kgem->need_expire = !idle; - return !idle; + return count; (void)count; (void)size; } @@ -3755,6 +3944,7 @@ struct kgem_bo *kgem_create_for_name(struct kgem *kgem, uint32_t name) { struct drm_gem_open open_arg; + struct drm_i915_gem_get_tiling tiling; struct kgem_bo *bo; DBG(("%s(name=%d)\n", __FUNCTION__, name)); @@ -3765,15 +3955,28 @@ return NULL; DBG(("%s: new handle=%d\n", __FUNCTION__, open_arg.handle)); + + VG_CLEAR(tiling); + tiling.handle = open_arg.handle; + if (do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_GET_TILING, &tiling)) { + DBG(("%s(name=%d) get-tiling failed, ret=%d\n", __FUNCTION__, name, errno)); + gem_close(kgem->fd, open_arg.handle); + return NULL; + } + + DBG(("%s: handle=%d, tiling=%d\n", __FUNCTION__, tiling.handle, tiling.tiling_mode)); + bo = __kgem_bo_alloc(open_arg.handle, open_arg.size / PAGE_SIZE); if (bo == NULL) { gem_close(kgem->fd, open_arg.handle); return NULL; } + bo->unique_id = kgem_get_unique_id(kgem); + bo->tiling = tiling.tiling_mode; bo->reusable = false; - bo->flush = true; - bo->purged = true; /* no coherency guarrantees */ + bo->prime = true; + bo->purged = true; /* no coherency guarantees */ debug_alloc__bo(kgem, bo); return bo; @@ -3784,6 +3987,7 @@ #ifdef DRM_IOCTL_PRIME_FD_TO_HANDLE struct drm_prime_handle args; struct drm_i915_gem_get_tiling tiling; + struct local_i915_gem_caching caching; struct kgem_bo *bo; off_t seek; @@ -3807,8 +4011,16 @@ /* Query actual size, overriding specified if available */ seek = lseek(args.fd, 0, SEEK_END); - if (seek != -1) + DBG(("%s: estimated size=%ld, actual=%lld\n", + __FUNCTION__, (long)size, (long long)seek)); + if (seek != -1) { + if (size > seek) { + DBG(("%s(name=%d) estimated required size [%d] is larger than actual [%ld]\n", __FUNCTION__, name, size, (long)seek)); + gem_close(kgem->fd, args.handle); + return NULL; + } size = seek; + } DBG(("%s: new handle=%d, tiling=%d\n", __FUNCTION__, args.handle, tiling.tiling_mode)); @@ -3818,10 +4030,46 @@ return NULL; } + bo->unique_id = kgem_get_unique_id(kgem); bo->tiling = tiling.tiling_mode; bo->reusable = false; + bo->prime = true; bo->domain = DOMAIN_NONE; + /* is this a special bo (e.g. scanout or CPU coherent)? */ + + VG_CLEAR(caching); + caching.handle = args.handle; + caching.caching = kgem->has_llc; + (void)drmIoctl(kgem->fd, LOCAL_IOCTL_I915_GEM_GET_CACHING, &caching); + DBG(("%s: imported handle=%d has caching %d\n", __FUNCTION__, args.handle, caching.caching)); + switch (caching.caching) { + case 0: + if (kgem->has_llc) { + DBG(("%s: interpreting handle=%d as a foreign scanout\n", + __FUNCTION__, args.handle)); + bo->scanout = true; + } + break; + case 1: + if (!kgem->has_llc) { + DBG(("%s: interpreting handle=%d as a foreign snooped buffer\n", + __FUNCTION__, args.handle)); + bo->snoop = true; + if (bo->tiling) { + DBG(("%s: illegal snooped tiled buffer\n", __FUNCTION__)); + kgem_bo_free(kgem, bo); + return NULL; + } + } + break; + case 2: + DBG(("%s: interpreting handle=%d as a foreign scanout\n", + __FUNCTION__, args.handle)); + bo->scanout = true; + break; + } + debug_alloc__bo(kgem, bo); return bo; #else @@ -3949,13 +4197,13 @@ goto done; } - if (tiling == I915_TILING_X && width * bpp <= 8*512/2) { + if (tiling == I915_TILING_X && width * bpp <= 8*512) { DBG(("%s: too thin [width %d, %d bpp] for TILING_X\n", __FUNCTION__, width, bpp)); tiling = I915_TILING_NONE; goto done; } - if (tiling == I915_TILING_Y && width * bpp <= 8*128/2) { + if (tiling == I915_TILING_Y && width * bpp < 8*128) { DBG(("%s: too thin [%d] for TILING_Y\n", __FUNCTION__, width)); tiling = I915_TILING_NONE; @@ -4025,7 +4273,7 @@ if (size > 0) { if (size <= kgem->max_cpu_size) flags |= KGEM_CAN_CREATE_CPU; - if (size <= kgem->max_gpu_size) + if (size > 4096 && size <= kgem->max_gpu_size) flags |= KGEM_CAN_CREATE_GPU; if (size <= PAGE_SIZE*kgem->aperture_mappable/4) flags |= KGEM_CAN_CREATE_GTT; @@ -4047,8 +4295,6 @@ DBG(("%s: tiled[%d] size=%d\n", __FUNCTION__, tiling, size)); if (size > 0 && size <= kgem->max_gpu_size) flags |= KGEM_CAN_CREATE_GPU; - if (size > kgem->max_gpu_size) - flags &= ~KGEM_CAN_CREATE_GPU; if (size > 0 && size <= PAGE_SIZE*kgem->aperture_mappable/4) flags |= KGEM_CAN_CREATE_GTT; if (size > PAGE_SIZE*kgem->aperture_mappable/4) @@ -4142,6 +4388,56 @@ return bo; } +static void __kgem_bo_make_scanout(struct kgem *kgem, + struct kgem_bo *bo, + int width, int height) +{ + ScrnInfoPtr scrn = + container_of(kgem, struct sna, kgem)->scrn; + struct drm_mode_fb_cmd arg; + + assert(bo->proxy == NULL); + + if (!scrn->vtSema) + return; + + DBG(("%s: create fb %dx%d@%d/%d\n", + __FUNCTION__, width, height, scrn->depth, scrn->bitsPerPixel)); + + VG_CLEAR(arg); + arg.width = width; + arg.height = height; + arg.pitch = bo->pitch; + arg.bpp = scrn->bitsPerPixel; + arg.depth = scrn->depth; + arg.handle = bo->handle; + + /* First move the scanout out of cached memory */ + if (kgem->has_llc) { + if (!gem_set_caching(kgem->fd, bo->handle, DISPLAY) && + !gem_set_caching(kgem->fd, bo->handle, UNCACHED)) + return; + } + + bo->scanout = true; + + /* Then pre-emptively move the object into the mappable + * portion to avoid rebinding later when busy. + */ + if (bo->map__gtt == NULL) + bo->map__gtt = __kgem_bo_map__gtt(kgem, bo); + if (bo->map__gtt) { + *(uint32_t *)bo->map__gtt = 0; + bo->domain = DOMAIN_GTT; + } + + if (do_ioctl(kgem->fd, DRM_IOCTL_MODE_ADDFB, &arg) == 0) { + DBG(("%s: attached fb=%d to handle=%d\n", + __FUNCTION__, arg.fb_id, arg.handle)); + bo->delta = arg.fb_id; + } +} + struct kgem_bo *kgem_create_2d(struct kgem *kgem, int width, int height, @@ -4170,17 +4466,19 @@ size = kgem_surface_size(kgem, kgem->has_relaxed_fencing, flags, width, height, bpp, tiling, &pitch); - assert(size && size <= kgem->max_object_size); + if (size == 0) + return NULL; + size /= PAGE_SIZE; bucket = cache_bucket(size); if (flags & CREATE_SCANOUT) { - struct kgem_bo *last = NULL, *first = NULL; + struct kgem_bo *last = NULL; list_for_each_entry_reverse(bo, &kgem->scanout, list) { assert(bo->scanout); - assert(bo->delta); assert(!bo->flush); + assert(!bo->refcnt); assert_tiling(kgem, bo); if (size > num_pages(bo) || num_pages(bo) > 2*size) @@ -4190,11 +4488,8 @@ /* No tiling/pitch without recreating fb */ continue; - if (!check_scanout_size(kgem, bo, width, height)) { - if (first == NULL) - first = bo; + if (bo->delta && !check_scanout_size(kgem, bo, width, height)) continue; - } if (flags & CREATE_INACTIVE && bo->rq) { last = bo; @@ -4224,49 +4519,69 @@ return last; } - if (first) { - ScrnInfoPtr scrn = - container_of(kgem, struct sna, kgem)->scrn; - - if (scrn->vtSema) { - DBG(("%s: recreate fb %dx%d@%d/%d\n", - __FUNCTION__, width, height, scrn->depth, scrn->bitsPerPixel)); + if (container_of(kgem, struct sna, kgem)->scrn->vtSema) { + ScrnInfoPtr scrn = container_of(kgem, struct sna, kgem)->scrn; + + list_for_each_entry_reverse(bo, &kgem->scanout, list) { + struct drm_mode_fb_cmd arg; + + assert(bo->scanout); + assert(!bo->refcnt); + + if (size > num_pages(bo) || num_pages(bo) > 2*size) + continue; + + if (flags & CREATE_INACTIVE && bo->rq) + continue; + + list_del(&bo->list); + + if (bo->tiling != tiling || bo->pitch != pitch) { + if (bo->delta) { + kgem_bo_rmfb(kgem, bo); + bo->delta = 0; + } - if (bo->tiling != tiling || - (tiling != I915_TILING_NONE && bo->pitch != pitch)) { if (gem_set_tiling(kgem->fd, bo->handle, tiling, pitch)) { bo->tiling = tiling; bo->pitch = pitch; + } else { + kgem_bo_free(kgem, bo); + break; } } - if (bo->tiling == tiling && bo->pitch == pitch) { - struct drm_mode_fb_cmd arg; + VG_CLEAR(arg); + arg.width = width; + arg.height = height; + arg.pitch = bo->pitch; + arg.bpp = scrn->bitsPerPixel; + arg.depth = scrn->depth; + arg.handle = bo->handle; - VG_CLEAR(arg); - arg.width = width; - arg.height = height; - arg.pitch = bo->pitch; - arg.bpp = scrn->bitsPerPixel; - arg.depth = scrn->depth; - arg.handle = bo->handle; - - do_ioctl(kgem->fd, DRM_IOCTL_MODE_RMFB, &bo->delta); - if (do_ioctl(kgem->fd, DRM_IOCTL_MODE_ADDFB, &arg)) { - bo->scanout = false; - kgem_bo_free(kgem, bo); - } else { - bo->delta = arg.fb_id; - return bo; - } + if (do_ioctl(kgem->fd, DRM_IOCTL_MODE_ADDFB, &arg)) { + kgem_bo_free(kgem, bo); + break; } + + bo->delta = arg.fb_id; + bo->unique_id = kgem_get_unique_id(kgem); + + DBG((" 2:from scanout: pitch=%d, tiling=%d, handle=%d, id=%d\n", + bo->pitch, bo->tiling, bo->handle, bo->unique_id)); + assert(bo->pitch*kgem_aligned_height(kgem, height, bo->tiling) <= kgem_bo_size(bo)); + assert_tiling(kgem, bo); + bo->refcnt = 1; + return bo; } } bo = __kgem_bo_create_as_display(kgem, size, tiling, pitch); if (bo) return bo; + + flags |= CREATE_INACTIVE; } if (bucket >= NUM_CACHE_BUCKETS) { @@ -4358,6 +4673,10 @@ assert(bo->pitch*kgem_aligned_height(kgem, height, bo->tiling) <= kgem_bo_size(bo)); assert_tiling(kgem, bo); bo->refcnt = 1; + + if (flags & CREATE_SCANOUT) + __kgem_bo_make_scanout(kgem, bo, width, height); + return bo; } @@ -4390,11 +4709,20 @@ continue; } + if (flags & UNCACHED && !kgem->has_llc && bo->domain != DOMAIN_CPU) + continue; + if (bo->tiling != tiling || (tiling != I915_TILING_NONE && bo->pitch != pitch)) { - DBG(("inactive vma with wrong tiling: %d < %d\n", - bo->tiling, tiling)); - continue; + if (bo->map__gtt || + !gem_set_tiling(kgem->fd, bo->handle, + tiling, pitch)) { + DBG(("inactive GTT vma with wrong tiling: %d < %d\n", + bo->tiling, tiling)); + continue; + } + bo->tiling = tiling; + bo->pitch = pitch; } if (bo->purged && !kgem_bo_clear_purgeable(kgem, bo)) { @@ -4406,7 +4734,6 @@ bo->pitch = pitch; bo->delta = 0; bo->unique_id = kgem_get_unique_id(kgem); - bo->domain = DOMAIN_NONE; kgem_bo_remove_from_inactive(kgem, bo); assert(list_is_empty(&bo->list)); @@ -4441,7 +4768,7 @@ retry = NUM_CACHE_BUCKETS - bucket; if (retry > 3 && (flags & CREATE_TEMPORARY) == 0) retry = 3; -search_again: +search_active: assert(bucket < NUM_CACHE_BUCKETS); cache = &kgem->active[bucket][tiling]; if (tiling) { @@ -4519,52 +4846,44 @@ } } - if (--retry && exact) { - if (kgem->gen >= 040) { - for (i = I915_TILING_NONE; i <= I915_TILING_Y; i++) { - if (i == tiling) - continue; - - cache = &kgem->active[bucket][i]; - list_for_each_entry(bo, cache, list) { - assert(!bo->purged); - assert(bo->refcnt == 0); - assert(bo->reusable); - assert(!bo->scanout); - assert(bo->flush == false); - assert_tiling(kgem, bo); + if (kgem->gen >= 040) { + for (i = I915_TILING_Y; i >= I915_TILING_NONE; i--) { + cache = &kgem->active[bucket][i]; + list_for_each_entry(bo, cache, list) { + assert(!bo->purged); + assert(bo->refcnt == 0); + assert(bo->reusable); + assert(!bo->scanout); + assert(bo->flush == false); + assert_tiling(kgem, bo); - if (num_pages(bo) < size) - continue; + if (num_pages(bo) < size) + continue; + if (bo->tiling != tiling || + (tiling != I915_TILING_NONE && bo->pitch != pitch)) { if (!gem_set_tiling(kgem->fd, bo->handle, tiling, pitch)) continue; + } - kgem_bo_remove_from_active(kgem, bo); + kgem_bo_remove_from_active(kgem, bo); - bo->unique_id = kgem_get_unique_id(kgem); - bo->pitch = pitch; - bo->tiling = tiling; - bo->delta = 0; - DBG((" 1:from active: pitch=%d, tiling=%d, handle=%d, id=%d\n", - bo->pitch, bo->tiling, bo->handle, bo->unique_id)); - assert(bo->pitch*kgem_aligned_height(kgem, height, bo->tiling) <= kgem_bo_size(bo)); - assert_tiling(kgem, bo); - bo->refcnt = 1; - return bo; - } + bo->unique_id = kgem_get_unique_id(kgem); + bo->pitch = pitch; + bo->tiling = tiling; + bo->delta = 0; + DBG((" 1:from active: pitch=%d, tiling=%d, handle=%d, id=%d\n", + bo->pitch, bo->tiling, bo->handle, bo->unique_id)); + assert(bo->pitch*kgem_aligned_height(kgem, height, bo->tiling) <= kgem_bo_size(bo)); + assert_tiling(kgem, bo); + bo->refcnt = 1; + return bo; } } - - bucket++; - goto search_again; - } - - if (!exact) { /* allow an active near-miss? */ - i = tiling; - while (--i >= 0) { + } else if (!exact) { /* allow an active near-miss? */ + for (i = tiling; i >= I915_TILING_NONE; i--) { tiled_height = kgem_surface_size(kgem, kgem->has_relaxed_fencing, flags, width, height, bpp, tiling, &pitch); cache = active(kgem, tiled_height / PAGE_SIZE, i); @@ -4604,6 +4923,11 @@ } } + if (--retry) { + bucket++; + goto search_active; + } + skip_active_search: bucket = cache_bucket(size); retry = NUM_CACHE_BUCKETS - bucket; @@ -4657,19 +4981,67 @@ assert(bo->pitch*kgem_aligned_height(kgem, height, bo->tiling) <= kgem_bo_size(bo)); assert_tiling(kgem, bo); bo->refcnt = 1; + + if (flags & CREATE_SCANOUT) + __kgem_bo_make_scanout(kgem, bo, width, height); + return bo; } - if (flags & CREATE_INACTIVE && - !list_is_empty(&kgem->active[bucket][tiling]) && - __kgem_throttle_retire(kgem, flags)) { - flags &= ~CREATE_INACTIVE; - goto search_inactive; + if ((flags & CREATE_NO_RETIRE) == 0) { + list_for_each_entry_reverse(bo, &kgem->active[bucket][tiling], list) { + if (bo->exec) + break; + + if (size > num_pages(bo)) + continue; + + if (__kgem_busy(kgem, bo->handle)) { + if (flags & CREATE_NO_THROTTLE) + goto no_retire; + + do { + if (!kgem->need_throttle) { + DBG(("%s: not throttling for active handle=%d\n", __FUNCTION__, bo->handle)); + goto no_retire; + } + + __kgem_throttle(kgem, false); + } while (__kgem_busy(kgem, bo->handle)); + } + + DBG(("%s: flushed active handle=%d\n", __FUNCTION__, bo->handle)); + + kgem_bo_remove_from_active(kgem, bo); + __kgem_bo_clear_busy(bo); + + if (tiling != I915_TILING_NONE && bo->pitch != pitch) { + if (!gem_set_tiling(kgem->fd, bo->handle, tiling, pitch)) { + kgem_bo_free(kgem, bo); + goto no_retire; + } + } + + bo->pitch = pitch; + bo->unique_id = kgem_get_unique_id(kgem); + bo->delta = 0; + DBG((" 2:from active: pitch=%d, tiling=%d, handle=%d, id=%d\n", + bo->pitch, bo->tiling, bo->handle, bo->unique_id)); + assert(bo->pitch*kgem_aligned_height(kgem, height, bo->tiling) <= kgem_bo_size(bo)); + assert_tiling(kgem, bo); + bo->refcnt = 1; + + if (flags & CREATE_SCANOUT) + __kgem_bo_make_scanout(kgem, bo, width, height); + + return bo; + } +no_retire: + flags |= CREATE_NO_RETIRE; } if (--retry) { bucket++; - flags &= ~CREATE_INACTIVE; goto search_inactive; } @@ -4694,6 +5066,8 @@ gem_set_tiling(kgem->fd, handle, tiling, pitch)) { bo->tiling = tiling; bo->pitch = pitch; + if (flags & CREATE_SCANOUT) + __kgem_bo_make_scanout(kgem, bo, width, height); } else { if (flags & CREATE_EXACT) { gem_close(kgem->fd, handle); @@ -4828,8 +5202,12 @@ kgem_bo_unref(kgem, bo->proxy); - *(struct kgem_bo **)bo = __kgem_freed_bo; - __kgem_freed_bo = bo; + if (DBG_NO_MALLOC_CACHE) { + free(bo); + } else { + *(struct kgem_bo **)bo = __kgem_freed_bo; + __kgem_freed_bo = bo; + } } else __kgem_bo_destroy(kgem, bo); } @@ -4850,10 +5228,11 @@ void kgem_scanout_flush(struct kgem *kgem, struct kgem_bo *bo) { - kgem_bo_submit(kgem, bo); if (!bo->needs_flush) return; + kgem_bo_submit(kgem, bo); + /* If the kernel fails to emit the flush, then it will be forced when * we assume direct access. And as the usual failure is EIO, we do * not actually care. @@ -4870,42 +5249,87 @@ bo->domain = DOMAIN_NONE; } +inline static bool nearly_idle(struct kgem *kgem) +{ + int ring = kgem->ring == KGEM_BLT; + + if (list_is_singular(&kgem->requests[ring])) + return true; + + return __kgem_ring_is_idle(kgem, ring); +} + inline static bool needs_semaphore(struct kgem *kgem, struct kgem_bo *bo) { - return kgem->nreloc && bo->rq && RQ_RING(bo->rq) != kgem->ring; + if (kgem->needs_semaphore) + return false; + + if (bo->rq == NULL || RQ_RING(bo->rq) == kgem->ring) + return false; + + kgem->needs_semaphore = true; + return true; } -static bool aperture_check(struct kgem *kgem, unsigned num_pages) +inline static bool needs_reservation(struct kgem *kgem, struct kgem_bo *bo) { - if (kgem->aperture) { - struct drm_i915_gem_get_aperture aperture; + if (kgem->needs_reservation) + return false; - VG_CLEAR(aperture); - aperture.aper_available_size = kgem->aperture_high; - aperture.aper_available_size *= PAGE_SIZE; - (void)do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture); + if (bo->presumed_offset) + return false; - DBG(("%s: aperture required %ld bytes, available %ld bytes\n", - __FUNCTION__, - (long)num_pages * PAGE_SIZE, - (long)aperture.aper_available_size)); + kgem->needs_reservation = true; + return nearly_idle(kgem); +} - /* Leave some space in case of alignment issues */ - aperture.aper_available_size -= 1024 * 1024; - aperture.aper_available_size -= kgem->aperture_mappable * PAGE_SIZE / 2; - if (kgem->gen < 033) - aperture.aper_available_size -= kgem->aperture_max_fence * PAGE_SIZE; - if (!kgem->has_llc) - aperture.aper_available_size -= 2 * kgem->nexec * PAGE_SIZE; +inline static bool needs_batch_flush(struct kgem *kgem, struct kgem_bo *bo) +{ + bool flush = false; - DBG(("%s: num_pages=%d, estimated max usable=%ld\n", - __FUNCTION__, num_pages, (long)(aperture.aper_available_size/PAGE_SIZE))); + if (needs_semaphore(kgem, bo)) { + DBG(("%s: flushing before handle=%d for required semaphore\n", __FUNCTION__, bo->handle)); + flush = true; + } - if (num_pages <= aperture.aper_available_size / PAGE_SIZE) - return true; + if (needs_reservation(kgem, bo)) { + DBG(("%s: flushing before handle=%d for new reservation\n", __FUNCTION__, bo->handle)); + flush = true; } - return false; + return kgem->nreloc ? flush : false; +} + +static bool aperture_check(struct kgem *kgem, unsigned num_pages) +{ + struct drm_i915_gem_get_aperture aperture; + int reserve; + + if (kgem->aperture) + return false; + + /* Leave some space in case of alignment issues */ + reserve = kgem->aperture_mappable / 2; + if (kgem->gen < 033 && reserve < kgem->aperture_max_fence) + reserve = kgem->aperture_max_fence; + if (!kgem->has_llc) + reserve += kgem->nexec * PAGE_SIZE * 2; + + DBG(("%s: num_pages=%d, holding %d pages in reserve, total aperture %d\n", + __FUNCTION__, num_pages, reserve, kgem->aperture_total)); + num_pages += reserve; + + VG_CLEAR(aperture); + aperture.aper_available_size = kgem->aperture_total; + aperture.aper_available_size *= PAGE_SIZE; + (void)do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture); + + DBG(("%s: aperture required %ld bytes, available %ld bytes\n", + __FUNCTION__, + (long)num_pages * PAGE_SIZE, + (long)aperture.aper_available_size)); + + return num_pages <= aperture.aper_available_size / PAGE_SIZE; } static inline bool kgem_flush(struct kgem *kgem, bool flush) @@ -4943,8 +5367,7 @@ if (bo->exec) continue; - if (needs_semaphore(kgem, bo)) { - DBG(("%s: flushing for required semaphore\n", __FUNCTION__)); + if (needs_batch_flush(kgem, bo)) { va_end(ap); return false; } @@ -4970,10 +5393,9 @@ } if (num_pages + kgem->aperture > kgem->aperture_high) { - DBG(("%s: final aperture usage (%d) is greater than high water mark (%d)\n", - __FUNCTION__, num_pages + kgem->aperture, kgem->aperture_high)); - if (!aperture_check(kgem, num_pages + kgem->aperture)) - return false; + DBG(("%s: final aperture usage (%d + %d) is greater than high water mark (%d)\n", + __FUNCTION__, kgem->aperture, num_pages, kgem->aperture_high)); + return aperture_check(kgem, num_pages); } if (busy) @@ -5015,13 +5437,13 @@ if (size > kgem->aperture_max_fence) kgem->aperture_max_fence = size; size += kgem->aperture_fenced; - if (kgem->gen < 033) - size += kgem->aperture_max_fence; + if (kgem->gen < 033 && size < 2 * kgem->aperture_max_fence) + size = 2 * kgem->aperture_max_fence; if (kgem->aperture_total == kgem->aperture_mappable) size += kgem->aperture; if (size > kgem->aperture_mappable) { - DBG(("%s: estimated fence space required [%d] exceed aperture [%d]\n", - __FUNCTION__, size, kgem->aperture_mappable)); + DBG(("%s: estimated fence space required %d (fenced=%d, max_fence=%d, aperture=%d) exceeds aperture %d\n", + __FUNCTION__, size, kgem->aperture_fenced, kgem->aperture_max_fence, kgem->aperture, kgem->aperture_mappable)); return false; } } @@ -5032,10 +5454,8 @@ if (kgem->nexec >= KGEM_EXEC_SIZE(kgem) - 1) return false; - if (needs_semaphore(kgem, bo)) { - DBG(("%s: flushing for required semaphore\n", __FUNCTION__)); + if (needs_batch_flush(kgem, bo)) return false; - } assert_tiling(kgem, bo); if (kgem->gen < 040 && bo->tiling != I915_TILING_NONE) { @@ -5061,22 +5481,21 @@ if (size > kgem->aperture_max_fence) kgem->aperture_max_fence = size; size += kgem->aperture_fenced; - if (kgem->gen < 033) - size += kgem->aperture_max_fence; + if (kgem->gen < 033 && size < 2 * kgem->aperture_max_fence) + size = 2 * kgem->aperture_max_fence; if (kgem->aperture_total == kgem->aperture_mappable) size += kgem->aperture; if (size > kgem->aperture_mappable) { - DBG(("%s: estimated fence space required [%d] exceed aperture [%d]\n", - __FUNCTION__, size, kgem->aperture_mappable)); + DBG(("%s: estimated fence space required %d (fenced=%d, max_fence=%d, aperture=%d) exceeds aperture %d\n", + __FUNCTION__, size, kgem->aperture_fenced, kgem->aperture_max_fence, kgem->aperture, kgem->aperture_mappable)); return false; } } if (kgem->aperture + kgem->aperture_fenced + num_pages(bo) > kgem->aperture_high) { - DBG(("%s: final aperture usage (%d) is greater than high water mark (%d)\n", - __FUNCTION__, num_pages(bo) + kgem->aperture, kgem->aperture_high)); - if (!aperture_check(kgem, num_pages(bo) + kgem->aperture + kgem->aperture_fenced)) - return false; + DBG(("%s: final aperture usage (%d + %d) is greater than high water mark (%d)\n", + __FUNCTION__, kgem->aperture, num_pages(bo), kgem->aperture_high)); + return aperture_check(kgem, num_pages(bo)); } if (bo->rq) @@ -5114,8 +5533,7 @@ continue; } - if (needs_semaphore(kgem, bo)) { - DBG(("%s: flushing for required semaphore\n", __FUNCTION__)); + if (needs_batch_flush(kgem, bo)) { va_end(ap); return false; } @@ -5155,13 +5573,13 @@ size = kgem->aperture_fenced; size += fenced_size; - if (kgem->gen < 033) - size += kgem->aperture_max_fence; + if (kgem->gen < 033 && size < 2 * kgem->aperture_max_fence) + size = 2 * kgem->aperture_max_fence; if (kgem->aperture_total == kgem->aperture_mappable) size += kgem->aperture; if (size > kgem->aperture_mappable) { - DBG(("%s: estimated fence space required [%d] exceed aperture [%d]\n", - __FUNCTION__, size, kgem->aperture_mappable)); + DBG(("%s: estimated fence space required %d (fenced=%d, max_fence=%d, aperture=%d) exceeds aperture %d\n", + __FUNCTION__, size, kgem->aperture_fenced, kgem->aperture_max_fence, kgem->aperture, kgem->aperture_mappable)); return false; } } @@ -5173,10 +5591,9 @@ return false; if (num_pages + kgem->aperture > kgem->aperture_high - kgem->aperture_fenced) { - DBG(("%s: final aperture usage (%d) is greater than high water mark (%d)\n", - __FUNCTION__, num_pages + kgem->aperture, kgem->aperture_high)); - if (!aperture_check(kgem, num_pages + kgem->aperture + kgem->aperture_fenced)) - return false; + DBG(("%s: final aperture usage (%d + %d + %d) is greater than high water mark (%d)\n", + __FUNCTION__, kgem->aperture, kgem->aperture_fenced, num_pages, kgem->aperture_high)); + return aperture_check(kgem, num_pages); } if (busy) @@ -5316,6 +5733,8 @@ assert(bo->rq == MAKE_REQUEST(kgem->next_request, kgem->ring)); assert(RQ_RING(bo->rq) == kgem->ring); + DBG(("%s[%d] = (delta=%d, target handle=%d, presumed=%llx)\n", + __FUNCTION__, index, delta, bo->target_handle, (long long)bo->presumed_offset)); kgem->reloc[index].delta = delta; kgem->reloc[index].target_handle = bo->target_handle; kgem->reloc[index].presumed_offset = bo->presumed_offset; @@ -5327,6 +5746,8 @@ delta += bo->presumed_offset; } else { + DBG(("%s[%d] = (delta=%d, target handle=batch)\n", + __FUNCTION__, index, delta)); kgem->reloc[index].delta = delta; kgem->reloc[index].target_handle = ~0U; kgem->reloc[index].presumed_offset = 0; @@ -5403,6 +5824,7 @@ assert(bo->proxy == NULL); assert(list_is_empty(&bo->list)); assert_tiling(kgem, bo); + assert(!bo->purged || bo->reusable); if (bo->tiling == I915_TILING_NONE && !bo->scanout && kgem->has_llc) { DBG(("%s: converting request for GTT map into CPU map\n", @@ -5443,6 +5865,7 @@ assert(list_is_empty(&bo->list)); assert(bo->exec == NULL); assert_tiling(kgem, bo); + assert(!bo->purged || bo->reusable); if (bo->tiling == I915_TILING_NONE && !bo->scanout && (kgem->has_llc || bo->domain == DOMAIN_CPU)) { @@ -5505,9 +5928,11 @@ DBG(("%s: handle=%d, offset=%ld, tiling=%d, map=%p:%p, domain=%d\n", __FUNCTION__, bo->handle, (long)bo->presumed_offset, bo->tiling, bo->map__gtt, bo->map__cpu, bo->domain)); + assert(bo->proxy == NULL); assert(bo->exec == NULL); assert(list_is_empty(&bo->list)); assert_tiling(kgem, bo); + assert(!bo->purged || bo->reusable); ptr = MAP(bo->map__gtt); if (ptr == NULL) { @@ -5546,6 +5971,7 @@ assert(!bo->purged); assert(list_is_empty(&bo->list)); assert(bo->proxy == NULL); + assert_tiling(kgem, bo); if (bo->map__cpu) return MAP(bo->map__cpu); @@ -5598,13 +6024,6 @@ kgem_bo_unclean(kgem, bo); - /* Henceforth, we need to broadcast all updates to clients and - * flush our rendering before doing so. - */ - bo->flush = true; - if (bo->exec) - kgem->flush = 1; - return flink.name; } @@ -5618,6 +6037,8 @@ assert(MAP(ptr) == ptr); + DBG(("%s(%p size=%d, read-only?=%d) - has_userptr?=%d\n", __FUNCTION__, + ptr, size, read_only, kgem->has_userptr)); if (!kgem->has_userptr) return NULL; @@ -5631,8 +6052,10 @@ handle = gem_userptr(kgem->fd, (void *)first_page, last_page-first_page, read_only); - if (handle == 0) + if (handle == 0) { + DBG(("%s: import failed, errno=%d\n", __FUNCTION__, errno)); return NULL; + } bo = __kgem_bo_alloc(handle, (last_page - first_page) / PAGE_SIZE); if (bo == NULL) { @@ -5640,6 +6063,7 @@ return NULL; } + bo->unique_id = kgem_get_unique_id(kgem); bo->snoop = !kgem->has_llc; debug_alloc__bo(kgem, bo); @@ -5666,6 +6090,8 @@ { DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle)); assert(!bo->scanout); + assert_tiling(kgem, bo); + kgem_bo_submit(kgem, bo); /* SHM pixmaps use proxies for subpage offsets */ @@ -5700,6 +6126,7 @@ { DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle)); assert(!bo->scanout || !write); + assert_tiling(kgem, bo); if (write || bo->needs_flush) kgem_bo_submit(kgem, bo); @@ -5745,6 +6172,7 @@ DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle)); assert(bo->refcnt); assert(bo->proxy == NULL); + assert_tiling(kgem, bo); kgem_bo_submit(kgem, bo); @@ -5813,11 +6241,13 @@ bo->proxy = kgem_bo_reference(target); bo->delta = offset; + /* Proxies are only tracked for busyness on the current rq */ if (target->exec && !bo->io) { + assert(RQ(target->rq) == kgem->next_request); list_move_tail(&bo->request, &kgem->next_request->buffers); bo->exec = &_kgem_dummy_exec; + bo->rq = target->rq; } - bo->rq = target->rq; return bo; } @@ -6078,7 +6508,7 @@ __FUNCTION__, size, bo->used, bytes(&bo->base))); gem_write__cachealigned(kgem->fd, bo->base.handle, 0, bo->used, bo->mem); - kgem_buffer_release(kgem, bo); + assert(list_is_empty(&bo->base.vma)); bo->need_io = 0; bo->write = 0; offset = 0; @@ -6135,13 +6565,14 @@ goto done; } - if (size <= bytes(&bo->base) && + if (bo->base.refcnt == 1 && + size <= bytes(&bo->base) && (bo->base.rq == NULL || !__kgem_busy(kgem, bo->base.handle))) { DBG(("%s: reusing whole buffer? size=%d, total=%d\n", __FUNCTION__, size, bytes(&bo->base))); __kgem_bo_clear_busy(&bo->base); - kgem_buffer_release(kgem, bo); + assert(list_is_empty(&bo->base.vma)); switch (bo->mmapped) { case MMAPPED_CPU: @@ -6672,6 +7103,8 @@ dst->pitch = pitch; dst->unique_id = kgem_get_unique_id(kgem); dst->refcnt = 1; + assert(dst->tiling == I915_TILING_NONE); + assert(kgem_bo_can_blt(kgem, dst)); kgem_set_mode(kgem, KGEM_BLT, dst); if (!kgem_check_batch(kgem, 10) || diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/kgem_debug.c xserver-xorg-video-intel-2.99.914/src/sna/kgem_debug.c --- xserver-xorg-video-intel-2.99.910/src/sna/kgem_debug.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/kgem_debug.c 2014-06-10 09:59:49.000000000 +0000 @@ -192,7 +192,7 @@ } static int -decode_2d(struct kgem *kgem, uint32_t offset) +__decode_2d(struct kgem *kgem, uint32_t offset) { static const struct { uint32_t opcode; @@ -369,9 +369,199 @@ return 1; } +static int +__decode_2d_gen8(struct kgem *kgem, uint32_t offset) +{ + static const struct { + uint32_t opcode; + int min_len; + int max_len; + const char *name; + } opcodes[] = { + { 0x43, 8, 8, "SRC_COPY_BLT" }, + { 0x01, 8, 8, "XY_SETUP_BLT" }, + { 0x11, 10, 10, "XY_SETUP_MONO_PATTERN_SL_BLT" }, + { 0x03, 3, 3, "XY_SETUP_CLIP_BLT" }, + { 0x24, 2, 2, "XY_PIXEL_BLT" }, + { 0x25, 3, 3, "XY_SCANLINES_BLT" }, + { 0x26, 4, 4, "Y_TEXT_BLT" }, + { 0x31, 5, 134, "XY_TEXT_IMMEDIATE_BLT" }, + { 0x50, 7, 7, "XY_COLOR_BLT" }, + { 0x51, 6, 6, "XY_PAT_BLT" }, + { 0x76, 8, 8, "XY_PAT_CHROMA_BLT" }, + { 0x72, 7, 135, "XY_PAT_BLT_IMMEDIATE" }, + { 0x77, 9, 137, "XY_PAT_CHROMA_BLT_IMMEDIATE" }, + { 0x52, 9, 9, "XY_MONO_PAT_BLT" }, + { 0x59, 7, 7, "XY_MONO_PAT_FIXED_BLT" }, + { 0x53, 8, 8, "XY_SRC_COPY_BLT" }, + { 0x54, 8, 8, "XY_MONO_SRC_COPY_BLT" }, + { 0x71, 9, 137, "XY_MONO_SRC_COPY_IMMEDIATE_BLT" }, + { 0x55, 9, 9, "XY_FULL_BLT" }, + { 0x55, 9, 137, "XY_FULL_IMMEDIATE_PATTERN_BLT" }, + { 0x56, 9, 9, "XY_FULL_MONO_SRC_BLT" }, + { 0x75, 10, 138, "XY_FULL_MONO_SRC_IMMEDIATE_PATTERN_BLT" }, + { 0x57, 12, 12, "XY_FULL_MONO_PATTERN_BLT" }, + { 0x58, 12, 12, "XY_FULL_MONO_PATTERN_MONO_SRC_BLT" }, + }; + + unsigned int op, len; + const char *format = NULL; + uint32_t *data = kgem->batch + offset; + struct drm_i915_gem_relocation_entry *reloc; + + /* Special case the two most common ops that we detail in full */ + switch ((data[0] & 0x1fc00000) >> 22) { + case 0x50: + kgem_debug_print(data, offset, 0, + "XY_COLOR_BLT (rgb %sabled, alpha %sabled, dst tile %d)\n", + (data[0] & (1 << 20)) ? "en" : "dis", + (data[0] & (1 << 21)) ? "en" : "dis", + (data[0] >> 11) & 1); + + len = (data[0] & 0x000000ff) + 2; + assert(len == 7); + + switch ((data[1] >> 24) & 0x3) { + case 0: + format="8"; + break; + case 1: + format="565"; + break; + case 2: + format="1555"; + break; + case 3: + format="8888"; + break; + } + + kgem_debug_print(data, offset, 1, "format %s, rop %x, pitch %d, " + "clipping %sabled\n", format, + (data[1] >> 16) & 0xff, + (short)(data[1] & 0xffff), + data[1] & (1 << 30) ? "en" : "dis"); + kgem_debug_print(data, offset, 2, "(%d,%d)\n", + data[2] & 0xffff, data[2] >> 16); + kgem_debug_print(data, offset, 3, "(%d,%d)\n", + data[3] & 0xffff, data[3] >> 16); + reloc = kgem_debug_get_reloc_entry(kgem, offset+4); + kgem_debug_print(data, offset, 4, "dst offset 0x%016llx [handle=%d, delta=%d, read=%x, write=%x (fenced? %d, tiling? %d)]\n", + (long long)*(uint64_t *)&data[4], + reloc->target_handle, reloc->delta, + reloc->read_domains, reloc->write_domain, + kgem_debug_handle_is_fenced(kgem, reloc->target_handle), + kgem_debug_handle_tiling(kgem, reloc->target_handle)); + kgem_debug_print(data, offset, 6, "color\n"); + return len; + + case 0x53: + kgem_debug_print(data, offset, 0, + "XY_SRC_COPY_BLT (rgb %sabled, alpha %sabled, " + "src tile %d, dst tile %d)\n", + (data[0] & (1 << 20)) ? "en" : "dis", + (data[0] & (1 << 21)) ? "en" : "dis", + (data[0] >> 15) & 1, + (data[0] >> 11) & 1); + + len = (data[0] & 0x000000ff) + 2; + assert(len == 10); + + switch ((data[1] >> 24) & 0x3) { + case 0: + format="8"; + break; + case 1: + format="565"; + break; + case 2: + format="1555"; + break; + case 3: + format="8888"; + break; + } + + kgem_debug_print(data, offset, 1, "format %s, rop %x, dst pitch %d, " + "clipping %sabled\n", format, + (data[1] >> 16) & 0xff, + (short)(data[1] & 0xffff), + data[1] & (1 << 30) ? "en" : "dis"); + kgem_debug_print(data, offset, 2, "dst (%d,%d)\n", + data[2] & 0xffff, data[2] >> 16); + kgem_debug_print(data, offset, 3, "dst (%d,%d)\n", + data[3] & 0xffff, data[3] >> 16); + reloc = kgem_debug_get_reloc_entry(kgem, offset+4); + assert(reloc); + kgem_debug_print(data, offset, 4, "dst offset 0x%016llx [handle=%d, delta=%d, read=%x, write=%x, (fenced? %d, tiling? %d)]\n", + (long long)*(uint64_t *)&data[4], + reloc->target_handle, reloc->delta, + reloc->read_domains, reloc->write_domain, + kgem_debug_handle_is_fenced(kgem, reloc->target_handle), + kgem_debug_handle_tiling(kgem, reloc->target_handle)); + + kgem_debug_print(data, offset, 6, "src (%d,%d)\n", + data[6] & 0xffff, data[6] >> 16); + kgem_debug_print(data, offset, 7, "src pitch %d\n", + (short)(data[7] & 0xffff)); + reloc = kgem_debug_get_reloc_entry(kgem, offset+8); + assert(reloc); + kgem_debug_print(data, offset, 8, "src offset 0x%016llx [handle=%d, delta=%d, read=%x, write=%x (fenced? %d, tiling? %d)]\n", + (long long)*(uint64_t *)&data[8], + reloc->target_handle, reloc->delta, + reloc->read_domains, reloc->write_domain, + kgem_debug_handle_is_fenced(kgem, reloc->target_handle), + kgem_debug_handle_tiling(kgem, reloc->target_handle)); + + return len; + } + + for (op = 0; op < ARRAY_SIZE(opcodes); op++) { + if ((data[0] & 0x1fc00000) >> 22 == opcodes[op].opcode) { + unsigned int i; + + len = 1; + kgem_debug_print(data, offset, 0, "%s\n", opcodes[op].name); + if (opcodes[op].max_len > 1) { + len = (data[0] & 0x000000ff) + 2; + assert(len >= opcodes[op].min_len && + len <= opcodes[op].max_len); + } + + for (i = 1; i < len; i++) + kgem_debug_print(data, offset, i, "dword %d\n", i); + + return len; + } + } + + kgem_debug_print(data, offset, 0, "2D UNKNOWN\n"); + assert(0); + return 1; +} + +static int (*decode_2d(int gen))(struct kgem*, uint32_t) +{ + if (gen >= 0100) + return __decode_2d_gen8; + else + return __decode_2d; +} + +static int kgem_nop_decode_3d(struct kgem *kgem, uint32_t offset) +{ + uint32_t *data = kgem->batch + offset; + return (data[0] & 0xf) + 2; +} + +static void kgem_nop_finish_state(struct kgem *kgem) +{ +} + static int (*decode_3d(int gen))(struct kgem*, uint32_t) { if (gen >= 0100) { + return kgem_nop_decode_3d; } else if (gen >= 070) { return kgem_gen7_decode_3d; } else if (gen >= 060) { @@ -391,6 +581,7 @@ static void (*finish_state(int gen))(struct kgem*) { if (gen >= 0100) { + return kgem_nop_finish_state; } else if (gen >= 070) { return kgem_gen7_finish_state; } else if (gen >= 060) { @@ -412,7 +603,7 @@ int (*const decode[])(struct kgem *, uint32_t) = { decode_mi, decode_nop, - decode_2d, + decode_2d(kgem->gen), decode_3d(kgem->gen), }; uint32_t offset = 0; diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/kgem.h xserver-xorg-video-intel-2.99.914/src/sna/kgem.h --- xserver-xorg-video-intel-2.99.910/src/sna/kgem.h 2014-02-04 21:48:50.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/kgem.h 2014-07-01 10:35:59.000000000 +0000 @@ -50,6 +50,8 @@ #define RQ(rq) ((struct kgem_request *)((uintptr_t)(rq) & ~3)) #define RQ_RING(rq) ((uintptr_t)(rq) & 3) #define RQ_IS_BLT(rq) (RQ_RING(rq) == KGEM_BLT) +#define MAKE_REQUEST(rq, ring) ((struct kgem_request *)((uintptr_t)(rq) | (ring))) + struct drm_i915_gem_exec_object2 *exec; struct kgem_bo *proxy; @@ -74,6 +76,7 @@ uint32_t handle; uint32_t target_handle; uint32_t delta; + uint32_t active_scanout; union { struct { uint32_t count:27; @@ -95,6 +98,7 @@ uint32_t io : 1; uint32_t flush : 1; uint32_t scanout : 1; + uint32_t prime : 1; uint32_t purged : 1; }; #define DOMAIN_NONE 0 @@ -167,6 +171,8 @@ uint32_t need_purge:1; uint32_t need_retire:1; uint32_t need_throttle:1; + uint32_t needs_semaphore:1; + uint32_t needs_reservation:1; uint32_t scanout_busy:1; uint32_t busy:1; @@ -268,7 +274,13 @@ #define KGEM_CAN_CREATE_LARGE 0x4 #define KGEM_CAN_CREATE_GTT 0x8 -uint32_t kgem_get_unique_id(struct kgem *kgem); +bool kgem_check_surface_size(struct kgem *kgem, + uint32_t width, + uint32_t height, + uint32_t bpp, + uint32_t tiling, + uint32_t pitch, + uint32_t size); struct kgem_bo * kgem_replace_bo(struct kgem *kgem, @@ -309,6 +321,21 @@ void kgem_bo_set_binding(struct kgem_bo *bo, uint32_t format, uint16_t offset); bool kgem_retire(struct kgem *kgem); +void kgem_retire__buffers(struct kgem *kgem); + +static inline bool kgem_bo_discard_cache(struct kgem_bo *bo, bool force) +{ + if (bo == NULL || bo->proxy == NULL) + return false; + + if (force) + return true; + + if (bo->proxy->rq) + return false; + + return bo->snoop; +} bool __kgem_ring_is_idle(struct kgem *kgem, int ring); static inline bool kgem_ring_is_idle(struct kgem *kgem, int ring) @@ -542,17 +569,26 @@ } void kgem_bo_undo(struct kgem *kgem, struct kgem_bo *bo); +void kgem_bo_pair_undo(struct kgem *kgem, struct kgem_bo *a, struct kgem_bo *b); bool __kgem_busy(struct kgem *kgem, int handle); -static inline void kgem_bo_mark_busy(struct kgem_bo *bo, int ring) +static inline void kgem_bo_mark_busy(struct kgem *kgem, struct kgem_bo *bo, int ring) { assert(bo->refcnt); - bo->rq = (struct kgem_request *)((uintptr_t)bo->rq | ring); + bo->needs_flush = true; + if (bo->rq) { + bo->rq = MAKE_REQUEST(RQ(bo->rq), ring); + } else { + bo->rq = MAKE_REQUEST(kgem, ring); + list_add(&bo->request, &kgem->flushing); + kgem->need_retire = true; + } } inline static void __kgem_bo_clear_busy(struct kgem_bo *bo) { + DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle)); bo->rq = NULL; list_del(&bo->request); @@ -630,6 +666,8 @@ bo->handle, bo->proxy != NULL)); assert(bo->refcnt); + assert(bo->exec); + assert(bo->rq); bo->exec->flags |= LOCAL_EXEC_OBJECT_WRITE; bo->needs_flush = bo->gpu_dirty = true; @@ -652,8 +690,9 @@ static inline bool kgem_bo_mapped(struct kgem *kgem, struct kgem_bo *bo) { - DBG(("%s: map=%p:%p, tiling=%d, domain=%d\n", - __FUNCTION__, bo->map__gtt, bo->map__cpu, bo->tiling, bo->domain)); + DBG(("%s: handle=%d, map=%p:%p, tiling=%d, domain=%d\n", + __FUNCTION__, bo->handle, bo->map__gtt, bo->map__cpu, bo->tiling, bo->domain)); + assert(bo->proxy == NULL); if (bo->tiling == I915_TILING_NONE && (bo->domain == DOMAIN_CPU || kgem->has_llc)) return bo->map__cpu != NULL; @@ -663,12 +702,14 @@ static inline bool kgem_bo_can_map(struct kgem *kgem, struct kgem_bo *bo) { - DBG(("%s: map=%p:%p, tiling=%d, domain=%d, offset=%ld\n", - __FUNCTION__, bo->map__gtt, bo->map__cpu, bo->tiling, bo->domain, (long)bo->presumed_offset)); + DBG(("%s: handle=%d, map=%p:%p, tiling=%d, domain=%d, offset=%ld\n", + __FUNCTION__, bo->handle, bo->map__gtt, bo->map__cpu, bo->tiling, bo->domain, (long)bo->presumed_offset)); if (!bo->tiling && (kgem->has_llc || bo->domain == DOMAIN_CPU)) return true; + assert(bo->proxy == NULL); + if (bo->map__gtt != NULL) return true; @@ -682,14 +723,22 @@ struct kgem_bo *bo, bool write) { + DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle)); assert(bo->refcnt); - if (bo->purged || (bo->scanout && write)) + if (bo->purged || (bo->scanout && write)) { + DBG(("%s: no, writing to scanout? %d, or is stolen [inaccessible via CPU]? %d\n", + __FUNCTION__, bo->scanout && write, bo->purged)); return false; + } - if (kgem->has_llc) + if (kgem->has_llc) { + DBG(("%s: yes, has LLC and target is in LLC\n", __FUNCTION__)); return true; + } + DBG(("%s: non-LLC - CPU domain? %d, clean? %d\n", + __FUNCTION__, bo->domain == DOMAIN_CPU, !write || bo->exec == NULL)); if (bo->domain != DOMAIN_CPU) return false; @@ -738,6 +787,11 @@ int16_t dst_x, int16_t dst_y, uint16_t width, uint16_t height) { + assert(kgem->memcpy_to_tiled_x); + assert(src_x >= 0 && src_y >= 0); + assert(dst_x >= 0 && dst_y >= 0); + assert(8*src_stride >= (src_x+width) * bpp); + assert(8*dst_stride >= (dst_x+width) * bpp); return kgem->memcpy_to_tiled_x(src, dst, bpp, src_stride, dst_stride, src_x, src_y, @@ -753,6 +807,11 @@ int16_t dst_x, int16_t dst_y, uint16_t width, uint16_t height) { + assert(kgem->memcpy_from_tiled_x); + assert(src_x >= 0 && src_y >= 0); + assert(dst_x >= 0 && dst_y >= 0); + assert(8*src_stride >= (src_x+width) * bpp); + assert(8*dst_stride >= (dst_x+width) * bpp); return kgem->memcpy_from_tiled_x(src, dst, bpp, src_stride, dst_stride, src_x, src_y, diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/Makefile.am xserver-xorg-video-intel-2.99.914/src/sna/Makefile.am --- xserver-xorg-video-intel-2.99.910/src/sna/Makefile.am 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/Makefile.am 2014-07-23 15:02:47.000000000 +0000 @@ -35,7 +35,7 @@ noinst_LTLIBRARIES = libsna.la libsna_la_LDFLAGS = -pthread -libsna_la_LIBADD = $(UDEV_LIBS) -lm $(DRM_LIBS) brw/libbrw.la fb/libfb.la +libsna_la_LIBADD = $(UDEV_LIBS) -lm $(DRM_LIBS) brw/libbrw.la fb/libfb.la ../../libobj/libcompat.la libsna_la_SOURCES = \ atomic.h \ @@ -109,11 +109,23 @@ $(NULL) if DRI2 -AM_CFLAGS += @DRI2_CFLAGS@ -libsna_la_SOURCES += sna_dri.c +AM_CFLAGS += $(DRI2_CFLAGS) +libsna_la_SOURCES += sna_dri2.c libsna_la_LIBADD += $(DRI2_LIBS) @CLOCK_GETTIME_LIBS@ endif +if DRI3 +AM_CFLAGS += $(DRI3_CFLAGS) +libsna_la_SOURCES += sna_dri3.c +libsna_la_LIBADD += $(DRI3_LIBS) +endif + +if PRESENT +AM_CFLAGS += $(PRESENT_CFLAGS) +libsna_la_SOURCES += sna_present.c +libsna_la_LIBADD += $(PRESENT_LIBS) +endif + if XVMC libsna_la_SOURCES += \ sna_video_hwmc.h \ diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/Makefile.in xserver-xorg-video-intel-2.99.914/src/sna/Makefile.in --- xserver-xorg-video-intel-2.99.910/src/sna/Makefile.in 2014-02-10 09:34:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/Makefile.in 2014-07-23 15:44:37.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -36,6 +35,51 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -55,15 +99,21 @@ build_triplet = @build@ host_triplet = @host@ @VALGRIND_TRUE@am__append_1 = $(VALGRIND_CFLAGS) -@DRI2_TRUE@am__append_2 = @DRI2_CFLAGS@ -@DRI2_TRUE@am__append_3 = sna_dri.c +@DRI2_TRUE@am__append_2 = $(DRI2_CFLAGS) +@DRI2_TRUE@am__append_3 = sna_dri2.c @DRI2_TRUE@am__append_4 = $(DRI2_LIBS) @CLOCK_GETTIME_LIBS@ -@XVMC_TRUE@am__append_5 = \ +@DRI3_TRUE@am__append_5 = $(DRI3_CFLAGS) +@DRI3_TRUE@am__append_6 = sna_dri3.c +@DRI3_TRUE@am__append_7 = $(DRI3_LIBS) +@PRESENT_TRUE@am__append_8 = $(PRESENT_CFLAGS) +@PRESENT_TRUE@am__append_9 = sna_present.c +@PRESENT_TRUE@am__append_10 = $(PRESENT_LIBS) +@XVMC_TRUE@am__append_11 = \ @XVMC_TRUE@ sna_video_hwmc.h \ @XVMC_TRUE@ sna_video_hwmc.c \ @XVMC_TRUE@ $(NULL) -@FULL_DEBUG_TRUE@am__append_6 = \ +@FULL_DEBUG_TRUE@am__append_12 = \ @FULL_DEBUG_TRUE@ kgem_debug.c \ @FULL_DEBUG_TRUE@ kgem_debug.h \ @FULL_DEBUG_TRUE@ kgem_debug_gen2.c \ @@ -75,7 +125,8 @@ @FULL_DEBUG_TRUE@ $(NULL) subdir = src/sna -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -90,8 +141,12 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = @DRI2_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) +@DRI3_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) +@PRESENT_TRUE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1) libsna_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - brw/libbrw.la fb/libfb.la $(am__DEPENDENCIES_2) + brw/libbrw.la fb/libfb.la ../../libobj/libcompat.la \ + $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) \ + $(am__DEPENDENCIES_4) am__libsna_la_SOURCES_DIST = atomic.h blt.c compiler.h kgem.c kgem.h \ rop.h sna.h sna_accel.c sna_acpi.c sna_blt.c sna_composite.c \ sna_cpu.c sna_cpuid.h sna_damage.c sna_damage.h sna_display.c \ @@ -109,13 +164,15 @@ gen5_render.c gen5_render.h gen6_common.c gen6_common.h \ gen6_render.c gen6_render.h gen7_render.c gen7_render.h \ gen8_eu.c gen8_eu.h gen8_render.c gen8_render.h gen8_vertex.c \ - gen8_vertex.h sna_dri.c sna_video_hwmc.h sna_video_hwmc.c \ - kgem_debug.c kgem_debug.h kgem_debug_gen2.c kgem_debug_gen3.c \ - kgem_debug_gen4.c kgem_debug_gen5.c kgem_debug_gen6.c \ - kgem_debug_gen7.c -@DRI2_TRUE@am__objects_1 = sna_dri.lo -@XVMC_TRUE@am__objects_2 = sna_video_hwmc.lo -@FULL_DEBUG_TRUE@am__objects_3 = kgem_debug.lo kgem_debug_gen2.lo \ + gen8_vertex.h sna_dri2.c sna_dri3.c sna_present.c \ + sna_video_hwmc.h sna_video_hwmc.c kgem_debug.c kgem_debug.h \ + kgem_debug_gen2.c kgem_debug_gen3.c kgem_debug_gen4.c \ + kgem_debug_gen5.c kgem_debug_gen6.c kgem_debug_gen7.c +@DRI2_TRUE@am__objects_1 = sna_dri2.lo +@DRI3_TRUE@am__objects_2 = sna_dri3.lo +@PRESENT_TRUE@am__objects_3 = sna_present.lo +@XVMC_TRUE@am__objects_4 = sna_video_hwmc.lo +@FULL_DEBUG_TRUE@am__objects_5 = kgem_debug.lo kgem_debug_gen2.lo \ @FULL_DEBUG_TRUE@ kgem_debug_gen3.lo kgem_debug_gen4.lo \ @FULL_DEBUG_TRUE@ kgem_debug_gen5.lo kgem_debug_gen6.lo \ @FULL_DEBUG_TRUE@ kgem_debug_gen7.lo @@ -131,14 +188,28 @@ gen3_render.lo gen4_common.lo gen4_render.lo gen4_source.lo \ gen4_vertex.lo gen5_render.lo gen6_common.lo gen6_render.lo \ gen7_render.lo gen8_eu.lo gen8_render.lo gen8_vertex.lo \ - $(am__objects_1) $(am__objects_2) $(am__objects_3) + $(am__objects_1) $(am__objects_2) $(am__objects_3) \ + $(am__objects_4) $(am__objects_5) libsna_la_OBJECTS = $(am_libsna_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = libsna_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libsna_la_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -151,34 +222,56 @@ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libsna_la_SOURCES) DIST_SOURCES = $(am__libsna_la_SOURCES_DIST) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -237,6 +330,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -265,8 +360,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -305,23 +405,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -384,11 +485,12 @@ AM_CFLAGS = @CWARNFLAGS@ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/render_program $(XORG_CFLAGS) \ $(UDEV_CFLAGS) $(DRM_CFLAGS) $(NULL) $(am__append_1) \ - $(am__append_2) @NOWARNFLAGS@ + $(am__append_2) $(am__append_5) $(am__append_8) @NOWARNFLAGS@ noinst_LTLIBRARIES = libsna.la libsna_la_LDFLAGS = -pthread libsna_la_LIBADD = $(UDEV_LIBS) -lm $(DRM_LIBS) brw/libbrw.la \ - fb/libfb.la $(am__append_4) + fb/libfb.la ../../libobj/libcompat.la $(am__append_4) \ + $(am__append_7) $(am__append_10) libsna_la_SOURCES = atomic.h blt.c compiler.h kgem.c kgem.h rop.h \ sna.h sna_accel.c sna_acpi.c sna_blt.c sna_composite.c \ sna_cpu.c sna_cpuid.h sna_damage.c sna_damage.h sna_display.c \ @@ -406,8 +508,8 @@ gen5_render.c gen5_render.h gen6_common.c gen6_common.h \ gen6_render.c gen6_render.h gen7_render.c gen7_render.h \ gen8_eu.c gen8_eu.h gen8_render.c gen8_render.h gen8_vertex.c \ - gen8_vertex.h $(NULL) $(am__append_3) $(am__append_5) \ - $(am__append_6) + gen8_vertex.h $(NULL) $(am__append_3) $(am__append_6) \ + $(am__append_9) $(am__append_11) $(am__append_12) all: all-recursive .SUFFIXES: @@ -445,12 +547,15 @@ clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + libsna.la: $(libsna_la_OBJECTS) $(libsna_la_DEPENDENCIES) $(EXTRA_libsna_la_DEPENDENCIES) $(AM_V_CCLD)$(libsna_la_LINK) $(libsna_la_OBJECTS) $(libsna_la_LIBADD) $(LIBS) @@ -490,11 +595,13 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sna_damage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sna_display.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sna_display_fake.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sna_dri.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sna_dri2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sna_dri3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sna_driver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sna_glyphs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sna_gradient.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sna_io.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sna_present.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sna_render.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sna_stream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sna_threads.Plo@am__quote@ @@ -517,14 +624,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -540,22 +647,25 @@ -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -570,57 +680,12 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -636,12 +701,7 @@ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -653,15 +713,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -670,6 +726,21 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -706,13 +777,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -838,12 +906,11 @@ uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive +.MAKE: $(am__recursive_targets) install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic clean-libtool \ - clean-noinstLTLIBRARIES ctags ctags-recursive distclean \ +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool \ + clean-noinstLTLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ @@ -853,8 +920,8 @@ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am + mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ + uninstall-am @HAVE_DOT_GIT_TRUE@git_version.h: $(top_srcdir)/.git/HEAD $(shell sed -e '/ref:/!d' -e 's#ref: *#$(top_srcdir)/.git/#' < $(top_srcdir)/.git/HEAD) diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_accel.c xserver-xorg-video-intel-2.99.914/src/sna/sna_accel.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_accel.c 2014-02-10 09:24:57.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_accel.c 2014-07-23 14:44:21.000000000 +0000 @@ -78,6 +78,7 @@ #define UNDO 1 #define MIGRATE_ALL 0 +#define DBG_NO_PARTIAL_MOVE_TO_CPU 0 #define DBG_NO_CPU_UPLOAD 0 #define DBG_NO_CPU_DOWNLOAD 0 @@ -107,9 +108,6 @@ #define NO_TILE_8x8 0 #define NO_STIPPLE_8x8 0 -#define IS_STATIC_PTR(ptr) ((uintptr_t)(ptr) & 1) -#define MAKE_STATIC_PTR(ptr) ((void*)((uintptr_t)(ptr) | 1)) - #define IS_COW_OWNER(ptr) ((uintptr_t)(ptr) & 1) #define MAKE_COW_OWNER(ptr) ((void*)((uintptr_t)(ptr) | 1)) #define COW(ptr) (void *)((uintptr_t)(ptr) & ~1) @@ -234,6 +232,13 @@ return r->data == NULL; } +static inline bool region_is_unclipped(const RegionRec *r, int w, int h) +{ + return (region_is_singular(r) && + w == r->extents.x2 - r->extents.x1 && + h == r->extents.y2 - r->extents.y1); +} + typedef struct box32 { int32_t x1, y1, x2, y2; } Box32Rec; @@ -241,21 +246,47 @@ #define PM_IS_SOLID(_draw, _pm) \ (((_pm) & FbFullMask((_draw)->depth)) == FbFullMask((_draw)->depth)) -#ifdef DEBUG_PIXMAP +#ifndef NDEBUG static void _assert_pixmap_contains_box(PixmapPtr pixmap, const BoxRec *box, const char *function) { if (box->x1 < 0 || box->y1 < 0 || box->x2 > pixmap->drawable.width || box->y2 > pixmap->drawable.height) { - FatalError("%s: damage box is beyond the pixmap: box=(%d, %d), (%d, %d), pixmap=(%d, %d)\n", - function, - box->x1, box->y1, box->x2, box->y2, + FatalError("%s: damage box [(%d, %d), (%d, %d)] is beyond the pixmap=%ld size=%dx%d\n", + function, box->x1, box->y1, box->x2, box->y2, + pixmap->drawable.serialNumber, pixmap->drawable.width, pixmap->drawable.height); } } +static void +_assert_pixmap_contains_damage(PixmapPtr pixmap, struct sna_damage *damage, const char *function) +{ + if (damage == NULL) + return; + + _assert_pixmap_contains_box(pixmap, &DAMAGE_PTR(damage)->extents, function); +} +#define assert_pixmap_contains_damage(p,d) _assert_pixmap_contains_damage(p, d, __FUNCTION__) +#else +#define assert_pixmap_contains_damage(p,d) +#endif + +#define __assert_pixmap_damage(p) do { \ + struct sna_pixmap *priv__ = sna_pixmap(p); \ + if (priv__) { \ + assert(priv__->gpu_damage == NULL || priv__->gpu_bo); \ + assert(priv__->gpu_bo == NULL || priv__->gpu_bo->refcnt); \ + assert(priv__->cpu_bo == NULL || priv__->cpu_bo->refcnt); \ + assert_pixmap_contains_damage(p, priv__->gpu_damage); \ + assert_pixmap_contains_damage(p, priv__->cpu_damage); \ + assert_pixmap_map(p, priv__); \ + } \ +} while (0) + +#ifdef DEBUG_PIXMAP static void _assert_pixmap_contains_box_with_offset(PixmapPtr pixmap, const BoxRec *box, int dx, int dy, const char *function) { BoxRec b = *box; @@ -340,10 +371,7 @@ if (priv == NULL) return; - assert(priv->gpu_damage == NULL || priv->gpu_bo); - assert(priv->gpu_bo == NULL || priv->gpu_bo->refcnt); - assert(priv->cpu_bo == NULL || priv->cpu_bo->refcnt); - assert_pixmap_map(p, priv); + __assert_pixmap_damage(p); if (priv->clear) { assert(DAMAGE_IS_ALL(priv->gpu_damage)); @@ -392,12 +420,7 @@ #define assert_pixmap_contains_points(p, pt, n, x, y) #define assert_drawable_contains_box(d, b) #ifndef NDEBUG -#define assert_pixmap_damage(p) do { \ - struct sna_pixmap *priv__ = sna_pixmap(p); \ - assert(priv__ == NULL || priv__->gpu_damage == NULL || priv__->gpu_bo); \ - assert(priv__ == NULL || priv__->gpu_bo == NULL || priv__->gpu_bo->refcnt); \ - assert(priv__ == NULL || priv__->cpu_bo == NULL || priv__->cpu_bo->refcnt); \ -} while (0) +#define assert_pixmap_damage(p) __assert_pixmap_damage(p) #else #define assert_pixmap_damage(p) #endif @@ -408,10 +431,12 @@ static int sigtrap_handler(int sig) { - if (sigtrap) { - /* XXX rate-limited squawk? */ + /* XXX rate-limited squawk? */ + DBG(("%s(sig=%d) sigtrap=%d\n", __FUNCTION__, sig, sigtrap)); + sna_threads_trap(sig); + + if (sigtrap) siglongjmp(sigjmp[--sigtrap], sig); - } return -1; } @@ -448,21 +473,30 @@ static void sna_pixmap_free_gpu(struct sna *sna, struct sna_pixmap *priv) { + DBG(("%s: handle=%d (pinned? %d)\n", __FUNCTION__, priv->gpu_bo ? priv->gpu_bo->handle : 0, priv->pinned)); assert(priv->gpu_damage == NULL || priv->gpu_bo); if (priv->cow) - sna_pixmap_undo_cow(sna, priv, 0); + sna_pixmap_undo_cow(sna, priv, MOVE_WRITE); assert(priv->cow == NULL); + if (priv->move_to_gpu) { + sna_pixmap_discard_shadow_damage(priv, NULL); + priv->move_to_gpu(sna, priv, MOVE_WRITE); + } + sna_damage_destroy(&priv->gpu_damage); priv->clear = false; - if (priv->gpu_bo && !priv->pinned) { - assert(!priv->flush); - assert(!priv->move_to_gpu); - sna_pixmap_unmap(priv->pixmap, priv); - kgem_bo_destroy(&sna->kgem, priv->gpu_bo); - priv->gpu_bo = NULL; + if (priv->gpu_bo) { + if (!priv->pinned) { + assert(!priv->flush); + assert(!priv->move_to_gpu); + sna_pixmap_unmap(priv->pixmap, priv); + kgem_bo_destroy(&sna->kgem, priv->gpu_bo); + priv->gpu_bo = NULL; + } else + kgem_bo_undo(&sna->kgem, priv->gpu_bo); } /* and reset the upload counter */ @@ -473,7 +507,7 @@ sna_pixmap_alloc_cpu(struct sna *sna, PixmapPtr pixmap, struct sna_pixmap *priv, - bool from_gpu) + unsigned flags) { /* Restore after a GTT mapping? */ assert(priv->gpu_damage == NULL || priv->gpu_bo); @@ -485,14 +519,21 @@ assert(priv->stride); if (priv->create & KGEM_CAN_CREATE_CPU) { + unsigned hint; + DBG(("%s: allocating CPU buffer (%dx%d)\n", __FUNCTION__, pixmap->drawable.width, pixmap->drawable.height)); + hint = 0; + if ((flags & MOVE_ASYNC_HINT) == 0 && + ((flags & MOVE_READ) == 0 || (priv->gpu_damage && !priv->clear && !sna->kgem.has_llc))) + hint = CREATE_CPU_MAP | CREATE_INACTIVE | CREATE_NO_THROTTLE; + priv->cpu_bo = kgem_create_cpu_2d(&sna->kgem, pixmap->drawable.width, pixmap->drawable.height, pixmap->drawable.bitsPerPixel, - from_gpu ? 0 : CREATE_CPU_MAP | CREATE_INACTIVE | CREATE_NO_THROTTLE); + hint); if (priv->cpu_bo) { priv->ptr = kgem_bo_map__cpu(&sna->kgem, priv->cpu_bo); if (priv->ptr) { @@ -516,7 +557,6 @@ priv->ptr = malloc(priv->stride * pixmap->drawable.height); } - assert(priv->ptr); done: assert(priv->stride); assert(!priv->mapped); @@ -534,8 +574,8 @@ sna->debug_memory.cpu_bo_allocs--; sna->debug_memory.cpu_bo_bytes -= kgem_bo_size(priv->cpu_bo); #endif - if (!priv->cpu_bo->reusable) { - assert(priv->cpu_bo->flush == true); + if (priv->cpu_bo->flush) { + assert(!priv->cpu_bo->reusable); kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo); sna_accel_watch_flush(sna, -1); } @@ -544,13 +584,16 @@ free(priv->ptr); } -static void sna_pixmap_free_cpu(struct sna *sna, struct sna_pixmap *priv, bool active) +static bool sna_pixmap_free_cpu(struct sna *sna, struct sna_pixmap *priv, bool active) { if (active) - return; + return false; if (IS_STATIC_PTR(priv->ptr)) - return; + return false; + + if (priv->ptr == NULL) + return true; __sna_pixmap_free_cpu(sna, priv); @@ -559,14 +602,17 @@ if (priv->mapped == MAPPED_NONE) priv->pixmap->devPrivate.ptr = NULL; + + return true; } -static inline uint32_t default_tiling(PixmapPtr pixmap, - uint32_t tiling) +static inline uint32_t default_tiling(struct sna *sna, PixmapPtr pixmap) { - struct sna_pixmap *priv = sna_pixmap(pixmap); - struct sna *sna = to_sna_from_pixmap(pixmap); - +#if DEFAULT_TILING == I915_TILING_NONE + return I915_TILING_NONE; +#elif DEFAULT_TILING == I915_TILING_X + return I915_TILING_X; +#else /* Try to avoid hitting the Y-tiling GTT mapping bug on 855GM */ if (sna->kgem.gen == 021) return I915_TILING_X; @@ -580,41 +626,26 @@ pixmap->drawable.height > sna->render.max_3d_size)) return I915_TILING_X; - if (tiling == I915_TILING_Y && - sna_damage_is_all(&priv->cpu_damage, + if (sna_damage_is_all(&sna_pixmap(pixmap)->cpu_damage, pixmap->drawable.width, pixmap->drawable.height)) { DBG(("%s: entire source is damaged, using Y-tiling\n", __FUNCTION__)); - sna_damage_destroy(&priv->gpu_damage); - + sna_damage_destroy(&sna_pixmap(priv)->gpu_damage); return I915_TILING_Y; } - return tiling; + return I915_TILING_Y; +#endif } -pure static uint32_t sna_pixmap_choose_tiling(PixmapPtr pixmap, - uint32_t tiling) +pure static uint32_t sna_pixmap_default_tiling(struct sna *sna, PixmapPtr pixmap) { - struct sna *sna = to_sna_from_pixmap(pixmap); - uint32_t bit; - - /* Use tiling by default, but disable per user request */ - if (pixmap->usage_hint == SNA_CREATE_FB) { - tiling = -I915_TILING_X; - bit = SNA_TILING_FB; - } else { - tiling = default_tiling(pixmap, tiling); - bit = SNA_TILING_2D; - } - if ((sna->tiling & bit) == 0) - tiling = I915_TILING_NONE; - /* Also adjust tiling if it is not supported or likely to * slow us down, */ - return kgem_choose_tiling(&sna->kgem, tiling, + return kgem_choose_tiling(&sna->kgem, + default_tiling(sna, pixmap), pixmap->drawable.width, pixmap->drawable.height, pixmap->drawable.bitsPerPixel); @@ -660,8 +691,8 @@ box.y2 = pixmap->drawable.height; if (!sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->gpu_bo, 0, 0, - pixmap, bo, 0, 0, + &pixmap->drawable, priv->gpu_bo, 0, 0, + &pixmap->drawable, bo, 0, 0, &box, 1, 0)) { DBG(("%s: copy failed\n", __FUNCTION__)); kgem_bo_destroy(&sna->kgem, bo); @@ -684,6 +715,7 @@ _sna_pixmap_init(struct sna_pixmap *priv, PixmapPtr pixmap) { list_init(&priv->flush_list); + list_init(&priv->cow_list); priv->source_count = SOURCE_BIAS; priv->pixmap = pixmap; @@ -719,26 +751,33 @@ return _sna_pixmap_init(priv, pixmap); } -bool sna_pixmap_attach_to_bo(PixmapPtr pixmap, struct kgem_bo *bo) +struct sna_pixmap *sna_pixmap_attach_to_bo(PixmapPtr pixmap, struct kgem_bo *bo) { struct sna_pixmap *priv; assert(bo); + assert(bo->proxy == NULL); + assert(bo->unique_id); priv = sna_pixmap_attach(pixmap); if (!priv) - return false; + return NULL; + + DBG(("%s: attaching %s handle=%d to pixmap=%ld\n", + __FUNCTION__, bo->snoop ? "CPU" : "GPU", bo->handle, pixmap->drawable.serialNumber)); assert(!priv->mapped); assert(!priv->move_to_gpu); - priv->gpu_bo = kgem_bo_reference(bo); - assert(priv->gpu_bo->proxy == NULL); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + if (bo->snoop) { + priv->cpu_bo = bo; + sna_damage_all(&priv->cpu_damage, pixmap); + } else { + priv->gpu_bo = bo; + sna_damage_all(&priv->gpu_damage, pixmap); + } - return true; + return priv; } static int bits_per_pixel(int depth) @@ -898,6 +937,7 @@ pixmap->drawable.height = height; pixmap->usage_hint = usage; + (*priv)->header = true; return pixmap; } @@ -931,12 +971,14 @@ } pixmap = create_pixmap_hdr(sna, screen, width, height, depth, 0, &priv); - if (pixmap == NullPixmap) + if (pixmap == NullPixmap) { + DBG(("%s: allocation failed\n", __FUNCTION__)); goto fallback; + } priv->cpu_bo = kgem_create_map(&sna->kgem, addr, pitch*height, false); if (priv->cpu_bo == NULL) { - priv->header = true; + DBG(("%s: mapping SHM segment failed\n", __FUNCTION__)); sna_pixmap_destroy(pixmap); goto fallback; } @@ -949,11 +991,12 @@ #endif /* Be wary as we cannot cache SHM Pixmap in our freed cache */ + priv->header = false; priv->cpu = true; priv->shm = true; priv->stride = pitch; priv->ptr = MAKE_STATIC_PTR(addr); - sna_damage_all(&priv->cpu_damage, width, height); + sna_damage_all(&priv->cpu_damage, pixmap); pixmap->devKind = pitch; pixmap->devPrivate.ptr = addr; @@ -973,7 +1016,7 @@ { return create_pixmap(to_sna_from_screen(screen), screen, width, height, depth, - CREATE_PIXMAP_USAGE_SCRATCH); + -1); } static PixmapPtr @@ -1007,7 +1050,6 @@ return NullPixmap; priv->stride = PixmapBytePad(width, depth); - priv->header = true; priv->gpu_bo = kgem_create_2d(&sna->kgem, width, height, bpp, tiling, @@ -1018,7 +1060,7 @@ return NullPixmap; } - sna_damage_all(&priv->gpu_damage, width, height); + sna_damage_all(&priv->gpu_damage, pixmap); assert(to_sna_from_pixmap(pixmap) == sna); assert(pixmap->drawable.pScreen == screen); @@ -1087,8 +1129,8 @@ assert(!wedged(sna)); /* XXX */ if (!sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->gpu_bo, 0, 0, - pixmap, bo, 0, 0, + &pixmap->drawable, priv->gpu_bo, 0, 0, + &pixmap->drawable, bo, 0, 0, &box, 1, 0)) { DBG(("%s: copy failed\n", __FUNCTION__)); kgem_bo_destroy(&sna->kgem, bo); @@ -1103,7 +1145,7 @@ assert((priv->gpu_bo->pitch & 255) == 0); /* And export the bo->pitch via pixmap->devKind */ - if (priv->mapped != MAPPED_GTT) { + if (!priv->mapped) { void *ptr; ptr = kgem_bo_map__async(&sna->kgem, priv->gpu_bo); @@ -1112,7 +1154,7 @@ pixmap->devPrivate.ptr = ptr; pixmap->devKind = priv->gpu_bo->pitch; - priv->mapped = MAPPED_GTT; + priv->mapped = ptr == MAP(priv->gpu_bo->map__cpu) ? MAPPED_CPU : MAPPED_GTT; } assert_pixmap_map(pixmap, priv); @@ -1155,9 +1197,7 @@ if (bo == NULL) return FALSE; - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->gpu_damage, pixmap); bo->pitch = pixmap->devKind; priv->stride = pixmap->devKind; @@ -1180,28 +1220,20 @@ DBG(("%s: depth=%d\n", __FUNCTION__, depth)); /* Create a stub to be attached later */ - pixmap = create_pixmap(sna, screen, 0, 0, depth, 0); + pixmap = create_pixmap_hdr(sna, screen, + width, height, depth, 0, + &priv); if (pixmap == NullPixmap) return NullPixmap; - pixmap->devKind = 0; - pixmap->devPrivate.ptr = NULL; - - priv = sna_pixmap_attach(pixmap); - if (priv == NULL) { - free(pixmap); - return NullPixmap; - } - + assert(!priv->mapped); priv->stride = 0; priv->create = 0; if (width|height) { - int bpp = bits_per_pixel(depth); - - assert(!priv->mapped); priv->gpu_bo = kgem_create_2d(&sna->kgem, - width, height, bpp, + width, height, + pixmap->drawable.bitsPerPixel, I915_TILING_NONE, CREATE_GTT_MAP | CREATE_PRIME); if (priv->gpu_bo == NULL) { @@ -1224,14 +1256,12 @@ } pixmap->devKind = priv->gpu_bo->pitch; - pixmap->drawable.width = width; - pixmap->drawable.height = height; priv->stride = priv->gpu_bo->pitch; - priv->mapped = MAPPED_GTT; + priv->mapped = pixmap->devPrivate.ptr == MAP(priv->gpu_bo->map__cpu) ? MAPPED_CPU : MAPPED_GTT; assert_pixmap_map(pixmap, priv); - sna_damage_all(&priv->gpu_damage, width, height); + sna_damage_all(&priv->gpu_damage, pixmap); } return pixmap; @@ -1287,12 +1317,12 @@ goto fallback; case SNA_CREATE_SCRATCH: - if (flags & KGEM_CAN_CREATE_GPU) + if (flags & (KGEM_CAN_CREATE_CPU | KGEM_CAN_CREATE_GPU)) return sna_pixmap_create_scratch(screen, width, height, depth, I915_TILING_Y); else - goto fallback; + return NullPixmap; } if (usage == CREATE_PIXMAP_USAGE_GLYPH_PICTURE) @@ -1326,7 +1356,6 @@ if (pixmap == NullPixmap) return NullPixmap; - priv->header = true; ptr = NULL; } @@ -1371,6 +1400,7 @@ PixmapPtr pixmap, struct sna_pixmap *priv) { + DBG(("%s(pixmap=%ld)\n", __FUNCTION__, pixmap->drawable.serialNumber)); list_del(&priv->flush_list); assert(priv->gpu_damage == NULL); @@ -1379,8 +1409,8 @@ __sna_pixmap_free_cpu(sna, priv); if (priv->header) { - assert(!priv->shm); assert(pixmap->drawable.pScreen == sna->scrn->pScreen); + assert(!priv->shm); pixmap->devPrivate.ptr = sna->freed_pixmap; sna->freed_pixmap = pixmap; #if DEBUG_MEMORY @@ -1419,16 +1449,17 @@ sna_damage_destroy(&priv->gpu_damage); sna_damage_destroy(&priv->cpu_damage); + list_del(&priv->cow_list); if (priv->cow) { struct sna_cow *cow = COW(priv->cow); DBG(("%s: pixmap=%ld discarding cow, refcnt=%d\n", __FUNCTION__, pixmap->drawable.serialNumber, cow->refcnt)); assert(cow->refcnt); - list_del(&priv->cow_list); if (!--cow->refcnt) free(cow); priv->cow = NULL; - } + } else + kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo); if (priv->move_to_gpu) (void)priv->move_to_gpu(sna, priv, 0); @@ -1441,6 +1472,8 @@ } if (priv->shm && kgem_bo_is_busy(priv->cpu_bo)) { + DBG(("%s: deferring release of active SHM pixmap=%ld\n", + __FUNCTION__, pixmap->drawable.serialNumber)); sna_add_flush_pixmap(sna, priv, priv->cpu_bo); kgem_bo_submit(&sna->kgem, priv->cpu_bo); /* XXX ShmDetach */ } else @@ -1476,10 +1509,16 @@ if (priv == NULL) return true; + if (flags & MOVE_ASYNC_HINT) { + /* Not referencing the pointer itself, so do not care */ + return true; + } + if (!priv->mapped) { if (!priv->cpu_bo) return true; + assert(!priv->cpu_bo->needs_flush); assert(priv->pixmap->devKind == priv->cpu_bo->pitch); return priv->pixmap->devPrivate.ptr == MAP(priv->cpu_bo->map__cpu); } @@ -1543,6 +1582,11 @@ return has_coherent_map(sna, priv->gpu_bo, flags); } + if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo)) { + DBG(("%s: yes, has CPU bo and is active on CPU\n", __FUNCTION__)); + return true; + } + if (priv->cpu_bo && priv->cpu) { DBG(("%s: no, has CPU bo and was last active on CPU, presume future CPU activity\n", __FUNCTION__)); return false; @@ -1554,10 +1598,34 @@ return false; } - return (pixmap->devKind * pixmap->drawable.height >> 12) > + return (priv->stride * pixmap->drawable.height >> 12) > sna->kgem.half_cpu_cache_pages; } +static bool sna_pixmap_alloc_gpu(struct sna *sna, + PixmapPtr pixmap, + struct sna_pixmap *priv, + unsigned flags) +{ + uint32_t tiling; + + /* Use tiling by default, but disable per user request */ + if (pixmap->usage_hint == SNA_CREATE_FB && (sna->flags & SNA_LINEAR_FB) == 0) { + flags |= CREATE_SCANOUT; + tiling = -I915_TILING_X; + } else + tiling = sna_pixmap_default_tiling(sna, pixmap); + + DBG(("%s: pixmap=%ld\n", __FUNCTION__, pixmap->drawable.serialNumber)); + + priv->gpu_bo = kgem_create_2d(&sna->kgem, + pixmap->drawable.width, + pixmap->drawable.height, + pixmap->drawable.bitsPerPixel, + tiling, flags); + return priv->gpu_bo != NULL; +} + static bool sna_pixmap_create_mappable_gpu(PixmapPtr pixmap, bool can_replace) @@ -1584,22 +1652,9 @@ } if (priv->gpu_bo == NULL) { - unsigned create; - assert_pixmap_damage(pixmap); assert(priv->gpu_damage == NULL); - - create = CREATE_GTT_MAP | CREATE_INACTIVE; - if (pixmap->usage_hint == SNA_CREATE_FB) - create |= CREATE_SCANOUT; - - priv->gpu_bo = - kgem_create_2d(&sna->kgem, - pixmap->drawable.width, - pixmap->drawable.height, - pixmap->drawable.bitsPerPixel, - sna_pixmap_choose_tiling(pixmap, DEFAULT_TILING), - create); + sna_pixmap_alloc_gpu(sna, pixmap, priv, CREATE_GTT_MAP | CREATE_INACTIVE); } out: @@ -1610,38 +1665,141 @@ !kgem_bo_is_busy(priv->gpu_bo)); } -static inline bool use_cpu_bo_for_download(struct sna *sna, - struct sna_pixmap *priv, - int nbox, const BoxRec *box) +static inline bool gpu_bo_download(struct sna *sna, + struct sna_pixmap *priv, + int n, const BoxRec *box, + bool idle) { - if (DBG_NO_CPU_DOWNLOAD) + char *src; + + if (!USE_INPLACE) return false; - if (wedged(sna)) + switch (priv->gpu_bo->tiling) { + case I915_TILING_Y: return false; + case I915_TILING_X: + if (!sna->kgem.memcpy_from_tiled_x) + return false; + default: + break; + } - if (priv->cpu_bo == NULL || !sna->kgem.can_blt_cpu) + if (!kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, FORCE_FULL_SYNC)) return false; - if (kgem_bo_is_busy(priv->gpu_bo) || kgem_bo_is_busy(priv->cpu_bo)) { - DBG(("%s: yes, either bo is busy, so use GPU for readback\n", - __FUNCTION__)); - return true; + if (idle) { + if (__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo)) + return false; + + if (priv->cpu_bo && __kgem_bo_is_busy(&sna->kgem, priv->cpu_bo)) + return false; } - /* Is it worth detiling? */ - assert(box[0].y1 < box[nbox-1].y2); - if (kgem_bo_can_map(&sna->kgem, priv->gpu_bo) && - (box[nbox-1].y2 - box[0].y1 - 1) * priv->gpu_bo->pitch < 4096) { - DBG(("%s: no, tiny transfer (height=%d, pitch=%d) expect to read inplace\n", - __FUNCTION__, box[nbox-1].y2-box[0].y1, priv->gpu_bo->pitch)); + src = kgem_bo_map__cpu(&sna->kgem, priv->gpu_bo); + if (src == NULL) + return false; + + kgem_bo_sync__cpu_full(&sna->kgem, priv->gpu_bo, FORCE_FULL_SYNC); + + if (priv->cpu_bo) + kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo); + assert(has_coherent_ptr(sna, priv, MOVE_WRITE)); + + if (sigtrap_get()) return false; + + if (priv->gpu_bo->tiling) { + int bpp = priv->pixmap->drawable.bitsPerPixel; + void *dst = priv->pixmap->devPrivate.ptr; + int dst_pitch = priv->pixmap->devKind; + + DBG(("%s: download through a tiled CPU map\n", __FUNCTION__)); + do { + DBG(("%s: box (%d, %d), (%d, %d)\n", + __FUNCTION__, box->x1, box->y1, box->x2, box->y2)); + memcpy_from_tiled_x(&sna->kgem, src, dst, bpp, + priv->gpu_bo->pitch, dst_pitch, + box->x1, box->y1, + box->x1, box->y1, + box->x2 - box->x1, box->y2 - box->y1); + box++; + } while (--n); + } else { + int bpp = priv->pixmap->drawable.bitsPerPixel; + void *dst = priv->pixmap->devPrivate.ptr; + int dst_pitch = priv->pixmap->devKind; + + DBG(("%s: download through a linear CPU map\n", __FUNCTION__)); + do { + DBG(("%s: box (%d, %d), (%d, %d)\n", + __FUNCTION__, box->x1, box->y1, box->x2, box->y2)); + memcpy_blt(src, dst, bpp, + priv->gpu_bo->pitch, dst_pitch, + box->x1, box->y1, + box->x1, box->y1, + box->x2 - box->x1, box->y2 - box->y1); + box++; + } while (--n); } - DBG(("%s: yes, default action\n", __FUNCTION__)); + sigtrap_put(); return true; } +static inline bool cpu_bo_download(struct sna *sna, + struct sna_pixmap *priv, + int n, const BoxRec *box) +{ + if (DBG_NO_CPU_DOWNLOAD) + return false; + + if (wedged(sna)) + return false; + + if (priv->cpu_bo == NULL || !sna->kgem.can_blt_cpu) + return false; + + if (!kgem_bo_is_busy(priv->gpu_bo) && !kgem_bo_is_busy(priv->cpu_bo)) { + /* Is it worth detiling? */ + assert(box[0].y1 < box[n-1].y2); + if (kgem_bo_can_map(&sna->kgem, priv->gpu_bo) && + (box[n-1].y2 - box[0].y1 - 1) * priv->gpu_bo->pitch < 4096) { + DBG(("%s: no, tiny transfer (height=%d, pitch=%d) expect to read inplace\n", + __FUNCTION__, box[n-1].y2-box[0].y1, priv->gpu_bo->pitch)); + return false; + } + } + + DBG(("%s: using GPU write to CPU bo for download from GPU\n", __FUNCTION__)); + return sna->render.copy_boxes(sna, GXcopy, + &priv->pixmap->drawable, priv->gpu_bo, 0, 0, + &priv->pixmap->drawable, priv->cpu_bo, 0, 0, + box, n, COPY_LAST); +} + +static void download_boxes(struct sna *sna, + struct sna_pixmap *priv, + int n, const BoxRec *box) +{ + bool ok; + + DBG(("%s: nbox=%d\n", __FUNCTION__, n)); + + ok = gpu_bo_download(sna, priv, n, box, true); + if (!ok) + ok = cpu_bo_download(sna, priv, n, box); + if (!ok) + ok = gpu_bo_download(sna, priv, n, box, false); + if (!ok) { + if (priv->cpu_bo) + kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo); + assert(priv->mapped == MAPPED_NONE); + assert(has_coherent_ptr(sna, priv, MOVE_WRITE)); + sna_read_boxes(sna, priv->pixmap, priv->gpu_bo, box, n); + } +} + static inline bool use_cpu_bo_for_upload(struct sna *sna, struct sna_pixmap *priv, unsigned flags) @@ -1688,7 +1846,11 @@ assert(priv->gpu_bo == cow->bo); assert(cow->refcnt); - list_del(&priv->cow_list); + if (flags && (flags & MOVE_WRITE) == 0 && IS_COW_OWNER(priv->cow)) + return true; + + if (!IS_COW_OWNER(priv->cow)) + list_del(&priv->cow_list); if (!--cow->refcnt) { DBG(("%s: freeing cow\n", __FUNCTION__)); @@ -1708,7 +1870,7 @@ bo = kgem_create_2d(&sna->kgem, box.x2, box.y2, pixmap->drawable.bitsPerPixel, - sna_pixmap_choose_tiling(pixmap, DEFAULT_TILING), + sna_pixmap_default_tiling(sna, pixmap), 0); if (bo == NULL) { cow->refcnt++; @@ -1717,8 +1879,8 @@ } if (!sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->gpu_bo, 0, 0, - pixmap, bo, 0, 0, + &pixmap->drawable, priv->gpu_bo, 0, 0, + &pixmap->drawable, bo, 0, 0, &box, 1, 0)) { DBG(("%s: copy failed\n", __FUNCTION__)); kgem_bo_destroy(&sna->kgem, bo); @@ -1757,7 +1919,7 @@ bo = kgem_create_2d(&sna->kgem, box.x2, box.y2, pixmap->drawable.bitsPerPixel, - sna_pixmap_choose_tiling(pixmap, DEFAULT_TILING), + sna_pixmap_default_tiling(sna, pixmap), 0); if (bo == NULL) { cow->refcnt++; @@ -1766,8 +1928,8 @@ } if (!sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->gpu_bo, 0, 0, - pixmap, bo, 0, 0, + &pixmap->drawable, priv->gpu_bo, 0, 0, + &pixmap->drawable, bo, 0, 0, &box, 1, 0)) { DBG(("%s: copy failed\n", __FUNCTION__)); kgem_bo_destroy(&sna->kgem, bo); @@ -1817,6 +1979,7 @@ assert(dst_priv->move_to_gpu == NULL); assert(!dst_priv->flush); + assert(list_is_empty(&dst_priv->cow_list)); cow = COW(src_priv->cow); if (cow == NULL) { @@ -1835,7 +1998,6 @@ cow->bo->handle)); src_priv->cow = MAKE_COW_OWNER(cow); - list_init(&src_priv->cow_list); } if (cow == COW(dst_priv->cow)) { @@ -1867,6 +2029,9 @@ static inline bool operate_inplace(struct sna_pixmap *priv, unsigned flags) { + if (!USE_INPLACE) + return false; + if ((flags & MOVE_INPLACE_HINT) == 0) { DBG(("%s: no, inplace operation not suitable\n", __FUNCTION__)); return false; @@ -1889,7 +2054,7 @@ return false; } - if (priv->cpu_damage && flags & MOVE_READ) { + if ((priv->gpu_damage == NULL || priv->cpu_damage) && flags & MOVE_READ) { DBG(("%s: no, has CPU damage and requires readback\n", __FUNCTION__)); return false; } @@ -1942,15 +2107,20 @@ assert(priv->gpu_damage == NULL || priv->gpu_bo); if ((flags & MOVE_READ) == 0 && UNDO) { - if (priv->gpu_bo) - kgem_bo_undo(&sna->kgem, priv->gpu_bo); - if (priv->cpu_bo) - kgem_bo_undo(&sna->kgem, priv->cpu_bo); + kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo); + if (priv->move_to_gpu) + sna_pixmap_discard_shadow_damage(priv, NULL); } - if (flags & MOVE_WRITE && priv->gpu_bo && priv->gpu_bo->proxy) { - DBG(("%s: discarding cached upload buffer\n", __FUNCTION__)); + if (kgem_bo_discard_cache(priv->gpu_bo, flags & MOVE_WRITE)) { assert(DAMAGE_IS_ALL(priv->cpu_damage)); + if (DAMAGE_IS_ALL(priv->gpu_damage)) { + DBG(("%s: using magical upload buffer\n", __FUNCTION__)); + goto skip; + } + + DBG(("%s: discarding cached upload buffer\n", __FUNCTION__)); + assert(priv->gpu_damage == NULL); assert(!priv->pinned); assert(!priv->mapped); kgem_bo_destroy(&sna->kgem, priv->gpu_bo); @@ -1960,17 +2130,13 @@ if (DAMAGE_IS_ALL(priv->cpu_damage)) { DBG(("%s: CPU all-damaged\n", __FUNCTION__)); assert(priv->gpu_damage == NULL || DAMAGE_IS_ALL(priv->gpu_damage)); + assert(priv->gpu_damage == NULL || (flags & MOVE_WRITE) == 0); goto done; } - if (priv->move_to_gpu && !priv->move_to_gpu(sna, priv, priv->gpu_damage ? flags & MOVE_READ: 0)) { - DBG(("%s: move-to-gpu override failed\n", __FUNCTION__)); - return false; - } - if (USE_INPLACE && (flags & MOVE_READ) == 0 && !(priv->cow || priv->move_to_gpu)) { assert(flags & MOVE_WRITE); - DBG(("%s: no readbck, discarding gpu damage [%d], pending clear[%d]\n", + DBG(("%s: no readback, discarding gpu damage [%d], pending clear[%d]\n", __FUNCTION__, priv->gpu_damage != NULL, priv->clear)); if ((priv->gpu_bo || priv->create & KGEM_CAN_CREATE_GPU) && @@ -1995,9 +2161,7 @@ assert(has_coherent_ptr(sna, priv, flags)); assert(priv->gpu_bo->proxy == NULL); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->gpu_damage, pixmap); sna_damage_destroy(&priv->cpu_damage); priv->clear = false; list_del(&priv->flush_list); @@ -2005,7 +2169,7 @@ assert(!priv->shm); assert(priv->cpu_bo == NULL || !priv->cpu_bo->flush); sna_pixmap_free_cpu(sna, priv, priv->cpu); - priv->cpu = false; + priv->cpu &= priv->mapped == MAPPED_CPU; assert_pixmap_damage(pixmap); return true; @@ -2014,7 +2178,8 @@ skip_inplace_map: sna_damage_destroy(&priv->gpu_damage); priv->clear = false; - if (priv->cpu_bo && !priv->cpu_bo->flush && + if ((flags & MOVE_ASYNC_HINT) == 0 && + priv->cpu_bo && !priv->cpu_bo->flush && __kgem_bo_is_busy(&sna->kgem, priv->cpu_bo)) { DBG(("%s: discarding busy CPU bo\n", __FUNCTION__)); assert(!priv->shm); @@ -2024,7 +2189,7 @@ sna_pixmap_free_cpu(sna, priv, false); assert(priv->mapped == MAPPED_NONE); - if (!sna_pixmap_alloc_cpu(sna, pixmap, priv, false)) + if (!sna_pixmap_alloc_cpu(sna, pixmap, priv, 0)) return false; assert(priv->mapped == MAPPED_NONE); assert(pixmap->devPrivate.ptr == PTR(priv->ptr)); @@ -2033,17 +2198,18 @@ } } - assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL); + assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL || (flags & MOVE_WRITE) == 0); - if (USE_INPLACE && - operate_inplace(priv, flags) && + if (operate_inplace(priv, flags) && pixmap_inplace(sna, pixmap, priv, flags) && sna_pixmap_create_mappable_gpu(pixmap, (flags & MOVE_READ) == 0)) { void *ptr; DBG(("%s: try to operate inplace (GTT)\n", __FUNCTION__)); + assert(priv->gpu_bo); assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0); assert(!priv->move_to_gpu); + assert(priv->gpu_bo->proxy == NULL || (flags & MOVE_WRITE) == 0); assert((flags & MOVE_READ) == 0 || priv->cpu_damage == NULL); /* XXX only sync for writes? */ kgem_bo_submit(&sna->kgem, priv->gpu_bo); @@ -2058,15 +2224,13 @@ if (flags & MOVE_WRITE) { assert(priv->gpu_bo->proxy == NULL); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->gpu_damage, pixmap); sna_damage_destroy(&priv->cpu_damage); sna_pixmap_free_cpu(sna, priv, priv->cpu); list_del(&priv->flush_list); priv->clear = false; } - priv->cpu = false; + priv->cpu &= priv->mapped == MAPPED_CPU; assert_pixmap_damage(pixmap); DBG(("%s: operate inplace (GTT)\n", __FUNCTION__)); @@ -2077,17 +2241,18 @@ sna_pixmap_unmap(pixmap, priv); if (USE_INPLACE && - priv->gpu_damage && priv->cpu_damage == NULL && + (flags & MOVE_WRITE ? (void *)priv->gpu_bo : (void *)priv->gpu_damage) && priv->cpu_damage == NULL && priv->gpu_bo->tiling == I915_TILING_NONE && (flags & MOVE_READ || kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, flags & MOVE_WRITE)) && ((flags & (MOVE_WRITE | MOVE_ASYNC_HINT)) == 0 || - (!priv->cow && !priv->move_to_gpu && - !__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo)))) { + (!priv->cow && !priv->move_to_gpu && !__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo)))) { void *ptr; DBG(("%s: try to operate inplace (CPU)\n", __FUNCTION__)); + assert(priv->gpu_bo); assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0); assert(priv->move_to_gpu == NULL || (flags & MOVE_WRITE) == 0); + assert(priv->gpu_bo->proxy == NULL || (flags & MOVE_WRITE) == 0); assert(!priv->mapped); assert(priv->gpu_bo->tiling == I915_TILING_NONE); @@ -2101,15 +2266,13 @@ if (flags & MOVE_WRITE) { assert(priv->gpu_bo->proxy == NULL); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->gpu_damage, pixmap); sna_damage_destroy(&priv->cpu_damage); sna_pixmap_free_cpu(sna, priv, priv->cpu); list_del(&priv->flush_list); priv->clear = false; + priv->cpu = true; } - priv->cpu = true; assert(pixmap->devPrivate.ptr == MAP(priv->gpu_bo->map__cpu)); kgem_bo_sync__cpu_full(&sna->kgem, priv->gpu_bo, @@ -2132,83 +2295,84 @@ assert(priv->mapped == MAPPED_NONE); if (pixmap->devPrivate.ptr == NULL && - !sna_pixmap_alloc_cpu(sna, pixmap, priv, - flags & MOVE_READ ? priv->gpu_damage && !priv->clear : 0)) + !sna_pixmap_alloc_cpu(sna, pixmap, priv, flags)) return false; assert(priv->mapped == MAPPED_NONE); assert(pixmap->devPrivate.ptr == PTR(priv->ptr)); - if (priv->clear) { - DBG(("%s: applying clear [%08x] size=%dx%d, stride=%d (total=%d)\n", - __FUNCTION__, priv->clear_color, pixmap->drawable.width, pixmap->drawable.height, - pixmap->devKind, pixmap->devKind * pixmap->drawable.height)); + if (flags & MOVE_READ) { + if (priv->clear) { + DBG(("%s: applying clear [%08x] size=%dx%d, stride=%d (total=%d)\n", + __FUNCTION__, priv->clear_color, pixmap->drawable.width, pixmap->drawable.height, + pixmap->devKind, pixmap->devKind * pixmap->drawable.height)); - if (priv->cpu_bo) { - DBG(("%s: syncing CPU bo\n", __FUNCTION__)); - kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo); - assert(pixmap->devPrivate.ptr == MAP(priv->cpu_bo->map__cpu)); - } + if (priv->cpu_bo) { + if ((flags & MOVE_ASYNC_HINT || priv->cpu_bo->exec) && + sna->render.fill_one(sna, + pixmap, priv->cpu_bo, priv->clear_color, + 0, 0, + pixmap->drawable.width, + pixmap->drawable.height, + GXcopy)) + goto clear_done; + + DBG(("%s: syncing CPU bo\n", __FUNCTION__)); + kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo); + assert(pixmap->devPrivate.ptr == MAP(priv->cpu_bo->map__cpu)); + } + + assert(pixmap->devKind); + if (priv->clear_color == 0 || + pixmap->drawable.bitsPerPixel == 8 || + priv->clear_color == (1 << pixmap->drawable.depth) - 1) { + memset(pixmap->devPrivate.ptr, priv->clear_color, + (size_t)pixmap->devKind * pixmap->drawable.height); + } else { + pixman_fill(pixmap->devPrivate.ptr, + pixmap->devKind/sizeof(uint32_t), + pixmap->drawable.bitsPerPixel, + 0, 0, + pixmap->drawable.width, + pixmap->drawable.height, + priv->clear_color); + } - if (priv->clear_color == 0 || - pixmap->drawable.bitsPerPixel == 8 || - priv->clear_color == (1 << pixmap->drawable.depth) - 1) { - memset(pixmap->devPrivate.ptr, priv->clear_color, - (size_t)pixmap->devKind * pixmap->drawable.height); - } else { - pixman_fill(pixmap->devPrivate.ptr, - pixmap->devKind/sizeof(uint32_t), - pixmap->drawable.bitsPerPixel, - 0, 0, - pixmap->drawable.width, - pixmap->drawable.height, - priv->clear_color); +clear_done: + sna_damage_all(&priv->cpu_damage, pixmap); + sna_pixmap_free_gpu(sna, priv); + assert(priv->gpu_damage == NULL); + assert(priv->clear == false); } - sna_damage_all(&priv->cpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); - sna_pixmap_free_gpu(sna, priv); - assert(priv->gpu_damage == NULL); - assert(priv->clear == false); - } + if (priv->gpu_damage) { + const BoxRec *box; + int n; - if (priv->gpu_damage) { - BoxPtr box; - int n; - - DBG(("%s: flushing GPU damage\n", __FUNCTION__)); - assert(priv->gpu_bo); + DBG(("%s: flushing GPU damage\n", __FUNCTION__)); + assert(priv->gpu_bo); - n = sna_damage_get_boxes(priv->gpu_damage, &box); - if (n) { - bool ok = false; + n = sna_damage_get_boxes(priv->gpu_damage, &box); + if (n) { + if (priv->move_to_gpu && !priv->move_to_gpu(sna, priv, MOVE_READ)) { + DBG(("%s: move-to-gpu override failed\n", __FUNCTION__)); + return false; + } - if (use_cpu_bo_for_download(sna, priv, n, box)) { - DBG(("%s: using CPU bo for download from GPU\n", __FUNCTION__)); - ok = sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->gpu_bo, 0, 0, - pixmap, priv->cpu_bo, 0, 0, - box, n, COPY_LAST); - } - if (!ok) { - assert(has_coherent_ptr(sna, sna_pixmap(pixmap), MOVE_READ)); - sna_read_boxes(sna, pixmap, priv->gpu_bo, - box, n); + download_boxes(sna, priv, n, box); } - } - __sna_damage_destroy(DAMAGE_PTR(priv->gpu_damage)); - priv->gpu_damage = NULL; + __sna_damage_destroy(DAMAGE_PTR(priv->gpu_damage)); + priv->gpu_damage = NULL; + } } if (flags & MOVE_WRITE || priv->create & KGEM_CAN_CREATE_LARGE) { mark_damage: DBG(("%s: marking as damaged\n", __FUNCTION__)); - sna_damage_all(&priv->cpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); - assert(priv->gpu_damage == NULL); + sna_damage_all(&priv->cpu_damage, pixmap); sna_pixmap_free_gpu(sna, priv); + assert(priv->gpu_damage == NULL); + assert(priv->clear == false); if (priv->flush) { assert(!priv->shm); @@ -2239,9 +2403,8 @@ assert((flags & MOVE_WRITE) == 0 || !kgem_bo_is_busy(priv->cpu_bo)); } } - priv->cpu = - (flags & (MOVE_INPLACE_HINT | MOVE_ASYNC_HINT)) == 0 && - !DAMAGE_IS_ALL(priv->gpu_damage); +skip: + priv->cpu |= (flags & (MOVE_WRITE | MOVE_ASYNC_HINT)) == MOVE_WRITE; assert(pixmap->devPrivate.ptr == PTR(priv->ptr)); assert(pixmap->devKind); assert_pixmap_damage(pixmap); @@ -2275,21 +2438,6 @@ re->y1 + dy < de->y2 && re->y2 + dy > de->y1); } -#ifndef NDEBUG -static bool -pixmap_contains_damage(PixmapPtr pixmap, struct sna_damage *damage) -{ - if (damage == NULL) - return true; - - damage = DAMAGE_PTR(damage); - return (damage->extents.x2 <= pixmap->drawable.width && - damage->extents.y2 <= pixmap->drawable.height && - damage->extents.x1 >= 0 && - damage->extents.y1 >= 0); -} -#endif - static inline bool region_inplace(struct sna *sna, PixmapPtr pixmap, RegionPtr region, @@ -2353,6 +2501,27 @@ >= sna->kgem.half_cpu_cache_pages; } +static bool cpu_clear_boxes(struct sna *sna, + PixmapPtr pixmap, + struct sna_pixmap *priv, + const BoxRec *box, int n) +{ + struct sna_fill_op fill; + + if (!sna_fill_init_blt(&fill, sna, + pixmap, priv->cpu_bo, + GXcopy, priv->clear_color, + FILL_BOXES)) { + DBG(("%s: unsupported fill\n", + __FUNCTION__)); + return false; + } + + fill.boxes(sna, &fill, box, n); + fill.done(sna, &fill); + return true; +} + bool sna_drawable_move_region_to_cpu(DrawablePtr drawable, RegionPtr region, @@ -2363,7 +2532,7 @@ struct sna_pixmap *priv; int16_t dx, dy; - DBG(("%s(pixmap=%ld (%dx%d), [(%d, %d), (%d, %d)], flags=%d)\n", + DBG(("%s(pixmap=%ld (%dx%d), [(%d, %d), (%d, %d)], flags=%x)\n", __FUNCTION__, pixmap->drawable.serialNumber, pixmap->drawable.width, pixmap->drawable.height, RegionExtents(region)->x1, RegionExtents(region)->y1, @@ -2379,6 +2548,12 @@ if (box_empty(®ion->extents)) return true; + if (MIGRATE_ALL || DBG_NO_PARTIAL_MOVE_TO_CPU) { + if (!region_subsumes_pixmap(region, pixmap)) + flags |= MOVE_READ; + return _sna_pixmap_move_to_cpu(pixmap, flags); + } + priv = sna_pixmap(pixmap); if (priv == NULL) { DBG(("%s: not attached to pixmap %ld (depth %d)\n", @@ -2388,9 +2563,15 @@ assert(priv->gpu_damage == NULL || priv->gpu_bo); - if (flags & MOVE_WRITE && priv->gpu_bo && priv->gpu_bo->proxy) { - DBG(("%s: discarding cached upload buffer\n", __FUNCTION__)); + if (kgem_bo_discard_cache(priv->gpu_bo, flags & MOVE_WRITE)) { assert(DAMAGE_IS_ALL(priv->cpu_damage)); + if (DAMAGE_IS_ALL(priv->gpu_damage)) { + DBG(("%s: using magical upload buffer\n", __FUNCTION__)); + goto skip; + } + + DBG(("%s: discarding cached upload buffer\n", __FUNCTION__)); + assert(priv->gpu_damage == NULL); assert(!priv->pinned); assert(!priv->mapped); kgem_bo_destroy(&sna->kgem, priv->gpu_bo); @@ -2421,8 +2602,7 @@ RegionTranslate(region, dx, dy); if (sna->kgem.has_llc && !priv->pinned && - sna_pixmap_choose_tiling(pixmap, - DEFAULT_TILING) == I915_TILING_NONE) { + sna_pixmap_default_tiling(sna, pixmap) == I915_TILING_NONE) { #ifdef DEBUG_MEMORY sna->debug_memory.cpu_bo_allocs--; sna->debug_memory.cpu_bo_bytes -= kgem_bo_size(priv->cpu_bo); @@ -2438,6 +2618,7 @@ priv->gpu_damage = priv->cpu_damage; priv->cpu_damage = NULL; + sna_damage_subtract(&priv->gpu_damage, region); discard_gpu = false; } else { DBG(("%s: pushing surrounding damage to GPU bo\n", __FUNCTION__)); @@ -2447,13 +2628,11 @@ sna_pixmap_free_cpu(sna, priv, false); if (priv->flush) sna_add_flush_pixmap(sna, priv, priv->gpu_bo); - discard_gpu = false; assert(priv->cpu_damage == NULL); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->gpu_damage, pixmap); sna_damage_subtract(&priv->gpu_damage, region); + discard_gpu = false; } } sna_damage_add(&priv->cpu_damage, region); @@ -2470,7 +2649,7 @@ sna_pixmap_unmap(pixmap, priv); assert(priv->mapped == MAPPED_NONE); if (pixmap->devPrivate.ptr == NULL && - !sna_pixmap_alloc_cpu(sna, pixmap, priv, false)) + !sna_pixmap_alloc_cpu(sna, pixmap, priv, flags)) return false; assert(priv->mapped == MAPPED_NONE); assert(pixmap->devPrivate.ptr == PTR(priv->ptr)); @@ -2481,55 +2660,53 @@ if (USE_INPLACE && (priv->create & KGEM_CAN_CREATE_LARGE || ((flags & (MOVE_READ | MOVE_ASYNC_HINT)) == 0 && - (priv->flush || box_inplace(pixmap, ®ion->extents))))) { + (priv->flush || + (flags & MOVE_WHOLE_HINT && whole_pixmap_inplace(pixmap)) || + box_inplace(pixmap, ®ion->extents))))) { DBG(("%s: marking for inplace hint (%d, %d)\n", __FUNCTION__, priv->flush, box_inplace(pixmap, ®ion->extents))); flags |= MOVE_INPLACE_HINT; } - if (flags & MOVE_WHOLE_HINT) - return _sna_pixmap_move_to_cpu(pixmap, flags); - - if (priv->gpu_bo == NULL && - (priv->create & KGEM_CAN_CREATE_GPU) == 0 && - flags & MOVE_WRITE) - return _sna_pixmap_move_to_cpu(pixmap, flags); - - if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { - DBG(("%s: delta=(%d, %d)\n", __FUNCTION__, dx, dy)); - RegionTranslate(region, dx, dy); - } - - if (region_subsumes_drawable(region, &pixmap->drawable)) { - DBG(("%s: region (%d, %d), (%d, %d) subsumes pixmap (%dx%d)\n", + if (region_subsumes_pixmap(region, pixmap)) { + DBG(("%s: region (%d, %d), (%d, %d) + (%d, %d) subsumes pixmap (%dx%d)\n", __FUNCTION__, region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2, + get_drawable_dx(drawable), get_drawable_dy(drawable), pixmap->drawable.width, pixmap->drawable.height)); - if (dx | dy) - RegionTranslate(region, -dx, -dy); return _sna_pixmap_move_to_cpu(pixmap, flags); } - if (priv->move_to_gpu && !priv->move_to_gpu(sna, priv, MOVE_READ)) { - DBG(("%s: move-to-gpu override failed\n", __FUNCTION__)); - if (dx | dy) - RegionTranslate(region, -dx, -dy); - return false; + if (priv->move_to_gpu) { + if ((flags & MOVE_READ) == 0) + sna_pixmap_discard_shadow_damage(priv, region); + if (!priv->move_to_gpu(sna, priv, MOVE_READ)) { + DBG(("%s: move-to-gpu override failed\n", __FUNCTION__)); + return NULL; + } } - if (USE_INPLACE && - operate_inplace(priv, flags) && + assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL || (flags & MOVE_WRITE) == 0); + + if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { + DBG(("%s: delta=(%d, %d)\n", __FUNCTION__, dx, dy)); + RegionTranslate(region, dx, dy); + } + + if (operate_inplace(priv, flags) && region_inplace(sna, pixmap, region, priv, flags) && sna_pixmap_create_mappable_gpu(pixmap, false)) { void *ptr; DBG(("%s: try to operate inplace\n", __FUNCTION__)); + assert(priv->gpu_bo); assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0); assert(priv->move_to_gpu == NULL || (flags & MOVE_WRITE) == 0); + assert(priv->gpu_bo->proxy == NULL || (flags & MOVE_WRITE) == 0); /* XXX only sync for writes? */ kgem_bo_submit(&sna->kgem, priv->gpu_bo); @@ -2559,7 +2736,7 @@ } priv->clear = false; } - priv->cpu = false; + priv->cpu &= priv->mapped == MAPPED_CPU; assert_pixmap_damage(pixmap); if (dx | dy) RegionTranslate(region, -dx, -dy); @@ -2570,11 +2747,27 @@ if (priv->clear && flags & MOVE_WRITE) { DBG(("%s: pending clear, moving whole pixmap for partial write\n", __FUNCTION__)); +demote_to_cpu: if (dx | dy) RegionTranslate(region, -dx, -dy); return _sna_pixmap_move_to_cpu(pixmap, flags | MOVE_READ); } + if (flags & MOVE_WHOLE_HINT) { + DBG(("%s: region (%d, %d), (%d, %d) marked with WHOLE hint, pixmap %dx%d\n", + __FUNCTION__, + region->extents.x1, + region->extents.y1, + region->extents.x2, + region->extents.y2, + pixmap->drawable.width, + pixmap->drawable.height)); +move_to_cpu: + if ((flags & MOVE_READ) == 0) + sna_damage_subtract(&priv->gpu_damage, region); + goto demote_to_cpu; + } + sna_pixmap_unmap(pixmap, priv); if (USE_INPLACE && @@ -2591,8 +2784,10 @@ DBG(("%s: try to operate inplace (CPU), read? %d, write? %d\n", __FUNCTION__, !!(flags & MOVE_READ), !!(flags & MOVE_WRITE))); - assert(sna_damage_contains_box(priv->gpu_damage, ®ion->extents) == PIXMAN_REGION_IN); - assert(sna_damage_contains_box(priv->cpu_damage, ®ion->extents) == PIXMAN_REGION_OUT); + assert(priv->gpu_bo); + assert(priv->gpu_bo->proxy == NULL || (flags & MOVE_WRITE) == 0); + assert(sna_damage_contains_box(&priv->gpu_damage, ®ion->extents) == PIXMAN_REGION_IN); + assert(sna_damage_contains_box(&priv->cpu_damage, ®ion->extents) == PIXMAN_REGION_OUT); ptr = kgem_bo_map__cpu(&sna->kgem, priv->gpu_bo); if (ptr != NULL) { @@ -2639,21 +2834,16 @@ sna_damage_subtract(&priv->cpu_damage, region); if (sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_ASYNC_HINT)) { assert(priv->gpu_bo); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->gpu_damage, pixmap); sna_pixmap_free_cpu(sna, priv, false); } } assert(priv->mapped == MAPPED_NONE); if (pixmap->devPrivate.ptr == NULL && - !sna_pixmap_alloc_cpu(sna, pixmap, priv, - flags & MOVE_READ ? priv->gpu_damage && !priv->clear : 0)) { - if (dx | dy) - RegionTranslate(region, -dx, -dy); + !sna_pixmap_alloc_cpu(sna, pixmap, priv, flags)) { DBG(("%s: CPU bo allocation failed, trying full move-to-cpu\n", __FUNCTION__)); - return _sna_pixmap_move_to_cpu(pixmap, flags | MOVE_READ); + goto move_to_cpu; } assert(priv->mapped == MAPPED_NONE); assert(pixmap->devPrivate.ptr == PTR(priv->ptr)); @@ -2664,19 +2854,33 @@ } assert(priv->gpu_bo->proxy == NULL); + + if ((flags & MOVE_READ) == 0) { + assert(flags & MOVE_WRITE); + sna_damage_subtract(&priv->gpu_damage, region); + priv->clear = false; + goto done; + } + if (priv->clear) { - int n = RegionNumRects(region); - BoxPtr box = RegionRects(region); + int n = region_num_rects(region); + const BoxRec *box = region_rects(region); assert(DAMAGE_IS_ALL(priv->gpu_damage)); + assert(priv->cpu_damage == NULL); DBG(("%s: pending clear, doing partial fill\n", __FUNCTION__)); if (priv->cpu_bo) { + if ((flags & MOVE_ASYNC_HINT || priv->cpu_bo->exec) && + cpu_clear_boxes(sna, pixmap, priv, box, n)) + goto clear_done; + DBG(("%s: syncing CPU bo\n", __FUNCTION__)); kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo); assert(pixmap->devPrivate.ptr == MAP(priv->cpu_bo->map__cpu)); } + assert(pixmap->devKind); do { pixman_fill(pixmap->devPrivate.ptr, pixmap->devKind/sizeof(uint32_t), @@ -2688,7 +2892,9 @@ box++; } while (--n); - if (region->extents.x2 - region->extents.x1 > 1 || +clear_done: + if (flags & MOVE_WRITE || + region->extents.x2 - region->extents.x1 > 1 || region->extents.y2 - region->extents.y1 > 1) { sna_damage_subtract(&priv->gpu_damage, region); priv->clear = false; @@ -2696,40 +2902,6 @@ goto done; } - if ((flags & MOVE_READ) == 0) { - assert(flags & MOVE_WRITE); - sna_damage_subtract(&priv->gpu_damage, region); - goto done; - } - - if (MIGRATE_ALL && priv->gpu_damage) { - BoxPtr box; - int n = sna_damage_get_boxes(priv->gpu_damage, &box); - if (n) { - bool ok; - - DBG(("%s: forced migration\n", __FUNCTION__)); - - assert(pixmap_contains_damage(pixmap, priv->gpu_damage)); - assert(priv->gpu_bo); - - ok = false; - if (use_cpu_bo_for_download(sna, priv, n, box)) { - DBG(("%s: using CPU bo for download from GPU\n", __FUNCTION__)); - ok = sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->gpu_bo, 0, 0, - pixmap, priv->cpu_bo, 0, 0, - box, n, COPY_LAST); - } - if (!ok) { - assert(has_coherent_ptr(sna, sna_pixmap(pixmap), MOVE_READ)); - sna_read_boxes(sna, pixmap, priv->gpu_bo, - box, n); - } - } - sna_damage_destroy(&priv->gpu_damage); - } - if (priv->gpu_damage && (DAMAGE_IS_ALL(priv->gpu_damage) || sna_damage_overlaps_box(priv->gpu_damage, ®ion->extents))) { @@ -2750,18 +2922,19 @@ goto done; } } else { - if (sna_damage_contains_box__no_reduce(priv->cpu_damage, + if (DAMAGE_IS_ALL(priv->cpu_damage) || + sna_damage_contains_box__no_reduce(priv->cpu_damage, ®ion->extents)) { - assert(sna_damage_contains_box(priv->gpu_damage, ®ion->extents) == PIXMAN_REGION_OUT); - assert(sna_damage_contains_box(priv->cpu_damage, ®ion->extents) == PIXMAN_REGION_IN); + assert(sna_damage_contains_box(&priv->gpu_damage, ®ion->extents) == PIXMAN_REGION_OUT); + assert(sna_damage_contains_box(&priv->cpu_damage, ®ion->extents) == PIXMAN_REGION_IN); DBG(("%s: region already in CPU damage\n", __FUNCTION__)); - goto done; + goto already_damaged; } } - if (sna_damage_contains_box(priv->gpu_damage, + if (sna_damage_contains_box(&priv->gpu_damage, ®ion->extents) != PIXMAN_REGION_OUT) { RegionRec want, *r = region; @@ -2784,13 +2957,13 @@ * reads. */ if (flags & MOVE_WRITE) { - int n = RegionNumRects(region), i; - BoxPtr boxes = RegionRects(region); + int n = region_num_rects(region), i; + const BoxRec *boxes = region_rects(region); BoxPtr blocks; blocks = NULL; if (priv->cpu_damage == NULL) - blocks = malloc(sizeof(BoxRec) * RegionNumRects(region)); + blocks = malloc(sizeof(BoxRec) * n); if (blocks) { for (i = 0; i < n; i++) { blocks[i].x1 = boxes[i].x1 & ~31; @@ -2816,85 +2989,42 @@ } if (region_subsumes_damage(r, priv->gpu_damage)) { - BoxPtr box; + const BoxRec *box; int n; DBG(("%s: region wholly contains damage\n", __FUNCTION__)); - n = sna_damage_get_boxes(priv->gpu_damage, - &box); - if (n) { - bool ok = false; - - if (use_cpu_bo_for_download(sna, priv, n, box)) { - DBG(("%s: using CPU bo for download from GPU\n", __FUNCTION__)); - ok = sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->gpu_bo, 0, 0, - pixmap, priv->cpu_bo, 0, 0, - box, n, COPY_LAST); - } - - if (!ok) { - assert(has_coherent_ptr(sna, sna_pixmap(pixmap), MOVE_READ)); - sna_read_boxes(sna, pixmap, priv->gpu_bo, - box, n); - } - } + n = sna_damage_get_boxes(priv->gpu_damage, &box); + if (n) + download_boxes(sna, priv, n, box); sna_damage_destroy(&priv->gpu_damage); } else if (DAMAGE_IS_ALL(priv->gpu_damage) || sna_damage_contains_box__no_reduce(priv->gpu_damage, &r->extents)) { - BoxPtr box = RegionRects(r); - int n = RegionNumRects(r); - bool ok = false; DBG(("%s: region wholly inside damage\n", __FUNCTION__)); - assert(sna_damage_contains_box(priv->gpu_damage, &r->extents) == PIXMAN_REGION_IN); - assert(sna_damage_contains_box(priv->cpu_damage, &r->extents) == PIXMAN_REGION_OUT); - - if (use_cpu_bo_for_download(sna, priv, n, box)) { - DBG(("%s: using CPU bo for download from GPU\n", __FUNCTION__)); - ok = sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->gpu_bo, 0, 0, - pixmap, priv->cpu_bo, 0, 0, - box, n, COPY_LAST); - } - if (!ok) { - assert(has_coherent_ptr(sna, sna_pixmap(pixmap), MOVE_READ)); - sna_read_boxes(sna, pixmap, priv->gpu_bo, - box, n); - } + assert(sna_damage_contains_box(&priv->gpu_damage, &r->extents) == PIXMAN_REGION_IN); + assert(sna_damage_contains_box(&priv->cpu_damage, &r->extents) == PIXMAN_REGION_OUT); + download_boxes(sna, priv, + region_num_rects(r), + region_rects(r)); sna_damage_subtract(&priv->gpu_damage, r); } else { RegionRec need; pixman_region_init(&need); if (sna_damage_intersect(priv->gpu_damage, r, &need)) { - BoxPtr box = RegionRects(&need); - int n = RegionNumRects(&need); - bool ok = false; - DBG(("%s: region intersects damage\n", __FUNCTION__)); - if (use_cpu_bo_for_download(sna, priv, n, box)) { - DBG(("%s: using CPU bo for download from GPU\n", __FUNCTION__)); - ok = sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->gpu_bo, 0, 0, - pixmap, priv->cpu_bo, 0, 0, - box, n, COPY_LAST); - } - if (!ok) { - assert(has_coherent_ptr(sna, sna_pixmap(pixmap), MOVE_READ)); - sna_read_boxes(sna, pixmap, priv->gpu_bo, - box, n); - } - + download_boxes(sna, priv, + region_num_rects(&need), + region_rects(&need)); sna_damage_subtract(&priv->gpu_damage, r); RegionUninit(&need); } @@ -2910,9 +3040,7 @@ assert(!DAMAGE_IS_ALL(priv->cpu_damage)); assert_pixmap_contains_box(pixmap, RegionExtents(region)); sna_damage_add(&priv->cpu_damage, region); - sna_damage_reduce_all(&priv->cpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_reduce_all(&priv->cpu_damage, pixmap); if (DAMAGE_IS_ALL(priv->cpu_damage)) { DBG(("%s: replaced entire pixmap\n", __FUNCTION__)); sna_pixmap_free_gpu(sna, priv); @@ -2923,6 +3051,7 @@ } } +already_damaged: if (dx | dy) RegionTranslate(region, -dx, -dy); @@ -2942,13 +3071,12 @@ FORCE_FULL_SYNC || flags & MOVE_WRITE); assert((flags & MOVE_WRITE) == 0 || !kgem_bo_is_busy(priv->cpu_bo)); } - priv->cpu = - (flags & (MOVE_INPLACE_HINT | MOVE_ASYNC_HINT)) == 0 && - !DAMAGE_IS_ALL(priv->gpu_damage); +skip: + priv->cpu |= (flags & (MOVE_WRITE | MOVE_ASYNC_HINT)) == MOVE_WRITE; assert(pixmap->devPrivate.ptr == PTR(priv->ptr)); assert(pixmap->devKind); assert_pixmap_damage(pixmap); - assert(has_coherent_ptr(sna, sna_pixmap(pixmap), flags)); + assert(has_coherent_ptr(sna, priv, flags)); return true; } @@ -3066,15 +3194,18 @@ if ((flags & __MOVE_DRI) == 0) return NULL; + if (pixmap->usage_hint == -1) { + DBG(("%s: not promoting SHM Pixmap for DRI\n", __FUNCTION__)); + return NULL; + } + DBG(("%s: forcing the creation on the GPU\n", __FUNCTION__)); priv = sna_pixmap_attach(pixmap); if (priv == NULL) return NULL; - sna_damage_all(&priv->cpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->cpu_damage, pixmap); assert(priv->gpu_bo == NULL); assert(priv->gpu_damage == NULL); @@ -3103,31 +3234,57 @@ assert_pixmap_contains_box(pixmap, box); assert(priv->gpu_damage == NULL || priv->gpu_bo); - if (priv->move_to_gpu && - !priv->move_to_gpu(sna, priv, flags | MOVE_READ | (priv->cpu_damage ? MOVE_WRITE : 0))) { - DBG(("%s: move-to-gpu override failed\n", __FUNCTION__)); - return NULL; + if ((flags & MOVE_READ) == 0) + sna_damage_subtract_box(&priv->cpu_damage, box); + + if (priv->move_to_gpu) { + unsigned int hint; + + hint = flags | MOVE_READ; + if ((flags & MOVE_READ) == 0) { + RegionRec region; + + region.extents = *box; + region.data = NULL; + sna_pixmap_discard_shadow_damage(priv, ®ion); + if (region_subsumes_pixmap(®ion, pixmap)) + hint &= ~MOVE_READ; + } else { + if (priv->cpu_damage) + hint |= MOVE_WRITE; + } + if (!priv->move_to_gpu(sna, priv, hint)) { + DBG(("%s: move-to-gpu override failed\n", __FUNCTION__)); + return NULL; + } } - if (priv->cow && (flags & MOVE_WRITE || priv->cpu_damage)) { - unsigned cow = MOVE_READ; + if (priv->cow) { + unsigned cow = flags & (MOVE_READ | MOVE_WRITE | __MOVE_FORCE); if ((flags & MOVE_READ) == 0) { if (priv->gpu_damage) { r.extents = *box; r.data = NULL; - if (region_subsumes_damage(&r, - priv->gpu_damage)) - cow = 0; - } else - cow = 0; + if (!region_subsumes_damage(&r, priv->gpu_damage)) + cow |= MOVE_READ; + } + } else { + if (priv->cpu_damage) { + r.extents = *box; + r.data = NULL; + if (region_overlaps_damage(&r, priv->cpu_damage, 0, 0)) + cow |= MOVE_WRITE; + } } - if (!sna_pixmap_undo_cow(sna, priv, cow)) - return NULL; + if (cow) { + if (!sna_pixmap_undo_cow(sna, priv, cow)) + return NULL; - if (priv->gpu_bo == NULL) - sna_damage_destroy(&priv->gpu_damage); + if (priv->gpu_bo == NULL) + sna_damage_destroy(&priv->gpu_damage); + } } if (sna_damage_is_all(&priv->gpu_damage, @@ -3140,18 +3297,17 @@ goto done; } - if (flags & MOVE_WRITE && priv->gpu_bo && priv->gpu_bo->proxy) { + if (kgem_bo_discard_cache(priv->gpu_bo, flags & (MOVE_WRITE | __MOVE_FORCE))) { DBG(("%s: discarding cached upload buffer\n", __FUNCTION__)); - assert(priv->gpu_damage == NULL); + assert(DAMAGE_IS_ALL(priv->cpu_damage)); + assert(priv->gpu_damage == NULL || DAMAGE_IS_ALL(priv->gpu_damage)); /* magical upload buffer */ assert(!priv->pinned); assert(!priv->mapped); + sna_damage_destroy(&priv->gpu_damage); kgem_bo_destroy(&sna->kgem, priv->gpu_bo); priv->gpu_bo = NULL; } - if ((flags & MOVE_READ) == 0) - sna_damage_subtract_box(&priv->cpu_damage, box); - sna_damage_reduce(&priv->cpu_damage); assert_pixmap_damage(pixmap); @@ -3163,24 +3319,8 @@ if (priv->gpu_bo == NULL) { assert(priv->gpu_damage == NULL); - if (flags & __MOVE_FORCE || - priv->create & KGEM_CAN_CREATE_GPU) { - unsigned create, tiling; - - create = CREATE_INACTIVE; - if (pixmap->usage_hint == SNA_CREATE_FB) - create |= CREATE_SCANOUT; - - tiling = (flags & MOVE_SOURCE_HINT) ? I915_TILING_Y : DEFAULT_TILING; - tiling = sna_pixmap_choose_tiling(pixmap, tiling); - - assert(!priv->mapped); - priv->gpu_bo = kgem_create_2d(&sna->kgem, - pixmap->drawable.width, - pixmap->drawable.height, - pixmap->drawable.bitsPerPixel, - tiling, create); - } + if (flags & __MOVE_FORCE || priv->create & KGEM_CAN_CREATE_GPU) + sna_pixmap_alloc_gpu(sna, pixmap, priv, CREATE_INACTIVE); if (priv->gpu_bo == NULL) return NULL; @@ -3203,42 +3343,41 @@ assert(priv->cpu_damage); region_set(&r, box); if (MIGRATE_ALL || region_subsumes_damage(&r, priv->cpu_damage)) { + bool ok = false; int n; - n = sna_damage_get_boxes(priv->cpu_damage, (BoxPtr *)&box); - if (n) { - bool ok = false; - - if (use_cpu_bo_for_upload(sna, priv, 0)) { - DBG(("%s: using CPU bo for upload to GPU\n", __FUNCTION__)); - ok = sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->cpu_bo, 0, 0, - pixmap, priv->gpu_bo, 0, 0, - box, n, 0); - } - if (!ok) { - sna_pixmap_unmap(pixmap, priv); - if (pixmap->devPrivate.ptr == NULL) - return NULL; + n = sna_damage_get_boxes(priv->cpu_damage, &box); + assert(n); + if (use_cpu_bo_for_upload(sna, priv, 0)) { + DBG(("%s: using CPU bo for upload to GPU\n", __FUNCTION__)); + ok = sna->render.copy_boxes(sna, GXcopy, + &pixmap->drawable, priv->cpu_bo, 0, 0, + &pixmap->drawable, priv->gpu_bo, 0, 0, + box, n, 0); + } + if (!ok) { + sna_pixmap_unmap(pixmap, priv); + if (pixmap->devPrivate.ptr == NULL) + return NULL; - if (n == 1 && !priv->pinned && - box->x1 <= 0 && box->y1 <= 0 && - box->x2 >= pixmap->drawable.width && - box->y2 >= pixmap->drawable.height) { - ok = sna_replace(sna, pixmap, - pixmap->devPrivate.ptr, - pixmap->devKind); - } else { - ok = sna_write_boxes(sna, pixmap, - priv->gpu_bo, 0, 0, - pixmap->devPrivate.ptr, - pixmap->devKind, - 0, 0, - box, n); - } - if (!ok) - return NULL; + assert(pixmap->devKind); + if (n == 1 && !priv->pinned && + box->x1 <= 0 && box->y1 <= 0 && + box->x2 >= pixmap->drawable.width && + box->y2 >= pixmap->drawable.height) { + ok = sna_replace(sna, pixmap, + pixmap->devPrivate.ptr, + pixmap->devKind); + } else { + ok = sna_write_boxes(sna, pixmap, + priv->gpu_bo, 0, 0, + pixmap->devPrivate.ptr, + pixmap->devKind, + 0, 0, + box, n); } + if (!ok) + return NULL; } sna_damage_destroy(&priv->cpu_damage); @@ -3246,52 +3385,56 @@ sna_damage_contains_box__no_reduce(priv->cpu_damage, box)) { bool ok = false; - assert(sna_damage_contains_box(priv->gpu_damage, box) == PIXMAN_REGION_OUT); - assert(sna_damage_contains_box(priv->cpu_damage, box) == PIXMAN_REGION_IN); + assert(sna_damage_contains_box(&priv->gpu_damage, box) == PIXMAN_REGION_OUT); + assert(sna_damage_contains_box(&priv->cpu_damage, box) == PIXMAN_REGION_IN); if (use_cpu_bo_for_upload(sna, priv, 0)) { DBG(("%s: using CPU bo for upload to GPU\n", __FUNCTION__)); ok = sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->cpu_bo, 0, 0, - pixmap, priv->gpu_bo, 0, 0, + &pixmap->drawable, priv->cpu_bo, 0, 0, + &pixmap->drawable, priv->gpu_bo, 0, 0, box, 1, 0); } if (!ok) { sna_pixmap_unmap(pixmap, priv); - if (pixmap->devPrivate.ptr != NULL) + if (pixmap->devPrivate.ptr != NULL) { + assert(pixmap->devKind); ok = sna_write_boxes(sna, pixmap, priv->gpu_bo, 0, 0, pixmap->devPrivate.ptr, pixmap->devKind, 0, 0, box, 1); + } } if (!ok) return NULL; sna_damage_subtract(&priv->cpu_damage, &r); } else if (sna_damage_intersect(priv->cpu_damage, &r, &i)) { - int n = RegionNumRects(&i); + int n = region_num_rects(&i); bool ok; - box = RegionRects(&i); + box = region_rects(&i); ok = false; if (use_cpu_bo_for_upload(sna, priv, 0)) { DBG(("%s: using CPU bo for upload to GPU, %d boxes\n", __FUNCTION__, n)); ok = sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->cpu_bo, 0, 0, - pixmap, priv->gpu_bo, 0, 0, + &pixmap->drawable, priv->cpu_bo, 0, 0, + &pixmap->drawable, priv->gpu_bo, 0, 0, box, n, 0); } if (!ok) { sna_pixmap_unmap(pixmap, priv); - if (pixmap->devPrivate.ptr != NULL) + if (pixmap->devPrivate.ptr != NULL) { + assert(pixmap->devKind); ok = sna_write_boxes(sna, pixmap, priv->gpu_bo, 0, 0, pixmap->devPrivate.ptr, pixmap->devKind, 0, 0, box, n); + } } if (!ok) return NULL; @@ -3307,17 +3450,20 @@ priv->clear = false; if (!DAMAGE_IS_ALL(priv->gpu_damage) && priv->cpu_damage == NULL && - box_inplace(pixmap, &r.extents)) { + (box_covers_pixmap(pixmap, &r.extents) || + box_inplace(pixmap, &r.extents))) { DBG(("%s: large operation on undamaged, promoting to full GPU\n", __FUNCTION__)); assert(priv->gpu_bo); assert(priv->gpu_bo->proxy == NULL); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + if (sna_pixmap_free_cpu(sna, priv, priv->cpu)) + sna_damage_all(&priv->gpu_damage, pixmap); } - if (DAMAGE_IS_ALL(priv->gpu_damage)) + if (DAMAGE_IS_ALL(priv->gpu_damage)) { sna_pixmap_free_cpu(sna, priv, priv->cpu); + sna_damage_destroy(&priv->cpu_damage); + list_del(&priv->flush_list); + } priv->cpu = false; } @@ -3353,9 +3499,9 @@ } if (priv->cow) { - unsigned cow = MOVE_READ; + unsigned cow = MOVE_WRITE | MOVE_READ; - if (flags & IGNORE_CPU) { + if (flags & IGNORE_DAMAGE) { if (priv->gpu_damage) { region.extents = *box; if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { @@ -3367,9 +3513,9 @@ region.data = NULL; if (region_subsumes_damage(®ion, priv->gpu_damage)) - cow = 0; + cow &= ~MOVE_READ; } else - cow = 0; + cow &= ~MOVE_READ; } if (!sna_pixmap_undo_cow(to_sna_from_pixmap(pixmap), priv, cow)) @@ -3379,37 +3525,48 @@ sna_damage_destroy(&priv->gpu_damage); } - if (priv->gpu_bo && priv->gpu_bo->proxy) { - DBG(("%s: cached upload proxy, discard and revert to GPU\n", - __FUNCTION__)); - assert(priv->gpu_damage == NULL); + if (kgem_bo_discard_cache(priv->gpu_bo, true)) { + DBG(("%s: cached upload proxy, discard and revert to GPU\n", __FUNCTION__)); + assert(DAMAGE_IS_ALL(priv->cpu_damage)); + assert(priv->gpu_damage == NULL || DAMAGE_IS_ALL(priv->gpu_damage)); /* magical upload buffer */ assert(!priv->pinned); assert(!priv->mapped); + sna_damage_destroy(&priv->gpu_damage); kgem_bo_destroy(&to_sna_from_pixmap(pixmap)->kgem, priv->gpu_bo); priv->gpu_bo = NULL; goto use_cpu_bo; } - if (priv->flush) + if (priv->flush) { + DBG(("%s: exported target, set PREFER_GPU\n", __FUNCTION__)); flags |= PREFER_GPU; - if (priv->shm) + } + if (priv->shm) { + DBG(("%s: shm target, discard PREFER_GPU\n", __FUNCTION__)); flags &= ~PREFER_GPU; - if (priv->pinned) + } + if (priv->pinned) { + DBG(("%s: pinned, never REPLACES\n", __FUNCTION__)); flags &= ~REPLACES; - if (priv->cpu && (flags & (FORCE_GPU | IGNORE_CPU)) == 0) + } + if (priv->cpu && (flags & (FORCE_GPU | IGNORE_DAMAGE)) == 0) { + DBG(("%s: last on cpu and needs damage, discard PREFER_GPU\n", __FUNCTION__)); flags &= ~PREFER_GPU; + } - if ((flags & (PREFER_GPU | IGNORE_CPU)) == IGNORE_CPU) { - if (box_inplace(pixmap, box)) + if ((flags & (PREFER_GPU | IGNORE_DAMAGE)) == IGNORE_DAMAGE) { + if (priv->gpu_bo && (box_covers_pixmap(pixmap, box) || box_inplace(pixmap, box))) { + DBG(("%s: not reading damage and large, set PREFER_GPU\n", __FUNCTION__)); flags |= PREFER_GPU; + } } DBG(("%s: flush=%d, shm=%d, cpu=%d => flags=%x\n", __FUNCTION__, priv->flush, priv->shm, priv->cpu, flags)); if ((flags & PREFER_GPU) == 0 && - (flags & REPLACES || !priv->gpu_damage || !kgem_bo_is_busy(priv->gpu_bo))) { + (flags & (REPLACES | IGNORE_DAMAGE) || !priv->gpu_damage || !kgem_bo_is_busy(priv->gpu_bo))) { DBG(("%s: try cpu as GPU bo is idle\n", __FUNCTION__)); goto use_cpu_bo; } @@ -3444,7 +3601,7 @@ goto use_cpu_bo; } - if ((flags & IGNORE_CPU) == 0) { + if ((flags & IGNORE_DAMAGE) == 0) { if (priv->cpu_bo) { if (to_sna_from_pixmap(pixmap)->kgem.can_blt_cpu) { if (kgem_bo_is_busy(priv->cpu_bo)) { @@ -3523,13 +3680,26 @@ if (priv->gpu_damage) { assert(priv->gpu_bo); - if (!priv->cpu_damage || flags & IGNORE_CPU) { - if (sna_damage_contains_box__no_reduce(priv->gpu_damage, + if (!priv->cpu_damage || flags & IGNORE_DAMAGE) { + if (flags & REPLACES || box_covers_pixmap(pixmap, ®ion.extents)) { + unsigned int move; + + if (flags & IGNORE_DAMAGE) + move = MOVE_WRITE; + else + move = MOVE_WRITE | MOVE_READ; + + if (sna_pixmap_move_to_gpu(pixmap, move)) + goto use_gpu_bo; + } + + if (DAMAGE_IS_ALL(priv->gpu_damage) || + sna_damage_contains_box__no_reduce(priv->gpu_damage, ®ion.extents)) { DBG(("%s: region wholly contained within GPU damage\n", __FUNCTION__)); - assert(sna_damage_contains_box(priv->gpu_damage, ®ion.extents) == PIXMAN_REGION_IN); - assert(sna_damage_contains_box(priv->cpu_damage, ®ion.extents) == PIXMAN_REGION_OUT); + assert(sna_damage_contains_box(&priv->gpu_damage, ®ion.extents) == PIXMAN_REGION_IN); + assert(sna_damage_contains_box(&priv->cpu_damage, ®ion.extents) == PIXMAN_REGION_OUT); goto use_gpu_bo; } else { DBG(("%s: partial GPU damage with no CPU damage, continuing to use GPU\n", @@ -3538,7 +3708,7 @@ } } - ret = sna_damage_contains_box(priv->gpu_damage, ®ion.extents); + ret = sna_damage_contains_box(&priv->gpu_damage, ®ion.extents); if (ret == PIXMAN_REGION_IN) { DBG(("%s: region wholly contained within GPU damage\n", __FUNCTION__)); @@ -3552,8 +3722,8 @@ } } - if ((flags & IGNORE_CPU) == 0 && priv->cpu_damage) { - ret = sna_damage_contains_box(priv->cpu_damage, ®ion.extents); + if ((flags & IGNORE_DAMAGE) == 0 && priv->cpu_damage) { + ret = sna_damage_contains_box(&priv->cpu_damage, ®ion.extents); if (ret == PIXMAN_REGION_IN) { DBG(("%s: region wholly contained within CPU damage\n", __FUNCTION__)); @@ -3574,13 +3744,14 @@ move_to_gpu: if (!sna_pixmap_move_area_to_gpu(pixmap, ®ion.extents, - flags & IGNORE_CPU ? MOVE_WRITE : MOVE_READ | MOVE_WRITE)) { + flags & IGNORE_DAMAGE ? MOVE_WRITE : MOVE_READ | MOVE_WRITE)) { DBG(("%s: failed to move-to-gpu, fallback\n", __FUNCTION__)); assert(priv->gpu_bo == NULL); goto use_cpu_bo; } done: + assert(priv->move_to_gpu == NULL); assert(priv->gpu_bo != NULL); assert(priv->gpu_bo->refcnt); if (sna_damage_is_all(&priv->gpu_damage, @@ -3598,25 +3769,42 @@ assert(priv->gpu_bo->proxy == NULL); assert(priv->clear == false); assert(priv->cpu == false); + assert(!priv->shm); return priv->gpu_bo; use_gpu_bo: if (priv->move_to_gpu) { unsigned hint = MOVE_READ | MOVE_WRITE; - if (flags & IGNORE_CPU) { + sna = to_sna_from_pixmap(pixmap); + + if (flags & IGNORE_DAMAGE) { region.extents = *box; region.data = NULL; - if (region_subsumes_drawable(®ion, &pixmap->drawable)) + if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { + region.extents.x1 += dx; + region.extents.x2 += dx; + region.extents.y1 += dy; + region.extents.y2 += dy; + } + sna_pixmap_discard_shadow_damage(priv, ®ion); + if (region_subsumes_pixmap(®ion, pixmap)) { + DBG(("%s: discarding move-to-gpu READ for subsumed pixmap\n", __FUNCTION__)); hint = MOVE_WRITE; + } } - if (!priv->move_to_gpu(to_sna_from_pixmap(pixmap), priv, hint)) { + if (!priv->move_to_gpu(sna, priv, hint)) { DBG(("%s: move-to-gpu override failed\n", __FUNCTION__)); goto use_cpu_bo; } } + if (priv->shm) { + assert(!priv->flush); + list_move(&priv->flush_list, &sna->flush_pixmaps); + } + DBG(("%s: using whole GPU bo\n", __FUNCTION__)); assert(priv->gpu_bo != NULL); assert(priv->gpu_bo->refcnt); @@ -3629,22 +3817,33 @@ use_cpu_bo: if (!USE_CPU_BO || priv->cpu_bo == NULL) { -cpu_fail: - if ((flags & FORCE_GPU) && priv->gpu_bo) { - region.extents = *box; - if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { - region.extents.x1 += dx; - region.extents.x2 += dx; - region.extents.y1 += dy; - region.extents.y2 += dy; - } - region.data = NULL; - - goto move_to_gpu; + if ((flags & FORCE_GPU) == 0) { + DBG(("%s: no CPU bo, and GPU not forced\n", __FUNCTION__)); + return NULL; } - return NULL; - } + flags &= ~FORCE_GPU; + + region.extents = *box; + if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { + region.extents.x1 += dx; + region.extents.x2 += dx; + region.extents.y1 += dy; + region.extents.y2 += dy; + } + region.data = NULL; + + if (!sna_drawable_move_region_to_cpu(&pixmap->drawable, ®ion, + (flags & IGNORE_DAMAGE ? 0 : MOVE_READ) | MOVE_WRITE | MOVE_ASYNC_HINT) || + priv->cpu_bo == NULL) { + DBG(("%s: did not create CPU bo\n", __FUNCTION__)); +cpu_fail: + if (priv->gpu_bo) + goto move_to_gpu; + + return NULL; + } + } assert(priv->cpu_bo->refcnt); @@ -3656,7 +3855,6 @@ return NULL; } - region.extents = *box; if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { region.extents.x1 += dx; @@ -3666,28 +3864,75 @@ } region.data = NULL; - /* Both CPU and GPU are busy, prefer to use the GPU */ - if (priv->gpu_bo && kgem_bo_is_busy(priv->gpu_bo)) + if (priv->gpu_bo && kgem_bo_is_busy(priv->gpu_bo)) { + DBG(("%s: both CPU and GPU are busy, prefer to use the GPU\n", + __FUNCTION__)); goto move_to_gpu; + } assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL); if (flags & RENDER_GPU) { - if (priv->gpu_bo && priv->gpu_bo->tiling) - goto move_to_gpu; + flags &= ~RENDER_GPU; - if (priv->cpu_bo->pitch >= 4096) - goto move_to_gpu; + if ((flags & IGNORE_DAMAGE) == 0 && priv->gpu_damage) { + DBG(("%s: prefer to use GPU bo for rendering whilst reading from GPU damage\n", __FUNCTION__)); + +prefer_gpu_bo: + if (priv->gpu_bo == NULL) { + if ((flags & FORCE_GPU) == 0) { + DBG(("%s: untiled, will not force allocation\n", + __FUNCTION__)); + return NULL; + } + + if (flags & IGNORE_DAMAGE) { + sna_damage_subtract(&priv->cpu_damage, ®ion); + if (priv->cpu_damage == NULL) { + list_del(&priv->flush_list); + priv->cpu = false; + } + } + + if (!sna_pixmap_move_to_gpu(pixmap, MOVE_WRITE | MOVE_READ | __MOVE_FORCE)) + return NULL; - if (!sna->kgem.can_blt_cpu) + sna_damage_all(&priv->gpu_damage, pixmap); + + DBG(("%s: allocated GPU bo for operation\n", __FUNCTION__)); + goto done; + } goto move_to_gpu; + } + + if ((priv->cpu_damage == NULL || flags & IGNORE_DAMAGE)) { + if (priv->gpu_bo && priv->gpu_bo->tiling) { + DBG(("%s: prefer to use GPU bo for rendering large pixmaps\n", __FUNCTION__)); + goto prefer_gpu_bo; + } + + if (priv->cpu_bo->pitch >= 4096) { + DBG(("%s: prefer to use GPU bo for rendering wide pixmaps\n", __FUNCTION__)); + goto prefer_gpu_bo; + } + } + + if ((flags & IGNORE_DAMAGE) == 0 && priv->cpu_bo->snoop) { + DBG(("%s: prefer to use GPU bo for reading from snooped target bo\n", __FUNCTION__)); + goto prefer_gpu_bo; + } + + if (!sna->kgem.can_blt_cpu) { + DBG(("%s: can't render to CPU bo, try to use GPU bo\n", __FUNCTION__)); + goto prefer_gpu_bo; + } } if (!sna->kgem.can_blt_cpu) goto cpu_fail; if (!sna_drawable_move_region_to_cpu(&pixmap->drawable, ®ion, - (flags & IGNORE_CPU ? 0 : MOVE_READ) | MOVE_WRITE | MOVE_ASYNC_HINT)) { + (flags & IGNORE_DAMAGE ? 0 : MOVE_READ) | MOVE_WRITE | MOVE_ASYNC_HINT)) { DBG(("%s: failed to move-to-cpu, fallback\n", __FUNCTION__)); goto cpu_fail; } @@ -3711,11 +3956,12 @@ sna_damage_destroy(&priv->gpu_damage); *damage = NULL; } else { + assert(!DAMAGE_IS_ALL(priv->cpu_damage)); if (priv->cpu_damage && sna_damage_contains_box__no_reduce(priv->cpu_damage, ®ion.extents)) { - assert(sna_damage_contains_box(priv->gpu_damage, ®ion.extents) == PIXMAN_REGION_OUT); - assert(sna_damage_contains_box(priv->cpu_damage, ®ion.extents) == PIXMAN_REGION_IN); + assert(sna_damage_contains_box(&priv->gpu_damage, ®ion.extents) == PIXMAN_REGION_OUT); + assert(sna_damage_contains_box(&priv->cpu_damage, ®ion.extents) == PIXMAN_REGION_IN); *damage = NULL; } else *damage = &priv->cpu_damage; @@ -3725,6 +3971,7 @@ __FUNCTION__, *damage != NULL)); assert(damage == NULL || !DAMAGE_IS_ALL(*damage)); assert(priv->clear == false); + priv->cpu = false; return priv->cpu_bo; } @@ -3767,14 +4014,14 @@ * but will work so long as we always check before doing the * transfer. */ - sna_damage_all(&priv->gpu_damage, width, height); - sna_damage_all(&priv->cpu_damage, width, height); + sna_damage_all(&priv->gpu_damage, pixmap); + sna_damage_all(&priv->cpu_damage, pixmap); pixmap->devKind = priv->gpu_bo->pitch; pixmap->devPrivate.ptr = ptr; priv->ptr = MAKE_STATIC_PTR(ptr); priv->stride = priv->gpu_bo->pitch; - priv->header = true; + priv->create = 0; pixmap->usage_hint = 0; if (!kgem_buffer_is_inplace(priv->gpu_bo)) @@ -3794,7 +4041,7 @@ { struct sna *sna = to_sna_from_pixmap(pixmap); struct sna_pixmap *priv; - BoxPtr box; + const BoxRec *box; int n; DBG(("%s(pixmap=%ld, usage=%d), flags=%x\n", @@ -3810,24 +4057,25 @@ assert_pixmap_damage(pixmap); if (priv->move_to_gpu && - !priv->move_to_gpu(sna, priv, flags | (priv->cpu_damage ? MOVE_WRITE : 0))) { + !priv->move_to_gpu(sna, priv, flags | ((priv->cpu_damage && (flags & MOVE_READ)) ? MOVE_WRITE : 0))) { DBG(("%s: move-to-gpu override failed\n", __FUNCTION__)); return NULL; } - if ((flags & MOVE_READ) == 0 && UNDO) { - if (priv->gpu_bo) - kgem_bo_undo(&sna->kgem, priv->gpu_bo); - if (priv->cpu_bo) - kgem_bo_undo(&sna->kgem, priv->cpu_bo); - } + if ((flags & MOVE_READ) == 0 && UNDO) + kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo); - if (priv->cow && (flags & MOVE_WRITE || priv->cpu_damage)) { - if (!sna_pixmap_undo_cow(sna, priv, flags & MOVE_READ)) - return NULL; + if (priv->cow) { + unsigned cow = flags & (MOVE_READ | MOVE_WRITE | __MOVE_FORCE); + if (flags & MOVE_READ && priv->cpu_damage) + cow |= MOVE_WRITE; + if (cow) { + if (!sna_pixmap_undo_cow(sna, priv, cow)) + return NULL; - if (priv->gpu_bo == NULL) - sna_damage_destroy(&priv->gpu_damage); + if (priv->gpu_bo == NULL) + sna_damage_destroy(&priv->gpu_damage); + } } if (sna_damage_is_all(&priv->gpu_damage, @@ -3843,22 +4091,19 @@ goto active; } - if (flags & MOVE_WRITE && priv->gpu_bo && priv->gpu_bo->proxy) { - DBG(("%s: discarding cached upload buffer\n", __FUNCTION__)); - assert(priv->gpu_damage == NULL); - assert(!priv->pinned); - assert(!priv->mapped); - kgem_bo_destroy(&sna->kgem, priv->gpu_bo); - priv->gpu_bo = NULL; - } - if ((flags & MOVE_READ) == 0) sna_damage_destroy(&priv->cpu_damage); sna_damage_reduce(&priv->cpu_damage); assert_pixmap_damage(pixmap); DBG(("%s: CPU damage? %d\n", __FUNCTION__, priv->cpu_damage != NULL)); - if (priv->gpu_bo == NULL) { + if (priv->gpu_bo == NULL || + kgem_bo_discard_cache(priv->gpu_bo, flags & (MOVE_WRITE | __MOVE_FORCE))) { + struct kgem_bo *proxy; + + proxy = priv->gpu_bo; + priv->gpu_bo = NULL; + DBG(("%s: creating GPU bo (%dx%d@%d), create=%x\n", __FUNCTION__, pixmap->drawable.width, @@ -3866,17 +4111,14 @@ pixmap->drawable.bitsPerPixel, priv->create)); assert(!priv->mapped); - if (flags & __MOVE_FORCE || priv->create & KGEM_CAN_CREATE_GPU) { - unsigned create, tiling; + assert(list_is_empty(&priv->flush_list)); + if (flags & __MOVE_FORCE || priv->create & KGEM_CAN_CREATE_GPU) { assert(pixmap->drawable.width > 0); assert(pixmap->drawable.height > 0); assert(pixmap->drawable.bitsPerPixel >= 8); - tiling = (flags & MOVE_SOURCE_HINT) ? I915_TILING_Y : DEFAULT_TILING; - tiling = sna_pixmap_choose_tiling(pixmap, tiling); - - if (tiling == I915_TILING_NONE && + if (sna_pixmap_default_tiling(sna, pixmap) == I915_TILING_NONE && priv->cpu_bo && !priv->shm && kgem_bo_convert_to_gpu(&sna->kgem, priv->cpu_bo, flags)) { assert(!priv->mapped); @@ -3889,32 +4131,41 @@ priv->cpu_bo = NULL; priv->ptr = NULL; pixmap->devPrivate.ptr = NULL; - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->gpu_damage, pixmap); sna_damage_destroy(&priv->cpu_damage); - goto done; - } - - create = 0; - if (flags & MOVE_INPLACE_HINT || (priv->cpu_damage && priv->cpu_bo == NULL)) - create = CREATE_GTT_MAP | CREATE_INACTIVE; - if (pixmap->usage_hint == SNA_CREATE_FB) - create |= CREATE_SCANOUT; + } else { + unsigned create = 0; + if (flags & MOVE_INPLACE_HINT || (priv->cpu_damage && priv->cpu_bo == NULL)) + create = CREATE_GTT_MAP | CREATE_INACTIVE; - priv->gpu_bo = - kgem_create_2d(&sna->kgem, - pixmap->drawable.width, - pixmap->drawable.height, - pixmap->drawable.bitsPerPixel, - tiling, create); + sna_pixmap_alloc_gpu(sna, pixmap, priv, create); + } } + if (priv->gpu_bo == NULL) { DBG(("%s: not creating GPU bo\n", __FUNCTION__)); assert(priv->gpu_damage == NULL); + priv->gpu_bo = proxy; + if (proxy) + sna_damage_all(&priv->cpu_damage, pixmap); return NULL; } + if (proxy) { + DBG(("%s: promoting upload proxy handle=%d to GPU\n", __FUNCTION__, proxy->handle)); + + if (priv->cpu_damage && + sna->render.copy_boxes(sna, GXcopy, + &pixmap->drawable, proxy, 0, 0, + &pixmap->drawable, priv->gpu_bo, 0, 0, + region_rects(DAMAGE_REGION(priv->cpu_damage)), + region_num_rects(DAMAGE_REGION(priv->cpu_damage)), + 0)) + sna_damage_destroy(&priv->cpu_damage); + + kgem_bo_destroy(&sna->kgem, proxy); + } + if (flags & MOVE_WRITE && priv->cpu_damage == NULL) { /* Presume that we will only ever write to the GPU * bo. Readbacks are expensive but fairly constant @@ -3924,9 +4175,7 @@ */ assert(priv->gpu_bo); assert(priv->gpu_bo->proxy == NULL); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->gpu_damage, pixmap); DBG(("%s: marking as all-damaged for GPU\n", __FUNCTION__)); goto active; @@ -3958,9 +4207,7 @@ priv->cpu_bo = NULL; priv->ptr = NULL; pixmap->devPrivate.ptr = NULL; - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->gpu_damage, pixmap); sna_damage_destroy(&priv->cpu_damage); goto done; } @@ -3971,18 +4218,19 @@ } n = sna_damage_get_boxes(priv->cpu_damage, &box); + assert(n); if (n) { bool ok; - assert(pixmap_contains_damage(pixmap, priv->cpu_damage)); + assert_pixmap_contains_damage(pixmap, priv->cpu_damage); DBG(("%s: uploading %d damage boxes\n", __FUNCTION__, n)); ok = false; if (use_cpu_bo_for_upload(sna, priv, flags)) { DBG(("%s: using CPU bo for upload to GPU\n", __FUNCTION__)); ok = sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->cpu_bo, 0, 0, - pixmap, priv->gpu_bo, 0, 0, + &pixmap->drawable, priv->cpu_bo, 0, 0, + &pixmap->drawable, priv->gpu_bo, 0, 0, box, n, 0); } if (!ok) { @@ -3990,6 +4238,7 @@ if (pixmap->devPrivate.ptr == NULL) return NULL; + assert(pixmap->devKind); if (n == 1 && !priv->pinned && (box->x2 - box->x1) >= pixmap->drawable.width && (box->y2 - box->y1) >= pixmap->drawable.height) { @@ -4019,18 +4268,14 @@ assert(!priv->shm); assert(priv->gpu_bo); assert(priv->gpu_bo->proxy == NULL); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->gpu_damage, pixmap); sna_pixmap_free_cpu(sna, priv, (priv->create & KGEM_CAN_CREATE_LARGE) ? false : priv->cpu); } done: list_del(&priv->flush_list); - sna_damage_reduce_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_reduce_all(&priv->gpu_damage, pixmap); if (DAMAGE_IS_ALL(priv->gpu_damage)) sna_pixmap_free_cpu(sna, priv, priv->cpu); @@ -4258,258 +4503,411 @@ } static bool -create_upload_tiled_x(struct kgem *kgem, - PixmapPtr pixmap, - struct sna_pixmap *priv) +can_create_upload_tiled_x(struct sna *sna, + PixmapPtr pixmap, + struct sna_pixmap *priv, + bool replaces) { - unsigned create, tiling; - - if (priv->shm || priv->cpu) + if (priv->shm || (priv->cpu && !replaces)) return false; if ((priv->create & KGEM_CAN_CREATE_GPU) == 0) return false; - tiling = sna_pixmap_choose_tiling(pixmap, I915_TILING_X); - assert(tiling != I915_TILING_Y && tiling != -I915_TILING_Y); + if (sna->kgem.has_llc) + return true; + + if (sna_pixmap_default_tiling(sna, pixmap)) + return false; + + return true; +} + +static bool +create_upload_tiled_x(struct sna *sna, + PixmapPtr pixmap, + struct sna_pixmap *priv, + bool replaces) +{ + unsigned create; + + if (!can_create_upload_tiled_x(sna, pixmap, priv, replaces)) + return false; assert(priv->gpu_bo == NULL); assert(priv->gpu_damage == NULL); create = CREATE_CPU_MAP | CREATE_INACTIVE; - if (pixmap->usage_hint == SNA_CREATE_FB) - create |= CREATE_SCANOUT; - if (!kgem->has_llc) + if (!sna->kgem.has_llc) create |= CREATE_CACHED; - priv->gpu_bo = - kgem_create_2d(kgem, - pixmap->drawable.width, - pixmap->drawable.height, - pixmap->drawable.bitsPerPixel, - tiling, create); - return priv->gpu_bo != NULL; + return sna_pixmap_alloc_gpu(sna, pixmap, priv, create); } static bool -try_upload_blt(PixmapPtr pixmap, RegionRec *region, - int x, int y, int w, int h, char *bits, int stride) +try_upload__tiled_x(PixmapPtr pixmap, RegionRec *region, + int x, int y, int w, int h, char *bits, int stride) { struct sna *sna = to_sna_from_pixmap(pixmap); - struct sna_pixmap *priv; - struct kgem_bo *src_bo; - bool ok; + struct sna_pixmap *priv = sna_pixmap(pixmap); + const BoxRec *box; + uint8_t *dst; + int n; - if (!sna->kgem.has_userptr || !USE_USERPTR_UPLOADS) + if (!kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, true)) { + DBG(("%s: no, cannot map through the CPU\n", __FUNCTION__)); return false; + } - priv = sna_pixmap(pixmap); - if (priv == NULL) + if (!sna_pixmap_move_area_to_gpu(pixmap, ®ion->extents, + MOVE_WRITE | (region->data ? MOVE_READ : 0))) return false; - if (DAMAGE_IS_ALL(priv->cpu_damage) || priv->gpu_damage == NULL) { - DBG(("%s: no, no gpu damage\n", __FUNCTION__)); + if ((priv->create & KGEM_CAN_CREATE_LARGE) == 0 && + __kgem_bo_is_busy(&sna->kgem, priv->gpu_bo)) return false; - } - assert(priv->gpu_bo); - assert(priv->gpu_bo->proxy == NULL); - - if ((priv->create & (KGEM_CAN_CREATE_GTT | KGEM_CAN_CREATE_LARGE)) == KGEM_CAN_CREATE_GTT && - kgem_bo_can_map(&sna->kgem, priv->gpu_bo) && - !__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo)) { - DBG(("%s: no, target is idle\n", __FUNCTION__)); + dst = kgem_bo_map__cpu(&sna->kgem, priv->gpu_bo); + if (dst == NULL) return false; - } - if (priv->cow || priv->move_to_gpu) { - if (!region_subsumes_drawable(region, &pixmap->drawable) || - !sna_pixmap_move_to_gpu(pixmap, MOVE_WRITE)) { - DBG(("%s: no, target is a partial COW\n", __FUNCTION__)); - return false; - } - } - - if (priv->cpu_damage && - sna_damage_contains_box__no_reduce(priv->cpu_damage, - ®ion->extents) && - !box_inplace(pixmap, ®ion->extents)) { - DBG(("%s: no, damage on CPU and too small\n", __FUNCTION__)); - return false; - } + kgem_bo_sync__cpu(&sna->kgem, priv->gpu_bo); - src_bo = kgem_create_map(&sna->kgem, bits, stride * h, true); - if (src_bo == NULL) - return false; + box = region_rects(region); + n = region_num_rects(region); - src_bo->pitch = stride; - kgem_bo_mark_unreusable(src_bo); + DBG(("%s: upload(%d, %d, %d, %d) x %d\n", __FUNCTION__, x, y, w, h, n)); - DBG(("%s: upload(%d, %d, %d, %d) x %ld through a temporary map\n", - __FUNCTION__, x, y, w, h, (long)RegionNumRects(region))); + if (sigtrap_get()) + return false; - if (sigtrap_get() == 0) { - ok = sna->render.copy_boxes(sna, GXcopy, - pixmap, src_bo, -x, -y, - pixmap, priv->gpu_bo, 0, 0, - RegionRects(region), - RegionNumRects(region), - COPY_LAST); - sigtrap_put(); - } else - ok = false; + if (priv->gpu_bo->tiling) { + do { + DBG(("%s: copy tiled box (%d, %d)->(%d, %d)x(%d, %d)\n", + __FUNCTION__, + box->x1 - x, box->y1 - y, + box->x1, box->y1, + box->x2 - box->x1, box->y2 - box->y1)); + + assert(box->x2 > box->x1); + assert(box->y2 > box->y1); + + assert(box->x1 >= 0); + assert(box->y1 >= 0); + assert(box->x2 <= pixmap->drawable.width); + assert(box->y2 <= pixmap->drawable.height); + + assert(box->x1 - x >= 0); + assert(box->y1 - y >= 0); + assert(box->x2 - x <= w); + assert(box->y2 - y <= h); - kgem_bo_sync__cpu(&sna->kgem, src_bo); - assert(src_bo->rq == NULL); - kgem_bo_destroy(&sna->kgem, src_bo); + memcpy_to_tiled_x(&sna->kgem, bits, dst, + pixmap->drawable.bitsPerPixel, + stride, priv->gpu_bo->pitch, + box->x1 - x, box->y1 - y, + box->x1, box->y1, + box->x2 - box->x1, box->y2 - box->y1); + box++; + } while (--n); + } else { + do { + DBG(("%s: copy lined box (%d, %d)->(%d, %d)x(%d, %d)\n", + __FUNCTION__, + box->x1 - x, box->y1 - y, + box->x1, box->y1, + box->x2 - box->x1, box->y2 - box->y1)); + + assert(box->x2 > box->x1); + assert(box->y2 > box->y1); + + assert(box->x1 >= 0); + assert(box->y1 >= 0); + assert(box->x2 <= pixmap->drawable.width); + assert(box->y2 <= pixmap->drawable.height); + + assert(box->x1 - x >= 0); + assert(box->y1 - y >= 0); + assert(box->x2 - x <= w); + assert(box->y2 - y <= h); - if (!ok) { - DBG(("%s: copy failed!\n", __FUNCTION__)); - return false; - } + memcpy_blt(bits, dst, + pixmap->drawable.bitsPerPixel, + stride, priv->gpu_bo->pitch, + box->x1 - x, box->y1 - y, + box->x1, box->y1, + box->x2 - box->x1, box->y2 - box->y1); + box++; + } while (--n); - if (!DAMAGE_IS_ALL(priv->gpu_damage)) { - assert(!priv->clear); - if (region_subsumes_drawable(region, &pixmap->drawable)) { - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); - } else { - sna_damage_add(&priv->gpu_damage, region); - sna_damage_reduce_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); - } - if (DAMAGE_IS_ALL(priv->gpu_damage)) - sna_damage_destroy(&priv->cpu_damage); - else - sna_damage_subtract(&priv->cpu_damage, region); - if (priv->cpu_damage == NULL) { - list_del(&priv->flush_list); - sna_pixmap_free_cpu(sna, priv, priv->cpu); + if (!priv->shm) { + assert(dst == MAP(priv->gpu_bo->map__cpu)); + pixmap->devPrivate.ptr = dst; + pixmap->devKind = priv->gpu_bo->pitch; + priv->mapped = MAPPED_CPU; + assert_pixmap_map(pixmap, priv); + priv->cpu = true; } } - priv->clear = false; - priv->cpu = false; + sigtrap_put(); return true; } static bool -try_upload_tiled_x(PixmapPtr pixmap, RegionRec *region, - int x, int y, int w, int h, char *bits, int stride) +try_upload__inplace(PixmapPtr pixmap, RegionRec *region, + int x, int y, int w, int h, char *bits, int stride) { struct sna *sna = to_sna_from_pixmap(pixmap); struct sna_pixmap *priv = sna_pixmap(pixmap); + bool ignore_cpu = false; bool replaces; - BoxRec *box; + const BoxRec *box; uint8_t *dst; int n; - if (wedged(sna)) + if (!USE_INPLACE) return false; - DBG(("%s: bo? %d, can map? %d\n", __FUNCTION__, + assert(priv); + + if (priv->shm && priv->gpu_damage == NULL) + return false; + + replaces = region_subsumes_pixmap(region, pixmap); + + DBG(("%s: bo? %d, can map? %d, replaces? %d\n", __FUNCTION__, priv->gpu_bo != NULL, - priv->gpu_bo ? kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, true) : 0)); + priv->gpu_bo ? kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, true) : 0, + replaces)); - replaces = region->data == NULL && - w >= pixmap->drawable.width && - h >= pixmap->drawable.height; + if (kgem_bo_discard_cache(priv->gpu_bo, true)) { + DBG(("%s: discarding cached upload buffer\n", __FUNCTION__)); + assert(DAMAGE_IS_ALL(priv->cpu_damage)); + assert(priv->gpu_damage == NULL || DAMAGE_IS_ALL(priv->gpu_damage)); /* magical upload buffer */ + assert(!priv->pinned); + assert(!priv->mapped); + sna_damage_destroy(&priv->gpu_damage); + kgem_bo_destroy(&sna->kgem, priv->gpu_bo); + priv->gpu_bo = NULL; + } - if (priv->gpu_bo && (replaces || priv->gpu_bo->proxy)) { - DBG(("%s: discarding cached upload proxy\n", __FUNCTION__)); - sna_pixmap_free_gpu(sna, priv); + if (priv->gpu_bo && replaces) { + if (UNDO) kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo); + if (can_create_upload_tiled_x(sna, pixmap, priv, true) && + (priv->cow || + __kgem_bo_is_busy(&sna->kgem, priv->gpu_bo) || + !kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, true))) { + DBG(("%s: discarding unusable target bo (busy? %d, mappable? %d)\n", __FUNCTION__, + kgem_bo_is_busy(priv->gpu_bo), + kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, true))); + sna_pixmap_free_gpu(sna, priv); + ignore_cpu = true; + } } assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL); - if (priv->cow || priv->move_to_gpu) { - DBG(("%s: no, has COW or pending move-to-gpu\n", __FUNCTION__)); + if (priv->cow || + (priv->move_to_gpu && !sna_pixmap_discard_shadow_damage(priv, replaces ? NULL : region))) { + DBG(("%s: no, has pending COW? %d or move-to-gpu? %d\n", + __FUNCTION__, priv->cow != NULL, priv->move_to_gpu != NULL)); return false; } + if (priv->gpu_damage && + region_subsumes_damage(region, priv->gpu_damage)) { + if (UNDO) kgem_bo_undo(&sna->kgem, priv->gpu_bo); + if (can_create_upload_tiled_x(sna, pixmap, priv, priv->cpu_damage == NULL) && + (__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo) || + !kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, true))) { + DBG(("%s: discarding unusable partial target bo (busy? %d, mappable? %d)\n", __FUNCTION__, + kgem_bo_is_busy(priv->gpu_bo), + kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, true))); + sna_pixmap_free_gpu(sna, priv); + ignore_cpu = priv->cpu_damage == NULL; + if (priv->ptr) + sna_damage_all(&priv->cpu_damage, pixmap); + } + } + if (priv->gpu_bo == NULL && - !create_upload_tiled_x(&sna->kgem, pixmap, priv)) + !create_upload_tiled_x(sna, pixmap, priv, ignore_cpu)) return false; DBG(("%s: tiling=%d\n", __FUNCTION__, priv->gpu_bo->tiling)); switch (priv->gpu_bo->tiling) { case I915_TILING_Y: - return false; + break; case I915_TILING_X: if (!sna->kgem.memcpy_to_tiled_x) - return false; + break; default: + if (try_upload__tiled_x(pixmap, region, x, y, w, h, bits, stride)) + goto done; break; } - if (!kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, true)) { + if (priv->gpu_damage == NULL && !box_inplace(pixmap, ®ion->extents)) { + DBG(("%s: no, too small to bother with using the GTT\n", __FUNCTION__)); + return false; + } + + if (!kgem_bo_can_map(&sna->kgem, priv->gpu_bo)) { DBG(("%s: no, cannot map through the CPU\n", __FUNCTION__)); return false; } + if (!sna_pixmap_move_area_to_gpu(pixmap, ®ion->extents, + MOVE_WRITE | (region->data ? MOVE_READ : 0))) + return false; + if ((priv->create & KGEM_CAN_CREATE_LARGE) == 0 && __kgem_bo_is_busy(&sna->kgem, priv->gpu_bo)) return false; - dst = kgem_bo_map__cpu(&sna->kgem, priv->gpu_bo); + dst = kgem_bo_map(&sna->kgem, priv->gpu_bo); if (dst == NULL) return false; - kgem_bo_sync__cpu(&sna->kgem, priv->gpu_bo); + pixmap->devPrivate.ptr = dst; + pixmap->devKind = priv->gpu_bo->pitch; + priv->mapped = dst == MAP(priv->gpu_bo->map__cpu) ? MAPPED_CPU : MAPPED_GTT; + assert(has_coherent_ptr(sna, priv, MOVE_WRITE)); - box = RegionRects(region); - n = RegionNumRects(region); + box = region_rects(region); + n = region_num_rects(region); DBG(("%s: upload(%d, %d, %d, %d) x %d\n", __FUNCTION__, x, y, w, h, n)); if (sigtrap_get()) return false; - if (priv->gpu_bo->tiling) { - do { - memcpy_to_tiled_x(&sna->kgem, bits, dst, - pixmap->drawable.bitsPerPixel, - stride, priv->gpu_bo->pitch, - box->x1 - x, box->y1 - y, - box->x1, box->y1, - box->x2 - box->x1, box->y2 - box->y1); - box++; - } while (--n); - } else { - do { - memcpy_blt(bits, dst, - pixmap->drawable.bitsPerPixel, - stride, priv->gpu_bo->pitch, - box->x1 - x, box->y1 - y, - box->x1, box->y1, - box->x2 - box->x1, box->y2 - box->y1); - box++; - } while (--n); + do { + DBG(("%s: copy lined box (%d, %d)->(%d, %d)x(%d, %d)\n", + __FUNCTION__, + box->x1 - x, box->y1 - y, + box->x1, box->y1, + box->x2 - box->x1, box->y2 - box->y1)); - if (!priv->shm) { - assert(dst == MAP(priv->gpu_bo->map__cpu)); - pixmap->devPrivate.ptr = dst; - pixmap->devKind = priv->gpu_bo->pitch; - priv->mapped = MAPPED_CPU; - assert_pixmap_map(pixmap, priv); - priv->cpu = true; + assert(box->x2 > box->x1); + assert(box->y2 > box->y1); + + assert(box->x1 >= 0); + assert(box->y1 >= 0); + assert(box->x2 <= pixmap->drawable.width); + assert(box->y2 <= pixmap->drawable.height); + + assert(box->x1 - x >= 0); + assert(box->y1 - y >= 0); + assert(box->x2 - x <= w); + assert(box->y2 - y <= h); + + memcpy_blt(bits, dst, + pixmap->drawable.bitsPerPixel, + stride, priv->gpu_bo->pitch, + box->x1 - x, box->y1 - y, + box->x1, box->y1, + box->x2 - box->x1, box->y2 - box->y1); + box++; + } while (--n); + + sigtrap_put(); + +done: + if (!DAMAGE_IS_ALL(priv->gpu_damage)) { + if (replaces) { + sna_damage_all(&priv->gpu_damage, pixmap); + } else { + sna_damage_add(&priv->gpu_damage, region); + sna_damage_reduce_all(&priv->gpu_damage, pixmap); + } + if (DAMAGE_IS_ALL(priv->gpu_damage)) + sna_damage_destroy(&priv->cpu_damage); + else + sna_damage_subtract(&priv->cpu_damage, region); + + if (priv->cpu_damage == NULL) { + list_del(&priv->flush_list); + sna_damage_all(&priv->gpu_damage, pixmap); } + + if (priv->shm) + sna_add_flush_pixmap(sna, priv, priv->cpu_bo); } - sigtrap_put(); + assert(!priv->clear); + return true; +} + +static bool +try_upload__blt(PixmapPtr pixmap, RegionRec *region, + int x, int y, int w, int h, char *bits, int stride) +{ + struct sna *sna = to_sna_from_pixmap(pixmap); + struct sna_pixmap *priv; + struct kgem_bo *src_bo; + bool ok; + + if (!sna->kgem.has_userptr || !USE_USERPTR_UPLOADS) + return false; + + priv = sna_pixmap(pixmap); + assert(priv); + assert(priv->gpu_bo); + assert(priv->gpu_bo->proxy == NULL); + + if (priv->cpu_damage && + (DAMAGE_IS_ALL(priv->cpu_damage) || + sna_damage_contains_box__no_reduce(priv->cpu_damage, + ®ion->extents)) && + !box_inplace(pixmap, ®ion->extents)) { + DBG(("%s: no, damage on CPU and too small\n", __FUNCTION__)); + return false; + } + + src_bo = kgem_create_map(&sna->kgem, bits, stride * h, true); + if (src_bo == NULL) + return false; + + src_bo->pitch = stride; + kgem_bo_mark_unreusable(src_bo); + + if (!sna_pixmap_move_area_to_gpu(pixmap, ®ion->extents, + MOVE_WRITE | MOVE_ASYNC_HINT | (region->data ? MOVE_READ : 0))) { + kgem_bo_destroy(&sna->kgem, src_bo); + return false; + } + + DBG(("%s: upload(%d, %d, %d, %d) x %d through a temporary map\n", + __FUNCTION__, x, y, w, h, region_num_rects(region))); + + if (sigtrap_get() == 0) { + ok = sna->render.copy_boxes(sna, GXcopy, + &pixmap->drawable, src_bo, -x, -y, + &pixmap->drawable, priv->gpu_bo, 0, 0, + region_rects(region), + region_num_rects(region), + COPY_LAST); + sigtrap_put(); + } else + ok = false; + + kgem_bo_sync__cpu(&sna->kgem, src_bo); + assert(src_bo->rq == NULL); + kgem_bo_destroy(&sna->kgem, src_bo); + + if (!ok) { + DBG(("%s: copy failed!\n", __FUNCTION__)); + return false; + } if (!DAMAGE_IS_ALL(priv->gpu_damage)) { assert(!priv->clear); - if (replaces) { - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + if (region_subsumes_drawable(region, &pixmap->drawable)) { + sna_damage_all(&priv->gpu_damage, pixmap); } else { sna_damage_add(&priv->gpu_damage, region); - sna_damage_reduce_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_reduce_all(&priv->gpu_damage, pixmap); } if (DAMAGE_IS_ALL(priv->gpu_damage)) sna_damage_destroy(&priv->cpu_damage); @@ -4517,12 +4915,71 @@ sna_damage_subtract(&priv->cpu_damage, region); if (priv->cpu_damage == NULL) { list_del(&priv->flush_list); - sna_pixmap_free_cpu(sna, priv, priv->cpu); + if (sna_pixmap_free_cpu(sna, priv, priv->cpu)) + sna_damage_all(&priv->gpu_damage, pixmap); } } + priv->cpu = false; + priv->clear = false; + + return true; +} + +static bool ignore_cpu_damage(struct sna *sna, struct sna_pixmap *priv, const RegionRec *region) +{ + if (region_subsumes_pixmap(region, priv->pixmap)) + return true; + + if (priv->cpu_damage != NULL) { + if (DAMAGE_IS_ALL(priv->cpu_damage)) + return false; + + if (!box_inplace(priv->pixmap, ®ion->extents)) + return false; + + if (sna_damage_contains_box__no_reduce(priv->cpu_damage, ®ion->extents)) + return false; + } + + return priv->gpu_bo == NULL || !__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo); + +} + +static bool +try_upload__fast(PixmapPtr pixmap, RegionRec *region, + int x, int y, int w, int h, char *bits, int stride) +{ + struct sna *sna = to_sna_from_pixmap(pixmap); + struct sna_pixmap *priv; + + if (wedged(sna)) + return false; + + priv = sna_pixmap(pixmap); + if (priv == NULL) + return false; + + if (ignore_cpu_damage(sna, priv, region)) { + DBG(("%s: ignore existing cpu damage (if any)\n", __FUNCTION__)); + if (try_upload__inplace(pixmap, region, x, y, w, h, bits, stride)) + return true; + } + + if (DAMAGE_IS_ALL(priv->cpu_damage) || priv->gpu_damage == NULL || priv->cpu) { + DBG(("%s: no, no gpu damage\n", __FUNCTION__)); + return false; + } + + assert(priv->gpu_bo); + assert(priv->gpu_bo->proxy == NULL); - priv->clear = false; - return true; + if (try_upload__blt(pixmap, region, x, y, w, h, bits, stride)) + return true; + + if (try_upload__inplace(pixmap, region, x, y, w, h, bits, stride)) + return true; + + return false; } static bool @@ -4530,7 +4987,8 @@ int x, int y, int w, int h, char *bits, int stride) { PixmapPtr pixmap = get_drawable_pixmap(drawable); - BoxRec *box; + unsigned int hint; + const BoxRec *box; int16_t dx, dy; int n; @@ -4545,23 +5003,31 @@ get_drawable_deltas(drawable, pixmap, &dx, &dy); x += dx + drawable->x; y += dy + drawable->y; + assert(region->extents.x1 >= x); + assert(region->extents.y1 >= y); + assert(region->extents.x2 <= x + w); + assert(region->extents.y2 <= y + h); - if (try_upload_blt(pixmap, region, x, y, w, h, bits, stride)) + if (try_upload__fast(pixmap, region, x, y, w, h, bits, stride)) return true; - if (try_upload_tiled_x(pixmap, region, x, y, w, h, bits, stride)) - return true; + hint = MOVE_WRITE; + if (region_is_unclipped(region, pixmap->drawable.width, h) && + (h+1)*stride > 65536) { + DBG(("%s: segmented, unclipped large upload (%d bytes), marking WHOLE_HINT\n", + __FUNCTION__, h*stride)); + hint |= MOVE_WHOLE_HINT; + } - if (!sna_drawable_move_region_to_cpu(&pixmap->drawable, - region, MOVE_WRITE)) + if (!sna_drawable_move_region_to_cpu(&pixmap->drawable, region, hint)) return false; if (sigtrap_get()) return false; /* Region is pre-clipped and translated into pixmap space */ - box = RegionRects(region); - n = RegionNumRects(region); + box = region_rects(region); + n = region_num_rects(region); DBG(("%s: upload(%d, %d, %d, %d) x %d boxes\n", __FUNCTION__, x, y, w, h, n)); do { DBG(("%s: copy box (%d, %d)->(%d, %d)x(%d, %d)\n", @@ -4584,6 +5050,7 @@ assert(box->y2 - y <= h); assert(has_coherent_ptr(to_sna_from_pixmap(pixmap), sna_pixmap(pixmap), MOVE_WRITE)); + assert(pixmap->devKind); memcpy_blt(bits, pixmap->devPrivate.ptr, pixmap->drawable.bitsPerPixel, stride, pixmap->devKind, @@ -4621,7 +5088,7 @@ struct sna *sna = to_sna_from_pixmap(pixmap); struct sna_damage **damage; struct kgem_bo *bo; - BoxRec *box; + const BoxRec *box; int16_t dx, dy; int n; uint8_t rop = copy_ROP[gc->alu]; @@ -4656,8 +5123,8 @@ kgem_set_mode(&sna->kgem, KGEM_BLT, bo); /* Region is pre-clipped and translated into pixmap space */ - box = RegionRects(region); - n = RegionNumRects(region); + box = region_rects(region); + n = region_num_rects(region); do { int bx1 = (box->x1 - x) & ~7; int bx2 = (box->x2 - x + 7) & ~7; @@ -4817,8 +5284,8 @@ skip = h * BitmapBytePad(w + left); for (i = 1 << (gc->depth-1); i; i >>= 1, bits += skip) { - const BoxRec *box = RegionRects(region); - int n = RegionNumRects(region); + const BoxRec *box = region_rects(region); + int n = region_num_rects(region); if ((gc->planemask & i) == 0) continue; @@ -5137,8 +5604,7 @@ if (priv->cpu_bo->flush && count > SOURCE_BIAS) return true; - if (sna_pixmap_choose_tiling(pixmap, - DEFAULT_TILING) == I915_TILING_NONE) + if (sna_pixmap_default_tiling(to_sna_from_pixmap(pixmap), pixmap) == I915_TILING_NONE) return false; if (priv->cpu) @@ -5153,14 +5619,17 @@ } } -static BoxPtr -reorder_boxes(BoxPtr box, int n, int dx, int dy) +static const BoxRec * +reorder_boxes(const BoxRec *box, int n, int dx, int dy) { - BoxPtr new, base, next, tmp; + const BoxRec *next, *base; + BoxRec *new; DBG(("%s x %d dx=%d, dy=%d\n", __FUNCTION__, n, dx, dy)); if (dy <= 0 && dx <= 0) { + BoxRec *tmp; + new = malloc(sizeof(BoxRec) * n); if (new == NULL) return NULL; @@ -5177,6 +5646,8 @@ base = next = box + n - 1; while (base >= box) { + const BoxRec *tmp; + while (next >= box && base->y1 == next->y1) next--; tmp = next + 1; @@ -5192,6 +5663,8 @@ base = next = box; while (base < box + n) { + const BoxRec *tmp; + while (next < box + n && next->y1 == base->y1) next++; tmp = next; @@ -5213,14 +5686,14 @@ PixmapPtr pixmap = get_drawable_pixmap(src); struct sna *sna = to_sna_from_pixmap(pixmap); struct sna_pixmap *priv = sna_pixmap(pixmap); - BoxPtr box = RegionRects(region); - int n = RegionNumRects(region); + const BoxRec *box = region_rects(region); + int n = region_num_rects(region); int alu = gc ? gc->alu : GXcopy; - int16_t tx, ty; + int16_t tx, ty, sx, sy; assert(pixmap == get_drawable_pixmap(dst)); - assert(RegionNumRects(region)); + assert(region_num_rects(region)); if (((dx | dy) == 0 && alu == GXcopy)) return; @@ -5237,13 +5710,15 @@ dx, dy, alu, pixmap->drawable.width, pixmap->drawable.height)); - if (get_drawable_deltas(src, pixmap, &tx, &ty)) - dx += tx, dy += ty; - if (dst != src) - get_drawable_deltas(dst, pixmap, &tx, &ty); + get_drawable_deltas(dst, pixmap, &tx, &ty); + get_drawable_deltas(src, pixmap, &sx, &sy); + sx += dx; + sy += dy; - if (priv == NULL || DAMAGE_IS_ALL(priv->cpu_damage) || priv->shm) + if (priv == NULL || DAMAGE_IS_ALL(priv->cpu_damage)) { + DBG(("%s: unattached, or all damaged on CPU\n", __FUNCTION__)); goto fallback; + } if (priv->gpu_damage || (priv->cpu_damage == NULL && priv->gpu_bo)) { assert(priv->gpu_bo); @@ -5257,10 +5732,11 @@ __FUNCTION__)); goto fallback; } + assert(priv->cpu_damage == NULL); if (!sna->render.copy_boxes(sna, alu, - pixmap, priv->gpu_bo, dx, dy, - pixmap, priv->gpu_bo, tx, ty, + &pixmap->drawable, priv->gpu_bo, sx, sy, + &pixmap->drawable, priv->gpu_bo, tx, ty, box, n, 0)) { DBG(("%s: fallback - accelerated copy boxes failed\n", __FUNCTION__)); @@ -5269,10 +5745,8 @@ if (!DAMAGE_IS_ALL(priv->gpu_damage)) { assert(!priv->clear); - if (priv->cpu_bo == NULL) { - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + if (sna_pixmap_free_cpu(sna, priv, false)) { + sna_damage_all(&priv->gpu_damage, pixmap); } else { RegionTranslate(region, tx, ty); sna_damage_add(&priv->gpu_damage, region); @@ -5281,11 +5755,12 @@ assert_pixmap_damage(pixmap); } else { fallback: - DBG(("%s: fallback", __FUNCTION__)); + DBG(("%s: fallback\n", __FUNCTION__)); if (!sna_pixmap_move_to_cpu(pixmap, MOVE_READ | MOVE_WRITE)) goto free_boxes; if (alu == GXcopy && pixmap->drawable.bitsPerPixel >= 8) { + assert(pixmap->devKind); if (sigtrap_get() == 0) { FbBits *dst_bits, *src_bits; int stride = pixmap->devKind; @@ -5297,7 +5772,7 @@ ty * stride + tx * bpp / 8); src_bits = (FbBits *) ((char *)pixmap->devPrivate.ptr + - dy * stride + dx * bpp / 8); + sy * stride + sx * bpp / 8); for (i = 0; i < n; i++) memmove_box(src_bits, dst_bits, @@ -5310,9 +5785,8 @@ goto out; if (sigtrap_get() == 0) { - get_drawable_deltas(src, pixmap, &tx, &ty); miCopyRegion(src, dst, gc, - region, dx - tx, dy - ty, + region, dx, dy, fbCopyNtoN, 0, NULL); sigtrap_put(); } @@ -5324,8 +5798,8 @@ } free_boxes: - if (box != RegionRects(region)) - free(box); + if (box != region_rects(region)) + free((void *)box); } static inline bool @@ -5442,7 +5916,8 @@ sna_copy_boxes__inplace(struct sna *sna, RegionPtr region, int alu, PixmapPtr src_pixmap, struct sna_pixmap *src_priv, int dx, int dy, - PixmapPtr dst_pixmap, struct sna_pixmap *dst_priv) + PixmapPtr dst_pixmap, struct sna_pixmap *dst_priv, + bool replaces) { const BoxRec *box; char *ptr; @@ -5505,8 +5980,8 @@ return false; } - assert(sna_damage_contains_box__offset(src_priv->gpu_damage, ®ion->extents, dx, dy) == PIXMAN_REGION_IN); - assert(sna_damage_contains_box__offset(src_priv->cpu_damage, ®ion->extents, dx, dy) == PIXMAN_REGION_OUT); + assert(sna_damage_contains_box__offset(&src_priv->gpu_damage, ®ion->extents, dx, dy) == PIXMAN_REGION_IN); + assert(sna_damage_contains_box__offset(&src_priv->cpu_damage, ®ion->extents, dx, dy) == PIXMAN_REGION_OUT); ptr = kgem_bo_map__cpu(&sna->kgem, src_priv->gpu_bo); if (ptr == NULL) { @@ -5523,10 +5998,11 @@ kgem_bo_sync__cpu_full(&sna->kgem, src_priv->gpu_bo, FORCE_FULL_SYNC); - box = RegionRects(region); - n = RegionNumRects(region); + box = region_rects(region); + n = region_num_rects(region); if (src_priv->gpu_bo->tiling) { DBG(("%s: copy from a tiled CPU map\n", __FUNCTION__)); + assert(dst_pixmap->devKind); do { memcpy_from_tiled_x(&sna->kgem, ptr, dst_pixmap->devPrivate.ptr, src_pixmap->drawable.bitsPerPixel, @@ -5539,6 +6015,7 @@ } while (--n); } else { DBG(("%s: copy from a linear CPU map\n", __FUNCTION__)); + assert(dst_pixmap->devKind); do { memcpy_blt(ptr, dst_pixmap->devPrivate.ptr, src_pixmap->drawable.bitsPerPixel, @@ -5581,18 +6058,14 @@ return false; } - if (!kgem_bo_can_map__cpu(&sna->kgem, dst_priv->gpu_bo, true)) { - DBG(("%s - no, cannot map dst for reads into the CPU\n", __FUNCTION__)); - return false; - } - - if (__kgem_bo_is_busy(&sna->kgem, dst_priv->gpu_bo)) { - if (!dst_priv->pinned) { + if (!kgem_bo_can_map__cpu(&sna->kgem, dst_priv->gpu_bo, true) || + __kgem_bo_is_busy(&sna->kgem, dst_priv->gpu_bo)) { + if (replaces && !dst_priv->pinned) { unsigned create; struct kgem_bo *bo; create = CREATE_CPU_MAP | CREATE_INACTIVE; - if (dst_pixmap->usage_hint == SNA_CREATE_FB) + if (dst_priv->gpu_bo->scanout) create |= CREATE_SCANOUT; bo = kgem_create_2d(&sna->kgem, @@ -5611,6 +6084,11 @@ DBG(("%s - no, dst is busy\n", __FUNCTION__)); return false; } + + if (!kgem_bo_can_map__cpu(&sna->kgem, dst_priv->gpu_bo, true)) { + DBG(("%s - no, cannot map dst for reads into the CPU\n", __FUNCTION__)); + return false; + } } if (src_priv && @@ -5644,11 +6122,14 @@ } dst_priv->clear = false; - box = RegionRects(region); - n = RegionNumRects(region); + assert(has_coherent_ptr(sna, src_priv, MOVE_READ)); + + box = region_rects(region); + n = region_num_rects(region); if (dst_priv->gpu_bo->tiling) { DBG(("%s: copy to a tiled CPU map\n", __FUNCTION__)); assert(dst_priv->gpu_bo->tiling == I915_TILING_X); + assert(src_pixmap->devKind); do { memcpy_to_tiled_x(&sna->kgem, src_pixmap->devPrivate.ptr, ptr, src_pixmap->drawable.bitsPerPixel, @@ -5661,6 +6142,7 @@ } while (--n); } else { DBG(("%s: copy to a linear CPU map\n", __FUNCTION__)); + assert(src_pixmap->devKind); do { memcpy_blt(src_pixmap->devPrivate.ptr, ptr, src_pixmap->drawable.bitsPerPixel, @@ -5687,18 +6169,27 @@ static void discard_cpu_damage(struct sna *sna, struct sna_pixmap *priv) { + if (priv->cpu_damage == NULL && !priv->shm) + return; + DBG(("%s: discarding existing CPU damage\n", __FUNCTION__)); - if (priv->gpu_bo && priv->gpu_bo->proxy) { - assert(priv->gpu_damage == NULL); + + if (kgem_bo_discard_cache(priv->gpu_bo, true)) { + DBG(("%s: discarding cached upload buffer\n", __FUNCTION__)); + assert(DAMAGE_IS_ALL(priv->cpu_damage)); + assert(priv->gpu_damage == NULL || DAMAGE_IS_ALL(priv->gpu_damage)); /* magical upload buffer */ assert(!priv->pinned); assert(!priv->mapped); + sna_damage_destroy(&priv->gpu_damage); kgem_bo_destroy(&sna->kgem, priv->gpu_bo); priv->gpu_bo = NULL; } + sna_damage_destroy(&priv->cpu_damage); list_del(&priv->flush_list); - sna_pixmap_free_cpu(sna, priv, priv->cpu); + if (priv->gpu_bo && sna_pixmap_free_cpu(sna, priv, priv->cpu)) + sna_damage_all(&priv->gpu_damage, priv->pixmap); priv->cpu = false; } @@ -5716,25 +6207,25 @@ struct kgem_bo *bo; int16_t src_dx, src_dy; int16_t dst_dx, dst_dy; - BoxPtr box = RegionRects(region); - int n = RegionNumRects(region); + const BoxRec *box = region_rects(region); + int n = region_num_rects(region); int alu = gc->alu; int stride, bpp; char *bits; bool replaces; - assert(RegionNumRects(region)); + assert(region_num_rects(region)); if (src_pixmap == dst_pixmap) return sna_self_copy_boxes(src, dst, gc, region, dx, dy, bitplane, closure); - DBG(("%s (boxes=%dx[(%d, %d), (%d, %d)...], src=+(%d, %d), dst=+(%d, %d), alu=%d, src.size=%dx%d, dst.size=%dx%d)\n", + DBG(("%s (boxes=%dx[(%d, %d), (%d, %d)...], src pixmap=%ld+(%d, %d), dst pixmap=%ld=+(%d, %d), alu=%d, src.size=%dx%d, dst.size=%dx%d)\n", __FUNCTION__, n, box[0].x1, box[0].y1, box[0].x2, box[0].y2, - dx, dy, - get_drawable_dx(dst), get_drawable_dy(dst), + src_pixmap->drawable.serialNumber, dx, dy, + dst_pixmap->drawable.serialNumber, get_drawable_dx(dst), get_drawable_dy(dst), alu, src_pixmap->drawable.width, src_pixmap->drawable.height, dst_pixmap->drawable.width, dst_pixmap->drawable.height)); @@ -5777,45 +6268,62 @@ goto fallback; } - /* XXX hack for firefox -- subsequent uses of src will be corrupt! */ - if (src_priv && - COW(src_priv->cow) == COW(dst_priv->cow) && - IS_COW_OWNER(dst_priv->cow)) { - DBG(("%s: ignoring cow reference for cousin copy\n", - __FUNCTION__)); - assert(src_priv->cpu_damage == NULL); - assert(dst_priv->move_to_gpu == NULL); - bo = dst_priv->gpu_bo; - damage = NULL; + if (alu == GXcopy && + src_priv && src_priv->cow && + COW(src_priv->cow) == COW(dst_priv->cow)) { + if ((dx | dy) == 0) { + DBG(("%s: ignoring cow for no op\n", + __FUNCTION__)); + return; + } else if (IS_COW_OWNER(dst_priv->cow)) { + /* XXX hack for firefox -- subsequent uses of src will be corrupt! */ + DBG(("%s: ignoring cow reference for cousin copy\n", + __FUNCTION__)); + assert(src_priv->cpu_damage == NULL); + assert(dst_priv->move_to_gpu == NULL); + bo = dst_priv->gpu_bo; + damage = NULL; + } else + goto discard_cow; } else { - unsigned hint = copy_prefer_gpu(sna, dst_priv, src_priv, region, src_dx, src_dy); + unsigned hint; +discard_cow: + hint = copy_prefer_gpu(sna, dst_priv, src_priv, region, src_dx, src_dy); if (replaces) { discard_cpu_damage(sna, dst_priv); - hint |= REPLACES | IGNORE_CPU; + hint |= REPLACES | IGNORE_DAMAGE; } else if (alu_overwrites(alu)) { if (region->data == NULL) - hint |= IGNORE_CPU; + hint |= IGNORE_DAMAGE; if (dst_priv->cpu_damage && region_subsumes_damage(region, dst_priv->cpu_damage)) { discard_cpu_damage(sna, dst_priv); - hint |= IGNORE_CPU; + hint |= IGNORE_DAMAGE; } } bo = sna_drawable_use_bo(&dst_pixmap->drawable, hint, ®ion->extents, &damage); } if (bo) { - if (src_priv && src_priv->clear) { + if (alu == GXset || alu == GXclear || (src_priv && src_priv->clear)) { + uint32_t color; + + if (alu == GXset) + color = (1 << dst_pixmap->drawable.depth) - 1; + else if (alu == GXclear) + color = 0; + else + color = src_priv->clear_color; DBG(("%s: applying src clear [%08x] to dst\n", __FUNCTION__, src_priv->clear_color)); + if (n == 1) { if (replaces && UNDO) - kgem_bo_undo(&sna->kgem, bo); + kgem_bo_pair_undo(&sna->kgem, dst_priv->gpu_bo, dst_priv->cpu_bo); if (!sna->render.fill_one(sna, - dst_pixmap, bo, - src_priv->clear_color, + dst_pixmap, bo, color, box->x1, box->y1, box->x2, box->y2, alu)) { @@ -5830,10 +6338,8 @@ dst_priv->gpu_bo->handle, src_priv->clear_color)); dst_priv->clear = true; - dst_priv->clear_color = src_priv->clear_color; - sna_damage_all(&dst_priv->gpu_damage, - dst_pixmap->drawable.width, - dst_pixmap->drawable.height); + dst_priv->clear_color = color; + sna_damage_all(&dst_priv->gpu_damage, dst_pixmap); sna_damage_destroy(&dst_priv->cpu_damage); list_del(&dst_priv->flush_list); return; @@ -5843,7 +6349,7 @@ if (!sna_fill_init_blt(&fill, sna, dst_pixmap, bo, - alu, src_priv->clear_color, + alu, color, FILL_BOXES)) { DBG(("%s: unsupported fill\n", __FUNCTION__)); @@ -5865,7 +6371,7 @@ DBG(("%s: move whole src_pixmap to GPU and copy\n", __FUNCTION__)); if (replaces && UNDO) - kgem_bo_undo(&sna->kgem, bo); + kgem_bo_pair_undo(&sna->kgem, dst_priv->gpu_bo, dst_priv->cpu_bo); if (replaces && src_pixmap->drawable.width == dst_pixmap->drawable.width && @@ -5874,9 +6380,7 @@ assert(src_pixmap->drawable.bitsPerPixel == dst_pixmap->drawable.bitsPerPixel); if (sna_pixmap_make_cow(sna, src_priv, dst_priv)) { assert(dst_priv->gpu_bo == src_priv->gpu_bo); - sna_damage_all(&dst_priv->gpu_damage, - dst_pixmap->drawable.width, - dst_pixmap->drawable.height); + sna_damage_all(&dst_priv->gpu_damage, dst_pixmap); sna_damage_destroy(&dst_priv->cpu_damage); list_del(&dst_priv->flush_list); if (dst_priv->shm) @@ -5885,8 +6389,8 @@ } } if (!sna->render.copy_boxes(sna, alu, - src_pixmap, src_priv->gpu_bo, src_dx, src_dy, - dst_pixmap, bo, 0, 0, + &src_pixmap->drawable, src_priv->gpu_bo, src_dx, src_dy, + &dst_pixmap->drawable, bo, 0, 0, box, n, 0)) { DBG(("%s: fallback - accelerated copy boxes failed\n", __FUNCTION__)); @@ -5919,11 +6423,11 @@ } if (replaces && UNDO) - kgem_bo_undo(&sna->kgem, bo); + kgem_bo_pair_undo(&sna->kgem, dst_priv->gpu_bo, dst_priv->cpu_bo); if (!sna->render.copy_boxes(sna, alu, - src_pixmap, src_priv->gpu_bo, src_dx, src_dy, - dst_pixmap, bo, 0, 0, + &src_pixmap->drawable, src_priv->gpu_bo, src_dx, src_dy, + &dst_pixmap->drawable, bo, 0, 0, box, n, 0)) { DBG(("%s: fallback - accelerated copy boxes failed\n", __FUNCTION__)); @@ -5938,7 +6442,7 @@ if (bo != dst_priv->gpu_bo) goto fallback; - if (use_shm_bo(sna, bo, src_priv, alu, replaces)) { + if (use_shm_bo(sna, bo, src_priv, alu, replaces && !dst_priv->pinned)) { bool ret; DBG(("%s: region overlaps CPU damage, copy from CPU bo (shm? %d)\n", @@ -5957,7 +6461,7 @@ } if (replaces && UNDO) - kgem_bo_undo(&sna->kgem, bo); + kgem_bo_pair_undo(&sna->kgem, dst_priv->gpu_bo, dst_priv->cpu_bo); if (src_priv->shm) { assert(!src_priv->flush); @@ -5965,8 +6469,8 @@ } if (!sna->render.copy_boxes(sna, alu, - src_pixmap, src_priv->cpu_bo, src_dx, src_dy, - dst_pixmap, bo, 0, 0, + &src_pixmap->drawable, src_priv->cpu_bo, src_dx, src_dy, + &dst_pixmap->drawable, bo, 0, 0, box, n, src_priv->shm ? COPY_LAST : 0)) { DBG(("%s: fallback - accelerated copy boxes failed\n", __FUNCTION__)); @@ -6007,6 +6511,7 @@ DBG(("%s: upload through a temporary map\n", __FUNCTION__)); + assert(src_pixmap->devKind); src_bo = kgem_create_map(&sna->kgem, src_pixmap->devPrivate.ptr, src_pixmap->devKind * src_pixmap->drawable.height, @@ -6016,8 +6521,8 @@ kgem_bo_mark_unreusable(src_bo); ok = sna->render.copy_boxes(sna, alu, - src_pixmap, src_bo, src_dx, src_dy, - dst_pixmap, bo, 0, 0, + &src_pixmap->drawable, src_bo, src_dx, src_dy, + &dst_pixmap->drawable, bo, 0, 0, box, n, COPY_LAST); kgem_bo_sync__cpu(&sna->kgem, src_bo); @@ -6068,6 +6573,8 @@ assert(has_coherent_ptr(sna, sna_pixmap(src_pixmap), MOVE_READ)); assert(has_coherent_ptr(sna, sna_pixmap(tmp), MOVE_WRITE)); + assert(src_pixmap->devKind); + assert(tmp->devKind); memcpy_blt(src_pixmap->devPrivate.ptr, tmp->devPrivate.ptr, src_pixmap->drawable.bitsPerPixel, @@ -6092,8 +6599,8 @@ } if (!sna->render.copy_boxes(sna, alu, - tmp, src_bo, dx, dy, - dst_pixmap, bo, 0, 0, + &tmp->drawable, src_bo, dx, dy, + &dst_pixmap->drawable, bo, 0, 0, box, n, 0)) { DBG(("%s: fallback - accelerated copy boxes failed\n", __FUNCTION__)); @@ -6109,6 +6616,7 @@ DBG(("%s: dst is on the GPU, src is on the CPU, uploading into dst\n", __FUNCTION__)); + assert(src_pixmap->devKind); if (!dst_priv->pinned && replaces) { stride = src_pixmap->devKind; bits = src_pixmap->devPrivate.ptr; @@ -6140,9 +6648,7 @@ assert(*damage == dst_priv->gpu_damage); if (replaces) { sna_damage_destroy(&dst_priv->cpu_damage); - sna_damage_all(&dst_priv->gpu_damage, - dst_pixmap->drawable.width, - dst_pixmap->drawable.height); + sna_damage_all(&dst_priv->gpu_damage, dst_pixmap); list_del(&dst_priv->flush_list); } else sna_damage_add(&dst_priv->gpu_damage, @@ -6167,6 +6673,7 @@ } assert(dst_pixmap->devPrivate.ptr); + assert(dst_pixmap->devKind); do { pixman_fill(dst_pixmap->devPrivate.ptr, dst_pixmap->devKind/sizeof(uint32_t), @@ -6180,7 +6687,8 @@ } else if (!sna_copy_boxes__inplace(sna, region, alu, src_pixmap, src_priv, src_dx, src_dy, - dst_pixmap, dst_priv)) { + dst_pixmap, dst_priv, + replaces)) { FbBits *dst_bits, *src_bits; int dst_stride, src_stride; @@ -6221,6 +6729,8 @@ } assert(dst_priv == sna_pixmap(dst_pixmap)); + assert(dst_pixmap->devKind); + assert(src_pixmap->devKind); dst_stride = dst_pixmap->devKind; src_stride = src_pixmap->devKind; @@ -6250,6 +6760,8 @@ assert(box->y2 + src_dy <= src_pixmap->drawable.height); assert(has_coherent_ptr(sna, src_priv, MOVE_READ)); assert(has_coherent_ptr(sna, dst_priv, MOVE_WRITE)); + assert(src_stride); + assert(dst_stride); memcpy_blt(src_bits, dst_bits, bpp, src_stride, dst_stride, box->x1, box->y1, @@ -6394,18 +6906,18 @@ } else RegionIntersect(®ion, ®ion, clip); } - DBG(("%s: src extents (%d, %d), (%d, %d) x %ld\n", __FUNCTION__, + DBG(("%s: src extents (%d, %d), (%d, %d) x %d\n", __FUNCTION__, region.extents.x1, region.extents.y1, region.extents.x2, region.extents.y2, - (long)RegionNumRects(®ion))); + region_num_rects(®ion))); RegionTranslate(®ion, dx-sx, dy-sy); if (gc->pCompositeClip->data) RegionIntersect(®ion, ®ion, gc->pCompositeClip); - DBG(("%s: copy region (%d, %d), (%d, %d) x %ld\n", __FUNCTION__, + DBG(("%s: copy region (%d, %d), (%d, %d) x %d\n", __FUNCTION__, region.extents.x1, region.extents.y1, region.extents.x2, region.extents.y2, - (long)RegionNumRects(®ion))); + region_num_rects(®ion))); if (!box_empty(®ion.extents)) copy(src, dst, gc, ®ion, sx-dx, sy-dy, bitPlane, closure); @@ -6428,8 +6940,8 @@ RegionPtr region, int dx, int dy, Pixel bitplane, void *closure) { - DBG(("%s (boxes=%ldx[(%d, %d), (%d, %d)...], src=+(%d, %d), alu=%d\n", - __FUNCTION__, (long)RegionNumRects(region), + DBG(("%s (boxes=%dx[(%d, %d), (%d, %d)...], src=+(%d, %d), alu=%d\n", + __FUNCTION__, region_num_rects(region), region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2, dx, dy, gc->alu)); @@ -6552,10 +7064,14 @@ DDXPointRec last; DBG(("%s: count=%d\n", __FUNCTION__, n)); + if (n == 0) + return; last.x = drawable->x + data->dx; last.y = drawable->y + data->dy; - while (n) { + if (op->points && mode != CoordModePrevious) { + op->points(data->sna, op, last.x, last.y, pt, n); + } else do { BoxRec *b = box; unsigned nbox = n; if (nbox > ARRAY_SIZE(box)) @@ -6574,7 +7090,7 @@ b++; } while (--nbox); op->boxes(data->sna, op, box, b - box); - } + } while (n); } static void @@ -7055,9 +7571,9 @@ assert(dx + clip.extents.x2 <= pixmap->drawable.width); assert(dy + clip.extents.y2 <= pixmap->drawable.height); - DBG(("%s: clip %ld x [(%d, %d), (%d, %d)] x %d [(%d, %d)...]\n", + DBG(("%s: clip %d x [(%d, %d), (%d, %d)] x %d [(%d, %d)...]\n", __FUNCTION__, - (long)RegionNumRects(&clip), + region_num_rects(&clip), clip.extents.x1, clip.extents.y1, clip.extents.x2, clip.extents.y2, n, pt->x, pt->y)); @@ -7155,9 +7671,9 @@ assert(dx + clip.extents.x2 <= pixmap->drawable.width); assert(dy + clip.extents.y2 <= pixmap->drawable.height); - DBG(("%s: clip %ld x [(%d, %d), (%d, %d)] x %d [(%d, %d)...]\n", + DBG(("%s: clip %d x [(%d, %d), (%d, %d)] x %d [(%d, %d)...]\n", __FUNCTION__, - (long)RegionNumRects(&clip), + region_num_rects(&clip), clip.extents.x1, clip.extents.y1, clip.extents.x2, clip.extents.y2, n, pt->x, pt->y)); @@ -7272,6 +7788,17 @@ static inline bool gc_is_solid(GCPtr gc, uint32_t *color) { + assert(FbFullMask(gc->depth) == (FbFullMask(gc->depth) & gc->planemask)); + + if (gc->alu == GXclear) { + *color = 0; + return true; + } + if (gc->alu == GXset) { + *color = (1 << gc->depth) - 1; + return true; + } + if (gc->fillStyle == FillSolid || (gc->fillStyle == FillTiled && gc->tileIsPixel) || (gc->fillStyle == FillOpaqueStippled && gc->bgPixel == gc->fgPixel)) { @@ -7544,17 +8071,17 @@ PixmapPtr bitmap = (PixmapPtr)_bitmap; uint32_t br00, br13; int16_t dx, dy; - BoxPtr box; + const BoxRec *box; int n; - DBG(("%s: plane=%x (%d,%d),(%d,%d)x%ld\n", + DBG(("%s: plane=%x (%d,%d),(%d,%d)xld\n", __FUNCTION__, (unsigned)bitplane, region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2, - (long)RegionNumRects(region))); + region_num_rects(region))); - box = RegionRects(region); - n = RegionNumRects(region); + box = region_rects(region); + n = region_num_rects(region); assert(n); get_drawable_deltas(drawable, pixmap, &dx, &dy); @@ -7587,6 +8114,7 @@ sx, sy, bx1, bx2)); src_stride = bstride*bh; + assert(src_stride > 0); if (src_stride <= 128) { src_stride = ALIGN(src_stride, 8) / 4; assert(src_stride <= 32); @@ -7637,6 +8165,7 @@ sna->kgem.nbatch += 7 + src_stride; } + assert(bitmap->devKind); src_stride = bitmap->devKind; src = bitmap->devPrivate.ptr; src += (box->y1 + sy) * src_stride + bx1/8; @@ -7718,6 +8247,7 @@ } dst = ptr; + assert(bitmap->devKind); src_stride = bitmap->devKind; src = bitmap->devPrivate.ptr; src += (box->y1 + sy) * src_stride + bx1/8; @@ -7764,8 +8294,8 @@ int16_t dx, dy; int bit = ffs(bitplane) - 1; uint32_t br00, br13; - BoxPtr box = RegionRects(region); - int n = RegionNumRects(region); + const BoxRec *box = region_rects(region); + int n = region_num_rects(region); DBG(("%s: plane=%x [%d] x%d\n", __FUNCTION__, (unsigned)bitplane, bit, n)); @@ -7823,6 +8353,7 @@ if (sigtrap_get() == 0) { uint32_t *b; + assert(src_pixmap->devKind); switch (source->bitsPerPixel) { case 32: { @@ -8143,26 +8674,30 @@ assert_pixmap_contains_points(pixmap, pt, n, last.x, last.y); sna_damage_add_points(damage, pt, n, last.x, last.y); - do { - unsigned nbox = n; - if (nbox > ARRAY_SIZE(box)) - nbox = ARRAY_SIZE(box); - n -= nbox; + if (fill.points && mode != CoordModePrevious) { + fill.points(sna, &fill, last.x, last.y, pt, n); + } else { do { - *(DDXPointRec *)b = *pt++; + unsigned nbox = n; + if (nbox > ARRAY_SIZE(box)) + nbox = ARRAY_SIZE(box); + n -= nbox; + do { + *(DDXPointRec *)b = *pt++; - b->x1 += last.x; - b->y1 += last.y; - if (mode == CoordModePrevious) - last = *(DDXPointRec *)b; + b->x1 += last.x; + b->y1 += last.y; + if (mode == CoordModePrevious) + last = *(DDXPointRec *)b; - b->x2 = b->x1 + 1; - b->y2 = b->y1 + 1; - b++; - } while (--nbox); - fill.boxes(sna, &fill, box, b - box); - b = box; - } while (n); + b->x2 = b->x1 + 1; + b->y2 = b->y1 + 1; + b++; + } while (--nbox); + fill.boxes(sna, &fill, box, b - box); + b = box; + } while (n); + } } else { RegionPtr clip = gc->pCompositeClip; @@ -8229,10 +8764,33 @@ box_add_pt(&box, last.x, last.y); } } else { - while (--n) { - ++pt; - box_add_pt(&box, pt->x, pt->y); + --n; ++pt; + while (n >= 8) { + box_add_pt(&box, pt[0].x, pt[0].y); + box_add_pt(&box, pt[1].x, pt[1].y); + box_add_pt(&box, pt[2].x, pt[2].y); + box_add_pt(&box, pt[3].x, pt[3].y); + box_add_pt(&box, pt[4].x, pt[4].y); + box_add_pt(&box, pt[5].x, pt[5].y); + box_add_pt(&box, pt[6].x, pt[6].y); + box_add_pt(&box, pt[7].x, pt[7].y); + pt += 8; + n -= 8; + } + if (n & 4) { + box_add_pt(&box, pt[0].x, pt[0].y); + box_add_pt(&box, pt[1].x, pt[1].y); + box_add_pt(&box, pt[2].x, pt[2].y); + box_add_pt(&box, pt[3].x, pt[3].y); + pt += 4; + } + if (n & 2) { + box_add_pt(&box, pt[0].x, pt[0].y); + box_add_pt(&box, pt[1].x, pt[1].y); + pt += 2; } + if (n & 1) + box_add_pt(&box, pt[0].x, pt[0].y); } box.x2++; box.y2++; @@ -8361,8 +8919,8 @@ clip.extents.x2, clip.extents.y2, dx, dy, damage)); - extents = RegionRects(&clip); - last_extents = extents + RegionNumRects(&clip); + extents = region_rects(&clip); + last_extents = extents + region_num_rects(&clip); b = box; do { @@ -8711,7 +9269,7 @@ DDXPointRec last; int16_t dx, dy; - DBG(("%s: alu=%d, fg=%08x\n", __FUNCTION__, gc->alu, (unsigned)pixel)); + DBG(("%s: alu=%d, fg=%08x, clipped=%d\n", __FUNCTION__, gc->alu, (unsigned)pixel, clipped)); if (!sna_fill_init_blt(&fill, sna, pixmap, bo, gc->alu, pixel, FILL_BOXES)) return false; @@ -8737,6 +9295,8 @@ p.x += dx; p.y += dy; } + DBG(("%s: line (%d, %d) -> (%d, %d)\n", __FUNCTION__, last.x, last.y, p.x, p.y)); + if (last.x == p.x) { b->x1 = last.x; b->x2 = last.x + 1; @@ -8747,6 +9307,7 @@ b->x1 = p.x; b->x2 = last.x; } + if (last.y == p.y) { b->y1 = last.y; b->y2 = last.y + 1; @@ -8757,11 +9318,12 @@ b->y1 = p.y; b->y2 = last.y; } - b->y2 += last.x == p.x; - b->x2 += last.y == p.y; + b->y2 += last.x == p.x && last.y != p.y; + b->x2 += last.y == p.y && last.x != p.x; DBG(("%s: blt (%d, %d), (%d, %d)\n", __FUNCTION__, b->x1, b->y1, b->x2, b->y2)); + if (++b == last_box) { assert_pixmap_contains_boxes(pixmap, boxes, last_box-boxes, 0, 0); fill.boxes(sna, &fill, boxes, last_box - boxes); @@ -8815,8 +9377,8 @@ b->y1 = p.y; b->y2 = last.y; } - b->y2 += last.x == p.x; - b->x2 += last.y == p.y; + b->y2 += last.x == p.x && last.y != p.y; + b->x2 += last.y == p.y && last.x != p.x; DBG(("%s: blt (%d, %d), (%d, %d)\n", __FUNCTION__, b->x1, b->y1, b->x2, b->y2)); @@ -8873,8 +9435,8 @@ box.y1 = p.y; box.y2 = last.y; } - b->y2 += last.x == p.x; - b->x2 += last.y == p.y; + b->y2 += last.x == p.x && last.y != p.y; + b->x2 += last.y == p.y && last.x != p.x; DBG(("%s: blt (%d, %d), (%d, %d)\n", __FUNCTION__, box.x1, box.y1, box.x2, box.y2)); @@ -9045,9 +9607,10 @@ if (data.flags == 0) return; - DBG(("%s: extents (%d, %d), (%d, %d)\n", __FUNCTION__, + DBG(("%s: extents (%d, %d), (%d, %d), flags=%x\n", __FUNCTION__, data.region.extents.x1, data.region.extents.y1, - data.region.extents.x2, data.region.extents.y2)); + data.region.extents.x2, data.region.extents.y2, + data.flags)); data.region.data = NULL; @@ -9064,7 +9627,7 @@ goto fallback; } - DBG(("%s: fill=%d [%d], line=%d [%d], width=%d, mask=%lu [%d], rectlinear=%d\n", + DBG(("%s: fill=%d [%d], line=%d [%d], width=%d, mask=%lx [%d], rectlinear=%d\n", __FUNCTION__, gc->fillStyle, gc->fillStyle == FillSolid, gc->lineStyle, gc->lineStyle == LineSolid, @@ -9593,8 +10156,8 @@ jump = _jump[(damage != NULL) | !!(dx|dy) << 1]; b = box; - extents = RegionRects(&clip); - last_extents = extents + RegionNumRects(&clip); + extents = region_rects(&clip); + last_extents = extents + region_num_rects(&clip); do { int n = _n; const xSegment *s = _s; @@ -10803,8 +11366,8 @@ } fallback: - DBG(("%s: fallback, clip=%ldx[(%d, %d), (%d, %d)]\n", __FUNCTION__, - (long)RegionNumRects(gc->pCompositeClip), + DBG(("%s: fallback, clip=%dx[(%d, %d), (%d, %d)]\n", __FUNCTION__, + region_num_rects(gc->pCompositeClip), gc->pCompositeClip->extents.x1, gc->pCompositeClip->extents.y1, gc->pCompositeClip->extents.x2, gc->pCompositeClip->extents.y2)); @@ -10812,8 +11375,8 @@ if (!region_maybe_clip(®ion, gc->pCompositeClip)) return; - DBG(("%s: CPU region=%ldx[(%d, %d), (%d, %d)]\n", __FUNCTION__, - (long)RegionNumRects(®ion), + DBG(("%s: CPU region=%dx[(%d, %d), (%d, %d)]\n", __FUNCTION__, + region_num_rects(®ion), region.extents.x1, region.extents.y1, region.extents.x2, region.extents.y2)); if (!sna_gc_move_to_cpu(gc, drawable, ®ion)) @@ -11037,7 +11600,7 @@ struct kgem_bo *bo, struct sna_damage **damage, GCPtr gc, uint32_t pixel, - int n, xRectangle *rect, + int n, const xRectangle *rect, const BoxRec *extents, bool clipped) { @@ -11047,8 +11610,8 @@ BoxRec boxes[512], *b = boxes, *const last_box = boxes+ARRAY_SIZE(boxes); int16_t dx, dy; - DBG(("%s x %d [(%d, %d)x(%d, %d)...]+(%d,%d), clipped?=%d\n", - __FUNCTION__, n, + DBG(("%s pixmap=%ld x %d [(%d, %d)x(%d, %d)...]+(%d,%d), clipped?=%d\n", + __FUNCTION__, pixmap->drawable.serialNumber, n, rect->x, rect->y, rect->width, rect->height, drawable->x, drawable->y, clipped)); @@ -11066,34 +11629,33 @@ r.x1 += dx; r.y1 += dy; r.x2 += dx; r.y2 += dy; } + DBG(("%s: using fill_one() fast path: (%d, %d), (%d, %d). alu=%d, pixel=%08x\n", + __FUNCTION__, r.x1, r.y1, r.x2, r.y2, gc->alu, pixel)); + if (sna->render.fill_one(sna, pixmap, bo, pixel, r.x1, r.y1, r.x2, r.y2, gc->alu)) { if (damage) { assert_pixmap_contains_box(pixmap, &r); if (r.x2 - r.x1 == pixmap->drawable.width && - r.y2 - r.y1 == pixmap->drawable.height) { - sna_damage_all(damage, - pixmap->drawable.width, - pixmap->drawable.height); - } else + r.y2 - r.y1 == pixmap->drawable.height) + sna_damage_all(damage, pixmap); + else sna_damage_add_box(damage, &r); } assert_pixmap_damage(pixmap); - if ((gc->alu == GXcopy || gc->alu == GXclear) && + if (alu_overwrites(gc->alu) && r.x2 - r.x1 == pixmap->drawable.width && r.y2 - r.y1 == pixmap->drawable.height) { struct sna_pixmap *priv = sna_pixmap(pixmap); if (bo == priv->gpu_bo) { assert(priv->gpu_bo->proxy == NULL); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->gpu_damage, pixmap); sna_damage_destroy(&priv->cpu_damage); list_del(&priv->flush_list); priv->clear = true; - priv->clear_color = gc->alu == GXcopy ? pixel : 0; + priv->clear_color = gc->alu == GXcopyInverted ? ~pixel & ((1 << gc->depth) - 1) : pixel; DBG(("%s: pixmap=%ld, marking clear [%08x]\n", __FUNCTION__, pixmap->drawable.serialNumber, priv->clear_color)); @@ -11235,7 +11797,7 @@ static uint32_t get_pixel(PixmapPtr pixmap) { - DBG(("%s\n", __FUNCTION__)); + DBG(("%s(pixmap=%ld)\n", __FUNCTION__, pixmap->drawable.serialNumber)); if (!sna_pixmap_move_to_cpu(pixmap, MOVE_READ)) return 0; @@ -11389,52 +11951,71 @@ sna_pixmap_get_source_bo(PixmapPtr pixmap) { struct sna_pixmap *priv = sna_pixmap(pixmap); + unsigned flags; + BoxRec box; - DBG(("%s(pixmap=%ld)\n", __FUNCTION__, pixmap->drawable.serialNumber)); + box.x1 = box.y1 = 0; + box.x2 = pixmap->drawable.width; + box.y2 = pixmap->drawable.height; + + DBG(("%s(pixmap=%ld, size=%dx%d)\n", __FUNCTION__, + pixmap->drawable.serialNumber, pixmap->drawable.width, pixmap->drawable.height)); if (priv == NULL) { + DBG(("%s: unattached, uploading data into temporary\n", __FUNCTION__)); + return kgem_upload_source_image(&to_sna_from_pixmap(pixmap)->kgem, + pixmap->devPrivate.ptr, &box, + pixmap->devKind, + pixmap->drawable.bitsPerPixel); + } + + if (priv->gpu_damage) { + if (sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_ASYNC_HINT)) + return kgem_bo_reference(priv->gpu_bo); + } else if (priv->cpu_damage) { + if (priv->cpu_bo) + return kgem_bo_reference(priv->cpu_bo); + } else { + if (priv->gpu_bo) + return kgem_bo_reference(priv->gpu_bo); + if (priv->cpu_bo) + return kgem_bo_reference(priv->cpu_bo); + } + + flags = MOVE_READ | MOVE_ASYNC_HINT; + if (priv->gpu_bo && priv->gpu_bo->proxy) { + struct kgem_bo *bo = priv->gpu_bo; + if (bo->rq == NULL && (bo->snoop || bo->pitch >= 4096)) + flags |= __MOVE_FORCE; + } + if (priv->gpu_bo == NULL) { + if (++priv->source_count > SOURCE_BIAS) + flags |= __MOVE_FORCE; + } + + if (!sna_pixmap_move_to_gpu(pixmap, flags)) { struct kgem_bo *upload; - struct sna *sna = to_sna_from_pixmap(pixmap); - void *ptr; - upload = kgem_create_buffer_2d(&sna->kgem, - pixmap->drawable.width, - pixmap->drawable.height, - pixmap->drawable.bitsPerPixel, - KGEM_BUFFER_WRITE_INPLACE, - &ptr); - if (upload == NULL) + if (!sna_pixmap_move_to_cpu(pixmap, MOVE_READ)) return NULL; - if (sigtrap_get()) { - kgem_bo_destroy(&sna->kgem, upload); + upload = kgem_upload_source_image(&to_sna_from_pixmap(pixmap)->kgem, + pixmap->devPrivate.ptr, &box, + pixmap->devKind, + pixmap->drawable.bitsPerPixel); + if (upload == NULL) return NULL; - } - - assert(has_coherent_ptr(sna, sna_pixmap(pixmap), MOVE_READ)); - memcpy_blt(pixmap->devPrivate.ptr, ptr, - pixmap->drawable.bitsPerPixel, - pixmap->devKind, upload->pitch, - 0, 0, - 0, 0, - pixmap->drawable.width, - pixmap->drawable.height); - sigtrap_put(); + if (priv->gpu_bo == NULL) { + DBG(("%s: adding upload cache to pixmap=%ld\n", + __FUNCTION__, pixmap->drawable.serialNumber)); + assert(upload->proxy != NULL); + kgem_proxy_bo_attach(upload, &priv->gpu_bo); + } return upload; } - if (priv->gpu_damage && - !sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_ASYNC_HINT)) - return NULL; - - if (priv->cpu_damage && priv->cpu_bo) - return kgem_bo_reference(priv->cpu_bo); - - if (!sna_pixmap_force_to_gpu(pixmap, MOVE_READ | MOVE_ASYNC_HINT)) - return NULL; - return kgem_bo_reference(priv->gpu_bo); } @@ -11767,6 +12348,9 @@ box.y1 = r->y + drawable->y; box.x2 = bound(box.x1, r->width); box.y2 = bound(box.y1, r->height); + DBG(("%s: rect=(%d, %d), (%d, %d), box=(%d, %d), (%d, %d)\n", __FUNCTION__, + r->x, r->y, r->width, r->height, + box.x1, box.y1, box.x2, box.y2)); r++; c = find_clip_box_for_y(clip_start, @@ -11775,12 +12359,15 @@ while (c != clip_end) { BoxRec bb; + DBG(("%s: clip=(%d, %d), (%d, %d)\n", __FUNCTION__, c->x1, c->y1, c->x2, c->y2)); + if (box.y2 <= c->y1) break; bb = box; if (box_intersect(&bb, c++)) { if (!kgem_check_batch(&sna->kgem, 3)) { + DBG(("%s: emitting split batch\n", __FUNCTION__)); _kgem_submit(&sna->kgem); _kgem_set_mode(&sna->kgem, KGEM_BLT); @@ -11833,6 +12420,9 @@ assert(bb.x2 + dx <= pixmap->drawable.width); assert(bb.y2 + dy <= pixmap->drawable.height); + DBG(("%s: emit box=(%d, %d),(%d, %d) + (%d, %d), tile=(%d, %d) [relative to drawable: (%d, %d)]\n", + __FUNCTION__, bb.x1, bb.y1, bb.x2, bb.y2, dx, dy, tx, ty, bb.x1 - drawable->x, bb.y1 - drawable->y)); + assert(sna->kgem.mode == KGEM_BLT); b = sna->kgem.batch + sna->kgem.nbatch; b[0] = br00; @@ -11848,7 +12438,7 @@ sna->kgem.nbatch = unwind_batch; sna->kgem.nreloc = unwind_reloc; if (sna->kgem.nbatch == 0) - kgem_bo_undo(&sna->kgem, bo); + kgem_bo_pair_undo(&sna->kgem, bo, tile_bo); } } done: @@ -11857,6 +12447,28 @@ return true; } +static bool tile8(int x) +{ + switch(x) { + case 1: + case 2: + case 4: + case 8: + return true; + default: + return false; + } +} + +static int next8(int x, int max) +{ + if (x > 2 && x <= 4) + x = 4; + else if (x < 8) + x = 8; + return MIN(x, max); +} + static bool sna_poly_fill_rect_tiled_nxm_blt(DrawablePtr drawable, struct kgem_bo *bo, @@ -11867,53 +12479,148 @@ PixmapPtr pixmap = get_drawable_pixmap(drawable); struct sna *sna = to_sna_from_pixmap(pixmap); PixmapPtr tile = gc->tile.pixmap; + int w, h, tx, ty, tw, th, bpp = tile->drawable.bitsPerPixel; + const DDXPointRec origin = gc->patOrg; struct kgem_bo *upload; - int w, h, cpp; + bool ret = false; + uint8_t *src; void *ptr; - bool ret; - DBG(("%s: %dx%d\n", __FUNCTION__, - tile->drawable.width, tile->drawable.height)); + tx = 0, tw = tile->drawable.width; + if (!tile8(tw) && tw > extents->x2 - extents->x1) { + tx = (extents->x1 - gc->patOrg.x - drawable->x) % tw; + if (tx < 0) + tx += tw; + tw = next8(extents->x2 - extents->x1, tw); + gc->patOrg.x = extents->x1 - drawable->x; + } + + ty = 0, th = tile->drawable.height; + if (!tile8(th) && th > extents->y2 - extents->y1) { + ty = (extents->y1 - gc->patOrg.y - drawable->y) % th; + if (ty < 0) + ty += th; + th = next8(extents->y2 - extents->y1, th); + gc->patOrg.y = extents->y1 - drawable->y; + } + + DBG(("%s: %dx%d+%d+%d (full tile size %dx%d)\n", __FUNCTION__, + tw, th, tx, ty, tile->drawable.width, tile->drawable.height)); + assert(tx < tile->drawable.width && tx >= 0); + assert(ty < tile->drawable.height && ty >= 0); + assert(tw && tw <= 8 && tw <= tile->drawable.width); + assert(is_power_of_two(tw)); + assert(th && th <= 8 && th <= tile->drawable.height); + assert(is_power_of_two(th)); if (!sna_pixmap_move_to_cpu(tile, MOVE_READ)) - return false; - - upload = kgem_create_buffer(&sna->kgem, 8*tile->drawable.bitsPerPixel, - KGEM_BUFFER_WRITE_INPLACE, - &ptr); - if (upload == NULL) - return false; + goto out_gc; - assert(tile->drawable.height && tile->drawable.height <= 8); - assert(tile->drawable.width && tile->drawable.width <= 8); + assert(tile->devKind); assert(has_coherent_ptr(sna, sna_pixmap(tile), MOVE_READ)); - upload->pitch = 8*tile->drawable.bitsPerPixel >> 3; /* for sanity checks */ - - cpp = tile->drawable.bitsPerPixel/8; - for (h = 0; h < tile->drawable.height; h++) { - uint8_t *src = (uint8_t *)tile->devPrivate.ptr + tile->devKind*h; - uint8_t *dst = (uint8_t *)ptr + 8*cpp*h; - w = tile->drawable.width*cpp; - memcpy(dst, src, w); - while (w < 8*cpp) { - memcpy(dst+w, dst, w); - w *= 2; + src = tile->devPrivate.ptr; + src += tile->devKind * ty; + src += tx * bpp/8; + + if ((tw | th) == 1) { + uint32_t pixel; + switch (bpp) { + case 32: pixel = *(uint32_t *)src; break; + case 16: pixel = *(uint16_t *)src; break; + default: pixel = *(uint8_t *)src; break; } + return sna_poly_fill_rect_blt(drawable, bo, damage, + gc, pixel, n, rect, + extents, clipped); } - while (h < 8) { - memcpy((uint8_t*)ptr + h*w, ptr, h*w); - h *= 2; - } - ret = sna_poly_fill_rect_tiled_8x8_blt(drawable, bo, damage, - upload, gc, n, rect, - extents, clipped); + upload = kgem_create_buffer(&sna->kgem, 8*bpp, KGEM_BUFFER_WRITE, &ptr); + if (upload == NULL) + goto out_gc; + + upload->pitch = bpp; /* for sanity checks */ + + if (sigtrap_get() == 0) { + uint8_t *dst = ptr; + if (tx + tw > tile->drawable.width || + ty + th > tile->drawable.height) { + int sy = ty; + src = tile->devPrivate.ptr; + for (h = 0; h < th; h++) { + int sx = tx; + for (w = 0; w < tw; w++) { + memcpy(dst + w*bpp/8, src + sy * tile->devKind + sx*bpp/8, bpp/8); + if (++sx == tile->drawable.width) + sx = 0; + } + w *= bpp/8; + while (w < bpp) { + memcpy(dst+w, dst, w); + w *= 2; + } + if (++sy == tile->drawable.height) + sy = 0; + dst += bpp; + } + while (h < 8) { + memcpy(dst, ptr, bpp*h); + dst += bpp * h; + h *= 2; + } + } else { + for (h = 0; h < th; h++) { + w = tw*bpp/8; + memcpy(dst, src, w); + while (w < bpp) { + memcpy(dst+w, dst, w); + w *= 2; + } + assert(w == bpp); + + src += tile->devKind; + dst += bpp; + } + while (h < 8) { + memcpy(dst, ptr, bpp*h); + dst += bpp * h; + h *= 2; + } + assert(h == 8); + } + + ret = sna_poly_fill_rect_tiled_8x8_blt(drawable, bo, damage, + upload, gc, n, rect, + extents, clipped); + sigtrap_put(); + } kgem_bo_destroy(&sna->kgem, upload); +out_gc: + gc->patOrg = origin; return ret; } +inline static bool tile_is_solid(GCPtr gc, uint32_t *pixel) +{ + PixmapPtr tile = gc->tile.pixmap; + struct sna_pixmap *priv; + + if ((tile->drawable.width | tile->drawable.height) == 1) { + DBG(("%s: single pixel tile pixmap, converting to solid fill\n", __FUNCTION__)); + *pixel = get_pixel(tile); + return true; + } + + priv = sna_pixmap(tile); + if (priv == NULL || !priv->clear) + return false; + + DBG(("%s: tile is clear, converting to solid fill\n", __FUNCTION__)); + *pixel = priv->clear_color; + return true; +} + static bool sna_poly_fill_rect_tiled_blt(DrawablePtr drawable, struct kgem_bo *bo, @@ -11930,30 +12637,34 @@ CARD32 alu = gc->alu; int tile_width, tile_height; int16_t dx, dy; + uint32_t pixel; - DBG(("%s x %d [(%d, %d)x(%d, %d)...], clipped? %d\n", - __FUNCTION__, n, rect->x, rect->y, rect->width, rect->height, + DBG(("%s pixmap=%ld, x %d [(%d, %d)x(%d, %d)...], clipped? %d\n", + __FUNCTION__, pixmap->drawable.serialNumber, + n, rect->x, rect->y, rect->width, rect->height, clipped)); - tile_width = tile->drawable.width; - tile_height = tile->drawable.height; - if ((tile_width | tile_height) == 1) { - DBG(("%s: single pixel tile pixmap ,converting to solid fill\n", - __FUNCTION__)); + assert(tile->drawable.depth == drawable->depth); + assert(bo); + + if (tile_is_solid(gc, &pixel)) return sna_poly_fill_rect_blt(drawable, bo, damage, - gc, get_pixel(tile), + gc, pixel, n, rect, extents, clipped); - } /* XXX [248]x[238] tiling can be reduced to a pattern fill. * Also we can do the lg2 reduction for BLT and use repeat modes for * RENDER. */ - if ((tile->drawable.width | tile->drawable.height) == 8) { + tile_width = tile->drawable.width; + tile_height = tile->drawable.height; + if ((tile_width | tile_height) == 8) { bool ret; + DBG(("%s: have 8x8 tile, using BLT fast path\n", __FUNCTION__)); + tile_bo = sna_pixmap_get_source_bo(tile); if (tile_bo == NULL) { DBG(("%s: unable to move tile go GPU, fallback\n", @@ -11969,12 +12680,22 @@ return true; } } else { - if ((tile->drawable.width | tile->drawable.height) <= 0xc && - is_power_of_two(tile->drawable.width) && - is_power_of_two(tile->drawable.height)) - return sna_poly_fill_rect_tiled_nxm_blt(drawable, bo, damage, - gc, n, rect, - extents, clipped); + int w = tile_width, h = tile_height; + struct sna_pixmap *priv = sna_pixmap(tile); + + if (priv == NULL || priv->gpu_damage == NULL) { + w = next8(extents->x2 - extents->x1, w); + h = next8(extents->y2 - extents->y1, h); + } + + DBG(("%s: not 8x8, triming size for tile: %dx%d from %dx%d (area %dx%d)\n", + __FUNCTION__, w, h, tile_width, tile_height, extents->x2-extents->x1, extents->y2-extents->y1)); + + if ((w|h) < 0x10 && is_power_of_two(w) && is_power_of_two(h) && + sna_poly_fill_rect_tiled_nxm_blt(drawable, bo, damage, + gc, n, rect, + extents, clipped)) + return true; tile_bo = sna_pixmap_get_source_bo(tile); if (tile_bo == NULL) { @@ -12049,7 +12770,7 @@ if (clip.data == NULL) { const BoxRec *box = &clip.extents; - DBG(("%s: single clip box [(%d, %d), (%d, %d)]", + DBG(("%s: single clip box [(%d, %d), (%d, %d)]\n", __FUNCTION__, box->x1, box->y1, box->x2, box->y2)); while (n--) { BoxRec r; @@ -12062,10 +12783,6 @@ DBG(("%s: rectangle [(%d, %d), (%d, %d)]\n", __FUNCTION__, r.x1, r.y1, r.x2, r.y2)); - assert(r.x1 + dx >= 0); - assert(r.y1 + dy >= 0); - assert(r.x2 + dx <= pixmap->drawable.width); - assert(r.y2 + dy <= pixmap->drawable.height); if (box_intersect(&r, box)) { int height = r.y2 - r.y1; @@ -12074,6 +12791,11 @@ if (tile_y < 0) tile_y += tile_height; + assert(r.x1 + dx >= 0); + assert(r.y1 + dy >= 0); + assert(r.x2 + dx <= pixmap->drawable.width); + assert(r.y2 + dy <= pixmap->drawable.height); + while (height) { int width = r.x2 - r.x1; int dst_x = r.x1, tile_x; @@ -12119,7 +12841,7 @@ } else { while (n--) { RegionRec region; - BoxRec *box; + const BoxRec *box; int nbox; region.extents.x1 = rect->x + drawable->x; @@ -12134,16 +12856,17 @@ region.extents.y1, region.extents.x2, region.extents.y2)); + + region.data = NULL; + RegionIntersect(®ion, ®ion, &clip); + assert(region.extents.x1 + dx >= 0); assert(region.extents.y1 + dy >= 0); assert(region.extents.x2 + dx <= pixmap->drawable.width); assert(region.extents.y2 + dy <= pixmap->drawable.height); - region.data = NULL; - RegionIntersect(®ion, ®ion, &clip); - - nbox = RegionNumRects(®ion); - box = RegionRects(®ion); + nbox = region_num_rects(®ion); + box = region_rects(®ion); DBG(("%s: split into %d boxes after clipping\n", __FUNCTION__, nbox)); while (nbox--) { int height = box->y2 - box->y1; @@ -12254,6 +12977,7 @@ br13 |= fill_ROP[gc->alu] << 16; } + assert(gc->stipple->devKind); { uint8_t *dst = (uint8_t *)pat; const uint8_t *src = gc->stipple->devPrivate.ptr; @@ -12594,6 +13318,7 @@ stipple = gc->stipple; gc->stipple = scratch; + assert(stipple->devKind); stride = stipple->devKind; src = stipple->devPrivate.ptr; end = src + stride * stipple->drawable.height; @@ -12674,6 +13399,7 @@ bx1, bx2)); src_stride = bstride*bh; + assert(src_stride > 0); if (src_stride <= 128) { src_stride = ALIGN(src_stride, 8) / 4; assert(src_stride <= 32); @@ -12722,6 +13448,7 @@ dst = (uint8_t *)&b[7]; sna->kgem.nbatch += 7 + src_stride; } + assert(stipple->devKind); src_stride = stipple->devKind; src = stipple->devPrivate.ptr; src += (r->y - origin->y) * src_stride + bx1/8; @@ -12757,6 +13484,7 @@ if (sigtrap_get() == 0) { dst = ptr; + assert(stipple->devKind); src_stride = stipple->devKind; src = stipple->devPrivate.ptr; src += (r->y - origin->y) * src_stride + bx1/8; @@ -12864,6 +13592,7 @@ bx1, bx2, bw, bstride)); src_stride = bstride*bh; + assert(src_stride > 0); if (src_stride <= 128) { src_stride = ALIGN(src_stride, 8) / 4; assert(src_stride <= 32); @@ -12913,6 +13642,7 @@ sna->kgem.nbatch += 7 + src_stride; } + assert(stipple->devKind); src_stride = stipple->devKind; src = stipple->devPrivate.ptr; src += (box.y1 - pat.y) * src_stride + bx1/8; @@ -12945,6 +13675,7 @@ if (sigtrap_get() == 0) { dst = ptr; + assert(stipple->devKind); src_stride = stipple->devKind; src = stipple->devPrivate.ptr; src += (box.y1 - pat.y) * src_stride + bx1/8; @@ -13052,6 +13783,7 @@ bx1, bx2)); src_stride = bstride*bh; + assert(src_stride > 0); if (src_stride <= 128) { src_stride = ALIGN(src_stride, 8) / 4; assert(src_stride <= 32); @@ -13100,6 +13832,7 @@ dst = (uint8_t *)&b[7]; sna->kgem.nbatch += 7 + src_stride; } + assert(stipple->devKind); src_stride = stipple->devKind; src = stipple->devPrivate.ptr; src += (box.y1 - pat.y) * src_stride + bx1/8; @@ -13132,6 +13865,7 @@ if (sigtrap_get() == 0) { dst = ptr; + assert(stipple->devKind); src_stride = stipple->devKind; src = stipple->devPrivate.ptr; src += (box.y1 - pat.y) * src_stride + bx1/8; @@ -13250,6 +13984,7 @@ len = bw*bh; len = ALIGN(len, 8) / 4; + assert(len > 0); assert(len <= 32); if (!kgem_check_batch(&sna->kgem, 8+len) || !kgem_check_bo_fenced(&sna->kgem, bo) || @@ -13293,6 +14028,7 @@ sna->kgem.nbatch += 7 + len; } + assert(gc->stipple->devKind); len = gc->stipple->devKind; src = gc->stipple->devPrivate.ptr; src += oy*len + ox/8; @@ -13325,6 +14061,7 @@ int stride = gc->stipple->devKind; uint32_t *b; + assert(stride); if ((((box->y2-box->y1) | (box->x2-box->x1)) & ~31) == 0) { br00 = XY_MONO_SRC_COPY_IMM |(br00 & (BLT_DST_TILED | 3 << 20)); sna_poly_fill_rect_stippled_n_box__imm(sna, bo, @@ -13373,6 +14110,7 @@ len = bw*bh; len = ALIGN(len, 8) / 4; + assert(len > 0); if (!kgem_check_batch(&sna->kgem, 8+len) || !kgem_check_bo_fenced(&sna->kgem, bo) || !kgem_check_reloc(&sna->kgem, 2)) { @@ -13427,6 +14165,7 @@ sna->kgem.nbatch += 7 + len; } + assert(gc->stipple->devKind); len = gc->stipple->devKind; src = gc->stipple->devPrivate.ptr; src += oy*len + ox/8; @@ -13976,7 +14715,7 @@ } if (!PM_IS_SOLID(draw, gc->planemask)) { - DBG(("%s: fallback -- planemask=%#lx (not-solid)\n", + DBG(("%s: fallback -- planemask=0x%lx (not-solid)\n", __FUNCTION__, gc->planemask)); goto fallback; } @@ -13995,27 +14734,26 @@ RegionTranslate(®ion, dx, dy); } - if (region_subsumes_drawable(®ion, &pixmap->drawable)) { - discard_cpu_damage(sna, priv); - hint |= IGNORE_CPU | REPLACES; - } else { - if ((flags & 2) == 0) - hint |= IGNORE_CPU; - if (priv->cpu_damage && - region_subsumes_damage(®ion, priv->cpu_damage)) { + if ((flags & 2) == 0) { + hint |= IGNORE_DAMAGE; + if (region_subsumes_drawable(®ion, &pixmap->drawable)) { discard_cpu_damage(sna, priv); - hint |= IGNORE_CPU; + hint |= REPLACES; + } else { + if (priv->cpu_damage && + region_subsumes_damage(®ion, priv->cpu_damage)) + discard_cpu_damage(sna, priv); } } if (priv->cpu_damage == NULL) { if (priv->gpu_bo && - (hint & REPLACES || box_inplace(pixmap, ®ion.extents))) { + (hint & REPLACES || + box_covers_pixmap(pixmap, ®ion.extents) || + box_inplace(pixmap, ®ion.extents))) { DBG(("%s: promoting to full GPU\n", __FUNCTION__)); assert(priv->gpu_bo->proxy == NULL); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->gpu_damage, pixmap); } DBG(("%s: dropping last-cpu hint\n", __FUNCTION__)); priv->cpu = false; @@ -14037,8 +14775,8 @@ DBG(("%s: not using GPU, hint=%x\n", __FUNCTION__, hint)); goto fallback; } - if (hint & REPLACES && (flags & 2) == 0 && UNDO) - kgem_bo_undo(&sna->kgem, bo); + if (hint & REPLACES && UNDO) + kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo); if (gc_is_solid(gc, &color)) { DBG(("%s: solid fill [%08x], testing for blt\n", @@ -14349,7 +15087,7 @@ } if (!transparent && clip->data == NULL) - hint = PREFER_GPU | IGNORE_CPU; + hint = PREFER_GPU | IGNORE_DAMAGE; else hint = PREFER_GPU; @@ -14373,8 +15111,8 @@ _x += drawable->x + dx; _y += drawable->y + dy; - extents = RegionRects(clip); - last_extents = extents + RegionNumRects(clip); + extents = region_rects(clip); + last_extents = extents + region_num_rects(clip); if (!transparent) { /* emulate miImageGlyphBlt */ if (!sna_blt_fill_boxes(sna, GXcopy, @@ -14479,6 +15217,7 @@ if (x1 + w <= extents->x1 || y1 + h <= extents->y1) goto skip; + assert(len > 0); if (!kgem_check_batch(&sna->kgem, 3+len)) { _kgem_submit(&sna->kgem); _kgem_set_mode(&sna->kgem, KGEM_BLT); @@ -15089,8 +15828,8 @@ _x += drawable->x + dx; _y += drawable->y + dy; - extents = RegionRects(clip); - last_extents = extents + RegionNumRects(clip); + extents = region_rects(clip); + last_extents = extents + region_num_rects(clip); if (!transparent) { /* emulate miImageGlyphBlt */ if (!sna_blt_fill_boxes(sna, GXcopy, @@ -15217,6 +15956,7 @@ } } + assert(len > 0); if (!kgem_check_batch(&sna->kgem, 3+len)) { _kgem_submit(&sna->kgem); _kgem_set_mode(&sna->kgem, KGEM_BLT); @@ -15402,7 +16142,7 @@ goto fallback; if (region.data == NULL) - hint = IGNORE_CPU | PREFER_GPU; + hint = IGNORE_DAMAGE | PREFER_GPU; else hint = PREFER_GPU; if ((bo = sna_drawable_use_bo(drawable, hint, @@ -15522,7 +16262,7 @@ struct sna *sna = to_sna_from_pixmap(pixmap); struct sna_damage **damage; struct kgem_bo *bo; - BoxRec *box; + const BoxRec *box; int16_t dx, dy; int n; uint8_t rop = copy_ROP[gc->alu]; @@ -15557,8 +16297,8 @@ kgem_set_mode(&sna->kgem, KGEM_BLT, bo); /* Region is pre-clipped and translated into pixmap space */ - box = RegionRects(region); - n = RegionNumRects(region); + box = region_rects(region); + n = region_num_rects(region); do { int bx1 = (box->x1 - region->extents.x1) & ~7; int bx2 = (box->x2 - region->extents.x1 + 7) & ~7; @@ -15591,6 +16331,7 @@ uint8_t *src; uint32_t *b; + assert(src_stride); src = (uint8_t*)bitmap->devPrivate.ptr; src += (box->y1 - region->extents.y1) * src_stride + bx1/8; src_stride -= bstride; @@ -15811,9 +16552,9 @@ (gc->clientClipType != CT_NONE && (changes & (GCClipXOrigin | GCClipYOrigin)))) { DBG(("%s: recomputing clip\n", __FUNCTION__)); miComputeCompositeClip(gc, drawable); - DBG(("%s: composite clip=%ldx[(%d, %d), (%d, %d)] [%p]\n", + DBG(("%s: composite clip=%dx[(%d, %d), (%d, %d)] [%p]\n", __FUNCTION__, - (long)RegionNumRects(gc->pCompositeClip), + region_num_rects(gc->pCompositeClip), gc->pCompositeClip->extents.x1, gc->pCompositeClip->extents.y1, gc->pCompositeClip->extents.x2, @@ -15902,8 +16643,8 @@ if (priv->move_to_gpu && !priv->move_to_gpu(sna, priv, MOVE_READ)) return false; - assert(sna_damage_contains_box(priv->gpu_damage, ®ion->extents) == PIXMAN_REGION_IN); - assert(sna_damage_contains_box(priv->cpu_damage, ®ion->extents) == PIXMAN_REGION_OUT); + assert(sna_damage_contains_box(&priv->gpu_damage, ®ion->extents) == PIXMAN_REGION_IN); + assert(sna_damage_contains_box(&priv->cpu_damage, ®ion->extents) == PIXMAN_REGION_OUT); src = kgem_bo_map__cpu(&sna->kgem, priv->gpu_bo); if (src == NULL) @@ -15993,8 +16734,8 @@ DBG(("%s: download through a temporary map\n", __FUNCTION__)); - assert(sna_damage_contains_box(priv->gpu_damage, ®ion->extents) == PIXMAN_REGION_IN); - assert(sna_damage_contains_box(priv->cpu_damage, ®ion->extents) == PIXMAN_REGION_OUT); + assert(sna_damage_contains_box(&priv->gpu_damage, ®ion->extents) == PIXMAN_REGION_IN); + assert(sna_damage_contains_box(&priv->cpu_damage, ®ion->extents) == PIXMAN_REGION_OUT); pitch = PixmapBytePad(region->extents.x2 - region->extents.x1, pixmap->drawable.depth); @@ -16006,8 +16747,8 @@ kgem_bo_mark_unreusable(dst_bo); ok = sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->gpu_bo, 0, 0, - pixmap, dst_bo, + &pixmap->drawable, priv->gpu_bo, 0, 0, + &pixmap->drawable, dst_bo, -region->extents.x1, -region->extents.y1, ®ion->extents, 1, @@ -16029,6 +16770,8 @@ { struct sna_pixmap *priv = sna_pixmap(pixmap); + DBG(("%s: attached?=%d, has gpu damage?=%d\n", + __FUNCTION__, priv != NULL, priv && priv->gpu_damage)); if (priv == NULL || priv->gpu_damage == NULL) return false; @@ -16128,6 +16871,7 @@ region.extents.x2, region.extents.y2)); assert(has_coherent_ptr(to_sna_from_pixmap(pixmap), sna_pixmap(pixmap), MOVE_READ)); if (sigtrap_get() == 0) { + assert(pixmap->devKind); memcpy_blt(pixmap->devPrivate.ptr, dst, drawable->bitsPerPixel, pixmap->devKind, PixmapBytePad(w, drawable->depth), region.extents.x1, region.extents.y1, 0, 0, w, h); @@ -16230,11 +16974,8 @@ return ret; } -static void -sna_accel_flush_callback(CallbackListPtr *list, - pointer user_data, pointer call_data) +void sna_accel_flush(struct sna *sna) { - struct sna *sna = user_data; struct sna_pixmap *priv; /* XXX we should be able to reduce the frequency of flushes further @@ -16270,8 +17011,15 @@ priv->pixmap->drawable.serialNumber)); assert(priv->flush); if (sna_pixmap_move_to_gpu(priv->pixmap, - MOVE_READ | __MOVE_FORCE)) - kgem_bo_unclean(&sna->kgem, priv->gpu_bo); + MOVE_READ | __MOVE_FORCE)) { + if (priv->flush & 2) { + kgem_bo_unclean(&sna->kgem, priv->gpu_bo); + sna_damage_all(&priv->gpu_damage, priv->pixmap); + assert(priv->cpu_damage == NULL); + priv->clear = false; + priv->cpu = false; + } + } } (void)ret; } @@ -16280,6 +17028,13 @@ kgem_submit(&sna->kgem); } +static void +sna_accel_flush_callback(CallbackListPtr *list, + pointer user_data, pointer call_data) +{ + sna_accel_flush(user_data); +} + static struct sna_pixmap *sna_accel_scanout(struct sna *sna) { struct sna_pixmap *priv; @@ -16291,7 +17046,8 @@ assert(sna->front); priv = sna_pixmap(sna->front); - assert(priv->gpu_bo); + if (priv->gpu_bo == NULL) + return NULL; return priv; } @@ -16328,26 +17084,26 @@ DBG(("%s: has pending damage? %d, outstanding flips: %d\n", __FUNCTION__, RegionNotEmpty(DamageRegion(damage)), - sna->mode.shadow_flip)); + sna->mode.flip_active)); return RegionNotEmpty(DamageRegion(damage)); } -static bool start_flush(struct sna *sna, struct sna_pixmap *scanout) +static bool start_flush(struct sna *sna) { - DBG(("%s: scanout=%d shadow?=%d, slaves?=%d, (cpu?=%d || gpu?=%d))\n", - __FUNCTION__, - scanout && scanout->gpu_bo ? scanout->gpu_bo->handle : 0, - has_shadow(sna), has_offload_slaves(sna), - scanout && scanout->cpu_damage != NULL, - scanout && scanout->gpu_bo && scanout->gpu_bo->exec != NULL)); + struct sna_pixmap *scanout; - if (has_offload_slaves(sna)) + if (has_offload_slaves(sna)) { + DBG(("%s: has offload slaves\n", __FUNCTION__)); return true; + } - if (has_shadow(sna)) + if (has_shadow(sna)) { + DBG(("%s: has dirty shadow\n", __FUNCTION__)); return true; + } + scanout = sna_accel_scanout(sna); if (!scanout) return false; @@ -16356,7 +17112,11 @@ return true; } - return scanout->cpu_damage || scanout->gpu_bo->exec; + if (scanout->cpu_damage || scanout->gpu_bo->needs_flush) + return true; + + kgem_scanout_flush(&sna->kgem, scanout->gpu_bo); + return false; } static bool stop_flush(struct sna *sna, struct sna_pixmap *scanout) @@ -16394,19 +17154,9 @@ DBG(("%s (time=%ld), starting timer %d\n", __FUNCTION__, (long)TIME, whom)); } -static bool sna_accel_do_flush(struct sna *sna) +static bool sna_scanout_do_flush(struct sna *sna) { - struct sna_pixmap *priv; - int interval; - - priv = sna_accel_scanout(sna); - if (priv == NULL && !sna->mode.shadow_damage && !has_offload_slaves(sna)) { - DBG(("%s -- no scanout attached\n", __FUNCTION__)); - sna_accel_disarm_timer(sna, FLUSH_TIMER); - return false; - } - - interval = sna->vblank_interval ?: 20; + int interval = sna->vblank_interval ?: 50; if (sna->timer_active & (1<<(FLUSH_TIMER))) { int32_t delta = sna->timer_expire[FLUSH_TIMER] - TIME; DBG(("%s: flush timer active: delta=%d\n", @@ -16416,12 +17166,10 @@ sna->timer_expire[FLUSH_TIMER] = TIME + interval; return true; } - } else if (!start_flush(sna, priv)) { - DBG(("%s -- no pending write to scanout\n", __FUNCTION__)); - if (priv) - kgem_scanout_flush(&sna->kgem, priv->gpu_bo); - } else - timer_enable(sna, FLUSH_TIMER, interval/2); + } else { + if (start_flush(sna)) + timer_enable(sna, FLUSH_TIMER, interval/2); + } return false; } @@ -16469,7 +17217,7 @@ xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list, ent) { RegionRec region, *damage; PixmapPtr src, dst; - BoxPtr box; + const BoxRec *box; int n; assert(dirty->src == sna->front); @@ -16487,10 +17235,10 @@ region.extents.y2 = dirty->y + dst->drawable.height; region.data = NULL; - DBG(("%s: pushing damage ((%d, %d), (%d, %d))x%d to slave pixmap=%ld, ((%d, %d), (%d, %d))\n", __FUNCTION__, + DBG(("%s: pushing damage ((%d, %d), (%d, %d))x%d to slave pixmap=%d, ((%d, %d), (%d, %d))\n", __FUNCTION__, damage->extents.x1, damage->extents.y1, damage->extents.x2, damage->extents.y2, - RegionNumRects(damage), + region_num_rects(damage), dst->drawable.serialNumber, region.extents.x1, region.extents.y1, region.extents.x2, region.extents.y2)); @@ -16505,10 +17253,10 @@ DBG(("%s: slave: ((%d, %d), (%d, %d))x%d\n", __FUNCTION__, region.extents.x1, region.extents.y1, region.extents.x2, region.extents.y2, - RegionNumRects(®ion))); + region_num_rects(®ion))); - box = RegionRects(®ion); - n = RegionNumRects(®ion); + box = region_rects(®ion); + n = region_num_rects(®ion); if (wedged(sna)) { fallback: if (!sna_pixmap_move_to_cpu(src, MOVE_READ)) @@ -16541,6 +17289,8 @@ assert(has_coherent_ptr(sna, sna_pixmap(src), MOVE_READ)); assert(has_coherent_ptr(sna, sna_pixmap(dst), MOVE_WRITE)); + assert(src->devKind); + assert(dst->devKind); memcpy_blt(src->devPrivate.ptr, dst->devPrivate.ptr, src->drawable.bitsPerPixel, @@ -16563,8 +17313,8 @@ goto fallback; if (!sna->render.copy_boxes(sna, GXcopy, - src, __sna_pixmap_get_bo(src), dirty->x, dirty->y, - dst, __sna_pixmap_get_bo(dst),0, 0, + &src->drawable, __sna_pixmap_get_bo(src), dirty->x, dirty->y, + &dst->drawable, __sna_pixmap_get_bo(dst),0, 0, box, n, COPY_LAST)) goto fallback; @@ -16581,7 +17331,7 @@ #endif } -static void sna_accel_flush(struct sna *sna) +static void sna_scanout_flush(struct sna *sna) { struct sna_pixmap *priv = sna_accel_scanout(sna); bool busy; @@ -16600,7 +17350,7 @@ if (priv && sna_pixmap_force_to_gpu(priv->pixmap, - MOVE_READ | MOVE_ASYNC_HINT)) + MOVE_READ | MOVE_ASYNC_HINT | __MOVE_SCANOUT)) kgem_scanout_flush(&sna->kgem, priv->gpu_bo); sna_mode_redisplay(sna); @@ -16633,10 +17383,11 @@ { DBG(("%s (time=%ld)\n", __FUNCTION__, (long)TIME)); - if (!kgem_expire_cache(&sna->kgem)) - sna_accel_disarm_timer(sna, EXPIRE_TIMER); - + kgem_expire_cache(&sna->kgem); sna_pixmap_expire(sna); + + if (!sna->kgem.need_expire) + sna_accel_disarm_timer(sna, EXPIRE_TIMER); } #ifdef DEBUG_MEMORY @@ -16653,13 +17404,13 @@ static void sna_accel_debug_memory(struct sna *sna) { - ErrorF("Allocated pixmaps: %d (cached: %d), bo: %d, %ld bytes (CPU bo: %d, %ld bytes)\n", + ErrorF("Allocated pixmaps: %d (cached: %d), bo: %d, %lu bytes (CPU bo: %d, %lu bytes)\n", sna->debug_memory.pixmap_allocs, sna->debug_memory.pixmap_cached, sna->kgem.debug_memory.bo_allocs, - (long)sna->kgem.debug_memory.bo_bytes, + (unsigned long)sna->kgem.debug_memory.bo_bytes, sna->debug_memory.cpu_bo_allocs, - (long)sna->debug_memory.cpu_bo_bytes); + (unsigned long)sna->debug_memory.cpu_bo_bytes); #ifdef VALGRIND_DO_ADDED_LEAK_CHECK VG(VALGRIND_DO_ADDED_LEAK_CHECK); @@ -16797,7 +17548,7 @@ sna_destroy_window(WindowPtr win) { sna_video_destroy_window(win); - sna_dri_destroy_window(win); + sna_dri2_destroy_window(win); return TRUE; } @@ -17057,10 +17808,11 @@ void sna_accel_block_handler(struct sna *sna, struct timeval **tv) { - sigtrap_assert(); + sigtrap_assert_inactive(); if (sna->kgem.need_retire) kgem_retire(&sna->kgem); + kgem_retire__buffers(&sna->kgem); if (sna->timer_active) UpdateCurrentTimeIf(); @@ -17073,10 +17825,10 @@ } restart: - if (sna_accel_do_flush(sna)) - sna_accel_flush(sna); + if (sna_scanout_do_flush(sna)) + sna_scanout_flush(sna); assert(sna_accel_scanout(sna) == NULL || - sna_accel_scanout(sna)->gpu_bo->exec == NULL || + !sna_accel_scanout(sna)->gpu_bo->needs_flush || sna->timer_active & (1<<(FLUSH_TIMER))); if (sna_accel_do_throttle(sna)) @@ -17144,11 +17896,11 @@ _kgem_submit(&sna->kgem); } - sigtrap_assert(); + sigtrap_assert_inactive(); } void sna_accel_free(struct sna *sna) { DBG(("%s\n", __FUNCTION__)); - sigtrap_assert(); + sigtrap_assert_inactive(); } diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_blt.c xserver-xorg-video-intel-2.99.914/src/sna/sna_blt.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_blt.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_blt.c 2014-07-06 06:38:39.000000000 +0000 @@ -89,8 +89,10 @@ static void nop_done(struct sna *sna, const struct sna_composite_op *op) { assert(sna->kgem.nbatch <= KGEM_BATCH_SIZE(&sna->kgem)); - if (sna->kgem.nexec > 1 && __kgem_ring_empty(&sna->kgem)) + if (sna->kgem.nexec > 1 && __kgem_ring_empty(&sna->kgem)) { + DBG(("%s: flushing BLT operation on empty ring\n", __FUNCTION__)); _kgem_submit(&sna->kgem); + } (void)op; } @@ -100,6 +102,7 @@ assert(kgem->nbatch <= KGEM_BATCH_SIZE(kgem)); if (kgem->nexec > 1 && __kgem_ring_empty(kgem)) { + DBG(("%s: flushing BLT operation on empty ring\n", __FUNCTION__)); _kgem_submit(kgem); return; } @@ -378,8 +381,10 @@ { struct kgem *kgem = &sna->kgem; - assert(kgem_bo_can_blt (kgem, src)); - assert(kgem_bo_can_blt (kgem, dst)); + DBG(("%s: dst handle=%d, src handle=%d, bpp=%d, fixup=%08x\n", + __FUNCTION__, dst->handle, src->handle, bpp, alpha)); + assert(kgem_bo_can_blt(kgem, src)); + assert(kgem_bo_can_blt(kgem, dst)); blt->bo[0] = src; blt->bo[1] = dst; @@ -521,7 +526,7 @@ kgem->reloc[kgem->nreloc-1].target_handle == blt->bo[1]->target_handle) { if (sna->kgem.gen >= 0100) { if (kgem->nbatch >= 7 && - kgem->batch[kgem->nbatch-7] == (XY_COLOR_BLT | (blt->cmd & (BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 5) && + kgem->batch[kgem->nbatch-7] == (XY_COLOR_BLT | (blt->cmd & (BLT_DST_TILED | BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 5) && kgem->batch[kgem->nbatch-5] == ((uint32_t)dst_y << 16 | (uint16_t)dst_x) && kgem->batch[kgem->nbatch-4] == ((uint32_t)(dst_y+height) << 16 | (uint16_t)(dst_x+width))) { DBG(("%s: replacing last fill\n", __FUNCTION__)); @@ -546,7 +551,7 @@ } } else { if (kgem->nbatch >= 6 && - kgem->batch[kgem->nbatch-6] == (XY_COLOR_BLT | (blt->cmd & (BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 4) && + kgem->batch[kgem->nbatch-6] == (XY_COLOR_BLT | (blt->cmd & (BLT_DST_TILED | BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 4) && kgem->batch[kgem->nbatch-4] == ((uint32_t)dst_y << 16 | (uint16_t)dst_x) && kgem->batch[kgem->nbatch-3] == ((uint32_t)(dst_y+height) << 16 | (uint16_t)(dst_x+width))) { DBG(("%s: replacing last fill\n", __FUNCTION__)); @@ -815,6 +820,26 @@ } static bool +pixel_is_transparent(uint32_t pixel, uint32_t format) +{ + unsigned int abits; + + abits = PICT_FORMAT_A(format); + if (!abits) + return false; + + if (PICT_FORMAT_TYPE(format) == PICT_TYPE_A || + PICT_FORMAT_TYPE(format) == PICT_TYPE_BGRA) { + return (pixel & ((1 << abits) - 1)) == 0; + } else if (PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB || + PICT_FORMAT_TYPE(format) == PICT_TYPE_ABGR) { + unsigned int ashift = PICT_FORMAT_BPP(format) - abits; + return (pixel >> ashift) == 0; + } else + return false; +} + +static bool pixel_is_opaque(uint32_t pixel, uint32_t format) { unsigned int abits; @@ -868,6 +893,16 @@ return pixel_is_white(get_pixel(picture), picture->format); } +static bool +is_transparent(PicturePtr picture) +{ + if (picture->pSourcePict) { + PictSolidFill *fill = (PictSolidFill *) picture->pSourcePict; + return fill->color == 0; + } else + return pixel_is_transparent(get_pixel(picture), picture->format); +} + bool sna_composite_mask_is_opaque(PicturePtr mask) { @@ -932,6 +967,8 @@ if (x2 <= x1 || y2 <= y1) return; + assert(op->dst.pixmap->devPrivate.ptr); + assert(op->dst.pixmap->devKind); pixman_fill(op->dst.pixmap->devPrivate.ptr, op->dst.pixmap->devKind / sizeof(uint32_t), op->dst.pixmap->drawable.bitsPerPixel, @@ -940,15 +977,17 @@ } fastcall static void -blt_composite_fill_box__cpu(struct sna *sna, - const struct sna_composite_op *op, - const BoxRec *box) +blt_composite_fill_box_no_offset__cpu(struct sna *sna, + const struct sna_composite_op *op, + const BoxRec *box) { assert(box->x1 >= 0); assert(box->y1 >= 0); assert(box->x2 <= op->dst.pixmap->drawable.width); assert(box->y2 <= op->dst.pixmap->drawable.height); + assert(op->dst.pixmap->devPrivate.ptr); + assert(op->dst.pixmap->devKind); pixman_fill(op->dst.pixmap->devPrivate.ptr, op->dst.pixmap->devKind / sizeof(uint32_t), op->dst.pixmap->drawable.bitsPerPixel, @@ -957,9 +996,9 @@ } static void -blt_composite_fill_boxes__cpu(struct sna *sna, - const struct sna_composite_op *op, - const BoxRec *box, int n) +blt_composite_fill_boxes_no_offset__cpu(struct sna *sna, + const struct sna_composite_op *op, + const BoxRec *box, int n) { do { assert(box->x1 >= 0); @@ -967,6 +1006,8 @@ assert(box->x2 <= op->dst.pixmap->drawable.width); assert(box->y2 <= op->dst.pixmap->drawable.height); + assert(op->dst.pixmap->devPrivate.ptr); + assert(op->dst.pixmap->devKind); pixman_fill(op->dst.pixmap->devPrivate.ptr, op->dst.pixmap->devKind / sizeof(uint32_t), op->dst.pixmap->drawable.bitsPerPixel, @@ -976,6 +1017,49 @@ } while (--n); } +fastcall static void +blt_composite_fill_box__cpu(struct sna *sna, + const struct sna_composite_op *op, + const BoxRec *box) +{ + assert(box->x1 + op->dst.x >= 0); + assert(box->y1 + op->dst.y >= 0); + assert(box->x2 + op->dst.x <= op->dst.pixmap->drawable.width); + assert(box->y2 + op->dst.y <= op->dst.pixmap->drawable.height); + + assert(op->dst.pixmap->devPrivate.ptr); + assert(op->dst.pixmap->devKind); + pixman_fill(op->dst.pixmap->devPrivate.ptr, + op->dst.pixmap->devKind / sizeof(uint32_t), + op->dst.pixmap->drawable.bitsPerPixel, + box->x1 + op->dst.x, box->y1 + op->dst.y, + box->x2 - box->x1, box->y2 - box->y1, + op->u.blt.pixel); +} + +static void +blt_composite_fill_boxes__cpu(struct sna *sna, + const struct sna_composite_op *op, + const BoxRec *box, int n) +{ + do { + assert(box->x1 + op->dst.x >= 0); + assert(box->y1 + op->dst.y >= 0); + assert(box->x2 + op->dst.x <= op->dst.pixmap->drawable.width); + assert(box->y2 + op->dst.y <= op->dst.pixmap->drawable.height); + + assert(op->dst.pixmap->devPrivate.ptr); + assert(op->dst.pixmap->devKind); + pixman_fill(op->dst.pixmap->devPrivate.ptr, + op->dst.pixmap->devKind / sizeof(uint32_t), + op->dst.pixmap->drawable.bitsPerPixel, + box->x1 + op->dst.x, box->y1 + op->dst.y, + box->x2 - box->x1, box->y2 - box->y1, + op->u.blt.pixel); + box++; + } while (--n); +} + inline static void _sna_blt_fill_box(struct sna *sna, const struct sna_blt_state *blt, const BoxRec *box) @@ -1064,11 +1148,28 @@ } while (1); } +static inline void _sna_blt_maybe_clear(const struct sna_composite_op *op, const BoxRec *box) +{ + if (box->x2 - box->x1 >= op->dst.width && + box->y2 - box->y1 >= op->dst.height) { + struct sna_pixmap *priv = sna_pixmap(op->dst.pixmap); + if (op->dst.bo == priv->gpu_bo) { + priv->clear = true; + priv->clear_color = op->u.blt.pixel; + DBG(("%s: pixmap=%ld marking clear [%08x]\n", + __FUNCTION__, + op->dst.pixmap->drawable.serialNumber, + op->u.blt.pixel)); + } + } +} + fastcall static void blt_composite_fill_box_no_offset(struct sna *sna, const struct sna_composite_op *op, const BoxRec *box) { _sna_blt_fill_box(sna, &op->u.blt, box); + _sna_blt_maybe_clear(op, box); } static void blt_composite_fill_boxes_no_offset(struct sna *sna, @@ -1159,6 +1260,7 @@ box->y1 + op->dst.y, box->x2 - box->x1, box->y2 - box->y1); + _sna_blt_maybe_clear(op, box); } static void blt_composite_fill_boxes(struct sna *sna, @@ -1316,9 +1418,15 @@ if (op->dst.bo == NULL) { op->blt = blt_composite_fill__cpu; - op->box = blt_composite_fill_box__cpu; - op->boxes = blt_composite_fill_boxes__cpu; - op->thread_boxes = blt_composite_fill_boxes__cpu; + if (op->dst.x|op->dst.y) { + op->box = blt_composite_fill_box__cpu; + op->boxes = blt_composite_fill_boxes__cpu; + op->thread_boxes = blt_composite_fill_boxes__cpu; + } else { + op->box = blt_composite_fill_box_no_offset__cpu; + op->boxes = blt_composite_fill_boxes_no_offset__cpu; + op->thread_boxes = blt_composite_fill_boxes_no_offset__cpu; + } op->done = nop_done; op->u.blt.pixel = 0; return true; @@ -1355,9 +1463,15 @@ if (op->dst.bo == NULL) { op->u.blt.pixel = pixel; op->blt = blt_composite_fill__cpu; - op->box = blt_composite_fill_box__cpu; - op->boxes = blt_composite_fill_boxes__cpu; - op->thread_boxes = blt_composite_fill_boxes__cpu; + if (op->dst.x|op->dst.y) { + op->box = blt_composite_fill_box__cpu; + op->boxes = blt_composite_fill_boxes__cpu; + op->thread_boxes = blt_composite_fill_boxes__cpu; + } else { + op->box = blt_composite_fill_box_no_offset__cpu; + op->boxes = blt_composite_fill_boxes_no_offset__cpu; + op->thread_boxes = blt_composite_fill_boxes_no_offset__cpu; + } op->done = nop_done; return true; } @@ -1877,6 +1991,10 @@ { PixmapPtr dst = op->dst.pixmap; PixmapPtr src = op->u.blt.src_pixmap; + assert(src->devPrivate.ptr); + assert(src->devKind); + assert(dst->devPrivate.ptr); + assert(dst->devKind); memcpy_blt(src->devPrivate.ptr, dst->devPrivate.ptr, src->drawable.bitsPerPixel, src->devKind, dst->devKind, r->src.x + op->u.blt.sx, r->src.y + op->u.blt.sy, @@ -1891,6 +2009,10 @@ { PixmapPtr dst = op->dst.pixmap; PixmapPtr src = op->u.blt.src_pixmap; + assert(src->devPrivate.ptr); + assert(src->devKind); + assert(dst->devPrivate.ptr); + assert(dst->devKind); memcpy_blt(src->devPrivate.ptr, dst->devPrivate.ptr, src->drawable.bitsPerPixel, src->devKind, dst->devKind, box->x1 + op->u.blt.sx, box->y1 + op->u.blt.sy, @@ -1905,6 +2027,10 @@ { PixmapPtr dst = op->dst.pixmap; PixmapPtr src = op->u.blt.src_pixmap; + assert(src->devPrivate.ptr); + assert(src->devKind); + assert(dst->devPrivate.ptr); + assert(dst->devKind); do { memcpy_blt(src->devPrivate.ptr, dst->devPrivate.ptr, src->drawable.bitsPerPixel, src->devKind, dst->devKind, @@ -1922,6 +2048,10 @@ { PixmapPtr dst = op->dst.pixmap; PixmapPtr src = op->u.blt.src_pixmap; + assert(src->devPrivate.ptr); + assert(src->devKind); + assert(dst->devPrivate.ptr); + assert(dst->devKind); memcpy_xor(src->devPrivate.ptr, dst->devPrivate.ptr, src->drawable.bitsPerPixel, src->devKind, dst->devKind, r->src.x + op->u.blt.sx, r->src.y + op->u.blt.sy, @@ -1938,6 +2068,10 @@ { PixmapPtr dst = op->dst.pixmap; PixmapPtr src = op->u.blt.src_pixmap; + assert(src->devPrivate.ptr); + assert(src->devKind); + assert(dst->devPrivate.ptr); + assert(dst->devKind); memcpy_xor(src->devPrivate.ptr, dst->devPrivate.ptr, src->drawable.bitsPerPixel, src->devKind, dst->devKind, box->x1 + op->u.blt.sx, box->y1 + op->u.blt.sy, @@ -1953,6 +2087,10 @@ { PixmapPtr dst = op->dst.pixmap; PixmapPtr src = op->u.blt.src_pixmap; + assert(src->devPrivate.ptr); + assert(src->devKind); + assert(dst->devPrivate.ptr); + assert(dst->devKind); do { memcpy_xor(src->devPrivate.ptr, dst->devPrivate.ptr, src->drawable.bitsPerPixel, src->devKind, dst->devKind, @@ -2019,6 +2157,8 @@ op->u.blt.sx, op->u.blt.sy, op->dst.x, op->dst.y)); + assert(src->devPrivate.ptr); + assert(src->devKind); if (!dst_priv->pinned && box->x2 - box->x1 == op->dst.width && box->y2 - box->y1 == op->dst.height) { @@ -2057,6 +2197,8 @@ op->dst.x, op->dst.y, box->x1, box->y1, box->x2, box->y2, n)); + assert(src->devPrivate.ptr); + assert(src->devKind); if (n == 1 && !dst_priv->pinned && box->x2 - box->x1 == op->dst.width && box->y2 - box->y1 == op->dst.height) { @@ -2099,6 +2241,9 @@ int16_t src_x = r->src.x + op->u.blt.sx; int16_t src_y = r->src.y + op->u.blt.sy; + assert(src->devPrivate.ptr); + assert(src->devKind); + if (!dst_priv->pinned && dst_x <= 0 && dst_y <= 0 && dst_x + r->width >= op->dst.width && @@ -2139,6 +2284,9 @@ op->u.blt.sx, op->u.blt.sy, op->dst.x, op->dst.y)); + assert(src->devPrivate.ptr); + assert(src->devKind); + if (!dst_priv->pinned && box->x2 - box->x1 == op->dst.width && box->y2 - box->y1 == op->dst.height) { @@ -2176,6 +2324,9 @@ op->dst.x, op->dst.y, box->x1, box->y1, box->x2, box->y2, n)); + assert(src->devPrivate.ptr); + assert(src->devKind); + if (n == 1 && !dst_priv->pinned && box->x2 - box->x1 == op->dst.width && box->y2 - box->y1 == op->dst.height) { @@ -2245,6 +2396,71 @@ return priv && priv->clear; } +static inline uint32_t +over(uint32_t src, uint32_t dst) +{ + uint32_t a = ~src >> 24; + +#define G_SHIFT 8 +#define RB_MASK 0xff00ff +#define RB_ONE_HALF 0x800080 +#define RB_MASK_PLUS_ONE 0x10000100 + +#define UN8_rb_MUL_UN8(x, a, t) do { \ + t = ((x) & RB_MASK) * (a); \ + t += RB_ONE_HALF; \ + x = (t + ((t >> G_SHIFT) & RB_MASK)) >> G_SHIFT; \ + x &= RB_MASK; \ +} while (0) + +#define UN8_rb_ADD_UN8_rb(x, y, t) do { \ + t = ((x) + (y)); \ + t |= RB_MASK_PLUS_ONE - ((t >> G_SHIFT) & RB_MASK); \ + x = (t & RB_MASK); \ +} while (0) + +#define UN8x4_MUL_UN8_ADD_UN8x4(x, a, y) do { \ + uint32_t r1__, r2__, r3__, t__; \ + \ + r1__ = (x); \ + r2__ = (y) & RB_MASK; \ + UN8_rb_MUL_UN8(r1__, (a), t__); \ + UN8_rb_ADD_UN8_rb(r1__, r2__, t__); \ + \ + r2__ = (x) >> G_SHIFT; \ + r3__ = ((y) >> G_SHIFT) & RB_MASK; \ + UN8_rb_MUL_UN8(r2__, (a), t__); \ + UN8_rb_ADD_UN8_rb(r2__, r3__, t__); \ + \ + (x) = r1__ | (r2__ << G_SHIFT); \ +} while (0) + + UN8x4_MUL_UN8_ADD_UN8x4(dst, a, src); + + return dst; +} + +static inline uint32_t +add(uint32_t src, uint32_t dst) +{ +#define UN8x4_ADD_UN8x4(x, y) do { \ + uint32_t r1__, r2__, r3__, t__; \ + \ + r1__ = (x) & RB_MASK; \ + r2__ = (y) & RB_MASK; \ + UN8_rb_ADD_UN8_rb(r1__, r2__, t__); \ + \ + r2__ = ((x) >> G_SHIFT) & RB_MASK; \ + r3__ = ((y) >> G_SHIFT) & RB_MASK; \ + UN8_rb_ADD_UN8_rb(r2__, r3__, t__); \ + \ + x = r1__ | (r2__ << G_SHIFT); \ +} while (0) + + UN8x4_ADD_UN8x4(src, dst); + return src; +} + bool sna_blt_composite(struct sna *sna, uint32_t op, @@ -2283,8 +2499,8 @@ return false; } - was_clear = sna_drawable_is_clear(dst->pDrawable); tmp->dst.pixmap = get_drawable_pixmap(dst->pDrawable); + was_clear = is_clear(tmp->dst.pixmap); if (width | height) { dst_box.x1 = dst_x; @@ -2302,15 +2518,16 @@ if (op == PictOpClear) { clear: - if (was_clear) + if (was_clear && sna_pixmap(tmp->dst.pixmap)->clear_color == 0) { + sna_pixmap(tmp->dst.pixmap)->clear = true; return prepare_blt_nop(sna, tmp); + } hint = 0; if (can_render(sna)) { hint |= PREFER_GPU; - if (dst->pCompositeClip->data == NULL && - (flags & COMPOSITE_PARTIAL) == 0) { - hint |= IGNORE_CPU; + if ((flags & COMPOSITE_PARTIAL) == 0) { + hint |= IGNORE_DAMAGE; if (width == tmp->dst.pixmap->drawable.width && height == tmp->dst.pixmap->drawable.height) hint |= REPLACES; @@ -2332,8 +2549,10 @@ region.extents = dst_box; region.data = NULL; - if (!sna_drawable_move_region_to_cpu(dst->pDrawable, ®ion, - MOVE_INPLACE_HINT | MOVE_WRITE)) + hint = MOVE_WRITE | MOVE_INPLACE_HINT; + if (flags & COMPOSITE_PARTIAL) + hint |= MOVE_READ; + if (!sna_drawable_move_region_to_cpu(dst->pDrawable, ®ion, hint)) return false; } @@ -2341,12 +2560,40 @@ } if (is_solid(src)) { + if ((op == PictOpOver || op == PictOpAdd) && is_transparent(src)) { + sna_pixmap(tmp->dst.pixmap)->clear = was_clear; + return prepare_blt_nop(sna, tmp); + } if (op == PictOpOver && is_opaque_solid(src)) op = PictOpSrc; if (op == PictOpAdd && is_white(src)) op = PictOpSrc; - if (was_clear && (op == PictOpAdd || op == PictOpOver)) - op = PictOpSrc; + if (was_clear && (op == PictOpAdd || op == PictOpOver)) { + if (sna_pixmap(tmp->dst.pixmap)->clear_color == 0) + op = PictOpSrc; + if (op == PictOpOver) { + color = over(get_solid_color(src, PICT_a8r8g8b8), + color_convert(sna_pixmap(tmp->dst.pixmap)->clear_color, + dst->format, PICT_a8r8g8b8)); + op = PictOpSrc; + DBG(("%s: precomputing solid OVER (%08x, %08x) -> %08x\n", + __FUNCTION__, get_solid_color(src, PICT_a8r8g8b8), + color_convert(sna_pixmap(tmp->dst.pixmap)->clear_color, + dst->format, PICT_a8r8g8b8), + color)); + } + if (op == PictOpAdd) { + color = add(get_solid_color(src, PICT_a8r8g8b8), + color_convert(sna_pixmap(tmp->dst.pixmap)->clear_color, + dst->format, PICT_a8r8g8b8)); + op = PictOpSrc; + DBG(("%s: precomputing solid ADD (%08x, %08x) -> %08x\n", + __FUNCTION__, get_solid_color(src, PICT_a8r8g8b8), + color_convert(sna_pixmap(tmp->dst.pixmap)->clear_color, + dst->format, PICT_a8r8g8b8), + color)); + } + } if (op == PictOpOutReverse && is_opaque_solid(src)) goto clear; @@ -2361,12 +2608,16 @@ if (color == 0) goto clear; + if (was_clear && sna_pixmap(tmp->dst.pixmap)->clear_color == color) { + sna_pixmap(tmp->dst.pixmap)->clear = true; + return prepare_blt_nop(sna, tmp); + } + hint = 0; if (can_render(sna)) { hint |= PREFER_GPU; - if (dst->pCompositeClip->data == NULL && - (flags & COMPOSITE_PARTIAL) == 0) { - hint |= IGNORE_CPU; + if ((flags & COMPOSITE_PARTIAL) == 0) { + hint |= IGNORE_DAMAGE; if (width == tmp->dst.pixmap->drawable.width && height == tmp->dst.pixmap->drawable.height) hint |= REPLACES; @@ -2388,8 +2639,10 @@ region.extents = dst_box; region.data = NULL; - if (!sna_drawable_move_region_to_cpu(dst->pDrawable, ®ion, - MOVE_INPLACE_HINT | MOVE_WRITE)) + hint = MOVE_WRITE | MOVE_INPLACE_HINT; + if (flags & COMPOSITE_PARTIAL) + hint |= MOVE_READ; + if (!sna_drawable_move_region_to_cpu(dst->pDrawable, ®ion, hint)) return false; } @@ -2417,11 +2670,15 @@ return false; } - if (!sna_transform_is_integer_translation(src->transform, &tx, &ty)) { + if (!sna_transform_is_imprecise_integer_translation(src->transform, src->filter, + dst->polyMode == PolyModePrecise, + &tx, &ty)) { DBG(("%s: source transform is not an integer translation\n", __FUNCTION__)); return false; } + DBG(("%s: converting transform to integer translation? (%d, %d)\n", + __FUNCTION__, src->transform != NULL, tx, ty)); x += tx; y += ty; @@ -2437,9 +2694,14 @@ src_pixmap = get_drawable_pixmap(src->pDrawable); if (is_clear(src_pixmap)) { - color = color_convert(sna_pixmap(src_pixmap)->clear_color, - src->format, tmp->dst.format); - goto fill; + if (src->repeat || + (x >= 0 && y >= 0 && + x + width < src_pixmap->drawable.width && + y + height < src_pixmap->drawable.height)) { + color = color_convert(sna_pixmap(src_pixmap)->clear_color, + src->format, tmp->dst.format); + goto fill; + } } alpha_fixup = 0; @@ -2520,9 +2782,8 @@ hint = 0; if (bo || can_render(sna)) { hint |= PREFER_GPU; - if (dst->pCompositeClip->data == NULL && - (flags & COMPOSITE_PARTIAL) == 0) { - hint |= IGNORE_CPU; + if ((flags & COMPOSITE_PARTIAL) == 0) { + hint |= IGNORE_DAMAGE; if (width == tmp->dst.pixmap->drawable.width && height == tmp->dst.pixmap->drawable.height) hint |= REPLACES; @@ -2533,16 +2794,26 @@ tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable, hint, &dst_box, &tmp->damage); - if (tmp->dst.bo && hint & REPLACES) - kgem_bo_undo(&sna->kgem, tmp->dst.bo); + if (tmp->dst.bo && hint & REPLACES) { + struct sna_pixmap *priv = sna_pixmap(tmp->dst.pixmap); + kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo); + } + + if (tmp->dst.pixmap == src_pixmap) + bo = __sna_render_pixmap_bo(sna, src_pixmap, &src_box, true); ret = false; if (bo) { if (!tmp->dst.bo) { DBG(("%s: fallback -- unaccelerated read back\n", __FUNCTION__)); +fallback: if (flags & COMPOSITE_FALLBACK || !kgem_bo_is_busy(bo)) goto put; + } else if (!kgem_bo_can_blt(&sna->kgem, bo)) { + DBG(("%s: fallback -- cannot blit from source\n", + __FUNCTION__)); + goto fallback; } else if (bo->snoop && tmp->dst.bo->snoop) { DBG(("%s: fallback -- can not copy between snooped bo\n", __FUNCTION__)); @@ -2550,12 +2821,11 @@ } else if (!kgem_bo_can_blt(&sna->kgem, tmp->dst.bo)) { DBG(("%s: fallback -- unaccelerated upload\n", __FUNCTION__)); - if (flags & COMPOSITE_FALLBACK || !kgem_bo_is_busy(bo)) - goto put; + goto fallback; } else { ret = prepare_blt_copy(sna, tmp, bo, alpha_fixup); - if (flags & COMPOSITE_FALLBACK && !ret) - goto put; + if (!ret) + goto fallback; } } else { RegionRec region; @@ -2569,7 +2839,7 @@ if (tmp->dst.bo == NULL) { hint = MOVE_INPLACE_HINT | MOVE_WRITE; - if (dst->pCompositeClip->data) + if (flags & COMPOSITE_PARTIAL) hint |= MOVE_READ; region.extents = dst_box; @@ -2598,8 +2868,10 @@ struct kgem *kgem = &sna->kgem; assert(kgem->nbatch <= KGEM_BATCH_SIZE(kgem)); - if (kgem->nexec > 1 && __kgem_ring_empty(kgem)) + if (kgem->nexec > 1 && __kgem_ring_empty(kgem)) { + DBG(("%s: flushing BLT operation on empty ring\n", __FUNCTION__)); _kgem_submit(kgem); + } kgem_bo_destroy(kgem, op->src.bo); sna_render_composite_redirect_done(sna, op); @@ -2811,6 +3083,128 @@ _sna_blt_fill_boxes(sna, &op->base.u.blt, box, nbox); } +static inline uint64_t pt_add(uint32_t cmd, const DDXPointRec *pt, int16_t dx, int16_t dy) +{ + union { + DDXPointRec pt; + uint32_t i; + } u; + + u.pt.x = pt->x + dx; + u.pt.y = pt->y + dy; + + return cmd | (uint64_t)u.i<<32; +} + +fastcall static void sna_blt_fill_op_points(struct sna *sna, + const struct sna_fill_op *op, + int16_t dx, int16_t dy, + const DDXPointRec *p, int n) +{ + const struct sna_blt_state *blt = &op->base.u.blt; + struct kgem *kgem = &sna->kgem; + uint32_t cmd; + + DBG(("%s: %08x x %d\n", __FUNCTION__, blt->pixel, n)); + + if (sna->blt_state.fill_bo != op->base.u.blt.bo[0]->unique_id) { + sna_blt_fill_begin(sna, blt); + + sna->blt_state.fill_bo = blt->bo[0]->unique_id; + sna->blt_state.fill_pixel = blt->pixel; + sna->blt_state.fill_alu = blt->alu; + } + + if (!kgem_check_batch(kgem, 2)) + sna_blt_fill_begin(sna, blt); + + cmd = XY_PIXEL_BLT; + if (kgem->gen >= 040 && op->base.u.blt.bo[0]->tiling) + cmd |= BLT_DST_TILED; + + do { + uint32_t *b = kgem->batch + kgem->nbatch; + int n_this_time; + + assert(sna->kgem.mode == KGEM_BLT); + n_this_time = n; + if (2*n_this_time > kgem->surface - kgem->nbatch - KGEM_BATCH_RESERVED) + n_this_time = (kgem->surface - kgem->nbatch - KGEM_BATCH_RESERVED) / 2; + assert(n_this_time); + n -= n_this_time; + + kgem->nbatch += 2 * n_this_time; + assert(kgem->nbatch < kgem->surface); + + if ((dx|dy) == 0) { + while (n_this_time >= 8) { + *((uint64_t *)b + 0) = pt_add(cmd, p+0, 0, 0); + *((uint64_t *)b + 1) = pt_add(cmd, p+1, 0, 0); + *((uint64_t *)b + 2) = pt_add(cmd, p+2, 0, 0); + *((uint64_t *)b + 3) = pt_add(cmd, p+3, 0, 0); + *((uint64_t *)b + 4) = pt_add(cmd, p+4, 0, 0); + *((uint64_t *)b + 5) = pt_add(cmd, p+5, 0, 0); + *((uint64_t *)b + 6) = pt_add(cmd, p+6, 0, 0); + *((uint64_t *)b + 7) = pt_add(cmd, p+7, 0, 0); + b += 16; + n_this_time -= 8; + p += 8; + } + if (n_this_time & 4) { + *((uint64_t *)b + 0) = pt_add(cmd, p+0, 0, 0); + *((uint64_t *)b + 1) = pt_add(cmd, p+1, 0, 0); + *((uint64_t *)b + 2) = pt_add(cmd, p+2, 0, 0); + *((uint64_t *)b + 3) = pt_add(cmd, p+3, 0, 0); + b += 8; + p += 4; + } + if (n_this_time & 2) { + *((uint64_t *)b + 0) = pt_add(cmd, p+0, 0, 0); + *((uint64_t *)b + 1) = pt_add(cmd, p+1, 0, 0); + b += 4; + p += 2; + } + if (n_this_time & 1) + *((uint64_t *)b + 0) = pt_add(cmd, p++, 0, 0); + } else { + while (n_this_time >= 8) { + *((uint64_t *)b + 0) = pt_add(cmd, p+0, dx, dy); + *((uint64_t *)b + 1) = pt_add(cmd, p+1, dx, dy); + *((uint64_t *)b + 2) = pt_add(cmd, p+2, dx, dy); + *((uint64_t *)b + 3) = pt_add(cmd, p+3, dx, dy); + *((uint64_t *)b + 4) = pt_add(cmd, p+4, dx, dy); + *((uint64_t *)b + 5) = pt_add(cmd, p+5, dx, dy); + *((uint64_t *)b + 6) = pt_add(cmd, p+6, dx, dy); + *((uint64_t *)b + 7) = pt_add(cmd, p+7, dx, dy); + b += 16; + n_this_time -= 8; + p += 8; + } + if (n_this_time & 4) { + *((uint64_t *)b + 0) = pt_add(cmd, p+0, dx, dy); + *((uint64_t *)b + 1) = pt_add(cmd, p+1, dx, dy); + *((uint64_t *)b + 2) = pt_add(cmd, p+2, dx, dy); + *((uint64_t *)b + 3) = pt_add(cmd, p+3, dx, dy); + b += 8; + p += 8; + } + if (n_this_time & 2) { + *((uint64_t *)b + 0) = pt_add(cmd, p+0, dx, dy); + *((uint64_t *)b + 1) = pt_add(cmd, p+1, dx, dy); + b += 4; + p += 2; + } + if (n_this_time & 1) + *((uint64_t *)b + 0) = pt_add(cmd, p++, dx, dy); + } + + if (!n) + return; + + sna_blt_fill_begin(sna, blt); + } while (1); +} + bool sna_blt_fill(struct sna *sna, uint8_t alu, struct kgem_bo *bo, int bpp, uint32_t pixel, @@ -2835,6 +3229,7 @@ fill->blt = sna_blt_fill_op_blt; fill->box = sna_blt_fill_op_box; fill->boxes = sna_blt_fill_op_boxes; + fill->points = sna_blt_fill_op_points; fill->done = (void (*)(struct sna *, const struct sna_fill_op *))nop_done; return true; @@ -2931,7 +3326,7 @@ return true; } if (kgem->nbatch >= 10 && - (kgem->batch[kgem->nbatch-10] & 0xffc0000f) == XY_SRC_COPY_BLT_CMD && + (kgem->batch[kgem->nbatch-10] & 0xffc00000) == XY_SRC_COPY_BLT_CMD && *(uint64_t *)&kgem->batch[kgem->nbatch-8] == *(const uint64_t *)box && kgem->reloc[kgem->nreloc-2].target_handle == bo->target_handle) { DBG(("%s: replacing last copy\n", __FUNCTION__)); @@ -2956,7 +3351,7 @@ return true; } if (kgem->nbatch >= 8 && - (kgem->batch[kgem->nbatch-8] & 0xffc0000f) == XY_SRC_COPY_BLT_CMD && + (kgem->batch[kgem->nbatch-8] & 0xffc00000) == XY_SRC_COPY_BLT_CMD && *(uint64_t *)&kgem->batch[kgem->nbatch-6] == *(const uint64_t *)box && kgem->reloc[kgem->nreloc-2].target_handle == bo->target_handle) { DBG(("%s: replacing last copy\n", __FUNCTION__)); @@ -3230,8 +3625,10 @@ } } while (nbox); - if (kgem->nexec > 1 && __kgem_ring_empty(kgem)) + if (kgem->nexec > 1 && __kgem_ring_empty(kgem)) { + DBG(("%s: flushing BLT operation on empty ring\n", __FUNCTION__)); _kgem_submit(kgem); + } return true; } @@ -3252,6 +3649,7 @@ __FUNCTION__, src_dx, src_dy, dst_dx, dst_dy, nbox, src_bo->tiling, dst_bo->tiling, src_bo->pitch, dst_bo->pitch)); + assert(nbox); if (wedged(sna) || !kgem_bo_can_blt(kgem, src_bo) || !kgem_bo_can_blt(kgem, dst_bo)) { DBG(("%s: cannot blt to src? %d or dst? %d\n", @@ -3292,7 +3690,7 @@ kgem->reloc[kgem->nreloc-1].target_handle == dst_bo->target_handle) { if (kgem->gen >= 0100) { if (kgem->nbatch >= 7 && - kgem->batch[kgem->nbatch-7] == (XY_COLOR_BLT | (cmd & (BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 5) && + kgem->batch[kgem->nbatch-7] == (XY_COLOR_BLT | (cmd & (BLT_DST_TILED | BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 5) && kgem->batch[kgem->nbatch-5] == ((uint32_t)(box->y1 + dst_dy) << 16 | (uint16_t)(box->x1 + dst_dx)) && kgem->batch[kgem->nbatch-4] == ((uint32_t)(box->y2 + dst_dy) << 16 | (uint16_t)(box->x2 + dst_dx))) { DBG(("%s: deleting last fill\n", __FUNCTION__)); @@ -3301,7 +3699,7 @@ } } else { if (kgem->nbatch >= 6 && - kgem->batch[kgem->nbatch-6] == (XY_COLOR_BLT | (cmd & (BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 4) && + kgem->batch[kgem->nbatch-6] == (XY_COLOR_BLT | (cmd & (BLT_DST_TILED | BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 4) && kgem->batch[kgem->nbatch-4] == ((uint32_t)(box->y1 + dst_dy) << 16 | (uint16_t)(box->x1 + dst_dx)) && kgem->batch[kgem->nbatch-3] == ((uint32_t)(box->y2 + dst_dy) << 16 | (uint16_t)(box->x2 + dst_dx))) { DBG(("%s: deleting last fill\n", __FUNCTION__)); @@ -3553,6 +3951,7 @@ } if (kgem->nexec > 1 && __kgem_ring_empty(kgem)) { + DBG(("%s: flushing BLT operation on empty ring\n", __FUNCTION__)); _kgem_submit(kgem); } else if (kgem->gen >= 060 && src_bo == dst_bo && kgem_check_batch(kgem, 3)) { uint32_t *b = kgem->batch + kgem->nbatch; @@ -3702,8 +4101,10 @@ box++; } - if (kgem->nexec > 1 && __kgem_ring_empty(kgem)) + if (kgem->nexec > 1 && __kgem_ring_empty(kgem)) { + DBG(("%s: flushing BLT operation on empty ring\n", __FUNCTION__)); _kgem_submit(kgem); + } sna->blt_state.fill_bo = 0; return true; @@ -3727,8 +4128,8 @@ } bool sna_blt_copy_boxes_fallback(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const DrawableRec *src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, + const DrawableRec *dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int nbox) { struct kgem_bo *free_bo = NULL; @@ -3736,9 +4137,9 @@ DBG(("%s: alu=%d, n=%d\n", __FUNCTION__, alu, nbox)); - if (!sna_blt_compare_depth(&src->drawable, &dst->drawable)) { + if (!sna_blt_compare_depth(src, dst)) { DBG(("%s: mismatching depths %d -> %d\n", - __FUNCTION__, src->drawable.depth, dst->drawable.depth)); + __FUNCTION__, src->depth, dst->depth)); return false; } @@ -3751,8 +4152,11 @@ DBG(("%s: src is Y-tiled\n", __FUNCTION__)); - assert(src_bo == sna_pixmap(src)->gpu_bo); - bo = sna_pixmap_change_tiling(src, I915_TILING_X); + if (src->type != DRAWABLE_PIXMAP) + return false; + + assert(sna_pixmap((PixmapPtr)src)->gpu_bo == src_bo); + bo = sna_pixmap_change_tiling((PixmapPtr)src, I915_TILING_X); if (bo == NULL) { BoxRec extents; @@ -3763,7 +4167,7 @@ free_bo = kgem_create_2d(&sna->kgem, extents.x2 - extents.x1, extents.y2 - extents.y1, - src->drawable.bitsPerPixel, + src->bitsPerPixel, I915_TILING_X, 0); if (free_bo == NULL) { DBG(("%s: fallback -- temp allocation failed\n", @@ -3774,7 +4178,7 @@ if (!sna_blt_copy_boxes(sna, GXcopy, src_bo, src_dx, src_dy, free_bo, -extents.x1, -extents.y1, - src->drawable.bitsPerPixel, + src->bitsPerPixel, box, nbox)) { DBG(("%s: fallback -- temp copy failed\n", __FUNCTION__)); @@ -3792,8 +4196,10 @@ if (src_bo->tiling == I915_TILING_Y && kgem_bo_blt_pitch_is_ok(&sna->kgem, src_bo)) { DBG(("%s: src is y-tiled\n", __FUNCTION__)); - assert(src_bo == sna_pixmap(src)->gpu_bo); - src_bo = sna_pixmap_change_tiling(src, I915_TILING_X); + if (src->type != DRAWABLE_PIXMAP) + return false; + assert(sna_pixmap((PixmapPtr)src)->gpu_bo == src_bo); + src_bo = sna_pixmap_change_tiling((PixmapPtr)src, I915_TILING_X); if (src_bo == NULL) { DBG(("%s: fallback -- src y-tiling conversion failed\n", __FUNCTION__)); @@ -3804,8 +4210,10 @@ if (dst_bo->tiling == I915_TILING_Y && kgem_bo_blt_pitch_is_ok(&sna->kgem, dst_bo)) { DBG(("%s: dst is y-tiled\n", __FUNCTION__)); - assert(dst_bo == sna_pixmap(dst)->gpu_bo); - dst_bo = sna_pixmap_change_tiling(dst, I915_TILING_X); + if (dst->type != DRAWABLE_PIXMAP) + return false; + assert(sna_pixmap((PixmapPtr)dst)->gpu_bo == dst_bo); + dst_bo = sna_pixmap_change_tiling((PixmapPtr)dst, I915_TILING_X); if (dst_bo == NULL) { DBG(("%s: fallback -- dst y-tiling conversion failed\n", __FUNCTION__)); @@ -3817,7 +4225,7 @@ ret = sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, nbox); if (free_bo) diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_composite.c xserver-xorg-video-intel-2.99.914/src/sna/sna_composite.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_composite.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_composite.c 2014-07-04 14:19:02.000000000 +0000 @@ -178,7 +178,7 @@ if (region->extents.x1 >= region->extents.x2 || region->extents.y1 >= region->extents.y2) - return FALSE; + return false; region->extents.x1 += dst->pDrawable->x; region->extents.x2 += dst->pDrawable->x; @@ -190,7 +190,7 @@ /* clip against dst */ if (!clip_to_dst(region, dst->pCompositeClip, 0, 0)) - return FALSE; + return false; DBG(("%s: clip against dst->pCompositeClip: (%d, %d), (%d, %d)\n", __FUNCTION__, @@ -202,7 +202,7 @@ -dst->alphaOrigin.x, -dst->alphaOrigin.y)) { pixman_region_fini (region); - return FALSE; + return false; } } @@ -214,7 +214,7 @@ } if (!clip_to_src(region, src, dst_x - src_x, dst_y - src_y)) { pixman_region_fini (region); - return FALSE; + return false; } DBG(("%s: clip against src (%dx%d clip=%d): (%d, %d), (%d, %d)\n", __FUNCTION__, @@ -229,7 +229,7 @@ dst_x - (src_x - src->alphaOrigin.x), dst_y - (src_y - src->alphaOrigin.y))) { pixman_region_fini(region); - return FALSE; + return false; } } } @@ -242,14 +242,14 @@ } if (!clip_to_src(region, mask, dst_x - mask_x, dst_y - mask_y)) { pixman_region_fini(region); - return FALSE; + return false; } if (mask->alphaMap) { if (!clip_to_src(region, mask->alphaMap, dst_x - (mask_x - mask->alphaOrigin.x), dst_y - (mask_y - mask->alphaOrigin.y))) { pixman_region_fini(region); - return FALSE; + return false; } } @@ -342,15 +342,32 @@ extents->x1, extents->y1, extents->x2, extents->y2)); - if (extents->x1 >= extents->x2 || - extents->y1 >= extents->y2) - return FALSE; + if (extents->x1 >= extents->x2 || extents->y1 >= extents->y2) + return false; extents->x1 += dst->pDrawable->x; extents->x2 += dst->pDrawable->x; extents->y1 += dst->pDrawable->y; extents->y2 += dst->pDrawable->y; + if (extents->x1 < dst->pCompositeClip->extents.x1) + extents->x1 = dst->pCompositeClip->extents.x1; + if (extents->x2 > dst->pCompositeClip->extents.x2) + extents->x2 = dst->pCompositeClip->extents.x2; + + if (extents->y1 < dst->pCompositeClip->extents.y1) + extents->y1 = dst->pCompositeClip->extents.y1; + if (extents->y2 > dst->pCompositeClip->extents.y2) + extents->y2 = dst->pCompositeClip->extents.y2; + + DBG(("%s: initial clip against dst->pCompositeClip: (%d, %d), (%d, %d)\n", + __FUNCTION__, + extents->x1, extents->y1, + extents->x2, extents->y2)); + + if (extents->x1 >= extents->x2 || extents->y1 >= extents->y2) + return false; + dst_x += dst->pDrawable->x; dst_y += dst->pDrawable->y; @@ -404,7 +421,7 @@ static void apply_damage(struct sna_composite_op *op, RegionPtr region) { DBG(("%s: damage=%p, region=%d [(%d, %d), (%d, %d) + (%d, %d)]\n", - __FUNCTION__, op->damage, (int)RegionNumRects(region), + __FUNCTION__, op->damage, region_num_rects(region), region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2, op->dst.x, op->dst.y)); @@ -418,9 +435,12 @@ assert_pixmap_contains_box(op->dst.pixmap, RegionExtents(region)); if (region->data == NULL && region->extents.x2 - region->extents.x1 == op->dst.width && - region->extents.y2 - region->extents.y1 == op->dst.height) - sna_damage_all(op->damage, op->dst.width, op->dst.height); - else + region->extents.y2 - region->extents.y1 == op->dst.height) { + *op->damage = _sna_damage_all(*op->damage, + op->dst.width, + op->dst.height); + op->damage = NULL; + } else sna_damage_add(op->damage, region); } @@ -527,7 +547,9 @@ src->filter != PictFilterConvolution && (op == PictOpSrc || (op == PictOpOver && !PICT_FORMAT_A(src->format))) && (dst->format == src->format || dst->format == alphaless(src->format)) && - sna_transform_is_integer_translation(src->transform, &tx, &ty)) { + sna_transform_is_imprecise_integer_translation(src->transform, src->filter, + dst->polyMode == PolyModePrecise, + &tx, &ty)) { PixmapPtr dst_pixmap = get_drawable_pixmap(dst->pDrawable); PixmapPtr src_pixmap = get_drawable_pixmap(src->pDrawable); int16_t sx = src_x + tx - (dst->pDrawable->x + dst_x); @@ -541,8 +563,8 @@ region->extents.x2 + sx <= src->pDrawable->width && region->extents.y2 + sy <= src->pDrawable->height) { if (sigtrap_get() == 0) { - BoxPtr box = RegionRects(region); - int nbox = RegionNumRects(region); + const BoxRec *box = region_rects(region); + int nbox = region_num_rects(region); sx += src->pDrawable->x; sy += src->pDrawable->y; @@ -570,6 +592,7 @@ assert(box->x2 > box->x1 && box->y2 > box->y1); + sigtrap_assert_active(); memcpy_blt(src_pixmap->devPrivate.ptr, dst_pixmap->devPrivate.ptr, dst_pixmap->drawable.bitsPerPixel, @@ -591,16 +614,12 @@ mask_image = image_from_pict(mask, FALSE, &msk_xoff, &msk_yoff); dest_image = image_from_pict(dst, TRUE, &dst_xoff, &dst_yoff); - if (src_image && dest_image && !(mask && !mask_image)) { - if (sigtrap_get() == 0) { - sna_image_composite(op, src_image, mask_image, dest_image, - src_x + src_xoff, src_y + src_yoff, - msk_x + msk_xoff, msk_y + msk_yoff, - dst_x + dst_xoff, dst_y + dst_yoff, - width, height); - sigtrap_put(); - } - } + if (src_image && dest_image && !(mask && !mask_image)) + sna_image_composite(op, src_image, mask_image, dest_image, + src_x + src_xoff, src_y + src_yoff, + msk_x + msk_xoff, msk_y + msk_yoff, + dst_x + dst_xoff, dst_y + dst_yoff, + width, height); free_pixman_pict(src, src_image); free_pixman_pict(mask, mask_image); @@ -679,7 +698,8 @@ } if (use_cpu(pixmap, priv, op, width, height) && - !picture_is_gpu(sna, src) && !picture_is_gpu(sna, mask)) { + !picture_is_gpu(sna, src, PREFER_GPU_RENDER) && + !picture_is_gpu(sna, mask, PREFER_GPU_RENDER)) { DBG(("%s: fallback, dst pixmap=%ld is too small (or completely damaged)\n", __FUNCTION__, pixmap->drawable.serialNumber)); goto fallback; @@ -720,7 +740,8 @@ region.extents.y1, region.extents.x2 - region.extents.x1, region.extents.y2 - region.extents.y1, - 0, memset(&tmp, 0, sizeof(tmp)))) { + region.data ? COMPOSITE_PARTIAL : 0, + memset(&tmp, 0, sizeof(tmp)))) { DBG(("%s: fallback due unhandled composite op\n", __FUNCTION__)); goto fallback; } @@ -730,7 +751,7 @@ else tmp.boxes(sna, &tmp, RegionBoxptr(®ion), - RegionNumRects(®ion)); + region_num_rects(®ion)); apply_damage(&tmp, ®ion); tmp.done(sna, &tmp); @@ -895,11 +916,11 @@ goto cleanup_region; } - DBG(("%s: clipped extents (%d, %d),(%d, %d) x %ld\n", + DBG(("%s: clipped extents (%d, %d),(%d, %d) x %d\n", __FUNCTION__, RegionExtents(®ion)->x1, RegionExtents(®ion)->y1, RegionExtents(®ion)->x2, RegionExtents(®ion)->y2, - (long)RegionNumRects(®ion))); + region_num_rects(®ion))); /* XXX xserver-1.8: CompositeRects is not tracked by Damage, so we must * manually append the damaged regions ourselves. @@ -942,35 +963,55 @@ */ hint = can_render(sna) ? PREFER_GPU : 0; if (op <= PictOpSrc) { - if (priv->cpu_damage && - region_subsumes_damage(®ion, priv->cpu_damage)) { - DBG(("%s: discarding existing CPU damage\n", __FUNCTION__)); - if (priv->gpu_bo && priv->gpu_bo->proxy) { - assert(priv->gpu_damage == NULL); - kgem_bo_destroy(&sna->kgem, priv->gpu_bo); - priv->gpu_bo = NULL; + if (priv->clear) { + uint32_t pixel; + bool ok; + + if (op == PictOpClear) { + ok = sna_get_pixel_from_rgba(&pixel, + 0, 0, 0, 0, + dst->format); + } else { + ok = sna_get_pixel_from_rgba(&pixel, + color->red, + color->green, + color->blue, + color->alpha, + dst->format); } - sna_damage_destroy(&priv->cpu_damage); - list_del(&priv->flush_list); + if (ok && priv->clear_color == pixel) + goto done; } - if (region_subsumes_drawable(®ion, &pixmap->drawable)) - hint |= REPLACES; - if (hint & REPLACES || box_inplace(pixmap, ®ion.extents)) { - DBG(("%s: promoting to full GPU\n", __FUNCTION__)); - if (priv->gpu_bo && priv->cpu_damage == NULL) { - assert(priv->gpu_bo->proxy == NULL); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + + if (region.data == NULL) { + hint |= IGNORE_DAMAGE; + if (region_subsumes_drawable(®ion, &pixmap->drawable)) + hint |= REPLACES; + if (priv->cpu_damage && + (hint & REPLACES || + region_subsumes_damage(®ion, priv->cpu_damage))) { + DBG(("%s: discarding existing CPU damage\n", __FUNCTION__)); + if (priv->gpu_bo && priv->gpu_bo->proxy) { + assert(priv->gpu_damage == NULL); + kgem_bo_destroy(&sna->kgem, priv->gpu_bo); + priv->gpu_bo = NULL; + } + sna_damage_destroy(&priv->cpu_damage); + list_del(&priv->flush_list); + } + if (hint & REPLACES || + box_inplace(pixmap, ®ion.extents)) { + if (priv->gpu_bo && priv->cpu_damage == NULL) { + DBG(("%s: promoting to full GPU\n", __FUNCTION__)); + assert(priv->gpu_bo->proxy == NULL); + sna_damage_all(&priv->gpu_damage, pixmap); + } } } if (priv->cpu_damage == NULL) { DBG(("%s: dropping last-cpu hint\n", __FUNCTION__)); priv->cpu = false; } - - if (region.data == NULL) - hint |= IGNORE_CPU; } bo = sna_drawable_use_bo(&pixmap->drawable, hint, @@ -980,12 +1021,12 @@ goto fallback; } if (hint & REPLACES) - kgem_bo_undo(&sna->kgem, bo); + kgem_bo_pair_undo(&sna->kgem, priv->gpu_bo, priv->cpu_bo); if (op <= PictOpSrc) { b = pixman_region_rectangles(®ion, &num_boxes); if (!sna->render.fill_boxes(sna, op, dst->format, color, - pixmap, bo, b, num_boxes)) { + &pixmap->drawable, bo, b, num_boxes)) { DBG(("%s: fallback - acceleration failed\n", __FUNCTION__)); goto fallback; } @@ -997,7 +1038,7 @@ boxes[i].y2 += dst_y; } if (!sna->render.fill_boxes(sna, op, dst->format, color, - pixmap, bo, boxes, num_boxes)) { + &pixmap->drawable, bo, boxes, num_boxes)) { DBG(("%s: fallback - acceleration failed\n", __FUNCTION__)); goto fallback; } @@ -1013,7 +1054,7 @@ pixman_region_translate(&tmp, dst_x, dst_y); n = !sna->render.fill_boxes(sna, op, dst->format, color, - pixmap, bo, b, n); + &pixmap->drawable, bo, b, n); } pixman_region_fini(&tmp); @@ -1034,9 +1075,7 @@ */ if (region_subsumes_drawable(®ion, &pixmap->drawable)) { if (damage) { - sna_damage_all(damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(damage, pixmap); sna_damage_destroy(damage == &priv->gpu_damage ? &priv->cpu_damage : &priv->gpu_damage); } @@ -1080,8 +1119,8 @@ if (sigtrap_get() == 0) { if (op <= PictOpSrc) { - int nbox = RegionNumRects(®ion); - BoxPtr box = RegionRects(®ion); + int nbox = region_num_rects(®ion); + const BoxRec *box = region_rects(®ion); uint32_t pixel; if (op == PictOpClear) @@ -1094,6 +1133,7 @@ dst->format)) goto fallback_composite; + sigtrap_assert_active(); if (pixel == 0 && box->x2 - box->x1 == pixmap->drawable.width && box->y2 - box->y1 == pixmap->drawable.height) { diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_cpu.c xserver-xorg-video-intel-2.99.914/src/sna/sna_cpu.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_cpu.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_cpu.c 2014-05-28 12:38:16.000000000 +0000 @@ -40,12 +40,13 @@ unsigned sna_cpu_detect(void) { unsigned max = __get_cpuid_max(BASIC_CPUID, NULL); - unsigned int eax, ebx, ecx, edx; + unsigned eax, ebx, ecx, edx; unsigned features = 0; unsigned extra = 0; if (max >= 1) { __cpuid(1, eax, ebx, ecx, edx); + if (ecx & bit_SSE3) features |= SSE3; @@ -80,6 +81,7 @@ if (max >= 7) { __cpuid_count(7, 0, eax, ebx, ecx, edx); + if ((extra & has_YMM) && (ebx & bit_AVX2)) features |= AVX2; } diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_cpuid.h xserver-xorg-video-intel-2.99.914/src/sna/sna_cpuid.h --- xserver-xorg-video-intel-2.99.910/src/sna/sna_cpuid.h 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_cpuid.h 2014-05-28 12:38:16.000000000 +0000 @@ -36,8 +36,8 @@ #include #else #define __get_cpuid_max(x, y) 0 -#define __cpuid(level, a, b, c, d) -#define __cpuid_count(level, count, a, b, c, d) +#define __cpuid(level, a, b, c, d) a = b = c = d = 0 +#define __cpuid_count(level, count, a, b, c, d) a = b = c = d = 0 #endif #define BASIC_CPUID 0x0 diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_damage.c xserver-xorg-video-intel-2.99.914/src/sna/sna_damage.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_damage.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_damage.c 2014-06-21 14:45:39.000000000 +0000 @@ -55,43 +55,45 @@ static struct sna_damage *__freed_damage; -static inline bool region_is_singular(RegionRec *r) +static inline bool region_is_singular(const RegionRec *r) { return r->data == NULL; } +static inline bool region_is_singular_or_empty(const RegionRec *r) +{ + return r->data == NULL || r->data->numRects == 0; +} + #if HAS_DEBUG_FULL static const char *_debug_describe_region(char *buf, int max, const RegionRec *region) { - BoxPtr extents; - BoxPtr box; - int n; - int len; + const BoxRec *box; + int n, len; if (region == NULL) return "nil"; - n = REGION_NUM_RECTS(region); + n = region_num_rects(region); if (n == 0) return "[0]"; - extents = REGION_EXTENTS(NULL, region); if (n == 1) { sprintf(buf, "[(%d, %d), (%d, %d)]", - extents->x1, extents->y1, - extents->x2, extents->y2); + region->extents.x1, region->extents.y1, + region->extents.x2, region->extents.y2); return buf; } len = sprintf(buf, "[(%d, %d), (%d, %d) x %d: ", - extents->x1, extents->y1, - extents->x2, extents->y2, + region->extents.x1, region->extents.y1, + region->extents.x2, region->extents.y2, n) + 3; max -= 2; - box = REGION_RECTS(region); + box = region_rects(region); while (n--) { char tmp[80]; int this; @@ -150,6 +152,14 @@ } #endif +static struct sna_damage_box * +last_box(struct sna_damage *damage) +{ + return list_entry(damage->embedded_box.list.prev, + struct sna_damage_box, + list); +} + static void reset_embedded_box(struct sna_damage *damage) { @@ -210,7 +220,7 @@ assert(damage->mode != DAMAGE_ALL); assert(damage->dirty); - DBG((" reduce: before region.n=%ld\n", (long)REGION_NUM_RECTS(region))); + DBG((" reduce: before region.n=%d\n", region_num_rects(region))); nboxes = damage->embedded_box.size; list_for_each_entry(iter, &damage->embedded_box.list, list) @@ -235,11 +245,9 @@ } if (damage->mode == DAMAGE_ADD) - nboxes += REGION_NUM_RECTS(region); + nboxes += region_num_rects(region); - iter = list_entry(damage->embedded_box.list.prev, - struct sna_damage_box, - list); + iter = last_box(damage); n = iter->size - damage->remain; boxes = (BoxRec *)(iter+1); DBG((" last box count=%d/%d, need=%d\n", n, iter->size, nboxes)); @@ -288,9 +296,9 @@ if (damage->mode == DAMAGE_ADD) { memcpy(boxes + n, - REGION_RECTS(region), - REGION_NUM_RECTS(region)*sizeof(BoxRec)); - assert(n + REGION_NUM_RECTS(region) == nboxes); + region_rects(region), + region_num_rects(region)*sizeof(BoxRec)); + assert(n + region_num_rects(region) == nboxes); pixman_region_fini(region); pixman_region_init_rects(region, boxes, nboxes); @@ -324,19 +332,16 @@ free_list(&damage->embedded_box.list); reset_embedded_box(damage); - DBG((" reduce: after region.n=%ld\n", (long)REGION_NUM_RECTS(region))); + DBG((" reduce: after region.n=%d\n", region_num_rects(region))); } - static bool _sna_damage_create_boxes(struct sna_damage *damage, int count) { struct sna_damage_box *box; int n; - box = list_entry(damage->embedded_box.list.prev, - struct sna_damage_box, - list); + box = last_box(damage); n = 4*box->size; if (n < count) n = ALIGN(count, 64); @@ -365,6 +370,7 @@ DBG((" %s: prev=(remain %d), count=%d\n", __FUNCTION__, damage->remain, count)); + assert(count); restart: n = count; @@ -383,6 +389,8 @@ } DBG((" %s(): new elt\n", __FUNCTION__)); + assert(damage->remain == 0); + assert(damage->box - (BoxRec *)(last_box(damage)+1) == last_box(damage)->size); if (!_sna_damage_create_boxes(damage, count)) { unsigned mode; @@ -414,6 +422,7 @@ int i, n; DBG((" %s: prev=(remain %d)\n", __FUNCTION__, damage->remain)); + assert(count); restart: n = count; @@ -437,6 +446,8 @@ } DBG((" %s(): new elt\n", __FUNCTION__)); + assert(damage->remain == 0); + assert(damage->box - (BoxRec *)(last_box(damage)+1) == last_box(damage)->size); if (!_sna_damage_create_boxes(damage, count)) { unsigned mode; @@ -474,6 +485,7 @@ DBG((" %s: prev=(remain %d), count=%d\n", __FUNCTION__, damage->remain, count)); + assert(count); restart: n = count; @@ -497,6 +509,8 @@ } DBG((" %s(): new elt\n", __FUNCTION__)); + assert(damage->remain == 0); + assert(damage->box - (BoxRec *)(last_box(damage)+1) == last_box(damage)->size); if (!_sna_damage_create_boxes(damage, count)) { unsigned mode; @@ -534,6 +548,7 @@ DBG((" %s: prev=(remain %d), count=%d\n", __FUNCTION__, damage->remain, count)); + assert(count); restart: n = count; @@ -557,6 +572,8 @@ } DBG((" %s(): new elt\n", __FUNCTION__)); + assert(damage->remain == 0); + assert(damage->box - (BoxRec *)(last_box(damage)+1) == last_box(damage)->size); if (!_sna_damage_create_boxes(damage, count)) { unsigned mode; @@ -641,7 +658,7 @@ break; } - if (REGION_NUM_RECTS(&damage->region) <= 1 || + if (region_is_singular_or_empty(&damage->region) || box_contains_region(box, &damage->region)) { _pixman_region_union_box(&damage->region, box); assert(damage->region.extents.x2 > damage->region.extents.x1); @@ -676,10 +693,10 @@ break; } - if (region->data == NULL) + if (region_is_singular(region)) return __sna_damage_add_box(damage, ®ion->extents); - if (REGION_NUM_RECTS(&damage->region) <= 1) { + if (region_is_singular_or_empty(&damage->region)) { pixman_region_union(&damage->region, &damage->region, region); assert(damage->region.extents.x2 > damage->region.extents.x1); assert(damage->region.extents.y2 > damage->region.extents.y1); @@ -693,8 +710,8 @@ damage_union(damage, ®ion->extents); return _sna_damage_create_elt(damage, - REGION_RECTS(region), - REGION_NUM_RECTS(region)); + region_rects(region), + region_num_rects(region)); } #if HAS_DEBUG_FULL @@ -712,7 +729,7 @@ DBG((" = %s\n", _debug_describe_damage(damage_buf, sizeof(damage_buf), damage))); - assert(RegionNumRects(&damage->region)); + assert(region_num_rects(&damage->region)); assert(damage->region.extents.x2 > damage->region.extents.x1); assert(damage->region.extents.y2 > damage->region.extents.y1); @@ -796,7 +813,7 @@ DBG((" = %s\n", _debug_describe_damage(damage_buf, sizeof(damage_buf), damage))); - if (RegionNumRects(&damage->region)) { + if (region_num_rects(&damage->region)) { assert(damage->region.extents.x2 > damage->region.extents.x1); assert(damage->region.extents.y2 > damage->region.extents.y1); } @@ -885,7 +902,7 @@ DBG((" = %s\n", _debug_describe_damage(damage_buf, sizeof(damage_buf), damage))); - if (RegionNumRects(&damage->region)) { + if (region_num_rects(&damage->region)) { assert(damage->region.extents.x2 > damage->region.extents.x1); assert(damage->region.extents.y2 > damage->region.extents.y1); } @@ -969,7 +986,7 @@ DBG((" = %s\n", _debug_describe_damage(damage_buf, sizeof(damage_buf), damage))); - if (RegionNumRects(&damage->region)) { + if (region_num_rects(&damage->region)) { assert(damage->region.extents.x2 > damage->region.extents.x1); assert(damage->region.extents.y2 > damage->region.extents.y1); } @@ -999,7 +1016,7 @@ DBG((" = %s\n", _debug_describe_damage(damage_buf, sizeof(damage_buf), damage))); - assert(RegionNumRects(&damage->region)); + assert(region_num_rects(&damage->region)); assert(damage->region.extents.x2 > damage->region.extents.x1); assert(damage->region.extents.y2 > damage->region.extents.y1); @@ -1140,8 +1157,8 @@ } return _sna_damage_create_elt(damage, - REGION_RECTS(region), - REGION_NUM_RECTS(region)); + region_rects(region), + region_num_rects(region)); } #if HAS_DEBUG_FULL @@ -1325,15 +1342,13 @@ } #endif -static int __sna_damage_contains_box(struct sna_damage *damage, +static int __sna_damage_contains_box(struct sna_damage **_damage, const BoxRec *box) { + struct sna_damage *damage = *_damage; const BoxRec *b; int n, count, ret; - if (!damage) - return PIXMAN_REGION_OUT; - if (damage->mode == DAMAGE_ALL) return PIXMAN_REGION_IN; @@ -1373,18 +1388,24 @@ } __sna_damage_reduce(damage); + if (!pixman_region_not_empty(&damage->region)) { + __sna_damage_destroy(damage); + *_damage = NULL; + return PIXMAN_REGION_OUT; + } + return pixman_region_contains_rectangle(&damage->region, (BoxPtr)box); } #if HAS_DEBUG_FULL -int _sna_damage_contains_box(struct sna_damage *damage, +int _sna_damage_contains_box(struct sna_damage **damage, const BoxRec *box) { char damage_buf[1000]; int ret; DBG(("%s(%s, [(%d, %d), (%d, %d)])\n", __FUNCTION__, - _debug_describe_damage(damage_buf, sizeof(damage_buf), damage), + _debug_describe_damage(damage_buf, sizeof(damage_buf), *damage), box->x1, box->y1, box->x2, box->y2)); ret = __sna_damage_contains_box(damage, box); @@ -1397,7 +1418,7 @@ return ret; } #else -int _sna_damage_contains_box(struct sna_damage *damage, +int _sna_damage_contains_box(struct sna_damage **damage, const BoxRec *box) { return __sna_damage_contains_box(damage, box); @@ -1512,15 +1533,18 @@ } #endif -static int __sna_damage_get_boxes(struct sna_damage *damage, BoxPtr *boxes) +static int __sna_damage_get_boxes(struct sna_damage *damage, const BoxRec **boxes) { assert(damage && damage->mode != DAMAGE_ALL); if (damage->dirty) __sna_damage_reduce(damage); - *boxes = REGION_RECTS(&damage->region); - return REGION_NUM_RECTS(&damage->region); + assert(!damage->dirty); + assert(damage->mode == DAMAGE_ADD); + + *boxes = region_rects(&damage->region); + return region_num_rects(&damage->region); } struct sna_damage *_sna_damage_reduce(struct sna_damage *damage) @@ -1528,6 +1552,10 @@ DBG(("%s\n", __FUNCTION__)); __sna_damage_reduce(damage); + + assert(!damage->dirty); + assert(damage->mode == DAMAGE_ADD); + if (!pixman_region_not_empty(&damage->region)) { __sna_damage_destroy(damage); damage = NULL; @@ -1537,7 +1565,7 @@ } #if HAS_DEBUG_FULL -int _sna_damage_get_boxes(struct sna_damage *damage, BoxPtr *boxes) +int _sna_damage_get_boxes(struct sna_damage *damage, const BoxRec **boxes) { char damage_buf[1000]; int count; @@ -1551,7 +1579,7 @@ return count; } #else -int _sna_damage_get_boxes(struct sna_damage *damage, BoxPtr *boxes) +int _sna_damage_get_boxes(struct sna_damage *damage, const BoxRec **boxes) { return __sna_damage_get_boxes(damage, boxes); } @@ -1808,11 +1836,9 @@ } if (damage->mode == DAMAGE_ADD) - nboxes += REGION_NUM_RECTS(r); + nboxes += region_num_rects(r); - iter = list_entry(damage->embedded_box.list.prev, - struct sna_damage_box, - list); + iter = last_box(damage); n = iter->size - damage->remain; boxes = malloc(sizeof(BoxRec)*nboxes); if (boxes == NULL) @@ -1847,9 +1873,9 @@ if (damage->mode == DAMAGE_ADD) { memcpy(boxes + n, - REGION_RECTS(r), - REGION_NUM_RECTS(r)*sizeof(BoxRec)); - assert(n + REGION_NUM_RECTS(r) == nboxes); + region_rects(r), + region_num_rects(r)*sizeof(BoxRec)); + assert(n + region_num_rects(r) == nboxes); pixman_region_fini(r); pixman_region_init_rects(r, boxes, nboxes); diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_damage.h xserver-xorg-video-intel-2.99.914/src/sna/sna_damage.h --- xserver-xorg-video-intel-2.99.910/src/sna/sna_damage.h 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_damage.h 2014-07-04 10:47:59.000000000 +0000 @@ -25,6 +25,7 @@ #define DAMAGE_IS_ALL(ptr) (((uintptr_t)(ptr))&1) #define DAMAGE_MARK_ALL(ptr) ((struct sna_damage *)(((uintptr_t)(ptr))|1)) #define DAMAGE_PTR(ptr) ((struct sna_damage *)(((uintptr_t)(ptr))&~1)) +#define DAMAGE_REGION(ptr) (&DAMAGE_PTR(ptr)->region) struct sna_damage *sna_damage_create(void); @@ -141,10 +142,12 @@ } static inline void sna_damage_all(struct sna_damage **damage, - int width, int height) + PixmapPtr pixmap) { if (!DAMAGE_IS_ALL(*damage)) - *damage = _sna_damage_all(*damage, width, height); + *damage = _sna_damage_all(*damage, + pixmap->drawable.width, + pixmap->drawable.height); } fastcall struct sna_damage *_sna_damage_subtract(struct sna_damage *damage, @@ -205,23 +208,27 @@ return true; } -int _sna_damage_contains_box(struct sna_damage *damage, +int _sna_damage_contains_box(struct sna_damage **damage, const BoxRec *box); -static inline int sna_damage_contains_box(struct sna_damage *damage, +static inline int sna_damage_contains_box(struct sna_damage **damage, const BoxRec *box) { - if (DAMAGE_IS_ALL(damage)) + if (DAMAGE_IS_ALL(*damage)) return PIXMAN_REGION_IN; + if (*damage == NULL) + return PIXMAN_REGION_OUT; return _sna_damage_contains_box(damage, box); } -static inline int sna_damage_contains_box__offset(struct sna_damage *damage, +static inline int sna_damage_contains_box__offset(struct sna_damage **damage, const BoxRec *box, int dx, int dy) { BoxRec b; - if (DAMAGE_IS_ALL(damage)) + if (DAMAGE_IS_ALL(*damage)) return PIXMAN_REGION_IN; + if (*damage == NULL) + return PIXMAN_REGION_OUT; b = *box; b.x1 += dx; b.x2 += dx; @@ -238,9 +245,9 @@ return _sna_damage_contains_box__no_reduce(damage, box); } -int _sna_damage_get_boxes(struct sna_damage *damage, BoxPtr *boxes); +int _sna_damage_get_boxes(struct sna_damage *damage, const BoxRec **boxes); static inline int -sna_damage_get_boxes(struct sna_damage *damage, BoxPtr *boxes) +sna_damage_get_boxes(struct sna_damage *damage, const BoxRec **boxes) { assert(damage); @@ -262,20 +269,20 @@ } static inline void sna_damage_reduce_all(struct sna_damage **_damage, - int width, int height) + PixmapPtr pixmap) { struct sna_damage *damage = *_damage; - DBG(("%s(width=%d, height=%d)\n", __FUNCTION__, width, height)); - if (damage == NULL || DAMAGE_IS_ALL(damage)) return; + DBG(("%s(width=%d, height=%d)\n", __FUNCTION__, pixmap->drawable.width, pixmap->drawable.height)); + if (damage->mode == DAMAGE_ADD) { if (damage->extents.x1 <= 0 && damage->extents.y1 <= 0 && - damage->extents.x2 >= width && - damage->extents.y2 >= height) { + damage->extents.x2 >= pixmap->drawable.width && + damage->extents.y2 >= pixmap->drawable.height) { if (damage->dirty) { damage = *_damage = _sna_damage_reduce(damage); if (damage == NULL) @@ -283,7 +290,9 @@ } if (damage->region.data == NULL) - *_damage = _sna_damage_all(damage, width, height); + *_damage = _sna_damage_all(damage, + pixmap->drawable.width, + pixmap->drawable.height); } } else *_damage = _sna_damage_reduce(damage); diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_display.c xserver-xorg-video-intel-2.99.914/src/sna/sna_display.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_display.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_display.c 2014-07-23 13:45:19.000000000 +0000 @@ -1,6 +1,6 @@ /* * Copyright © 2007 Red Hat, Inc. - * Copyright © 2013 Intel Corporation + * Copyright © 2013-2014 Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -33,9 +33,9 @@ #include #include #include +#include #include #include -#include #include #include #include @@ -44,8 +44,11 @@ #include "sna_reg.h" #include "fb/fbpict.h" #include "intel_options.h" +#include "backlight.h" #include +#include +#include #if XF86_CRTC_VERSION >= 3 #define HAS_GAMMA 1 @@ -85,6 +88,24 @@ #define DEFAULT_DPI 96 #endif +#define DRM_MODE_PAGE_FLIP_ASYNC 0x02 + +#define DRM_CLIENT_CAP_UNIVERSAL_PLANES 2 +#define DRM_PLANE_TYPE_OVERLAY 0 +#define DRM_PLANE_TYPE_PRIMARY 1 +#define DRM_PLANE_TYPE_CURSOR 2 + +#define LOCAL_IOCTL_MODE_OBJ_GETPROPERTIES DRM_IOWR(0xb9, struct local_mode_obj_get_properties) +struct local_mode_obj_get_properties { + uint64_t props_ptr; + uint64_t prop_values_ptr; + uint32_t count_props; + uint32_t obj_id; + uint32_t obj_type; + uint32_t pad; +}; +#define LOCAL_MODE_OBJECT_PLANE 0xeeeeeeee + #if 0 #define __DBG DBG #else @@ -94,17 +115,40 @@ extern XF86ConfigPtr xf86configptr; struct sna_crtc { + xf86CrtcPtr base; struct drm_mode_modeinfo kmode; int dpms_mode; - PixmapPtr scanout_pixmap; + PixmapPtr slave_pixmap; + DamagePtr slave_damage; struct kgem_bo *bo, *shadow_bo; - uint32_t cursor; + struct sna_cursor *cursor; + uint32_t offset; bool shadow; bool fallback_shadow; bool transform; uint8_t id; uint8_t pipe; - uint8_t plane; + + uint32_t rotation; + struct plane { + uint32_t id; + struct { + uint32_t prop; + uint32_t supported; + uint32_t current; + } rotation; + } primary, sprite; + + uint32_t mode_serial, flip_serial; + + uint32_t last_seq, wrap_seq; + struct ust_msc swap; + + sna_flip_handler_t flip_handler; + struct kgem_bo *flip_bo; + void *flip_data; + + struct list shadow_link; }; struct sna_property { @@ -114,8 +158,12 @@ }; struct sna_output { - int id; - int encoder_idx; + xf86OutputPtr base; + unsigned id; + unsigned serial; + + unsigned possible_encoders; + unsigned attached_encoders; unsigned int is_panel : 1; @@ -130,9 +178,8 @@ uint32_t dpms_id; int dpms_mode; - char *backlight_iface; + struct backlight backlight; int backlight_active_level; - int backlight_max; int num_modes; struct drm_mode_modeinfo *modes; @@ -141,9 +188,15 @@ uint32_t *prop_ids; uint64_t *prop_values; struct sna_property *props; - }; +static void sna_crtc_disable_cursor(struct sna *sna, struct sna_crtc *crtc); + +inline static unsigned count_to_mask(int x) +{ + return (1 << x) - 1; +} + static inline struct sna_output *to_sna_output(xf86OutputPtr output) { return output->driver_private; @@ -151,6 +204,8 @@ static inline int to_connector_id(xf86OutputPtr output) { + assert(to_sna_output(output)); + assert(to_sna_output(output)->id); return to_sna_output(output)->id; } @@ -159,14 +214,23 @@ return crtc->driver_private; } -static bool sna_mode_has_pending_events(struct sna *sna) +static inline bool event_pending(int fd) { struct pollfd pfd; - pfd.fd = sna->kgem.fd; + pfd.fd = fd; pfd.events = POLLIN; return poll(&pfd, 1, 0) == 1; } +static bool sna_mode_has_pending_events(struct sna *sna) +{ + /* In order to workaround a kernel bug in not honouring O_NONBLOCK, + * check that the fd is readable before attempting to read the next + * event from drm. + */ + return event_pending(sna->kgem.fd); +} + static bool sna_mode_wait_for_event(struct sna *sna) { struct pollfd pfd; @@ -175,11 +239,6 @@ return poll(&pfd, 1, -1) == 1; } -#define BACKLIGHT_CLASS "/sys/class/backlight" - -/* Enough for 10 digits of backlight + '\n' + '\0' */ -#define BACKLIGHT_VALUE_LEN 12 - static inline uint32_t fb_id(struct kgem_bo *bo) { return bo->delta; @@ -187,17 +246,85 @@ uint32_t sna_crtc_id(xf86CrtcPtr crtc) { + if (to_sna_crtc(crtc) == NULL) + return 0; return to_sna_crtc(crtc)->id; } int sna_crtc_to_pipe(xf86CrtcPtr crtc) { + assert(to_sna_crtc(crtc)); return to_sna_crtc(crtc)->pipe; } -uint32_t sna_crtc_to_plane(xf86CrtcPtr crtc) +uint32_t sna_crtc_to_sprite(xf86CrtcPtr crtc) +{ + assert(to_sna_crtc(crtc)); + return to_sna_crtc(crtc)->sprite.id; +} + +bool sna_crtc_is_on(xf86CrtcPtr crtc) +{ + assert(to_sna_crtc(crtc)); + return to_sna_crtc(crtc)->bo != NULL; +} + +bool sna_crtc_is_transformed(xf86CrtcPtr crtc) +{ + assert(to_sna_crtc(crtc)); + return to_sna_crtc(crtc)->transform; +} + +static inline uint64_t msc64(struct sna_crtc *sna_crtc, uint32_t seq) +{ + if (seq < sna_crtc->last_seq) { + if (sna_crtc->last_seq - seq > 0x40000000) { + sna_crtc->wrap_seq++; + DBG(("%s: pipe=%d wrapped; was %u, now %u, wraps=%u\n", + __FUNCTION__, sna_crtc->pipe, + sna_crtc->last_seq, seq, sna_crtc->wrap_seq)); + } else { + ERR(("%s: pipe=%d msc went backwards; was %u, now %u\n", + __FUNCTION__, sna_crtc->pipe, sna_crtc->last_seq, seq)); + seq = sna_crtc->last_seq; + } + } + sna_crtc->last_seq = seq; + return (uint64_t)sna_crtc->wrap_seq << 32 | seq; +} + +uint64_t sna_crtc_record_swap(xf86CrtcPtr crtc, + int tv_sec, int tv_usec, unsigned seq) +{ + struct sna_crtc *sna_crtc = to_sna_crtc(crtc); + assert(sna_crtc); + DBG(("%s: recording last swap on pipe=%d, frame %d, time %d.%06d\n", + __FUNCTION__, sna_crtc->pipe, seq, tv_sec, tv_usec)); + sna_crtc->swap.tv_sec = tv_sec; + sna_crtc->swap.tv_usec = tv_usec; + return sna_crtc->swap.msc = msc64(sna_crtc, seq); +} + +const struct ust_msc *sna_crtc_last_swap(xf86CrtcPtr crtc) +{ + static struct ust_msc zero; + + if (crtc == NULL) { + return &zero; + } else { + struct sna_crtc *sna_crtc = to_sna_crtc(crtc); + assert(sna_crtc); + return &sna_crtc->swap; + } +} + +xf86CrtcPtr sna_mode_first_crtc(struct sna *sna) { - return to_sna_crtc(crtc)->plane; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); + if (sna->mode.num_real_crtc) + return config->crtc[0]; + else + return NULL; } #ifndef NDEBUG @@ -210,7 +337,7 @@ assert(bo->scanout); VG_CLEAR(info); - info.fb_id = bo->delta; + info.fb_id = fb_id(bo); assert(drmIoctl(kgem->fd, DRM_IOCTL_MODE_GETFB, &info) == 0); gem_close(kgem->fd, info.handle); @@ -230,12 +357,13 @@ assert(bo->refcnt); assert(bo->proxy == NULL); assert(!bo->snoop); + assert(8*bo->pitch >= width * scrn->bitsPerPixel); assert(height * bo->pitch <= kgem_bo_size(bo)); /* XXX crtc offset */ - if (bo->delta) { + if (fb_id(bo)) { DBG(("%s: reusing fb=%d for handle=%d\n", - __FUNCTION__, bo->delta, bo->handle)); + __FUNCTION__, fb_id(bo), bo->handle)); assert_scanout(&sna->kgem, bo, width, height); - return bo->delta; + return fb_id(bo); } DBG(("%s: create fb %dx%d@%d/%d\n", @@ -262,6 +390,9 @@ } assert(arg.fb_id != 0); + DBG(("%s: attached fb=%d to handle=%d\n", + __FUNCTION__, arg.fb_id, arg.handle)); + bo->scanout = true; return bo->delta = arg.fb_id; } @@ -270,14 +401,33 @@ { struct drm_i915_gem_create create; + assert((size & 4095) == 0); + VG_CLEAR(create); create.handle = 0; - create.size = ALIGN(size, 4096); + create.size = size; (void)drmIoctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); return create.handle; } +static void *gem_mmap(int fd, int handle, int size) +{ + struct drm_i915_gem_mmap_gtt mmap_arg; + void *ptr; + + VG_CLEAR(mmap_arg); + mmap_arg.handle = handle; + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg)) + return NULL; + + ptr = mmap(0, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, mmap_arg.offset); + if (ptr == MAP_FAILED) + return NULL; + + return ptr; +} + static void gem_close(int fd, uint32_t handle) { struct drm_gem_close close; @@ -287,203 +437,192 @@ (void)drmIoctl(fd, DRM_IOCTL_GEM_CLOSE, &close); } -#ifdef __OpenBSD__ - -#include -#include +#define BACKLIGHT_NAME "Backlight" +#define BACKLIGHT_DEPRECATED_NAME "BACKLIGHT" +static Atom backlight_atom, backlight_deprecated_atom; +#if HAVE_UDEV static void -sna_output_backlight_set(xf86OutputPtr output, int level) +sna_backlight_uevent(int fd, void *closure) { - struct sna_output *sna_output = output->driver_private; - struct wsdisplay_param param; + struct sna *sna = closure; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); + int i; - DBG(("%s: level=%d, max=%d\n", __FUNCTION__, - level, sna_output->backlight_max)); + DBG(("%s()\n", __FUNCTION__)); - if (!sna_output->backlight_iface) - return; + /* Drain the event queue */ + while (event_pending(fd)) { + struct udev_device *dev; + + DBG(("%s: waiting for uevent\n", __FUNCTION__)); + dev = udev_monitor_receive_device(sna->mode.backlight_monitor); + if (dev == NULL) + break; - if ((unsigned)level > sna_output->backlight_max) - level = sna_output->backlight_max; + udev_device_unref(dev); + } - VG_CLEAR(param); - param.param = WSDISPLAYIO_PARAM_BRIGHTNESS; - param.curval = level; + /* Query all backlights for any changes */ + DBG(("%s: probing backlights for changes\n", __FUNCTION__)); + for (i = 0; i < sna->mode.num_real_output; i++) { + xf86OutputPtr output = config->output[i]; + struct sna_output *sna_output = to_sna_output(output); + int val; - if (ioctl(xf86Info.consoleFd, WSDISPLAYIO_SETPARAM, ¶m) == -1) { - xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, - "Failed to set backlight level: %s\n", - strerror(errno)); - } -} + if (sna_output->dpms_mode != DPMSModeOn) + continue; -static int -sna_output_backlight_get(xf86OutputPtr output) -{ - struct wsdisplay_param param; + assert(output->randr_output); - VG_CLEAR(param); - param.param = WSDISPLAYIO_PARAM_BRIGHTNESS; + val = backlight_get(&sna_output->backlight); + if (val < 0) + continue; + DBG(("%s(%s): backlight '%s' was %d, now %d\n", + __FUNCTION__, output->name, sna_output->backlight.iface, + sna_output->backlight_active_level, val)); - if (ioctl(xf86Info.consoleFd, WSDISPLAYIO_GETPARAM, ¶m) == -1) { - xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, - "Failed to get backlight level: %s\n", - strerror(errno)); - return -1; - } + if (val == sna_output->backlight_active_level) + continue; - DBG(("%s: level=%d (max=%d)\n", __FUNCTION__, param.curval, param.max)); + sna_output->backlight_active_level = val; - return param.curval; + DBG(("%s(%s): sending change notification\n", __FUNCTION__, output->name)); + RRChangeOutputProperty(output->randr_output, + backlight_atom, XA_INTEGER, + 32, PropModeReplace, 1, &val, + TRUE, FALSE); + RRChangeOutputProperty(output->randr_output, + backlight_deprecated_atom, XA_INTEGER, + 32, PropModeReplace, 1, &val, + TRUE, FALSE); + } } -static void -sna_output_backlight_init(xf86OutputPtr output) +static void sna_backlight_pre_init(struct sna *sna) { - struct sna_output *sna_output = output->driver_private; - struct wsdisplay_param param; + struct udev *u; + struct udev_monitor *mon; - VG_CLEAR(param); - param.param = WSDISPLAYIO_PARAM_BRIGHTNESS; +#if !USE_BACKLIGHT + return; +#endif - if (ioctl(xf86Info.consoleFd, WSDISPLAYIO_GETPARAM, ¶m) == -1) + u = udev_new(); + if (!u) return; - DBG(("%s: found 'wscons'\n", __FUNCTION__)); + mon = udev_monitor_new_from_netlink(u, "udev"); + if (!mon) + goto free_udev; - sna_output->backlight_iface = strdup("wscons"); - sna_output->backlight_max = param.max; - sna_output->backlight_active_level = param.curval; -} + if (udev_monitor_filter_add_match_subsystem_devtype(mon, "backlight", NULL)) + goto free_monitor; -#else + if (udev_monitor_enable_receiving(mon)) + goto free_monitor; -static void -sna_output_backlight_set(xf86OutputPtr output, int level) -{ - struct sna_output *sna_output = output->driver_private; - char path[1024], val[BACKLIGHT_VALUE_LEN]; - int fd, len, ret; + sna->mode.backlight_handler = + xf86AddGeneralHandler(udev_monitor_get_fd(mon), + sna_backlight_uevent, sna); + if (!sna->mode.backlight_handler) + goto free_monitor; - DBG(("%s: level=%d, max=%d\n", __FUNCTION__, - level, sna_output->backlight_max)); + DBG(("%s: installed backlight monitor\n", __FUNCTION__)); + sna->mode.backlight_monitor = mon; - if (!sna_output->backlight_iface) - return; + return; - if ((unsigned)level > sna_output->backlight_max) - level = sna_output->backlight_max; +free_monitor: + udev_monitor_unref(mon); +free_udev: + udev_unref(u); +} - len = snprintf(val, BACKLIGHT_VALUE_LEN, "%d\n", level); - sprintf(path, "%s/%s/brightness", - BACKLIGHT_CLASS, sna_output->backlight_iface); - fd = open(path, O_RDWR); - if (fd == -1) { - xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "failed to open %s for backlight " - "control: %s\n", path, strerror(errno)); +static void sna_backlight_drain_uevents(struct sna *sna) +{ + if (sna->mode.backlight_monitor == NULL) return; - } - - ret = write(fd, val, len); - if (ret == -1) { - xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "write to %s for backlight " - "control failed: %s\n", path, strerror(errno)); - } - close(fd); + sna_backlight_uevent(udev_monitor_get_fd(sna->mode.backlight_monitor), + sna); } -static int -sna_output_backlight_get(xf86OutputPtr output) +static void sna_backlight_close(struct sna *sna) { - struct sna_output *sna_output = output->driver_private; - char path[1024], val[BACKLIGHT_VALUE_LEN]; - int fd, level; + struct udev *u; - sprintf(path, "%s/%s/actual_brightness", - BACKLIGHT_CLASS, sna_output->backlight_iface); - fd = open(path, O_RDONLY); - if (fd == -1) { - xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "failed to open %s " - "for backlight control: %s\n", path, strerror(errno)); - return -1; - } + if (sna->mode.backlight_handler == NULL) + return; - memset(val, 0, sizeof(val)); - if (read(fd, val, BACKLIGHT_VALUE_LEN) == -1) { - close(fd); - return -1; - } + xf86RemoveGeneralHandler(sna->mode.backlight_handler); - close(fd); + u = udev_monitor_get_udev(sna->mode.backlight_monitor); + udev_monitor_unref(sna->mode.backlight_monitor); + udev_unref(u); - level = atoi(val); - DBG(("%s: level=%d (max=%d)\n", - __FUNCTION__, level, sna_output->backlight_max)); - - if (level > sna_output->backlight_max) - level = sna_output->backlight_max; - else if (level < 0) - level = -1; - return level; + sna->mode.backlight_handler = NULL; + sna->mode.backlight_monitor = NULL; } +#else +static void sna_backlight_pre_init(struct sna *sna) { } +static void sna_backlight_drain_uevents(struct sna *sna) { } +static void sna_backlight_close(struct sna *sna) { } +#endif -static int -sna_output_backlight_get_max(xf86OutputPtr output) +static void +sna_output_backlight_set(struct sna_output *sna_output, int level) { - struct sna_output *sna_output = output->driver_private; - char path[1024], val[BACKLIGHT_VALUE_LEN]; - int fd, max = 0; + xf86OutputPtr output = sna_output->base; - sprintf(path, "%s/%s/max_brightness", - BACKLIGHT_CLASS, sna_output->backlight_iface); - fd = open(path, O_RDONLY); - if (fd == -1) { - xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "failed to open %s " - "for backlight control: %s\n", path, strerror(errno)); - return -1; - } + DBG(("%s(%s) level=%d, max=%d\n", __FUNCTION__, + output->name, level, sna_output->backlight.max)); - memset(val, 0, sizeof(val)); - if (read(fd, val, BACKLIGHT_VALUE_LEN) == -1) { - close(fd); - return -1; + if (backlight_set(&sna_output->backlight, level)) { + xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, + "Failed to set backlight %s for output %s to brightness level %d, disabling\n", + sna_output->backlight.iface, output->name, level); + backlight_disable(&sna_output->backlight); + if (output->randr_output) { + RRDeleteOutputProperty(output->randr_output, backlight_atom); + RRDeleteOutputProperty(output->randr_output, backlight_deprecated_atom); + } } - close(fd); - - max = atoi(val); - if (max <= 0) - max = -1; - return max; + /* Consume the uevent notification now so that we don't misconstrue + * the change latter when we wake up and the output is in a different + * state. + */ + sna_backlight_drain_uevents(to_sna(output->scrn)); } -enum { - PLATFORM, - FIRMWARE, - RAW, - NAMED, -}; +static int +sna_output_backlight_get(xf86OutputPtr output) +{ + struct sna_output *sna_output = output->driver_private; + int level = backlight_get(&sna_output->backlight); + DBG(("%s(%s) level=%d, max=%d\n", __FUNCTION__, + output->name, level, sna_output->backlight.max)); + return level; +} static char * has_user_backlight_override(xf86OutputPtr output) { - struct sna_output *sna_output = output->driver_private; struct sna *sna = to_sna(output->scrn); const char *str; - int max; str = xf86GetOptValString(sna->Options, OPTION_BACKLIGHT); if (str == NULL) return NULL; - sna_output->backlight_iface = (char *)str; - max = sna_output_backlight_get_max(output); - sna_output->backlight_iface = NULL; - if (max <= 0) { + DBG(("%s(%s) requested %s\n", __FUNCTION__, output->name, str)); + if (*str == '\0') + return (char *)str; + + if (backlight_exists(str) == BL_NONE) { xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, - "unrecognised backlight control interface '%s'\n", + "Unrecognised backlight control interface '%s'\n", str); return NULL; } @@ -491,220 +630,75 @@ return strdup(str); } -static char * -has_device_backlight(xf86OutputPtr output, int *best_type) +static void +sna_output_backlight_init(xf86OutputPtr output) { struct sna_output *sna_output = output->driver_private; - struct sna *sna = to_sna(output->scrn); struct pci_device *pci; - char path[1024]; - char *best_iface = NULL; - DIR *dir; - struct dirent *de; + MessageType from; + char *best_iface; - pci = xf86GetPciInfoForEntity(sna->pEnt->index); - if (pci == NULL) - return NULL; +#if !USE_BACKLIGHT + return; +#endif - snprintf(path, sizeof(path), - "/sys/bus/pci/devices/%04x:%02x:%02x.%d/backlight", - pci->domain, pci->bus, pci->dev, pci->func); - - DBG(("%s: scanning %s\n", __FUNCTION__, path)); - dir = opendir(path); - if (dir == NULL) - return NULL; + from = X_CONFIG; + best_iface = has_user_backlight_override(output); + if (best_iface) + goto done; - while ((de = readdir(dir))) { - char buf[100]; - int fd, v; - - if (*de->d_name == '.') - continue; - - DBG(("%s: %s\n", __FUNCTION__, de->d_name)); - snprintf(path, sizeof(path), "%s/%s/type", - BACKLIGHT_CLASS, de->d_name); - - v = -1; - fd = open(path, O_RDONLY); - if (fd >= 0) { - v = read(fd, buf, sizeof(buf)-1); - close(fd); - } - if (v > 0) { - while (v > 0 && isspace(buf[v-1])) - v--; - buf[v] = '\0'; - - if (strcmp(buf, "raw") == 0) - v = RAW; - else if (strcmp(buf, "platform") == 0) - v = PLATFORM; - else if (strcmp(buf, "firmware") == 0) - v = FIRMWARE; - else - v = INT_MAX; - } else - v = INT_MAX; + /* XXX detect right backlight for multi-GPU/panels */ + from = X_PROBED; + pci = xf86GetPciInfoForEntity(to_sna(output->scrn)->pEnt->index); + if (pci != NULL) + best_iface = backlight_find_for_device(pci); - if (v < *best_type) { - char *copy; - int max; - - sna_output->backlight_iface = de->d_name; - max = sna_output_backlight_get_max(output); - sna_output->backlight_iface = NULL; - if (max <= 0) - continue; +done: + DBG(("%s(%s) opening backlight %s\n", __FUNCTION__, + output->name, best_iface ?: "none")); + sna_output->backlight_active_level = + backlight_open(&sna_output->backlight, best_iface); + DBG(("%s(%s): initial backlight value %d\n", + __FUNCTION__, output->name, sna_output->backlight_active_level)); + if (sna_output->backlight_active_level < 0) + return; - copy = strdup(de->d_name); - if (copy) { - free(best_iface); - best_iface = copy; - *best_type = v; - } - } + switch (sna_output->backlight.type) { + case BL_FIRMWARE: best_iface = (char *)"firmware"; break; + case BL_PLATFORM: best_iface = (char *)"platform"; break; + case BL_RAW: best_iface = (char *)"raw"; break; + default: best_iface = (char *)"unknown"; break; } - closedir(dir); - - return best_iface; + xf86DrvMsg(output->scrn->scrnIndex, from, + "Found backlight control interface %s (type '%s') for output %s\n", + sna_output->backlight.iface, best_iface, output->name); } -static char * -has_backlight(xf86OutputPtr output, int *best_type) +static char *canonical_kmode_name(const struct drm_mode_modeinfo *kmode) { - static const char *known_interfaces[] = { - "dell_backlight", - "gmux_backlight", - "asus-laptop", - "asus-nb-wmi", - "eeepc", - "thinkpad_screen", - "mbp_backlight", - "fujitsu-laptop", - "sony", - "samsung", - "acpi_video1", - "acpi_video0", - "intel_backlight", - }; - struct sna_output *sna_output = output->driver_private; - char *best_iface = NULL; - DIR *dir; - struct dirent *de; + char tmp[32], *buf; + int len; - dir = opendir(BACKLIGHT_CLASS); - if (dir == NULL) + len = sprintf(tmp, "%dx%d%s", + kmode->hdisplay, kmode->vdisplay, + kmode->flags & V_INTERLACE ? "i" : ""); + if ((unsigned)len >= sizeof(tmp)) return NULL; - while ((de = readdir(dir))) { - char path[1024]; - char buf[100]; - int fd, v; - - if (*de->d_name == '.') - continue; - - snprintf(path, sizeof(path), "%s/%s/type", - BACKLIGHT_CLASS, de->d_name); - - v = -1; - fd = open(path, O_RDONLY); - if (fd >= 0) { - v = read(fd, buf, sizeof(buf)-1); - close(fd); - } - if (v > 0) { - while (v > 0 && isspace(buf[v-1])) - v--; - buf[v] = '\0'; - - if (strcmp(buf, "raw") == 0) - v = RAW; - else if (strcmp(buf, "platform") == 0) - v = PLATFORM; - else if (strcmp(buf, "firmware") == 0) - v = FIRMWARE; - else - v = NAMED; - } else - v = NAMED; - - /* Fallback to priority list of known iface for old kernels */ - if (v == NAMED) { - int i; - for (i = 0; i < ARRAY_SIZE(known_interfaces); i++) { - if (strcmp(de->d_name, known_interfaces[i]) == 0) - break; - } - v += i; - } - - if (v < *best_type) { - char *copy; - int max; - - /* XXX detect right backlight for multi-GPU/panels */ - - sna_output->backlight_iface = de->d_name; - max = sna_output_backlight_get_max(output); - sna_output->backlight_iface = NULL; - if (max <= 0) - continue; - - copy = strdup(de->d_name); - if (copy) { - free(best_iface); - best_iface = copy; - *best_type = v; - } - } - } - closedir(dir); + buf = malloc(len + 1); + if (buf == NULL) + return NULL; - return best_iface; + return memcpy(buf, tmp, len + 1); } -static void -sna_output_backlight_init(xf86OutputPtr output) +static char *get_kmode_name(const struct drm_mode_modeinfo *kmode) { - struct sna_output *sna_output = output->driver_private; - MessageType from = X_PROBED; - char *best_iface; - int best_type; + if (*kmode->name == '\0') + return canonical_kmode_name(kmode); - best_type = INT_MAX; - best_iface = has_user_backlight_override(output); - if (best_iface) - goto done; - - best_iface = has_device_backlight(output, &best_type); - if (best_iface) - goto done; - - best_iface = has_backlight(output, &best_type); - if (best_iface) - goto done; - - return; - -done: - sna_output->backlight_iface = best_iface; - sna_output->backlight_max = sna_output_backlight_get_max(output); - sna_output->backlight_active_level = sna_output_backlight_get(output); - switch (best_type) { - case INT_MAX: best_iface = (char *)"user"; from = X_CONFIG; break; - case FIRMWARE: best_iface = (char *)"firmware"; break; - case PLATFORM: best_iface = (char *)"platform"; break; - case RAW: best_iface = (char *)"raw"; break; - default: best_iface = (char *)"unknown"; break; - } - xf86DrvMsg(output->scrn->scrnIndex, from, - "found backlight control interface %s (type '%s')\n", - sna_output->backlight_iface, best_iface); + return strdup(kmode->name); } -#endif static DisplayModePtr mode_from_kmode(ScrnInfoPtr scrn, @@ -734,7 +728,7 @@ mode->VScan = kmode->vscan; mode->Flags = kmode->flags; - mode->name = strdup(kmode->name); + mode->name = get_kmode_name(kmode); if (kmode->type & DRM_MODE_TYPE_DRIVER) mode->type = M_T_DRIVER; @@ -778,6 +772,7 @@ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn); int i; + assert(to_sna_crtc(crtc)); DBG(("%s(pipe=%d), currently? %d\n", __FUNCTION__, to_sna_crtc(crtc)->pipe, to_sna_crtc(crtc)->dpms_mode)); @@ -809,6 +804,7 @@ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn); int i; + assert(to_sna_crtc(crtc)); DBG(("%s(pipe=%d), currently? %d\n", __FUNCTION__, to_sna_crtc(crtc)->pipe, to_sna_crtc(crtc)->dpms_mode)); @@ -831,6 +827,93 @@ to_sna_crtc(crtc)->dpms_mode = DPMSModeOff; } +static unsigned +rotation_reduce(struct plane *p, unsigned rotation) +{ + unsigned unsupported_rotations = rotation & ~p->rotation.supported; + + if (unsupported_rotations == 0) + return rotation; + +#define RR_Reflect_XY (RR_Reflect_X | RR_Reflect_Y) + + if ((unsupported_rotations & RR_Reflect_XY) == RR_Reflect_XY && + p->rotation.supported& RR_Rotate_180) { + rotation &= ~RR_Reflect_XY; + rotation ^= RR_Rotate_180; + } + + if ((unsupported_rotations & RR_Rotate_180) && + (p->rotation.supported& RR_Reflect_XY) == RR_Reflect_XY) { + rotation ^= RR_Reflect_XY; + rotation &= ~RR_Rotate_180; + } + +#undef RR_Reflect_XY + + return rotation; +} + +static bool +rotation_set(struct sna *sna, struct plane *p, uint32_t desired) +{ +#define LOCAL_IOCTL_MODE_OBJ_SETPROPERTY DRM_IOWR(0xbA, struct local_mode_obj_set_property) + struct local_mode_obj_set_property { + uint64_t value; + uint32_t prop_id; + uint32_t obj_id; + uint32_t obj_type; + uint32_t pad; + } prop; + + if (desired == p->rotation.current) + return true; + + if ((desired & p->rotation.supported) == 0) { + errno = EINVAL; + return false; + } + + DBG(("%s: obj=%d, type=%x prop=%d set-rotation=%x\n", + __FUNCTION__, p->id, LOCAL_MODE_OBJECT_PLANE, p->rotation.prop, desired)); + + assert(p->id); + assert(p->rotation.prop); + + prop.obj_id = p->id; + prop.obj_type = LOCAL_MODE_OBJECT_PLANE; + prop.prop_id = p->rotation.prop; + prop.value = desired; + + if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_OBJ_SETPROPERTY, &prop)) + return false; + + p->rotation.current = desired; + return true; +} + +static void +rotation_reset(struct plane *p) +{ + if (p->rotation.prop == 0) + return; + + p->rotation.current = 0; +} + +bool sna_crtc_set_sprite_rotation(xf86CrtcPtr crtc, uint32_t rotation) +{ + assert(to_sna_crtc(crtc)); + DBG(("%s: CRTC:%d [pipe=%d], sprite=%u set-rotation=%x\n", + __FUNCTION__, + to_sna_crtc(crtc)->id, to_sna_crtc(crtc)->pipe, to_sna_crtc(crtc)->sprite.id, + rotation)); + + return rotation_set(to_sna(crtc->scrn), + &to_sna_crtc(crtc)->sprite, + rotation_reduce(&to_sna_crtc(crtc)->sprite, rotation)); +} + static bool sna_crtc_apply(xf86CrtcPtr crtc) { @@ -842,38 +925,61 @@ int output_count = 0; int i; - DBG(("%s\n", __FUNCTION__)); + DBG(("%s CRTC:%d [pipe=%d], handle=%d\n", __FUNCTION__, sna_crtc->id, sna_crtc->pipe, sna_crtc->bo->handle)); - assert(config->num_output < ARRAY_SIZE(output_ids)); + assert(sna->mode.num_real_output < ARRAY_SIZE(output_ids)); + sna_crtc_disable_cursor(sna, sna_crtc); - for (i = 0; i < config->num_output; i++) { + if (!rotation_set(sna, &sna_crtc->primary, sna_crtc->rotation)) { + ERR(("%s: set-primary-rotation failed (rotation-id=%d, rotation=%d) on CRTC:%d [pipe=%d], errno=%d\n", + __FUNCTION__, sna_crtc->primary.rotation.prop, sna_crtc->rotation, sna_crtc->id, sna_crtc->pipe, errno)); + sna_crtc->primary.rotation.supported &= ~sna_crtc->rotation; + return false; + } + DBG(("%s: CRTC:%d [pipe=%d] primary rotation set to %x\n", + __FUNCTION__, sna_crtc->id, sna_crtc->pipe, sna_crtc->rotation)); + + for (i = 0; i < sna->mode.num_real_output; i++) { xf86OutputPtr output = config->output[i]; + /* Make sure we mark the output as off (and save the backlight) + * before the kernel turns it off due to changing the pipe. + * This is necessary as the kernel may turn off the backlight + * and we lose track of the user settings. + */ + if (output->crtc == NULL) + output->funcs->dpms(output, DPMSModeOff); + if (output->crtc != crtc) continue; - assert(output->possible_crtcs & (1 << sna_crtc->pipe) || - xf86IsEntityShared(crtc->scrn->entityList[0])); - DBG(("%s: attaching output '%s' %d [%d] to crtc:%d (pipe %d) (possible crtc:%x, possible clones:%x)\n", __FUNCTION__, output->name, i, to_connector_id(output), sna_crtc->id, sna_crtc->pipe, (uint32_t)output->possible_crtcs, (uint32_t)output->possible_clones)); + + assert(output->possible_crtcs & (1 << sna_crtc->pipe) || + xf86IsEntityShared(crtc->scrn->entityList[0])); + output_ids[output_count] = to_connector_id(output); - if (++output_count == ARRAY_SIZE(output_ids)) + if (++output_count == ARRAY_SIZE(output_ids)) { + errno = EINVAL; return false; + } } VG_CLEAR(arg); arg.crtc_id = sna_crtc->id; arg.fb_id = fb_id(sna_crtc->bo); - if (sna_crtc->transform) { + if (sna_crtc->transform || sna_crtc->slave_pixmap) { arg.x = 0; arg.y = 0; + sna_crtc->offset = 0; } else { arg.x = crtc->x; arg.y = crtc->y; + sna_crtc->offset = arg.y << 16 | arg.x; } arg.set_connectors_ptr = (uintptr_t)output_ids; arg.count_connectors = output_count; @@ -894,48 +1000,101 @@ if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETCRTC, &arg)) return false; + sna_crtc->mode_serial++; sna_crtc_force_outputs_on(crtc); return true; } -struct wait_for_shadow { - RegionRec region; - struct kgem_bo *bo; -}; +static bool overlap(const BoxRec *a, const BoxRec *b) +{ + if (a->x1 >= b->x2) + return false; + if (a->x2 <= b->x1) + return false; + + if (a->y1 >= b->y2) + return false; + if (a->y2 <= b->y1) + return false; -static bool wait_for_shadow(struct sna *sna, struct sna_pixmap *priv, unsigned flags) + return true; +} + +static bool wait_for_shadow(struct sna *sna, + struct sna_pixmap *priv, + unsigned flags) { - struct wait_for_shadow *wait = priv->move_to_gpu_data; - struct kgem_bo *bo = wait->bo; PixmapPtr pixmap = priv->pixmap; DamagePtr damage; + struct kgem_bo *bo, *tmp; bool ret = true; - DBG(("%s: flags=%x, shadow_flip=%d, handle=%d, wait=%d, old=%d\n", - __FUNCTION__, flags, sna->mode.shadow_flip, - priv->gpu_bo->handle, wait->bo->handle, sna->mode.shadow->handle)); + DBG(("%s: flags=%x, flips=%d, handle=%d, shadow=%d\n", + __FUNCTION__, flags, sna->mode.flip_active, + priv->gpu_bo->handle, sna->mode.shadow->handle)); - assert(wait->bo != priv->gpu_bo); + assert(priv->move_to_gpu_data == sna); + assert(sna->mode.shadow != priv->gpu_bo); if (flags == 0 || pixmap != sna->front || !sna->mode.shadow_damage) goto done; - if ((flags & MOVE_WRITE) == 0) - return true; + if ((flags & MOVE_WRITE) == 0) { + if ((flags & __MOVE_SCANOUT) == 0) { + while (!list_is_empty(&sna->mode.shadow_crtc)) { + struct sna_crtc *crtc = + list_first_entry(&sna->mode.shadow_crtc, + struct sna_crtc, + shadow_link); + if (overlap(&sna->mode.shadow_region.extents, + &crtc->base->bounds)) { + DrawableRec draw; + + draw.width = crtc->base->mode.HDisplay; + draw.height = crtc->base->mode.VDisplay; + draw.depth = sna->front->drawable.depth; + draw.bitsPerPixel = sna->front->drawable.bitsPerPixel; + + DBG(("%s: copying replaced CRTC: (%d, %d), (%d, %d), handle=%d\n", + __FUNCTION__, + crtc->base->bounds.x1, + crtc->base->bounds.y1, + crtc->base->bounds.x2, + crtc->base->bounds.y2, + crtc->shadow_bo->handle)); + + ret &= sna->render.copy_boxes(sna, GXcopy, + &draw, crtc->shadow_bo, -crtc->base->bounds.x1, -crtc->base->bounds.y1, + &pixmap->drawable, priv->gpu_bo, 0, 0, + &crtc->base->bounds, 1, + 0); + } - assert(sna->mode.shadow_active); - assert(bo == sna->mode.shadow); + kgem_bo_destroy(&sna->kgem, crtc->shadow_bo); + crtc->shadow_bo = NULL; + list_del(&crtc->shadow_link); + } + } - assert(priv->gpu_bo->refcnt >= 1); - sna->mode.shadow = priv->gpu_bo; + return ret; + } + + assert(sna->mode.shadow_active); damage = sna->mode.shadow_damage; sna->mode.shadow_damage = NULL; - while (sna->mode.shadow_flip && sna_mode_has_pending_events(sna)) - sna_mode_wakeup(sna); + if (sna->mode.flip_active) { + /* raw cmd to avoid setting wedged in the middle of an op */ + drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_THROTTLE, 0); + sna->kgem.need_throttle = false; - if (sna->mode.shadow_flip) { + while (sna->mode.flip_active && sna_mode_has_pending_events(sna)) + sna_mode_wakeup(sna); + } + + bo = sna->mode.shadow; + if (sna->mode.flip_active) { bo = kgem_create_2d(&sna->kgem, pixmap->drawable.width, pixmap->drawable.height, @@ -943,38 +1102,101 @@ priv->gpu_bo->tiling, CREATE_EXACT | CREATE_SCANOUT); if (bo != NULL) { - DBG(("%s: replacing still-attached GPU bo\n", - __FUNCTION__)); + DBG(("%s: replacing still-attached GPU bo handle=%d, flips=%d\n", + __FUNCTION__, priv->gpu_bo->tiling, sna->mode.flip_active)); - kgem_bo_destroy(&sna->kgem, wait->bo); - RegionUninit(&wait->region); - - wait->region.extents.x1 = 0; - wait->region.extents.y1 = 0; - wait->region.extents.x2 = pixmap->drawable.width; - wait->region.extents.y2 = pixmap->drawable.height; - wait->region.data = NULL; + RegionUninit(&sna->mode.shadow_region); + sna->mode.shadow_region.extents.x1 = 0; + sna->mode.shadow_region.extents.y1 = 0; + sna->mode.shadow_region.extents.x2 = pixmap->drawable.width; + sna->mode.shadow_region.extents.y2 = pixmap->drawable.height; + sna->mode.shadow_region.data = NULL; } else { - while (sna->mode.shadow_flip && + while (sna->mode.flip_active && sna_mode_wait_for_event(sna)) sna_mode_wakeup(sna); - bo = wait->bo; + bo = sna->mode.shadow; } } + if (bo->refcnt > 1) { + bo = kgem_create_2d(&sna->kgem, + pixmap->drawable.width, + pixmap->drawable.height, + pixmap->drawable.bitsPerPixel, + priv->gpu_bo->tiling, + CREATE_EXACT | CREATE_SCANOUT); + if (bo != NULL) { + DBG(("%s: replacing exported GPU bo\n", + __FUNCTION__)); + + RegionUninit(&sna->mode.shadow_region); + sna->mode.shadow_region.extents.x1 = 0; + sna->mode.shadow_region.extents.y1 = 0; + sna->mode.shadow_region.extents.x2 = pixmap->drawable.width; + sna->mode.shadow_region.extents.y2 = pixmap->drawable.height; + sna->mode.shadow_region.data = NULL; + } else + bo = sna->mode.shadow; + } + sna->mode.shadow_damage = damage; - if (flags & MOVE_READ) { - DBG(("%s: copying existing GPU damage: %ldx(%d, %d), (%d, %d)\n", - __FUNCTION__, (long)REGION_NUM_RECTS(&wait->region), - wait->region.extents.x1, wait->region.extents.y1, - wait->region.extents.x2, wait->region.extents.y2)); + RegionSubtract(&sna->mode.shadow_region, + &sna->mode.shadow_region, + &sna->mode.shadow_cancel); + + while (!list_is_empty(&sna->mode.shadow_crtc)) { + struct sna_crtc *crtc = + list_first_entry(&sna->mode.shadow_crtc, struct sna_crtc, shadow_link); + if (overlap(&crtc->base->bounds, + &sna->mode.shadow_region.extents)) { + RegionRec region; + DrawableRec draw; + + draw.width = crtc->base->mode.HDisplay; + draw.height = crtc->base->mode.VDisplay; + draw.depth = sna->front->drawable.depth; + draw.bitsPerPixel = sna->front->drawable.bitsPerPixel; + + DBG(("%s: copying replaced CRTC: (%d, %d), (%d, %d), handle=%d\n", + __FUNCTION__, + crtc->base->bounds.x1, + crtc->base->bounds.y1, + crtc->base->bounds.x2, + crtc->base->bounds.y2, + crtc->shadow_bo->handle)); + + ret = sna->render.copy_boxes(sna, GXcopy, + &draw, crtc->shadow_bo, -crtc->base->bounds.x1, -crtc->base->bounds.y1, + &pixmap->drawable, bo, 0, 0, + &crtc->base->bounds, 1, + 0); + + + region.extents = crtc->base->bounds; + region.data = NULL; + RegionSubtract(&sna->mode.shadow_region, &sna->mode.shadow_region, ®ion); + } + + kgem_bo_destroy(&sna->kgem, crtc->shadow_bo); + crtc->shadow_bo = NULL; + list_del(&crtc->shadow_link); + } + + if (RegionNotEmpty(&sna->mode.shadow_region)) { + DBG(("%s: copying existing GPU damage: %dx(%d, %d), (%d, %d)\n", + __FUNCTION__, region_num_rects(&sna->mode.shadow_region), + sna->mode.shadow_region.extents.x1, + sna->mode.shadow_region.extents.y1, + sna->mode.shadow_region.extents.x2, + sna->mode.shadow_region.extents.y2)); ret = sna->render.copy_boxes(sna, GXcopy, - pixmap, priv->gpu_bo, 0, 0, - pixmap, bo, 0, 0, - REGION_RECTS(&wait->region), - REGION_NUM_RECTS(&wait->region), + &pixmap->drawable, priv->gpu_bo, 0, 0, + &pixmap->drawable, bo, 0, 0, + region_rects(&sna->mode.shadow_region), + region_num_rects(&sna->mode.shadow_region), 0); } @@ -982,14 +1204,20 @@ sna_pixmap_undo_cow(sna, priv, 0); sna_pixmap_unmap(pixmap, priv); + + DBG(("%s: setting front pixmap to handle=%d\n", __FUNCTION__, bo->handle)); + tmp = priv->gpu_bo; priv->gpu_bo = bo; + if (bo != sna->mode.shadow) + kgem_bo_destroy(&sna->kgem, sna->mode.shadow); + sna->mode.shadow = tmp; - sna_dri_pixmap_update_bo(sna, pixmap); + sna_dri2_pixmap_update_bo(sna, pixmap, bo); done: - kgem_bo_destroy(&sna->kgem, wait->bo); - RegionUninit(&wait->region); - free(wait); + RegionEmpty(&sna->mode.shadow_cancel); + RegionEmpty(&sna->mode.shadow_region); + sna->mode.shadow_dirty = false; priv->move_to_gpu_data = NULL; priv->move_to_gpu = NULL; @@ -997,6 +1225,50 @@ return ret; } +bool sna_pixmap_discard_shadow_damage(struct sna_pixmap *priv, + const RegionRec *region) +{ + struct sna *sna; + + if (priv->move_to_gpu != wait_for_shadow) + return false; + + sna = priv->move_to_gpu_data; + if (region) { + DBG(("%s: discarding region %dx[(%d, %d), (%d, %d)] from damage %dx[(%d, %d], (%d, %d)]\n", + __FUNCTION__, + region_num_rects(region), + region->extents.x1, region->extents.y1, + region->extents.x2, region->extents.y2, + region_num_rects(&sna->mode.shadow_region), + sna->mode.shadow_region.extents.x1, sna->mode.shadow_region.extents.y1, + sna->mode.shadow_region.extents.x2, sna->mode.shadow_region.extents.y2)); + + RegionSubtract(&sna->mode.shadow_region, + &sna->mode.shadow_region, + (RegionPtr)region); + RegionUnion(&sna->mode.shadow_cancel, + &sna->mode.shadow_cancel, + (RegionPtr)region); + } else { + DBG(("%s: discarding all damage %dx[(%d, %d], (%d, %d)]\n", + __FUNCTION__, + region_num_rects(&sna->mode.shadow_region), + sna->mode.shadow_region.extents.x1, sna->mode.shadow_region.extents.y1, + sna->mode.shadow_region.extents.x2, sna->mode.shadow_region.extents.y2)); + RegionEmpty(&sna->mode.shadow_region); + + RegionUninit(&sna->mode.shadow_cancel); + sna->mode.shadow_cancel.extents.x1 = 0; + sna->mode.shadow_cancel.extents.y1 = 0; + sna->mode.shadow_cancel.extents.x2 = sna->front->drawable.width; + sna->mode.shadow_cancel.extents.y2 = sna->front->drawable.height; + sna->mode.shadow_cancel.data = NULL; + } + + return RegionNil(&sna->mode.shadow_region); +} + static bool sna_mode_enable_shadow(struct sna *sna) { ScreenPtr screen = sna->scrn->pScreen; @@ -1039,6 +1311,28 @@ } assert(sna->mode.shadow_active == 0); + sna->mode.shadow_dirty = false; +} + +static void sna_crtc_slave_damage(DamagePtr damage, RegionPtr region, void *closure) +{ + struct sna_crtc *crtc = closure; + struct sna *sna = to_sna(crtc->base->scrn); + RegionPtr scr; + + DBG(("%s: pushing damage [(%d, %d), (%d, %d) x %d] to CRTC [pipe=%d] (%d, %d)\n", + __FUNCTION__, + region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2, + region_num_rects(region), + crtc->pipe, crtc->base->x, crtc->base->y)); + + assert(crtc->slave_damage == damage); + assert(sna->mode.shadow_damage); + + RegionTranslate(region, crtc->base->x, crtc->base->y); + scr = DamageRegion(sna->mode.shadow_damage); + RegionUnion(scr, scr, region); + RegionTranslate(region, -crtc->base->x, -crtc->base->y); } static bool sna_crtc_enable_shadow(struct sna *sna, struct sna_crtc *crtc) @@ -1057,6 +1351,21 @@ assert(sna->mode.shadow == NULL); } + if (crtc->slave_pixmap) { + assert(crtc->slave_damage == NULL); + + crtc->slave_damage = DamageCreate(sna_crtc_slave_damage, NULL, + DamageReportRawRegion, TRUE, + sna->scrn->pScreen, crtc); + if (crtc->slave_damage == NULL) { + if (!--sna->mode.shadow_active) + sna_mode_disable_shadow(sna); + return false; + } + + DamageRegister(&crtc->slave_pixmap->drawable, crtc->slave_damage); + } + crtc->shadow = true; sna->mode.shadow_active++; return true; @@ -1071,14 +1380,35 @@ DBG(("%s: disabling for crtc %d\n", __FUNCTION__, crtc->id)); assert(sna->mode.shadow_active > 0); - if (!--sna->mode.shadow_active) - sna_mode_disable_shadow(sna); + if (crtc->slave_damage) { + assert(crtc->slave_pixmap); + DamageUnregister(&crtc->slave_pixmap->drawable, crtc->slave_damage); + DamageDestroy(crtc->slave_damage); + crtc->slave_damage = NULL; + } if (crtc->shadow_bo) { + if (!crtc->transform) { + DrawableRec tmp; + + tmp.width = crtc->base->mode.HDisplay; + tmp.height = crtc->base->mode.VDisplay; + tmp.depth = sna->front->drawable.depth; + tmp.bitsPerPixel = sna->front->drawable.bitsPerPixel; + + sna->render.copy_boxes(sna, GXcopy, + &tmp, crtc->shadow_bo, -crtc->base->bounds.x1, -crtc->base->bounds.y1, + &sna->front->drawable, __sna_pixmap_get_bo(sna->front), 0, 0, + &crtc->base->bounds, 1, 0); + list_del(&crtc->shadow_link); + } kgem_bo_destroy(&sna->kgem, crtc->shadow_bo); crtc->shadow_bo = NULL; } + if (!--sna->mode.shadow_active) + sna_mode_disable_shadow(sna); + crtc->shadow = false; } @@ -1101,12 +1431,28 @@ arg.crtc_id = sna_crtc->id; (void)drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETCRTC, &arg); + sna_crtc->mode_serial++; + + sna_crtc_disable_cursor(sna, sna_crtc); + rotation_set(sna, &sna_crtc->primary, RR_Rotate_0); sna_crtc_disable_shadow(sna, sna_crtc); if (sna_crtc->bo) { + assert(sna_crtc->bo->active_scanout); + assert(sna_crtc->bo->refcnt >= sna_crtc->bo->active_scanout); + sna_crtc->bo->active_scanout--; kgem_bo_destroy(&sna->kgem, sna_crtc->bo); sna_crtc->bo = NULL; + + assert(sna->mode.front_active); + sna->mode.front_active--; + sna->mode.dirty = true; } + + sna_crtc->transform = false; + + assert(sna_crtc->dpms_mode == DPMSModeOff); + assert(!sna_crtc->shadow); } static void update_flush_interval(struct sna *sna) @@ -1114,15 +1460,15 @@ xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); int i, max_vrefresh = 0; - for (i = 0; i < config->num_crtc; i++) { + for (i = 0; i < sna->mode.num_real_crtc; i++) { xf86CrtcPtr crtc = config->crtc[i]; - if (to_sna_crtc(crtc) == NULL) - continue; + assert(to_sna_crtc(crtc) != NULL); if (!crtc->enabled) { DBG(("%s: CRTC:%d (pipe %d) disabled\n", __FUNCTION__,i, to_sna_crtc(crtc)->pipe)); + assert(to_sna_crtc(crtc)->bo == NULL); continue; } @@ -1138,9 +1484,10 @@ max_vrefresh = max(max_vrefresh, xf86ModeVRefresh(&crtc->mode)); } - if (max_vrefresh == 0) + if (max_vrefresh == 0) { + assert(sna->mode.front_active == 0); sna->vblank_interval = 0; - else + } else sna->vblank_interval = 1000 / max_vrefresh; /* Hz -> ms */ DBG(("max_vrefresh=%d, vblank_interval=%d ms\n", @@ -1200,12 +1547,11 @@ /* Scan the connectors for a framebuffer and assume that is the fbcon */ VG_CLEAR(fbcon); fbcon.fb_id = 0; - for (i = 0; i < config->num_crtc; i++) { + for (i = 0; i < sna->mode.num_real_crtc; i++) { struct sna_crtc *crtc = to_sna_crtc(config->crtc[i]); struct drm_mode_crtc mode; - if (!crtc) - continue; + assert(crtc != NULL); VG_CLEAR(mode); mode.crtc_id = crtc->id; @@ -1226,7 +1572,7 @@ return; } - if (fbcon.fb_id == priv->gpu_bo->delta) { + if (fbcon.fb_id == fb_id(priv->gpu_bo)) { DBG(("%s: fb already installed as scanout\n", __FUNCTION__)); return; } @@ -1263,8 +1609,8 @@ dy = (sna->front->drawable.height - box.y2) / 2; ok = sna->render.copy_boxes(sna, GXcopy, - &scratch, bo, sx, sy, - sna->front, priv->gpu_bo, dx, dy, + &scratch.drawable, bo, sx, sy, + &sna->front->drawable, priv->gpu_bo, dx, dy, &box, 1, 0); if (!DAMAGE_IS_ALL(priv->gpu_damage)) sna_damage_add_box(&priv->gpu_damage, &box); @@ -1297,17 +1643,21 @@ return true; } - if (sna->scrn->virtualX > sna->mode.kmode->max_width || - sna->scrn->virtualY > sna->mode.kmode->max_height) { + if (sna->flags & SNA_TEAR_FREE && to_sna_crtc(crtc)->slave_pixmap) { + DBG(("%s: tear-free shadow required\n", __FUNCTION__)); + return true; + } + + if (sna->scrn->virtualX > sna->mode.max_crtc_width || + sna->scrn->virtualY > sna->mode.max_crtc_height) { DBG(("%s: framebuffer too large (%dx%d) > (%dx%d)\n", __FUNCTION__, sna->scrn->virtualX, sna->scrn->virtualY, - sna->mode.kmode->max_width, - sna->mode.kmode->max_height)); + sna->mode.max_crtc_width, sna->mode.max_crtc_height)); return true; } - priv = sna_pixmap_force_to_gpu(sna->front, MOVE_READ | MOVE_WRITE); + priv = sna_pixmap_force_to_gpu(sna->front, MOVE_READ); if (priv == NULL) return true; /* maybe we can create a bo for the scanout? */ @@ -1324,6 +1674,9 @@ if (priv->gpu_bo->pitch > pitch_limit) return true; + if (priv->gpu_bo->tiling && sna->flags & SNA_LINEAR_FB) + return true; + transform = NULL; if (crtc->transformPresent) transform = &crtc->transform; @@ -1333,8 +1686,20 @@ &crtc_to_fb, &f_crtc_to_fb, &f_fb_to_crtc)) { - DBG(("%s: RandR transform present\n", __FUNCTION__)); - return true; + bool needs_transform = true; + unsigned rotation = rotation_reduce(&to_sna_crtc(crtc)->primary, crtc->rotation); + DBG(("%s: natively supported rotation? rotation=%x & supported=%x == %d\n", + __FUNCTION__, crtc->rotation, to_sna_crtc(crtc)->primary.rotation.supported, + !!(crtc->rotation & to_sna_crtc(crtc)->primary.rotation.supported))); + if (to_sna_crtc(crtc)->primary.rotation.supported & rotation) + needs_transform = RRTransformCompute(crtc->x, crtc->y, + crtc->mode.HDisplay, crtc->mode.VDisplay, + RR_Rotate_0, transform, + NULL, NULL, NULL); + if (needs_transform) { + DBG(("%s: RandR transform present\n", __FUNCTION__)); + return true; + } } /* And finally check that it is entirely visible */ @@ -1357,6 +1722,30 @@ return false; } +static void set_shadow(struct sna *sna, RegionPtr region) +{ + struct sna_pixmap *priv = sna_pixmap(sna->front); + + assert(priv->gpu_bo); + assert(sna->mode.shadow); + + DBG(("%s: waiting for region %dx[(%d, %d), (%d, %d)], front handle=%d, shadow handle=%d\n", + __FUNCTION__, + region_num_rects(region), + region->extents.x1, region->extents.y1, + region->extents.x2, region->extents.y2, + priv->gpu_bo->handle, sna->mode.shadow->handle)); + + assert(priv->pinned & PIN_SCANOUT); + assert((priv->pinned & PIN_PRIME) == 0); + assert(sna->mode.shadow != priv->gpu_bo); + + RegionCopy(&sna->mode.shadow_region, region); + + priv->move_to_gpu = wait_for_shadow; + priv->move_to_gpu_data = sna; +} + static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc) { struct sna_crtc *sna_crtc = to_sna_crtc(crtc); @@ -1365,21 +1754,9 @@ struct kgem_bo *bo; sna_crtc->transform = false; - if (sna_crtc->scanout_pixmap) { - DBG(("%s: attaching to scanout pixmap\n", __FUNCTION__)); - - bo = sna_pixmap_pin(sna_crtc->scanout_pixmap, PIN_SCANOUT); - if (bo == NULL) - return NULL; - - if (!get_fb(sna, bo, - sna_crtc->scanout_pixmap->drawable.width, - sna_crtc->scanout_pixmap->drawable.height)) - return NULL; + sna_crtc->rotation = RR_Rotate_0; - sna_crtc->transform = true; - return kgem_bo_reference(bo); - } else if (use_shadow(sna, crtc)) { + if (use_shadow(sna, crtc)) { unsigned long tiled_limit; int tiling; @@ -1400,6 +1777,8 @@ tiled_limit = 8 * 1024 * 8; if ((unsigned long)crtc->mode.HDisplay * scrn->bitsPerPixel > tiled_limit) tiling = I915_TILING_NONE; + if (sna->flags & SNA_LINEAR_FB) + tiling = I915_TILING_NONE; bo = kgem_create_2d(&sna->kgem, crtc->mode.HDisplay, crtc->mode.VDisplay, @@ -1415,59 +1794,70 @@ sna_crtc->transform = true; return bo; - } else if (sna->flags & SNA_TEAR_FREE) { - DBG(("%s: tear-free updates requested\n", __FUNCTION__)); - - if (!sna_crtc_enable_shadow(sna, sna_crtc)) - return NULL; - - DBG(("%s: attaching to single shadow pixmap\n", __FUNCTION__)); - if (sna->mode.shadow == NULL) { - BoxRec box; - - bo = kgem_create_2d(&sna->kgem, - sna->scrn->virtualX, - sna->scrn->virtualY, - scrn->bitsPerPixel, - I915_TILING_X, - CREATE_SCANOUT); + } else { + if (sna_crtc->slave_pixmap) { + DBG(("%s: attaching to scanout pixmap\n", __FUNCTION__)); + bo = sna_pixmap_pin(sna_crtc->slave_pixmap, PIN_SCANOUT); if (bo == NULL) return NULL; - box.x1 = box.y1 = 0; - box.x2 = sna->scrn->virtualX; - box.y2 = sna->scrn->virtualY; - - if (!sna->render.copy_boxes(sna, GXcopy, - sna->front, sna_pixmap(sna->front)->gpu_bo, 0, 0, - sna->front, bo, 0, 0, - &box, 1, COPY_LAST)) { - kgem_bo_destroy(&sna->kgem, bo); - return NULL; - } - if (!get_fb(sna, bo, - sna->scrn->virtualX, - sna->scrn->virtualY)) { - kgem_bo_destroy(&sna->kgem, bo); + sna_crtc->slave_pixmap->drawable.width, + sna_crtc->slave_pixmap->drawable.height)) + return NULL; + } else { + DBG(("%s: attaching to framebuffer\n", __FUNCTION__)); + bo = sna_pixmap_pin(sna->front, PIN_SCANOUT); + if (bo == NULL) return NULL; - } - sna->mode.shadow = bo; + if (!get_fb(sna, bo, scrn->virtualX, scrn->virtualY)) + return NULL; } - return kgem_bo_reference(sna->mode.shadow); - } else { - DBG(("%s: attaching to framebuffer\n", __FUNCTION__)); - sna_crtc_disable_shadow(sna, sna_crtc); - bo = sna_pixmap_pin(sna->front, PIN_SCANOUT); - if (bo == NULL) - return NULL; + if (sna->flags & SNA_TEAR_FREE) { + assert(sna_crtc->slave_pixmap == NULL); - if (!get_fb(sna, bo, scrn->virtualX, scrn->virtualY)) - return NULL; + DBG(("%s: enabling TearFree shadow\n", __FUNCTION__)); + if (!sna_crtc_enable_shadow(sna, sna_crtc)) + return NULL; + + if (sna->mode.shadow == NULL) { + RegionRec region; + struct kgem_bo *shadow; + + DBG(("%s: creating TearFree shadow bo\n", __FUNCTION__)); + + region.extents.x1 = 0; + region.extents.y1 = 0; + region.extents.x2 = sna->scrn->virtualX; + region.extents.y2 = sna->scrn->virtualY; + region.data = NULL; + + shadow = kgem_create_2d(&sna->kgem, + region.extents.x2, + region.extents.y2, + scrn->bitsPerPixel, + I915_TILING_X, + CREATE_SCANOUT); + if (shadow == NULL) + return NULL; + + if (!get_fb(sna, shadow, + region.extents.x2, + region.extents.y2)) { + kgem_bo_destroy(&sna->kgem, shadow); + return NULL; + } + + sna->mode.shadow = shadow; + set_shadow(sna, ®ion); + } + } else + sna_crtc_disable_shadow(sna, sna_crtc); - assert(!sna_crtc->shadow); + sna_crtc->rotation = rotation_reduce(&sna_crtc->primary, crtc->rotation); + assert(sna_crtc->primary.rotation.supported & sna_crtc->rotation); return kgem_bo_reference(bo); } } @@ -1481,17 +1871,19 @@ xFixed *params; int nparams; RRTransformPtr transform; + int needs_transform; transform = NULL; if (crtc->transformPresent) transform = &crtc->transform; - RRTransformCompute(crtc->x, crtc->y, - crtc->mode.HDisplay, crtc->mode.VDisplay, - crtc->rotation, transform, - &crtc_to_fb, - &f_crtc_to_fb, - &f_fb_to_crtc); + needs_transform = + RRTransformCompute(crtc->x, crtc->y, + crtc->mode.HDisplay, crtc->mode.VDisplay, + crtc->rotation, transform, + &crtc_to_fb, + &f_crtc_to_fb, + &f_fb_to_crtc); filter = NULL; params = NULL; @@ -1511,9 +1903,9 @@ filter = transform->filter; } #endif - crtc->transform_in_use = TRUE; + crtc->transform_in_use = needs_transform; } else - crtc->transform_in_use = FALSE; + crtc->transform_in_use = sna_crtc->rotation != RR_Rotate_0; crtc->crtc_to_framebuffer = crtc_to_fb; crtc->f_crtc_to_framebuffer = f_crtc_to_fb; @@ -1571,14 +1963,21 @@ assert(sna->mode.shadow_damage && sna->mode.shadow_active); damage = DamageRegion(sna->mode.shadow_damage); RegionUnion(damage, damage, ®ion); + + DBG(("%s: damage now %dx[(%d, %d), (%d, %d)]\n", + __FUNCTION__, + region_num_rects(damage), + damage->extents.x1, damage->extents.y1, + damage->extents.x2, damage->extents.y2)); } static char *outputs_for_crtc(xf86CrtcPtr crtc, char *outputs, int max) { + struct sna *sna = to_sna(crtc->scrn); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn); int len, i; - for (i = len = 0; i < config->num_output; i++) { + for (i = len = 0; i < sna->mode.num_real_output; i++) { xf86OutputPtr output = config->output[i]; if (output->crtc != crtc) @@ -1624,20 +2023,23 @@ struct sna_crtc *sna_crtc = to_sna_crtc(crtc); struct kgem_bo *saved_bo, *bo; struct drm_mode_modeinfo saved_kmode; + uint32_t saved_offset; bool saved_transform; char outputs[256]; if (mode->HDisplay == 0 || mode->VDisplay == 0) return FALSE; + assert(sna_crtc); + xf86DrvMsg(crtc->scrn->scrnIndex, X_INFO, "switch to mode %dx%d@%.1f on %s using pipe %d, position (%d, %d), rotation %s, reflection %s\n", mode->HDisplay, mode->VDisplay, xf86ModeVRefresh(mode), outputs_for_crtc(crtc, outputs, sizeof(outputs)), sna_crtc->pipe, x, y, rotation_to_str(rotation), reflection_to_str(rotation)); - assert(mode->HDisplay <= sna->mode.kmode->max_width && - mode->VDisplay <= sna->mode.kmode->max_height); + assert(mode->HDisplay <= sna->mode.max_crtc_width && + mode->VDisplay <= sna->mode.max_crtc_height); #if HAS_GAMMA drmModeCrtcSetGamma(sna->kgem.fd, sna_crtc->id, @@ -1650,6 +2052,7 @@ saved_kmode = sna_crtc->kmode; saved_bo = sna_crtc->bo; saved_transform = sna_crtc->transform; + saved_offset = sna_crtc->offset; sna_crtc->fallback_shadow = false; retry: /* Attach per-crtc pixmap or direct */ @@ -1662,6 +2065,8 @@ sna_crtc->bo = bo; mode_to_kmode(&sna_crtc->kmode, mode); if (!sna_crtc_apply(crtc)) { + int err = errno; + kgem_bo_destroy(&sna->kgem, bo); if (!sna_crtc->shadow) { @@ -1670,22 +2075,27 @@ } xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, - "failed to set mode: %s\n", strerror(errno)); + "failed to set mode: %s [%d]\n", strerror(err), err); + sna_crtc->offset = saved_offset; sna_crtc->transform = saved_transform; sna_crtc->bo = saved_bo; sna_crtc->kmode = saved_kmode; return FALSE; } - if (saved_bo) + bo->active_scanout++; + if (saved_bo) { + assert(saved_bo->active_scanout); + assert(saved_bo->refcnt >= saved_bo->active_scanout); + saved_bo->active_scanout--; kgem_bo_destroy(&sna->kgem, saved_bo); + } sna_crtc_randr(crtc); - if (sna_crtc->shadow) + if (sna_crtc->transform) sna_crtc_damage(crtc); - - if (scrn->pScreen) - xf86_reload_cursors(scrn->pScreen); + sna->mode.front_active += saved_bo == NULL; + sna->mode.dirty = true; return TRUE; } @@ -1700,122 +2110,54 @@ if (priv->dpms_mode == mode) return; - if (mode == DPMSModeOn) { - if (priv->bo == NULL && - !sna_crtc_set_mode_major(crtc, - &crtc->mode, crtc->rotation, - crtc->x, crtc->y)) - sna_crtc_disable(crtc); - } else - sna_crtc_disable(crtc); + assert(priv); + priv->dpms_mode = mode; - if (priv->bo != NULL) { - priv->dpms_mode = mode; - update_flush_interval(to_sna(crtc->scrn)); - } + if (mode == DPMSModeOn && + priv->bo == NULL && + !sna_crtc_set_mode_major(crtc, + &crtc->mode, crtc->rotation, + crtc->x, crtc->y)) + mode = DPMSModeOff; + + if (mode != DPMSModeOn) + sna_crtc_disable(crtc); } void sna_mode_adjust_frame(struct sna *sna, int x, int y) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); xf86CrtcPtr crtc; + int saved_x, saved_y; if ((unsigned)config->compat_output >= config->num_output) return; crtc = config->output[config->compat_output]->crtc; - if (crtc && crtc->enabled) { - int saved_x = crtc->x; - int saved_y = crtc->y; - - crtc->x = x; - crtc->y = y; - if (!sna_crtc_set_mode_major(crtc, &crtc->mode, - crtc->rotation, x, y)) { - crtc->x = saved_x; - crtc->y = saved_y; - } - } -} - -static void -sna_crtc_hide_cursor(xf86CrtcPtr crtc) -{ - struct sna_crtc *sna_crtc = to_sna_crtc(crtc); - struct drm_mode_cursor arg; - - __DBG(("%s: CRTC:%d\n", __FUNCTION__, sna_crtc->id)); - - VG_CLEAR(arg); - arg.flags = DRM_MODE_CURSOR_BO; - arg.crtc_id = sna_crtc->id; - arg.width = arg.height = 64; - arg.handle = 0; - - (void)drmIoctl(to_sna(crtc->scrn)->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg); -} - -static void -sna_crtc_show_cursor(xf86CrtcPtr crtc) -{ - struct sna_crtc *sna_crtc = to_sna_crtc(crtc); - struct drm_mode_cursor arg; - - __DBG(("%s: CRTC:%d\n", __FUNCTION__, sna_crtc->id)); - - VG_CLEAR(arg); - arg.flags = DRM_MODE_CURSOR_BO; - arg.crtc_id = sna_crtc->id; - arg.width = arg.height = 64; - arg.handle = sna_crtc->cursor; - - (void)drmIoctl(to_sna(crtc->scrn)->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg); -} - -static void -sna_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg) -{ - __DBG(("%s: CRTC:%d (bg=%x, fg=%x)\n", __FUNCTION__, - to_sna_crtc(crtc)->id, bg, fg)); -} - -static void -sna_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y) -{ - struct sna_crtc *sna_crtc = to_sna_crtc(crtc); - struct drm_mode_cursor arg; - - __DBG(("%s: CRTC:%d (%d, %d)\n", __FUNCTION__, sna_crtc->id, x, y)); - - VG_CLEAR(arg); - arg.flags = DRM_MODE_CURSOR_MOVE; - arg.crtc_id = sna_crtc->id; - arg.x = x; - arg.y = y; - arg.handle = sna_crtc->cursor; - - (void)drmIoctl(to_sna(crtc->scrn)->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg); -} + if (crtc == NULL || !crtc->enabled) + return; -static void -sna_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image) -{ - struct drm_i915_gem_pwrite pwrite; + if (crtc->x == x && crtc->y == y) + return; - __DBG(("%s: CRTC:%d\n", __FUNCTION__, to_sna_crtc(crtc)->id)); + saved_x = crtc->x; + saved_y = crtc->y; - VG_CLEAR(pwrite); - pwrite.handle = to_sna_crtc(crtc)->cursor; - pwrite.offset = 0; - pwrite.size = 64*64*4; - pwrite.data_ptr = (uintptr_t)image; - (void)drmIoctl(to_sna(crtc->scrn)->kgem.fd, DRM_IOCTL_I915_GEM_PWRITE, &pwrite); + crtc->x = x; + crtc->y = y; + if (to_sna_crtc(crtc) && + !sna_crtc_set_mode_major(crtc, &crtc->mode, + crtc->rotation, x, y)) { + crtc->x = saved_x; + crtc->y = saved_y; + } } static void sna_crtc_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue, int size) { + assert(to_sna_crtc(crtc)); drmModeCrtcSetGamma(to_sna(crtc->scrn)->kgem.fd, to_sna_crtc(crtc)->id, size, red, green, blue); @@ -1829,9 +2171,6 @@ if (sna_crtc == NULL) return; - sna_crtc_hide_cursor(crtc); - gem_close(to_sna(crtc->scrn)->kgem.fd, sna_crtc->cursor); - free(sna_crtc); crtc->driver_private = NULL; } @@ -1840,10 +2179,23 @@ static Bool sna_crtc_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr pixmap) { + struct sna_crtc *sna_crtc = to_sna_crtc(crtc); + + if (sna_crtc == NULL) + return FALSE; + + if (pixmap == sna_crtc->slave_pixmap) + return TRUE; + DBG(("%s: CRTC:%d, pipe=%d setting scanout pixmap=%ld\n", - __FUNCTION__,to_sna_crtc(crtc)->id, to_sna_crtc(crtc)->pipe, + __FUNCTION__, sna_crtc->id, sna_crtc->pipe, pixmap ? pixmap->drawable.serialNumber : 0)); - to_sna_crtc(crtc)->scanout_pixmap = pixmap; + + /* Disable first so that we can unregister the damage tracking */ + sna_crtc_disable_shadow(to_sna(crtc->scrn), sna_crtc); + + sna_crtc->slave_pixmap = pixmap; + return TRUE; } #endif @@ -1853,11 +2205,6 @@ .dpms = sna_crtc_dpms, #endif .set_mode_major = sna_crtc_set_mode_major, - .set_cursor_colors = sna_crtc_set_cursor_colors, - .set_cursor_position = sna_crtc_set_cursor_position, - .show_cursor = sna_crtc_show_cursor, - .hide_cursor = sna_crtc_hide_cursor, - .load_cursor_argb = sna_crtc_load_cursor_argb, .gamma_set = sna_crtc_gamma_set, .destroy = sna_crtc_destroy, #if HAS_PIXMAP_SHARING @@ -1865,70 +2212,252 @@ #endif }; -static int -sna_crtc_find_plane(struct sna *sna, int pipe) +inline static bool prop_is_rotation(struct drm_mode_get_property *prop) { -#ifdef DRM_IOCTL_MODE_GETPLANERESOURCES - struct drm_mode_get_plane_res r; - uint32_t *planes, id = 0; - int i; +#if USE_ROTATION + if ((prop->flags & (1 << 5)) == 0) + return false; - VG_CLEAR(r); - r.count_planes = 0; - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPLANERESOURCES, &r)) - return 0; + if (strcmp(prop->name, "rotation")) + return false; - if (!r.count_planes) - return 0; + return true; +#else + return false; +#endif +} - planes = malloc(sizeof(uint32_t)*r.count_planes); - if (planes == NULL) - return 0; +static int plane_details(struct sna *sna, struct plane *p) +{ + struct local_mode_obj_get_properties arg; + uint64_t stack_props[24]; + uint32_t *props = (uint32_t *)stack_props; + uint64_t *values = stack_props + 8; + int i, type = DRM_PLANE_TYPE_OVERLAY; + + memset(&arg, 0, sizeof(struct local_mode_obj_get_properties)); + arg.obj_id = p->id; + arg.obj_type = LOCAL_MODE_OBJECT_PLANE; + + arg.props_ptr = (uintptr_t)props; + arg.prop_values_ptr = (uintptr_t)values; + arg.count_props = 16; - r.plane_id_ptr = (uintptr_t)planes; - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPLANERESOURCES, &r)) - r.count_planes = 0; + if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_OBJ_GETPROPERTIES, &arg)) + return -1; - VG(VALGRIND_MAKE_MEM_DEFINED(planes, sizeof(uint32_t)*r.count_planes)); + DBG(("%s: object %d (type %x) has %d props\n", __FUNCTION__, + p->id, LOCAL_MODE_OBJECT_PLANE, arg.count_props)); - for (i = 0; i < r.count_planes; i++) { - struct drm_mode_get_plane p; + if (arg.count_props > 16) { + props = malloc(2*sizeof(uint64_t)*arg.count_props); + if (props == NULL) + return -1; - VG_CLEAR(p); - p.plane_id = planes[i]; - p.count_format_types = 0; - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPLANE, &p) == 0) { - if (p.possible_crtcs & (1 << pipe)) { - id = p.plane_id; - break; - } - } - } - free(planes); + values = (uint64_t *)props + arg.count_props; - assert(id); - return id; -#else - return 0; -#endif -} + arg.props_ptr = (uintptr_t)props; + arg.prop_values_ptr = (uintptr_t)values; + + if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_OBJ_GETPROPERTIES, &arg)) + arg.count_props = 0; + } + VG(VALGRIND_MAKE_MEM_DEFINED(arg.props_ptr, sizeof(uint32_t)*arg.count_props)); + VG(VALGRIND_MAKE_MEM_DEFINED(arg.prop_values_ptr, sizeof(uint64_t)*arg.count_props)); + + for (i = 0; i < arg.count_props; i++) { + struct drm_mode_get_property prop; + + memset(&prop, 0, sizeof(prop)); + prop.prop_id = props[i]; + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPERTY, &prop)) { + ERR(("%s: prop[%d].id=%d GETPROPERTY failed with errno=%d\n", + __FUNCTION__, i, props[i], errno)); + continue; + } + + DBG(("%s: prop[%d] .id=%d, .name=%s, .flags=%x, .value=%ld\n", __FUNCTION__, i, + (long)props[i], prop.name, prop.flags, (long)values[i])); + + if (strcmp(prop.name, "type") == 0) { + type = values[i]; + } else if (prop_is_rotation(&prop)) { + struct drm_mode_property_enum *enums; + + p->rotation.prop = props[i]; + p->rotation.current = values[i]; + + DBG(("%s: found rotation property .id=%d, value=%ld, num_enums=%d\n", + __FUNCTION__, prop.prop_id, (long)values[i], prop.count_enum_blobs)); + enums = malloc(prop.count_enum_blobs * sizeof(struct drm_mode_property_enum)); + if (enums != NULL) { + prop.count_values = 0; + prop.enum_blob_ptr = (uintptr_t)enums; + + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPERTY, &prop) == 0) { + int j; + + /* XXX we assume that the mapping between kernel enum and + * RandR remains fixed for our lifetimes. + */ + VG(VALGRIND_MAKE_MEM_DEFINED(enums, sizeof(*enums)*prop.count_enum_blobs)); + for (j = 0; j < prop.count_enum_blobs; j++) { + DBG(("%s: rotation[%d] = %s [%lx]\n", __FUNCTION__, + j, enums[j].name, (long)enums[j].value)); + p->rotation.supported |= 1 << enums[j].value; + } + } + + free(enums); + } + } + } + + if (props != (uint32_t *)stack_props) + free(props); + + DBG(("%s: plane=%d type=%d\n", __FUNCTION__, p->id, type)); + return type; +} + +static void +sna_crtc_find_planes(struct sna *sna, struct sna_crtc *crtc) +{ +#define LOCAL_IOCTL_SET_CAP DRM_IOWR(0x0d, struct local_set_cap) +#define LOCAL_IOCTL_MODE_GETPLANERESOURCES DRM_IOWR(0xb5, struct local_mode_get_plane_res) +#define LOCAL_IOCTL_MODE_GETPLANE DRM_IOWR(0xb6, struct local_mode_get_plane) + struct local_set_cap { + uint64_t name; + uint64_t value; + } cap; + struct local_mode_get_plane_res { + uint64_t plane_id_ptr; + uint64_t count_planes; + } r; + uint32_t stack_planes[32]; + uint32_t *planes = stack_planes; + int i; + + VG_CLEAR(cap); + cap.name = DRM_CLIENT_CAP_UNIVERSAL_PLANES; + cap.value = 1; + (void)drmIoctl(sna->kgem.fd, LOCAL_IOCTL_SET_CAP, &cap); + + VG_CLEAR(r); + r.plane_id_ptr = (uintptr_t)planes; + r.count_planes = ARRAY_SIZE(stack_planes); + if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_GETPLANERESOURCES, &r)) { + ERR(("%s: GETPLANERESOURCES failed with errno=%d\n", __FUNCTION__, errno)); + return; + } + + DBG(("%s: %d planes\n", __FUNCTION__, r.count_planes)); + + if (r.count_planes > ARRAY_SIZE(stack_planes)) { + planes = malloc(sizeof(uint32_t)*r.count_planes); + if (planes == NULL) + return; + + r.plane_id_ptr = (uintptr_t)planes; + if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_GETPLANERESOURCES, &r)) + r.count_planes = 0; + } + + VG(VALGRIND_MAKE_MEM_DEFINED(planes, sizeof(uint32_t)*r.count_planes)); + + for (i = 0; i < r.count_planes; i++) { + struct local_mode_get_plane { + uint32_t plane_id; + + uint32_t crtc_id; + uint32_t fb_id; + + uint32_t possible_crtcs; + uint32_t gamma_size; + + uint32_t count_format_types; + uint64_t format_type_ptr; + } p; + struct plane details; + + VG_CLEAR(p); + p.plane_id = planes[i]; + p.count_format_types = 0; + if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_GETPLANE, &p)) + continue; + + if ((p.possible_crtcs & (1 << crtc->pipe)) == 0) + continue; + + DBG(("%s: plane %d is attached to our pipe=%d\n", + __FUNCTION__, planes[i], crtc->pipe)); + + details.id = p.plane_id; + details.rotation.prop = 0; + details.rotation.supported = RR_Rotate_0; + details.rotation.current = RR_Rotate_0; + + switch (plane_details(sna, &details)) { + default: + break; + + case DRM_PLANE_TYPE_PRIMARY: + crtc->primary = details; + break; + + case DRM_PLANE_TYPE_CURSOR: + break; + + case DRM_PLANE_TYPE_OVERLAY: + if (crtc->sprite.id == 0) + crtc->sprite = details; + break; + } + } + + if (planes != stack_planes) + free(planes); +} + +static void +sna_crtc_init__rotation(struct sna *sna, struct sna_crtc *crtc) +{ + crtc->rotation = RR_Rotate_0; + crtc->primary.rotation.supported = RR_Rotate_0; + crtc->primary.rotation.current = RR_Rotate_0; + crtc->sprite.rotation = crtc->primary.rotation; +} + +static void +sna_crtc_init__cursor(struct sna *sna, struct sna_crtc *crtc) +{ + struct drm_mode_cursor arg; + + VG_CLEAR(arg); + arg.flags = DRM_MODE_CURSOR_BO; + arg.crtc_id = crtc->id; + arg.width = arg.height = 0; + arg.handle = 0; + + (void)drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg); +} static bool -sna_crtc_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num) +sna_crtc_add(ScrnInfoPtr scrn, int id) { struct sna *sna = to_sna(scrn); xf86CrtcPtr crtc; struct sna_crtc *sna_crtc; struct drm_i915_get_pipe_from_crtc_id get_pipe; - DBG(("%s\n", __FUNCTION__)); + DBG(("%s(%d)\n", __FUNCTION__, id)); sna_crtc = calloc(sizeof(struct sna_crtc), 1); if (sna_crtc == NULL) return false; - sna_crtc->id = mode->kmode->crtcs[num]; - sna_crtc->dpms_mode = DPMSModeOff; + sna_crtc->id = id; + sna_crtc->dpms_mode = -1; VG_CLEAR(get_pipe); get_pipe.pipe = 0; @@ -1940,7 +2469,6 @@ return false; } sna_crtc->pipe = get_pipe.pipe; - sna_crtc->plane = sna_crtc_find_plane(sna, sna_crtc->pipe); if (xf86IsEntityShared(scrn->entityList[0]) && scrn->confScreen->device->screen != sna_crtc->pipe) { @@ -1948,24 +2476,29 @@ return true; } + sna_crtc_init__rotation(sna, sna_crtc); + + sna_crtc_find_planes(sna, sna_crtc); + + DBG(("%s: CRTC:%d [pipe=%d], primary id=%x: supported-rotations=%x, current-rotation=%x, sprite id=%x: supported-rotations=%x, current-rotation=%x\n", + __FUNCTION__, sna_crtc->id, sna_crtc->pipe, + sna_crtc->primary.id, sna_crtc->primary.rotation.supported, sna_crtc->primary.rotation.current, + sna_crtc->sprite.id, sna_crtc->sprite.rotation.supported, sna_crtc->sprite.rotation.current)); + + list_init(&sna_crtc->shadow_link); + crtc = xf86CrtcCreate(scrn, &sna_crtc_funcs); if (crtc == NULL) { free(sna_crtc); return false; } - sna_crtc->cursor = gem_create(sna->kgem.fd, 64*64*4); - if (!sna_crtc->cursor) { - xf86CrtcDestroy(crtc); - free(sna_crtc); - return false; - } - DBG(("%s: created handle=%d for cursor on CRTC:%d\n", - __FUNCTION__, sna_crtc->cursor, sna_crtc->id)); + sna_crtc_init__cursor(sna, sna_crtc); crtc->driver_private = sna_crtc; - DBG(("%s: attached crtc[%d] id=%d, pipe=%d\n", - __FUNCTION__, num, sna_crtc->id, sna_crtc->pipe)); + sna_crtc->base = crtc; + DBG(("%s: attached crtc[%d] pipe=%d\n", + __FUNCTION__, id, sna_crtc->pipe)); return true; } @@ -1998,13 +2531,6 @@ return -1; } -static int -find_property_id(struct sna *sna, struct sna_output *output, const char *name) -{ - int idx = find_property(sna, output, name); - return idx != -1 ? output->prop_ids[idx] : 0; -} - static xf86OutputStatus sna_output_detect(xf86OutputPtr output) { @@ -2012,7 +2538,12 @@ struct sna_output *sna_output = output->driver_private; union compat_mode_get_connector compat_conn; - DBG(("%s(%s)\n", __FUNCTION__, output->name)); + DBG(("%s(%s:%d)\n", __FUNCTION__, output->name, sna_output->id)); + + if (!sna_output->id) { + DBG(("%s(%s) hiding due to lost connection\n", __FUNCTION__, output->name)); + return XF86OutputStatusDisconnected; + } VG_CLEAR(compat_conn); compat_conn.conn.connector_id = sna_output->id; @@ -2073,9 +2604,9 @@ struct sna_output *sna_output = output->driver_private; struct sna *sna = to_sna(output->scrn); - if (mode->HDisplay > sna->mode.kmode->max_width) + if (mode->HDisplay > sna->mode.max_crtc_width) return MODE_VIRTUAL_X; - if (mode->VDisplay > sna->mode.kmode->max_height) + if (mode->VDisplay > sna->mode.max_crtc_height) return MODE_VIRTUAL_Y; /* Check that we can successfully pin this into the global GTT */ @@ -2235,24 +2766,6 @@ return xf86ModesAdd(modes, m); } -static char *canonical_mode_name(DisplayModePtr mode) -{ - char tmp[32], *buf; - int len; - - len = sprintf(tmp, "%dx%d%s", - mode->HDisplay, mode->VDisplay, - mode->Flags & V_INTERLACE ? "i" : ""); - if ((unsigned)len >= sizeof(tmp)) - return NULL; - - buf = malloc(len + 1); - if (buf == NULL) - return NULL; - - return memcpy(buf, tmp, len + 1); -} - static DisplayModePtr sna_output_get_modes(xf86OutputPtr output) { @@ -2260,7 +2773,8 @@ DisplayModePtr Modes = NULL, Mode, current = NULL; int i; - DBG(("%s(%s)\n", __FUNCTION__, output->name)); + DBG(("%s(%s:%d)\n", __FUNCTION__, output->name, sna_output->id)); + assert(sna_output->id); sna_output_attach_edid(output); @@ -2268,6 +2782,7 @@ struct drm_mode_crtc mode; VG_CLEAR(mode); + assert(to_sna_crtc(output->crtc)); mode.crtc_id = to_sna_crtc(output->crtc)->id; if (drmIoctl(to_sna(output->scrn)->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode) == 0) { @@ -2301,6 +2816,7 @@ Modes = xf86ModesAdd(Modes, Mode); Mode = NULL; } else { + free((void *)current->name); current->name = strdup(Mode->name); current->type = Mode->type; } @@ -2308,14 +2824,6 @@ } free(Mode); - if (current && (current->name == NULL || *current->name == '\0')) { - char *str = canonical_mode_name(current); - if (str) { - free((char *)current->name); - current->name = str; - } - } - /* * If the connector type is a panel, we will traverse the kernel mode to * get the panel limit. And then add all the standard modes to fake @@ -2356,54 +2864,43 @@ free(sna_output->edid_raw); for (i = 0; i < sna_output->num_props; i++) { + if (sna_output->props[i].kprop == NULL) + continue; + + if (sna_output->props[i].atoms) { + if (output->randr_output) + RRDeleteOutputProperty(output->randr_output, sna_output->props[i].atoms[0]); + free(sna_output->props[i].atoms); + } + drmModeFreeProperty(sna_output->props[i].kprop); - free(sna_output->props[i].atoms); } free(sna_output->props); free(sna_output->prop_ids); free(sna_output->prop_values); - free(sna_output->backlight_iface); + backlight_close(&sna_output->backlight); free(sna_output); output->driver_private = NULL; } static void -sna_output_dpms_backlight(xf86OutputPtr output, int oldmode, int mode) -{ - struct sna_output *sna_output = output->driver_private; - - if (!sna_output->backlight_iface) - return; - - DBG(("%s(%s) -- %d -> %d\n", __FUNCTION__, output->name, oldmode, mode)); - - if (mode == DPMSModeOn) { - /* If we're going from off->on we may need to turn on the backlight. */ - if (oldmode != DPMSModeOn) - sna_output_backlight_set(output, - sna_output->backlight_active_level); - } else { - /* Only save the current backlight value if we're going from on to off. */ - if (oldmode == DPMSModeOn) - sna_output->backlight_active_level = sna_output_backlight_get(output); - sna_output_backlight_set(output, 0); - } -} - -static void sna_output_dpms(xf86OutputPtr output, int dpms) { struct sna *sna = to_sna(output->scrn); struct sna_output *sna_output = output->driver_private; + int old_dpms = sna_output->dpms_mode; - DBG(("%s(%s): dpms=%d (current: %d), active? %d\n", - __FUNCTION__, output->name, + DBG(("%s(%s:%d): dpms=%d (current: %d), active? %d\n", + __FUNCTION__, output->name, sna_output->id, dpms, sna_output->dpms_mode, output->crtc != NULL)); - if (sna_output->dpms_mode == dpms) + if (!sna_output->id) + return; + + if (old_dpms == dpms) return; /* Record the value of the backlight before turning @@ -2413,22 +2910,29 @@ * record the value before the kernel modifies it * and reapply it afterwards. */ - if (dpms != DPMSModeOn) - sna_output_dpms_backlight(output, - sna_output->dpms_mode, - dpms); + if (sna_output->backlight.iface && dpms != DPMSModeOn) { + if (old_dpms == DPMSModeOn) { + sna_output->backlight_active_level = sna_output_backlight_get(output); + DBG(("%s: saving current backlight %d\n", + __FUNCTION__, sna_output->backlight_active_level)); + } + sna_output->dpms_mode = dpms; + sna_output_backlight_set(sna_output, 0); + } if (output->crtc && drmModeConnectorSetProperty(sna->kgem.fd, sna_output->id, sna_output->dpms_id, dpms)) - dpms = sna_output->dpms_mode; + dpms = old_dpms; - if (dpms == DPMSModeOn) - sna_output_dpms_backlight(output, - sna_output->dpms_mode, - dpms); + if (sna_output->backlight.iface && dpms == DPMSModeOn) { + DBG(("%s: restoring previous backlight %d\n", + __FUNCTION__, sna_output->backlight_active_level)); + sna_output_backlight_set(sna_output, + sna_output->backlight_active_level); + } sna_output->dpms_mode = dpms; } @@ -2478,10 +2982,6 @@ "RRChangeOutputProperty error, %d\n", err); } -#define BACKLIGHT_NAME "Backlight" -#define BACKLIGHT_DEPRECATED_NAME "BACKLIGHT" -static Atom backlight_atom, backlight_deprecated_atom; - static void sna_output_create_resources(xf86OutputPtr output) { @@ -2553,20 +3053,20 @@ } } - if (sna_output->backlight_iface) { + if (sna_output->backlight.iface) { /* Set up the backlight property, which takes effect * immediately and accepts values only within the * backlight_range. */ sna_output_create_ranged_atom(output, &backlight_atom, BACKLIGHT_NAME, 0, - sna_output->backlight_max, + sna_output->backlight.max, sna_output->backlight_active_level, FALSE); sna_output_create_ranged_atom(output, &backlight_deprecated_atom, BACKLIGHT_DEPRECATED_NAME, 0, - sna_output->backlight_max, + sna_output->backlight.max, sna_output->backlight_active_level, FALSE); } @@ -2591,16 +3091,19 @@ val = *(INT32 *)value->data; DBG(("%s: setting backlight to %d (max=%d)\n", - __FUNCTION__, (int)val, sna_output->backlight_max)); - if (val < 0 || val > sna_output->backlight_max) + __FUNCTION__, (int)val, sna_output->backlight.max)); + if (val < 0 || val > sna_output->backlight.max) return FALSE; - if (sna_output->dpms_mode == DPMSModeOn) - sna_output_backlight_set(output, val); sna_output->backlight_active_level = val; + if (sna_output->dpms_mode == DPMSModeOn) + sna_output_backlight_set(sna_output, val); return TRUE; } + if (!sna_output->id) + return TRUE; + for (i = 0; i < sna_output->num_props; i++) { struct sna_property *p = &sna_output->props[i]; @@ -2658,17 +3161,24 @@ if (property == backlight_atom || property == backlight_deprecated_atom) { INT32 val; - if (!sna_output->backlight_iface) + if (!sna_output->backlight.iface) return FALSE; - val = sna_output_backlight_get(output); - if (val < 0) - return FALSE; + if (sna_output->dpms_mode == DPMSModeOn) { + val = sna_output_backlight_get(output); + if (val < 0) + return FALSE; + DBG(("%s(%s): output on, reporting actual backlight value [%d]\n", + __FUNCTION__, output->name, val)); + } else { + val = sna_output->backlight_active_level; + DBG(("%s(%s): output off, reporting cached backlight value [%d]\n", + __FUNCTION__, output->name, val)); + } err = RRChangeOutputProperty(output->randr_output, property, XA_INTEGER, 32, PropModeReplace, 1, &val, FALSE, FALSE); - if (err != 0) { xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "RRChangeOutputProperty error, %d\n", err); @@ -2785,200 +3295,595 @@ } static bool -sna_output_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num) +gather_encoders(struct sna *sna, uint32_t id, int count, + struct drm_mode_get_encoder *out) { - struct sna *sna = to_sna(scrn); - xf86OutputPtr output; union compat_mode_get_connector compat_conn; - struct drm_mode_get_encoder enc; struct drm_mode_modeinfo dummy; - struct sna_output *sna_output; - const char *output_name; - char name[32]; - bool ret = false; - int i; + struct drm_mode_get_encoder enc; + uint32_t *ids = NULL; - COMPILE_TIME_ASSERT(sizeof(struct drm_mode_get_connector) <= sizeof(compat_conn.pad)); + VG_CLEAR(compat_conn); + memset(out, 0, sizeof(*out)); - DBG(("%s(num=%d)\n", __FUNCTION__, num)); + do { + free(ids); + ids = malloc(sizeof(*ids) * count); + if (ids == 0) + return false; - VG_CLEAR(compat_conn); - VG_CLEAR(enc); + compat_conn.conn.connector_id = id; + compat_conn.conn.count_props = 0; + compat_conn.conn.count_modes = 1; /* skip detect */ + compat_conn.conn.modes_ptr = (uintptr_t)&dummy; + compat_conn.conn.count_encoders = count; + compat_conn.conn.encoders_ptr = (uintptr_t)ids; - compat_conn.conn.connector_id = mode->kmode->connectors[num]; - compat_conn.conn.count_props = 0; - compat_conn.conn.count_modes = 1; /* skip detect */ - compat_conn.conn.modes_ptr = (uintptr_t)&dummy; - compat_conn.conn.count_encoders = 1; - compat_conn.conn.encoders_ptr = (uintptr_t)&enc.encoder_id; + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCONNECTOR, &compat_conn.conn)) { + DBG(("%s: GETCONNECTOR[%d] failed, ret=%d\n", __FUNCTION__, id, errno)); + compat_conn.conn.count_encoders = count = 0; + } - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCONNECTOR, &compat_conn.conn)) { - DBG(("%s: GETCONNECTOR failed, ret=%d\n", __FUNCTION__, errno)); - return false; - } + if (count == compat_conn.conn.count_encoders) + break; - if (compat_conn.conn.count_encoders != 1) { - DBG(("%s: unexpected number [%d] of encoders attached\n", - __FUNCTION__, compat_conn.conn.count_encoders)); - return false; - } + count = compat_conn.conn.count_encoders; + } while (1); - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETENCODER, &enc)) { - DBG(("%s: GETENCODER failed, ret=%d\n", __FUNCTION__, errno)); - return false; + for (count = 0; count < compat_conn.conn.count_encoders; count++) { + enc.encoder_id = ids[count]; + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETENCODER, &enc)) { + DBG(("%s: GETENCODER[%d] failed, ret=%d\n", __FUNCTION__, ids[count], errno)); + count = 0; + break; + } + out->possible_crtcs |= enc.possible_crtcs; + out->possible_clones |= enc.possible_clones; + + for (id = 0; id < sna->mode.num_real_encoder; id++) { + if (enc.encoder_id == sna->mode.encoders[id]) { + out->crtc_id |= 1 << id; + break; + } + } } - sna_output = calloc(sizeof(struct sna_output), 1); - if (!sna_output) - return false; + free(ids); + return count > 0; +} - sna_output->num_props = compat_conn.conn.count_props; - sna_output->prop_ids = malloc(sizeof(uint32_t)*compat_conn.conn.count_props); - sna_output->prop_values = malloc(sizeof(uint64_t)*compat_conn.conn.count_props); - sna_output->dpms_mode = DPMSModeOff; +/* We need to map from kms encoder based possible_clones mask to X output based + * possible clones masking. Note that for SDVO and on Haswell with DP/HDMI we + * can have more than one output hanging off the same encoder. + */ +static void +sna_mode_compute_possible_outputs(struct sna *sna) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); + int encoder_mask[32]; + int i, j; - compat_conn.conn.count_encoders = 0; + assert(sna->mode.num_real_output < 32); + assert(sna->mode.num_real_crtc < 32); - compat_conn.conn.count_modes = 1; - compat_conn.conn.modes_ptr = (uintptr_t)&dummy; + for (i = 0; i < sna->mode.num_real_output; i++) { + xf86OutputPtr output = config->output[i]; + struct sna_output *sna_output = to_sna_output(output); - compat_conn.conn.count_props = sna_output->num_props; - compat_conn.conn.props_ptr = (uintptr_t)sna_output->prop_ids; - compat_conn.conn.prop_values_ptr = (uintptr_t)sna_output->prop_values; + assert(sna_output); - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCONNECTOR, &compat_conn.conn)) { - DBG(("%s: second! GETCONNECTOR failed, ret=%d\n", __FUNCTION__, errno)); - goto cleanup; + if (sna_output->id) { + output->possible_clones = sna_output->possible_encoders; + encoder_mask[i] = sna_output->attached_encoders; + } else { + output->possible_clones = 0; + encoder_mask[i] = 0; + } } - /* statically constructed property list */ - assert(sna_output->num_props == compat_conn.conn.count_props); - VG(VALGRIND_MAKE_MEM_DEFINED(sna_output->prop_ids, sizeof(uint32_t)*sna_output->num_props)); - VG(VALGRIND_MAKE_MEM_DEFINED(sna_output->prop_values, sizeof(uint64_t)*sna_output->num_props)); + /* Convert from encoder numbering to output numbering */ + for (i = 0; i < sna->mode.num_real_output; i++) { + xf86OutputPtr output = config->output[i]; + unsigned clones; - if (compat_conn.conn.connector_type < ARRAY_SIZE(output_names)) - output_name = output_names[compat_conn.conn.connector_type]; - else - output_name = "UNKNOWN"; - snprintf(name, 32, "%s%d", output_name, compat_conn.conn.connector_type_id); + if (output->possible_clones == 0) + continue; - if (xf86IsEntityShared(scrn->entityList[0])) { - const char *str; + clones = 0; + for (j = 0; j < sna->mode.num_real_output; j++) + if (i != j && output->possible_clones & encoder_mask[j]) + clones |= 1 << j; + output->possible_clones = clones; - str = xf86GetOptValString(sna->Options, OPTION_ZAPHOD); - if (str && !sna_zaphod_match(str, name)) { - DBG(("%s: zaphod mismatch, want %s, have %s\n", __FUNCTION__, str, name)); - ret = true; - goto cleanup; - } + DBG(("%s: updated output '%s' %d [%d] (possible crtc:%x, possible clones:%x)\n", + __FUNCTION__, output->name, i, to_connector_id(output), + (uint32_t)output->possible_crtcs, + (uint32_t)output->possible_clones)); + } +} - if ((enc.possible_crtcs & (1 << scrn->confScreen->device->screen)) == 0) { - if (str) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "%s is an invalid output for screen (pipe) %d\n", - name, scrn->confScreen->device->screen); - } - goto cleanup; - } +static int name_from_path(struct sna *sna, + struct sna_output *sna_output, + char *name) +{ + struct drm_mode_get_blob blob; + char buf[32], *path = buf; + int id; - enc.possible_crtcs = 1; - enc.possible_clones = 0; - } + id = find_property(sna, sna_output, "PATH"); + DBG(("%s: found? PATH=%d\n", __FUNCTION__, id)); + if (id == -1) + return 0; - output = xf86OutputCreate(scrn, &sna_output_funcs, name); - if (!output) { - /* xf86OutputCreate does not differentiate between - * a failure to allocate the output, and a user request - * to ignore the output. So reconstruct whether the user - * explicitly ignored the output. - */ - ret = output_ignored(scrn, name); - DBG(("%s: create failed, ignored? %d\n", __FUNCTION__, ret)); - goto cleanup; + VG_CLEAR(blob); + blob.blob_id = sna_output->prop_values[id]; + blob.length = sizeof(buf)-1; + blob.data = (uintptr_t)path; + VG(memset(path, 0, blob.length)); + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob)) + return 0; + + if (blob.length >= sizeof(buf)) { + path = alloca(blob.length + 1); + blob.data = (uintptr_t)path; + VG(memset(path, 0, blob.length)); + DBG(("%s: reading %d bytes for path blob\n", __FUNCTION__, blob.length)); + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPROPBLOB, &blob)) + return 0; } - sna_output->id = compat_conn.conn.connector_id; - sna_output->is_panel = is_panel(compat_conn.conn.connector_type); - sna_output->edid_idx = find_property(sna, sna_output, "EDID"); - sna_output->dpms_id = find_property_id(sna, sna_output, "DPMS"); + path[blob.length] = '\0'; /* paranoia */ + DBG(("%s: PATH='%s'\n", __FUNCTION__, path)); - output->mm_width = compat_conn.conn.mm_width; + /* we only handle MST paths for now */ + if (strncmp(path, "mst:", 4) == 0) { + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); + char tmp[5], *c; + int n; + + c = strchr(path + 4, '-'); + if (c == NULL) + return 0; + + id = c - (path + 4); + if (id + 1> 5) + return 0; + + memcpy(tmp, path + 4, id); + tmp[id] = '\0'; + id = strtoul(tmp, NULL, 0); + + for (n = 0; n < sna->mode.num_real_output; n++) { + if (to_sna_output(config->output[n])->id == id) + return snprintf(name, 32, "%s-%s", config->output[n]->name, c + 1); + } + } + + return 0; +} + +static int +sna_output_add(struct sna *sna, unsigned id, unsigned serial) +{ + ScrnInfoPtr scrn = sna->scrn; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + union compat_mode_get_connector compat_conn; + struct drm_mode_get_encoder enc; + struct drm_mode_modeinfo dummy; + struct sna_output *sna_output; + xf86OutputPtr *outputs, output; + unsigned possible_encoders, attached_encoders, possible_crtcs; + const char *output_name; + char name[32]; + int path, len, i; + + DBG(("%s(%d): serial=%d\n", __FUNCTION__, id, serial)); + + COMPILE_TIME_ASSERT(sizeof(struct drm_mode_get_connector) <= sizeof(compat_conn.pad)); + + VG_CLEAR(compat_conn); + memset(&enc, 0, sizeof(enc)); + + compat_conn.conn.connector_id = id; + compat_conn.conn.count_props = 0; + compat_conn.conn.count_modes = 1; /* skip detect */ + compat_conn.conn.modes_ptr = (uintptr_t)&dummy; + compat_conn.conn.count_encoders = 1; + compat_conn.conn.encoders_ptr = (uintptr_t)&enc.encoder_id; + + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCONNECTOR, &compat_conn.conn)) { + DBG(("%s: GETCONNECTOR[%d] failed, ret=%d\n", __FUNCTION__, id, errno)); + return -1; + } + assert(compat_conn.conn.connector_id == id); + + if (compat_conn.conn.connector_type < ARRAY_SIZE(output_names)) + output_name = output_names[compat_conn.conn.connector_type]; + else + output_name = "UNKNOWN"; + len = snprintf(name, 32, "%s%d", output_name, compat_conn.conn.connector_type_id); + if (output_ignored(scrn, name)) + return 0; + + if (enc.encoder_id) { + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETENCODER, &enc)) { + DBG(("%s: GETENCODER[%d] failed, ret=%d\n", __FUNCTION__, enc.encoder_id, errno)); + return 0; + } + + possible_encoders = enc.possible_clones; + attached_encoders = 0; + for (i = 0; i < sna->mode.num_real_encoder; i++) { + if (enc.encoder_id == sna->mode.encoders[i]) { + attached_encoders = 1 << i; + break; + } + } + + if (attached_encoders == 0) { + DBG(("%s: failed to find attached encoder\n", __FUNCTION__)); + return 0; + } + + possible_crtcs = enc.possible_crtcs; + assert(enc.encoder_id == compat_conn.conn.encoder_id || compat_conn.conn.encoder_id == 0); + } else { + DBG(("%s: unexpected number [%d] of encoders attached\n", + __FUNCTION__, compat_conn.conn.count_encoders)); + if (!gather_encoders(sna, id, compat_conn.conn.count_encoders, &enc)) { + DBG(("%s: gather encoders failed\n", __FUNCTION__)); + return 0; + } + possible_encoders = enc.possible_clones; + attached_encoders = enc.crtc_id; + possible_crtcs = enc.possible_crtcs; + + memset(&enc, 0, sizeof(enc)); + enc.encoder_id = compat_conn.conn.encoder_id; + (void)drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETENCODER, &enc); + } + + if (xf86IsEntityShared(scrn->entityList[0])) { + const char *str; + + str = xf86GetOptValString(sna->Options, OPTION_ZAPHOD); + if (str && !sna_zaphod_match(str, name)) { + DBG(("%s: zaphod mismatch, want %s, have %s\n", __FUNCTION__, str, name)); + return 0; + } + + if ((possible_crtcs & (1 << scrn->confScreen->device->screen)) == 0) { + if (str) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "%s is an invalid output for screen (pipe) %d\n", + name, scrn->confScreen->device->screen); + return -1; + } else + return 0; + } + + possible_crtcs = 1; + } + + sna_output = calloc(sizeof(struct sna_output), 1); + if (!sna_output) + return -1; + + sna_output->num_props = compat_conn.conn.count_props; + sna_output->prop_ids = malloc(sizeof(uint32_t)*compat_conn.conn.count_props); + sna_output->prop_values = malloc(sizeof(uint64_t)*compat_conn.conn.count_props); + + compat_conn.conn.count_encoders = 0; + + compat_conn.conn.count_modes = 1; + compat_conn.conn.modes_ptr = (uintptr_t)&dummy; + + compat_conn.conn.count_props = sna_output->num_props; + compat_conn.conn.props_ptr = (uintptr_t)sna_output->prop_ids; + compat_conn.conn.prop_values_ptr = (uintptr_t)sna_output->prop_values; + + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCONNECTOR, &compat_conn.conn)) { + DBG(("%s: second! GETCONNECTOR failed, ret=%d\n", __FUNCTION__, errno)); + goto cleanup; + } + assert(compat_conn.conn.connector_id == id); + + /* statically constructed property list */ + assert(sna_output->num_props == compat_conn.conn.count_props); + VG(VALGRIND_MAKE_MEM_DEFINED(sna_output->prop_ids, sizeof(uint32_t)*sna_output->num_props)); + VG(VALGRIND_MAKE_MEM_DEFINED(sna_output->prop_values, sizeof(uint64_t)*sna_output->num_props)); + + /* Construct name from topology, and recheck if output is acceptable */ + path = name_from_path(sna, sna_output, name); + if (path) { + const char *str; + + if (output_ignored(scrn, name)) { + len = 0; + goto skip; + } + + str = xf86GetOptValString(sna->Options, OPTION_ZAPHOD); + if (str && !sna_zaphod_match(str, name)) { + DBG(("%s: zaphod mismatch, want %s, have %s\n", __FUNCTION__, str, name)); + len = 0; + goto skip; + } + + len = path; + } + + /* Check if we are dynamically reattaching an old connector */ + if (serial) { + for (i = 0; i < sna->mode.num_real_output; i++) { + output = config->output[i]; + if (strcmp(output->name, name) == 0) { + assert(output->scrn == scrn); + assert(output->funcs == &sna_output_funcs); + assert(to_sna_output(output)->id == 0); + sna_output_destroy(output); + goto reset; + } + } + } + + output = calloc(1, sizeof(*output) + len + 1); + if (!output) + goto cleanup; + + outputs = realloc(config->output, (config->num_output + 1) * sizeof(output)); + if (outputs == NULL) { + free(output); + goto cleanup; + } + + DBG(("%s: inserting output #%d of %d\n", __FUNCTION__, sna->mode.num_real_output, config->num_output)); + for (i = config->num_output; i > sna->mode.num_real_output; i--) { + outputs[i] = outputs[i-1]; + assert(outputs[i]->driver_private == NULL); + outputs[i]->possible_clones <<= 1; + } + outputs[i] = output; + sna->mode.num_real_output++; + config->num_output++; + config->output = outputs; + + output->scrn = scrn; + output->funcs = &sna_output_funcs; + output->name = (char *)(output + 1); + memcpy(output->name, name, len + 1); + + output->use_screen_monitor = config->num_output != 1; + xf86OutputUseScreenMonitor(output, !output->use_screen_monitor); + +reset: + sna_output->id = compat_conn.conn.connector_id; + sna_output->is_panel = is_panel(compat_conn.conn.connector_type); + sna_output->edid_idx = find_property(sna, sna_output, "EDID"); + i = find_property(sna, sna_output, "DPMS"); + if (i != -1) { + sna_output->dpms_id = sna_output->prop_ids[i]; + sna_output->dpms_mode = sna_output->prop_values[i]; + DBG(("%s: found 'DPMS' (idx=%d, id=%d), initial value=%d\n", + __FUNCTION__, i, sna_output->dpms_id, sna_output->dpms_mode)); + } else { + sna_output->dpms_id = -1; + sna_output->dpms_mode = DPMSModeOff; + } + + sna_output->possible_encoders = possible_encoders; + sna_output->attached_encoders = attached_encoders; + + output->mm_width = compat_conn.conn.mm_width; output->mm_height = compat_conn.conn.mm_height; if (compat_conn.conn.subpixel >= ARRAY_SIZE(subpixel_conv_table)) compat_conn.conn.subpixel = 0; output->subpixel_order = subpixel_conv_table[compat_conn.conn.subpixel]; output->driver_private = sna_output; - - for (i = 0; i < mode->kmode->count_encoders; i++) { - if (enc.encoder_id == mode->kmode->encoders[i]) { - sna_output->encoder_idx = i; - break; - } - } + sna_output->base = output; if (sna_output->is_panel) sna_output_backlight_init(output); - output->possible_crtcs = enc.possible_crtcs; - output->possible_clones = enc.possible_clones; + output->possible_crtcs = possible_crtcs & count_to_mask(sna->mode.num_real_crtc); output->interlaceAllowed = TRUE; - /* stash the active CRTC id for our probe function */ - output->crtc = NULL; - if (compat_conn.conn.connection == DRM_MODE_CONNECTED) - output->crtc = (void *)(uintptr_t)enc.crtc_id; + if (serial) { + if (output->randr_output == NULL) { + output->randr_output = RROutputCreate(xf86ScrnToScreen(scrn), name, len, output); + if (output->randr_output == NULL) + goto cleanup; + } + + sna_output_create_resources(output); + RRPostPendingProperties(output->randr_output); + + sna_output->serial = serial; + } else { + /* stash the active CRTC id for our probe function */ + if (compat_conn.conn.connection != DRM_MODE_DISCONNECTED) + output->crtc = (void *)(uintptr_t)enc.crtc_id; + } - DBG(("%s: created output '%s' %d [%ld] (possible crtc:%x, possible clones:%x), edid=%d, dpms=%d, crtc=%lu\n", - __FUNCTION__, name, num, (long)sna_output->id, + DBG(("%s: created output '%s' %d, encoder=%d (possible crtc:%x, attached encoders:%x, possible clones:%x), serial=%d, edid=%d, dpms=%d, crtc=%lu\n", + __FUNCTION__, name, id, enc.encoder_id, (uint32_t)output->possible_crtcs, - (uint32_t)output->possible_clones, - sna_output->edid_idx, sna_output->dpms_id, + sna_output->attached_encoders, + sna_output->possible_encoders, + serial, sna_output->edid_idx, sna_output->dpms_id, (unsigned long)(uintptr_t)output->crtc)); + assert(sna_output->id == id); - return true; + return 1; cleanup: + len = -1; +skip: free(sna_output->prop_ids); free(sna_output->prop_values); free(sna_output); - return ret; + return len; } -/* We need to map from kms encoder based possible_clones mask to X output based - * possible clones masking. Note that for SDVO and on Haswell with DP/HDMI we - * can have more than one output hanging off the same encoder. - */ -static void -sna_mode_compute_possible_outputs(ScrnInfoPtr scrn) +static void sna_output_del(xf86OutputPtr output) { + ScrnInfoPtr scrn = output->scrn; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - unsigned crtc_mask; - int i, j; + int i; + + DBG(("%s(%s)\n", __FUNCTION__, output->name)); + assert(to_sna_output(output)); - assert(config->num_output < 32); - assert(config->num_crtc < 32); + RROutputDestroy(output->randr_output); + sna_output_destroy(output); - crtc_mask = (1 << config->num_crtc) - 1; + while (output->probed_modes) + xf86DeleteMode(&output->probed_modes, output->probed_modes); - /* Convert from encoder numbering to output numbering */ + free(output); + + for (i = 0; i < config->num_output; i++) + if (config->output[i] == output) + break; + assert(i < to_sna(scrn)->mode.num_real_output); + DBG(("%s: removing output #%d of %d\n", + __FUNCTION__, i, to_sna(scrn)->mode.num_real_output)); + + for (; i < config->num_output; i++) { + config->output[i] = config->output[i+1]; + config->output[i]->possible_clones >>= 1; + } + config->num_output--; + to_sna(scrn)->mode.num_real_output--; +} + +static void sort_randr_outputs(struct sna *sna, ScreenPtr screen) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); + rrScrPriv(screen); + int i; + + assert(pScrPriv->numOutputs == config->num_output); for (i = 0; i < config->num_output; i++) { + assert(config->output[i]->randr_output); + pScrPriv->outputs[i] = config->output[i]->randr_output; + } +} + +static void disable_unused_crtc(struct sna *sna) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); + bool update = false; + int o, c; + + for (c = 0; c < sna->mode.num_real_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; + + if (!crtc->enabled) + continue; + + + for (o = 0; o < sna->mode.num_real_output; o++) { + xf86OutputPtr output = config->output[o]; + if (output->crtc == crtc) + break; + } + + if (o == sna->mode.num_real_output) { + crtc->enabled = false; + update = true; + } + } + + if (update) + xf86DisableUnusedFunctions(sna->scrn); +} + +void sna_mode_discover(struct sna *sna) +{ + ScreenPtr screen = xf86ScrnToScreen(sna->scrn); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); + struct drm_mode_card_res res; + uint32_t connectors[32]; + unsigned changed = 0; + unsigned serial; + int i, j; + + DBG(("%s()\n", __FUNCTION__)); + VG_CLEAR(connectors); + + memset(&res, 0, sizeof(res)); + res.count_connectors = 32; + res.connector_id_ptr = (uintptr_t)connectors; + + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETRESOURCES, &res)) + return; + + DBG(("%s: now %d (was %d) connectors\n", __FUNCTION__, + res.count_connectors, sna->mode.num_real_output)); + if (res.count_connectors > 32) + return; + + assert(sna->mode.num_real_crtc == res.count_crtcs); + assert(sna->mode.max_crtc_width == res.max_width); + assert(sna->mode.max_crtc_height == res.max_height); + assert(sna->mode.num_real_encoder == res.count_encoders); + + serial = ++sna->mode.serial; + if (serial == 0) + serial = ++sna->mode.serial; + + for (i = 0; i < res.count_connectors; i++) { + DBG(("%s: connector[%d] = %d\n", __FUNCTION__, i, connectors[i])); + for (j = 0; j < sna->mode.num_real_output; j++) { + xf86OutputPtr output = config->output[j]; + if (to_sna_output(output)->id == connectors[i]) { + DBG(("%s: found %s (id=%d)\n", __FUNCTION__, output->name, connectors[i])); + assert(to_sna_output(output)->id); + to_sna_output(output)->serial = serial; + break; + } + } + if (j == sna->mode.num_real_output) { + DBG(("%s: adding id=%d\n", __FUNCTION__, connectors[i])); + changed |= sna_output_add(sna, connectors[i], serial) > 0; + } + } + + for (i = 0; i < sna->mode.num_real_output; i++) { xf86OutputPtr output = config->output[i]; - unsigned mask = output->possible_clones; - unsigned clones = 0; - for (j = 0; j < config->num_output; j++) { - if (mask & (1 << to_sna_output(config->output[j])->encoder_idx)) - clones |= 1 << j; + if (to_sna_output(output)->id == 0) + continue; + + if (to_sna_output(output)->serial == serial) + continue; + + DBG(("%s: removing output %s (id=%d), serial=%u [now %u]\n", + __FUNCTION__, output->name, to_sna_output(output)->id, + to_sna_output(output)->serial, serial)); + if (sna->flags & SNA_REMOVE_OUTPUTS) { + sna_output_del(output); i--; + } else { + to_sna_output(output)->id = 0; + output->crtc = NULL; } + changed |= 2; + } - output->possible_clones = clones; - output->possible_crtcs &= crtc_mask; + if (changed) { + DBG(("%s: outputs changed, broadcasting\n", __FUNCTION__)); - DBG(("%s: updated output '%s' %d [%d] (possible crtc:%x, possible clones:%x)\n", - __FUNCTION__, output->name, i, to_connector_id(output), - (uint32_t)output->possible_crtcs, - (uint32_t)output->possible_clones)); + sna_mode_compute_possible_outputs(sna); + + /* Reorder user visible listing */ + sort_randr_outputs(sna, screen); + + if (changed & 2) + disable_unused_crtc(sna); + + xf86RandR12TellChanged(screen); } } @@ -3033,8 +3938,8 @@ box.x2 = new->drawable.width - dx; (void)sna->render.copy_boxes(sna, GXcopy, - old, old_priv->gpu_bo, 0, 0, - new, new_priv->gpu_bo, dx, dy, + &old->drawable, old_priv->gpu_bo, 0, 0, + &new->drawable, new_priv->gpu_bo, dx, dy, &box, 1, 0); dx += old->drawable.width; } @@ -3068,16 +3973,13 @@ GXclear); } (void)sna->render.copy_boxes(sna, GXcopy, - old, old_priv->gpu_bo, sx, sy, - new, new_priv->gpu_bo, dx, dy, + &old->drawable, old_priv->gpu_bo, sx, sy, + &new->drawable, new_priv->gpu_bo, dx, dy, &box, 1, 0); } } - if (!DAMAGE_IS_ALL(new_priv->gpu_damage)) - sna_damage_all(&new_priv->gpu_damage, - new->drawable.width, - new->drawable.height); + sna_damage_all(&new_priv->gpu_damage, new); } static Bool @@ -3097,6 +3999,10 @@ if (scrn->virtualX == width && scrn->virtualY == height) return TRUE; + /* Paranoid defense against rogue internal calls by Xorg */ + if (width == 0 || height == 0) + return FALSE; + assert(sna->front); assert(screen->GetScreenPixmap(screen) == sna->front); @@ -3113,15 +4019,8 @@ "resizing framebuffer to %dx%d\n", width, height); - for (i = 0; i < config->num_crtc; i++) { - struct sna_crtc *crtc; - - crtc = to_sna_crtc(config->crtc[i]); - if (crtc == NULL) - continue; - - sna_crtc_disable_shadow(sna, crtc); - } + for (i = 0; i < sna->mode.num_real_crtc; i++) + sna_crtc_disable_shadow(sna, to_sna_crtc(config->crtc[i])); assert(sna->mode.shadow_active == 0); assert(sna->mode.shadow_damage == NULL); assert(sna->mode.shadow == NULL); @@ -3137,14 +4036,23 @@ scrn->virtualY = height; scrn->displayWidth = width; + /* Flush pending shadow updates */ + if (sna->mode.flip_active) { + DBG(("%s: waiting for %d outstanding TearFree flips\n", + __FUNCTION__, sna->mode.flip_active)); + while (sna->mode.flip_active && sna_mode_wait_for_event(sna)) + sna_mode_wakeup(sna); + } + /* Only update the CRTCs if we are in control */ if (!scrn->vtSema) return TRUE; - for (i = 0; i < config->num_crtc; i++) { + for (i = 0; i < sna->mode.num_real_crtc; i++) { xf86CrtcPtr crtc = config->crtc[i]; - if (!crtc->enabled || to_sna_crtc(crtc) == NULL) + assert(to_sna_crtc(crtc) != NULL); + if (!crtc->enabled) continue; if (!sna_crtc_set_mode_major(crtc, @@ -3161,100 +4069,990 @@ return TRUE; } -static int do_page_flip(struct sna *sna, struct kgem_bo *bo, - void *data, int ref_crtc_hw_id) +/* cursor handling */ +struct sna_cursor { + struct sna_cursor *next; + uint32_t *image; + Rotation rotation; + int ref; + int size; + int last_width; + int last_height; + unsigned handle; + unsigned serial; + unsigned alloc; +}; + +static void +rotate_coord(Rotation rotation, int size, + int x_dst, int y_dst, + int *x_src, int *y_src) { - xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); - int width = sna->scrn->virtualX; - int height = sna->scrn->virtualY; - int count = 0; - int i; + int t; - /* - * Queue flips on all enabled CRTCs - * Note that if/when we get per-CRTC buffers, we'll have to update this. - * Right now it assumes a single shared fb across all CRTCs, with the - * kernel fixing up the offset of each CRTC as necessary. - * - * Also, flips queued on disabled or incorrectly configured displays - * may never complete; this is a configuration error. - */ - for (i = 0; i < config->num_crtc; i++) { - struct sna_crtc *crtc = config->crtc[i]->driver_private; - struct drm_mode_crtc_page_flip arg; + switch (rotation & 0xf) { + case RR_Rotate_0: + break; + case RR_Rotate_90: + t = x_dst; + x_dst = size - y_dst - 1; + y_dst = t; + break; + case RR_Rotate_180: + x_dst = size - x_dst - 1; + y_dst = size - y_dst - 1; + break; + case RR_Rotate_270: + t = x_dst; + x_dst = y_dst; + y_dst = size - t - 1; + break; + } - DBG(("%s: crtc %d active? %d\n", - __FUNCTION__, i, crtc && crtc->bo)); - if (crtc == NULL || crtc->bo == NULL) - continue; + if (rotation & RR_Reflect_X) + x_dst = size - x_dst - 1; + if (rotation & RR_Reflect_Y) + y_dst = size - y_dst - 1; - arg.crtc_id = crtc->id; - arg.fb_id = get_fb(sna, bo, width, height); - if (arg.fb_id == 0) - goto disable; + *x_src = x_dst; + *y_src = y_dst; +} - /* Only the reference crtc will finally deliver its page flip - * completion event. All other crtc's events will be discarded. - */ - arg.user_data = (uintptr_t)data; - arg.user_data |= crtc->pipe == ref_crtc_hw_id; - arg.flags = DRM_MODE_PAGE_FLIP_EVENT; - arg.reserved = 0; +static void +rotate_coord_back(Rotation rotation, int size, int *x, int *y) +{ + int t; - DBG(("%s: crtc %d [ref? %d] --> fb %d\n", - __FUNCTION__, crtc->id, - crtc->pipe == ref_crtc_hw_id, arg.fb_id)); - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_PAGE_FLIP, &arg)) { - DBG(("%s: flip [fb=%d] on crtc %d [%d] failed - %d\n", - __FUNCTION__, arg.fb_id, i, crtc->id, errno)); -disable: - if (count == 0) - return 0; + if (rotation & RR_Reflect_X) + *x = size - *x - 1; + if (rotation & RR_Reflect_Y) + *y = size - *y - 1; - xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR, - "%s: page flipping failed, disabling CRTC:%d (pipe=%d)\n", - __FUNCTION__, crtc->id, crtc->pipe); - sna_crtc_disable(config->crtc[i]); + switch (rotation & 0xf) { + case RR_Rotate_0: + break; + case RR_Rotate_90: + t = *x; + *x = *y; + *y = size - t - 1; + break; + case RR_Rotate_180: + *x = size - *x - 1; + *y = size - *y - 1; + break; + case RR_Rotate_270: + t = *x; + *x = size - *y - 1; + *y = t; + break; + } +} + +static struct sna_cursor *__sna_create_cursor(struct sna *sna, int size) +{ + struct sna_cursor *c; + + for (c = sna->cursor.cursors; c; c = c->next) { + if (c->ref == 0 && c->alloc >= size) { + __DBG(("%s: stealing handle=%d, serial=%d, rotation=%d, alloc=%d\n", + __FUNCTION__, c->handle, c->serial, c->rotation, c->alloc)); + return c; + } + } + + __DBG(("%s(size=%d, num_stash=%d)\n", __FUNCTION__, size, sna->cursor.num_stash)); + + c = sna->cursor.stash; + assert(c); + + c->alloc = ALIGN(size, 4096); + c->handle = gem_create(sna->kgem.fd, c->alloc); + if (c->handle == 0) + return NULL; + + /* Old hardware uses physical addresses, which the kernel + * implements in an incoherent fashion requiring a pwrite. + */ + if (sna->cursor.use_gtt) { + c->image = gem_mmap(sna->kgem.fd, c->handle, c->alloc); + if (c->image == NULL) { + gem_close(sna->kgem.fd, c->handle); + return NULL; + } + } else + c->image = NULL; + + __DBG(("%s: handle=%d, allocated %d\n", __FUNCTION__, c->handle, size)); + + c->ref = 0; + c->serial = 0; + c->last_width = c->last_height = 0; /* all clear */ + + sna->cursor.num_stash--; + sna->cursor.stash = c->next; + + c->next = sna->cursor.cursors; + sna->cursor.cursors = c; + + return c; +} + +static uint32_t *get_cursor_argb(CursorPtr c) +{ +#ifdef ARGB_CURSOR + return (uint32_t *)c->bits->argb; +#else + return NULL; +#endif +} + +static struct sna_cursor *__sna_get_cursor(struct sna *sna, xf86CrtcPtr crtc) +{ + struct sna_cursor *cursor; + const uint8_t *source, *mask; + const uint32_t *argb; + uint32_t *image; + int width, height, pitch, size, x, y; + Rotation rotation; + + assert(sna->cursor.ref); + + cursor = to_sna_crtc(crtc)->cursor; + __DBG(("%s: current cursor handle=%d, serial=%d [expected %d]\n", + __FUNCTION__, + cursor ? cursor->handle : 0, + cursor ? cursor->serial : 0, + sna->cursor.serial)); + if (cursor && cursor->serial == sna->cursor.serial) { + assert(cursor->size == sna->cursor.size); + assert(cursor->rotation == crtc->transform_in_use ? crtc->rotation : RR_Rotate_0); + assert(cursor->ref); + return cursor; + } + + __DBG(("%s: cursor=%dx%d, serial=%d, argb?=%d\n", __FUNCTION__, + sna->cursor.ref->bits->width, + sna->cursor.ref->bits->height, + sna->cursor.serial, + get_cursor_argb(c) != NULL)); + + rotation = crtc->transform_in_use ? crtc->rotation : RR_Rotate_0; + + if (sna->cursor.use_gtt) { /* Don't allow phys cursor sharing */ + for (cursor = sna->cursor.cursors; cursor; cursor = cursor->next) { + if (cursor->serial == sna->cursor.serial && cursor->rotation == rotation) { + __DBG(("%s: reusing handle=%d, serial=%d, rotation=%d, size=%d\n", + __FUNCTION__, cursor->handle, cursor->serial, cursor->rotation, cursor->size)); + assert(cursor->size == sna->cursor.size); + return cursor; + } + } + + cursor = to_sna_crtc(crtc)->cursor; + } + + size = sna->cursor.size; + if (cursor && cursor->alloc < 4*size*size) + cursor = NULL; + + if (cursor == NULL) { + cursor = __sna_create_cursor(sna, 4*size*size); + if (cursor == NULL) + return NULL; + } + + width = sna->cursor.ref->bits->width; + height = sna->cursor.ref->bits->height; + source = sna->cursor.ref->bits->source; + mask = sna->cursor.ref->bits->mask; + argb = get_cursor_argb(sna->cursor.ref); + pitch = BitmapBytePad(width); + + image = cursor->image; + if (image == NULL) { + image = sna->cursor.scratch; + cursor->last_width = cursor->last_height = size; + } + if (width < cursor->last_width || height < cursor->last_height) + memset(image, 0, 4*size*size); + if (rotation == RR_Rotate_0) { + if (argb == NULL) { + for (y = 0; y < height; y++) { + uint32_t *p = image + y*size; + for (x = 0; x < width; x++) { + int byte = x / 8; + int bit = x & 7; + uint32_t pixel; + if (mask[byte] & (1 << bit)) { + if (source[byte] & (1 << bit)) + pixel = sna->cursor.fg; + else + pixel = sna->cursor.bg; + } else + pixel = 0; + *p++ = pixel; + } + mask += pitch; + source += pitch; + } + } else + memcpy_blt(argb, image, 32, + width * 4, size * 4, + 0, 0, + 0, 0, + width, height); + } else { + for (y = 0; y < size; y++) + for (x = 0; x < size; x++) { + uint32_t pixel; + int xin, yin; + + rotate_coord(rotation, size, x, y, &xin, &yin); + if (xin < width && yin < height) + if (argb == NULL) { + int byte = xin / 8; + int bit = xin & 7; + if (mask[yin*pitch + byte] & (1 << bit)) { + if (source[yin*pitch + byte] & (1 << bit)) + pixel = sna->cursor.fg; + else + pixel = sna->cursor.bg; + } else + pixel = 0; + } else + pixel = argb[yin * width + xin]; + else + pixel = 0; + image[y * size + x] = pixel; + } + } + + if (image != cursor->image) { + struct drm_i915_gem_pwrite pwrite; + + VG_CLEAR(pwrite); + pwrite.handle = cursor->handle; + pwrite.offset = 0; + pwrite.size = 4*size*size; + pwrite.data_ptr = (uintptr_t)image; + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_PWRITE, &pwrite)) + __DBG(("%s: cursor update (pwrite) failed: %d\n", __FUNCTION__, errno)); + } + + cursor->size = size; + cursor->rotation = rotation; + cursor->serial = sna->cursor.serial; + cursor->last_width = width; + cursor->last_height = height; + return cursor; +} + +static unsigned char * +sna_realize_cursor(xf86CursorInfoPtr info, CursorPtr cursor) +{ + return NULL; +} + +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,12,99,901,0) +static inline int sigio_block(void) +{ + OsBlockSIGIO(); + return 0; +} +static inline void sigio_unblock(int was_blocked) +{ + OsReleaseSIGIO(); + (void)was_blocked; +} +#else +#include +static inline int sigio_block(void) +{ + return xf86BlockSIGIO(); +} +static inline void sigio_unblock(int was_blocked) +{ + xf86UnblockSIGIO(was_blocked); +} +#endif + +static void +sna_show_cursors(ScrnInfoPtr scrn) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + struct sna *sna = to_sna(scrn); + int sigio, c; + + __DBG(("%s\n", __FUNCTION__)); + if (sna->cursor.ref == NULL) + return; + + sigio = sigio_block(); + for (c = 0; c < sna->mode.num_real_crtc; c++) { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + struct sna_crtc *sna_crtc = to_sna_crtc(crtc); + struct drm_mode_cursor arg; + struct sna_cursor *cursor; + + assert(sna_crtc != NULL); + if (sna_crtc->bo == NULL) + continue; + + if (!crtc->cursor_in_range) + continue; + + if (sna_crtc->cursor) continue; + + cursor = __sna_get_cursor(sna, crtc); + if (cursor == NULL) + continue; + + __DBG(("%s: CRTC:%d, handle->%d\n", __FUNCTION__, + sna_crtc->id, cursor->handle)); + + VG_CLEAR(arg); + arg.flags = DRM_MODE_CURSOR_BO; + arg.crtc_id = sna_crtc->id; + arg.width = arg.height = cursor->size; + arg.handle = cursor->handle; + + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg) == 0) { + cursor->ref++; + sna_crtc->cursor = cursor; } + } + sigio_unblock(sigio); +} + +static void +sna_set_cursor_colors(ScrnInfoPtr scrn, int _bg, int _fg) +{ + struct sna *sna = to_sna(scrn); + uint32_t fg = _fg, bg = _bg; + + __DBG(("%s(%08x, %08x)\n", __FUNCTION__, bg, fg)); + + /* Save ARGB versions of these colors */ + fg |= 0xff000000; + bg |= 0xff000000; + if (fg == sna->cursor.fg && bg == sna->cursor.bg) + return; + + sna->cursor.fg = fg; + sna->cursor.bg = bg; + + if (sna->cursor.ref == NULL) + return; + + if (get_cursor_argb(sna->cursor.ref)) + return; + + sna->cursor.serial++; + __DBG(("%s: serial->%d\n", __FUNCTION__, sna->cursor.serial)); + + sna_show_cursors(scrn); +} + +static void +sna_crtc_disable_cursor(struct sna *sna, struct sna_crtc *crtc) +{ + struct drm_mode_cursor arg; + + if (!crtc->cursor) + return; + + DBG(("%s: CRTC:%d, handle=%d\n", __FUNCTION__, crtc->id, crtc->cursor->handle)); + assert(crtc->cursor->ref); + + VG_CLEAR(arg); + arg.flags = DRM_MODE_CURSOR_BO; + arg.crtc_id = crtc->id; + arg.width = arg.height = 0; + arg.handle = 0; + + (void)drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg); + assert(crtc->cursor->ref > 0); + crtc->cursor->ref--; + crtc->cursor = NULL; +} + +static void +sna_hide_cursors(ScrnInfoPtr scrn) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + struct sna *sna = to_sna(scrn); + struct sna_cursor *cursor, **prev; + int sigio, c; + + __DBG(("%s\n", __FUNCTION__)); + + sigio = sigio_block(); + for (c = 0; c < sna->mode.num_real_crtc; c++) { + assert(to_sna_crtc(xf86_config->crtc[c])); + sna_crtc_disable_cursor(sna, to_sna_crtc(xf86_config->crtc[c])); + } + + for (prev = &sna->cursor.cursors; (cursor = *prev) != NULL; ) { + assert(cursor->ref == 0); + + if (cursor->serial == sna->cursor.serial) { + prev = &cursor->next; + continue; + } + + *prev = cursor->next; + if (cursor->image) + munmap(cursor->image, cursor->alloc); + gem_close(sna->kgem.fd, cursor->handle); + + cursor->next = sna->cursor.stash; + sna->cursor.stash = cursor; + sna->cursor.num_stash++; + } + + sigio_unblock(sigio); +} + +static void +sna_set_cursor_position(ScrnInfoPtr scrn, int x, int y) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + struct sna *sna = to_sna(scrn); + int sigio, c; + + __DBG(("%s(%d, %d), cursor? %d\n", __FUNCTION__, + x, y, sna->cursor.ref!=NULL)); + if (sna->cursor.ref == NULL) + return; + + sigio = sigio_block(); + sna->cursor.last_x = x; + sna->cursor.last_y = y; + + /* undo what xf86HWCurs did to the coordinates */ + x += scrn->frameX0; + y += scrn->frameY0; + for (c = 0; c < sna->mode.num_real_crtc; c++) { + xf86CrtcPtr crtc = xf86_config->crtc[c]; + struct sna_crtc *sna_crtc = to_sna_crtc(crtc); + struct sna_cursor *cursor = NULL; + struct drm_mode_cursor arg; + + assert(sna_crtc != NULL); + + VG_CLEAR(arg); + arg.flags = 0; + arg.crtc_id = sna_crtc->id; + arg.handle = 0; + + if (sna_crtc->bo == NULL) + goto disable; + + if (crtc->transform_in_use) { + int xhot = sna->cursor.ref->bits->xhot; + int yhot = sna->cursor.ref->bits->yhot; + struct pict_f_vector v; + + v.v[0] = (x + xhot) + 0.5; + v.v[1] = (y + yhot) + 0.5; + v.v[2] = 1; + pixman_f_transform_point(&crtc->f_framebuffer_to_crtc, &v); + + rotate_coord_back(crtc->rotation, sna->cursor.size, &xhot, &yhot); + + /* cursor will have 0.5 added to it already so floor is sufficent */ + arg.x = floor(v.v[0]) - xhot; + arg.y = floor(v.v[1]) - yhot; + } else { + arg.x = x - crtc->x; + arg.y = y - crtc->y; + } + + if (arg.x < crtc->mode.HDisplay && arg.x > -sna->cursor.size && + arg.y < crtc->mode.VDisplay && arg.y > -sna->cursor.size) { + cursor = __sna_get_cursor(sna, crtc); + if (cursor == NULL) + cursor = sna_crtc->cursor; + if (cursor == NULL || cursor->size > sna->cursor.size) { + __DBG(("%s: failed to grab cursor, disabling\n", + __FUNCTION__)); + goto disable; + } + + if (sna_crtc->cursor != cursor) { + arg.flags |= DRM_MODE_CURSOR_BO; + arg.handle = cursor->handle; + } + + arg.width = arg.height = cursor->size; + arg.flags |= DRM_MODE_CURSOR_MOVE; + crtc->cursor_in_range = true; + } else { + crtc->cursor_in_range = false; +disable: + if (sna_crtc->cursor) { + arg.flags = DRM_MODE_CURSOR_BO; + arg.width = arg.height = 0; + } + cursor = NULL; + } + + __DBG(("%s: CRTC:%d (%d, %d), handle=%d, flags=%x (old cursor handle=%d), move? %d, update handle? %d\n", + __FUNCTION__, sna_crtc->id, arg.x, arg.y, arg.handle, arg.flags, sna_crtc->cursor ? sna_crtc->cursor->handle : 0, + arg.flags & DRM_MODE_CURSOR_MOVE, arg.flags & DRM_MODE_CURSOR_BO)); + + if (arg.flags && + drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_CURSOR, &arg) == 0) { + if (arg.flags & DRM_MODE_CURSOR_BO) { + if (sna_crtc->cursor) { + assert(sna_crtc->cursor->ref > 0); + sna_crtc->cursor->ref--; + } + sna_crtc->cursor = cursor; + if (cursor) + cursor->ref++; + } + } + } + sigio_unblock(sigio); +} + +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,902,2) +static Bool +sna_load_cursor_argb2(ScrnInfoPtr scrn, CursorPtr cursor) +{ + return TRUE; +} + +static Bool +sna_load_cursor_image2(ScrnInfoPtr scrn, unsigned char *src) +{ + return TRUE; +} +#endif + +static void +sna_load_cursor_argb(ScrnInfoPtr scrn, CursorPtr cursor) +{ +} + +static void +sna_load_cursor_image(ScrnInfoPtr scrn, unsigned char *src) +{ +} + +static int __cursor_size(CursorPtr cursor) +{ + int i, size; + + i = MAX(cursor->bits->width, cursor->bits->height); + for (size = 64; size < i; size <<= 1) + ; + + return size; +} + +static bool +sna_cursor_preallocate(struct sna *sna) +{ + while (sna->cursor.num_stash < 0) { + struct sna_cursor *cursor = malloc(sizeof(*cursor)); + if (!cursor) + return false; + + cursor->next = sna->cursor.stash; + sna->cursor.stash = cursor; + + sna->cursor.num_stash++; + } + + return true; +} + +static Bool +sna_use_hw_cursor(ScreenPtr screen, CursorPtr cursor) +{ + struct sna *sna = to_sna_from_screen(screen); + + __DBG(("%s (%dx%d)\n", __FUNCTION__, + cursor->bits->width, cursor->bits->height)); + + /* cursors are invariant */ + if (cursor == sna->cursor.ref) + return TRUE; + + if (sna->cursor.ref) { + FreeCursor(sna->cursor.ref, None); + sna->cursor.ref = NULL; + } + + sna->cursor.size = __cursor_size(cursor); + if (sna->cursor.size > sna->cursor.max_size) + return FALSE; + + if (!sna_cursor_preallocate(sna)) + return FALSE; + + sna->cursor.ref = cursor; + cursor->refcnt++; + sna->cursor.serial++; + + __DBG(("%s(%dx%d): ARGB?=%d, serial->%d, size->%d\n", __FUNCTION__, + cursor->bits->width, + cursor->bits->height, + get_cursor_argb(cursor) != NULL, + sna->cursor.serial, + sna->cursor.size)); + + return TRUE; +} + +static void +sna_cursor_pre_init(struct sna *sna) +{ + struct local_get_cap { + uint64_t name; + uint64_t value; + } cap; + int v; + + if (sna->mode.num_real_crtc == 0) + return; + +#define LOCAL_IOCTL_GET_CAP DRM_IOWR(0x0c, struct local_get_cap) +#define DRM_CAP_CURSOR_WIDTH 8 +#define DRM_CAP_CURSOR_HEIGHT 9 + +#define I915_PARAM_HAS_COHERENT_PHYS_GTT 29 + + sna->cursor.max_size = 64; + + cap.value = 0; + cap.name = DRM_CAP_CURSOR_WIDTH; + if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_GET_CAP, &cap) == 0) + sna->cursor.max_size = cap.value; + +#if HAS_DEBUG_FULL + cap.name = DRM_CAP_CURSOR_HEIGHT; + if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_GET_CAP, &cap) == 0) + assert(sna->cursor.max_size == cap.value); +#endif + + v = -1; /* No param uses the sign bit, reserve it for errors */ + if (sna->kgem.gen >= 033) { + v = 1; + } else { + drm_i915_getparam_t gp = { + I915_PARAM_HAS_COHERENT_PHYS_GTT, + &v, + }; + (void)drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GETPARAM, &gp); + } + sna->cursor.use_gtt = v > 0; + DBG(("%s: cursor updates use_gtt?=%d\n", + __FUNCTION__, sna->cursor.use_gtt)); + + if (!sna->cursor.use_gtt) { + sna->cursor.scratch = malloc(sna->cursor.max_size * sna->cursor.max_size * 4); + if (!sna->cursor.scratch) + sna->cursor.max_size = 0; + } + + sna->cursor.num_stash = -sna->mode.num_real_crtc; + + xf86DrvMsg(sna->scrn->scrnIndex, X_PROBED, + "Using a maximum size of %dx%d for hardware cursors\n", + sna->cursor.max_size, sna->cursor.max_size); +} + +static void +sna_cursor_close(struct sna *sna) +{ + sna->cursor.serial = 0; + sna_hide_cursors(sna->scrn); + + while (sna->cursor.stash) { + struct sna_cursor *cursor = sna->cursor.stash; + sna->cursor.stash = cursor->next; + free(cursor); + } + + sna->cursor.num_stash = -sna->mode.num_real_crtc; +} + +bool +sna_cursors_init(ScreenPtr screen, struct sna *sna) +{ + xf86CursorInfoPtr cursor_info; + + if (sna->cursor.max_size == 0) + return false; + + cursor_info = xf86CreateCursorInfoRec(); + if (cursor_info == NULL) + return false; + + cursor_info->MaxWidth = sna->cursor.max_size; + cursor_info->MaxHeight = sna->cursor.max_size; + cursor_info->Flags = (HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | + HARDWARE_CURSOR_UPDATE_UNHIDDEN | + HARDWARE_CURSOR_ARGB); + + cursor_info->RealizeCursor = sna_realize_cursor; + cursor_info->SetCursorColors = sna_set_cursor_colors; + cursor_info->SetCursorPosition = sna_set_cursor_position; + cursor_info->LoadCursorImage = sna_load_cursor_image; + cursor_info->HideCursor = sna_hide_cursors; + cursor_info->ShowCursor = sna_show_cursors; + cursor_info->UseHWCursor = sna_use_hw_cursor; +#ifdef ARGB_CURSOR + cursor_info->UseHWCursorARGB = sna_use_hw_cursor; + cursor_info->LoadCursorARGB = sna_load_cursor_argb; +#endif +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,902,3) + cursor_info->LoadCursorImageCheck = sna_load_cursor_image2; +#ifdef ARGB_CURSOR + cursor_info->LoadCursorARGBCheck = sna_load_cursor_argb2; +#endif +#endif + + if (!xf86InitCursor(screen, cursor_info)) { + xf86DestroyCursorInfoRec(cursor_info); + return false; + } + + sna->cursor.info = cursor_info; + return true; +} + +static void +sna_cursors_reload(struct sna *sna) +{ + sna_set_cursor_position(sna->scrn, + sna->cursor.last_x, + sna->cursor.last_y); +} + +static void +sna_cursors_fini(struct sna *sna) +{ + if (sna->cursor.info) { + xf86DestroyCursorInfoRec(sna->cursor.info); + sna->cursor.info = NULL; + } + + if (sna->cursor.ref) { + FreeCursor(sna->cursor.ref, None); + sna->cursor.ref = NULL; + } +} + +static bool +sna_crtc_flip(struct sna *sna, struct sna_crtc *crtc, struct kgem_bo *bo, int x, int y) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); + struct drm_mode_crtc arg; + uint32_t output_ids[32]; + int output_count = 0; + int i; + + DBG(("%s CRTC:%d [pipe=%d], handle=%d\n", __FUNCTION__, crtc->id, crtc->pipe, bo->handle)); + + assert(sna->mode.num_real_output < ARRAY_SIZE(output_ids)); + + for (i = 0; i < sna->mode.num_real_output; i++) { + xf86OutputPtr output = config->output[i]; + + if (output->crtc != crtc->base) + continue; + + DBG(("%s: attaching output '%s' %d [%d] to crtc:%d (pipe %d) (possible crtc:%x, possible clones:%x)\n", + __FUNCTION__, output->name, i, to_connector_id(output), + crtc->id, crtc->pipe, + (uint32_t)output->possible_crtcs, + (uint32_t)output->possible_clones)); + + assert(output->possible_crtcs & (1 << crtc->pipe) || + xf86IsEntityShared(sna->scrn->entityList[0])); + + output_ids[output_count] = to_connector_id(output); + if (++output_count == ARRAY_SIZE(output_ids)) + return false; + } + + VG_CLEAR(arg); + arg.crtc_id = crtc->id; + arg.fb_id = fb_id(bo); + assert(arg.fb_id); + arg.x = x; + arg.y = y; + arg.set_connectors_ptr = (uintptr_t)output_ids; + arg.count_connectors = output_count; + arg.mode = crtc->kmode; + arg.mode_valid = 1; + + DBG(("%s: applying crtc [%d, pipe=%d] mode=%dx%d+%d+%d@%d, fb=%d across %d outputs [%d...]\n", + __FUNCTION__, crtc->id, crtc->pipe, + arg.mode.hdisplay, + arg.mode.vdisplay, + arg.x, arg.y, + arg.mode.clock, + arg.fb_id, + output_count, output_count ? output_ids[0] : 0)); + + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETCRTC, &arg)) + return false; + + crtc->offset = y << 16 | x; + return true; +} + +int +sna_page_flip(struct sna *sna, + struct kgem_bo *bo, + sna_flip_handler_t handler, + void *data) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); + const int width = sna->scrn->virtualX; + const int height = sna->scrn->virtualY; + int count = 0; + int i; + + DBG(("%s: handle %d attached\n", __FUNCTION__, bo->handle)); + assert(bo->refcnt); + + assert((sna->flags & SNA_IS_HOSTED) == 0); + assert((sna->flags & SNA_TEAR_FREE) == 0); + assert(sna->mode.flip_active == 0); + assert(sna->mode.front_active); + assert(sna->scrn->vtSema); + + if ((sna->flags & (data ? SNA_HAS_FLIP : SNA_HAS_ASYNC_FLIP)) == 0) + return 0; + + kgem_bo_submit(&sna->kgem, bo); + + for (i = 0; i < sna->mode.num_real_crtc; i++) { + struct sna_crtc *crtc = config->crtc[i]->driver_private; + struct drm_mode_crtc_page_flip arg; + uint32_t crtc_offset; + + DBG(("%s: crtc %d id=%d, pipe=%d active? %d\n", + __FUNCTION__, i, crtc->id, crtc->pipe, crtc->bo != NULL)); + if (crtc->bo == NULL) + continue; + assert(!crtc->transform); + assert(!crtc->slave_pixmap); + assert(crtc->bo->active_scanout); + assert(crtc->bo->refcnt >= crtc->bo->active_scanout); + assert(crtc->flip_bo == NULL); + + arg.crtc_id = crtc->id; + arg.fb_id = get_fb(sna, bo, width, height); + if (arg.fb_id == 0) { + assert(count == 0); + return 0; + } + + crtc_offset = crtc->base->y << 16 | crtc->base->x; + + if (bo->pitch != crtc->bo->pitch || crtc_offset != crtc->offset) { + DBG(("%s: changing pitch (%d == %d) or offset (%x == %x)\n", + __FUNCTION__, + bo->pitch, crtc->bo->pitch, + crtc_offset, crtc->offset)); +fixup_flip: + if (crtc->bo != bo && sna_crtc_flip(sna, crtc, bo, crtc->base->x, crtc->base->y)) { + assert(crtc->bo->active_scanout); + assert(crtc->bo->refcnt >= crtc->bo->active_scanout); + crtc->bo->active_scanout--; + kgem_bo_destroy(&sna->kgem, crtc->bo); + + crtc->bo = kgem_bo_reference(bo); + crtc->bo->active_scanout++; + + if (data == NULL) + goto next_crtc; + + /* queue a flip in order to send the event */ + } else { + if (count && !xf86SetDesiredModes(sna->scrn)) { + xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR, + "failed to restore display configuration\n"); + for (; i < sna->mode.num_real_crtc; i++) + sna_crtc_disable(config->crtc[i]); + } + return 0; + } + } + + /* Only the reference crtc will finally deliver its page flip + * completion event. All other crtc's events will be discarded. + */ + if (data) { + arg.user_data = (uintptr_t)crtc; + arg.flags = DRM_MODE_PAGE_FLIP_EVENT; + } else { + arg.user_data = 0; + arg.flags = DRM_MODE_PAGE_FLIP_ASYNC; + } + arg.reserved = 0; + +retry_flip: + DBG(("%s: crtc %d id=%d, pipe=%d --> fb %d\n", + __FUNCTION__, i, crtc->id, crtc->pipe, arg.fb_id)); + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_PAGE_FLIP, &arg)) { + ERR(("%s: pageflip failed with err=%d\n", __FUNCTION__, errno)); + + if (errno == EBUSY) { + struct drm_mode_crtc mode; + + memset(&mode, 0, sizeof(mode)); + mode.crtc_id = crtc->id; + drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode); + + DBG(("%s: crtc=%d, valid?=%d, fb attached?=%d, expected=%d\n", + __FUNCTION__, + mode.crtc_id, mode.mode_valid, + mode.fb_id, fb_id(crtc->bo))); + + if (mode.fb_id != fb_id(crtc->bo)) + goto fixup_flip; + + if (count == 0) + return 0; + + DBG(("%s: throttling on busy flip / waiting for kernel to catch up\n", __FUNCTION__)); + drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_THROTTLE, 0); + sna->kgem.need_throttle = false; + + goto retry_flip; + } - if (crtc->bo != bo) { - kgem_bo_destroy(&sna->kgem, crtc->bo); - crtc->bo = kgem_bo_reference(bo); + xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR, + "page flipping failed, on CRTC:%d (pipe=%d), disabling %s page flips\n", + crtc->id, crtc->pipe, data ? "synchronous": "asynchronous"); + sna->flags &= ~(data ? SNA_HAS_FLIP : SNA_HAS_ASYNC_FLIP); + goto fixup_flip; + } + + if (data) { + assert(crtc->flip_bo == NULL); + crtc->flip_handler = handler; + crtc->flip_data = data; + crtc->flip_bo = kgem_bo_reference(bo); + crtc->flip_bo->active_scanout++; + crtc->flip_serial = crtc->mode_serial; + sna->mode.flip_active++; } +next_crtc: count++; } - return count; -} - -int -sna_page_flip(struct sna *sna, - struct kgem_bo *bo, - void *data, - int ref_crtc_hw_id) -{ - int count; - - DBG(("%s: handle %d attached\n", __FUNCTION__, bo->handle)); - assert(bo->refcnt); - assert((sna->flags & SNA_IS_HOSTED) == 0); - - kgem_bo_submit(&sna->kgem, bo); - - /* - * Queue flips on all enabled CRTCs - * Note that if/when we get per-CRTC buffers, we'll have to update this. - * Right now it assumes a single shared fb across all CRTCs, with the - * kernel fixing up the offset of each CRTC as necessary. - * - * Also, flips queued on disabled or incorrectly configured displays - * may never complete; this is a configuration error. - */ - count = do_page_flip(sna, bo, data, ref_crtc_hw_id); DBG(("%s: page flipped %d crtcs\n", __FUNCTION__, count)); - return count; } @@ -3268,7 +5066,7 @@ * crtc limits, so if the mode exceeds the scanout restrictions, * we will quietly convert that to per-crtc pixmaps. */ - xf86CrtcSetSizeRange(sna->scrn, 320, 200, INT16_MAX, INT16_MAX); + xf86CrtcSetSizeRange(sna->scrn, 8, 8, INT16_MAX, INT16_MAX); } enum { /* XXX copied from hw/xfree86/modes/xf86Crtc.c */ @@ -3347,6 +5145,8 @@ struct drm_mode_crtc_lut lut; bool gamma_set = false; + assert(sna_crtc); + lut.crtc_id = sna_crtc->id; lut.gamma_size = 256; lut.red = (uintptr_t)(gamma); @@ -3404,49 +5204,48 @@ { ScrnInfoPtr scrn = sna->scrn; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - const int user_overrides[] = { - OPTION_POSITION, - OPTION_BELOW, - OPTION_RIGHT_OF, - OPTION_ABOVE, - OPTION_LEFT_OF, - OPTION_ROTATE, - OPTION_PANNING, - }; int width, height; int i, j; assert((sna->flags & SNA_IS_HOSTED) == 0); - if (xf86ReturnOptValBool(sna->Options, OPTION_REPROBE, FALSE)) { - DBG(("%s: user requests reprobing\n", __FUNCTION__)); - return false; - } - - /* First scan through all outputs and look for user overrides */ - for (i = 0; i < config->num_output; i++) { - xf86OutputPtr output = config->output[i]; + if ((sna->flags & SNA_IS_SLAVED) == 0) { + const int user_overrides[] = { + OPTION_POSITION, + OPTION_BELOW, + OPTION_RIGHT_OF, + OPTION_ABOVE, + OPTION_LEFT_OF, + OPTION_ROTATE, + OPTION_PANNING, + }; + if (xf86ReturnOptValBool(sna->Options, OPTION_REPROBE, FALSE)) { + DBG(("%s: user requests reprobing\n", __FUNCTION__)); + return false; + } - for (j = 0; j < ARRAY_SIZE(user_overrides); j++) { - if (xf86GetOptValString(output->options, user_overrides[j])) { - DBG(("%s: user placement [%d] for %s\n", - __FUNCTION__, - user_overrides[j], - output->name)); - return false; + /* First scan through all outputs and look for user overrides */ + for (i = 0; i < sna->mode.num_real_output; i++) { + xf86OutputPtr output = config->output[i]; + + for (j = 0; j < ARRAY_SIZE(user_overrides); j++) { + if (xf86GetOptValString(output->options, user_overrides[j])) { + DBG(("%s: user placement [%d] for %s\n", + __FUNCTION__, + user_overrides[j], + output->name)); + return false; + } } } } /* Copy the existing modes on each CRTCs */ - for (i = 0; i < config->num_crtc; i++) { + for (i = 0; i < sna->mode.num_real_crtc; i++) { xf86CrtcPtr crtc = config->crtc[i]; struct sna_crtc *sna_crtc = to_sna_crtc(crtc); struct drm_mode_crtc mode; - if (sna_crtc == NULL) - continue; - crtc->enabled = FALSE; crtc->desiredMode.status = MODE_NOMODE; @@ -3466,36 +5265,41 @@ continue; mode_from_kmode(scrn, &mode.mode, &crtc->desiredMode); - crtc->desiredRotation = RR_Rotate_0; + crtc->desiredRotation = sna_crtc->primary.rotation.current; crtc->desiredX = mode.x; crtc->desiredY = mode.y; crtc->desiredTransformPresent = FALSE; } /* Reconstruct outputs pointing to active CRTC */ - for (i = 0; i < config->num_output; i++) { + for (i = 0; i < sna->mode.num_real_output; i++) { xf86OutputPtr output = config->output[i]; uint32_t crtc_id; - if (to_sna_output(output) == NULL) { - assert(output->crtc == NULL); - continue; - } + assert(to_sna_output(output)); crtc_id = (uintptr_t)output->crtc; output->crtc = NULL; + if (sna->flags & SNA_IS_SLAVED) + continue; - if (crtc_id == 0) + if (crtc_id == 0) { + DBG(("%s: not using output %s, disconnected\n", + __FUNCTION__, output->name)); continue; + } - if (xf86ReturnOptValBool(output->options, OPTION_DISABLE, 0)) + if (xf86ReturnOptValBool(output->options, OPTION_DISABLE, 0)) { + DBG(("%s: not using output %s, manually disabled\n", + __FUNCTION__, output->name)); continue; + } - for (j = 0; j < config->num_crtc; j++) { + for (j = 0; j < sna->mode.num_real_crtc; j++) { xf86CrtcPtr crtc = config->crtc[j]; - if (to_sna_crtc(crtc) == NULL || - to_sna_crtc(crtc)->id != crtc_id) + assert(to_sna_crtc(crtc)); + if (to_sna_crtc(crtc)->id != crtc_id) continue; if (crtc->desiredMode.status == MODE_OK) { @@ -3503,14 +5307,17 @@ const char *pref; pref = preferred_mode(output); - if (pref && strcmp(pref, crtc->desiredMode.name)) + if (pref && strcmp(pref, crtc->desiredMode.name)) { + DBG(("%s: output %s user requests a different preferred mode %s, found %s\n", + __FUNCTION__, output->name, pref, crtc->desiredMode.name)); return false; + } xf86DrvMsg(scrn->scrnIndex, X_PROBED, - "Output %s using initial mode %s on pipe %d\n", - output->name, - crtc->desiredMode.name, - to_sna_crtc(crtc)->pipe); + "Output %s using initial mode %s on pipe %d\n", + output->name, + crtc->desiredMode.name, + to_sna_crtc(crtc)->pipe); output->crtc = crtc; crtc->enabled = TRUE; @@ -3534,7 +5341,7 @@ break; } - if (j == config->num_crtc) { + if (j == sna->mode.num_real_crtc) { /* Can not find the earlier associated CRTC, bail */ DBG(("%s: existing setup conflicts with output assignment (Zaphod), reprobing\n", __FUNCTION__)); @@ -3543,7 +5350,7 @@ } width = height = 0; - for (i = 0; i < config->num_crtc; i++) { + for (i = 0; i < sna->mode.num_real_crtc; i++) { xf86CrtcPtr crtc = config->crtc[i]; int w, h; @@ -3586,11 +5393,74 @@ config->output[i]->crtc = NULL; } +static bool has_flip(struct sna *sna) +{ + drm_i915_getparam_t gp; + int v; + + if (sna->flags & SNA_NO_FLIP) + return false; + + v = 0; + + VG_CLEAR(gp); + gp.param = I915_PARAM_HAS_PAGEFLIPPING; + gp.value = &v; + + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GETPARAM, &gp)) + return false; + + VG(VALGRIND_MAKE_MEM_DEFINED(&v, sizeof(v))); + return v > 0; +} + +static bool has_flip__async(struct sna *sna) +{ +#define DRM_CAP_ASYNC_PAGE_FLIP 0x7 + struct local_get_cap { + uint64_t name; + uint64_t value; + } cap = { DRM_CAP_ASYNC_PAGE_FLIP }; + + if (sna->flags & SNA_NO_FLIP) + return false; + + if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_GET_CAP, &cap) == 0) + return cap.value > 0; + + return false; +} + static void +probe_capabilities(struct sna *sna) +{ + sna->flags &= ~(SNA_HAS_FLIP | SNA_HAS_ASYNC_FLIP); + if (has_flip(sna)) + sna->flags |= SNA_HAS_FLIP; + if (has_flip__async(sna)) + sna->flags |= SNA_HAS_ASYNC_FLIP; + DBG(("%s: page flips? %s, async? %s\n", __FUNCTION__, + sna->flags & SNA_HAS_FLIP ? "enabled" : "disabled", + sna->flags & SNA_HAS_ASYNC_FLIP ? "enabled" : "disabled")); +} + +void sna_crtc_config_notify(ScreenPtr screen) { - DBG(("%s\n", __FUNCTION__)); - sna_mode_update(to_sna_from_screen(screen)); + struct sna *sna = to_sna_from_screen(screen); + + DBG(("%s(dirty?=%d)\n", __FUNCTION__, sna->mode.dirty)); + if (!sna->mode.dirty) + return; + + probe_capabilities(sna); + update_flush_interval(sna); + + sna_cursors_reload(sna); + + sna_present_update(sna); + + sna->mode.dirty = false; } #if HAS_PIXMAP_SHARING @@ -3601,7 +5471,7 @@ bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna) { - struct sna_mode *mode = &sna->mode; + drmModeResPtr res; int num_fake = 0; int i; @@ -3610,24 +5480,59 @@ return true; } + probe_capabilities(sna); + if (!xf86GetOptValInteger(sna->Options, OPTION_VIRTUAL, &num_fake)) num_fake = 1; - mode->kmode = drmModeGetResources(sna->kgem.fd); - if (mode->kmode) { + res = drmModeGetResources(sna->kgem.fd); + if (res && + (res->count_crtcs == 0 || + res->count_encoders == 0 || + res->count_connectors == 0)) { + drmModeFreeResources(res); + res = NULL; + } + if (res) { + xf86CrtcConfigPtr xf86_config; + + assert(res->count_crtcs); + assert(res->count_connectors); + xf86CrtcConfigInit(scrn, &sna_mode_funcs); - XF86_CRTC_CONFIG_PTR(scrn)->xf86_crtc_notify = sna_crtc_config_notify; - for (i = 0; i < mode->kmode->count_crtcs; i++) - if (!sna_crtc_init(scrn, mode, i)) + xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + xf86_config->xf86_crtc_notify = sna_crtc_config_notify; + + for (i = 0; i < res->count_crtcs; i++) + if (!sna_crtc_add(scrn, res->crtcs[i])) return false; - for (i = 0; i < mode->kmode->count_connectors; i++) - if (!sna_output_init(scrn, mode, i)) + sna->mode.num_real_crtc = xf86_config->num_crtc; + + sna->mode.num_real_encoder = res->count_encoders; + sna->mode.encoders = res->encoders; + res->encoders = NULL; + + for (i = 0; i < res->count_connectors; i++) + if (sna_output_add(sna, res->connectors[i], 0) < 0) return false; - if (!xf86IsEntityShared(scrn->entityList[0])) - sna_mode_compute_possible_outputs(scrn); + sna->mode.num_real_output = xf86_config->num_output; + + sna_mode_compute_possible_outputs(sna); + + sna->mode.max_crtc_width = res->max_width; + sna->mode.max_crtc_height = res->max_height; + + RegionEmpty(&sna->mode.shadow_region); + RegionEmpty(&sna->mode.shadow_cancel); + list_init(&sna->mode.shadow_crtc); + + drmModeFreeResources(res); + + sna_cursor_pre_init(sna); + sna_backlight_pre_init(sna); } else { if (num_fake == 0) num_fake = 1; @@ -3640,43 +5545,54 @@ if (!sna_probe_initial_configuration(sna)) { sanitize_outputs(sna); - xf86InitialConfiguration(scrn, TRUE); + if (XF86_CRTC_CONFIG_PTR(scrn)->num_crtc) + xf86InitialConfiguration(scrn, TRUE); } sna_setup_provider(scrn); return scrn->modes != NULL; } -void -sna_mode_close(struct sna *sna) +bool +sna_mode_wants_tear_free(struct sna *sna) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); int i; - /* In order to workaround a kernel bug in not honouring O_NONBLOCK, - * check that the fd is readable before attempting to read the next - * event from drm. - */ + for (i = 0; i < sna->mode.num_real_output; i++) { + struct sna_output *output = to_sna_output(config->output[i]); + int id = find_property(sna, output, "Panel Self-Refresh"); + if (id !=-1 && output->prop_values[id] != -1) { + DBG(("%s: Panel Self-Refresh detected on %s\n", + __FUNCTION__, config->output[i]->name)); + return true; + } + } + + return false; +} + +void +sna_mode_close(struct sna *sna) +{ while (sna_mode_has_pending_events(sna)) sna_mode_wakeup(sna); if (sna->flags & SNA_IS_HOSTED) return; - for (i = 0; i < config->num_crtc; i++) { - struct sna_crtc *crtc; + sna_mode_reset(sna); - crtc = to_sna_crtc(config->crtc[i]); - if (crtc == NULL) - continue; + sna_cursor_close(sna); + sna_cursors_fini(sna); - sna_crtc_disable_shadow(sna, crtc); - } + sna_backlight_close(sna); } void sna_mode_fini(struct sna *sna) { + free(sna->mode.encoders); } static bool sna_box_intersect(BoxPtr r, const BoxRec *a, const BoxRec *b) @@ -3726,15 +5642,33 @@ DBG(("%s for box=(%d, %d), (%d, %d)\n", __FUNCTION__, box->x1, box->y1, box->x2, box->y2)); + if (desired == NULL) { + rrScrPrivPtr rr = rrGetScrPriv(xf86ScrnToScreen(sna->scrn)); + if (rr && rr->primaryOutput) { + xf86OutputPtr output = rr->primaryOutput->devPrivate; + DBG(("%s: have PrimaryOutput? %d marking as desired\n", __FUNCTION__, output->crtc != NULL)); + desired = output->crtc; + } + } + if (desired && to_sna_crtc(desired) && to_sna_crtc(desired)->bo) { + BoxRec cover_box; + if (sna_box_intersect(&cover_box, &desired->bounds, box)) { + DBG(("%s: box overlaps desired crtc: (%d, %d), (%d, %d)\n", + __FUNCTION__, + cover_box.x1, cover_box.y1, + cover_box.x2, cover_box.y2)); + return desired; + } + } + best_crtc = NULL; best_coverage = 0; - for (c = 0; c < config->num_crtc; c++) { + for (c = 0; c < sna->mode.num_real_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; BoxRec cover_box; int coverage; - if (to_sna_crtc(crtc) == NULL) - continue; + assert(to_sna_crtc(crtc)); /* If the CRTC is off, treat it as not covering */ if (to_sna_crtc(crtc)->bo == NULL) { @@ -3760,11 +5694,6 @@ cover_box.x1, cover_box.y1, cover_box.x2, cover_box.y2, c)); - if (crtc == desired) { - DBG(("%s: box is on desired crtc [%p]\n", - __FUNCTION__, crtc)); - return crtc; - } coverage = sna_box_area(&cover_box); DBG(("%s: box covers %d of crtc %d\n", @@ -3839,52 +5768,6 @@ return true; } -static bool sna_emit_wait_for_scanline_vlv(struct sna *sna, - xf86CrtcPtr crtc, - int pipe, int y1, int y2, - bool full_height) -{ - uint32_t display_base = 0x180000; - uint32_t event; - uint32_t *b; - - return false; /* synchronisation? I've heard of that */ - - if (!sna->kgem.has_secure_batches) - return false; - - assert(y1 >= 0); - assert(y2 > y1); - assert(sna->kgem.mode); - - /* Always program one less than the desired value */ - if (--y1 < 0) - y1 = crtc->bounds.y2; - y2--; - - b = kgem_get_batch(&sna->kgem); - sna->kgem.nbatch += 4; - - if (pipe == 0) { - if (full_height) - event = MI_WAIT_FOR_PIPEA_SVBLANK; - else - event = MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW; - } else { - if (full_height) - event = MI_WAIT_FOR_PIPEB_SVBLANK; - else - event = MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW; - } - b[0] = MI_LOAD_REGISTER_IMM | 1; - b[1] = display_base + 0x70004 + 0x1000 * pipe; - b[2] = (1 << 31) | (y1 << 16) | y2; - b[3] = MI_WAIT_FOR_EVENT | event; - - sna->kgem.batch_flags |= I915_EXEC_SECURE; - return true; -} - static bool sna_emit_wait_for_scanline_ivb(struct sna *sna, xf86CrtcPtr crtc, int pipe, int y1, int y2, @@ -4102,10 +5985,12 @@ if (sna->kgem.gen >= 0110) ret = false; + else if (sna->kgem.gen == 0101) + ret = false; /* chv, vsync method unknown */ else if (sna->kgem.gen >= 075) ret = sna_emit_wait_for_scanline_hsw(sna, crtc, pipe, y1, y2, full_height); else if (sna->kgem.gen == 071) - ret = sna_emit_wait_for_scanline_vlv(sna, crtc, pipe, y1, y2, full_height); + ret = false; /* vlv, vsync method unknown */ else if (sna->kgem.gen >= 070) ret = sna_emit_wait_for_scanline_ivb(sna, crtc, pipe, y1, y2, full_height); else if (sna->kgem.gen >= 060) @@ -4118,7 +6003,7 @@ return ret; } -void sna_mode_update(struct sna *sna) +void sna_mode_check(struct sna *sna) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); int i; @@ -4126,37 +6011,39 @@ if (sna->flags & SNA_IS_HOSTED) return; + DBG(("%s\n", __FUNCTION__)); + /* Validate CRTC attachments and force consistency upon the kernel */ - sna->mode.front_active = 0; - for (i = 0; i < config->num_crtc; i++) { + for (i = 0; i < sna->mode.num_real_crtc; i++) { xf86CrtcPtr crtc = config->crtc[i]; struct sna_crtc *sna_crtc = to_sna_crtc(crtc); struct drm_mode_crtc mode; - uint32_t expected; + uint32_t expected[2]; - if (sna_crtc == NULL) - continue; + assert(sna_crtc); #if XF86_CRTC_VERSION >= 3 assert(sna_crtc->bo == NULL || crtc->active); #endif - expected = sna_crtc->bo ? fb_id(sna_crtc->bo) : 0; + expected[0] = sna_crtc->bo ? fb_id(sna_crtc->bo) : 0; + expected[1] = sna_crtc->flip_bo ? fb_id(sna_crtc->flip_bo) : -1; VG_CLEAR(mode); mode.crtc_id = sna_crtc->id; if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode)) continue; - DBG(("%s: crtc=%d, valid?=%d, fb attached?=%d, expected=%d\n", + DBG(("%s: crtc=%d, valid?=%d, fb attached?=%d, expected=(%d or %d)\n", __FUNCTION__, mode.crtc_id, mode.mode_valid, - mode.fb_id, expected)); + mode.fb_id, expected[0], expected[1])); - if (mode.fb_id != expected) + if (mode.fb_id != expected[0] && mode.fb_id != expected[1]) { + xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, + "%s: invalid state found on pipe %d, disabling CRTC:%d\n", + __FUNCTION__, sna_crtc->pipe, sna_crtc->id); sna_crtc_disable(crtc); - - if (sna->front && sna_crtc->bo == __sna_pixmap_get_bo(sna->front)) - sna->mode.front_active++; + } } for (i = 0; i < config->num_output; i++) { @@ -4184,21 +6071,41 @@ if (sna->flags & SNA_IS_HOSTED) return; - for (i = 0; i < config->num_crtc; i++) { + DBG(("%s\n", __FUNCTION__)); + + sna_hide_cursors(sna->scrn); + for (i = 0; i < sna->mode.num_real_crtc; i++) + sna_crtc_disable(config->crtc[i]); + assert(sna->mode.front_active == 0); + + for (i = 0; i < sna->mode.num_real_crtc; i++) { struct sna_crtc *sna_crtc = to_sna_crtc(config->crtc[i]); - if (sna_crtc == NULL) - continue; - sna_crtc->dpms_mode = DPMSModeOff; + assert(sna_crtc != NULL); + sna_crtc->dpms_mode = -1; + + /* Force the rotation property to be reset on next use */ + rotation_reset(&sna_crtc->primary); + rotation_reset(&sna_crtc->sprite); } - for (i = 0; i < config->num_output; i++) { + /* VT switching, likely to fbcon so make the backlight usable */ + for (i = 0; i < sna->mode.num_real_output; i++) { struct sna_output *sna_output = to_sna_output(config->output[i]); - if (sna_output == NULL) + + assert(sna_output != NULL); + assert(sna_output->dpms_mode == DPMSModeOff); + + if (!sna_output->backlight.iface) continue; - sna_output->dpms_mode = DPMSModeOff; + sna_output_backlight_set(sna_output, + sna_output->backlight.max); } + + /* drain the event queue */ + while (sna_mode_has_pending_events(sna)) + sna_mode_wakeup(sna); } static void transformed_box(BoxRec *box, xf86CrtcPtr crtc) @@ -4220,47 +6127,58 @@ box->y2 = crtc->mode.VDisplay; } +inline static DrawablePtr crtc_source(xf86CrtcPtr crtc, int16_t *sx, int16_t *sy) +{ + struct sna_crtc *sna_crtc = to_sna_crtc(crtc); + if (sna_crtc->slave_pixmap) { + *sx = -crtc->x; + *sy = -crtc->y; + return &sna_crtc->slave_pixmap->drawable; + } else { + *sx = *sy = 0; + return &to_sna(crtc->scrn)->front->drawable; + } +} + static void sna_crtc_redisplay__fallback(xf86CrtcPtr crtc, RegionPtr region, struct kgem_bo *bo) { + int16_t sx, sy; struct sna *sna = to_sna(crtc->scrn); ScreenPtr screen = sna->scrn->pScreen; + DrawablePtr draw = crtc_source(crtc, &sx, &sy); PictFormatPtr format; PicturePtr src, dst; PixmapPtr pixmap; - int error; + int depth, error; void *ptr; DBG(("%s: compositing transformed damage boxes\n", __FUNCTION__)); + error = sna_render_format_for_depth(draw->depth); + depth = PIXMAN_FORMAT_DEPTH(error); + format = PictureMatchFormat(screen, depth, error); + if (format == NULL) { + DBG(("%s: can't find format for depth=%d [%08x]\n", + __FUNCTION__, depth, error)); + return; + } + ptr = kgem_bo_map__gtt(&sna->kgem, bo); if (ptr == NULL) return; - pixmap = sna_pixmap_create_unattached(screen, - 0, 0, sna->front->drawable.depth); + pixmap = sna_pixmap_create_unattached(screen, 0, 0, depth); if (pixmap == NullPixmap) return; if (!screen->ModifyPixmapHeader(pixmap, - crtc->mode.HDisplay, - crtc->mode.VDisplay, - sna->front->drawable.depth, - sna->front->drawable.bitsPerPixel, + crtc->mode.HDisplay, crtc->mode.VDisplay, + depth, draw->bitsPerPixel, bo->pitch, ptr)) goto free_pixmap; - error = sna_render_format_for_depth(sna->front->drawable.depth); - format = PictureMatchFormat(screen, - PIXMAN_FORMAT_DEPTH(error), error); - if (format == NULL) { - DBG(("%s: can't find format for depth=%d [%08x]\n", - __FUNCTION__, sna->front->drawable.depth, - (int)sna_render_format_for_depth(sna->front->drawable.depth))); - goto free_pixmap; - } - - src = CreatePicture(None, &sna->front->drawable, format, + src = CreatePicture(None, draw, format, 0, NULL, serverClient, &error); if (!src) goto free_pixmap; @@ -4281,8 +6199,8 @@ kgem_bo_sync__gtt(&sna->kgem, bo); if (sigtrap_get() == 0) { /* paranoia */ - const BoxRec *b = REGION_RECTS(region); - int n = REGION_NUM_RECTS(region); + const BoxRec *b = region_rects(region); + int n = region_num_rects(region); do { BoxRec box; @@ -4295,7 +6213,7 @@ box.x1, box.y1, box.x2, box.y2)); fbComposite(PictOpSrc, src, NULL, dst, - box.x1, box.y1, + box.x1 + sx, box.y1 + sy, 0, 0, box.x1, box.y1, box.x2 - box.x1, box.y2 - box.y1); @@ -4313,44 +6231,44 @@ static void sna_crtc_redisplay__composite(xf86CrtcPtr crtc, RegionPtr region, struct kgem_bo *bo) { + int16_t sx, sy; struct sna *sna = to_sna(crtc->scrn); ScreenPtr screen = crtc->scrn->pScreen; + DrawablePtr draw = crtc_source(crtc, &sx, &sy); struct sna_composite_op tmp; PictFormatPtr format; PicturePtr src, dst; PixmapPtr pixmap; - BoxPtr b; - int n, error; + const BoxRec *b; + int n, depth, error; DBG(("%s: compositing transformed damage boxes\n", __FUNCTION__)); - pixmap = sna_pixmap_create_unattached(screen, - 0, 0, sna->front->drawable.depth); + error = sna_render_format_for_depth(draw->depth); + depth = PIXMAN_FORMAT_DEPTH(error); + format = PictureMatchFormat(screen, depth, error); + if (format == NULL) { + DBG(("%s: can't find format for depth=%d [%08x]\n", + __FUNCTION__, depth, error)); + return; + } + + pixmap = sna_pixmap_create_unattached(screen, 0, 0, depth); if (pixmap == NullPixmap) return; if (!screen->ModifyPixmapHeader(pixmap, - crtc->mode.HDisplay, - crtc->mode.VDisplay, - sna->front->drawable.depth, - sna->front->drawable.bitsPerPixel, + crtc->mode.HDisplay, crtc->mode.VDisplay, + depth, draw->bitsPerPixel, bo->pitch, NULL)) goto free_pixmap; - if (!sna_pixmap_attach_to_bo(pixmap, bo)) - goto free_pixmap; - - error = sna_render_format_for_depth(sna->front->drawable.depth); - format = PictureMatchFormat(screen, - PIXMAN_FORMAT_DEPTH(error), error); - if (format == NULL) { - DBG(("%s: can't find format for depth=%d [%08x]\n", - __FUNCTION__, sna->front->drawable.depth, - (int)sna_render_format_for_depth(sna->front->drawable.depth))); + if (!sna_pixmap_attach_to_bo(pixmap, kgem_bo_reference(bo))) { + kgem_bo_destroy(&sna->kgem, bo); goto free_pixmap; } - src = CreatePicture(None, &sna->front->drawable, format, + src = CreatePicture(None, draw, format, 0, NULL, serverClient, &error); if (!src) goto free_pixmap; @@ -4373,18 +6291,18 @@ if (!sna->render.composite(sna, PictOpSrc, src, NULL, dst, - 0, 0, + sx, sy, 0, 0, 0, 0, crtc->mode.HDisplay, crtc->mode.VDisplay, - 0, memset(&tmp, 0, sizeof(tmp)))) { + COMPOSITE_PARTIAL, memset(&tmp, 0, sizeof(tmp)))) { DBG(("%s: unsupported operation!\n", __FUNCTION__)); sna_crtc_redisplay__fallback(crtc, region, bo); goto free_dst; } - n = REGION_NUM_RECTS(region); - b = REGION_RECTS(region); + n = region_num_rects(region); + b = region_rects(region); do { BoxRec box; @@ -4411,16 +6329,18 @@ static void sna_crtc_redisplay(xf86CrtcPtr crtc, RegionPtr region) { + int16_t tx, ty, sx, sy; struct sna *sna = to_sna(crtc->scrn); struct sna_crtc *sna_crtc = to_sna_crtc(crtc); - struct sna_pixmap *priv = sna_pixmap(sna->front); - int16_t tx, ty; + DrawablePtr draw = crtc_source(crtc, &sx, &sy); + struct sna_pixmap *priv = sna_pixmap((PixmapPtr)draw); - DBG(("%s: crtc %d [pipe=%d], damage (%d, %d), (%d, %d) x %ld\n", + assert(sna_crtc); + DBG(("%s: crtc %d [pipe=%d], damage (%d, %d), (%d, %d) x %d\n", __FUNCTION__, sna_crtc->id, sna_crtc->pipe, region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2, - (long)RegionNumRects(region))); + region_num_rects(region))); assert(!wedged(sna)); @@ -4429,28 +6349,28 @@ RegionTranslate(region, -crtc->bounds.x1, -crtc->bounds.y1); sna_blt_fill_boxes(sna, GXcopy, - sna_crtc->bo, sna->front->drawable.bitsPerPixel, + sna_crtc->bo, draw->bitsPerPixel, priv->clear_color, - REGION_RECTS(region), REGION_NUM_RECTS(region)); + region_rects(region), region_num_rects(region)); return; } if (crtc->filter == NULL && sna_transform_is_integer_translation(&crtc->crtc_to_framebuffer, &tx, &ty)) { - PixmapRec tmp; + DrawableRec tmp; DBG(("%s: copy damage boxes\n", __FUNCTION__)); - tmp.drawable.width = crtc->mode.HDisplay; - tmp.drawable.height = crtc->mode.VDisplay; - tmp.drawable.depth = sna->front->drawable.depth; - tmp.drawable.bitsPerPixel = sna->front->drawable.bitsPerPixel; + tmp.width = crtc->mode.HDisplay; + tmp.height = crtc->mode.VDisplay; + tmp.depth = sna->front->drawable.depth; + tmp.bitsPerPixel = sna->front->drawable.bitsPerPixel; if (sna->render.copy_boxes(sna, GXcopy, - sna->front, priv->gpu_bo, 0, 0, + draw, priv->gpu_bo, sx, sy, &tmp, sna_crtc->bo, -tx, -ty, - REGION_RECTS(region), REGION_NUM_RECTS(region), 0)) + region_rects(region), region_num_rects(region), 0)) return; } @@ -4460,27 +6380,56 @@ sna_crtc_redisplay__fallback(crtc, region, sna_crtc->bo); } -static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo, RegionPtr region) +#define shadow_flip_handler (sna_flip_handler_t)sna_mode_redisplay + +void sna_shadow_set_crtc(struct sna *sna, + xf86CrtcPtr crtc, + struct kgem_bo *bo) { - struct sna_pixmap *priv = sna_pixmap(pixmap); - struct wait_for_shadow *wait; + struct sna_crtc *sna_crtc = to_sna_crtc(crtc); + struct sna_pixmap *priv; - assert((priv->pinned & PIN_PRIME) == 0); - assert(bo != priv->gpu_bo); - assert(priv->gpu_bo); + DBG(("%s: setting shadow override for CRTC:%d to handle=%d\n", + __FUNCTION__, sna_crtc->id, bo->handle)); - assert(priv->move_to_gpu == NULL); - wait = malloc(sizeof(*wait)); - if (wait != NULL) { - wait->bo = kgem_bo_reference(bo); - RegionNull(&wait->region); - RegionCopy(&wait->region, region); + assert(sna->flags & SNA_TEAR_FREE); + assert(sna_crtc); + assert(!sna_crtc->transform); + + if (sna_crtc->shadow_bo != bo) { + if (sna_crtc->shadow_bo) + kgem_bo_destroy(&sna->kgem, sna_crtc->shadow_bo); - priv->move_to_gpu = wait_for_shadow; - priv->move_to_gpu_data = wait; + sna_crtc->shadow_bo = kgem_bo_reference(bo); + sna_crtc_damage(crtc); } - priv->pinned |= PIN_SCANOUT; + list_move(&sna_crtc->shadow_link, &sna->mode.shadow_crtc); + sna->mode.shadow_dirty = true; + + priv = sna_pixmap(sna->front); + assert(priv->gpu_bo); + priv->move_to_gpu = wait_for_shadow; + priv->move_to_gpu_data = sna; +} + +void sna_shadow_unset_crtc(struct sna *sna, + xf86CrtcPtr crtc) +{ + struct sna_crtc *sna_crtc = to_sna_crtc(crtc); + + DBG(("%s: clearin shadow override for CRTC:%d\n", + __FUNCTION__, sna_crtc->id)); + + if (sna_crtc->shadow_bo == NULL) + return; + + kgem_bo_destroy(&sna->kgem, sna_crtc->shadow_bo); + sna_crtc->shadow_bo = NULL; + list_del(&sna_crtc->shadow_link); + sna->mode.shadow_dirty = true; + + sna_crtc_damage(crtc); } void sna_mode_redisplay(struct sna *sna) @@ -4495,7 +6444,7 @@ DBG(("%s: posting shadow damage? %d (flips pending? %d)\n", __FUNCTION__, !RegionNil(DamageRegion(sna->mode.shadow_damage)), - sna->mode.shadow_flip)); + sna->mode.flip_active)); assert((sna->flags & SNA_IS_HOSTED) == 0); assert(sna->mode.shadow_active); @@ -4503,40 +6452,42 @@ if (RegionNil(region)) return; - DBG(("%s: damage: %ldx(%d, %d), (%d, %d)\n", - __FUNCTION__, (long)REGION_NUM_RECTS(region), + DBG(("%s: damage: %dx(%d, %d), (%d, %d)\n", + __FUNCTION__, region_num_rects(region), region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2)); - if (sna->mode.shadow_flip) { + if (sna->mode.flip_active) { DamagePtr damage; damage = sna->mode.shadow_damage; sna->mode.shadow_damage = NULL; - while (sna->mode.shadow_flip && sna_mode_has_pending_events(sna)) + while (sna->mode.flip_active && sna_mode_has_pending_events(sna)) sna_mode_wakeup(sna); sna->mode.shadow_damage = damage; } - if (sna->mode.shadow_flip) + if (sna->mode.flip_active) return; - if (wedged(sna) || !sna_pixmap_move_to_gpu(sna->front, MOVE_READ | MOVE_ASYNC_HINT)) { + if (wedged(sna) || !sna_pixmap_move_to_gpu(sna->front, MOVE_READ | MOVE_ASYNC_HINT | __MOVE_SCANOUT)) { + DBG(("%s: forcing scanout update using the CPU\n", __FUNCTION__)); if (!sna_pixmap_move_to_cpu(sna->front, MOVE_READ)) return; - for (i = 0; i < config->num_crtc; i++) { + for (i = 0; i < sna->mode.num_real_crtc; i++) { xf86CrtcPtr crtc = config->crtc[i]; struct sna_crtc *sna_crtc = to_sna_crtc(crtc); RegionRec damage; - if (sna_crtc == NULL || !sna_crtc->shadow) + assert(sna_crtc != NULL); + if (!sna_crtc->shadow) continue; assert(crtc->enabled); - assert(crtc->transform_in_use || sna->flags & SNA_TEAR_FREE); + assert(sna_crtc->transform || sna->flags & SNA_TEAR_FREE); damage.extents = crtc->bounds; damage.data = NULL; @@ -4544,6 +6495,9 @@ if (RegionNotEmpty(&damage)) sna_crtc_redisplay__fallback(crtc, &damage, sna_crtc->bo); RegionUninit(&damage); + + if (sna_crtc->slave_damage) + DamageEmpty(sna_crtc->slave_damage); } RegionEmpty(region); @@ -4557,12 +6511,14 @@ assert(priv != NULL); if (priv->move_to_gpu) { - if (priv->move_to_gpu == wait_for_shadow) { + if (priv->move_to_gpu == wait_for_shadow && + !sna->mode.shadow_dirty) { /* No damage written to new scanout * (backbuffer), ignore redisplay request * and continue with the current intact * scanout (frontbuffer). */ + DBG(("%s: shadow idle, skipping update\n", __FUNCTION__)); RegionEmpty(region); return; } @@ -4573,24 +6529,20 @@ assert(priv->move_to_gpu == NULL); } - for (i = 0; i < config->num_crtc; i++) { + for (i = 0; i < sna->mode.num_real_crtc; i++) { xf86CrtcPtr crtc = config->crtc[i]; struct sna_crtc *sna_crtc = to_sna_crtc(crtc); RegionRec damage; - if (sna_crtc == NULL) - continue; - - DBG(("%s: crtc[%d] shadow? %d, transformed? %d\n", - __FUNCTION__, i, - sna_crtc->shadow, - sna_crtc->bo != sna->mode.shadow)); + assert(sna_crtc != NULL); + DBG(("%s: crtc[%d] transformed? %d\n", + __FUNCTION__, i, sna_crtc->transform)); - if (!sna_crtc->shadow || sna_crtc->bo == sna->mode.shadow) + if (!sna_crtc->transform) continue; assert(crtc->enabled); - assert(crtc->transform_in_use); + assert(sna_crtc->bo); damage.extents = crtc->bounds; damage.data = NULL; @@ -4626,24 +6578,27 @@ if (arg.fb_id == 0) goto disable1; - arg.user_data = 0; + arg.user_data = (uintptr_t)sna_crtc; arg.flags = DRM_MODE_PAGE_FLIP_EVENT; arg.reserved = 0; if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_PAGE_FLIP, &arg)) { BoxRec box; + DrawableRec tmp; DBG(("%s: flip [fb=%d] on crtc %d [%d, pipe=%d] failed - %d\n", __FUNCTION__, arg.fb_id, i, sna_crtc->id, sna_crtc->pipe, errno)); disable1: box.x1 = 0; box.y1 = 0; - box.x2 = crtc->mode.HDisplay; - box.y2 = crtc->mode.VDisplay; + tmp.width = box.x2 = crtc->mode.HDisplay; + tmp.height = box.y2 = crtc->mode.VDisplay; + tmp.depth = sna->front->drawable.depth; + tmp.bitsPerPixel = sna->front->drawable.bitsPerPixel; if (!sna->render.copy_boxes(sna, GXcopy, - sna->front, bo, 0, 0, - sna->front, sna_crtc->bo, 0, 0, + &sna->front->drawable, bo, 0, 0, + &tmp, sna_crtc->bo, 0, 0, &box, 1, COPY_LAST)) { xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, "%s: page flipping failed, disabling CRTC:%d (pipe=%d)\n", @@ -4651,98 +6606,171 @@ sna_crtc_disable(crtc); } + kgem_bo_destroy(&sna->kgem, bo); + sna_crtc->shadow_bo = NULL; continue; } + sna->mode.flip_active++; - sna_crtc->shadow_bo = sna_crtc->bo; - sna_crtc->bo = bo; + assert(sna_crtc->flip_bo == NULL); + sna_crtc->flip_handler = shadow_flip_handler; + sna_crtc->flip_bo = bo; + sna_crtc->flip_bo->active_scanout++; + sna_crtc->flip_serial = sna_crtc->mode_serial; - sna->mode.shadow_flip++; + sna_crtc->shadow_bo = kgem_bo_reference(sna_crtc->bo); } else { sna_crtc_redisplay(crtc, &damage); kgem_scanout_flush(&sna->kgem, sna_crtc->bo); } } RegionUninit(&damage); + + if (sna_crtc->slave_damage) + DamageEmpty(sna_crtc->slave_damage); } if (sna->mode.shadow) { struct kgem_bo *new = __sna_pixmap_get_bo(sna->front); struct kgem_bo *old = sna->mode.shadow; + struct drm_mode_crtc_page_flip arg; + uint32_t fb; + + DBG(("%s: flipping tear-free outputs, current scanout handle=%d [active?=%d], new handle=%d [active=%d]\n", + __FUNCTION__, old->handle, old->active_scanout, new->handle, new->active_scanout)); + + assert(new != old); + assert(new->refcnt); + + fb = get_fb(sna, new, sna->scrn->virtualX, sna->scrn->virtualY); + if (fb == 0) { +fixup_shadow: + if (sna_pixmap_move_to_gpu(sna->front, MOVE_READ | MOVE_ASYNC_HINT)) { + BoxRec box; + + box.x1 = 0; + box.y1 = 0; + box.x2 = sna->scrn->virtualX; + box.y2 = sna->scrn->virtualY; + if (sna->render.copy_boxes(sna, GXcopy, + &sna->front->drawable, __sna_pixmap_get_bo(sna->front), 0, 0, + &sna->front->drawable, old, 0, 0, + &box, 1, COPY_LAST)) { + kgem_submit(&sna->kgem); + RegionEmpty(region); + } + } + + return; + } + + arg.flags = DRM_MODE_PAGE_FLIP_EVENT; + arg.reserved = 0; - DBG(("%s: flipping tear-free outputs\n", __FUNCTION__)); kgem_bo_submit(&sna->kgem, new); - for (i = 0; i < config->num_crtc; i++) { + for (i = 0; i < sna->mode.num_real_crtc; i++) { struct sna_crtc *crtc = config->crtc[i]->driver_private; - struct drm_mode_crtc_page_flip arg; - - if (crtc == NULL) - continue; + struct kgem_bo *flip_bo; + int x, y; - DBG(("%s: crtc %d [%d, pipe=%d] active? %d\n", - __FUNCTION__, i, crtc->id, crtc->pipe, crtc && crtc->bo)); - if (crtc->bo != old) + assert(crtc != NULL); + DBG(("%s: crtc %d [%d, pipe=%d] active? %d, transformed? %d\n", + __FUNCTION__, i, crtc->id, crtc->pipe, crtc->bo ? crtc->bo->handle : 0, crtc->transform)); + if (crtc->bo == NULL || crtc->transform) continue; assert(config->crtc[i]->enabled); - assert(crtc->dpms_mode == DPMSModeOn); + assert(crtc->dpms_mode <= DPMSModeOn); + assert(crtc->flip_bo == NULL); arg.crtc_id = crtc->id; - arg.fb_id = get_fb(sna, new, - sna->scrn->virtualX, - sna->scrn->virtualY); - if (arg.fb_id == 0) - goto disable2; + arg.user_data = (uintptr_t)crtc; - arg.user_data = 0; - arg.flags = DRM_MODE_PAGE_FLIP_EVENT; - arg.reserved = 0; - - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_PAGE_FLIP, &arg)) { - DBG(("%s: flip [fb=%d] on crtc %d [%d, pipe=%d] failed - %d\n", - __FUNCTION__, arg.fb_id, i, crtc->id, crtc->pipe, errno)); -disable2: - if (sna->mode.shadow_flip == 0) { - BoxRec box; + if (crtc->shadow_bo) { + DBG(("%s: apply shadow override bo for CRTC:%d on pipe=%d, handle=%d\n", + __FUNCTION__, crtc->id, crtc->pipe, crtc->shadow_bo->handle)); + arg.fb_id = get_fb(sna, crtc->shadow_bo, + crtc->base->mode.HDisplay, + crtc->base->mode.VDisplay); + flip_bo = crtc->shadow_bo; + x = y = 0; + } else { + arg.fb_id = fb; + flip_bo = new; + x = crtc->base->x; + y = crtc->base->y; + } - box.x1 = 0; - box.y1 = 0; - box.x2 = sna->scrn->virtualX; - box.y2 = sna->scrn->virtualY; + if (crtc->bo == flip_bo) + continue; - if (sna->render.copy_boxes(sna, GXcopy, - sna->front, new, 0, 0, - sna->front, old, 0, 0, - &box, 1, COPY_LAST)) { - kgem_submit(&sna->kgem); - RegionEmpty(region); + if (flip_bo->pitch != crtc->bo->pitch || (y << 16 | x) != crtc->offset) { + DBG(("%s: changing pitch (%d == %d) or offset (%x == %x)\n", + __FUNCTION__, + flip_bo->pitch, crtc->bo->pitch, + y << 16 | x, crtc->offset)); +fixup_flip: + if (sna_crtc_flip(sna, crtc, flip_bo, x, y)) { + assert(flip_bo != crtc->bo); + assert(crtc->bo->active_scanout); + assert(crtc->bo->refcnt >= crtc->bo->active_scanout); + crtc->bo->active_scanout--; + kgem_bo_destroy(&sna->kgem, crtc->bo); + + crtc->bo = kgem_bo_reference(flip_bo); + crtc->bo->active_scanout++; + } else { + if (sna->mode.flip_active == 0) { + DBG(("%s: abandoning flip attempt\n", __FUNCTION__)); + goto fixup_shadow; } - return; + xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR, + "%s: page flipping failed, disabling CRTC:%d (pipe=%d)\n", + __FUNCTION__, crtc->id, crtc->pipe); + sna_crtc_disable(crtc->base); } - - xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR, - "%s: page flipping failed, disabling CRTC:%d (pipe=%d)\n", - __FUNCTION__, crtc->id, crtc->pipe); - sna_crtc_disable(config->crtc[i]); continue; } - sna->mode.shadow_flip++; - kgem_bo_destroy(&sna->kgem, old); - crtc->bo = kgem_bo_reference(new); + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_PAGE_FLIP, &arg)) { + ERR(("%s: flip [fb=%d] on crtc %d [%d, pipe=%d] failed - %d\n", + __FUNCTION__, arg.fb_id, i, crtc->id, crtc->pipe, errno)); + goto fixup_flip; + } + sna->mode.flip_active++; + + assert(crtc->flip_bo == NULL); + crtc->flip_handler = shadow_flip_handler; + crtc->flip_bo = kgem_bo_reference(flip_bo); + crtc->flip_bo->active_scanout++; + crtc->flip_serial = crtc->mode_serial; + + { + struct drm_i915_gem_busy busy = { flip_bo->handle }; + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_BUSY, &busy) == 0) { + if (busy.busy) { + int mode = KGEM_RENDER; + if (busy.busy & (0xfffe << 16)) + mode = KGEM_BLT; + DBG(("%s: marking flip bo as busy [%x -> mode=%d]\n", __FUNCTION__, busy.busy, mode)); + kgem_bo_mark_busy(&sna->kgem, flip_bo, mode); + } else + __kgem_bo_clear_busy(flip_bo); + } + } } DBG(("%s: flipped %d outputs, shadow active? %d\n", __FUNCTION__, - sna->mode.shadow_flip, + sna->mode.flip_active, sna->mode.shadow ? sna->mode.shadow->handle : 0)); - if (sna->mode.shadow) { + if (sna->mode.flip_active) { assert(old == sna->mode.shadow); assert(old->refcnt >= 1); - set_bo(sna->front, old, region); + set_shadow(sna, region); } } else kgem_submit(&sna->kgem); @@ -4769,14 +6797,44 @@ struct drm_event *e = (struct drm_event *)&buffer[i]; switch (e->type) { case DRM_EVENT_VBLANK: - sna_dri_vblank_handler(sna, (struct drm_event_vblank *)e); + if (((uintptr_t)((struct drm_event_vblank *)e)->user_data) & 2) + sna_present_vblank_handler(sna, (struct drm_event_vblank *)e); + else + sna_dri2_vblank_handler(sna, (struct drm_event_vblank *)e); break; case DRM_EVENT_FLIP_COMPLETE: - if (((struct drm_event_vblank *)e)->user_data) { - sna_dri_page_flip_handler(sna, (struct drm_event_vblank *)e); - } else { - if (!--sna->mode.shadow_flip) - sna_mode_redisplay(sna); + { + struct drm_event_vblank *vbl = (struct drm_event_vblank *)e; + struct sna_crtc *crtc = (void *)(uintptr_t)vbl->user_data; + + crtc->swap.tv_sec = vbl->tv_sec; + crtc->swap.tv_usec = vbl->tv_usec; + crtc->swap.msc = msc64(crtc, vbl->sequence); + + assert(crtc->flip_bo); + assert(crtc->flip_bo->active_scanout); + assert(crtc->flip_bo->refcnt >= crtc->flip_bo->active_scanout); + + if (crtc->flip_serial == crtc->mode_serial) { + DBG(("%s: removing handle=%d from scanout, installing handle=%d\n", + __FUNCTION__, crtc->bo->handle, crtc->flip_bo->handle)); + assert(crtc->bo->active_scanout); + assert(crtc->bo->refcnt >= crtc->bo->active_scanout); + crtc->bo->active_scanout--; + kgem_bo_destroy(&sna->kgem, crtc->bo); + + crtc->bo = crtc->flip_bo; + crtc->flip_bo = NULL; + } else { + crtc->flip_bo->active_scanout--; + kgem_bo_destroy(&sna->kgem, crtc->flip_bo); + crtc->flip_bo = NULL; + } + + DBG(("%s: flip complete, pending? %d\n", __FUNCTION__, sna->mode.flip_active)); + assert(sna->mode.flip_active); + if (--sna->mode.flip_active == 0) + crtc->flip_handler(sna, vbl, crtc->flip_data); } break; default: diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_display_fake.c xserver-xorg-video-intel-2.99.914/src/sna/sna_display_fake.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_display_fake.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_display_fake.c 2014-05-06 10:32:12.000000000 +0000 @@ -96,31 +96,6 @@ } static void -sna_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg) -{ -} - -static void -sna_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y) -{ -} - -static void -sna_crtc_hide_cursor(xf86CrtcPtr crtc) -{ -} - -static void -sna_crtc_show_cursor(xf86CrtcPtr crtc) -{ -} - -static void -sna_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image) -{ -} - -static void sna_crtc_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue, int size) { @@ -131,27 +106,11 @@ { } -#if HAS_PIXMAP_SHARING -static Bool -sna_crtc_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr pixmap) -{ - return TRUE; -} -#endif - static const xf86CrtcFuncsRec sna_crtc_funcs = { .dpms = sna_crtc_dpms, .set_mode_major = sna_crtc_set_mode_major, - .set_cursor_colors = sna_crtc_set_cursor_colors, - .set_cursor_position = sna_crtc_set_cursor_position, - .show_cursor = sna_crtc_show_cursor, - .hide_cursor = sna_crtc_hide_cursor, - .load_cursor_argb = sna_crtc_load_cursor_argb, .gamma_set = sna_crtc_gamma_set, .destroy = sna_crtc_destroy, -#if HAS_PIXMAP_SHARING - .set_scanout_pixmap = sna_crtc_set_scanout_pixmap, -#endif }; static void @@ -280,9 +239,8 @@ xf86CrtcPtr crtc; RROutputPtr clones[32]; RRCrtcPtr crtcs[32]; - unsigned mask; char buf[80]; - int i, j, len; + int i, len; if (sna->mode.num_fake >= 32) return false; @@ -305,6 +263,9 @@ output->interlaceAllowed = FALSE; output->subpixel_order = SubPixelNone; + output->possible_crtcs = ~((1 << sna->mode.num_real_crtc) - 1); + output->possible_clones = ~((1 << sna->mode.num_real_output) - 1); + if (late) { ScreenPtr screen = xf86ScrnToScreen(scrn); @@ -318,46 +279,27 @@ RRPostPendingProperties(output->randr_output); - mask = (1 << ++sna->mode.num_fake) - 1; - for (i = j = 0; i < xf86_config->num_output; i++) { - output = xf86_config->output[i]; - if (output->driver_private) - continue; - - output->possible_crtcs = mask << sna->mode.num_real_crtc; - output->possible_clones = mask << sna->mode.num_real_output; - - clones[j++] = output->randr_output; - } - assert(j == sna->mode.num_fake); - - for (i = j = 0; i < xf86_config->num_crtc; i++) { - crtc = xf86_config->crtc[i]; - if (crtc->driver_private) - continue; - - crtcs[j++] = crtc->randr_crtc; - } - assert(j == sna->mode.num_fake); + for (i = sna->mode.num_real_output; i < xf86_config->num_output; i++) + clones[i - sna->mode.num_real_output] = xf86_config->output[i]->randr_output; + assert(i - sna->mode.num_real_output == sna->mode.num_fake + 1); + + for (i = sna->mode.num_real_crtc; i < xf86_config->num_crtc; i++) + crtcs[i - sna->mode.num_real_crtc] = xf86_config->crtc[i]->randr_crtc; + assert(i - sna->mode.num_real_crtc == sna->mode.num_fake + 1); - for (i = 0; i < xf86_config->num_output; i++) { - output = xf86_config->output[i]; - if (output->driver_private) - continue; + for (i = sna->mode.num_real_output; i < xf86_config->num_output; i++) { + RROutputPtr rr_output = xf86_config->output[i]->randr_output; - if (!RROutputSetCrtcs(output->randr_output, crtcs, j) || - !RROutputSetClones(output->randr_output, clones, j)) + if (!RROutputSetCrtcs(rr_output, crtcs, sna->mode.num_fake + 1) || + !RROutputSetClones(rr_output, clones, sna->mode.num_fake + 1)) goto err; } RRCrtcSetRotations(crtc->randr_crtc, RR_Rotate_All | RR_Reflect_All); - } else { - mask = (1 << ++sna->mode.num_fake) - 1; - output->possible_crtcs = mask << sna->mode.num_real_crtc; - output->possible_clones = mask << sna->mode.num_real_output; } + sna->mode.num_fake++; return true; err: @@ -381,15 +323,11 @@ bool sna_mode_fake_init(struct sna *sna, int num_fake) { - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(sna->scrn); bool ret; if (num_fake == 0) return true; - sna->mode.num_real_crtc = xf86_config->num_crtc; - sna->mode.num_real_output = xf86_config->num_output; - if (sna->mode.num_real_crtc == 0) xf86CrtcConfigInit(sna->scrn, &sna_mode_funcs); diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_dri2.c xserver-xorg-video-intel-2.99.914/src/sna/sna_dri2.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_dri2.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_dri2.c 2014-07-23 15:43:38.000000000 +0000 @@ -0,0 +1,3276 @@ +/************************************************************************** + +Copyright 2001 VA Linux Systems Inc., Fremont, California. +Copyright © 2002 by David Dawes + +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +on the rights to use, copy, modify, merge, publish, distribute, sub +license, and/or sell copies of the Software, and to permit persons to whom +the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. + +**************************************************************************/ + +/* + * Authors: Jeff Hartmann + * David Dawes + * Keith Whitwell + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include + +#include "sna.h" +#include "intel_options.h" + +#include +#include +#include +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,12,99,901,0) && defined(COMPOSITE) +#include +#define CHECK_FOR_COMPOSITOR +#endif + +#define DBG_CAN_FLIP 1 +#define DBG_CAN_XCHG 1 + +#define DBG_FORCE_COPY -1 /* KGEM_BLT or KGEM_3D */ + +#if DRI2INFOREC_VERSION < 2 +#error DRI2 version supported by the Xserver is too old +#endif + +static inline struct kgem_bo *ref(struct kgem_bo *bo) +{ + assert(bo->refcnt); + bo->refcnt++; + return bo; +} + +static inline void unref(struct kgem_bo *bo) +{ + assert(bo->refcnt > 1); + bo->refcnt--; +} + +struct sna_dri2_private { + PixmapPtr pixmap; + struct kgem_bo *bo; + DRI2Buffer2Ptr proxy; + bool stale; + uint32_t size; + int refcnt; +}; + +static inline struct sna_dri2_private * +get_private(void *buffer) +{ + return (struct sna_dri2_private *)((DRI2Buffer2Ptr)buffer+1); +} + +#if DRI2INFOREC_VERSION >= 4 +enum event_type { + WAITMSC = 0, + SWAP, + SWAP_WAIT, + SWAP_THROTTLE, + FLIP, + FLIP_THROTTLE, + FLIP_COMPLETE, + FLIP_ASYNC, +}; + +struct dri_bo { + struct list link; + struct kgem_bo *bo; + uint32_t name; +}; + +struct sna_dri2_event { + DrawablePtr draw; + ClientPtr client; + enum event_type type; + xf86CrtcPtr crtc; + int pipe; + bool queued; + + /* for swaps & flips only */ + DRI2SwapEventPtr event_complete; + void *event_data; + DRI2BufferPtr front; + DRI2BufferPtr back; + struct kgem_bo *bo; + + struct sna_dri2_event *chain; + + struct list cache; + struct list link; + + int mode; +}; + +static void sna_dri2_flip_event(struct sna *sna, + struct sna_dri2_event *flip); + +static void +sna_dri2_get_back(struct sna *sna, + DrawablePtr draw, + DRI2BufferPtr back, + struct sna_dri2_event *info) +{ + struct kgem_bo *bo; + uint32_t name; + bool reuse; + + reuse = (draw->height << 16 | draw->width) == get_private(back)->size; + if (reuse) { + bo = get_private(back)->bo; + assert(bo->refcnt); + DBG(("%s: back buffer handle=%d, scanout?=%d, refcnt=%d\n", + __FUNCTION__, bo->handle, bo->active_scanout, get_private(back)->refcnt)); + if (bo->active_scanout == 0) { + DBG(("%s: reuse unattached back\n", __FUNCTION__)); + get_private(back)->stale = false; + return; + } + } + + bo = NULL; + if (info) { + struct dri_bo *c; + list_for_each_entry(c, &info->cache, link) { + if (c->bo && c->bo->scanout == 0) { + bo = c->bo; + name = c->name; + DBG(("%s: reuse cache handle=%d\n", __FUNCTION__, bo->handle)); + list_move_tail(&c->link, &info->cache); + c->bo = NULL; + } + } + } + if (bo == NULL) { + DBG(("%s: allocating new backbuffer\n", __FUNCTION__)); + bo = kgem_create_2d(&sna->kgem, + draw->width, draw->height, draw->bitsPerPixel, + get_private(back)->bo->tiling, + get_private(back)->bo->scanout ? CREATE_SCANOUT : 0); + if (bo == NULL) + return; + + name = kgem_bo_flink(&sna->kgem, bo); + if (name == 0) { + kgem_bo_destroy(&sna->kgem, bo); + return; + } + } + assert(bo->active_scanout == 0); + + if (info && reuse) { + bool found = false; + struct dri_bo *c; + + list_for_each_entry_reverse(c, &info->cache, link) { + if (c->bo == NULL) { + found = true; + _list_del(&c->link); + break; + } + } + if (!found) + c = malloc(sizeof(*c)); + if (c != NULL) { + c->bo = ref(get_private(back)->bo); + c->name = back->name; + list_add(&c->link, &info->cache); + DBG(("%s: cacheing handle=%d (name=%d)\n", __FUNCTION__, c->bo->handle, c->name)); + } + } + + assert(bo != get_private(back)->bo); + kgem_bo_destroy(&sna->kgem, get_private(back)->bo); + + get_private(back)->bo = bo; + get_private(back)->size = draw->height << 16 | draw->width; + back->pitch = bo->pitch; + back->name = name; + + get_private(back)->stale = false; +} + +struct dri2_window { + DRI2BufferPtr front; + struct sna_dri2_event *chain; + xf86CrtcPtr crtc; + int64_t msc_delta; +}; + +static struct dri2_window *dri2_window(WindowPtr win) +{ + assert(win->drawable.type != DRAWABLE_PIXMAP); + return ((void **)__get_private(win, sna_window_key))[1]; +} + +static struct sna_dri2_event * +dri2_chain(DrawablePtr d) +{ + struct dri2_window *priv = dri2_window((WindowPtr)d); + assert(priv != NULL); + return priv->chain; +} +inline static DRI2BufferPtr dri2_window_get_front(WindowPtr win) { return dri2_window(win)->front; } +#else +inline static void *dri2_window_get_front(WindowPtr win) { return NULL; } +#endif + +#if DRI2INFOREC_VERSION < 6 + +#define xorg_can_triple_buffer(ptr) 0 +#define swap_limit(d, l) false + +#else + +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,904,0) +#define xorg_can_triple_buffer(ptr) 1 +#else +inline static bool xorg_can_triple_buffer(struct sna *sna) +{ + return screenInfo.numGPUScreens == 0; +} +#endif + +static Bool +sna_dri2_swap_limit_validate(DrawablePtr draw, int swap_limit) +{ + DBG(("%s: swap limit set to %d\n", __FUNCTION__, swap_limit)); + return swap_limit >= 1; +} + +static void +sna_dri2_reuse_buffer(DrawablePtr draw, DRI2BufferPtr buffer) +{ + DBG(("%s: reusing buffer pixmap=%ld, attachment=%d, handle=%d, name=%d\n", + __FUNCTION__, get_drawable_pixmap(draw)->drawable.serialNumber, + buffer->attachment, get_private(buffer)->bo->handle, buffer->name)); + assert(get_private(buffer)->refcnt); + assert(get_private(buffer)->bo->refcnt > get_private(buffer)->bo->active_scanout); + + if (buffer->attachment == DRI2BufferBackLeft && + draw->type != DRAWABLE_PIXMAP) { + DBG(("%s: replacing back buffer\n", __FUNCTION__)); + sna_dri2_get_back(to_sna_from_drawable(draw), draw, buffer, dri2_chain(draw)); + + assert(kgem_bo_flink(&to_sna_from_drawable(draw)->kgem, get_private(buffer)->bo) == buffer->name); + assert(get_private(buffer)->bo->refcnt); + assert(get_private(buffer)->bo->active_scanout == 0); + } +} + +static bool swap_limit(DrawablePtr draw, int limit) +{ + DBG(("%s: draw=%ld setting swap limit to %d\n", __FUNCTION__, (long)draw->id, limit)); + DRI2SwapLimit(draw, limit); + return true; +} +#endif + +#if DRI2INFOREC_VERSION < 10 +#undef USE_ASYNC_SWAP +#define USE_ASYNC_SWAP 0 +#endif + +#define COLOR_PREFER_TILING_Y 0 + +/* Prefer to enable TILING_Y if this buffer will never be a + * candidate for pageflipping + */ +static uint32_t color_tiling(struct sna *sna, DrawablePtr draw) +{ + uint32_t tiling; + + if (COLOR_PREFER_TILING_Y && + (draw->width != sna->front->drawable.width || + draw->height != sna->front->drawable.height)) + tiling = I915_TILING_Y; + else + tiling = I915_TILING_X; + + return kgem_choose_tiling(&sna->kgem, -tiling, + draw->width, + draw->height, + draw->bitsPerPixel); +} + +static uint32_t other_tiling(struct sna *sna, DrawablePtr draw) +{ + /* XXX Can mix color X / depth Y? */ + return kgem_choose_tiling(&sna->kgem, + sna->kgem.gen >= 040 ? -I915_TILING_Y : -I915_TILING_X, + draw->width, + draw->height, + draw->bitsPerPixel); +} + +static struct kgem_bo *sna_pixmap_set_dri(struct sna *sna, + PixmapPtr pixmap) +{ + struct sna_pixmap *priv; + int tiling; + + DBG(("%s: attaching DRI client to pixmap=%ld\n", + __FUNCTION__, pixmap->drawable.serialNumber)); + + priv = sna_pixmap(pixmap); + if (priv != NULL && IS_STATIC_PTR(priv->ptr) && priv->cpu_bo) { + DBG(("%s: SHM or unattached Pixmap, BadAlloc\n", __FUNCTION__)); + return NULL; + } + + priv = sna_pixmap_move_to_gpu(pixmap, + MOVE_READ | __MOVE_FORCE | __MOVE_DRI); + if (priv == NULL) { + DBG(("%s: failed to move to GPU, BadAlloc\n", __FUNCTION__)); + return NULL; + } + + assert(priv->flush == false); + assert(priv->cpu_damage == NULL); + assert(priv->gpu_bo); + assert(priv->gpu_bo->proxy == NULL); + assert(priv->gpu_bo->flush == false); + + tiling = color_tiling(sna, &pixmap->drawable); + if (tiling < 0) + tiling = -tiling; + if (priv->gpu_bo->tiling != tiling) + sna_pixmap_change_tiling(pixmap, tiling); + + return priv->gpu_bo; +} + +pure static inline void *sna_pixmap_get_buffer(PixmapPtr pixmap) +{ + assert(pixmap->refcnt); + return ((void **)__get_private(pixmap, sna_pixmap_key))[2]; +} + +static inline void sna_pixmap_set_buffer(PixmapPtr pixmap, void *ptr) +{ + assert(pixmap->refcnt); + ((void **)__get_private(pixmap, sna_pixmap_key))[2] = ptr; +} + +void +sna_dri2_pixmap_update_bo(struct sna *sna, PixmapPtr pixmap, struct kgem_bo *bo) +{ + DRI2BufferPtr buffer; + struct sna_dri2_private *private; + + buffer = sna_pixmap_get_buffer(pixmap); + if (buffer == NULL) + return; + + DBG(("%s: pixmap=%ld, old handle=%d, new handle=%d\n", __FUNCTION__, + pixmap->drawable.serialNumber, + get_private(buffer)->bo->handle, + sna_pixmap(pixmap)->gpu_bo->handle)); + + private = get_private(buffer); + assert(private->pixmap == pixmap); + + assert(bo != private->bo); + if (private->bo == bo) + return; + + DBG(("%s: dropping flush hint from handle=%d\n", __FUNCTION__, private->bo->handle)); + private->bo->flush = false; + kgem_bo_destroy(&sna->kgem, private->bo); + + buffer->name = kgem_bo_flink(&sna->kgem, bo); + private->bo = ref(bo); + + DBG(("%s: adding flush hint to handle=%d\n", __FUNCTION__, bo->handle)); + bo->flush = true; + assert(sna_pixmap(pixmap)->flush); + + /* XXX DRI2InvalidateDrawable(&pixmap->drawable); */ +} + +static DRI2Buffer2Ptr +sna_dri2_create_buffer(DrawablePtr draw, + unsigned int attachment, + unsigned int format) +{ + struct sna *sna = to_sna_from_drawable(draw); + DRI2Buffer2Ptr buffer; + struct sna_dri2_private *private; + PixmapPtr pixmap; + struct kgem_bo *bo; + unsigned flags = 0; + uint32_t size; + int bpp; + + DBG(("%s pixmap=%ld, (attachment=%d, format=%d, drawable=%dx%d)\n", + __FUNCTION__, + get_drawable_pixmap(draw)->drawable.serialNumber, + attachment, format, draw->width, draw->height)); + + pixmap = NULL; + size = (uint32_t)draw->height << 16 | draw->width; + switch (attachment) { + case DRI2BufferFrontLeft: + pixmap = get_drawable_pixmap(draw); + buffer = NULL; + if (draw->type != DRAWABLE_PIXMAP) + buffer = dri2_window_get_front((WindowPtr)draw); + if (buffer == NULL) + buffer = sna_pixmap_get_buffer(pixmap); + if (buffer) { + private = get_private(buffer); + + DBG(("%s: reusing front buffer attachment, win=%lu %dx%d, pixmap=%ld %dx%d, handle=%d, name=%d\n", + __FUNCTION__, + draw->type != DRAWABLE_PIXMAP ? (long)draw->id : (long)0, + draw->width, draw->height, + pixmap->drawable.serialNumber, + pixmap->drawable.width, + pixmap->drawable.height, + private->bo->handle, buffer->name)); + + assert(private->pixmap == pixmap); + assert(sna_pixmap(pixmap)->flush); + assert(sna_pixmap(pixmap)->pinned & PIN_DRI2); + assert(private->proxy != NULL || sna_pixmap(pixmap)->gpu_bo == private->bo); + assert(kgem_bo_flink(&sna->kgem, private->bo) == buffer->name); + + buffer->attachment = DRI2BufferFrontLeft; + + private->refcnt++; + return buffer; + } + + bo = sna_pixmap_set_dri(sna, pixmap); + if (bo == NULL) + return NULL; + + assert(sna_pixmap(pixmap) != NULL); + + bo = ref(bo); + bpp = pixmap->drawable.bitsPerPixel; + if (pixmap == sna->front && !(sna->flags & SNA_LINEAR_FB)) + flags |= CREATE_SCANOUT; + DBG(("%s: attaching to front buffer %dx%d [%p:%d], scanout? %d\n", + __FUNCTION__, + pixmap->drawable.width, pixmap->drawable.height, + pixmap, pixmap->refcnt, flags & CREATE_SCANOUT)); + size = (uint32_t)pixmap->drawable.height << 16 | pixmap->drawable.width; + break; + + case DRI2BufferBackLeft: + if (draw->type != DRAWABLE_PIXMAP) { + if (dri2_window_get_front((WindowPtr)draw)) + flags |= CREATE_SCANOUT; + if (draw->width == sna->front->drawable.width && + draw->height == sna->front->drawable.height && + (sna->flags & (SNA_LINEAR_FB | SNA_NO_WAIT | SNA_NO_FLIP)) == 0) + flags |= CREATE_SCANOUT; + } + case DRI2BufferBackRight: + case DRI2BufferFrontRight: + case DRI2BufferFakeFrontLeft: + case DRI2BufferFakeFrontRight: + bpp = draw->bitsPerPixel; + DBG(("%s: creating back buffer %dx%d, suitable for scanout? %d\n", + __FUNCTION__, + draw->width, draw->height, + flags & CREATE_SCANOUT)); + + bo = kgem_create_2d(&sna->kgem, + draw->width, + draw->height, + draw->bitsPerPixel, + color_tiling(sna, draw), + flags); + break; + + case DRI2BufferStencil: + /* + * The stencil buffer has quirky pitch requirements. From Vol + * 2a, 11.5.6.2.1 3DSTATE_STENCIL_BUFFER, field "Surface + * Pitch": + * The pitch must be set to 2x the value computed based on + * width, as the stencil buffer is stored with two rows + * interleaved. + * To accomplish this, we resort to the nasty hack of doubling + * the drm region's cpp and halving its height. + * + * If we neglect to double the pitch, then + * drm_intel_gem_bo_map_gtt() maps the memory incorrectly. + * + * The alignment for W-tiling is quite different to the + * nominal no-tiling case, so we have to account for + * the tiled access pattern explicitly. + * + * The stencil buffer is W tiled. However, we request from + * the kernel a non-tiled buffer because the kernel does + * not understand W tiling and the GTT is incapable of + * W fencing. + */ + bpp = format ? format : draw->bitsPerPixel; + bpp *= 2; + bo = kgem_create_2d(&sna->kgem, + ALIGN(draw->width, 64), + ALIGN((draw->height + 1) / 2, 64), + bpp, I915_TILING_NONE, flags); + break; + + case DRI2BufferDepth: + case DRI2BufferDepthStencil: + case DRI2BufferHiz: + case DRI2BufferAccum: + bpp = format ? format : draw->bitsPerPixel, + bo = kgem_create_2d(&sna->kgem, + draw->width, draw->height, bpp, + other_tiling(sna, draw), + flags); + break; + + default: + return NULL; + } + if (bo == NULL) + return NULL; + + buffer = calloc(1, sizeof *buffer + sizeof *private); + if (buffer == NULL) + goto err; + + private = get_private(buffer); + buffer->attachment = attachment; + buffer->pitch = bo->pitch; + buffer->cpp = bpp / 8; + buffer->driverPrivate = private; + buffer->format = format; + buffer->flags = 0; + buffer->name = kgem_bo_flink(&sna->kgem, bo); + private->refcnt = 1; + private->bo = bo; + private->pixmap = pixmap; + private->size = size; + + if (buffer->name == 0) + goto err; + + if (pixmap) { + struct sna_pixmap *priv; + + assert(attachment == DRI2BufferFrontLeft); + assert(sna_pixmap_get_buffer(pixmap) == NULL); + + sna_pixmap_set_buffer(pixmap, buffer); + assert(sna_pixmap_get_buffer(pixmap) == buffer); + pixmap->refcnt++; + + priv = sna_pixmap(pixmap); + assert(priv->flush == false); + assert((priv->pinned & PIN_DRI2) == 0); + + /* Don't allow this named buffer to be replaced */ + priv->pinned |= PIN_DRI2; + + /* We need to submit any modifications to and reads from this + * buffer before we send any reply to the Client. + * + * As we don't track which Client, we flush for all. + */ + DBG(("%s: adding flush hint to handle=%d\n", __FUNCTION__, priv->gpu_bo->handle)); + priv->gpu_bo->flush = true; + if (priv->gpu_bo->exec) + sna->kgem.flush = 1; + + priv->flush |= 1; + if (draw->type == DRAWABLE_PIXMAP) { + /* DRI2 renders directly into GLXPixmaps, treat as hostile */ + kgem_bo_unclean(&sna->kgem, priv->gpu_bo); + sna_damage_all(&priv->gpu_damage, pixmap); + priv->clear = false; + priv->cpu = false; + priv->flush |= 2; + } + + sna_accel_watch_flush(sna, 1); + } + + return buffer; + +err: + kgem_bo_destroy(&sna->kgem, bo); + free(buffer); + return NULL; +} + +static void _sna_dri2_destroy_buffer(struct sna *sna, DRI2Buffer2Ptr buffer) +{ + struct sna_dri2_private *private = get_private(buffer); + + if (buffer == NULL) + return; + + DBG(("%s: %p [handle=%d] -- refcnt=%d, pixmap=%ld\n", + __FUNCTION__, buffer, private->bo->handle, private->refcnt, + private->pixmap ? private->pixmap->drawable.serialNumber : 0)); + assert(private->refcnt > 0); + if (--private->refcnt) + return; + + assert(private->bo); + + if (private->proxy) { + DBG(("%s: destroying proxy\n", __FUNCTION__)); + _sna_dri2_destroy_buffer(sna, private->proxy); + private->pixmap = NULL; + } + + if (private->pixmap) { + PixmapPtr pixmap = private->pixmap; + struct sna_pixmap *priv = sna_pixmap(pixmap); + + assert(sna_pixmap_get_buffer(pixmap) == buffer); + assert(priv->gpu_bo == private->bo); + assert(priv->gpu_bo->flush); + assert(priv->pinned & PIN_DRI2); + assert(priv->flush); + + /* Undo the DRI markings on this pixmap */ + DBG(("%s: releasing last DRI pixmap=%ld, scanout?=%d\n", + __FUNCTION__, + pixmap->drawable.serialNumber, + pixmap == sna->front)); + + list_del(&priv->flush_list); + + DBG(("%s: dropping flush hint from handle=%d\n", __FUNCTION__, private->bo->handle)); + priv->gpu_bo->flush = false; + priv->pinned &= ~PIN_DRI2; + + priv->flush = false; + sna_accel_watch_flush(sna, -1); + + sna_pixmap_set_buffer(pixmap, NULL); + pixmap->drawable.pScreen->DestroyPixmap(pixmap); + } + assert(private->bo->flush == false); + + kgem_bo_destroy(&sna->kgem, private->bo); + free(buffer); +} + +static void sna_dri2_destroy_buffer(DrawablePtr draw, DRI2Buffer2Ptr buffer) +{ + _sna_dri2_destroy_buffer(to_sna_from_drawable(draw), buffer); +} + +static DRI2BufferPtr sna_dri2_reference_buffer(DRI2BufferPtr buffer) +{ + get_private(buffer)->refcnt++; + return buffer; +} + +static inline void damage(PixmapPtr pixmap, struct sna_pixmap *priv, RegionPtr region) +{ + assert(priv->gpu_bo); + if (DAMAGE_IS_ALL(priv->gpu_damage)) + goto done; + + if (region == NULL) { +damage_all: + priv->gpu_damage = _sna_damage_all(priv->gpu_damage, + pixmap->drawable.width, + pixmap->drawable.height); + sna_damage_destroy(&priv->cpu_damage); + list_del(&priv->flush_list); + } else { + sna_damage_subtract(&priv->cpu_damage, region); + if (priv->cpu_damage == NULL) + goto damage_all; + sna_damage_add(&priv->gpu_damage, region); + } +done: + priv->cpu = false; + priv->clear = false; +} + +static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo) +{ + struct sna *sna = to_sna_from_pixmap(pixmap); + struct sna_pixmap *priv = sna_pixmap(pixmap); + RegionRec region; + + DBG(("%s: pixmap=%ld, handle=%d\n", + __FUNCTION__, pixmap->drawable.serialNumber, bo->handle)); + + assert(pixmap->drawable.width * pixmap->drawable.bitsPerPixel <= 8*bo->pitch); + assert(pixmap->drawable.height * bo->pitch <= kgem_bo_size(bo)); + assert(bo->proxy == NULL); + assert(priv->pinned & PIN_DRI2); + assert((priv->pinned & (PIN_PRIME | PIN_DRI3)) == 0); + assert(priv->flush); + + /* Post damage on the new front buffer so that listeners, such + * as DisplayLink know take a copy and shove it over the USB, + * also for software cursors and the like. + */ + region.extents.x1 = region.extents.y1 = 0; + region.extents.x2 = pixmap->drawable.width; + region.extents.y2 = pixmap->drawable.height; + region.data = NULL; + DamageRegionAppend(&pixmap->drawable, ®ion); + + damage(pixmap, priv, NULL); + + assert(bo->refcnt); + if (priv->move_to_gpu) + priv->move_to_gpu(sna, priv, 0); + if (priv->gpu_bo != bo) { + DBG(("%s: dropping flush hint from handle=%d\n", __FUNCTION__, priv->gpu_bo->handle)); + priv->gpu_bo->flush = false; + if (priv->cow) + sna_pixmap_undo_cow(sna, priv, 0); + if (priv->gpu_bo) { + sna_pixmap_unmap(pixmap, priv); + kgem_bo_destroy(&sna->kgem, priv->gpu_bo); + } + DBG(("%s: adding flush hint to handle=%d\n", __FUNCTION__, bo->handle)); + bo->flush = true; + if (bo->exec) + sna->kgem.flush = 1; + priv->gpu_bo = ref(bo); + } + if (bo->domain != DOMAIN_GPU) + bo->domain = DOMAIN_NONE; + assert(bo->flush); + + DamageRegionProcessPending(&pixmap->drawable); +} + +static void sna_dri2_select_mode(struct sna *sna, struct kgem_bo *dst, struct kgem_bo *src, bool sync) +{ + struct drm_i915_gem_busy busy; + int mode; + + if (sna->kgem.gen < 060) + return; + + if (sync) { + DBG(("%s: sync, force %s ring\n", __FUNCTION__, + sna->kgem.gen >= 070 ? "BLT" : "RENDER")); + kgem_set_mode(&sna->kgem, + sna->kgem.gen >= 070 ? KGEM_BLT : KGEM_RENDER, + dst); + return; + } + + if (DBG_FORCE_COPY != -1) { + DBG(("%s: forcing %d\n", __FUNCTION__, DBG_FORCE_COPY)); + kgem_set_mode(&sna->kgem, DBG_FORCE_COPY, dst); + return; + } + + if (sna->kgem.mode != KGEM_NONE) { + DBG(("%s: busy, not switching\n", __FUNCTION__)); + return; + } + + VG_CLEAR(busy); + busy.handle = src->handle; + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_BUSY, &busy)) + return; + + DBG(("%s: src handle=%d busy?=%x\n", __FUNCTION__, busy.handle, busy.busy)); + if (busy.busy == 0) { + __kgem_bo_clear_busy(src); + + busy.handle = dst->handle; + if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_BUSY, &busy)) + return; + + DBG(("%s: dst handle=%d busy?=%x\n", __FUNCTION__, busy.handle, busy.busy)); + if (busy.busy == 0) { + __kgem_bo_clear_busy(dst); + DBG(("%s: src/dst is idle, using defaults\n", __FUNCTION__)); + return; + } + } + + /* Sandybridge introduced a separate ring which it uses to + * perform blits. Switching rendering between rings incurs + * a stall as we wait upon the old ring to finish and + * flush its render cache before we can proceed on with + * the operation on the new ring. + * + * As this buffer, we presume, has just been written to by + * the DRI client using the RENDER ring, we want to perform + * our operation on the same ring, and ideally on the same + * ring as we will flip from (which should be the RENDER ring + * as well). + * + * The ultimate question is whether preserving the ring outweighs + * the cost of the query. + */ + mode = KGEM_RENDER; + if (busy.busy & (0xfffe << 16)) + mode = KGEM_BLT; + kgem_bo_mark_busy(&sna->kgem, busy.handle == src->handle ? src : dst, mode); + _kgem_set_mode(&sna->kgem, mode); +} + +static bool can_copy_cpu(struct sna *sna, + struct kgem_bo *src, + struct kgem_bo *dst) +{ + if (src->tiling != dst->tiling) + return false; + + if (src->pitch != dst->pitch) + return false; + + if (!kgem_bo_can_map__cpu(&sna->kgem, src, false)) + return false; + + if (!kgem_bo_can_map__cpu(&sna->kgem, dst, true)) + return false; + + DBG(("%s -- yes, src handle=%d, dst handle=%d\n", __FUNCTION__, src->handle, dst->handle)); + return true; +} + +static void +sna_dri2_copy_fallback(struct sna *sna, + const DrawableRec *draw, + struct kgem_bo *src_bo, int sx, int sy, + struct kgem_bo *dst_bo, int dx, int dy, + const BoxRec *box, int n) +{ + void *dst, *src; + bool clipped; + + clipped = (n > 1 || + box->x1 + sx > 0 || + box->y1 + sy > 0 || + box->x2 + sx < draw->width || + box->y2 + sy < draw->height); + + dst = src = NULL; + if (!clipped && can_copy_cpu(sna, src_bo, dst_bo)) { + dst = kgem_bo_map__cpu(&sna->kgem, dst_bo); + src = kgem_bo_map__cpu(&sna->kgem, src_bo); + } + + if (dst == NULL || src == NULL) { + dst = kgem_bo_map__gtt(&sna->kgem, dst_bo); + src = kgem_bo_map__gtt(&sna->kgem, src_bo); + if (dst == NULL || src == NULL) + return; + } else { + kgem_bo_sync__cpu_full(&sna->kgem, dst_bo, true); + kgem_bo_sync__cpu_full(&sna->kgem, src_bo, false); + } + + DBG(("%s: src(%d, %d), dst(%d, %d) x %d\n", + __FUNCTION__, sx, sy, dx, dy, n)); + + if (sigtrap_get() == 0) { + do { + memcpy_blt(src, dst, draw->bitsPerPixel, + src_bo->pitch, dst_bo->pitch, + box->x1 + sx, box->y1 + sy, + box->x1 + dx, box->y1 + dy, + box->x2 - box->x1, box->y2 - box->y1); + box++; + } while (--n); + sigtrap_put(); + } +} + +static bool is_front(int attachment) +{ + return attachment == DRI2BufferFrontLeft; +} + +static struct kgem_bo * +__sna_dri2_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region, + DRI2BufferPtr src, DRI2BufferPtr dst, + bool sync) +{ + PixmapPtr pixmap = get_drawable_pixmap(draw); + DrawableRec scratch, *src_draw = &pixmap->drawable, *dst_draw = &pixmap->drawable; + struct sna_dri2_private *src_priv = get_private(src); + struct sna_dri2_private *dst_priv = get_private(dst); + pixman_region16_t clip; + struct kgem_bo *bo = NULL; + struct kgem_bo *src_bo; + struct kgem_bo *dst_bo; + const BoxRec *boxes; + int16_t dx, dy, sx, sy; + int n; + + /* To hide a stale DRI2Buffer, one may choose to substitute + * pixmap->gpu_bo instead of dst/src->bo, however you then run + * the risk of copying around invalid data. So either you may not + * see the results of the copy, or you may see the wrong pixels. + * Either way you eventually lose. + * + * We also have to be careful in case that the stale buffers are + * now attached to invalid (non-DRI) pixmaps. + */ + + assert(is_front(dst->attachment) || is_front(src->attachment)); + assert(dst->attachment != src->attachment); + + clip.extents.x1 = draw->x; + clip.extents.y1 = draw->y; + clip.extents.x2 = draw->x + draw->width; + clip.extents.y2 = draw->y + draw->height; + clip.data = NULL; + + if (region) { + pixman_region_translate(region, draw->x, draw->y); + pixman_region_intersect(&clip, &clip, region); + region = &clip; + } + + if (clip.extents.x1 >= clip.extents.x2 || + clip.extents.y1 >= clip.extents.y2) { + DBG(("%s: all clipped\n", __FUNCTION__)); + return NULL; + } + + sx = sy = dx = dy = 0; + if (is_front(dst->attachment)) { + sx = -draw->x; + sy = -draw->y; + } else { + dx = -draw->x; + dy = -draw->y; + } + if (draw->type == DRAWABLE_WINDOW) { + WindowPtr win = (WindowPtr)draw; + int16_t tx, ty; + + if (is_clipped(&win->clipList, draw)) { + DBG(("%s: draw=(%d, %d), delta=(%d, %d), draw=(%d, %d),(%d, %d), clip.extents=(%d, %d), (%d, %d)\n", + __FUNCTION__, draw->x, draw->y, + get_drawable_dx(draw), get_drawable_dy(draw), + clip.extents.x1, clip.extents.y1, + clip.extents.x2, clip.extents.y2, + win->clipList.extents.x1, win->clipList.extents.y1, + win->clipList.extents.x2, win->clipList.extents.y2)); + + assert(region == NULL || region == &clip); + pixman_region_intersect(&clip, &win->clipList, &clip); + if (!pixman_region_not_empty(&clip)) { + DBG(("%s: all clipped\n", __FUNCTION__)); + return NULL; + } + + region = &clip; + } + + if (get_drawable_deltas(draw, pixmap, &tx, &ty)) { + if (is_front(dst->attachment)) { + pixman_region_translate(region ?: &clip, tx, ty); + sx -= tx; + sy -= ty; + } else { + sx += tx; + sy += ty; + } + } + } else + sync = false; + + scratch.x = scratch.y = 0; + scratch.width = scratch.height = 0; + scratch.depth = draw->depth; + scratch.bitsPerPixel = draw->bitsPerPixel; + + src_bo = src_priv->bo; + assert(src_bo->refcnt); + if (is_front(src->attachment)) { + struct sna_pixmap *priv; + + priv = sna_pixmap_move_to_gpu(pixmap, MOVE_READ); + if (priv) + src_bo = priv->gpu_bo; + DBG(("%s: updated FrontLeft src_bo from handle=%d to handle=%d\n", + __FUNCTION__, src_priv->bo->handle, src_bo->handle)); + assert(src_bo->refcnt); + } else { + RegionRec source; + + scratch.width = src_priv->size & 0xffff; + scratch.height = src_priv->size >> 16; + src_draw = &scratch; + + DBG(("%s: source size %dx%d, region size %dx%d\n", + __FUNCTION__, + scratch.width, scratch.height, + clip.extents.x2 - clip.extents.x1, + clip.extents.y2 - clip.extents.y1)); + + source.extents.x1 = -sx; + source.extents.y1 = -sy; + source.extents.x2 = source.extents.x1 + scratch.width; + source.extents.y2 = source.extents.y1 + scratch.height; + source.data = NULL; + + assert(region == NULL || region == &clip); + pixman_region_intersect(&clip, &clip, &source); + + } + + dst_bo = dst_priv->bo; + assert(dst_bo->refcnt); + if (is_front(dst->attachment)) { + struct sna_pixmap *priv; + unsigned int flags; + + flags = MOVE_WRITE | __MOVE_FORCE; + if (clip.data) + flags |= MOVE_READ; + + assert(region == NULL || region == &clip); + priv = sna_pixmap_move_area_to_gpu(pixmap, &clip.extents, flags); + if (priv) { + damage(pixmap, priv, region); + dst_bo = priv->gpu_bo; + } + DBG(("%s: updated FrontLeft dst_bo from handle=%d to handle=%d\n", + __FUNCTION__, dst_priv->bo->handle, dst_bo->handle)); + assert(dst_bo->refcnt); + } else { + RegionRec target; + + scratch.width = dst_priv->size & 0xffff; + scratch.height = dst_priv->size >> 16; + dst_draw = &scratch; + + DBG(("%s: target size %dx%d, region size %dx%d\n", + __FUNCTION__, + scratch.width, scratch.height, + clip.extents.x2 - clip.extents.x1, + clip.extents.y2 - clip.extents.y1)); + + target.extents.x1 = -dx; + target.extents.y1 = -dy; + target.extents.x2 = target.extents.x1 + scratch.width; + target.extents.y2 = target.extents.y1 + scratch.height; + target.data = NULL; + + assert(region == NULL || region == &clip); + pixman_region_intersect(&clip, &clip, &target); + + sync = false; + } + + if (!wedged(sna)) { + xf86CrtcPtr crtc; + + crtc = NULL; + if (sync && sna_pixmap_is_scanout(sna, pixmap)) + crtc = sna_covering_crtc(sna, &clip.extents, NULL); + sna_dri2_select_mode(sna, dst_bo, src_bo, crtc != NULL); + + sync = (crtc != NULL&& + sna_wait_for_scanline(sna, pixmap, crtc, + &clip.extents)); + } + + if (region) { + boxes = region_rects(region); + n = region_num_rects(region); + assert(n); + } else { + region = &clip; + boxes = &clip.extents; + n = 1; + } + DamageRegionAppend(&pixmap->drawable, region); + + if (wedged(sna)) { +fallback: + sna_dri2_copy_fallback(sna, src_draw, + src_bo, sx, sy, + dst_bo, dx, dy, + boxes, n); + } else { + unsigned flags; + + DBG(("%s: copying [(%d, %d), (%d, %d)]x%d src=(%d, %d), dst=(%d, %d)\n", + __FUNCTION__, + boxes[0].x1, boxes[0].y1, + boxes[0].x2, boxes[0].y2, + n, sx, sy, dx, dy)); + + flags = COPY_LAST; + if (sync) + flags |= COPY_SYNC; + if (!sna->render.copy_boxes(sna, GXcopy, + src_draw, src_bo, sx, sy, + dst_draw, dst_bo, dx, dy, + boxes, n, flags)) + goto fallback; + + DBG(("%s: flushing? %d\n", __FUNCTION__, sync)); + if (sync) { /* STAT! */ + struct kgem_request *rq = sna->kgem.next_request; + kgem_submit(&sna->kgem); + if (rq->bo) { + bo = ref(rq->bo); + DBG(("%s: recording sync fence handle=%d\n", __FUNCTION__, bo->handle)); + } + } + } + + DamageRegionProcessPending(&pixmap->drawable); + + if (clip.data) + pixman_region_fini(&clip); + + return bo; +} + +static void +sna_dri2_copy_region(DrawablePtr draw, + RegionPtr region, + DRI2BufferPtr dst, + DRI2BufferPtr src) +{ + PixmapPtr pixmap = get_drawable_pixmap(draw); + struct sna *sna = to_sna_from_pixmap(pixmap); + + DBG(("%s: pixmap=%ld, src=%u (refs=%d/%d, flush=%d, attach=%d) , dst=%u (refs=%d/%d, flush=%d, attach=%d)\n", + __FUNCTION__, + pixmap->drawable.serialNumber, + get_private(src)->bo->handle, + get_private(src)->refcnt, + get_private(src)->bo->refcnt, + get_private(src)->bo->flush, + src->attachment, + get_private(dst)->bo->handle, + get_private(dst)->refcnt, + get_private(dst)->bo->refcnt, + get_private(dst)->bo->flush, + dst->attachment)); + + assert(src != dst); + + assert(get_private(src)->refcnt); + assert(get_private(dst)->refcnt); + + assert(get_private(src)->bo->refcnt); + assert(get_private(dst)->bo->refcnt); + + DBG(("%s: region (%d, %d), (%d, %d) x %d\n", + __FUNCTION__, + region->extents.x1, region->extents.y1, + region->extents.x2, region->extents.y2, + region_num_rects(region))); + + __sna_dri2_copy_region(sna, draw, region, src, dst, false); +} + +inline static uint32_t pipe_select(int pipe) +{ + /* The third pipe was introduced with IvyBridge long after + * multiple pipe support was added to the kernel, hence + * we can safely ignore the capability check - if we have more + * than two pipes, we can assume that they are fully supported. + */ + if (pipe > 1) + return pipe << DRM_VBLANK_HIGH_CRTC_SHIFT; + else if (pipe > 0) + return DRM_VBLANK_SECONDARY; + else + return 0; +} + +static inline int sna_wait_vblank(struct sna *sna, union drm_wait_vblank *vbl, int pipe) +{ + DBG(("%s(pipe=%d, waiting until seq=%u%s)\n", + __FUNCTION__, pipe, vbl->request.sequence, + vbl->request.type & DRM_VBLANK_RELATIVE ? " [relative]" : "")); + assert(pipe != -1); + + vbl->request.type |= pipe_select(pipe); + return drmIoctl(sna->kgem.fd, DRM_IOCTL_WAIT_VBLANK, vbl); +} + +#if DRI2INFOREC_VERSION >= 4 + +static void dri2_window_attach(WindowPtr win, struct dri2_window *priv) +{ + assert(win->drawable.type == DRAWABLE_WINDOW); + assert(dri2_window(win) == NULL); + ((void **)__get_private(win, sna_window_key))[1] = priv; + assert(dri2_window(win) == priv); +} + +static uint64_t +draw_current_msc(DrawablePtr draw, xf86CrtcPtr crtc, uint64_t msc) +{ + struct dri2_window *priv; + + if (draw->type != DRAWABLE_WINDOW) + return msc; + + priv = dri2_window((WindowPtr)draw); + if (priv == NULL) { + priv = malloc(sizeof(*priv)); + if (priv != NULL) { + priv->front = NULL; + priv->crtc = crtc; + priv->msc_delta = 0; + priv->chain = NULL; + dri2_window_attach((WindowPtr)draw, priv); + } + } else { + if (priv->crtc != crtc) { + const struct ust_msc *last = sna_crtc_last_swap(priv->crtc); + const struct ust_msc *this = sna_crtc_last_swap(crtc); + DBG(("%s: Window transferring from pipe=%d [msc=%llu] to pipe=%d [msc=%llu], delta now %lld\n", + __FUNCTION__, + sna_crtc_to_pipe(priv->crtc), (long long)last->msc, + sna_crtc_to_pipe(crtc), (long long)this->msc, + (long long)(priv->msc_delta + this->msc - last->msc))); + priv->msc_delta += this->msc - last->msc; + priv->crtc = crtc; + } + msc -= priv->msc_delta; + } + return msc; +} + +static uint32_t +draw_target_seq(DrawablePtr draw, uint64_t msc) +{ + struct dri2_window *priv = dri2_window((WindowPtr)draw); + if (priv == NULL) + return msc; + DBG(("%s: converting target_msc=%llu to seq %u\n", + __FUNCTION__, (long long)msc, (unsigned)(msc + priv->msc_delta))); + return msc + priv->msc_delta; +} + +static xf86CrtcPtr +sna_dri2_get_crtc(DrawablePtr draw) +{ + struct sna *sna = to_sna_from_drawable(draw); + BoxRec box; + + if (draw->type == DRAWABLE_PIXMAP) + return NULL; + + box.x1 = draw->x; + box.y1 = draw->y; + box.x2 = box.x1 + draw->width; + box.y2 = box.y1 + draw->height; + + /* Make sure the CRTC is valid and this is the real front buffer */ + return sna_covering_crtc(sna, &box, NULL); +} + +static void +sna_dri2_remove_event(WindowPtr win, struct sna_dri2_event *info) +{ + struct dri2_window *priv; + struct sna_dri2_event *chain; + + assert(win->drawable.type == DRAWABLE_WINDOW); + DBG(("%s: remove[%p] from window %ld, active? %d\n", + __FUNCTION__, info, (long)win->drawable.id, info->draw != NULL)); + + priv = dri2_window(win); + assert(priv); + assert(priv->chain != NULL); + + if (priv->chain == info) { + priv->chain = info->chain; + return; + } + + chain = priv->chain; + while (chain->chain != info) + chain = chain->chain; + assert(chain != info); + assert(info->chain != chain); + chain->chain = info->chain; +} + +static void +sna_dri2_event_free(struct sna *sna, + DrawablePtr draw, + struct sna_dri2_event *info) +{ + DBG(("%s(draw?=%d)\n", __FUNCTION__, draw != NULL)); + + if (draw && draw->type == DRAWABLE_WINDOW) + sna_dri2_remove_event((WindowPtr)draw, info); + _sna_dri2_destroy_buffer(sna, info->front); + _sna_dri2_destroy_buffer(sna, info->back); + + while (!list_is_empty(&info->cache)) { + struct dri_bo *c; + + c = list_first_entry(&info->cache, struct dri_bo, link); + list_del(&c->link); + + DBG(("%s: releasing cached handle=%d\n", __FUNCTION__, c->bo ? c->bo->handle : 0)); + if (c->bo) + kgem_bo_destroy(&sna->kgem, c->bo); + + free(c); + } + + if (info->bo) { + DBG(("%s: releasing batch handle=%d\n", __FUNCTION__, info->bo->handle)); + kgem_bo_destroy(&sna->kgem, info->bo); + } + + _list_del(&info->link); + free(info); +} + +static void +sna_dri2_client_gone(CallbackListPtr *list, void *closure, void *data) +{ + NewClientInfoRec *clientinfo = data; + ClientPtr client = clientinfo->client; + struct sna_client *priv = sna_client(client); + struct sna *sna = closure; + + if (priv->events.next == NULL) + return; + + if (client->clientState != ClientStateGone) + return; + + DBG(("%s(active?=%d)\n", __FUNCTION__, + !list_is_empty(&priv->events))); + + while (!list_is_empty(&priv->events)) { + struct sna_dri2_event *event; + + event = list_first_entry(&priv->events, struct sna_dri2_event, link); + assert(event->client == client); + + if (event->queued) { + event->client = NULL; + event->draw = NULL; + list_del(&event->link); + } else + sna_dri2_event_free(sna, event->draw, event); + } + + if (--sna->dri2.client_count == 0) + DeleteCallback(&ClientStateCallback, sna_dri2_client_gone, sna); +} + +static bool add_event_to_client(struct sna_dri2_event *info, struct sna *sna, ClientPtr client) +{ + struct sna_client *priv = sna_client(client); + + if (priv->events.next == NULL) { + if (sna->dri2.client_count++ == 0 && + !AddCallback(&ClientStateCallback, sna_dri2_client_gone, sna)) + return false; + + list_init(&priv->events); + } + + list_add(&info->link, &priv->events); + info->client = client; + return true; +} + +static struct sna_dri2_event * +sna_dri2_add_event(struct sna *sna, DrawablePtr draw, ClientPtr client) +{ + struct dri2_window *priv; + struct sna_dri2_event *info, *chain; + + assert(draw->type == DRAWABLE_WINDOW); + DBG(("%s: adding event to window %ld)\n", + __FUNCTION__, (long)draw->id)); + + priv = dri2_window((WindowPtr)draw); + if (priv == NULL) + return NULL; + + info = calloc(1, sizeof(struct sna_dri2_event)); + if (info == NULL) + return NULL; + + list_init(&info->cache); + info->draw = draw; + info->crtc = priv->crtc; + info->pipe = sna_crtc_to_pipe(priv->crtc); + + if (!add_event_to_client(info, sna, client)) { + free(info); + return NULL; + } + + assert(priv->chain != info); + + if (priv->chain == NULL) { + priv->chain = info; + return info; + } + + chain = priv->chain; + while (chain->chain != NULL) + chain = chain->chain; + + assert(chain != info); + chain->chain = info; + return info; +} + +void sna_dri2_destroy_window(WindowPtr win) +{ + struct sna *sna; + struct dri2_window *priv; + + priv = dri2_window(win); + if (priv == NULL) + return; + + DBG(("%s: window=%ld\n", __FUNCTION__, win->drawable.serialNumber)); + sna = to_sna_from_drawable(&win->drawable); + + if (priv->front) { + assert(priv->crtc); + sna_shadow_unset_crtc(sna, priv->crtc); + _sna_dri2_destroy_buffer(sna, priv->front); + } + + if (priv->chain) { + struct sna_dri2_event *info, *chain; + + DBG(("%s: freeing chain\n", __FUNCTION__)); + + chain = priv->chain; + while ((info = chain)) { + info->draw = NULL; + info->client = NULL; + + chain = info->chain; + info->chain = NULL; + + if (!info->queued) + sna_dri2_event_free(sna, NULL, info); + } + } + + free(priv); +} + +static void +sna_dri2_flip_handler(struct sna *sna, + struct drm_event_vblank *event, + void *data) +{ + DBG(("%s: sequence=%d\n", __FUNCTION__, event->sequence)); + sna_dri2_flip_event(sna, data); +} + +static bool +sna_dri2_flip(struct sna *sna, struct sna_dri2_event *info) +{ + struct kgem_bo *bo = get_private(info->back)->bo; + struct kgem_bo *tmp_bo; + uint32_t tmp_name; + + DBG(("%s(type=%d)\n", __FUNCTION__, info->type)); + + assert(sna_pixmap_get_buffer(sna->front) == info->front); + assert(get_drawable_pixmap(info->draw)->drawable.height * bo->pitch <= kgem_bo_size(bo)); + assert(bo->refcnt); + + if (!sna_page_flip(sna, bo, sna_dri2_flip_handler, + info->type == FLIP_ASYNC ? NULL : info)) + return false; + + assert(sna->dri2.flip_pending == NULL || sna->dri2.flip_pending == info); + if (info->type != FLIP_ASYNC) + sna->dri2.flip_pending = info; + + DBG(("%s: marked handle=%d as scanout, swap front (handle=%d, name=%d) and back (handle=%d, name=%d)\n", + __FUNCTION__, bo->handle, + get_private(info->front)->bo->handle, info->front->name, + get_private(info->back)->bo->handle, info->back->name)); + + tmp_bo = get_private(info->front)->bo; + tmp_name = info->front->name; + + set_bo(sna->front, bo); + + info->front->name = info->back->name; + get_private(info->front)->bo = bo; + + info->back->name = tmp_name; + get_private(info->back)->bo = tmp_bo; + get_private(info->back)->stale = true; + + assert(get_private(info->front)->bo->refcnt); + assert(get_private(info->back)->bo->refcnt); + assert(get_private(info->front)->bo != get_private(info->back)->bo); + + info->queued = true; + return true; +} + +static bool +can_flip(struct sna * sna, + DrawablePtr draw, + DRI2BufferPtr front, + DRI2BufferPtr back, + xf86CrtcPtr crtc) +{ + WindowPtr win = (WindowPtr)draw; + PixmapPtr pixmap; + + assert((sna->flags & SNA_NO_WAIT) == 0); + + if (!DBG_CAN_FLIP) + return false; + + if (draw->type == DRAWABLE_PIXMAP) + return false; + + if (!sna->mode.front_active) { + DBG(("%s: no, active CRTC\n", __FUNCTION__)); + return false; + } + + assert(sna->scrn->vtSema); + + if ((sna->flags & (SNA_HAS_FLIP | SNA_HAS_ASYNC_FLIP)) == 0) { + DBG(("%s: no, pageflips disabled\n", __FUNCTION__)); + return false; + } + + if (front->format != back->format) { + DBG(("%s: no, format mismatch, front = %d, back = %d\n", + __FUNCTION__, front->format, back->format)); + return false; + } + + if (sna->mode.shadow_active) { + DBG(("%s: no, shadow enabled\n", __FUNCTION__)); + return false; + } + + if (!sna_crtc_is_on(crtc)) { + DBG(("%s: ref-pipe=%d is disabled\n", __FUNCTION__, sna_crtc_to_pipe(crtc))); + return false; + } + + pixmap = get_window_pixmap(win); + if (pixmap != sna->front) { + DBG(("%s: no, window (pixmap=%ld) is not attached to the front buffer (pixmap=%ld)\n", + __FUNCTION__, pixmap->drawable.serialNumber, sna->front->drawable.serialNumber)); + return false; + } + + if (sna_pixmap_get_buffer(pixmap) != front) { + DBG(("%s: no, DRI2 drawable is no longer attached (old name=%d, new name=%d) to pixmap=%ld\n", + __FUNCTION__, front->name, + sna_pixmap_get_buffer(pixmap) ? ((DRI2BufferPtr)sna_pixmap_get_buffer(pixmap))->name : 0, + pixmap->drawable.serialNumber)); + return false; + } + + assert(get_private(front)->pixmap == sna->front); + assert(sna_pixmap(sna->front)->gpu_bo == get_private(front)->bo); + + if (!get_private(back)->bo->scanout) { + DBG(("%s: no, DRI2 drawable was too small at time of creation)\n", + __FUNCTION__)); + return false; + } + + if (get_private(back)->size != get_private(front)->size) { + DBG(("%s: no, DRI2 drawable does not fit into scanout\n", + __FUNCTION__)); + return false; + } + + DBG(("%s: window size: %dx%d, clip=(%d, %d), (%d, %d) x %d\n", + __FUNCTION__, + win->drawable.width, win->drawable.height, + win->clipList.extents.x1, win->clipList.extents.y1, + win->clipList.extents.x2, win->clipList.extents.y2, + region_num_rects(&win->clipList))); + if (!RegionEqual(&win->clipList, &draw->pScreen->root->winSize)) { + DBG(("%s: no, window is clipped: clip region=(%d, %d), (%d, %d), root size=(%d, %d), (%d, %d)\n", + __FUNCTION__, + win->clipList.extents.x1, + win->clipList.extents.y1, + win->clipList.extents.x2, + win->clipList.extents.y2, + draw->pScreen->root->winSize.extents.x1, + draw->pScreen->root->winSize.extents.y1, + draw->pScreen->root->winSize.extents.x2, + draw->pScreen->root->winSize.extents.y2)); + return false; + } + + if (draw->x != 0 || draw->y != 0 || +#ifdef COMPOSITE + draw->x != pixmap->screen_x || + draw->y != pixmap->screen_y || +#endif + draw->width != pixmap->drawable.width || + draw->height != pixmap->drawable.height) { + DBG(("%s: no, window is not full size (%dx%d)!=(%dx%d)\n", + __FUNCTION__, + draw->width, draw->height, + pixmap->drawable.width, + pixmap->drawable.height)); + return false; + } + + /* prevent an implicit tiling mode change */ + if (get_private(back)->bo->tiling > I915_TILING_X) { + DBG(("%s -- no, tiling mismatch: front %d, back=%d, want-tiled?=%d\n", + __FUNCTION__, + get_private(front)->bo->tiling, + get_private(back)->bo->tiling, + !!(sna->flags & SNA_LINEAR_FB))); + return false; + } + + if (get_private(front)->bo->pitch != get_private(back)->bo->pitch) { + DBG(("%s -- no, pitch mismatch: front %d, back=%d\n", + __FUNCTION__, + get_private(front)->bo->pitch, + get_private(back)->bo->pitch)); + return false; + } + + if (sna_pixmap(pixmap)->pinned & ~(PIN_DRI2 | PIN_SCANOUT)) { + DBG(("%s -- no, pinned: front %x\n", + __FUNCTION__, sna_pixmap(pixmap)->pinned)); + return false; + } + + DBG(("%s: yes, pixmap=%ld\n", __FUNCTION__, pixmap->drawable.serialNumber)); + assert(dri2_window(win)->front == NULL); + return true; +} + +static bool +can_xchg(struct sna * sna, + DrawablePtr draw, + DRI2BufferPtr front, + DRI2BufferPtr back) +{ + WindowPtr win = (WindowPtr)draw; + PixmapPtr pixmap; + + if (!DBG_CAN_XCHG) + return false; + + if (draw->type == DRAWABLE_PIXMAP) + return false; + + if (front->format != back->format) { + DBG(("%s: no, format mismatch, front = %d, back = %d\n", + __FUNCTION__, front->format, back->format)); + return false; + } + + pixmap = get_window_pixmap(win); + + DBG(("%s: window size: %dx%d, clip=(%d, %d), (%d, %d) x %d, pixmap size=%dx%d\n", + __FUNCTION__, + win->drawable.width, win->drawable.height, + win->clipList.extents.x1, win->clipList.extents.y1, + win->clipList.extents.x2, win->clipList.extents.y2, + region_num_rects(&win->clipList), + pixmap->drawable.width, + pixmap->drawable.height)); + if (is_clipped(&win->clipList, &pixmap->drawable)) { + DBG(("%s: no, %dx%d window is clipped: clip region=(%d, %d), (%d, %d)\n", + __FUNCTION__, + draw->width, draw->height, + win->clipList.extents.x1, + win->clipList.extents.y1, + win->clipList.extents.x2, + win->clipList.extents.y2)); + return false; + } + + if (get_private(back)->size != get_private(front)->size) { + DBG(("%s: no, back buffer %dx%d does not match front buffer %dx%d\n", + __FUNCTION__, + get_private(back)->size & 0x7fff, (get_private(back)->size >> 16) & 0x7fff, + get_private(front)->size & 0x7fff, (get_private(front)->size >> 16) & 0x7fff)); + return false; + } + + if (pixmap == sna->front && !(sna->flags & SNA_TEAR_FREE) && sna->mode.front_active) { + DBG(("%s: no, front buffer, requires flipping\n", + __FUNCTION__)); + return false; + } + + if (sna_pixmap(pixmap)->pinned & ~(PIN_DRI2 | PIN_SCANOUT)) { + DBG(("%s: no, pinned: %x\n", + __FUNCTION__, sna_pixmap(pixmap)->pinned)); + return false; + } + + DBG(("%s: yes, pixmap=%ld\n", __FUNCTION__, pixmap->drawable.serialNumber)); + return true; +} + +static bool +overlaps_other_crtc(struct sna *sna, xf86CrtcPtr desired) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); + int c; + + for (c = 0; c < sna->mode.num_real_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; + + if (crtc == desired) + continue; + + if (!crtc->enabled) + continue; + + if (desired->bounds.x1 < crtc->bounds.x2 && + desired->bounds.x2 > crtc->bounds.x1 && + desired->bounds.y1 < crtc->bounds.y2 && + desired->bounds.y2 > crtc->bounds.y1) + return true; + } + + return false; +} + +static bool +can_xchg_crtc(struct sna *sna, + DrawablePtr draw, + DRI2BufferPtr front, + DRI2BufferPtr back, + xf86CrtcPtr crtc) +{ + WindowPtr win = (WindowPtr)draw; + PixmapPtr pixmap; + + if (!DBG_CAN_XCHG) + return false; + + if ((sna->flags & SNA_TEAR_FREE) == 0) { + DBG(("%s: no, requires TearFree\n", + __FUNCTION__)); + return false; + } + + if (draw->type == DRAWABLE_PIXMAP) + return false; + + if (front->format != back->format) { + DBG(("%s: no, format mismatch, front = %d, back = %d\n", + __FUNCTION__, front->format, back->format)); + return false; + } + + if (memcmp(&win->clipList.extents, &crtc->bounds, sizeof(crtc->bounds))) { + DBG(("%s: no, window [(%d, %d), (%d, %d)] does not cover CRTC [(%d, %d), (%d, %d)]\n", + __FUNCTION__, + win->clipList.extents.x1, win->clipList.extents.y1, + win->clipList.extents.x2, win->clipList.extents.y2, + crtc->bounds.x1, crtc->bounds.y1, + crtc->bounds.x2, crtc->bounds.y2)); + return false; + } + + if (sna_crtc_is_transformed(crtc)) { + DBG(("%s: no, CRTC is rotated\n", __FUNCTION__)); + return false; + } + + pixmap = get_window_pixmap(win); + if (pixmap != sna->front) { + DBG(("%s: no, not attached to front buffer\n", __FUNCTION__)); + return false; + } + + DBG(("%s: window size: %dx%d, clip=(%d, %d), (%d, %d) x %d\n", + __FUNCTION__, + win->drawable.width, win->drawable.height, + win->clipList.extents.x1, win->clipList.extents.y1, + win->clipList.extents.x2, win->clipList.extents.y2, + region_num_rects(&win->clipList))); + if (is_clipped(&win->clipList, &win->drawable)) { + DBG(("%s: no, %dx%d window is clipped: clip region=(%d, %d), (%d, %d)\n", + __FUNCTION__, + draw->width, draw->height, + win->clipList.extents.x1, + win->clipList.extents.y1, + win->clipList.extents.x2, + win->clipList.extents.y2)); + return false; + } + + if (overlaps_other_crtc(sna, crtc)) { + DBG(("%s: no, overlaps other CRTC\n", __FUNCTION__)); + return false; + } + + if (get_private(back)->size != (draw->height << 16 | draw->width)) { + DBG(("%s: no, DRI2 buffers does not fit window\n", + __FUNCTION__)); + return false; + } + + assert(win != win->drawable.pScreen->root); + DBG(("%s: yes, pixmap=%ld\n", __FUNCTION__, pixmap->drawable.serialNumber)); + return true; +} + +static void +sna_dri2_xchg(DrawablePtr draw, DRI2BufferPtr front, DRI2BufferPtr back) +{ + WindowPtr win = (WindowPtr)draw; + struct kgem_bo *back_bo, *front_bo; + PixmapPtr pixmap; + int tmp; + + assert(draw->type != DRAWABLE_PIXMAP); + pixmap = get_window_pixmap(win); + + back_bo = get_private(back)->bo; + front_bo = get_private(front)->bo; + assert(front_bo != back_bo); + + DBG(("%s: win=%ld, exchange front=%d/%d and back=%d/%d, pixmap=%ld %dx%d\n", + __FUNCTION__, win->drawable.id, + front_bo->handle, front->name, + back_bo->handle, back->name, + pixmap->drawable.serialNumber, + pixmap->drawable.width, + pixmap->drawable.height)); + + DBG(("%s: back_bo pitch=%d, size=%d, ref=%d, active_scanout?=%d\n", + __FUNCTION__, back_bo->pitch, kgem_bo_size(back_bo), back_bo->refcnt, back_bo->active_scanout)); + DBG(("%s: front_bo pitch=%d, size=%d, ref=%d, active_scanout?=%d\n", + __FUNCTION__, front_bo->pitch, kgem_bo_size(front_bo), front_bo->refcnt, front_bo->active_scanout)); + assert(front_bo->refcnt); + assert(back_bo->refcnt); + + assert(sna_pixmap_get_buffer(pixmap) == front); + + assert(pixmap->drawable.height * back_bo->pitch <= kgem_bo_size(back_bo)); + assert(pixmap->drawable.height * front_bo->pitch <= kgem_bo_size(front_bo)); + + set_bo(pixmap, back_bo); + + get_private(front)->bo = back_bo; + get_private(back)->bo = front_bo; + get_private(back)->stale = true; + + tmp = front->name; + front->name = back->name; + back->name = tmp; + + assert(front_bo->refcnt); + assert(back_bo->refcnt); + + assert(get_private(front)->bo == sna_pixmap(pixmap)->gpu_bo); +} + +static void sna_dri2_xchg_crtc(struct sna *sna, DrawablePtr draw, xf86CrtcPtr crtc, DRI2BufferPtr front, DRI2BufferPtr back) +{ + WindowPtr win = (WindowPtr)draw; + PixmapPtr pixmap = get_window_pixmap(win); + + DBG(("%s: exchange front=%d/%d and back=%d/%d, win id=%lu, pixmap=%ld %dx%d\n", + __FUNCTION__, + get_private(front)->bo->handle, front->name, + get_private(back)->bo->handle, back->name, + win->drawable.id, + pixmap->drawable.serialNumber, + pixmap->drawable.width, + pixmap->drawable.height)); + + sna_shadow_set_crtc(sna, crtc, get_private(back)->bo); + DamageRegionProcessPending(&win->drawable); + + front->attachment = DRI2BufferBackLeft; + get_private(front)->stale = true; + + back->attachment = DRI2BufferFrontLeft; + if (get_private(back)->proxy == NULL) { + get_private(back)->proxy = sna_dri2_reference_buffer(sna_pixmap_get_buffer(pixmap)); + get_private(back)->pixmap = pixmap; + } + + assert(dri2_window(win)->front == NULL); + dri2_window(win)->front = sna_dri2_reference_buffer(back); +} + +static void frame_swap_complete(struct sna *sna, + struct sna_dri2_event *frame, + int type) +{ + const struct ust_msc *swap; + + if (frame->draw == NULL) + return; + + assert(frame->client); + + swap = sna_crtc_last_swap(frame->crtc); + DBG(("%s: draw=%ld, pipe=%d, frame=%lld [msc=%lld], tv=%d.%06d\n", + __FUNCTION__, (long)frame->draw, frame->pipe, + (long long)swap->msc, + (long long)draw_current_msc(frame->draw, frame->crtc, swap->msc), + swap->tv_sec, swap->tv_usec)); + + DRI2SwapComplete(frame->client, frame->draw, + draw_current_msc(frame->draw, frame->crtc, swap->msc), + swap->tv_sec, swap->tv_usec, + type, frame->event_complete, frame->event_data); +} + +static void fake_swap_complete(struct sna *sna, ClientPtr client, + DrawablePtr draw, xf86CrtcPtr crtc, + int type, DRI2SwapEventPtr func, void *data) +{ + const struct ust_msc *swap; + + swap = sna_crtc_last_swap(crtc); + DBG(("%s: draw=%ld, pipe=%d, frame=%lld [msc %lld], tv=%d.%06d\n", + __FUNCTION__, (long)draw->id, crtc ? sna_crtc_to_pipe(crtc) : -1, + (long long)swap->msc, + (long long)draw_current_msc(draw, crtc, swap->msc), + swap->tv_sec, swap->tv_usec)); + + DRI2SwapComplete(client, draw, + draw_current_msc(draw, crtc, swap->msc), + swap->tv_sec, swap->tv_usec, + type, func, data); +} + +static void chain_swap(struct sna *sna, struct sna_dri2_event *chain) +{ + union drm_wait_vblank vbl; + + if (chain->draw == NULL) { + sna_dri2_event_free(sna, NULL, chain); + return; + } + + if (chain->queued) /* too early! */ + return; + + assert(chain == dri2_chain(chain->draw)); + DBG(("%s: chaining draw=%ld, type=%d\n", + __FUNCTION__, (long)chain->draw->id, chain->type)); + chain->queued = true; + + switch (chain->type) { + case SWAP_THROTTLE: + DBG(("%s: emitting chained vsync'ed blit\n", __FUNCTION__)); + if (sna->mode.shadow && !sna->mode.shadow_damage) { + /* recursed from wait_for_shadow(), simply requeue */ + DBG(("%s -- recursed from wait_for_shadow(), requeuing\n", __FUNCTION__)); + VG_CLEAR(vbl); + vbl.request.type = + DRM_VBLANK_RELATIVE | + DRM_VBLANK_EVENT; + vbl.request.sequence = 1; + vbl.request.signal = (uintptr_t)chain; + + if (!sna_wait_vblank(sna, &vbl, chain->pipe)) + return; + + DBG(("%s -- requeue failed, errno=%d\n", __FUNCTION__, errno)); + } + + if (can_xchg(sna, chain->draw, chain->front, chain->back)) { + sna_dri2_xchg(chain->draw, chain->front, chain->back); + } else if (can_xchg_crtc(sna, chain->draw, chain->front, chain->back, chain->crtc)) { + sna_dri2_xchg_crtc(sna, chain->draw, chain->crtc, chain->front, chain->back); + } else { + assert(chain->queued); + chain->bo = __sna_dri2_copy_region(sna, chain->draw, NULL, + chain->back, chain->front, + true); + } + case SWAP: + break; + default: + return; + } + + VG_CLEAR(vbl); + vbl.request.type = + DRM_VBLANK_RELATIVE | + DRM_VBLANK_EVENT; + vbl.request.sequence = 1; + vbl.request.signal = (uintptr_t)chain; + if (sna_wait_vblank(sna, &vbl, chain->pipe)) { + DBG(("%s: vblank wait failed, unblocking client\n", __FUNCTION__)); + frame_swap_complete(sna, chain, DRI2_BLIT_COMPLETE); + sna_dri2_event_free(sna, chain->draw, chain); + } else { + if (chain->type == SWAP_THROTTLE && !swap_limit(chain->draw, 2)) { + DBG(("%s: fake triple buffering, unblocking client\n", __FUNCTION__)); + frame_swap_complete(sna, chain, DRI2_BLIT_COMPLETE); + } + } +} + +static inline bool rq_is_busy(struct kgem *kgem, struct kgem_bo *bo) +{ + if (bo == NULL) + return false; + + DBG(("%s: handle=%d, domain: %d exec? %d, rq? %d\n", __FUNCTION__, + bo->handle, bo->domain, bo->exec != NULL, bo->rq != NULL)); + assert(bo->refcnt); + + if (bo->exec) + return true; + + if (bo->rq == NULL) + return false; + + return __kgem_busy(kgem, bo->handle); +} + +static bool sna_dri2_blit_complete(struct sna *sna, + struct sna_dri2_event *info) +{ + if (rq_is_busy(&sna->kgem, info->bo)) { + union drm_wait_vblank vbl; + + DBG(("%s: vsync'ed blit is still busy, postponing\n", + __FUNCTION__)); + + VG_CLEAR(vbl); + vbl.request.type = + DRM_VBLANK_RELATIVE | + DRM_VBLANK_EVENT; + vbl.request.sequence = 1; + vbl.request.signal = (uintptr_t)info; + assert(info->queued); + if (!sna_wait_vblank(sna, &vbl, info->pipe)) + return false; + } + + DBG(("%s: blit finished\n", __FUNCTION__)); + return true; +} + +void sna_dri2_vblank_handler(struct sna *sna, struct drm_event_vblank *event) +{ + struct sna_dri2_event *info = (void *)(uintptr_t)event->user_data; + DrawablePtr draw; + union drm_wait_vblank vbl; + uint64_t msc; + + DBG(("%s(type=%d, sequence=%d)\n", __FUNCTION__, info->type, event->sequence)); + assert(info->queued); + msc = sna_crtc_record_event(info->crtc, event); + + draw = info->draw; + if (draw == NULL) { + DBG(("%s -- drawable gone\n", __FUNCTION__)); + goto done; + } + + switch (info->type) { + case FLIP: + /* If we can still flip... */ + if (can_flip(sna, draw, info->front, info->back, info->crtc) && + sna_dri2_flip(sna, info)) + return; + + /* else fall through to blit */ + case SWAP: + assert(info->queued); + if (sna->mode.shadow && !sna->mode.shadow_damage) { + /* recursed from wait_for_shadow(), simply requeue */ + DBG(("%s -- recursed from wait_for_shadow(), requeuing\n", __FUNCTION__)); + + } else if (can_xchg(sna, draw, info->front, info->back)) { + sna_dri2_xchg(draw, info->front, info->back); + info->type = SWAP_WAIT; + } else if (can_xchg_crtc(sna, draw, info->front, info->back, info->crtc)) { + sna_dri2_xchg_crtc(sna, draw, info->crtc, info->front, info->back); + info->type = SWAP_WAIT; + } else { + assert(info->queued); + info->bo = __sna_dri2_copy_region(sna, draw, NULL, + info->back, info->front, true); + info->type = SWAP_WAIT; + } + + VG_CLEAR(vbl); + vbl.request.type = + DRM_VBLANK_RELATIVE | + DRM_VBLANK_EVENT; + vbl.request.sequence = 1; + vbl.request.signal = (uintptr_t)info; + + assert(info->queued); + if (!sna_wait_vblank(sna, &vbl, info->pipe)) + return; + + DBG(("%s -- requeue failed, errno=%d\n", __FUNCTION__, errno)); + /* fall through to SwapComplete */ + case SWAP_WAIT: + if (!sna_dri2_blit_complete(sna, info)) + return; + + DBG(("%s: swap complete, unblocking client (frame=%d, tv=%d.%06d)\n", __FUNCTION__, + event->sequence, event->tv_sec, event->tv_usec)); + frame_swap_complete(sna, info, DRI2_BLIT_COMPLETE); + break; + + case SWAP_THROTTLE: + DBG(("%s: %d complete, frame=%d tv=%d.%06d\n", + __FUNCTION__, info->type, + event->sequence, event->tv_sec, event->tv_usec)); + + if (xorg_can_triple_buffer(sna)) { + if (!sna_dri2_blit_complete(sna, info)) + return; + + DBG(("%s: triple buffer swap complete, unblocking client (frame=%d, tv=%d.%06d)\n", __FUNCTION__, + event->sequence, event->tv_sec, event->tv_usec)); + frame_swap_complete(sna, info, DRI2_BLIT_COMPLETE); + } + break; + + case WAITMSC: + assert(info->client); + DRI2WaitMSCComplete(info->client, draw, msc, + event->tv_sec, event->tv_usec); + break; + default: + xf86DrvMsg(sna->scrn->scrnIndex, X_WARNING, + "%s: unknown vblank event received\n", __func__); + /* Unknown type */ + break; + } + + if (info->chain) { + assert(info->chain != info); + assert(info->draw == draw); + sna_dri2_remove_event((WindowPtr)draw, info); + chain_swap(sna, info->chain); + draw = NULL; + } + +done: + sna_dri2_event_free(sna, draw, info); + DBG(("%s complete\n", __FUNCTION__)); +} + +static bool +sna_dri2_immediate_blit(struct sna *sna, + struct sna_dri2_event *info, + bool sync, bool event) +{ + DrawablePtr draw = info->draw; + bool ret = false; + + if (sna->flags & SNA_NO_WAIT) + sync = false; + + DBG(("%s: emitting immediate blit, throttling client, synced? %d, chained? %d, send-event? %d\n", + __FUNCTION__, sync, dri2_chain(draw) != info, + event)); + + info->type = SWAP_THROTTLE; + if (!sync || dri2_chain(draw) == info) { + DBG(("%s: no pending blit, starting chain\n", + __FUNCTION__)); + + info->queued = true; + info->bo = __sna_dri2_copy_region(sna, draw, NULL, + info->back, + info->front, + sync); + if (event) { + if (sync) { + union drm_wait_vblank vbl; + + VG_CLEAR(vbl); + vbl.request.type = + DRM_VBLANK_RELATIVE | + DRM_VBLANK_EVENT; + vbl.request.sequence = 1; + vbl.request.signal = (uintptr_t)info; + ret = !sna_wait_vblank(sna, &vbl, info->pipe); + if (ret) + event = !swap_limit(draw, 2); + } + if (event) { + DBG(("%s: fake triple buffering, unblocking client\n", __FUNCTION__)); + frame_swap_complete(sna, info, DRI2_BLIT_COMPLETE); + } + } + } else { + DBG(("%s: pending blit, chained\n", __FUNCTION__)); + ret = true; + } + + DBG(("%s: continue? %d\n", __FUNCTION__, ret)); + return ret; +} + +static bool +sna_dri2_flip_continue(struct sna *sna, struct sna_dri2_event *info) +{ + DBG(("%s(mode=%d)\n", __FUNCTION__, info->mode)); + + if (info->mode > 0){ + struct kgem_bo *bo = get_private(info->front)->bo; + + info->type = info->mode; + + if (bo != sna_pixmap(sna->front)->gpu_bo) + return false; + + if (!sna_page_flip(sna, bo, sna_dri2_flip_handler, info)) + return false; + + assert(sna->dri2.flip_pending == NULL || sna->dri2.flip_pending == info); + sna->dri2.flip_pending = info; + } else { + info->type = -info->mode; + + if (!info->draw) + return false; + + if (!can_flip(sna, info->draw, info->front, info->back, info->crtc)) + return false; + + assert(sna_pixmap_get_buffer(get_drawable_pixmap(info->draw)) == info->front); + if (!sna_dri2_flip(sna, info)) + return false; + + if (!xorg_can_triple_buffer(sna)) { + sna_dri2_get_back(sna, info->draw, info->back, info); + DBG(("%s: fake triple buffering, unblocking client\n", __FUNCTION__)); + frame_swap_complete(sna, info, DRI2_FLIP_COMPLETE); + } + } + + info->mode = 0; + return true; +} + +static void chain_flip(struct sna *sna) +{ + struct sna_dri2_event *chain = sna->dri2.flip_pending; + + assert(chain->type == FLIP); + DBG(("%s: chaining type=%d, cancelled?=%d\n", + __FUNCTION__, chain->type, chain->draw == NULL)); + + sna->dri2.flip_pending = NULL; + if (chain->draw == NULL) { + sna_dri2_event_free(sna, NULL, chain); + return; + } + + assert(chain == dri2_chain(chain->draw)); + assert(!chain->queued); + chain->queued = true; + + if (can_flip(sna, chain->draw, chain->front, chain->back, chain->crtc) && + sna_dri2_flip(sna, chain)) { + DBG(("%s: performing chained flip\n", __FUNCTION__)); + } else { + DBG(("%s: emitting chained vsync'ed blit\n", __FUNCTION__)); + chain->bo = __sna_dri2_copy_region(sna, chain->draw, NULL, + chain->back, chain->front, + true); + + if (xorg_can_triple_buffer(sna)) { + union drm_wait_vblank vbl; + + VG_CLEAR(vbl); + + chain->type = SWAP_WAIT; + vbl.request.type = + DRM_VBLANK_RELATIVE | + DRM_VBLANK_EVENT; + vbl.request.sequence = 1; + vbl.request.signal = (uintptr_t)chain; + + assert(chain->queued); + if (!sna_wait_vblank(sna, &vbl, chain->pipe)) + return; + } + + DBG(("%s: fake triple buffering (or vblank wait failed), unblocking client\n", __FUNCTION__)); + frame_swap_complete(sna, chain, DRI2_BLIT_COMPLETE); + sna_dri2_event_free(sna, chain->draw, chain); + } +} + +static void sna_dri2_flip_event(struct sna *sna, + struct sna_dri2_event *flip) +{ + DBG(("%s(pipe=%d, event=%d)\n", __FUNCTION__, flip->pipe, flip->type)); + assert(flip->queued); + + if (sna->dri2.flip_pending == flip) + sna->dri2.flip_pending = NULL; + + /* We assume our flips arrive in order, so we don't check the frame */ + switch (flip->type) { + case FLIP: + DBG(("%s: swap complete, unblocking client\n", __FUNCTION__)); + frame_swap_complete(sna, flip, DRI2_FLIP_COMPLETE); + sna_dri2_event_free(sna, flip->draw, flip); + + if (sna->dri2.flip_pending) + chain_flip(sna); + break; + + case FLIP_THROTTLE: + DBG(("%s: triple buffer swap complete, unblocking client\n", __FUNCTION__)); + frame_swap_complete(sna, flip, DRI2_FLIP_COMPLETE); + case FLIP_COMPLETE: + if (sna->dri2.flip_pending) { + sna_dri2_event_free(sna, flip->draw, flip); + chain_flip(sna); + } else if (!flip->mode) { + DBG(("%s: flip chain complete\n", __FUNCTION__)); + + if (flip->chain) { + sna_dri2_remove_event((WindowPtr)flip->draw, + flip); + chain_swap(sna, flip->chain); + flip->draw = NULL; + } + + sna_dri2_event_free(sna, flip->draw, flip); + } else if (!sna_dri2_flip_continue(sna, flip)) { + DBG(("%s: no longer able to flip\n", __FUNCTION__)); + if (flip->draw == NULL || !sna_dri2_immediate_blit(sna, flip, false, flip->mode < 0)) + sna_dri2_event_free(sna, flip->draw, flip); + } + break; + + default: /* Unknown type */ + xf86DrvMsg(sna->scrn->scrnIndex, X_WARNING, + "%s: unknown vblank event received\n", __func__); + sna_dri2_event_free(sna, flip->draw, flip); + if (sna->dri2.flip_pending) + chain_flip(sna); + break; + } +} + +static uint64_t +get_current_msc(struct sna *sna, DrawablePtr draw, xf86CrtcPtr crtc) +{ + union drm_wait_vblank vbl; + uint64_t ret = -1; + + VG_CLEAR(vbl); + vbl.request.type = _DRM_VBLANK_RELATIVE; + vbl.request.sequence = 0; + if (sna_wait_vblank(sna, &vbl, sna_crtc_to_pipe(crtc)) == 0) + ret = sna_crtc_record_vblank(crtc, &vbl); + + return draw_current_msc(draw, crtc, ret); +} + +#if defined(CHECK_FOR_COMPOSITOR) +static Bool find(pointer value, XID id, pointer cdata) +{ + return TRUE; +} +#endif + +static int use_triple_buffer(struct sna *sna, ClientPtr client, bool async) +{ + if ((sna->flags & SNA_TRIPLE_BUFFER) == 0) { + DBG(("%s: triple buffer disabled, using FLIP\n", __FUNCTION__)); + return FLIP; + } + + if (async) { + DBG(("%s: running async, using %s\n", __FUNCTION__, + sna->flags & SNA_HAS_ASYNC_FLIP ? "FLIP_ASYNC" : "FLIP_COMPLETE")); + return sna->flags & SNA_HAS_ASYNC_FLIP ? FLIP_ASYNC : FLIP_COMPLETE; + } + + if (xorg_can_triple_buffer(sna)) { + DBG(("%s: triple buffer enabled, using FLIP_THROTTLE\n", __FUNCTION__)); + return FLIP_THROTTLE; + } + +#if defined(CHECK_FOR_COMPOSITOR) + /* Hack: Disable triple buffering for compositors */ + { + struct sna_client *priv = sna_client(client); + if (priv->is_compositor == 0) + priv->is_compositor = + LookupClientResourceComplex(client, + CompositeClientWindowType+1, + find, NULL) ? FLIP : FLIP_COMPLETE; + + DBG(("%s: fake triple buffer enabled?=%d using %s\n", __FUNCTION__, + priv->is_compositor != FLIP, priv->is_compositor == FLIP ? "FLIP" : "FLIP_COMPLETE")); + return priv->is_compositor; + } +#else + DBG(("%s: fake triple buffer enabled, using FLIP_COMPLETE\n", __FUNCTION__)); + return FLIP_COMPLETE; +#endif +} + +static bool immediate_swap(struct sna *sna, + uint64_t target_msc, + uint64_t divisor, + DrawablePtr draw, + xf86CrtcPtr crtc, + uint64_t *current_msc) +{ + if (divisor == 0) { + *current_msc = -1; + + if (sna->flags & SNA_NO_WAIT) { + DBG(("%s: yes, waits are disabled\n", __FUNCTION__)); + return true; + } + + if (target_msc) + *current_msc = get_current_msc(sna, draw, crtc); + + DBG(("%s: current_msc=%ld, target_msc=%ld -- %s\n", + __FUNCTION__, (long)*current_msc, (long)target_msc, + (*current_msc >= target_msc - 1) ? "yes" : "no")); + return *current_msc >= target_msc - 1; + } + + DBG(("%s: explicit waits requests, divisor=%ld\n", + __FUNCTION__, (long)divisor)); + *current_msc = get_current_msc(sna, draw, crtc); + return false; +} + +static bool +sna_dri2_schedule_flip(ClientPtr client, DrawablePtr draw, xf86CrtcPtr crtc, + DRI2BufferPtr front, DRI2BufferPtr back, + CARD64 *target_msc, CARD64 divisor, CARD64 remainder, + DRI2SwapEventPtr func, void *data) +{ + struct sna *sna = to_sna_from_drawable(draw); + struct sna_dri2_event *info; + uint64_t current_msc; + + if (immediate_swap(sna, *target_msc, divisor, draw, crtc, ¤t_msc)) { + int type; + + info = sna->dri2.flip_pending; + DBG(("%s: performing immediate swap on pipe %d, pending? %d, mode: %d, continuation? %d\n", + __FUNCTION__, sna_crtc_to_pipe(crtc), + info != NULL, info ? info->mode : 0, + info && info->draw == draw)); + + if (info && info->draw == draw) { + assert(info->type != FLIP); + assert(info->front == front); + if (info->back != back) { + _sna_dri2_destroy_buffer(sna, info->back); + info->back = sna_dri2_reference_buffer(back); + } + if (info->mode || current_msc >= *target_msc) { + DBG(("%s: executing xchg of pending flip\n", + __FUNCTION__)); + sna_dri2_xchg(draw, front, back); + info->mode = type = FLIP_COMPLETE; + goto new_back; + } else { + DBG(("%s: chaining flip\n", __FUNCTION__)); + type = FLIP_THROTTLE; + if (xorg_can_triple_buffer(sna)) + info->mode = -type; + else + info->mode = -FLIP_COMPLETE; + goto out; + } + } + + info = sna_dri2_add_event(sna, draw, client); + if (info == NULL) + return false; + + assert(info->crtc == crtc); + info->event_complete = func; + info->event_data = data; + + info->front = sna_dri2_reference_buffer(front); + info->back = sna_dri2_reference_buffer(back); + + if (sna->dri2.flip_pending) { + /* We need to first wait (one vblank) for the + * async flips to complete before this client + * can take over. + */ + DBG(("%s: queueing flip after pending completion\n", + __FUNCTION__)); + info->type = type = FLIP; + sna->dri2.flip_pending = info; + current_msc++; + } else { + info->type = type = use_triple_buffer(sna, client, *target_msc == 0); + if (!sna_dri2_flip(sna, info)) { + DBG(("%s: flip failed, falling back\n", __FUNCTION__)); + sna_dri2_event_free(sna, draw, info); + return false; + } + } + + swap_limit(draw, 1 + (type == FLIP_THROTTLE)); + if (type >= FLIP_COMPLETE) { +new_back: + if (!xorg_can_triple_buffer(sna)) + sna_dri2_get_back(sna, draw, back, info); + DBG(("%s: fake triple buffering, unblocking client\n", __FUNCTION__)); + frame_swap_complete(sna, info, DRI2_EXCHANGE_COMPLETE); + if (info->type == FLIP_ASYNC) + sna_dri2_event_free(sna, draw, info); + } +out: + DBG(("%s: target_msc=%llu\n", __FUNCTION__, current_msc + 1)); + *target_msc = current_msc + 1; + return true; + } + + info = sna_dri2_add_event(sna, draw, client); + if (info == NULL) + return false; + + assert(info->crtc == crtc); + info->event_complete = func; + info->event_data = data; + info->type = FLIP; + + info->front = sna_dri2_reference_buffer(front); + info->back = sna_dri2_reference_buffer(back); + + /* + * If divisor is zero, or current_msc is smaller than target_msc + * we just need to make sure target_msc passes before initiating + * the swap. + */ + if (divisor && current_msc >= *target_msc) { + DBG(("%s: missed target, queueing event for next: current=%lld, target=%lld, divisor=%lld, remainder=%lld\n", + __FUNCTION__, + (long long)current_msc, + (long long)*target_msc, + (long long)divisor, + (long long)remainder)); + + *target_msc = current_msc + remainder - current_msc % divisor; + if (*target_msc <= current_msc) + *target_msc += divisor; + } + + if (*target_msc <= current_msc + 1) { + if (!sna_dri2_flip(sna, info)) { + sna_dri2_event_free(sna, draw, info); + return false; + } + *target_msc = current_msc + 1; + } else { + union drm_wait_vblank vbl; + + VG_CLEAR(vbl); + + vbl.request.type = + DRM_VBLANK_ABSOLUTE | + DRM_VBLANK_EVENT; + + /* Account for 1 frame extra pageflip delay */ + vbl.reply.sequence = draw_target_seq(draw, *target_msc - 1); + vbl.request.signal = (uintptr_t)info; + + info->queued = true; + if (sna_wait_vblank(sna, &vbl, info->pipe)) { + sna_dri2_event_free(sna, draw, info); + return false; + } + } + + DBG(("%s: reported target_msc=%llu\n", __FUNCTION__, *target_msc)); + swap_limit(draw, 1); + return true; +} + +static bool +sna_dri2_schedule_xchg(ClientPtr client, DrawablePtr draw, xf86CrtcPtr crtc, + DRI2BufferPtr front, DRI2BufferPtr back, + CARD64 *target_msc, CARD64 divisor, CARD64 remainder, + DRI2SwapEventPtr func, void *data) +{ + struct sna *sna = to_sna_from_drawable(draw); + uint64_t current_msc; + bool sync, event; + + if (!immediate_swap(sna, *target_msc, divisor, draw, crtc, ¤t_msc)) + return false; + + sync = current_msc < *target_msc; + event = dri2_chain(draw) == NULL; + if (!sync || event) { + DBG(("%s: performing immediate xchg on pipe %d\n", + __FUNCTION__, sna_crtc_to_pipe(crtc))); + sna_dri2_xchg(draw, front, back); + } + if (sync) { + struct sna_dri2_event *info; + + info = sna_dri2_add_event(sna, draw, client); + if (!info) + goto complete; + + info->event_complete = func; + info->event_data = data; + + info->front = sna_dri2_reference_buffer(front); + info->back = sna_dri2_reference_buffer(back); + info->type = SWAP_THROTTLE; + + if (event) { + union drm_wait_vblank vbl; + + VG_CLEAR(vbl); + vbl.request.type = + DRM_VBLANK_RELATIVE | + DRM_VBLANK_EVENT; + vbl.request.sequence = 1; + vbl.request.signal = (uintptr_t)info; + + info->queued = true; + if (sna_wait_vblank(sna, &vbl, info->pipe)) { + sna_dri2_event_free(sna, draw, info); + goto complete; + } + + swap_limit(draw, 2); + } + } else { +complete: + fake_swap_complete(sna, client, draw, crtc, DRI2_EXCHANGE_COMPLETE, func, data); + } + + *target_msc = current_msc + 1; + return true; +} + +static bool +sna_dri2_schedule_xchg_crtc(ClientPtr client, DrawablePtr draw, xf86CrtcPtr crtc, + DRI2BufferPtr front, DRI2BufferPtr back, + CARD64 *target_msc, CARD64 divisor, CARD64 remainder, + DRI2SwapEventPtr func, void *data) +{ + struct sna *sna = to_sna_from_drawable(draw); + uint64_t current_msc; + bool sync, event; + + if (!immediate_swap(sna, *target_msc, divisor, draw, crtc, ¤t_msc)) + return false; + + sync = current_msc < *target_msc; + event = dri2_chain(draw) == NULL; + if (!sync || event) { + DBG(("%s: performing immediate xchg only on pipe %d\n", + __FUNCTION__, sna_crtc_to_pipe(crtc))); + sna_dri2_xchg_crtc(sna, draw, crtc, front, back); + } + if (sync) { + struct sna_dri2_event *info; + + info = sna_dri2_add_event(sna, draw, client); + if (!info) + goto complete; + + info->event_complete = func; + info->event_data = data; + + info->front = sna_dri2_reference_buffer(front); + info->back = sna_dri2_reference_buffer(back); + info->type = SWAP_THROTTLE; + + if (event) { + union drm_wait_vblank vbl; + + VG_CLEAR(vbl); + vbl.request.type = + DRM_VBLANK_RELATIVE | + DRM_VBLANK_EVENT; + vbl.request.sequence = 1; + vbl.request.signal = (uintptr_t)info; + + info->queued = true; + if (sna_wait_vblank(sna, &vbl, info->pipe)) { + sna_dri2_event_free(sna, draw, info); + goto complete; + } + + swap_limit(draw, 2); + } + } else { +complete: + fake_swap_complete(sna, client, draw, crtc, DRI2_EXCHANGE_COMPLETE, func, data); + } + + *target_msc = current_msc + 1; + return true; +} + +static bool has_pending_events(struct sna *sna) +{ + struct pollfd pfd; + pfd.fd = sna->kgem.fd; + pfd.events = POLLIN; + return poll(&pfd, 1, 0) == 1; +} + +/* + * ScheduleSwap is responsible for requesting a DRM vblank event for the + * appropriate frame. + * + * In the case of a blit (e.g. for a windowed swap) or buffer exchange, + * the vblank requested can simply be the last queued swap frame + the swap + * interval for the drawable. + * + * In the case of a page flip, we request an event for the last queued swap + * frame + swap interval - 1, since we'll need to queue the flip for the frame + * immediately following the received event. + * + * The client will be blocked if it tries to perform further GL commands + * after queueing a swap, though in the Intel case after queueing a flip, the + * client is free to queue more commands; they'll block in the kernel if + * they access buffers busy with the flip. + * + * When the swap is complete, the driver should call into the server so it + * can send any swap complete events that have been requested. + */ +static int +sna_dri2_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, + DRI2BufferPtr back, CARD64 *target_msc, CARD64 divisor, + CARD64 remainder, DRI2SwapEventPtr func, void *data) +{ + struct sna *sna = to_sna_from_drawable(draw); + union drm_wait_vblank vbl; + xf86CrtcPtr crtc = NULL; + struct sna_dri2_event *info = NULL; + CARD64 current_msc; + + DBG(("%s: draw=%lu %dx%d, pixmap=%ld %dx%d, back=%u (refs=%d/%d, flush=%d) , front=%u (refs=%d/%d, flush=%d)\n", + __FUNCTION__, + (long)draw->id, draw->width, draw->height, + get_drawable_pixmap(draw)->drawable.serialNumber, + get_drawable_pixmap(draw)->drawable.width, + get_drawable_pixmap(draw)->drawable.height, + get_private(back)->bo->handle, + get_private(back)->refcnt, + get_private(back)->bo->refcnt, + get_private(back)->bo->flush, + get_private(front)->bo->handle, + get_private(front)->refcnt, + get_private(front)->bo->refcnt, + get_private(front)->bo->flush)); + + DBG(("%s(target_msc=%llu, divisor=%llu, remainder=%llu)\n", + __FUNCTION__, + (long long)*target_msc, + (long long)divisor, + (long long)remainder)); + + assert(get_private(front)->refcnt); + assert(get_private(back)->refcnt); + + assert(get_private(front)->bo->refcnt); + assert(get_private(back)->bo->refcnt); + + if (get_private(front)->pixmap != get_drawable_pixmap(draw)) + goto skip; + + if (get_private(back)->stale) + goto skip; + + assert(sna_pixmap_from_drawable(draw)->flush); + + if (draw->type != DRAWABLE_PIXMAP) { + struct dri2_window *priv = dri2_window((WindowPtr)draw); + if (priv->front) { + assert(front == priv->front); + assert(get_private(priv->front)->refcnt > 1); + get_private(priv->front)->refcnt--; + priv->front = NULL; + } + } + + /* Drawable not displayed... just complete the swap */ + if ((sna->flags & SNA_NO_WAIT) == 0) + crtc = sna_dri2_get_crtc(draw); + if (crtc == NULL) { + DBG(("%s: off-screen, immediate update\n", __FUNCTION__)); + goto blit; + } + + assert(draw->type != DRAWABLE_PIXMAP); + + while (dri2_chain(draw) && has_pending_events(sna)) { + DBG(("%s: flushing pending events\n", __FUNCTION__)); + sna_mode_wakeup(sna); + } + + if (can_xchg(sna, draw, front, back) && + sna_dri2_schedule_xchg(client, draw, crtc, front, back, + target_msc, divisor, remainder, + func, data)) + return TRUE; + + if (can_xchg_crtc(sna, draw, front, back, crtc) && + sna_dri2_schedule_xchg_crtc(client, draw, crtc, front, back, + target_msc, divisor, remainder, + func, data)) + return TRUE; + + if (can_flip(sna, draw, front, back, crtc) && + sna_dri2_schedule_flip(client, draw, crtc, front, back, + target_msc, divisor, remainder, + func, data)) + return TRUE; + + VG_CLEAR(vbl); + + info = sna_dri2_add_event(sna, draw, client); + if (!info) + goto blit; + + assert(info->crtc == crtc); + info->event_complete = func; + info->event_data = data; + + info->front = sna_dri2_reference_buffer(front); + info->back = sna_dri2_reference_buffer(back); + + if (immediate_swap(sna, *target_msc, divisor, draw, crtc, ¤t_msc)) { + bool sync = current_msc < *target_msc; + if (!sna_dri2_immediate_blit(sna, info, sync, true)) + sna_dri2_event_free(sna, draw, info); + *target_msc = current_msc + sync; + return TRUE; + } + + vbl.request.type = + DRM_VBLANK_ABSOLUTE | + DRM_VBLANK_EVENT; + vbl.request.signal = (uintptr_t)info; + + /* + * If divisor is zero, or current_msc is smaller than target_msc + * we just need to make sure target_msc passes before initiating + * the swap. + */ + info->type = SWAP; + info->queued = true; + if (divisor && current_msc >= *target_msc) { + DBG(("%s: missed target, queueing event for next: current=%lld, target=%lld, divisor=%lld, remainder=%lld\n", + __FUNCTION__, + (long long)current_msc, + (long long)*target_msc, + (long long)divisor, + (long long)remainder)); + + *target_msc = current_msc + remainder - current_msc % divisor; + if (*target_msc <= current_msc) + *target_msc += divisor; + } + vbl.request.sequence = draw_target_seq(draw, *target_msc - 1); + if (*target_msc <= current_msc + 1) { + DBG(("%s: performing blit before queueing\n", __FUNCTION__)); + assert(info->queued); + info->bo = __sna_dri2_copy_region(sna, draw, NULL, + back, front, + true); + info->type = SWAP_WAIT; + + vbl.request.type = + DRM_VBLANK_RELATIVE | + DRM_VBLANK_EVENT; + vbl.request.sequence = 1; + *target_msc = current_msc + 1; + } + + assert(info->queued); + if (sna_wait_vblank(sna, &vbl, info->pipe)) + goto blit; + + DBG(("%s: reported target_msc=%llu\n", __FUNCTION__, *target_msc)); + swap_limit(draw, 1 + (info->type == SWAP_WAIT)); + return TRUE; + +blit: + DBG(("%s -- blit\n", __FUNCTION__)); + if (info) + sna_dri2_event_free(sna, draw, info); + if (can_xchg(sna, draw, front, back)) + sna_dri2_xchg(draw, front, back); + else + __sna_dri2_copy_region(sna, draw, NULL, back, front, false); +skip: + DBG(("%s: unable to show frame, unblocking client\n", __FUNCTION__)); + if (crtc == NULL) + crtc = sna_mode_first_crtc(sna); + fake_swap_complete(sna, client, draw, crtc, DRI2_BLIT_COMPLETE, func, data); + *target_msc = 0; /* offscreen, so zero out target vblank count */ + return TRUE; +} + +/* + * Get current frame count and frame count timestamp, based on drawable's + * crtc. + */ +static int +sna_dri2_get_msc(DrawablePtr draw, CARD64 *ust, CARD64 *msc) +{ + struct sna *sna = to_sna_from_drawable(draw); + xf86CrtcPtr crtc = sna_dri2_get_crtc(draw); + const struct ust_msc *swap; + + DBG(("%s(draw=%ld, pipe=%d)\n", __FUNCTION__, draw->id, + crtc ? sna_crtc_to_pipe(crtc) : -1)); + + if (crtc != NULL) { + union drm_wait_vblank vbl; + + VG_CLEAR(vbl); + vbl.request.type = _DRM_VBLANK_RELATIVE; + vbl.request.sequence = 0; + if (sna_wait_vblank(sna, &vbl, sna_crtc_to_pipe(crtc)) == 0) + sna_crtc_record_vblank(crtc, &vbl); + } else + /* Drawable not displayed, make up a *monotonic* value */ + crtc = sna_mode_first_crtc(sna); + + swap = sna_crtc_last_swap(crtc); + *msc = draw_current_msc(draw, crtc, swap->msc); + *ust = ust64(swap->tv_sec, swap->tv_usec); + DBG(("%s: msc=%llu, ust=%llu\n", __FUNCTION__, + (long long)*msc, (long long)*ust)); + return TRUE; +} + +/* + * Request a DRM event when the requested conditions will be satisfied. + * + * We need to handle the event and ask the server to wake up the client when + * we receive it. + */ +static int +sna_dri2_schedule_wait_msc(ClientPtr client, DrawablePtr draw, CARD64 target_msc, + CARD64 divisor, CARD64 remainder) +{ + struct sna *sna = to_sna_from_drawable(draw); + struct sna_dri2_event *info = NULL; + xf86CrtcPtr crtc; + CARD64 current_msc; + union drm_wait_vblank vbl; + const struct ust_msc *swap; + int pipe; + + crtc = sna_dri2_get_crtc(draw); + DBG(("%s(pipe=%d, target_msc=%llu, divisor=%llu, rem=%llu)\n", + __FUNCTION__, crtc ? sna_crtc_to_pipe(crtc) : -1, + (long long)target_msc, + (long long)divisor, + (long long)remainder)); + + /* Drawable not visible, return immediately */ + if (crtc == NULL) + goto out_complete; + + pipe = sna_crtc_to_pipe(crtc); + + VG_CLEAR(vbl); + + /* Get current count */ + vbl.request.type = _DRM_VBLANK_RELATIVE; + vbl.request.sequence = 0; + if (sna_wait_vblank(sna, &vbl, pipe)) + goto out_complete; + + current_msc = draw_current_msc(draw, crtc, sna_crtc_record_vblank(crtc, &vbl)); + + /* If target_msc already reached or passed, set it to + * current_msc to ensure we return a reasonable value back + * to the caller. This keeps the client from continually + * sending us MSC targets from the past by forcibly updating + * their count on this call. + */ + if (divisor == 0 && current_msc >= target_msc) + goto out_complete; + + info = sna_dri2_add_event(sna, draw, client); + if (!info) + goto out_complete; + + assert(info->crtc == crtc); + info->type = WAITMSC; + + vbl.request.signal = (uintptr_t)info; + vbl.request.type = DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT; + /* + * If divisor is zero, or current_msc is smaller than target_msc, + * we just need to make sure target_msc passes before waking up the + * client. Otherwise, compute the next msc to match divisor/remainder. + */ + if (divisor && current_msc >= target_msc) { + DBG(("%s: missed target, queueing event for next: current=%lld, target=%lld, divisor=%lld, remainder=%lld\n", + __FUNCTION__, + (long long)current_msc, + (long long)target_msc, + (long long)divisor, + (long long)remainder)); + target_msc = current_msc + remainder - current_msc % divisor; + if (target_msc <= current_msc) + target_msc += divisor; + } + vbl.request.sequence = draw_target_seq(draw, target_msc); + + info->queued = true; + if (sna_wait_vblank(sna, &vbl, pipe)) + goto out_free_info; + + DRI2BlockClient(client, draw); + return TRUE; + +out_free_info: + sna_dri2_event_free(sna, draw, info); +out_complete: + if (crtc == NULL) + crtc = sna_mode_first_crtc(sna); + swap = sna_crtc_last_swap(crtc); + DRI2WaitMSCComplete(client, draw, + draw_current_msc(draw, crtc, swap->msc), + swap->tv_sec, swap->tv_usec); + return TRUE; +} +#else +void sna_dri2_destroy_window(WindowPtr win) { } +#endif + +static bool has_i830_dri(void) +{ + return access(DRI_DRIVER_PATH "/i830_dri.so", R_OK) == 0; +} + +static int +namecmp(const char *s1, const char *s2) +{ + char c1, c2; + + if (!s1 || *s1 == 0) { + if (!s2 || *s2 == 0) + return 0; + else + return 1; + } + + while (*s1 == '_' || *s1 == ' ' || *s1 == '\t') + s1++; + + while (*s2 == '_' || *s2 == ' ' || *s2 == '\t') + s2++; + + c1 = isupper(*s1) ? tolower(*s1) : *s1; + c2 = isupper(*s2) ? tolower(*s2) : *s2; + while (c1 == c2) { + if (c1 == '\0') + return 0; + + s1++; + while (*s1 == '_' || *s1 == ' ' || *s1 == '\t') + s1++; + + s2++; + while (*s2 == '_' || *s2 == ' ' || *s2 == '\t') + s2++; + + c1 = isupper(*s1) ? tolower(*s1) : *s1; + c2 = isupper(*s2) ? tolower(*s2) : *s2; + } + + return c1 - c2; +} + +static bool is_level(const char **str) +{ + const char *s = *str; + char *end; + unsigned val; + + if (s == NULL || *s == '\0') + return true; + + if (namecmp(s, "on") == 0) + return true; + if (namecmp(s, "true") == 0) + return true; + if (namecmp(s, "yes") == 0) + return true; + + if (namecmp(s, "0") == 0) + return true; + if (namecmp(s, "off") == 0) + return true; + if (namecmp(s, "false") == 0) + return true; + if (namecmp(s, "no") == 0) + return true; + + val = strtoul(s, &end, 0); + if (val && *end == '\0') + return true; + if (val && *end == ':') + *str = end + 1; + return false; +} + +static const char *dri_driver_name(struct sna *sna) +{ + const char *s = xf86GetOptValString(sna->Options, OPTION_DRI); + + if (is_level(&s)) { + if (sna->kgem.gen < 030) + return has_i830_dri() ? "i830" : "i915"; + else if (sna->kgem.gen < 040) + return "i915"; + else + return "i965"; + } + + return s; +} + +bool sna_dri2_open(struct sna *sna, ScreenPtr screen) +{ + DRI2InfoRec info; + int major = 1, minor = 0; +#if DRI2INFOREC_VERSION >= 4 + const char *driverNames[2]; +#endif + + DBG(("%s()\n", __FUNCTION__)); + + if (wedged(sna)) { + xf86DrvMsg(sna->scrn->scrnIndex, X_WARNING, + "loading DRI2 whilst the GPU is wedged.\n"); + } + + if (xf86LoaderCheckSymbol("DRI2Version")) + DRI2Version(&major, &minor); + + if (minor < 1) { + xf86DrvMsg(sna->scrn->scrnIndex, X_WARNING, + "DRI2 requires DRI2 module version 1.1.0 or later\n"); + return false; + } + + memset(&info, '\0', sizeof(info)); + info.fd = sna->kgem.fd; + info.driverName = dri_driver_name(sna); + info.deviceName = intel_get_client_name(sna->scrn); + + DBG(("%s: loading dri driver '%s' [gen=%d] for device '%s'\n", + __FUNCTION__, info.driverName, sna->kgem.gen, info.deviceName)); + +#if DRI2INFOREC_VERSION == 2 + /* The ABI between 2 and 3 was broken so we could get rid of + * the multi-buffer alloc functions. Make sure we indicate the + * right version so DRI2 can reject us if it's version 3 or above. */ + info.version = 2; +#else + info.version = 3; +#endif + info.CreateBuffer = sna_dri2_create_buffer; + info.DestroyBuffer = sna_dri2_destroy_buffer; + + info.CopyRegion = sna_dri2_copy_region; +#if DRI2INFOREC_VERSION >= 4 + info.version = 4; + info.ScheduleSwap = sna_dri2_schedule_swap; + info.GetMSC = sna_dri2_get_msc; + info.ScheduleWaitMSC = sna_dri2_schedule_wait_msc; + info.numDrivers = 2; + info.driverNames = driverNames; + driverNames[0] = info.driverName; + driverNames[1] = info.driverName; +#endif + +#if DRI2INFOREC_VERSION >= 6 + if (xorg_can_triple_buffer(sna)) { + info.version = 6; + info.SwapLimitValidate = sna_dri2_swap_limit_validate; + info.ReuseBufferNotify = sna_dri2_reuse_buffer; + } +#endif + +#if USE_ASYNC_SWAP + info.version = 10; + info.scheduleSwap0 = 1; +#endif + + return DRI2ScreenInit(screen, &info); +} + +void sna_dri2_close(struct sna *sna, ScreenPtr screen) +{ + DBG(("%s()\n", __FUNCTION__)); + DRI2CloseScreen(screen); +} diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_dri3.c xserver-xorg-video-intel-2.99.914/src/sna/sna_dri3.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_dri3.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_dri3.c 2014-07-23 14:44:21.000000000 +0000 @@ -0,0 +1,378 @@ +/* + * Copyright (c) 2014 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. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include + +#include "sna.h" + +#include +#include +#include +#include + +static DevPrivateKeyRec sna_sync_fence_private_key; +struct sna_sync_fence { + SyncFenceSetTriggeredFunc set_triggered; +}; + +static inline struct sna_sync_fence *sna_sync_fence(SyncFence *fence) +{ + return dixLookupPrivate(&fence->devPrivates, &sna_sync_fence_private_key); +} + +static void sna_sync_flush(struct sna *sna, struct sna_pixmap *priv) +{ + struct kgem_bo *bo = NULL; + + DBG(("%s(pixmap=%ld)\n", __FUNCTION__, priv->pixmap->drawable.serialNumber)); + assert(priv); + + if (priv->pinned & PIN_DRI3) { + assert(priv->gpu_bo); + assert(priv->pinned & PIN_DRI3); + DBG(("%s: flushing prime GPU bo, handle=%ld\n", __FUNCTION__, priv->gpu_bo->handle)); + if (sna_pixmap_move_to_gpu(priv->pixmap, MOVE_READ | MOVE_WRITE | MOVE_ASYNC_HINT | __MOVE_FORCE)) { + sna_damage_all(&priv->gpu_damage, priv->pixmap); + bo = priv->gpu_bo; + } + } else { + assert(priv->cpu_bo); + assert(IS_STATIC_PTR(priv->ptr)); + DBG(("%s: flushing prime CPU bo, handle=%ld\n", __FUNCTION__, priv->cpu_bo->handle)); + if (sna_pixmap_move_to_cpu(priv->pixmap, MOVE_READ | MOVE_WRITE | MOVE_ASYNC_HINT)) + bo = priv->cpu_bo; + } + + if (bo != NULL) { + kgem_bo_submit(&sna->kgem, bo); + kgem_bo_unclean(&sna->kgem, bo); + } +} + +static void +sna_sync_fence_set_triggered(SyncFence *fence) +{ + struct sna *sna = to_sna_from_screen(fence->pScreen); + struct sna_sync_fence *sna_fence = sna_sync_fence(fence); + DrawablePtr draw = NULL; + + DBG(("%s()\n", __FUNCTION__)); + +#if 0 + draw = miSyncShmFenceGetDrawable(fence); +#endif + if (draw) { + DBG(("%s: associated pixmap=%ld\n", __FUNCTION__, get_drawable_pixmap(draw)->drawable.serialNumber)); + sna_sync_flush(sna, sna_pixmap(get_drawable_pixmap(draw))); + } else { /* SyncFence are currently per-screen, sigh */ + struct sna_pixmap *priv; + + DBG(("%s: flushing all DRI3 pixmaps\n", __FUNCTION__)); + list_for_each_entry(priv, &sna->dri3.pixmaps, cow_list) + sna_sync_flush(sna, priv); + + sna_accel_flush(sna); + } + + DBG(("%s: complete, chaining up\n", __FUNCTION__)); + fence->funcs.SetTriggered = sna_fence->set_triggered; + sna_fence->set_triggered(fence); + sna_fence->set_triggered = fence->funcs.SetTriggered; + fence->funcs.SetTriggered = sna_sync_fence_set_triggered; +} + +static void +sna_sync_create_fence(ScreenPtr screen, SyncFence *fence, Bool initially_triggered) +{ + struct sna *sna = to_sna_from_screen(screen); + SyncScreenFuncsPtr funcs = miSyncGetScreenFuncs(screen); + + DBG(("%s()\n", __FUNCTION__)); + + funcs->CreateFence = sna->dri3.create_fence; + sna->dri3.create_fence(screen, fence, initially_triggered); + sna->dri3.create_fence = funcs->CreateFence; + funcs->CreateFence = sna_sync_create_fence; + + sna_sync_fence(fence)->set_triggered = fence->funcs.SetTriggered; + fence->funcs.SetTriggered = sna_sync_fence_set_triggered; +} + +static bool +sna_sync_open(struct sna *sna, ScreenPtr screen) +{ + SyncScreenFuncsPtr funcs; + + DBG(("%s()\n", __FUNCTION__)); + + if (!miSyncShmScreenInit(screen)) + return false; + + if (!dixPrivateKeyRegistered(&sna_sync_fence_private_key)) { + if (!dixRegisterPrivateKey(&sna_sync_fence_private_key, + PRIVATE_SYNC_FENCE, + sizeof(struct sna_sync_fence))) + return false; + } + + funcs = miSyncGetScreenFuncs(screen); + sna->dri3.create_fence = funcs->CreateFence; + funcs->CreateFence = sna_sync_create_fence; + + return true; +} + +static int sna_dri3_open_device(ScreenPtr screen, + RRProviderPtr provider, + int *out) +{ + int fd; + + DBG(("%s()\n", __FUNCTION__)); + fd = intel_get_client_fd(xf86ScreenToScrn(screen)); + if (fd < 0) + return -fd; + + *out = fd; + return Success; +} + +static PixmapPtr sna_dri3_pixmap_from_fd(ScreenPtr screen, + int fd, + CARD16 width, + CARD16 height, + CARD16 stride, + CARD8 depth, + CARD8 bpp) +{ + struct sna *sna = to_sna_from_screen(screen); + PixmapPtr pixmap; + struct sna_pixmap *priv; + struct kgem_bo *bo; + + DBG(("%s(fd=%d, width=%d, height=%d, stride=%d, depth=%d, bpp=%d)\n", + __FUNCTION__, fd, width, height, stride, depth, bpp)); + if (width > INT16_MAX || height > INT16_MAX) + return NULL; + + if ((uint32_t)width * bpp > (uint32_t)stride * 8) + return NULL; + + if (depth < 8) + return NULL; + + switch (bpp) { + case 8: + case 16: + case 32: + break; + default: + return NULL; + } + + bo = kgem_create_for_prime(&sna->kgem, fd, (uint32_t)stride * height); + if (bo == NULL) + return NULL; + + /* Check for a duplicate */ + list_for_each_entry(priv, &sna->dri3.pixmaps, cow_list) { + int other_stride = 0; + if (bo->snoop) { + assert(priv->cpu_bo); + assert(IS_STATIC_PTR(priv->ptr)); + if (bo->handle == priv->cpu_bo->handle) + other_stride = priv->cpu_bo->pitch; + } else { + assert(priv->gpu_bo); + assert(priv->pinned & PIN_DRI3); + if (bo->handle == priv->gpu_bo->handle) + other_stride = priv->gpu_bo->pitch; + } + if (other_stride) { + pixmap = priv->pixmap; + DBG(("%s: imported fd matches existing DRI3 pixmap=%ld\n", __FUNCTION__, pixmap->drawable.serialNumber)); + bo->handle = 0; /* fudge to prevent gem_close */ + kgem_bo_destroy(&sna->kgem, bo); + if (width != pixmap->drawable.width || + height != pixmap->drawable.height || + depth != pixmap->drawable.depth || + bpp != pixmap->drawable.bitsPerPixel || + stride != other_stride) { + DBG(("%s: imported fd mismatches existing DRI3 pixmap (width=%d, height=%d, depth=%d, bpp=%d, stride=%d)\n", __FUNCTION__, + pixmap->drawable.width, + pixmap->drawable.height, + pixmap->drawable.depth, + pixmap->drawable.bitsPerPixel, + other_stride)); + return NULL; + } + sna_sync_flush(sna, priv); + pixmap->refcnt++; + return pixmap; + } + } + + if (!kgem_check_surface_size(&sna->kgem, + width, height, bpp, + bo->tiling, stride, kgem_bo_size(bo))) { + DBG(("%s: client supplied pitch=%d, size=%d too small for %dx%d surface\n", + __FUNCTION__, stride, kgem_bo_size(bo), width, height)); + goto free_bo; + } + + pixmap = sna_pixmap_create_unattached(screen, 0, 0, depth); + if (pixmap == NullPixmap) + goto free_bo; + + if (!screen->ModifyPixmapHeader(pixmap, width, height, + depth, bpp, stride, NULL)) + goto free_pixmap; + + priv = sna_pixmap_attach_to_bo(pixmap, bo); + if (priv == NULL) + goto free_pixmap; + + bo->pitch = stride; + priv->stride = stride; + + if (bo->snoop) { + assert(priv->cpu_bo == bo); + pixmap->devPrivate.ptr = kgem_bo_map__cpu(&sna->kgem, priv->cpu_bo); + if (pixmap->devPrivate.ptr == NULL) + goto free_pixmap; + + pixmap->devKind = stride; + priv->ptr = MAKE_STATIC_PTR(pixmap->devPrivate.ptr); + } else { + assert(priv->gpu_bo == bo); + priv->pinned |= PIN_DRI3; + } + list_add(&priv->cow_list, &sna->dri3.pixmaps); + + return pixmap; + +free_pixmap: + screen->DestroyPixmap(pixmap); +free_bo: + kgem_bo_destroy(&sna->kgem, bo); + return NULL; +} + +static int sna_dri3_fd_from_pixmap(ScreenPtr screen, + PixmapPtr pixmap, + CARD16 *stride, + CARD32 *size) +{ + struct sna *sna = to_sna_from_screen(screen); + struct sna_pixmap *priv; + struct kgem_bo *bo = NULL; + int fd; + + DBG(("%s(pixmap=%ld, width=%d, height=%d)\n", __FUNCTION__, + pixmap->drawable.serialNumber, pixmap->drawable.width, pixmap->drawable.height)); + if (pixmap == sna->front && sna->flags & SNA_TEAR_FREE) { + DBG(("%s: DRI3 protocol cannot support TearFree frontbuffers\n", __FUNCTION__)); + return -1; + } + + priv = sna_pixmap(pixmap); + if (priv && IS_STATIC_PTR(priv->ptr) && priv->cpu_bo) { + if (sna_pixmap_move_to_cpu(pixmap, MOVE_READ | MOVE_WRITE | MOVE_ASYNC_HINT)) + bo = priv->cpu_bo; + } else { + priv = sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_WRITE | MOVE_ASYNC_HINT | __MOVE_FORCE | __MOVE_DRI); + if (priv != NULL) { + sna_damage_all(&priv->gpu_damage, pixmap); + bo = priv->gpu_bo; + } + } + if (bo == NULL) { + DBG(("%s: pixmap not supported by GPU\n", __FUNCTION__)); + return -1; + } + assert(priv != NULL); + + if (bo->pitch > UINT16_MAX) { + DBG(("%s: pixmap pitch (%d) too large for DRI3 protocol\n", + __FUNCTION__, bo->pitch)); + return -1; + } + + fd = kgem_bo_export_to_prime(&sna->kgem, bo); + if (fd == -1) { + DBG(("%s: exporting handle=%d to fd failed\n", __FUNCTION__, bo->handle)); + return -1; + } + + if (bo == priv->gpu_bo) + priv->pinned |= PIN_DRI3; + list_move(&priv->cow_list, &sna->dri3.pixmaps); + + *stride = (priv->pinned & PIN_DRI3) ? priv->gpu_bo->pitch : priv->cpu_bo->pitch; + *size = kgem_bo_size((priv->pinned & PIN_DRI3) ? priv->gpu_bo : priv->cpu_bo); + DBG(("%s: exporting %s pixmap=%ld, handle=%d, stride=%d, size=%d\n", + __FUNCTION__, + (priv->pinned & PIN_DRI3) ? "GPU" : "CPU", pixmap->drawable.serialNumber, + (priv->pinned & PIN_DRI3) ? priv->gpu_bo->handle : priv->cpu_bo->handle, + *stride, *size)); + return fd; +} + +static dri3_screen_info_rec sna_dri3_info = { + .version = DRI3_SCREEN_INFO_VERSION, + + .open = sna_dri3_open_device, + .pixmap_from_fd = sna_dri3_pixmap_from_fd, + .fd_from_pixmap = sna_dri3_fd_from_pixmap, +}; + +bool sna_dri3_open(struct sna *sna, ScreenPtr screen) +{ + DBG(("%s()\n", __FUNCTION__)); + + if (!sna_sync_open(sna, screen)) + return false; + + list_init(&sna->dri3.pixmaps); + return dri3_screen_init(screen, &sna_dri3_info); +} + +void sna_dri3_close(struct sna *sna, ScreenPtr screen) +{ + SyncScreenFuncsPtr funcs; + + DBG(("%s()\n", __FUNCTION__)); + + funcs = miSyncGetScreenFuncs(screen); + if (funcs) + funcs->CreateFence = sna->dri3.create_fence; +} diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_dri.c xserver-xorg-video-intel-2.99.914/src/sna/sna_dri.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_dri.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_dri.c 1970-01-01 00:00:00.000000000 +0000 @@ -1,2534 +0,0 @@ -/************************************************************************** - -Copyright 2001 VA Linux Systems Inc., Fremont, California. -Copyright © 2002 by David Dawes - -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -on the rights to use, copy, modify, merge, publish, distribute, sub -license, and/or sell copies of the Software, and to permit persons to whom -the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice (including the next -paragraph) shall be included in all copies or substantial portions of the -Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL -ATI, VA LINUX SYSTEMS AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: Jeff Hartmann - * David Dawes - * Keith Whitwell - */ - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include - -#include "sna.h" -#include "intel_options.h" - -#include -#include -#include -#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,12,99,901,0) -#include -#endif - -#if DRI2INFOREC_VERSION < 2 -#error DRI2 version supported by the Xserver is too old -#endif - -#if DRI2INFOREC_VERSION < 10 -#undef USE_ASYNC_SWAP -#define USE_ASYNC_SWAP 0 -#endif - -#define COLOR_PREFER_TILING_Y 0 - -enum frame_event_type { - DRI2_WAITMSC = 0, - DRI2_SWAP, - DRI2_SWAP_WAIT, - DRI2_SWAP_THROTTLE, - DRI2_FLIP, - DRI2_FLIP_THROTTLE, -}; - -struct sna_dri_private { - PixmapPtr pixmap; - struct kgem_bo *bo; - bool scanout; - uint32_t size; - int refcnt; -}; - -static inline struct sna_dri_private * -get_private(void *buffer) -{ - return (struct sna_dri_private *)((DRI2Buffer2Ptr)buffer+1); -} - -static inline struct kgem_bo *ref(struct kgem_bo *bo) -{ - assert(bo->refcnt); - bo->refcnt++; - return bo; -} - -static inline void unref(struct kgem_bo *bo) -{ - assert(bo->refcnt > 1); - bo->refcnt--; -} - -/* Prefer to enable TILING_Y if this buffer will never be a - * candidate for pageflipping - */ -static uint32_t color_tiling(struct sna *sna, DrawablePtr draw) -{ - uint32_t tiling; - - if (COLOR_PREFER_TILING_Y && - (draw->width != sna->front->drawable.width || - draw->height != sna->front->drawable.height)) - tiling = I915_TILING_Y; - else - tiling = I915_TILING_X; - - return kgem_choose_tiling(&sna->kgem, -tiling, - draw->width, - draw->height, - draw->bitsPerPixel); -} - -static uint32_t other_tiling(struct sna *sna, DrawablePtr draw) -{ - /* XXX Can mix color X / depth Y? */ - return kgem_choose_tiling(&sna->kgem, - sna->kgem.gen >= 040 ? -I915_TILING_Y : -I915_TILING_X, - draw->width, - draw->height, - draw->bitsPerPixel); -} - -static struct kgem_bo *sna_pixmap_set_dri(struct sna *sna, - PixmapPtr pixmap) -{ - struct sna_pixmap *priv; - int tiling; - - DBG(("%s: attaching DRI client to pixmap=%ld\n", - __FUNCTION__, pixmap->drawable.serialNumber)); - - priv = sna_pixmap(pixmap); - if (priv != NULL && priv->shm) { - DBG(("%s: SHM Pixmap, BadAlloc\n", __FUNCTION__)); - return NULL; - } - - priv = sna_pixmap_move_to_gpu(pixmap, - MOVE_READ | MOVE_WRITE | __MOVE_FORCE | __MOVE_DRI); - if (priv == NULL) { - DBG(("%s: failed to move to GPU, BadAlloc\n", __FUNCTION__)); - return NULL; - } - - assert(priv->flush == false); - assert(priv->cow == NULL); - assert(priv->cpu_damage == NULL); - assert(priv->gpu_bo); - assert(priv->gpu_bo->proxy == NULL); - assert(priv->gpu_bo->flush == false); - - tiling = color_tiling(sna, &pixmap->drawable); - if (tiling < 0) - tiling = -tiling; - if (priv->gpu_bo->tiling != tiling) - sna_pixmap_change_tiling(pixmap, tiling); - - return priv->gpu_bo; -} - -pure static inline void *sna_pixmap_get_buffer(PixmapPtr pixmap) -{ - assert(pixmap->refcnt); - return ((void **)__get_private(pixmap, sna_pixmap_key))[2]; -} - -static inline void sna_pixmap_set_buffer(PixmapPtr pixmap, void *ptr) -{ - assert(pixmap->refcnt); - ((void **)__get_private(pixmap, sna_pixmap_key))[2] = ptr; -} - -void -sna_dri_pixmap_update_bo(struct sna *sna, PixmapPtr pixmap) -{ - DRI2BufferPtr buffer; - struct sna_dri_private *private; - struct kgem_bo *bo; - - buffer = sna_pixmap_get_buffer(pixmap); - if (buffer == NULL) - return; - - DBG(("%s: pixmap=%ld, old handle=%d, new handle=%d\n", __FUNCTION__, - pixmap->drawable.serialNumber, - get_private(buffer)->bo->handle, - sna_pixmap(pixmap)->gpu_bo->handle)); - - private = get_private(buffer); - assert(private->pixmap == pixmap); - - bo = sna_pixmap(pixmap)->gpu_bo; - if (private->bo == bo) - return; - - private->bo->flush = false; - kgem_bo_destroy(&sna->kgem, private->bo); - - buffer->name = kgem_bo_flink(&sna->kgem, bo); - private->bo = ref(bo); - - assert(bo->flush); - - /* XXX DRI2InvalidateDrawable(&pixmap->drawable); */ -} - -static DRI2Buffer2Ptr -sna_dri_create_buffer(DrawablePtr draw, - unsigned int attachment, - unsigned int format) -{ - struct sna *sna = to_sna_from_drawable(draw); - DRI2Buffer2Ptr buffer; - struct sna_dri_private *private; - PixmapPtr pixmap; - struct kgem_bo *bo; - unsigned flags = 0; - uint32_t size; - int bpp; - - DBG(("%s pixmap=%ld, (attachment=%d, format=%d, drawable=%dx%d)\n", - __FUNCTION__, - get_drawable_pixmap(draw)->drawable.serialNumber, - attachment, format, draw->width, draw->height)); - - pixmap = NULL; - size = (uint32_t)draw->height << 16 | draw->width; - switch (attachment) { - case DRI2BufferFrontLeft: - pixmap = get_drawable_pixmap(draw); - buffer = sna_pixmap_get_buffer(pixmap); - if (buffer) { - private = get_private(buffer); - - DBG(("%s: reusing front buffer attachment, pixmap=%ld, handle=%d, name=%d\n", - __FUNCTION__, pixmap->drawable.serialNumber, - private->bo->handle, buffer->name)); - - assert(private->pixmap == pixmap); - assert(sna_pixmap(pixmap)->flush); - assert(sna_pixmap(pixmap)->gpu_bo == private->bo); - assert(sna_pixmap(pixmap)->pinned & PIN_DRI2); - assert(kgem_bo_flink(&sna->kgem, private->bo) == buffer->name); - assert(8*private->bo->pitch >= pixmap->drawable.width * pixmap->drawable.bitsPerPixel); - assert(private->bo->pitch * pixmap->drawable.height <= kgem_bo_size(private->bo)); - - private->refcnt++; - return buffer; - } - - bo = sna_pixmap_set_dri(sna, pixmap); - if (bo == NULL) - return NULL; - - assert(sna_pixmap(pixmap) != NULL); - - bo = ref(bo); - bpp = pixmap->drawable.bitsPerPixel; - if (pixmap == sna->front) - flags |= CREATE_SCANOUT; - DBG(("%s: attaching to front buffer %dx%d [%p:%d], scanout? %d\n", - __FUNCTION__, - pixmap->drawable.width, pixmap->drawable.height, - pixmap, pixmap->refcnt, flags & CREATE_SCANOUT)); - size = (uint32_t)pixmap->drawable.height << 16 | pixmap->drawable.width; - break; - - case DRI2BufferBackLeft: - if (draw->width == sna->front->drawable.width && - draw->height == sna->front->drawable.height && - (sna->flags & (SNA_NO_WAIT | SNA_NO_FLIP)) == 0) - flags |= CREATE_SCANOUT; - case DRI2BufferBackRight: - case DRI2BufferFrontRight: - case DRI2BufferFakeFrontLeft: - case DRI2BufferFakeFrontRight: - bpp = draw->bitsPerPixel; - DBG(("%s: creating back buffer %dx%d, suitable for scanout? %d\n", - __FUNCTION__, - draw->width, draw->height, - flags & CREATE_SCANOUT)); - - bo = kgem_create_2d(&sna->kgem, - draw->width, - draw->height, - draw->bitsPerPixel, - color_tiling(sna, draw), - flags); - break; - - case DRI2BufferStencil: - /* - * The stencil buffer has quirky pitch requirements. From Vol - * 2a, 11.5.6.2.1 3DSTATE_STENCIL_BUFFER, field "Surface - * Pitch": - * The pitch must be set to 2x the value computed based on - * width, as the stencil buffer is stored with two rows - * interleaved. - * To accomplish this, we resort to the nasty hack of doubling - * the drm region's cpp and halving its height. - * - * If we neglect to double the pitch, then - * drm_intel_gem_bo_map_gtt() maps the memory incorrectly. - * - * The alignment for W-tiling is quite different to the - * nominal no-tiling case, so we have to account for - * the tiled access pattern explicitly. - * - * The stencil buffer is W tiled. However, we request from - * the kernel a non-tiled buffer because the kernel does - * not understand W tiling and the GTT is incapable of - * W fencing. - */ - bpp = format ? format : draw->bitsPerPixel; - bpp *= 2; - bo = kgem_create_2d(&sna->kgem, - ALIGN(draw->width, 64), - ALIGN((draw->height + 1) / 2, 64), - bpp, I915_TILING_NONE, flags); - break; - - case DRI2BufferDepth: - case DRI2BufferDepthStencil: - case DRI2BufferHiz: - case DRI2BufferAccum: - bpp = format ? format : draw->bitsPerPixel, - bo = kgem_create_2d(&sna->kgem, - draw->width, draw->height, bpp, - other_tiling(sna, draw), - flags); - break; - - default: - return NULL; - } - if (bo == NULL) - return NULL; - - buffer = calloc(1, sizeof *buffer + sizeof *private); - if (buffer == NULL) - goto err; - - private = get_private(buffer); - buffer->attachment = attachment; - buffer->pitch = bo->pitch; - buffer->cpp = bpp / 8; - buffer->driverPrivate = private; - buffer->format = format; - buffer->flags = 0; - buffer->name = kgem_bo_flink(&sna->kgem, bo); - private->refcnt = 1; - private->bo = bo; - private->pixmap = pixmap; - private->scanout = !!(flags & CREATE_SCANOUT); - private->size = size; - - if (buffer->name == 0) - goto err; - - if (pixmap) { - struct sna_pixmap *priv; - - assert(attachment == DRI2BufferFrontLeft); - assert(sna_pixmap_get_buffer(pixmap) == NULL); - - sna_pixmap_set_buffer(pixmap, buffer); - assert(sna_pixmap_get_buffer(pixmap) == buffer); - pixmap->refcnt++; - - priv = sna_pixmap(pixmap); - assert(priv->flush == false); - assert((priv->pinned & PIN_DRI2) == 0); - - /* Don't allow this named buffer to be replaced */ - priv->pinned |= PIN_DRI2; - - /* We need to submit any modifications to and reads from this - * buffer before we send any reply to the Client. - * - * As we don't track which Client, we flush for all. - */ - priv->flush = true; - sna_accel_watch_flush(sna, 1); - } - - assert(bo->flush == true); - - return buffer; - -err: - kgem_bo_destroy(&sna->kgem, bo); - free(buffer); - return NULL; -} - -static void _sna_dri_destroy_buffer(struct sna *sna, DRI2Buffer2Ptr buffer) -{ - struct sna_dri_private *private = get_private(buffer); - - if (buffer == NULL) - return; - - DBG(("%s: %p [handle=%d] -- refcnt=%d, pixmap=%ld\n", - __FUNCTION__, buffer, private->bo->handle, private->refcnt, - private->pixmap ? private->pixmap->drawable.serialNumber : 0)); - assert(private->refcnt > 0); - if (--private->refcnt) - return; - - assert(private->bo); - if (private->pixmap) { - PixmapPtr pixmap = private->pixmap; - struct sna_pixmap *priv = sna_pixmap(pixmap); - - assert(sna_pixmap_get_buffer(pixmap) == buffer); - assert(priv->gpu_bo == private->bo); - assert(priv->gpu_bo->flush); - assert(priv->pinned & PIN_DRI2); - assert(priv->flush); - - /* Undo the DRI markings on this pixmap */ - DBG(("%s: releasing last DRI pixmap=%ld, scanout?=%d\n", - __FUNCTION__, - pixmap->drawable.serialNumber, - pixmap == sna->front)); - - list_del(&priv->flush_list); - - priv->gpu_bo->flush = false; - priv->pinned &= ~PIN_DRI2; - - priv->flush = false; - sna_accel_watch_flush(sna, -1); - - sna_pixmap_set_buffer(pixmap, NULL); - pixmap->drawable.pScreen->DestroyPixmap(pixmap); - } else - private->bo->flush = false; - - kgem_bo_destroy(&sna->kgem, private->bo); - free(buffer); -} - -static void sna_dri_destroy_buffer(DrawablePtr draw, DRI2Buffer2Ptr buffer) -{ - _sna_dri_destroy_buffer(to_sna_from_drawable(draw), buffer); -} - -static void sna_dri_reference_buffer(DRI2BufferPtr buffer) -{ - get_private(buffer)->refcnt++; -} - -static inline void damage(PixmapPtr pixmap, struct sna_pixmap *priv, RegionPtr region) -{ - assert(priv->gpu_bo); - if (DAMAGE_IS_ALL(priv->gpu_damage)) - goto done; - - if (region == NULL) { -damage_all: - priv->gpu_damage = _sna_damage_all(priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); - sna_damage_destroy(&priv->cpu_damage); - list_del(&priv->flush_list); - } else { - sna_damage_subtract(&priv->cpu_damage, region); - if (priv->cpu_damage == NULL) - goto damage_all; - sna_damage_add(&priv->gpu_damage, region); - } -done: - priv->cpu = false; - priv->clear = false; -} - -static void set_bo(PixmapPtr pixmap, struct kgem_bo *bo) -{ - struct sna *sna = to_sna_from_pixmap(pixmap); - struct sna_pixmap *priv = sna_pixmap(pixmap); - RegionRec region; - - DBG(("%s: pixmap=%ld, handle=%d\n", - __FUNCTION__, pixmap->drawable.serialNumber, bo->handle)); - - assert(pixmap->drawable.width * pixmap->drawable.bitsPerPixel <= 8*bo->pitch); - assert(pixmap->drawable.height * bo->pitch <= kgem_bo_size(bo)); - assert(bo->proxy == NULL); - assert(bo->flush); - assert(priv->pinned & PIN_DRI2); - assert((priv->pinned & PIN_PRIME) == 0); - assert(priv->flush); - - if (priv->cow && priv->gpu_bo != bo) - sna_pixmap_undo_cow(sna, priv, 0); - - /* Post damage on the new front buffer so that listeners, such - * as DisplayLink know take a copy and shove it over the USB, - * also for software cursors and the like. - */ - region.extents.x1 = region.extents.y1 = 0; - region.extents.x2 = pixmap->drawable.width; - region.extents.y2 = pixmap->drawable.height; - region.data = NULL; - DamageRegionAppend(&pixmap->drawable, ®ion); - - damage(pixmap, priv, NULL); - - assert(bo->refcnt); - if (priv->gpu_bo != bo) { - if (priv->gpu_bo) { - sna_pixmap_unmap(pixmap, priv); - kgem_bo_destroy(&sna->kgem, priv->gpu_bo); - } - priv->gpu_bo = ref(bo); - } - if (bo->domain != DOMAIN_GPU) - bo->domain = DOMAIN_NONE; - - DamageRegionProcessPending(&pixmap->drawable); -} - -static void sna_dri_select_mode(struct sna *sna, struct kgem_bo *dst, struct kgem_bo *src, bool sync) -{ - struct drm_i915_gem_busy busy; - int mode; - - if (sna->kgem.gen < 060) - return; - - if (sync) { - DBG(("%s: sync, force %s ring\n", __FUNCTION__, - sna->kgem.gen >= 070 ? "BLT" : "RENDER")); - kgem_set_mode(&sna->kgem, - sna->kgem.gen >= 070 ? KGEM_BLT : KGEM_RENDER, - dst); - return; - } - - if (sna->kgem.mode != KGEM_NONE) { - DBG(("%s: busy, not switching\n", __FUNCTION__)); - return; - } - - VG_CLEAR(busy); - busy.handle = src->handle; - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_BUSY, &busy)) - return; - - DBG(("%s: src busy?=%x\n", __FUNCTION__, busy.busy)); - if (busy.busy == 0) { - busy.handle = dst->handle; - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GEM_BUSY, &busy)) - return; - DBG(("%s: dst busy?=%x\n", __FUNCTION__, busy.busy)); - if (busy.busy == 0) { - DBG(("%s: src/dst is idle, using defaults\n", __FUNCTION__)); - return; - } - } - - /* Sandybridge introduced a separate ring which it uses to - * perform blits. Switching rendering between rings incurs - * a stall as we wait upon the old ring to finish and - * flush its render cache before we can proceed on with - * the operation on the new ring. - * - * As this buffer, we presume, has just been written to by - * the DRI client using the RENDER ring, we want to perform - * our operation on the same ring, and ideally on the same - * ring as we will flip from (which should be the RENDER ring - * as well). - * - * The ultimate question is whether preserving the ring outweighs - * the cost of the query. - */ - mode = KGEM_RENDER; - if (busy.busy & (1 << 17)) - mode = KGEM_BLT; - kgem_bo_mark_busy(busy.handle == src->handle ? src : dst, mode); - _kgem_set_mode(&sna->kgem, mode); -} - -static void -sna_dri_copy_fallback(struct sna *sna, int bpp, - struct kgem_bo *src_bo, int sx, int sy, - struct kgem_bo *dst_bo, int dx, int dy, - const BoxRec *box, int n) -{ - void *dst = kgem_bo_map__gtt(&sna->kgem, dst_bo); - void *src = kgem_bo_map__gtt(&sna->kgem, src_bo); - - if (dst == NULL || src == NULL) - return; - - DBG(("%s: src(%d, %d), dst(%d, %d) x %d\n", - __FUNCTION__, sx, sy, dx, dy, n)); - - if (sigtrap_get() == 0) { - do { - memcpy_blt(src, dst, bpp, - src_bo->pitch, dst_bo->pitch, - box->x1 + sx, box->y1 + sy, - box->x1 + dx, box->y1 + dy, - box->x2 - box->x1, box->y2 - box->y1); - box++; - } while (--n); - sigtrap_put(); - } -} - -static struct kgem_bo * -__sna_dri_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region, - DRI2BufferPtr src, DRI2BufferPtr dst, - bool sync) -{ - PixmapPtr pixmap = get_drawable_pixmap(draw); - struct sna_dri_private *src_priv = get_private(src); - struct sna_dri_private *dst_priv = get_private(dst); - pixman_region16_t clip; - struct kgem_bo *bo = NULL; - struct kgem_bo *src_bo; - struct kgem_bo *dst_bo; - BoxRec *boxes; - int16_t dx, dy, sx, sy; - int w, h, n; - - /* To hide a stale DRI2Buffer, one may choose to substitute - * pixmap->gpu_bo instead of dst/src->bo, however you then run - * the risk of copying around invalid data. So either you may not - * see the results of the copy, or you may see the wrong pixels. - * Either way you eventually lose. - * - * We also have to be careful in case that the stale buffers are - * now attached to invalid (non-DRI) pixmaps. - */ - - assert(dst->attachment == DRI2BufferFrontLeft || - src->attachment == DRI2BufferFrontLeft); - assert(dst->attachment != src->attachment); - - /* Copy the minimum of the Drawable / src / dst extents */ - w = draw->width; - if ((src_priv->size & 0xffff) < w) - w = src_priv->size & 0xffff; - if ((dst_priv->size & 0xffff) < w) - w = dst_priv->size & 0xffff; - - h = draw->height; - if ((src_priv->size >> 16) < h) - h = src_priv->size >> 16; - if ((dst_priv->size >> 16) < h) - h = dst_priv->size >> 16; - - clip.extents.x1 = draw->x; - clip.extents.y1 = draw->y; - clip.extents.x2 = draw->x + w; - clip.extents.y2 = draw->y + h; - clip.data = NULL; - - if (region) { - pixman_region_translate(region, draw->x, draw->y); - pixman_region_intersect(&clip, &clip, region); - region = &clip; - } - - if (clip.extents.x1 >= clip.extents.x2 || - clip.extents.y1 >= clip.extents.y2) { - DBG(("%s: all clipped\n", __FUNCTION__)); - return NULL; - } - - sx = sy = dx = dy = 0; - if (dst->attachment == DRI2BufferFrontLeft) { - sx = -draw->x; - sy = -draw->y; - } else { - dx = -draw->x; - dy = -draw->y; - } - if (draw->type == DRAWABLE_WINDOW) { - WindowPtr win = (WindowPtr)draw; - int16_t tx, ty; - - if (is_clipped(&win->clipList, draw)) { - DBG(("%s: draw=(%d, %d), delta=(%d, %d), clip.extents=(%d, %d), (%d, %d)\n", - __FUNCTION__, draw->x, draw->y, - get_drawable_dx(draw), get_drawable_dy(draw), - win->clipList.extents.x1, win->clipList.extents.y1, - win->clipList.extents.x2, win->clipList.extents.y2)); - - assert(region == NULL || region == &clip); - pixman_region_intersect(&clip, &win->clipList, &clip); - if (!pixman_region_not_empty(&clip)) { - DBG(("%s: all clipped\n", __FUNCTION__)); - return NULL; - } - - region = &clip; - } - - if (get_drawable_deltas(draw, pixmap, &tx, &ty)) { - if (dst->attachment == DRI2BufferFrontLeft) { - pixman_region_translate(region ?: &clip, tx, ty); - sx -= tx; - sy -= ty; - } else { - sx += tx; - sy += ty; - } - } - } else - sync = false; - - src_bo = src_priv->bo; - if (src->attachment == DRI2BufferFrontLeft) { - struct sna_pixmap *priv; - - priv = sna_pixmap_move_to_gpu(pixmap, MOVE_READ); - if (priv) - src_bo = priv->gpu_bo; - } - - dst_bo = dst_priv->bo; - if (dst->attachment == DRI2BufferFrontLeft) { - struct sna_pixmap *priv; - unsigned int flags; - - flags = MOVE_WRITE | __MOVE_FORCE; - if (clip.data || - clip.extents.x1 > 0 || - clip.extents.x2 < pixmap->drawable.width || - clip.extents.y1 > 0 || - clip.extents.y2 < pixmap->drawable.height) - flags |= MOVE_READ; - - priv = sna_pixmap_move_to_gpu(pixmap, flags); - if (priv) { - damage(pixmap, priv, region); - dst_bo = priv->gpu_bo; - } - } else - sync = false; - - if (!wedged(sna)) { - xf86CrtcPtr crtc; - - crtc = NULL; - if (sync && sna_pixmap_is_scanout(sna, pixmap)) - crtc = sna_covering_crtc(sna, &clip.extents, NULL); - sna_dri_select_mode(sna, dst_bo, src_bo, crtc != NULL); - - sync = (crtc != NULL&& - sna_wait_for_scanline(sna, pixmap, crtc, - &clip.extents)); - } - - if (region) { - boxes = REGION_RECTS(region); - n = REGION_NUM_RECTS(region); - assert(n); - } else { - region = &clip; - boxes = &clip.extents; - n = 1; - } - DamageRegionAppend(&pixmap->drawable, region); - - if (wedged(sna)) { - sna_dri_copy_fallback(sna, draw->bitsPerPixel, - src_bo, sx, sy, - dst_bo, dx, dy, - boxes, n); - } else { - unsigned flags; - - flags = COPY_LAST; - if (sync) - flags |= COPY_SYNC; - sna->render.copy_boxes(sna, GXcopy, - pixmap, src_bo, sx, sy, - pixmap, dst_bo, dx, dy, - boxes, n, flags); - - DBG(("%s: flushing? %d\n", __FUNCTION__, sync)); - if (sync) { /* STAT! */ - struct kgem_request *rq = sna->kgem.next_request; - kgem_submit(&sna->kgem); - if (rq->bo) - bo = kgem_bo_reference(rq->bo); - } - } - - DamageRegionProcessPending(&pixmap->drawable); - - if (clip.data) - pixman_region_fini(&clip); - - return bo; -} - -static void -sna_dri_copy_region(DrawablePtr draw, - RegionPtr region, - DRI2BufferPtr dst, - DRI2BufferPtr src) -{ - PixmapPtr pixmap = get_drawable_pixmap(draw); - struct sna *sna = to_sna_from_pixmap(pixmap); - - DBG(("%s: pixmap=%ld, src=%u (refs=%d/%d, flush=%d, attach=%d) , dst=%u (refs=%d/%d, flush=%d, attach=%d)\n", - __FUNCTION__, - pixmap->drawable.serialNumber, - get_private(src)->bo->handle, - get_private(src)->refcnt, - get_private(src)->bo->refcnt, - get_private(src)->bo->flush, - src->attachment, - get_private(dst)->bo->handle, - get_private(dst)->refcnt, - get_private(dst)->bo->refcnt, - get_private(dst)->bo->flush, - dst->attachment)); - - assert(src != dst); - - assert(get_private(src)->refcnt); - assert(get_private(dst)->refcnt); - - assert(get_private(src)->bo->refcnt); - assert(get_private(src)->bo->flush); - - assert(get_private(dst)->bo->refcnt); - assert(get_private(dst)->bo->flush); - - DBG(("%s: region (%d, %d), (%d, %d) x %ld\n", - __FUNCTION__, - region->extents.x1, region->extents.y1, - region->extents.x2, region->extents.y2, - (long)REGION_NUM_RECTS(region))); - - __sna_dri_copy_region(sna, draw, region, src, dst, false); -} - -static inline int sna_wait_vblank(struct sna *sna, drmVBlank *vbl) -{ - DBG(("%s\n", __FUNCTION__)); - return drmIoctl(sna->kgem.fd, DRM_IOCTL_WAIT_VBLANK, vbl); -} - -#if DRI2INFOREC_VERSION >= 4 - -struct dri_bo { - struct list link; - struct kgem_bo *bo; - uint32_t name; -}; - -struct sna_dri_frame_event { - DrawablePtr draw; - ClientPtr client; - enum frame_event_type type; - int pipe; - int count; - - /* for swaps & flips only */ - DRI2SwapEventPtr event_complete; - void *event_data; - DRI2BufferPtr front; - DRI2BufferPtr back; - struct kgem_bo *bo; - - struct sna_dri_frame_event *chain; - - unsigned int fe_frame; - unsigned int fe_tv_sec; - unsigned int fe_tv_usec; - - struct { - struct kgem_bo *bo; - uint32_t name; - } scanout[2]; - - struct list cache; - - int mode; -}; - -static inline struct sna_dri_frame_event * -to_frame_event(uintptr_t data) -{ - return (struct sna_dri_frame_event *)(data & ~1); -} - -static int -sna_dri_get_pipe(DrawablePtr draw) -{ - struct sna *sna = to_sna_from_drawable(draw); - xf86CrtcPtr crtc; - BoxRec box; - int pipe; - - if (draw->type == DRAWABLE_PIXMAP) - return -1; - - box.x1 = draw->x; - box.y1 = draw->y; - box.x2 = box.x1 + draw->width; - box.y2 = box.y1 + draw->height; - - crtc = sna_covering_crtc(sna, &box, NULL); - - /* Make sure the CRTC is valid and this is the real front buffer */ - pipe = -1; - if (crtc != NULL) - pipe = sna_crtc_to_pipe(crtc); - - DBG(("%s(box=((%d, %d), (%d, %d)), pipe=%d)\n", - __FUNCTION__, box.x1, box.y1, box.x2, box.y2, pipe)); - - return pipe; -} - -static struct sna_dri_frame_event * -sna_dri_window_get_chain(WindowPtr win) -{ - return ((void **)__get_private(win, sna_window_key))[1]; -} - -static void -sna_dri_window_set_chain(WindowPtr win, - struct sna_dri_frame_event *chain) -{ - DBG(("%s: head now %p\n", __FUNCTION__, chain)); - assert(win->drawable.type == DRAWABLE_WINDOW); - ((void **)__get_private(win, sna_window_key))[1] = chain; -} - -static void -sna_dri_remove_frame_event(WindowPtr win, - struct sna_dri_frame_event *info) -{ - struct sna_dri_frame_event *chain; - - DBG(("%s: remove[%p] from window %ld)\n", - __FUNCTION__, info, (long)win->drawable.id)); - - chain = sna_dri_window_get_chain(win); - if (chain == NULL) - return; - - if (chain == info) { - sna_dri_window_set_chain(win, info->chain); - return; - } - - while (chain->chain != info) - chain = chain->chain; - assert(chain != info); - assert(info->chain != chain); - chain->chain = info->chain; -} - -static void -sna_dri_add_frame_event(DrawablePtr draw, struct sna_dri_frame_event *info) -{ - struct sna_dri_frame_event *chain; - - if (draw->type != DRAWABLE_WINDOW) - return; - - DBG(("%s: add[%p] to window %ld)\n", - __FUNCTION__, info, (long)draw->id)); - - chain = sna_dri_window_get_chain((WindowPtr)draw); - if (chain == NULL) { - sna_dri_window_set_chain((WindowPtr)draw, info); - return; - } - - assert(chain != info); - while (chain->chain != NULL) - chain = chain->chain; - - assert(chain != info); - chain->chain = info; -} - -static void -sna_dri_frame_event_info_free(struct sna *sna, - DrawablePtr draw, - struct sna_dri_frame_event *info) -{ - if (draw && draw->type == DRAWABLE_WINDOW) - sna_dri_remove_frame_event((WindowPtr)draw, info); - _sna_dri_destroy_buffer(sna, info->front); - _sna_dri_destroy_buffer(sna, info->back); - - assert(info->scanout[1].bo == NULL); - - if (info->scanout[0].bo) { - assert(info->scanout[0].bo->scanout); - kgem_bo_destroy(&sna->kgem, info->scanout[0].bo); - } - - while (!list_is_empty(&info->cache)) { - struct dri_bo *c; - - c = list_first_entry(&info->cache, struct dri_bo, link); - list_del(&c->link); - - if (c->bo) { - assert(c->bo->refcnt == 1); - kgem_bo_destroy(&sna->kgem, c->bo); - } - - free(c); - } - - if (info->bo) - kgem_bo_destroy(&sna->kgem, info->bo); - - free(info); -} - -void sna_dri_destroy_window(WindowPtr win) -{ - struct sna *sna = to_sna_from_drawable(&win->drawable); - struct sna_dri_frame_event *info, *chain; - - info = sna_dri_window_get_chain(win); - if (info == NULL) - return; - - DBG(("%s: window=%ld\n", __FUNCTION__, win->drawable.serialNumber)); - info->draw = NULL; - - chain = info->chain; - info->chain = NULL; - - while ((info = chain)) { - chain = info->chain; - sna_dri_frame_event_info_free(sna, NULL, info); - } -} - -static bool -sna_dri_page_flip(struct sna *sna, struct sna_dri_frame_event *info) -{ - struct kgem_bo *bo = get_private(info->back)->bo; - struct dri_bo tmp; - - DBG(("%s()\n", __FUNCTION__)); - - assert(sna_pixmap_get_buffer(sna->front) == info->front); - assert(get_drawable_pixmap(info->draw)->drawable.height * bo->pitch <= kgem_bo_size(bo)); - assert(info->scanout[0].bo); - assert(info->scanout[0].bo->scanout); - assert(info->scanout[1].bo == NULL); - assert(bo->refcnt); - - info->count = sna_page_flip(sna, bo, info, info->pipe); - if (!info->count) - return false; - - DBG(("%s: mark handle=%d as scanout, swap front (handle=%d, name=%d) and back (handle=%d, name=%d)\n", - __FUNCTION__, bo->handle, - get_private(info->front)->bo->handle, info->front->name, - get_private(info->back)->bo->handle, info->back->name)); - - info->scanout[1] = info->scanout[0]; - info->scanout[0].bo = ref(bo); - info->scanout[0].name = info->back->name; - assert(info->scanout[0].bo->scanout); - - tmp.bo = get_private(info->front)->bo; - tmp.name = info->front->name; - - set_bo(sna->front, bo); - - info->front->name = info->back->name; - get_private(info->front)->bo = bo; - - info->back->name = tmp.name; - get_private(info->back)->bo = tmp.bo; - - sna->dri.flip_pending = info; - return true; -} - -static bool -can_flip(struct sna * sna, - DrawablePtr draw, - DRI2BufferPtr front, - DRI2BufferPtr back) -{ - WindowPtr win = (WindowPtr)draw; - PixmapPtr pixmap; - - assert((sna->flags & SNA_NO_WAIT) == 0); - - if (draw->type == DRAWABLE_PIXMAP) - return false; - - if (!sna->scrn->vtSema) { - DBG(("%s: no, not attached to VT\n", __FUNCTION__)); - return false; - } - - if (sna->flags & SNA_NO_FLIP) { - DBG(("%s: no, pageflips disabled\n", __FUNCTION__)); - return false; - } - - if (front->format != back->format) { - DBG(("%s: no, format mismatch, front = %d, back = %d\n", - __FUNCTION__, front->format, back->format)); - return false; - } - - if (front->attachment != DRI2BufferFrontLeft) { - DBG(("%s: no, front attachment [%d] is not FrontLeft [%d]\n", - __FUNCTION__, - front->attachment, - DRI2BufferFrontLeft)); - return false; - } - - if (sna->mode.shadow_active) { - DBG(("%s: no, shadow enabled\n", __FUNCTION__)); - return false; - } - - pixmap = get_window_pixmap(win); - if (pixmap != sna->front) { - DBG(("%s: no, window (pixmap=%ld) is not attached to the front buffer (pixmap=%ld)\n", - __FUNCTION__, pixmap->drawable.serialNumber, sna->front->drawable.serialNumber)); - return false; - } - - if (sna_pixmap_get_buffer(pixmap) != front) { - DBG(("%s: no, DRI2 drawable is no longer attached (old name=%d, new name=%d) to pixmap=%ld\n", - __FUNCTION__, front->name, - sna_pixmap_get_buffer(pixmap) ? ((DRI2BufferPtr)sna_pixmap_get_buffer(pixmap))->name : 0, - pixmap->drawable.serialNumber)); - return false; - } - - assert(get_private(front)->pixmap == sna->front); - assert(sna_pixmap(sna->front)->gpu_bo == get_private(front)->bo); - - if (!get_private(back)->scanout) { - DBG(("%s: no, DRI2 drawable was too small at time of creation)\n", - __FUNCTION__)); - return false; - } - - if (get_private(back)->size != get_private(front)->size) { - DBG(("%s: no, DRI2 drawable does not fit into scanout\n", - __FUNCTION__)); - return false; - } - - DBG(("%s: window size: %dx%d, clip=(%d, %d), (%d, %d) x %d\n", - __FUNCTION__, - win->drawable.width, win->drawable.height, - win->clipList.extents.x1, win->clipList.extents.y1, - win->clipList.extents.x2, win->clipList.extents.y2, - RegionNumRects(&win->clipList))); - if (!RegionEqual(&win->clipList, &draw->pScreen->root->winSize)) { - DBG(("%s: no, window is clipped: clip region=(%d, %d), (%d, %d), root size=(%d, %d), (%d, %d)\n", - __FUNCTION__, - win->clipList.extents.x1, - win->clipList.extents.y1, - win->clipList.extents.x2, - win->clipList.extents.y2, - draw->pScreen->root->winSize.extents.x1, - draw->pScreen->root->winSize.extents.y1, - draw->pScreen->root->winSize.extents.x2, - draw->pScreen->root->winSize.extents.y2)); - return false; - } - - if (draw->x != 0 || draw->y != 0 || -#ifdef COMPOSITE - draw->x != pixmap->screen_x || - draw->y != pixmap->screen_y || -#endif - draw->width != pixmap->drawable.width || - draw->height != pixmap->drawable.height) { - DBG(("%s: no, window is not full size (%dx%d)!=(%dx%d)\n", - __FUNCTION__, - draw->width, draw->height, - pixmap->drawable.width, - pixmap->drawable.height)); - return false; - } - - /* prevent an implicit tiling mode change */ - if (get_private(front)->bo->tiling != get_private(back)->bo->tiling) { - DBG(("%s -- no, tiling mismatch: front %d, back=%d\n", - __FUNCTION__, - get_private(front)->bo->tiling, - get_private(back)->bo->tiling)); - return false; - } - - if (sna_pixmap(pixmap)->pinned & ~(PIN_DRI2 | PIN_SCANOUT)) { - DBG(("%s -- no, pinned: front %x\n", - __FUNCTION__, sna_pixmap(pixmap)->pinned)); - return false; - } - - return true; -} - -inline static uint32_t pipe_select(int pipe) -{ - /* The third pipe was introduced with IvyBridge long after - * multiple pipe support was added to the kernel, hence - * we can safely ignore the capability check - if we have more - * than two pipes, we can assume that they are fully supported. - */ - if (pipe > 1) - return pipe << DRM_VBLANK_HIGH_CRTC_SHIFT; - else if (pipe > 0) - return DRM_VBLANK_SECONDARY; - else - return 0; -} - -static void -sna_dri_exchange_buffers(DrawablePtr draw, - DRI2BufferPtr front, - DRI2BufferPtr back) -{ - struct kgem_bo *back_bo, *front_bo; - PixmapPtr pixmap; - int tmp; - - pixmap = get_drawable_pixmap(draw); - - back_bo = get_private(back)->bo; - front_bo = get_private(front)->bo; - - DBG(("%s: exchange front=%d/%d and back=%d/%d, pixmap=%ld %dx%d\n", - __FUNCTION__, - front_bo->handle, front->name, - back_bo->handle, back->name, - pixmap->drawable.serialNumber, - pixmap->drawable.width, - pixmap->drawable.height)); - - DBG(("%s: back_bo pitch=%d, size=%d, ref=%d\n", - __FUNCTION__, back_bo->pitch, kgem_bo_size(back_bo), back_bo->refcnt)); - DBG(("%s: front_bo pitch=%d, size=%d, ref=%d\n", - __FUNCTION__, front_bo->pitch, kgem_bo_size(front_bo), front_bo->refcnt)); - assert(front_bo->refcnt); - assert(back_bo->refcnt); - - assert(sna_pixmap_get_buffer(pixmap) == front); - assert(pixmap->drawable.height * back_bo->pitch <= kgem_bo_size(back_bo)); - assert(pixmap->drawable.height * front_bo->pitch <= kgem_bo_size(front_bo)); - - set_bo(pixmap, back_bo); - - get_private(front)->bo = back_bo; - get_private(back)->bo = front_bo; - - tmp = front->name; - front->name = back->name; - back->name = tmp; -} - -static void chain_swap(struct sna *sna, - DrawablePtr draw, - int frame, unsigned int tv_sec, unsigned int tv_usec, - struct sna_dri_frame_event *chain) -{ - drmVBlank vbl; - - assert(chain == sna_dri_window_get_chain((WindowPtr)draw)); - DBG(("%s: chaining type=%d\n", __FUNCTION__, chain->type)); - switch (chain->type) { - case DRI2_SWAP_THROTTLE: - break; - default: - return; - } - - DBG(("%s: emitting chained vsync'ed blit\n", __FUNCTION__)); - - if (sna->mode.shadow_flip && !sna->mode.shadow_damage) { - /* recursed from wait_for_shadow(), simply requeue */ - DBG(("%s -- recursed from wait_for_shadow(), requeuing\n", __FUNCTION__)); - chain->type = DRI2_SWAP; - - VG_CLEAR(vbl); - vbl.request.type = - DRM_VBLANK_RELATIVE | - DRM_VBLANK_EVENT | - pipe_select(chain->pipe); - vbl.request.sequence = 1; - vbl.request.signal = (unsigned long)chain; - - if (!sna_wait_vblank(sna, &vbl)) - return; - - DBG(("%s -- requeue failed, errno=%d\n", __FUNCTION__, errno)); - } else { - chain->bo = __sna_dri_copy_region(sna, draw, NULL, - chain->back, chain->front, true); - } - - DRI2SwapComplete(chain->client, draw, - frame, tv_sec, tv_usec, - DRI2_BLIT_COMPLETE, - chain->client ? chain->event_complete : NULL, chain->event_data); - - VG_CLEAR(vbl); - vbl.request.type = - DRM_VBLANK_RELATIVE | - DRM_VBLANK_NEXTONMISS | - DRM_VBLANK_EVENT | - pipe_select(chain->pipe); - vbl.request.sequence = 0; - vbl.request.signal = (unsigned long)chain; - if (sna_wait_vblank(sna, &vbl)) - sna_dri_frame_event_info_free(sna, draw, chain); -} - -static bool sna_dri_blit_complete(struct sna *sna, - struct sna_dri_frame_event *info) -{ - if (info->bo && __kgem_bo_is_busy(&sna->kgem, info->bo)) { - drmVBlank vbl; - - DBG(("%s: vsync'ed blit is still busy, postponing\n", - __FUNCTION__)); - - VG_CLEAR(vbl); - vbl.request.type = - DRM_VBLANK_RELATIVE | - DRM_VBLANK_EVENT | - pipe_select(info->pipe); - vbl.request.sequence = 1; - vbl.request.signal = (unsigned long)info; - if (!sna_wait_vblank(sna, &vbl)) - return false; - } - - DBG(("%s: blit finished\n", __FUNCTION__)); - return true; -} - -void sna_dri_vblank_handler(struct sna *sna, struct drm_event_vblank *event) -{ - struct sna_dri_frame_event *info = (void *)(uintptr_t)event->user_data; - DrawablePtr draw; - - DBG(("%s(type=%d)\n", __FUNCTION__, info->type)); - - draw = info->draw; - if (draw == NULL) { - DBG(("%s -- drawable gone\n", __FUNCTION__)); - goto done; - } - - switch (info->type) { - case DRI2_FLIP: - /* If we can still flip... */ - if (can_flip(sna, draw, info->front, info->back) && - sna_dri_page_flip(sna, info)) - return; - - /* else fall through to blit */ - case DRI2_SWAP: - if (sna->mode.shadow_flip && !sna->mode.shadow_damage) { - drmVBlank vbl; - - /* recursed from wait_for_shadow(), simply requeue */ - DBG(("%s -- recursed from wait_for_shadow(), requeuing\n", __FUNCTION__)); - - VG_CLEAR(vbl); - vbl.request.type = - DRM_VBLANK_RELATIVE | - DRM_VBLANK_EVENT | - pipe_select(info->pipe); - vbl.request.sequence = 1; - vbl.request.signal = (unsigned long)info; - - if (!sna_wait_vblank(sna, &vbl)) - return; - - DBG(("%s -- requeue failed, errno=%d\n", __FUNCTION__, errno)); - } else { - info->bo = __sna_dri_copy_region(sna, draw, NULL, - info->back, info->front, true); - info->type = DRI2_SWAP_WAIT; - } - /* fall through to SwapComplete */ - case DRI2_SWAP_WAIT: - if (!sna_dri_blit_complete(sna, info)) - return; - - DRI2SwapComplete(info->client, - draw, event->sequence, - event->tv_sec, event->tv_usec, - DRI2_BLIT_COMPLETE, - info->client ? info->event_complete : NULL, - info->event_data); - break; - - case DRI2_SWAP_THROTTLE: - DBG(("%s: %d complete, frame=%d tv=%d.%06d\n", - __FUNCTION__, info->type, - event->sequence, event->tv_sec, event->tv_usec)); - break; - - case DRI2_WAITMSC: - DRI2WaitMSCComplete(info->client, draw, - event->sequence, - event->tv_sec, - event->tv_usec); - break; - default: - xf86DrvMsg(sna->scrn->scrnIndex, X_WARNING, - "%s: unknown vblank event received\n", __func__); - /* Unknown type */ - break; - } - - if (info->chain) { - sna_dri_remove_frame_event((WindowPtr)draw, info); - chain_swap(sna, draw, - event->sequence, event->tv_sec, event->tv_usec, - info->chain); - draw = NULL; - } - -done: - sna_dri_frame_event_info_free(sna, draw, info); -} - -static bool -sna_dri_immediate_blit(struct sna *sna, - struct sna_dri_frame_event *info, - bool sync, bool event) -{ - DrawablePtr draw = info->draw; - bool ret = false; - - if (sna->flags & SNA_NO_WAIT) - sync = false; - - DBG(("%s: emitting immediate blit, throttling client, synced? %d, chained? %d, send-event? %d\n", - __FUNCTION__, sync, sna_dri_window_get_chain((WindowPtr)draw) != info, - event)); - - if (sync) { - info->type = DRI2_SWAP_THROTTLE; - if (sna_dri_window_get_chain((WindowPtr)draw) == info) { - drmVBlank vbl; - - DBG(("%s: no pending blit, starting chain\n", - __FUNCTION__)); - - info->bo = __sna_dri_copy_region(sna, draw, NULL, - info->back, - info->front, - true); - if (event) { - DRI2SwapComplete(info->client, draw, 0, 0, 0, - DRI2_BLIT_COMPLETE, - info->event_complete, - info->event_data); - - VG_CLEAR(vbl); - vbl.request.type = - DRM_VBLANK_RELATIVE | - DRM_VBLANK_NEXTONMISS | - DRM_VBLANK_EVENT | - pipe_select(info->pipe); - vbl.request.sequence = 0; - vbl.request.signal = (unsigned long)info; - ret = !sna_wait_vblank(sna, &vbl); - } - } else { - DBG(("%s: pending blit, chained\n", __FUNCTION__)); - ret = true; - } - } else { - DBG(("%s: immediate blit\n", __FUNCTION__)); - info->bo = __sna_dri_copy_region(sna, draw, NULL, - info->back, info->front, false); - if (event) - DRI2SwapComplete(info->client, draw, 0, 0, 0, - DRI2_BLIT_COMPLETE, - info->event_complete, - info->event_data); - } - - DBG(("%s: continue? %d\n", __FUNCTION__, ret)); - return ret; -} - -static void -sna_dri_flip_get_back(struct sna *sna, struct sna_dri_frame_event *info) -{ - struct kgem_bo *bo; - uint32_t name; - - DBG(("%s: scanout=(%d, %d), back=%d, cache?=%d\n", - __FUNCTION__, - info->scanout[0].bo ? info->scanout[0].bo->handle : 0, - info->scanout[1].bo ? info->scanout[1].bo->handle : 0, - get_private(info->back)->bo->handle, - !list_is_empty(&info->cache))); - - bo = get_private(info->back)->bo; - assert(bo->refcnt); - assert(bo->flush); - if (!(bo == info->scanout[0].bo || bo == info->scanout[1].bo)) { - DBG(("%s: reuse unattached back\n", __FUNCTION__)); - return; - } - - bo = NULL; - if (!list_is_empty(&info->cache)) { - struct dri_bo *c = list_first_entry(&info->cache, struct dri_bo, link); - if (c->bo) { - bo = c->bo; - name = c->name; - DBG(("%s: reuse cache handle=%d,name=%d\n", __FUNCTION__, - bo->handle, name)); - list_move_tail(&c->link, &info->cache); - c->bo = NULL; - } - } - if (bo == NULL) { - DBG(("%s: allocating new backbuffer\n", __FUNCTION__)); - bo = kgem_create_2d(&sna->kgem, - info->draw->width, - info->draw->height, - info->draw->bitsPerPixel, - get_private(info->front)->bo->tiling, - CREATE_SCANOUT); - if (bo == NULL) - return; - - name = kgem_bo_flink(&sna->kgem, bo); - if (name == 0) { - kgem_bo_destroy(&sna->kgem, bo); - return; - } - } - - assert(!(bo == info->scanout[0].bo || bo == info->scanout[1].bo)); - assert(name); - - unref(get_private(info->back)->bo); - get_private(info->back)->bo = bo; - info->back->name = name; - - assert(get_private(info->back)->bo != info->scanout[0].bo); - assert(get_private(info->back)->bo != info->scanout[1].bo); - - assert(bo->refcnt == 1); - assert(bo->flush); -} - -static bool -sna_dri_flip_continue(struct sna *sna, struct sna_dri_frame_event *info) -{ - DBG(("%s(mode=%d)\n", __FUNCTION__, info->mode)); - - if (info->mode > 1){ - if (get_private(info->front)->bo != sna_pixmap(sna->front)->gpu_bo) - return false; - - info->count = sna_page_flip(sna, - get_private(info->front)->bo, - info, info->pipe); - if (!info->count) - return false; - - assert(info->scanout[0].bo->scanout); - info->scanout[1] = info->scanout[0]; - info->scanout[0].bo = ref(get_private(info->front)->bo); - info->scanout[0].name = info->front->name; - assert(info->scanout[0].bo->scanout); - sna->dri.flip_pending = info; - } else { - if (!info->draw) - return false; - - if (!can_flip(sna, info->draw, info->front, info->back)) - return false; - - assert(sna_pixmap_get_buffer(get_drawable_pixmap(info->draw)) == info->front); - if (!sna_dri_page_flip(sna, info)) - return false; - - sna_dri_flip_get_back(sna, info); - DRI2SwapComplete(info->client, info->draw, - 0, 0, 0, - DRI2_FLIP_COMPLETE, - info->client ? info->event_complete : NULL, - info->event_data); - } - - info->mode = 0; - return true; -} - -static void chain_flip(struct sna *sna) -{ - struct sna_dri_frame_event *chain = sna->dri.flip_pending; - - assert(chain->type == DRI2_FLIP); - DBG(("%s: chaining type=%d\n", __FUNCTION__, chain->type)); - - sna->dri.flip_pending = NULL; - if (chain->draw == NULL) { - sna_dri_frame_event_info_free(sna, NULL, chain); - return; - } - - assert(chain == sna_dri_window_get_chain((WindowPtr)chain->draw)); - - if (chain->type == DRI2_FLIP && - can_flip(sna, chain->draw, chain->front, chain->back) && - sna_dri_page_flip(sna, chain)) { - DBG(("%s: performing chained flip\n", __FUNCTION__)); - } else { - DBG(("%s: emitting chained vsync'ed blit\n", __FUNCTION__)); - chain->bo = __sna_dri_copy_region(sna, chain->draw, NULL, - chain->back, chain->front, - true); - DRI2SwapComplete(chain->client, chain->draw, 0, 0, 0, - DRI2_BLIT_COMPLETE, chain->client ? chain->event_complete : NULL, chain->event_data); - sna_dri_frame_event_info_free(sna, chain->draw, chain); - } -} - -static void sna_dri_flip_event(struct sna *sna, - struct sna_dri_frame_event *flip) -{ - DBG(("%s(frame=%d, tv=%d.%06d, type=%d)\n", - __FUNCTION__, - flip->fe_frame, - flip->fe_tv_sec, - flip->fe_tv_usec, - flip->type)); - - assert(!sna->mode.shadow_flip); - - if (flip->scanout[1].bo) { - struct dri_bo *c = NULL; - - DBG(("%s: retiring previous scanout handle=%d, name=%d, refcnt=%d\n", - __FUNCTION__, - flip->scanout[1].bo->handle, - flip->scanout[1].name, - flip->scanout[1].bo->refcnt)); - - if (flip->scanout[1].bo != flip->scanout[0].bo && - flip->scanout[1].bo->refcnt == 1) { - if (!list_is_empty(&flip->cache)) - c = list_last_entry(&flip->cache, struct dri_bo, link); - if (c) { - if (c->bo == NULL) - _list_del(&c->link); - else - c = NULL; - } - if (c == NULL) - c = malloc(sizeof(*c)); - if (c != NULL) { - c->bo = flip->scanout[1].bo; - c->name = flip->scanout[1].name; - list_add(&c->link, &flip->cache); - } - } - - if (c == NULL) - kgem_bo_destroy(&sna->kgem, flip->scanout[1].bo); - - flip->scanout[1].bo = NULL; - } - - if (sna->dri.flip_pending == flip) - sna->dri.flip_pending = NULL; - - /* We assume our flips arrive in order, so we don't check the frame */ - switch (flip->type) { - case DRI2_FLIP: - DBG(("%s: flip complete (drawable gone? %d), msc=%d\n", - __FUNCTION__, flip->draw == NULL, flip->fe_frame)); - if (flip->draw) - DRI2SwapComplete(flip->client, flip->draw, - flip->fe_frame, - flip->fe_tv_sec, - flip->fe_tv_usec, - DRI2_FLIP_COMPLETE, - flip->client ? flip->event_complete : NULL, - flip->event_data); - - sna_dri_frame_event_info_free(sna, flip->draw, flip); - - if (sna->dri.flip_pending) - chain_flip(sna); - break; - - case DRI2_FLIP_THROTTLE: - if (sna->dri.flip_pending) { - sna_dri_frame_event_info_free(sna, flip->draw, flip); - chain_flip(sna); - } else if (!flip->mode) { - DBG(("%s: flip chain complete\n", __FUNCTION__)); - - if (flip->chain) { - sna_dri_remove_frame_event((WindowPtr)flip->draw, - flip); - chain_swap(sna, flip->draw, - flip->fe_frame, - flip->fe_tv_sec, - flip->fe_tv_usec, - flip->chain); - flip->draw = NULL; - } - - sna_dri_frame_event_info_free(sna, flip->draw, flip); - } else if (!sna_dri_flip_continue(sna, flip)) { - DBG(("%s: no longer able to flip\n", __FUNCTION__)); - if (flip->draw == NULL || !sna_dri_immediate_blit(sna, flip, false, flip->mode == 1)) - sna_dri_frame_event_info_free(sna, flip->draw, flip); - } - break; - - default: /* Unknown type */ - xf86DrvMsg(sna->scrn->scrnIndex, X_WARNING, - "%s: unknown vblank event received\n", __func__); - sna_dri_frame_event_info_free(sna, flip->draw, flip); - if (sna->dri.flip_pending) - chain_flip(sna); - break; - } -} - -void -sna_dri_page_flip_handler(struct sna *sna, - struct drm_event_vblank *event) -{ - struct sna_dri_frame_event *info = to_frame_event(event->user_data); - - DBG(("%s: pending flip_count=%d\n", __FUNCTION__, info->count)); - assert(info->count > 0); - - /* Is this the event whose info shall be delivered to higher level? */ - if (event->user_data & 1) { - info->fe_frame = event->sequence; - info->fe_tv_sec = event->tv_sec; - info->fe_tv_usec = event->tv_usec; - } - - if (--info->count) - return; - - sna_dri_flip_event(sna, info); -} - -static CARD64 -get_current_msc_for_target(struct sna *sna, CARD64 target_msc, int pipe) -{ - CARD64 ret = -1; - - if (target_msc && (sna->flags & SNA_NO_WAIT) == 0) { - drmVBlank vbl; - - VG_CLEAR(vbl); - vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe); - vbl.request.sequence = 0; - if (sna_wait_vblank(sna, &vbl) == 0) - ret = vbl.reply.sequence; - } - - return ret; -} - -static Bool find(pointer value, XID id, pointer cdata) -{ - return TRUE; -} - -static int use_triple_buffer(struct sna *sna, ClientPtr client) -{ - struct sna_client *priv; - - if ((sna->flags & SNA_TRIPLE_BUFFER) == 0) - return DRI2_FLIP; - - /* Hack: Disable triple buffering for compositors */ - -#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,12,99,901,0) - priv = sna_client(client); - if (priv->is_compositor == 0) - priv->is_compositor = - LookupClientResourceComplex(client, - CompositeClientWindowType+1, - find, NULL) ? DRI2_FLIP : DRI2_FLIP_THROTTLE; - - return priv->is_compositor; -#else - return DRI2_FLIP_THROTTLE; -#endif -} - -static bool -sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw, - DRI2BufferPtr front, DRI2BufferPtr back, int pipe, - CARD64 *target_msc, CARD64 divisor, CARD64 remainder, - DRI2SwapEventPtr func, void *data) -{ - struct sna *sna = to_sna_from_drawable(draw); - struct sna_dri_frame_event *info; - drmVBlank vbl; - CARD64 current_msc; - - current_msc = get_current_msc_for_target(sna, *target_msc, pipe); - - DBG(("%s: target_msc=%u, current_msc=%u, divisor=%u\n", __FUNCTION__, - (uint32_t)*target_msc, (uint32_t)current_msc, (uint32_t)divisor)); - - if (divisor == 0 && current_msc >= *target_msc - 1) { - info = sna->dri.flip_pending; - - DBG(("%s: performing immediate swap on pipe %d, pending? %d, mode: %d\n", - __FUNCTION__, pipe, info != NULL, info ? info->mode : 0)); - - if (info && info->draw == draw) { - assert(info->type == DRI2_FLIP_THROTTLE); - assert(info->front == front); - if (info->back != back) { - _sna_dri_destroy_buffer(sna, info->back); - info->back = back; - sna_dri_reference_buffer(back); - } - if (current_msc >= *target_msc) { - DBG(("%s: executing xchg of pending flip\n", - __FUNCTION__)); - sna_dri_exchange_buffers(draw, front, back); - info->mode = 2; - current_msc = *target_msc; - goto new_back; - } else { - DBG(("%s: chaining flip\n", __FUNCTION__)); - info->mode = 1; - current_msc++; - goto out; - } - } - - info = calloc(1, sizeof(struct sna_dri_frame_event)); - if (info == NULL) - return false; - - list_init(&info->cache); - info->type = use_triple_buffer(sna, client); - info->draw = draw; - info->client = client; - info->event_complete = func; - info->event_data = data; - info->front = front; - info->back = back; - info->pipe = pipe; - - info->scanout[0].bo = ref(get_private(front)->bo); - info->scanout[0].name = info->front->name; - assert(info->scanout[0].bo->scanout); - - sna_dri_add_frame_event(draw, info); - sna_dri_reference_buffer(front); - sna_dri_reference_buffer(back); - - if (sna->dri.flip_pending) { - /* We need to first wait (one vblank) for the - * async flips to complete before this client - * can take over. - */ - DBG(("%s: queueing flip after pending completion\n", - __FUNCTION__)); - info->type = DRI2_FLIP; - sna->dri.flip_pending = info; - } else { - if (!sna_dri_page_flip(sna, info)) { - sna_dri_frame_event_info_free(sna, draw, info); - return false; - } - } - - current_msc++; - if (info->type != DRI2_FLIP) { -new_back: - sna_dri_flip_get_back(sna, info); - DRI2SwapComplete(client, draw, 0, 0, 0, - DRI2_EXCHANGE_COMPLETE, - func, data); - } -out: - DBG(("%s: target_msc=%lu\n", __FUNCTION__, (unsigned long)current_msc)); - *target_msc = current_msc; - return true; - } - - info = calloc(1, sizeof(struct sna_dri_frame_event)); - if (info == NULL) - return false; - - list_init(&info->cache); - info->draw = draw; - info->client = client; - info->event_complete = func; - info->event_data = data; - info->front = front; - info->back = back; - info->pipe = pipe; - info->type = DRI2_FLIP; - - info->scanout[0].bo = ref(get_private(front)->bo); - info->scanout[0].name = info->front->name; - assert(info->scanout[0].bo->scanout); - - sna_dri_add_frame_event(draw, info); - sna_dri_reference_buffer(front); - sna_dri_reference_buffer(back); - - *target_msc &= 0xffffffff; - remainder &= 0xffffffff; - - VG_CLEAR(vbl); - - vbl.request.type = - DRM_VBLANK_ABSOLUTE | - DRM_VBLANK_EVENT | - pipe_select(pipe); - - /* - * If divisor is zero, or current_msc is smaller than target_msc - * we just need to make sure target_msc passes before initiating - * the swap. - */ - if (current_msc <= *target_msc - 1) { - DBG(("%s: waiting for swap: current=%d, target=%d, divisor=%d\n", - __FUNCTION__, - (int)current_msc, - (int)*target_msc, - (int)divisor)); - vbl.request.sequence = *target_msc; - } else { - DBG(("%s: missed target, queueing event for next: current=%d, target=%d, divisor=%d\n", - __FUNCTION__, - (int)current_msc, - (int)*target_msc, - (int)divisor)); - - if (divisor == 0) - divisor = 1; - - vbl.request.sequence = current_msc - current_msc % divisor + remainder; - - /* - * If the calculated deadline vbl.request.sequence is - * smaller than or equal to current_msc, it means - * we've passed the last point when effective onset - * frame seq could satisfy *seq % divisor == remainder, - * so we need to wait for the next time this will - * happen. - * - * This comparison takes the 1 frame swap delay - * in pageflipping mode into account. - */ - if (vbl.request.sequence <= current_msc) - vbl.request.sequence += divisor; - - /* Adjust returned value for 1 frame pageflip offset */ - *target_msc = vbl.reply.sequence; - } - - /* Account for 1 frame extra pageflip delay */ - vbl.request.sequence -= 1; - vbl.request.signal = (unsigned long)info; - if (sna_wait_vblank(sna, &vbl)) { - sna_dri_frame_event_info_free(sna, draw, info); - return false; - } - - return true; -} - -/* - * ScheduleSwap is responsible for requesting a DRM vblank event for the - * appropriate frame. - * - * In the case of a blit (e.g. for a windowed swap) or buffer exchange, - * the vblank requested can simply be the last queued swap frame + the swap - * interval for the drawable. - * - * In the case of a page flip, we request an event for the last queued swap - * frame + swap interval - 1, since we'll need to queue the flip for the frame - * immediately following the received event. - * - * The client will be blocked if it tries to perform further GL commands - * after queueing a swap, though in the Intel case after queueing a flip, the - * client is free to queue more commands; they'll block in the kernel if - * they access buffers busy with the flip. - * - * When the swap is complete, the driver should call into the server so it - * can send any swap complete events that have been requested. - */ -static int -sna_dri_schedule_swap(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front, - DRI2BufferPtr back, CARD64 *target_msc, CARD64 divisor, - CARD64 remainder, DRI2SwapEventPtr func, void *data) -{ - struct sna *sna = to_sna_from_drawable(draw); - drmVBlank vbl; - int pipe; - struct sna_dri_frame_event *info = NULL; - enum frame_event_type swap_type = DRI2_SWAP; - CARD64 current_msc; - - DBG(("%s: pixmap=%ld, back=%u (refs=%d/%d, flush=%d) , fron=%u (refs=%d/%d, flush=%d)\n", - __FUNCTION__, - get_drawable_pixmap(draw)->drawable.serialNumber, - get_private(back)->bo->handle, - get_private(back)->refcnt, - get_private(back)->bo->refcnt, - get_private(back)->bo->flush, - get_private(front)->bo->handle, - get_private(front)->refcnt, - get_private(front)->bo->refcnt, - get_private(front)->bo->flush)); - - DBG(("%s(target_msc=%llu, divisor=%llu, remainder=%llu)\n", - __FUNCTION__, - (long long)*target_msc, - (long long)divisor, - (long long)remainder)); - - /* Truncate to match kernel interfaces; means occasional overflow - * misses, but that's generally not a big deal */ - *target_msc &= 0xffffffff; - divisor &= 0xffffffff; - remainder &= 0xffffffff; - - assert(get_private(front)->refcnt); - assert(get_private(back)->refcnt); - - assert(get_private(front)->bo->refcnt); - assert(get_private(front)->bo->flush); - - assert(get_private(back)->bo->refcnt); - assert(get_private(back)->bo->flush); - - if (get_private(front)->pixmap != get_drawable_pixmap(draw)) - goto skip; - - assert(sna_pixmap_from_drawable(draw)->flush); - - /* Drawable not displayed... just complete the swap */ - pipe = -1; - if ((sna->flags & SNA_NO_WAIT) == 0) - pipe = sna_dri_get_pipe(draw); - if (pipe == -1) { - DBG(("%s: off-screen, immediate update\n", __FUNCTION__)); - goto blit; - } - - if (can_flip(sna, draw, front, back) && - sna_dri_schedule_flip(client, draw, front, back, pipe, - target_msc, divisor, remainder, - func, data)) - return TRUE; - - VG_CLEAR(vbl); - - info = calloc(1, sizeof(struct sna_dri_frame_event)); - if (!info) - goto blit; - - list_init(&info->cache); - info->draw = draw; - info->client = client; - info->event_complete = func; - info->event_data = data; - info->front = front; - info->back = back; - info->pipe = pipe; - - sna_dri_add_frame_event(draw, info); - sna_dri_reference_buffer(front); - sna_dri_reference_buffer(back); - - info->type = swap_type; - - current_msc = get_current_msc_for_target(sna, *target_msc, pipe); - DBG(("%s: target_msc=%u, current_msc=%u, divisor=%u\n", __FUNCTION__, - (uint32_t)*target_msc, (uint32_t)current_msc, (uint32_t)divisor)); - - if (divisor == 0 && current_msc >= *target_msc - 1) { - bool sync = current_msc < *target_msc; - if (!sna_dri_immediate_blit(sna, info, sync, true)) - sna_dri_frame_event_info_free(sna, draw, info); - if (*target_msc) - *target_msc = current_msc + sync; - return TRUE; - } - - /* - * If divisor is zero, or current_msc is smaller than target_msc - * we just need to make sure target_msc passes before initiating - * the swap. - */ - if (current_msc < *target_msc) { - DBG(("%s: waiting for swap: current=%d, target=%d, divisor=%d\n", - __FUNCTION__, - (int)current_msc, - (int)*target_msc, - (int)divisor)); - - info->type = DRI2_SWAP; - - vbl.request.type = - DRM_VBLANK_ABSOLUTE | - DRM_VBLANK_EVENT | - pipe_select(pipe); - vbl.request.sequence = *target_msc; - vbl.request.signal = (unsigned long)info; - if (sna_wait_vblank(sna, &vbl)) - goto blit; - - return TRUE; - } - - /* - * If we get here, target_msc has already passed or we don't have one, - * and we need to queue an event that will satisfy the divisor/remainder - * equation. - */ - DBG(("%s: missed target, queueing event for next: current=%d, target=%d, divisor=%d\n", - __FUNCTION__, - (int)current_msc, - (int)*target_msc, - (int)divisor)); - - if (divisor == 0) - divisor = 1; - - vbl.request.type = - DRM_VBLANK_ABSOLUTE | - DRM_VBLANK_EVENT | - DRM_VBLANK_NEXTONMISS | - pipe_select(pipe); - - vbl.request.sequence = current_msc - current_msc % divisor + remainder; - /* - * If the calculated deadline vbl.request.sequence is smaller than - * or equal to current_msc, it means we've passed the last point - * when effective onset frame seq could satisfy - * seq % divisor == remainder, so we need to wait for the next time - * this will happen. - */ - if (vbl.request.sequence < current_msc) - vbl.request.sequence += divisor; - *target_msc = vbl.reply.sequence; - - vbl.request.sequence -= 1; - vbl.request.signal = (unsigned long)info; - if (sna_wait_vblank(sna, &vbl)) - goto blit; - - return TRUE; - -blit: - DBG(("%s -- blit\n", __FUNCTION__)); - __sna_dri_copy_region(sna, draw, NULL, back, front, false); - if (info) - sna_dri_frame_event_info_free(sna, draw, info); -skip: - DRI2SwapComplete(client, draw, 0, 0, 0, DRI2_BLIT_COMPLETE, func, data); - *target_msc = 0; /* offscreen, so zero out target vblank count */ - return TRUE; -} - -static uint64_t gettime_us(void) -{ - struct timespec tv; - - if (clock_gettime(CLOCK_MONOTONIC, &tv)) - return 0; - - return (uint64_t)tv.tv_sec * 1000000 + tv.tv_nsec / 1000; -} - -/* - * Get current frame count and frame count timestamp, based on drawable's - * crtc. - */ -static int -sna_dri_get_msc(DrawablePtr draw, CARD64 *ust, CARD64 *msc) -{ - struct sna *sna = to_sna_from_drawable(draw); - drmVBlank vbl; - int pipe; - - - pipe = sna_dri_get_pipe(draw); - DBG(("%s(pipe=%d)\n", __FUNCTION__, pipe)); - if (pipe == -1) { -fail: - /* Drawable not displayed, make up a *monotonic* value */ - *ust = gettime_us(); - *msc = 0; - return TRUE; - } - - VG_CLEAR(vbl); - vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe); - vbl.request.sequence = 0; - if (sna_wait_vblank(sna, &vbl) == 0) { - *ust = ((CARD64)vbl.reply.tval_sec * 1000000) + vbl.reply.tval_usec; - *msc = vbl.reply.sequence; - DBG(("%s: msc=%llu, ust=%llu\n", __FUNCTION__, - (long long)*msc, (long long)*ust)); - } else { - DBG(("%s: query failed on pipe %d, ret=%d\n", - __FUNCTION__, pipe, errno)); - goto fail; - } - - return TRUE; -} - -/* - * Request a DRM event when the requested conditions will be satisfied. - * - * We need to handle the event and ask the server to wake up the client when - * we receive it. - */ -static int -sna_dri_schedule_wait_msc(ClientPtr client, DrawablePtr draw, CARD64 target_msc, - CARD64 divisor, CARD64 remainder) -{ - struct sna *sna = to_sna_from_drawable(draw); - struct sna_dri_frame_event *info = NULL; - int pipe = sna_dri_get_pipe(draw); - CARD64 current_msc; - drmVBlank vbl; - - DBG(("%s(pipe=%d, target_msc=%llu, divisor=%llu, rem=%llu)\n", - __FUNCTION__, pipe, - (long long)target_msc, - (long long)divisor, - (long long)remainder)); - - /* Truncate to match kernel interfaces; means occasional overflow - * misses, but that's generally not a big deal */ - target_msc &= 0xffffffff; - divisor &= 0xffffffff; - remainder &= 0xffffffff; - - /* Drawable not visible, return immediately */ - if (pipe == -1) - goto out_complete; - - VG_CLEAR(vbl); - - /* Get current count */ - vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe); - vbl.request.sequence = 0; - if (sna_wait_vblank(sna, &vbl)) - goto out_complete; - - current_msc = vbl.reply.sequence; - - /* If target_msc already reached or passed, set it to - * current_msc to ensure we return a reasonable value back - * to the caller. This keeps the client from continually - * sending us MSC targets from the past by forcibly updating - * their count on this call. - */ - if (divisor == 0 && current_msc >= target_msc) { - target_msc = current_msc; - goto out_complete; - } - - info = calloc(1, sizeof(struct sna_dri_frame_event)); - if (!info) - goto out_complete; - - list_init(&info->cache); - info->draw = draw; - info->client = client; - info->type = DRI2_WAITMSC; - sna_dri_add_frame_event(draw, info); - - /* - * If divisor is zero, or current_msc is smaller than target_msc, - * we just need to make sure target_msc passes before waking up the - * client. - */ - if (divisor == 0 || current_msc < target_msc) { - vbl.request.type = - DRM_VBLANK_ABSOLUTE | - DRM_VBLANK_EVENT | - pipe_select(pipe); - vbl.request.sequence = target_msc; - vbl.request.signal = (unsigned long)info; - if (sna_wait_vblank(sna, &vbl)) - goto out_free_info; - - DRI2BlockClient(client, draw); - return TRUE; - } - - /* - * If we get here, target_msc has already passed or we don't have one, - * so we queue an event that will satisfy the divisor/remainder - * equation. - */ - vbl.request.type = - DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT | pipe_select(pipe); - - vbl.request.sequence = current_msc - current_msc % divisor + remainder; - - /* - * If calculated remainder is larger than requested remainder, - * it means we've passed the last point where - * seq % divisor == remainder, so we need to wait for the next time - * that will happen. - */ - if ((current_msc % divisor) >= remainder) - vbl.request.sequence += divisor; - - vbl.request.signal = (unsigned long)info; - if (sna_wait_vblank(sna, &vbl)) - goto out_free_info; - - DRI2BlockClient(client, draw); - return TRUE; - -out_free_info: - sna_dri_frame_event_info_free(sna, draw, info); -out_complete: - DRI2WaitMSCComplete(client, draw, target_msc, 0, 0); - return TRUE; -} -#else -void sna_dri_destroy_window(WindowPtr win) { } -#endif - -static bool has_i830_dri(void) -{ - return access(DRI_DRIVER_PATH "/i830_dri.so", R_OK) == 0; -} - -static int -namecmp(const char *s1, const char *s2) -{ - char c1, c2; - - if (!s1 || *s1 == 0) { - if (!s2 || *s2 == 0) - return 0; - else - return 1; - } - - while (*s1 == '_' || *s1 == ' ' || *s1 == '\t') - s1++; - - while (*s2 == '_' || *s2 == ' ' || *s2 == '\t') - s2++; - - c1 = isupper(*s1) ? tolower(*s1) : *s1; - c2 = isupper(*s2) ? tolower(*s2) : *s2; - while (c1 == c2) { - if (c1 == '\0') - return 0; - - s1++; - while (*s1 == '_' || *s1 == ' ' || *s1 == '\t') - s1++; - - s2++; - while (*s2 == '_' || *s2 == ' ' || *s2 == '\t') - s2++; - - c1 = isupper(*s1) ? tolower(*s1) : *s1; - c2 = isupper(*s2) ? tolower(*s2) : *s2; - } - - return c1 - c2; -} - -static bool is_bool(const char *str) -{ - if (str == NULL) - return true; - - if (*str == '\0') - return true; - - if (namecmp(str, "1") == 0) - return true; - if (namecmp(str, "on") == 0) - return true; - if (namecmp(str, "true") == 0) - return true; - if (namecmp(str, "yes") == 0) - return true; - - if (namecmp(str, "0") == 0) - return true; - if (namecmp(str, "off") == 0) - return true; - if (namecmp(str, "false") == 0) - return true; - if (namecmp(str, "no") == 0) - return true; - - return false; -} - -static const char *dri_driver_name(struct sna *sna) -{ - const char *s = xf86GetOptValString(sna->Options, OPTION_DRI); - - if (is_bool(s)) { - if (sna->kgem.gen < 030) - return has_i830_dri() ? "i830" : "i915"; - else if (sna->kgem.gen < 040) - return "i915"; - else - return "i965"; - } - - return s; -} - -bool sna_dri_open(struct sna *sna, ScreenPtr screen) -{ - DRI2InfoRec info; - int major = 1, minor = 0; -#if DRI2INFOREC_VERSION >= 4 - const char *driverNames[2]; -#endif - - DBG(("%s()\n", __FUNCTION__)); - - if (wedged(sna)) { - xf86DrvMsg(sna->scrn->scrnIndex, X_WARNING, - "loading DRI2 whilst the GPU is wedged.\n"); - } - - if (xf86LoaderCheckSymbol("DRI2Version")) - DRI2Version(&major, &minor); - - if (minor < 1) { - xf86DrvMsg(sna->scrn->scrnIndex, X_WARNING, - "DRI2 requires DRI2 module version 1.1.0 or later\n"); - return false; - } - - memset(&info, '\0', sizeof(info)); - info.fd = sna->kgem.fd; - info.driverName = dri_driver_name(sna); - info.deviceName = intel_get_client_name(sna->scrn); - - DBG(("%s: loading dri driver '%s' [gen=%d] for device '%s'\n", - __FUNCTION__, info.driverName, sna->kgem.gen, info.deviceName)); - -#if DRI2INFOREC_VERSION == 2 - /* The ABI between 2 and 3 was broken so we could get rid of - * the multi-buffer alloc functions. Make sure we indicate the - * right version so DRI2 can reject us if it's version 3 or above. */ - info.version = 2; -#else - info.version = 3; -#endif - info.CreateBuffer = sna_dri_create_buffer; - info.DestroyBuffer = sna_dri_destroy_buffer; - - info.CopyRegion = sna_dri_copy_region; -#if DRI2INFOREC_VERSION >= 4 - info.version = 4; - info.ScheduleSwap = sna_dri_schedule_swap; - info.GetMSC = sna_dri_get_msc; - info.ScheduleWaitMSC = sna_dri_schedule_wait_msc; - info.numDrivers = 2; - info.driverNames = driverNames; - driverNames[0] = info.driverName; - driverNames[1] = info.driverName; -#endif - -#if DRI2INFOREC_VERSION >= 6 - info.version = 6; - info.SwapLimitValidate = NULL; - info.ReuseBufferNotify = NULL; -#endif - -#if USE_ASYNC_SWAP - info.version = 10; - info.scheduleSwap0 = 1; -#endif - - return DRI2ScreenInit(screen, &info); -} - -void sna_dri_close(struct sna *sna, ScreenPtr screen) -{ - DBG(("%s()\n", __FUNCTION__)); - DRI2CloseScreen(screen); -} diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_driver.c xserver-xorg-video-intel-2.99.914/src/sna/sna_driver.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_driver.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_driver.c 2014-07-23 11:57:21.000000000 +0000 @@ -71,6 +71,12 @@ #include "git_version.h" #endif +#ifdef TEARFREE +#define ENABLE_TEAR_FREE TRUE +#else +#define ENABLE_TEAR_FREE FALSE +#endif + DevPrivateKeyRec sna_pixmap_key; DevPrivateKeyRec sna_gc_key; DevPrivateKeyRec sna_window_key; @@ -196,7 +202,7 @@ sna_set_fallback_mode(scrn); } - sna_mode_update(sna); + sna_mode_check(sna); return TRUE; } @@ -243,7 +249,7 @@ return FALSE; } - if (!sna_pixmap_force_to_gpu(new_front, MOVE_WRITE)) { + if (!sna_pixmap_force_to_gpu(new_front, MOVE_READ)) { xf86DrvMsg(screen->myNum, X_ERROR, "[intel] Failed to allocate video resources for front buffer %dx%d at depth %d\n", screen->width, @@ -281,38 +287,40 @@ return TRUE; } -static void sna_selftest(void) +static Bool sna_save_screen(ScreenPtr screen, int mode) { - sna_damage_selftest(); + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + + DBG(("%s(mode=%d)\n", __FUNCTION__, mode)); + if (!scrn->vtSema) + return FALSE; + + xf86SaveScreen(screen, mode); + sna_crtc_config_notify(screen); + return TRUE; } -static bool has_vsync(struct sna *sna) +static void sna_dpms_set(ScrnInfoPtr scrn, int mode, int flags) { - if (sna->flags & SNA_IS_HOSTED) - return false; + DBG(("%s(mode=%d, flags=%d)\n", __FUNCTION__, mode)); + if (!scrn->vtSema) + return; - return true; + xf86DPMSSet(scrn, mode, flags); + sna_crtc_config_notify(xf86ScrnToScreen(scrn)); } -static bool has_pageflipping(struct sna *sna) +static void sna_selftest(void) { - drm_i915_getparam_t gp; - int v; + sna_damage_selftest(); +} +static bool has_vsync(struct sna *sna) +{ if (sna->flags & SNA_IS_HOSTED) return false; - v = 0; - - VG_CLEAR(gp); - gp.param = I915_PARAM_HAS_PAGEFLIPPING; - gp.value = &v; - - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GETPARAM, &gp)) - return false; - - VG(VALGRIND_MAKE_MEM_DEFINED(&v, sizeof(v))); - return v > 0; + return true; } static void sna_setup_capabilities(ScrnInfoPtr scrn, int fd) @@ -400,6 +408,37 @@ return val; } +static unsigned sna_option_cast_to_unsigned(struct sna *sna, int id, unsigned val) +{ + const char *str = xf86GetOptValString(sna->Options, id); + unsigned v; + + if (str == NULL || *str == '\0') + return val; + + if (namecmp(str, "on") == 0) + return val; + if (namecmp(str, "true") == 0) + return val; + if (namecmp(str, "yes") == 0) + return val; + + if (namecmp(str, "0") == 0) + return 0; + if (namecmp(str, "off") == 0) + return 0; + if (namecmp(str, "false") == 0) + return 0; + if (namecmp(str, "no") == 0) + return 0; + + v = atoi(str); + if (v) + return v; + + return val; +} + static Bool fb_supports_depth(int fd, int depth) { struct drm_i915_gem_create create; @@ -428,6 +467,66 @@ return ret; } +static void setup_dri(struct sna *sna) +{ + unsigned level; + + sna->dri2.available = false; + sna->dri3.available = false; + + level = sna_option_cast_to_unsigned(sna, OPTION_DRI, ~0); +#if HAVE_DRI3 + if (level >= 3) + sna->dri3.available = !!xf86LoadSubModule(sna->scrn, "dri3"); +#endif +#if HAVE_DRI2 + if (level >= 2) + sna->dri2.available = !!xf86LoadSubModule(sna->scrn, "dri2"); +#endif +} + +static bool enable_tear_free(struct sna *sna) +{ + if (sna->flags & SNA_LINEAR_FB) + return false; + + /* Under certain conditions, we should enable TearFree by default, + * for example when the hardware requires pageflipping to run within + * its power/performance budget. + */ + if (sna_mode_wants_tear_free(sna)) + return true; + + return ENABLE_TEAR_FREE; +} + +static void setup_tear_free(struct sna *sna) +{ + MessageType from; + Bool enable; + + if (sna->flags & SNA_LINEAR_FB) + return; + + if ((sna->flags & SNA_HAS_FLIP) == 0) { + from = X_PROBED; + goto done; + } + + if (!xf86GetOptValBool(sna->Options, OPTION_TEAR_FREE, &enable)) { + enable = enable_tear_free(sna); + from = X_DEFAULT; + } else + from = X_CONFIG; + + if (enable) + sna->flags |= SNA_TEAR_FREE; + +done: + xf86DrvMsg(sna->scrn->scrnIndex, from, "TearFree %sabled\n", + sna->flags & SNA_TEAR_FREE ? "en" : "dis"); +} + /** * This is called before ScreenInit to do any require probing of screen * configuration. @@ -441,7 +540,7 @@ * As a result, we want to set up that server initialization once rather * that doing it per generation. */ -static Bool sna_pre_init(ScrnInfoPtr scrn, int flags) +static Bool sna_pre_init(ScrnInfoPtr scrn, int probe) { struct sna *sna; char buf[1024]; @@ -451,7 +550,7 @@ int fd; DBG(("%s flags=%x, numEntities=%d\n", - __FUNCTION__, flags, scrn->numEntities)); + __FUNCTION__, probe, scrn->numEntities)); if (scrn->numEntities != 1) return FALSE; @@ -467,17 +566,19 @@ ) return FALSE; - if (flags & PROBE_DETECT) + if (probe & PROBE_DETECT) return TRUE; sna_selftest(); - if (((uintptr_t)scrn->driverPrivate) & 1) { + probe = 0; + if (((uintptr_t)scrn->driverPrivate) & 3) { if (posix_memalign((void **)&sna, 4096, sizeof(*sna))) return FALSE; memset(sna, 0, sizeof(*sna)); /* should be unnecessary */ - sna->info = (void *)((uintptr_t)scrn->driverPrivate & ~1); + probe = (uintptr_t)scrn->driverPrivate & 1; + sna->info = (void *)((uintptr_t)scrn->driverPrivate & ~3); scrn->driverPrivate = sna; sna->cpu_features = sna_cpu_detect(); @@ -486,7 +587,7 @@ sna = to_sna(scrn); sna->scrn = scrn; sna->pEnt = pEnt; - sna->flags = 0; + sna->flags = probe; scrn->displayWidth = 640; /* default it */ @@ -555,14 +656,11 @@ sna->kgem.wedged = true; } - /* Enable tiling by default */ - sna->tiling = SNA_TILING_ALL; - - /* Allow user override if they set a value */ - if (!xf86ReturnOptValBool(sna->Options, OPTION_TILING_2D, TRUE)) - sna->tiling &= ~SNA_TILING_2D; if (xf86ReturnOptValBool(sna->Options, OPTION_TILING_FB, FALSE)) - sna->tiling &= ~SNA_TILING_FB; + sna->flags |= SNA_LINEAR_FB; + + if (xf86ReturnOptValBool(sna->Options, OPTION_DELETE_DP12, FALSE)) + sna->flags |= SNA_REMOVE_OUTPUTS; if (!xf86ReturnOptValBool(sna->Options, OPTION_SWAPBUFFERS_WAIT, TRUE)) sna->flags |= SNA_NO_WAIT; @@ -573,7 +671,7 @@ sna->flags |= SNA_NO_VSYNC; DBG(("%s: vsync? %s\n", __FUNCTION__, sna->flags & SNA_NO_VSYNC ? "disabled" : "enabled")); - if (!has_pageflipping(sna) || + if (sna->flags & SNA_IS_HOSTED || !xf86ReturnOptValBool(sna->Options, OPTION_PAGEFLIP, TRUE)) sna->flags |= SNA_NO_FLIP; DBG(("%s: page flips? %s\n", __FUNCTION__, sna->flags & SNA_NO_FLIP ? "disabled" : "enabled")); @@ -583,25 +681,10 @@ sna->flags |= SNA_TRIPLE_BUFFER; DBG(("%s: triple buffer? %s\n", __FUNCTION__, sna->flags & SNA_TRIPLE_BUFFER ? "enabled" : "disabled")); - if ((sna->flags & (SNA_NO_VSYNC | SNA_NO_FLIP)) == 0 && - xf86ReturnOptValBool(sna->Options, OPTION_TEAR_FREE, FALSE)) - sna->flags |= SNA_TEAR_FREE; - - if (xf86ReturnOptValBool(sna->Options, OPTION_CRTC_PIXMAPS, FALSE)) + if (xf86ReturnOptValBool(sna->Options, OPTION_CRTC_PIXMAPS, FALSE)) { + xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "Forcing per-crtc-pixmaps.\n"); sna->flags |= SNA_FORCE_SHADOW; - - xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "Framebuffer %s\n", - sna->tiling & SNA_TILING_FB ? "tiled" : "linear"); - xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "Pixmaps %s\n", - sna->tiling & SNA_TILING_2D ? "tiled" : "linear"); - xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "\"Tear free\" %sabled\n", - sna->flags & SNA_TEAR_FREE ? "en" : "dis"); - xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "Forcing per-crtc-pixmaps? %s\n", - sna->flags & SNA_FORCE_SHADOW ? "yes" : "no"); - - if (sna->tiling != SNA_TILING_ALL) - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "Tiling disabled, expect poor performance and increased power consumption.\n"); + } if (!sna_mode_pre_init(scrn, sna)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, @@ -610,23 +693,41 @@ } scrn->currentMode = scrn->modes; + setup_tear_free(sna); + xf86SetGamma(scrn, zeros); xf86SetDpi(scrn, 0, 0); - sna->dri_available = false; - if (sna_option_cast_to_bool(sna, OPTION_DRI, TRUE)) - sna->dri_available = !!xf86LoadSubModule(scrn, "dri2"); + setup_dri(sna); + + sna->present.available = false; + if (xf86ReturnOptValBool(sna->Options, OPTION_PRESENT, TRUE)) { +#if HAVE_PRESENT + sna->present.available = !!xf86LoadSubModule(scrn, "present"); +#endif + } sna_acpi_init(sna); return TRUE; cleanup: - scrn->driverPrivate = (void *)((uintptr_t)sna->info | 1); + scrn->driverPrivate = (void *)((uintptr_t)sna->info | (sna->flags & SNA_IS_SLAVED) | 2); free(sna); return FALSE; } +static bool has_shadow(struct sna *sna) +{ + if (!sna->mode.shadow_damage) + return false; + + if (RegionNil(DamageRegion(sna->mode.shadow_damage))) + return false; + + return sna->mode.flip_active == 0; +} + static void sna_block_handler(BLOCKHANDLER_ARGS_DECL) { @@ -642,7 +743,7 @@ sna->BlockHandler(BLOCKHANDLER_ARGS); - if (*tv == NULL || ((*tv)->tv_usec | (*tv)->tv_sec)) + if (*tv == NULL || ((*tv)->tv_usec | (*tv)->tv_sec) || has_shadow(sna)) sna_accel_block_handler(sna, tv); } @@ -675,10 +776,9 @@ static void sna_handle_uevents(int fd, void *closure) { - ScrnInfoPtr scrn = closure; - struct sna *sna = to_sna(scrn); + struct sna *sna = closure; struct udev_device *dev; - const char *hotplug; + const char *str; struct stat s; dev_t udev_devnum; @@ -689,25 +789,20 @@ return; udev_devnum = udev_device_get_devnum(dev); - if (fstat(sna->kgem.fd, &s)) { + if (fstat(sna->kgem.fd, &s) || memcmp(&s.st_rdev, &udev_devnum, sizeof (dev_t))) { udev_device_unref(dev); return; } - /* - * Check to make sure this event is directed at our - * device (by comparing dev_t values), then make - * sure it's a hotplug event (HOTPLUG=1) - */ - - hotplug = udev_device_get_property_value(dev, "HOTPLUG"); - - if (memcmp(&s.st_rdev, &udev_devnum, sizeof (dev_t)) == 0 && - hotplug && atoi(hotplug) == 1) { - DBG(("%s: hotplug event (vtSema?=%d)\n", - __FUNCTION__, sna->scrn->vtSema)); - if (sna->scrn->vtSema) { - sna_mode_update(sna); + str = udev_device_get_property_value(dev, "HOTPLUG"); + if (str && atoi(str) == 1) { + ScrnInfoPtr scrn = sna->scrn; + + DBG(("%s: hotplug event (vtSema?=%d)\n", __FUNCTION__, scrn->vtSema)); + + if (scrn->vtSema) { + sna_mode_discover(sna); + sna_mode_check(sna); RRGetInfo(xf86ScrnToScreen(scrn), TRUE); } else sna->flags |= SNA_REPROBE; @@ -717,12 +812,10 @@ } static void -sna_uevent_init(ScrnInfoPtr scrn) +sna_uevent_init(struct sna *sna) { - struct sna *sna = to_sna(scrn); struct udev *u; struct udev_monitor *mon; - Bool hotplug; MessageType from = X_CONFIG; if (sna->flags & SNA_IS_HOSTED) @@ -734,51 +827,47 @@ * RR hotplug events is then verboten. */ if (!dixPrivateKeyRegistered(rrPrivKey)) - return; - - if (!xf86GetOptValBool(sna->Options, OPTION_HOTPLUG, &hotplug)) - from = X_DEFAULT, hotplug = TRUE; - xf86DrvMsg(scrn->scrnIndex, from, "hotplug detection: \"%s\"\n", - hotplug ? "enabled" : "disabled"); - if (!hotplug) - return; + goto out; - u = udev_new(); + u = NULL; + if (xf86ReturnOptValBool(sna->Options, OPTION_HOTPLUG, TRUE)) + u = udev_new(); if (!u) - return; + goto out; + + from = X_DEFAULT; mon = udev_monitor_new_from_netlink(u, "udev"); - if (!mon) { - udev_unref(u); - return; - } + if (!mon) + goto err_dev; - if (udev_monitor_filter_add_match_subsystem_devtype(mon, - "drm", "drm_minor") < 0 || - udev_monitor_enable_receiving(mon) < 0) - { - udev_monitor_unref(mon); - udev_unref(u); - return; - } + if (udev_monitor_filter_add_match_subsystem_devtype(mon, "drm", "drm_minor") < 0) + goto err_monitor; + + if (udev_monitor_enable_receiving(mon) < 0) + goto err_monitor; sna->uevent_handler = xf86AddGeneralHandler(udev_monitor_get_fd(mon), - sna_handle_uevents, scrn); - if (!sna->uevent_handler) { - udev_monitor_unref(mon); - udev_unref(u); - return; - } + sna_handle_uevents, sna); + if (!sna->uevent_handler) + goto err_monitor; sna->uevent_monitor = mon; - - DBG(("%s: installed uvent handler\n", __FUNCTION__)); +out: + xf86DrvMsg(sna->scrn->scrnIndex, from, "display hotplug detection %s\n", + sna->uevent_monitor ? "enabled" : "disabled"); + return; + +err_monitor: + udev_monitor_unref(mon); +err_dev: + udev_unref(u); + goto out; } static void -sna_uevent_fini(ScrnInfoPtr scrn) +sna_uevent_fini(struct sna *sna) { - struct sna *sna = to_sna(scrn); struct udev *u; if (sna->uevent_handler == NULL) @@ -796,8 +885,8 @@ DBG(("%s: removed uvent handler\n", __FUNCTION__)); } #else -static void sna_uevent_init(ScrnInfoPtr scrn) { } -static void sna_uevent_fini(ScrnInfoPtr scrn) { } +static void sna_uevent_init(struct sna *sna) { } +static void sna_uevent_fini(struct sna *sna) { } #endif /* HAVE_UDEV */ static void sna_leave_vt(VT_FUNC_ARGS_DECL) @@ -806,8 +895,6 @@ DBG(("%s\n", __FUNCTION__)); - xf86_hide_cursors(scrn); - sna_mode_reset(to_sna(scrn)); if (intel_put_master(scrn)) @@ -824,14 +911,22 @@ /* XXX Note that we will leak kernel resources if !vtSema */ - xf86_hide_cursors(scrn); - sna_uevent_fini(scrn); - + sna_uevent_fini(sna); sna_mode_close(sna); - if (sna->dri_open) { - sna_dri_close(sna, screen); - sna->dri_open = false; + if (sna->present.open) { + sna_present_close(sna, screen); + sna->present.open = false; + } + + if (sna->dri3.open) { + sna_dri3_close(sna, screen); + sna->dri3.open = false; + } + + if (sna->dri2.open) { + sna_dri2_close(sna, screen); + sna->dri2.open = false; } if (sna->front) { @@ -844,8 +939,6 @@ scrn->vtSema = FALSE; } - xf86_cursors_fini(screen); - return sna->CloseScreen(CLOSE_SCREEN_ARGS); } @@ -912,6 +1005,25 @@ return TRUE; } +static void sna_dri_init(struct sna *sna, ScreenPtr screen) +{ + char str[128] = ""; + + if (sna->dri2.available) + sna->dri2.open = sna_dri2_open(sna, screen); + if (sna->dri2.open) + strcat(str, "DRI2 "); + + if (sna->dri3.available) + sna->dri3.open = sna_dri3_open(sna, screen); + if (sna->dri3.open) + strcat(str, "DRI3 "); + + if (*str) + xf86DrvMsg(sna->scrn->scrnIndex, X_INFO, + "direct rendering: %senabled\n", str); +} + static size_t agp_aperture_size(struct pci_device *dev, int gen) { @@ -999,16 +1111,7 @@ if (!miDCInitialize(screen, xf86GetPointerScreenFuncs())) return FALSE; - if ((sna->flags & SNA_IS_HOSTED) == 0 && - xf86_cursors_init(screen, SNA_CURSOR_X, SNA_CURSOR_Y, - HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | - HARDWARE_CURSOR_BIT_ORDER_MSBFIRST | - HARDWARE_CURSOR_INVERT_MASK | - HARDWARE_CURSOR_SWAP_SOURCE_AND_MASK | - HARDWARE_CURSOR_AND_SOURCE_WITH_MASK | - HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 | - HARDWARE_CURSOR_UPDATE_UNHIDDEN | - HARDWARE_CURSOR_ARGB)) + if (sna_cursors_init(screen, sna)) xf86DrvMsg(scrn->scrnIndex, X_INFO, "HW Cursor enabled\n"); /* Must force it before EnterVT, so we are in control of VT and @@ -1021,7 +1124,7 @@ sna->WakeupHandler = screen->WakeupHandler; screen->WakeupHandler = sna_wakeup_handler; - screen->SaveScreen = xf86SaveScreen; + screen->SaveScreen = sna_save_screen; screen->CreateScreenResources = sna_create_screen_resources; sna->CloseScreen = screen->CloseScreen; @@ -1036,27 +1139,29 @@ if (!miCreateDefColormap(screen)) return FALSE; - if (!xf86HandleColormaps(screen, 256, 8, sna_load_palette, NULL, + if (sna->mode.num_real_crtc && + !xf86HandleColormaps(screen, 256, 8, sna_load_palette, NULL, CMAP_RELOAD_ON_MODE_SWITCH | - CMAP_PALETTED_TRUECOLOR)) { + CMAP_PALETTED_TRUECOLOR)) return FALSE; - } - xf86DPMSInit(screen, xf86DPMSSet, 0); + xf86DPMSInit(screen, sna_dpms_set, 0); sna_video_init(sna, screen); - if (sna->dri_available) - sna->dri_open = sna_dri_open(sna, screen); - if (sna->dri_open) - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "direct rendering: DRI2 Enabled\n"); + sna_dri_init(sna, screen); + + if (sna->present.available) + sna->present.open = sna_present_open(sna, screen); + if (sna->present.open) + xf86DrvMsg(sna->scrn->scrnIndex, X_INFO, + "hardware support for Present enabled\n"); if (serverGeneration == 1) xf86ShowUnusedOptions(scrn->scrnIndex, scrn->options); sna->suspended = FALSE; - sna_uevent_init(scrn); + sna_uevent_init(sna); return TRUE; } @@ -1077,7 +1182,7 @@ if ((uintptr_t)sna & 1) return; - scrn->driverPrivate = (void *)((uintptr_t)sna->info | 1); + scrn->driverPrivate = (void *)((uintptr_t)sna->info | (sna->flags & SNA_IS_SLAVED) | 2); sna_mode_fini(sna); sna_acpi_fini(sna); @@ -1095,17 +1200,15 @@ if (intel_get_master(scrn)) return FALSE; - if (!sna_set_desired_mode(sna)) - return FALSE; - if (sna->flags & SNA_REPROBE) { DBG(("%s: reporting deferred hotplug event\n", __FUNCTION__)); + sna_mode_discover(sna); RRGetInfo(xf86ScrnToScreen(scrn), TRUE); sna->flags &= ~SNA_REPROBE; } - return TRUE; + return sna_set_desired_mode(sna); } static Bool sna_switch_mode(SWITCH_MODE_ARGS_DECL) @@ -1194,9 +1297,31 @@ { } -Bool sna_init_scrn(ScrnInfoPtr scrn, int entity_num) +static void describe_kms(ScrnInfoPtr scrn) +{ + int fd = __intel_peek_fd(scrn); + drm_version_t version; + char name[128] = ""; + char date[128] = ""; + + memset(&version, 0, sizeof(version)); + version.name_len = sizeof(name) - 1; + version.name = name; + version.date_len = sizeof(date) - 1; + version.date = date; + + if (drmIoctl(fd, DRM_IOCTL_VERSION, &version)) + return; + + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "Using Kernel Mode Setting driver: %s, version %d.%d.%d %s\n", + version.name, + version.version_major, version.version_minor, version.version_patchlevel, + version.date); +} + +static void describe_sna(ScrnInfoPtr scrn) { - DBG(("%s: entity_num=%d\n", __FUNCTION__, entity_num)); #if defined(USE_GIT_DESCRIBE) xf86DrvMsg(scrn->scrnIndex, X_INFO, "SNA compiled from %s\n", git_version); @@ -1220,7 +1345,19 @@ xf86DrvMsg(scrn->scrnIndex, X_INFO, "SNA compiled with extra pixmap/damage validation\n"); #endif +#ifdef HAVE_VALGRIND + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "SNA compiled for use with valgrind\n"); + VALGRIND_PRINTF("SNA compiled for use with valgrind\n"); +#endif DBG(("pixman version: %s\n", pixman_version_string())); +} + +Bool sna_init_scrn(ScrnInfoPtr scrn, int entity_num) +{ + DBG(("%s: entity_num=%d\n", __FUNCTION__, entity_num)); + describe_kms(scrn); + describe_sna(scrn); scrn->PreInit = sna_pre_init; scrn->ScreenInit = sna_screen_init; diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_glyphs.c xserver-xorg-video-intel-2.99.914/src/sna/sna_glyphs.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_glyphs.c 2014-02-04 09:45:46.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_glyphs.c 2014-06-27 15:37:50.000000000 +0000 @@ -70,8 +70,9 @@ #define FALLBACK 0 #define NO_GLYPH_CACHE 0 #define NO_GLYPHS_TO_DST 0 +#define FORCE_GLYPHS_TO_DST 0 #define NO_GLYPHS_VIA_MASK 0 -#define NO_SMALL_MASK 0 +#define FORCE_SMALL_MASK 0 /* -1 = never, 1 = always */ #define NO_GLYPHS_SLOW 0 #define NO_DISCARD_MASK 0 @@ -81,10 +82,16 @@ #define GLYPH_CACHE_SIZE (CACHE_PICTURE_SIZE * CACHE_PICTURE_SIZE / (GLYPH_MIN_SIZE * GLYPH_MIN_SIZE)) #define N_STACK_GLYPHS 512 +#define NO_ATLAS ((PicturePtr)-1) +#define GLYPH_TOLERANCE 3 #define glyph_valid(g) *((uint32_t *)&(g)->info.width) #define glyph_copy_size(r, g) *(uint32_t *)&(r)->width = *(uint32_t *)&g->info.width +#if HAS_PIXMAN_GLYPHS +static pixman_glyph_cache_t *__global_glyph_cache; +#endif + #if HAS_DEBUG_FULL static void _assert_pixmap_contains_box(PixmapPtr pixmap, BoxPtr box, const char *function) { @@ -165,12 +172,6 @@ FreePicture(render->white_picture, 0); render->white_picture = NULL; } -#if HAS_PIXMAN_GLYPHS - if (render->glyph_cache) { - pixman_glyph_cache_destroy(render->glyph_cache); - render->glyph_cache = NULL; - } -#endif } /* All caches for a single format share a single pixmap for glyph storage, @@ -196,9 +197,11 @@ DBG(("%s\n", __FUNCTION__)); #if HAS_PIXMAN_GLYPHS - sna->render.glyph_cache = pixman_glyph_cache_create(); - if (sna->render.glyph_cache == NULL) - goto bail; + if (__global_glyph_cache == NULL) { + __global_glyph_cache = pixman_glyph_cache_create(); + if (__global_glyph_cache == NULL) + goto bail; + } #endif sna->render.white_image = pixman_image_create_solid_fill(&white); @@ -245,6 +248,7 @@ priv = sna_pixmap(pixmap); if (priv != NULL) { /* Prevent the cache from ever being paged out */ + assert(priv->gpu_bo); priv->pinned = PIN_SCANOUT; component_alpha = NeedsComponent(pPictFormat->format); @@ -350,6 +354,20 @@ extents->y2 = y2 < MAXSHORT ? y2 : MAXSHORT; } +#if HAS_DEBUG_FULL +static int +glyph_count(int nlist, + GlyphListPtr list) +{ + int count = 0; + while (nlist--) { + count += list->len; + list++; + } + return count; +} +#endif + static inline unsigned int glyph_size_to_count(int size) { @@ -379,8 +397,7 @@ struct sna_glyph *p; int size, mask, pos, s; - if (NO_GLYPH_CACHE) - return false; + assert(glyph_valid(glyph)); glyph_picture = GetGlyphPicture(glyph, screen); if (unlikely(glyph_picture == NULL)) { @@ -388,7 +405,8 @@ return false; } - if (glyph->info.width > GLYPH_MAX_SIZE || + if (NO_GLYPH_CACHE || + glyph->info.width > GLYPH_MAX_SIZE || glyph->info.height > GLYPH_MAX_SIZE) { PixmapPtr pixmap = (PixmapPtr)glyph_picture->pDrawable; assert(glyph_picture->pDrawable->type == DRAWABLE_PIXMAP); @@ -396,7 +414,12 @@ pixmap->usage_hint = 0; sna_pixmap_force_to_gpu(pixmap, MOVE_READ); } - return false; + + /* no cache for this glyph */ + p = sna_glyph(glyph); + p->atlas = glyph_picture; + p->coordinate.x = p->coordinate.y = 0; + return true; } for (size = GLYPH_MIN_SIZE; size <= GLYPH_MAX_SIZE; size *= 2) @@ -527,7 +550,15 @@ if (dst->pCompositeClip->data == NULL && region_matches_pixmap(dst->pCompositeClip, get_drawable_pixmap(dst->pDrawable))) { - DBG(("%s: no, region matches drawable\n", __FUNCTION__)); + DBG(("%s: no, clip region (%d, %d), (%d, %d) matches drawable pixmap=%ld size=%dx%d\n", + __FUNCTION__, + dst->pCompositeClip->extents.x1, + dst->pCompositeClip->extents.y1, + dst->pCompositeClip->extents.x2, + dst->pCompositeClip->extents.y2, + get_drawable_pixmap(dst->pDrawable), + get_drawable_pixmap(dst->pDrawable)->drawable.width, + get_drawable_pixmap(dst->pDrawable)->drawable.height)); return false; } @@ -538,8 +569,8 @@ box.y1 += dst->pDrawable->y; box.y2 += dst->pDrawable->y; - DBG(("%s? glyph extents (%d, %d), (%d, %d), region (%d, %d), (%d, %d): %s\n", - __FUNCTION__, box.x1, box.y1, box.x2, box.y2, + DBG(("%s? %d glyph in %d lists extents (%d, %d), (%d, %d), region (%d, %d), (%d, %d): %s\n", + __FUNCTION__, glyph_count(nlist, list), nlist, box.x1, box.y1, box.x2, box.y2, dst->pCompositeClip->extents.x1, dst->pCompositeClip->extents.y1, dst->pCompositeClip->extents.x2, dst->pCompositeClip->extents.y2, pixman_region_contains_rectangle(dst->pCompositeClip, @@ -560,7 +591,7 @@ struct sna_composite_op tmp; ScreenPtr screen = dst->pDrawable->pScreen; PicturePtr glyph_atlas; - BoxPtr rects; + const BoxRec *rects; int nrect; int16_t x, y; @@ -574,8 +605,8 @@ list->xOff, list->yOff, dst->pDrawable->x, dst->pDrawable->y)); if (clipped_glyphs(dst, nlist, list, glyphs)) { - rects = REGION_RECTS(dst->pCompositeClip); - nrect = REGION_NUM_RECTS(dst->pCompositeClip); + rects = region_rects(dst->pCompositeClip); + nrect = region_num_rects(dst->pCompositeClip); } else nrect = 0; @@ -603,15 +634,9 @@ tmp.done(sna, &tmp); glyph_atlas = NULL; } - if (!glyph_cache(screen, &sna->render, glyph)) { - /* no cache for this glyph */ - p->atlas = GetGlyphPicture(glyph, screen); - if (unlikely(p->atlas == NULL)) { - glyph->info.width = glyph->info.height = 0; - goto next_glyph; - } - p->coordinate.x = p->coordinate.y = 0; - } + + if (!glyph_cache(screen, &sna->render, glyph)) + goto next_glyph; } if (p->atlas != glyph_atlas) { @@ -722,8 +747,8 @@ { struct sna_composite_op tmp; ScreenPtr screen = dst->pDrawable->pScreen; - PicturePtr glyph_atlas; - BoxPtr rects; + PicturePtr glyph_atlas = NO_ATLAS; + const BoxRec *rects; int nrect; int x, y; @@ -736,64 +761,52 @@ __FUNCTION__, op, src_x, src_y, nlist, list->xOff, list->yOff, dst->pDrawable->x, dst->pDrawable->y)); - if (clipped_glyphs(dst, nlist, list, glyphs)) { - rects = REGION_RECTS(dst->pCompositeClip); - nrect = REGION_NUM_RECTS(dst->pCompositeClip); - } else - nrect = 0; - x = dst->pDrawable->x; y = dst->pDrawable->y; src_x -= list->xOff + x; src_y -= list->yOff + y; - glyph_atlas = NULL; - while (nlist--) { - int n = list->len; - x += list->xOff; - y += list->yOff; - while (n--) { - GlyphPtr glyph = *glyphs++; - struct sna_glyph *p; - int i; + if (clipped_glyphs(dst, nlist, list, glyphs)) { + rects = region_rects(dst->pCompositeClip); + nrect = region_num_rects(dst->pCompositeClip); + if (nrect == 0) + return true; - p = sna_glyph0(glyph); - if (unlikely(p->atlas == NULL)) { - if (unlikely(!glyph_valid(glyph))) - goto next_glyph; + while (nlist--) { + int n = list->len; + x += list->xOff; + y += list->yOff; + while (n--) { + GlyphPtr glyph = *glyphs++; + struct sna_glyph *p = sna_glyph0(glyph); + int i, xi, yi; + + if (unlikely(p->atlas != glyph_atlas)) { + if (unlikely(!glyph_valid(glyph))) + goto next_glyph_N; + + if (glyph_atlas != NO_ATLAS) { + tmp.done(sna, &tmp); + glyph_atlas = NO_ATLAS; + } - if (glyph_atlas) { - tmp.done(sna, &tmp); - glyph_atlas = NULL; - } - if (!glyph_cache(screen, &sna->render, glyph)) { - /* no cache for this glyph */ - p->atlas = GetGlyphPicture(glyph, screen); if (unlikely(p->atlas == NULL)) { - glyph->info.width = glyph->info.height = 0; - goto next_glyph; + if (!glyph_cache(screen, &sna->render, glyph)) + goto next_glyph_N; } - p->coordinate.x = p->coordinate.y = 0; - } - } - if (p->atlas != glyph_atlas) { - if (glyph_atlas) - tmp.done(sna, &tmp); + if (!sna->render.composite(sna, + op, src, p->atlas, dst, + 0, 0, 0, 0, 0, 0, + 0, 0, + COMPOSITE_PARTIAL, &tmp)) + goto next_glyph_N; - if (!sna->render.composite(sna, - op, src, p->atlas, dst, - 0, 0, 0, 0, 0, 0, - 0, 0, - COMPOSITE_PARTIAL, &tmp)) - return false; - - glyph_atlas = p->atlas; - } + glyph_atlas = p->atlas; + } - if (nrect) { - int xi = x - glyph->info.x; - int yi = y - glyph->info.y; + xi = x - glyph->info.x; + yi = y - glyph->info.y; if (xi < dst->pCompositeClip->extents.x2 && yi < dst->pCompositeClip->extents.y2 && @@ -844,32 +857,68 @@ } } } - } else { - struct sna_composite_rectangles r; - r.dst.x = x - glyph->info.x; - r.dst.y = y - glyph->info.y; - r.src.x = r.dst.x + src_x; - r.src.y = r.dst.y + src_y; - r.mask = p->coordinate; - glyph_copy_size(&r, glyph); +next_glyph_N: + x += glyph->info.xOff; + y += glyph->info.yOff; + } + list++; + } + } else while (nlist--) { + int n = list->len; + x += list->xOff; + y += list->yOff; + while (n--) { + GlyphPtr glyph = *glyphs++; + struct sna_glyph *p = sna_glyph0(glyph); + struct sna_composite_rectangles r; - DBG(("%s: glyph=(%d, %d)x(%d, %d), unclipped\n", - __FUNCTION__, - r.dst.x, r.dst.y, - r.width, r.height)); + if (unlikely(p->atlas != glyph_atlas)) { + if (unlikely(!glyph_valid(glyph))) + goto next_glyph_0; - tmp.blt(sna, &tmp, &r); - apply_damage_clipped_to_dst(&tmp, &r, dst->pDrawable); + if (glyph_atlas != NO_ATLAS) { + tmp.done(sna, &tmp); + glyph_atlas = NO_ATLAS; + } + + if (unlikely(p->atlas == NULL)) { + if (!glyph_cache(screen, &sna->render, glyph)) + goto next_glyph_0; + } + + if (!sna->render.composite(sna, + op, src, p->atlas, dst, + 0, 0, 0, 0, 0, 0, + 0, 0, + COMPOSITE_PARTIAL, &tmp)) + goto next_glyph_0; + + glyph_atlas = p->atlas; } -next_glyph: + r.dst.x = x - glyph->info.x; + r.dst.y = y - glyph->info.y; + r.src.x = r.dst.x + src_x; + r.src.y = r.dst.y + src_y; + r.mask = p->coordinate; + glyph_copy_size(&r, glyph); + + DBG(("%s: glyph=(%d, %d)x(%d, %d), unclipped\n", + __FUNCTION__, + r.dst.x, r.dst.y, + r.width, r.height)); + + tmp.blt(sna, &tmp, &r); + apply_damage_clipped_to_dst(&tmp, &r, dst->pDrawable); + +next_glyph_0: x += glyph->info.xOff; y += glyph->info.yOff; } list++; } - if (glyph_atlas) + if (glyph_atlas != NO_ATLAS) tmp.done(sna, &tmp); return true; @@ -906,7 +955,7 @@ while (n--) { GlyphPtr glyph = *glyphs++; struct sna_glyph *p; - BoxPtr rects; + const BoxRec *rects; BoxRec box; int nrect; @@ -924,15 +973,8 @@ if (unlikely(!glyph_valid(glyph))) goto next_glyph; - if (!glyph_cache(screen, &sna->render, glyph)) { - /* no cache for this glyph */ - p->atlas = GetGlyphPicture(glyph, screen); - if (unlikely(p->atlas == NULL)) { - glyph->info.width = glyph->info.height = 0; - goto next_glyph; - } - p->coordinate.x = p->coordinate.y = 0; - } + if (!glyph_cache(screen, &sna->render, glyph)) + goto next_glyph; } DBG(("%s: glyph=(%d, %d)x(%d, %d), src=(%d, %d), mask=(%d, %d)\n", @@ -957,8 +999,8 @@ COMPOSITE_PARTIAL, memset(&tmp, 0, sizeof(tmp)))) return false; - rects = REGION_RECTS(dst->pCompositeClip); - nrect = REGION_NUM_RECTS(dst->pCompositeClip); + rects = region_rects(dst->pCompositeClip); + nrect = region_num_rects(dst->pCompositeClip); do { struct sna_composite_rectangles r; int16_t x2, y2; @@ -1030,6 +1072,8 @@ PicturePtr p; int dx, dy; + DBG(("%s: creating image cache for glyph %p (on screen %d)\n", __FUNCTION__, g, s->myNum)); + p = GetGlyphPicture(g, s); if (unlikely(p == NULL)) return NULL; @@ -1054,6 +1098,17 @@ return image; } +static inline bool use_small_mask(struct sna *sna, int16_t width, int16_t height, int depth) +{ + if (FORCE_SMALL_MASK) + return FORCE_SMALL_MASK > 0; + + if (depth * width * height < 8 * 4096) + return true; + + return too_large(sna, width, height); +} + flatten static bool glyphs_via_mask(struct sna *sna, CARD8 op, @@ -1064,10 +1119,9 @@ int nlist, GlyphListPtr list, GlyphPtr *glyphs) { ScreenPtr screen = dst->pDrawable->pScreen; - struct sna_composite_op tmp; CARD32 component_alpha; PixmapPtr pixmap; - PicturePtr glyph_atlas, mask; + PicturePtr mask; int16_t x, y, width, height; int error; bool ret = false; @@ -1084,8 +1138,8 @@ if (box.x2 <= box.x1 || box.y2 <= box.y1) return true; - DBG(("%s: bounds=((%d, %d), (%d, %d))\n", __FUNCTION__, - box.x1, box.y1, box.x2, box.y2)); + DBG(("%s: nlist=%d, count=%d, bounds=((%d, %d), (%d, %d))\n", __FUNCTION__, + nlist, glyph_count(nlist, list), box.x1, box.y1, box.x2, box.y2)); if (!sna_compute_composite_extents(&box, src, NULL, dst, @@ -1115,11 +1169,10 @@ } component_alpha = NeedsComponent(format->format); - if (!NO_SMALL_MASK && - ((uint32_t)width * height * format->depth < 8 * 4096 || - too_large(sna, width, height))) { + if (use_small_mask(sna, width, height, format->depth)) { pixman_image_t *mask_image; +use_small_mask: DBG(("%s: small mask [format=%lx, depth=%d, size=%d], rendering glyphs to upload buffer\n", __FUNCTION__, (unsigned long)format->format, format->depth, (uint32_t)width*height*format->depth)); @@ -1146,15 +1199,11 @@ memset(pixmap->devPrivate.ptr, 0, pixmap->devKind*height); #if HAS_PIXMAN_GLYPHS - if (sna->render.glyph_cache) { + if (__global_glyph_cache) { pixman_glyph_t stack_glyphs[N_STACK_GLYPHS]; pixman_glyph_t *pglyphs = stack_glyphs; - pixman_glyph_cache_t *cache; int count, n; - cache = sna->render.glyph_cache; - pixman_glyph_cache_freeze(cache); - count = 0; for (n = 0; n < nlist; ++n) count += list[n].len; @@ -1164,6 +1213,7 @@ goto err_pixmap; } + pixman_glyph_cache_freeze(__global_glyph_cache); count = 0; do { n = list->len; @@ -1176,7 +1226,7 @@ if (!glyph_valid(g)) goto next_pglyph; - ptr = pixman_glyph_cache_lookup(cache, g, NULL); + ptr = pixman_glyph_cache_lookup(__global_glyph_cache, g, NULL); if (ptr == NULL) { pixman_image_t *glyph_image; @@ -1184,7 +1234,8 @@ if (glyph_image == NULL) goto next_pglyph; - ptr = pixman_glyph_cache_insert(cache, g, NULL, + DBG(("%s: inserting glyph %p into pixman cache\n", __FUNCTION__, g)); + ptr = pixman_glyph_cache_insert(__global_glyph_cache, g, NULL, g->info.x, g->info.y, glyph_image); @@ -1192,6 +1243,8 @@ goto next_pglyph; } + assert(sna_glyph_get_image(g, screen) != NULL); + pglyphs[count].x = x; pglyphs[count].y = y; pglyphs[count].glyph = ptr; @@ -1209,8 +1262,8 @@ mask_image, 0, 0, 0, 0, - cache, count, pglyphs); - pixman_glyph_cache_thaw(cache); + __global_glyph_cache, count, pglyphs); + pixman_glyph_cache_thaw(__global_glyph_cache); if (pglyphs != stack_glyphs) free(pglyphs); } else @@ -1290,11 +1343,16 @@ ValidatePicture(mask); } else { + struct sna_composite_op tmp; + PicturePtr glyph_atlas = NO_ATLAS; + pixmap = screen->CreatePixmap(screen, width, height, format->depth, SNA_CREATE_SCRATCH); if (!pixmap) - return false; + goto use_small_mask; + + assert(__sna_pixmap_get_bo(pixmap)); mask = CreatePicture(0, &pixmap->drawable, format, CPComponentAlpha, @@ -1306,40 +1364,30 @@ if (!clear_pixmap(sna, pixmap)) goto err_mask; - glyph_atlas = NULL; do { int n = list->len; x += list->xOff; y += list->yOff; while (n--) { GlyphPtr glyph = *glyphs++; - struct sna_glyph *p; + struct sna_glyph *p = sna_glyph(glyph); struct sna_composite_rectangles r; - p = sna_glyph(glyph); - if (unlikely(p->atlas == NULL)) { + if (unlikely(p->atlas != glyph_atlas)) { + bool ok; + if (unlikely(!glyph_valid(glyph))) goto next_glyph; - if (glyph_atlas) { + if (glyph_atlas != NO_ATLAS) { tmp.done(sna, &tmp); - glyph_atlas = NULL; + glyph_atlas = NO_ATLAS; } - if (!glyph_cache(screen, &sna->render, glyph)) { - /* no cache for this glyph */ - p->atlas = GetGlyphPicture(glyph, screen); - if (unlikely(p->atlas == NULL)) { - glyph->info.width = glyph->info.height = 0; + + if (unlikely(p->atlas == NULL)) { + if (!glyph_cache(screen, &sna->render, glyph)) goto next_glyph; - } - p->coordinate.x = p->coordinate.y = 0; } - } - if (p->atlas != glyph_atlas) { - bool ok; - - if (glyph_atlas) - tmp.done(sna, &tmp); DBG(("%s: atlas format=%08x, mask format=%08x\n", __FUNCTION__, @@ -1388,7 +1436,7 @@ } list++; } while (--nlist); - if (glyph_atlas) + if (glyph_atlas != NO_ATLAS) tmp.done(sna, &tmp); } @@ -1421,9 +1469,8 @@ return NULL; } - x = 0; - y = 0; - for (i = 0; i < nlist; i++) { + x = y = 0; i = 0; + while (nlist--) { BoxRec extents; bool first = true; int n = list->len; @@ -1434,12 +1481,11 @@ * If we overlap then we cannot substitute a mask as the * rendering will be altered. */ - extents.x1 = 0; - extents.y1 = 0; - extents.x2 = 0; - extents.y2 = 0; - if (format->format != list->format->format) { + DBG(("%s: switching formats from %x to %x\n", + __FUNCTION__, + (unsigned)format->format, + (unsigned)list->format->format)); format = NULL; goto out; } @@ -1472,8 +1518,14 @@ * boundary is small, yet glyphs frequently * overlap on the boundaries. */ - if (x1 < extents.x2-1 && x2 > extents.x1+1 && - y1 < extents.y2-1 && y2 > extents.y1+1) { + if (x1 < extents.x2-GLYPH_TOLERANCE && + x2 > extents.x1+GLYPH_TOLERANCE && + y1 < extents.y2-GLYPH_TOLERANCE && + y2 > extents.y1+GLYPH_TOLERANCE) { + DBG(("%s: overlapping glyph inside line, current bbox (%d, %d), (%d, %d), glyph (%d, %d), (%d, %d)\n", + __FUNCTION__, + extents.x1, extents.y1, extents.x2, extents.y2, + x1, y1, x2, y2)); format = NULL; goto out; } @@ -1496,16 +1548,23 @@ * the number of lists to be small, so just keep a list * of the previous boxes and walk those. */ - for (j = 0; j < i; j++) { - if (extents.x1 < list_extents[j].x2-1 && - extents.x2 > list_extents[j].x1+1 && - extents.y1 < list_extents[j].y2-1 && - extents.y2 > list_extents[j].y1+1) { - format = NULL; - goto out; + if (!first) { + for (j = 0; j < i; j++) { + if (extents.x1 < list_extents[j].x2-GLYPH_TOLERANCE && + extents.x2 > list_extents[j].x1+GLYPH_TOLERANCE && + extents.y1 < list_extents[j].y2-GLYPH_TOLERANCE && + extents.y2 > list_extents[j].y1+GLYPH_TOLERANCE) { + DBG(("%s: overlapping lines, current bbox (%d, %d), (%d, %d), previous line (%d, %d), (%d, %d)\n", + __FUNCTION__, + extents.x1, extents.y1, extents.x2, extents.y2, + list_extents[j].x1, list_extents[j].y1, + list_extents[j].x2, list_extents[j].y2)); + format = NULL; + goto out; + } } + list_extents[i++] = extents; } - list_extents[i] = extents; } out: @@ -1523,6 +1582,11 @@ if (NO_DISCARD_MASK) return false; + DBG(("%s: nlist=%d, mask=%08x, depth %d, op=%d (bounded? %d)\n", + __FUNCTION__, nlist, + mask ? (unsigned)mask->format : 0, mask ? mask->depth : 0, + op, op_is_bounded(op))); + if (nlist == 1 && list->len == 1) return true; @@ -1534,6 +1598,9 @@ if (mask == g) return true; + DBG(("%s: preferred mask format %08x, depth %d\n", + __FUNCTION__, g ? (unsigned)g->format : 0, g ? g->depth : 0)); + /* Otherwise if the glyphs are all bitmaps and we have an * opaque source we can also render directly to the dst. */ @@ -1574,18 +1641,18 @@ int x, y, n; glyph_extents(nlist, list, glyphs, ®ion.extents); + DBG(("%s: nlist=%d, count=%d, extents (%d, %d), (%d, %d)\n", __FUNCTION__, + nlist, glyph_count(nlist, list), + region.extents.x1, region.extents.y1, + region.extents.x2, region.extents.y2)); + if (region.extents.x2 <= region.extents.x1 || region.extents.y2 <= region.extents.y1) return; - DBG(("%s: (%d, %d), (%d, %d)\n", __FUNCTION__, - region.extents.x1, region.extents.y1, - region.extents.x2, region.extents.y2)); - region.data = NULL; RegionTranslate(®ion, dst->pDrawable->x, dst->pDrawable->y); - if (dst->pCompositeClip) - RegionIntersect(®ion, ®ion, dst->pCompositeClip); + RegionIntersect(®ion, ®ion, dst->pCompositeClip); DBG(("%s: clipped extents (%d, %d), (%d, %d)\n", __FUNCTION__, RegionExtents(®ion)->x1, RegionExtents(®ion)->y1, @@ -1620,20 +1687,19 @@ } #if HAS_PIXMAN_GLYPHS - if (sna->render.glyph_cache) { + if (__global_glyph_cache) { pixman_glyph_t stack_glyphs[N_STACK_GLYPHS]; pixman_glyph_t *pglyphs = stack_glyphs; - pixman_glyph_cache_t *cache = sna->render.glyph_cache; int dst_x = list->xOff, dst_y = list->yOff; int dst_dx, dst_dy, count; - pixman_glyph_cache_freeze(cache); + pixman_glyph_cache_freeze(__global_glyph_cache); count = 0; for (n = 0; n < nlist; ++n) count += list[n].len; if (count > N_STACK_GLYPHS) { - pglyphs = malloc (count * sizeof(pixman_glyph_t)); + pglyphs = malloc(count * sizeof(pixman_glyph_t)); if (pglyphs == NULL) goto out; } @@ -1651,7 +1717,7 @@ if (!glyph_valid(g)) goto next; - ptr = pixman_glyph_cache_lookup(cache, g, NULL); + ptr = pixman_glyph_cache_lookup(__global_glyph_cache, g, NULL); if (ptr == NULL) { pixman_image_t *glyph_image; @@ -1659,14 +1725,17 @@ if (glyph_image == NULL) goto next; - ptr = pixman_glyph_cache_insert(cache, g, NULL, + DBG(("%s: inserting glyph %p into pixman cache\n", __FUNCTION__, g)); + ptr = pixman_glyph_cache_insert(__global_glyph_cache, g, NULL, g->info.x, g->info.y, glyph_image); if (ptr == NULL) - goto out; + goto next; } + assert(sna_glyph_get_image(g, screen) != NULL); + pglyphs[count].x = x; pglyphs[count].y = y; pglyphs[count].glyph = ptr; @@ -1679,6 +1748,9 @@ list++; } + if (count == 0) + goto out; + src_image = image_from_pict(src, FALSE, &src_dx, &src_dy); if (src_image == NULL) goto out; @@ -1697,12 +1769,12 @@ region.extents.x1 + dst_dx, region.extents.y1 + dst_dy, region.extents.x2 - region.extents.x1, region.extents.y2 - region.extents.y1, - cache, count, pglyphs); + __global_glyph_cache, count, pglyphs); } else { pixman_composite_glyphs_no_mask(op, src_image, dst_image, src_x + src_dx - dst_x, src_y + src_dy - dst_y, dst_dx, dst_dy, - cache, count, pglyphs); + __global_glyph_cache, count, pglyphs); } sigtrap_put(); } @@ -1713,7 +1785,7 @@ free_pixman_pict(src, src_image); out: - pixman_glyph_cache_thaw(cache); + pixman_glyph_cache_thaw(__global_glyph_cache); if (pglyphs != stack_glyphs) free(pglyphs); } else @@ -1894,7 +1966,7 @@ DBG(("%s(op=%d, nlist=%d, src=(%d, %d))\n", __FUNCTION__, op, nlist, src_x, src_y)); - if (REGION_NUM_RECTS(dst->pCompositeClip) == 0) + if (RegionNil(dst->pCompositeClip)) return; if (FALLBACK) @@ -1916,15 +1988,15 @@ goto fallback; } - if ((too_small(priv) || DAMAGE_IS_ALL(priv->cpu_damage)) && - !picture_is_gpu(sna, src)) { + if (!is_gpu_dst(priv) && !picture_is_gpu(sna, src, 0)) { DBG(("%s: fallback -- too small (%dx%d)\n", __FUNCTION__, dst->pDrawable->width, dst->pDrawable->height)); goto fallback; } /* Try to discard the mask for non-overlapping glyphs */ - if (mask == NULL || + if (FORCE_GLYPHS_TO_DST || + mask == NULL || (dst->pCompositeClip->data == NULL && can_discard_mask(op, src, mask, nlist, list, glyphs))) { DBG(("%s: discarding mask\n", __FUNCTION__)); @@ -1996,8 +2068,8 @@ if (box.x2 <= box.x1 || box.y2 <= box.y1) return true; - DBG(("%s: bounds=((%d, %d), (%d, %d))\n", __FUNCTION__, - box.x1, box.y1, box.x2, box.y2)); + DBG(("%s: nlist=%d, count=%d, bounds=((%d, %d), (%d, %d))\n", __FUNCTION__, + nlist, glyph_count(nlist, list), box.x1, box.y1, box.x2, box.y2)); if (!sna_compute_composite_extents(&box, src, NULL, dst, @@ -2052,24 +2124,21 @@ memset(pixmap->devPrivate.ptr, 0, pixmap->devKind*height); #if HAS_PIXMAN_GLYPHS - if (sna->render.glyph_cache) { + if (__global_glyph_cache) { pixman_glyph_t stack_glyphs[N_STACK_GLYPHS]; pixman_glyph_t *pglyphs = stack_glyphs; - pixman_glyph_cache_t *cache; int count, n; - cache = sna->render.glyph_cache; - pixman_glyph_cache_freeze(cache); - count = 0; for (n = 0; n < nlist; ++n) count += list[n].len; if (count > N_STACK_GLYPHS) { - pglyphs = malloc (count * sizeof(pixman_glyph_t)); + pglyphs = malloc(count * sizeof(pixman_glyph_t)); if (pglyphs == NULL) goto err_pixmap; } + pixman_glyph_cache_freeze(__global_glyph_cache); count = 0; do { n = list->len; @@ -2082,7 +2151,7 @@ if (!glyph_valid(g)) goto next_pglyph; - ptr = pixman_glyph_cache_lookup(cache, g, NULL); + ptr = pixman_glyph_cache_lookup(__global_glyph_cache, g, NULL); if (ptr == NULL) { pixman_image_t *glyph_image; @@ -2090,7 +2159,8 @@ if (glyph_image == NULL) goto next_pglyph; - ptr = pixman_glyph_cache_insert(cache, g, NULL, + DBG(("%s: inserting glyph %p into pixman cache\n", __FUNCTION__, g)); + ptr = pixman_glyph_cache_insert(__global_glyph_cache, g, NULL, g->info.x, g->info.y, glyph_image); @@ -2098,6 +2168,8 @@ goto next_pglyph; } + assert(sna_glyph_get_image(g, screen) != NULL); + pglyphs[count].x = x; pglyphs[count].y = y; pglyphs[count].glyph = ptr; @@ -2115,8 +2187,8 @@ mask_image, 0, 0, 0, 0, - cache, count, pglyphs); - pixman_glyph_cache_thaw(cache); + __global_glyph_cache, count, pglyphs); + pixman_glyph_cache_thaw(__global_glyph_cache); if (pglyphs != stack_glyphs) free(pglyphs); } else @@ -2144,8 +2216,7 @@ yi + g->info.height <= 0) goto next_image; - glyph_image = - sna_glyph_get_image(g, dst->pDrawable->pScreen); + glyph_image = sna_glyph_get_image(g, screen); if (glyph_image == NULL) goto next_image; @@ -2225,7 +2296,7 @@ DBG(("%s(op=%d, nlist=%d, src=(%d, %d))\n", __FUNCTION__, op, nlist, src_x, src_y)); - if (REGION_NUM_RECTS(dst->pCompositeClip) == 0) + if (RegionNil(dst->pCompositeClip)) return; if (FALLBACK) @@ -2247,8 +2318,7 @@ goto fallback; } - if ((too_small(priv) || DAMAGE_IS_ALL(priv->cpu_damage)) && - !picture_is_gpu(sna, src)) { + if (!is_gpu_dst(priv) && !picture_is_gpu(sna, src, 0)) { DBG(("%s: fallback -- too small (%dx%d)\n", __FUNCTION__, dst->pDrawable->width, dst->pDrawable->height)); goto fallback; @@ -2275,15 +2345,18 @@ { struct sna_glyph *p = sna_glyph(glyph); - DBG(("%s: screen=%d, glyph(image?=%d, atlas?=%d)\n", - __FUNCTION__, screen->myNum, !!p->image, !!p->atlas)); + DBG(("%s: screen=%d, glyph=%p (image?=%d, atlas?=%d)\n", + __FUNCTION__, screen->myNum, glyph, !!p->image, + p->atlas && p->atlas != GetGlyphPicture(glyph, screen))); if (p->image) { #if HAS_PIXMAN_GLYPHS - struct sna *sna = to_sna_from_screen(screen); - if (sna->render.glyph_cache) - pixman_glyph_cache_remove(sna->render.glyph_cache, + if (__global_glyph_cache) { + DBG(("%s: removing glyph %p from pixman cache\n", + __FUNCTION__, glyph)); + pixman_glyph_cache_remove(__global_glyph_cache, glyph, NULL); + } #endif pixman_image_unref(p->image); p->image = NULL; @@ -2298,4 +2371,9 @@ cache->glyphs[p->pos >> 1] = NULL; p->atlas = NULL; } + +#if HAS_PIXMAN_GLYPHS + assert(__global_glyph_cache == NULL || + pixman_glyph_cache_lookup(__global_glyph_cache, glyph, NULL) == NULL); +#endif } diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna.h xserver-xorg-video-intel-2.99.914/src/sna/sna.h --- xserver-xorg-video-intel-2.99.910/src/sna/sna.h 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna.h 2014-07-23 11:57:21.000000000 +0000 @@ -61,10 +61,14 @@ #include #include -#ifdef HAVE_DRI2_H +#if HAVE_DRI2 #include #endif +#if HAVE_DRI3 +#include +#endif + #if HAVE_UDEV #include #endif @@ -106,10 +110,11 @@ #include "sna_render.h" #include "fb/fb.h" -#define SNA_CURSOR_X 64 -#define SNA_CURSOR_Y SNA_CURSOR_X +struct sna_cursor; +struct sna_crtc; struct sna_client { + struct list events; int is_compositor; /* only 4 bits used */ }; @@ -144,7 +149,7 @@ uint32_t clear_color; #define SOURCE_BIAS 4 - uint16_t source_count; + uint8_t source_count; uint8_t pinned :4; #define PIN_SCANOUT 0x1 #define PIN_DRI2 0x2 @@ -155,13 +160,16 @@ #define MAPPED_NONE 0 #define MAPPED_GTT 1 #define MAPPED_CPU 2 - uint8_t flush :1; + uint8_t flush :2; uint8_t shm :1; uint8_t clear :1; uint8_t header :1; uint8_t cpu :1; }; +#define IS_STATIC_PTR(ptr) ((uintptr_t)(ptr) & 1) +#define MAKE_STATIC_PTR(ptr) ((void*)((uintptr_t)(ptr) | 1)) + struct sna_glyph { PicturePtr atlas; struct sna_coordinate coordinate; @@ -233,16 +241,21 @@ ScrnInfoPtr scrn; unsigned flags; -#define SNA_NO_WAIT 0x1 -#define SNA_NO_FLIP 0x2 -#define SNA_NO_VSYNC 0x4 -#define SNA_TRIPLE_BUFFER 0x8 -#define SNA_TEAR_FREE 0x10 -#define SNA_FORCE_SHADOW 0x20 -#define SNA_FLUSH_GTT 0x40 -#define SNA_IS_HOSTED 0x80 -#define SNA_PERFORMANCE 0x100 -#define SNA_POWERSAVE 0x200 +#define SNA_IS_SLAVED 0x1 +#define SNA_IS_HOSTED 0x2 +#define SNA_NO_WAIT 0x10 +#define SNA_NO_FLIP 0x20 +#define SNA_NO_VSYNC 0x40 +#define SNA_TRIPLE_BUFFER 0x80 +#define SNA_TEAR_FREE 0x100 +#define SNA_FORCE_SHADOW 0x200 +#define SNA_FLUSH_GTT 0x400 +#define SNA_PERFORMANCE 0x1000 +#define SNA_POWERSAVE 0x2000 +#define SNA_REMOVE_OUTPUTS 0x4000 +#define SNA_HAS_FLIP 0x10000 +#define SNA_HAS_ASYNC_FLIP 0x20000 +#define SNA_LINEAR_FB 0x40000 #define SNA_REPROBE 0x80000000 unsigned cpu_features; @@ -271,33 +284,84 @@ PixmapPtr freed_pixmap; struct sna_mode { - drmModeResPtr kmode; - DamagePtr shadow_damage; struct kgem_bo *shadow; - int shadow_active; - int shadow_flip; - int front_active; + unsigned front_active; + unsigned shadow_active; + unsigned flip_active; + bool dirty; + + int max_crtc_width, max_crtc_height; + RegionRec shadow_region; + RegionRec shadow_cancel; + struct list shadow_crtc; + bool shadow_dirty; unsigned num_real_crtc; unsigned num_real_output; + unsigned num_real_encoder; unsigned num_fake; + unsigned serial; + + uint32_t *encoders; + +#if HAVE_UDEV + struct udev_monitor *backlight_monitor; + pointer backlight_handler; +#endif } mode; - struct sna_dri { + struct { + struct sna_cursor *cursors; + xf86CursorInfoPtr info; + CursorPtr ref; + + unsigned serial; + uint32_t fg, bg; + int size; + + int last_x; + int last_y; + + unsigned max_size; + bool use_gtt; + + int num_stash; + struct sna_cursor *stash; + void *scratch; + } cursor; + + struct sna_dri2 { + bool available; + bool open; + +#if HAVE_DRI2 void *flip_pending; - } dri; + unsigned client_count; +#endif + } dri2; + + struct sna_dri3 { + bool available; + bool open; +#if HAVE_DRI3 + SyncScreenCreateFenceFunc create_fence; + struct list pixmaps; +#endif + } dri3; + + struct sna_present { + bool available; + bool open; +#if HAVE_PRESENT +#endif + } present; struct sna_xv { XvAdaptorPtr adaptors; int num_adaptors; } xv; - unsigned int tiling; -#define SNA_TILING_FB 0x1 -#define SNA_TILING_2D 0x2 -#define SNA_TILING_ALL (~0) - EntityInfoPtr pEnt; const struct intel_device_info *info; @@ -322,9 +386,6 @@ struct gen8_render_state gen8; } render_state; - bool dri_available; - bool dri_open; - /* Broken-out options. */ OptionInfoPtr Options; @@ -358,18 +419,32 @@ bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna); bool sna_mode_fake_init(struct sna *sna, int num_fake); +bool sna_mode_wants_tear_free(struct sna *sna); void sna_mode_adjust_frame(struct sna *sna, int x, int y); -extern void sna_mode_update(struct sna *sna); +extern void sna_mode_discover(struct sna *sna); +extern void sna_mode_check(struct sna *sna); extern void sna_mode_reset(struct sna *sna); extern void sna_mode_wakeup(struct sna *sna); extern void sna_mode_redisplay(struct sna *sna); +extern void sna_shadow_set_crtc(struct sna *sna, xf86CrtcPtr crtc, struct kgem_bo *bo); +extern void sna_shadow_unset_crtc(struct sna *sna, xf86CrtcPtr crtc); +extern bool sna_pixmap_discard_shadow_damage(struct sna_pixmap *priv, + const RegionRec *region); extern void sna_mode_close(struct sna *sna); extern void sna_mode_fini(struct sna *sna); +extern void sna_crtc_config_notify(ScreenPtr screen); + +extern bool sna_cursors_init(ScreenPtr screen, struct sna *sna); + +typedef void (*sna_flip_handler_t)(struct sna *sna, + struct drm_event_vblank *e, + void *data); + extern int sna_page_flip(struct sna *sna, struct kgem_bo *bo, - void *data, - int ref_crtc_hw_id); + sna_flip_handler_t handler, + void *data); pure static inline struct sna * to_sna(ScrnInfoPtr scrn) @@ -424,24 +499,83 @@ extern bool sna_wait_for_scanline(struct sna *sna, PixmapPtr pixmap, xf86CrtcPtr crtc, const BoxRec *clip); -#if HAVE_DRI2_H -bool sna_dri_open(struct sna *sna, ScreenPtr pScreen); -void sna_dri_page_flip_handler(struct sna *sna, struct drm_event_vblank *event); -void sna_dri_vblank_handler(struct sna *sna, struct drm_event_vblank *event); -void sna_dri_destroy_window(WindowPtr win); -void sna_dri_close(struct sna *sna, ScreenPtr pScreen); +xf86CrtcPtr sna_mode_first_crtc(struct sna *sna); + +const struct ust_msc { + uint64_t msc; + int tv_sec; + int tv_usec; +} *sna_crtc_last_swap(xf86CrtcPtr crtc); + +uint64_t sna_crtc_record_swap(xf86CrtcPtr crtc, + int tv_sec, int tv_usec, unsigned seq); + +static inline uint64_t sna_crtc_record_vblank(xf86CrtcPtr crtc, + const union drm_wait_vblank *vbl) +{ + return sna_crtc_record_swap(crtc, + vbl->reply.tval_sec, + vbl->reply.tval_usec, + vbl->reply.sequence); +} + +static inline uint64_t sna_crtc_record_event(xf86CrtcPtr crtc, + struct drm_event_vblank *event) +{ + return sna_crtc_record_swap(crtc, + event->tv_sec, + event->tv_usec, + event->sequence); +} + +static inline uint64_t ust64(int tv_sec, int tv_usec) +{ + return (uint64_t)tv_sec * 1000000 + tv_usec; +} + +#if HAVE_DRI2 +bool sna_dri2_open(struct sna *sna, ScreenPtr pScreen); +void sna_dri2_page_flip_handler(struct sna *sna, struct drm_event_vblank *event); +void sna_dri2_vblank_handler(struct sna *sna, struct drm_event_vblank *event); +void sna_dri2_pixmap_update_bo(struct sna *sna, PixmapPtr pixmap, struct kgem_bo *bo); +void sna_dri2_destroy_window(WindowPtr win); +void sna_dri2_close(struct sna *sna, ScreenPtr pScreen); +#else +static inline bool sna_dri2_open(struct sna *sna, ScreenPtr pScreen) { return false; } +static inline void sna_dri2_page_flip_handler(struct sna *sna, struct drm_event_vblank *event) { } +static inline void sna_dri2_vblank_handler(struct sna *sna, struct drm_event_vblank *event) { } +static inline void sna_dri2_pixmap_update_bo(struct sna *sna, PixmapPtr pixmap, struct kgem_bo *bo) { } +static inline void sna_dri2_destroy_window(WindowPtr win) { } +static inline void sna_dri2_close(struct sna *sna, ScreenPtr pScreen) { } +#endif + +#if HAVE_DRI3 +bool sna_dri3_open(struct sna *sna, ScreenPtr pScreen); +void sna_dri3_close(struct sna *sna, ScreenPtr pScreen); #else -static inline bool sna_dri_open(struct sna *sna, ScreenPtr pScreen) { return false; } -static inline void sna_dri_page_flip_handler(struct sna *sna, struct drm_event_vblank *event) { } -static inline void sna_dri_vblank_handler(struct sna *sna, struct drm_event_vblank *event) { } -static inline void sna_dri_destroy_window(WindowPtr win) { } -static inline void sna_dri_close(struct sna *sna, ScreenPtr pScreen) { } +static inline bool sna_dri3_open(struct sna *sna, ScreenPtr pScreen) { return false; } +static inline void sna_dri3_close(struct sna *sna, ScreenPtr pScreen) { } #endif -void sna_dri_pixmap_update_bo(struct sna *sna, PixmapPtr pixmap); +#if HAVE_PRESENT +bool sna_present_open(struct sna *sna, ScreenPtr pScreen); +void sna_present_update(struct sna *sna); +void sna_present_close(struct sna *sna, ScreenPtr pScreen); +void sna_present_vblank_handler(struct sna *sna, + struct drm_event_vblank *event); +#else +static inline bool sna_present_open(struct sna *sna, ScreenPtr pScreen) { return false; } +static inline void sna_present_update(struct sna *sna) { } +static inline void sna_present_close(struct sna *sna, ScreenPtr pScreen) { } +static inline void sna_present_vblank_handler(struct sna *sna, struct drm_event_vblank *event) { } +#endif + +extern bool sna_crtc_set_sprite_rotation(xf86CrtcPtr crtc, uint32_t rotation); extern int sna_crtc_to_pipe(xf86CrtcPtr crtc); -extern uint32_t sna_crtc_to_plane(xf86CrtcPtr crtc); +extern uint32_t sna_crtc_to_sprite(xf86CrtcPtr crtc); extern uint32_t sna_crtc_id(xf86CrtcPtr crtc); +extern bool sna_crtc_is_on(xf86CrtcPtr crtc); +extern bool sna_crtc_is_transformed(xf86CrtcPtr crtc); CARD32 sna_format_for_depth(int depth); CARD32 sna_render_format_for_depth(int depth); @@ -492,7 +626,7 @@ return 0; } -bool sna_pixmap_attach_to_bo(PixmapPtr pixmap, struct kgem_bo *bo); +struct sna_pixmap *sna_pixmap_attach_to_bo(PixmapPtr pixmap, struct kgem_bo *bo); static inline bool sna_pixmap_is_scanout(struct sna *sna, PixmapPtr pixmap) { return (pixmap == sna->front && @@ -500,6 +634,31 @@ (sna->flags & SNA_NO_WAIT) == 0); } +static inline int sna_max_tile_copy_size(struct sna *sna, struct kgem_bo *src, struct kgem_bo *dst) +{ + int min_object; + int max_size; + + max_size = sna->kgem.aperture_high * PAGE_SIZE; + max_size -= MAX(kgem_bo_size(src), kgem_bo_size(dst)); + if (max_size <= 0) { + DBG(("%s: tiles cannot fit into aperture\n", __FUNCTION__)); + return 0; + } + + if (max_size > sna->kgem.max_copy_tile_size) + max_size = sna->kgem.max_copy_tile_size; + + min_object = MIN(kgem_bo_size(src), kgem_bo_size(dst)) / 2; + if (max_size > min_object) + max_size = min_object; + if (max_size <= 4096) + max_size = 0; + + DBG(("%s: using max tile size of %d\n", __FUNCTION__, max_size)); + return max_size; +} + PixmapPtr sna_pixmap_create_upload(ScreenPtr screen, int width, int height, int depth, unsigned flags); @@ -542,6 +701,7 @@ #define MOVE_WHOLE_HINT 0x20 #define __MOVE_FORCE 0x40 #define __MOVE_DRI 0x80 +#define __MOVE_SCANOUT 0x100 struct sna_pixmap * sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int flags); @@ -586,7 +746,7 @@ #define PREFER_GPU 0x1 #define FORCE_GPU 0x2 #define RENDER_GPU 0x4 -#define IGNORE_CPU 0x8 +#define IGNORE_DAMAGE 0x8 #define REPLACES 0x10 struct kgem_bo * sna_drawable_use_bo(DrawablePtr drawable, unsigned flags, const BoxRec *box, @@ -616,6 +776,14 @@ } static inline bool +box_covers_pixmap(PixmapPtr pixmap, const BoxRec *box) +{ + int w = box->x2 - box->x1; + int h = box->y2 - box->y1; + return pixmap->drawable.width <= w && pixmap->drawable.height <= h; +} + +static inline bool box_inplace(PixmapPtr pixmap, const BoxRec *box) { struct sna *sna = to_sna_from_pixmap(pixmap); @@ -623,6 +791,13 @@ } static inline bool +whole_pixmap_inplace(PixmapPtr pixmap) +{ + struct sna *sna = to_sna_from_pixmap(pixmap); + return ((int)pixmap->drawable.width * (int)pixmap->drawable.height * pixmap->drawable.bitsPerPixel >> 12) >= sna->kgem.half_cpu_cache_pages; +} + +static inline bool region_subsumes_drawable(RegionPtr region, DrawablePtr drawable) { const BoxRec *extents; @@ -637,7 +812,7 @@ } static inline bool -region_subsumes_pixmap(RegionPtr region, PixmapPtr pixmap) +region_subsumes_pixmap(const RegionRec *region, PixmapPtr pixmap) { if (region->data) return false; @@ -676,7 +851,6 @@ (BoxPtr)de) == PIXMAN_REGION_IN; } - static inline bool sna_drawable_is_clear(DrawablePtr d) { @@ -699,7 +873,7 @@ { struct sna_pixmap *priv; - priv = sna_pixmap_force_to_gpu(pixmap, MOVE_READ | MOVE_WRITE); + priv = sna_pixmap_force_to_gpu(pixmap, MOVE_READ); if (!priv) return NULL; @@ -760,10 +934,13 @@ float *x_out, float *y_out, float *z_out); bool sna_transform_is_affine(const PictTransform *t); -bool sna_transform_is_integer_translation(const PictTransform *t, - int16_t *tx, int16_t *ty); bool sna_transform_is_translation(const PictTransform *t, pixman_fixed_t *tx, pixman_fixed_t *ty); +bool sna_transform_is_integer_translation(const PictTransform *t, + int16_t *tx, int16_t *ty); +bool sna_transform_is_imprecise_integer_translation(const PictTransform *t, + int filter, bool precise, + int16_t *tx, int16_t *ty); static inline bool sna_affine_transform_is_rotation(const PictTransform *t) { @@ -817,6 +994,7 @@ void sna_accel_block_handler(struct sna *sna, struct timeval **tv); void sna_accel_wakeup_handler(struct sna *sna); void sna_accel_watch_flush(struct sna *sna, int enable); +void sna_accel_flush(struct sna *sna); void sna_accel_close(struct sna *sna); void sna_accel_free(struct sna *sna); @@ -964,9 +1142,9 @@ inline static bool is_clipped(const RegionRec *r, const DrawableRec *d) { - DBG(("%s: region[%ld]x(%d, %d),(%d, %d) against drawable %dx%d\n", + DBG(("%s: region[%d]x(%d, %d),(%d, %d) against drawable %dx%d\n", __FUNCTION__, - (long)RegionNumRects(r), + region_num_rects(r), r->extents.x1, r->extents.y1, r->extents.x2, r->extents.y2, d->width, d->height)); @@ -1011,8 +1189,10 @@ void sna_threads_init(void); int sna_use_threads (int width, int height, int threshold); -void sna_threads_run(void (*func)(void *arg), void *arg); +void sna_threads_run(int id, void (*func)(void *arg), void *arg); +void sna_threads_trap(int sig); void sna_threads_wait(void); +void sna_threads_kill(void); void sna_image_composite(pixman_op_t op, pixman_image_t *src, @@ -1030,16 +1210,22 @@ extern jmp_buf sigjmp[4]; extern volatile sig_atomic_t sigtrap; -#define sigtrap_assert() assert(sigtrap == 0) +#define sigtrap_assert_inactive() assert(sigtrap == 0) +#define sigtrap_assert_active() assert(sigtrap > 0 && sigtrap <= ARRAY_SIZE(sigjmp)) #define sigtrap_get() sigsetjmp(sigjmp[sigtrap++], 1) static inline void sigtrap_put(void) { - assert(sigtrap > 0); + sigtrap_assert_active(); --sigtrap; } #define RR_Rotate_All (RR_Rotate_0 | RR_Rotate_90 | RR_Rotate_180 | RR_Rotate_270) #define RR_Reflect_All (RR_Reflect_X | RR_Reflect_Y) +#ifndef HAVE_GETLINE +#include +extern int getline(char **line, size_t *len, FILE *file); +#endif + #endif /* _SNA_H */ diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_io.c xserver-xorg-video-intel-2.99.914/src/sna/sna_io.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_io.c 2014-02-01 18:37:13.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_io.c 2014-06-30 20:19:58.000000000 +0000 @@ -117,8 +117,9 @@ if (sigtrap_get()) return false; + DBG(("%s x %d\n", __FUNCTION__, n)); + if (bo->tiling == I915_TILING_X) { - assert(kgem->memcpy_from_tiled_x); do { memcpy_from_tiled_x(kgem, src, dst, bpp, src_pitch, dst_pitch, box->x1, box->y1, @@ -211,10 +212,13 @@ if (FORCE_INPLACE) return FORCE_INPLACE > 0; + if (cpu) + return true; + if (kgem->can_blt_cpu && kgem->max_cpu_size) return false; - return !__kgem_bo_is_busy(kgem, bo) || cpu; + return !__kgem_bo_is_busy(kgem, bo); } void sna_read_boxes(struct sna *sna, PixmapPtr dst, struct kgem_bo *src_bo, @@ -254,7 +258,7 @@ * this path. */ - if (download_inplace(kgem, dst, src_bo, box ,nbox)) { + if (download_inplace(kgem, dst, src_bo, box, nbox)) { fallback: read_boxes_inplace(kgem, dst, src_bo, box, nbox); return; @@ -286,18 +290,17 @@ /* Try to avoid switching rings... */ if (!can_blt || kgem->ring == KGEM_RENDER || upload_too_large(sna, extents.x2 - extents.x1, extents.y2 - extents.y1)) { - PixmapRec tmp; + DrawableRec tmp; - tmp.drawable.width = extents.x2 - extents.x1; - tmp.drawable.height = extents.y2 - extents.y1; - tmp.drawable.depth = dst->drawable.depth; - tmp.drawable.bitsPerPixel = dst->drawable.bitsPerPixel; - tmp.devPrivate.ptr = NULL; + tmp.width = extents.x2 - extents.x1; + tmp.height = extents.y2 - extents.y1; + tmp.depth = dst->drawable.depth; + tmp.bitsPerPixel = dst->drawable.bitsPerPixel; - assert(tmp.drawable.width); - assert(tmp.drawable.height); + assert(tmp.width); + assert(tmp.height); - if (must_tile(sna, tmp.drawable.width, tmp.drawable.height)) { + if (must_tile(sna, tmp.width, tmp.height)) { BoxRec tile, stack[64], *clipped, *c; int step; @@ -329,8 +332,8 @@ x2 = extents.x2; tile.x2 = x2; - tmp.drawable.width = tile.x2 - tile.x1; - tmp.drawable.height = tile.y2 - tile.y1; + tmp.width = tile.x2 - tile.x1; + tmp.height = tile.y2 - tile.y1; c = clipped; for (n = 0; n < nbox; n++) { @@ -350,9 +353,9 @@ continue; dst_bo = kgem_create_buffer_2d(kgem, - tmp.drawable.width, - tmp.drawable.height, - tmp.drawable.bitsPerPixel, + tmp.width, + tmp.height, + tmp.bitsPerPixel, KGEM_BUFFER_LAST, &ptr); if (!dst_bo) { @@ -362,7 +365,7 @@ } if (!sna->render.copy_boxes(sna, GXcopy, - dst, src_bo, 0, 0, + &dst->drawable, src_bo, 0, 0, &tmp, dst_bo, -tile.x1, -tile.y1, clipped, c-clipped, COPY_LAST)) { kgem_bo_destroy(&sna->kgem, dst_bo); @@ -376,7 +379,7 @@ if (sigtrap_get() == 0) { while (c-- != clipped) { - memcpy_blt(ptr, dst->devPrivate.ptr, tmp.drawable.bitsPerPixel, + memcpy_blt(ptr, dst->devPrivate.ptr, tmp.bitsPerPixel, dst_bo->pitch, dst->devKind, c->x1 - tile.x1, c->y1 - tile.y1, @@ -395,16 +398,16 @@ free(clipped); } else { dst_bo = kgem_create_buffer_2d(kgem, - tmp.drawable.width, - tmp.drawable.height, - tmp.drawable.bitsPerPixel, + tmp.width, + tmp.height, + tmp.bitsPerPixel, KGEM_BUFFER_LAST, &ptr); if (!dst_bo) goto fallback; if (!sna->render.copy_boxes(sna, GXcopy, - dst, src_bo, 0, 0, + &dst->drawable, src_bo, 0, 0, &tmp, dst_bo, -extents.x1, -extents.y1, box, nbox, COPY_LAST)) { kgem_bo_destroy(&sna->kgem, dst_bo); @@ -416,7 +419,7 @@ if (sigtrap_get() == 0) { for (n = 0; n < nbox; n++) { - memcpy_blt(ptr, dst->devPrivate.ptr, tmp.drawable.bitsPerPixel, + memcpy_blt(ptr, dst->devPrivate.ptr, tmp.bitsPerPixel, dst_bo->pitch, dst->devKind, box[n].x1 - extents.x1, box[n].y1 - extents.y1, @@ -636,11 +639,16 @@ static bool upload_inplace__tiled(struct kgem *kgem, struct kgem_bo *bo) { - if (!kgem->memcpy_to_tiled_x) - return false; - - if (bo->tiling != I915_TILING_X) + DBG(("%s: tiling=%d\n", __FUNCTION__, bo->tiling)); + switch (bo->tiling) { + case I915_TILING_Y: return false; + case I915_TILING_X: + if (!kgem->memcpy_to_tiled_x) + return false; + default: + break; + } return kgem_bo_can_map__cpu(kgem, bo, true); } @@ -654,7 +662,7 @@ uint8_t *dst; assert(kgem_bo_can_map__cpu(kgem, bo, true)); - assert(bo->tiling == I915_TILING_X); + assert(bo->tiling != I915_TILING_Y); dst = kgem_bo_map__cpu(kgem, bo); if (dst == NULL) @@ -665,13 +673,23 @@ if (sigtrap_get()) return false; - do { - memcpy_to_tiled_x(kgem, src, dst, bpp, stride, bo->pitch, - box->x1 + src_dx, box->y1 + src_dy, - box->x1 + dst_dx, box->y1 + dst_dy, - box->x2 - box->x1, box->y2 - box->y1); - box++; - } while (--n); + if (bo->tiling) { + do { + memcpy_to_tiled_x(kgem, src, dst, bpp, stride, bo->pitch, + box->x1 + src_dx, box->y1 + src_dy, + box->x1 + dst_dx, box->y1 + dst_dy, + box->x2 - box->x1, box->y2 - box->y1); + box++; + } while (--n); + } else { + do { + memcpy_blt(src, dst, bpp, stride, bo->pitch, + box->x1 + src_dx, box->y1 + src_dy, + box->x1 + dst_dx, box->y1 + dst_dy, + box->x2 - box->x1, box->y2 - box->y1); + box++; + } while (--n); + } sigtrap_put(); return true; @@ -822,23 +840,22 @@ /* Try to avoid switching rings... */ if (!can_blt || kgem->ring == KGEM_RENDER || upload_too_large(sna, extents.x2 - extents.x1, extents.y2 - extents.y1)) { - PixmapRec tmp; + DrawableRec tmp; - tmp.drawable.width = extents.x2 - extents.x1; - tmp.drawable.height = extents.y2 - extents.y1; - tmp.drawable.depth = dst->drawable.depth; - tmp.drawable.bitsPerPixel = dst->drawable.bitsPerPixel; - tmp.devPrivate.ptr = NULL; + tmp.width = extents.x2 - extents.x1; + tmp.height = extents.y2 - extents.y1; + tmp.depth = dst->drawable.depth; + tmp.bitsPerPixel = dst->drawable.bitsPerPixel; - assert(tmp.drawable.width); - assert(tmp.drawable.height); + assert(tmp.width); + assert(tmp.height); DBG(("%s: upload (%d, %d)x(%d, %d), max %dx%d\n", __FUNCTION__, extents.x1, extents.y1, - tmp.drawable.width, tmp.drawable.height, + tmp.width, tmp.height, sna->render.max_3d_size, sna->render.max_3d_size)); - if (must_tile(sna, tmp.drawable.width, tmp.drawable.height)) { + if (must_tile(sna, tmp.width, tmp.height)) { BoxRec tile, stack[64], *clipped; int cpp, step; @@ -875,13 +892,13 @@ x2 = extents.x2; tile.x2 = x2; - tmp.drawable.width = tile.x2 - tile.x1; - tmp.drawable.height = tile.y2 - tile.y1; + tmp.width = tile.x2 - tile.x1; + tmp.height = tile.y2 - tile.y1; src_bo = kgem_create_buffer_2d(kgem, - tmp.drawable.width, - tmp.drawable.height, - tmp.drawable.bitsPerPixel, + tmp.width, + tmp.height, + tmp.bitsPerPixel, KGEM_BUFFER_WRITE_INPLACE, &ptr); if (!src_bo) { @@ -904,7 +921,7 @@ src_dx, src_dy, c->x1 - tile.x1, c->y1 - tile.y1)); - memcpy_blt(src, ptr, tmp.drawable.bitsPerPixel, + memcpy_blt(src, ptr, tmp.bitsPerPixel, stride, src_bo->pitch, c->x1 + src_dx, c->y1 + src_dy, @@ -918,7 +935,7 @@ if (c != clipped) n = sna->render.copy_boxes(sna, GXcopy, &tmp, src_bo, -tile.x1, -tile.y1, - dst, dst_bo, dst_dx, dst_dy, + &dst->drawable, dst_bo, dst_dx, dst_dy, clipped, c - clipped, 0); else n = 1; @@ -940,9 +957,9 @@ free(clipped); } else { src_bo = kgem_create_buffer_2d(kgem, - tmp.drawable.width, - tmp.drawable.height, - tmp.drawable.bitsPerPixel, + tmp.width, + tmp.height, + tmp.bitsPerPixel, KGEM_BUFFER_WRITE_INPLACE, &ptr); if (!src_bo) @@ -957,7 +974,7 @@ src_dx, src_dy, box[n].x1 - extents.x1, box[n].y1 - extents.y1)); - memcpy_blt(src, ptr, tmp.drawable.bitsPerPixel, + memcpy_blt(src, ptr, tmp.bitsPerPixel, stride, src_bo->pitch, box[n].x1 + src_dx, box[n].y1 + src_dy, @@ -969,7 +986,7 @@ n = sna->render.copy_boxes(sna, GXcopy, &tmp, src_bo, -extents.x1, -extents.y1, - dst, dst_bo, dst_dx, dst_dy, + &dst->drawable, dst_bo, dst_dx, dst_dy, box, nbox, 0); sigtrap_put(); } else @@ -1325,23 +1342,22 @@ /* Try to avoid switching rings... */ if (!can_blt || kgem->ring == KGEM_RENDER || upload_too_large(sna, extents.x2 - extents.x1, extents.y2 - extents.y1)) { - PixmapRec tmp; + DrawableRec tmp; - tmp.drawable.width = extents.x2 - extents.x1; - tmp.drawable.height = extents.y2 - extents.y1; - tmp.drawable.depth = dst->drawable.depth; - tmp.drawable.bitsPerPixel = dst->drawable.bitsPerPixel; - tmp.devPrivate.ptr = NULL; + tmp.width = extents.x2 - extents.x1; + tmp.height = extents.y2 - extents.y1; + tmp.depth = dst->drawable.depth; + tmp.bitsPerPixel = dst->drawable.bitsPerPixel; - assert(tmp.drawable.width); - assert(tmp.drawable.height); + assert(tmp.width); + assert(tmp.height); DBG(("%s: upload (%d, %d)x(%d, %d), max %dx%d\n", __FUNCTION__, extents.x1, extents.y1, - tmp.drawable.width, tmp.drawable.height, + tmp.width, tmp.height, sna->render.max_3d_size, sna->render.max_3d_size)); - if (must_tile(sna, tmp.drawable.width, tmp.drawable.height)) { + if (must_tile(sna, tmp.width, tmp.height)) { BoxRec tile, stack[64], *clipped; int step; @@ -1374,13 +1390,13 @@ x2 = extents.x2; tile.x2 = x2; - tmp.drawable.width = tile.x2 - tile.x1; - tmp.drawable.height = tile.y2 - tile.y1; + tmp.width = tile.x2 - tile.x1; + tmp.height = tile.y2 - tile.y1; src_bo = kgem_create_buffer_2d(kgem, - tmp.drawable.width, - tmp.drawable.height, - tmp.drawable.bitsPerPixel, + tmp.width, + tmp.height, + tmp.bitsPerPixel, KGEM_BUFFER_WRITE_INPLACE, &ptr); if (!src_bo) { @@ -1403,7 +1419,7 @@ src_dx, src_dy, c->x1 - tile.x1, c->y1 - tile.y1)); - memcpy_xor(src, ptr, tmp.drawable.bitsPerPixel, + memcpy_xor(src, ptr, tmp.bitsPerPixel, stride, src_bo->pitch, c->x1 + src_dx, c->y1 + src_dy, @@ -1418,7 +1434,7 @@ if (c != clipped) n = sna->render.copy_boxes(sna, GXcopy, &tmp, src_bo, -tile.x1, -tile.y1, - dst, dst_bo, dst_dx, dst_dy, + &dst->drawable, dst_bo, dst_dx, dst_dy, clipped, c - clipped, 0); else n = 1; @@ -1441,9 +1457,9 @@ free(clipped); } else { src_bo = kgem_create_buffer_2d(kgem, - tmp.drawable.width, - tmp.drawable.height, - tmp.drawable.bitsPerPixel, + tmp.width, + tmp.height, + tmp.bitsPerPixel, KGEM_BUFFER_WRITE_INPLACE, &ptr); if (!src_bo) @@ -1458,7 +1474,7 @@ src_dx, src_dy, box[n].x1 - extents.x1, box[n].y1 - extents.y1)); - memcpy_xor(src, ptr, tmp.drawable.bitsPerPixel, + memcpy_xor(src, ptr, tmp.bitsPerPixel, stride, src_bo->pitch, box[n].x1 + src_dx, box[n].y1 + src_dy, @@ -1471,7 +1487,7 @@ n = sna->render.copy_boxes(sna, GXcopy, &tmp, src_bo, -extents.x1, -extents.y1, - dst, dst_bo, dst_dx, dst_dy, + &dst->drawable, dst_bo, dst_dx, dst_dy, box, nbox, 0); sigtrap_put(); } else @@ -1730,10 +1746,10 @@ DBG(("%s: size=%d vs %d\n", __FUNCTION__, - (int)pixmap->devKind * pixmap->drawable.height >> 12, + stride * pixmap->drawable.height >> 12, kgem->half_cpu_cache_pages)); - if ((int)pixmap->devKind * pixmap->drawable.height >> 12 > kgem->half_cpu_cache_pages) + if (stride * pixmap->drawable.height >> 12 > kgem->half_cpu_cache_pages) return false; if (!kgem_bo_can_blt(kgem, bo) && @@ -1762,8 +1778,8 @@ box.y2 = pixmap->drawable.height; ret = sna->render.copy_boxes(sna, GXcopy, - pixmap, src_bo, 0, 0, - pixmap, bo, 0, 0, + &pixmap->drawable, src_bo, 0, 0, + &pixmap->drawable, bo, 0, 0, &box, 1, 0); sigtrap_put(); } else diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_present.c xserver-xorg-video-intel-2.99.914/src/sna/sna_present.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_present.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_present.c 2014-07-17 20:26:45.000000000 +0000 @@ -0,0 +1,479 @@ +/* + * Copyright © 2014 Intel Corporation + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include + +#include "sna.h" + +#include +#include + +static present_screen_info_rec present_info; + +struct sna_present_event { + uint64_t event_id; + xf86CrtcPtr crtc; +}; + +static inline struct sna_present_event * +to_present_event(uintptr_t data) +{ + return (struct sna_present_event *)(data & ~3); +} + +#define MARK_PRESENT(x) ((void *)((uintptr_t)(x) | 2)) + +static int pipe_from_crtc(RRCrtcPtr crtc) +{ + return crtc ? sna_crtc_to_pipe(crtc->devPrivate) : -1; +} + +static uint32_t pipe_select(int pipe) +{ + if (pipe > 1) + return pipe << DRM_VBLANK_HIGH_CRTC_SHIFT; + else if (pipe > 0) + return DRM_VBLANK_SECONDARY; + else + return 0; +} + +static inline int sna_wait_vblank(struct sna *sna, union drm_wait_vblank *vbl, int pipe) +{ + DBG(("%s(pipe=%d, waiting until seq=%u%s)\n", + __FUNCTION__, pipe, vbl->request.sequence, + vbl->request.type & DRM_VBLANK_RELATIVE ? " [relative]" : "")); + vbl->request.type |= pipe_select(pipe); + return drmIoctl(sna->kgem.fd, DRM_IOCTL_WAIT_VBLANK, vbl); +} + +static RRCrtcPtr +sna_present_get_crtc(WindowPtr window) +{ + struct sna *sna = to_sna_from_drawable(&window->drawable); + BoxRec box; + xf86CrtcPtr crtc; + + DBG(("%s\n", __FUNCTION__)); + + box.x1 = window->drawable.x; + box.y1 = window->drawable.y; + box.x2 = box.x1 + window->drawable.width; + box.y2 = box.y1 + window->drawable.height; + + crtc = sna_covering_crtc(sna, &box, NULL); + if (crtc) + return crtc->randr_crtc; + + return NULL; +} + +static int +sna_present_get_ust_msc(RRCrtcPtr crtc, CARD64 *ust, CARD64 *msc) +{ + struct sna *sna = to_sna_from_screen(crtc->pScreen); + int pipe = pipe_from_crtc(crtc); + union drm_wait_vblank vbl; + + DBG(("%s(pipe=%d)\n", __FUNCTION__, pipe)); + + VG_CLEAR(vbl); + vbl.request.type = DRM_VBLANK_RELATIVE; + vbl.request.sequence = 0; + if (sna_wait_vblank(sna, &vbl, pipe) == 0) { + *ust = ust64(vbl.reply.tval_sec, vbl.reply.tval_usec); + *msc = sna_crtc_record_vblank(crtc->devPrivate, &vbl); + } else { + const struct ust_msc *swap = sna_crtc_last_swap(crtc->devPrivate); + *ust = ust64(swap->tv_sec, swap->tv_usec); + *msc = swap->msc; + } + + DBG(("%s: pipe=%d, tv=%d.%06d msc=%lld\n", __FUNCTION__, pipe, + (int)(*ust / 1000000), (int)(*ust % 1000000), + (long long)*msc)); + + return Success; +} + +void +sna_present_vblank_handler(struct sna *sna, struct drm_event_vblank *event) +{ + struct sna_present_event *info = to_present_event(event->user_data); + + DBG(("%s: pipe=%d event=%lld, tv=%d.%06d msc=%d\n", __FUNCTION__, + sna_crtc_to_pipe(info->crtc), (long long)info->event_id, + event->tv_sec, event->tv_usec, event->sequence)); + present_event_notify(info->event_id, + ust64(event->tv_sec, event->tv_usec), + sna_crtc_record_event(info->crtc, event)); + free(info); +} + +static int +sna_present_queue_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) +{ + struct sna *sna = to_sna_from_screen(crtc->pScreen); + struct sna_present_event *event; + union drm_wait_vblank vbl; + + DBG(("%s(pipe=%d, event=%lld, msc=%lld)\n", + __FUNCTION__, pipe_from_crtc(crtc), + (long long)event_id, (long long)msc)); + + event = malloc(sizeof(struct sna_present_event)); + if (event == NULL) + return BadAlloc; + + event->event_id = event_id; + event->crtc = crtc->devPrivate; + + VG_CLEAR(vbl); + vbl.request.type = DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT; + vbl.request.sequence = msc; + vbl.request.signal = (uintptr_t)MARK_PRESENT(event); + if (sna_wait_vblank(sna, &vbl, sna_crtc_to_pipe(event->crtc))) { + DBG(("%s: vblank enqueue failed\n", __FUNCTION__)); + free(event); + return BadMatch; + } + + return Success; +} + +static void +sna_present_abort_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) +{ + DBG(("%s(pipe=%d, event=%lld, msc=%lld)\n", + __FUNCTION__, pipe_from_crtc(crtc), + (long long)event_id, (long long)msc)); +} + +static void +sna_present_flush(WindowPtr window) +{ + PixmapPtr pixmap = get_window_pixmap(window); + struct sna_pixmap *priv; + + DBG(("%s(pixmap=%ld)\n", __FUNCTION__, pixmap->drawable.serialNumber)); + + priv = sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_ASYNC_HINT | __MOVE_FORCE); + if (priv && priv->gpu_bo) + kgem_scanout_flush(&to_sna_from_pixmap(pixmap)->kgem, priv->gpu_bo); +} + +static bool +check_flip__crtc(struct sna *sna, + RRCrtcPtr crtc) +{ + if (!sna_crtc_is_on(crtc->devPrivate)) { + DBG(("%s: CRTC off\n", __FUNCTION__)); + return false; + } + + assert(sna->scrn->vtSema); + + if (sna->mode.shadow_active) { + DBG(("%s: shadow buffer active\n", __FUNCTION__)); + return false; + } + + return true; +} + +static Bool +sna_present_check_flip(RRCrtcPtr crtc, + WindowPtr window, + PixmapPtr pixmap, + Bool sync_flip) +{ + struct sna *sna = to_sna_from_pixmap(pixmap); + struct sna_pixmap *flip; + + DBG(("%s(pipe=%d, pixmap=%ld, sync_flip=%d)\n", + __FUNCTION__, + pipe_from_crtc(crtc), + pixmap->drawable.serialNumber, + sync_flip)); + + if (sna->flags & SNA_NO_FLIP) { + DBG(("%s: flips not suported\n", __FUNCTION__)); + return FALSE; + } + + if (sync_flip) { + if ((sna->flags & SNA_HAS_FLIP) == 0) { + DBG(("%s: async flips not suported\n", __FUNCTION__)); + return FALSE; + } + } else { + if ((sna->flags & SNA_HAS_ASYNC_FLIP) == 0) { + DBG(("%s: async flips not suported\n", __FUNCTION__)); + return FALSE; + } + } + + if (!check_flip__crtc(sna, crtc)) { + DBG(("%s: flip invalid for CRTC\n", __FUNCTION__)); + return FALSE; + } + + flip = sna_pixmap(pixmap); + if (flip == NULL) { + DBG(("%s: unattached pixmap\n", __FUNCTION__)); + return FALSE; + } + + if (flip->cpu_bo && IS_STATIC_PTR(flip->ptr)) { + DBG(("%s: SHM pixmap\n", __FUNCTION__)); + return FALSE; + } + + return TRUE; +} + +static uint64_t gettime_ust64(void) +{ + struct timespec tv; + + if (clock_gettime(CLOCK_MONOTONIC, &tv)) + return 0; + + return ust64(tv.tv_sec, tv.tv_nsec / 1000); +} + +static Bool +page_flip__async(RRCrtcPtr crtc, + uint64_t event_id, + uint64_t target_msc, + struct kgem_bo *bo) +{ + DBG(("%s(pipe=%d, event=%lld, handle=%d)\n", + __FUNCTION__, + pipe_from_crtc(crtc), + (long long)event_id, + bo->handle)); + + if (!sna_page_flip(to_sna_from_screen(crtc->pScreen), bo, NULL, NULL)) { + DBG(("%s: async pageflip failed\n", __FUNCTION__)); + present_info.capabilities &= ~PresentCapabilityAsync; + return FALSE; + } + + present_event_notify(event_id, gettime_ust64(), target_msc); + return TRUE; +} + +static void +present_flip_handler(struct sna *sna, + struct drm_event_vblank *event, + void *data) +{ + struct sna_present_event *info = data; + struct ust_msc swap; + + DBG(("%s(sequence=%d)\n", __FUNCTION__, event->sequence)); + + if (info->crtc == NULL) { + swap.tv_sec = event->tv_sec; + swap.tv_usec = event->tv_usec; + swap.msc = event->sequence; + } else + swap = *sna_crtc_last_swap(info->crtc); + + DBG(("%s: pipe=%d, tv=%d.%06d msc %lld, complete\n", __FUNCTION__, + info->crtc ? sna_crtc_to_pipe(info->crtc) : -1, + swap.tv_sec, swap.tv_usec, (long long)swap.msc)); + present_event_notify(info->event_id, ust64(swap.tv_sec, swap.tv_usec), swap.msc); + free(info); +} + +static Bool +page_flip(ScreenPtr screen, + RRCrtcPtr crtc, + uint64_t event_id, + struct kgem_bo *bo) +{ + struct sna *sna = to_sna_from_screen(screen); + struct sna_present_event *event; + + DBG(("%s(pipe=%d, event=%lld, handle=%d)\n", + __FUNCTION__, + pipe_from_crtc(crtc), + (long long)event_id, + bo->handle)); + + event = malloc(sizeof(struct sna_present_event)); + if (event == NULL) + return FALSE; + + event->event_id = event_id; + event->crtc = crtc ? crtc->devPrivate : NULL; + if (!sna_page_flip(sna, bo, present_flip_handler, event)) { + DBG(("%s: pageflip failed\n", __FUNCTION__)); + free(event); + return FALSE; + } + + return TRUE; +} + +static struct kgem_bo * +get_flip_bo(PixmapPtr pixmap) +{ + struct sna *sna = to_sna_from_pixmap(pixmap); + struct sna_pixmap *priv; + + DBG(("%s(pixmap=%ld)\n", __FUNCTION__, pixmap->drawable.serialNumber)); + + priv = sna_pixmap_move_to_gpu(pixmap, MOVE_READ | __MOVE_FORCE); + if (priv == NULL) { + DBG(("%s: cannot force pixmap to the GPU\n", __FUNCTION__)); + return NULL; + } + + if (sna->flags & SNA_LINEAR_FB && + priv->gpu_bo->tiling && + !sna_pixmap_change_tiling(pixmap, I915_TILING_NONE)) { + DBG(("%s: invalid tiling for scanout, user requires linear\n", __FUNCTION__)); + return NULL; + } + + if (priv->gpu_bo->tiling == I915_TILING_Y && + !sna_pixmap_change_tiling(pixmap, I915_TILING_X)) { + DBG(("%s: invalid Y-tiling, cannot convert\n", __FUNCTION__)); + return NULL; + } + + priv->pinned |= PIN_SCANOUT; + return priv->gpu_bo; +} + +static Bool +sna_present_flip(RRCrtcPtr crtc, + uint64_t event_id, + uint64_t target_msc, + PixmapPtr pixmap, + Bool sync_flip) +{ + struct kgem_bo *bo; + + DBG(("%s(pipe=%d, event=%lld, msc=%lld, pixmap=%ld, sync?=%d)\n", + __FUNCTION__, + pipe_from_crtc(crtc), + (long long)event_id, + (long long)target_msc, + pixmap->drawable.serialNumber, sync_flip)); + + if (!check_flip__crtc(to_sna_from_pixmap(pixmap), crtc)) { + DBG(("%s: flip invalid for CRTC\n", __FUNCTION__)); + return FALSE; + } + + bo = get_flip_bo(pixmap); + if (bo == NULL) { + DBG(("%s: flip invalid bo\n", __FUNCTION__)); + return FALSE; + } + + if (sync_flip) + return page_flip(crtc->pScreen, crtc, event_id, bo); + else + return page_flip__async(crtc, event_id, target_msc, bo); +} + +static void +sna_present_unflip(ScreenPtr screen, uint64_t event_id) +{ + struct sna *sna = to_sna_from_screen(screen); + struct kgem_bo *bo; + + DBG(("%s(event=%lld)\n", __FUNCTION__, (long long)event_id)); + if (sna->mode.front_active == 0) { + const struct ust_msc *swap; + + DBG(("%s: no CRTC active, perform no-op flip\n", __FUNCTION__)); + +notify: + swap = sna_crtc_last_swap(sna_mode_first_crtc(sna)); + present_event_notify(event_id, + ust64(swap->tv_sec, swap->tv_usec), + swap->msc); + return; + } + + bo = get_flip_bo(screen->GetScreenPixmap(screen)); + if (bo == NULL || !page_flip(screen, NULL, event_id, bo)) { + DBG(("%s: failed, trying to restore original mode\n", __FUNCTION__)); + xf86SetDesiredModes(sna->scrn); + goto notify; + } +} + +static present_screen_info_rec present_info = { + .version = PRESENT_SCREEN_INFO_VERSION, + + .get_crtc = sna_present_get_crtc, + .get_ust_msc = sna_present_get_ust_msc, + .queue_vblank = sna_present_queue_vblank, + .abort_vblank = sna_present_abort_vblank, + .flush = sna_present_flush, + + .capabilities = PresentCapabilityNone, + .check_flip = sna_present_check_flip, + .flip = sna_present_flip, + .unflip = sna_present_unflip, +}; + +bool sna_present_open(struct sna *sna, ScreenPtr screen) +{ + if (sna->mode.num_real_crtc == 0) + return false; + + sna_present_update(sna); + + return present_screen_init(screen, &present_info); +} + +void sna_present_update(struct sna *sna) +{ + if (sna->flags & SNA_HAS_ASYNC_FLIP) + present_info.capabilities |= PresentCapabilityAsync; + else + present_info.capabilities &= ~PresentCapabilityAsync; + + DBG(("%s: has_async_flip? %d\n", __FUNCTION__, + !!(present_info.capabilities & PresentCapabilityAsync))); +} + +void sna_present_close(struct sna *sna, ScreenPtr screen) +{ + DBG(("%s()\n", __FUNCTION__)); +} diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_reg.h xserver-xorg-video-intel-2.99.914/src/sna/sna_reg.h --- xserver-xorg-video-intel-2.99.910/src/sna/sna_reg.h 2014-02-01 18:37:13.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_reg.h 2014-04-09 17:41:18.000000000 +0000 @@ -47,6 +47,7 @@ #define XY_SETUP_BLT (2<<29|0x01<<22) #define XY_SETUP_MONO_PATTERN_SL_BLT (2<<29|0x11<<22) #define XY_SETUP_CLIP (2<<29|0x03<<22|1) +#define XY_PIXEL_BLT (2<<29|0x24<<22) #define XY_SCANLINE_BLT (2<<29|0x25<<22|1) #define XY_TEXT_IMMEDIATE_BLT (2<<29|0x31<<22|(1<<16)) #define XY_SRC_COPY_BLT_CMD (2<<29|0x53<<22) diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_render.c xserver-xorg-video-intel-2.99.914/src/sna/sna_render.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_render.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_render.c 2014-07-17 20:26:45.000000000 +0000 @@ -125,19 +125,19 @@ static bool no_render_copy_boxes(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const DrawableRec *src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, + const DrawableRec *dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int n, unsigned flags) { DBG(("%s (n=%d)\n", __FUNCTION__, n)); - if (!sna_blt_compare_depth(&src->drawable, &dst->drawable)) + if (!sna_blt_compare_depth(src, dst)) return false; return sna_blt_copy_boxes(sna, alu, src_bo, src_dx, src_dy, dst_bo, dst_dx, dst_dy, - dst->drawable.bitsPerPixel, + dst->bitsPerPixel, box, n); } @@ -163,7 +163,7 @@ CARD8 op, PictFormat format, const xRenderColor *color, - PixmapPtr dst, struct kgem_bo *dst_bo, + const DrawableRec *dst, struct kgem_bo *dst_bo, const BoxRec *box, int n) { uint8_t alu = GXcopy; @@ -197,7 +197,7 @@ return false; return sna_blt_fill_boxes(sna, alu, - dst_bo, dst->drawable.bitsPerPixel, + dst_bo, dst->bitsPerPixel, pixel, box, n); } @@ -346,7 +346,7 @@ } if (priv->gpu_bo) { - switch (sna_damage_contains_box(priv->cpu_damage, box)) { + switch (sna_damage_contains_box(&priv->cpu_damage, box)) { case PIXMAN_REGION_OUT: DBG(("%s: has GPU bo and no damage to upload\n", __FUNCTION__)); @@ -362,7 +362,7 @@ __FUNCTION__)); return NULL; } - if (sna_damage_contains_box(priv->gpu_damage, + if (sna_damage_contains_box(&priv->gpu_damage, box) != PIXMAN_REGION_OUT) { DBG(("%s: box is damaged on the GPU\n", __FUNCTION__)); @@ -440,7 +440,7 @@ if (priv->gpu_bo) { if (priv->cpu_damage && - sna_damage_contains_box(priv->cpu_damage, + sna_damage_contains_box(&priv->cpu_damage, box) != PIXMAN_REGION_OUT) goto upload; @@ -708,7 +708,7 @@ struct sna_pixmap *priv; pixman_transform_t t; PixmapPtr tmp; - int width, height, size; + int width, height, size, max_size; int sx, sy, sw, sh; int error, ret = 0; BoxRec box, b; @@ -772,12 +772,9 @@ goto fixup; priv = sna_pixmap(tmp); - if (priv == NULL) { - screen->DestroyPixmap(tmp); - goto fixup; - } + assert(priv && priv->gpu_bo); - if (!sna_pixmap_force_to_gpu(pixmap, MOVE_SOURCE_HINT | MOVE_READ)) { + if (!sna_pixmap_move_to_gpu(pixmap, MOVE_SOURCE_HINT | MOVE_READ)) { fixup: DBG(("%s: unable to create GPU bo for target or temporary pixmaps\n", __FUNCTION__)); @@ -789,6 +786,11 @@ format = PictureMatchFormat(screen, pixmap->drawable.depth, picture->format); + if (format == NULL) { + DBG(("%s: invalid depth=%d, format=%08x\n", + __FUNCTION__, pixmap->drawable.depth, picture->format)); + goto fixup; + } tmp_dst = CreatePicture(0, &tmp->drawable, format, 0, NULL, serverClient, &error); @@ -818,8 +820,12 @@ ValidatePicture(tmp_src); /* Use a small size to accommodate enlargement through tile alignment */ + max_size = sna_max_tile_copy_size(sna, sna_pixmap(pixmap)->gpu_bo, priv->gpu_bo); + if (max_size == 0) + goto cleanup_dst; + size = sna->render.max_3d_size - 4096 / pixmap->drawable.bitsPerPixel; - while (size * size * 4 > sna->kgem.max_copy_tile_size) + while (size * size * 4 > max_size) size /= 2; sw = size / sx - 2 * sx; @@ -886,7 +892,7 @@ bool sna_render_pixmap_partial(struct sna *sna, - PixmapPtr pixmap, + const DrawableRec *draw, struct kgem_bo *bo, struct sna_composite_channel *channel, int16_t x, int16_t y, @@ -927,11 +933,11 @@ box.y1 = box.y1 & ~(2*tile_height - 1); box.y2 = ALIGN(box.y2, 2*tile_height); - assert(tile_width * 8 >= pixmap->drawable.bitsPerPixel); - box.x1 = box.x1 & ~(tile_width * 8 / pixmap->drawable.bitsPerPixel - 1); - box.x2 = ALIGN(box.x2, tile_width * 8 / pixmap->drawable.bitsPerPixel); + assert(tile_width * 8 >= draw->bitsPerPixel); + box.x1 = box.x1 & ~(tile_width * 8 / draw->bitsPerPixel - 1); + box.x2 = ALIGN(box.x2, tile_width * 8 / draw->bitsPerPixel); - offset = box.x1 * pixmap->drawable.bitsPerPixel / 8 / tile_width * tile_size; + offset = box.x1 * draw->bitsPerPixel / 8 / tile_width * tile_size; } else { box.y1 = box.y1 & ~1; box.y2 = ALIGN(box.y2, 2); @@ -939,19 +945,19 @@ box.x1 = box.x1 & ~1; box.x2 = ALIGN(box.x2, 2); - offset = box.x1 * pixmap->drawable.bitsPerPixel / 8; + offset = box.x1 * draw->bitsPerPixel / 8; } - if (box.x2 > pixmap->drawable.width) - box.x2 = pixmap->drawable.width; - if (box.y2 > pixmap->drawable.height) - box.y2 = pixmap->drawable.height; + if (box.x2 > draw->width) + box.x2 = draw->width; + if (box.y2 > draw->height) + box.y2 = draw->height; w = box.x2 - box.x1; h = box.y2 - box.y1; DBG(("%s box=(%d, %d), (%d, %d): (%d, %d)/(%d, %d)\n", __FUNCTION__, box.x1, box.y1, box.x2, box.y2, w, h, - pixmap->drawable.width, pixmap->drawable.height)); + draw->width, draw->height)); if (w <= 0 || h <= 0 || w > sna->render.max_3d_size || h > sna->render.max_3d_size) { @@ -1214,19 +1220,18 @@ pixmap->drawable.bitsPerPixel), CREATE_TEMPORARY); if (bo) { - PixmapRec tmp; + DrawableRec tmp; - tmp.drawable.width = w; - tmp.drawable.height = h; - tmp.drawable.depth = pixmap->drawable.depth; - tmp.drawable.bitsPerPixel = pixmap->drawable.bitsPerPixel; - tmp.devPrivate.ptr = NULL; + tmp.width = w; + tmp.height = h; + tmp.depth = pixmap->drawable.depth; + tmp.bitsPerPixel = pixmap->drawable.bitsPerPixel; - assert(tmp.drawable.width); - assert(tmp.drawable.height); + assert(tmp.width); + assert(tmp.height); if (!sna->render.copy_boxes(sna, GXcopy, - pixmap, src_bo, 0, 0, + &pixmap->drawable, src_bo, 0, 0, &tmp, bo, -box.x1, -box.y1, &box, 1, 0)) { kgem_bo_destroy(&sna->kgem, bo); @@ -1344,21 +1349,19 @@ return -1; } - tmp = CreatePicture(0, &pixmap->drawable, - PictureMatchFormat(screen, depth, channel->pict_format), - 0, NULL, serverClient, &error); + tmp = NULL; + bo = __sna_pixmap_get_bo(pixmap); + assert(bo); + if (sna->render.clear(sna, pixmap, bo)) + tmp = CreatePicture(0, &pixmap->drawable, + PictureMatchFormat(screen, depth, channel->pict_format), + 0, NULL, serverClient, &error); screen->DestroyPixmap(pixmap); if (tmp == NULL) return -1; ValidatePicture(tmp); - bo = __sna_pixmap_get_bo(pixmap); - if (!sna->render.clear(sna, pixmap, bo)) { - FreePicture(tmp, 0); - return 0; - } - picture->filter = PictFilterBilinear; params += 2; for (j = 0; j < ch; j++) { @@ -1403,7 +1406,7 @@ return 1; } -static int +static bool sna_render_picture_flatten(struct sna *sna, PicturePtr picture, struct sna_composite_channel *channel, @@ -1426,15 +1429,17 @@ pixmap = screen->CreatePixmap(screen, w, h, 32, SNA_CREATE_SCRATCH); if (pixmap == NullPixmap) { DBG(("%s: pixmap allocation failed\n", __FUNCTION__)); - return -1; + return false; } + assert(__sna_pixmap_get_bo(pixmap)); + tmp = CreatePicture(0, &pixmap->drawable, PictureMatchFormat(screen, 32, PICT_a8r8g8b8), 0, NULL, serverClient, &error); screen->DestroyPixmap(pixmap); if (tmp == NULL) - return -1; + return false; ValidatePicture(tmp); @@ -1472,7 +1477,7 @@ channel->bo = kgem_bo_reference(__sna_pixmap_get_bo(pixmap)); FreePicture(tmp, 0); - return 1; + return true; } int @@ -1615,8 +1620,9 @@ DBG(("%s: alphamap\n", __FUNCTION__)); if (is_gpu(sna, picture->pDrawable, PREFER_GPU_RENDER) || is_gpu(sna, picture->alphaMap->pDrawable, PREFER_GPU_RENDER)) { - return sna_render_picture_flatten(sna, picture, channel, - x, y, w, h, dst_x, dst_y); + if (sna_render_picture_flatten(sna, picture, channel, + x, y, w, h, dst_x, dst_y)) + return 1; } goto do_fixup; @@ -1659,7 +1665,8 @@ dst = pixman_image_create_bits(channel->pict_format, w, h, ptr, channel->bo->pitch); else - dst = pixman_image_create_bits(picture->format, w, h, NULL, 0); + dst = pixman_image_create_bits((pixman_format_code_t)picture->format, + w, h, NULL, 0); if (!dst) { kgem_bo_destroy(&sna->kgem, channel->bo); return 0; @@ -1674,14 +1681,11 @@ DBG(("%s: compositing tmp=(%d+%d, %d+%d)x(%d, %d)\n", __FUNCTION__, x, dx, y, dy, w, h)); - if (sigtrap_get() == 0) { - sna_image_composite(PictOpSrc, src, NULL, dst, - x + dx, y + dy, - 0, 0, - 0, 0, - w, h); - sigtrap_put(); - } + sna_image_composite(PictOpSrc, src, NULL, dst, + x + dx, y + dy, + 0, 0, + 0, 0, + w, h); free_pixman_pict(picture, src); /* Then convert to card format */ @@ -1695,11 +1699,11 @@ dst = pixman_image_create_bits(channel->pict_format, w, h, ptr, channel->bo->pitch); if (dst) { - pixman_image_composite(PictOpSrc, src, NULL, dst, - 0, 0, - 0, 0, - 0, 0, - w, h); + sna_image_composite(PictOpSrc, src, NULL, dst, + 0, 0, + 0, 0, + 0, 0, + w, h); pixman_image_unref(src); } else { memset(ptr, 0, __kgem_buffer_size(channel->bo)); @@ -1803,10 +1807,12 @@ (unsigned)channel->pict_format, (unsigned)picture->format)); - tmp = screen->CreatePixmap(screen, w, h, pixmap->drawable.bitsPerPixel, 0); + tmp = screen->CreatePixmap(screen, w, h, pixmap->drawable.bitsPerPixel, SNA_CREATE_SCRATCH); if (tmp == NULL) return -1; + assert(__sna_pixmap_get_bo(tmp)); + dst = CreatePicture(0, &tmp->drawable, PictureMatchFormat(screen, pixmap->drawable.bitsPerPixel, @@ -1849,7 +1855,7 @@ if (!sna_pixmap_move_to_cpu(pixmap, MOVE_READ)) return 0; - src = pixman_image_create_bits(picture->format, + src = pixman_image_create_bits((pixman_format_code_t)picture->format, pixmap->drawable.width, pixmap->drawable.height, pixmap->devPrivate.ptr, @@ -1885,11 +1891,11 @@ } if (sigtrap_get() == 0) { - pixman_image_composite(PictOpSrc, src, NULL, dst, - box.x1, box.y1, - 0, 0, - 0, 0, - w, h); + sna_image_composite(PictOpSrc, src, NULL, dst, + box.x1, box.y1, + 0, 0, + 0, 0, + w, h); sigtrap_put(); } pixman_image_unref(dst); @@ -2027,7 +2033,6 @@ } assert(op->dst.bo != t->real_bo); - op->dst.bo->unique_id = kgem_get_unique_id(&sna->kgem); op->dst.bo->pitch = t->real_bo->pitch; op->dst.x -= box.x1; @@ -2118,39 +2123,159 @@ } } -bool -sna_render_copy_boxes__overlap(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, - const BoxRec *box, int n, const BoxRec *extents) +static bool +copy_overlap(struct sna *sna, uint8_t alu, + const DrawableRec *draw, struct kgem_bo *bo, + int16_t src_dx, int16_t src_dy, + int16_t dst_dx, int16_t dst_dy, + const BoxRec *box, int n, const BoxRec *extents) { - ScreenPtr screen = dst->drawable.pScreen; - struct kgem_bo *bo; + ScreenPtr screen = draw->pScreen; + struct kgem_bo *tmp_bo; PixmapPtr tmp; bool ret = false; + if (n == 0) + return true; + + DBG(("%s: %d x %dx%d src=(%d, %d), dst=(%d, %d)\n", + __FUNCTION__, n, + extents->x2 - extents->x1, + extents->y2 - extents->y1, + src_dx, src_dy, + dst_dx, dst_dy)); + tmp = screen->CreatePixmap(screen, extents->x2 - extents->x1, extents->y2 - extents->y1, - dst->drawable.depth, + draw->depth, SNA_CREATE_SCRATCH); if (tmp == NULL) return false; - bo = __sna_pixmap_get_bo(tmp); - if (bo == NULL) - goto out; - - ret = (sna->render.copy_boxes(sna, alu, - src, src_bo, src_dx, src_dy, - tmp, bo, -extents->x1, -extents->y1, + tmp_bo = __sna_pixmap_get_bo(tmp); + assert(tmp_bo); + + ret = (sna->render.copy_boxes(sna, GXcopy, + draw, bo, src_dx, src_dy, + &tmp->drawable, tmp_bo, -extents->x1, -extents->y1, box, n , 0) && sna->render.copy_boxes(sna, alu, - tmp, bo, -extents->x1, -extents->y1, - dst, dst_bo, dst_dx, dst_dy, + &tmp->drawable, tmp_bo, -extents->x1, -extents->y1, + draw, bo, dst_dx, dst_dy, box, n , 0)); -out: screen->DestroyPixmap(tmp); return ret; } +bool +sna_render_copy_boxes__overlap(struct sna *sna, uint8_t alu, + const DrawableRec *draw, struct kgem_bo *bo, + int16_t src_dx, int16_t src_dy, + int16_t dst_dx, int16_t dst_dy, + const BoxRec *box, int n, const BoxRec *extents) +{ + bool ret = false; + RegionRec overlap, non_overlap; + pixman_region16_t region; + pixman_box16_t stack_boxes[64], *boxes = stack_boxes; + int num_boxes, i; + + DBG(("%s: pixmap=%ld, handle=%d, %d x [(%d, %d), (%d, %d)], dst=(%d, %d), src=(%d, %d)\n", + __FUNCTION__, draw->serialNumber, bo->handle, + n, extents->x1, extents->y1, extents->x2, extents->y2, + src_dx, src_dy, dst_dx, dst_dy)); + + if ((dst_dx - src_dx < 4 && src_dx - dst_dx < 4) && + (dst_dy - src_dy < 4 && src_dy - dst_dy < 4)) + return copy_overlap(sna, alu, draw, bo, + src_dx, src_dy, + dst_dx, dst_dy, + box, n, extents); + + if (n > ARRAY_SIZE(stack_boxes)) { + boxes = malloc(sizeof(pixman_box16_t) * n); + if (boxes == NULL) + return copy_overlap(sna, alu, draw, bo, + src_dx, src_dy, + dst_dx, dst_dy, + box, n, extents); + } + + region.extents.x1 = extents->x1 + dst_dx; + region.extents.x2 = extents->x2 + dst_dx; + region.extents.y1 = extents->y1 + dst_dy; + region.extents.y2 = extents->y2 + dst_dy; + + for (i = num_boxes = 0; i < n; i++) { + boxes[num_boxes].x1 = box[i].x1 + dst_dx; + if (boxes[num_boxes].x1 < region.extents.x1) + boxes[num_boxes].x1 = region.extents.x1; + + boxes[num_boxes].y1 = box[i].y1 + dst_dy; + if (boxes[num_boxes].y1 < region.extents.y1) + boxes[num_boxes].y1 = region.extents.y1; + + boxes[num_boxes].x2 = box[i].x2 + dst_dx; + if (boxes[num_boxes].x2 > region.extents.x2) + boxes[num_boxes].x2 = region.extents.x2; + + boxes[num_boxes].y2 = box[i].y2 + dst_dy; + if (boxes[num_boxes].y2 > region.extents.y2) + boxes[num_boxes].y2 = region.extents.y2; + + if (boxes[num_boxes].x2 > boxes[num_boxes].x1 && + boxes[num_boxes].y2 > boxes[num_boxes].y1) + num_boxes++; + } + + if (num_boxes == 0) { + ret = true; + goto cleanup_boxes; + } + + if (!pixman_region_init_rects(®ion, boxes, num_boxes)) + goto cleanup_boxes; + + overlap.extents.x1 = extents->x1 + src_dx; + overlap.extents.x2 = extents->x2 + src_dx; + overlap.extents.y1 = extents->y1 + src_dy; + overlap.extents.y2 = extents->y2 + src_dy; + overlap.data = NULL; + + RegionIntersect(&overlap, &overlap, ®ion); + DBG(("%s: overlapping extents: (%d, %d), (%d, %d) x %d\n", + __FUNCTION__, + overlap.extents.x1, overlap.extents.y1, + overlap.extents.x2, overlap.extents.y2, + region_num_rects(&overlap))); + + RegionNull(&non_overlap); + RegionSubtract(&non_overlap, ®ion, &overlap); + DBG(("%s: non-overlapping extents: (%d, %d), (%d, %d) x %d\n", + __FUNCTION__, + non_overlap.extents.x1, non_overlap.extents.y1, + non_overlap.extents.x2, non_overlap.extents.y2, + region_num_rects(&non_overlap))); + + n = region_num_rects(&non_overlap); + box = region_rects(&non_overlap); + if (n && !sna->render.copy_boxes(sna, alu, + draw, bo, -dst_dx + src_dx, -dst_dy + src_dy, + draw, bo, 0, 0, + box, n , COPY_NO_OVERLAP)) + goto cleanup_boxes; + + n = region_num_rects(&overlap); + box = region_rects(&overlap); + ret = copy_overlap(sna, alu, draw, bo, + -dst_dx + src_dx, -dst_dy + src_dy, + 0, 0, + box, n, &overlap.extents); + +cleanup_boxes: + if (boxes != stack_boxes) + free(boxes); + + return ret; +} diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_render.h xserver-xorg-video-intel-2.99.914/src/sna/sna_render.h --- xserver-xorg-video-intel-2.99.910/src/sna/sna_render.h 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_render.h 2014-06-30 20:19:58.000000000 +0000 @@ -44,7 +44,7 @@ uint32_t op; struct { - PixmapPtr pixmap; + PixmapPtr pixmap; /* XXX */ CARD32 format; struct kgem_bo *bo; int16_t x, y; @@ -199,6 +199,11 @@ const struct sna_fill_op *op, const BoxRec *box, int count); + fastcall void (*points)(struct sna *sna, + const struct sna_fill_op *op, + int16_t dx, int16_t dy, + const DDXPointRec *points, + int count); void (*done)(struct sna *sna, const struct sna_fill_op *op); }; @@ -259,7 +264,7 @@ CARD8 op, PictFormat format, const xRenderColor *color, - PixmapPtr dst, struct kgem_bo *dst_bo, + const DrawableRec *dst, struct kgem_bo *dst_bo, const BoxRec *box, int n); bool (*fill)(struct sna *sna, uint8_t alu, PixmapPtr dst, struct kgem_bo *dst_bo, @@ -275,11 +280,12 @@ bool (*clear)(struct sna *sna, PixmapPtr dst, struct kgem_bo *dst_bo); bool (*copy_boxes)(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const DrawableRec *src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, + const DrawableRec *dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int n, unsigned flags); #define COPY_LAST 0x1 #define COPY_SYNC 0x2 +#define COPY_NO_OVERLAP 0x4 bool (*copy)(struct sna *sna, uint8_t alu, PixmapPtr src, struct kgem_bo *src_bo, @@ -321,9 +327,6 @@ } glyph[2]; pixman_image_t *white_image; PicturePtr white_picture; -#if HAS_PIXMAN_GLYPHS - pixman_glyph_cache_t *glyph_cache; -#endif uint16_t vb_id; uint16_t vertex_offset; @@ -638,12 +641,12 @@ CARD8 op, PictFormat format, const xRenderColor *color, - PixmapPtr dst, struct kgem_bo *dst_bo, + const DrawableRec *dst, struct kgem_bo *dst_bo, const BoxRec *box, int n); bool sna_tiling_copy_boxes(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const DrawableRec *src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, + const DrawableRec *dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int n); bool sna_tiling_blt_copy_boxes(struct sna *sna, uint8_t alu, @@ -700,8 +703,8 @@ int bpp, int alpha_fixup, const BoxRec *box, int nbox); bool sna_blt_copy_boxes_fallback(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const DrawableRec *src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, + const DrawableRec *dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int nbox); bool _sna_get_pixel_from_rgba(uint32_t *pixel, @@ -753,7 +756,7 @@ bool sna_render_pixmap_partial(struct sna *sna, - PixmapPtr pixmap, + const DrawableRec *draw, struct kgem_bo *bo, struct sna_composite_channel *channel, int16_t x, int16_t y, @@ -812,8 +815,9 @@ bool sna_render_copy_boxes__overlap(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const DrawableRec *draw, struct kgem_bo *bo, + int16_t src_dx, int16_t src_dy, + int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int n, const BoxRec *extents); bool diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_render_inline.h xserver-xorg-video-intel-2.99.914/src/sna/sna_render_inline.h --- xserver-xorg-video-intel-2.99.910/src/sna/sna_render_inline.h 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_render_inline.h 2014-06-30 20:19:58.000000000 +0000 @@ -92,6 +92,9 @@ if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo)) return true; + if (DAMAGE_IS_ALL(priv->cpu_damage)) + return false; + return priv->gpu_bo && kgem_bo_is_busy(priv->gpu_bo); } @@ -110,6 +113,26 @@ } static inline bool +is_gpu_dst(struct sna_pixmap *priv) +{ + assert(priv); + + if (too_small(priv)) + return false; + + if (priv->gpu_bo && kgem_bo_is_busy(priv->gpu_bo)) + return true; + + if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo)) + return true; + + if (DAMAGE_IS_ALL(priv->cpu_damage)) + return false; + + return priv->gpu_damage != NULL || !priv->cpu; +} + +static inline bool unattached(DrawablePtr drawable) { struct sna_pixmap *priv = sna_pixmap_from_drawable(drawable); @@ -117,11 +140,33 @@ } static inline bool -picture_is_gpu(struct sna *sna, PicturePtr picture) +picture_is_gpu(struct sna *sna, PicturePtr picture, unsigned flags) { - if (!picture || !picture->pDrawable) + if (!picture) return false; - return is_gpu(sna, picture->pDrawable, PREFER_GPU_RENDER); + + if (!picture->pDrawable) { + switch (flags) { + case PREFER_GPU_RENDER: + switch (picture->pSourcePict->type) { + case SourcePictTypeSolidFill: + case SourcePictTypeLinear: + return false; + default: + return true; + } + case PREFER_GPU_SPANS: + return true; + default: + return false; + } + } else { + if (picture->repeat && + (picture->pDrawable->width | picture->pDrawable->height) == 1) + return flags == PREFER_GPU_SPANS; + } + + return is_gpu(sna, picture->pDrawable, flags); } static inline bool @@ -133,7 +178,7 @@ return !is_gpu(sna, picture->pDrawable, PREFER_GPU_RENDER); } -static inline bool sna_blt_compare_depth(DrawablePtr src, DrawablePtr dst) +static inline bool sna_blt_compare_depth(const DrawableRec *src, const DrawableRec *dst) { if (src->depth == dst->depth) return true; @@ -274,5 +319,43 @@ return !p->transform || pixman_transform_is_int_translate(p->transform); } +inline static void +boxes_extents(const BoxRec *box, int n, BoxRec *extents) +{ + *extents = box[0]; + while (--n) { + box++; + + if (box->x1 < extents->x1) + extents->x1 = box->x1; + if (box->x2 > extents->x2) + extents->x2 = box->x2; + + if (box->y1 < extents->y1) + extents->y1 = box->y1; + if (box->y2 > extents->y2) + extents->y2 = box->y2; + } +} + +inline static bool +overlaps(struct sna *sna, + struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, + struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const BoxRec *box, int n, unsigned flags, + BoxRec *extents) +{ + if (src_bo != dst_bo) + return false; + + if (flags & COPY_NO_OVERLAP) + return false; + + boxes_extents(box, n, extents); + return (extents->x2 + src_dx > extents->x1 + dst_dx && + extents->x1 + src_dx < extents->x2 + dst_dx && + extents->y2 + src_dy > extents->y1 + dst_dy && + extents->y1 + src_dy < extents->y2 + dst_dy); +} #endif /* SNA_RENDER_INLINE_H */ diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_threads.c xserver-xorg-video-intel-2.99.914/src/sna/sna_threads.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_threads.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_threads.c 2014-07-05 13:29:43.000000000 +0000 @@ -35,6 +35,13 @@ #include #include +#ifdef HAVE_VALGRIND +#include +static inline bool valgrind_active(void) { return RUNNING_ON_VALGRIND; } +#else +static inline bool valgrind_active(void) { return false; } +#endif + static int max_threads = -1; static struct thread { @@ -53,7 +60,9 @@ /* Disable all signals in the slave threads as X uses them for IO */ sigfillset(&signals); - pthread_sigmask(SIG_BLOCK, &signals, NULL); + sigdelset(&signals, SIGBUS); + sigdelset(&signals, SIGSEGV); + pthread_sigmask(SIG_SETMASK, &signals, NULL); pthread_mutex_lock(&t->mutex); while (1) { @@ -65,6 +74,7 @@ t->func(t->arg); pthread_mutex_lock(&t->mutex); + t->arg = NULL; t->func = NULL; pthread_cond_signal(&t->cond); } @@ -128,6 +138,9 @@ if (max_threads != -1) return; + if (valgrind_active()) + goto bail; + max_threads = num_cores(); if (max_threads == 0) max_threads = sysconf(_SC_NPROCESSORS_ONLN) / 2; @@ -141,51 +154,62 @@ if (threads == NULL) goto bail; - for (n = 0; n < max_threads; n++) { + for (n = 1; n < max_threads; n++) { pthread_mutex_init(&threads[n].mutex, NULL); pthread_cond_init(&threads[n].cond, NULL); threads[n].func = NULL; + threads[n].arg = NULL; if (pthread_create(&threads[n].thread, NULL, __run__, &threads[n])) goto bail; } + threads[0].thread = pthread_self(); return; bail: max_threads = 0; } -void sna_threads_run(void (*func)(void *arg), void *arg) +void sna_threads_run(int id, void (*func)(void *arg), void *arg) +{ + assert(max_threads > 0); + assert(pthread_self() == threads[0].thread); + assert(id > 0 && id < max_threads); + + assert(threads[id].func == NULL); + + pthread_mutex_lock(&threads[id].mutex); + threads[id].func = func; + threads[id].arg = arg; + pthread_cond_signal(&threads[id].cond); + pthread_mutex_unlock(&threads[id].mutex); +} + +void sna_threads_trap(int sig) { + pthread_t t = pthread_self(); int n; - assert(max_threads > 0); + if (max_threads == 0) + return; - for (n = 0; n < max_threads; n++) { - if (threads[n].func) - continue; + if (t == threads[0].thread) + return; - pthread_mutex_lock(&threads[n].mutex); - if (threads[n].func) { - pthread_mutex_unlock(&threads[n].mutex); - continue; - } + for (n = 1; threads[n].thread != t; n++) + ; - goto execute; - } + ERR(("%s: thread[%d] caught signal %d\n", __func__, n, sig)); - n = rand() % max_threads; pthread_mutex_lock(&threads[n].mutex); - while (threads[n].func) - pthread_cond_wait(&threads[n].cond, &threads[n].mutex); - -execute: - threads[n].func = func; - threads[n].arg = arg; + threads[n].arg = (void *)(intptr_t)sig; + threads[n].func = NULL; pthread_cond_signal(&threads[n].cond); pthread_mutex_unlock(&threads[n].mutex); + + pthread_exit(&sig); } void sna_threads_wait(void) @@ -193,18 +217,41 @@ int n; assert(max_threads > 0); + assert(pthread_self() == threads[0].thread); + + for (n = 1; n < max_threads; n++) { + if (threads[n].func != NULL) { + pthread_mutex_lock(&threads[n].mutex); + while (threads[n].func) + pthread_cond_wait(&threads[n].cond, &threads[n].mutex); + pthread_mutex_unlock(&threads[n].mutex); + } - for (n = 0; n < max_threads; n++) { - if (threads[n].func == NULL) - continue; - - pthread_mutex_lock(&threads[n].mutex); - while (threads[n].func) - pthread_cond_wait(&threads[n].cond, &threads[n].mutex); - pthread_mutex_unlock(&threads[n].mutex); + if (threads[n].arg != NULL) { + DBG(("%s: thread[%d] died from signal %d\n", __func__, n, (int)(intptr_t)threads[n].arg)); + sna_threads_kill(); + return; + } } } +void sna_threads_kill(void) +{ + int n; + + ERR(("%s: kill %d threads\n", __func__, max_threads)); + assert(max_threads > 0); + assert(pthread_self() == threads[0].thread); + + for (n = 1; n < max_threads; n++) + pthread_cancel(threads[n].thread); + + for (n = 1; n < max_threads; n++) + pthread_join(threads[n].thread, NULL); + + max_threads = 0; +} + int sna_use_threads(int width, int height, int threshold) { int num_threads; @@ -212,6 +259,9 @@ if (max_threads <= 0) return 1; + if (height <= 1) + return 1; + if (width < 128) height /= 128/width; @@ -221,6 +271,9 @@ if (num_threads > max_threads) num_threads = max_threads; + if (num_threads > height) + num_threads = height; + return num_threads; } @@ -260,11 +313,14 @@ num_threads = sna_use_threads(width, height, 32); if (num_threads <= 1) { - pixman_image_composite(op, src, mask, dst, - src_x, src_y, - mask_x, mask_y, - dst_x, dst_y, - width, height); + if (sigtrap_get() == 0) { + pixman_image_composite(op, src, mask, dst, + src_x, src_y, + mask_x, mask_y, + dst_x, dst_y, + width, height); + sigtrap_put(); + } } else { struct thread_composite data[num_threads]; int y, dy, n; @@ -289,27 +345,31 @@ data[0].width = width; data[0].height = dy; - for (n = 1; n < num_threads; n++) { - data[n] = data[0]; - data[n].src_y += y - dst_y; - data[n].mask_y += y - dst_y; - data[n].dst_y = y; - y += dy; - - sna_threads_run(thread_composite, &data[n]); - } + if (sigtrap_get() == 0) { + for (n = 1; n < num_threads; n++) { + data[n] = data[0]; + data[n].src_y += y - dst_y; + data[n].mask_y += y - dst_y; + data[n].dst_y = y; + y += dy; - assert(y < dst_y + height); - if (y + dy > dst_y + height) - dy = dst_y + height - y; - - data[0].src_y += y - dst_y; - data[0].mask_y += y - dst_y; - data[0].dst_y = y; - data[0].height = dy; - - thread_composite(&data[0]); + sna_threads_run(n, thread_composite, &data[n]); + } - sna_threads_wait(); + assert(y < dst_y + height); + if (y + dy > dst_y + height) + dy = dst_y + height - y; + + data[0].src_y += y - dst_y; + data[0].mask_y += y - dst_y; + data[0].dst_y = y; + data[0].height = dy; + + thread_composite(&data[0]); + + sna_threads_wait(); + sigtrap_put(); + } else + sna_threads_kill(); } } diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_tiling.c xserver-xorg-video-intel-2.99.914/src/sna/sna_tiling.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_tiling.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_tiling.c 2014-06-30 20:19:58.000000000 +0000 @@ -138,14 +138,19 @@ { struct sna_tile_state *tile = op->priv; struct sna_composite_op tmp; - int x, y, n, step; + int x, y, n, step, max_size; /* Use a small step to accommodate enlargement through tile alignment */ step = sna->render.max_3d_size; if (tile->dst_x & (8*512 / tile->dst->pDrawable->bitsPerPixel - 1) || tile->dst_y & 63) step /= 2; - while (step * step * 4 > sna->kgem.max_copy_tile_size) + + max_size = sna_max_tile_copy_size(sna, op->dst.bo, op->dst.bo); + if (max_size == 0) + goto done; + + while (step * step * 4 > max_size) step /= 2; DBG(("%s -- %dx%d, count=%d, step size=%d\n", __FUNCTION__, @@ -317,6 +322,7 @@ tmp->done = sna_tiling_composite_done; tmp->priv = tile; + tmp->dst.bo = priv->gpu_bo; return true; } @@ -373,7 +379,7 @@ { struct sna_tile_state *tile = op->base.priv; struct sna_composite_spans_op tmp; - int x, y, n, step; + int x, y, n, step, max_size; bool force_fallback = false; /* Use a small step to accommodate enlargement through tile alignment */ @@ -381,7 +387,12 @@ if (tile->dst_x & (8*512 / tile->dst->pDrawable->bitsPerPixel - 1) || tile->dst_y & 63) step /= 2; - while (step * step * 4 > sna->kgem.max_copy_tile_size) + + max_size = sna_max_tile_copy_size(sna, op->base.dst.bo, op->base.dst.bo); + if (max_size == 0) + goto done; + + while (step * step * 4 > max_size) step /= 2; DBG(("%s -- %dx%d, count=%d, step size=%d\n", __FUNCTION__, @@ -576,6 +587,7 @@ tmp->done = sna_tiling_composite_spans_done; tmp->base.priv = tile; + tmp->base.dst.bo = priv->gpu_bo; return true; } @@ -584,22 +596,27 @@ CARD8 op, PictFormat format, const xRenderColor *color, - PixmapPtr dst, struct kgem_bo *dst_bo, + const DrawableRec *dst, struct kgem_bo *dst_bo, const BoxRec *box, int n) { RegionRec region, tile, this; struct kgem_bo *bo; - int step; + int step, max_size; bool ret = false; pixman_region_init_rects(®ion, box, n); /* Use a small step to accommodate enlargement through tile alignment */ step = sna->render.max_3d_size; - if (region.extents.x1 & (8*512 / dst->drawable.bitsPerPixel - 1) || + if (region.extents.x1 & (8*512 / dst->bitsPerPixel - 1) || region.extents.y1 & 63) step /= 2; - while (step * step * 4 > sna->kgem.max_copy_tile_size) + + max_size = sna_max_tile_copy_size(sna, dst_bo, dst_bo); + if (max_size == 0) + goto done; + + while (step * step * 4 > max_size) step /= 2; DBG(("%s (op=%d, format=%x, color=(%04x,%04x,%04x, %04x), tile.size=%d, box=%dx[(%d, %d), (%d, %d)])\n", @@ -620,7 +637,7 @@ for (tile.extents.x1 = tile.extents.x2 = region.extents.x1; tile.extents.x2 < region.extents.x2; tile.extents.x1 = tile.extents.x2) { - PixmapRec tmp; + DrawableRec tmp; int x2 = tile.extents.x1 + step; if (x2 > region.extents.x2) x2 = region.extents.x2; @@ -633,21 +650,20 @@ if (RegionNil(&this)) continue; - tmp.drawable.width = this.extents.x2 - this.extents.x1; - tmp.drawable.height = this.extents.y2 - this.extents.y1; - tmp.drawable.depth = dst->drawable.depth; - tmp.drawable.bitsPerPixel = dst->drawable.bitsPerPixel; - tmp.devPrivate.ptr = NULL; + tmp.width = this.extents.x2 - this.extents.x1; + tmp.height = this.extents.y2 - this.extents.y1; + tmp.depth = dst->depth; + tmp.bitsPerPixel = dst->bitsPerPixel; bo = kgem_create_2d(&sna->kgem, - tmp.drawable.width, - tmp.drawable.height, - dst->drawable.bitsPerPixel, + tmp.width, + tmp.height, + dst->bitsPerPixel, kgem_choose_tiling(&sna->kgem, I915_TILING_X, - tmp.drawable.width, - tmp.drawable.height, - dst->drawable.bitsPerPixel), + tmp.width, + tmp.height, + dst->bitsPerPixel), CREATE_TEMPORARY); if (bo) { int16_t dx = this.extents.x1; @@ -655,22 +671,22 @@ assert(kgem_bo_can_blt(&sna->kgem, bo)); - if (!sna->render.copy_boxes(sna, GXcopy, - dst, dst_bo, 0, 0, - &tmp, bo, -dx, -dy, - REGION_RECTS(&this), REGION_NUM_RECTS(&this), 0)) + if (op > PictOpSrc && + !sna->render.copy_boxes(sna, GXcopy, + dst, dst_bo, 0, 0, + &tmp, bo, -dx, -dy, + region_rects(&this), region_num_rects(&this), 0)) goto err; RegionTranslate(&this, -dx, -dy); - if (!sna->render.fill_boxes(sna, op, format, color, - &tmp, bo, - REGION_RECTS(&this), REGION_NUM_RECTS(&this))) + if (!sna->render.fill_boxes(sna, op, format, color, &tmp, bo, + region_rects(&this), region_num_rects(&this))) goto err; if (!sna->render.copy_boxes(sna, GXcopy, - &tmp, bo, 0, 0, - dst, dst_bo, dx, dy, - REGION_RECTS(&this), REGION_NUM_RECTS(&this), 0)) + &tmp, bo, 0, 0, + dst, dst_bo, dx, dy, + region_rects(&this), region_num_rects(&this), 0)) goto err; kgem_bo_destroy(&sna->kgem, bo); @@ -790,14 +806,9 @@ return false; } - max_size = sna->kgem.aperture_high * PAGE_SIZE; - max_size -= MAX(kgem_bo_size(src_bo), kgem_bo_size(dst_bo)); - if (max_size <= 0) { - DBG(("%s: tiles cannot fit into aperture\n", __FUNCTION__)); + max_size = sna_max_tile_copy_size(sna, src_bo, dst_bo); + if (max_size == 0) return false; - } - if (max_size > sna->kgem.max_copy_tile_size) - max_size = sna->kgem.max_copy_tile_size; pixman_region_init_rects(®ion, box, nbox); @@ -854,20 +865,19 @@ int16_t dx = this.extents.x1; int16_t dy = this.extents.y1; - assert(bo->pitch <= 8192); - assert(bo->tiling != I915_TILING_Y); + assert(kgem_bo_can_blt(&sna->kgem, bo)); if (!sna_blt_copy_boxes(sna, GXcopy, src_bo, src_dx, src_dy, bo, -dx, -dy, - bpp, REGION_RECTS(&this), REGION_NUM_RECTS(&this))) + bpp, region_rects(&this), region_num_rects(&this))) goto err; if (!sna_blt_copy_boxes__with_alpha(sna, alu, bo, -dx, -dy, dst_bo, dst_dx, dst_dy, bpp, alpha_fixup, - REGION_RECTS(&this), REGION_NUM_RECTS(&this))) + region_rects(&this), region_num_rects(&this))) goto err; kgem_bo_destroy(&sna->kgem, bo); @@ -1009,6 +1019,9 @@ int max_size, step; bool ret = false; + DBG(("%s: alu=%d, src size=%d, dst size=%d\n", __FUNCTION__, + alu, kgem_bo_size(src_bo), kgem_bo_size(dst_bo))); + if (wedged(sna) || !kgem_bo_can_blt(&sna->kgem, src_bo) || !kgem_bo_can_blt(&sna->kgem, dst_bo)) { @@ -1020,14 +1033,9 @@ return false; } - max_size = sna->kgem.aperture_high * PAGE_SIZE; - max_size -= MAX(kgem_bo_size(src_bo), kgem_bo_size(dst_bo)); - if (max_size <= 0) { - DBG(("%s: tiles cannot fit into aperture\n", __FUNCTION__)); + max_size = sna_max_tile_copy_size(sna, src_bo, dst_bo); + if (max_size == 0) return false; - } - if (max_size > sna->kgem.max_copy_tile_size) - max_size = sna->kgem.max_copy_tile_size; pixman_region_init_rects(®ion, box, nbox); @@ -1084,19 +1092,18 @@ int16_t dx = this.extents.x1; int16_t dy = this.extents.y1; - assert(bo->pitch <= 8192); - assert(bo->tiling != I915_TILING_Y); + assert(kgem_bo_can_blt(&sna->kgem, bo)); if (!sna_blt_copy_boxes(sna, GXcopy, src_bo, src_dx, src_dy, bo, -dx, -dy, - bpp, REGION_RECTS(&this), REGION_NUM_RECTS(&this))) + bpp, region_rects(&this), region_num_rects(&this))) goto err; if (!sna_blt_copy_boxes(sna, alu, bo, -dx, -dy, dst_bo, dst_dx, dst_dy, - bpp, REGION_RECTS(&this), REGION_NUM_RECTS(&this))) + bpp, region_rects(&this), region_num_rects(&this))) goto err; kgem_bo_destroy(&sna->kgem, bo); @@ -1117,12 +1124,12 @@ bool sna_tiling_copy_boxes(struct sna *sna, uint8_t alu, - PixmapPtr src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, - PixmapPtr dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, + const DrawableRec *src, struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy, + const DrawableRec *dst, struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy, const BoxRec *box, int n) { BoxRec extents, tile, stack[64], *clipped, *c; - PixmapRec p; + DrawableRec p; int i, step, tiling; bool create = true; bool ret = false; @@ -1166,9 +1173,8 @@ } else clipped = stack; - p.drawable.depth = src->drawable.depth; - p.drawable.bitsPerPixel = src->drawable.bitsPerPixel; - p.devPrivate.ptr = NULL; + p.depth = src->depth; + p.bitsPerPixel = src->bitsPerPixel; for (tile.y1 = extents.y1; tile.y1 < extents.y2; tile.y1 = tile.y2) { int y2 = tile.y1 + step; @@ -1201,17 +1207,17 @@ if (c == clipped) continue; - p.drawable.width = tile.x2 - tile.x1; - p.drawable.height = tile.y2 - tile.y1; + p.width = tile.x2 - tile.x1; + p.height = tile.y2 - tile.y1; DBG(("%s: tile (%d, %d), (%d, %d)\n", __FUNCTION__, tile.x1, tile.y1, tile.x2, tile.y2)); if (create) { tmp_bo = kgem_create_2d(&sna->kgem, - p.drawable.width, - p.drawable.height, - p.drawable.bitsPerPixel, + p.width, + p.height, + p.bitsPerPixel, tiling, CREATE_TEMPORARY); if (!tmp_bo) goto tiled_error; diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_transform.c xserver-xorg-video-intel-2.99.914/src/sna/sna_transform.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_transform.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_transform.c 2014-04-09 17:41:18.000000000 +0000 @@ -96,6 +96,63 @@ return true; } +bool +sna_transform_is_imprecise_integer_translation(const PictTransform *t, + int filter, bool precise, + int16_t *tx, int16_t *ty) +{ + if (t == NULL) { + DBG(("%s: no transform\n", __FUNCTION__)); + *tx = *ty = 0; + return true; + } + + DBG(("%s: FilterNearest?=%d, precise?=%d, transform=[%f %f %f, %f %f %f, %f %f %f]\n", + __FUNCTION__, filter==PictFilterNearest, precise, + t->matrix[0][0]/65536., t->matrix[0][1]/65536., t->matrix[0][2]/65536., + t->matrix[1][0]/65536., t->matrix[1][1]/65536., t->matrix[1][2]/65536., + t->matrix[2][0]/65536., t->matrix[2][1]/65536., t->matrix[2][2]/65536.)); + + if (t->matrix[0][0] != IntToxFixed(1) || + t->matrix[0][1] != 0 || + t->matrix[1][0] != 0 || + t->matrix[1][1] != IntToxFixed(1) || + t->matrix[2][0] != 0 || + t->matrix[2][1] != 0 || + t->matrix[2][2] != IntToxFixed(1)) { + DBG(("%s: not unity scaling\n", __FUNCTION__)); + return false; + } + + if (filter != PictFilterNearest) { + if (precise) { + if (pixman_fixed_fraction(t->matrix[0][2]) || + pixman_fixed_fraction(t->matrix[1][2])) { + DBG(("%s: precise, fractional translation\n", __FUNCTION__)); + return false; + } + } else { + int f; + + f = pixman_fixed_fraction(t->matrix[0][2]); + if (f < IntToxFixed(1)/4 || f > IntToxFixed(3)/4) { + DBG(("%s: imprecise, fractional translation X\n", __FUNCTION__)); + return false; + } + + f = pixman_fixed_fraction(t->matrix[1][2]); + if (f < IntToxFixed(1)/4 || f > IntToxFixed(3)/4) { + DBG(("%s: imprecise, fractional translation Y\n", __FUNCTION__)); + return false; + } + } + } + + *tx = pixman_fixed_to_int(t->matrix[0][2] + IntToxFixed(1)/2); + *ty = pixman_fixed_to_int(t->matrix[1][2] + IntToxFixed(1)/2); + return true; +} + /** * Returns the floating-point coordinates transformed by the given transform. */ diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_trapezoids_boxes.c xserver-xorg-video-intel-2.99.914/src/sna/sna_trapezoids_boxes.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_trapezoids_boxes.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_trapezoids_boxes.c 2014-07-04 14:19:02.000000000 +0000 @@ -73,9 +73,9 @@ static void apply_damage(struct sna_composite_op *op, RegionPtr region) { - DBG(("%s: damage=%p, region=%ldx[(%d, %d), (%d, %d)]\n", + DBG(("%s: damage=%p, region=%dx[(%d, %d), (%d, %d)]\n", __FUNCTION__, op->damage, - (long)REGION_NUM_RECTS(region), + region_num_rects(region), region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2)); @@ -202,15 +202,18 @@ clip.extents.y2 - clip.extents.y1, COMPOSITE_PARTIAL, memset(&tmp, 0, sizeof(tmp)))) { unsigned int flags; - pixman_box16_t *b; + const pixman_box16_t *b; int i, count; DBG(("%s: composite render op not supported\n", __FUNCTION__)); flags = MOVE_READ | MOVE_WRITE; - if (n == 1 && op <= PictOpSrc) - flags = MOVE_WRITE | MOVE_INPLACE_HINT; + if (op <= PictOpSrc) { + flags |= MOVE_INPLACE_HINT; + if (n == 1) + flags &= ~MOVE_READ; + } if (!sna_drawable_move_region_to_cpu(dst->pDrawable, &clip, flags)) goto done; @@ -234,8 +237,8 @@ RegionIntersect(®ion, ®ion, &clip); if (sigtrap_get() == 0) { - b = REGION_RECTS(®ion); - count = REGION_NUM_RECTS(®ion); + b = region_rects(®ion); + count = region_num_rects(®ion); for (i = 0; i < count; i++) { fbComposite(op, src, NULL, dst, src_x + b[i].x1 - boxes[0].x1, @@ -251,15 +254,18 @@ for (n = 0; n < num_boxes; n++) { pixman_region_init_rects(®ion, &boxes[n], 1); RegionIntersect(®ion, ®ion, &clip); - b = REGION_RECTS(®ion); - count = REGION_NUM_RECTS(®ion); - for (i = 0; i < count; i++) { - fbComposite(op, src, NULL, dst, - src_x + b[i].x1 - boxes[0].x1, - src_y + b[i].y1 - boxes[0].y1, - 0, 0, - b[i].x1, b[i].y1, - b[i].x2 - b[i].x1, b[i].y2 - b[i].y1); + b = region_rects(®ion); + count = region_num_rects(®ion); + if (sigtrap_get() == 0) { + for (i = 0; i < count; i++) { + fbComposite(op, src, NULL, dst, + src_x + b[i].x1 - boxes[0].x1, + src_y + b[i].y1 - boxes[0].y1, + 0, 0, + b[i].x1, b[i].y1, + b[i].x2 - b[i].x1, b[i].y2 - b[i].y1); + } + sigtrap_put(); } pixman_region_fini(®ion); pixman_region_fini(®ion); @@ -274,10 +280,10 @@ num_boxes == 1) { pixman_region_init_rects(®ion, boxes, num_boxes); RegionIntersect(®ion, ®ion, &clip); - if (REGION_NUM_RECTS(®ion)) { + if (region_num_rects(®ion)) { tmp.boxes(sna, &tmp, - REGION_RECTS(®ion), - REGION_NUM_RECTS(®ion)); + region_rects(®ion), + region_num_rects(®ion)); apply_damage(&tmp, ®ion); } pixman_region_fini(®ion); @@ -285,10 +291,10 @@ for (n = 0; n < num_boxes; n++) { pixman_region_init_rects(®ion, &boxes[n], 1); RegionIntersect(®ion, ®ion, &clip); - if (REGION_NUM_RECTS(®ion)) { + if (region_num_rects(®ion)) { tmp.boxes(sna, &tmp, - REGION_RECTS(®ion), - REGION_NUM_RECTS(®ion)); + region_rects(®ion), + region_num_rects(®ion)); apply_damage(&tmp, ®ion); } pixman_region_fini(®ion); @@ -324,10 +330,10 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - if (REGION_NUM_RECTS(®ion)) + if (region_num_rects(®ion)) tmp->boxes(sna, tmp, - REGION_RECTS(®ion), - REGION_NUM_RECTS(®ion), + region_rects(®ion), + region_num_rects(®ion), opacity); pixman_region_fini(®ion); } else @@ -466,7 +472,7 @@ pixman_region_init_rects(®ion, &box, 1); RegionIntersect(®ion, ®ion, clip); - if (REGION_NUM_RECTS(®ion)) + if (region_num_rects(®ion)) apply_damage(&tmp->base, ®ion); RegionUninit(®ion); } else @@ -675,8 +681,8 @@ *pi->bits = pi->color; else *pi->bits = mul_4x8_8(pi->color, opacity); - pixman_image_composite(pi->op, pi->source, NULL, pi->image, - 0, 0, 0, 0, pi->dx + x, pi->dy + y, w, h); + sna_image_composite(pi->op, pi->source, NULL, pi->image, + 0, 0, 0, 0, pi->dx + x, pi->dy + y, w, h); } static void @@ -765,7 +771,7 @@ __FUNCTION__, n)); do { RegionRec clip; - BoxPtr extents; + const BoxRec *extents; int count; clip.extents.x1 = pixman_fixed_to_int(t->left.p1.x); @@ -789,52 +795,55 @@ continue; } - RegionTranslate(&clip, dx, dy); - count = REGION_NUM_RECTS(&clip); - extents = REGION_RECTS(&clip); - while (count--) { - int16_t y1 = dy + pixman_fixed_to_int(t->top); - uint16_t fy1 = pixman_fixed_frac(t->top); - int16_t y2 = dy + pixman_fixed_to_int(t->bottom); - uint16_t fy2 = pixman_fixed_frac(t->bottom); - - DBG(("%s: t=(%d, %d), (%d, %d), extents (%d, %d), (%d, %d)\n", - __FUNCTION__, - pixman_fixed_to_int(t->left.p1.x), - pixman_fixed_to_int(t->top), - pixman_fixed_to_int(t->right.p2.x), - pixman_fixed_to_int(t->bottom), - extents->x1, extents->y1, - extents->x2, extents->y2)); - - if (y1 < extents->y1) - y1 = extents->y1, fy1 = 0; - if (y2 >= extents->y2) - y2 = extents->y2, fy2 = 0; + if (sigtrap_get() == 0) { + RegionTranslate(&clip, dx, dy); + count = region_num_rects(&clip); + extents = region_rects(&clip); + while (count--) { + int16_t y1 = dy + pixman_fixed_to_int(t->top); + uint16_t fy1 = pixman_fixed_frac(t->top); + int16_t y2 = dy + pixman_fixed_to_int(t->bottom); + uint16_t fy2 = pixman_fixed_frac(t->bottom); + + DBG(("%s: t=(%d, %d), (%d, %d), extents (%d, %d), (%d, %d)\n", + __FUNCTION__, + pixman_fixed_to_int(t->left.p1.x), + pixman_fixed_to_int(t->top), + pixman_fixed_to_int(t->right.p2.x), + pixman_fixed_to_int(t->bottom), + extents->x1, extents->y1, + extents->x2, extents->y2)); - if (y1 < y2) { - if (fy1) { + if (y1 < extents->y1) + y1 = extents->y1, fy1 = 0; + if (y2 >= extents->y2) + y2 = extents->y2, fy2 = 0; + + if (y1 < y2) { + if (fy1) { + lerp32_unaligned_box_row(pixmap, color, extents, + t, dx, y1, 1, + SAMPLES_Y - grid_coverage(SAMPLES_Y, fy1)); + y1++; + } + + if (y2 > y1) + lerp32_unaligned_box_row(pixmap, color, extents, + t, dx, y1, y2 - y1, + SAMPLES_Y); + + if (fy2) + lerp32_unaligned_box_row(pixmap, color, extents, + t, dx, y2, 1, + grid_coverage(SAMPLES_Y, fy2)); + } else if (y1 == y2 && fy2 > fy1) { lerp32_unaligned_box_row(pixmap, color, extents, t, dx, y1, 1, - SAMPLES_Y - grid_coverage(SAMPLES_Y, fy1)); - y1++; + grid_coverage(SAMPLES_Y, fy2) - grid_coverage(SAMPLES_Y, fy1)); } - - if (y2 > y1) - lerp32_unaligned_box_row(pixmap, color, extents, - t, dx, y1, y2 - y1, - SAMPLES_Y); - - if (fy2) - lerp32_unaligned_box_row(pixmap, color, extents, - t, dx, y2, 1, - grid_coverage(SAMPLES_Y, fy2)); - } else if (y1 == y2 && fy2 > fy1) { - lerp32_unaligned_box_row(pixmap, color, extents, - t, dx, y1, 1, - grid_coverage(SAMPLES_Y, fy2) - grid_coverage(SAMPLES_Y, fy1)); + extents++; } - extents++; + sigtrap_put(); } RegionUninit(&clip); @@ -846,7 +855,7 @@ do { struct pixman_inplace pi; RegionRec clip; - BoxPtr extents; + const BoxRec *extents; int count; clip.extents.x1 = pixman_fixed_to_int(t->left.p1.x); @@ -877,37 +886,40 @@ pi.color = color; pi.op = op; - count = REGION_NUM_RECTS(&clip); - extents = REGION_RECTS(&clip); - while (count--) { - int16_t y1 = pixman_fixed_to_int(t->top); - uint16_t fy1 = pixman_fixed_frac(t->top); - int16_t y2 = pixman_fixed_to_int(t->bottom); - uint16_t fy2 = pixman_fixed_frac(t->bottom); - - if (y1 < extents->y1) - y1 = extents->y1, fy1 = 0; - if (y2 >= extents->y2) - y2 = extents->y2, fy2 = 0; - if (y1 < y2) { - if (fy1) { + if (sigtrap_get() == 0) { + count = region_num_rects(&clip); + extents = region_rects(&clip); + while (count--) { + int16_t y1 = pixman_fixed_to_int(t->top); + uint16_t fy1 = pixman_fixed_frac(t->top); + int16_t y2 = pixman_fixed_to_int(t->bottom); + uint16_t fy2 = pixman_fixed_frac(t->bottom); + + if (y1 < extents->y1) + y1 = extents->y1, fy1 = 0; + if (y2 >= extents->y2) + y2 = extents->y2, fy2 = 0; + if (y1 < y2) { + if (fy1) { + pixsolid_unaligned_box_row(&pi, extents, t, y1, 1, + SAMPLES_Y - grid_coverage(SAMPLES_Y, fy1)); + y1++; + } + + if (y2 > y1) + pixsolid_unaligned_box_row(&pi, extents, t, y1, y2 - y1, + SAMPLES_Y); + + if (fy2) + pixsolid_unaligned_box_row(&pi, extents, t, y2, 1, + grid_coverage(SAMPLES_Y, fy2)); + } else if (y1 == y2 && fy2 > fy1) { pixsolid_unaligned_box_row(&pi, extents, t, y1, 1, - SAMPLES_Y - grid_coverage(SAMPLES_Y, fy1)); - y1++; + grid_coverage(SAMPLES_Y, fy2) - grid_coverage(SAMPLES_Y, fy1)); } - - if (y2 > y1) - pixsolid_unaligned_box_row(&pi, extents, t, y1, y2 - y1, - SAMPLES_Y); - - if (fy2) - pixsolid_unaligned_box_row(&pi, extents, t, y2, 1, - grid_coverage(SAMPLES_Y, fy2)); - } else if (y1 == y2 && fy2 > fy1) { - pixsolid_unaligned_box_row(&pi, extents, t, y1, 1, - grid_coverage(SAMPLES_Y, fy2) - grid_coverage(SAMPLES_Y, fy1)); + extents++; } - extents++; + sigtrap_put(); } RegionUninit(&clip); @@ -1048,7 +1060,7 @@ { if (!force_fallback && (is_gpu(sna, dst->pDrawable, PREFER_GPU_SPANS) || - picture_is_gpu(sna, src))) { + picture_is_gpu(sna, src, PREFER_GPU_SPANS))) { DBG(("%s: fallback -- not forcing\n", __FUNCTION__)); return false; } @@ -1059,7 +1071,7 @@ src_y -= pixman_fixed_to_int(t[0].left.p1.y); do { RegionRec clip; - BoxPtr extents; + const BoxRec *extents; int count; int num_threads; @@ -1115,37 +1127,40 @@ pi.bits = pixman_image_get_data(pi.mask); pi.op = op; - count = REGION_NUM_RECTS(&clip); - extents = REGION_RECTS(&clip); - while (count--) { - int16_t y1 = pixman_fixed_to_int(t->top); - uint16_t fy1 = pixman_fixed_frac(t->top); - int16_t y2 = pixman_fixed_to_int(t->bottom); - uint16_t fy2 = pixman_fixed_frac(t->bottom); - - if (y1 < extents->y1) - y1 = extents->y1, fy1 = 0; - if (y2 > extents->y2) - y2 = extents->y2, fy2 = 0; - if (y1 < y2) { - if (fy1) { + if (sigtrap_get() == 0) { + count = region_num_rects(&clip); + extents = region_rects(&clip); + while (count--) { + int16_t y1 = pixman_fixed_to_int(t->top); + uint16_t fy1 = pixman_fixed_frac(t->top); + int16_t y2 = pixman_fixed_to_int(t->bottom); + uint16_t fy2 = pixman_fixed_frac(t->bottom); + + if (y1 < extents->y1) + y1 = extents->y1, fy1 = 0; + if (y2 > extents->y2) + y2 = extents->y2, fy2 = 0; + if (y1 < y2) { + if (fy1) { + pixmask_unaligned_box_row(&pi, extents, t, y1, 1, + SAMPLES_Y - grid_coverage(SAMPLES_Y, fy1)); + y1++; + } + + if (y2 > y1) + pixmask_unaligned_box_row(&pi, extents, t, y1, y2 - y1, + SAMPLES_Y); + + if (fy2) + pixmask_unaligned_box_row(&pi, extents, t, y2, 1, + grid_coverage(SAMPLES_Y, fy2)); + } else if (y1 == y2 && fy2 > fy1) { pixmask_unaligned_box_row(&pi, extents, t, y1, 1, - SAMPLES_Y - grid_coverage(SAMPLES_Y, fy1)); - y1++; + grid_coverage(SAMPLES_Y, fy2) - grid_coverage(SAMPLES_Y, fy1)); } - - if (y2 > y1) - pixmask_unaligned_box_row(&pi, extents, t, y1, y2 - y1, - SAMPLES_Y); - - if (fy2) - pixmask_unaligned_box_row(&pi, extents, t, y2, 1, - grid_coverage(SAMPLES_Y, fy2)); - } else if (y1 == y2 && fy2 > fy1) { - pixmask_unaligned_box_row(&pi, extents, t, y1, 1, - grid_coverage(SAMPLES_Y, fy2) - grid_coverage(SAMPLES_Y, fy1)); + extents++; } - extents++; + sigtrap_put(); } pixman_image_unref(pi.image); @@ -1169,19 +1184,23 @@ dy = (clip.extents.y2 - clip.extents.y1 + num_threads - 1) / num_threads; num_threads = (clip.extents.y2 - clip.extents.y1 + dy - 1) / dy; - for (i = 1; i < num_threads; i++) { - thread[i] = thread[0]; - thread[i].y1 = y; - thread[i].y2 = y += dy; - sna_threads_run(rectilinear_inplace_thread, &thread[i]); - } + if (sigtrap_get() == 0) { + for (i = 1; i < num_threads; i++) { + thread[i] = thread[0]; + thread[i].y1 = y; + thread[i].y2 = y += dy; + sna_threads_run(i, rectilinear_inplace_thread, &thread[i]); + } - assert(y < clip.extents.y2); - thread[0].y1 = y; - thread[0].y2 = clip.extents.y2; - rectilinear_inplace_thread(&thread[0]); + assert(y < clip.extents.y2); + thread[0].y1 = y; + thread[0].y2 = clip.extents.y2; + rectilinear_inplace_thread(&thread[0]); - sna_threads_wait(); + sna_threads_wait(); + sigtrap_put(); + } else + sna_threads_kill(); pixman_image_unref(thread[0].dst); pixman_image_unref(thread[0].src); diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_trapezoids.c xserver-xorg-video-intel-2.99.914/src/sna/sna_trapezoids.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_trapezoids.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_trapezoids.c 2014-06-30 20:19:58.000000000 +0000 @@ -318,7 +318,7 @@ DBG(("%s: mask (%dx%d) depth=%d, format=%08x\n", __FUNCTION__, width, height, depth, format)); if (is_gpu(sna, dst->pDrawable, PREFER_GPU_RENDER) || - picture_is_gpu(sna, src)) { + picture_is_gpu(sna, src, PREFER_GPU_RENDER)) { int num_threads; scratch = sna_pixmap_create_upload(screen, @@ -385,21 +385,25 @@ dy = (height + num_threads - 1) / num_threads; num_threads -= (num_threads-1) * dy >= bounds.y2 - bounds.y1; - for (n = 1; n < num_threads; n++) { - threads[n] = threads[0]; - threads[n].ptr += (y - bounds.y1) * threads[n].stride; - threads[n].bounds.y1 = y; - threads[n].bounds.y2 = y += dy; + if (sigtrap_get() == 0) { + for (n = 1; n < num_threads; n++) { + threads[n] = threads[0]; + threads[n].ptr += (y - bounds.y1) * threads[n].stride; + threads[n].bounds.y1 = y; + threads[n].bounds.y2 = y += dy; - sna_threads_run(rasterize_traps_thread, &threads[n]); - } - - assert(y < threads[0].bounds.y2); - threads[0].ptr += (y - bounds.y1) * threads[0].stride; - threads[0].bounds.y1 = y; - rasterize_traps_thread(&threads[0]); + sna_threads_run(n, rasterize_traps_thread, &threads[n]); + } - sna_threads_wait(); + assert(y < threads[0].bounds.y2); + threads[0].ptr += (y - bounds.y1) * threads[0].stride; + threads[0].bounds.y1 = y; + rasterize_traps_thread(&threads[0]); + + sna_threads_wait(); + sigtrap_put(); + } else + sna_threads_kill(); format = PIXMAN_a8; depth = 8; @@ -483,7 +487,7 @@ case PICT_x8r8g8b8: case PICT_a8r8g8b8: - if (picture_is_gpu(sna, src)) + if (picture_is_gpu(sna, src, 0)) return false; switch (op) { @@ -508,24 +512,39 @@ out: priv = sna_pixmap_from_drawable(dst->pDrawable); - if (priv == NULL) + if (priv == NULL) { + DBG(("%s? yes -- unattached\n", __FUNCTION__)); return true; + } - if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo)) + if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo)) { + DBG(("%s? no -- CPU bo is busy\n", __FUNCTION__)); return false; + } - if (DAMAGE_IS_ALL(priv->cpu_damage) || priv->gpu_damage == NULL) + if (DAMAGE_IS_ALL(priv->cpu_damage) || priv->gpu_damage == NULL) { + DBG(("%s? yes -- damaged on CPU only (all? %d)\n", __FUNCTION__, DAMAGE_IS_ALL(priv->cpu_damage))); return true; + } - if (priv->clear) + if (priv->clear) { + DBG(("%s? clear, %s\n", __FUNCTION__, + dst->pDrawable->width <= TOR_INPLACE_SIZE ? "yes" : "no")); return dst->pDrawable->width <= TOR_INPLACE_SIZE; + } - if (kgem_bo_is_busy(priv->gpu_bo)) + if (kgem_bo_is_busy(priv->gpu_bo)) { + DBG(("%s? no, GPU bo is busy\n", __FUNCTION__)); return false; + } - if (priv->cpu_damage) + if (priv->cpu_damage) { + DBG(("%s? yes, idle GPU bo and damage on idle CPU\n", __FUNCTION__)); return true; + } + DBG(("%s? small enough? %s\n", __FUNCTION__, + dst->pDrawable->width <= TOR_INPLACE_SIZE ? "yes" : "no")); return dst->pDrawable->width <= TOR_INPLACE_SIZE; } @@ -576,15 +595,10 @@ } if (FORCE_FALLBACK == 0 && - (too_small(priv) || DAMAGE_IS_ALL(priv->cpu_damage)) && - !picture_is_gpu(sna, src) && untransformed(src)) { - DBG(("%s: force fallbacks --too small, %dx%d? %d, all-cpu? %d, src-is-cpu? %d\n", - __FUNCTION__, - dst->pDrawable->width, - dst->pDrawable->height, - too_small(priv), - (int)DAMAGE_IS_ALL(priv->cpu_damage), - !picture_is_gpu(sna, src))); + !is_gpu_dst(priv) && !picture_is_gpu(sna, src, 0) && untransformed(src)) { + DBG(("%s: force fallbacks -- (!gpu dst, %dx%d? %d) && (src-is-cpu? %d && untransformed? %d)\n", + __FUNCTION__, dst->pDrawable->width, dst->pDrawable->height, + !is_gpu_dst(priv), !picture_is_gpu(sna, src, 0), untransformed(src))); force_fallback: force_fallback = true; @@ -625,8 +639,9 @@ } } - DBG(("%s: rectilinear? %d, pixel-aligned? %d\n", - __FUNCTION__, rectilinear, pixel_aligned)); + DBG(("%s: rectilinear? %d, pixel-aligned? %d, mono? %d precise? %d\n", + __FUNCTION__, rectilinear, pixel_aligned, + is_mono(dst, maskFormat), is_precise(dst, maskFormat))); flags = 0; if (rectilinear) { @@ -708,9 +723,7 @@ box->x2 >= pixmap->drawable.width && box->y2 >= pixmap->drawable.height) { sna_damage_destroy(&priv->cpu_damage); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->gpu_damage, pixmap); list_del(&priv->flush_list); } else { sna_damage_add_box(&priv->gpu_damage, box); @@ -774,7 +787,8 @@ return true; memset(scratch->devPrivate.ptr, 0, scratch->devKind*height); - image = pixman_image_create_bits(picture->format, width, height, + image = pixman_image_create_bits((pixman_format_code_t)picture->format, + width, height, scratch->devPrivate.ptr, scratch->devKind); if (image) { @@ -787,8 +801,8 @@ /* XXX clip boxes */ get_drawable_deltas(picture->pDrawable, pixmap, &x, &y); sna->render.copy_boxes(sna, GXcopy, - scratch, __sna_pixmap_get_bo(scratch), -extents.x1, -extents.x1, - pixmap, priv->gpu_bo, x, y, + &scratch->drawable, __sna_pixmap_get_bo(scratch), -extents.x1, -extents.x1, + &pixmap->drawable, priv->gpu_bo, x, y, &extents, 1, 0); mark_damaged(pixmap, priv, &extents, x, y); diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_trapezoids_imprecise.c xserver-xorg-video-intel-2.99.914/src/sna/sna_trapezoids_imprecise.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_trapezoids_imprecise.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_trapezoids_imprecise.c 2014-06-30 20:19:58.000000000 +0000 @@ -85,9 +85,9 @@ static void apply_damage(struct sna_composite_op *op, RegionPtr region) { - DBG(("%s: damage=%p, region=%ldx[(%d, %d), (%d, %d)]\n", + DBG(("%s: damage=%p, region=%dx[(%d, %d), (%d, %d)]\n", __FUNCTION__, op->damage, - (long)REGION_NUM_RECTS(region), + region_num_rects(region), region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2)); @@ -1008,10 +1008,10 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - if (REGION_NUM_RECTS(®ion)) { + if (region_num_rects(®ion)) { op->boxes(sna, op, - REGION_RECTS(®ion), - REGION_NUM_RECTS(®ion), + region_rects(®ion), + region_num_rects(®ion), opacity); apply_damage(&op->base, ®ion); } @@ -1505,6 +1505,15 @@ } static void +convert_mono(uint8_t *ptr, int w) +{ + while (w--) { + *ptr = 0xff * (*ptr >= 0xf0); + ptr++; + } +} + +static void tor_inplace(struct tor *converter, PixmapPtr scratch, int mono, uint8_t *buf) { int i, j, h = converter->extents.y2; @@ -1516,7 +1525,6 @@ int width = scratch->drawable.width; __DBG(("%s: mono=%d, buf?=%d\n", __FUNCTION__, mono, buf != NULL)); - assert(!mono); assert(converter->extents.y1 == 0); assert(converter->extents.x1 == 0); assert(scratch->drawable.depth == 8); @@ -1552,6 +1560,8 @@ if (do_full_step) { memset(ptr, 0, width); inplace_row(active, ptr, width); + if (mono) + convert_mono(ptr, width); if (row != ptr) memcpy(row, ptr, width); @@ -1584,8 +1594,11 @@ } assert(min >= 0 && max <= width); memset(row, 0, min); - if (max > min) + if (max > min) { inplace_end_subrows(active, row+min, (int8_t*)ptr+min, max-min); + if (mono) + convert_mono(row+min, max-min); + } if (max < width) memset(row+max, 0, width-max); } @@ -1738,10 +1751,10 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - if (REGION_NUM_RECTS(®ion)) { + if (region_num_rects(®ion)) { span_thread_add_boxes(sna, op, - REGION_RECTS(®ion), - REGION_NUM_RECTS(®ion), + region_rects(®ion), + region_num_rects(®ion), AREA_TO_ALPHA(coverage)); } pixman_region_fini(®ion); @@ -1988,7 +2001,7 @@ threads[n].extents.y1 = y; threads[n].extents.y2 = y += h; - sna_threads_run(span_thread, &threads[n]); + sna_threads_run(n, span_thread, &threads[n]); } assert(y < threads[0].extents.y2); @@ -2230,8 +2243,8 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - n = REGION_NUM_RECTS(®ion); - box = REGION_RECTS(®ion); + n = region_num_rects(®ion); + box = region_rects(®ion); while (n--) tor_blt_src(sna, op, NULL, box++, coverage); pixman_region_fini(®ion); @@ -2280,8 +2293,8 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - n = REGION_NUM_RECTS(®ion); - box = REGION_RECTS(®ion); + n = region_num_rects(®ion); + box = region_rects(®ion); while (n--) tor_blt_in(sna, op, NULL, box++, coverage); pixman_region_fini(®ion); @@ -2337,8 +2350,8 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - n = REGION_NUM_RECTS(®ion); - box = REGION_RECTS(®ion); + n = region_num_rects(®ion); + box = region_rects(®ion); while (n--) tor_blt_add(sna, op, NULL, box++, coverage); pixman_region_fini(®ion); @@ -2411,8 +2424,8 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - n = REGION_NUM_RECTS(®ion); - box = REGION_RECTS(®ion); + n = region_num_rects(®ion); + box = region_rects(®ion); while (n--) tor_blt_lerp32(sna, op, NULL, box++, coverage); pixman_region_fini(®ion); @@ -2459,8 +2472,8 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - n = REGION_NUM_RECTS(®ion); - box = REGION_RECTS(®ion); + n = region_num_rects(®ion); + box = region_rects(®ion); while (n--) pixmask_span_solid(sna, op, NULL, box++, coverage); pixman_region_fini(®ion); @@ -2499,8 +2512,8 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - n = REGION_NUM_RECTS(®ion); - box = REGION_RECTS(®ion); + n = region_num_rects(®ion); + box = region_rects(®ion); while (n--) pixmask_span(sna, op, NULL, box++, coverage); pixman_region_fini(®ion); @@ -2759,8 +2772,11 @@ DBG(("%s: render inplace op=%d, color=%08x\n", __FUNCTION__, op, color)); - tor_render(NULL, &tor, (void*)&inplace, - dst->pCompositeClip, span, false); + if (sigtrap_get() == 0) { + tor_render(NULL, &tor, (void*)&inplace, + dst->pCompositeClip, span, false); + sigtrap_put(); + } } else if (is_solid) { struct pixman_inplace pi; @@ -2778,9 +2794,12 @@ else span = pixmask_span_solid; - tor_render(NULL, &tor, (void*)&pi, - dst->pCompositeClip, span, - false); + if (sigtrap_get() == 0) { + tor_render(NULL, &tor, (void*)&pi, + dst->pCompositeClip, span, + false); + sigtrap_put(); + } pixman_image_unref(pi.source); pixman_image_unref(pi.image); @@ -2804,9 +2823,12 @@ else span = pixmask_span; - tor_render(NULL, &tor, (void*)&pi, - dst->pCompositeClip, span, - false); + if (sigtrap_get() == 0) { + tor_render(NULL, &tor, (void*)&pi, + dst->pCompositeClip, span, + false); + sigtrap_put(); + } pixman_image_unref(pi.mask); pixman_image_unref(pi.source); @@ -2842,19 +2864,23 @@ h = (h + num_threads - 1) / num_threads; num_threads -= (num_threads-1) * h >= region.extents.y2 - region.extents.y1; - for (n = 1; n < num_threads; n++) { - threads[n] = threads[0]; - threads[n].extents.y1 = y; - threads[n].extents.y2 = y += h; + if (sigtrap_get() == 0) { + for (n = 1; n < num_threads; n++) { + threads[n] = threads[0]; + threads[n].extents.y1 = y; + threads[n].extents.y2 = y += h; - sna_threads_run(inplace_x8r8g8b8_thread, &threads[n]); - } + sna_threads_run(n, inplace_x8r8g8b8_thread, &threads[n]); + } - assert(y < threads[0].extents.y2); - threads[0].extents.y1 = y; - inplace_x8r8g8b8_thread(&threads[0]); + assert(y < threads[0].extents.y2); + threads[0].extents.y1 = y; + inplace_x8r8g8b8_thread(&threads[0]); - sna_threads_wait(); + sna_threads_wait(); + sigtrap_put(); + } else + sna_threads_kill(); /* leaks thread allocations */ } return true; @@ -3083,8 +3109,11 @@ tor_add_edge(&tor, &t, &t.right, -1); } - tor_render(NULL, &tor, (void*)&inplace, - dst->pCompositeClip, span, unbounded); + if (sigtrap_get() == 0) { + tor_render(NULL, &tor, (void*)&inplace, + dst->pCompositeClip, span, unbounded); + sigtrap_put(); + } tor_fini(&tor); } else { @@ -3113,19 +3142,23 @@ h = (h + num_threads - 1) / num_threads; num_threads -= (num_threads-1) * h >= region.extents.y2 - region.extents.y1; - for (n = 1; n < num_threads; n++) { - threads[n] = threads[0]; - threads[n].extents.y1 = y; - threads[n].extents.y2 = y += h; + if (sigtrap_get() == 0) { + for (n = 1; n < num_threads; n++) { + threads[n] = threads[0]; + threads[n].extents.y1 = y; + threads[n].extents.y2 = y += h; - sna_threads_run(inplace_thread, &threads[n]); - } + sna_threads_run(n, inplace_thread, &threads[n]); + } - assert(y < threads[0].extents.y2); - threads[0].extents.y1 = y; - inplace_thread(&threads[0]); + assert(y < threads[0].extents.y2); + threads[0].extents.y1 = y; + inplace_thread(&threads[0]); - sna_threads_wait(); + sna_threads_wait(); + sigtrap_put(); + } else + sna_threads_kill(); /* leaks thread allocations */ } return true; @@ -3375,9 +3408,7 @@ box->x2 >= pixmap->drawable.width && box->y2 >= pixmap->drawable.height) { sna_damage_destroy(&priv->cpu_damage); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + sna_damage_all(&priv->gpu_damage, pixmap); list_del(&priv->flush_list); } else { sna_damage_add_box(&priv->gpu_damage, box); @@ -3495,8 +3526,8 @@ get_drawable_deltas(picture->pDrawable, pixmap, &x, &y); sna = to_sna_from_screen(screen); sna->render.copy_boxes(sna, GXcopy, - scratch, __sna_pixmap_get_bo(scratch), -extents.x1, -extents.x1, - pixmap, priv->gpu_bo, x, y, + &scratch->drawable, __sna_pixmap_get_bo(scratch), -extents.x1, -extents.x1, + &pixmap->drawable, priv->gpu_bo, x, y, &extents, 1, 0); mark_damaged(pixmap, priv, &extents ,x, y); sna_pixmap_destroy(scratch); diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_trapezoids_mono.c xserver-xorg-video-intel-2.99.914/src/sna/sna_trapezoids_mono.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_trapezoids_mono.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_trapezoids_mono.c 2014-06-11 11:25:09.000000000 +0000 @@ -119,9 +119,9 @@ static void apply_damage(struct sna_composite_op *op, RegionPtr region) { - DBG(("%s: damage=%p, region=%ldx[(%d, %d), (%d, %d)]\n", + DBG(("%s: damage=%p, region=%dx[(%d, %d), (%d, %d)]\n", __FUNCTION__, op->damage, - (long)REGION_NUM_RECTS(region), + region_num_rects(region), region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2)); @@ -444,10 +444,10 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, &c->clip); - if (REGION_NUM_RECTS(®ion)) { + if (region_num_rects(®ion)) { c->op.boxes(c->sna, &c->op, - REGION_RECTS(®ion), - REGION_NUM_RECTS(®ion)); + region_rects(®ion), + region_num_rects(®ion)); apply_damage(&c->op, ®ion); } pixman_region_fini(®ion); @@ -505,10 +505,10 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, &c->clip); - if (REGION_NUM_RECTS(®ion)) + if (region_num_rects(®ion)) thread_mono_span_add_boxes(c, - REGION_RECTS(®ion), - REGION_NUM_RECTS(®ion)); + region_rects(®ion), + region_num_rects(®ion)); pixman_region_fini(®ion); } @@ -852,7 +852,7 @@ threads[n].extents.y1 = y; threads[n].extents.y2 = y += h; - sna_threads_run(mono_span_thread, &threads[n]); + sna_threads_run(n, mono_span_thread, &threads[n]); } threads[0].extents.y1 = y; @@ -1168,7 +1168,10 @@ mono.span = mono_span__fast; else mono.span = mono_span; - mono_render(&mono); + if (sigtrap_get() == 0) { + mono_render(&mono); + sigtrap_put(); + } mono_fini(&mono); if (op) { diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_trapezoids_precise.c xserver-xorg-video-intel-2.99.914/src/sna/sna_trapezoids_precise.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_trapezoids_precise.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_trapezoids_precise.c 2014-06-11 11:25:09.000000000 +0000 @@ -106,9 +106,9 @@ static void apply_damage(struct sna_composite_op *op, RegionPtr region) { - DBG(("%s: damage=%p, region=%ldx[(%d, %d), (%d, %d)]\n", + DBG(("%s: damage=%p, region=%dx[(%d, %d), (%d, %d)]\n", __FUNCTION__, op->damage, - (long)REGION_NUM_RECTS(region), + region_num_rects(region), region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2)); @@ -1012,10 +1012,10 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - if (REGION_NUM_RECTS(®ion)) { + if (region_num_rects(®ion)) { op->boxes(sna, op, - REGION_RECTS(®ion), - REGION_NUM_RECTS(®ion), + region_rects(®ion), + region_num_rects(®ion), opacity); apply_damage(&op->base, ®ion); } @@ -1667,10 +1667,10 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - if (REGION_NUM_RECTS(®ion)) { + if (region_num_rects(®ion)) { span_thread_add_boxes(sna, op, - REGION_RECTS(®ion), - REGION_NUM_RECTS(®ion), + region_rects(®ion), + region_num_rects(®ion), AREA_TO_FLOAT(coverage)); } pixman_region_fini(®ion); @@ -1913,7 +1913,7 @@ threads[n].extents.y1 = y; threads[n].extents.y2 = y += h; - sna_threads_run(span_thread, &threads[n]); + sna_threads_run(n, span_thread, &threads[n]); } assert(y < threads[0].extents.y2); @@ -2139,7 +2139,7 @@ threads[n].extents.y1 = y; threads[n].extents.y2 = y += h; - sna_threads_run(mask_thread, &threads[n]); + sna_threads_run(n, mask_thread, &threads[n]); } assert(y < threads[0].extents.y2); @@ -2231,8 +2231,8 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - n = REGION_NUM_RECTS(®ion); - box = REGION_RECTS(®ion); + n = region_num_rects(®ion); + box = region_rects(®ion); while (n--) tor_blt_src(sna, op, NULL, box++, coverage); pixman_region_fini(®ion); @@ -2281,8 +2281,8 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - n = REGION_NUM_RECTS(®ion); - box = REGION_RECTS(®ion); + n = region_num_rects(®ion); + box = region_rects(®ion); while (n--) tor_blt_in(sna, op, NULL, box++, coverage); pixman_region_fini(®ion); @@ -2338,8 +2338,8 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - n = REGION_NUM_RECTS(®ion); - box = REGION_RECTS(®ion); + n = region_num_rects(®ion); + box = region_rects(®ion); while (n--) tor_blt_add(sna, op, NULL, box++, coverage); pixman_region_fini(®ion); @@ -2410,8 +2410,8 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - n = REGION_NUM_RECTS(®ion); - box = REGION_RECTS(®ion); + n = region_num_rects(®ion); + box = region_rects(®ion); while (n--) tor_blt_lerp32(sna, op, NULL, box++, coverage); pixman_region_fini(®ion); @@ -2456,8 +2456,8 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - n = REGION_NUM_RECTS(®ion); - box = REGION_RECTS(®ion); + n = region_num_rects(®ion); + box = region_rects(®ion); while (n--) pixmask_span_solid(sna, op, NULL, box++, coverage); pixman_region_fini(®ion); @@ -2494,8 +2494,8 @@ pixman_region_init_rects(®ion, box, 1); RegionIntersect(®ion, ®ion, clip); - n = REGION_NUM_RECTS(®ion); - box = REGION_RECTS(®ion); + n = region_num_rects(®ion); + box = region_rects(®ion); while (n--) pixmask_span(sna, op, NULL, box++, coverage); pixman_region_fini(®ion); @@ -2757,8 +2757,11 @@ DBG(("%s: render inplace op=%d, color=%08x\n", __FUNCTION__, op, color)); - tor_render(NULL, &tor, (void*)&inplace, - dst->pCompositeClip, span, false); + if (sigtrap_get() == 0) { + tor_render(NULL, &tor, (void*)&inplace, + dst->pCompositeClip, span, false); + sigtrap_put(); + } } else if (is_solid) { struct pixman_inplace pi; @@ -2776,9 +2779,12 @@ else span = pixmask_span_solid; - tor_render(NULL, &tor, (void*)&pi, - dst->pCompositeClip, span, - false); + if (sigtrap_get() == 0) { + tor_render(NULL, &tor, (void*)&pi, + dst->pCompositeClip, span, + false); + sigtrap_put(); + } pixman_image_unref(pi.source); pixman_image_unref(pi.image); @@ -2802,9 +2808,12 @@ else span = pixmask_span; - tor_render(NULL, &tor, (void*)&pi, - dst->pCompositeClip, span, - false); + if (sigtrap_get() == 0) { + tor_render(NULL, &tor, (void*)&pi, + dst->pCompositeClip, span, + false); + sigtrap_put(); + } pixman_image_unref(pi.mask); pixman_image_unref(pi.source); @@ -2840,19 +2849,23 @@ h = (h + num_threads - 1) / num_threads; num_threads -= (num_threads-1) * h >= region.extents.y2 - region.extents.y1; - for (n = 1; n < num_threads; n++) { - threads[n] = threads[0]; - threads[n].extents.y1 = y; - threads[n].extents.y2 = y += h; + if (sigtrap_get() == 0) { + for (n = 1; n < num_threads; n++) { + threads[n] = threads[0]; + threads[n].extents.y1 = y; + threads[n].extents.y2 = y += h; - sna_threads_run(inplace_x8r8g8b8_thread, &threads[n]); - } + sna_threads_run(n, inplace_x8r8g8b8_thread, &threads[n]); + } - assert(y < threads[0].extents.y2); - threads[0].extents.y1 = y; - inplace_x8r8g8b8_thread(&threads[0]); + assert(y < threads[0].extents.y2); + threads[0].extents.y1 = y; + inplace_x8r8g8b8_thread(&threads[0]); - sna_threads_wait(); + sna_threads_wait(); + sigtrap_put(); + } else + sna_threads_kill(); /* leaks thread allocations */ } return true; @@ -3082,8 +3095,11 @@ tor_add_edge(&tor, &t, &t.right, -1); } - tor_render(NULL, &tor, (void*)&inplace, - dst->pCompositeClip, span, unbounded); + if (sigtrap_get() == 0) { + tor_render(NULL, &tor, (void*)&inplace, + dst->pCompositeClip, span, unbounded); + sigtrap_put(); + } tor_fini(&tor); } else { @@ -3112,19 +3128,23 @@ h = (h + num_threads - 1) / num_threads; num_threads -= (num_threads-1) * h >= region.extents.y2 - region.extents.y1; - for (n = 1; n < num_threads; n++) { - threads[n] = threads[0]; - threads[n].extents.y1 = y; - threads[n].extents.y2 = y += h; + if (sigtrap_get() == 0) { + for (n = 1; n < num_threads; n++) { + threads[n] = threads[0]; + threads[n].extents.y1 = y; + threads[n].extents.y2 = y += h; - sna_threads_run(inplace_thread, &threads[n]); - } + sna_threads_run(n, inplace_thread, &threads[n]); + } - assert(y < threads[0].extents.y2); - threads[0].extents.y1 = y; - inplace_thread(&threads[0]); + assert(y < threads[0].extents.y2); + threads[0].extents.y1 = y; + inplace_thread(&threads[0]); - sna_threads_wait(); + sna_threads_wait(); + sigtrap_put(); + } else + sna_threads_kill(); /* leaks thread allocations */ } return true; @@ -3261,7 +3281,7 @@ threads[n].extents.y1 = y; threads[n].extents.y2 = y += h; - sna_threads_run(mask_thread, &threads[n]); + sna_threads_run(n, mask_thread, &threads[n]); } assert(y < threads[0].extents.y2); diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_video.c xserver-xorg-video-intel-2.99.914/src/sna/sna_video.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_video.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_video.c 2014-04-23 10:34:32.000000000 +0000 @@ -200,8 +200,6 @@ int id, short width, short height, struct sna_video_frame *frame) { - int align; - DBG(("%s: id=%d [planar? %d], width=%d, height=%d, align=%d\n", __FUNCTION__, id, is_planar_fourcc(id), width, height, video->alignment)); assert(width && height); @@ -210,21 +208,35 @@ frame->id = id; frame->width = width; frame->height = height; + frame->rotation = 0; +} + +void +sna_video_frame_set_rotation(struct sna_video *video, + struct sna_video_frame *frame, + Rotation rotation) +{ + unsigned width = frame->width; + unsigned height = frame->height; + unsigned align; + + DBG(("%s: rotation=%d\n", __FUNCTION__, rotation)); + frame->rotation = rotation; align = video->alignment; #if SNA_XVMC /* for i915 xvmc, hw requires 1kb aligned surfaces */ - if (id == FOURCC_XVMC && video->sna->kgem.gen < 040 && align < 1024) + if (frame->id == FOURCC_XVMC && video->sna->kgem.gen < 040 && align < 1024) align = 1024; #endif /* Determine the desired destination pitch (representing the * chroma's pitch in the planar case). */ - if (is_planar_fourcc(id)) { + if (is_planar_fourcc(frame->id)) { assert((width & 1) == 0); assert((height & 1) == 0); - if (video->rotation & (RR_Rotate_90 | RR_Rotate_270)) { + if (rotation & (RR_Rotate_90 | RR_Rotate_270)) { frame->pitch[0] = ALIGN((height / 2), align); frame->pitch[1] = ALIGN(height, align); frame->size = width; @@ -235,7 +247,7 @@ } frame->size *= frame->pitch[0] + frame->pitch[1]; - if (video->rotation & (RR_Rotate_90 | RR_Rotate_270)) { + if (rotation & (RR_Rotate_90 | RR_Rotate_270)) { frame->UBufOffset = (int)frame->pitch[1] * width; frame->VBufOffset = frame->UBufOffset + (int)frame->pitch[0] * width / 2; @@ -247,7 +259,7 @@ } else { switch (frame->id) { case FOURCC_RGB888: - if (video->rotation & (RR_Rotate_90 | RR_Rotate_270)) { + if (rotation & (RR_Rotate_90 | RR_Rotate_270)) { frame->pitch[0] = ALIGN((height << 2), align); frame->size = (int)frame->pitch[0] * width; } else { @@ -257,7 +269,7 @@ frame->UBufOffset = frame->VBufOffset = 0; break; case FOURCC_RGB565: - if (video->rotation & (RR_Rotate_90 | RR_Rotate_270)) { + if (rotation & (RR_Rotate_90 | RR_Rotate_270)) { frame->pitch[0] = ALIGN((height << 1), align); frame->size = (int)frame->pitch[0] * width; } else { @@ -268,7 +280,7 @@ break; default: - if (video->rotation & (RR_Rotate_90 | RR_Rotate_270)) { + if (rotation & (RR_Rotate_90 | RR_Rotate_270)) { frame->pitch[0] = ALIGN((height << 1), align); frame->size = (int)frame->pitch[0] * width; } else { @@ -309,7 +321,7 @@ if (!video->textured) x = y = 0; - switch (video->rotation) { + switch (frame->rotation) { case RR_Rotate_0: dst += y * dstPitch + x; if (srcPitch == dstPitch && srcPitch == w) @@ -399,7 +411,7 @@ src = buf + (y * pitch) + (x << 1); - switch (video->rotation) { + switch (frame->rotation) { case RR_Rotate_0: w <<= 1; for (i = 0; i < h; i++) { @@ -481,16 +493,17 @@ DBG(("%s: handle=%d, size=%dx%d [%d], pitch=[%d,%d] rotation=%d, is-texture=%d\n", __FUNCTION__, frame->bo ? frame->bo->handle : 0, frame->width, frame->height, frame->size, frame->pitch[0], frame->pitch[1], - video->rotation, video->textured)); + frame->rotation, video->textured)); DBG(("%s: image=(%d, %d), (%d, %d), source=(%d, %d), (%d, %d)\n", __FUNCTION__, frame->image.x1, frame->image.y1, frame->image.x2, frame->image.y2, frame->src.x1, frame->src.y1, frame->src.x2, frame->src.y2)); assert(frame->width && frame->height); + assert(frame->rotation); assert(frame->size); /* In the common case, we can simply the upload in a single pwrite */ - if (video->rotation == RR_Rotate_0 && !video->tiled) { + if (frame->rotation == RR_Rotate_0 && !video->tiled) { DBG(("%s: unrotated, untiled fast paths: is-planar?=%d\n", __FUNCTION__, is_planar_fourcc(frame->id))); if (is_planar_fourcc(frame->id)) { @@ -500,8 +513,9 @@ ALIGN(w >> 1, 4) == frame->pitch[0] && ALIGN(w, 4) == frame->pitch[1]) { if (frame->bo) { - kgem_bo_write(&video->sna->kgem, frame->bo, - buf, frame->size); + if (!kgem_bo_write(&video->sna->kgem, frame->bo, + buf, frame->size)) + goto use_gtt; } else { frame->bo = kgem_create_buffer(&video->sna->kgem, frame->size, KGEM_BUFFER_WRITE | KGEM_BUFFER_WRITE_INPLACE, @@ -537,8 +551,9 @@ if (w*2 == frame->pitch[0]) { buf += (2U*y * frame->width) + (x << 1); if (frame->bo) { - kgem_bo_write(&video->sna->kgem, frame->bo, - buf, 2U*h*frame->width); + if (!kgem_bo_write(&video->sna->kgem, frame->bo, + buf, 2U*h*frame->width)) + goto use_gtt; } else { frame->bo = kgem_create_buffer(&video->sna->kgem, frame->size, KGEM_BUFFER_WRITE | KGEM_BUFFER_WRITE_INPLACE, @@ -555,7 +570,7 @@ DBG(("%s: source cropped, fallback\n", __FUNCTION__)); } - /* copy data, must use GTT so that we keep the overlay uncached */ +use_gtt: /* copy data, must use GTT so that we keep the overlay uncached */ if (frame->bo) { dst = kgem_bo_map__gtt(&video->sna->kgem, frame->bo); if (dst == NULL) diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_video.h xserver-xorg-video-intel-2.99.914/src/sna/sna_video.h --- xserver-xorg-video-intel-2.99.910/src/sna/sna_video.h 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_video.h 2014-04-23 10:34:32.000000000 +0000 @@ -77,8 +77,6 @@ int saturation; xf86CrtcPtr desired_crtc; - RegionRec clip; - uint32_t gamma0; uint32_t gamma1; uint32_t gamma2; @@ -86,8 +84,9 @@ uint32_t gamma4; uint32_t gamma5; - int color_key; - int color_key_changed; + unsigned color_key; + unsigned color_key_changed; + bool has_color_key; /** YUV data buffers */ struct kgem_bo *old_buf[2]; @@ -97,9 +96,10 @@ int alignment; bool tiled; bool textured; - Rotation rotation; int plane; - struct kgem_bo *bo; + + struct kgem_bo *bo[4]; + RegionRec clip; int SyncToVblank; /* -1: auto, 0: off, 1: on */ int AlwaysOnTop; @@ -111,6 +111,7 @@ uint32_t size; uint32_t UBufOffset; uint32_t VBufOffset; + Rotation rotation; uint16_t width, height; uint16_t pitch[2]; @@ -178,6 +179,11 @@ int id, short width, short height, struct sna_video_frame *frame); +void +sna_video_frame_set_rotation(struct sna_video *video, + struct sna_video_frame *frame, + Rotation rotation); + struct kgem_bo * sna_video_buffer(struct sna_video *video, struct sna_video_frame *frame); diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_video_overlay.c xserver-xorg-video-intel-2.99.914/src/sna/sna_video_overlay.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_video_overlay.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_video_overlay.c 2014-06-11 11:25:09.000000000 +0000 @@ -139,9 +139,9 @@ DRM_IOCTL_I915_OVERLAY_PUT_IMAGE, &request); - if (video->bo) - kgem_bo_destroy(&sna->kgem, video->bo); - video->bo = NULL; + if (video->bo[0]) + kgem_bo_destroy(&sna->kgem, video->bo[0]); + video->bo[0] = NULL; sna_video_free_buffers(video); sna_window_set_port((WindowPtr)draw, NULL); @@ -202,6 +202,7 @@ video->gamma5 = value; } else if (attribute == xvColorKey) { video->color_key = value; + RegionEmpty(&video->clip); DBG(("COLORKEY\n")); } else return BadMatch; @@ -218,9 +219,6 @@ if (!sna_video_overlay_update_attrs(video)) return BadValue; - if (attribute == xvColorKey) - RegionEmpty(&video->clip); - return Success; } @@ -455,10 +453,10 @@ return false; } - if (video->bo != frame->bo) { - if (video->bo) - kgem_bo_destroy(&sna->kgem, video->bo); - video->bo = kgem_bo_reference(frame->bo); + if (video->bo[0] != frame->bo) { + if (video->bo[0]) + kgem_bo_destroy(&sna->kgem, video->bo[0]); + video->bo[0] = kgem_bo_reference(frame->bo); } return true; @@ -518,8 +516,8 @@ drw_x, drw_y, drw_w, drw_h, format->id, width, height, sync)); - DBG(("%s: region %ld:(%d, %d), (%d, %d)\n", __FUNCTION__, - (long)RegionNumRects(&clip), + DBG(("%s: region %d:(%d, %d), (%d, %d)\n", __FUNCTION__, + region_num_rects(&clip), clip.extents.x1, clip.extents.y1, clip.extents.x2, clip.extents.y2)); @@ -535,7 +533,7 @@ goto invisible; /* overlay can't handle rotation natively, store it for the copy func */ - video->rotation = crtc->rotation; + sna_video_frame_set_rotation(video, &frame, crtc->rotation); if (xvmc_passthrough(format->id)) { DBG(("%s: using passthough, name=%d\n", @@ -583,8 +581,8 @@ __sna_pixmap_get_bo(sna->front), sna->front->drawable.bitsPerPixel, video->color_key, - RegionRects(&clip), - RegionNumRects(&clip))) + region_rects(&clip), + region_num_rects(&clip))) RegionCopy(&video->clip, &clip); sna_window_set_port((WindowPtr)draw, port); } else { @@ -644,6 +642,7 @@ case FOURCC_XVMC: *h = (*h + 1) & ~1; sna_video_frame_init(video, format->id, *w, *h, &frame); + sna_video_frame_set_rotation(video, &frame, RR_Rotate_0); size = sizeof(uint32_t); if (pitches) { pitches[0] = frame.pitch[1]; @@ -821,7 +820,6 @@ video->gamma2 = 0x202020; video->gamma1 = 0x101010; video->gamma0 = 0x080808; - video->rotation = RR_Rotate_0; RegionNull(&video->clip); xvColorKey = MAKE_ATOM("XV_COLORKEY"); diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_video_sprite.c xserver-xorg-video-intel-2.99.914/src/sna/sna_video_sprite.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_video_sprite.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_video_sprite.c 2014-07-22 08:12:01.000000000 +0000 @@ -35,20 +35,37 @@ #include #include +#include #include #include #include #include -#ifdef DRM_IOCTL_MODE_GETPLANERESOURCES -#include - -#define IMAGE_MAX_WIDTH 2048 -#define IMAGE_MAX_HEIGHT 2048 +#define fourcc_code(a,b,c,d) ((uint32_t)(a) | ((uint32_t)(b) << 8) | ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24)) +#define DRM_FORMAT_RGB565 fourcc_code('R', 'G', '1', '6') /* [15:0] R:G:B 5:6:5 little endian */ +#define DRM_FORMAT_XRGB8888 fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */ +#define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ +#define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ + +#define LOCAL_IOCTL_MODE_SETPLANE DRM_IOWR(0xB7, struct local_mode_set_plane) +struct local_mode_set_plane { + uint32_t plane_id; + uint32_t crtc_id; + uint32_t fb_id; /* fb object contains surface format type */ + uint32_t flags; + + /* Signed dest location allows it to be partially off screen */ + int32_t crtc_x, crtc_y; + uint32_t crtc_w, crtc_h; + + /* Source values are 16.16 fixed point */ + uint32_t src_x, src_y; + uint32_t src_h, src_w; +}; #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, true) -static Atom xvColorKey, xvAlwaysOnTop; +static Atom xvColorKey, xvAlwaysOnTop, xvSyncToVblank; static XvFormatRec formats[] = { {15}, {16}, {24} }; static const XvImageRec images[] = { XVIMAGE_YUY2, XVIMAGE_UYVY, XVMC_RGB888, XVMC_RGB565 }; @@ -62,22 +79,32 @@ DrawablePtr draw) { struct sna_video *video = port->devPriv.ptr; - struct drm_mode_set_plane s; + struct local_mode_set_plane s; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(video->sna->scrn); + int i; + + for (i = 0; i < config->num_crtc; i++) { + xf86CrtcPtr crtc = config->crtc[i]; + int pipe; - if (video->plane == 0) - return Success; + if (sna_crtc_id(crtc) == 0) + break; - memset(&s, 0, sizeof(s)); - s.plane_id = video->plane; - if (drmIoctl(video->sna->kgem.fd, DRM_IOCTL_MODE_SETPLANE, &s)) - xf86DrvMsg(video->sna->scrn->scrnIndex, X_ERROR, - "failed to disable plane\n"); - - if (video->bo) - kgem_bo_destroy(&video->sna->kgem, video->bo); - video->bo = NULL; + pipe = sna_crtc_to_pipe(crtc); + if (video->bo[pipe] == NULL) + continue; + + memset(&s, 0, sizeof(s)); + s.plane_id = sna_crtc_to_sprite(crtc); + if (drmIoctl(video->sna->kgem.fd, LOCAL_IOCTL_MODE_SETPLANE, &s)) + xf86DrvMsg(video->sna->scrn->scrnIndex, X_ERROR, + "failed to disable plane\n"); + + if (video->bo[pipe]) + kgem_bo_destroy(&video->sna->kgem, video->bo[pipe]); + video->bo[pipe] = NULL; + } - video->plane = 0; sna_window_set_port((WindowPtr)draw, NULL); return Success; @@ -91,13 +118,18 @@ struct sna_video *video = port->devPriv.ptr; if (attribute == xvColorKey) { - video->color_key_changed = true; + video->color_key_changed = ~0; video->color_key = value; + RegionEmpty(&video->clip); DBG(("COLORKEY = %ld\n", (long)value)); + } else if (attribute == xvSyncToVblank) { + DBG(("%s: SYNC_TO_VBLANK: %d -> %d\n", __FUNCTION__, + video->SyncToVblank, !!value)); + video->SyncToVblank = !!value; } else if (attribute == xvAlwaysOnTop) { DBG(("%s: ALWAYS_ON_TOP: %d -> %d\n", __FUNCTION__, video->AlwaysOnTop, !!value)); - video->color_key_changed = true; + video->color_key_changed = ~0; video->AlwaysOnTop = !!value; } else return BadMatch; @@ -116,6 +148,8 @@ *value = video->color_key; else if (attribute == xvAlwaysOnTop) *value = video->AlwaysOnTop; + else if (attribute == xvSyncToVblank) + *value = video->SyncToVblank; else return BadMatch; @@ -200,23 +234,26 @@ xf86CrtcPtr crtc, BoxPtr dstBox) { - struct drm_mode_set_plane s; + struct local_mode_set_plane s; + int pipe = sna_crtc_to_pipe(crtc); /* XXX handle video spanning multiple CRTC */ VG_CLEAR(s); - s.plane_id = sna_crtc_to_plane(crtc); - - update_dst_box_to_crtc_coords(sna, crtc, dstBox); - if (crtc->rotation & (RR_Rotate_90 | RR_Rotate_270)) { - int tmp = frame->width; - frame->width = frame->height; - frame->height = tmp; - } + s.plane_id = sna_crtc_to_sprite(crtc); -#if defined(DRM_I915_SET_SPRITE_COLORKEY) - if (video->color_key_changed || video->plane != s.plane_id) { - struct drm_intel_sprite_colorkey set; +#define DRM_I915_SET_SPRITE_COLORKEY 0x2b +#define LOCAL_IOCTL_I915_SET_SPRITE_COLORKEY DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_SET_SPRITE_COLORKEY, struct local_intel_sprite_colorkey) +#define LOCAL_IOCTL_MODE_ADDFB2 DRM_IOWR(0xb8, struct local_mode_fb_cmd2) + + if (video->color_key_changed & (1 << pipe) && video->has_color_key) { + struct local_intel_sprite_colorkey { + uint32_t plane_id; + uint32_t min_value; + uint32_t channel_mask; + uint32_t max_value; + uint32_t flags; + } set; DBG(("%s: updating color key: %x\n", __FUNCTION__, video->color_key)); @@ -227,58 +264,79 @@ set.channel_mask = 0x7 << 24 | 0xff << 16 | 0xff << 8 | 0xff << 0; set.flags = 0; if (!video->AlwaysOnTop) - set.flags = I915_SET_COLORKEY_DESTINATION; + set.flags |= 1 << 1; /* COLORKEY_DESTINATION */ if (drmIoctl(sna->kgem.fd, - DRM_IOCTL_I915_SET_SPRITE_COLORKEY, - &set)) + LOCAL_IOCTL_I915_SET_SPRITE_COLORKEY, + &set)) { xf86DrvMsg(sna->scrn->scrnIndex, X_ERROR, - "failed to update color key\n"); + "failed to update color key, disabling future updates\n"); + video->has_color_key = false; + } + + video->color_key_changed &= ~(1 << pipe); + } - video->color_key_changed = false; + if (video->bo[pipe] == frame->bo) + return true; + + update_dst_box_to_crtc_coords(sna, crtc, dstBox); + if (frame->rotation & (RR_Rotate_90 | RR_Rotate_270)) { + int tmp = frame->width; + frame->width = frame->height; + frame->height = tmp; } -#endif if (frame->bo->delta == 0) { - uint32_t offsets[4], pitches[4], handles[4]; - uint32_t pixel_format; + struct local_mode_fb_cmd2 { + uint32_t fb_id; + uint32_t width, height; + uint32_t pixel_format; + uint32_t flags; + + uint32_t handles[4]; + uint32_t pitches[4]; /* pitch for each plane */ + uint32_t offsets[4]; /* offset of each plane */ + } f; bool purged = true; - handles[0] = frame->bo->handle; - pitches[0] = frame->pitch[0]; - offsets[0] = 0; + memset(&f, 0, sizeof(f)); + f.width = frame->width; + f.height = frame->height; + f.handles[0] = frame->bo->handle; + f.pitches[0] = frame->pitch[0]; switch (frame->id) { case FOURCC_RGB565: - pixel_format = DRM_FORMAT_RGB565; + f.pixel_format = DRM_FORMAT_RGB565; purged = sna->scrn->depth != 16; break; case FOURCC_RGB888: - pixel_format = DRM_FORMAT_XRGB8888; + f.pixel_format = DRM_FORMAT_XRGB8888; purged = sna->scrn->depth != 24; break; case FOURCC_UYVY: - pixel_format = DRM_FORMAT_UYVY; + f.pixel_format = DRM_FORMAT_UYVY; break; case FOURCC_YUY2: default: - pixel_format = DRM_FORMAT_YUYV; + f.pixel_format = DRM_FORMAT_YUYV; break; } - DBG(("%s: creating new fb for handle=%d, width=%d, height=%d, stride=%d\n", - __FUNCTION__, frame->bo->handle, - frame->width, frame->height, pitches[0])); - - if (drmModeAddFB2(sna->kgem.fd, - frame->width, frame->height, pixel_format, - handles, pitches, offsets, - &frame->bo->delta, 0)) { + DBG(("%s: creating new fb for handle=%d, width=%d, height=%d, stride=%d, format=%x\n", + __FUNCTION__, frame->bo->handle, frame->width, frame->height, + f.pitches[0], f.pixel_format)); + + if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_ADDFB2, &f)) { + ERR(("%s: ADDFB2 failed, errno=%d\n", __FUNCTION__, errno)); xf86DrvMsg(sna->scrn->scrnIndex, - X_ERROR, "failed to add fb\n"); + X_ERROR, "failed to add fb, unable to update video\n"); return false; } + frame->bo->delta = f.fb_id; + frame->bo->scanout = true; /* Don't allow the scanout to be cached if not suitable for front */ frame->bo->purged = purged; @@ -304,30 +362,23 @@ s.crtc_x, s.crtc_y, s.crtc_w, s.crtc_h, s.src_x >> 16, s.src_y >> 16, s.src_w >> 16, s.src_h >> 16)); - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETPLANE, &s)) { + if (drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_SETPLANE, &s)) { DBG(("SET_PLANE failed: ret=%d\n", errno)); + memset(&s, 0, sizeof(s)); + s.plane_id = video->plane; + (void)drmIoctl(sna->kgem.fd, LOCAL_IOCTL_MODE_SETPLANE, &s); + if (video->bo[pipe]) { + kgem_bo_destroy(&sna->kgem, video->bo[pipe]); + video->bo[pipe] = NULL; + } return false; } frame->bo->domain = DOMAIN_NONE; - if (video->plane != s.plane_id) { - if (video->plane) { - memset(&s, 0, sizeof(s)); - s.plane_id = video->plane; - if (drmIoctl(video->sna->kgem.fd, DRM_IOCTL_MODE_SETPLANE, &s)) { - DBG(("SET_PLANE failed to turn off existing sprite: ret=%d\n", errno)); - return false; - } - } - video->plane = s.plane_id; - } - - if (video->bo != frame->bo) { - if (video->bo) - kgem_bo_destroy(&sna->kgem, video->bo); - video->bo = kgem_bo_reference(frame->bo); - } + if (video->bo[pipe]) + kgem_bo_destroy(&sna->kgem, video->bo[pipe]); + video->bo[pipe] = kgem_bo_reference(frame->bo); return true; } @@ -346,11 +397,9 @@ { struct sna_video *video = port->devPriv.ptr; struct sna *sna = video->sna; - struct sna_video_frame frame; - xf86CrtcPtr crtc; - BoxRec dst_box; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); RegionRec clip; - int ret; + int ret, i; clip.extents.x1 = draw->x + drw_x; clip.extents.y1 = draw->y + drw_y; @@ -361,8 +410,6 @@ DBG(("%s: always_on_top=%d\n", __FUNCTION__, video->AlwaysOnTop)); if (!video->AlwaysOnTop) RegionIntersect(&clip, &clip, gc->pCompositeClip); - if (box_empty(&clip.extents)) - goto invisible; DBG(("%s: src=(%d, %d),(%d, %d), dst=(%d, %d),(%d, %d), id=%d, sizep=%dx%d, sync?=%d\n", __FUNCTION__, @@ -371,87 +418,155 @@ format->id, width, height, sync)); DBG(("%s: region %d:(%d, %d), (%d, %d)\n", __FUNCTION__, - RegionNumRects(&clip), + region_num_rects(&clip), clip.extents.x1, clip.extents.y1, clip.extents.x2, clip.extents.y2)); - sna_video_frame_init(video, format->id, width, height, &frame); + if (RegionNil(&clip)) { + ret = Success; + goto err; + } - if (!sna_video_clip_helper(video, &frame, &crtc, &dst_box, - src_x, src_y, draw->x + drw_x, draw->y + drw_y, - src_w, src_h, drw_w, drw_h, - &clip)) - goto invisible; - - if (!crtc || sna_crtc_to_plane(crtc) == 0) - goto invisible; - - /* sprites can't handle rotation natively, store it for the copy func */ - video->rotation = crtc->rotation; - - if (xvmc_passthrough(format->id)) { - DBG(("%s: using passthough, name=%d\n", - __FUNCTION__, *(uint32_t *)buf)); - - if (*(uint32_t*)buf == 0) - goto invisible; - - frame.bo = kgem_create_for_name(&sna->kgem, *(uint32_t*)buf); - if (frame.bo == NULL) - return BadAlloc; - - if (kgem_bo_size(frame.bo) < frame.size) { - DBG(("%s: bo size=%d, expected=%d\n", - __FUNCTION__, kgem_bo_size(frame.bo), frame.size)); - kgem_bo_destroy(&sna->kgem, frame.bo); - return BadAlloc; + for (i = 0; i < config->num_crtc; i++) { + xf86CrtcPtr crtc = config->crtc[i]; + struct sna_video_frame frame; + int pipe; + INT32 x1, x2, y1, y2; + BoxRec dst; + RegionRec reg; + Rotation rotation; + + if (sna_crtc_id(crtc) == 0) + break; + + pipe = sna_crtc_to_pipe(crtc); + + sna_video_frame_init(video, format->id, width, height, &frame); + + reg.extents = crtc->bounds; + reg.data = NULL; + RegionIntersect(®, ®, &clip); + if (RegionNil(®)) { +off: + if (video->bo[pipe]) { + struct local_mode_set_plane s; + memset(&s, 0, sizeof(s)); + s.plane_id = sna_crtc_to_sprite(crtc); + if (drmIoctl(video->sna->kgem.fd, LOCAL_IOCTL_MODE_SETPLANE, &s)) + xf86DrvMsg(video->sna->scrn->scrnIndex, X_ERROR, + "failed to disable plane\n"); + video->bo[pipe] = NULL; + } + continue; } - frame.image.x1 = 0; - frame.image.y1 = 0; - frame.image.x2 = frame.width; - frame.image.y2 = frame.height; - } else { - frame.bo = sna_video_buffer(video, &frame); - if (frame.bo == NULL) { - DBG(("%s: failed to allocate video bo\n", __FUNCTION__)); - return BadAlloc; + x1 = src_x; + x2 = src_x + src_w; + y1 = src_y; + y2 = src_y + src_h; + + dst = clip.extents; + + ret = xf86XVClipVideoHelper(&dst, &x1, &x2, &y1, &y2, + ®, frame.width, frame.height); + RegionUninit(®); + if (!ret) + goto off; + + frame.src.x1 = x1 >> 16; + frame.src.y1 = y1 >> 16; + frame.src.x2 = (x2 + 0xffff) >> 16; + frame.src.y2 = (y2 + 0xffff) >> 16; + + frame.image.x1 = frame.src.x1 & ~1; + frame.image.x2 = ALIGN(frame.src.x2, 2); + if (is_planar_fourcc(frame.id)) { + frame.image.y1 = frame.src.y1 & ~1; + frame.image.y2 = ALIGN(frame.src.y2, 2); + } else { + frame.image.y1 = frame.src.y1; + frame.image.y2 = frame.src.y2; } - if (!sna_video_copy_data(video, &frame, buf)) { - DBG(("%s: failed to copy video data\n", __FUNCTION__)); - return BadAlloc; + /* if sprite can't handle rotation natively, store it for the copy func */ + rotation = RR_Rotate_0; + if (!sna_crtc_set_sprite_rotation(crtc, crtc->rotation)) { + sna_crtc_set_sprite_rotation(crtc, RR_Rotate_0); + rotation = crtc->rotation; } - } + sna_video_frame_set_rotation(video, &frame, rotation); - ret = Success; - if (!sna_video_sprite_show(sna, video, &frame, crtc, &dst_box)) { - DBG(("%s: failed to show video frame\n", __FUNCTION__)); - ret = BadAlloc; - } else { - //xf86XVFillKeyHelperDrawable(draw, video->color_key, &clip); - if (!video->AlwaysOnTop && !RegionEqual(&video->clip, &clip) && - sna_blt_fill_boxes(sna, GXcopy, - __sna_pixmap_get_bo(sna->front), - sna->front->drawable.bitsPerPixel, - video->color_key, - RegionRects(&clip), - RegionNumRects(&clip))) - RegionCopy(&video->clip, &clip); - sna_window_set_port((WindowPtr)draw, port); + if (xvmc_passthrough(format->id)) { + DBG(("%s: using passthough, name=%d\n", + __FUNCTION__, *(uint32_t *)buf)); + + if (*(uint32_t*)buf == 0) + goto err; + + frame.bo = kgem_create_for_name(&sna->kgem, *(uint32_t*)buf); + if (frame.bo == NULL) { + ret = BadAlloc; + goto err; + } + + if (kgem_bo_size(frame.bo) < frame.size) { + DBG(("%s: bo size=%d, expected=%d\n", + __FUNCTION__, kgem_bo_size(frame.bo), frame.size)); + kgem_bo_destroy(&sna->kgem, frame.bo); + ret = BadAlloc; + goto err; + } + + frame.image.x1 = 0; + frame.image.y1 = 0; + frame.image.x2 = frame.width; + frame.image.y2 = frame.height; + } else { + frame.bo = sna_video_buffer(video, &frame); + if (frame.bo == NULL) { + DBG(("%s: failed to allocate video bo\n", __FUNCTION__)); + ret = BadAlloc; + goto err; + } + + if (!sna_video_copy_data(video, &frame, buf)) { + DBG(("%s: failed to copy video data\n", __FUNCTION__)); + ret = BadAlloc; + goto err; + } + } + + ret = Success; + if (!sna_video_sprite_show(sna, video, &frame, crtc, &dst)) { + DBG(("%s: failed to show video frame\n", __FUNCTION__)); + ret = BadAlloc; + } + + frame.bo->domain = DOMAIN_NONE; + if (xvmc_passthrough(format->id)) + kgem_bo_destroy(&sna->kgem, frame.bo); + else + sna_video_buffer_fini(video); + + if (ret != Success) + goto err; } - frame.bo->domain = DOMAIN_NONE; - if (xvmc_passthrough(format->id)) - kgem_bo_destroy(&sna->kgem, frame.bo); - else - sna_video_buffer_fini(video); + if (!video->AlwaysOnTop && !RegionEqual(&video->clip, &clip) && + sna_blt_fill_boxes(sna, GXcopy, + __sna_pixmap_get_bo(sna->front), + sna->front->drawable.bitsPerPixel, + video->color_key, + region_rects(&clip), + region_num_rects(&clip))) + RegionCopy(&video->clip, &clip); + sna_window_set_port((WindowPtr)draw, port); - return ret; + return Success; -invisible: - /* If the video isn't visible on any CRTC, turn it off */ - return sna_video_sprite_stop(client, port, draw); +err: + (void)sna_video_sprite_stop(client, port, draw); + return ret; } static int sna_video_sprite_query(ClientPtr client, @@ -466,10 +581,10 @@ struct sna_video_frame frame; int size; - if (*w > IMAGE_MAX_WIDTH) - *w = IMAGE_MAX_WIDTH; - if (*h > IMAGE_MAX_HEIGHT) - *h = IMAGE_MAX_HEIGHT; + if (*w > video->sna->mode.max_crtc_width) + *w = video->sna->mode.max_crtc_width; + if (*h > video->sna->mode.max_crtc_height) + *h = video->sna->mode.max_crtc_height; if (offsets) offsets[0] = 0; @@ -477,9 +592,11 @@ switch (format->id) { case FOURCC_RGB888: case FOURCC_RGB565: - sna_video_frame_init(video, format->id, *w, *h, &frame); - if (pitches) + if (pitches) { + sna_video_frame_init(video, format->id, *w, *h, &frame); + sna_video_frame_set_rotation(video, &frame, RR_Rotate_0); pitches[0] = frame.pitch[0]; + } size = 4; break; @@ -516,22 +633,34 @@ return color_key & ((1 << scrn->depth) - 1); } +static bool sna_video_has_sprites(struct sna *sna) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); + int i; + + DBG(("%s: num_crtc=%d\n", __FUNCTION__, sna->mode.num_real_crtc)); + + if (sna->mode.num_real_crtc == 0) + return false; + + for (i = 0; i < sna->mode.num_real_crtc; i++) { + if (!sna_crtc_to_sprite(config->crtc[i])) { + DBG(("%s: no sprite found on pipe %d\n", __FUNCTION__, sna_crtc_to_pipe(config->crtc[i]))); + return false; + } + } + + DBG(("%s: yes\n", __FUNCTION__)); + return true; +} + void sna_video_sprite_setup(struct sna *sna, ScreenPtr screen) { XvAdaptorPtr adaptor; - struct drm_mode_get_plane_res r; struct sna_video *video; XvPortPtr port; - if (sna->flags & SNA_IS_HOSTED) - return; - - memset(&r, 0, sizeof(struct drm_mode_get_plane_res)); - if (drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETPLANERESOURCES, &r)) - return; - - DBG(("%s: %d sprite planes\n", __FUNCTION__, r.count_planes)); - if (r.count_planes == 0) + if (!sna_video_has_sprites(sna)) return; adaptor = sna_xv_adaptor_alloc(sna); @@ -555,8 +684,8 @@ adaptor->pEncodings[0].id = 0; adaptor->pEncodings[0].pScreen = screen; adaptor->pEncodings[0].name = (char *)"XV_IMAGE"; - adaptor->pEncodings[0].width = IMAGE_MAX_WIDTH; - adaptor->pEncodings[0].height = IMAGE_MAX_HEIGHT; + adaptor->pEncodings[0].width = sna->mode.max_crtc_width; + adaptor->pEncodings[0].height = sna->mode.max_crtc_height; adaptor->pEncodings[0].rate.numerator = 1; adaptor->pEncodings[0].rate.denominator = 1; adaptor->pFormats = formats; @@ -598,7 +727,8 @@ video->sna = sna; video->alignment = 64; video->color_key = sna_video_sprite_color_key(sna); - video->color_key_changed = true; + video->color_key_changed = ~0; + video->has_color_key = true; video->brightness = -19; /* (255/219) * -16 */ video->contrast = 75; /* 255/219 * 64 */ video->saturation = 146; /* 128/112 * 128 */ @@ -609,14 +739,10 @@ video->gamma2 = 0x202020; video->gamma1 = 0x101010; video->gamma0 = 0x080808; - video->rotation = RR_Rotate_0; RegionNull(&video->clip); + video->SyncToVblank = 1; xvColorKey = MAKE_ATOM("XV_COLORKEY"); xvAlwaysOnTop = MAKE_ATOM("XV_ALWAYS_ON_TOP"); + xvSyncToVblank = MAKE_ATOM("XV_SYNC_TO_VBLANK"); } -#else -void sna_video_sprite_setup(struct sna *sna, ScreenPtr screen) -{ -} -#endif diff -Nru xserver-xorg-video-intel-2.99.910/src/sna/sna_video_textured.c xserver-xorg-video-intel-2.99.914/src/sna/sna_video_textured.c --- xserver-xorg-video-intel-2.99.910/src/sna/sna_video_textured.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/sna/sna_video_textured.c 2014-06-11 11:25:09.000000000 +0000 @@ -170,6 +170,7 @@ struct sna *sna = video->sna; struct sna_video_frame frame; PixmapPtr pixmap = get_drawable_pixmap(draw); + unsigned int flags; BoxRec dstBox; RegionRec clip; xf86CrtcPtr crtc; @@ -192,17 +193,11 @@ drw_x, drw_y, drw_w, drw_h, format->id, width, height, sync)); - DBG(("%s: region %ld:(%d, %d), (%d, %d)\n", __FUNCTION__, - (long)RegionNumRects(&clip), + DBG(("%s: region %d:(%d, %d), (%d, %d)\n", __FUNCTION__, + region_num_rects(&clip), clip.extents.x1, clip.extents.y1, clip.extents.x2, clip.extents.y2)); - if (!sna_pixmap_move_to_gpu(pixmap, MOVE_READ | MOVE_WRITE)) { - DBG(("%s: attempting to render to a non-GPU pixmap\n", - __FUNCTION__)); - return BadAlloc; - } - sna_video_frame_init(video, format->id, width, height, &frame); if (!sna_video_clip_helper(video, &frame, &crtc, &dstBox, @@ -211,6 +206,18 @@ &clip)) return Success; + flags = MOVE_WRITE | __MOVE_FORCE; + if (clip.data) + flags |= MOVE_READ; + + if (!sna_pixmap_move_area_to_gpu(pixmap, &clip.extents, flags)) { + DBG(("%s: attempting to render to a non-GPU pixmap\n", + __FUNCTION__)); + return BadAlloc; + } + + sna_video_frame_set_rotation(video, &frame, RR_Rotate_0); + if (xvmc_passthrough(format->id)) { DBG(("%s: using passthough, name=%d\n", __FUNCTION__, *(uint32_t *)buf)); @@ -403,7 +410,6 @@ v->sna = sna; v->textured = true; v->alignment = 4; - v->rotation = RR_Rotate_0; v->SyncToVblank = (sna->flags & SNA_NO_WAIT) == 0; RegionNull(&v->clip); diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/i830_reg.h xserver-xorg-video-intel-2.99.914/src/uxa/i830_reg.h --- xserver-xorg-video-intel-2.99.910/src/uxa/i830_reg.h 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/i830_reg.h 2014-04-09 17:41:18.000000000 +0000 @@ -70,32 +70,32 @@ #define COLOR_BLT_WRITE_ALPHA (1<<21) #define COLOR_BLT_WRITE_RGB (1<<20) -#define XY_COLOR_BLT_CMD ((2<<29)|(0x50<<22)|(0x4)) +#define XY_COLOR_BLT_CMD ((2<<29)|(0x50<<22)) #define XY_COLOR_BLT_WRITE_ALPHA (1<<21) #define XY_COLOR_BLT_WRITE_RGB (1<<20) #define XY_COLOR_BLT_TILED (1<<11) -#define XY_SETUP_CLIP_BLT_CMD ((2<<29)|(3<<22)|1) +#define XY_SETUP_CLIP_BLT_CMD ((2<<29)|(3<<22)) -#define XY_SRC_COPY_BLT_CMD ((2<<29)|(0x53<<22)|6) +#define XY_SRC_COPY_BLT_CMD ((2<<29)|(0x53<<22)) #define XY_SRC_COPY_BLT_WRITE_ALPHA (1<<21) #define XY_SRC_COPY_BLT_WRITE_RGB (1<<20) #define XY_SRC_COPY_BLT_SRC_TILED (1<<15) #define XY_SRC_COPY_BLT_DST_TILED (1<<11) -#define SRC_COPY_BLT_CMD ((2<<29)|(0x43<<22)|0x4) +#define SRC_COPY_BLT_CMD ((2<<29)|(0x43<<22)) #define SRC_COPY_BLT_WRITE_ALPHA (1<<21) #define SRC_COPY_BLT_WRITE_RGB (1<<20) #define XY_PAT_BLT_IMMEDIATE ((2<<29)|(0x72<<22)) -#define XY_MONO_PAT_BLT_CMD ((0x2<<29)|(0x52<<22)|0x7) +#define XY_MONO_PAT_BLT_CMD ((0x2<<29)|(0x52<<22)) #define XY_MONO_PAT_VERT_SEED ((1<<10)|(1<<9)|(1<<8)) #define XY_MONO_PAT_HORT_SEED ((1<<14)|(1<<13)|(1<<12)) #define XY_MONO_PAT_BLT_WRITE_ALPHA (1<<21) #define XY_MONO_PAT_BLT_WRITE_RGB (1<<20) -#define XY_MONO_SRC_BLT_CMD ((0x2<<29)|(0x54<<22)|(0x6)) +#define XY_MONO_SRC_BLT_CMD ((0x2<<29)|(0x54<<22)) #define XY_MONO_SRC_BLT_WRITE_ALPHA (1<<21) #define XY_MONO_SRC_BLT_WRITE_RGB (1<<20) diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/intel_batchbuffer.c xserver-xorg-video-intel-2.99.914/src/uxa/intel_batchbuffer.c --- xserver-xorg-video-intel-2.99.910/src/uxa/intel_batchbuffer.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/intel_batchbuffer.c 2014-05-30 17:59:18.000000000 +0000 @@ -185,13 +185,21 @@ assert (!intel->in_batch_atomic); /* Big hammer, look to the pipelined flushes in future. */ - if ((INTEL_INFO(intel)->gen >= 060)) { + if ((INTEL_INFO(intel)->gen >= 0100)) { + /* Only BLT supported */ + BEGIN_BATCH_BLT(4); + OUT_BATCH(MI_FLUSH_DW | 2); + OUT_BATCH(0); /* address low */ + OUT_BATCH(0); /* address high */ + OUT_BATCH(0); /* dword data */ + ADVANCE_BATCH(); + } else if ((INTEL_INFO(intel)->gen >= 060)) { if (intel->current_batch == BLT_BATCH) { BEGIN_BATCH_BLT(4); OUT_BATCH(MI_FLUSH_DW | 2); - OUT_BATCH(0); - OUT_BATCH(0); - OUT_BATCH(0); + OUT_BATCH(0); /* address */ + OUT_BATCH(0); /* qword low */ + OUT_BATCH(0); /* qword high */ ADVANCE_BATCH(); } else { if ((INTEL_INFO(intel)->gen == 060)) { diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/intel_batchbuffer.h xserver-xorg-video-intel-2.99.914/src/uxa/intel_batchbuffer.h --- xserver-xorg-video-intel-2.99.910/src/uxa/intel_batchbuffer.h 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/intel_batchbuffer.h 2014-05-10 06:54:18.000000000 +0000 @@ -108,6 +108,8 @@ uint32_t read_domains, uint32_t write_domains, uint32_t delta, int needs_fence) { + uint64_t offset; + if (needs_fence) drm_intel_bo_emit_reloc_fence(intel->batch_bo, intel->batch_used * 4, @@ -118,7 +120,11 @@ bo, delta, read_domains, write_domains); - intel_batch_emit_dword(intel, bo->offset + delta); + offset = bo->offset64 + delta; + + intel_batch_emit_dword(intel, offset); + if (INTEL_INFO(intel)->gen >= 0100) + intel_batch_emit_dword(intel, offset >> 32); } static inline void diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/intel_display.c xserver-xorg-video-intel-2.99.914/src/uxa/intel_display.c --- xserver-xorg-video-intel-2.99.910/src/uxa/intel_display.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/intel_display.c 2014-06-27 15:37:50.000000000 +0000 @@ -43,6 +43,7 @@ #include "intel.h" #include "intel_bufmgr.h" #include "intel_options.h" +#include "backlight.h" #include "xf86drm.h" #include "xf86drmMode.h" #include "X11/Xatom.h" @@ -60,6 +61,22 @@ #define KNOWN_MODE_FLAGS ((1<<14)-1) +struct intel_drm_queue { + struct list list; + xf86CrtcPtr crtc; + uint32_t seq; + void *data; + ScrnInfoPtr scrn; + intel_drm_handler_proc handler; + intel_drm_abort_proc abort; +}; + +static void +intel_drm_abort_scrn(ScrnInfoPtr scrn); + +static uint32_t intel_drm_seq; +static struct list intel_drm_queue; + struct intel_mode { int fd; uint32_t fb_id; @@ -67,15 +84,17 @@ int cpp; drmEventContext event_context; - DRI2FrameEventPtr flip_info; int old_fb_id; int flip_count; - unsigned int fe_frame; - unsigned int fe_tv_sec; - unsigned int fe_tv_usec; + uint64_t fe_msc; + uint64_t fe_usec; struct list outputs; struct list crtcs; + + void *pageflip_data; + intel_pageflip_handler_proc pageflip_handler; + intel_pageflip_abort_proc pageflip_abort; }; struct intel_pageflip { @@ -96,6 +115,9 @@ struct list link; PixmapPtr scanout_pixmap; uint32_t scanout_fb_id; + int32_t vblank_offset; + uint32_t msc_prev; + uint64_t msc_high; }; struct intel_property { @@ -120,9 +142,8 @@ int panel_vdisplay; int dpms_mode; - const char *backlight_iface; + struct backlight backlight; int backlight_active_level; - int backlight_max; xf86OutputPtr output; struct list link; }; @@ -139,186 +160,23 @@ return crtc->mode_crtc->crtc_id; } -#ifdef __OpenBSD__ - -#include -#include "xf86Priv.h" - static void intel_output_backlight_set(xf86OutputPtr output, int level) { struct intel_output *intel_output = output->driver_private; - struct wsdisplay_param param; - - if (level > intel_output->backlight_max) - level = intel_output->backlight_max; - if (! intel_output->backlight_iface || level < 0) - return; - - param.param = WSDISPLAYIO_PARAM_BRIGHTNESS; - param.curval = level; - if (ioctl(xf86Info.consoleFd, WSDISPLAYIO_SETPARAM, ¶m) == -1) { + if (backlight_set(&intel_output->backlight, level) < 0) { xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, - "Failed to set backlight level: %s\n", - strerror(errno)); + "failed to set backlight %s to brightness level %d, disabling\n", + intel_output->backlight.iface, level); + backlight_disable(&intel_output->backlight); } } static int intel_output_backlight_get(xf86OutputPtr output) { - struct wsdisplay_param param; - - param.param = WSDISPLAYIO_PARAM_BRIGHTNESS; - if (ioctl(xf86Info.consoleFd, WSDISPLAYIO_GETPARAM, ¶m) == -1) { - xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, - "Failed to get backlight level: %s\n", - strerror(errno)); - return -1; - } - - return param.curval; -} - -static void -intel_output_backlight_init(xf86OutputPtr output) -{ struct intel_output *intel_output = output->driver_private; - struct wsdisplay_param param; - - param.param = WSDISPLAYIO_PARAM_BRIGHTNESS; - if (ioctl(xf86Info.consoleFd, WSDISPLAYIO_GETPARAM, ¶m) == -1) { - intel_output->backlight_iface = NULL; - return; - } - - intel_output->backlight_iface = "wscons"; - intel_output->backlight_max = param.max; - intel_output->backlight_active_level = param.curval; -} - -#else - -#define BACKLIGHT_CLASS "/sys/class/backlight" - -/* - * List of available kernel interfaces in priority order - */ -static const char *backlight_interfaces[] = { - "dell_backlight", - "gmux_backlight", - "asus-laptop", - "asus-nb-wmi", - "eeepc", - "thinkpad_screen", - "mbp_backlight", - "fujitsu-laptop", - "sony", - "samsung", - "acpi_video1", /* finally fallback to the generic acpi drivers */ - "acpi_video0", - "intel_backlight", - NULL, -}; -/* - * Must be long enough for BACKLIGHT_CLASS + '/' + longest in above table + - * '/' + "max_backlight" - */ -#define BACKLIGHT_PATH_LEN 80 -/* Enough for 10 digits of backlight + '\n' + '\0' */ -#define BACKLIGHT_VALUE_LEN 12 - -static void -intel_output_backlight_set(xf86OutputPtr output, int level) -{ - struct intel_output *intel_output = output->driver_private; - char path[BACKLIGHT_PATH_LEN], val[BACKLIGHT_VALUE_LEN]; - int fd, len, ret; - - if (level > intel_output->backlight_max) - level = intel_output->backlight_max; - if (! intel_output->backlight_iface || level < 0) - return; - - len = snprintf(val, BACKLIGHT_VALUE_LEN, "%d\n", level); - sprintf(path, "%s/%s/brightness", - BACKLIGHT_CLASS, intel_output->backlight_iface); - fd = open(path, O_RDWR); - if (fd == -1) { - xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "failed to open %s for backlight " - "control: %s\n", path, strerror(errno)); - return; - } - - ret = write(fd, val, len); - if (ret == -1) { - xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "write to %s for backlight " - "control failed: %s\n", path, strerror(errno)); - } - - close(fd); -} - -static int -intel_output_backlight_get(xf86OutputPtr output) -{ - struct intel_output *intel_output = output->driver_private; - char path[BACKLIGHT_PATH_LEN], val[BACKLIGHT_VALUE_LEN]; - int fd, level; - - sprintf(path, "%s/%s/actual_brightness", - BACKLIGHT_CLASS, intel_output->backlight_iface); - fd = open(path, O_RDONLY); - if (fd == -1) { - xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "failed to open %s " - "for backlight control: %s\n", path, strerror(errno)); - return -1; - } - - memset(val, 0, sizeof(val)); - if (read(fd, val, BACKLIGHT_VALUE_LEN) == -1) { - close(fd); - return -1; - } - - close(fd); - - level = atoi(val); - if (level > intel_output->backlight_max) - level = intel_output->backlight_max; - if (level < 0) - level = -1; - return level; -} - -static int -intel_output_backlight_get_max(xf86OutputPtr output) -{ - struct intel_output *intel_output = output->driver_private; - char path[BACKLIGHT_PATH_LEN], val[BACKLIGHT_VALUE_LEN]; - int fd, max = 0; - - sprintf(path, "%s/%s/max_brightness", - BACKLIGHT_CLASS, intel_output->backlight_iface); - fd = open(path, O_RDONLY); - if (fd == -1) { - xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "failed to open %s " - "for backlight control: %s\n", path, strerror(errno)); - return -1; - } - - memset(val, 0, sizeof(val)); - if (read(fd, val, BACKLIGHT_VALUE_LEN) == -1) { - close(fd); - return -1; - } - - close(fd); - - max = atoi(val); - if (max <= 0) - max = -1; - return max; + return backlight_get(&intel_output->backlight); } static void @@ -326,46 +184,39 @@ { struct intel_output *intel_output = output->driver_private; intel_screen_private *intel = intel_get_screen_private(output->scrn); - char path[BACKLIGHT_PATH_LEN]; - struct stat buf; char *str; - int i; + +#if !USE_BACKLIGHT + return; +#endif str = xf86GetOptValString(intel->Options, OPTION_BACKLIGHT); if (str != NULL) { - sprintf(path, "%s/%s", BACKLIGHT_CLASS, str); - if (!stat(path, &buf)) { - intel_output->backlight_iface = str; - intel_output->backlight_max = intel_output_backlight_get_max(output); - if (intel_output->backlight_max > 0) { - intel_output->backlight_active_level = intel_output_backlight_get(output); + if (backlight_exists(str) != BL_NONE) { + intel_output->backlight_active_level = + backlight_open(&intel_output->backlight, + strdup(str)); + if (intel_output->backlight_active_level != -1) { xf86DrvMsg(output->scrn->scrnIndex, X_CONFIG, - "found backlight control interface %s\n", path); + "found backlight control interface %s\n", str); return; } } + xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, "unrecognised backlight control interface %s\n", str); } - for (i = 0; backlight_interfaces[i] != NULL; i++) { - sprintf(path, "%s/%s", BACKLIGHT_CLASS, backlight_interfaces[i]); - if (!stat(path, &buf)) { - intel_output->backlight_iface = backlight_interfaces[i]; - intel_output->backlight_max = intel_output_backlight_get_max(output); - if (intel_output->backlight_max > 0) { - intel_output->backlight_active_level = intel_output_backlight_get(output); - xf86DrvMsg(output->scrn->scrnIndex, X_PROBED, - "found backlight control interface %s\n", path); - return; - } - } + intel_output->backlight_active_level = + backlight_open(&intel_output->backlight, NULL); + if (intel_output->backlight_active_level != -1) { + xf86DrvMsg(output->scrn->scrnIndex, X_PROBED, + "found backlight control interface %s\n", + intel_output->backlight.iface); + return; } - intel_output->backlight_iface = NULL; } -#endif - static void mode_from_kmode(ScrnInfoPtr scrn, drmModeModeInfoPtr kmode, @@ -469,6 +320,14 @@ xf86OutputPtr output = xf86_config->output[i]; struct intel_output *intel_output; + /* Make sure we mark the output as off (and save the backlight) + * before the kernel turns it off due to changing the pipe. + * This is necessary as the kernel may turn off the backlight + * and we lose track of the user settings. + */ + if (output->crtc == NULL) + output->funcs->dpms(output, DPMSModeOff); + if (output->crtc != crtc) continue; @@ -533,6 +392,7 @@ if (scrn->pScreen) xf86_reload_cursors(scrn->pScreen); + intel_drm_abort_scrn(scrn); done: free(output_ids); @@ -606,8 +466,8 @@ drmModeMoveCursor(mode->fd, crtc_id(intel_crtc), x, y); } -static void -intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image) +static int +__intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image) { struct intel_crtc *intel_crtc = crtc->driver_private; int ret; @@ -616,7 +476,23 @@ if (ret) xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, "failed to set cursor: %s\n", strerror(-ret)); + + return ret; +} + +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,902,2) +static Bool +intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image) +{ + return __intel_crtc_load_cursor_argb(crtc, image) == 0; +} +#else +static void +intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image) +{ + __intel_crtc_load_cursor_argb(crtc, image); } +#endif static void intel_crtc_hide_cursor(xf86CrtcPtr crtc) @@ -643,7 +519,7 @@ ScrnInfoPtr scrn = crtc->scrn; struct intel_crtc *intel_crtc = crtc->driver_private; struct intel_mode *mode = intel_crtc->mode; - unsigned long rotate_pitch; + int rotate_pitch; uint32_t tiling; int ret; @@ -814,7 +690,11 @@ .set_cursor_position = intel_crtc_set_cursor_position, .show_cursor = intel_crtc_show_cursor, .hide_cursor = intel_crtc_hide_cursor, +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,902,3) + .load_cursor_argb_check = intel_crtc_load_cursor_argb, +#else .load_cursor_argb = intel_crtc_load_cursor_argb, +#endif .shadow_create = intel_crtc_shadow_create, .shadow_allocate = intel_crtc_shadow_allocate, .shadow_destroy = intel_crtc_shadow_destroy, @@ -1075,6 +955,7 @@ intel_output->mode_output = NULL; list_del(&intel_output->link); + backlight_close(&intel_output->backlight); free(intel_output); output->driver_private = NULL; @@ -1085,7 +966,7 @@ { struct intel_output *intel_output = output->driver_private; - if (!intel_output->backlight_iface) + if (!intel_output->backlight.iface) return; if (mode == DPMSModeOn) { @@ -1123,11 +1004,10 @@ intel_output->dpms_mode, dpms); - if (output->crtc) - drmModeConnectorSetProperty(mode->fd, - intel_output->output_id, - props->prop_id, - dpms); + drmModeConnectorSetProperty(mode->fd, + intel_output->output_id, + props->prop_id, + dpms); if (dpms == DPMSModeOn) intel_output_dpms_backlight(output, @@ -1279,20 +1159,20 @@ } } - if (intel_output->backlight_iface) { + if (intel_output->backlight.iface) { /* Set up the backlight property, which takes effect * immediately and accepts values only within the * backlight_range. */ intel_output_create_ranged_atom(output, &backlight_atom, BACKLIGHT_NAME, 0, - intel_output->backlight_max, + intel_output->backlight.max, intel_output->backlight_active_level, FALSE); intel_output_create_ranged_atom(output, &backlight_deprecated_atom, BACKLIGHT_DEPRECATED_NAME, 0, - intel_output->backlight_max, + intel_output->backlight.max, intel_output->backlight_active_level, FALSE); } @@ -1316,7 +1196,7 @@ } val = *(INT32 *)value->data; - if (val < 0 || val > intel_output->backlight_max) + if (val < 0 || val > intel_output->backlight.max) return FALSE; if (intel_output->dpms_mode == DPMSModeOn) @@ -1382,12 +1262,16 @@ if (property == backlight_atom || property == backlight_deprecated_atom) { INT32 val; - if (! intel_output->backlight_iface) + if (!intel_output->backlight.iface) return FALSE; - val = intel_output_backlight_get(output); - if (val < 0) - return FALSE; + if (intel_output->dpms_mode == DPMSModeOn) { + val = intel_output_backlight_get(output); + if (val < 0) + return FALSE; + } else { + val = intel_output->backlight_active_level; + } err = RRChangeOutputProperty(output->randr_output, property, XA_INTEGER, 32, PropModeReplace, 1, &val, @@ -1529,7 +1413,7 @@ Bool ret; uint32_t old_fb_id; int i, old_width, old_height, old_pitch; - unsigned long pitch; + int pitch; uint32_t tiling; ScreenPtr screen; @@ -1559,8 +1443,7 @@ intel->front_buffer = intel_allocate_framebuffer(scrn, width, height, intel->cpp, - &pitch, - &tiling); + &pitch, &tiling); if (!intel->front_buffer) goto fail; @@ -1578,6 +1461,9 @@ scrn->virtualX = width; scrn->virtualY = height; + if (!intel_uxa_create_screen_resources(scrn->pScreen)) + goto fail; + for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; @@ -1588,8 +1474,6 @@ goto fail; } - intel_uxa_create_screen_resources(scrn->pScreen); - if (old_fb_id) drmModeRmFB(mode->fd, old_fb_id); if (old_front) @@ -1611,10 +1495,27 @@ return FALSE; } +static void +intel_pageflip_handler(ScrnInfoPtr scrn, xf86CrtcPtr crtc, + uint64_t frame, uint64_t usec, void *data); + +static void +intel_pageflip_abort(ScrnInfoPtr scrn, xf86CrtcPtr crtc, void *data); + +static void +intel_pageflip_complete(struct intel_mode *mode); + +static void +intel_drm_abort_seq (ScrnInfoPtr scrn, uint32_t seq); + Bool intel_do_pageflip(intel_screen_private *intel, dri_bo *new_front, - DRI2FrameEventPtr flip_info, int ref_crtc_hw_id) + int ref_crtc_hw_id, + Bool async, + void *pageflip_data, + intel_pageflip_handler_proc pageflip_handler, + intel_pageflip_abort_proc pageflip_abort) { ScrnInfoPtr scrn = intel->scrn; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); @@ -1623,6 +1524,8 @@ unsigned int pitch = scrn->displayWidth * intel->cpp; struct intel_pageflip *flip; uint32_t new_fb_id; + uint32_t flags; + uint32_t seq; int i; /* @@ -1637,6 +1540,10 @@ intel_glamor_flush(intel); intel_batch_submit(scrn); + mode->pageflip_data = pageflip_data; + mode->pageflip_handler = pageflip_handler; + mode->pageflip_abort = pageflip_abort; + /* * Queue flips on all enabled CRTCs * Note that if/when we get per-CRTC buffers, we'll have to update this. @@ -1646,17 +1553,16 @@ * Also, flips queued on disabled or incorrectly configured displays * may never complete; this is a configuration error. */ - mode->fe_frame = 0; - mode->fe_tv_sec = 0; - mode->fe_tv_usec = 0; + mode->fe_msc = 0; + mode->fe_usec = 0; + flags = DRM_MODE_PAGE_FLIP_EVENT; + if (async) + flags |= DRM_MODE_PAGE_FLIP_ASYNC; for (i = 0; i < config->num_crtc; i++) { if (!intel_crtc_on(config->crtc[i])) continue; - mode->flip_info = flip_info; - mode->flip_count++; - crtc = config->crtc[i]->driver_private; flip = calloc(1, sizeof(struct intel_pageflip)); @@ -1672,19 +1578,38 @@ flip->dispatch_me = (intel_crtc_to_pipe(crtc->crtc) == ref_crtc_hw_id); flip->mode = mode; + seq = intel_drm_queue_alloc(scrn, config->crtc[i], flip, intel_pageflip_handler, intel_pageflip_abort); + if (!seq) { + free(flip); + goto error_undo; + } + +again: if (drmModePageFlip(mode->fd, crtc_id(crtc), new_fb_id, - DRM_MODE_PAGE_FLIP_EVENT, flip)) { + flags, (void *)(uintptr_t)seq)) { + if (intel_mode_read_drm_events(intel)) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "flip queue retry\n"); + goto again; + } xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue failed: %s\n", strerror(errno)); + if (seq) + intel_drm_abort_seq(scrn, seq); free(flip); goto error_undo; } + mode->flip_count++; } mode->old_fb_id = mode->fb_id; mode->fb_id = new_fb_id; + + if (!mode->flip_count) + intel_pageflip_complete(mode); + return TRUE; error_undo: @@ -1697,6 +1622,8 @@ error_out: xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Page flip failed: %s\n", strerror(errno)); + + mode->flip_count = 0; return FALSE; } @@ -1704,45 +1631,303 @@ intel_xf86crtc_resize }; +/* + * Enqueue a potential drm response; when the associated response + * appears, we've got data to pass to the handler from here + */ +uint32_t +intel_drm_queue_alloc(ScrnInfoPtr scrn, + xf86CrtcPtr crtc, + void *data, + intel_drm_handler_proc handler, + intel_drm_abort_proc abort) +{ + struct intel_drm_queue *q; + + q = calloc(1, sizeof(struct intel_drm_queue)); + if (!q) + return 0; + + if (!intel_drm_seq) + ++intel_drm_seq; + q->seq = intel_drm_seq++; + q->scrn = scrn; + q->crtc = crtc; + q->data = data; + q->handler = handler; + q->abort = abort; + + list_add(&q->list, &intel_drm_queue); + + return q->seq; +} + +/* + * Abort one queued DRM entry, removing it + * from the list, calling the abort function and + * freeing the memory + */ static void -intel_vblank_handler(int fd, unsigned int frame, unsigned int tv_sec, - unsigned int tv_usec, void *event) +intel_drm_abort_one(struct intel_drm_queue *q) { - I830DRI2FrameEventHandler(frame, tv_sec, tv_usec, event); + list_del(&q->list); + q->abort(q->scrn, q->crtc, q->data); + free(q); } +/* + * Externally usable abort function that uses a callback to match a single queued + * entry to abort + */ +void +intel_drm_abort(ScrnInfoPtr scrn, Bool (*match)(void *data, void *match_data), void *match_data) +{ + struct intel_drm_queue *q; + + list_for_each_entry(q, &intel_drm_queue, list) { + if (match(q->data, match_data)) { + intel_drm_abort_one(q); + break; + } + } +} + +/* + * Abort by drm queue sequence number + */ +static void +intel_drm_abort_seq(ScrnInfoPtr scrn, uint32_t seq) +{ + struct intel_drm_queue *q; + + list_for_each_entry(q, &intel_drm_queue, list) { + if (q->seq == seq) { + intel_drm_abort_one(q); + break; + } + } +} + +/* + * Abort all queued entries on a specific scrn, used + * when resetting the X server + */ +static void +intel_drm_abort_scrn(ScrnInfoPtr scrn) +{ + struct intel_drm_queue *q, *tmp; + + list_for_each_entry_safe(q, tmp, &intel_drm_queue, list) { + if (q->scrn == scrn) + intel_drm_abort_one(q); + } +} + +static uint32_t pipe_select(int pipe) +{ + if (pipe > 1) + return pipe << DRM_VBLANK_HIGH_CRTC_SHIFT; + else if (pipe > 0) + return DRM_VBLANK_SECONDARY; + else + return 0; +} + +/* + * Get the current msc/ust value from the kernel + */ +static int +intel_get_msc_ust(ScrnInfoPtr scrn, xf86CrtcPtr crtc, uint32_t *msc, uint64_t *ust) +{ + intel_screen_private *intel = intel_get_screen_private(scrn); + drmVBlank vbl; + + /* Get current count */ + vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(intel_crtc_to_pipe(crtc)); + vbl.request.sequence = 0; + vbl.request.signal = 0; + if (drmWaitVBlank(intel->drmSubFD, &vbl)) { + *msc = 0; + *ust = 0; + return BadMatch; + } else { + *msc = vbl.reply.sequence; + *ust = (CARD64) vbl.reply.tval_sec * 1000000 + vbl.reply.tval_usec; + return Success; + } +} + +/* + * Convert a 32-bit kernel MSC sequence number to a 64-bit local sequence + * number, adding in the vblank_offset and high 32 bits, and dealing + * with 64-bit wrapping + */ +uint64_t +intel_sequence_to_crtc_msc(xf86CrtcPtr crtc, uint32_t sequence) +{ + struct intel_crtc *intel_crtc = crtc->driver_private; + + sequence += intel_crtc->vblank_offset; + if ((int32_t) (sequence - intel_crtc->msc_prev) < -0x40000000) + intel_crtc->msc_high += 0x100000000L; + intel_crtc->msc_prev = sequence; + return intel_crtc->msc_high + sequence; +} + +/* + * Get the current 64-bit adjust MSC and UST value + */ +int +intel_get_crtc_msc_ust(ScrnInfoPtr scrn, xf86CrtcPtr crtc, uint64_t *msc, uint64_t *ust) +{ + uint32_t sequence; + int ret; + + ret = intel_get_msc_ust(scrn, crtc, &sequence, ust); + if (ret) + return ret; + + *msc = intel_sequence_to_crtc_msc(crtc, sequence); + return 0; +} + +/* + * Convert a 64-bit adjusted MSC value into a 32-bit kernel sequence number, + * removing the high 32 bits and subtracting out the vblank_offset term. + * + * This also updates the vblank_offset when it notices that the value should + * change. + */ + +#define MAX_VBLANK_OFFSET 1000 + +uint32_t +intel_crtc_msc_to_sequence(ScrnInfoPtr scrn, xf86CrtcPtr crtc, uint64_t expect) +{ + struct intel_crtc *intel_crtc = crtc->driver_private; + uint64_t msc, ust; + + if (intel_get_crtc_msc_ust(scrn, crtc, &msc, &ust) == 0) { + int64_t diff = expect - msc; + + /* We're way off here, assume that the kernel has lost its mind + * and smack the vblank back to something sensible + */ + if (diff < -MAX_VBLANK_OFFSET || diff > MAX_VBLANK_OFFSET) { + intel_crtc->vblank_offset += (int32_t) diff; + if (intel_crtc->vblank_offset > -MAX_VBLANK_OFFSET && + intel_crtc->vblank_offset < MAX_VBLANK_OFFSET) + intel_crtc->vblank_offset = 0; + } + } + + return (uint32_t) (expect - intel_crtc->vblank_offset); +} + +/* + * General DRM kernel handler. Looks for the matching sequence number in the + * drm event queue and calls the handler for it. + */ +static void +intel_drm_handler(int fd, uint32_t frame, uint32_t sec, uint32_t usec, void *user_ptr) +{ + uint32_t user_data = (intptr_t)user_ptr; + struct intel_drm_queue *q; + + list_for_each_entry(q, &intel_drm_queue, list) { + if (q->seq == user_data) { + list_del(&q->list); + q->handler(q->scrn, q->crtc, + intel_sequence_to_crtc_msc(q->crtc, frame), + (uint64_t)sec * 1000000 + usec, q->data); + free(q); + break; + } + } +} + + +/* + * Notify the page flip caller that the flip is + * complete + */ static void -intel_page_flip_handler(int fd, unsigned int frame, unsigned int tv_sec, - unsigned int tv_usec, void *event_data) +intel_pageflip_complete(struct intel_mode *mode) +{ + /* Release framebuffer */ + drmModeRmFB(mode->fd, mode->old_fb_id); + + if (!mode->pageflip_handler) + return; + + mode->pageflip_handler(mode->fe_msc, mode->fe_usec, + mode->pageflip_data); +} + +/* + * One pageflip event has completed. Update the saved msc/ust values + * as needed, then check to see if the whole set of events are + * complete and notify the application at that point + */ +static struct intel_mode * +intel_handle_pageflip(struct intel_pageflip *flip, uint64_t msc, uint64_t usec) { - struct intel_pageflip *flip = event_data; struct intel_mode *mode = flip->mode; - /* Is this the event whose info shall be delivered to higher level? */ if (flip->dispatch_me) { /* Yes: Cache msc, ust for later delivery. */ - mode->fe_frame = frame; - mode->fe_tv_sec = tv_sec; - mode->fe_tv_usec = tv_usec; + mode->fe_msc = msc; + mode->fe_usec = usec; } free(flip); /* Last crtc completed flip? */ mode->flip_count--; if (mode->flip_count > 0) + return NULL; + + return mode; +} + +/* + * Called from the DRM event queue when a single flip has completed + */ +static void +intel_pageflip_handler(ScrnInfoPtr scrn, xf86CrtcPtr crtc, + uint64_t msc, uint64_t usec, void *data) +{ + struct intel_pageflip *flip = data; + struct intel_mode *mode = intel_handle_pageflip(flip, msc, usec); + + if (!mode) + return; + intel_pageflip_complete(mode); +} + +/* + * Called from the DRM queue abort code when a flip has been aborted + */ +static void +intel_pageflip_abort(ScrnInfoPtr scrn, xf86CrtcPtr crtc, void *data) +{ + struct intel_pageflip *flip = data; + struct intel_mode *mode = intel_handle_pageflip(flip, 0, 0); + + if (!mode) return; /* Release framebuffer */ drmModeRmFB(mode->fd, mode->old_fb_id); - if (mode->flip_info == NULL) + if (!mode->pageflip_abort) return; - /* Deliver cached msc, ust from reference crtc to flip event handler */ - I830DRI2FlipEventHandler(mode->fe_frame, mode->fe_tv_sec, - mode->fe_tv_usec, mode->flip_info); + mode->pageflip_abort(mode->pageflip_data); } +/* + * Check for pending DRM events and process them. + */ static void drm_wakeup_handler(pointer data, int err, pointer p) { @@ -1758,6 +1943,26 @@ drmHandleEvent(mode->fd, &mode->event_context); } +/* + * If there are any available, read drm_events + */ +int +intel_mode_read_drm_events(struct intel_screen_private *intel) +{ + struct intel_mode *mode = intel->modes; + struct pollfd p = { .fd = mode->fd, .events = POLLIN }; + int r; + + do { + r = poll(&p, 1, 0); + } while (r == -1 && (errno == EINTR || errno == EAGAIN)); + + if (r <= 0) + return 0; + + return drmHandleEvent(mode->fd, &mode->event_context); +} + static drmModeEncoderPtr intel_get_kencoder(struct intel_mode *mode, int num) { @@ -1857,8 +2062,12 @@ xf86InitialConfiguration(scrn, TRUE); mode->event_context.version = DRM_EVENT_CONTEXT_VERSION; - mode->event_context.vblank_handler = intel_vblank_handler; - mode->event_context.page_flip_handler = intel_page_flip_handler; + mode->event_context.vblank_handler = intel_drm_handler; + mode->event_context.page_flip_handler = intel_drm_handler; + + /* XXX assumes only one intel screen */ + list_init(&intel_drm_queue); + intel_drm_seq = 0; has_flipping = 0; gp.param = I915_PARAM_HAS_PAGEFLIPPING; @@ -1901,14 +2110,6 @@ } } -static Bool has_pending_events(int fd) -{ - struct pollfd pfd; - pfd.fd = fd; - pfd.events = POLLIN; - return poll(&pfd, 1, 0) == 1; -} - void intel_mode_close(intel_screen_private *intel) { @@ -1917,8 +2118,7 @@ if (mode == NULL) return; - while (has_pending_events(mode->fd)) - drmHandleEvent(mode->fd, &mode->event_context); + intel_drm_abort_scrn(intel->scrn); RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)NoopDDA, drm_wakeup_handler, mode); @@ -1997,7 +2197,8 @@ return FALSE; ret = (drm_crtc->mode_valid && - intel_crtc->mode->fb_id == drm_crtc->buffer_id); + (intel_crtc->mode->fb_id == drm_crtc->buffer_id || + intel_crtc->mode->old_fb_id == drm_crtc->buffer_id)); free(drm_crtc); return ret; diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/intel_dri3.c xserver-xorg-video-intel-2.99.914/src/uxa/intel_dri3.c --- xserver-xorg-video-intel-2.99.910/src/uxa/intel_dri3.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/intel_dri3.c 2014-05-14 11:00:32.000000000 +0000 @@ -0,0 +1,140 @@ +/* + * Copyright © 2013-2014 Intel Corporation + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "xorg-server.h" +#include "xf86.h" +#include "fb.h" + +#include "intel.h" +#include "dri3.h" + +static int +intel_dri3_open(ScreenPtr screen, + RRProviderPtr provider, + int *out) +{ + int fd; + + fd = intel_get_client_fd(xf86ScreenToScrn(screen)); + if (fd < 0) + return -fd; + + *out = fd; + return Success; +} + +static PixmapPtr intel_dri3_pixmap_from_fd(ScreenPtr screen, + int fd, + CARD16 width, + CARD16 height, + CARD16 stride, + CARD8 depth, + CARD8 bpp) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + intel_screen_private *intel = intel_get_screen_private(scrn); + struct intel_pixmap *priv; + PixmapPtr pixmap; + dri_bo *bo; + + if (depth < 8) + return NULL; + + switch (bpp) { + case 8: + case 16: + case 32: + break; + default: + return NULL; + } + + pixmap = fbCreatePixmap(screen, 0, 0, depth, 0); + if (!pixmap) + return NULL; + + if (!screen->ModifyPixmapHeader(pixmap, width, height, 0, 0, stride, NULL)) + goto free_pixmap; + + bo = drm_intel_bo_gem_create_from_prime(intel->bufmgr, + fd, (uint32_t)height * stride); + if (bo == NULL) + goto free_pixmap; + + intel_set_pixmap_bo(pixmap, bo); + dri_bo_unreference(bo); + + priv = intel_get_pixmap_private(pixmap); + if (priv == NULL) + goto free_pixmap; + + priv->pinned |= PIN_DRI3; + + return pixmap; + +free_pixmap: + fbDestroyPixmap(pixmap); + return NULL; +} + +static int intel_dri3_fd_from_pixmap(ScreenPtr screen, + PixmapPtr pixmap, + CARD16 *stride, + CARD32 *size) +{ + struct intel_pixmap *priv; + int fd; + + priv = intel_get_pixmap_private(pixmap); + if (!priv) + return -1; + + if (priv->stride > UINT16_MAX) + return -1; + + if (drm_intel_bo_gem_export_to_prime(priv->bo, &fd) < 0) + return -1; + + priv->pinned |= PIN_DRI3; + + *stride = priv->stride; + *size = priv->bo->size; + return fd; +} + +static dri3_screen_info_rec intel_dri3_screen_info = { + .version = DRI3_SCREEN_INFO_VERSION, + + .open = intel_dri3_open, + .pixmap_from_fd = intel_dri3_pixmap_from_fd, + .fd_from_pixmap = intel_dri3_fd_from_pixmap +}; + +Bool +intel_dri3_screen_init(ScreenPtr screen) +{ + return dri3_screen_init(screen, &intel_dri3_screen_info); +} diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/intel_dri.c xserver-xorg-video-intel-2.99.914/src/uxa/intel_dri.c --- xserver-xorg-video-intel-2.99.910/src/uxa/intel_dri.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/intel_dri.c 2014-05-23 13:45:03.000000000 +0000 @@ -575,14 +575,13 @@ } } -static int -I830DRI2DrawablePipe(DrawablePtr pDraw) +static xf86CrtcPtr +I830DRI2DrawableCrtc(DrawablePtr pDraw) { ScreenPtr pScreen = pDraw->pScreen; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); BoxRec box, crtcbox; xf86CrtcPtr crtc = NULL; - int pipe = -1; box.x1 = pDraw->x; box.y1 = pDraw->y; @@ -594,9 +593,9 @@ /* Make sure the CRTC is valid and this is the real front buffer */ if (crtc != NULL && !crtc->rotatedData) - pipe = intel_crtc_to_pipe(crtc); + return crtc; - return pipe; + return NULL; } static RESTYPE frame_event_client_type, frame_event_drawable_type; @@ -727,15 +726,15 @@ } static void -i830_dri2_del_frame_event(DrawablePtr drawable, DRI2FrameEventPtr info) +i830_dri2_del_frame_event(DRI2FrameEventPtr info) { list_del(&info->client_resource); list_del(&info->drawable_resource); if (info->front) - I830DRI2DestroyBuffer(drawable, info->front); + I830DRI2DestroyBuffer(NULL, info->front); if (info->back) - I830DRI2DestroyBuffer(drawable, info->back); + I830DRI2DestroyBuffer(NULL, info->back); free(info); } @@ -833,6 +832,24 @@ return bo; } +static void +I830DRI2FlipComplete(uint64_t frame, uint64_t usec, void *pageflip_data) +{ + DRI2FrameEventPtr info = pageflip_data; + + I830DRI2FlipEventHandler((uint32_t) frame, usec / 1000000, + usec % 1000000, + info); +} + +static void +I830DRI2FlipAbort(void *pageflip_data) +{ + DRI2FrameEventPtr info = pageflip_data; + + i830_dri2_del_frame_event(info); +} + /* * Our internal swap routine takes care of actually exchanging, blitting, or * flipping buffers as necessary. @@ -850,7 +867,9 @@ info->type = DRI2_SWAP; if (!intel_do_pageflip(intel, get_pixmap_bo(priv), - info, info->pipe)) + info->pipe, FALSE, info, + I830DRI2FlipComplete, + I830DRI2FlipAbort)) return FALSE; I830DRI2ExchangeBuffers(intel, info->front, info->back); @@ -905,7 +924,7 @@ } old_back = get_pixmap_bo(priv); - if (!intel_do_pageflip(intel, old_back, info, info->pipe)) { + if (!intel_do_pageflip(intel, old_back, info->pipe, FALSE, info, I830DRI2FlipComplete, I830DRI2FlipAbort)) { intel->back_buffer = new_back; return FALSE; } @@ -954,7 +973,7 @@ if (!pScrn->vtSema) return FALSE; - if (I830DRI2DrawablePipe(drawable) < 0) + if (I830DRI2DrawableCrtc(drawable) == NULL) return FALSE; if (!DRI2CanFlip(drawable)) @@ -1004,7 +1023,7 @@ status = dixLookupDrawable(&drawable, swap_info->drawable_id, serverClient, M_ANY, DixWriteAccess); if (status != Success) { - i830_dri2_del_frame_event(NULL, swap_info); + i830_dri2_del_frame_event(swap_info); return; } @@ -1038,7 +1057,7 @@ break; } - i830_dri2_del_frame_event(drawable, swap_info); + i830_dri2_del_frame_event(swap_info); } void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec, @@ -1099,7 +1118,7 @@ serverClient, M_ANY, DixWriteAccess); if (chain_drawable == NULL) { - i830_dri2_del_frame_event(chain_drawable, chain); + i830_dri2_del_frame_event(chain); } else if (!can_exchange(chain_drawable, chain->front, chain->back) || !I830DRI2ScheduleFlip(intel, chain_drawable, chain)) { I830DRI2FallbackBlitSwap(chain_drawable, @@ -1110,7 +1129,7 @@ DRI2_BLIT_COMPLETE, chain->client ? chain->event_complete : NULL, chain->event_data); - i830_dri2_del_frame_event(chain_drawable, chain); + i830_dri2_del_frame_event(chain); } } break; @@ -1122,7 +1141,7 @@ break; } - i830_dri2_del_frame_event(drawable, flip_info); + i830_dri2_del_frame_event(flip_info); } static uint32_t pipe_select(int pipe) @@ -1135,6 +1154,28 @@ return 0; } +static void +intel_dri2_vblank_handler(ScrnInfoPtr scrn, + xf86CrtcPtr crtc, + uint64_t msc, + uint64_t usec, + void *data) +{ + DRI2FrameEventPtr swap_info = data; + + I830DRI2FrameEventHandler((uint32_t) msc, usec / 1000000, usec % 1000000, swap_info); +} + +static void +intel_dri2_vblank_abort(ScrnInfoPtr scrn, + xf86CrtcPtr crtc, + void *data) +{ + DRI2FrameEventPtr swap_info = data; + + i830_dri2_del_frame_event(swap_info); +} + /* * ScheduleSwap is responsible for requesting a DRM vblank event for the * appropriate frame. @@ -1164,21 +1205,20 @@ ScrnInfoPtr scrn = xf86ScreenToScrn(screen); intel_screen_private *intel = intel_get_screen_private(scrn); drmVBlank vbl; - int ret, pipe = I830DRI2DrawablePipe(draw), flip = 0; + int ret; + xf86CrtcPtr crtc = I830DRI2DrawableCrtc(draw); + int pipe = crtc ? intel_crtc_to_pipe(crtc) : -1; + int flip = 0; DRI2FrameEventPtr swap_info = NULL; enum DRI2FrameEventType swap_type = DRI2_SWAP; - CARD64 current_msc; + uint64_t current_msc, current_ust; + uint64_t request_msc; + uint32_t seq; /* Drawable not displayed... just complete the swap */ if (pipe == -1) goto blit_fallback; - /* Truncate to match kernel interfaces; means occasional overflow - * misses, but that's generally not a big deal */ - *target_msc &= 0xffffffff; - divisor &= 0xffffffff; - remainder &= 0xffffffff; - swap_info = calloc(1, sizeof(DRI2FrameEventRec)); if (!swap_info) goto blit_fallback; @@ -1201,18 +1241,9 @@ I830DRI2ReferenceBuffer(front); I830DRI2ReferenceBuffer(back); - /* Get current count */ - vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe); - vbl.request.sequence = 0; - ret = drmWaitVBlank(intel->drmSubFD, &vbl); - if (ret) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "first get vblank counter failed: %s\n", - strerror(errno)); - goto blit_fallback; - } - - current_msc = vbl.reply.sequence; + ret = intel_get_crtc_msc_ust(scrn, crtc, ¤t_msc, ¤t_ust); + if (ret) + goto blit_fallback; /* Flips need to be submitted one frame before */ if (can_exchange(draw, front, back)) { @@ -1261,8 +1292,13 @@ if (current_msc >= *target_msc) *target_msc = current_msc; - vbl.request.sequence = *target_msc; - vbl.request.signal = (unsigned long)swap_info; + seq = intel_drm_queue_alloc(scrn, crtc, swap_info, intel_dri2_vblank_handler, intel_dri2_vblank_abort); + if (!seq) + goto blit_fallback; + + vbl.request.sequence = intel_crtc_msc_to_sequence(scrn, crtc, *target_msc); + vbl.request.signal = seq; + ret = drmWaitVBlank(intel->drmSubFD, &vbl); if (ret) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, @@ -1271,7 +1307,7 @@ goto blit_fallback; } - *target_msc = vbl.reply.sequence + flip; + *target_msc = intel_sequence_to_crtc_msc(crtc, vbl.reply.sequence + flip); swap_info->frame = *target_msc; return TRUE; @@ -1287,8 +1323,8 @@ if (flip == 0) vbl.request.type |= DRM_VBLANK_NEXTONMISS; - vbl.request.sequence = current_msc - (current_msc % divisor) + - remainder; + request_msc = current_msc - (current_msc % divisor) + + remainder; /* * If the calculated deadline vbl.request.sequence is smaller than @@ -1301,13 +1337,17 @@ * into account, as well as a potential DRM_VBLANK_NEXTONMISS delay * if we are blitting/exchanging instead of flipping. */ - if (vbl.request.sequence <= current_msc) - vbl.request.sequence += divisor; + if (request_msc <= current_msc) + request_msc += divisor; + + seq = intel_drm_queue_alloc(scrn, crtc, swap_info, intel_dri2_vblank_handler, intel_dri2_vblank_abort); + if (!seq) + goto blit_fallback; /* Account for 1 frame extra pageflip delay if flip > 0 */ - vbl.request.sequence -= flip; + vbl.request.sequence = intel_crtc_msc_to_sequence(scrn, crtc, request_msc) - flip; + vbl.request.signal = seq; - vbl.request.signal = (unsigned long)swap_info; ret = drmWaitVBlank(intel->drmSubFD, &vbl); if (ret) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, @@ -1317,7 +1357,7 @@ } /* Adjust returned value for 1 fame pageflip offset of flip > 0 */ - *target_msc = vbl.reply.sequence + flip; + *target_msc = intel_sequence_to_crtc_msc(crtc, vbl.reply.sequence + flip); swap_info->frame = *target_msc; return TRUE; @@ -1326,7 +1366,7 @@ I830DRI2FallbackBlitSwap(draw, front, back); DRI2SwapComplete(client, draw, 0, 0, 0, DRI2_BLIT_COMPLETE, func, data); if (swap_info) - i830_dri2_del_frame_event(draw, swap_info); + i830_dri2_del_frame_event(swap_info); *target_msc = 0; /* offscreen, so zero out target vblank count */ return TRUE; } @@ -1350,21 +1390,18 @@ { ScreenPtr screen = draw->pScreen; ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - intel_screen_private *intel = intel_get_screen_private(scrn); - drmVBlank vbl; - int ret, pipe = I830DRI2DrawablePipe(draw); + int ret; + xf86CrtcPtr crtc = I830DRI2DrawableCrtc(draw); /* Drawable not displayed, make up a *monotonic* value */ - if (pipe == -1) { + if (crtc == NULL) { +fail: *ust = gettime_us(); *msc = 0; return TRUE; } - vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe); - vbl.request.sequence = 0; - - ret = drmWaitVBlank(intel->drmSubFD, &vbl); + ret = intel_get_crtc_msc_ust(scrn, crtc, msc, ust); if (ret) { static int limit = 5; if (limit) { @@ -1374,12 +1411,9 @@ strerror(errno)); limit--; } - return FALSE; + goto fail; } - *ust = ((CARD64)vbl.reply.tval_sec * 1000000) + vbl.reply.tval_usec; - *msc = vbl.reply.sequence; - return TRUE; } @@ -1398,14 +1432,11 @@ intel_screen_private *intel = intel_get_screen_private(scrn); DRI2FrameEventPtr wait_info; drmVBlank vbl; - int ret, pipe = I830DRI2DrawablePipe(draw); - CARD64 current_msc; - - /* Truncate to match kernel interfaces; means occasional overflow - * misses, but that's generally not a big deal */ - target_msc &= 0xffffffff; - divisor &= 0xffffffff; - remainder &= 0xffffffff; + int ret; + xf86CrtcPtr crtc = I830DRI2DrawableCrtc(draw); + int pipe = crtc ? intel_crtc_to_pipe(crtc) : -1; + CARD64 current_msc, current_ust, request_msc; + uint32_t seq; /* Drawable not visible, return immediately */ if (pipe == -1) @@ -1427,22 +1458,9 @@ } /* Get current count */ - vbl.request.type = DRM_VBLANK_RELATIVE | pipe_select(pipe); - vbl.request.sequence = 0; - ret = drmWaitVBlank(intel->drmSubFD, &vbl); - if (ret) { - static int limit = 5; - if (limit) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "%s:%d get vblank counter failed: %s\n", - __FUNCTION__, __LINE__, - strerror(errno)); - limit--; - } - goto out_free; - } - - current_msc = vbl.reply.sequence; + ret = intel_get_crtc_msc_ust(scrn, crtc, ¤t_msc, ¤t_ust); + if (ret) + goto out_free; /* * If divisor is zero, or current_msc is smaller than target_msc, @@ -1456,12 +1474,17 @@ * sending us MSC targets from the past by forcibly updating * their count on this call. */ + seq = intel_drm_queue_alloc(scrn, crtc, wait_info, intel_dri2_vblank_handler, intel_dri2_vblank_abort); + if (!seq) + goto out_free; + if (current_msc >= target_msc) target_msc = current_msc; vbl.request.type = DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT | pipe_select(pipe); - vbl.request.sequence = target_msc; - vbl.request.signal = (unsigned long)wait_info; + vbl.request.sequence = intel_crtc_msc_to_sequence(scrn, crtc, target_msc); + vbl.request.signal = seq; + ret = drmWaitVBlank(intel->drmSubFD, &vbl); if (ret) { static int limit = 5; @@ -1475,7 +1498,7 @@ goto out_free; } - wait_info->frame = vbl.reply.sequence; + wait_info->frame = intel_sequence_to_crtc_msc(crtc, vbl.reply.sequence); DRI2BlockClient(client, draw); return TRUE; } @@ -1487,9 +1510,8 @@ vbl.request.type = DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT | pipe_select(pipe); - vbl.request.sequence = current_msc - (current_msc % divisor) + - remainder; - + request_msc = current_msc - (current_msc % divisor) + + remainder; /* * If calculated remainder is larger than requested remainder, * it means we've passed the last point where @@ -1497,9 +1519,15 @@ * that will happen. */ if ((current_msc % divisor) >= remainder) - vbl.request.sequence += divisor; + request_msc += divisor; + + seq = intel_drm_queue_alloc(scrn, crtc, wait_info, intel_dri2_vblank_handler, intel_dri2_vblank_abort); + if (!seq) + goto out_free; + + vbl.request.sequence = intel_crtc_msc_to_sequence(scrn, crtc, request_msc); + vbl.request.signal = seq; - vbl.request.signal = (unsigned long)wait_info; ret = drmWaitVBlank(intel->drmSubFD, &vbl); if (ret) { static int limit = 5; @@ -1513,13 +1541,13 @@ goto out_free; } - wait_info->frame = vbl.reply.sequence; + wait_info->frame = intel_sequence_to_crtc_msc(crtc, vbl.reply.sequence); DRI2BlockClient(client, draw); return TRUE; out_free: - i830_dri2_del_frame_event(draw, wait_info); + i830_dri2_del_frame_event(wait_info); out_complete: DRI2WaitMSCComplete(client, draw, target_msc, 0, 0); return TRUE; @@ -1649,6 +1677,5 @@ intel_screen_private *intel = intel_get_screen_private(scrn); DRI2CloseScreen(screen); - intel->directRenderingType = DRI_NONE; drmFree(intel->deviceName); } diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/intel_driver.c xserver-xorg-video-intel-2.99.914/src/uxa/intel_driver.c --- xserver-xorg-video-intel-2.99.910/src/uxa/intel_driver.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/intel_driver.c 2014-07-23 11:57:21.000000000 +0000 @@ -232,77 +232,24 @@ { intel_screen_private *intel = intel_get_screen_private(scrn); - intel->directRenderingType = DRI_NONE; + intel->dri2 = intel->dri3 = DRI_NONE; if (!intel_option_cast_string_to_bool(intel, OPTION_DRI, TRUE)) - intel->directRenderingType = DRI_DISABLED; + intel->dri2 = intel->dri3 = DRI_DISABLED; if (scrn->depth != 16 && scrn->depth != 24 && scrn->depth != 30) { xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "DRI is disabled because it " "runs only at depths 16, 24, and 30.\n"); - intel->directRenderingType = DRI_DISABLED; + intel->dri2 = intel->dri3 = DRI_DISABLED; } } static Bool intel_open_drm_master(ScrnInfoPtr scrn) { intel_screen_private *intel = intel_get_screen_private(scrn); - struct pci_device *dev = intel->PciInfo; - drmSetVersion sv; - struct drm_i915_getparam gp; - int err, has_gem; - char busid[20]; - snprintf(busid, sizeof(busid), "pci:%04x:%02x:%02x.%d", - dev->domain, dev->bus, dev->dev, dev->func); - - intel->drmSubFD = drmOpen(NULL, busid); - if (intel->drmSubFD == -1) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "[drm] Failed to open DRM device for %s: %s\n", - busid, strerror(errno)); - return FALSE; - } - - /* Check that what we opened was a master or a master-capable FD, - * by setting the version of the interface we'll use to talk to it. - * (see DRIOpenDRMMaster() in DRI1) - */ - sv.drm_di_major = 1; - sv.drm_di_minor = 1; - sv.drm_dd_major = -1; - sv.drm_dd_minor = -1; - err = drmSetInterfaceVersion(intel->drmSubFD, &sv); - if (err != 0) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "[drm] failed to set drm interface version.\n"); - drmClose(intel->drmSubFD); - intel->drmSubFD = -1; - return FALSE; - } - - has_gem = FALSE; - gp.param = I915_PARAM_HAS_GEM; - gp.value = &has_gem; - (void)drmCommandWriteRead(intel->drmSubFD, DRM_I915_GETPARAM, - &gp, sizeof(gp)); - if (!has_gem) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "[drm] Failed to detect GEM. Kernel 2.6.28 required.\n"); - drmClose(intel->drmSubFD); - intel->drmSubFD = -1; - return FALSE; - } - - return TRUE; -} - -static void intel_close_drm_master(intel_screen_private *intel) -{ - if (intel && intel->drmSubFD > 0) { - drmClose(intel->drmSubFD); - intel->drmSubFD = -1; - } + intel->drmSubFD = intel_get_device(scrn); + return intel->drmSubFD != -1; } static int intel_init_bufmgr(intel_screen_private *intel) @@ -405,9 +352,6 @@ if (INTEL_INFO(intel)->gen == -1) return FALSE; - if (INTEL_INFO(intel)->gen >= 0100) - return FALSE; - if (xf86ReturnOptValBool(intel->Options, OPTION_ACCEL_DISABLE, FALSE) || !intel_option_cast_string_to_bool(intel, OPTION_ACCEL_METHOD, TRUE)) { xf86DrvMsg(intel->scrn->scrnIndex, X_CONFIG, @@ -503,12 +447,12 @@ if (flags & PROBE_DETECT) return TRUE; - if (((uintptr_t)scrn->driverPrivate) & 1) { + if (((uintptr_t)scrn->driverPrivate) & 3) { intel = xnfcalloc(sizeof(*intel), 1); if (intel == NULL) return FALSE; - intel->info = (void *)((uintptr_t)scrn->driverPrivate & ~1); + intel->info = (void *)((uintptr_t)scrn->driverPrivate & ~3); scrn->driverPrivate = intel; } intel = intel_get_screen_private(scrn); @@ -655,9 +599,15 @@ return FALSE; } - /* Load the dri2 module if requested. */ - if (intel->directRenderingType != DRI_DISABLED) - xf86LoadSubModule(scrn, "dri2"); + /* Load the dri modules if requested. */ +#if HAVE_DRI2 + if (intel->dri2 != DRI_DISABLED && !xf86LoadSubModule(scrn, "dri2")) + intel->dri2 = DRI_DISABLED; +#endif +#if HAVE_DRI3 + if (intel->dri3 != DRI_DISABLED && !xf86LoadSubModule(scrn, "dri3")) + intel->dri3 = DRI_DISABLED; +#endif return TRUE; } @@ -767,14 +717,13 @@ intel_screen_private *intel = intel_get_screen_private(scrn); int width = scrn->virtualX; int height = scrn->virtualY; - unsigned long pitch; + int pitch; uint32_t tiling; intel->front_buffer = intel_allocate_framebuffer(scrn, width, height, intel->cpp, - &pitch, - &tiling); + &pitch, &tiling); if (!intel->front_buffer) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, @@ -927,18 +876,12 @@ */ intel->XvEnabled = TRUE; -#ifdef DRI2 - if (intel->directRenderingType == DRI_NONE - && I830DRI2ScreenInit(screen)) - intel->directRenderingType = DRI_DRI2; -#endif - if (!intel_init_initial_framebuffer(scrn)) return FALSE; intel_batch_init(scrn); - if (INTEL_INFO(intel)->gen >= 040) + if (INTEL_INFO(intel)->gen >= 040 && INTEL_INFO(intel)->gen < 0100) gen4_render_state_init(scrn); miClearVisualTypes(); @@ -949,6 +892,7 @@ if (!miSetPixmapDepths()) return FALSE; + /* Must be first, before anything else installs screen callbacks. */ if (!fbScreenInit(screen, NULL, scrn->virtualX, scrn->virtualY, scrn->xDpi, scrn->yDpi, @@ -980,6 +924,21 @@ return FALSE; } +#if HAVE_DRI2 + if (intel->dri2 == DRI_NONE && I830DRI2ScreenInit(screen)) + intel->dri2 = DRI_ACTIVE; +#endif + +#if HAVE_DRI3 + if (!intel_sync_init(screen)) + intel->dri3 = DRI_DISABLED; + if (intel->dri3 == DRI_NONE && intel_dri3_screen_init(screen)) + intel->dri3 = DRI_ACTIVE; +#endif + + if (xf86ReturnOptValBool(intel->Options, OPTION_PRESENT, TRUE)) + intel_present_screen_init(screen); + xf86SetBackingStore(screen); xf86SetSilkenMouse(screen); miDCInitialize(screen, xf86GetPointerScreenFuncs()); @@ -1033,7 +992,7 @@ #ifdef INTEL_XVMC if (INTEL_INFO(intel)->gen >= 040) intel->XvMCEnabled = TRUE; - from = ((intel->directRenderingType == DRI_DRI2) && + from = (intel->dri2 == DRI_ACTIVE && xf86GetOptValBool(intel->Options, OPTION_XVMC, &intel->XvMCEnabled) ? X_CONFIG : X_DEFAULT); xf86DrvMsg(scrn->scrnIndex, from, "Intel XvMC decoder %sabled\n", @@ -1043,25 +1002,44 @@ if (intel->XvEnabled) I830InitVideo(screen); -#if defined(DRI2) - switch (intel->directRenderingType) { - case DRI_DRI2: - intel->directRenderingOpen = TRUE; +#if HAVE_DRI2 + switch (intel->dri2) { + case DRI_ACTIVE: xf86DrvMsg(scrn->scrnIndex, X_INFO, - "direct rendering: DRI2 Enabled\n"); + "DRI2: Enabled\n"); break; case DRI_DISABLED: xf86DrvMsg(scrn->scrnIndex, X_INFO, - "direct rendering: Disabled\n"); + "DRI2: Disabled\n"); break; case DRI_NONE: xf86DrvMsg(scrn->scrnIndex, X_INFO, - "direct rendering: Failed\n"); + "DRI2: Failed\n"); break; } #else xf86DrvMsg(scrn->scrnIndex, X_INFO, - "direct rendering: Not available\n"); + "DRI2: Not available\n"); +#endif + +#if HAVE_DRI3 + switch (intel->dri3) { + case DRI_ACTIVE: + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "DRI3: Enabled\n"); + break; + case DRI_DISABLED: + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "DRI3: Disabled\n"); + break; + case DRI_NONE: + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "DRI3: Failed\n"); + break; + } +#else + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "DRI3: Not available\n"); #endif if (serverGeneration == 1) @@ -1091,10 +1069,10 @@ SCRN_INFO_PTR(arg); intel_screen_private *intel = intel_get_screen_private(scrn); - if (intel && !((uintptr_t)intel & 1)) { + if (intel && !((uintptr_t)intel & 3)) { intel_mode_fini(intel); - intel_close_drm_master(intel); intel_bufmgr_fini(intel); + intel_put_device(scrn); free(intel); scrn->driverPrivate = NULL; @@ -1104,15 +1082,12 @@ static void I830LeaveVT(VT_FUNC_ARGS_DECL) { SCRN_INFO_PTR(arg); - intel_screen_private *intel = intel_get_screen_private(scrn); - int ret; xf86RotateFreeShadow(scrn); xf86_hide_cursors(scrn); - ret = drmDropMaster(intel->drmSubFD); - if (ret) + if (intel_put_master(scrn)) xf86DrvMsg(scrn->scrnIndex, X_WARNING, "drmDropMaster failed: %s\n", strerror(errno)); } @@ -1123,14 +1098,12 @@ static Bool I830EnterVT(VT_FUNC_ARGS_DECL) { SCRN_INFO_PTR(arg); - intel_screen_private *intel = intel_get_screen_private(scrn); - int ret; - ret = drmSetMaster(intel->drmSubFD); - if (ret) { + if (intel_get_master(scrn)) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "drmSetMaster failed: %s\n", strerror(errno)); + return FALSE; } if (!xf86SetDesiredModes(scrn)) @@ -1193,7 +1166,7 @@ intel_batch_teardown(scrn); - if (INTEL_INFO(intel)->gen >= 040) + if (INTEL_INFO(intel)->gen >= 040 && INTEL_INFO(intel)->gen < 0100) gen4_render_state_cleanup(scrn); xf86_cursors_fini(screen); @@ -1203,12 +1176,18 @@ screen->CloseScreen = intel->CloseScreen; (*screen->CloseScreen) (CLOSE_SCREEN_ARGS); - if (intel->directRenderingOpen - && intel->directRenderingType == DRI_DRI2) { - intel->directRenderingOpen = FALSE; + if (intel->dri2 == DRI_ACTIVE) { I830DRI2CloseScreen(screen); + intel->dri2 = DRI_NONE; + } + + if (intel->dri3 == DRI_ACTIVE) { + /* nothing to do here? */ + intel->dri3 = DRI_NONE; } + intel_sync_close(screen); + xf86GARTCloseScreen(scrn->scrnIndex); scrn->vtSema = FALSE; @@ -1296,8 +1275,6 @@ Bool intel_init_scrn(ScrnInfoPtr scrn) { - __intel_uxa_release_device(scrn); - scrn->PreInit = I830PreInit; scrn->ScreenInit = I830ScreenInit; scrn->SwitchMode = I830SwitchMode; diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/intel_glamor.c xserver-xorg-video-intel-2.99.914/src/uxa/intel_glamor.c --- xserver-xorg-video-intel-2.99.910/src/uxa/intel_glamor.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/intel_glamor.c 2014-04-23 08:24:58.000000000 +0000 @@ -219,7 +219,13 @@ if ((intel->uxa_flags & UXA_GLAMOR_EGL_INITIALIZED) == 0) goto fail; - if (!glamor_init(screen, GLAMOR_INVERTED_Y_AXIS | GLAMOR_USE_EGL_SCREEN)) { + if (!glamor_init(screen, +#if defined(GLAMOR_NO_DRI3) + /* Not doing DRI3 yet, since Present support hasn't landed. */ + GLAMOR_NO_DRI3 | +#endif + GLAMOR_INVERTED_Y_AXIS | + GLAMOR_USE_EGL_SCREEN)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to initialize glamor.\n"); goto fail; @@ -242,7 +248,7 @@ fail: xf86DrvMsg(scrn->scrnIndex, X_INFO, - "Use standard UXA acceleration.\n"); + "Use legacy UXA acceleration.\n"); return FALSE; } diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/intel.h xserver-xorg-video-intel-2.99.914/src/uxa/intel.h --- xserver-xorg-video-intel-2.99.910/src/uxa/intel.h 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/intel.h 2014-06-16 13:20:07.000000000 +0000 @@ -78,6 +78,10 @@ #include #endif +#if HAVE_DRI3 +#include "misync.h" +#endif + /* remain compatible to xorg-server 1.6 */ #ifndef MONITOR_EDID_COMPLETE_RAWDATA #define MONITOR_EDID_COMPLETE_RAWDATA EDID_COMPLETE_RAWDATA @@ -87,6 +91,8 @@ #define INTEL_PIXMAP_SHARING 1 #endif +#define MAX_PIPES 4 /* consider making all users dynamic */ + struct intel_pixmap { dri_bo *bo; @@ -160,7 +166,7 @@ enum dri_type { DRI_DISABLED, DRI_NONE, - DRI_DRI2 + DRI_ACTIVE }; typedef struct intel_screen_private { @@ -322,9 +328,8 @@ /* 965 render acceleration state */ struct gen4_render_state *gen4_render_state; - enum dri_type directRenderingType; /* DRI enabled this generation. */ - - Bool directRenderingOpen; + /* DRI enabled this generation. */ + enum dri_type dri2, dri3; int drmSubFD; char *deviceName; @@ -334,7 +339,7 @@ Bool has_kernel_flush; Bool needs_flush; - struct _DRI2FrameEvent *pending_flip[2]; + struct _DRI2FrameEvent *pending_flip[MAX_PIPES]; /* Broken-out options. */ OptionInfoPtr Options; @@ -354,6 +359,11 @@ pointer uevent_handler; #endif Bool has_prime_vmap_flush; + +#if HAVE_DRI3 + SyncScreenFuncsRec save_sync_screen_funcs; +#endif + void (*flush_rendering)(struct intel_screen_private *intel); } intel_screen_private; #define INTEL_INFO(intel) ((intel)->info) @@ -397,12 +407,35 @@ extern void intel_mode_remove_fb(intel_screen_private *intel); extern void intel_mode_close(intel_screen_private *intel); extern void intel_mode_fini(intel_screen_private *intel); +extern int intel_mode_read_drm_events(intel_screen_private *intel); + +typedef void (*intel_drm_handler_proc)(ScrnInfoPtr scrn, + xf86CrtcPtr crtc, + uint64_t seq, + uint64_t usec, + void *data); + +typedef void (*intel_drm_abort_proc)(ScrnInfoPtr scrn, + xf86CrtcPtr crtc, + void *data); + +extern uint32_t intel_drm_queue_alloc(ScrnInfoPtr scrn, xf86CrtcPtr crtc, void *data, intel_drm_handler_proc handler, intel_drm_abort_proc abort); +extern void intel_drm_abort(ScrnInfoPtr scrn, Bool (*match)(void *data, void *match_data), void *match_data); extern int intel_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, xf86CrtcPtr crtc); extern int intel_crtc_id(xf86CrtcPtr crtc); extern int intel_output_dpms_status(xf86OutputPtr output); extern void intel_copy_fb(ScrnInfoPtr scrn); +int +intel_get_crtc_msc_ust(ScrnInfoPtr scrn, xf86CrtcPtr crtc, uint64_t *msc, uint64_t *ust); + +uint32_t +intel_crtc_msc_to_sequence(ScrnInfoPtr scrn, xf86CrtcPtr crtc, uint64_t expect); + +uint64_t +intel_sequence_to_crtc_msc(xf86CrtcPtr crtc, uint32_t sequence); + enum DRI2FrameEventType { DRI2_SWAP, DRI2_SWAP_CHAIN, @@ -415,6 +448,12 @@ CARD64 ust, CARD64 msc, CARD64 sbc); #endif +typedef void (*intel_pageflip_handler_proc) (uint64_t frame, + uint64_t usec, + void *data); + +typedef void (*intel_pageflip_abort_proc) (void *data); + typedef struct _DRI2FrameEvent { struct intel_screen_private *intel; @@ -437,7 +476,11 @@ extern Bool intel_do_pageflip(intel_screen_private *intel, dri_bo *new_front, - DRI2FrameEventPtr flip_info, int ref_crtc_hw_id); + int ref_crtc_hw_id, + Bool async, + void *pageflip_data, + intel_pageflip_handler_proc pageflip_handler, + intel_pageflip_abort_proc pageflip_abort); static inline intel_screen_private * intel_get_screen_private(ScrnInfoPtr scrn) @@ -483,6 +526,9 @@ void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec, unsigned int tv_usec, DRI2FrameEventPtr flip_info); +/* intel_dri3.c */ +Bool intel_dri3_screen_init(ScreenPtr screen); + extern Bool intel_crtc_on(xf86CrtcPtr crtc); int intel_crtc_to_pipe(xf86CrtcPtr crtc); @@ -490,11 +536,13 @@ unsigned long intel_get_fence_size(intel_screen_private *intel, unsigned long size); unsigned long intel_get_fence_pitch(intel_screen_private *intel, unsigned long pitch, uint32_t tiling_mode); +Bool intel_check_display_stride(ScrnInfoPtr scrn, int stride, Bool tiling); +void intel_set_gem_max_sizes(ScrnInfoPtr scrn); drm_intel_bo *intel_allocate_framebuffer(ScrnInfoPtr scrn, - int w, int h, int cpp, - unsigned long *pitch, - uint32_t *tiling); + int width, int height, int cpp, + int *out_stride, + uint32_t *out_tiling); /* i830_render.c */ Bool i830_check_composite(int op, @@ -689,4 +737,28 @@ return priv && priv->offscreen; } +#if HAVE_DRI3 +Bool intel_sync_init(ScreenPtr screen); +void intel_sync_close(ScreenPtr screen); +#else +static inline Bool intel_sync_init(ScreenPtr screen) { return 0; } +void intel_sync_close(ScreenPtr screen); +#endif + +/* + * intel_present.c + */ + +#if 0 +#define DebugPresent(x) ErrorF x +#else +#define DebugPresent(x) +#endif + +#if HAVE_PRESENT +Bool intel_present_screen_init(ScreenPtr screen); +#else +static inline Bool intel_present_screen_init(ScreenPtr screen) { return 0; } +#endif + #endif /* _I830_H_ */ diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/intel_memory.c xserver-xorg-video-intel-2.99.914/src/uxa/intel_memory.c --- xserver-xorg-video-intel-2.99.910/src/uxa/intel_memory.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/intel_memory.c 2014-06-16 13:20:07.000000000 +0000 @@ -137,11 +137,10 @@ return i; } -static Bool -intel_check_display_stride(ScrnInfoPtr scrn, int stride, Bool tiling) +Bool intel_check_display_stride(ScrnInfoPtr scrn, int stride, Bool tiling) { intel_screen_private *intel = intel_get_screen_private(scrn); - int limit = KB(32); + int limit; /* 8xx spec has always 8K limit, but tests show larger limit in non-tiling mode, which makes large monitor work. */ @@ -154,30 +153,19 @@ limit = KB(16); else limit = KB(32); - } + } else + limit = KB(32); - if (stride <= limit) - return TRUE; - else - return FALSE; + return stride <= limit; } -/* - * Pad to accelerator requirement - */ -static inline int intel_pad_drawable_width(int width) -{ - return ALIGN(width, 64); -} - - static size_t agp_aperture_size(struct pci_device *dev, int gen) { return dev->regions[gen < 030 ? 0 : 2].size; } -static void intel_set_gem_max_sizes(ScrnInfoPtr scrn) +void intel_set_gem_max_sizes(ScrnInfoPtr scrn) { intel_screen_private *intel = intel_get_screen_private(scrn); size_t agp_size = agp_aperture_size(intel->PciInfo, @@ -202,86 +190,3 @@ */ intel->max_bo_size = intel->max_gtt_map_size; } - -/** - * Allocates a framebuffer for a screen. - * - * Used once for each X screen, so once with RandR 1.2 and twice with classic - * dualhead. - */ -drm_intel_bo *intel_allocate_framebuffer(ScrnInfoPtr scrn, - int width, int height, int cpp, - unsigned long *out_pitch, - uint32_t *out_tiling) -{ - intel_screen_private *intel = intel_get_screen_private(scrn); - drm_intel_bo *front_buffer; - uint32_t tiling_mode; - unsigned long pitch; - - if (intel->tiling & INTEL_TILING_FB) - tiling_mode = I915_TILING_X; - else - tiling_mode = I915_TILING_NONE; - - width = intel_pad_drawable_width(width); - if (!intel_check_display_stride(scrn, width * intel->cpp, - tiling_mode != I915_TILING_NONE)) - tiling_mode = I915_TILING_NONE; - if (!intel_check_display_stride(scrn, width * intel->cpp, - tiling_mode != I915_TILING_NONE)) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Expected front buffer stride %d kB " - "will exceed display limit\n", - width * intel->cpp / 1024); - return NULL; - } - -retry: - front_buffer = drm_intel_bo_alloc_tiled(intel->bufmgr, "front buffer", - width, height, intel->cpp, - &tiling_mode, &pitch, 0); - if (front_buffer == NULL) { - if (tiling_mode != I915_TILING_NONE) { - tiling_mode = I915_TILING_NONE; - goto retry; - } - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Failed to allocate framebuffer.\n"); - return NULL; - } - - if (!intel_check_display_stride(scrn, pitch, - tiling_mode != I915_TILING_NONE)) { - drm_intel_bo_unreference(front_buffer); - if (tiling_mode != I915_TILING_NONE) { - tiling_mode = I915_TILING_NONE; - goto retry; - } - - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Front buffer stride %ld kB " - "exceeds display limit\n", pitch / 1024); - return NULL; - } - - /* If we could have used tiling but failed, warn */ - if (intel->tiling & INTEL_TILING_FB && - tiling_mode != I915_TILING_X && - intel_check_display_stride(scrn, pitch, I915_TILING_X)) - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "Failed to set tiling on frontbuffer.\n"); - - xf86DrvMsg(scrn->scrnIndex, X_INFO, - "Allocated new frame buffer %dx%d stride %ld, %s\n", - width, height, pitch, - tiling_mode == I915_TILING_NONE ? "untiled" : "tiled"); - - drm_intel_bo_disable_reuse(front_buffer); - - intel_set_gem_max_sizes(scrn); - *out_pitch = pitch; - *out_tiling = tiling_mode; - - return front_buffer; -} diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/intel_present.c xserver-xorg-video-intel-2.99.914/src/uxa/intel_present.c --- xserver-xorg-video-intel-2.99.910/src/uxa/intel_present.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/intel_present.c 2014-05-23 06:34:34.000000000 +0000 @@ -0,0 +1,401 @@ +/* + * Copyright © 2014 Intel Corporation + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "xorg-server.h" +#include "xf86.h" +#include "xf86_OSproc.h" + +#include "xf86Pci.h" +#include "xf86drm.h" + +#include "windowstr.h" +#include "shadow.h" +#include "fb.h" + +#include "intel.h" +#include "i830_reg.h" + +#include "i915_drm.h" + +#include "present.h" + +#include "intel_glamor.h" +#include "uxa.h" + +struct intel_present_vblank_event { + uint64_t event_id; +}; + +static uint32_t pipe_select(int pipe) +{ + if (pipe > 1) + return pipe << DRM_VBLANK_HIGH_CRTC_SHIFT; + else if (pipe > 0) + return DRM_VBLANK_SECONDARY; + else + return 0; +} + +static RRCrtcPtr +intel_present_get_crtc(WindowPtr window) +{ + ScreenPtr screen = window->drawable.pScreen; + ScrnInfoPtr pScrn = xf86ScreenToScrn(screen); + BoxRec box, crtcbox; + xf86CrtcPtr crtc; + RRCrtcPtr randr_crtc = NULL; + + box.x1 = window->drawable.x; + box.y1 = window->drawable.y; + box.x2 = box.x1 + window->drawable.width; + box.y2 = box.y1 + window->drawable.height; + + crtc = intel_covering_crtc(pScrn, &box, NULL, &crtcbox); + + /* Make sure the CRTC is valid and this is the real front buffer */ + if (crtc != NULL && !crtc->rotatedData) + randr_crtc = crtc->randr_crtc; + + return randr_crtc; +} + +static int +intel_present_crtc_pipe(ScreenPtr screen, RRCrtcPtr randr_crtc) +{ + xf86CrtcPtr crtc; + + if (randr_crtc == NULL) + return 0; + + crtc = randr_crtc->devPrivate; + return intel_crtc_to_pipe(crtc); +} + +static int +intel_present_get_ust_msc(RRCrtcPtr crtc, CARD64 *ust, CARD64 *msc) +{ + xf86CrtcPtr xf86_crtc = crtc->devPrivate; + ScreenPtr screen = crtc->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + + return intel_get_crtc_msc_ust(scrn, xf86_crtc, msc, ust); +} + +/* + * Flush the DRM event queue when full; this + * makes space for new requests + */ +static Bool +intel_present_flush_drm_events(ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + intel_screen_private *intel = intel_get_screen_private(scrn); + + return intel_mode_read_drm_events(intel) >= 0; +} + +/* + * Called when the queued vblank event has occurred + */ +static void +intel_present_vblank_handler(ScrnInfoPtr scrn, xf86CrtcPtr crtc, uint64_t msc, uint64_t usec, void *data) +{ + struct intel_present_vblank_event *event = data; + + present_event_notify(event->event_id, usec, msc); + free(event); +} + +/* + * Called when the queued vblank is aborted + */ +static void +intel_present_vblank_abort(ScrnInfoPtr scrn, xf86CrtcPtr crtc, void *data) +{ + struct intel_present_vblank_event *event = data; + + free(event); +} + +/* + * Queue an event to report back to the Present extension when the specified + * MSC has past + */ +static int +intel_present_queue_vblank(RRCrtcPtr crtc, + uint64_t event_id, + uint64_t msc) +{ + xf86CrtcPtr xf86_crtc = crtc->devPrivate; + ScreenPtr screen = crtc->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + intel_screen_private *intel = intel_get_screen_private(scrn); + int pipe = intel_present_crtc_pipe(screen, crtc); + struct intel_present_vblank_event *event; + drmVBlank vbl; + int ret; + uint32_t seq; + + event = calloc(sizeof(struct intel_present_vblank_event), 1); + if (!event) + return BadAlloc; + event->event_id = event_id; + seq = intel_drm_queue_alloc(scrn, xf86_crtc, event, + intel_present_vblank_handler, + intel_present_vblank_abort); + if (!seq) { + free(event); + return BadAlloc; + } + + vbl.request.type = DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT | pipe_select(pipe); + vbl.request.sequence = intel_crtc_msc_to_sequence(scrn, xf86_crtc, msc); + vbl.request.signal = seq; + for (;;) { + ret = drmWaitVBlank(intel->drmSubFD, &vbl); + if (!ret) + break; + if (errno != EBUSY || !intel_present_flush_drm_events(screen)) + return BadAlloc; + } + DebugPresent(("\t\tiq %lld seq %u msc %u (hw msc %u)\n", event_id, seq, low_msc, vbl.request.sequence)); + return Success; +} + +static Bool +intel_present_event_match(void *data, void *match_data) +{ + struct intel_present_vblank_event *event = data; + uint64_t *match = match_data; + + return *match == event->event_id; +} + +/* + * Remove a pending vblank event from the DRM queue so that it is not reported + * to the extension + */ +static void +intel_present_abort_vblank(RRCrtcPtr crtc, uint64_t event_id, uint64_t msc) +{ + ScreenPtr screen = crtc->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + + intel_drm_abort(scrn, intel_present_event_match, &event_id); +} + +/* + * Flush our batch buffer when requested by the Present extension. + */ +static void +intel_present_flush(WindowPtr window) +{ + ScreenPtr screen = window->drawable.pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + intel_screen_private *intel = intel_get_screen_private(scrn); + + if (intel->flush_rendering) + intel->flush_rendering(intel); +} + +/* + * Test to see if page flipping is possible on the target crtc + */ +static Bool +intel_present_check_flip(RRCrtcPtr crtc, + WindowPtr window, + PixmapPtr pixmap, + Bool sync_flip) +{ + ScreenPtr screen = window->drawable.pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + intel_screen_private *intel = intel_get_screen_private(scrn); + + if (!scrn->vtSema) + return FALSE; + + if (intel->shadow_present) + return FALSE; + + if (!intel->use_pageflipping) + return FALSE; + + if (crtc && !intel_crtc_on(crtc->devPrivate)) + return FALSE; + + return TRUE; +} + +/* + * Once the flip has been completed on all pipes, notify the + * extension code telling it when that happened + */ +static void +intel_present_flip_event(uint64_t msc, uint64_t ust, void *pageflip_data) +{ + struct intel_present_vblank_event *event = pageflip_data; + + present_event_notify(event->event_id, ust, msc); + free(event); +} + +/* + * The flip has been aborted, free the structure + */ +static void +intel_present_flip_abort(void *pageflip_data) +{ + struct intel_present_vblank_event *event = pageflip_data; + + free(event); +} + +/* + * Queue a flip on 'crtc' to 'pixmap' at 'target_msc'. If 'sync_flip' is true, + * then wait for vblank. Otherwise, flip immediately + */ +static Bool +intel_present_flip(RRCrtcPtr crtc, + uint64_t event_id, + uint64_t target_msc, + PixmapPtr pixmap, + Bool sync_flip) +{ + ScreenPtr screen = crtc->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + intel_screen_private *intel = intel_get_screen_private(scrn); + struct intel_present_vblank_event *event; + int pipe = intel_present_crtc_pipe(screen, crtc); + dri_bo *bo; + Bool ret; + + if (!intel_present_check_flip(crtc, screen->root, pixmap, sync_flip)) + return FALSE; + + bo = intel_get_pixmap_bo(pixmap); + if (!bo) + return FALSE; + + event = calloc(1, sizeof(struct intel_present_vblank_event)); + if (!event) + return FALSE; + + event->event_id = event_id; + + ret = intel_do_pageflip(intel, bo, pipe, !sync_flip, + event, + intel_present_flip_event, + intel_present_flip_abort); + if (!ret) + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "present flip failed\n"); + return ret; +} + +/* + * Queue a flip back to the normal frame buffer + */ +static void +intel_present_unflip(ScreenPtr screen, uint64_t event_id) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + intel_screen_private *intel = intel_get_screen_private(scrn); + struct intel_present_vblank_event *event; + PixmapPtr pixmap = screen->GetScreenPixmap(screen); + dri_bo *bo; + Bool ret; + + if (!intel_present_check_flip(NULL, screen->root, pixmap, true)) + return; + + bo = intel_get_pixmap_bo(pixmap); + if (!bo) + return; + + event = calloc(1, sizeof(struct intel_present_vblank_event)); + if (!event) + return; + + event->event_id = event_id; + + ret = intel_do_pageflip(intel, bo, -1, FALSE, event, intel_present_flip_event, intel_present_flip_abort); + if (!ret) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "present unflip failed\n"); + } +} + +static present_screen_info_rec intel_present_screen_info = { + .version = PRESENT_SCREEN_INFO_VERSION, + + .get_crtc = intel_present_get_crtc, + .get_ust_msc = intel_present_get_ust_msc, + .queue_vblank = intel_present_queue_vblank, + .abort_vblank = intel_present_abort_vblank, + .flush = intel_present_flush, + + .capabilities = PresentCapabilityNone, + .check_flip = intel_present_check_flip, + .flip = intel_present_flip, + .unflip = intel_present_unflip, +}; + +static Bool +intel_present_has_async_flip(ScreenPtr screen) +{ +#ifdef DRM_CAP_ASYNC_PAGE_FLIP + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + intel_screen_private *intel = intel_get_screen_private(scrn); + int ret; + uint64_t value; + + ret = drmGetCap(intel->drmSubFD, DRM_CAP_ASYNC_PAGE_FLIP, &value); + if (ret == 0) + return value == 1; +#endif + return FALSE; +} + +Bool +intel_present_screen_init(ScreenPtr screen) +{ + if (intel_present_has_async_flip(screen)) + intel_present_screen_info.capabilities |= PresentCapabilityAsync; + + return present_screen_init(screen, &intel_present_screen_info); +} diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/intel_sync.c xserver-xorg-video-intel-2.99.914/src/uxa/intel_sync.c --- xserver-xorg-video-intel-2.99.910/src/uxa/intel_sync.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/intel_sync.c 2014-05-10 06:54:18.000000000 +0000 @@ -0,0 +1,111 @@ +/* + * Copyright © 2013-2014 Intel Corporation + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "intel.h" +#include "misyncshm.h" +#include "misyncstr.h" + +/* + * This whole file exists to wrap a sync fence trigger operation + * so that we can flush the batch buffer to provide serialization + * between the server and the shm fence client + */ + +static DevPrivateKeyRec intel_sync_fence_private_key; + +typedef struct _intel_sync_fence_private { + SyncFenceSetTriggeredFunc set_triggered; +} intel_sync_fence_private; + +#define SYNC_FENCE_PRIV(pFence) \ + (intel_sync_fence_private *) dixLookupPrivate(&pFence->devPrivates, &intel_sync_fence_private_key) + +static void +intel_sync_fence_set_triggered (SyncFence *fence) +{ + ScreenPtr screen = fence->pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + intel_screen_private *intel = intel_get_screen_private(scrn); + intel_sync_fence_private *private = SYNC_FENCE_PRIV(fence); + + /* Flush pending rendering operations */ + if (intel->flush_rendering) + intel->flush_rendering(intel); + + fence->funcs.SetTriggered = private->set_triggered; + fence->funcs.SetTriggered(fence); + private->set_triggered = fence->funcs.SetTriggered; + fence->funcs.SetTriggered = intel_sync_fence_set_triggered; +} + +static void +intel_sync_create_fence(ScreenPtr screen, + SyncFence *fence, + Bool initially_triggered) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + intel_screen_private *intel = intel_get_screen_private(scrn); + SyncScreenFuncsPtr screen_funcs = miSyncGetScreenFuncs(screen); + intel_sync_fence_private *private = SYNC_FENCE_PRIV(fence); + + screen_funcs->CreateFence = intel->save_sync_screen_funcs.CreateFence; + screen_funcs->CreateFence(screen, fence, initially_triggered); + intel->save_sync_screen_funcs.CreateFence = screen_funcs->CreateFence; + screen_funcs->CreateFence = intel_sync_create_fence; + + private->set_triggered = fence->funcs.SetTriggered; + fence->funcs.SetTriggered = intel_sync_fence_set_triggered; +} + +Bool +intel_sync_init(ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + intel_screen_private *intel = intel_get_screen_private(scrn); + SyncScreenFuncsPtr screen_funcs; + + if (!miSyncShmScreenInit(screen)) + return FALSE; + + if (!dixPrivateKeyRegistered(&intel_sync_fence_private_key)) { + if (!dixRegisterPrivateKey(&intel_sync_fence_private_key, + PRIVATE_SYNC_FENCE, + sizeof (intel_sync_fence_private))) + return FALSE; + } + + screen_funcs = miSyncGetScreenFuncs(screen); + intel->save_sync_screen_funcs.CreateFence = screen_funcs->CreateFence; + screen_funcs->CreateFence = intel_sync_create_fence; + return TRUE; +} + +void +intel_sync_close(ScreenPtr screen) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + intel_screen_private *intel = intel_get_screen_private(scrn); + SyncScreenFuncsPtr screen_funcs = miSyncGetScreenFuncs(screen); + + if (screen_funcs) + screen_funcs->CreateFence = intel->save_sync_screen_funcs.CreateFence; +} diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/intel_uxa.c xserver-xorg-video-intel-2.99.914/src/uxa/intel_uxa.c --- xserver-xorg-video-intel-2.99.910/src/uxa/intel_uxa.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/intel_uxa.c 2014-07-04 09:44:01.000000000 +0000 @@ -156,19 +156,15 @@ } static unsigned int -intel_uxa_pixmap_compute_size(PixmapPtr pixmap, - int w, int h, - uint32_t *tiling, - int *stride, - unsigned usage) +intel_uxa_compute_size(struct intel_screen_private *intel, + int w, int h, int bpp, unsigned usage, + uint32_t *tiling, int *stride) { - ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen); - intel_screen_private *intel = intel_get_screen_private(scrn); int pitch, size; if (*tiling != I915_TILING_NONE) { /* First check whether tiling is necessary. */ - pitch = (w * pixmap->drawable.bitsPerPixel + 7) / 8; + pitch = (w * bpp + 7) / 8; pitch = ALIGN(pitch, 64); size = pitch * ALIGN (h, 2); if (INTEL_INFO(intel)->gen < 040) { @@ -197,7 +193,7 @@ } } - pitch = (w * pixmap->drawable.bitsPerPixel + 7) / 8; + pitch = (w * bpp + 7) / 8; if (!(usage & INTEL_CREATE_PIXMAP_DRI2) && pitch <= 256) *tiling = I915_TILING_NONE; @@ -243,6 +239,58 @@ return size; } +drm_intel_bo *intel_allocate_framebuffer(ScrnInfoPtr scrn, + int width, int height, int cpp, + int *out_stride, + uint32_t *out_tiling) +{ + intel_screen_private *intel = intel_get_screen_private(scrn); + uint32_t tiling; + int stride, size; + drm_intel_bo *bo; + + if (intel->tiling & INTEL_TILING_FB) + tiling = I915_TILING_X; + else + tiling = I915_TILING_NONE; + +retry: + size = intel_uxa_compute_size(intel, + width, height, + intel->cpp*8, 0, + &tiling, &stride); + if (!intel_check_display_stride(scrn, stride, tiling)) { + if (tiling != I915_TILING_NONE) { + tiling = I915_TILING_NONE; + goto retry; + } + + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "Front buffer stride %d kB " + "exceeds display limit\n", stride / 1024); + return NULL; + } + + bo = drm_intel_bo_alloc(intel->bufmgr, "front buffer", size, 0); + if (bo == NULL) + return FALSE; + + if (tiling != I915_TILING_NONE) + drm_intel_bo_set_tiling(bo, &tiling, stride); + + xf86DrvMsg(scrn->scrnIndex, X_INFO, + "Allocated new frame buffer %dx%d stride %d, %s\n", + width, height, stride, + tiling == I915_TILING_NONE ? "untiled" : "tiled"); + + drm_intel_bo_disable_reuse(bo); + + intel_set_gem_max_sizes(scrn); + *out_stride = stride; + *out_tiling = tiling; + return bo; +} + static Bool intel_uxa_check_solid(DrawablePtr drawable, int alu, Pixel planemask) { @@ -324,9 +372,10 @@ pitch = intel_pixmap_pitch(pixmap); { - BEGIN_BATCH_BLT(6); + int len = INTEL_INFO(intel)->gen >= 0100 ? 7 : 6; + BEGIN_BATCH_BLT(len); - cmd = XY_COLOR_BLT_CMD; + cmd = XY_COLOR_BLT_CMD | (len - 2); if (pixmap->drawable.bitsPerPixel == 32) cmd |= @@ -462,9 +511,10 @@ src_pitch = intel_pixmap_pitch(intel->render_source); { - BEGIN_BATCH_BLT(8); + int len = INTEL_INFO(intel)->gen >= 0100 ? 10 : 8; + BEGIN_BATCH_BLT(len); - cmd = XY_SRC_COPY_BLT_CMD; + cmd = XY_SRC_COPY_BLT_CMD | (len - 2); if (dest->drawable.bitsPerPixel == 32) cmd |= @@ -509,10 +559,10 @@ ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen); intel_screen_private *intel = intel_get_screen_private(scrn); - if (IS_GEN6(intel) || IS_GEN7(intel)) { + if (INTEL_INFO(intel)->gen >= 060) { /* workaround a random BLT hang */ BEGIN_BATCH_BLT(3); - OUT_BATCH(XY_SETUP_CLIP_BLT_CMD); + OUT_BATCH(XY_SETUP_CLIP_BLT_CMD | (3 - 2)); OUT_BATCH(0); OUT_BATCH(0); ADVANCE_BATCH(); @@ -631,18 +681,38 @@ return intel->bo; } +static unsigned intel_get_tile_width(intel_screen_private *intel, int tiling, int pitch) +{ + unsigned long tile_width; + + if (tiling == I915_TILING_NONE) + return 4; + + tile_width = (tiling == I915_TILING_Y) ? 128 : 512; + if (INTEL_INFO(intel)->gen >= 040) + return tile_width; + + while (tile_width < pitch) + tile_width <<= 1; + + return tile_width; +} + void intel_set_pixmap_bo(PixmapPtr pixmap, dri_bo * bo) { + ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen); + intel_screen_private *intel = intel_get_screen_private(scrn); struct intel_pixmap *priv; priv = intel_get_pixmap_private(pixmap); if (priv == NULL && bo == NULL) - return; + return; if (priv != NULL) { if (priv->bo == bo) return; +free_priv: dri_bo_unreference(priv->bo); list_del(&priv->batch); @@ -651,9 +721,9 @@ } if (bo != NULL) { - uint32_t tiling; - uint32_t swizzle_mode; - int ret; + uint32_t tiling, swizzle_mode; + unsigned tile_width; + int size, stride; priv = calloc(1, sizeof (struct intel_pixmap)); if (priv == NULL) @@ -665,15 +735,51 @@ priv->bo = bo; priv->stride = intel_pixmap_pitch(pixmap); - ret = drm_intel_bo_get_tiling(bo, &tiling, &swizzle_mode); - if (ret != 0) { - FatalError("Couldn't get tiling on bo %p: %s\n", - bo, strerror(-ret)); + if (drm_intel_bo_get_tiling(bo, &tiling, &swizzle_mode)) { + bo = NULL; + goto free_priv; } priv->tiling = tiling; priv->busy = -1; priv->offscreen = 1; + + stride = (pixmap->drawable.width * pixmap->drawable.bitsPerPixel + 7) / 8; + tile_width = intel_get_tile_width(intel, tiling, stride); + stride = ALIGN(stride, tile_width); + + if (priv->stride < stride || + priv->stride & (tile_width - 1) || + priv->stride >= KB(32)) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "%s: stride on buffer object does not match constraints: stride=%d, must be greater than %d, but less than %d, and have alignment at least %d\n", + __FUNCTION__, priv->stride, stride, KB(32), tile_width); + bo = NULL; + goto free_priv; + } + + if (tiling != I915_TILING_NONE) { + int height; + + if (IS_GEN2(intel)) + height = 16; + else if (tiling == I915_TILING_X) + height = 8; + else + height = 32; + + height = ALIGN(pixmap->drawable.height, 2*height); + size = intel_get_fence_size(intel, priv->stride * height); + } else + size = priv->stride * pixmap->drawable.height; + + if (bo->size < size || bo->size > intel->max_bo_size) { + xf86DrvMsg(scrn->scrnIndex, X_ERROR, + "%s: size of buffer object does not match constraints: size=%ld, must be greater than %d, but less than %d\n", + __FUNCTION__, (long)bo->size, size, intel->max_bo_size); + bo = NULL; + goto free_priv; + } } BAIL: @@ -798,8 +904,10 @@ dri_bo *bo; /* Replace busy bo. */ - size = intel_uxa_pixmap_compute_size (pixmap, w, h, - &tiling, &stride, 0); + size = intel_uxa_compute_size(intel, + w, h, + pixmap->drawable.bitsPerPixel, pixmap->usage_hint, + &tiling, &stride); if (size > intel->max_gtt_map_size) return FALSE; @@ -1059,7 +1167,9 @@ if (h <= 16 && tiling == I915_TILING_Y) tiling = I915_TILING_X; } - size = intel_uxa_pixmap_compute_size(pixmap, w, h, &tiling, &stride, usage); + size = intel_uxa_compute_size(intel, + w, h, pixmap->drawable.bitsPerPixel, usage, + &tiling, &stride); /* Fail very large allocations. Large BOs will tend to hit SW fallbacks * frequently, and also will tend to fail to successfully map when doing @@ -1150,6 +1260,7 @@ PixmapPtr pixmap; intel_screen_private *intel = intel_get_screen_private(scrn); dri_bo *bo = intel->front_buffer; + int old_width, old_height, old_pitch; if (!uxa_resources_init(screen)) return FALSE; @@ -1158,23 +1269,34 @@ return FALSE; pixmap = screen->GetScreenPixmap(screen); + old_width = pixmap->drawable.width; + old_height = pixmap->drawable.height; + old_pitch = pixmap->devKind; + + if (!screen->ModifyPixmapHeader(pixmap, + scrn->virtualX, + scrn->virtualY, + -1, -1, + intel->front_pitch, + NULL)) + return FALSE; + intel_set_pixmap_bo(pixmap, bo); if (intel_get_pixmap_private(pixmap) == NULL) - return FALSE; + goto err; + + if (!intel_glamor_create_screen_resources(screen)) + goto err; intel_get_pixmap_private(pixmap)->pinned |= PIN_SCANOUT; - screen->ModifyPixmapHeader(pixmap, - scrn->virtualX, - scrn->virtualY, - -1, -1, - intel->front_pitch, - NULL); scrn->displayWidth = intel->front_pitch / intel->cpp; - if (!intel_glamor_create_screen_resources(screen)) - return FALSE; - return TRUE; + +err: + screen->ModifyPixmapHeader(pixmap, + old_width, old_height, -1, -1, old_pitch, NULL); + return FALSE; } #ifdef CREATE_PIXMAP_USAGE_SHARED @@ -1200,7 +1322,10 @@ tiling = I915_TILING_NONE; - size = intel_uxa_pixmap_compute_size(ppix, ppix->drawable.width, ppix->drawable.height, &tiling, &stride, INTEL_CREATE_PIXMAP_DRI2); + size = intel_uxa_compute_size(intel, + ppix->drawable.width, ppix->drawable.height, + ppix->drawable.bitsPerPixel, INTEL_CREATE_PIXMAP_DRI2, + &tiling, &stride); newbo = drm_intel_bo_alloc_for_render(intel->bufmgr, "pixmap", @@ -1354,7 +1479,7 @@ /* Composite */ if (intel_option_accel_blt(intel)) { - } else if (IS_GEN2(intel)) { + } else if (INTEL_INFO(intel)->gen < 030) { intel->uxa_driver->check_composite = i830_check_composite; intel->uxa_driver->check_composite_target = i830_check_composite_target; intel->uxa_driver->check_composite_texture = i830_check_composite_texture; @@ -1364,7 +1489,7 @@ intel->vertex_flush = i830_vertex_flush; intel->batch_commit_notify = i830_batch_commit_notify; - } else if (IS_GEN3(intel)) { + } else if (INTEL_INFO(intel)->gen < 040) { intel->uxa_driver->check_composite = i915_check_composite; intel->uxa_driver->check_composite_target = i915_check_composite_target; intel->uxa_driver->check_composite_texture = i915_check_composite_texture; @@ -1374,7 +1499,7 @@ intel->vertex_flush = i915_vertex_flush; intel->batch_commit_notify = i915_batch_commit_notify; - } else { + } else if (INTEL_INFO(intel)->gen < 0100) { intel->uxa_driver->check_composite = i965_check_composite; intel->uxa_driver->check_composite_texture = i965_check_composite_texture; intel->uxa_driver->prepare_composite = i965_prepare_composite; @@ -1385,9 +1510,9 @@ intel->batch_flush = i965_batch_flush; intel->batch_commit_notify = i965_batch_commit_notify; - if (IS_GEN4(intel)) { + if (INTEL_INFO(intel)->gen < 050) { intel->context_switch = gen4_context_switch; - } else if (IS_GEN5(intel)) { + } else if (INTEL_INFO(intel)->gen < 060) { intel->context_switch = gen5_context_switch; } else { intel->context_switch = gen6_context_switch; @@ -1420,5 +1545,6 @@ uxa_set_fallback_debug(screen, intel->fallback_debug); uxa_set_force_fallback(screen, intel->force_fallback); + intel->flush_rendering = intel_flush_rendering; return TRUE; } diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/intel_video.c xserver-xorg-video-intel-2.99.914/src/uxa/intel_video.c --- xserver-xorg-video-intel-2.99.910/src/uxa/intel_video.c 2014-02-10 09:24:57.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/intel_video.c 2014-04-09 17:41:18.000000000 +0000 @@ -356,7 +356,8 @@ */ if (!intel->force_fallback && scrn->bitsPerPixel >= 16 && - INTEL_INFO(intel)->gen >= 030) { + INTEL_INFO(intel)->gen >= 030 && + INTEL_INFO(intel)->gen < 0100) { texturedAdaptor = I830SetupImageVideoTextured(screen); if (texturedAdaptor != NULL) { xf86DrvMsg(scrn->scrnIndex, X_INFO, diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/Makefile.am xserver-xorg-video-intel-2.99.914/src/uxa/Makefile.am --- xserver-xorg-video-intel-2.99.910/src/uxa/Makefile.am 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/Makefile.am 2014-05-22 06:43:27.000000000 +0000 @@ -80,6 +80,19 @@ $(NULL) endif +if DRI3 +libuxa_la_SOURCES += \ + intel_dri3.c \ + intel_sync.c \ + $(NULL) +endif + +if PRESENT +libuxa_la_SOURCES += \ + intel_present.c \ + $(NULL) +endif + if XVMC AM_CFLAGS += -I$(top_srcdir)/xvmc libuxa_la_SOURCES += \ diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/Makefile.in xserver-xorg-video-intel-2.99.914/src/uxa/Makefile.in --- xserver-xorg-video-intel-2.99.910/src/uxa/Makefile.in 2014-02-10 09:34:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/Makefile.in 2014-07-23 15:44:37.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -36,6 +35,51 @@ # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -70,13 +114,23 @@ @DRI2_TRUE@ $(CLOCK_GETTIME_LIBS) \ @DRI2_TRUE@ $(NULL) -@XVMC_TRUE@am__append_7 = -I$(top_srcdir)/xvmc -@XVMC_TRUE@am__append_8 = \ +@DRI3_TRUE@am__append_7 = \ +@DRI3_TRUE@ intel_dri3.c \ +@DRI3_TRUE@ intel_sync.c \ +@DRI3_TRUE@ $(NULL) + +@PRESENT_TRUE@am__append_8 = \ +@PRESENT_TRUE@ intel_present.c \ +@PRESENT_TRUE@ $(NULL) + +@XVMC_TRUE@am__append_9 = -I$(top_srcdir)/xvmc +@XVMC_TRUE@am__append_10 = \ @XVMC_TRUE@ intel_hwmc.c \ @XVMC_TRUE@ $(NULL) subdir = src/uxa -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -104,20 +158,37 @@ i915_render.c i915_video.c i965_reg.h i965_3d.c i965_video.c \ i965_render.c uxa_module.h uxa.c uxa.h uxa-accel.c \ uxa-glamor.h uxa-glyphs.c uxa-render.c uxa-priv.h \ - uxa-unaccel.c intel_glamor.c intel_dri.c intel_hwmc.c + uxa-unaccel.c intel_glamor.c intel_dri.c intel_dri3.c \ + intel_sync.c intel_present.c intel_hwmc.c @GLAMOR_TRUE@am__objects_1 = intel_glamor.lo @DRI2_TRUE@am__objects_2 = intel_dri.lo -@XVMC_TRUE@am__objects_3 = intel_hwmc.lo +@DRI3_TRUE@am__objects_3 = intel_dri3.lo intel_sync.lo +@PRESENT_TRUE@am__objects_4 = intel_present.lo +@XVMC_TRUE@am__objects_5 = intel_hwmc.lo am_libuxa_la_OBJECTS = intel_batchbuffer.lo intel_display.lo \ intel_driver.lo intel_memory.lo intel_uxa.lo intel_video.lo \ i830_3d.lo i830_render.lo i915_3d.lo i915_render.lo \ i915_video.lo i965_3d.lo i965_video.lo i965_render.lo uxa.lo \ uxa-accel.lo uxa-glyphs.lo uxa-render.lo uxa-unaccel.lo \ - $(am__objects_1) $(am__objects_2) $(am__objects_3) + $(am__objects_1) $(am__objects_2) $(am__objects_3) \ + $(am__objects_4) $(am__objects_5) libuxa_la_OBJECTS = $(am_libuxa_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -130,22 +201,40 @@ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libuxa_la_SOURCES) DIST_SOURCES = $(am__libuxa_la_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -178,6 +267,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -206,8 +297,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -246,23 +342,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -325,7 +422,7 @@ $(PCIACCESS_CFLAGS) $(UDEV_CFLAGS) $(DRM_CFLAGS) \ $(DRMINTEL_CFLAGS) -I$(top_srcdir)/xvmc -I$(top_srcdir)/src \ -I$(top_srcdir)/src/render_program $(am__append_1) \ - $(am__append_4) $(am__append_7) + $(am__append_4) $(am__append_9) noinst_LTLIBRARIES = libuxa.la libuxa_la_LIBADD = $(UDEV_LIBS) $(DRMINTEL_LIBS) $(DRM_LIBS) \ $(am__append_2) $(am__append_6) @@ -337,7 +434,7 @@ i965_reg.h i965_3d.c i965_video.c i965_render.c uxa_module.h \ uxa.c uxa.h uxa-accel.c uxa-glamor.h uxa-glyphs.c uxa-render.c \ uxa-priv.h uxa-unaccel.c $(am__append_3) $(am__append_5) \ - $(am__append_8) + $(am__append_7) $(am__append_8) $(am__append_10) all: all-am .SUFFIXES: @@ -375,12 +472,15 @@ clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + libuxa.la: $(libuxa_la_OBJECTS) $(libuxa_la_DEPENDENCIES) $(EXTRA_libuxa_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libuxa_la_OBJECTS) $(libuxa_la_LIBADD) $(LIBS) @@ -401,10 +501,13 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_batchbuffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_display.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_dri.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_dri3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_driver.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_glamor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_hwmc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_memory.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_present.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_sync.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_uxa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uxa-accel.Plo@am__quote@ @@ -418,14 +521,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -440,26 +543,15 @@ clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -471,15 +563,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -488,6 +576,21 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -629,18 +732,19 @@ .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLTLIBRARIES cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am $(NULL) diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/uxa-accel.c xserver-xorg-video-intel-2.99.914/src/uxa/uxa-accel.c --- xserver-xorg-video-intel-2.99.910/src/uxa/uxa-accel.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/uxa-accel.c 2014-05-28 12:38:16.000000000 +0000 @@ -942,8 +942,8 @@ uxa_screen_t *uxa_screen = uxa_get_screen(screen); if (uxa_screen->info->flags & UXA_USE_GLAMOR) { + RegionPtr region = NULL; int ok = 0; - RegionPtr region; if (uxa_prepare_access(pDst, UXA_GLAMOR_ACCESS_RW)) { if (uxa_prepare_access(pSrc, UXA_GLAMOR_ACCESS_RO)) { diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/uxa.c xserver-xorg-video-intel-2.99.914/src/uxa/uxa.c --- xserver-xorg-video-intel-2.99.910/src/uxa/uxa.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/uxa.c 2014-06-09 13:32:28.000000000 +0000 @@ -382,6 +382,7 @@ uxa_glyphs_fini(screen); +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,15,99,903,0) if (screen->devPrivate) { /* Destroy the pixmap created by miScreenInit() *before* * chaining up as we finalize ourselves here and so this @@ -391,6 +392,7 @@ (void) (*screen->DestroyPixmap) (screen->devPrivate); screen->devPrivate = NULL; } +#endif screen->CreateGC = uxa_screen->SavedCreateGC; screen->CloseScreen = uxa_screen->SavedCloseScreen; diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/uxa-priv.h xserver-xorg-video-intel-2.99.914/src/uxa/uxa-priv.h --- xserver-xorg-video-intel-2.99.910/src/uxa/uxa-priv.h 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/uxa-priv.h 2014-04-11 16:50:55.000000000 +0000 @@ -53,7 +53,7 @@ #include "fb.h" #include "fboverlay.h" #ifdef RENDER -//#include "fbpict.h" +#include "fbpict.h" #include "glyphstr.h" #endif #include "damage.h" @@ -300,21 +300,6 @@ #ifdef RENDER -/* XXX these are in fbpict.h, which is not installed */ -void -fbComposite(CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); - -void -fbAddTraps(PicturePtr pPicture, - INT16 xOff, INT16 yOff, int ntrap, xTrap * traps); - void uxa_check_composite(CARD8 op, PicturePtr pSrc, diff -Nru xserver-xorg-video-intel-2.99.910/src/uxa/uxa-render.c xserver-xorg-video-intel-2.99.914/src/uxa/uxa-render.c --- xserver-xorg-video-intel-2.99.910/src/uxa/uxa-render.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/src/uxa/uxa-render.c 2014-05-28 12:38:16.000000000 +0000 @@ -926,7 +926,7 @@ INT16 * out_x, INT16 * out_y) { return uxa_acquire_picture (screen, pict, - PICT_a8r8g8b8, + PIXMAN_a8r8g8b8, x, y, width, height, out_x, out_y); @@ -940,7 +940,7 @@ INT16 * out_x, INT16 * out_y) { return uxa_acquire_picture (screen, pict, - PICT_a8, + PIXMAN_a8, x, y, width, height, out_x, out_y); diff -Nru xserver-xorg-video-intel-2.99.910/test/basic-copyarea.c xserver-xorg-video-intel-2.99.914/test/basic-copyarea.c --- xserver-xorg-video-intel-2.99.910/test/basic-copyarea.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/basic-copyarea.c 2014-06-21 14:45:39.000000000 +0000 @@ -9,7 +9,7 @@ static void show_cells(char *buf, - const uint32_t *real, const uint32_t *ref, + const uint32_t *out, const uint32_t *ref, int x, int y, int w, int h) { int i, j, len = 0; @@ -22,7 +22,7 @@ if (i < 0 || i >= w) continue; - len += sprintf(buf+len, "%08x ", real[j*w+i]); + len += sprintf(buf+len, "%08x ", out[j*w+i]); } len += sprintf(buf+len, "\t"); @@ -85,13 +85,13 @@ { struct test_target tt; XImage image; - uint32_t *cells = malloc(t->real.width*t->real.height*4); + uint32_t *cells = malloc(t->out.width*t->out.height*4); struct { uint16_t x, y; } *pixels = malloc(reps*sizeof(*pixels)); int r, s; - test_target_create_render(&t->real, target, &tt); + test_target_create_render(&t->out, target, &tt); printf("Testing setting of single pixels (%s): ", test_target_name(target)); @@ -103,7 +103,7 @@ int y = rand() % (tt.height - 1); uint32_t fg = rand(); - fill_rect(&t->real, tt.draw, tt.format, + fill_rect(&t->out, tt.draw, tt.format, 0, 0, 0, GXcopy, x, y, 1, 1, fg); @@ -112,14 +112,14 @@ cells[y*tt.width+x] = fg; } - test_init_image(&image, &t->real.shm, tt.format, 1, 1); + test_init_image(&image, &t->out.shm, tt.format, 1, 1); for (r = 0; r < reps; r++) { uint32_t x = pixels[r].x; uint32_t y = pixels[r].y; uint32_t result; - XShmGetImage(t->real.dpy, tt.draw, &image, + XShmGetImage(t->out.dpy, tt.draw, &image, x, y, AllPlanes); result = *(uint32_t *)image.data; @@ -138,7 +138,7 @@ } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(pixels); free(cells); } @@ -154,16 +154,16 @@ { struct test_target tt; XImage image; - uint32_t *cells = calloc(sizeof(uint32_t), t->real.width*t->real.height); + uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height); int r, s, x, y; printf("Testing area sets (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &tt); - clear(&t->real, &tt); + test_target_create_render(&t->out, target, &tt); + clear(&t->out, &tt); - test_init_image(&image, &t->real.shm, tt.format, tt.width, tt.height); + test_init_image(&image, &t->out.shm, tt.format, tt.width, tt.height); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { @@ -174,7 +174,7 @@ x = rand() % (2*tt.width) - tt.width; y = rand() % (2*tt.height) - tt.height; - fill_rect(&t->real, tt.draw, tt.format, + fill_rect(&t->out, tt.draw, tt.format, 0, 0, 0, GXcopy, x, y, w, h, fg); @@ -195,7 +195,7 @@ pixman_fill(cells, tt.width, 32, x, y, w, h, fg); } - XShmGetImage(t->real.dpy, tt.draw, &image, 0, 0, AllPlanes); + XShmGetImage(t->out.dpy, tt.draw, &image, 0, 0, AllPlanes); for (y = 0; y < tt.height; y++) { for (x = 0; x < tt.width; x++) { @@ -223,37 +223,37 @@ printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(cells); } static void rect_tests(struct test *t, int reps, int sets, enum target target, int use_window) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing area fills (%s, using %s source): ", test_target_name(target), use_window ? "window" : "pixmap"); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (real.width - 1); - int y = rand() % (real.height - 1); - int w = 1 + rand() % (real.width - x - 1); - int h = 1 + rand() % (real.height - y - 1); - int tmpx = w == real.width ? 0 : rand() % (real.width - w); - int tmpy = h == real.height ? 0 : rand() % (real.height - h); + int x = rand() % (out.width - 1); + int y = rand() % (out.height - 1); + int w = 1 + rand() % (out.width - x - 1); + int h = 1 + rand() % (out.height - y - 1); + int tmpx = w == out.width ? 0 : rand() % (out.width - w); + int tmpy = h == out.height ? 0 : rand() % (out.height - h); uint8_t alu = rand() % (GXset + 1); uint32_t fg = rand(); - fill_rect(&t->real, real.draw, real.format, + fill_rect(&t->out, out.draw, out.format, use_window, tmpx, tmpy, alu, x, y, w, h, fg); fill_rect(&t->ref, ref.draw, ref.format, @@ -262,15 +262,15 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/basic-copyarea-size.c xserver-xorg-video-intel-2.99.914/test/basic-copyarea-size.c --- xserver-xorg-video-intel-2.99.910/test/basic-copyarea-size.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/basic-copyarea-size.c 2014-06-21 14:45:39.000000000 +0000 @@ -45,14 +45,14 @@ int main(int argc, char **argv) { struct test test; - struct draw real, ref; + struct draw out, ref; int size, i; test_init(&test, argc, argv); /* Copy back and forth betwenn two pixmaps, gradually getting larger */ for (size = 1; size <= SIZE; size = (size * 3 + 1) / 2) { - target_init(&test.real, &real, size); + target_init(&test.out, &out, size); target_init(&test.ref, &ref, size); printf("size=%d\n", size); @@ -67,10 +67,10 @@ int order = rand() & 1; - XCopyArea(test.real.dpy, - order ? real.a : real.b, - (!order) ? real.a : real.b, - real.gc, + XCopyArea(test.out.dpy, + order ? out.a : out.b, + (!order) ? out.a : out.b, + out.gc, sx, sy, size, size, dx, dy); @@ -86,17 +86,17 @@ } test_compare(&test, - real.a, real.format, + out.a, out.format, ref.a, ref.format, 0, 0, size, size, ""); test_compare(&test, - real.b, real.format, + out.b, out.format, ref.b, ref.format, 0, 0, size, size, ""); - target_fini(&test.real, &real); + target_fini(&test.out, &out); target_fini(&test.ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/basic-fillrect.c xserver-xorg-video-intel-2.99.914/test/basic-fillrect.c --- xserver-xorg-video-intel-2.99.910/test/basic-fillrect.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/basic-fillrect.c 2014-06-21 14:45:39.000000000 +0000 @@ -9,7 +9,7 @@ static void show_cells(char *buf, - const uint32_t *real, const uint32_t *ref, + const uint32_t *out, const uint32_t *ref, int x, int y, int w, int h) { int i, j, len = 0; @@ -22,7 +22,7 @@ if (i < 0 || i >= w) continue; - len += sprintf(buf+len, "%08x ", real[j*w+i]); + len += sprintf(buf+len, "%08x ", out[j*w+i]); } len += sprintf(buf+len, "\t"); @@ -56,13 +56,13 @@ { struct test_target tt; XImage image; - uint32_t *cells = malloc(t->real.width*t->real.height*4); + uint32_t *cells = malloc(t->out.width*t->out.height*4); struct { uint16_t x, y; } *pixels = malloc(reps*sizeof(*pixels)); int r, s; - test_target_create_render(&t->real, target, &tt); + test_target_create_render(&t->out, target, &tt); printf("Testing setting of single pixels (%s): ", test_target_name(target)); @@ -74,7 +74,7 @@ int y = rand() % (tt.height - 1); uint32_t fg = rand(); - fill_rect(&t->real, tt.draw, GXcopy, + fill_rect(&t->out, tt.draw, GXcopy, x, y, 1, 1, fg); pixels[r].x = x; @@ -82,14 +82,14 @@ cells[y*tt.width+x] = fg; } - test_init_image(&image, &t->real.shm, tt.format, 1, 1); + test_init_image(&image, &t->out.shm, tt.format, 1, 1); for (r = 0; r < reps; r++) { uint32_t x = pixels[r].x; uint32_t y = pixels[r].y; uint32_t result; - XShmGetImage(t->real.dpy, tt.draw, &image, + XShmGetImage(t->out.dpy, tt.draw, &image, x, y, AllPlanes); result = *(uint32_t *)image.data; @@ -108,7 +108,7 @@ } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(pixels); free(cells); } @@ -124,16 +124,16 @@ { struct test_target tt; XImage image; - uint32_t *cells = calloc(sizeof(uint32_t), t->real.width*t->real.height); + uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height); int r, s, x, y; printf("Testing area sets (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &tt); - clear(&t->real, &tt); + test_target_create_render(&t->out, target, &tt); + clear(&t->out, &tt); - test_init_image(&image, &t->real.shm, tt.format, tt.width, tt.height); + test_init_image(&image, &t->out.shm, tt.format, tt.width, tt.height); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { @@ -144,7 +144,7 @@ x = rand() % (2*tt.width) - tt.width; y = rand() % (2*tt.height) - tt.height; - fill_rect(&t->real, tt.draw, GXcopy, + fill_rect(&t->out, tt.draw, GXcopy, x, y, w, h, fg); if (x < 0) @@ -164,7 +164,7 @@ pixman_fill(cells, tt.width, 32, x, y, w, h, fg); } - XShmGetImage(t->real.dpy, tt.draw, &image, 0, 0, AllPlanes); + XShmGetImage(t->out.dpy, tt.draw, &image, 0, 0, AllPlanes); for (y = 0; y < tt.height; y++) { for (x = 0; x < tt.width; x++) { @@ -192,49 +192,49 @@ printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(cells); } static void rect_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing area fills (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; - int w = rand() % (2*real.width); - int h = rand() % (2*real.height); + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; + int w = rand() % (2*out.width); + int h = rand() % (2*out.height); uint8_t alu = rand() % (GXset + 1); uint32_t fg = rand(); - fill_rect(&t->real, real.draw, alu, + fill_rect(&t->out, out.draw, alu, x, y, w, h, fg); fill_rect(&t->ref, ref.draw, alu, x, y, w, h, fg); } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/basic-lines.c xserver-xorg-video-intel-2.99.914/test/basic-lines.c --- xserver-xorg-video-intel-2.99.910/test/basic-lines.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/basic-lines.c 2014-06-21 14:45:39.000000000 +0000 @@ -85,14 +85,14 @@ static void line_tests(struct test *t, enum target target) { char buf[1024]; - struct test_target real, ref; + struct test_target out, ref; int a, b, alu, lw, style, cap; printf("Testing drawing of single line segments (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); + test_target_create_render(&t->out, target, &out); test_target_create_render(&t->ref, target, &ref); style = LineSolid; @@ -108,18 +108,18 @@ points[b].x, points[b].y, lw, cap, alu); - clear(&t->real, &real); + clear(&t->out, &out); clear(&t->ref, &ref); - draw_line(&t->real, &real, alu, lw, style, cap, + draw_line(&t->out, &out, alu, lw, style, cap, &points[a], &points[b], 64, 64); draw_line(&t->ref, &ref, alu, lw, style, cap, &points[a], &points[b], 64, 64); test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, buf); } } @@ -127,7 +127,7 @@ } } - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); printf("\n"); diff -Nru xserver-xorg-video-intel-2.99.910/test/basic-putimage.c xserver-xorg-video-intel-2.99.914/test/basic-putimage.c --- xserver-xorg-video-intel-2.99.910/test/basic-putimage.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/basic-putimage.c 2014-06-21 14:45:39.000000000 +0000 @@ -9,7 +9,7 @@ static void show_cells(char *buf, - const uint32_t *real, const uint32_t *ref, + const uint32_t *out, const uint32_t *ref, int x, int y, int w, int h) { int i, j, len = 0; @@ -22,7 +22,7 @@ if (i < 0 || i >= w) continue; - len += sprintf(buf+len, "%08x ", real[j*w+i]); + len += sprintf(buf+len, "%08x ", out[j*w+i]); } len += sprintf(buf+len, "\t"); @@ -69,13 +69,13 @@ { struct test_target tt; XImage image; - uint32_t *cells = malloc(t->real.width*t->real.height*4); + uint32_t *cells = malloc(t->out.width*t->out.height*4); struct { uint16_t x, y; } *pixels = malloc(reps*sizeof(*pixels)); int r, s; - test_target_create_render(&t->real, target, &tt); + test_target_create_render(&t->out, target, &tt); printf("Testing setting of single pixels (%s %s shm): ", test_target_name(target), use_shm ? "with" : "without" ); @@ -91,7 +91,7 @@ int alpha = rand() % 0xff; uint32_t fg = color(red, green, blue, alpha); - fill_rect(&t->real, tt.draw, tt.format, use_shm, + fill_rect(&t->out, tt.draw, tt.format, use_shm, GXcopy, x, y, 1, 1, fg); pixels[r].x = x; @@ -99,14 +99,14 @@ cells[y*tt.width+x] = fg; } - test_init_image(&image, &t->real.shm, tt.format, 1, 1); + test_init_image(&image, &t->out.shm, tt.format, 1, 1); for (r = 0; r < reps; r++) { uint32_t result; uint32_t x = pixels[r].x; uint32_t y = pixels[r].y; - XShmGetImage(t->real.dpy, tt.draw, &image, + XShmGetImage(t->out.dpy, tt.draw, &image, x, y, AllPlanes); result = *(uint32_t *)image.data; @@ -128,7 +128,7 @@ } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(pixels); free(cells); } @@ -144,17 +144,17 @@ { struct test_target tt; XImage image; - uint32_t *cells = calloc(sizeof(uint32_t), t->real.width*t->real.height); + uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height); int r, s, x, y; printf("Testing area sets (%s %s shm): ", test_target_name(target), use_shm ? "with" : "without" ); fflush(stdout); - test_target_create_render(&t->real, target, &tt); - clear(&t->real, &tt); + test_target_create_render(&t->out, target, &tt); + clear(&t->out, &tt); - test_init_image(&image, &t->real.shm, tt.format, tt.width, tt.height); + test_init_image(&image, &t->out.shm, tt.format, tt.width, tt.height); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { @@ -170,13 +170,13 @@ w = rand() % (tt.width - x); h = rand() % (tt.height - y); - fill_rect(&t->real, tt.draw, tt.format, use_shm, + fill_rect(&t->out, tt.draw, tt.format, use_shm, GXcopy, x, y, w, h, fg); pixman_fill(cells, tt.width, 32, x, y, w, h, fg); } - XShmGetImage(t->real.dpy, tt.draw, &image, 0, 0, AllPlanes); + XShmGetImage(t->out.dpy, tt.draw, &image, 0, 0, AllPlanes); for (y = 0; y < tt.height; y++) { for (x = 0; x < tt.width; x++) { @@ -205,30 +205,30 @@ printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(cells); } static void rect_tests(struct test *t, int reps, int sets, enum target target, int use_shm) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing area fills (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % real.width; - int y = rand() % real.height; - int w = rand() % (real.width - x); - int h = rand() % (real.height - y); + int x = rand() % out.width; + int y = rand() % out.height; + int w = rand() % (out.width - x); + int h = rand() % (out.height - y); uint8_t alu = rand() % (GXset + 1); int red = rand() % 0xff; int green = rand() % 0xff; @@ -236,22 +236,22 @@ int alpha = rand() % 0xff; uint8_t fg = color(red, green, blue, alpha); - fill_rect(&t->real, real.draw, real.format, use_shm, + fill_rect(&t->out, out.draw, out.format, use_shm, alu, x, y, w, h, fg); fill_rect(&t->ref, ref.draw, ref.format, use_shm, alu, x, y, w, h, fg); } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } int main(int argc, char **argv) diff -Nru xserver-xorg-video-intel-2.99.910/test/basic-rectangle.c xserver-xorg-video-intel-2.99.914/test/basic-rectangle.c --- xserver-xorg-video-intel-2.99.910/test/basic-rectangle.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/basic-rectangle.c 2014-06-21 14:45:39.000000000 +0000 @@ -30,169 +30,169 @@ static void zrect_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing empty rects (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; uint8_t alu = rand() % (GXset + 1); uint32_t fg = rand(); uint32_t lw = rand() % 4; - draw_rect(&t->real, real.draw, alu, + draw_rect(&t->out, out.draw, alu, x, y, 0, 0, fg, lw); draw_rect(&t->ref, ref.draw, alu, x, y, 0, 0, fg, lw); } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } static void hrect_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing horizontal rects (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; - int w = rand() % (2*real.width); + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; + int w = rand() % (2*out.width); uint8_t alu = rand() % (GXset + 1); uint32_t fg = rand(); uint32_t lw = rand() % 4; - draw_rect(&t->real, real.draw, alu, + draw_rect(&t->out, out.draw, alu, x, y, w, 0, fg, lw); draw_rect(&t->ref, ref.draw, alu, x, y, w, 0, fg, lw); } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } static void vrect_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing vertical rects (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; - int h = rand() % (2*real.width); + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; + int h = rand() % (2*out.width); uint8_t alu = rand() % (GXset + 1); uint32_t fg = rand(); uint32_t lw = rand() % 4; - draw_rect(&t->real, real.draw, alu, + draw_rect(&t->out, out.draw, alu, x, y, 0, h, fg, lw); draw_rect(&t->ref, ref.draw, alu, x, y, 0, h, fg, lw); } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } static void rect_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing general (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; - int w = rand() % (2*real.width); - int h = rand() % (2*real.height); + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; + int w = rand() % (2*out.width); + int h = rand() % (2*out.height); uint8_t alu = rand() % (GXset + 1); uint32_t fg = rand(); uint32_t lw = rand() % 4; - draw_rect(&t->real, real.draw, alu, + draw_rect(&t->out, out.draw, alu, x, y, w, h, fg, lw); draw_rect(&t->ref, ref.draw, alu, x, y, w, h, fg, lw); } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/basic-stippledrect.c xserver-xorg-video-intel-2.99.914/test/basic-stippledrect.c --- xserver-xorg-video-intel-2.99.910/test/basic-stippledrect.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/basic-stippledrect.c 2014-06-21 14:45:39.000000000 +0000 @@ -54,33 +54,33 @@ static void unclipped_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing unclipped stippled fills (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&real); + test_target_create_render(&t->out, target, &out); + clear(&out); test_target_create_render(&t->ref, target, &ref); clear(&ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % real.width; - int y = rand() % real.height; - int w = rand() % (real.width - x); - int h = rand() % (real.height - y); - int tx = rand() % (2*real.width) - real.width; - int ty = rand() % (2*real.height) - real.height; + int x = rand() % out.width; + int y = rand() % out.height; + int w = rand() % (out.width - x); + int h = rand() % (out.height - y); + int tx = rand() % (2*out.width) - out.width; + int ty = rand() % (2*out.height) - out.height; uint8_t stipple = rand() % 4; uint8_t opaque = rand() % 1; uint8_t alu = rand() % (GXset + 1); uint32_t fg = rand(); uint32_t bg = rand(); - fill_rect(&real, alu, NULL, 0, + fill_rect(&out, alu, NULL, 0, stipple, opaque, tx, ty, x, y, w, h, fg, bg); @@ -91,47 +91,47 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } static void simple_clip_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing simple clipped stippled fills (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&real); + test_target_create_render(&t->out, target, &out); + clear(&out); test_target_create_render(&t->ref, target, &ref); clear(&ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; - int w = rand() % (2*real.width); - int h = rand() % (2*real.height); - int tx = rand() % (2*real.width) - real.width; - int ty = rand() % (2*real.height) - real.height; + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; + int w = rand() % (2*out.width); + int h = rand() % (2*out.height); + int tx = rand() % (2*out.width) - out.width; + int ty = rand() % (2*out.height) - out.height; uint8_t stipple = rand() % 4; uint8_t opaque = rand() % 1; uint8_t alu = rand() % (GXset + 1); uint32_t fg = rand(); uint32_t bg = rand(); - fill_rect(&real, alu, NULL, 0, + fill_rect(&out, alu, NULL, 0, stipple, opaque, tx, ty, x, y, w, h, fg, bg); @@ -142,29 +142,29 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } static void complex_clip_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; XRectangle *clip; int nclip, r, s; printf("Testing complex clipped stippled fills (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&real); + test_target_create_render(&t->out, target, &out); + clear(&out); test_target_create_render(&t->ref, target, &ref); clear(&ref); @@ -173,26 +173,26 @@ nclip = (rand() % 16) + 2; clip = malloc(sizeof(XRectangle)*nclip); for (r = 0; r < nclip; r++) { - clip[r].x = rand() % real.width; - clip[r].y = rand() % real.height; - clip[r].width = rand() % (real.width - clip[r].x); - clip[r].height = rand() % (real.height - clip[r].y); + clip[r].x = rand() % out.width; + clip[r].y = rand() % out.height; + clip[r].width = rand() % (out.width - clip[r].x); + clip[r].height = rand() % (out.height - clip[r].y); } for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; - int w = rand() % (2*real.width); - int h = rand() % (2*real.height); - int tx = rand() % (2*real.width) - real.width; - int ty = rand() % (2*real.height) - real.height; + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; + int w = rand() % (2*out.width); + int h = rand() % (2*out.height); + int tx = rand() % (2*out.width) - out.width; + int ty = rand() % (2*out.height) - out.height; uint8_t stipple = rand() % 4; uint8_t opaque = rand() % 1; uint8_t alu = rand() % (GXset + 1); uint32_t fg = rand(); uint32_t bg = rand(); - fill_rect(&real, alu, clip, nclip, + fill_rect(&out, alu, clip, nclip, stipple, opaque, tx, ty, x, y, w, h, fg, bg); @@ -203,9 +203,9 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); free(clip); @@ -213,7 +213,7 @@ printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/basic-stress.c xserver-xorg-video-intel-2.99.914/test/basic-stress.c --- xserver-xorg-video-intel-2.99.910/test/basic-stress.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/basic-stress.c 2014-06-21 14:45:39.000000000 +0000 @@ -27,36 +27,36 @@ 0, 0, tt->width, tt->height); } -static void fill(struct test_target *real, +static void fill(struct test_target *out, struct test_target *ref) { - int x = rand() % (2*real->width) - real->width; - int y = rand() % (2*real->height) - real->height; - int w = rand() % (2*real->width); - int h = rand() % (2*real->height); + int x = rand() % (2*out->width) - out->width; + int y = rand() % (2*out->height) - out->height; + int w = rand() % (2*out->width); + int h = rand() % (2*out->height); int color = rand(); int alu = rand() % 16; - fill_rect(real, alu, color, x, y, w, h); + fill_rect(out, alu, color, x, y, w, h); fill_rect(ref, alu, color, x, y, w, h); } -static void copy(struct test_target *real, +static void copy(struct test_target *out, struct test_target *ref) { - int sx = rand() % (2*real->width) - ref->width; - int sy = rand() % (2*real->height) - ref->height; - int dx = rand() % (2*real->width) - ref->width; - int dy = rand() % (2*real->height) - ref->height; - int w = rand() % (2*real->width); - int h = rand() % (2*real->height); + int sx = rand() % (2*out->width) - ref->width; + int sy = rand() % (2*out->height) - ref->height; + int dx = rand() % (2*out->width) - ref->width; + int dy = rand() % (2*out->height) - ref->height; + int w = rand() % (2*out->width); + int h = rand() % (2*out->height); XGCValues val; val.function = rand() % 16; - XChangeGC(real->dpy->dpy, real->gc, GCFunction, &val); - XCopyArea(real->dpy->dpy, - real->draw, real->draw, real->gc, + XChangeGC(out->dpy->dpy, out->gc, GCFunction, &val); + XCopyArea(out->dpy->dpy, + out->draw, out->draw, out->gc, sx, sy, w, h, dx, dy); XChangeGC(ref->dpy->dpy, ref->gc, GCFunction, &val); @@ -90,23 +90,23 @@ } } -static void put(struct test_target *real, +static void put(struct test_target *out, struct test_target *ref) { - int x = rand() % (2*real->width) - real->width; - int y = rand() % (2*real->height) - real->height; - int w = rand() % real->width; - int h = rand() % real->height; + int x = rand() % (2*out->width) - out->width; + int y = rand() % (2*out->height) - out->height; + int w = rand() % out->width; + int h = rand() % out->height; int color = rand(); int alu = rand() % 16; - _put(real, x, y, w, h, color, alu); + _put(out, x, y, w, h, color, alu); _put(ref, x, y, w, h, color, alu); } static void rect_tests(struct test *test, int iterations, enum target target) { - struct test_target real, ref; + struct test_target out, ref; void (* const ops[])(struct test_target *, struct test_target *) = { copy, fill, @@ -118,24 +118,24 @@ test_target_name(target)); fflush(stdout); - test_target_create_render(&test->real, target, &real); + test_target_create_render(&test->out, target, &out); test_target_create_render(&test->ref, target, &ref); - clear(&real); + clear(&out); clear(&ref); for (n = 0; n < iterations; n++) - ops[rand() % ARRAY_SIZE(ops)](&real, &ref); + ops[rand() % ARRAY_SIZE(ops)](&out, &ref); test_compare(test, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); printf("passed [%d iterations]\n", n); - test_target_destroy_render(&test->real, &real); + test_target_destroy_render(&test->out, &out); test_target_destroy_render(&test->ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/basic-string.c xserver-xorg-video-intel-2.99.914/test/basic-string.c --- xserver-xorg-video-intel-2.99.910/test/basic-string.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/basic-string.c 2014-06-21 14:45:39.000000000 +0000 @@ -39,42 +39,42 @@ static void string_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing general (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; uint8_t alu = rand() % (GXset + 1); uint32_t fg = rand(); uint32_t bg = rand(); int str = rand(); int fill = rand() & 1; - draw_string(&t->real, real.draw, alu, x, y, fg, bg, str, fill); + draw_string(&t->out, out.draw, alu, x, y, fg, bg, str, fill); draw_string(&t->ref, ref.draw, alu, x, y, fg, bg, str, fill); } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/basic-tiledrect.c xserver-xorg-video-intel-2.99.914/test/basic-tiledrect.c --- xserver-xorg-video-intel-2.99.910/test/basic-tiledrect.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/basic-tiledrect.c 2014-06-21 14:45:39.000000000 +0000 @@ -4,16 +4,61 @@ #include "test.h" -static unsigned char bitmap4x4[] = { - 0x03, 0x06, 0x0c, 0x09 +static const unsigned char data[] = { + 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, + 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, }; -static unsigned char bitmap8x8[3][8] = { - { 0xcc, 0x66, 0x33, 0x99, 0xcc, 0x66, 0x33, 0x99 }, - { 0x00, 0xfe, 0x92, 0x92, 0xfe, 0x92, 0x92, 0xfe }, - { 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa }, +static struct bitmap { + int width, height; + struct cache { + Display *dpy; + Pixmap pixmap; + } cached[2]; +} bitmaps[] = { + { 1, 1, }, + { 1, 2, }, + { 2, 3, }, + { 3, 2, }, + { 4, 4, }, + { 6, 6, }, + { 8, 8, }, + { 8, 4, }, + { 8, 2, }, + { 8, 1, }, + { 4, 8, }, + { 2, 8, }, + { 1, 8, }, + { 16, 16, }, + { 15, 17, }, + { 24, 24, }, + { 32, 32, }, + { 16, 8, }, + { 16, 4, }, + { 16, 2, }, + { 16, 1, }, + { 8, 16, }, + { 4, 16, }, + { 2, 16, }, + { 1, 16, }, }; +static void reset_cache(void) +{ + int n, m; + + for (n = 0; n < sizeof(bitmaps)/sizeof(bitmaps[0]); n++) { + for (m = 0; m < 2; m++) { + if (bitmaps[n].cached[m].dpy) { + XFreePixmap(bitmaps[n].cached[m].dpy, bitmaps[n].cached[m].pixmap); + bitmaps[n].cached[m].dpy = NULL; + } + } + } +} + static void fill_rect(struct test_target *t, uint8_t alu, XRectangle *clip, int nclip, uint8_t tile, int tx, int ty, @@ -21,28 +66,48 @@ uint32_t fg, uint32_t bg) { Display *dpy = t->dpy->dpy; + struct bitmap *b = &bitmaps[(tile >> 1) % (sizeof(bitmaps)/sizeof(bitmaps[0]))]; XGCValues val; GC gc; + int n; val.function = alu; + val.function = GXcopy; val.fill_style = FillTiled; val.ts_x_origin = tx; val.ts_y_origin = ty; - if (tile == 0) { - val.tile = XCreatePixmapFromBitmapData(dpy, t->draw, (char *)bitmap4x4, 4, 4, - fg, bg, t->depth); - } else { - char *b = (char *)bitmap8x8[tile-1]; - val.tile = XCreatePixmapFromBitmapData(dpy, t->draw, b, 8, 8, + if (tile & 1) { + val.tile = 0; + for (n = 0; n < 2; n++) { + if (b->cached[n].dpy == dpy) { + val.tile = b->cached[n].pixmap; + break; + } + } + if (val.tile == 0) { + val.tile = XCreatePixmapFromBitmapData(dpy, t->draw, + (char *)data, b->width, b->height, + fg, bg, t->depth); + for (n = 0; n < 2; n++) { + if (b->cached[n].dpy == NULL) { + b->cached[n].dpy = dpy; + b->cached[n].pixmap = val.tile; + break; + } + } + } + } else + val.tile = XCreatePixmapFromBitmapData(dpy, t->draw, + (char *)data, b->width, b->height, fg, bg, t->depth); - } gc = XCreateGC(dpy, t->draw, GCFillStyle | GCTileStipXOrigin | GCTileStipYOrigin | GCTile | GCFunction, &val); if (nclip) XSetClipRectangles(dpy, gc, 0, 0, clip, nclip, Unsorted); XFillRectangle(dpy, t->draw, gc, x, y, w, h); XFreeGC(dpy, gc); - XFreePixmap(dpy, val.tile); + if ((tile & 1) == 0) + XFreePixmap(dpy, val.tile); } static void clear(struct test_target *tt) @@ -52,34 +117,107 @@ 0, 0, tt->width, tt->height); } +static void small_tests(struct test *t, int reps, int sets, enum target target) +{ + struct test_target out, ref; + int r, s; + + printf("Testing small tiled fills (%s): ", test_target_name(target)); + fflush(stdout); + + test_target_create_render(&t->out, target, &out); + clear(&out); + + test_target_create_render(&t->ref, target, &ref); + clear(&ref); + + for (s = 0; s < sets; s++) { + for (r = 0; r < reps; r++) { + int x = rand() % out.width; + int y = rand() % out.height; + int w = rand() % out.width; + int h = rand() % 8; + int tx = rand() % (2*out.width) - out.width; + int ty = rand() % (2*out.height) - out.height; + uint8_t tile = rand(); + uint8_t alu = rand() % (GXset + 1); + uint32_t fg = rand(); + uint32_t bg = rand(); + + fill_rect(&out, alu, NULL, 0, + tile, tx, ty, + x, y, w, h, + fg, bg); + fill_rect(&ref, alu, NULL, 0, + tile, tx, ty, + x, y, w, h, + fg, bg); + + fill_rect(&out, alu, NULL, 0, + tile, tx, ty, + x, y, h, w, + fg, bg); + fill_rect(&ref, alu, NULL, 0, + tile, tx, ty, + x, y, h, w, + fg, bg); + } + + test_compare(t, + out.draw, out.format, + ref.draw, ref.format, + 0, 0, out.width, out.height, + ""); + + if (target == CHILD) { + int x = rand() % (t->out.width-out.width); + int y = rand() % (t->out.height-out.height); + + clear(&out); + clear(&ref); + + XMoveWindow(out.dpy->dpy, out.draw, x, y); + XMoveWindow(ref.dpy->dpy, ref.draw, x, y); + + clear(&out); + clear(&ref); + } + } + + printf("passed [%d iterations x %d]\n", reps, sets); + + test_target_destroy_render(&t->out, &out); + test_target_destroy_render(&t->ref, &ref); +} + static void unclipped_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing unclipped tiled fills (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&real); + test_target_create_render(&t->out, target, &out); + clear(&out); test_target_create_render(&t->ref, target, &ref); clear(&ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % real.width; - int y = rand() % real.height; - int w = rand() % (real.width - x); - int h = rand() % (real.height - y); - int tx = rand() % (2*real.width) - real.width; - int ty = rand() % (2*real.height) - real.height; - uint8_t tile = rand() % 4; + int x = rand() % out.width; + int y = rand() % out.height; + int w = rand() % (out.width - x); + int h = rand() % (out.height - y); + int tx = rand() % (2*out.width) - out.width; + int ty = rand() % (2*out.height) - out.height; + uint8_t tile = rand(); uint8_t alu = rand() % (GXset + 1); uint32_t fg = rand(); uint32_t bg = rand(); - fill_rect(&real, alu, NULL, 0, + fill_rect(&out, alu, NULL, 0, tile, tx, ty, x, y, w, h, fg, bg); @@ -90,46 +228,60 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); + + if (target == CHILD) { + int x = rand() % (t->out.width-out.width); + int y = rand() % (t->out.height-out.height); + + clear(&out); + clear(&ref); + + XMoveWindow(out.dpy->dpy, out.draw, x, y); + XMoveWindow(ref.dpy->dpy, ref.draw, x, y); + + clear(&out); + clear(&ref); + } } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } static void simple_clip_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing simple clipped tiled fills (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&real); + test_target_create_render(&t->out, target, &out); + clear(&out); test_target_create_render(&t->ref, target, &ref); clear(&ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; - int w = rand() % (2*real.width); - int h = rand() % (2*real.height); - int tx = rand() % (2*real.width) - real.width; - int ty = rand() % (2*real.height) - real.height; - uint8_t tile = rand() % 4; + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; + int w = rand() % (2*out.width); + int h = rand() % (2*out.height); + int tx = rand() % (2*out.width) - out.width; + int ty = rand() % (2*out.height) - out.height; + uint8_t tile = rand(); uint8_t alu = rand() % (GXset + 1); uint32_t fg = rand(); uint32_t bg = rand(); - fill_rect(&real, alu, NULL, 0, + fill_rect(&out, alu, NULL, 0, tile, tx, ty, x, y, w, h, fg, bg); @@ -140,29 +292,43 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); + + if (target == CHILD) { + int x = rand() % (t->out.width-out.width); + int y = rand() % (t->out.height-out.height); + + clear(&out); + clear(&ref); + + XMoveWindow(out.dpy->dpy, out.draw, x, y); + XMoveWindow(ref.dpy->dpy, ref.draw, x, y); + + clear(&out); + clear(&ref); + } } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } static void complex_clip_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; XRectangle *clip; int nclip, r, s; printf("Testing complex clipped tiled fills (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&real); + test_target_create_render(&t->out, target, &out); + clear(&out); test_target_create_render(&t->ref, target, &ref); clear(&ref); @@ -171,25 +337,25 @@ nclip = (rand() % 16) + 2; clip = malloc(sizeof(XRectangle)*nclip); for (r = 0; r < nclip; r++) { - clip[r].x = rand() % real.width; - clip[r].y = rand() % real.height; - clip[r].width = rand() % (real.width - clip[r].x); - clip[r].height = rand() % (real.height - clip[r].y); + clip[r].x = rand() % out.width; + clip[r].y = rand() % out.height; + clip[r].width = rand() % (out.width - clip[r].x); + clip[r].height = rand() % (out.height - clip[r].y); } for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; - int w = rand() % (2*real.width); - int h = rand() % (2*real.height); - int tx = rand() % (2*real.width) - real.width; - int ty = rand() % (2*real.height) - real.height; - uint8_t tile = rand() % 4; + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; + int w = rand() % (2*out.width); + int h = rand() % (2*out.height); + int tx = rand() % (2*out.width) - out.width; + int ty = rand() % (2*out.height) - out.height; + uint8_t tile = rand(); uint8_t alu = rand() % (GXset + 1); uint32_t fg = rand(); uint32_t bg = rand(); - fill_rect(&real, alu, clip, nclip, + fill_rect(&out, alu, clip, nclip, tile, tx, ty, x, y, w, h, fg, bg); @@ -200,17 +366,31 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); free(clip); + + if (target == CHILD) { + int x = rand() % (t->out.width-out.width); + int y = rand() % (t->out.height-out.height); + + clear(&out); + clear(&ref); + + XMoveWindow(out.dpy->dpy, out.draw, x, y); + XMoveWindow(ref.dpy->dpy, ref.draw, x, y); + + clear(&out); + clear(&ref); + } } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } @@ -226,9 +406,11 @@ enum target t; for (t = TARGET_FIRST; t <= TARGET_LAST; t++) { + small_tests(&test, reps, sets, t); unclipped_tests(&test, reps, sets, t); simple_clip_tests(&test, reps, sets, t); complex_clip_tests(&test, reps, sets, t); + reset_cache(); } } diff -Nru xserver-xorg-video-intel-2.99.910/test/dri2-race.c xserver-xorg-video-intel-2.99.914/test/dri2-race.c --- xserver-xorg-video-intel-2.99.910/test/dri2-race.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/dri2-race.c 2014-07-23 12:55:39.000000000 +0000 @@ -28,7 +28,7 @@ printf ("Connecting to %s driver on %s\n", driver, device); - fd = open("/dev/dri/card0", O_RDWR); + fd = open(device, O_RDWR); if (fd < 0) return -1; diff -Nru xserver-xorg-video-intel-2.99.910/test/dri2-swap.c xserver-xorg-video-intel-2.99.914/test/dri2-swap.c --- xserver-xorg-video-intel-2.99.910/test/dri2-swap.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/dri2-swap.c 2014-07-23 12:55:39.000000000 +0000 @@ -28,7 +28,7 @@ printf ("Connecting to %s driver on %s\n", driver, device); - fd = open("/dev/dri/card0", O_RDWR); + fd = open(device, O_RDWR); if (fd < 0) return -1; diff -Nru xserver-xorg-video-intel-2.99.910/test/dri2-test.c xserver-xorg-video-intel-2.99.914/test/dri2-test.c --- xserver-xorg-video-intel-2.99.910/test/dri2-test.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/dri2-test.c 2014-07-23 12:55:39.000000000 +0000 @@ -52,7 +52,7 @@ printf ("Connecting to %s driver on %s\n", driver, device); - fd = open("/dev/dri/card0", O_RDWR); + fd = open(device, O_RDWR); if (fd < 0) return -1; @@ -83,15 +83,6 @@ XFixesDestroyRegion(dpy, region); } -static void xsync(Display *dpy, Window win) -{ - XImage *image; - - image = XGetImage(dpy, win, 0, 0, 1, 1, ~0, ZPixmap); - if (image) - XDestroyImage(image); -} - static double elapsed(const struct timespec *start, const struct timespec *end) { @@ -99,6 +90,17 @@ 1e-9*(end->tv_nsec - start->tv_nsec); } +static uint64_t check_msc(Display *dpy, Window win, uint64_t last_msc) +{ + uint64_t current_msc, current_ust, current_sbc; + DRI2GetMSC(dpy, win, ¤t_ust, ¤t_msc, ¤t_sbc); + if (current_msc < last_msc) { + printf("Invalid MSC: was %llu, now %llu\n", + (long long)last_msc, (long long)current_msc); + } + return current_msc; +} + static void run(Display *dpy, int width, int height, unsigned int *attachments, int nattachments, const char *name) @@ -108,6 +110,7 @@ int count; DRI2Buffer *buffers; struct timespec start, end; + uint64_t msc; /* Be nasty and install a fullscreen window on top so that we * can guarantee we do not get clipped by children. @@ -120,29 +123,29 @@ DefaultVisual(dpy, DefaultScreen(dpy)), CWOverrideRedirect, &attr); XMapWindow(dpy, win); - xsync(dpy, win); DRI2CreateDrawable(dpy, win); + msc = check_msc(dpy, win, 0); buffers = DRI2GetBuffers(dpy, win, &width, &height, attachments, nattachments, &count); if (count != nattachments) return; - xsync(dpy, win); + msc = check_msc(dpy, win, msc); clock_gettime(CLOCK_MONOTONIC, &start); for (count = 0; count < COUNT; count++) DRI2SwapBuffers(dpy, win, 0, 0, 0); - xsync(dpy, win); + msc = check_msc(dpy, win, msc); clock_gettime(CLOCK_MONOTONIC, &end); printf("%d %s (%dx%d) swaps in %fs.\n", count, name, width, height, elapsed(&start, &end)); - xsync(dpy, win); + msc = check_msc(dpy, win, msc); clock_gettime(CLOCK_MONOTONIC, &start); for (count = 0; count < COUNT; count++) dri2_copy_swap(dpy, win, width, height, nattachments == 2); - xsync(dpy, win); + msc = check_msc(dpy, win, msc); clock_gettime(CLOCK_MONOTONIC, &end); printf("%d %s (%dx%d) blits in %fs.\n", @@ -150,11 +153,11 @@ DRI2SwapInterval(dpy, win, 0); - xsync(dpy, win); + msc = check_msc(dpy, win, msc); clock_gettime(CLOCK_MONOTONIC, &start); for (count = 0; count < COUNT; count++) DRI2SwapBuffers(dpy, win, 0, 0, 0); - xsync(dpy, win); + msc = check_msc(dpy, win, msc); clock_gettime(CLOCK_MONOTONIC, &end); printf("%d %s (%dx%d) vblank=0 swaps in %fs.\n", count, name, width, height, elapsed(&start, &end)); @@ -174,6 +177,9 @@ DRI2BufferFrontLeft, }; XRRScreenResources *res; + XRRCrtcInfo **original_crtc; + Window root; + uint64_t last_msc; dpy = XOpenDisplay(NULL); if (dpy == NULL) @@ -186,16 +192,23 @@ if (fd < 0) return 1; - res = _XRRGetScreenResourcesCurrent(dpy, DefaultRootWindow(dpy)); + root = DefaultRootWindow(dpy); + DRI2CreateDrawable(dpy, root); + + res = _XRRGetScreenResourcesCurrent(dpy, root); if (res == NULL) return 1; - printf("noutput=%d, ncrtc=%d\n", res->noutput, res->ncrtc); + original_crtc = malloc(sizeof(XRRCrtcInfo *)*res->ncrtc); + for (i = 0; i < res->ncrtc; i++) + original_crtc[i] = XRRGetCrtcInfo(dpy, res, res->crtcs[i]); + printf("noutput=%d, ncrtc=%d\n", res->noutput, res->ncrtc); + last_msc = check_msc(dpy, root, 0); for (i = 0; i < res->ncrtc; i++) XRRSetCrtcConfig(dpy, res, res->crtcs[i], CurrentTime, 0, 0, None, RR_Rotate_0, NULL, 0); - XSync(dpy, True); + last_msc = check_msc(dpy, root, last_msc); for (i = 0; i < res->noutput; i++) { XRROutputInfo *output; @@ -209,12 +222,17 @@ if (res->nmode) mode = lookup_mode(res, output->modes[0]); - for (j = 0; mode && j < output->ncrtc; j++) { + for (j = 0; mode && j < 2*output->ncrtc; j++) { + int c = j; + if (c >= output->ncrtc) + c = 2*output->ncrtc - j - 1; + printf("[%d, %d] -- OUTPUT:%ld, CRTC:%ld\n", - i, j, (long)res->outputs[i], (long)output->crtcs[j]); - XRRSetCrtcConfig(dpy, res, output->crtcs[j], CurrentTime, + i, c, (long)res->outputs[i], (long)output->crtcs[c]); + last_msc = check_msc(dpy, root, last_msc); + XRRSetCrtcConfig(dpy, res, output->crtcs[c], CurrentTime, 0, 0, output->modes[0], RR_Rotate_0, &res->outputs[i], 1); - XSync(dpy, True); + last_msc = check_msc(dpy, root, last_msc); run(dpy, mode->width, mode->height, attachments, 1, "fullscreen"); run(dpy, mode->width, mode->height, attachments, 2, "fullscreen (with front)"); @@ -222,13 +240,22 @@ run(dpy, mode->width/2, mode->height/2, attachments, 1, "windowed"); run(dpy, mode->width/2, mode->height/2, attachments, 2, "windowed (with front)"); - XRRSetCrtcConfig(dpy, res, output->crtcs[j], CurrentTime, + last_msc = check_msc(dpy, root, last_msc); + XRRSetCrtcConfig(dpy, res, output->crtcs[c], CurrentTime, 0, 0, None, RR_Rotate_0, NULL, 0); - XSync(dpy, True); + last_msc = check_msc(dpy, root, last_msc); } XRRFreeOutputInfo(output); } + for (i = 0; i < res->ncrtc; i++) + XRRSetCrtcConfig(dpy, res, res->crtcs[i], CurrentTime, + original_crtc[i]->x, + original_crtc[i]->y, + original_crtc[i]->mode, + original_crtc[i]->rotation, + original_crtc[i]->outputs, + original_crtc[i]->noutput); return 0; } diff -Nru xserver-xorg-video-intel-2.99.910/test/dri3.c xserver-xorg-video-intel-2.99.914/test/dri3.c --- xserver-xorg-video-intel-2.99.910/test/dri3.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/dri3.c 2014-06-02 07:36:29.000000000 +0000 @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2014 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. + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "dri3.h" + +Pixmap dri3_create_pixmap(Display *dpy, + Drawable draw, + int width, int height, int depth, + int fd, int bpp, int stride, int size) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + if (fd >= 0) { + xcb_pixmap_t pixmap = xcb_generate_id(c); + xcb_dri3_pixmap_from_buffer(c, pixmap, draw, size, width, height, stride, depth, bpp, fd); + return pixmap; + } + return 0; +} + +int dri3_create_fd(Display *dpy, + Pixmap pixmap, + int *stride) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + xcb_dri3_buffer_from_pixmap_cookie_t cookie; + xcb_dri3_buffer_from_pixmap_reply_t *reply; + + cookie = xcb_dri3_buffer_from_pixmap(c, pixmap); + reply = xcb_dri3_buffer_from_pixmap_reply(c, cookie, NULL); + if (!reply) + return -1; + + if (reply->nfd != 1) + return -1; + + *stride = reply->stride; + return xcb_dri3_buffer_from_pixmap_reply_fds(c, reply)[0]; +} + +int dri3_create_fence(Display *dpy, Pixmap pixmap, struct dri3_fence *fence) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + struct dri3_fence f; + int fd; + + fd = xshmfence_alloc_shm(); + if (fd < 0) + return -1; + + f.addr = xshmfence_map_shm(fd); + if (f.addr == NULL) { + close(fd); + return -1; + } + + f.xid = xcb_generate_id(c); + xcb_dri3_fence_from_fd(c, pixmap, f.xid, 0, fd); + + *fence = f; + return 0; +} + +void dri3_fence_sync(Display *dpy, struct dri3_fence *fence) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + + xshmfence_reset(fence->addr); + + xcb_sync_trigger_fence(c, fence->xid); + xcb_flush(c); + + xshmfence_await(fence->addr); +} + +void dri3_fence_free(Display *dpy, struct dri3_fence *fence) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + + xshmfence_unmap_shm(fence->addr); + xcb_sync_destroy_fence(c, fence->xid); +} + +int dri3_open__full(Display *dpy, Window root, unsigned provider) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + xcb_dri3_open_cookie_t cookie; + xcb_dri3_open_reply_t *reply; + + cookie = xcb_dri3_open(c, root, provider); + reply = xcb_dri3_open_reply(c, cookie, NULL); + + if (!reply) + return -1; + + if (reply->nfd != 1) + return -1; + + return xcb_dri3_open_reply_fds(c, reply)[0]; +} + +int dri3_open(Display *dpy) +{ + return dri3_open__full(dpy, RootWindow(dpy, DefaultScreen(dpy)), None); +} diff -Nru xserver-xorg-video-intel-2.99.910/test/dri3.h xserver-xorg-video-intel-2.99.914/test/dri3.h --- xserver-xorg-video-intel-2.99.910/test/dri3.h 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/dri3.h 2014-05-14 13:42:31.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2014 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. + * + */ + +#ifndef DRI3_H +#define DRI3_H + +#include + +int dri3_open(Display *dpy); +int dri3_open__full(Display *dpy, Window root, unsigned provider); + +Pixmap dri3_create_pixmap(Display *dpy, + Drawable draw, + int width, int height, int depth, + int fd, int bpp, int stride, int size); +int dri3_create_fd(Display *dpy, + Pixmap pixmap, + int *stride); + +struct dri3_fence { + XID xid; + void *addr; +}; + +int dri3_create_fence(Display *dpy, Pixmap pixmap, struct dri3_fence *out); +void dri3_fence_sync(Display *dpy, struct dri3_fence *fence); +void dri3_fence_free(Display *dpy, struct dri3_fence *fence); + +#endif /* DRI3_H */ diff -Nru xserver-xorg-video-intel-2.99.910/test/dri3-test.c xserver-xorg-video-intel-2.99.914/test/dri3-test.c --- xserver-xorg-video-intel-2.99.910/test/dri3-test.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/dri3-test.c 2014-07-22 08:12:01.000000000 +0000 @@ -0,0 +1,1112 @@ +/* + * Copyright (c) 2014 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. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#if HAVE_X11_EXTENSIONS_SHMPROTO_H +#include +#elif HAVE_X11_EXTENSIONS_SHMSTR_H +#include +#else +#error Failed to find the right header for X11 MIT-SHM protocol definitions +#endif +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "dri3.h" +#include "../src/i915_pciids.h" + +#define ALIGN(x, y) (((x) + (y) - 1) & -(y)) +#define PAGE_ALIGN(x) ALIGN(x, 4096) + +#define GTT I915_GEM_DOMAIN_GTT +#define CPU I915_GEM_DOMAIN_CPU + +static int _x_error_occurred; + +static const struct pci_id_match ids[] = { + INTEL_I830_IDS(020), + INTEL_I845G_IDS(021), + INTEL_I85X_IDS(022), + INTEL_I865G_IDS(023), + + INTEL_I915G_IDS(030), + INTEL_I915GM_IDS(030), + INTEL_I945G_IDS(031), + INTEL_I945GM_IDS(031), + + INTEL_G33_IDS(033), + INTEL_PINEVIEW_IDS(033), + + INTEL_I965G_IDS(040), + INTEL_I965GM_IDS(040), + + INTEL_G45_IDS(045), + INTEL_GM45_IDS(045), + + INTEL_IRONLAKE_D_IDS(050), + INTEL_IRONLAKE_M_IDS(050), + + INTEL_SNB_D_IDS(060), + INTEL_SNB_M_IDS(060), + + INTEL_IVB_D_IDS(070), + INTEL_IVB_M_IDS(070), + + INTEL_HSW_D_IDS(075), + INTEL_HSW_M_IDS(075), + + INTEL_VLV_D_IDS(071), + INTEL_VLV_M_IDS(071), + + INTEL_BDW_D_IDS(0100), + INTEL_BDW_M_IDS(0100), +}; + +static int i915_gen(int device) +{ + struct drm_i915_getparam gp; + int devid = 0; + int n; + + gp.param = I915_PARAM_CHIPSET_ID; + gp.value = &devid; + + if (drmIoctl(device, DRM_IOCTL_I915_GETPARAM, &gp)) + return 0; + + for (n = 0; n < sizeof(ids)/sizeof(ids[0]); n++) { + if (devid == ids[n].device_id) + return ids[n].match_data; + } + + return 0; +} + +static int is_i915_device(int fd) +{ + drm_version_t version; + char name[5] = ""; + + memset(&version, 0, sizeof(version)); + version.name_len = 4; + version.name = name; + + if (drmIoctl(fd, DRM_IOCTL_VERSION, &version)) + return 0; + + return strcmp("i915", name) == 0; +} + +static int is_intel(int fd) +{ + struct drm_i915_getparam gp; + int ret; + + /* Confirm that this is a i915.ko device with GEM/KMS enabled */ + ret = is_i915_device(fd); + if (ret) { + gp.param = I915_PARAM_HAS_GEM; + gp.value = &ret; + if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) + ret = 0; + } + return ret; +} + +static uint32_t gem_create(int fd, int size) +{ + struct drm_i915_gem_create create; + + create.handle = 0; + create.size = size; + (void)drmIoctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); + + return create.handle; +} + +struct local_i915_gem_caching { + uint32_t handle; + uint32_t caching; +}; + +#define LOCAL_I915_GEM_SET_CACHING 0x2f +#define LOCAL_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + LOCAL_I915_GEM_SET_CACHING, struct local_i915_gem_caching) + +static int gem_set_caching(int fd, uint32_t handle, int caching) +{ + struct local_i915_gem_caching arg; + + arg.handle = handle; + arg.caching = caching; + + return drmIoctl(fd, LOCAL_IOCTL_I915_GEM_SET_CACHING, &arg) == 0; +} + +static int gem_export(int fd, uint32_t handle) +{ + struct drm_prime_handle args; + + args.handle = handle; + args.flags = O_CLOEXEC; + + if (drmIoctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args)) + return -1; + + return args.fd; +} + +static uint32_t gem_import(int fd, int name) +{ + struct drm_prime_handle args; + + args.fd = name; + args.flags = 0; + if (drmIoctl(fd, DRM_IOCTL_PRIME_FD_TO_HANDLE, &args)) + return 0; + + return args.handle; +} + +static int gem_write(int fd, uint32_t handle, int offset, void *data, int len) +{ + struct drm_i915_gem_pwrite gem_pwrite; + + gem_pwrite.handle = handle; + gem_pwrite.offset = offset; + gem_pwrite.size = len; + gem_pwrite.data_ptr = (uintptr_t)data; + return drmIoctl(fd, DRM_IOCTL_I915_GEM_PWRITE, &gem_pwrite); +} + +static void *gem_mmap(int fd, uint32_t handle, int size, unsigned prot, int domain) +{ + struct drm_i915_gem_set_domain set_domain; + void *ptr; + + if (domain == CPU) { + struct drm_i915_gem_mmap mmap_arg; + + mmap_arg.handle = handle; + mmap_arg.offset = 0; + mmap_arg.size = size; + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg)) + return NULL; + + ptr = (void *)(uintptr_t)mmap_arg.addr_ptr; + } else { + struct drm_i915_gem_mmap_gtt mmap_arg; + + mmap_arg.handle = handle; + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_MMAP_GTT, &mmap_arg)) + return NULL; + + ptr = mmap(0, size, prot, MAP_SHARED, fd, mmap_arg.offset); + if (ptr == MAP_FAILED) + return NULL; + } + + set_domain.handle = handle; + set_domain.read_domains = domain; + set_domain.write_domain = prot & PROT_WRITE ? set_domain.read_domains : 0; + if (drmIoctl(fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain)) { + munmap(ptr, size); + return NULL; + } + + return ptr; +} + +static void gem_sync(int fd, uint32_t handle, int read) +{ + struct drm_i915_gem_set_domain set_domain; + + set_domain.handle = handle; + set_domain.read_domains = read; + set_domain.write_domain = 0; + drmIoctl(fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &set_domain); +} + +static int gem_get_tiling(int fd, uint32_t handle) +{ + struct drm_i915_gem_get_tiling tiling; + + tiling.handle = handle; + tiling.tiling_mode = -1; + (void)drmIoctl(fd, DRM_IOCTL_I915_GEM_GET_TILING, &tiling); + return tiling.tiling_mode; +} + +static void gem_close(int fd, uint32_t handle) +{ + struct drm_gem_close close; + + close.handle = handle; + (void)drmIoctl(fd, DRM_IOCTL_GEM_CLOSE, &close); +} + +static void gem_fill(int fd, uint32_t handle, uint32_t pixel, uint32_t size, int domain) +{ + uint32_t *ptr, s; + + ptr = gem_mmap(fd, handle, size, PROT_READ | PROT_WRITE, domain); + if (ptr == NULL) + return; + + for (s = 0; s < size; s += 4) + ptr[s/4] = pixel; + munmap(ptr, size); +} + +static int check_pixmap(Display *dpy, Pixmap pix, + int x, int y, uint32_t expected, int bpp) +{ + XImage *image; + int w = 32 / bpp; + + image = XGetImage(dpy, pix, x - (x % w), y, w, 1, AllPlanes, ZPixmap); + if (image == NULL) + return 0; + + if (*(uint32_t *)image->data != expected) { + printf("pixmap[%d, %d]:%d = %08x\n", x, y, bpp, *(uint32_t *)image->data); + return 0; + } + XDestroyImage(image); + + return 1; +} + +static int check_pixel(int fd, uint32_t handle, uint32_t stride, uint32_t size, + int x, int y, uint32_t expected, int bpp, int domain) +{ + uint32_t *ptr; + int w = 32 / bpp; + + assert((stride & 3) == 0); + + ptr = gem_mmap(fd, handle, size, PROT_READ, domain); + if (ptr == NULL) + return 0; + + if (ptr[(y*stride + x - (x % w))/4] != expected) { + printf("pixel[%d, %d]:%d = %08x\n", x, y, bpp, ptr[(y * stride + x)/4]); + return 0; + } + munmap(ptr, size); + + return 1; +} + +static GC get_gc(Display *dpy, Drawable d, int depth) +{ + static GC gc[33]; + if (gc[depth] == NULL) { + XGCValues gcv; + + gcv.graphics_exposures = False; + gc[depth] = XCreateGC(dpy, d, GCGraphicsExposures, &gcv); + } + return gc[depth]; +} + +static int +can_use_shm(Display *dpy) +{ + int major, minor, has_pixmap; + + if (!XShmQueryExtension(dpy)) + return 0; + + XShmQueryVersion(dpy, &major, &minor, &has_pixmap); + return has_pixmap; +} + +static int gpu_fill(int device, int handle, int width, int height, int pitch, int bpp, int tiling, uint32_t pixel) +{ + struct drm_i915_gem_execbuffer2 execbuf; + struct drm_i915_gem_relocation_entry gem_reloc[2]; + struct drm_i915_gem_exec_object2 gem_exec[2]; + uint32_t batch[10]; + int gen = i915_gen(device); + int len = 0; + int ret; + + if (gen == 0) + return -ENODEV; + + batch[0] = 2 << 29 | 0x50 << 22; + batch[0] |= (gen >= 0100 ? 5 : 4); + batch[1] = pitch; + if (gen >= 040 && tiling) { + batch[0] |= 1 << 11; + batch[1] >>= 2; + } + + batch[1] |= 0xf0 << 16; + switch (bpp) { + default: assert(0); + case 32: batch[0] |= 1 << 21 | 1 << 20; + batch[1] |= 1 << 25; /* RGB8888 */ + case 16: batch[1] |= 1 << 24; /* RGB565 */ + case 8: break; + } + + batch[2] = 0; + batch[3] = height << 16 | width; + batch[4] = 0; + len = 5; + if (gen >= 0100) + batch[len++] = 0; + batch[len++] = pixel; + batch[len++] = 0xA << 23; + if (len & 1) + len++; + + gem_reloc[0].offset = 4 * sizeof(uint32_t); + gem_reloc[0].delta = 0; + gem_reloc[0].target_handle = handle; + gem_reloc[0].read_domains = I915_GEM_DOMAIN_RENDER; + gem_reloc[0].write_domain = I915_GEM_DOMAIN_RENDER; + gem_reloc[0].presumed_offset = 0; + + memset(gem_exec, 0, sizeof(gem_exec)); + gem_exec[0].handle = handle; + gem_exec[1].handle = gem_create(device, 4096); + gem_exec[1].relocation_count = 1; + gem_exec[1].relocs_ptr = (uintptr_t)gem_reloc; + + memset(&execbuf, 0, sizeof(execbuf)); + execbuf.buffers_ptr = (uintptr_t)gem_exec; + execbuf.buffer_count = 2; + execbuf.batch_len = len * sizeof(uint32_t); + execbuf.flags = gen >= 060 ? I915_EXEC_BLT : 0; + + ret = gem_write(device, gem_exec[1].handle, 0, batch, execbuf.batch_len); + if (ret == 0) + ret = drmIoctl(device, DRM_IOCTL_I915_GEM_EXECBUFFER2, &execbuf); + if (ret < 0) + ret = -errno; + + gem_close(device, gem_exec[1].handle); + return ret; +} + +static int test_shm(Display *dpy, int device, + int width, int height) +{ + const int x_loc[] = {0, width/2, width-1}; + const int y_loc[] = {0, height/2, height-1}; + uint32_t pixel = 0xffff00ff; + XShmSegmentInfo shm; + Pixmap pixmap; + uint32_t handle = 0; + uint32_t *ptr; + int stride, fd; + int x, y; + int line; + + if (!can_use_shm(dpy)) + return 0; + + printf("Creating %dx%d SHM pixmap\n", width, height); + _x_error_occurred = 0; + + shm.shmid = shmget(IPC_PRIVATE, height * 4*width, IPC_CREAT | 0666); + if (shm.shmid == -1) + return 0; + + shm.shmaddr = shmat(shm.shmid, 0, 0); + if (shm.shmaddr == (char *) -1) { + shmctl(shm.shmid, IPC_RMID, NULL); + return 0; + } + + shm.readOnly = False; + XShmAttach(dpy, &shm); + + pixmap = XShmCreatePixmap(dpy, DefaultRootWindow(dpy), + shm.shmaddr, &shm, width, height, 24); + XSync(dpy, False); + shmctl(shm.shmid, IPC_RMID, NULL); + + if (_x_error_occurred) { + XShmDetach(dpy, &shm); + shmdt(shm.shmaddr); + return 0; + } + + printf("Testing write of %dx%d SHM pixmap via DRI3 fd\n", width, height); + + fd = dri3_create_fd(dpy, pixmap, &stride); + if (fd < 0) { + line = __LINE__; + goto fail; + } + + handle = gem_import(device, fd); + close(fd); + if (handle == 0) { + line = __LINE__; + goto fail; + } + + if (gpu_fill(device, handle, width, height, stride, 32, I915_TILING_NONE, pixel)) { + line = __LINE__; + goto fail; + } + + gem_sync(device, handle, CPU); + ptr = (uint32_t *)shm.shmaddr; + for (x = 0; x < sizeof(x_loc)/sizeof(x_loc[0]); x++) + for (y = 0; y < sizeof(y_loc)/sizeof(y_loc[0]); y++) + if (ptr[y_loc[y]*width + x_loc[x]] != pixel) { + printf("pixel[%d, %d]:%d = %08x\n", x, y, 32, ptr[y_loc[y] * width + x_loc[x]]); + line = __LINE__; + goto fail; + } + + for (x = 0; x < sizeof(x_loc)/sizeof(x_loc[0]); x++) + for (y = 0; y < sizeof(y_loc)/sizeof(y_loc[0]); y++) + if (!check_pixmap(dpy, pixmap, + x_loc[x], y_loc[y], + pixel, 32)) { + line = __LINE__; + goto fail; + } + + if (_x_error_occurred) { + line = __LINE__; + goto fail; + } + +out: + gem_close(device, handle); + XFreePixmap(dpy, pixmap); + XShmDetach(dpy, &shm); + shmdt(shm.shmaddr); + return fd != -1; + +fail: + printf("%s failed at (%dx%d), line %d\n", + __func__, width, height, line); + fd = -1; + goto out; +} + +static int test_read_after_write(Display *dpy, int device, + int width, int height, int depth, + int domain) +{ + const uint32_t pixel = 0xffff00ff; + const int x_loc[] = {0, width/2, width-1}; + const int y_loc[] = {0, height/2, height-1}; + Window root = RootWindow(dpy, DefaultScreen(dpy)); + uint32_t src, dst; + int src_fd, dst_fd; + int src_stride, src_size; + int dst_stride, dst_size; + Pixmap src_pix, dst_pix; + struct dri3_fence fence; + int x, y, bpp; + + _x_error_occurred = 0; + + switch (depth) { + case 8: bpp = 8; break; + case 16: bpp = 16; break; + case 24: bpp = 32; break; + case 32: bpp = 32; break; + default: return 0; + } + + src_stride = width * bpp/8; + src_size = PAGE_ALIGN(src_stride * height); + printf("Creating %dx%d (source stride=%d, size=%d, domain=%d)\n", + width, height, src_stride, src_size, domain); + + src = gem_create(device, src_size); + if (!src) + goto fail; + + if (domain == CPU) + gem_set_caching(device, src, 1); + + gem_fill(device, src, pixel, src_size, domain); + + src_fd = gem_export(device, src); + if (src_fd < 0) + goto fail; + + src_pix = dri3_create_pixmap(dpy, root, + width, height, depth, + src_fd, bpp, src_stride, src_size); + + for (x = 0; x < sizeof(x_loc)/sizeof(x_loc[0]); x++) + for (y = 0; y < sizeof(y_loc)/sizeof(y_loc[0]); y++) + if (!check_pixmap(dpy, src_pix, + x_loc[x], y_loc[y], + pixel, bpp)) + goto fail; + close(src_fd); + + dst_pix = XCreatePixmap(dpy, root, width, height, depth); + if (dri3_create_fence(dpy, dst_pix, &fence)) + goto fail; + + dst_fd = dri3_create_fd(dpy, dst_pix, &dst_stride); + if (dst_fd < 0) + goto fail; + dst_size = lseek(dst_fd, 0, SEEK_END); + printf("Comparing %dx%d (destination stride=%d, size=%d)\n", + width, height, dst_stride, dst_size); + dst = gem_import(device, dst_fd); + if (dst == 0) + goto fail; + close(dst_fd); + + XCopyArea(dpy, src_pix, dst_pix, + get_gc(dpy, dst_pix, depth), + 0, 0, width, height, 0, 0); + dri3_fence_sync(dpy, &fence); + dri3_fence_free(dpy, &fence); + + for (x = 0; x < sizeof(x_loc)/sizeof(x_loc[0]); x++) + for (y = 0; y < sizeof(y_loc)/sizeof(y_loc[0]); y++) + if (!check_pixel(device, dst, dst_stride, dst_size, + x_loc[x], y_loc[y], + pixel, bpp, GTT)) + goto fail; + + XFreePixmap(dpy, dst_pix); + XFreePixmap(dpy, src_pix); + + gem_close(device, src); + gem_close(device, dst); + + if (_x_error_occurred) + goto fail; + + return 0; + +fail: + printf("%s failed at (%dx%d), depth=%d, domain=%d\n", + __func__, width, height, depth, domain); + return 1; +} + +static XRenderPictFormat *format_for_depth(Display *dpy, int depth) +{ + switch (depth) { + case 8: return XRenderFindStandardFormat(dpy, PictStandardA8); + case 24: return XRenderFindStandardFormat(dpy, PictStandardRGB24); + case 32: return XRenderFindStandardFormat(dpy, PictStandardARGB32); + default: assert(0); return NULL; + } +} + +static int test_read(Display *dpy, int device, + int width, int height, + int domain) +{ + const uint32_t pixel = 0xffff00ff; + const XRenderColor color = { 0xffff, 0x0000, 0xffff, 0xffff }; + const int x_loc[] = {0, width/2, width-1}; + const int y_loc[] = {0, height/2, height-1}; + Window root = RootWindow(dpy, DefaultScreen(dpy)); + uint32_t dst; + int dst_stride, dst_size, dst_fd; + Pixmap src_pix, dst_pix; + Picture src_pic; + struct dri3_fence fence; + int depth = 32, bpp = 32; + int x, y; + + _x_error_occurred = 0; + + dst_stride = width * bpp/8; + dst_size = PAGE_ALIGN(dst_stride * height); + printf("Creating %dx%d (destination stride=%d, size=%d, domain=%d)\n", + width, height, dst_stride, dst_size, domain); + + dst = gem_create(device, dst_size); + if (!dst) + goto fail; + + if (domain == CPU) + gem_set_caching(device, dst, 1); + + gem_fill(device, dst, ~pixel, dst_size, domain); + + dst_fd = gem_export(device, dst); + if (dst_fd < 0) + goto fail; + + dst_pix = dri3_create_pixmap(dpy, root, + width, height, depth, + dst_fd, bpp, dst_stride, dst_size); + XSync(dpy, True); + if (_x_error_occurred) + goto fail; + if (dri3_create_fence(dpy, dst_pix, &fence)) + goto fail; + + src_pix = XCreatePixmap(dpy, root, width, height, depth); + src_pic = XRenderCreatePicture(dpy, src_pix, format_for_depth(dpy, depth), 0, NULL); + XRenderFillRectangle(dpy, PictOpSrc, src_pic, &color, 0, 0, width, height); + XCopyArea(dpy, src_pix, dst_pix, + get_gc(dpy, dst_pix, depth), + 0, 0, width, height, 0, 0); + dri3_fence_sync(dpy, &fence); + dri3_fence_free(dpy, &fence); + + for (x = 0; x < sizeof(x_loc)/sizeof(x_loc[0]); x++) + for (y = 0; y < sizeof(y_loc)/sizeof(y_loc[0]); y++) + if (!check_pixel(device, dst, dst_stride, dst_size, + x_loc[x], y_loc[y], + pixel, bpp, domain)) + goto fail; + + XFreePixmap(dpy, dst_pix); + XRenderFreePicture(dpy, src_pic); + XFreePixmap(dpy, src_pix); + + gem_close(device, dst); + + if (_x_error_occurred) + goto fail; + + return 0; + +fail: + printf("%s failed at (%dx%d), depth=%d, domain=%d\n", + __func__, width, height, depth, domain); + return 1; +} + +static int test_dup_pixmap(Display *dpy, int device) +{ + const uint32_t pixel = 0xffff00ff; + const XRenderColor color = { 0xffff, 0x0000, 0xffff, 0xffff }; + const XRenderColor inverse = { 0, 0xffff, 0, 0 }; + int width = 400, height = 400; + const int x_loc[] = {0, width/2, width-1}; + const int y_loc[] = {0, height/2, height-1}; + Window root = RootWindow(dpy, DefaultScreen(dpy)); + uint32_t handle; + int stride, size, fd; + Pixmap src_pix, dst_pix; + Picture src_pic, dst_pic; + struct dri3_fence fence; + int depth = 32, bpp = 32; + int x, y; + + _x_error_occurred = 0; + + printf("%s: Creating %dx%d pixmap\n", __func__, width, height); + src_pix = XCreatePixmap(dpy, root, width, height, depth); + src_pic = XRenderCreatePicture(dpy, src_pix, format_for_depth(dpy, depth), 0, NULL); + fd = dri3_create_fd(dpy, src_pix, &stride); + if (fd < 0) + goto fail; + + size = lseek(fd, 0, SEEK_END); + handle = gem_import(device, fd); + + printf("%s: Creating duplicate from pixmap exported fd\n", __func__); + dst_pix = dri3_create_pixmap(dpy, root, + width, height, depth, + fd, bpp, stride, size); + dst_pic = XRenderCreatePicture(dpy, dst_pix, format_for_depth(dpy, depth), 0, NULL); + XSync(dpy, True); + if (_x_error_occurred) + goto fail; + + printf("%s: Filling src with %08x, reading dst\n", __func__, pixel); + XRenderFillRectangle(dpy, PictOpSrc, src_pic, &color, 0, 0, width, height); + for (x = 0; x < sizeof(x_loc)/sizeof(x_loc[0]); x++) + for (y = 0; y < sizeof(y_loc)/sizeof(y_loc[0]); y++) + if (!check_pixmap(dpy, dst_pix, + x_loc[x], y_loc[y], + pixel, 32)) + goto fail; + + printf("%s: Filling dst with %08x, reading src\n", __func__, ~pixel); + XRenderFillRectangle(dpy, PictOpSrc, dst_pic, &inverse, 0, 0, width, height); + for (x = 0; x < sizeof(x_loc)/sizeof(x_loc[0]); x++) + for (y = 0; y < sizeof(y_loc)/sizeof(y_loc[0]); y++) + if (!check_pixmap(dpy, dst_pix, + x_loc[x], y_loc[y], + ~pixel, 32)) + goto fail; + + if (dri3_create_fence(dpy, src_pix, &fence)) + goto fail; + + printf("%s: Filling src with %08x, reading fd\n", __func__, pixel); + XRenderFillRectangle(dpy, PictOpSrc, src_pic, &color, 0, 0, width, height); + dri3_fence_sync(dpy, &fence); + dri3_fence_free(dpy, &fence); + for (x = 0; x < sizeof(x_loc)/sizeof(x_loc[0]); x++) + for (y = 0; y < sizeof(y_loc)/sizeof(y_loc[0]); y++) + if (!check_pixel(device, handle, stride, size, + x_loc[x], y_loc[y], + pixel, bpp, GTT)) + goto fail; + + printf("%s: Filling fd with %08x, reading src\n", __func__, ~pixel); + if (gpu_fill(device, handle, width, height, stride, 32, gem_get_tiling(device, handle), ~pixel)) + goto fail; + for (x = 0; x < sizeof(x_loc)/sizeof(x_loc[0]); x++) + for (y = 0; y < sizeof(y_loc)/sizeof(y_loc[0]); y++) + if (!check_pixmap(dpy, src_pix, + x_loc[x], y_loc[y], + ~pixel, 32)) + goto fail; + + if (dri3_create_fence(dpy, dst_pix, &fence)) + goto fail; + + printf("%s: Filling dst with %08x, reading fd\n", __func__, pixel); + XRenderFillRectangle(dpy, PictOpSrc, dst_pic, &color, 0, 0, width, height); + dri3_fence_sync(dpy, &fence); + dri3_fence_free(dpy, &fence); + for (x = 0; x < sizeof(x_loc)/sizeof(x_loc[0]); x++) + for (y = 0; y < sizeof(y_loc)/sizeof(y_loc[0]); y++) + if (!check_pixel(device, handle, stride, size, + x_loc[x], y_loc[y], + pixel, bpp, GTT)) + goto fail; + + printf("%s: Filling fd with %08x, reading dst\n", __func__, ~pixel); + if (gpu_fill(device, handle, width, height, stride, 32, gem_get_tiling(device, handle), ~pixel)) + goto fail; + for (x = 0; x < sizeof(x_loc)/sizeof(x_loc[0]); x++) + for (y = 0; y < sizeof(y_loc)/sizeof(y_loc[0]); y++) + if (!check_pixmap(dpy, dst_pix, + x_loc[x], y_loc[y], + ~pixel, 32)) + goto fail; + + XRenderFreePicture(dpy, src_pic); + XFreePixmap(dpy, src_pix); + + if (dri3_create_fence(dpy, dst_pix, &fence)) + goto fail; + + printf("%s: Closed original src, filling dst with %08x, reading fd\n", __func__, pixel); + XRenderFillRectangle(dpy, PictOpSrc, dst_pic, &color, 0, 0, width, height); + dri3_fence_sync(dpy, &fence); + dri3_fence_free(dpy, &fence); + for (x = 0; x < sizeof(x_loc)/sizeof(x_loc[0]); x++) + for (y = 0; y < sizeof(y_loc)/sizeof(y_loc[0]); y++) + if (!check_pixel(device, handle, stride, size, + x_loc[x], y_loc[y], + pixel, bpp, GTT)) + goto fail; + + XRenderFreePicture(dpy, dst_pic); + XFreePixmap(dpy, dst_pix); + + gem_close(device, handle); + + if (_x_error_occurred) + goto fail; + + return 0; + +fail: + printf("%s failed at (%dx%d), depth=%d\n", + __func__, width, height, depth); + return 1; +} + +static int test_bad_size(Display *dpy, int device) +{ + Window root = RootWindow(dpy, DefaultScreen(dpy)); + uint32_t src; + int src_fd; + Pixmap src_pix; + int line = -1; + + _x_error_occurred = 0; + + src = gem_create(device, 4096); + if (!src) + goto fail; + + src_fd = gem_export(device, src); + if (src_fd < 0) + goto fail; + + src_pix = dri3_create_pixmap(dpy, root, + 16, 16, 32, + dup(src_fd), 32, 16*4, 4096); + line = __LINE__; + XSync(dpy, True); + if (_x_error_occurred) + goto fail; + XFreePixmap(dpy, src_pix); + _x_error_occurred = 0; + + src_pix = dri3_create_pixmap(dpy, root, + 32, 32, 32, + dup(src_fd), 32, 32*4, 4096); + line = __LINE__; + XSync(dpy, True); + if (_x_error_occurred) + goto fail; + XFreePixmap(dpy, src_pix); + _x_error_occurred = 0; + + src_pix = dri3_create_pixmap(dpy, root, + 64, 64, 32, + dup(src_fd), 32, 64*4, 4096); + line = __LINE__; + XSync(dpy, True); + if (!_x_error_occurred) + goto fail; + _x_error_occurred = 0; + + src_pix = dri3_create_pixmap(dpy, root, + 64, 64, 32, + dup(src_fd), 32, 64*4, 64*64*4); + line = __LINE__; + XSync(dpy, True); + if (!_x_error_occurred) + goto fail; + _x_error_occurred = 0; + + src_pix = dri3_create_pixmap(dpy, root, + INT16_MAX, INT16_MAX, 8, + dup(src_fd), 8, INT16_MAX, UINT32_MAX); + line = __LINE__; + XSync(dpy, True); + if (!_x_error_occurred) + goto fail; + _x_error_occurred = 0; + + close(src_fd); + gem_close(device, src); + + return 0; + +fail: + printf("%s failed at line %d\n", __func__, line); + return 1; +} + +static int test_bad_pitch(Display *dpy, int device) +{ + Window root = RootWindow(dpy, DefaultScreen(dpy)); + uint32_t src; + int src_fd; + Pixmap src_pix; + int line = -1; + + _x_error_occurred = 0; + + src = gem_create(device, 4096); + if (!src) + goto fail; + + src_fd = gem_export(device, src); + if (src_fd < 0) + goto fail; + + src_pix = dri3_create_pixmap(dpy, root, + 16, 16, 32, + dup(src_fd), 32, 16*4, 4096); + line = __LINE__; + XSync(dpy, True); + if (_x_error_occurred) + goto fail; + XFreePixmap(dpy, src_pix); + _x_error_occurred = 0; + + src_pix = dri3_create_pixmap(dpy, root, + 256, 2, 32, + dup(src_fd), 32, 256*4, 4096); + line = __LINE__; + XSync(dpy, True); + if (_x_error_occurred) + goto fail; + XFreePixmap(dpy, src_pix); + _x_error_occurred = 0; + + src_pix = dri3_create_pixmap(dpy, root, + 256, 2, 32, + dup(src_fd), 32, 256, 4096); + line = __LINE__; + XSync(dpy, True); + if (!_x_error_occurred) + goto fail; + _x_error_occurred = 0; + + src_pix = dri3_create_pixmap(dpy, root, + 256, 2, 32, + dup(src_fd), 32, 16384, 4096); + line = __LINE__; + XSync(dpy, True); + if (!_x_error_occurred) + goto fail; + _x_error_occurred = 0; + + src_pix = dri3_create_pixmap(dpy, root, + 256, 2, 32, + dup(src_fd), 32, 1023, 4096); + line = __LINE__; + XSync(dpy, True); + if (!_x_error_occurred) + goto fail; + _x_error_occurred = 0; + + src_pix = dri3_create_pixmap(dpy, root, + 256, 2, 32, + dup(src_fd), 32, 1025, 4096); + line = __LINE__; + XSync(dpy, True); + if (!_x_error_occurred) + goto fail; + _x_error_occurred = 0; + + close(src_fd); + gem_close(device, src); + + return 0; + +fail: + printf("%s failed at line %d\n", __func__, line); + return 1; +} + +static int +_check_error_handler(Display *display, + XErrorEvent *event) +{ + printf("X11 error from display %s, serial=%ld, error=%d, req=%d.%d\n", + DisplayString(display), + event->serial, + event->error_code, + event->request_code, + event->minor_code); + _x_error_occurred++; + return False; /* ignored */ +} + +int main(void) +{ + Display *dpy; + int device; + int error = 0; + + dpy = XOpenDisplay(NULL); + if (dpy == NULL) + return 77; + + if (DefaultDepth(dpy, DefaultScreen(dpy)) != 24) + return 77; + + XSetErrorHandler(_check_error_handler); + + device = dri3_open(dpy); + if (device < 0) + return 127; + + if (!is_intel(device)) + return 77; + + printf("Opened Intel DRI3 device\n"); + + error += test_bad_size(dpy, device); + error += test_bad_pitch(dpy, device); + + error += test_shm(dpy, device, 400, 300); + error += test_shm(dpy, device, 300, 400); + + error += test_read(dpy, device, 400, 200, GTT); + error += test_read(dpy, device, 4000, 20, GTT); + error += test_read(dpy, device, 16000, 10, GTT); + error += test_read(dpy, device, 30000, 10, GTT); + + error += test_read(dpy, device, 200, 400, GTT); + error += test_read(dpy, device, 20, 4000, GTT); + error += test_read(dpy, device, 16, 16000, GTT); + error += test_read(dpy, device, 16, 30000, GTT); + + error += test_read(dpy, device, 400, 200, CPU); + error += test_read(dpy, device, 4000, 20, CPU); + error += test_read(dpy, device, 16000, 10, CPU); + error += test_read(dpy, device, 30000, 10, CPU); + + error += test_read(dpy, device, 200, 400, CPU); + error += test_read(dpy, device, 20, 4000, CPU); + error += test_read(dpy, device, 16, 16000, CPU); + error += test_read(dpy, device, 16, 30000, CPU); + + error += test_read_after_write(dpy, device, 400, 200, 24, GTT); + error += test_read_after_write(dpy, device, 4000, 20, 24, GTT); + error += test_read_after_write(dpy, device, 16000, 10, 24, GTT); + error += test_read_after_write(dpy, device, 30000, 10, 24, GTT); + error += test_read_after_write(dpy, device, 30000, 10, 8, GTT); + + error += test_read_after_write(dpy, device, 200, 400, 24, GTT); + error += test_read_after_write(dpy, device, 20, 4000, 24, GTT); + error += test_read_after_write(dpy, device, 16, 16000, 24, GTT); + error += test_read_after_write(dpy, device, 16, 30000, 24, GTT); + + error += test_read_after_write(dpy, device, 400, 200, 24, CPU); + error += test_read_after_write(dpy, device, 4000, 20, 24, CPU); + error += test_read_after_write(dpy, device, 16000, 10, 24, CPU); + error += test_read_after_write(dpy, device, 30000, 10, 24, CPU); + error += test_read_after_write(dpy, device, 30000, 10, 8, CPU); + + error += test_read_after_write(dpy, device, 200, 400, 24, CPU); + error += test_read_after_write(dpy, device, 20, 4000, 24, CPU); + error += test_read_after_write(dpy, device, 16, 16000, 24, CPU); + error += test_read_after_write(dpy, device, 16, 30000, 24, CPU); + + error += test_dup_pixmap(dpy, device); + + return !!error; +} diff -Nru xserver-xorg-video-intel-2.99.910/test/lowlevel-blt-bench.c xserver-xorg-video-intel-2.99.914/test/lowlevel-blt-bench.c --- xserver-xorg-video-intel-2.99.910/test/lowlevel-blt-bench.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/lowlevel-blt-bench.c 2014-07-06 06:38:39.000000000 +0000 @@ -23,6 +23,10 @@ * DEALINGS IN THE SOFTWARE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -31,7 +35,19 @@ #include #include /* for XDestroyImage */ +#include +#include +#include +#if HAVE_X11_EXTENSIONS_SHMPROTO_H +#include +#elif HAVE_X11_EXTENSIONS_SHMSTR_H +#include +#else +#error Failed to find the right header for X11 MIT-SHM protocol definitions +#endif #include /* for pixman blt functions */ +#include +#include #include "test.h" @@ -47,32 +63,259 @@ }; static const struct op { + int value; const char *name; } ops[] = { - [PictOpClear] = { "Clear" }, - [PictOpSrc] = { "Src" }, - [PictOpDst] = { "Dst" }, - [PictOpOver] = { "Over" }, - [PictOpOverReverse] = { "OverReverse" }, - [PictOpIn] = { "In" }, - [PictOpInReverse] = { "InReverse" }, - [PictOpOut] = { "Out" }, - [PictOpOutReverse] = { "OutReverse" }, - [PictOpAtop] = { "Atop" }, - [PictOpAtopReverse] = { "AtopReverse" }, - [PictOpXor] = { "Xor" }, - [PictOpAdd] = { "Add" }, - [PictOpSaturate] = { "Saturate" }, + { PictOpClear, "Clear" }, + { PictOpSrc, "Src" }, + { PictOpDst, "Dst" }, + { PictOpOver, "Over" }, + { PictOpOverReverse, "OverReverse" }, + { PictOpIn, "In" }, + { PictOpInReverse, "InReverse" }, + { PictOpOut, "Out" }, + { PictOpOutReverse, "OutReverse" }, + { PictOpAtop, "Atop" }, + { PictOpAtopReverse, "AtopReverse" }, + { PictOpXor, "Xor" }, + { PictOpAdd, "Add" }, + { PictOpSaturate, "Saturate" }, + { PictOpMultiply, "Multiply" }, + { PictOpScreen, "Screen" }, + { PictOpOverlay, "Overlay" }, + { PictOpDarken, "Darken" }, + { PictOpLighten, "Lighten" }, + { PictOpColorDodge, "Dodge" }, + { PictOpColorBurn, "Burn" }, + { PictOpHardLight, "HardLight" }, + { PictOpSoftLight, "SoftLight" }, }; -static double _bench(struct test_display *t, enum target target_type, - int op, int src_format, - int loops) +static Picture source_pixmap(struct test_display *t, struct test_target *target, int format) +{ + XRenderColor render_color[2] = { + { 0x8000, 0x8000, 0x8000, 0x8000 }, + { 0xffff, 0xffff, 0xffff, 0xffff }, + }; + Pixmap pixmap; + Picture picture; + + pixmap = XCreatePixmap(t->dpy, t->root, + target->width, target->height, + PIXMAN_FORMAT_DEPTH(formats[format].pixman_format)); + + picture = XRenderCreatePicture(t->dpy, pixmap, + XRenderFindStandardFormat(t->dpy, format), + 0, NULL); + XFreePixmap(t->dpy, pixmap); + + XRenderFillRectangle(t->dpy, PictOpSrc, picture, &render_color[0], + 0, 0, target->width, target->height/2); + XRenderFillRectangle(t->dpy, PictOpSrc, picture, &render_color[1], + 0, target->height/2, target->width, target->height/2); + + return picture; +} + +static Picture source_a8r8g8b8(struct test_display *t, struct test_target *target) +{ + return source_pixmap(t, target, 0); +} + +static Picture source_x8r8g8b8(struct test_display *t, struct test_target *target) +{ + return source_pixmap(t, target, 1); +} + +static Picture source_a8(struct test_display *t, struct test_target *target) +{ + return source_pixmap(t, target, 2); +} + +static Picture source_a4(struct test_display *t, struct test_target *target) +{ + return source_pixmap(t, target, 3); +} + +static Picture source_a1(struct test_display *t, struct test_target *target) +{ + return source_pixmap(t, target, 3); +} + +static Picture source_1x1r(struct test_display *t, struct test_target *target) { XRenderColor render_color = { 0x8000, 0x8000, 0x8000, 0x8000 }; - struct test_target target; + XRenderPictureAttributes pa; Pixmap pixmap; Picture picture; + + pa.repeat = RepeatNormal; + + pixmap = XCreatePixmap(t->dpy, t->root, 1, 1, 32); + picture = XRenderCreatePicture(t->dpy, pixmap, + XRenderFindStandardFormat(t->dpy, 0), + CPRepeat, &pa); + XFreePixmap(t->dpy, pixmap); + + XRenderFillRectangle(t->dpy, PictOpSrc, picture, &render_color, + 0, 0, 1, 1); + + return picture; +} + +static Picture source_solid(struct test_display *t, struct test_target *target) +{ + XRenderColor render_color = { 0x8000, 0x8000, 0x8000, 0x8000 }; + return XRenderCreateSolidFill(t->dpy, &render_color); +} + +static Picture source_linear_horizontal(struct test_display *t, struct test_target *target) +{ + XRenderColor colors[2] = {{0}, {0xffff, 0xffff, 0xffff, 0xffff}}; + XFixed stops[2] = {0, 0xffff}; + XLinearGradient gradient = { {0, 0}, {target->width << 16, 0}}; + + return XRenderCreateLinearGradient(t->dpy, &gradient, stops, colors, 2); +} + +static Picture source_linear_vertical(struct test_display *t, struct test_target *target) +{ + XRenderColor colors[2] = {{0}, {0xffff, 0xffff, 0xffff, 0xffff}}; + XFixed stops[2] = {0, 0xffff}; + XLinearGradient gradient = { {0, 0}, {0, target->height << 16}}; + + return XRenderCreateLinearGradient(t->dpy, &gradient, stops, colors, 2); +} + +static Picture source_linear_diagonal(struct test_display *t, struct test_target *target) +{ + XRenderColor colors[2] = {{0}, {0xffff, 0xffff, 0xffff, 0xffff}}; + XFixed stops[2] = {0, 0xffff}; + XLinearGradient gradient = { {0, 0}, {target->width << 16, target->height << 16}}; + + return XRenderCreateLinearGradient(t->dpy, &gradient, stops, colors, 2); +} + +static Picture source_radial_concentric(struct test_display *t, struct test_target *target) +{ + XRenderColor colors[2] = {{0}, {0xffff, 0xffff, 0xffff, 0xffff}}; + XFixed stops[2] = {0, 0xffff}; + XRadialGradient gradient = { + { + ((target->width << 16) + 1) / 2, + ((target->height << 16) + 1) / 2, + 0, + }, + { + ((target->width << 16) + 1) / 2, + ((target->height << 16) + 1) / 2, + target->width << 15, + } + }; + + return XRenderCreateRadialGradient(t->dpy, &gradient, stops, colors, 2); +} + +static Picture source_radial_generic(struct test_display *t, struct test_target *target) +{ + XRenderColor colors[2] = {{0}, {0xffff, 0xffff, 0xffff, 0xffff}}; + XFixed stops[2] = {0, 0xffff}; + XRadialGradient gradient = { + { 0, 0, target->width << 14, }, + { target->width << 16, target->height << 16, target->width << 14, } + }; + + return XRenderCreateRadialGradient(t->dpy, &gradient, stops, colors, 2); +} + +static XShmSegmentInfo shmref, shmout; + +static void setup_shm(struct test *t) +{ + XShmSegmentInfo shm; + int size; + + shm.shmid = -1; + + if (!(t->ref.has_shm_pixmaps && t->out.has_shm_pixmaps)) + return; + + size = t->ref.width * t->ref.height * 4; + size = (size + 4095) & -4096; + + shm.shmid = shmget(IPC_PRIVATE, size, IPC_CREAT | 0666); + if (shm.shmid == -1) + return; + + shm.shmaddr = shmat(shm.shmid, 0, 0); + if (shm.shmaddr == (char *) -1) { + shmctl(shm.shmid, IPC_RMID, NULL); + shm.shmid = -1; + return; + } + + shm.readOnly = False; + + shmref = shm; + XShmAttach(t->ref.dpy, &shmref); + XSync(t->ref.dpy, True); + + shmout = shm; + XShmAttach(t->out.dpy, &shmout); + XSync(t->out.dpy, True); +} + +static Picture source_shm(struct test_display *t, struct test_target *target) +{ + XShmSegmentInfo *shm = t->target == REF ? &shmref : &shmout; + Pixmap pixmap; + Picture picture; + int size; + + if (shm->shmid == -1) + return 0; + + pixmap = XShmCreatePixmap(t->dpy, t->root, + shm->shmaddr, shm, + target->width, target->height, 32); + + picture = XRenderCreatePicture(t->dpy, pixmap, + XRenderFindStandardFormat(t->dpy, 0), + 0, NULL); + XFreePixmap(t->dpy, pixmap); + + size = target->width * target->height * 4; + memset(shm->shmaddr, 0x80, size/2); + memset(shm->shmaddr+size/2, 0xff, size/2); + + return picture; +} + +static const struct { + Picture (*create)(struct test_display *, struct test_target *); + const char *name; +} source[] = { + { source_a8r8g8b8, "a8r8g8b8 pixmap" }, + { source_x8r8g8b8, "x8r8g8b8 pixmap" }, + { source_a8, "a8 pixmap" }, + { source_a4, "a4 pixmap" }, + { source_a1, "a1 pixmap" }, + { source_1x1r, "a8r8g8b8 1x1R pixmap" }, + { source_solid, "solid" }, + { source_shm, "a8r8g8b8 shm" }, + { source_linear_horizontal, "linear (horizontal gradient)" }, + { source_linear_vertical, "linear (vertical gradient)" }, + { source_linear_diagonal, "linear (diagonal gradient)" }, + { source_radial_concentric, "radial (concentric)" }, + { source_radial_generic, "radial (generic)" }, +}; + +static double _bench_source(struct test_display *t, enum target target_type, + int op, int src, int loops) +{ + XRenderColor render_color = { 0x8000, 0x8000, 0x8000, 0x8000 }; + struct test_target target; + Picture picture; struct timespec tv; double elapsed; @@ -80,54 +323,134 @@ XRenderFillRectangle(t->dpy, PictOpClear, target.picture, &render_color, 0, 0, target.width, target.height); - pixmap = XCreatePixmap(t->dpy, t->root, - target.width, target.height, - PIXMAN_FORMAT_DEPTH(formats[src_format].pixman_format)); + picture = source[src].create(t, &target); + if (picture) { + test_timer_start(t, &tv); + while (loops--) + XRenderComposite(t->dpy, op, + picture, 0, target.picture, + 0, 0, + 0, 0, + 0, 0, + target.width, target.height); + elapsed = test_timer_stop(t, &tv); + XRenderFreePicture(t->dpy, picture); + } else + elapsed = -1; - picture = XRenderCreatePicture(t->dpy, pixmap, - XRenderFindStandardFormat(t->dpy, src_format), - 0, NULL); - XRenderFillRectangle(t->dpy, PictOpSrc, picture, &render_color, + test_target_destroy_render(t, &target); + + return elapsed; +} + +static void bench_source(struct test *t, enum target target, int op, int src) +{ + double out, ref; + + fprintf(stdout, "%28s with %s: ", source[src].name, ops[op].name); + fflush(stdout); + + op = ops[op].value; + + ref = _bench_source(&t->ref, target, op, src, 1000); + if (ref < 0) { + fprintf(stdout, "SKIP\n"); + return; + } + fprintf(stdout, "ref=%f, ", ref); + fflush(stdout); + + out = _bench_source(&t->out, target, op, src, 1000); + if (out < 0) { + fprintf(stdout, "SKIP\n"); + return; + } + + fprintf(stdout, "out=%f\n", out); +} + +static double _bench_mask(struct test_display *t, enum target target_type, + int op, int src, int mask, int loops) +{ + XRenderColor render_color = { 0x8000, 0x8000, 0x8000, 0x8000 }; + struct test_target target; + Picture ps, pm; + struct timespec tv; + double elapsed; + + test_target_create_render(t, target_type, &target); + XRenderFillRectangle(t->dpy, PictOpClear, target.picture, &render_color, 0, 0, target.width, target.height); - test_timer_start(t, &tv); - while (loops--) - XRenderComposite(t->dpy, op, - picture, 0, target.picture, - 0, 0, - 0, 0, - 0, 0, - target.width, target.height); - elapsed = test_timer_stop(t, &tv); + ps = source[src].create(t, &target); + pm = source[mask].create(t, &target); + if (ps && pm) { + test_timer_start(t, &tv); + while (loops--) + XRenderComposite(t->dpy, op, + ps, pm, target.picture, + 0, 0, + 0, 0, + 0, 0, + target.width, target.height); + elapsed = test_timer_stop(t, &tv); + } else + elapsed = -1; + + if (ps) + XRenderFreePicture(t->dpy, ps); + if (pm) + XRenderFreePicture(t->dpy, pm); - XRenderFreePicture(t->dpy, picture); - XFreePixmap(t->dpy, pixmap); test_target_destroy_render(t, &target); return elapsed; } -static void bench(struct test *t, enum target target, int op, int sf) +static void bench_mask(struct test *t, enum target target, int op, int src, int mask) { - double real, ref; + double out, ref; + + fprintf(stdout, "%28s In %28s with %s: ", + source[src].name, source[mask].name, ops[op].name); + fflush(stdout); + + op = ops[op].value; + + ref = _bench_mask(&t->ref, target, op, src, mask, 1000); + if (ref < 0) { + fprintf(stdout, "SKIP\n"); + return; + } + fprintf(stdout, "ref=%f, ", ref); + fflush(stdout); - ref = _bench(&t->ref, target, op, sf, 1000); - real = _bench(&t->real, target, op, sf, 1000); + out = _bench_mask(&t->out, target, op, src, mask, 1000); + if (out < 0) { + fprintf(stdout, "SKIP\n"); + return; + } - fprintf (stdout, "Testing %s with %s: ref=%f, real=%f\n", - formats[sf].name, ops[op].name, ref, real); + fprintf(stdout, "out=%f\n", out); } int main(int argc, char **argv) { struct test test; - unsigned op, sf; + unsigned op, src, mask; test_init(&test, argc, argv); + setup_shm(&test); + for (op = 0; op < sizeof(ops)/sizeof(ops[0]); op++) { - for (sf = 0; sf < sizeof(formats)/sizeof(formats[0]); sf++) - bench(&test, ROOT, op, sf); + for (src = 0; src < sizeof(source)/sizeof(source[0]); src++) + bench_source(&test, ROOT, op, src); + fprintf (stdout, "\n"); + + for (src = 0; src < sizeof(source)/sizeof(source[0]); src++) + for (mask = 0; mask < sizeof(source)/sizeof(source[0]); mask++) + bench_mask(&test, ROOT, op, src, mask); fprintf (stdout, "\n"); } diff -Nru xserver-xorg-video-intel-2.99.910/test/Makefile.am xserver-xorg-video-intel-2.99.914/test/Makefile.am --- xserver-xorg-video-intel-2.99.910/test/Makefile.am 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/Makefile.am 2014-06-16 06:40:08.000000000 +0000 @@ -20,6 +20,7 @@ render-copyarea-size \ render-copy-alphaless \ mixed-stress \ + shm-test \ $(NULL) if DRI2 @@ -30,6 +31,12 @@ $(NULL) endif +if X11_DRI3 +stress_TESTS += \ + dri3-test \ + present-test \ + $(NULL) +endif check_PROGRAMS = $(stress_TESTS) noinst_PROGRAMS = lowlevel-blt-bench @@ -53,6 +60,15 @@ $(NULL) endif +if X11_DRI3 +libtest_la_SOURCES += \ + dri3.c \ + dri3.h \ + $(NULL) +AM_CFLAGS += $(X11_DRI3_CFLAGS) +LDADD += $(X11_DRI3_LIBS) +endif + vsync.avi: mkvsync.sh ./mkvsync.sh $@ diff -Nru xserver-xorg-video-intel-2.99.910/test/Makefile.in xserver-xorg-video-intel-2.99.914/test/Makefile.in --- xserver-xorg-video-intel-2.99.910/test/Makefile.in 2014-02-10 09:34:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/Makefile.in 2014-07-23 15:44:38.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -17,6 +16,51 @@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -41,15 +85,28 @@ @DRI2_TRUE@ dri2-test \ @DRI2_TRUE@ $(NULL) -check_PROGRAMS = $(am__EXEEXT_2) +@X11_DRI3_TRUE@am__append_2 = \ +@X11_DRI3_TRUE@ dri3-test \ +@X11_DRI3_TRUE@ present-test \ +@X11_DRI3_TRUE@ $(NULL) + +check_PROGRAMS = $(am__EXEEXT_3) noinst_PROGRAMS = lowlevel-blt-bench$(EXEEXT) -@DRI2_TRUE@am__append_2 = \ +@DRI2_TRUE@am__append_3 = \ @DRI2_TRUE@ dri2.c \ @DRI2_TRUE@ dri2.h \ @DRI2_TRUE@ $(NULL) +@X11_DRI3_TRUE@am__append_4 = \ +@X11_DRI3_TRUE@ dri3.c \ +@X11_DRI3_TRUE@ dri3.h \ +@X11_DRI3_TRUE@ $(NULL) + +@X11_DRI3_TRUE@am__append_5 = $(X11_DRI3_CFLAGS) +@X11_DRI3_TRUE@am__append_6 = $(X11_DRI3_LIBS) subdir = test -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp README ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -64,17 +121,20 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) libtest_la_LIBADD = am__libtest_la_SOURCES_DIST = test.h test_display.c test_image.c \ - test_log.c test_render.c dri2.c dri2.h + test_log.c test_render.c dri2.c dri2.h dri3.c dri3.h @DRI2_TRUE@am__objects_1 = dri2.lo +@X11_DRI3_TRUE@am__objects_2 = dri3.lo am_libtest_la_OBJECTS = test_display.lo test_image.lo test_log.lo \ - test_render.lo $(am__objects_1) + test_render.lo $(am__objects_1) $(am__objects_2) libtest_la_OBJECTS = $(am_libtest_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = @DRI2_TRUE@am__EXEEXT_1 = dri2-race$(EXEEXT) dri2-swap$(EXEEXT) \ @DRI2_TRUE@ dri2-test$(EXEEXT) -am__EXEEXT_2 = basic-fillrect$(EXEEXT) basic-tiledrect$(EXEEXT) \ +@X11_DRI3_TRUE@am__EXEEXT_2 = dri3-test$(EXEEXT) present-test$(EXEEXT) +am__EXEEXT_3 = basic-fillrect$(EXEEXT) basic-tiledrect$(EXEEXT) \ basic-stippledrect$(EXEEXT) basic-rectangle$(EXEEXT) \ basic-string$(EXEEXT) basic-copyarea$(EXEEXT) \ basic-copyarea-size$(EXEEXT) basic-putimage$(EXEEXT) \ @@ -85,136 +145,191 @@ render-composite-solid-mask$(EXEEXT) render-copyarea$(EXEEXT) \ render-copyarea-mask$(EXEEXT) render-copyarea-size$(EXEEXT) \ render-copy-alphaless$(EXEEXT) mixed-stress$(EXEEXT) \ - $(am__EXEEXT_1) + shm-test$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) PROGRAMS = $(noinst_PROGRAMS) basic_copyarea_SOURCES = basic-copyarea.c basic_copyarea_OBJECTS = basic-copyarea.$(OBJEXT) basic_copyarea_LDADD = $(LDADD) am__DEPENDENCIES_1 = +@X11_DRI3_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) basic_copyarea_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) basic_copyarea_size_SOURCES = basic-copyarea-size.c basic_copyarea_size_OBJECTS = basic-copyarea-size.$(OBJEXT) basic_copyarea_size_LDADD = $(LDADD) basic_copyarea_size_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) basic_fillrect_SOURCES = basic-fillrect.c basic_fillrect_OBJECTS = basic-fillrect.$(OBJEXT) basic_fillrect_LDADD = $(LDADD) basic_fillrect_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) basic_lines_SOURCES = basic-lines.c basic_lines_OBJECTS = basic-lines.$(OBJEXT) basic_lines_LDADD = $(LDADD) basic_lines_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) basic_putimage_SOURCES = basic-putimage.c basic_putimage_OBJECTS = basic-putimage.$(OBJEXT) basic_putimage_LDADD = $(LDADD) basic_putimage_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) basic_rectangle_SOURCES = basic-rectangle.c basic_rectangle_OBJECTS = basic-rectangle.$(OBJEXT) basic_rectangle_LDADD = $(LDADD) basic_rectangle_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) basic_stippledrect_SOURCES = basic-stippledrect.c basic_stippledrect_OBJECTS = basic-stippledrect.$(OBJEXT) basic_stippledrect_LDADD = $(LDADD) basic_stippledrect_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) basic_stress_SOURCES = basic-stress.c basic_stress_OBJECTS = basic-stress.$(OBJEXT) basic_stress_LDADD = $(LDADD) basic_stress_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) basic_string_SOURCES = basic-string.c basic_string_OBJECTS = basic-string.$(OBJEXT) basic_string_LDADD = $(LDADD) basic_string_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) basic_tiledrect_SOURCES = basic-tiledrect.c basic_tiledrect_OBJECTS = basic-tiledrect.$(OBJEXT) basic_tiledrect_LDADD = $(LDADD) basic_tiledrect_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) dri2_race_SOURCES = dri2-race.c dri2_race_OBJECTS = dri2-race.$(OBJEXT) dri2_race_LDADD = $(LDADD) dri2_race_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) dri2_swap_SOURCES = dri2-swap.c dri2_swap_OBJECTS = dri2-swap.$(OBJEXT) dri2_swap_LDADD = $(LDADD) dri2_swap_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) dri2_test_SOURCES = dri2-test.c dri2_test_OBJECTS = dri2-test.$(OBJEXT) dri2_test_LDADD = $(LDADD) dri2_test_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +dri3_test_SOURCES = dri3-test.c +dri3_test_OBJECTS = dri3-test.$(OBJEXT) +dri3_test_LDADD = $(LDADD) +dri3_test_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) lowlevel_blt_bench_SOURCES = lowlevel-blt-bench.c lowlevel_blt_bench_OBJECTS = lowlevel-blt-bench.$(OBJEXT) lowlevel_blt_bench_LDADD = $(LDADD) lowlevel_blt_bench_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) mixed_stress_SOURCES = mixed-stress.c mixed_stress_OBJECTS = mixed-stress.$(OBJEXT) mixed_stress_LDADD = $(LDADD) mixed_stress_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +present_test_SOURCES = present-test.c +present_test_OBJECTS = present-test.$(OBJEXT) +present_test_LDADD = $(LDADD) +present_test_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) render_composite_solid_SOURCES = render-composite-solid.c render_composite_solid_OBJECTS = render-composite-solid.$(OBJEXT) render_composite_solid_LDADD = $(LDADD) render_composite_solid_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) render_composite_solid_mask_SOURCES = render-composite-solid-mask.c render_composite_solid_mask_OBJECTS = \ render-composite-solid-mask.$(OBJEXT) render_composite_solid_mask_LDADD = $(LDADD) render_composite_solid_mask_DEPENDENCIES = libtest.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) render_copy_alphaless_SOURCES = render-copy-alphaless.c render_copy_alphaless_OBJECTS = render-copy-alphaless.$(OBJEXT) render_copy_alphaless_LDADD = $(LDADD) render_copy_alphaless_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) render_copyarea_SOURCES = render-copyarea.c render_copyarea_OBJECTS = render-copyarea.$(OBJEXT) render_copyarea_LDADD = $(LDADD) render_copyarea_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) render_copyarea_mask_SOURCES = render-copyarea-mask.c render_copyarea_mask_OBJECTS = render-copyarea-mask.$(OBJEXT) render_copyarea_mask_LDADD = $(LDADD) render_copyarea_mask_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) render_copyarea_size_SOURCES = render-copyarea-size.c render_copyarea_size_OBJECTS = render-copyarea-size.$(OBJEXT) render_copyarea_size_LDADD = $(LDADD) render_copyarea_size_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) render_fill_SOURCES = render-fill.c render_fill_OBJECTS = render-fill.$(OBJEXT) render_fill_LDADD = $(LDADD) render_fill_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) render_fill_copy_SOURCES = render-fill-copy.c render_fill_copy_OBJECTS = render-fill-copy.$(OBJEXT) render_fill_copy_LDADD = $(LDADD) render_fill_copy_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) render_trapezoid_SOURCES = render-trapezoid.c render_trapezoid_OBJECTS = render-trapezoid.$(OBJEXT) render_trapezoid_LDADD = $(LDADD) render_trapezoid_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) render_trapezoid_image_SOURCES = render-trapezoid-image.c render_trapezoid_image_OBJECTS = render-trapezoid-image.$(OBJEXT) render_trapezoid_image_LDADD = $(LDADD) render_trapezoid_image_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ - $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +shm_test_SOURCES = shm-test.c +shm_test_OBJECTS = shm-test.$(OBJEXT) +shm_test_LDADD = $(LDADD) +shm_test_DEPENDENCIES = libtest.la $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_2) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -227,38 +342,58 @@ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libtest_la_SOURCES) basic-copyarea.c basic-copyarea-size.c \ basic-fillrect.c basic-lines.c basic-putimage.c \ basic-rectangle.c basic-stippledrect.c basic-stress.c \ basic-string.c basic-tiledrect.c dri2-race.c dri2-swap.c \ - dri2-test.c lowlevel-blt-bench.c mixed-stress.c \ - render-composite-solid.c render-composite-solid-mask.c \ - render-copy-alphaless.c render-copyarea.c \ - render-copyarea-mask.c render-copyarea-size.c render-fill.c \ - render-fill-copy.c render-trapezoid.c render-trapezoid-image.c + dri2-test.c dri3-test.c lowlevel-blt-bench.c mixed-stress.c \ + present-test.c render-composite-solid.c \ + render-composite-solid-mask.c render-copy-alphaless.c \ + render-copyarea.c render-copyarea-mask.c \ + render-copyarea-size.c render-fill.c render-fill-copy.c \ + render-trapezoid.c render-trapezoid-image.c shm-test.c DIST_SOURCES = $(am__libtest_la_SOURCES_DIST) basic-copyarea.c \ basic-copyarea-size.c basic-fillrect.c basic-lines.c \ basic-putimage.c basic-rectangle.c basic-stippledrect.c \ basic-stress.c basic-string.c basic-tiledrect.c dri2-race.c \ - dri2-swap.c dri2-test.c lowlevel-blt-bench.c mixed-stress.c \ - render-composite-solid.c render-composite-solid-mask.c \ - render-copy-alphaless.c render-copyarea.c \ - render-copyarea-mask.c render-copyarea-size.c render-fill.c \ - render-fill-copy.c render-trapezoid.c render-trapezoid-image.c + dri2-swap.c dri2-test.c dri3-test.c lowlevel-blt-bench.c \ + mixed-stress.c present-test.c render-composite-solid.c \ + render-composite-solid-mask.c render-copy-alphaless.c \ + render-copyarea.c render-copyarea-mask.c \ + render-copyarea-size.c render-fill.c render-fill-copy.c \ + render-trapezoid.c render-trapezoid-image.c shm-test.c +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -291,6 +426,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -319,8 +456,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -359,23 +501,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -441,12 +584,14 @@ render-fill-copy render-composite-solid \ render-composite-solid-mask render-copyarea \ render-copyarea-mask render-copyarea-size \ - render-copy-alphaless mixed-stress $(NULL) $(am__append_1) -AM_CFLAGS = @CWARNFLAGS@ $(X11_CFLAGS) $(DRM_CFLAGS) -LDADD = libtest.la $(X11_LIBS) $(DRM_LIBS) $(CLOCK_GETTIME_LIBS) + render-copy-alphaless mixed-stress shm-test $(NULL) \ + $(am__append_1) $(am__append_2) +AM_CFLAGS = @CWARNFLAGS@ $(X11_CFLAGS) $(DRM_CFLAGS) $(am__append_5) +LDADD = libtest.la $(X11_LIBS) $(DRM_LIBS) $(CLOCK_GETTIME_LIBS) \ + $(am__append_6) noinst_LTLIBRARIES = libtest.la libtest_la_SOURCES = test.h test_display.c test_image.c test_log.c \ - test_render.c $(NULL) $(am__append_2) + test_render.c $(NULL) $(am__append_3) $(am__append_4) EXTRA_DIST = README mkvsync.sh tearing.mp4 virtual.conf all: all-am @@ -485,12 +630,15 @@ clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(noinst_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + libtest.la: $(libtest_la_OBJECTS) $(libtest_la_DEPENDENCIES) $(EXTRA_libtest_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libtest_la_OBJECTS) $(libtest_la_LIBADD) $(LIBS) @@ -511,82 +659,119 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list + basic-copyarea$(EXEEXT): $(basic_copyarea_OBJECTS) $(basic_copyarea_DEPENDENCIES) $(EXTRA_basic_copyarea_DEPENDENCIES) @rm -f basic-copyarea$(EXEEXT) $(AM_V_CCLD)$(LINK) $(basic_copyarea_OBJECTS) $(basic_copyarea_LDADD) $(LIBS) + basic-copyarea-size$(EXEEXT): $(basic_copyarea_size_OBJECTS) $(basic_copyarea_size_DEPENDENCIES) $(EXTRA_basic_copyarea_size_DEPENDENCIES) @rm -f basic-copyarea-size$(EXEEXT) $(AM_V_CCLD)$(LINK) $(basic_copyarea_size_OBJECTS) $(basic_copyarea_size_LDADD) $(LIBS) + basic-fillrect$(EXEEXT): $(basic_fillrect_OBJECTS) $(basic_fillrect_DEPENDENCIES) $(EXTRA_basic_fillrect_DEPENDENCIES) @rm -f basic-fillrect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(basic_fillrect_OBJECTS) $(basic_fillrect_LDADD) $(LIBS) + basic-lines$(EXEEXT): $(basic_lines_OBJECTS) $(basic_lines_DEPENDENCIES) $(EXTRA_basic_lines_DEPENDENCIES) @rm -f basic-lines$(EXEEXT) $(AM_V_CCLD)$(LINK) $(basic_lines_OBJECTS) $(basic_lines_LDADD) $(LIBS) + basic-putimage$(EXEEXT): $(basic_putimage_OBJECTS) $(basic_putimage_DEPENDENCIES) $(EXTRA_basic_putimage_DEPENDENCIES) @rm -f basic-putimage$(EXEEXT) $(AM_V_CCLD)$(LINK) $(basic_putimage_OBJECTS) $(basic_putimage_LDADD) $(LIBS) + basic-rectangle$(EXEEXT): $(basic_rectangle_OBJECTS) $(basic_rectangle_DEPENDENCIES) $(EXTRA_basic_rectangle_DEPENDENCIES) @rm -f basic-rectangle$(EXEEXT) $(AM_V_CCLD)$(LINK) $(basic_rectangle_OBJECTS) $(basic_rectangle_LDADD) $(LIBS) + basic-stippledrect$(EXEEXT): $(basic_stippledrect_OBJECTS) $(basic_stippledrect_DEPENDENCIES) $(EXTRA_basic_stippledrect_DEPENDENCIES) @rm -f basic-stippledrect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(basic_stippledrect_OBJECTS) $(basic_stippledrect_LDADD) $(LIBS) + basic-stress$(EXEEXT): $(basic_stress_OBJECTS) $(basic_stress_DEPENDENCIES) $(EXTRA_basic_stress_DEPENDENCIES) @rm -f basic-stress$(EXEEXT) $(AM_V_CCLD)$(LINK) $(basic_stress_OBJECTS) $(basic_stress_LDADD) $(LIBS) + basic-string$(EXEEXT): $(basic_string_OBJECTS) $(basic_string_DEPENDENCIES) $(EXTRA_basic_string_DEPENDENCIES) @rm -f basic-string$(EXEEXT) $(AM_V_CCLD)$(LINK) $(basic_string_OBJECTS) $(basic_string_LDADD) $(LIBS) + basic-tiledrect$(EXEEXT): $(basic_tiledrect_OBJECTS) $(basic_tiledrect_DEPENDENCIES) $(EXTRA_basic_tiledrect_DEPENDENCIES) @rm -f basic-tiledrect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(basic_tiledrect_OBJECTS) $(basic_tiledrect_LDADD) $(LIBS) + dri2-race$(EXEEXT): $(dri2_race_OBJECTS) $(dri2_race_DEPENDENCIES) $(EXTRA_dri2_race_DEPENDENCIES) @rm -f dri2-race$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dri2_race_OBJECTS) $(dri2_race_LDADD) $(LIBS) + dri2-swap$(EXEEXT): $(dri2_swap_OBJECTS) $(dri2_swap_DEPENDENCIES) $(EXTRA_dri2_swap_DEPENDENCIES) @rm -f dri2-swap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dri2_swap_OBJECTS) $(dri2_swap_LDADD) $(LIBS) + dri2-test$(EXEEXT): $(dri2_test_OBJECTS) $(dri2_test_DEPENDENCIES) $(EXTRA_dri2_test_DEPENDENCIES) @rm -f dri2-test$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dri2_test_OBJECTS) $(dri2_test_LDADD) $(LIBS) + +dri3-test$(EXEEXT): $(dri3_test_OBJECTS) $(dri3_test_DEPENDENCIES) $(EXTRA_dri3_test_DEPENDENCIES) + @rm -f dri3-test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dri3_test_OBJECTS) $(dri3_test_LDADD) $(LIBS) + lowlevel-blt-bench$(EXEEXT): $(lowlevel_blt_bench_OBJECTS) $(lowlevel_blt_bench_DEPENDENCIES) $(EXTRA_lowlevel_blt_bench_DEPENDENCIES) @rm -f lowlevel-blt-bench$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lowlevel_blt_bench_OBJECTS) $(lowlevel_blt_bench_LDADD) $(LIBS) + mixed-stress$(EXEEXT): $(mixed_stress_OBJECTS) $(mixed_stress_DEPENDENCIES) $(EXTRA_mixed_stress_DEPENDENCIES) @rm -f mixed-stress$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mixed_stress_OBJECTS) $(mixed_stress_LDADD) $(LIBS) + +present-test$(EXEEXT): $(present_test_OBJECTS) $(present_test_DEPENDENCIES) $(EXTRA_present_test_DEPENDENCIES) + @rm -f present-test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(present_test_OBJECTS) $(present_test_LDADD) $(LIBS) + render-composite-solid$(EXEEXT): $(render_composite_solid_OBJECTS) $(render_composite_solid_DEPENDENCIES) $(EXTRA_render_composite_solid_DEPENDENCIES) @rm -f render-composite-solid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(render_composite_solid_OBJECTS) $(render_composite_solid_LDADD) $(LIBS) + render-composite-solid-mask$(EXEEXT): $(render_composite_solid_mask_OBJECTS) $(render_composite_solid_mask_DEPENDENCIES) $(EXTRA_render_composite_solid_mask_DEPENDENCIES) @rm -f render-composite-solid-mask$(EXEEXT) $(AM_V_CCLD)$(LINK) $(render_composite_solid_mask_OBJECTS) $(render_composite_solid_mask_LDADD) $(LIBS) + render-copy-alphaless$(EXEEXT): $(render_copy_alphaless_OBJECTS) $(render_copy_alphaless_DEPENDENCIES) $(EXTRA_render_copy_alphaless_DEPENDENCIES) @rm -f render-copy-alphaless$(EXEEXT) $(AM_V_CCLD)$(LINK) $(render_copy_alphaless_OBJECTS) $(render_copy_alphaless_LDADD) $(LIBS) + render-copyarea$(EXEEXT): $(render_copyarea_OBJECTS) $(render_copyarea_DEPENDENCIES) $(EXTRA_render_copyarea_DEPENDENCIES) @rm -f render-copyarea$(EXEEXT) $(AM_V_CCLD)$(LINK) $(render_copyarea_OBJECTS) $(render_copyarea_LDADD) $(LIBS) + render-copyarea-mask$(EXEEXT): $(render_copyarea_mask_OBJECTS) $(render_copyarea_mask_DEPENDENCIES) $(EXTRA_render_copyarea_mask_DEPENDENCIES) @rm -f render-copyarea-mask$(EXEEXT) $(AM_V_CCLD)$(LINK) $(render_copyarea_mask_OBJECTS) $(render_copyarea_mask_LDADD) $(LIBS) + render-copyarea-size$(EXEEXT): $(render_copyarea_size_OBJECTS) $(render_copyarea_size_DEPENDENCIES) $(EXTRA_render_copyarea_size_DEPENDENCIES) @rm -f render-copyarea-size$(EXEEXT) $(AM_V_CCLD)$(LINK) $(render_copyarea_size_OBJECTS) $(render_copyarea_size_LDADD) $(LIBS) + render-fill$(EXEEXT): $(render_fill_OBJECTS) $(render_fill_DEPENDENCIES) $(EXTRA_render_fill_DEPENDENCIES) @rm -f render-fill$(EXEEXT) $(AM_V_CCLD)$(LINK) $(render_fill_OBJECTS) $(render_fill_LDADD) $(LIBS) + render-fill-copy$(EXEEXT): $(render_fill_copy_OBJECTS) $(render_fill_copy_DEPENDENCIES) $(EXTRA_render_fill_copy_DEPENDENCIES) @rm -f render-fill-copy$(EXEEXT) $(AM_V_CCLD)$(LINK) $(render_fill_copy_OBJECTS) $(render_fill_copy_LDADD) $(LIBS) + render-trapezoid$(EXEEXT): $(render_trapezoid_OBJECTS) $(render_trapezoid_DEPENDENCIES) $(EXTRA_render_trapezoid_DEPENDENCIES) @rm -f render-trapezoid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(render_trapezoid_OBJECTS) $(render_trapezoid_LDADD) $(LIBS) + render-trapezoid-image$(EXEEXT): $(render_trapezoid_image_OBJECTS) $(render_trapezoid_image_DEPENDENCIES) $(EXTRA_render_trapezoid_image_DEPENDENCIES) @rm -f render-trapezoid-image$(EXEEXT) $(AM_V_CCLD)$(LINK) $(render_trapezoid_image_OBJECTS) $(render_trapezoid_image_LDADD) $(LIBS) +shm-test$(EXEEXT): $(shm_test_OBJECTS) $(shm_test_DEPENDENCIES) $(EXTRA_shm_test_DEPENDENCIES) + @rm -f shm-test$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(shm_test_OBJECTS) $(shm_test_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -607,8 +792,11 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri2-swap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri2-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri3-test.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri3.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lowlevel-blt-bench.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mixed-stress.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/present-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/render-composite-solid-mask.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/render-composite-solid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/render-copy-alphaless.Po@am__quote@ @@ -619,6 +807,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/render-fill.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/render-trapezoid-image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/render-trapezoid.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shm-test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_display.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_image.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_log.Plo@am__quote@ @@ -629,14 +818,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -651,26 +840,15 @@ clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -682,15 +860,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -699,6 +873,21 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -841,19 +1030,20 @@ .MAKE: check-am install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean \ +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool clean-local \ - clean-noinstLTLIBRARIES clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am + clean-noinstLTLIBRARIES clean-noinstPROGRAMS cscopelist-am \ + ctags ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am vsync.avi: mkvsync.sh diff -Nru xserver-xorg-video-intel-2.99.910/test/mixed-stress.c xserver-xorg-video-intel-2.99.914/test/mixed-stress.c --- xserver-xorg-video-intel-2.99.910/test/mixed-stress.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/mixed-stress.c 2014-06-21 14:45:39.000000000 +0000 @@ -43,19 +43,19 @@ XFreePixmap(tt->dpy->dpy, tmp); } -static void render_copy(struct test_target *real, +static void render_copy(struct test_target *out, struct test_target *ref) { - int x = rand() % (2*real->width) - real->width; - int y = rand() % (2*real->height) - real->height; - int w = rand() % (2*real->width); - int h = rand() % (2*real->height); + int x = rand() % (2*out->width) - out->width; + int y = rand() % (2*out->height) - out->height; + int w = rand() % (2*out->width); + int h = rand() % (2*out->height); int red = rand() & 0xff; int green = rand() & 0xff; int blue = rand() & 0xff; int alpha = rand() & 0xff; - _render_copy(real, x, y, w, h, red, green, blue, alpha); + _render_copy(out, x, y, w, h, red, green, blue, alpha); _render_copy(ref, x, y, w, h, red, green, blue, alpha); } @@ -79,36 +79,36 @@ 0, 0, tt->width, tt->height); } -static void basic_fill(struct test_target *real, +static void basic_fill(struct test_target *out, struct test_target *ref) { - int x = rand() % (2*real->width) - real->width; - int y = rand() % (2*real->height) - real->height; - int w = rand() % (2*real->width); - int h = rand() % (2*real->height); + int x = rand() % (2*out->width) - out->width; + int y = rand() % (2*out->height) - out->height; + int w = rand() % (2*out->width); + int h = rand() % (2*out->height); int color = rand(); int alu = rand() % 16; - fill_rect(real, alu, color, x, y, w, h); + fill_rect(out, alu, color, x, y, w, h); fill_rect(ref, alu, color, x, y, w, h); } -static void basic_copy(struct test_target *real, +static void basic_copy(struct test_target *out, struct test_target *ref) { - int sx = rand() % (2*real->width) - ref->width; - int sy = rand() % (2*real->height) - ref->height; - int dx = rand() % (2*real->width) - ref->width; - int dy = rand() % (2*real->height) - ref->height; - int w = rand() % (2*real->width); - int h = rand() % (2*real->height); + int sx = rand() % (2*out->width) - ref->width; + int sy = rand() % (2*out->height) - ref->height; + int dx = rand() % (2*out->width) - ref->width; + int dy = rand() % (2*out->height) - ref->height; + int w = rand() % (2*out->width); + int h = rand() % (2*out->height); XGCValues val; val.function = rand() % 16; - XChangeGC(real->dpy->dpy, real->gc, GCFunction, &val); - XCopyArea(real->dpy->dpy, - real->draw, real->draw, real->gc, + XChangeGC(out->dpy->dpy, out->gc, GCFunction, &val); + XCopyArea(out->dpy->dpy, + out->draw, out->draw, out->gc, sx, sy, w, h, dx, dy); XChangeGC(ref->dpy->dpy, ref->gc, GCFunction, &val); @@ -142,23 +142,23 @@ } } -static void basic_put(struct test_target *real, +static void basic_put(struct test_target *out, struct test_target *ref) { - int x = rand() % (2*real->width) - real->width; - int y = rand() % (2*real->height) - real->height; - int w = rand() % real->width; - int h = rand() % real->height; + int x = rand() % (2*out->width) - out->width; + int y = rand() % (2*out->height) - out->height; + int w = rand() % out->width; + int h = rand() % out->height; int color = rand(); int alu = rand() % 16; - _put(real, x, y, w, h, color, alu); + _put(out, x, y, w, h, color, alu); _put(ref, x, y, w, h, color, alu); } static void rect_tests(struct test *test, int iterations, enum target target) { - struct test_target real, ref; + struct test_target out, ref; void (* const ops[])(struct test_target *, struct test_target *) = { basic_copy, basic_fill, @@ -171,24 +171,24 @@ test_target_name(target)); fflush(stdout); - test_target_create_render(&test->real, target, &real); + test_target_create_render(&test->out, target, &out); test_target_create_render(&test->ref, target, &ref); - clear(&real); + clear(&out); clear(&ref); for (n = 0; n < iterations; n++) - ops[rand() % ARRAY_SIZE(ops)](&real, &ref); + ops[rand() % ARRAY_SIZE(ops)](&out, &ref); test_compare(test, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); printf("passed [%d iterations]\n", n); - test_target_destroy_render(&test->real, &real); + test_target_destroy_render(&test->out, &out); test_target_destroy_render(&test->ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/present-test.c xserver-xorg-video-intel-2.99.914/test/present-test.c --- xserver-xorg-video-intel-2.99.910/test/present-test.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/present-test.c 2014-06-02 07:36:29.000000000 +0000 @@ -0,0 +1,726 @@ +/* + * Copyright (c) 2014 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. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if HAVE_X11_EXTENSIONS_SHMPROTO_H +#include +#elif HAVE_X11_EXTENSIONS_SHMSTR_H +#include +#else +#error Failed to find the right header for X11 MIT-SHM protocol definitions +#endif +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "dri3.h" + +#define ALIGN(x, y) (((x) + (y) - 1) & -(y)) +#define PAGE_ALIGN(x) ALIGN(x, 4096) + +#define GTT I915_GEM_DOMAIN_GTT +#define CPU I915_GEM_DOMAIN_CPU + +static int _x_error_occurred; +static uint32_t stamp; + +static int +_check_error_handler(Display *display, + XErrorEvent *event) +{ + printf("X11 error from display %s, serial=%ld, error=%d, req=%d.%d\n", + DisplayString(display), + event->serial, + event->error_code, + event->request_code, + event->minor_code); + _x_error_occurred++; + return False; /* ignored */ +} + +static int is_i915_device(int fd) +{ + drm_version_t version; + char name[5] = ""; + + memset(&version, 0, sizeof(version)); + version.name_len = 4; + version.name = name; + + if (drmIoctl(fd, DRM_IOCTL_VERSION, &version)) + return 0; + + return strcmp("i915", name) == 0; +} + +static int is_intel(int fd) +{ + struct drm_i915_getparam gp; + int ret; + + /* Confirm that this is a i915.ko device with GEM/KMS enabled */ + ret = is_i915_device(fd); + if (ret) { + gp.param = I915_PARAM_HAS_GEM; + gp.value = &ret; + if (drmIoctl(fd, DRM_IOCTL_I915_GETPARAM, &gp)) + ret = 0; + } + return ret; +} + +static void *setup_msc(Display *dpy, Window win) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + xcb_void_cookie_t cookie; + uint32_t id = xcb_generate_id(c); + xcb_generic_error_t *error; + void *q; + + cookie = xcb_present_select_input_checked(c, id, win, XCB_PRESENT_EVENT_MASK_COMPLETE_NOTIFY); + q = xcb_register_for_special_xge(c, &xcb_present_id, id, &stamp); + + error = xcb_request_check(c, cookie); + assert(error == NULL); + + return q; +} + +static uint64_t check_msc(Display *dpy, Window win, void *q, uint64_t last_msc) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + uint64_t msc = 0; + + xcb_present_notify_msc(c, win, 0, 0, 0, 0); + xcb_flush(c); + + do { + xcb_present_complete_notify_event_t *ce; + xcb_generic_event_t *ev; + + ev = xcb_wait_for_special_event(c, q); + if (ev == NULL) + break; + + ce = (xcb_present_complete_notify_event_t *)ev; + if (ce->kind != XCB_PRESENT_COMPLETE_KIND_PIXMAP) + msc = ce->msc; + free(ev); + } while (msc == 0); + + if (msc < last_msc) { + printf("Invalid MSC: was %llu, now %llu\n", + (long long)last_msc, (long long)msc); + } + + return msc; +} + +static void teardown_msc(Display *dpy, void *q) +{ + xcb_unregister_for_special_event(XGetXCBConnection(dpy), q); +} +static int test_whole(Display *dpy) +{ + Pixmap pixmap; + struct dri3_fence fence; + Window root; + unsigned int width, height; + unsigned border, depth; + int x, y, ret = 1; + + XGetGeometry(dpy, DefaultRootWindow(dpy), + &root, &x, &y, &width, &height, &border, &depth); + + if (dri3_create_fence(dpy, root, &fence)) + return 0; + + printf("Testing whole screen flip: %dx%d\n", width, height); + _x_error_occurred = 0; + + xshmfence_reset(fence.addr); + + pixmap = XCreatePixmap(dpy, root, width, height, depth); + xcb_present_pixmap(XGetXCBConnection(dpy), + root, pixmap, + 0, /* sbc */ + 0, /* valid */ + 0, /* update */ + 0, /* x_off */ + 0, /* y_off */ + None, + None, /* wait fence */ + fence.xid, + XCB_PRESENT_OPTION_NONE, + 0, /* target msc */ + 0, /* divisor */ + 0, /* remainder */ + 0, NULL); + XFreePixmap(dpy, pixmap); + + pixmap = XCreatePixmap(dpy, root, width, height, depth); + xcb_present_pixmap(XGetXCBConnection(dpy), + root, pixmap, + 0, /* sbc */ + 0, /* valid */ + 0, /* update */ + 0, /* x_off */ + 0, /* y_off */ + None, + None, /* wait fence */ + None, /* sync fence */ + XCB_PRESENT_OPTION_NONE, + 0, /* target msc */ + 0, /* divisor */ + 0, /* remainder */ + 0, NULL); + XFreePixmap(dpy, pixmap); + XFlush(dpy); + + ret = !!xshmfence_await(fence.addr); + dri3_fence_free(dpy, &fence); + + XSync(dpy, True); + ret += !!_x_error_occurred; + + return ret; +} + +static inline XRRScreenResources *_XRRGetScreenResourcesCurrent(Display *dpy, Window window) +{ + XRRScreenResources *res; + + res = XRRGetScreenResourcesCurrent(dpy, window); + if (res == NULL) + res = XRRGetScreenResources(dpy, window); + + return res; +} + +static XRRModeInfo *lookup_mode(XRRScreenResources *res, int id) +{ + int i; + + for (i = 0; i < res->nmode; i++) { + if (res->modes[i].id == id) + return &res->modes[i]; + } + + return NULL; +} + +static int for_each_crtc(Display *dpy, + int (*func)(Display *dpy, + RRCrtc crtc, + int width, int height, + void *closure), + void *closure) +{ + XRRScreenResources *res; + XRRCrtcInfo **original_crtc; + int i, j, err = 0; + + if (!XRRQueryVersion(dpy, &i, &j)) + return -1; + + res = _XRRGetScreenResourcesCurrent(dpy, DefaultRootWindow(dpy)); + if (res == NULL) + return -1; + + original_crtc = malloc(sizeof(XRRCrtcInfo *)*res->ncrtc); + for (i = 0; i < res->ncrtc; i++) + original_crtc[i] = XRRGetCrtcInfo(dpy, res, res->crtcs[i]); + + printf("noutput=%d, ncrtc=%d\n", res->noutput, res->ncrtc); + + for (i = 0; i < res->noutput; i++) { + XRROutputInfo *output; + XRRModeInfo *mode; + + output = XRRGetOutputInfo(dpy, res, res->outputs[i]); + if (output == NULL) + continue; + + mode = NULL; + if (res->nmode) + mode = lookup_mode(res, output->modes[0]); + + for (j = 0; mode && j < output->ncrtc; j++) { + printf("[%d, %d] -- OUTPUT:%ld, CRTC:%ld\n", + i, j, (long)res->outputs[i], (long)output->crtcs[j]); + XRRSetCrtcConfig(dpy, res, output->crtcs[j], CurrentTime, + 0, 0, output->modes[0], RR_Rotate_0, &res->outputs[i], 1); + XSync(dpy, True); + + err += func(dpy, output->crtcs[j], mode->width, mode->height, closure); + + XRRSetCrtcConfig(dpy, res, output->crtcs[j], CurrentTime, + 0, 0, None, RR_Rotate_0, NULL, 0); + XSync(dpy, True); + } + + XRRFreeOutputInfo(output); + } + + for (i = 0; i < res->ncrtc; i++) + XRRSetCrtcConfig(dpy, res, res->crtcs[i], CurrentTime, + original_crtc[i]->x, + original_crtc[i]->y, + original_crtc[i]->mode, + original_crtc[i]->rotation, + original_crtc[i]->outputs, + original_crtc[i]->noutput); + + free(original_crtc); + XRRFreeScreenResources(res); + + return j; +} + +struct test_crtc { + Window win; + int depth; + unsigned flags; + + struct dri3_fence fence; + void *queue; + uint64_t msc; +}; +#define SYNC 0x1 + +static int __test_crtc(Display *dpy, RRCrtc crtc, + int width, int height, + void *closure) +{ + struct test_crtc *test = closure; + Pixmap pixmap; + int err = 0; + + test->msc = check_msc(dpy, test->win, test->queue, test->msc); + + if (test->flags & SYNC) + xshmfence_reset(test->fence.addr); + + pixmap = XCreatePixmap(dpy, test->win, width, height, test->depth); + xcb_present_pixmap(XGetXCBConnection(dpy), + test->win, pixmap, + 0, /* sbc */ + 0, /* valid */ + 0, /* update */ + 0, /* x_off */ + 0, /* y_off */ + crtc, + None, /* wait fence */ + test->flags & SYNC ? test->fence.xid : None, + XCB_PRESENT_OPTION_NONE, + 0, /* target msc */ + 1, /* divisor */ + 0, /* remainder */ + 0, NULL); + XFreePixmap(dpy, pixmap); + + if (test->flags & SYNC) { + pixmap = XCreatePixmap(dpy, test->win, width, height, test->depth); + xcb_present_pixmap(XGetXCBConnection(dpy), + test->win, pixmap, + 1, /* sbc */ + 0, /* valid */ + 0, /* update */ + 0, /* x_off */ + 0, /* y_off */ + crtc, + None, /* wait fence */ + None, /* sync fence */ + XCB_PRESENT_OPTION_NONE, + 1, /* target msc */ + 1, /* divisor */ + 0, /* remainder */ + 0, NULL); + XFreePixmap(dpy, pixmap); + XFlush(dpy); + err += !!xshmfence_await(test->fence.addr); + } + + test->msc = check_msc(dpy, test->win, test->queue, test->msc); + return err; +} + +static int test_crtc(Display *dpy, void *queue, uint64_t last_msc) +{ + struct test_crtc test; + int err = 0; + + XSync(dpy, True); + _x_error_occurred = 0; + + test.win = DefaultRootWindow(dpy); + test.depth = DefaultDepth(dpy, DefaultScreen(dpy)); + if (dri3_create_fence(dpy, test.win, &test.fence)) + return -1; + test.queue = queue; + test.msc = last_msc; + + printf("Testing each crtc, without waiting for each flip\n"); + test.flags = 0; + err += for_each_crtc(dpy, __test_crtc, &test); + + printf("Testing each crtc, waiting for flips to complete\n"); + test.flags = SYNC; + err += for_each_crtc(dpy, __test_crtc, &test); + + test.msc = check_msc(dpy, test.win, test.queue, test.msc); + dri3_fence_free(dpy, &test.fence); + + XSync(dpy, True); + err += !!_x_error_occurred; + + if (err) + printf("%s: failures=%d\n", __func__, err); + + return err; +} + +static int +can_use_shm(Display *dpy) +{ + int major, minor, has_pixmap; + + if (!XShmQueryExtension(dpy)) + return 0; + + XShmQueryVersion(dpy, &major, &minor, &has_pixmap); + return has_pixmap; +} + +static int test_shm(Display *dpy) +{ + Window win = DefaultRootWindow(dpy); + XShmSegmentInfo shm; + Pixmap pixmap; + Window root; + unsigned int width, height; + unsigned border, depth; + int x, y, ret = 1; + + if (!can_use_shm(dpy)) + return 0; + + _x_error_occurred = 0; + + XGetGeometry(dpy, win, &root, &x, &y, + &width, &height, &border, &depth); + + printf("Using %dx%d SHM\n", width, height); + + shm.shmid = shmget(IPC_PRIVATE, height * 4*width, IPC_CREAT | 0666); + if (shm.shmid == -1) + return 0; + + shm.shmaddr = shmat(shm.shmid, 0, 0); + if (shm.shmaddr == (char *) -1) + goto rmid; + + shm.readOnly = False; + XShmAttach(dpy, &shm); + + pixmap = XShmCreatePixmap(dpy, DefaultRootWindow(dpy), + shm.shmaddr, &shm, width, height, 24); + if (_x_error_occurred) + goto detach; + + xcb_present_pixmap(XGetXCBConnection(dpy), + win, pixmap, + 0, /* sbc */ + 0, /* valid */ + 0, /* update */ + 0, /* x_off */ + 0, /* y_off */ + None, + None, /* wait fence */ + None, + XCB_PRESENT_OPTION_NONE, + 0, /* target msc */ + 0, /* divisor */ + 0, /* remainder */ + 0, NULL); + XFreePixmap(dpy, pixmap); + + XSync(dpy, True); + if (_x_error_occurred) + goto detach; + + ret = 0; +detach: + XShmDetach(dpy, &shm); + shmdt(shm.shmaddr); + XSync(dpy, False); +rmid: + shmctl(shm.shmid, IPC_RMID, NULL); + return ret; +} + +static uint32_t gem_create(int fd, int size) +{ + struct drm_i915_gem_create create; + + create.handle = 0; + create.size = size; + (void)drmIoctl(fd, DRM_IOCTL_I915_GEM_CREATE, &create); + + return create.handle; +} + +struct local_i915_gem_caching { + uint32_t handle; + uint32_t caching; +}; + +#define LOCAL_I915_GEM_SET_CACHING 0x2f +#define LOCAL_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + LOCAL_I915_GEM_SET_CACHING, struct local_i915_gem_caching) + +static int gem_set_caching(int fd, uint32_t handle, int caching) +{ + struct local_i915_gem_caching arg; + + arg.handle = handle; + arg.caching = caching; + + return drmIoctl(fd, LOCAL_IOCTL_I915_GEM_SET_CACHING, &arg) == 0; +} + +static int gem_export(int fd, uint32_t handle) +{ + struct drm_prime_handle args; + + args.handle = handle; + args.flags = O_CLOEXEC; + + if (drmIoctl(fd, DRM_IOCTL_PRIME_HANDLE_TO_FD, &args)) + return -1; + + return args.fd; +} + +static void gem_close(int fd, uint32_t handle) +{ + struct drm_gem_close close; + + close.handle = handle; + (void)drmIoctl(fd, DRM_IOCTL_GEM_CLOSE, &close); +} + +static int test_dri3(Display *dpy) +{ + Window win = DefaultRootWindow(dpy); + Pixmap pixmap; + Window root; + unsigned int width, height; + unsigned border, depth; + unsigned stride, size; + int x, y, ret = 1; + int device, handle; + int bpp; + + device = dri3_open(dpy); + if (device < 0) + return 0; + + if (!is_intel(device)) + return 0; + + printf("Opened Intel DRI3 device\n"); + + XGetGeometry(dpy, win, &root, &x, &y, + &width, &height, &border, &depth); + + switch (depth) { + case 8: bpp = 8; break; + case 15: case 16: bpp = 16; break; + case 24: case 32: bpp = 32; break; + default: return 0; + } + + stride = width * bpp/8; + size = PAGE_ALIGN(stride * height); + printf("Creating DRI3 %dx%d (source stride=%d, size=%d) for GTT\n", + width, height, stride, size); + + pixmap = 0; + handle = gem_create(device, size); + if (handle) { + pixmap = dri3_create_pixmap(dpy, root, + width, height, depth, + gem_export(device, handle), bpp, stride, size); + gem_close(device, handle); + } + if (pixmap == 0) + goto fail; + + xcb_present_pixmap(XGetXCBConnection(dpy), + win, pixmap, + 0, /* sbc */ + 0, /* valid */ + 0, /* update */ + 0, /* x_off */ + 0, /* y_off */ + None, + None, /* wait fence */ + None, + XCB_PRESENT_OPTION_NONE, + 0, /* target msc */ + 0, /* divisor */ + 0, /* remainder */ + 0, NULL); + XFreePixmap(dpy, pixmap); + + XSync(dpy, True); + if (_x_error_occurred) + goto fail; + + printf("Creating DRI3 %dx%d (source stride=%d, size=%d) for CPU\n", + width, height, stride, size); + + pixmap = 0; + handle = gem_create(device, size); + if (handle) { + gem_set_caching(device, handle, CPU); + handle = dri3_create_pixmap(dpy, root, + width, height, depth, + gem_export(device, handle), bpp, stride, size); + gem_close(device, handle); + } + if (pixmap == 0) + goto fail; + + xcb_present_pixmap(XGetXCBConnection(dpy), + win, pixmap, + 0, /* sbc */ + 0, /* valid */ + 0, /* update */ + 0, /* x_off */ + 0, /* y_off */ + None, + None, /* wait fence */ + None, + XCB_PRESENT_OPTION_NONE, + 0, /* target msc */ + 0, /* divisor */ + 0, /* remainder */ + 0, NULL); + XFreePixmap(dpy, pixmap); + + XSync(dpy, True); + if (_x_error_occurred) + goto fail; + + ret = 0; +fail: + close(device); + return ret; +} + +static int has_present(Display *dpy) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + xcb_present_query_version_reply_t *reply; + xcb_generic_error_t *error = NULL; + + reply = xcb_present_query_version_reply(c, + xcb_present_query_version(c, + XCB_PRESENT_MAJOR_VERSION, + XCB_PRESENT_MINOR_VERSION), + &error); + + free(reply); + free(error); + + return reply != NULL; +} + +int main(void) +{ + Display *dpy; + Window root; + int error = 0; + uint64_t last_msc; + void *queue; + + dpy = XOpenDisplay(NULL); + if (dpy == NULL) + return 77; + + if (!has_present(dpy)) + return 77; + + root = DefaultRootWindow(dpy); + + signal(SIGALRM, SIG_IGN); + XSetErrorHandler(_check_error_handler); + + queue = setup_msc(dpy, root); + last_msc = check_msc(dpy, root, queue, 0); + + error += test_whole(dpy); + last_msc = check_msc(dpy, root, queue, last_msc); + + error += test_crtc(dpy, queue, last_msc); + last_msc = check_msc(dpy, root, queue, last_msc); + + error += test_shm(dpy); + last_msc = check_msc(dpy, root, queue, last_msc); + + error += test_dri3(dpy); + last_msc = check_msc(dpy, root, queue, last_msc); + + teardown_msc(dpy, queue); + + return !!error; +} diff -Nru xserver-xorg-video-intel-2.99.910/test/render-composite-solid.c xserver-xorg-video-intel-2.99.914/test/render-composite-solid.c --- xserver-xorg-video-intel-2.99.910/test/render-composite-solid.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/render-composite-solid.c 2014-06-21 14:45:39.000000000 +0000 @@ -34,13 +34,13 @@ { struct test_target tt; XImage image; - uint32_t *cells = malloc(t->real.width*t->real.height*4); + uint32_t *cells = malloc(t->out.width*t->out.height*4); struct { uint16_t x, y; } *pixels = malloc(reps*sizeof(*pixels)); int r, s; - test_target_create_render(&t->real, target, &tt); + test_target_create_render(&t->out, target, &tt); printf("Testing setting of single pixels (%s): ", test_target_name(target)); @@ -55,7 +55,7 @@ int blue = rand() % 0xff; int alpha = rand() % 0xff; - fill_rect(&t->real, tt.picture, PictOpSrc, + fill_rect(&t->out, tt.picture, PictOpSrc, x, y, 1, 1, red, green, blue, alpha); @@ -64,14 +64,14 @@ cells[y*tt.width+x] = color(red, green, blue, alpha); } - test_init_image(&image, &t->real.shm, tt.format, 1, 1); + test_init_image(&image, &t->out.shm, tt.format, 1, 1); for (r = 0; r < reps; r++) { uint32_t result; uint32_t x = pixels[r].x; uint32_t y = pixels[r].y; - XShmGetImage(t->real.dpy, tt.draw, &image, + XShmGetImage(t->out.dpy, tt.draw, &image, x, y, AllPlanes); result = *(uint32_t *)image.data; @@ -93,7 +93,7 @@ } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(pixels); free(cells); } @@ -109,16 +109,16 @@ { struct test_target tt; XImage image; - uint32_t *cells = calloc(sizeof(uint32_t), t->real.width*t->real.height); + uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height); int r, s, x, y; printf("Testing area sets (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &tt); - clear(&t->real, &tt); + test_target_create_render(&t->out, target, &tt); + clear(&t->out, &tt); - test_init_image(&image, &t->real.shm, tt.format, tt.width, tt.height); + test_init_image(&image, &t->out.shm, tt.format, tt.width, tt.height); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { @@ -132,7 +132,7 @@ x = rand() % (2*tt.width) - tt.width; y = rand() % (2*tt.height) - tt.height; - fill_rect(&t->real, tt.picture, PictOpSrc, + fill_rect(&t->out, tt.picture, PictOpSrc, x, y, w, h, red, green, blue, alpha); if (x < 0) @@ -153,7 +153,7 @@ color(red, green, blue, alpha)); } - XShmGetImage(t->real.dpy, tt.draw, &image, 0, 0, AllPlanes); + XShmGetImage(t->out.dpy, tt.draw, &image, 0, 0, AllPlanes); for (y = 0; y < tt.height; y++) { for (x = 0; x < tt.width; x++) { @@ -179,37 +179,37 @@ printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(cells); } static void rect_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing area fills (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; - int w = rand() % real.width; - int h = rand() % real.height; + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; + int w = rand() % out.width; + int h = rand() % out.height; int op = ops[rand() % sizeof(ops)]; int red = rand() % 0xff; int green = rand() % 0xff; int blue = rand() % 0xff; int alpha = rand() % 0xff; - fill_rect(&t->real, real.picture, + fill_rect(&t->out, out.picture, op, x, y, w, h, red, green, blue, alpha); fill_rect(&t->ref, ref.picture, @@ -218,15 +218,15 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/render-composite-solid-mask.c xserver-xorg-video-intel-2.99.914/test/render-composite-solid-mask.c --- xserver-xorg-video-intel-2.99.910/test/render-composite-solid-mask.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/render-composite-solid-mask.c 2014-06-21 14:45:39.000000000 +0000 @@ -48,24 +48,24 @@ static void ref_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing area fills (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; - int w = rand() % real.width; - int h = rand() % real.height; + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; + int w = rand() % out.width; + int h = rand() % out.height; int op = ops[rand() % sizeof(ops)]; int s_red = rand() % 0xff; int s_green = rand() % 0xff; @@ -76,7 +76,7 @@ int m_blue = rand() % 0xff; int m_alpha = rand() % 0xff; - fill_rect(&t->real, real.picture, + fill_rect(&t->out, out.picture, op, x, y, w, h, s_red, s_green, s_blue, s_alpha, m_red, m_green, m_blue, m_alpha); @@ -87,15 +87,15 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/render-copy-alphaless.c xserver-xorg-video-intel-2.99.914/test/render-copy-alphaless.c --- xserver-xorg-video-intel-2.99.910/test/render-copy-alphaless.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/render-copy-alphaless.c 2014-06-21 14:45:39.000000000 +0000 @@ -9,7 +9,7 @@ static void show_cells(char *buf, - const uint32_t *real, const uint32_t *ref, + const uint32_t *out, const uint32_t *ref, int x, int y, int w, int h) { int i, j, len = 0; @@ -22,7 +22,7 @@ if (i < 0 || i >= w) continue; - len += sprintf(buf+len, "%08x ", real[j*w+i]); + len += sprintf(buf+len, "%08x ", out[j*w+i]); } len += sprintf(buf+len, "\t"); @@ -68,13 +68,13 @@ { struct test_target tt; XImage image; - uint32_t *cells = malloc(t->real.width*t->real.height*4); + uint32_t *cells = malloc(t->out.width*t->out.height*4); struct { uint16_t x, y; } *pixels = malloc(reps*sizeof(*pixels)); int r, s; - test_target_create_render(&t->real, target, &tt); + test_target_create_render(&t->out, target, &tt); printf("Testing setting of single pixels (%s): ", test_target_name(target)); @@ -88,7 +88,7 @@ uint8_t green = rand(); uint8_t blue = rand(); - fill_rect(&t->real, tt.picture, + fill_rect(&t->out, tt.picture, x, y, 1, 1, red, green, blue); @@ -97,14 +97,14 @@ cells[y*tt.width+x] = color(red, green, blue, 0xff); } - test_init_image(&image, &t->real.shm, tt.format, 1, 1); + test_init_image(&image, &t->out.shm, tt.format, 1, 1); for (r = 0; r < reps; r++) { uint32_t x = pixels[r].x; uint32_t y = pixels[r].y; uint32_t result; - XShmGetImage(t->real.dpy, tt.draw, &image, + XShmGetImage(t->out.dpy, tt.draw, &image, x, y, AllPlanes); result = *(uint32_t *)image.data; @@ -123,7 +123,7 @@ } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(pixels); free(cells); } @@ -139,16 +139,16 @@ { struct test_target tt; XImage image; - uint32_t *cells = calloc(sizeof(uint32_t), t->real.width*t->real.height); + uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height); int r, s, x, y; printf("Testing area sets (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &tt); - clear(&t->real, &tt); + test_target_create_render(&t->out, target, &tt); + clear(&t->out, &tt); - test_init_image(&image, &t->real.shm, tt.format, tt.width, tt.height); + test_init_image(&image, &t->out.shm, tt.format, tt.width, tt.height); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { @@ -161,7 +161,7 @@ x = rand() % (2*tt.width) - tt.width; y = rand() % (2*tt.height) - tt.height; - fill_rect(&t->real, tt.picture, + fill_rect(&t->out, tt.picture, x, y, w, h, red, green, blue); @@ -183,7 +183,7 @@ color(red, green, blue, 0xff)); } - XShmGetImage(t->real.dpy, tt.draw, &image, 0, 0, AllPlanes); + XShmGetImage(t->out.dpy, tt.draw, &image, 0, 0, AllPlanes); for (y = 0; y < tt.height; y++) { for (x = 0; x < tt.width; x++) { @@ -211,20 +211,20 @@ printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(cells); } static void rect_tests(struct test *t, int reps, int sets, enum target target, int use_window) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing area fills (%s, using %s source): ", test_target_name(target), use_window ? "window" : "pixmap"); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); @@ -236,12 +236,12 @@ uint8_t green = rand(); uint8_t blue = rand(); - x = rand() % (real.width - 1); - y = rand() % (real.height - 1); - w = 1 + rand() % (real.width - x - 1); - h = 1 + rand() % (real.height - y - 1); + x = rand() % (out.width - 1); + y = rand() % (out.height - 1); + w = 1 + rand() % (out.width - x - 1); + h = 1 + rand() % (out.height - y - 1); - fill_rect(&t->real, real.picture, + fill_rect(&t->out, out.picture, x, y, w, h, red, green, blue); fill_rect(&t->ref, ref.picture, @@ -250,15 +250,15 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/render-copyarea.c xserver-xorg-video-intel-2.99.914/test/render-copyarea.c --- xserver-xorg-video-intel-2.99.910/test/render-copyarea.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/render-copyarea.c 2014-06-21 14:45:39.000000000 +0000 @@ -9,7 +9,7 @@ static void show_cells(char *buf, - const uint32_t *real, const uint32_t *ref, + const uint32_t *out, const uint32_t *ref, int x, int y, int w, int h) { int i, j, len = 0; @@ -22,7 +22,7 @@ if (i < 0 || i >= w) continue; - len += sprintf(buf+len, "%08x ", real[j*w+i]); + len += sprintf(buf+len, "%08x ", out[j*w+i]); } len += sprintf(buf+len, "\t"); @@ -85,13 +85,13 @@ { struct test_target tt; XImage image; - uint32_t *cells = malloc(t->real.width*t->real.height*4); + uint32_t *cells = malloc(t->out.width*t->out.height*4); struct { uint16_t x, y; } *pixels = malloc(reps*sizeof(*pixels)); int r, s; - test_target_create_render(&t->real, target, &tt); + test_target_create_render(&t->out, target, &tt); printf("Testing setting of single pixels (%s): ", test_target_name(target)); @@ -106,7 +106,7 @@ uint8_t blue = rand(); uint8_t alpha = rand(); - fill_rect(&t->real, tt.picture, tt.format, + fill_rect(&t->out, tt.picture, tt.format, 0, 0, 0, PictOpSrc, x, y, 1, 1, red, green, blue, alpha); @@ -116,14 +116,14 @@ cells[y*tt.width+x] = color(red, green, blue, alpha); } - test_init_image(&image, &t->real.shm, tt.format, 1, 1); + test_init_image(&image, &t->out.shm, tt.format, 1, 1); for (r = 0; r < reps; r++) { uint32_t x = pixels[r].x; uint32_t y = pixels[r].y; uint32_t result; - XShmGetImage(t->real.dpy, tt.draw, &image, + XShmGetImage(t->out.dpy, tt.draw, &image, x, y, AllPlanes); result = *(uint32_t *)image.data; @@ -142,7 +142,7 @@ } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(pixels); free(cells); } @@ -158,16 +158,16 @@ { struct test_target tt; XImage image; - uint32_t *cells = calloc(sizeof(uint32_t), t->real.width*t->real.height); + uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height); int r, s, x, y; printf("Testing area sets (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &tt); - clear(&t->real, &tt); + test_target_create_render(&t->out, target, &tt); + clear(&t->out, &tt); - test_init_image(&image, &t->real.shm, tt.format, tt.width, tt.height); + test_init_image(&image, &t->out.shm, tt.format, tt.width, tt.height); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { @@ -181,7 +181,7 @@ x = rand() % (2*tt.width) - tt.width; y = rand() % (2*tt.height) - tt.height; - fill_rect(&t->real, tt.picture, tt.format, + fill_rect(&t->out, tt.picture, tt.format, 0, 0, 0, PictOpSrc, x, y, w, h, red, green, blue, alpha); @@ -204,7 +204,7 @@ color(red, green, blue, alpha)); } - XShmGetImage(t->real.dpy, tt.draw, &image, 0, 0, AllPlanes); + XShmGetImage(t->out.dpy, tt.draw, &image, 0, 0, AllPlanes); for (y = 0; y < tt.height; y++) { for (x = 0; x < tt.width; x++) { @@ -232,20 +232,20 @@ printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(cells); } static void rect_tests(struct test *t, int reps, int sets, enum target target, int use_window) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing area fills (%s, using %s source): ", test_target_name(target), use_window ? "window" : "pixmap"); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); @@ -261,19 +261,19 @@ int try = 50; do { - x = rand() % (real.width - 1); - y = rand() % (real.height - 1); - w = 1 + rand() % (real.width - x - 1); - h = 1 + rand() % (real.height - y - 1); - tmpx = w == real.width ? 0 : rand() % (real.width - w); - tmpy = h == real.height ? 0 : rand() % (real.height - h); + x = rand() % (out.width - 1); + y = rand() % (out.height - 1); + w = 1 + rand() % (out.width - x - 1); + h = 1 + rand() % (out.height - y - 1); + tmpx = w == out.width ? 0 : rand() % (out.width - w); + tmpy = h == out.height ? 0 : rand() % (out.height - h); } while (((tmpx+w > x && tmpx < x+w) || (tmpy+h > y && tmpy < y+h)) && --try); if (try) { - fill_rect(&t->real, real.picture, real.format, + fill_rect(&t->out, out.picture, out.format, use_window, tmpx, tmpy, PictOpSrc, x, y, w, h, red, green, blue, alpha); @@ -285,15 +285,15 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/render-copyarea-mask.c xserver-xorg-video-intel-2.99.914/test/render-copyarea-mask.c --- xserver-xorg-video-intel-2.99.910/test/render-copyarea-mask.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/render-copyarea-mask.c 2014-06-21 14:45:39.000000000 +0000 @@ -75,14 +75,14 @@ static void rect_tests(struct test *t, int reps, int sets, enum target target, int use_window) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing area fills (%s, using %s source): ", test_target_name(target), use_window ? "window" : "pixmap"); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); @@ -99,12 +99,12 @@ int try = 50; do { - x = rand() % (real.width - 1); - y = rand() % (real.height - 1); - w = 1 + rand() % (real.width - x - 1); - h = 1 + rand() % (real.height - y - 1); - tmpx = w == real.width ? 0 : rand() % (real.width - w); - tmpy = h == real.height ? 0 : rand() % (real.height - h); + x = rand() % (out.width - 1); + y = rand() % (out.height - 1); + w = 1 + rand() % (out.width - x - 1); + h = 1 + rand() % (out.height - y - 1); + tmpx = w == out.width ? 0 : rand() % (out.width - w); + tmpy = h == out.height ? 0 : rand() % (out.height - h); } while (((tmpx+w > x && tmpx < x+w) || (tmpy+h > y && tmpy < y+h)) && --try); @@ -115,7 +115,7 @@ mask_h = rand() % h; if (try) { - fill_rect(&t->real, real.picture, real.format, + fill_rect(&t->out, out.picture, out.format, use_window, tmpx, tmpy, PictOpSrc, x, y, w, h, mask_x, mask_y, mask_w, mask_h, @@ -129,15 +129,15 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/render-copyarea-size.c xserver-xorg-video-intel-2.99.914/test/render-copyarea-size.c --- xserver-xorg-video-intel-2.99.910/test/render-copyarea-size.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/render-copyarea-size.c 2014-06-21 14:45:39.000000000 +0000 @@ -53,14 +53,14 @@ int main(int argc, char **argv) { struct test test; - struct draw real, ref; + struct draw out, ref; int size, i; test_init(&test, argc, argv); /* Copy back and forth betwenn two pixmaps, gradually getting larger */ for (size = 1; size <= SIZE; size = (size * 3 + 1) / 2) { - target_init(&test.real, &real, size); + target_init(&test.out, &out, size); target_init(&test.ref, &ref, size); printf("size=%d\n", size); @@ -78,10 +78,10 @@ int order = rand() & 1; - XRenderComposite(test.real.dpy, PictOpSrc, - order ? real.pa : real.pb, + XRenderComposite(test.out.dpy, PictOpSrc, + order ? out.pa : out.pb, 0, - (!order) ? real.pa : real.pb, + (!order) ? out.pa : out.pb, sx, sy, 0, 0, dx, dy, @@ -99,17 +99,17 @@ } test_compare(&test, - real.a, real.format, + out.a, out.format, ref.a, ref.format, 0, 0, size, size, ""); test_compare(&test, - real.b, real.format, + out.b, out.format, ref.b, ref.format, 0, 0, size, size, ""); - target_fini(&test.real, &real); + target_fini(&test.out, &out); target_fini(&test.ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/render-fill.c xserver-xorg-video-intel-2.99.914/test/render-fill.c --- xserver-xorg-video-intel-2.99.910/test/render-fill.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/render-fill.c 2014-06-21 14:45:39.000000000 +0000 @@ -31,13 +31,13 @@ { struct test_target tt; XImage image; - uint32_t *cells = malloc(t->real.width*t->real.height*4); + uint32_t *cells = malloc(t->out.width*t->out.height*4); struct { uint16_t x, y; } *pixels = malloc(reps*sizeof(*pixels)); int r, s; - test_target_create_render(&t->real, target, &tt); + test_target_create_render(&t->out, target, &tt); printf("Testing setting of single pixels (%s): ", test_target_name(target)); @@ -52,7 +52,7 @@ int blue = rand() % 0xff; int alpha = rand() % 0xff; - fill_rect(&t->real, tt.picture, PictOpSrc, + fill_rect(&t->out, tt.picture, PictOpSrc, x, y, 1, 1, red, green, blue, alpha); @@ -61,14 +61,14 @@ cells[y*tt.width+x] = color(red, green, blue, alpha); } - test_init_image(&image, &t->real.shm, tt.format, 1, 1); + test_init_image(&image, &t->out.shm, tt.format, 1, 1); for (r = 0; r < reps; r++) { uint32_t result; uint32_t x = pixels[r].x; uint32_t y = pixels[r].y; - XShmGetImage(t->real.dpy, tt.draw, &image, + XShmGetImage(t->out.dpy, tt.draw, &image, x, y, AllPlanes); result = *(uint32_t *)image.data; @@ -85,7 +85,7 @@ } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(pixels); free(cells); } @@ -101,16 +101,16 @@ { struct test_target tt; XImage image; - uint32_t *cells = calloc(sizeof(uint32_t), t->real.width*t->real.height); + uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height); int r, s, x, y; printf("Testing area sets (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &tt); - clear(&t->real, &tt); + test_target_create_render(&t->out, target, &tt); + clear(&t->out, &tt); - test_init_image(&image, &t->real.shm, tt.format, tt.width, tt.height); + test_init_image(&image, &t->out.shm, tt.format, tt.width, tt.height); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { @@ -124,7 +124,7 @@ x = rand() % (2*tt.width) - tt.width; y = rand() % (2*tt.height) - tt.height; - fill_rect(&t->real, tt.picture, PictOpSrc, + fill_rect(&t->out, tt.picture, PictOpSrc, x, y, w, h, red, green, blue, alpha); if (x < 0) @@ -145,7 +145,7 @@ color(red, green, blue, alpha)); } - XShmGetImage(t->real.dpy, tt.draw, &image, 0, 0, AllPlanes); + XShmGetImage(t->out.dpy, tt.draw, &image, 0, 0, AllPlanes); for (y = 0; y < tt.height; y++) { for (x = 0; x < tt.width; x++) { @@ -171,37 +171,37 @@ printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(cells); } static void rect_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing area fills (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; - int w = rand() % real.width; - int h = rand() % real.height; + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; + int w = rand() % out.width; + int h = rand() % out.height; int op = ops[rand() % sizeof(ops)]; int red = rand() % 0xff; int green = rand() % 0xff; int blue = rand() % 0xff; int alpha = rand() % 0xff; - fill_rect(&t->real, real.picture, + fill_rect(&t->out, out.picture, op, x, y, w, h, red, green, blue, alpha); fill_rect(&t->ref, ref.picture, @@ -210,15 +210,15 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/render-fill-copy.c xserver-xorg-video-intel-2.99.914/test/render-fill-copy.c --- xserver-xorg-video-intel-2.99.910/test/render-fill-copy.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/render-fill-copy.c 2014-06-21 14:45:39.000000000 +0000 @@ -57,13 +57,13 @@ { struct test_target tt; XImage image; - uint32_t *cells = malloc(t->real.width*t->real.height*4); + uint32_t *cells = malloc(t->out.width*t->out.height*4); struct { uint16_t x, y; } *pixels = malloc(reps*sizeof(*pixels)); int r, s; - test_target_create_render(&t->real, target, &tt); + test_target_create_render(&t->out, target, &tt); printf("Testing setting of single pixels (%s): ", test_target_name(target)); @@ -78,7 +78,7 @@ int blue = rand() % 0xff; int alpha = rand() % 0xff; - fill_rect(&t->real, tt.picture, tt.format, + fill_rect(&t->out, tt.picture, tt.format, PictOpSrc, x, y, 1, 1, red, green, blue, alpha); @@ -87,14 +87,14 @@ cells[y*tt.width+x] = color(red, green, blue, alpha); } - test_init_image(&image, &t->real.shm, tt.format, 1, 1); + test_init_image(&image, &t->out.shm, tt.format, 1, 1); for (r = 0; r < reps; r++) { uint32_t result; uint32_t x = pixels[r].x; uint32_t y = pixels[r].y; - XShmGetImage(t->real.dpy, tt.draw, &image, + XShmGetImage(t->out.dpy, tt.draw, &image, x, y, AllPlanes); result = *(uint32_t *)image.data; @@ -115,7 +115,7 @@ } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(pixels); free(cells); } @@ -131,16 +131,16 @@ { struct test_target tt; XImage image; - uint32_t *cells = calloc(sizeof(uint32_t), t->real.width*t->real.height); + uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height); int r, s, x, y; printf("Testing area sets (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &tt); - clear(&t->real, &tt); + test_target_create_render(&t->out, target, &tt); + clear(&t->out, &tt); - test_init_image(&image, &t->real.shm, tt.format, tt.width, tt.height); + test_init_image(&image, &t->out.shm, tt.format, tt.width, tt.height); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { @@ -154,7 +154,7 @@ x = rand() % (2*tt.width) - tt.width; y = rand() % (2*tt.height) - tt.height; - fill_rect(&t->real, tt.picture, tt.format, + fill_rect(&t->out, tt.picture, tt.format, PictOpSrc, x, y, w, h, red, green, blue, alpha); @@ -176,7 +176,7 @@ color(red, green, blue, alpha)); } - XShmGetImage(t->real.dpy, tt.draw, &image, 0, 0, AllPlanes); + XShmGetImage(t->out.dpy, tt.draw, &image, 0, 0, AllPlanes); for (y = 0; y < tt.height; y++) { for (x = 0; x < tt.width; x++) { @@ -203,37 +203,37 @@ printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(cells); } static void rect_tests(struct test *t, int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing area fills (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; - int w = rand() % real.width; - int h = rand() % real.height; + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; + int w = rand() % out.width; + int h = rand() % out.height; int op = ops[rand() % sizeof(ops)]; int red = rand() % 0xff; int green = rand() % 0xff; int blue = rand() % 0xff; int alpha = rand() % 0xff; - fill_rect(&t->real, real.picture, real.format, + fill_rect(&t->out, out.picture, out.format, op, x, y, w, h, red, green, blue, alpha); fill_rect(&t->ref, ref.picture, ref.format, @@ -242,15 +242,15 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } diff -Nru xserver-xorg-video-intel-2.99.910/test/render-trapezoid.c xserver-xorg-video-intel-2.99.914/test/render-trapezoid.c --- xserver-xorg-video-intel-2.99.910/test/render-trapezoid.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/render-trapezoid.c 2014-06-21 14:45:39.000000000 +0000 @@ -79,7 +79,7 @@ { struct test_target tt; XImage image; - uint32_t *cells = malloc(t->real.width*t->real.height*4); + uint32_t *cells = malloc(t->out.width*t->out.height*4); struct { uint16_t x, y; } *pixels = malloc(reps*sizeof(*pixels)); @@ -88,7 +88,7 @@ printf("Testing setting of single pixels (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &tt); + test_target_create_render(&t->out, target, &tt); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { @@ -99,24 +99,24 @@ int blue = rand() % 0xff; int alpha = rand() % 0xff; - fill_rect(&t->real, tt.picture, PictOpSrc, + fill_rect(&t->out, tt.picture, PictOpSrc, x, y, 1, 1, 0, 0, MASK_NONE, red, green, blue, alpha); pixels[r].x = x; pixels[r].y = y; - cells[y*t->real.width+x] = color(red, green, blue, alpha); + cells[y*t->out.width+x] = color(red, green, blue, alpha); } - test_init_image(&image, &t->real.shm, tt.format, 1, 1); + test_init_image(&image, &t->out.shm, tt.format, 1, 1); for (r = 0; r < reps; r++) { uint32_t result; uint32_t x = pixels[r].x; uint32_t y = pixels[r].y; - XShmGetImage(t->real.dpy, tt.draw, &image, + XShmGetImage(t->out.dpy, tt.draw, &image, x, y, AllPlanes); result = *(uint32_t *)image.data; @@ -134,7 +134,7 @@ } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(pixels); free(cells); @@ -151,16 +151,16 @@ { struct test_target tt; XImage image; - uint32_t *cells = calloc(sizeof(uint32_t), t->real.width*t->real.height); + uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height); int r, s, x, y; printf("Testing area sets (%s): ", test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &tt); - clear(&t->real, &tt); + test_target_create_render(&t->out, target, &tt); + clear(&t->out, &tt); - test_init_image(&image, &t->real.shm, tt.format, tt.width, tt.height); + test_init_image(&image, &t->out.shm, tt.format, tt.width, tt.height); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { @@ -174,7 +174,7 @@ x = rand() % (2*tt.width) - tt.width; y = rand() % (2*tt.height) - tt.height; - fill_rect(&t->real, tt.picture, PictOpSrc, + fill_rect(&t->out, tt.picture, PictOpSrc, x, y, w, h, 0, 0, MASK_NONE, red, green, blue, alpha); @@ -197,7 +197,7 @@ color(red, green, blue, alpha)); } - XShmGetImage(t->real.dpy, tt.draw, &image, 0, 0, AllPlanes); + XShmGetImage(t->out.dpy, tt.draw, &image, 0, 0, AllPlanes); for (y = 0; y < tt.height; y++) { for (x = 0; x < tt.width; x++) { @@ -221,7 +221,7 @@ printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(cells); } @@ -231,32 +231,32 @@ int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing area fills (offset %dx%d, mask %s) (%s): ", dx, dy, mask_name(mask), test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { - int x = rand() % (2*real.width) - real.width; - int y = rand() % (2*real.height) - real.height; - int w = rand() % real.width; - int h = rand() % real.height; + int x = rand() % (2*out.width) - out.width; + int y = rand() % (2*out.height) - out.height; + int w = rand() % out.width; + int h = rand() % out.height; int op = ops[rand() % sizeof(ops)]; int red = rand() % 0xff; int green = rand() % 0xff; int blue = rand() % 0xff; int alpha = rand() % 0xff; - fill_rect(&t->real, real.picture, op, + fill_rect(&t->out, out.picture, op, x, y, w, h, dx, dy, mask, red, green, blue, alpha); fill_rect(&t->ref, ref.picture, op, @@ -265,15 +265,15 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } @@ -331,7 +331,7 @@ int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; XTrapezoid *traps; int max_traps = 65536; int r, s, n; @@ -346,8 +346,8 @@ test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); @@ -365,20 +365,20 @@ for (n = 0; n < num_traps; n++) random_trapezoid(&traps[n], 0, - 0, 0, real.width, real.height); + 0, 0, out.width, out.height); render_color.red = red * alpha; render_color.green = green * alpha; render_color.blue = blue * alpha; render_color.alpha = alpha << 8; - src = XRenderCreateSolidFill(t->real.dpy, + src = XRenderCreateSolidFill(t->out.dpy, &render_color); - XRenderCompositeTrapezoids(t->real.dpy, - op, src, real.picture, - mask_format(t->real.dpy, mask), + XRenderCompositeTrapezoids(t->out.dpy, + op, src, out.picture, + mask_format(t->out.dpy, mask), 0, 0, traps, num_traps); - XRenderFreePicture(t->real.dpy, src); + XRenderFreePicture(t->out.dpy, src); src = XRenderCreateSolidFill(t->ref.dpy, &render_color); @@ -390,15 +390,15 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); free(traps); } diff -Nru xserver-xorg-video-intel-2.99.910/test/render-trapezoid-image.c xserver-xorg-video-intel-2.99.914/test/render-trapezoid-image.c --- xserver-xorg-video-intel-2.99.910/test/render-trapezoid-image.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/render-trapezoid-image.c 2014-06-21 14:45:39.000000000 +0000 @@ -56,7 +56,7 @@ static void show_cells(char *buf, - const uint32_t *real, const uint32_t *ref, + const uint32_t *out, const uint32_t *ref, int x, int y, int w, int h) { int i, j, len = 0; @@ -69,7 +69,7 @@ if (i < 0 || i >= w) continue; - len += sprintf(buf+len, "%08x ", real[j*w+i]); + len += sprintf(buf+len, "%08x ", out[j*w+i]); } len += sprintf(buf+len, "\t"); @@ -143,7 +143,7 @@ { struct test_target tt; XImage image; - uint32_t *cells = malloc(t->real.width*t->real.height*4); + uint32_t *cells = malloc(t->out.width*t->out.height*4); struct { uint16_t x, y; } *pixels = malloc(reps*sizeof(*pixels)); @@ -154,7 +154,7 @@ use_window ? "window" : "pixmap"); fflush(stdout); - test_target_create_render(&t->real, target, &tt); + test_target_create_render(&t->out, target, &tt); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { @@ -172,8 +172,8 @@ ty = rand() % (tt.height - 1); } while (tx == x && ty == y); - fill_rect(&t->real, tt.picture, - use_window ? t->real.format : tt.format, + fill_rect(&t->out, tt.picture, + use_window ? t->out.format : tt.format, PictOpSrc, x, y, 1, 1, 0, 0, MASK_NONE, use_window, tx, ty, @@ -181,17 +181,17 @@ pixels[r].x = x; pixels[r].y = y; - cells[y*t->real.width+x] = color(red, green, blue, alpha); + cells[y*t->out.width+x] = color(red, green, blue, alpha); } - test_init_image(&image, &t->real.shm, tt.format, 1, 1); + test_init_image(&image, &t->out.shm, tt.format, 1, 1); for (r = 0; r < reps; r++) { uint32_t result; uint32_t x = pixels[r].x; uint32_t y = pixels[r].y; - XShmGetImage(t->real.dpy, tt.draw, &image, + XShmGetImage(t->out.dpy, tt.draw, &image, x, y, AllPlanes); result = *(uint32_t *)image.data; @@ -209,7 +209,7 @@ } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(pixels); free(cells); @@ -265,7 +265,7 @@ { struct test_target tt; XImage image; - uint32_t *cells = calloc(sizeof(uint32_t), t->real.width*t->real.height); + uint32_t *cells = calloc(sizeof(uint32_t), t->out.width*t->out.height); int r, s, x, y; printf("Testing area sets (%s using %s source): ", @@ -273,10 +273,10 @@ use_window ? "window" : "pixmap"); fflush(stdout); - test_target_create_render(&t->real, target, &tt); - clear(&t->real, &tt); + test_target_create_render(&t->out, target, &tt); + clear(&t->out, &tt); - test_init_image(&image, &t->real.shm, tt.format, tt.width, tt.height); + test_init_image(&image, &t->out.shm, tt.format, tt.width, tt.height); for (s = 0; s < sets; s++) { for (r = 0; r < reps; r++) { @@ -308,8 +308,8 @@ tx = ty = 0; } - fill_rect(&t->real, tt.picture, - use_window ? t->real.format : tt.format, + fill_rect(&t->out, tt.picture, + use_window ? t->out.format : tt.format, PictOpSrc, x, y, w, h, 0, 0, MASK_NONE, use_window, tx, ty, @@ -323,7 +323,7 @@ } - XShmGetImage(t->real.dpy, tt.draw, &image, 0, 0, AllPlanes); + XShmGetImage(t->out.dpy, tt.draw, &image, 0, 0, AllPlanes); for (y = 0; y < tt.height; y++) { for (x = 0; x < tt.width; x++) { @@ -351,7 +351,7 @@ printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &tt); + test_target_destroy_render(&t->out, &tt); free(cells); } @@ -362,7 +362,7 @@ enum target target, int use_window) { - struct test_target real, ref; + struct test_target out, ref; int r, s; printf("Testing area fills (offset %dx%d, mask %s) (%s using %s source): ", @@ -370,9 +370,9 @@ use_window ? "window" : "pixmap"); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); - set_mask(&t->real, &real, mask); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); + set_mask(&t->out, &out, mask); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); @@ -389,19 +389,19 @@ int tx, ty, try = 50; do { - x = rand() % (real.width - 1); - y = rand() % (real.height - 1); - w = 1 + rand() % (real.width - x - 1); - h = 1 + rand() % (real.height - y - 1); - tx = w == real.width ? 0 : rand() % (real.width - w); - ty = h == real.height ? 0 : rand() % (real.height - h); + x = rand() % (out.width - 1); + y = rand() % (out.height - 1); + w = 1 + rand() % (out.width - x - 1); + h = 1 + rand() % (out.height - y - 1); + tx = w == out.width ? 0 : rand() % (out.width - w); + ty = h == out.height ? 0 : rand() % (out.height - h); } while (((tx+w > x && tx < x+w) && (ty+h > y && ty < y+h)) && --try); if (try) { - fill_rect(&t->real, real.picture, - use_window ? t->real.format : real.format, + fill_rect(&t->out, out.picture, + use_window ? t->out.format : out.format, op, x, y, w, h, dx, dy, mask, use_window, tx, ty, @@ -416,15 +416,15 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); } @@ -508,7 +508,7 @@ int reps, int sets, enum target target) { - struct test_target real, ref; + struct test_target out, ref; XTrapezoid *traps; int max_traps = 65536; int r, s, n; @@ -523,9 +523,9 @@ test_target_name(target)); fflush(stdout); - test_target_create_render(&t->real, target, &real); - clear(&t->real, &real); - set_mask(&t->real, &real, mask); + test_target_create_render(&t->out, target, &out); + clear(&t->out, &out); + set_mask(&t->out, &out, mask); test_target_create_render(&t->ref, target, &ref); clear(&t->ref, &ref); @@ -539,17 +539,17 @@ int blue = rand() % 0xff; int alpha = rand() % 0xff; int num_traps = rand() % max_traps; - int srcx = rand() % 2*real.width - real.width; - int srcy = rand() % 2*real.height - real.height; - int srcw = rand() % real.width; - int srch = rand() % real.height; + int srcx = rand() % 2*out.width - out.width; + int srcy = rand() % 2*out.height - out.height; + int srcw = rand() % out.width; + int srch = rand() % out.height; for (n = 0; n < num_traps; n++) random_trapezoid(&traps[n], 0, - 0, 0, real.width, real.height); + 0, 0, out.width, out.height); - fill_traps(&t->real, real.picture, real.format, + fill_traps(&t->out, out.picture, out.format, op, traps, num_traps, mask, srcx, srcy, srcw, srch, red, green, blue, alpha); @@ -561,15 +561,15 @@ } test_compare(t, - real.draw, real.format, + out.draw, out.format, ref.draw, ref.format, - 0, 0, real.width, real.height, + 0, 0, out.width, out.height, ""); } printf("passed [%d iterations x %d]\n", reps, sets); - test_target_destroy_render(&t->real, &real); + test_target_destroy_render(&t->out, &out); test_target_destroy_render(&t->ref, &ref); free(traps); } diff -Nru xserver-xorg-video-intel-2.99.910/test/shm-test.c xserver-xorg-video-intel-2.99.914/test/shm-test.c --- xserver-xorg-video-intel-2.99.910/test/shm-test.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/shm-test.c 2014-06-16 06:40:08.000000000 +0000 @@ -0,0 +1,174 @@ +/* + * Copyright (c) 2014 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. + * + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include +#include +#include +#include +#include +#if HAVE_X11_EXTENSIONS_SHMPROTO_H +#include +#elif HAVE_X11_EXTENSIONS_SHMSTR_H +#include +#else +#error Failed to find the right header for X11 MIT-SHM protocol definitions +#endif + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +static int _x_error_occurred; + +static int +can_use_shm(Display *dpy) +{ + int major, minor, has_pixmap; + + if (!XShmQueryExtension(dpy)) + return 0; + + XShmQueryVersion(dpy, &major, &minor, &has_pixmap); + return has_pixmap; +} + +static int test_subpage(Display *dpy) +{ + const int width = 10; + const int height = 10; + uint32_t pixel = 0xffffffff; + char *expected; + XShmSegmentInfo shm; + Pixmap pixmap, source; + XGCValues gcv; + GC gc; + + printf("Creating %dx%d SHM pixmap\n", width, height); + _x_error_occurred = 0; + + expected = malloc(4096); + if (expected == NULL) + return 0; + + shm.shmid = shmget(IPC_PRIVATE, 4096, IPC_CREAT | 0666); + if (shm.shmid == -1) + return 0; + + shm.shmaddr = shmat(shm.shmid, 0, 0); + if (shm.shmaddr == (char *) -1) { + shmctl(shm.shmid, IPC_RMID, NULL); + return 0; + } + + shm.readOnly = False; + XShmAttach(dpy, &shm); + + memset(shm.shmaddr, 0xcc, 4096); + memset(expected, 0xcc, 4096); + memset(expected + 64, 0xff, 4*width * height); + + pixmap = XShmCreatePixmap(dpy, DefaultRootWindow(dpy), + shm.shmaddr + 64, &shm, width, height, 24); + XSync(dpy, False); + shmctl(shm.shmid, IPC_RMID, NULL); + + source = XCreatePixmap(dpy, DefaultRootWindow(dpy), + width, height, 24); + + gcv.graphics_exposures = False; + gcv.subwindow_mode = IncludeInferiors; + gcv.foreground = pixel; + gcv.function = GXcopy; + gcv.fill_style = FillSolid; + gc = XCreateGC(dpy, pixmap, GCGraphicsExposures | GCSubwindowMode | GCFillStyle | GCForeground | GCFunction, &gcv); + + XCopyArea(dpy, pixmap, source, gc, + 0, 0, width, height, 0, 0); + + XFillRectangle(dpy, source, gc, 0, 0, width, height); + + XCopyArea(dpy, source, pixmap, gc, + 0, 0, width, height, 0, 0); + XSync(dpy, True); + + if (_x_error_occurred == 0) + _x_error_occurred = memcmp(shm.shmaddr, expected, 4096); + + printf("%s: %s\n", __func__, _x_error_occurred ? "failed" : "passed"); + + XShmDetach(dpy, &shm); + shmdt(shm.shmaddr); + free(expected); + + + return !_x_error_occurred;; +} + +static int +_check_error_handler(Display *display, + XErrorEvent *event) +{ + printf("X11 error from display %s, serial=%ld, error=%d, req=%d.%d\n", + DisplayString(display), + event->serial, + event->error_code, + event->request_code, + event->minor_code); + _x_error_occurred++; + return False; /* ignored */ +} + +int main(void) +{ + Display *dpy; + int error = 0; + + dpy = XOpenDisplay(NULL); + if (dpy == NULL) + return 77; + + if (DefaultDepth(dpy, DefaultScreen(dpy)) != 24) + return 77; + + if (!can_use_shm(dpy)) + return 0; + + XSetErrorHandler(_check_error_handler); + + error += test_subpage(dpy); + + return !!error; +} diff -Nru xserver-xorg-video-intel-2.99.910/test/test_display.c xserver-xorg-video-intel-2.99.914/test/test_display.c --- xserver-xorg-video-intel-2.99.910/test/test_display.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/test_display.c 2014-07-02 20:23:17.000000000 +0000 @@ -27,7 +27,7 @@ return w; } -static Display *real_display(int argc, char **argv) +static Display *out_display(int argc, char **argv) { Display *dpy; const char *name = NULL; @@ -52,7 +52,7 @@ dpy = XOpenDisplay(name); if (dpy == NULL) - die("unable to open real display %s\n", name); + die("unable to open out display %s\n", name); printf("Opened connection to %s for testing.\n", name); return dpy; @@ -97,10 +97,10 @@ static void shm_setup(struct test_display *d) { - int major, minor, has_pixmaps; + int major, minor; int size; - XShmQueryVersion(d->dpy, &major, &minor, &has_pixmaps); + XShmQueryVersion(d->dpy, &major, &minor, &d->has_shm_pixmaps); if (major == 0 && minor == 0) die("XSHM not supported\n"); @@ -129,24 +129,26 @@ } static void test_get_displays(int argc, char **argv, - struct test_display *real, + struct test_display *out, struct test_display *ref) { - real->dpy = real_display(argc, argv); - default_setup(real); - shm_setup(real); - real->root = get_root(real); + out->dpy = out_display(argc, argv); + default_setup(out); + shm_setup(out); + out->root = get_root(out); + out->target = OUT; - ref->dpy = ref_display(real->width, real->height, real->depth); + ref->dpy = ref_display(out->width, out->height, out->depth); default_setup(ref); shm_setup(ref); ref->root = get_root(ref); + ref->target = REF; } void test_init(struct test *test, int argc, char **argv) { memset(test, 0, sizeof(*test)); - test_get_displays(argc, argv, &test->real, &test->ref); + test_get_displays(argc, argv, &test->out, &test->ref); } void test_timer_start(struct test_display *t, struct timespec *tv) diff -Nru xserver-xorg-video-intel-2.99.910/test/test.h xserver-xorg-video-intel-2.99.914/test/test.h --- xserver-xorg-video-intel-2.99.910/test/test.h 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/test.h 2014-07-02 20:23:17.000000000 +0000 @@ -31,9 +31,11 @@ Window root; XShmSegmentInfo shm; int max_shm_size; + int has_shm_pixmaps; int width, height, depth; XRenderPictFormat *format; - } real, ref; + enum { REF, OUT } target; + } out, ref; }; void die(const char *fmt, ...); @@ -42,8 +44,8 @@ void test_init(struct test *test, int argc, char **argv); -void test_compare(struct test *real, - Drawable real_draw, XRenderPictFormat *real_format, +void test_compare(struct test *out, + Drawable out_draw, XRenderPictFormat *out_format, Drawable ref_draw, XRenderPictFormat *ref_format, int x, int y, int w, int h, const char *info); @@ -52,15 +54,11 @@ static inline int pixel_equal(int depth, uint32_t a, uint32_t b) { - uint32_t mask; - - if (depth == 32) - mask = 0xffffffff; - else - mask = (1 << depth) - 1; - - a &= mask; - b &= mask; + if (depth != 32) { + uint32_t mask = (1 << depth) - 1; + a &= mask; + b &= mask; + } if (a == b) return 1; @@ -120,7 +118,7 @@ #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) #endif +#define SETS(I) ((I) >= 12 ? 1 : 1 << (12 - (I))) #define REPS(I) (1 << (I)) -#define SETS(I) ((I) < 12 ? 1 << (12 - (I)) : 2) #endif diff -Nru xserver-xorg-video-intel-2.99.910/test/test_image.c xserver-xorg-video-intel-2.99.914/test/test_image.c --- xserver-xorg-video-intel-2.99.910/test/test_image.c 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/test/test_image.c 2014-06-21 14:45:39.000000000 +0000 @@ -1,6 +1,7 @@ #include #include #include +#include #include "test.h" @@ -29,7 +30,7 @@ static void show_pixels(char *buf, - const XImage *real, const XImage *ref, + const XImage *out, const XImage *ref, int x, int y, int w, int h) { int i, j, len = 0; @@ -44,9 +45,9 @@ len += sprintf(buf+len, "%08x ", - *(uint32_t*)(real->data + - j*real->bytes_per_line + - i*real->bits_per_pixel/8)); + *(uint32_t*)(out->data + + j*out->bytes_per_line + + i*out->bits_per_pixel/8)); } len += sprintf(buf+len, "\t"); @@ -58,8 +59,8 @@ len += sprintf(buf+len, "%08x ", *(uint32_t*)(ref->data + - j*real->bytes_per_line + - i*real->bits_per_pixel/8)); + j*out->bytes_per_line + + i*out->bits_per_pixel/8)); } len += sprintf(buf+len, "\n"); @@ -67,92 +68,167 @@ } static void test_compare_fallback(struct test *t, - Drawable real_draw, XRenderPictFormat *real_format, + Drawable out_draw, XRenderPictFormat *out_format, Drawable ref_draw, XRenderPictFormat *ref_format, int x, int y, int w, int h) { - XImage *real_image, *ref_image; - char *real, *ref; + XImage *out_image, *ref_image; + char *out, *ref; char buf[600]; uint32_t mask; int i, j; - die_unless(real_format->depth == ref_format->depth); + die_unless(out_format->depth == ref_format->depth); - real_image = XGetImage(t->real.dpy, real_draw, + out_image = XGetImage(t->out.dpy, out_draw, x, y, w, h, AllPlanes, ZPixmap); - real = real_image->data; + out = out_image->data; ref_image = XGetImage(t->ref.dpy, ref_draw, x, y, w, h, AllPlanes, ZPixmap); ref = ref_image->data; - mask = depth_mask(real_image->depth); + mask = depth_mask(out_image->depth); /* Start with an exact comparison. However, one quicky desires * a fuzzy comparator to hide hardware inaccuracies... */ for (j = 0; j < h; j++) { for (i = 0; i < w; i++) { - uint32_t a = ((uint32_t *)real)[i] & mask; + uint32_t a = ((uint32_t *)out)[i] & mask; uint32_t b = ((uint32_t *)ref)[i] & mask; if (a != b && pixel_difference(a, b) > MAX_DELTA) { show_pixels(buf, - real_image, ref_image, + out_image, ref_image, i, j, w, h); die("discrepancy found at (%d+%d, %d+%d): found %08x, expected %08x (delta: %d)\n%s", x,i, y,j, a, b, pixel_difference(a, b), buf); } } - real += real_image->bytes_per_line; + out += out_image->bytes_per_line; ref += ref_image->bytes_per_line; } - XDestroyImage(real_image); + XDestroyImage(out_image); XDestroyImage(ref_image); } +static void +unpremultiply_data (png_structp png, png_row_infop row_info, png_bytep data) +{ + unsigned int i; + + for (i = 0; i < row_info->rowbytes; i += 4) { + uint8_t *b = &data[i]; + uint32_t pixel; + uint8_t alpha; + + memcpy (&pixel, b, sizeof (uint32_t)); + alpha = (pixel & 0xff000000) >> 24; + if (alpha == 0) { + b[0] = (pixel & 0xff0000) >> 16; + b[1] = (pixel & 0x00ff00) >> 8; + b[2] = (pixel & 0x0000ff) >> 0; + b[3] = 0xff; + } else { + b[0] = (((pixel & 0xff0000) >> 16) * 255 + alpha / 2) / alpha; + b[1] = (((pixel & 0x00ff00) >> 8) * 255 + alpha / 2) / alpha; + b[2] = (((pixel & 0x0000ff) >> 0) * 255 + alpha / 2) / alpha; + b[3] = alpha; + } + } +} + +static void save_image(XImage *image, const char *filename) +{ + FILE *file; + png_struct *png = NULL; + png_info *info = NULL; + png_byte **rows = NULL; + int i; + + file = fopen(filename, "w"); + if (file == NULL) + return; + + png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + if (png == NULL) + goto out; + + info = png_create_info_struct(png); + if (info == NULL) + goto out; + + rows = png_malloc(png, sizeof(png_byte *) * image->height); + if (rows == NULL) + goto out; + for (i = 0; i < image->height; i++) + rows[i] = (png_byte *)(image->data + image->bytes_per_line * i); + + if (setjmp(png_jmpbuf(png))) + goto out; + + png_set_IHDR(png, info, + image->width, image->height, 8, + PNG_COLOR_TYPE_RGB_ALPHA, + PNG_INTERLACE_NONE, + PNG_COMPRESSION_TYPE_DEFAULT, + PNG_FILTER_TYPE_DEFAULT); + + png_init_io(png, file); + png_write_info(png, info); + png_set_write_user_transform_fn(png, unpremultiply_data); + png_write_image(png, rows); + png_write_end(png, info); + +out: + if (rows) + png_free(png, rows); + png_destroy_write_struct(&png, &info); + fclose(file); +} + void test_compare(struct test *t, - Drawable real_draw, XRenderPictFormat *real_format, + Drawable out_draw, XRenderPictFormat *out_format, Drawable ref_draw, XRenderPictFormat *ref_format, int x, int y, int w, int h, const char *info) { - XImage real_image, ref_image; + XImage out_image, ref_image; Pixmap tmp; - char *real, *ref; + char *out, *ref; char buf[600]; uint32_t mask; int i, j; XGCValues gcv; GC gc; - if (w * h * 4 > t->real.max_shm_size) + if (w * h * 4 > t->out.max_shm_size) return test_compare_fallback(t, - real_draw, real_format, + out_draw, out_format, ref_draw, ref_format, x, y, w, h); - test_init_image(&real_image, &t->real.shm, real_format, w, h); + test_init_image(&out_image, &t->out.shm, out_format, w, h); test_init_image(&ref_image, &t->ref.shm, ref_format, w, h); gcv.graphics_exposures = 0; - die_unless(real_image.depth == ref_image.depth); - die_unless(real_image.bits_per_pixel == ref_image.bits_per_pixel); - die_unless(real_image.bits_per_pixel == 32); - - mask = depth_mask(real_image.depth); - - tmp = XCreatePixmap(t->real.dpy, real_draw, w, h, real_image.depth); - gc = XCreateGC(t->real.dpy, tmp, GCGraphicsExposures, &gcv); - XCopyArea(t->real.dpy, real_draw, tmp, gc, x, y, w, h, 0, 0); - XShmGetImage(t->real.dpy, tmp, &real_image, 0, 0, AllPlanes); - XFreeGC(t->real.dpy, gc); - XFreePixmap(t->real.dpy, tmp); - real = real_image.data; + die_unless(out_image.depth == ref_image.depth); + die_unless(out_image.bits_per_pixel == ref_image.bits_per_pixel); + die_unless(out_image.bits_per_pixel == 32); + + mask = depth_mask(out_image.depth); + + tmp = XCreatePixmap(t->out.dpy, out_draw, w, h, out_image.depth); + gc = XCreateGC(t->out.dpy, tmp, GCGraphicsExposures, &gcv); + XCopyArea(t->out.dpy, out_draw, tmp, gc, x, y, w, h, 0, 0); + XShmGetImage(t->out.dpy, tmp, &out_image, 0, 0, AllPlanes); + XFreeGC(t->out.dpy, gc); + XFreePixmap(t->out.dpy, tmp); + out = out_image.data; tmp = XCreatePixmap(t->ref.dpy, ref_draw, w, h, ref_image.depth); gc = XCreateGC(t->ref.dpy, tmp, GCGraphicsExposures, &gcv); @@ -167,17 +243,19 @@ */ for (j = 0; j < h; j++) { for (i = 0; i < w; i++) { - uint32_t a = ((uint32_t *)real)[i] & mask; + uint32_t a = ((uint32_t *)out)[i] & mask; uint32_t b = ((uint32_t *)ref)[i] & mask; if (a != b && pixel_difference(a, b) > MAX_DELTA) { show_pixels(buf, - &real_image, &ref_image, + &out_image, &ref_image, i, j, w, h); + save_image(&out_image, "out.png"); + save_image(&ref_image, "ref.png"); die("discrepancy found at (%d+%d, %d+%d): found %08x, expected %08x (delta: %d)\n%s%s\n", x,i, y,j, a, b, pixel_difference(a, b), buf, info); } } - real += real_image.bytes_per_line; + out += out_image.bytes_per_line; ref += ref_image.bytes_per_line; } } diff -Nru xserver-xorg-video-intel-2.99.910/tools/backlight_helper.c xserver-xorg-video-intel-2.99.914/tools/backlight_helper.c --- xserver-xorg-video-intel-2.99.910/tools/backlight_helper.c 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/tools/backlight_helper.c 2014-07-17 20:26:45.000000000 +0000 @@ -0,0 +1,58 @@ +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define DBG 0 + +#if defined(__GNUC__) && (__GNUC__ > 3) +__attribute__((format(printf, 1, 2), noreturn)) +#endif +static void die(const char *format, ...) +{ + if (DBG) { + va_list args; + + va_start(args, format); + vfprintf(stderr, format, args); + va_end(args); + } + + exit(1); +} + +int main(int argc, char *argv[]) +{ + struct stat st; + char buf[1024]; + int len, fd; + + if (argc != 2) + die("Usage: xf86-video-intel-backlight-helper \n"); + + if (strchr(argv[1], '/') != NULL) + die("Invalid interface '%s': contains '/'\n", argv[1]); + + if (snprintf(buf, sizeof(buf), + "/sys/class/backlight/%s/brightness", + argv[1]) >= sizeof(buf)) + die("Invalid interface '%s': name too long\n", argv[1]); + + fd = open(buf, O_RDWR); + if (fd < 0 || fstat(fd, &st) || major(st.st_dev)) + die("Invalid interface '%s': unknown backlight file\n", argv[1]); + + while (fgets(buf, sizeof(buf), stdin)) { + len = strlen(buf); + if (write(fd, buf, len) != len) + die("Failed to update backlight interface '%s': errno=%d\n", argv[1], errno); + } + + return 0; +} diff -Nru xserver-xorg-video-intel-2.99.910/tools/intel-virtual-output.man xserver-xorg-video-intel-2.99.914/tools/intel-virtual-output.man --- xserver-xorg-video-intel-2.99.910/tools/intel-virtual-output.man 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/tools/intel-virtual-output.man 2014-06-25 10:44:53.000000000 +0000 @@ -17,7 +17,7 @@ The xf86-video-intel driver is part of the X.Org and Freedesktop.org umbrella projects. Details on bug reporting can be found at -http://www.intellinuxgraphics.org/how_to_report_bug.html. Mailing +https://01.org/linuxgraphics/documentation/how-report-bugs. Mailing lists are also commonly used to report experiences and ask questions about configuration and other topics. See lists.freedesktop.org for more information (the xorg@lists.freedesktop.org mailing list is the diff -Nru xserver-xorg-video-intel-2.99.910/tools/Makefile.am xserver-xorg-video-intel-2.99.914/tools/Makefile.am --- xserver-xorg-video-intel-2.99.910/tools/Makefile.am 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/tools/Makefile.am 2014-05-14 13:42:31.000000000 +0000 @@ -20,23 +20,44 @@ AM_CFLAGS = \ @CWARNFLAGS@ \ - $(TOOL_CFLAGS) \ @NOWARNFLAGS@ \ $(NULL) drivermandir = $(DRIVER_MAN_DIR) +policydir = $(datarootdir)/polkit-1/actions +if BUILD_TOOLS bin_PROGRAMS = intel-virtual-output driverman_DATA = intel-virtual-output.$(DRIVER_MAN_SUFFIX) +endif +if BUILD_BACKLIGHT_HELPER +libexec_PROGRAMS = xf86-video-intel-backlight-helper +nodist_policy_DATA = org.x.xf86-video-intel.backlight-helper.policy + +backlight_helper = $(libexecdir)/xf86-video-intel-backlight-helper +install-exec-hook: + -chown root $(DESTDIR)$(backlight_helper) && chmod u+s $(DESTDIR)$(backlight_helper) +endif + +intel_virtual_output_CFLAGS = \ + @CWARNFLAGS@ \ + $(IVO_CFLAGS) \ + @NOWARNFLAGS@ \ + $(NULL) intel_virtual_output_SOURCES = \ virtual.c \ $(NULL) +intel_virtual_output_LDADD = \ + $(IVO_LIBS) \ + $(NULL) -intel_virtual_output_LDADD = $(TOOL_LIBS) +xf86_video_intel_backlight_helper_SOURCES = \ + backlight_helper.c \ + $(NULL) -EXTRA_DIST = intel-virtual-output.man -CLEANFILES = $(driverman_DATA) +EXTRA_DIST = intel-virtual-output.man org.x.xf86-video-intel.backlight-helper.policy.in +CLEANFILES = $(driverman_DATA) $(nodist_policy_DATA) # String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man diff -Nru xserver-xorg-video-intel-2.99.910/tools/Makefile.in xserver-xorg-video-intel-2.99.914/tools/Makefile.in --- xserver-xorg-video-intel-2.99.910/tools/Makefile.in 2014-02-10 09:34:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/tools/Makefile.in 2014-07-23 15:44:38.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -37,6 +36,51 @@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -55,9 +99,12 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -bin_PROGRAMS = intel-virtual-output$(EXEEXT) +@BUILD_TOOLS_TRUE@bin_PROGRAMS = intel-virtual-output$(EXEEXT) +@BUILD_BACKLIGHT_HELPER_TRUE@libexec_PROGRAMS = xf86-video-intel-backlight-helper$(EXEEXT) subdir = tools -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(srcdir)/org.x.xf86-video-intel.backlight-helper.policy.in \ + $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -67,17 +114,41 @@ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = org.x.xf86-video-intel.backlight-helper.policy CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(drivermandir)" -PROGRAMS = $(bin_PROGRAMS) -am_intel_virtual_output_OBJECTS = virtual.$(OBJEXT) +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \ + "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(policydir)" +PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) +am_intel_virtual_output_OBJECTS = \ + intel_virtual_output-virtual.$(OBJEXT) intel_virtual_output_OBJECTS = $(am_intel_virtual_output_OBJECTS) am__DEPENDENCIES_1 = intel_virtual_output_DEPENDENCIES = $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = +intel_virtual_output_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ + $(intel_virtual_output_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +am_xf86_video_intel_backlight_helper_OBJECTS = \ + backlight_helper.$(OBJEXT) +xf86_video_intel_backlight_helper_OBJECTS = \ + $(am_xf86_video_intel_backlight_helper_OBJECTS) +xf86_video_intel_backlight_helper_LDADD = $(LDADD) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -90,22 +161,25 @@ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -SOURCES = $(intel_virtual_output_SOURCES) -DIST_SOURCES = $(intel_virtual_output_SOURCES) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(intel_virtual_output_SOURCES) \ + $(xf86_video_intel_backlight_helper_SOURCES) +DIST_SOURCES = $(intel_virtual_output_SOURCES) \ + $(xf86_video_intel_backlight_helper_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -133,7 +207,24 @@ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } -DATA = $(driverman_DATA) +DATA = $(driverman_DATA) $(nodist_policy_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -166,6 +257,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -194,8 +287,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -234,23 +332,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -311,19 +410,34 @@ top_srcdir = @top_srcdir@ AM_CFLAGS = \ @CWARNFLAGS@ \ - $(TOOL_CFLAGS) \ @NOWARNFLAGS@ \ $(NULL) drivermandir = $(DRIVER_MAN_DIR) -driverman_DATA = intel-virtual-output.$(DRIVER_MAN_SUFFIX) +policydir = $(datarootdir)/polkit-1/actions +@BUILD_TOOLS_TRUE@driverman_DATA = intel-virtual-output.$(DRIVER_MAN_SUFFIX) +@BUILD_BACKLIGHT_HELPER_TRUE@nodist_policy_DATA = org.x.xf86-video-intel.backlight-helper.policy +@BUILD_BACKLIGHT_HELPER_TRUE@backlight_helper = $(libexecdir)/xf86-video-intel-backlight-helper +intel_virtual_output_CFLAGS = \ + @CWARNFLAGS@ \ + $(IVO_CFLAGS) \ + @NOWARNFLAGS@ \ + $(NULL) + intel_virtual_output_SOURCES = \ virtual.c \ $(NULL) -intel_virtual_output_LDADD = $(TOOL_LIBS) -EXTRA_DIST = intel-virtual-output.man -CLEANFILES = $(driverman_DATA) +intel_virtual_output_LDADD = \ + $(IVO_LIBS) \ + $(NULL) + +xf86_video_intel_backlight_helper_SOURCES = \ + backlight_helper.c \ + $(NULL) + +EXTRA_DIST = intel-virtual-output.man org.x.xf86-video-intel.backlight-helper.policy.in +CLEANFILES = $(driverman_DATA) $(nodist_policy_DATA) # String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man @@ -361,16 +475,23 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +org.x.xf86-video-intel.backlight-helper.policy: $(top_builddir)/config.status $(srcdir)/org.x.xf86-video-intel.backlight-helper.policy.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) - test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ + fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p || test -f $$p1; \ - then echo "$$p"; echo "$$p"; else :; fi; \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ @@ -391,7 +512,8 @@ @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ + -e 's/$$/$(EXEEXT)/' \ + `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files @@ -404,9 +526,63 @@ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list +install-libexecPROGRAMS: $(libexec_PROGRAMS) + @$(NORMAL_INSTALL) + @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libexecdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libexecdir)" || exit 1; \ + fi; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p \ + || test -f $$p1 \ + ; then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' \ + -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(libexecdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(libexecdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-libexecPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(libexec_PROGRAMS)'; test -n "$(libexecdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' \ + `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(libexecdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(libexecdir)" && rm -f $$files + +clean-libexecPROGRAMS: + @list='$(libexec_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list + intel-virtual-output$(EXEEXT): $(intel_virtual_output_OBJECTS) $(intel_virtual_output_DEPENDENCIES) $(EXTRA_intel_virtual_output_DEPENDENCIES) @rm -f intel-virtual-output$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(intel_virtual_output_OBJECTS) $(intel_virtual_output_LDADD) $(LIBS) + $(AM_V_CCLD)$(intel_virtual_output_LINK) $(intel_virtual_output_OBJECTS) $(intel_virtual_output_LDADD) $(LIBS) + +xf86-video-intel-backlight-helper$(EXEEXT): $(xf86_video_intel_backlight_helper_OBJECTS) $(xf86_video_intel_backlight_helper_DEPENDENCIES) $(EXTRA_xf86_video_intel_backlight_helper_DEPENDENCIES) + @rm -f xf86-video-intel-backlight-helper$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xf86_video_intel_backlight_helper_OBJECTS) $(xf86_video_intel_backlight_helper_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -414,21 +590,22 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/virtual.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/backlight_helper.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/intel_virtual_output-virtual.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -437,6 +614,20 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< +intel_virtual_output-virtual.o: virtual.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(intel_virtual_output_CFLAGS) $(CFLAGS) -MT intel_virtual_output-virtual.o -MD -MP -MF $(DEPDIR)/intel_virtual_output-virtual.Tpo -c -o intel_virtual_output-virtual.o `test -f 'virtual.c' || echo '$(srcdir)/'`virtual.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/intel_virtual_output-virtual.Tpo $(DEPDIR)/intel_virtual_output-virtual.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='virtual.c' object='intel_virtual_output-virtual.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(intel_virtual_output_CFLAGS) $(CFLAGS) -c -o intel_virtual_output-virtual.o `test -f 'virtual.c' || echo '$(srcdir)/'`virtual.c + +intel_virtual_output-virtual.obj: virtual.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(intel_virtual_output_CFLAGS) $(CFLAGS) -MT intel_virtual_output-virtual.obj -MD -MP -MF $(DEPDIR)/intel_virtual_output-virtual.Tpo -c -o intel_virtual_output-virtual.obj `if test -f 'virtual.c'; then $(CYGPATH_W) 'virtual.c'; else $(CYGPATH_W) '$(srcdir)/virtual.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/intel_virtual_output-virtual.Tpo $(DEPDIR)/intel_virtual_output-virtual.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='virtual.c' object='intel_virtual_output-virtual.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(intel_virtual_output_CFLAGS) $(CFLAGS) -c -o intel_virtual_output-virtual.obj `if test -f 'virtual.c'; then $(CYGPATH_W) 'virtual.c'; else $(CYGPATH_W) '$(srcdir)/virtual.c'; fi` + mostlyclean-libtool: -rm -f *.lo @@ -444,8 +635,11 @@ -rm -rf .libs _libs install-drivermanDATA: $(driverman_DATA) @$(NORMAL_INSTALL) - test -z "$(drivermandir)" || $(MKDIR_P) "$(DESTDIR)$(drivermandir)" @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(drivermandir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(drivermandir)" || exit 1; \ + fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ @@ -460,27 +654,37 @@ @list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir) +install-nodist_policyDATA: $(nodist_policy_DATA) + @$(NORMAL_INSTALL) + @list='$(nodist_policy_DATA)'; test -n "$(policydir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(policydir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(policydir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(policydir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(policydir)" || exit $$?; \ + done -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +uninstall-nodist_policyDATA: + @$(NORMAL_UNINSTALL) + @list='$(nodist_policy_DATA)'; test -n "$(policydir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(policydir)'; $(am__uninstall_files_from_dir) -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -492,15 +696,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -509,6 +709,21 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -547,7 +762,7 @@ check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(drivermandir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(policydir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -581,9 +796,11 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." +@BUILD_BACKLIGHT_HELPER_FALSE@install-exec-hook: clean: clean-am -clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \ + clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -603,14 +820,15 @@ info-am: -install-data-am: install-drivermanDATA +install-data-am: install-drivermanDATA install-nodist_policyDATA install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS - +install-exec-am: install-binPROGRAMS install-libexecPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am install-html-am: @@ -649,25 +867,31 @@ ps-am: -uninstall-am: uninstall-binPROGRAMS uninstall-drivermanDATA +uninstall-am: uninstall-binPROGRAMS uninstall-drivermanDATA \ + uninstall-libexecPROGRAMS uninstall-nodist_policyDATA -.MAKE: install-am install-strip +.MAKE: install-am install-exec-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ - clean-generic clean-libtool ctags distclean distclean-compile \ - distclean-generic distclean-libtool distclean-tags distdir dvi \ - dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am \ - install-drivermanDATA install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS \ - uninstall-drivermanDATA +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ + clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \ + clean-libtool cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-binPROGRAMS install-data \ + install-data-am install-drivermanDATA install-dvi \ + install-dvi-am install-exec install-exec-am install-exec-hook \ + install-html install-html-am install-info install-info-am \ + install-libexecPROGRAMS install-man install-nodist_policyDATA \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-drivermanDATA \ + uninstall-libexecPROGRAMS uninstall-nodist_policyDATA +@BUILD_BACKLIGHT_HELPER_TRUE@install-exec-hook: +@BUILD_BACKLIGHT_HELPER_TRUE@ -chown root $(DESTDIR)$(backlight_helper) && chmod u+s $(DESTDIR)$(backlight_helper) .man.$(DRIVER_MAN_SUFFIX): $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@ diff -Nru xserver-xorg-video-intel-2.99.910/tools/org.x.xf86-video-intel.backlight-helper.policy.in xserver-xorg-video-intel-2.99.914/tools/org.x.xf86-video-intel.backlight-helper.policy.in --- xserver-xorg-video-intel-2.99.910/tools/org.x.xf86-video-intel.backlight-helper.policy.in 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/tools/org.x.xf86-video-intel.backlight-helper.policy.in 2014-04-09 17:41:18.000000000 +0000 @@ -0,0 +1,19 @@ + + + + The X.Org project + https://01.org/linuxgraphics/community/xf86-video-intel + brightness + + Modify lcd panel brightness + Authentication is required to modify the lcd panel brightness + + no + no + yes + + @LIBEXEC_PATH@/xf86-video-intel-backlight-helper + + diff -Nru xserver-xorg-video-intel-2.99.910/tools/virtual.c xserver-xorg-video-intel-2.99.914/tools/virtual.c --- xserver-xorg-video-intel-2.99.910/tools/virtual.c 2014-02-01 18:48:34.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/tools/virtual.c 2014-07-22 08:12:01.000000000 +0000 @@ -40,7 +40,10 @@ #error Failed to find the right header for X11 MIT-SHM protocol definitions #endif #include +#if HAVE_X11_EXTENSIONS_XINERAMA_H #include +#define USE_XINERAMA +#endif #include #include #include @@ -65,13 +68,18 @@ #include #include -#if 0 -#define DBG(x) printf x -#else -#define DBG(x) -#endif - #define FORCE_FULL_REDRAW 0 +#define FORCE_16BIT_XFER 0 + +#define DBG(v, x) if (verbose & v) printf x +static int verbose; +#define X11 0x1 +#define XRR 0x1 +#define TIMER 0x4 +#define DRAW 0x8 +#define DAMAGE 0x10 +#define CURSOR 0x20 +#define POLL 0x40 struct display { Display *dpy; @@ -82,10 +90,10 @@ int xfixes_event, xfixes_error; int rr_event, rr_error, rr_active; int xinerama_event, xinerama_error, xinerama_active; + int dri3_active; Window root; Visual *visual; Damage damage; - long timestamp; int width; int height; @@ -154,6 +162,11 @@ int width, height, depth; struct { int x1, x2, y1, y2; } damaged; int rr_update; + + struct dri3_fence { + XID xid; + void *addr; + } dri3; }; struct context { @@ -169,6 +182,9 @@ int timer_active; + long timestamp; + long configTimestamp; + Atom singleton; char command[1024]; int command_continuation; @@ -205,7 +221,7 @@ _check_error_handler(Display *display, XErrorEvent *event) { - DBG(("X11 error from display %s, serial=%ld, error=%d, req=%d.%d\n", + DBG(X11, ("X11 error from display %s, serial=%ld, error=%d, req=%d.%d\n", DisplayString(display), event->serial, event->error_code, @@ -300,6 +316,143 @@ return has_shm; } +#ifdef DRI3 +#include +#include +#include +#include +#include +static Pixmap dri3_create_pixmap(Display *dpy, + Drawable draw, + int width, int height, int depth, + int fd, int bpp, int stride, int size) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + xcb_pixmap_t pixmap = xcb_generate_id(c); + xcb_dri3_pixmap_from_buffer(c, pixmap, draw, size, width, height, stride, depth, bpp, fd); + return pixmap; +} + +static int dri3_create_fd(Display *dpy, + Pixmap pixmap, + int *stride) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + xcb_dri3_buffer_from_pixmap_cookie_t cookie; + xcb_dri3_buffer_from_pixmap_reply_t *reply; + + cookie = xcb_dri3_buffer_from_pixmap(c, pixmap); + reply = xcb_dri3_buffer_from_pixmap_reply(c, cookie, NULL); + if (!reply) + return -1; + + if (reply->nfd != 1) + return -1; + + *stride = reply->stride; + return xcb_dri3_buffer_from_pixmap_reply_fds(c, reply)[0]; +} + +static int dri3_query_version(Display *dpy, int *major, int *minor) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + xcb_dri3_query_version_reply_t *reply; + + *major = *minor = -1; + + reply = xcb_dri3_query_version_reply(c, + xcb_dri3_query_version(c, + XCB_DRI3_MAJOR_VERSION, + XCB_DRI3_MINOR_VERSION), + NULL); + if (reply == NULL) + return -1; + + *major = reply->major_version; + *minor = reply->minor_version; + free(reply); + + return 0; +} + +static int dri3_exists(Display *dpy) +{ + int major, minor; + + if (dri3_query_version(dpy, &major, &minor) < 0) + return 0; + + return major >= 0; +} + +static void dri3_create_fence(Display *dpy, Drawable d, struct dri3_fence *fence) +{ + xcb_connection_t *c = XGetXCBConnection(dpy); + struct dri3_fence f; + int fd; + + fd = xshmfence_alloc_shm(); + if (fd < 0) + return; + + f.addr = xshmfence_map_shm(fd); + if (f.addr == NULL) { + close(fd); + return; + } + + f.xid = xcb_generate_id(c); + xcb_dri3_fence_from_fd(c, d, f.xid, 0, fd); + + *fence = f; +} + +static void dri3_fence_flush(Display *dpy, struct dri3_fence *fence) +{ + xcb_sync_trigger_fence(XGetXCBConnection(dpy), fence->xid); +} + +static void dri3_fence_free(Display *dpy, struct dri3_fence *fence) +{ + xshmfence_unmap_shm(fence->addr); + xcb_sync_destroy_fence(XGetXCBConnection(dpy), fence->xid); +} + +#else + +static int dri3_exists(Display *dpy) +{ + return 0; +} + +static void dri3_create_fence(Display *dpy, Drawable d, struct dri3_fence *fence) +{ +} + +static void dri3_fence_flush(Display *dpy, struct dri3_fence *fence) +{ +} + +static void dri3_fence_free(Display *dpy, struct dri3_fence *fence) +{ +} + +static Pixmap dri3_create_pixmap(Display *dpy, + Drawable draw, + int width, int height, int depth, + int fd, int bpp, int stride, int size) +{ + return None; +} + +static int dri3_create_fd(Display *dpy, + Pixmap pixmap, + int *stride) +{ + return -1; +} +#endif + static int timerfd(int hz) { struct itimerspec it; @@ -356,7 +509,7 @@ { uint64_t count; - DBG(("%s timer active? %d\n", __func__, ctx->timer_active)); + DBG(TIMER, ("%s timer active? %d\n", __func__, ctx->timer_active)); if (ctx->timer_active) return; @@ -388,7 +541,7 @@ static void display_mark_flush(struct display *display) { - DBG(("%s mark flush (flush=%d)\n", + DBG(DRAW, ("%s mark flush (flush=%d)\n", DisplayString(display->dpy), display->flush)); if (display->flush) @@ -442,6 +595,46 @@ } } +static int disable_crtc(Display *dpy, XRRScreenResources *res, RRCrtc crtc) +{ + XRRPanning panning; + + if (crtc) { + XRRSetPanning(dpy, res, crtc, memset(&panning, 0, sizeof(panning))); + + if (XRRSetCrtcConfig(dpy, res, crtc, CurrentTime, 0, 0, None, RR_Rotate_0, NULL, 0) != Success) + return 0; + + if (XRRSetPanning(dpy, res, crtc, memset(&panning, 0, sizeof(panning))) != Success) { + DBG(XRR, ("%s failed to clear panning on CRTC:%ld\n", DisplayString(dpy), (long)crtc)); + if (verbose) { + XRRCrtcInfo *c; + XRRPanning *p; + + c = XRRGetCrtcInfo(dpy, res, crtc); + if (c) { + DBG(XRR, ("%s CRTC:%ld x=%d, y=%d, rotation=%d, mode=%ld\n", + DisplayString(dpy), (long)crtc, + c->x, c->y, c->rotation, c->mode)); + XRRFreeCrtcInfo(c); + } + + p = XRRGetPanning(dpy, res, crtc); + if (p) { + DBG(XRR, ("%s CRTC:%ld panning (%d, %d)x(%d, %d), tracking (%d, %d)x(%d, %d), border (%d, %d),(%d, %d)\n", + DisplayString(dpy), (long)crtc, + p->left, p->top, p->width, p->height, + p->track_left, p->track_top, p->track_width, p->track_height, + p->border_left, p->border_top, p->border_right, p->border_bottom)); + XRRFreePanning(p); + } + } + } + } + + return 1; +} + static int clone_update_modes__randr(struct clone *clone) { XRRScreenResources *from_res = NULL, *to_res = NULL; @@ -452,7 +645,7 @@ assert(clone->dst.rr_output); assert(clone->dst.display->rr_event); - from_res = XRRGetScreenResources(clone->dst.dpy, clone->dst.window); + from_res = _XRRGetScreenResourcesCurrent(clone->dst.dpy, clone->dst.window); if (from_res == NULL) goto err; @@ -460,11 +653,10 @@ if (from_info == NULL) goto err; - DBG(("%s(%s-%s): timestamp %ld (last %ld)\n", __func__, + DBG(XRR, ("%s(%s-%s <- %s-%s): timestamp %ld (last %ld)\n", __func__, DisplayString(clone->src.dpy), clone->src.name, - from_info->timestamp, clone->timestamp)); - if (from_info->timestamp == clone->timestamp) - goto err; + DisplayString(clone->dst.dpy), clone->dst.name, + from_info->timestamp, clone->timestamp)); to_res = _XRRGetScreenResourcesCurrent(clone->src.dpy, clone->src.window); if (to_res == NULL) @@ -474,6 +666,8 @@ if (to_info == NULL) goto err; + DBG(XRR, ("%s: dst.rr_crtc=%ld, now %ld\n", + __func__, (long)clone->dst.rr_crtc, (long)from_info->crtc)); if (clone->dst.rr_crtc == from_info->crtc) { for (i = 0; i < to_info->nmode; i++) { XRRModeInfo *mode, *old; @@ -481,6 +675,11 @@ mode = lookup_mode(to_res, to_info->modes[i]); if (mode == NULL) break; + + DBG(XRR, ("%s(%s-%s): lookup mode %s\n", __func__, + DisplayString(clone->src.dpy), clone->src.name, + mode->name)); + for (j = 0; j < from_info->nmode; j++) { old = lookup_mode(from_res, from_info->modes[j]); if (old && mode_equal(mode, old)) { @@ -488,35 +687,56 @@ break; } } - if (mode) + if (mode) { + DBG(XRR, ("%s(%s-%s): unknown mode %s\n", __func__, + DisplayString(clone->src.dpy), clone->src.name, + mode->name)); break; + } } if (i == from_info->nmode && i == to_info->nmode) { - DBG(("%s(%s-%s): no change in output\n", __func__, + DBG(XRR, ("%s(%s-%s): no change in output\n", __func__, DisplayString(clone->src.dpy), clone->src.name)); goto done; } } - clone->dst.rr_crtc = from_info->crtc; + /* Disable the remote output */ + if (from_info->crtc != clone->dst.rr_crtc) { + DBG(XRR, ("%s(%s-%s): disabling active CRTC\n", __func__, + DisplayString(clone->dst.dpy), clone->dst.name)); + if (disable_crtc(clone->dst.dpy, from_res, from_info->crtc)) { + clone->dst.rr_crtc = 0; + clone->dst.mode.id = 0; + } else { + XRRCrtcInfo *c = XRRGetCrtcInfo(clone->dst.dpy, from_res, from_info->crtc); + if (c) { + clone->dst.x = c->x; + clone->dst.y = c->y; + clone->dst.rotation = c->rotation; + clone->dst.mode.id = c->mode; + XRRFreeCrtcInfo(c); + } + } + } + + /* Create matching modes for the real output on the virtual */ + XGrabServer(clone->src.dpy); /* Clear all current UserModes on the output, including any active ones */ if (to_info->crtc) { - DBG(("%s(%s-%s): disabling active CRTC\n", __func__, + DBG(XRR, ("%s(%s-%s): disabling active CRTC\n", __func__, DisplayString(clone->src.dpy), clone->src.name)); - XRRSetCrtcConfig(clone->src.dpy, to_res, to_info->crtc, CurrentTime, - 0, 0, None, RR_Rotate_0, NULL, 0); + disable_crtc(clone->src.dpy, to_res, to_info->crtc); } for (i = 0; i < to_info->nmode; i++) { - DBG(("%s(%s-%s): deleting mode %ld\n", __func__, + DBG(XRR, ("%s(%s-%s): deleting mode %ld\n", __func__, DisplayString(clone->src.dpy), clone->src.name, (long)to_info->modes[i])); XRRDeleteOutputMode(clone->src.dpy, clone->src.rr_output, to_info->modes[i]); } clone->src.rr_crtc = 0; - /* Create matching modes for the real output on the virtual */ - XGrabServer(clone->src.dpy); for (i = 0; i < from_info->nmode; i++) { XRRModeInfo *mode, *old; RRMode id; @@ -539,7 +759,7 @@ old = &to_res->modes[j]; if (mode_equal(mode, old)) { id = old->id; - DBG(("%s(%s-%s): reusing mode %ld: %s\n", __func__, + DBG(XRR, ("%s(%s-%s): reusing mode %ld: %s\n", __func__, DisplayString(clone->src.dpy), clone->src.name, id, mode->name)); break; } @@ -555,7 +775,7 @@ m.name = buf; id = XRRCreateMode(clone->src.dpy, clone->src.window, &m); - DBG(("%s(%s-%s): adding mode %ld: %s\n", __func__, + DBG(XRR, ("%s(%s-%s): adding mode %ld: %s\n", __func__, DisplayString(clone->src.dpy), clone->src.name, id, mode->name)); } @@ -603,13 +823,12 @@ /* Clear all current UserModes on the output, including any active ones */ if (info->crtc) { - DBG(("%s(%s-%s): disabling active CRTC\n", __func__, + DBG(XRR, ("%s(%s-%s): disabling active CRTC\n", __func__, DisplayString(clone->src.dpy), clone->src.name)); - XRRSetCrtcConfig(clone->src.dpy, res, info->crtc, CurrentTime, - 0, 0, None, RR_Rotate_0, NULL, 0); + disable_crtc(clone->src.dpy, res, info->crtc); } for (i = 0; i < info->nmode; i++) { - DBG(("%s(%s-%s): deleting mode %ld\n", __func__, + DBG(XRR, ("%s(%s-%s): deleting mode %ld\n", __func__, DisplayString(clone->src.dpy), clone->src.name, (long)info->modes[i])); XRRDeleteOutputMode(clone->src.dpy, clone->src.rr_output, info->modes[i]); } @@ -657,7 +876,7 @@ RROutput rr_output = 0; int i; - DBG(("%s(%d)\n", __func__, nclone)); + DBG(X11, ("%s(%d)\n", __func__, nclone)); XGrabServer(dpy); res = _XRRGetScreenResourcesCurrent(dpy, display->root); @@ -682,7 +901,7 @@ } XRRFreeScreenResources(res); - DBG(("%s(%s): rr_output=%ld\n", __func__, output_name, (long)rr_output)); + DBG(XRR, ("%s(%s): rr_output=%ld\n", __func__, output_name, (long)rr_output)); if (rr_output == 0) goto out; @@ -705,9 +924,7 @@ /* Some else may have interrupted us and installed that new mode! */ output = XRRGetOutputInfo(dpy, res, rr_output); if (output) { - if (output->crtc) - XRRSetCrtcConfig(dpy, res, output->crtc, CurrentTime, - 0, 0, None, RR_Rotate_0, NULL, 0); + disable_crtc(dpy, res, output->crtc); XRRFreeOutputInfo(output); } XRRFreeScreenResources(res); @@ -715,6 +932,10 @@ XRRDeleteOutputMode(dpy, rr_output, id); XRRDestroyMode(dpy, id); + /* And hide it again */ + res = XRRGetScreenResources(dpy, display->root); + if (res != NULL) + XRRFreeScreenResources(res); out: XUngrabServer(dpy); @@ -795,10 +1016,11 @@ static void output_init_xfer(struct clone *clone, struct output *output) { - if (output->use_shm_pixmap) { - DBG(("%s-%s: creating shm pixmap\n", DisplayString(output->dpy), output->name)); - if (output->pixmap) - XFreePixmap(output->dpy, output->pixmap); + if (output->pixmap == None && output->use_shm_pixmap) { + DBG(DRAW, ("%s-%s: creating shm pixmap\n", DisplayString(output->dpy), output->name)); + XSync(output->dpy, False); + _x_error_occurred = 0; + output->pixmap = XShmCreatePixmap(output->dpy, output->window, clone->shm.shmaddr, &output->shm, clone->width, clone->height, clone->depth); @@ -806,9 +1028,16 @@ XRenderFreePicture(output->dpy, output->pix_picture); output->pix_picture = None; } + + XSync(output->dpy, False); + if (_x_error_occurred) { + XFreePixmap(output->dpy, output->pixmap); + output->pixmap = None; + output->use_shm_pixmap = 0; + } } if (output->use_render) { - DBG(("%s-%s: creating picture\n", DisplayString(output->dpy), output->name)); + DBG(DRAW, ("%s-%s: creating picture\n", DisplayString(output->dpy), output->name)); if (output->win_picture == None) output->win_picture = XRenderCreatePicture(output->dpy, output->window, output->display->root_format, 0, NULL); @@ -823,6 +1052,8 @@ if (output->gc == None) { XGCValues gcv; + DBG(DRAW, ("%s-%s: creating gc\n", DisplayString(output->dpy), output->name)); + gcv.graphics_exposures = False; gcv.subwindow_mode = IncludeInferiors; @@ -830,76 +1061,145 @@ } } +static int bpp_for_depth(int depth) +{ + switch (depth) { + case 1: return 1; + case 8: return 8; + case 15: return 16; + case 16: return 16; + case 24: return 24; + case 32: return 32; + default: return 0; + } +} + static int clone_init_xfer(struct clone *clone) { int width, height; - if (clone->src.mode.id == 0) { - if (clone->width == 0 && clone->height == 0) - return 0; - + if (clone->dst.mode.id == 0) { clone->width = 0; clone->height = 0; + } else if (clone->dri3.xid) { + width = clone->dst.display->width; + height = clone->dst.display->height; + } else { + width = mode_width(&clone->src.mode, clone->src.rotation); + height = mode_height(&clone->src.mode, clone->src.rotation); + } + + if (width == clone->width && height == clone->height) + return 0; + DBG(DRAW, ("%s-%s create xfer, %dx%d\n", + DisplayString(clone->dst.dpy), clone->dst.name, + width, height)); + + if (clone->shm.shmaddr) { if (clone->src.use_shm) XShmDetach(clone->src.dpy, &clone->src.shm); if (clone->dst.use_shm) XShmDetach(clone->dst.dpy, &clone->dst.shm); - if (clone->shm.shmaddr) { - shmdt(clone->shm.shmaddr); - clone->shm.shmaddr = 0; - } + shmdt(clone->shm.shmaddr); + clone->shm.shmaddr = NULL; + } + + if (clone->src.pixmap) { + XFreePixmap(clone->src.dpy, clone->src.pixmap); + clone->src.pixmap = 0; + } + if (clone->dst.pixmap) { + XFreePixmap(clone->dst.dpy, clone->dst.pixmap); + clone->dst.pixmap = 0; + } + + if ((width | height) == 0) { clone->damaged.x2 = clone->damaged.y2 = INT_MIN; clone->damaged.x1 = clone->damaged.y1 = INT_MAX; return 0; } - width = mode_width(&clone->src.mode, clone->src.rotation); - height = mode_height(&clone->src.mode, clone->src.rotation); + if (clone->dri3.xid) { + int fd, stride; + Pixmap src; + + _x_error_occurred = 0; + + DBG(DRAW, ("%s-%s create xfer, trying DRI3\n", + DisplayString(clone->dst.dpy), clone->dst.name)); + + fd = dri3_create_fd(clone->dst.dpy, clone->dst.window, &stride); + if (fd < 0) + goto disable_dri3; + + DBG(DRAW, ("%s-%s create xfer, DRI3 fd=%d, stride=%d\n", + DisplayString(clone->dst.dpy), clone->dst.name, + fd, stride)); + + src = dri3_create_pixmap(clone->src.dpy, clone->src.window, + width, height, clone->depth, + fd, bpp_for_depth(clone->depth), + stride, lseek(fd, 0, SEEK_END)); - if (width == clone->width && height == clone->height) - return 0; - - DBG(("%s-%s create xfer, %dx%d\n", - DisplayString(clone->dst.dpy), clone->dst.name, - width, height)); + XSync(clone->src.dpy, False); + if (!_x_error_occurred) { + clone->src.pixmap = src; + clone->width = width; + clone->height = height; + } else { + XFreePixmap(clone->src.dpy, src); + close(fd); +disable_dri3: + dri3_fence_free(clone->src.dpy, &clone->dri3); + clone->dri3.xid = 0; - clone->width = width; - clone->height = height; + DBG(DRAW, ("%s-%s create xfer, DRI3 failed\n", + DisplayString(clone->dst.dpy), clone->dst.name)); + } + } - if (clone->shm.shmaddr) - shmdt(clone->shm.shmaddr); + width = mode_width(&clone->src.mode, clone->src.rotation); + height = mode_height(&clone->src.mode, clone->src.rotation); - clone->shm.shmid = shmget(IPC_PRIVATE, - height * stride_for_depth(width, clone->depth), - IPC_CREAT | 0666); - if (clone->shm.shmid == -1) - return errno; + if (!clone->dri3.xid) { + DBG(DRAW, ("%s-%s create xfer, trying SHM\n", + DisplayString(clone->dst.dpy), clone->dst.name)); + + clone->shm.shmid = shmget(IPC_PRIVATE, + height * stride_for_depth(width, clone->depth), + IPC_CREAT | 0666); + if (clone->shm.shmid == -1) + return errno; + + clone->shm.shmaddr = shmat(clone->shm.shmid, 0, 0); + if (clone->shm.shmaddr == (char *) -1) { + shmctl(clone->shm.shmid, IPC_RMID, NULL); + return ENOMEM; + } + + if (clone->src.use_shm) { + clone->src.shm = clone->shm; + clone->src.shm.readOnly = False; + XShmAttach(clone->src.dpy, &clone->src.shm); + XSync(clone->src.dpy, False); + } + if (clone->dst.use_shm) { + clone->dst.shm = clone->shm; + clone->dst.shm.readOnly = !clone->dst.use_shm_pixmap; + XShmAttach(clone->dst.dpy, &clone->dst.shm); + XSync(clone->dst.dpy, False); + } - clone->shm.shmaddr = shmat(clone->shm.shmid, 0, 0); - if (clone->shm.shmaddr == (char *) -1) { shmctl(clone->shm.shmid, IPC_RMID, NULL); - return ENOMEM; - } - init_image(clone); + clone->width = width; + clone->height = height; - if (clone->src.use_shm) { - clone->src.shm = clone->shm; - clone->dst.shm.readOnly = False; - XShmAttach(clone->src.dpy, &clone->src.shm); - XSync(clone->src.dpy, False); + init_image(clone); } - if (clone->dst.use_shm) { - clone->dst.shm = clone->shm; - clone->dst.shm.readOnly = True; - XShmAttach(clone->dst.dpy, &clone->dst.shm); - XSync(clone->dst.dpy, False); - } - - shmctl(clone->shm.shmid, IPC_RMID, NULL); output_init_xfer(clone, &clone->src); output_init_xfer(clone, &clone->dst); @@ -918,7 +1218,7 @@ if (!clone->rr_update) return; - DBG(("%s-%s cloning modes\n", + DBG(X11, ("%s-%s cloning modes\n", DisplayString(clone->dst.dpy), clone->dst.name)); clone_update_modes__randr(clone); @@ -932,20 +1232,26 @@ int context_changed = 0; int i, n; - DBG(("%s\n", __func__)); + DBG(X11, ("%s\n", __func__)); res = _XRRGetScreenResourcesCurrent(dpy, ctx->display->root); if (res == NULL) return 0; - DBG(("%s timestamp %ld (last %ld)\n", DisplayString(dpy), res->timestamp, ctx->display->timestamp)); - if (res->timestamp == ctx->display->timestamp && + DBG(XRR, ("%s timestamp %ld (last %ld), config %ld (last %ld)\n", + DisplayString(dpy), + res->timestamp, ctx->timestamp, + res->configTimestamp, ctx->configTimestamp)); + if (res->timestamp == ctx->timestamp && + res->configTimestamp == ctx->configTimestamp && res->timestamp != res->configTimestamp) { /* mutter be damned */ XRRFreeScreenResources(res); return 0; } - ctx->display->timestamp = res->timestamp; + ctx->timestamp = res->timestamp; + ctx->configTimestamp = res->configTimestamp; + for (n = 0; n < ctx->nclone; n++) { struct output *output = &ctx->clones[n].src; XRROutputInfo *o; @@ -961,12 +1267,12 @@ if (o->crtc) c = XRRGetCrtcInfo(dpy, res, o->crtc); if (c) { - DBG(("%s-%s: (x=%d, y=%d, rotation=%d, mode=%ld) -> (x=%d, y=%d, rotation=%d, mode=%ld)\n", + DBG(XRR, ("%s-%s: (x=%d, y=%d, rotation=%d, mode=%ld) -> (x=%d, y=%d, rotation=%d, mode=%ld)\n", DisplayString(dpy), output->name, output->x, output->y, output->rotation, output->mode.id, c->x, c->y, c->rotation, c->mode)); - changed |= output->rotation |= c->rotation; + changed |= output->rotation != c->rotation; output->rotation = c->rotation; changed |= output->x != c->x; @@ -975,17 +1281,20 @@ changed |= output->y != c->y; output->y = c->y; - changed |= output->mode.id != mode; + changed |= output->mode.id != c->mode; mode = c->mode; XRRFreeCrtcInfo(c); } else { - DBG(("%s-%s: (x=%d, y=%d, rotation=%d, mode=%ld) -> off\n", + DBG(XRR, ("%s-%s: (x=%d, y=%d, rotation=%d, mode=%ld) -> off\n", DisplayString(dpy), output->name, output->x, output->y, output->rotation, output->mode.id)); } output->rr_crtc = o->crtc; XRRFreeOutputInfo(o); + DBG(XRR, ("%s-%s crtc changed? %d\n", + DisplayString(ctx->clones[n].dst.display->dpy), ctx->clones[n].dst.name, changed)); + if (mode) { if (output->mode.id != mode) { for (i = 0; i < res->nmode; i++) { @@ -1000,16 +1309,14 @@ output->mode.id = 0; } - DBG(("%s-%s changed? %d\n", + DBG(XRR, ("%s-%s output changed? %d\n", DisplayString(ctx->clones[n].dst.display->dpy), ctx->clones[n].dst.name, changed)); - if (changed) - clone_init_xfer(&ctx->clones[n]); context_changed |= changed; } XRRFreeScreenResources(res); - DBG(("%s changed? %d\n", DisplayString(dpy), context_changed)); + DBG(XRR, ("%s changed? %d\n", DisplayString(dpy), context_changed)); if (!context_changed) return 0; @@ -1033,7 +1340,7 @@ if (output->mode.id == 0) continue; - DBG(("%s: source %s enabled (%d, %d)x(%d, %d)\n", + DBG(XRR, ("%s: source %s enabled (%d, %d)x(%d, %d)\n", DisplayString(clone->dst.dpy), output->name, output->x, output->y, mode_width(&output->mode, output->rotation), @@ -1052,18 +1359,36 @@ y2 = v; } - x2 -= x1; - y2 -= y1; - DBG(("%s fb bounds (%d, %d)x(%d, %d)\n", DisplayString(display->dpy), + DBG(XRR, ("%s fb bounds (%d, %d)x(%d, %d)\n", DisplayString(display->dpy), x1, y1, x2, y2)); + XGrabServer(display->dpy); res = _XRRGetScreenResourcesCurrent(display->dpy, display->root); if (res == NULL) - continue; + goto ungrab; - XGrabServer(display->dpy); + if (x2 <= x1 || y2 <= y1) { + /* Nothing enabled, preserve the current fb, and turn everything off */ + for (clone = display->clone; clone; clone = clone->next) { + struct output *dst = &clone->dst; + + if (!dst->rr_crtc) + continue; + + DBG(XRR, ("%s: disabling output '%s'\n", + DisplayString(display->dpy), dst->name)); + assert(clone->dst.display == display); + if (disable_crtc(display->dpy, res, dst->rr_crtc)) { + dst->rr_crtc = 0; + dst->mode.id = 0; + } + } + goto free_res; + } - DBG(("%s: current size %dx%d, need %dx%d\n", + x2 -= x1; + y2 -= y1; + DBG(XRR, ("%s: current size %dx%d, need %dx%d\n", DisplayString(display->dpy), display->width, display->height, x2, y2)); @@ -1076,15 +1401,16 @@ if (!dst->rr_crtc) continue; - DBG(("%s: disabling output '%s'\n", - DisplayString(dst->dpy), dst->name)); - XRRSetCrtcConfig(dst->dpy, res, dst->rr_crtc, CurrentTime, - 0, 0, None, RR_Rotate_0, NULL, 0); - dst->rr_crtc = 0; - dst->mode.id = 0; + DBG(XRR, ("%s: disabling output '%s'\n", + DisplayString(display->dpy), dst->name)); + assert(clone->dst.display == display); + if (disable_crtc(display->dpy, res, dst->rr_crtc)) { + dst->rr_crtc = 0; + dst->mode.id = 0; + } } - DBG(("%s: XRRSetScreenSize %dx%d\n", DisplayString(display->dpy), x2, y2)); + DBG(XRR, ("%s: XRRSetScreenSize %dx%d\n", DisplayString(display->dpy), x2, y2)); XRRSetScreenSize(display->dpy, display->root, x2, y2, x2 * 96 / 25.4, y2 * 96 / 25.4); display->width = x2; display->height = y2; @@ -1099,20 +1425,21 @@ RRCrtc rr_crtc; Status ret; - DBG(("%s: copying configuration from %s (mode=%ld: %s) to %s\n", - DisplayString(dst->dpy), - src->name, (long)src->mode.id, src->mode.name, + DBG(XRR, ("%s: copying configuration from %s (mode=%ld: %dx%d) to %s\n", + DisplayString(display->dpy), + src->name, (long)src->mode.id, src->mode.width, src->mode.height, dst->name)); if (src->mode.id == 0) { err: if (dst->rr_crtc) { - DBG(("%s: disabling unused output '%s'\n", - DisplayString(dst->dpy), dst->name)); - XRRSetCrtcConfig(dst->dpy, res, dst->rr_crtc, CurrentTime, - 0, 0, None, RR_Rotate_0, NULL, 0); - dst->rr_crtc = 0; - dst->mode.id = 0; + DBG(XRR, ("%s: disabling unused output '%s'\n", + DisplayString(display->dpy), dst->name)); + assert(clone->dst.display == display); + if (disable_crtc(display->dpy, res, dst->rr_crtc)) { + dst->rr_crtc = 0; + dst->mode.id = 0; + } } continue; } @@ -1137,19 +1464,24 @@ /* XXX User names must be unique! */ m = src->mode; m.nameLength = snprintf(buf, sizeof(buf), - "%s.%ld-%s", src->name, (long)src->mode.id, src->mode.name); + "%s.%ld-%dx%d", src->name, + (long)src->mode.id, + src->mode.width, + src->mode.height); m.name = buf; id = XRRCreateMode(dst->dpy, dst->window, &m); if (id) { - DBG(("%s: adding mode %ld: %s to %s\n", + DBG(XRR, ("%s: adding mode %ld: %dx%d to %s, new mode %ld\n", DisplayString(dst->dpy), - (long)id, src->mode.name, - dst->name)); + (long)src->mode.id, + src->mode.width, + src->mode.height, + dst->name, (long)id)); XRRAddOutputMode(dst->dpy, dst->rr_output, id); dst->mode.id = id; } else { - DBG(("%s: failed to find suitable mode for %s\n", + DBG(XRR, ("%s: failed to find suitable mode for %s\n", DisplayString(dst->dpy), dst->name)); goto err; } @@ -1159,7 +1491,7 @@ if (rr_crtc) { for (set = display->clone; set != clone; set = set->next) { if (set->dst.rr_crtc == rr_crtc) { - DBG(("%s: CRTC reassigned from %s\n", + DBG(XRR, ("%s: CRTC reassigned from %s\n", DisplayString(dst->dpy), dst->name)); rr_crtc = 0; break; @@ -1169,11 +1501,11 @@ if (rr_crtc == 0) { o = XRRGetOutputInfo(dst->dpy, res, dst->rr_output); for (i = 0; i < o->ncrtc; i++) { - DBG(("%s: checking whether CRTC:%ld is available\n", + DBG(XRR, ("%s: checking whether CRTC:%ld is available\n", DisplayString(dst->dpy), (long)o->crtcs[i])); for (set = display->clone; set != clone; set = set->next) { if (set->dst.rr_crtc == o->crtcs[i]) { - DBG(("%s: CRTC:%ld already assigned to %s\n", + DBG(XRR, ("%s: CRTC:%ld already assigned to %s\n", DisplayString(dst->dpy), (long)o->crtcs[i], set->dst.name)); break; } @@ -1186,41 +1518,70 @@ XRRFreeOutputInfo(o); } if (rr_crtc == 0) { - DBG(("%s: failed to find available CRTC for %s\n", + DBG(XRR, ("%s: failed to find available CRTC for %s\n", DisplayString(dst->dpy), dst->name)); goto err; } - DBG(("%s: enabling output '%s' (%d,%d)x(%d,%d), rotation %d, on CRTC:%ld, using mode %ld\n", + DBG(XRR, ("%s: enabling output '%s' (%d,%d)x(%d,%d), rotation %d, on CRTC:%ld, using mode %ld\n", DisplayString(dst->dpy), dst->name, dst->x, dst->y, dst->mode.width, dst->mode.height, dst->rotation, (long)rr_crtc, dst->mode.id)); + ret = XRRSetPanning(dst->dpy, res, rr_crtc, memset(&panning, 0, sizeof(panning))); + DBG(XRR, ("%s-%s: XRRSetPanning %s\n", DisplayString(dst->dpy), dst->name, ret ? "failed" : "success")); + (void)ret; + ret = XRRSetCrtcConfig(dst->dpy, res, rr_crtc, CurrentTime, dst->x, dst->y, dst->mode.id, dst->rotation, &dst->rr_output, 1); - DBG(("%s-%s: XRRSetCrtcConfig %s\n", DisplayString(dst->dpy), dst->name, ret ? "failed" : "success")); + DBG(XRR, ("%s-%s: XRRSetCrtcConfig %s\n", DisplayString(dst->dpy), dst->name, ret ? "failed" : "success")); if (ret) goto err; - ret = XRRSetPanning(dst->dpy, res, rr_crtc, memset(&panning, 0, sizeof(panning))); - DBG(("%s-%s: XRRSetPanning %s\n", DisplayString(dst->dpy), dst->name, ret ? "failed" : "success")); + if (verbose & XRR) { + XRRCrtcInfo *c; + XRRPanning *p; + + c = XRRGetCrtcInfo(dst->dpy, res, rr_crtc); + if (c) { + DBG(XRR, ("%s-%s: x=%d, y=%d, rotation=%d, mode=%ld\n", + DisplayString(dst->dpy), dst->name, + c->x, c->y, c->rotation, c->mode)); + XRRFreeCrtcInfo(c); + } + + p = XRRGetPanning(dst->dpy, res, rr_crtc); + if (p) { + DBG(XRR, ("%s-%s: panning (%d, %d)x(%d, %d), tracking (%d, %d)x(%d, %d), border (%d, %d),(%d, %d)\n", + DisplayString(dst->dpy), dst->name, + p->left, p->top, p->width, p->height, + p->track_left, p->track_top, p->track_width, p->track_height, + p->border_left, p->border_top, p->border_right, p->border_bottom)); + XRRFreePanning(p); + } + } dst->rr_crtc = rr_crtc; - (void)ret; } - XUngrabServer(display->dpy); - +free_res: XRRFreeScreenResources(res); +ungrab: + XUngrabServer(display->dpy); } ctx->active = NULL; for (n = 0; n < ctx->nclone; n++) { struct clone *clone = &ctx->clones[n]; + clone_init_xfer(clone); + if (clone->dst.rr_crtc == 0) continue; + DBG(XRR, ("%s-%s: added to active list\n", + DisplayString(clone->dst.display->dpy), clone->dst.name)); + clone->active = ctx->active; ctx->active = clone; } @@ -1239,7 +1600,7 @@ static Cursor display_get_visible_cursor(struct display *display) { if (display->cursor_serial != display->cursor_image.size) { - DBG(("%s updating cursor\n", DisplayString(display->dpy))); + DBG(CURSOR, ("%s updating cursor\n", DisplayString(display->dpy))); if (display->visible_cursor) XFreeCursor(display->dpy, display->visible_cursor); @@ -1276,7 +1637,7 @@ while (n--) *dst++ = *src++; - DBG(("%s marking cursor changed\n", DisplayString(display->dpy))); + DBG(CURSOR, ("%s marking cursor changed\n", DisplayString(display->dpy))); display->cursor_moved++; if (display->cursor != display->invisible_cursor) { display->cursor_visible++; @@ -1286,7 +1647,7 @@ static void display_cursor_move(struct display *display, int x, int y, int visible) { - DBG(("%s cursor moved (visible=%d, (%d, %d))\n", + DBG(CURSOR, ("%s cursor moved (visible=%d, (%d, %d))\n", DisplayString(display->dpy), visible, x, y)); display->cursor_moved++; display->cursor_visible += visible; @@ -1314,7 +1675,7 @@ y = display->cursor_y++ & 31; } - DBG(("%s setting cursor position (%d, %d), visible? %d\n", + DBG(CURSOR, ("%s setting cursor position (%d, %d), visible? %d\n", DisplayString(display->dpy), x, y, display->cursor_visible)); XWarpPointer(display->dpy, None, display->root, 0, 0, 0, 0, x, y); @@ -1338,7 +1699,7 @@ { int visible; - DBG(("%s-%s moving cursor (%d, %d) [(%d, %d), (%d, %d)]\n", + DBG(CURSOR, ("%s-%s moving cursor (%d, %d) [(%d, %d), (%d, %d)]\n", DisplayString(c->dst.dpy), c->dst.name, x, y, c->src.x, c->src.y, @@ -1360,7 +1721,7 @@ Display *dpy = display->dpy; int depth; - DBG(("%s(%s, %s)\n", __func__, DisplayString(dpy), name)); + DBG(X11, ("%s(%s, %s)\n", __func__, DisplayString(dpy), name)); output->name = strdup(name); if (output->name == NULL) @@ -1376,10 +1737,10 @@ output->use_shm = display->has_shm; output->use_shm_pixmap = display->has_shm_pixmap; - DBG(("%s-%s use shm? %d (use shm pixmap? %d)\n", + DBG(X11, ("%s-%s use shm? %d (use shm pixmap? %d)\n", DisplayString(dpy), name, display->has_shm, display->has_shm_pixmap)); - depth = output->use_shm ? display->depth : 16; + depth = output->use_shm && !FORCE_16BIT_XFER ? display->depth : 16; if (depth < clone->depth) clone->depth = depth; @@ -1395,7 +1756,7 @@ static void get_src(struct clone *c, const XRectangle *clip) { - DBG(("%s-%s get_src(%d,%d)x(%d,%d)\n", DisplayString(c->dst.dpy), c->dst.name, + DBG(DRAW,("%s-%s get_src(%d,%d)x(%d,%d)\n", DisplayString(c->dst.dpy), c->dst.name, clip->x, clip->y, clip->width, clip->height)); c->image.obdata = (char *)&c->src.shm; @@ -1442,17 +1803,17 @@ static void put_dst(struct clone *c, const XRectangle *clip) { - DBG(("%s-%s put_dst(%d,%d)x(%d,%d)\n", DisplayString(c->dst.dpy), c->dst.name, + DBG(DRAW, ("%s-%s put_dst(%d,%d)x(%d,%d)\n", DisplayString(c->dst.dpy), c->dst.name, clip->x, clip->y, clip->width, clip->height)); c->image.obdata = (char *)&c->dst.shm; if (c->dst.use_render) { if (c->dst.use_shm_pixmap) { - DBG(("%s-%s using SHM pixmap composite\n", + DBG(DRAW, ("%s-%s using SHM pixmap composite\n", DisplayString(c->dst.dpy), c->dst.name)); } else if (c->dst.use_shm) { - DBG(("%s-%s using SHM image composite\n", + DBG(DRAW, ("%s-%s using SHM image composite\n", DisplayString(c->dst.dpy), c->dst.name)); XShmPutImage(c->dst.dpy, c->dst.pixmap, c->dst.gc, &c->image, 0, 0, @@ -1460,7 +1821,7 @@ clip->width, clip->height, False); } else { - DBG(("%s-%s using composite\n", + DBG(DRAW, ("%s-%s using composite\n", DisplayString(c->dst.dpy), c->dst.name)); XPutImage(c->dst.dpy, c->dst.pixmap, c->dst.gc, &c->image, 0, 0, @@ -1477,7 +1838,7 @@ clip->width, clip->height); c->dst.display->send |= c->dst.use_shm; } else if (c->dst.pixmap) { - DBG(("%s-%s using SHM pixmap\n", + DBG(DRAW, ("%s-%s using SHM pixmap\n", DisplayString(c->dst.dpy), c->dst.name)); c->dst.serial = NextRequest(c->dst.dpy); XCopyArea(c->dst.dpy, c->dst.pixmap, c->dst.window, c->dst.gc, @@ -1486,7 +1847,7 @@ clip->x, clip->y); c->dst.display->send = 1; } else if (c->dst.use_shm) { - DBG(("%s-%s using SHM image\n", + DBG(DRAW, ("%s-%s using SHM image\n", DisplayString(c->dst.dpy), c->dst.name)); c->dst.serial = NextRequest(c->dst.dpy); XShmPutImage(c->dst.dpy, c->dst.window, c->dst.gc, &c->image, @@ -1495,7 +1856,7 @@ clip->width, clip->height, True); } else { - DBG(("%s-%s using image\n", + DBG(DRAW, ("%s-%s using image\n", DisplayString(c->dst.dpy), c->dst.name)); XPutImage(c->dst.dpy, c->dst.window, c->dst.gc, &c->image, 0, 0, @@ -1503,15 +1864,13 @@ clip->width, clip->height); c->dst.serial = 0; } - - display_mark_flush(c->dst.display); } static int clone_paint(struct clone *c) { XRectangle clip; - DBG(("%s-%s paint clone, damaged (%d, %d), (%d, %d) [(%d, %d), (%d, %d)]\n", + DBG(DRAW, ("%s-%s paint clone, damaged (%d, %d), (%d, %d) [(%d, %d), (%d, %d)]\n", DisplayString(c->dst.dpy), c->dst.name, c->damaged.x1, c->damaged.y1, c->damaged.x2, c->damaged.y2, @@ -1532,7 +1891,7 @@ if (c->damaged.y2 <= c->damaged.y1) goto done; - DBG(("%s-%s is damaged, last SHM serial: %ld, now %ld\n", + DBG(DRAW, ("%s-%s is damaged, last SHM serial: %ld, now %ld\n", DisplayString(c->dst.dpy), c->dst.name, (long)c->dst.serial, (long)LastKnownRequestProcessed(c->dst.dpy))); if (c->dst.serial > LastKnownRequestProcessed(c->dst.dpy)) { @@ -1559,15 +1918,37 @@ c->damaged.y2 = c->src.y + c->height; } - clip.x = c->damaged.x1; - clip.y = c->damaged.y1; - clip.width = c->damaged.x2 - c->damaged.x1; - clip.height = c->damaged.y2 - c->damaged.y1; - get_src(c, &clip); - - clip.x += c->dst.x - c->src.x; - clip.y += c->dst.y - c->src.y; - put_dst(c, &clip); + if (c->dri3.xid) { + if (c->src.use_render) { + XRenderComposite(c->src.dpy, PictOpSrc, + c->src.win_picture, 0, c->src.pix_picture, + c->damaged.x1, c->damaged.y1, + 0, 0, + c->damaged.x1 + c->dst.x - c->src.x, + c->damaged.y1 + c->dst.y - c->src.y, + c->damaged.x2 - c->damaged.x1, + c->damaged.y2 - c->damaged.y1); + } else { + XCopyArea(c->src.dpy, c->src.window, c->src.pixmap, c->src.gc, + c->damaged.x1, c->damaged.y1, + c->damaged.x2 - c->damaged.x1, + c->damaged.y2 - c->damaged.y1, + c->damaged.x1 + c->dst.x - c->src.x, + c->damaged.y1 + c->dst.y - c->src.y); + } + dri3_fence_flush(c->src.dpy, &c->dri3); + } else { + clip.x = c->damaged.x1; + clip.y = c->damaged.y1; + clip.width = c->damaged.x2 - c->damaged.x1; + clip.height = c->damaged.y2 - c->damaged.y1; + get_src(c, &clip); + + clip.x += c->dst.x - c->src.x; + clip.y += c->dst.y - c->src.y; + put_dst(c, &clip); + } + display_mark_flush(c->dst.display); done: c->damaged.x2 = c->damaged.y2 = INT_MIN; @@ -1577,31 +1958,49 @@ static void clone_damage(struct clone *c, const XRectangle *rec) { - if (rec->x < c->damaged.x1) - c->damaged.x1 = rec->x; - if (rec->x + rec->width > c->damaged.x2) - c->damaged.x2 = rec->x + rec->width; - if (rec->y < c->damaged.y1) - c->damaged.y1 = rec->y; - if (rec->y + rec->height > c->damaged.y2) - c->damaged.y2 = rec->y + rec->height; + int v; + + if ((v = rec->x) < c->damaged.x1) + c->damaged.x1 = v; + if ((v = (int)rec->x + rec->width) > c->damaged.x2) + c->damaged.x2 = v; + if ((v = rec->y) < c->damaged.y1) + c->damaged.y1 = v; + if ((v = (int)rec->y + rec->height) > c->damaged.y2) + c->damaged.y2 = v; + + DBG(DAMAGE, ("%s-%s damaged: (%d, %d), (%d, %d)\n", + DisplayString(c->dst.display->dpy), c->dst.name, + c->damaged.x1, c->damaged.y1, + c->damaged.x2, c->damaged.y2)); } static void usage(const char *arg0) { - printf("usage: %s [-d ] [-b] []...\n", arg0); + printf("Usage: %s [OPTION]... [TARGET_DISPLAY]...\n", arg0); + printf(" -d source display\n"); + printf(" -f keep in foreground (do not detach from console and daemonize)\n"); + printf(" -b start bumblebee\n"); + printf(" -a connect to all local displays (e.g. :1, :2, etc)\n"); + printf(" -S disable use of a singleton and launch a fresh intel-virtual-output process\n"); + printf(" -v all verbose output, implies -f\n"); + printf(" -V specific verbose output, implies -f\n"); + printf(" -h this help\n"); + printf("If no target displays are parsed on the commandline, \n"); + printf("intel-virtual-output will attempt to connect to any local display\n"); + printf("and then start bumblebee.\n"); } static void record_callback(XPointer closure, XRecordInterceptData *data) { struct context *ctx = (struct context *)closure; - DBG(("%s\n", __func__)); + DBG(X11, ("%s\n", __func__)); if (data->category == XRecordFromServer) { const xEvent *e = (const xEvent *)data->data; - DBG(("%s -- from server, event type %d, root %ld (ours? %d)\n", + DBG(X11, ("%s -- from server, event type %d, root %ld (ours? %d)\n", __func__, e->u.u.type, (long)e->u.keyButtonPointer.root, ctx->display->root == e->u.keyButtonPointer.root)); @@ -1626,7 +2025,7 @@ XRecordClientSpec rcs; XRecordContext rc; - DBG(("%s(%s)\n", __func__, DisplayString(ctx->display->dpy))); + DBG(X11, ("%s(%s)\n", __func__, DisplayString(ctx->display->dpy))); dpy = XOpenDisplay(DisplayString(ctx->display->dpy)); if (dpy == NULL) @@ -1652,7 +2051,7 @@ static int bad_visual(Visual *visual, int depth) { - DBG(("%s? depth=%d, visual: class=%d, bits_per_rgb=%d, red_mask=%08lx, green_mask=%08lx, blue_mask=%08lx\n", + DBG(X11, ("%s? depth=%d, visual: class=%d, bits_per_rgb=%d, red_mask=%08lx, green_mask=%08lx, blue_mask=%08lx\n", __func__, depth, visual->class, visual->bits_per_rgb, @@ -1691,7 +2090,7 @@ tmpl.depth = PIXMAN_FORMAT_DEPTH(format); mask = PictFormatType | PictFormatDepth; - DBG(("%s(0x%08lx)\n", __func__, (long)format)); + DBG(X11, ("%s(0x%08lx)\n", __func__, (long)format)); switch (PIXMAN_FORMAT_TYPE(format)) { case PIXMAN_TYPE_ARGB: @@ -1798,7 +2197,7 @@ Display *dpy = display->dpy; int major, minor; - DBG(("%s is depth %d, want %d\n", DisplayString(dpy), display->depth, depth)); + DBG(X11, ("%s is depth %d, want %d\n", DisplayString(dpy), display->depth, depth)); *use_render = 0; if (depth == display->depth && !bad_visual(display->visual, depth)) @@ -1814,7 +2213,7 @@ display->rgb16_format = find_xrender_format(dpy, PIXMAN_r5g6b5); display->rgb24_format = XRenderFindStandardFormat(dpy, PictStandardRGB24); - DBG(("%s: root format=%lx, rgb16 format=%lx, rgb24 format=%lx\n", + DBG(X11, ("%s: root format=%lx, rgb16 format=%lx, rgb24 format=%lx\n", DisplayString(dpy), (long)display->root_format, (long)display->rgb16_format, @@ -1835,7 +2234,7 @@ { int ret, depth; - DBG(("%s-%s wants depth %d\n", + DBG(X11,("%s-%s wants depth %d\n", DisplayString(clone->dst.dpy), clone->dst.name, clone->depth)); ret = -1; @@ -1853,15 +2252,32 @@ if (ret) return ret; - DBG(("%s-%s using depth %d, requires xrender for src? %d, for dst? %d\n", + DBG(X11, ("%s-%s using depth %d, requires xrender for src? %d, for dst? %d\n", DisplayString(clone->dst.dpy), clone->dst.name, clone->depth, clone->src.use_render != NULL, clone->dst.use_render != NULL)); + if (!clone->dst.use_render && + clone->src.display->dri3_active && + clone->dst.display->dri3_active) + dri3_create_fence(clone->src.dpy, clone->src.window, &clone->dri3); + return 0; } +#if defined(USE_XINERAMA) +static int xinerama_active(struct display *display) +{ + int active = 0; + if (XineramaQueryExtension(display->dpy, &display->xinerama_event, &display->xinerama_error)) + active = XineramaIsActive(display->dpy); + return active; +} +#else +#define xinerama_active(d) 0 +#endif + static int add_display(struct context *ctx, Display *dpy) { struct display *display; @@ -1900,10 +2316,31 @@ &display->shm_event, &display->shm_opcode, &display->has_shm_pixmap); + DBG(X11, ("%s: has_shm?=%d, event=%d, opcode=%d, has_pixmap?=%d\n", + DisplayString(dpy), + display->has_shm, + display->shm_event, + display->shm_opcode, + display->has_shm_pixmap)); display->rr_active = XRRQueryExtension(dpy, &display->rr_event, &display->rr_error); - if (XineramaQueryExtension(dpy, &display->xinerama_event, &display->xinerama_error)) - display->xinerama_active = XineramaIsActive(dpy); + DBG(X11, ("%s: randr_active?=%d, event=%d, error=%d\n", + DisplayString(dpy), + display->rr_active, + display->rr_event, + display->rr_error)); + + display->xinerama_active = xinerama_active(display); + DBG(X11, ("%s: xinerama_active?=%d, event=%d, error=%d\n", + DisplayString(dpy), + display->xinerama_active, + display->xinerama_event, + display->xinerama_error)); + + display->dri3_active = dri3_exists(dpy); + DBG(X11, ("%s: dri3_active?=%d\n", + DisplayString(dpy), + display->dri3_active)); /* first display (source) is slightly special */ if (!first_display) { @@ -1919,7 +2356,7 @@ Display *dpy; int n; - DBG(("%s(%s)\n", __func__, name)); + DBG(X11, ("%s(%s)\n", __func__, name)); dpy = XOpenDisplay(name); if (dpy == NULL) @@ -1928,7 +2365,7 @@ /* Prevent cloning the same display twice */ for (n = 0; n < ctx->ndisplay; n++) { if (strcmp(DisplayString(dpy), DisplayString(ctx->display[n].dpy)) == 0) { - DBG(("%s %s is already connected\n", __func__, name)); + DBG(X11, ("%s %s is already connected\n", __func__, name)); XCloseDisplay(dpy); return -EBUSY; } @@ -1945,21 +2382,21 @@ fd = socket(PF_UNIX, SOCK_STREAM, 0); if (fd < 0) { - DBG(("%s unable to create a socket: %d\n", __func__, errno)); + DBG(X11, ("%s unable to create a socket: %d\n", __func__, errno)); return -ECONNREFUSED; } addr.sun_family = AF_UNIX; strcpy(addr.sun_path, optarg && *optarg ? optarg : "/var/run/bumblebee.socket"); if (connect(fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { - DBG(("%s unable to create a socket: %d\n", __func__, errno)); + DBG(X11, ("%s unable to create a socket: %d\n", __func__, errno)); goto err; } /* Ask bumblebee to start the second server */ buf[0] = 'C'; if (send(fd, &buf, 1, 0) != 1 || (len = recv(fd, &buf, 255, 0)) <= 0) { - DBG(("%s startup send/recv failed: %d\n", __func__, errno)); + DBG(X11, ("%s startup send/recv failed: %d\n", __func__, errno)); goto err; } buf[len] = '\0'; @@ -1967,12 +2404,12 @@ /* Query the display name */ strcpy(buf, "Q VirtualDisplay"); if (send(fd, buf, 17, 0) != 17 || (len = recv(fd, buf, 255, 0)) <= 0) { - DBG(("%s query send/recv failed: %d\n", __func__, errno)); + DBG(X11, ("%s query send/recv failed: %d\n", __func__, errno)); goto err; } buf[len] = '\0'; - DBG(("%s query result '%s'\n", __func__, buf)); + DBG(X11, ("%s query result '%s'\n", __func__, buf)); if (strncmp(buf, "Value: ", 7)) goto err; @@ -1998,7 +2435,7 @@ static int display_init_damage(struct display *display) { - DBG(("%s(%s)\n", __func__, DisplayString(display->dpy))); + DBG(X11, ("%s(%s)\n", __func__, DisplayString(display->dpy))); if (!XDamageQueryExtension(display->dpy, &display->damage_event, &display->damage_error) || !XFixesQueryExtension(display->dpy, &display->xfixes_event, &display->xfixes_error)) { @@ -2030,12 +2467,12 @@ { int major, minor; - DBG(("%s(%s)\n", __func__, DisplayString(display->dpy))); + DBG(X11,("%s(%s)\n", __func__, DisplayString(display->dpy))); if (!XRRQueryVersion(display->dpy, &major, &minor)) return; - DBG(("%s - randr version %d.%d\n", DisplayString(display->dpy), major, minor)); + DBG(X11, ("%s - randr version %d.%d\n", DisplayString(display->dpy), major, minor)); if (major > 1 || (major == 1 && minor >= 2)) XRRSelectInput(display->dpy, display->root, RROutputChangeNotifyMask); } @@ -2083,6 +2520,20 @@ return &ctx->display[ctx->ndisplay-1]; } +static void reverse_clone_list(struct display *display) +{ + struct clone *list = NULL; + + while (display->clone) { + struct clone *clone = display->clone; + display->clone = clone->next; + clone->next = list; + list = clone; + } + + display->clone = list; +} + static int last_display_add_clones__randr(struct context *ctx) { struct display *display = last_display(ctx); @@ -2090,15 +2541,16 @@ char buf[80]; int i, ret; - DBG(("%s(%s)\n", __func__, DisplayString(display->dpy))); + DBG(X11, ("%s(%s)\n", __func__, DisplayString(display->dpy))); display_init_randr_hpd(display); - res = _XRRGetScreenResourcesCurrent(display->dpy, display->root); + /* Force a probe of outputs on initial connection */ + res = XRRGetScreenResources(display->dpy, display->root); if (res == NULL) return -ENOMEM; - DBG(("%s - noutputs=%d\n", DisplayString(display->dpy), res->noutput)); + DBG(X11, ("%s - noutputs=%d\n", DisplayString(display->dpy), res->noutput)); for (i = 0; i < res->noutput; i++) { XRROutputInfo *o = XRRGetOutputInfo(display->dpy, res, res->outputs[i]); struct clone *clone = add_clone(ctx); @@ -2148,17 +2600,19 @@ if (o->crtc) { - DBG(("%s - disabling active output\n", DisplayString(display->dpy))); - XRRSetCrtcConfig(display->dpy, res, o->crtc, CurrentTime, - 0, 0, None, RR_Rotate_0, NULL, 0); + DBG(X11, ("%s - disabling active output\n", DisplayString(display->dpy))); + disable_crtc(display->dpy, res, o->crtc); } XRRFreeOutputInfo(o); } XRRFreeScreenResources(res); + + reverse_clone_list(display); return 0; } +#if defined(USE_XINERAMA) static int last_display_add_clones__xinerama(struct context *ctx) { struct display *display = last_display(ctx); @@ -2167,7 +2621,7 @@ char buf[80]; int n, count, ret; - DBG(("%s(%s)\n", __func__, DisplayString(display->dpy))); + DBG(X11, ("%s(%s)\n", __func__, DisplayString(display->dpy))); count = 0; xi = XineramaQueryScreens(dpy, &count); @@ -2229,8 +2683,13 @@ ctx->active = clone; } XFree(xi); + + reverse_clone_list(display); return 0; } +#else +#define last_display_add_clones__xinerama(ctx) -1 +#endif static int last_display_add_clones__display(struct context *ctx) { @@ -2243,7 +2702,7 @@ RROutput id; - DBG(("%s(%s)\n", __func__, DisplayString(dpy))); + DBG(X11, ("%s(%s)\n", __func__, DisplayString(dpy))); clone = add_clone(ctx); if (clone == NULL) return -ENOMEM; @@ -2305,7 +2764,7 @@ display->width = DisplayWidth(display->dpy, DefaultScreen(display->dpy)); display->height = DisplayHeight(display->dpy, DefaultScreen(display->dpy)); - DBG(("%s - initial size %dx%d\n", DisplayString(display->dpy), display->width, display->height)); + DBG(X11, ("%s - initial size %dx%d\n", DisplayString(display->dpy), display->width, display->height)); if (display->rr_active) return last_display_add_clones__randr(ctx); @@ -2341,7 +2800,7 @@ XGetWindowProperty(display->dpy, display->root, ctx->singleton, 0, 0, 0, AnyPropertyType, &type, &format, &nitems, &bytes, &prop); - DBG(("%s: singleton registered? %d\n", DisplayString(display->dpy), type != None)); + DBG(X11, ("%s: singleton registered? %d\n", DisplayString(display->dpy), type != None)); return type != None; } @@ -2352,7 +2811,7 @@ char expect[6]; /* "1234R\0" */ sprintf(expect, "%04xR", id); - DBG(("%s: wait for act '%c%c%c%c%c'\n", + DBG(X11, ("%s: wait for act '%c%c%c%c%c'\n", DisplayString(display->dpy), expect[0], expect[1], expect[2], expect[3], expect[4])); @@ -2369,7 +2828,7 @@ XClientMessageEvent *cme; XNextEvent(display->dpy, &e); - DBG(("%s: reading event type %d\n", DisplayString(display->dpy), e.type)); + DBG(X11, ("%s: reading event type %d\n", DisplayString(display->dpy), e.type)); if (e.type != ClientMessage) continue; @@ -2380,7 +2839,7 @@ if (cme->format != 8) continue; - DBG(("%s: client message '%c%c%c%c%c'\n", + DBG(X11, ("%s: client message '%c%c%c%c%c'\n", DisplayString(display->dpy), cme->data.b[0], cme->data.b[1], @@ -2414,7 +2873,7 @@ va_end(va); assert(len < sizeof(buf)); - DBG(("%s: send command '%s'\n", DisplayString(display->dpy), buf)); + DBG(X11, ("%s: send command '%s'\n", DisplayString(display->dpy), buf)); b = buf; while (len) { @@ -2449,7 +2908,7 @@ ctx->command[3], -result); - DBG(("%s: send reply '%s'\n", DisplayString(display->dpy), msg.data.b)); + DBG(X11, ("%s: send reply '%s'\n", DisplayString(display->dpy), msg.data.b)); msg.type = ClientMessage; msg.serial = 0; @@ -2465,7 +2924,7 @@ { int len; - DBG(("client message!\n")); + DBG(X11, ("client message!\n")); for (len = 0; len < 20 && msg[len]; len++) ; @@ -2480,7 +2939,7 @@ if (len < 20) { ctx->command[ctx->command_continuation] = 0; - DBG(("client command complete! '%s'\n", ctx->command)); + DBG(X11, ("client command complete! '%s'\n", ctx->command)); switch (ctx->command[4]) { case 'B': first_display_reply(ctx, last_display_clone(ctx, bumblebee_open(ctx))); @@ -2522,7 +2981,7 @@ XEvent e; XNextEvent(display->dpy, &e); - DBG(("%s: reading event type %d\n", DisplayString(display->dpy), e.type)); + DBG(X11, ("%s: reading event type %d\n", DisplayString(display->dpy), e.type)); if (e.type == PropertyNotify && ((XPropertyEvent *)&e)->atom == ctx->singleton) @@ -2538,7 +2997,7 @@ if (!display->send) return; - DBG(("%s flushing send (serial now %ld) (has shm send? %d)\n", + DBG(X11, ("%s flushing send (serial now %ld) (has shm send? %d)\n", DisplayString(display->dpy), (long)NextRequest(display->dpy), display->shm_event)); @@ -2570,7 +3029,7 @@ if (display->skip_frame++ < 2) return; - DBG(("%s forcing sync\n", DisplayString(display->dpy))); + DBG(X11, ("%s forcing sync\n", DisplayString(display->dpy))); XSync(display->dpy, False); display->flush = 0; @@ -2590,7 +3049,7 @@ if (!display->flush) return; - DBG(("%s(%s)\n", __func__, DisplayString(display->dpy))); + DBG(X11, ("%s(%s)\n", __func__, DisplayString(display->dpy))); XFlush(display->dpy); display->flush = 0; @@ -2626,16 +3085,37 @@ return 1; } - #define first_display_for_each_sibling(CTX, i) \ for (i = first_display_first_sibling(CTX); first_display_sibling(CTX, i); i++) +static void display_cleanup(struct display *display) +{ + Display *dpy = display->dpy; + XRRScreenResources *res; + int n; + + XGrabServer(dpy); + + res = _XRRGetScreenResourcesCurrent(dpy, display->root); + if (res != NULL) { + for (n = 0; n < res->ncrtc; n++) + disable_crtc(display->dpy, res, res->crtcs[n]); + + XRRFreeScreenResources(res); + } + + XUngrabServer(dpy); +} + static void context_cleanup(struct context *ctx) { Display *dpy = ctx->display->dpy; XRRScreenResources *res; int i, j; + for (i = 1; i < ctx->ndisplay; i++) + display_cleanup(&ctx->display[i]); + res = _XRRGetScreenResourcesCurrent(dpy, ctx->display->root); if (res == NULL) return; @@ -2652,10 +3132,7 @@ if (output == NULL) continue; - if (output->crtc) - XRRSetCrtcConfig(dpy, res, output->crtc, CurrentTime, - 0, 0, None, RR_Rotate_0, NULL, 0); - + disable_crtc(dpy, res, output->crtc); for (j = 0; j < output->nmode; j++) XRRDeleteOutputMode(dpy, clone->src.rr_output, output->modes[j]); @@ -2673,9 +3150,14 @@ continue; } } + XRRFreeScreenResources(res); + + /* And hide them again */ + res = XRRGetScreenResources(dpy, ctx->display->root); + if (res != NULL) + XRRFreeScreenResources(res); XUngrabServer(dpy); - XRRFreeScreenResources(res); if (ctx->singleton) XDeleteProperty(dpy, ctx->display->root, ctx->singleton); @@ -2694,12 +3176,12 @@ struct context ctx; const char *src_name = NULL; uint64_t count; - int daemonize = 1, bumblebee = 0, all = 0, singleton = 1; + int daemonize = 1, bumblebee = 0, siblings = 0, singleton = 1; int i, ret, open, fail; signal(SIGPIPE, SIG_IGN); - while ((i = getopt(argc, argv, "abd:fhS")) != -1) { + while ((i = getopt(argc, argv, "abd:fhSvV:")) != -1) { switch (i) { case 'd': src_name = optarg; @@ -2710,12 +3192,20 @@ case 'b': bumblebee = 1; break; - case 'a': - all = 1; + case 's': + siblings = 1; break; case 'S': singleton = 0; break; + case 'v': + verbose = ~0; + daemonize = 0; + break; + case 'V': + verbose = strtol(optarg, NULL, 0); + daemonize = 0; + break; case 'h': default: usage(argv[0]); @@ -2733,20 +3223,23 @@ if (ret) { fprintf(stderr, "Unable to connect to \"%s\".\n", src_name ?: getenv("DISPLAY") ?: ", set either the DISPLAY environment variable or pass -d on the commandline"); - return -ret; + ret = -ret; + goto out; } if (singleton) { XSelectInput(ctx.display->dpy, ctx.display->root, PropertyChangeMask); if (first_display_has_singleton(&ctx)) { - DBG(("%s: pinging singleton\n", DisplayString(ctx.display->dpy))); + DBG(X11, ("%s: pinging singleton\n", DisplayString(ctx.display->dpy))); ret = first_display_send_command(&ctx, 2000, "P"); if (ret) { - if (ret != -ETIME) - return -ret; - DBG(("No reply from singleton; assuming control\n")); + if (ret != -ETIME) { + ret = -ret; + goto out; + } + DBG(X11, ("No reply from singleton; assuming control\n")); } else { - DBG(("%s: singleton active, sending open commands\n", DisplayString(ctx.display->dpy))); + DBG(X11, ("%s: singleton active, sending open commands\n", DisplayString(ctx.display->dpy))); open = fail = 0; for (i = optind; i < argc; i++) { @@ -2757,7 +3250,7 @@ } else open++; } - if (all || (optind == argc && !bumblebee)) { + if (siblings || (optind == argc && !bumblebee)) { first_display_for_each_sibling(&ctx, i) { ret = first_display_send_command(&ctx, 5000, "C%s", ctx.command); if (ret && ret != -EBUSY) @@ -2766,7 +3259,7 @@ open++; } } - if (bumblebee || (optind == argc && !all)) { + if (bumblebee || (optind == argc && !siblings)) { ret = first_display_send_command(&ctx, 5000, "B"); if (ret && ret != -EBUSY) { if (bumblebee) @@ -2775,21 +3268,23 @@ } else open++; } - return open || !fail ? 0 : ECONNREFUSED; + ret = open || !fail ? 0 : ECONNREFUSED; + goto out; } } ret = first_display_register_as_singleton(&ctx); if (ret) - return ret; + goto out; } ret = display_init_damage(ctx.display); if (ret) - return ret; + goto out; if ((ctx.display->rr_event | ctx.display->rr_error) == 0) { fprintf(stderr, "RandR extension not supported by %s\n", DisplayString(ctx.display->dpy)); - return EINVAL; + ret = EINVAL; + goto out; } XRRSelectInput(ctx.display->dpy, ctx.display->root, RRScreenChangeNotifyMask); XFixesSelectCursorInput(ctx.display->dpy, ctx.display->root, XFixesDisplayCursorNotifyMask); @@ -2797,7 +3292,8 @@ ret = add_fd(&ctx, record_mouse(&ctx)); if (ret) { fprintf(stderr, "XTEST extension not supported by display \"%s\"\n", DisplayString(ctx.display->dpy)); - return -ret; + ret = -ret; + goto out; } open = fail = 0; @@ -2809,7 +3305,7 @@ } else open++; } - if (all || (optind == argc && !bumblebee)) { + if (siblings || (optind == argc && !bumblebee)) { first_display_for_each_sibling(&ctx, i) { ret = last_display_clone(&ctx, display_open(&ctx, ctx.command)); if (ret && ret != -EBUSY) @@ -2818,7 +3314,7 @@ open++; } } - if (bumblebee || (optind == argc && !all)) { + if (bumblebee || (optind == argc && !siblings)) { ret = last_display_clone(&ctx, bumblebee_open(&ctx)); if (ret && ret != -EBUSY) { if (bumblebee) @@ -2827,11 +3323,15 @@ } else open++; } - if (open == 0) - return fail ? ECONNREFUSED : 0; + if (open == 0) { + ret = fail ? ECONNREFUSED : 0; + goto out; + } - if (daemonize && daemon(0, 0)) - return EINVAL; + if (daemonize && daemon(0, 0)) { + ret = EINVAL; + goto out; + } signal(SIGHUP, signal_handler); signal(SIGINT, signal_handler); @@ -2843,16 +3343,16 @@ int reconfigure = 0; int rr_update = 0; - DBG(("polling - enable timer? %d, nfd=%d, ndisplay=%d\n", ctx.timer_active, ctx.nfd, ctx.ndisplay)); + DBG(POLL, ("polling - enable timer? %d, nfd=%d, ndisplay=%d\n", ctx.timer_active, ctx.nfd, ctx.ndisplay)); ret = poll(ctx.pfd + !ctx.timer_active, ctx.nfd - !ctx.timer_active, -1); if (ret <= 0) break; /* pfd[0] is the timer, pfd[1] is the local display, pfd[2] is the mouse, pfd[3+] are the remotes */ - DBG(("poll reports %d fd awake\n", ret)); + DBG(POLL, ("poll reports %d fd awake\n", ret)); if (ctx.pfd[1].revents || XPending(ctx.display[0].dpy)) { - DBG(("%s woken up\n", DisplayString(ctx.display[0].dpy))); + DBG(POLL,("%s woken up\n", DisplayString(ctx.display[0].dpy))); do { XNextEvent(ctx.display->dpy, &e); @@ -2860,11 +3360,11 @@ const XDamageNotifyEvent *de = (const XDamageNotifyEvent *)&e; struct clone *clone; - DBG(("%s damaged: (%d, %d)x(%d, %d)\n", + DBG(DAMAGE, ("%s damaged: (%d, %d)x(%d, %d)\n", DisplayString(ctx.display->dpy), de->area.x, de->area.y, de->area.width, de->area.height)); - for (clone = ctx.active; clone; clone = clone->next) + for (clone = ctx.active; clone; clone = clone->active) clone_damage(clone, &de->area); if (ctx.active) @@ -2872,7 +3372,7 @@ } else if (e.type == ctx.display->xfixes_event + XFixesCursorNotify) { XFixesCursorImage *cur; - DBG(("%s cursor changed\n", + DBG(CURSOR, ("%s cursor changed\n", DisplayString(ctx.display->dpy))); cur = XFixesGetCursorImage(ctx.display->dpy); @@ -2884,19 +3384,19 @@ XFree(cur); } else if (e.type == ctx.display->rr_event + RRScreenChangeNotify) { - DBG(("%s screen changed (reconfigure pending? %d)\n", + DBG(XRR, ("%s screen changed (reconfigure pending? %d)\n", DisplayString(ctx.display->dpy), reconfigure)); reconfigure = 1; } else if (e.type == PropertyNotify) { XPropertyEvent *pe = (XPropertyEvent *)&e; if (pe->atom == ctx.singleton) { - DBG(("lost control of singleton\n")); + DBG(X11, ("lost control of singleton\n")); return 0; } } else if (e.type == ClientMessage) { XClientMessageEvent *cme; - DBG(("%s client message\n", + DBG(X11, ("%s client message\n", DisplayString(ctx.display->dpy))); cme = (XClientMessageEvent *)&e; @@ -2907,7 +3407,7 @@ first_display_handle_command(&ctx, cme->data.b); } else { - DBG(("unknown event %d\n", e.type)); + DBG(X11, ("unknown event %d\n", e.type)); } } while (XEventsQueued(ctx.display->dpy, QueuedAfterReading)); } @@ -2916,20 +3416,20 @@ if (ctx.pfd[i+2].revents == 0 && !XPending(ctx.display[i].dpy)) continue; - DBG(("%s woken up\n", DisplayString(ctx.display[i].dpy))); + DBG(POLL, ("%s woken up\n", DisplayString(ctx.display[i].dpy))); do { XNextEvent(ctx.display[i].dpy, &e); - DBG(("%s received event %d\n", DisplayString(ctx.display[i].dpy), e.type)); + DBG(POLL, ("%s received event %d\n", DisplayString(ctx.display[i].dpy), e.type)); if (ctx.display[i].rr_active && e.type == ctx.display[i].rr_event + RRNotify) { XRRNotifyEvent *re = (XRRNotifyEvent *)&e; - DBG(("%s received RRNotify, type %d\n", DisplayString(ctx.display[i].dpy), re->subtype)); + DBG(XRR, ("%s received RRNotify, type %d\n", DisplayString(ctx.display[i].dpy), re->subtype)); if (re->subtype == RRNotify_OutputChange) { XRROutputPropertyNotifyEvent *ro = (XRROutputPropertyNotifyEvent *)re; struct clone *clone; - DBG(("%s RRNotify_OutputChange, timestamp %ld\n", DisplayString(ctx.display[i].dpy), ro->timestamp)); + DBG(XRR, ("%s RRNotify_OutputChange, timestamp %ld\n", DisplayString(ctx.display[i].dpy), ro->timestamp)); for (clone = ctx.display[i].clone; clone; clone = clone->next) { if (clone->dst.rr_output == ro->output) rr_update = clone->rr_update = 1; @@ -2947,16 +3447,17 @@ if (reconfigure && context_update(&ctx)) display_reset_damage(ctx.display); - XPending(ctx.record); + while (XPending(ctx.record)) /* discard all implicit events */ + XNextEvent(ctx.record, &e); if (ctx.timer_active && read(ctx.timer, &count, sizeof(count)) > 0) { struct clone *clone; - DBG(("%s timer expired (count=%ld)\n", DisplayString(ctx.display->dpy), (long)count)); + DBG(TIMER, ("%s timer expired (count=%ld)\n", DisplayString(ctx.display->dpy), (long)count)); ret = 0; if (ctx.active) { - DBG(("%s clearing damage\n", DisplayString(ctx.display->dpy))); + DBG(DAMAGE, ("%s clearing damage\n", DisplayString(ctx.display->dpy))); XDamageSubtract(ctx.display->dpy, ctx.display->damage, None, None); ctx.display->flush = 1; } @@ -2967,11 +3468,13 @@ for (i = 0; i < ctx.ndisplay; i++) display_flush(&ctx.display[i]); - DBG(("%s timer still active? %d\n", DisplayString(ctx.display->dpy), ret != 0)); + DBG(TIMER, ("%s timer still active? %d\n", DisplayString(ctx.display->dpy), ret != 0)); ctx.timer_active = ret != 0; } } + ret = 0; +out: context_cleanup(&ctx); - return 0; + return ret; } diff -Nru xserver-xorg-video-intel-2.99.910/xvmc/intel_xvmc.c xserver-xorg-video-intel-2.99.914/xvmc/intel_xvmc.c --- xserver-xorg-video-intel-2.99.910/xvmc/intel_xvmc.c 2014-02-01 18:42:22.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/xvmc/intel_xvmc.c 2014-06-13 08:33:48.000000000 +0000 @@ -103,21 +103,6 @@ 768 /* 111111 */ }; -void LOCK_HARDWARE(drm_context_t ctx) -{ - PPTHREAD_MUTEX_LOCK(); - assert(!xvmc_driver->locked); - - xvmc_driver->locked = 1; -} - -void UNLOCK_HARDWARE(drm_context_t ctx) -{ - xvmc_driver->locked = 0; - - PPTHREAD_MUTEX_UNLOCK(); -} - static int dri2_connect(Display *display) { @@ -340,8 +325,14 @@ return ret; } - + sigfillset(&xvmc_driver->sa_mask); + sigdelset(&xvmc_driver->sa_mask, SIGFPE); + sigdelset(&xvmc_driver->sa_mask, SIGILL); + sigdelset(&xvmc_driver->sa_mask, SIGSEGV); + sigdelset(&xvmc_driver->sa_mask, SIGBUS); + sigdelset(&xvmc_driver->sa_mask, SIGKILL); pthread_mutex_init(&xvmc_driver->ctxmutex, NULL); + intel_xvmc_dump_open(); return Success; diff -Nru xserver-xorg-video-intel-2.99.910/xvmc/intel_xvmc_private.h xserver-xorg-video-intel-2.99.914/xvmc/intel_xvmc_private.h --- xserver-xorg-video-intel-2.99.910/xvmc/intel_xvmc_private.h 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/xvmc/intel_xvmc_private.h 2014-06-13 08:33:48.000000000 +0000 @@ -147,9 +147,8 @@ } alloc; intel_xvmc_drm_map_t batchbuffer; - sigset_t sa_mask; + sigset_t sa_mask, old_mask; pthread_mutex_t ctxmutex; - int locked; int num_ctx; intel_xvmc_context_ptr ctx_list; @@ -194,33 +193,17 @@ extern struct _intel_xvmc_driver xvmc_vld_driver; extern struct _intel_xvmc_driver *xvmc_driver; -#define SET_BLOCKED_SIGSET() do { \ - sigset_t bl_mask; \ - sigfillset(&bl_mask); \ - sigdelset(&bl_mask, SIGFPE); \ - sigdelset(&bl_mask, SIGILL); \ - sigdelset(&bl_mask, SIGSEGV); \ - sigdelset(&bl_mask, SIGBUS); \ - sigdelset(&bl_mask, SIGKILL); \ - pthread_sigmask(SIG_SETMASK, &bl_mask, &xvmc_driver->sa_mask); \ - } while (0) - -#define RESTORE_BLOCKED_SIGSET() do { \ - pthread_sigmask(SIG_SETMASK, &xvmc_driver->sa_mask, NULL); \ - } while (0) - -#define PPTHREAD_MUTEX_LOCK() do { \ - SET_BLOCKED_SIGSET(); \ - pthread_mutex_lock(&xvmc_driver->ctxmutex); \ - } while (0) - -#define PPTHREAD_MUTEX_UNLOCK() do { \ - pthread_mutex_unlock(&xvmc_driver->ctxmutex); \ - RESTORE_BLOCKED_SIGSET(); \ - } while (0) +static inline void LOCK_HARDWARE(drm_context_t ctx) +{ + pthread_mutex_lock(&xvmc_driver->ctxmutex); + pthread_sigmask(SIG_SETMASK, &xvmc_driver->sa_mask, &xvmc_driver->old_mask); +} -extern void LOCK_HARDWARE(drm_context_t); -extern void UNLOCK_HARDWARE(drm_context_t); +static inline void UNLOCK_HARDWARE(drm_context_t ctx) +{ + pthread_sigmask(SIG_SETMASK, &xvmc_driver->old_mask, NULL); + pthread_mutex_unlock(&xvmc_driver->ctxmutex); +} static inline const char *intel_xvmc_decoder_string(int flag) { diff -Nru xserver-xorg-video-intel-2.99.910/xvmc/Makefile.am xserver-xorg-video-intel-2.99.914/xvmc/Makefile.am --- xserver-xorg-video-intel-2.99.910/xvmc/Makefile.am 2013-11-25 11:59:04.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/xvmc/Makefile.am 2014-06-13 08:33:48.000000000 +0000 @@ -24,9 +24,7 @@ intel_batchbuffer.h \ $(NULL) -AM_CFLAGS = @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI2_CFLAGS@ \ - @XVMCLIB_CFLAGS@ @XCB_CFLAGS@ \ - -I$(top_srcdir)/src -DTRUE=1 -DFALSE=0 +AM_CFLAGS = $(XVMCLIB_CFLAGS) $(XORG_CFLAGS) -I$(top_srcdir)/src -DTRUE=1 -DFALSE=0 libIntelXvMC_la_LDFLAGS = -version-number 1:0:0 -libIntelXvMC_la_LIBADD = @DRI2_LIBS@ @DRM_LIBS@ @XVMCLIB_LIBS@ @XCB_LIBS@ @DRMINTEL_LIBS@ -lpthread +libIntelXvMC_la_LIBADD = $(XVMCLIB_LIBS) -lpthread diff -Nru xserver-xorg-video-intel-2.99.910/xvmc/Makefile.in xserver-xorg-video-intel-2.99.914/xvmc/Makefile.in --- xserver-xorg-video-intel-2.99.910/xvmc/Makefile.in 2014-02-10 09:34:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/xvmc/Makefile.in 2014-07-23 15:44:38.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -35,7 +79,8 @@ build_triplet = @build@ host_triplet = @host@ subdir = xvmc -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -76,18 +121,32 @@ } am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) -libIntelXvMC_la_DEPENDENCIES = +am__DEPENDENCIES_1 = +libIntelXvMC_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libIntelXvMC_la_OBJECTS = intel_xvmc.lo intel_xvmc_dump.lo \ i915_xvmc.lo i965_xvmc.lo xvmc_vld.lo intel_batchbuffer.lo libIntelXvMC_la_OBJECTS = $(am_libIntelXvMC_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent +am__v_lt_1 = libIntelXvMC_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libIntelXvMC_la_LDFLAGS) $(LDFLAGS) \ -o $@ @XVMC_TRUE@am_libIntelXvMC_la_rpath = -rpath $(libdir) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -100,34 +159,56 @@ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = SOURCES = $(libIntelXvMC_la_SOURCES) DIST_SOURCES = $(libIntelXvMC_la_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -186,6 +267,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -214,8 +297,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -254,23 +342,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -351,12 +440,9 @@ intel_batchbuffer.h \ $(NULL) -AM_CFLAGS = @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI2_CFLAGS@ \ - @XVMCLIB_CFLAGS@ @XCB_CFLAGS@ \ - -I$(top_srcdir)/src -DTRUE=1 -DFALSE=0 - +AM_CFLAGS = $(XVMCLIB_CFLAGS) $(XORG_CFLAGS) -I$(top_srcdir)/src -DTRUE=1 -DFALSE=0 libIntelXvMC_la_LDFLAGS = -version-number 1:0:0 -libIntelXvMC_la_LIBADD = @DRI2_LIBS@ @DRM_LIBS@ @XVMCLIB_LIBS@ @XCB_LIBS@ @DRMINTEL_LIBS@ -lpthread +libIntelXvMC_la_LIBADD = $(XVMCLIB_LIBS) -lpthread all: all-recursive .SUFFIXES: @@ -391,9 +477,9 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): + install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ @@ -401,6 +487,8 @@ else :; fi; \ done; \ test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } @@ -416,12 +504,15 @@ clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) - @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done + @list='$(lib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } + libIntelXvMC.la: $(libIntelXvMC_la_OBJECTS) $(libIntelXvMC_la_DEPENDENCIES) $(EXTRA_libIntelXvMC_la_DEPENDENCIES) $(AM_V_CCLD)$(libIntelXvMC_la_LINK) $(am_libIntelXvMC_la_rpath) $(libIntelXvMC_la_OBJECTS) $(libIntelXvMC_la_LIBADD) $(LIBS) @@ -443,14 +534,14 @@ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -466,22 +557,25 @@ -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -496,57 +590,12 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -562,12 +611,7 @@ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -579,15 +623,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -596,6 +636,21 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -632,13 +687,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -767,24 +819,22 @@ uninstall-am: uninstall-libLTLIBRARIES -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive +.MAKE: $(am__recursive_targets) install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic \ - clean-libLTLIBRARIES clean-libtool ctags ctags-recursive \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-libLTLIBRARIES install-man install-pdf \ - install-pdf-am install-ps install-ps-am install-strip \ - installcheck installcheck-am installdirs installdirs-am \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ - uninstall-libLTLIBRARIES +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libLTLIBRARIES \ + clean-libtool cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am \ + install-libLTLIBRARIES install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru xserver-xorg-video-intel-2.99.910/xvmc/shader/Makefile.in xserver-xorg-video-intel-2.99.914/xvmc/shader/Makefile.in --- xserver-xorg-video-intel-2.99.910/xvmc/shader/Makefile.in 2014-02-10 09:34:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/xvmc/shader/Makefile.in 2014-07-23 15:44:38.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,6 +14,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -34,7 +78,7 @@ build_triplet = @build@ host_triplet = @host@ subdir = xvmc/shader -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -46,26 +90,58 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -124,6 +200,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -152,8 +230,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -192,23 +275,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -309,22 +393,25 @@ -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -339,57 +426,12 @@ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -405,12 +447,7 @@ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -422,15 +459,11 @@ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -439,6 +472,21 @@ here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -475,13 +523,10 @@ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -602,22 +647,20 @@ uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive +.MAKE: $(am__recursive_targets) install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic clean-libtool \ - ctags ctags-recursive distclean distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. diff -Nru xserver-xorg-video-intel-2.99.910/xvmc/shader/mc/Makefile.in xserver-xorg-video-intel-2.99.914/xvmc/shader/mc/Makefile.in --- xserver-xorg-video-intel-2.99.910/xvmc/shader/mc/Makefile.in 2014-02-10 09:34:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/xvmc/shader/mc/Makefile.in 2014-07-23 15:44:38.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,6 +14,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -34,7 +78,7 @@ build_triplet = @build@ host_triplet = @host@ subdir = xvmc/shader/mc -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -46,14 +90,26 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ @@ -84,6 +140,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -112,8 +170,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -152,23 +215,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -376,11 +440,11 @@ clean-libtool: -rm -rf .libs _libs -tags: TAGS -TAGS: +tags TAGS: + +ctags CTAGS: -ctags: CTAGS -CTAGS: +cscope cscopelist: distdir: $(DISTFILES) @@ -520,16 +584,16 @@ .MAKE: all check install install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - clean-local distclean distclean-generic distclean-libtool \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-dvi \ + clean-local cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am + tags-am uninstall uninstall-am @HAVE_GEN4ASM_TRUE@.g4a.g4b: @HAVE_GEN4ASM_TRUE@ $(AM_V_GEN)m4 -I$(srcdir) $(srcdir)/$*.g4a > $*.g4m && @INTEL_GEN4ASM@ -o $@ $*.g4m && @INTEL_GEN4ASM@ -g 5 -o $@.gen5 $*.g4m && rm $*.g4m diff -Nru xserver-xorg-video-intel-2.99.910/xvmc/shader/vld/Makefile.in xserver-xorg-video-intel-2.99.914/xvmc/shader/vld/Makefile.in --- xserver-xorg-video-intel-2.99.910/xvmc/shader/vld/Makefile.in 2014-02-10 09:34:15.000000000 +0000 +++ xserver-xorg-video-intel-2.99.914/xvmc/shader/vld/Makefile.in 2014-07-23 15:44:38.000000000 +0000 @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.3 from Makefile.am. +# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software -# Foundation, Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,6 +14,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -34,7 +78,7 @@ build_triplet = @build@ host_triplet = @host@ subdir = xvmc/shader/vld -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -46,14 +90,26 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ @@ -84,6 +140,8 @@ DRI1_LIBS = @DRI1_LIBS@ DRI2_CFLAGS = @DRI2_CFLAGS@ DRI2_LIBS = @DRI2_LIBS@ +DRI3_CFLAGS = @DRI3_CFLAGS@ +DRI3_LIBS = @DRI3_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ DRIVER_NAME = @DRIVER_NAME@ @@ -112,8 +170,13 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTEL_GEN4ASM = @INTEL_GEN4ASM@ +IVO_CFLAGS = @IVO_CFLAGS@ +IVO_EXTRA_CFLAGS = @IVO_EXTRA_CFLAGS@ +IVO_EXTRA_LIBS = @IVO_EXTRA_LIBS@ +IVO_LIBS = @IVO_LIBS@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBEXEC_PATH = @LIBEXEC_PATH@ LIBGLAMOR_CFLAGS = @LIBGLAMOR_CFLAGS@ LIBGLAMOR_EGL_CFLAGS = @LIBGLAMOR_EGL_CFLAGS@ LIBGLAMOR_EGL_LIBS = @LIBGLAMOR_EGL_LIBS@ @@ -152,23 +215,24 @@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ +PREFIX_PATH = @PREFIX_PATH@ +PRESENT_CFLAGS = @PRESENT_CFLAGS@ +PRESENT_LIBS = @PRESENT_LIBS@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ -TOOL_CFLAGS = @TOOL_CFLAGS@ -TOOL_LIBS = @TOOL_LIBS@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ VALGRIND_LIBS = @VALGRIND_LIBS@ VERSION = @VERSION@ X11_CFLAGS = @X11_CFLAGS@ +X11_DRI3_CFLAGS = @X11_DRI3_CFLAGS@ +X11_DRI3_LIBS = @X11_DRI3_LIBS@ X11_LIBS = @X11_LIBS@ -XCB_CFLAGS = @XCB_CFLAGS@ -XCB_LIBS = @XCB_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ XORG_LIBS = @XORG_LIBS@ XORG_MAN_PAGE = @XORG_MAN_PAGE@ @@ -329,11 +393,11 @@ clean-libtool: -rm -rf .libs _libs -tags: TAGS -TAGS: +tags TAGS: + +ctags CTAGS: -ctags: CTAGS -CTAGS: +cscope cscopelist: distdir: $(DISTFILES) @@ -473,16 +537,16 @@ .MAKE: all check install install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ - clean-local distclean distclean-generic distclean-libtool \ - distdir dvi dvi-am html html-am info info-am install \ - install-am install-data install-data-am install-dvi \ + clean-local cscopelist-am ctags-am distclean distclean-generic \ + distclean-libtool distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am + tags-am uninstall uninstall-am @HAVE_GEN4ASM_TRUE@.g4a.g4b: @HAVE_GEN4ASM_TRUE@ $(AM_V_GEN)m4 $*.g4a > $*.g4m && @INTEL_GEN4ASM@ -o $@ $*.g4m && @INTEL_GEN4ASM@ -g 5 -o $@.gen5 $*.g4m && rm $*.g4m