diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/config.guess xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/config.guess --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/config.guess 2017-09-08 07:28:24.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/config.guess 2018-03-15 15:40:35.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2016-10-02' +timestamp='2018-02-24' # 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 @@ -15,7 +15,7 @@ # 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 . +# 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 @@ -27,7 +27,7 @@ # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # 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 +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . @@ -39,7 +39,7 @@ Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2018 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." @@ -107,9 +107,9 @@ dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; + ,,) echo "int x;" > "$dummy.c" ; for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; @@ -132,14 +132,14 @@ UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +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 + eval "$set_cc_for_build" + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc @@ -149,13 +149,20 @@ LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -169,30 +176,30 @@ # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` - machine=${arch}${endian}-unknown + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + eval "$set_cc_for_build" if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -208,10 +215,10 @@ ;; esac # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -219,46 +226,55 @@ # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}${abi}" + echo "$machine-${os}${release}${abi}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + 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} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) - echo ${UNAME_MACHINE}-unknown-sortix + echo "$UNAME_MACHINE"-unknown-sortix exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox + exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -310,28 +326,19 @@ # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -343,7 +350,7 @@ echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos @@ -370,19 +377,19 @@ sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build + eval "$set_cc_for_build" SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. @@ -395,13 +402,13 @@ SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -410,25 +417,25 @@ ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -439,44 +446,44 @@ # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -485,23 +492,23 @@ #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -527,17 +534,17 @@ AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -554,7 +561,7 @@ echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id @@ -566,14 +573,14 @@ if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -584,7 +591,7 @@ exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else @@ -598,7 +605,7 @@ exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -607,18 +614,18 @@ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -633,28 +640,28 @@ echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in + case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in + case "$sc_kernel_bits" in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if [ "$HP_ARCH" = "" ]; then + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -687,13 +694,13 @@ exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = hppa2.0w ] + if [ "$HP_ARCH" = hppa2.0w ] then - eval $set_cc_for_build + eval "$set_cc_for_build" # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -712,15 +719,15 @@ HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -745,11 +752,11 @@ exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -758,7 +765,7 @@ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -766,9 +773,9 @@ exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -793,127 +800,109 @@ echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case "$UNAME_PROCESSOR" in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin + echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`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 "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + echo "$UNAME_MACHINE"-pc-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -927,63 +916,63 @@ esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval $set_cc_for_build + 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-${LIBC} + 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-${LIBC}eabi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + eval "$set_cc_for_build" + sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el @@ -997,70 +986,74 @@ #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; mips64el:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} + echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} + 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-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + 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-${LIBC} + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} + echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} + echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} + echo powerpcle-unknown-linux-"$LIBC" exit ;; riscv32:Linux:*:* | riscv64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + if objdump -f /bin/sh | grep -q elf32-x86-64; then + echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32 + else + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + fi exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1074,34 +1067,34 @@ # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable + echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) @@ -1111,12 +1104,12 @@ *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1126,9 +1119,9 @@ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1148,9 +1141,9 @@ exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1170,9 +1163,9 @@ test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1181,28 +1174,28 @@ test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1213,7 +1206,7 @@ *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1233,23 +1226,23 @@ exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} + echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1268,49 +1261,56 @@ echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" exit ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux${UNAME_RELEASE} + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build + eval "$set_cc_for_build" if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then 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 + (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 + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub @@ -1321,7 +1321,7 @@ # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` @@ -1329,19 +1329,25 @@ UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + echo nse-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1350,7 +1356,7 @@ echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 @@ -1361,7 +1367,7 @@ else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1382,14 +1388,14 @@ echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1398,32 +1404,44 @@ echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx exit ;; amd64:Isilon\ OneFS:*:*) echo x86_64-unknown-onefs exit ;; esac +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 </dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/config.sub xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/config.sub --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/config.sub 2017-09-08 07:28:24.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/config.sub 2018-03-15 15:40:35.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2016-11-04' +timestamp='2018-02-22' # 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 @@ -15,7 +15,7 @@ # 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 . +# 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 @@ -33,7 +33,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -57,7 +57,7 @@ Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -67,7 +67,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2018 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." @@ -94,7 +94,7 @@ *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -112,7 +112,7 @@ # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ @@ -120,16 +120,16 @@ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown + basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` + basic_machine=`echo "$1" | sed 's/-[^-]*$//'` + if [ "$basic_machine" != "$1" ] + then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac @@ -178,44 +178,44 @@ ;; -sco6) os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 @@ -227,10 +227,7 @@ os=-lynxos ;; -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` + basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos @@ -263,7 +260,7 @@ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ - | i370 | i860 | i960 | ia64 \ + | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ @@ -299,7 +296,7 @@ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ + | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ @@ -315,7 +312,7 @@ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ - | we32k \ + | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown @@ -336,7 +333,7 @@ basic_machine=$basic_machine-unknown os=-none ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown @@ -365,7 +362,7 @@ ;; # Object if more than one company name word. *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. @@ -388,7 +385,7 @@ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ + | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ @@ -446,6 +443,7 @@ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ + | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ @@ -459,7 +457,7 @@ # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) - basic_machine=i386-unknown + basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) @@ -493,7 +491,7 @@ basic_machine=x86_64-pc ;; amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl @@ -538,7 +536,7 @@ os=-linux ;; blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) @@ -546,13 +544,13 @@ os=-cnk ;; c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray @@ -641,7 +639,7 @@ basic_machine=rs6000-bull os=-bosx ;; - dpx2* | dpx2*-bull) + dpx2*) basic_machine=m68k-bull os=-sysv3 ;; @@ -650,7 +648,7 @@ os=$os"spe" ;; e500v[12]-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) @@ -742,9 +740,6 @@ hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; - hppa-next) - os=-nextstep3 - ;; hppaosf) basic_machine=hppa1.1-hp os=-osf @@ -757,26 +752,26 @@ basic_machine=i370-ibm ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; - i386-vsta | vsta) + vsta) basic_machine=i386-unknown os=-vsta ;; @@ -795,19 +790,16 @@ os=-sysv ;; leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` + basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; - m88k-omron*) - basic_machine=m88k-omron - ;; magnum | m3230) basic_machine=mips-mips os=-sysv @@ -839,10 +831,10 @@ os=-mint ;; mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k @@ -861,7 +853,7 @@ os=-msdos ;; ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc @@ -903,7 +895,7 @@ basic_machine=v70-nec os=-sysv ;; - next | m*-next ) + next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) @@ -948,6 +940,12 @@ nsr-tandem) basic_machine=nsr-tandem ;; + nsv-tandem) + basic_machine=nsv-tandem + ;; + nsx-tandem) + basic_machine=nsx-tandem + ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf @@ -980,7 +978,7 @@ os=-linux ;; parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) @@ -996,7 +994,7 @@ basic_machine=i386-pc ;; pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc @@ -1011,16 +1009,16 @@ basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould @@ -1030,23 +1028,23 @@ ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm @@ -1100,17 +1098,10 @@ sequent) basic_machine=i386-sequent ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; sh5el) basic_machine=sh5le-unknown ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) + simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; @@ -1129,7 +1120,7 @@ os=-sysv4 ;; strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` + basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun @@ -1251,6 +1242,9 @@ basic_machine=hppa1.1-winbond os=-proelf ;; + x64) + basic_machine=x86_64-pc + ;; xbox) basic_machine=i686-pc os=-mingw32 @@ -1259,20 +1253,12 @@ basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; none) basic_machine=none-none os=-none @@ -1301,10 +1287,6 @@ vax) basic_machine=vax-dec ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; pdp11) basic_machine=pdp11-dec ;; @@ -1314,9 +1296,6 @@ sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; cydra) basic_machine=cydra-cydrome ;; @@ -1336,7 +1315,7 @@ # Make sure to match an already-canonicalized machine name. ;; *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac @@ -1344,10 +1323,10 @@ # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; @@ -1358,8 +1337,8 @@ if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases that might get confused + # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux @@ -1370,18 +1349,19 @@ -solaris) os=-solaris2 ;; - -svr4*) - os=-sysv4 - ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; - # First accept the basic system types. + # es1800 is here to avoid being matched by es* (a different OS) + -es1800*) + os=-ose + ;; + # Now accept the basic system types. # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. + # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ @@ -1391,25 +1371,26 @@ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -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* \ + | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos* | -phoenix* | -fuchsia*) + | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ + | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1426,12 +1407,12 @@ -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + -sim | -xray | -os68k* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc @@ -1440,10 +1421,10 @@ os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition @@ -1454,12 +1435,6 @@ -wince*) os=-wince ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; -utek*) os=-bsd ;; @@ -1484,7 +1459,7 @@ -nova*) os=-rtmk-nova ;; - -ns2 ) + -ns2) os=-nextstep2 ;; -nsk*) @@ -1506,7 +1481,7 @@ -oss*) os=-sysv3 ;; - -svr4) + -svr4*) os=-sysv4 ;; -svr3) @@ -1521,24 +1496,28 @@ -ose*) os=-ose ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; - -aros*) - os=-aros - ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; + -pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $basic_machine in + arm*) + os=-eabi + ;; + *) + os=-elf + ;; + esac + ;; -nacl*) ;; -ios) @@ -1548,7 +1527,7 @@ *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac @@ -1638,12 +1617,12 @@ sparc-* | *-sun) os=-sunos4.1.1 ;; + pru-*) + os=-elf + ;; *-be) os=-beos ;; - *-haiku) - os=-haiku - ;; *-ibm) os=-aix ;; @@ -1683,7 +1662,7 @@ m88k-omron*) os=-luna ;; - *-next ) + *-next) os=-nextstep ;; *-sequent) @@ -1698,9 +1677,6 @@ i370-*) os=-mvs ;; - *-next) - os=-nextstep3 - ;; *-gould) os=-sysv ;; @@ -1810,15 +1786,15 @@ vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$basic_machine$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/configure xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/configure --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/configure 2017-09-08 07:28:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/configure 2018-03-15 15:40:33.000000000 +0000 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for xf86-video-amdgpu 1.4.0. +# Generated by GNU Autoconf 2.69 for xf86-video-amdgpu 18.0.1. # # Report bugs to . # @@ -591,8 +591,8 @@ # Identity of this package. PACKAGE_NAME='xf86-video-amdgpu' PACKAGE_TARNAME='xf86-video-amdgpu' -PACKAGE_VERSION='1.4.0' -PACKAGE_STRING='xf86-video-amdgpu 1.4.0' +PACKAGE_VERSION='18.0.1' +PACKAGE_STRING='xf86-video-amdgpu 18.0.1' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/AMDgpu' PACKAGE_URL='' @@ -1404,7 +1404,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-amdgpu 1.4.0 to adapt to many kinds of systems. +\`configure' configures xf86-video-amdgpu 18.0.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1476,7 +1476,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xf86-video-amdgpu 1.4.0:";; + short | recursive ) echo "Configuration of xf86-video-amdgpu 18.0.1:";; esac cat <<\_ACEOF @@ -1635,7 +1635,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xf86-video-amdgpu configure 1.4.0 +xf86-video-amdgpu configure 18.0.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2050,7 +2050,7 @@ 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-amdgpu $as_me 1.4.0, which was +It was created by xf86-video-amdgpu $as_me 18.0.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2921,7 +2921,7 @@ # Define the identity of the package. PACKAGE='xf86-video-amdgpu' - VERSION='1.4.0' + VERSION='18.0.1' cat >>confdefs.h <<_ACEOF @@ -19005,12 +19005,12 @@ pkg_cv_LIBDRM_AMDGPU_CFLAGS="$LIBDRM_AMDGPU_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_amdgpu >= 2.4.72\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libdrm_amdgpu >= 2.4.72") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm_amdgpu >= 2.4.76\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libdrm_amdgpu >= 2.4.76") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBDRM_AMDGPU_CFLAGS=`$PKG_CONFIG --cflags "libdrm_amdgpu >= 2.4.72" 2>/dev/null` + pkg_cv_LIBDRM_AMDGPU_CFLAGS=`$PKG_CONFIG --cflags "libdrm_amdgpu >= 2.4.76" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -19022,12 +19022,12 @@ pkg_cv_LIBDRM_AMDGPU_LIBS="$LIBDRM_AMDGPU_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_amdgpu >= 2.4.72\""; } >&5 - ($PKG_CONFIG --exists --print-errors "libdrm_amdgpu >= 2.4.72") 2>&5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libdrm_amdgpu >= 2.4.76\""; } >&5 + ($PKG_CONFIG --exists --print-errors "libdrm_amdgpu >= 2.4.76") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then - pkg_cv_LIBDRM_AMDGPU_LIBS=`$PKG_CONFIG --libs "libdrm_amdgpu >= 2.4.72" 2>/dev/null` + pkg_cv_LIBDRM_AMDGPU_LIBS=`$PKG_CONFIG --libs "libdrm_amdgpu >= 2.4.76" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes @@ -19048,14 +19048,14 @@ _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - LIBDRM_AMDGPU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdrm_amdgpu >= 2.4.72" 2>&1` + LIBDRM_AMDGPU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libdrm_amdgpu >= 2.4.76" 2>&1` else - LIBDRM_AMDGPU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdrm_amdgpu >= 2.4.72" 2>&1` + LIBDRM_AMDGPU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libdrm_amdgpu >= 2.4.76" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$LIBDRM_AMDGPU_PKG_ERRORS" >&5 - as_fn_error $? "Package requirements (libdrm_amdgpu >= 2.4.72) were not met: + as_fn_error $? "Package requirements (libdrm_amdgpu >= 2.4.76) were not met: $LIBDRM_AMDGPU_PKG_ERRORS @@ -19910,8 +19910,8 @@ do : ac_fn_c_check_header_compile "$LINENO" "present.h" "ac_cv_header_present_h" "#include #include - #include #include \"xorg-server.h\" + #include " if test "x$ac_cv_header_present_h" = xyes; then : cat >>confdefs.h <<_ACEOF @@ -20619,7 +20619,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xf86-video-amdgpu $as_me 1.4.0, which was +This file was extended by xf86-video-amdgpu $as_me 18.0.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20685,7 +20685,7 @@ 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-amdgpu config.status 1.4.0 +xf86-video-amdgpu config.status 18.0.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/configure.ac xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/configure.ac --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/configure.ac 2017-09-08 07:27:57.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/configure.ac 2018-03-15 15:40:07.000000000 +0000 @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-video-amdgpu], - [1.4.0], + [18.0.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/AMDgpu], [xf86-video-amdgpu]) @@ -71,7 +71,7 @@ # Checks for libraries. PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.78]) -PKG_CHECK_MODULES(LIBDRM_AMDGPU, [libdrm_amdgpu >= 2.4.72]) +PKG_CHECK_MODULES(LIBDRM_AMDGPU, [libdrm_amdgpu >= 2.4.76]) PKG_CHECK_MODULES(GBM, [gbm]) # Obtain compiler/linker options for the driver dependencies @@ -194,8 +194,8 @@ AC_CHECK_HEADERS([present.h], [], [], [#include #include - #include - #include "xorg-server.h"]) + #include "xorg-server.h" + #include ]) AC_CHECK_HEADERS([dri3.h], [], [], [#include diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/debian/changelog xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/debian/changelog --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/debian/changelog 2018-06-14 13:42:17.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/debian/changelog 2018-06-14 13:42:17.000000000 +0000 @@ -1,8 +1,22 @@ -xserver-xorg-video-amdgpu-hwe-16.04 (1.4.0-1~16.04.1) xenial; urgency=medium +xserver-xorg-video-amdgpu-hwe-16.04 (18.0.1-1~16.04.1) xenial; urgency=medium - * Backport for hwe-16.04 stack. (LP: #1716203) + * Backport for hwe-16.04 stack. (LP: #1772632) - -- Timo Aaltonen Wed, 03 Jan 2018 12:26:59 +0200 + -- Timo Aaltonen Thu, 07 Jun 2018 10:50:49 +0300 + +xserver-xorg-video-amdgpu (18.0.1-1) unstable; urgency=medium + + * New upstream release. + + -- Timo Aaltonen Tue, 20 Mar 2018 14:02:29 +0200 + +xserver-xorg-video-amdgpu (18.0.0-1) unstable; urgency=medium + + * New upstream release. + * control: Update VCS urls. + * control: Bump policy to 4.1.3, no changes. + + -- Timo Aaltonen Wed, 07 Mar 2018 04:44:35 +0200 xserver-xorg-video-amdgpu (1.4.0-1) unstable; urgency=medium diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/debian/control xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/debian/control --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/debian/control 2018-06-14 13:42:17.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/debian/control 2018-06-14 13:42:17.000000000 +0000 @@ -22,9 +22,9 @@ x11proto-xf86dri-dev, xserver-xorg-dev-hwe-16.04 (>= 2:1.16), xutils-dev (>= 1:7.5+4) -Standards-Version: 3.9.8 -Vcs-Git: https://anonscm.debian.org/git/pkg-xorg/driver/xserver-xorg-video-amdgpu.git -Vcs-Browser: https://anonscm.debian.org/cgit/pkg-xorg/driver/xserver-xorg-video-amdgpu.git +Standards-Version: 4.1.3 +Vcs-Git: https://salsa.debian.org/xorg-team/driver/xserver-xorg-video-amdgpu.git +Vcs-Browser: https://salsa.debian.org/xorg-team/driver/xserver-xorg-video-amdgpu.git Package: xserver-xorg-video-amdgpu-hwe-16.04 Architecture: linux-any diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/man/amdgpu.man xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/man/amdgpu.man --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/man/amdgpu.man 2017-09-08 07:27:57.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/man/amdgpu.man 2018-03-15 15:40:07.000000000 +0000 @@ -18,7 +18,7 @@ .PD 0 .TP 2 \(bu -Support for 24-bit pixel depth; +Support for 24- and 30-bit pixel depths; .TP \(bu RandR support up to version 1.4; @@ -80,8 +80,8 @@ on. If this option is set, the default value of the property is 'on' or 'off' accordingly. If this option isn't set, the default value of the property is .B auto, -which means that TearFree is on for outputs with rotation or other RandR -transforms, and for RandR 1.4 slave outputs, otherwise off. +which means that TearFree is on for rotated outputs, outputs with RandR +transforms applied and for RandR 1.4 slave outputs, otherwise off. .TP .BI "Option \*qAccelMethod\*q \*q" string \*q Setting this option to diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_bo_helper.c xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_bo_helper.c --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_bo_helper.c 2017-09-08 07:27:57.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_bo_helper.c 2018-03-15 15:40:07.000000000 +0000 @@ -42,6 +42,8 @@ return GBM_FORMAT_RGB565; case 32: return GBM_FORMAT_ARGB8888; + case 30: + return GBM_FORMAT_XRGB2101010; case 24: if (bitsPerPixel == 32) return GBM_FORMAT_XRGB8888; diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_dri2.c xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_dri2.c --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_dri2.c 2017-09-08 07:27:57.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_dri2.c 2018-03-15 15:40:07.000000000 +0000 @@ -120,6 +120,7 @@ cpp = 2; break; case 24: + case 30: cpp = 4; break; default: @@ -603,7 +604,7 @@ if (draw->type != DRAWABLE_WINDOW || !info->allowPageFlip || - info->hwcursor_disabled || + info->sprites_visible > 0 || info->drmmode.present_flipping || !pScrn->vtSema || !DRI2CanFlip(draw)) diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_drv.h xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_drv.h --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_drv.h 2017-09-08 07:27:57.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_drv.h 2018-03-15 15:40:07.000000000 +0000 @@ -178,23 +178,23 @@ static inline ScreenPtr amdgpu_dirty_master(PixmapDirtyUpdatePtr dirty) { + return amdgpu_master_screen(dirty->slave_dst->drawable.pScreen); +} + +static inline DrawablePtr +amdgpu_dirty_src_drawable(PixmapDirtyUpdatePtr dirty) +{ #ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC - ScreenPtr screen = dirty->src->pScreen; + return dirty->src; #else - ScreenPtr screen = dirty->src->drawable.pScreen; + return &dirty->src->drawable; #endif - - return amdgpu_master_screen(screen); } static inline Bool amdgpu_dirty_src_equals(PixmapDirtyUpdatePtr dirty, PixmapPtr pixmap) { -#ifdef HAS_DIRTYTRACKING_DRAWABLE_SRC - return dirty->src == &pixmap->drawable; -#else - return dirty->src == pixmap; -#endif + return amdgpu_dirty_src_drawable(dirty) == &pixmap->drawable; } @@ -234,6 +234,13 @@ uint_fast32_t needs_flush; }; +struct amdgpu_device_priv { + CursorPtr cursor; + Bool sprite_visible; +}; + +extern DevScreenPrivateKeyRec amdgpu_device_private_key; + typedef struct { EntityInfoPtr pEnt; struct pci_device *PciInfo; @@ -274,6 +281,10 @@ CreateScreenResourcesProcPtr CreateScreenResources; CreateWindowProcPtr CreateWindow; WindowExposuresProcPtr WindowExposures; + miPointerSpriteFuncPtr SpriteFuncs; + + /* Number of SW cursors currently visible on this screen */ + int sprites_visible; Bool IsSecondary; @@ -327,6 +338,7 @@ SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking; } glamor; + xf86CrtcFuncsRec drmmode_crtc_funcs; } AMDGPUInfoRec, *AMDGPUInfoPtr; @@ -335,7 +347,7 @@ /* amdgpu_kms.c */ Bool amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id, - PixmapPtr src_pix, BoxPtr extents); + PixmapPtr src_pix, BoxRec extents); void AMDGPUWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0) , RegionPtr pBSRegion diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_glamor.c xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_glamor.c --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_glamor.c 2017-09-08 07:27:57.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_glamor.c 2018-03-15 15:40:07.000000000 +0000 @@ -323,13 +323,21 @@ void **handle_p) { ScreenPtr screen = pixmap->drawable.pScreen; + AMDGPUInfoPtr info = AMDGPUPTR(xf86ScreenToScrn(screen)); uint64_t tiling_info; CARD16 stride; CARD32 size; + Bool is_linear; int fd; tiling_info = amdgpu_pixmap_get_tiling_info(pixmap); - if (AMDGPU_TILING_GET(tiling_info, ARRAY_MODE) != 0) { + + if (info->family >= AMDGPU_FAMILY_AI) + is_linear = AMDGPU_TILING_GET(tiling_info, SWIZZLE_MODE) == 0; + else + is_linear = AMDGPU_TILING_GET(tiling_info, ARRAY_MODE) == 1; + + if (!is_linear) { PixmapPtr linear; /* We don't want to re-allocate the screen pixmap as diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_kms.c xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_kms.c --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_kms.c 2017-09-08 07:27:57.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_kms.c 2018-03-15 15:40:07.000000000 +0000 @@ -37,6 +37,7 @@ #include "amdgpu_glamor.h" #include "amdgpu_probe.h" #include "micmap.h" +#include "mipointrst.h" #include "amdgpu_version.h" #include "shadow.h" @@ -62,6 +63,7 @@ #include static DevScreenPrivateKeyRec amdgpu_client_private_key; +DevScreenPrivateKeyRec amdgpu_device_private_key; static Bool amdgpu_setup_kernel_mem(ScreenPtr pScreen); @@ -116,16 +118,24 @@ DevUnion *pPriv; AMDGPUEntPtr pAMDGPUEnt; AMDGPUInfoPtr info; + EntityInfoPtr pEnt; if (!pScrn) return; info = AMDGPUPTR(pScrn); - if (info && info->fbcon_pixmap) - pScrn->pScreen->DestroyPixmap(info->fbcon_pixmap); + if (info) { + if (info->fbcon_pixmap) + pScrn->pScreen->DestroyPixmap(info->fbcon_pixmap); + + pEnt = info->pEnt; + free(pScrn->driverPrivate); + pScrn->driverPrivate = NULL; + } else { + pEnt = xf86GetEntityInfo(pScrn->entityList[pScrn->numEntities - 1]); + } - pPriv = xf86GetEntityPrivate(xf86GetEntityInfo(pScrn->entityList[pScrn->numEntities - 1])->index, - gAMDGPUEntityIndex); + pPriv = xf86GetEntityPrivate(pEnt->index, gAMDGPUEntityIndex); pAMDGPUEnt = pPriv->ptr; if (pAMDGPUEnt->fd > 0) { DevUnion *pPriv; @@ -138,11 +148,12 @@ if (!pAMDGPUEnt->fd_ref) { amdgpu_device_deinitialize(pAMDGPUEnt->pDev); amdgpu_kernel_close_fd(pAMDGPUEnt); + free(pPriv->ptr); + pPriv->ptr = NULL; } } - free(pScrn->driverPrivate); - pScrn->driverPrivate = NULL; + free(pEnt); } static void *amdgpuShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, @@ -470,7 +481,8 @@ static void redisplay_dirty(PixmapDirtyUpdatePtr dirty, RegionPtr region) { - ScrnInfoPtr scrn = xf86ScreenToScrn(dirty->slave_dst->drawable.pScreen); + ScrnInfoPtr src_scrn = + xf86ScreenToScrn(amdgpu_dirty_src_drawable(dirty)->pScreen); if (RegionNil(region)) goto out; @@ -484,7 +496,7 @@ PixmapSyncDirtyHelper(dirty, region); #endif - amdgpu_glamor_flush(scrn); + amdgpu_glamor_flush(src_scrn); if (dirty->slave_dst->master_pixmap) DamageRegionProcessPending(&dirty->slave_dst->drawable); @@ -792,21 +804,21 @@ Bool amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id, - PixmapPtr src_pix, BoxPtr extents) + PixmapPtr src_pix, BoxRec extents) { drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private; - RegionRec region = { .extents = *extents, .data = NULL }; + RegionRec region = { .extents = extents, .data = NULL }; ScrnInfoPtr scrn = xf86_crtc->scrn; ScreenPtr pScreen = scrn->pScreen; DrawablePtr pDraw; if (!xf86_crtc->enabled || !drmmode_crtc->scanout[scanout_id].pixmap || - extents->x1 >= extents->x2 || extents->y1 >= extents->y2) + extents.x1 >= extents.x2 || extents.y1 >= extents.y2) return FALSE; pDraw = &drmmode_crtc->scanout[scanout_id].pixmap->drawable; - if (!amdgpu_scanout_extents_intersect(xf86_crtc, extents)) + if (!amdgpu_scanout_extents_intersect(xf86_crtc, &extents)) return FALSE; if (drmmode_crtc->tear_free) { @@ -848,9 +860,9 @@ pScreen->SourceValidate = NULL; CompositePicture(PictOpSrc, src, NULL, dst, - extents->x1, extents->y1, 0, 0, extents->x1, - extents->y1, extents->x2 - extents->x1, - extents->y2 - extents->y1); + extents.x1, extents.y1, 0, 0, extents.x1, + extents.y1, extents.x2 - extents.x1, + extents.y2 - extents.y1); pScreen->SourceValidate = SourceValidate; free_dst: @@ -864,9 +876,9 @@ ValidateGC(pDraw, gc); (*gc->ops->CopyArea)(&src_pix->drawable, pDraw, gc, - xf86_crtc->x + extents->x1, xf86_crtc->y + extents->y1, - extents->x2 - extents->x1, extents->y2 - extents->y1, - extents->x1, extents->y1); + xf86_crtc->x + extents.x1, xf86_crtc->y + extents.y1, + extents.x2 - extents.x1, extents.y2 - extents.y1, + extents.x1, extents.y1); FreeScratchGC(gc); } @@ -896,7 +908,7 @@ drmmode_crtc->dpms_mode == DPMSModeOn) { if (amdgpu_scanout_do_update(crtc, drmmode_crtc->scanout_id, screen->GetWindowPixmap(screen->root), - ®ion->extents)) + region->extents)) RegionEmpty(region); } @@ -977,7 +989,7 @@ scanout_id = drmmode_crtc->scanout_id ^ 1; if (!amdgpu_scanout_do_update(xf86_crtc, scanout_id, pScreen->GetWindowPixmap(pScreen->root), - ®ion->extents)) + region->extents)) return; RegionEmpty(region); @@ -1071,6 +1083,7 @@ case 15: case 16: case 24: + case 30: break; default: @@ -1153,6 +1166,14 @@ use_glamor = FALSE; #endif + if (pScrn->depth == 30 && use_glamor && + xorgGetVersion() < XORG_VERSION_NUMERIC(1,19,99,1,0)) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Depth 30 is not supported by GLAMOR with " + "Xorg < 1.19.99.1\n"); + goto shadowfb; + } + #ifdef DRI2 info->dri2.available = ! !xf86LoadSubModule(pScrn, "dri2"); #endif @@ -1170,15 +1191,16 @@ "ShadowFB\n"); } } else { +shadowfb: xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "GPU acceleration disabled, using ShadowFB\n"); } - info->dri2.available = FALSE; - info->shadow_fb = TRUE; if (!xf86LoadSubModule(pScrn, "shadow")) - info->shadow_fb = FALSE; + return FALSE; + info->dri2.available = FALSE; + info->shadow_fb = TRUE; return TRUE; } @@ -1332,7 +1354,7 @@ && info->pEnt->location.type != BUS_PLATFORM #endif ) - goto fail; + return FALSE; pPriv = xf86GetEntityPrivate(pScrn->entityList[0], getAMDGPUEntityIndex()); @@ -1355,23 +1377,23 @@ pScrn->monitor = pScrn->confScreen->monitor; if (!AMDGPUPreInitVisual(pScrn)) - goto fail; + return FALSE; xf86CollectOptions(pScrn, NULL); if (!(info->Options = malloc(sizeof(AMDGPUOptions_KMS)))) - goto fail; + return FALSE; memcpy(info->Options, AMDGPUOptions_KMS, sizeof(AMDGPUOptions_KMS)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, info->Options); if (!AMDGPUPreInitWeight(pScrn)) - goto fail; + return FALSE; memset(&gpu_info, 0, sizeof(gpu_info)); amdgpu_query_gpu_info(pAMDGPUEnt->pDev, &gpu_info); if (!AMDGPUPreInitChipType_KMS(pScrn, &gpu_info)) - goto fail; + return FALSE; info->dri2.available = FALSE; info->dri2.enabled = FALSE; @@ -1379,7 +1401,7 @@ if (info->dri2.pKernelDRMVersion == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "AMDGPUDRIGetVersion failed to get the DRM version\n"); - goto fail; + return FALSE; } /* Get ScreenInit function */ @@ -1387,7 +1409,7 @@ return FALSE; if (!AMDGPUPreInitAccel_KMS(pScrn)) - goto fail; + return FALSE; amdgpu_drm_queue_init(); @@ -1446,7 +1468,7 @@ FALSE) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Kernel modesetting setup failed\n"); - goto fail; + return FALSE; } AMDGPUSetupCapabilities(pScrn); @@ -1498,14 +1520,10 @@ #endif ) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n"); - goto fail; + return FALSE; } return TRUE; -fail: - AMDGPUFreeRec(pScrn); - return FALSE; - } static Bool AMDGPUCursorInit_KMS(ScreenPtr pScreen) @@ -1513,12 +1531,44 @@ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); AMDGPUInfoPtr info = AMDGPUPTR(pScrn); - return xf86_cursors_init(pScreen, info->cursor_w, info->cursor_h, - (HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | - HARDWARE_CURSOR_AND_SOURCE_WITH_MASK | - HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 | - HARDWARE_CURSOR_UPDATE_UNHIDDEN | - HARDWARE_CURSOR_ARGB)); + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG, + "Initializing Cursor\n"); + + /* Set Silken Mouse */ + xf86SetSilkenMouse(pScreen); + + /* Cursor setup */ + miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); + + if (info->allowPageFlip) { + miPointerScreenPtr PointPriv = + dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); + + if (!dixRegisterScreenPrivateKey(&amdgpu_device_private_key, pScreen, + PRIVATE_DEVICE, + sizeof(struct amdgpu_device_priv))) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "dixRegisterScreenPrivateKey failed\n"); + return FALSE; + } + + info->SpriteFuncs = PointPriv->spriteFuncs; + PointPriv->spriteFuncs = &drmmode_sprite_funcs; + } + + if (xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) + return TRUE; + + if (!xf86_cursors_init(pScreen, info->cursor_w, info->cursor_h, + HARDWARE_CURSOR_TRUECOLOR_AT_8BPP | + HARDWARE_CURSOR_AND_SOURCE_WITH_MASK | + HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_1 | + HARDWARE_CURSOR_UPDATE_UNHIDDEN | + HARDWARE_CURSOR_ARGB)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "xf86_cursors_init failed\n"); + return FALSE; + } + + return TRUE; } void AMDGPUBlank(ScrnInfoPtr pScrn) @@ -1615,6 +1665,7 @@ drmmode_fb_reference(pAMDGPUEnt->fd, &drmmode_crtc->fb, NULL); } + TimerFree(timer); return 0; } @@ -1673,6 +1724,15 @@ amdgpu_glamor_fini(pScreen); pScrn->vtSema = FALSE; xf86ClearPrimInitDone(info->pEnt->index); + + if (info->allowPageFlip) { + miPointerScreenPtr PointPriv = + dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); + + if (PointPriv->spriteFuncs == &drmmode_sprite_funcs) + PointPriv->spriteFuncs = info->SpriteFuncs; + } + pScreen->BlockHandler = info->BlockHandler; pScreen->CloseScreen = info->CloseScreen; return pScreen->CloseScreen(pScreen); @@ -1727,7 +1787,7 @@ if (info->fb_shadow == NULL) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to allocate shadow framebuffer\n"); - info->shadow_fb = FALSE; + return FALSE; } else { if (!fbScreenInit(pScreen, info->fb_shadow, pScrn->virtualX, pScrn->virtualY, @@ -1847,19 +1907,8 @@ "Initializing DPMS\n"); xf86DPMSInit(pScreen, xf86DPMSSet, 0); - xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG, - "Initializing Cursor\n"); - - /* Set Silken Mouse */ - xf86SetSilkenMouse(pScreen); - - /* Cursor setup */ - miDCInitialize(pScreen, xf86GetPointerScreenFuncs()); - - if (!xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE)) { - if (AMDGPUCursorInit_KMS(pScreen)) { - } - } + if (!AMDGPUCursorInit_KMS(pScreen)) + return FALSE; /* DGA setup */ #ifdef XFreeXDGA @@ -1941,6 +1990,33 @@ amdgpu_set_drm_master(pScrn); + if (info->shadow_fb) { + int pitch; + struct amdgpu_buffer *front_buffer = + amdgpu_alloc_pixmap_bo(pScrn, pScrn->virtualX, + pScrn->virtualY, pScrn->depth, + AMDGPU_CREATE_PIXMAP_LINEAR, + pScrn->bitsPerPixel, + &pitch); + + if (front_buffer) { + if (amdgpu_bo_map(pScrn, front_buffer) == 0) { + memset(front_buffer->cpu_ptr, 0, pitch * pScrn->virtualY); + amdgpu_bo_unref(&info->front_buffer); + info->front_buffer = front_buffer; + } else { + amdgpu_bo_unref(&front_buffer); + front_buffer = NULL; + } + } + + if (!front_buffer) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Failed to allocate new scanout BO after VT switch, " + "other DRM masters may see screen contents\n"); + } + } + pScrn->vtSema = TRUE; if (!drmmode_set_desired_modes(pScrn, &info->drmmode, TRUE)) @@ -1963,84 +2039,91 @@ void AMDGPULeaveVT_KMS(ScrnInfoPtr pScrn) { AMDGPUInfoPtr info = AMDGPUPTR(pScrn); - AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn); ScreenPtr pScreen = pScrn->pScreen; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - struct drmmode_scanout black_scanout = { .pixmap = NULL, .bo = NULL }; - xf86CrtcPtr crtc; - drmmode_crtc_private_ptr drmmode_crtc; - unsigned w = 0, h = 0; - int i; xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG, "AMDGPULeaveVT_KMS\n"); - /* Compute maximum scanout dimensions of active CRTCs */ - for (i = 0; i < xf86_config->num_crtc; i++) { - crtc = xf86_config->crtc[i]; - drmmode_crtc = crtc->driver_private; + if (!info->shadow_fb) { + AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); + struct drmmode_scanout black_scanout = { .pixmap = NULL, .bo = NULL }; + xf86CrtcPtr crtc; + drmmode_crtc_private_ptr drmmode_crtc; + unsigned w = 0, h = 0; + int i; + + /* Compute maximum scanout dimensions of active CRTCs */ + for (i = 0; i < xf86_config->num_crtc; i++) { + crtc = xf86_config->crtc[i]; + drmmode_crtc = crtc->driver_private; - if (!drmmode_crtc->fb) - continue; + if (!drmmode_crtc->fb) + continue; - w = max(w, crtc->mode.HDisplay); - h = max(h, crtc->mode.VDisplay); - } + w = max(w, crtc->mode.HDisplay); + h = max(h, crtc->mode.VDisplay); + } - /* Make all active CRTCs scan out from an all-black framebuffer */ - if (w > 0 && h > 0) { - if (drmmode_crtc_scanout_create(crtc, &black_scanout, w, h)) { - struct drmmode_fb *black_fb = - amdgpu_pixmap_get_fb(black_scanout.pixmap); - - amdgpu_pixmap_clear(black_scanout.pixmap); - amdgpu_glamor_finish(pScrn); - - for (i = 0; i < xf86_config->num_crtc; i++) { - crtc = xf86_config->crtc[i]; - drmmode_crtc = crtc->driver_private; - - if (drmmode_crtc->fb) { - if (black_fb) { - drmmode_set_mode(crtc, black_fb, &crtc->mode, 0, 0); - } else { - drmModeSetCrtc(pAMDGPUEnt->fd, - drmmode_crtc->mode_crtc->crtc_id, 0, 0, - 0, NULL, 0, NULL); - drmmode_fb_reference(pAMDGPUEnt->fd, &drmmode_crtc->fb, - NULL); - } + /* Make all active CRTCs scan out from an all-black framebuffer */ + if (w > 0 && h > 0) { + if (drmmode_crtc_scanout_create(crtc, &black_scanout, w, h)) { + struct drmmode_fb *black_fb = + amdgpu_pixmap_get_fb(black_scanout.pixmap); + + amdgpu_pixmap_clear(black_scanout.pixmap); + amdgpu_glamor_finish(pScrn); + + for (i = 0; i < xf86_config->num_crtc; i++) { + crtc = xf86_config->crtc[i]; + drmmode_crtc = crtc->driver_private; - if (pScrn->is_gpu) { - if (drmmode_crtc->scanout[0].pixmap) - pixmap_unref_fb(drmmode_crtc->scanout[0].pixmap, - None, pAMDGPUEnt); - if (drmmode_crtc->scanout[1].pixmap) - pixmap_unref_fb(drmmode_crtc->scanout[1].pixmap, - None, pAMDGPUEnt); - } else { - drmmode_crtc_scanout_free(drmmode_crtc); + if (drmmode_crtc->fb) { + if (black_fb) { + drmmode_set_mode(crtc, black_fb, &crtc->mode, 0, 0); + } else { + drmModeSetCrtc(pAMDGPUEnt->fd, + drmmode_crtc->mode_crtc->crtc_id, 0, + 0, 0, NULL, 0, NULL); + drmmode_fb_reference(pAMDGPUEnt->fd, + &drmmode_crtc->fb, NULL); + } + + if (pScrn->is_gpu) { + if (drmmode_crtc->scanout[0].pixmap) + pixmap_unref_fb(drmmode_crtc->scanout[0].pixmap, + None, pAMDGPUEnt); + if (drmmode_crtc->scanout[1].pixmap) + pixmap_unref_fb(drmmode_crtc->scanout[1].pixmap, + None, pAMDGPUEnt); + } else { + drmmode_crtc_scanout_free(drmmode_crtc); + } } } } } - } - xf86RotateFreeShadow(pScrn); - drmmode_crtc_scanout_destroy(&info->drmmode, &black_scanout); + xf86RotateFreeShadow(pScrn); + drmmode_crtc_scanout_destroy(&info->drmmode, &black_scanout); - /* Unreference FBs of all pixmaps. After this, the only FB remaining - * should be the all-black one being scanned out by active CRTCs - */ - for (i = 0; i < currentMaxClients; i++) { - if (i > 0 && - (!clients[i] || clients[i]->clientState != ClientStateRunning)) - continue; + /* Unreference FBs of all pixmaps. After this, the only FB remaining + * should be the all-black one being scanned out by active CRTCs + */ + for (i = 0; i < currentMaxClients; i++) { + if (i > 0 && + (!clients[i] || clients[i]->clientState != ClientStateRunning)) + continue; - FindClientResourcesByType(clients[i], RT_PIXMAP, pixmap_unref_fb, - pAMDGPUEnt); + FindClientResourcesByType(clients[i], RT_PIXMAP, pixmap_unref_fb, + pAMDGPUEnt); + } + + pixmap_unref_fb(pScreen->GetScreenPixmap(pScreen), None, pAMDGPUEnt); + } else { + memset(info->front_buffer->cpu_ptr, 0, pScrn->virtualX * + info->pixel_bytes * pScrn->virtualY); } - pixmap_unref_fb(pScreen->GetScreenPixmap(pScreen), None, pAMDGPUEnt); TimerSet(NULL, 0, 1000, cleanup_black_fb, pScreen); diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_pixmap.h xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_pixmap.h --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_pixmap.h 2017-09-08 07:27:57.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_pixmap.h 2018-03-15 15:40:07.000000000 +0000 @@ -104,8 +104,8 @@ } static inline struct drmmode_fb* -amdgpu_fb_create(int drm_fd, uint32_t width, uint32_t height, uint8_t depth, - uint8_t bpp, uint32_t pitch, uint32_t handle) +amdgpu_fb_create(ScrnInfoPtr scrn, int drm_fd, uint32_t width, uint32_t height, + uint32_t pitch, uint32_t handle) { struct drmmode_fb *fb = malloc(sizeof(*fb)); @@ -113,8 +113,8 @@ return NULL; fb->refcnt = 1; - if (drmModeAddFB(drm_fd, width, height, depth, bpp, pitch, handle, - &fb->handle) == 0) + if (drmModeAddFB(drm_fd, width, height, scrn->depth, scrn->bitsPerPixel, + pitch, handle, &fb->handle) == 0) return fb; free(fb); @@ -154,9 +154,8 @@ ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen); AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn); - *fb_ptr = amdgpu_fb_create(pAMDGPUEnt->fd, pix->drawable.width, - pix->drawable.height, pix->drawable.depth, - pix->drawable.bitsPerPixel, pix->devKind, + *fb_ptr = amdgpu_fb_create(scrn, pAMDGPUEnt->fd, pix->drawable.width, + pix->drawable.height, pix->devKind, handle); } } diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_present.c xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_present.c --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_present.c 2017-09-08 07:27:57.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_present.c 2018-03-15 15:40:07.000000000 +0000 @@ -273,7 +273,7 @@ if (!info->allowPageFlip) return FALSE; - if (info->hwcursor_disabled) + if (info->sprites_visible > 0) return FALSE; if (info->drmmode.dri2_flipping) diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_probe.c xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_probe.c --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/amdgpu_probe.c 2017-09-08 07:27:57.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/amdgpu_probe.c 2018-03-15 15:40:07.000000000 +0000 @@ -177,7 +177,7 @@ { ScrnInfoPtr pScrn = NULL; char *busid; - EntityInfoPtr pEnt; + EntityInfoPtr pEnt = NULL; DevUnion *pPriv; AMDGPUEntPtr pAMDGPUEnt; @@ -227,7 +227,7 @@ pAMDGPUEnt = pPriv->ptr; if (!amdgpu_open_drm_master(pScrn, pAMDGPUEnt, busid)) - goto error_fd; + goto error; pAMDGPUEnt->fd_ref = 1; @@ -255,9 +255,8 @@ error_amdgpu: amdgpu_kernel_close_fd(pAMDGPUEnt); -error_fd: - free(pPriv->ptr); error: + free(pEnt); free(busid); return FALSE; } @@ -296,7 +295,7 @@ ScrnInfoPtr pScrn; int scr_flags = 0; char *busid; - EntityInfoPtr pEnt; + EntityInfoPtr pEnt = NULL; DevUnion *pPriv; AMDGPUEntPtr pAMDGPUEnt; @@ -352,7 +351,7 @@ pAMDGPUEnt->platform_dev = dev; pAMDGPUEnt->fd = amdgpu_kernel_open_fd(pScrn, busid, dev); if (pAMDGPUEnt->fd < 0) - goto error_fd; + goto error; pAMDGPUEnt->fd_ref = 1; @@ -380,9 +379,8 @@ error_amdgpu: amdgpu_kernel_close_fd(pAMDGPUEnt); -error_fd: - free(pPriv->ptr); error: + free(pEnt); free(busid); return FALSE; } diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/drmmode_display.c xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/drmmode_display.c --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/drmmode_display.c 2017-09-08 07:27:57.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/drmmode_display.c 2018-03-15 15:40:07.000000000 +0000 @@ -34,8 +34,10 @@ #include #include "cursorstr.h" #include "damagestr.h" +#include "inputstr.h" #include "list.h" #include "micmap.h" +#include "mipointrst.h" #include "xf86cmap.h" #include "xf86Priv.h" #include "sarea.h" @@ -752,7 +754,7 @@ amdgpu_scanout_do_update(crtc, scanout_id, screen->GetWindowPixmap(screen->root), - box); + *box); amdgpu_glamor_finish(scrn); } } @@ -857,8 +859,11 @@ if (drmmode_crtc->tear_free) scanout_id = drmmode_crtc->scanout_id; - drmmode_crtc_gamma_do_set(crtc, crtc->gamma_red, crtc->gamma_green, - crtc->gamma_blue, crtc->gamma_size); + /* gamma is disabled in kernel driver for deep color */ + if (pScrn->depth != 30) + drmmode_crtc_gamma_do_set( + crtc, crtc->gamma_red, crtc->gamma_green, + crtc->gamma_blue, crtc->gamma_size); if (drmmode_crtc->prime_scanout_pixmap) { drmmode_crtc_prime_scanout_update(crtc, mode, scanout_id, @@ -881,9 +886,8 @@ union gbm_bo_handle bo_handle; bo_handle = gbm_bo_get_handle(info->front_buffer->bo.gbm); - fb = amdgpu_fb_create(pAMDGPUEnt->fd, pScrn->virtualX, - pScrn->virtualY, pScrn->depth, - pScrn->bitsPerPixel, + fb = amdgpu_fb_create(pScrn, pAMDGPUEnt->fd, + pScrn->virtualX, pScrn->virtualY, pScrn->displayWidth * info->pixel_bytes, bo_handle.u32); /* Prevent refcnt of ad-hoc FBs from reaching 2 */ @@ -1343,8 +1347,9 @@ xf86CrtcPtr crtc; drmmode_crtc_private_ptr drmmode_crtc; AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn); + AMDGPUInfoPtr info = AMDGPUPTR(pScrn); - crtc = xf86CrtcCreate(pScrn, &drmmode_crtc_funcs); + crtc = xf86CrtcCreate(pScrn, &info->drmmode_crtc_funcs); if (crtc == NULL) return 0; @@ -1364,6 +1369,72 @@ return 1; } +/* + * Update all of the property values for an output + */ +static void +drmmode_output_update_properties(xf86OutputPtr output) +{ + drmmode_output_private_ptr drmmode_output = output->driver_private; + int i, j, k; + int err; + drmModeConnectorPtr koutput; + + /* Use the most recently fetched values from the kernel */ + koutput = drmmode_output->mode_output; + + if (!koutput) + return; + + for (i = 0; i < drmmode_output->num_props; i++) { + drmmode_prop_ptr p = &drmmode_output->props[i]; + + for (j = 0; j < koutput->count_props; j++) { + if (koutput->props[j] != p->mode_prop->prop_id) + continue; + + /* Check to see if the property value has changed */ + if (koutput->prop_values[j] == p->value) + break; + + p->value = koutput->prop_values[j]; + + if (p->mode_prop->flags & DRM_MODE_PROP_RANGE) { + INT32 value = p->value; + + err = RRChangeOutputProperty(output->randr_output, + p->atoms[0], XA_INTEGER, + 32, PropModeReplace, 1, + &value, FALSE, TRUE); + if (err != 0) { + xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, + "RRChangeOutputProperty error, %d\n", + err); + } + } else if (p->mode_prop->flags & DRM_MODE_PROP_ENUM) { + for (k = 0; k < p->mode_prop->count_enums; k++) { + if (p->mode_prop->enums[k].value == p->value) + break; + } + if (k < p->mode_prop->count_enums) { + err = RRChangeOutputProperty(output->randr_output, + p->atoms[0], XA_ATOM, + 32, PropModeReplace, 1, + &p->atoms[k + 1], FALSE, + TRUE); + if (err != 0) { + xf86DrvMsg(output->scrn->scrnIndex, X_ERROR, + "RRChangeOutputProperty error, %d\n", + err); + } + } + } + + break; + } + } +} + static xf86OutputStatus drmmode_output_detect(xf86OutputPtr output) { /* go to the hw and retrieve a new output struct */ @@ -1374,8 +1445,12 @@ drmmode_output->mode_output = drmModeGetConnector(pAMDGPUEnt->fd, drmmode_output->output_id); - if (!drmmode_output->mode_output) + if (!drmmode_output->mode_output) { + drmmode_output->output_id = -1; return XF86OutputStatusDisconnected; + } + + drmmode_output_update_properties(output); switch (drmmode_output->mode_output->connection) { case DRM_MODE_CONNECTED: @@ -1398,6 +1473,51 @@ return MODE_OK; } +static int +koutput_get_prop_idx(int fd, drmModeConnectorPtr koutput, + int type, const char *name) +{ + int idx = -1; + + for (int i = 0; i < koutput->count_props; i++) { + drmModePropertyPtr prop = drmModeGetProperty(fd, koutput->props[i]); + + if (!prop) + continue; + + if (drm_property_type_is(prop, type) && !strcmp(prop->name, name)) + idx = i; + + drmModeFreeProperty(prop); + + if (idx > -1) + break; + } + + return idx; +} + +static int +koutput_get_prop_id(int fd, drmModeConnectorPtr koutput, + int type, const char *name) +{ + int idx = koutput_get_prop_idx(fd, koutput, type, name); + + return (idx > -1) ? koutput->props[idx] : -1; +} + +static drmModePropertyBlobPtr +koutput_get_prop_blob(int fd, drmModeConnectorPtr koutput, const char *name) +{ + drmModePropertyBlobPtr blob = NULL; + int idx = koutput_get_prop_idx(fd, koutput, DRM_MODE_PROP_BLOB, name); + + if (idx > -1) + blob = drmModeGetPropertyBlob(fd, koutput->prop_values[idx]); + + return blob; +} + static DisplayModePtr drmmode_output_get_modes(xf86OutputPtr output) { drmmode_output_private_ptr drmmode_output = output->driver_private; @@ -1405,29 +1525,16 @@ AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(output->scrn); int i; DisplayModePtr Modes = NULL, Mode; - drmModePropertyPtr props; xf86MonPtr mon = NULL; if (!koutput) return NULL; + drmModeFreePropertyBlob(drmmode_output->edid_blob); + /* look for an EDID property */ - for (i = 0; i < koutput->count_props; i++) { - props = drmModeGetProperty(pAMDGPUEnt->fd, koutput->props[i]); - if (props && (props->flags & DRM_MODE_PROP_BLOB)) { - if (!strcmp(props->name, "EDID")) { - if (drmmode_output->edid_blob) - drmModeFreePropertyBlob - (drmmode_output->edid_blob); - drmmode_output->edid_blob = - drmModeGetPropertyBlob(pAMDGPUEnt->fd, - koutput->prop_values - [i]); - } - } - if (props) - drmModeFreeProperty(props); - } + drmmode_output->edid_blob = + koutput_get_prop_blob(pAMDGPUEnt->fd, koutput, "EDID"); if (drmmode_output->edid_blob) { mon = xf86InterpretEDID(output->scrn->scrnIndex, @@ -1871,7 +1978,6 @@ drmModeConnectorPtr koutput; drmModeEncoderPtr *kencoders = NULL; drmmode_output_private_ptr drmmode_output; - drmModePropertyPtr props; drmModePropertyBlobPtr path_blob = NULL; char name[32]; int i; @@ -1883,17 +1989,7 @@ if (!koutput) return 0; - for (i = 0; i < koutput->count_props; i++) { - props = drmModeGetProperty(pAMDGPUEnt->fd, koutput->props[i]); - if (props && (props->flags & DRM_MODE_PROP_BLOB)) { - if (!strcmp(props->name, "PATH")) { - path_blob = drmModeGetPropertyBlob(pAMDGPUEnt->fd, koutput->prop_values[i]); - drmModeFreeProperty(props); - break; - } - drmModeFreeProperty(props); - } - } + path_blob = koutput_get_prop_blob(pAMDGPUEnt->fd, koutput, "PATH"); kencoders = calloc(sizeof(drmModeEncoderPtr), koutput->count_encoders); if (!kencoders) { @@ -1977,18 +2073,9 @@ /* work out the possible clones later */ output->possible_clones = 0; - for (i = 0; i < koutput->count_props; i++) { - props = drmModeGetProperty(pAMDGPUEnt->fd, koutput->props[i]); - if (props && (props->flags & DRM_MODE_PROP_ENUM)) { - if (!strcmp(props->name, "DPMS")) { - drmmode_output->dpms_enum_id = - koutput->props[i]; - drmModeFreeProperty(props); - break; - } - drmModeFreeProperty(props); - } - } + drmmode_output->dpms_enum_id = + koutput_get_prop_id(pAMDGPUEnt->fd, koutput, DRM_MODE_PROP_ENUM, + "DPMS"); if (dynamic) { output->randr_output = RROutputCreate(xf86ScrnToScreen(pScrn), output->name, strlen(output->name), output); @@ -2347,13 +2434,24 @@ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, AMDGPU_LOGLEVEL_DEBUG, "%d crtcs needed for screen.\n", crtcs_needed); + /* Need per-screen drmmode_crtc_funcs, based on our global template, + * so we can disable some functions, depending on screen settings. + */ + info->drmmode_crtc_funcs = drmmode_crtc_funcs; + if (!info->use_glamor) { /* Rotation requires hardware acceleration */ - drmmode_crtc_funcs.shadow_allocate = NULL; - drmmode_crtc_funcs.shadow_create = NULL; - drmmode_crtc_funcs.shadow_destroy = NULL; + info->drmmode_crtc_funcs.shadow_allocate = NULL; + info->drmmode_crtc_funcs.shadow_create = NULL; + info->drmmode_crtc_funcs.shadow_destroy = NULL; } + /* Hw gamma lut's are currently bypassed by the hw at color depth 30, + * so spare the server the effort to compute and update the cluts. + */ + if (pScrn->depth == 30) + info->drmmode_crtc_funcs.gamma_set = NULL; + for (i = 0; i < mode_res->count_crtcs; i++) if (!xf86IsEntityShared(pScrn->entityList[0]) || (crtcs_needed && !(pAMDGPUEnt->assigned_crtcs & (1 << i)))) @@ -2431,6 +2529,105 @@ drmmode_crtc_scanout_free(config->crtc[c]->driver_private); } +static void drmmode_sprite_do_set_cursor(struct amdgpu_device_priv *device_priv, + ScrnInfoPtr scrn, int x, int y) +{ + AMDGPUInfoPtr info = AMDGPUPTR(scrn); + CursorPtr cursor = device_priv->cursor; + Bool sprite_visible = device_priv->sprite_visible; + + if (cursor) { + x -= cursor->bits->xhot; + y -= cursor->bits->yhot; + + device_priv->sprite_visible = + x < scrn->virtualX && y < scrn->virtualY && + (x + cursor->bits->width > 0) && + (y + cursor->bits->height > 0); + } else { + device_priv->sprite_visible = FALSE; + } + + info->sprites_visible += device_priv->sprite_visible - sprite_visible; +} + +static void drmmode_sprite_set_cursor(DeviceIntPtr pDev, ScreenPtr pScreen, + CursorPtr pCursor, int x, int y) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); + AMDGPUInfoPtr info = AMDGPUPTR(scrn); + struct amdgpu_device_priv *device_priv = + dixLookupScreenPrivate(&pDev->devPrivates, + &amdgpu_device_private_key, pScreen); + + device_priv->cursor = pCursor; + drmmode_sprite_do_set_cursor(device_priv, scrn, x, y); + + info->SpriteFuncs->SetCursor(pDev, pScreen, pCursor, x, y); +} + +static void drmmode_sprite_move_cursor(DeviceIntPtr pDev, ScreenPtr pScreen, + int x, int y) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); + AMDGPUInfoPtr info = AMDGPUPTR(scrn); + struct amdgpu_device_priv *device_priv = + dixLookupScreenPrivate(&pDev->devPrivates, + &amdgpu_device_private_key, pScreen); + + drmmode_sprite_do_set_cursor(device_priv, scrn, x, y); + + info->SpriteFuncs->MoveCursor(pDev, pScreen, x, y); +} + +static Bool drmmode_sprite_realize_realize_cursor(DeviceIntPtr pDev, + ScreenPtr pScreen, + CursorPtr pCursor) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); + AMDGPUInfoPtr info = AMDGPUPTR(scrn); + + return info->SpriteFuncs->RealizeCursor(pDev, pScreen, pCursor); +} + +static Bool drmmode_sprite_realize_unrealize_cursor(DeviceIntPtr pDev, + ScreenPtr pScreen, + CursorPtr pCursor) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); + AMDGPUInfoPtr info = AMDGPUPTR(scrn); + + return info->SpriteFuncs->UnrealizeCursor(pDev, pScreen, pCursor); +} + +static Bool drmmode_sprite_device_cursor_initialize(DeviceIntPtr pDev, + ScreenPtr pScreen) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); + AMDGPUInfoPtr info = AMDGPUPTR(scrn); + + return info->SpriteFuncs->DeviceCursorInitialize(pDev, pScreen); +} + +static void drmmode_sprite_device_cursor_cleanup(DeviceIntPtr pDev, + ScreenPtr pScreen) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); + AMDGPUInfoPtr info = AMDGPUPTR(scrn); + + info->SpriteFuncs->DeviceCursorCleanup(pDev, pScreen); +} + +miPointerSpriteFuncRec drmmode_sprite_funcs = { + .RealizeCursor = drmmode_sprite_realize_realize_cursor, + .UnrealizeCursor = drmmode_sprite_realize_unrealize_cursor, + .SetCursor = drmmode_sprite_set_cursor, + .MoveCursor = drmmode_sprite_move_cursor, + .DeviceCursorInitialize = drmmode_sprite_device_cursor_initialize, + .DeviceCursorCleanup = drmmode_sprite_device_cursor_cleanup, +}; + + void drmmode_set_cursor(ScrnInfoPtr scrn, drmmode_ptr drmmode, int id, struct amdgpu_buffer *bo) { @@ -2457,26 +2654,36 @@ { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn); + unsigned num_desired = 0, num_on = 0; int c; + /* First, disable all unused CRTCs */ + if (set_hw) { + for (c = 0; c < config->num_crtc; c++) { + xf86CrtcPtr crtc = config->crtc[c]; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + /* Skip disabled CRTCs */ + if (crtc->enabled) + continue; + + drmmode_do_crtc_dpms(crtc, DPMSModeOff); + drmModeSetCrtc(pAMDGPUEnt->fd, + drmmode_crtc->mode_crtc->crtc_id, + 0, 0, 0, NULL, 0, NULL); + drmmode_fb_reference(pAMDGPUEnt->fd, + &drmmode_crtc->fb, NULL); + } + } + + /* Then, try setting the chosen mode on each CRTC */ for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; xf86OutputPtr output = NULL; int o; - /* Skip disabled CRTCs */ - if (!crtc->enabled) { - if (set_hw) { - drmmode_do_crtc_dpms(crtc, DPMSModeOff); - drmModeSetCrtc(pAMDGPUEnt->fd, - drmmode_crtc->mode_crtc->crtc_id, - 0, 0, 0, NULL, 0, NULL); - drmmode_fb_reference(pAMDGPUEnt->fd, - &drmmode_crtc->fb, NULL); - } + if (!crtc->enabled) continue; - } if (config->output[config->compat_output]->crtc == crtc) output = config->output[config->compat_output]; @@ -2491,6 +2698,8 @@ if (!output) continue; + num_desired++; + /* Mark that we'll need to re-set the mode for sure */ memset(&crtc->mode, 0, sizeof(crtc->mode)); if (!crtc->desiredMode.CrtcHDisplay) { @@ -2498,8 +2707,11 @@ pScrn-> currentMode); - if (!mode) - return FALSE; + if (!mode) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Failed to find mode for CRTC %d\n", c); + continue; + } crtc->desiredMode = *mode; crtc->desiredRotation = RR_Rotate_0; crtc->desiredX = 0; @@ -2507,20 +2719,30 @@ } if (set_hw) { - if (!crtc->funcs->set_mode_major(crtc, &crtc->desiredMode, - crtc->desiredRotation, - crtc->desiredX, - crtc->desiredY)) - return FALSE; + if (crtc->funcs->set_mode_major(crtc, &crtc->desiredMode, + crtc->desiredRotation, + crtc->desiredX, + crtc->desiredY)) { + num_on++; + } else { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Failed to set mode on CRTC %d\n", c); + } } else { crtc->mode = crtc->desiredMode; crtc->rotation = crtc->desiredRotation; crtc->x = crtc->desiredX; crtc->y = crtc->desiredY; - if (!drmmode_handle_transform(crtc)) - return FALSE; + if (drmmode_handle_transform(crtc)) + num_on++; } } + + if (num_on == 0 && num_desired > 0) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to enable any CRTC\n"); + return FALSE; + } + return TRUE; } @@ -2533,8 +2755,9 @@ "Initializing kms color map\n"); if (!miCreateDefColormap(pScreen)) return FALSE; - /* all amdgpus support 10 bit CLUTs */ - if (!xf86HandleColormaps(pScreen, 256, 10, + /* All radeons support 10 bit CLUTs. They get bypassed at depth 30. */ + if (pScrn->depth != 30 && + !xf86HandleColormaps(pScreen, 256, 10, NULL, NULL, CMAP_PALETTED_TRUECOLOR #if 0 /* This option messes up text mode! (eich@suse.de) */ @@ -2599,23 +2822,23 @@ */ for (i = 0; i < config->num_output; i++) { xf86OutputPtr output = config->output[i]; + xf86CrtcPtr crtc = output->crtc; drmmode_output_private_ptr drmmode_output = output->driver_private; - uint32_t con_id = drmmode_output->mode_output->connector_id; - drmModeConnectorPtr koutput; + + drmmode_output_detect(output); + + if (!crtc || !drmmode_output->mode_output) + continue; /* Get an updated view of the properties for the current connector and * look for the link-status property */ - koutput = drmModeGetConnectorCurrent(pAMDGPUEnt->fd, con_id); - for (j = 0; koutput && j < koutput->count_props; j++) { - drmModePropertyPtr props; - props = drmModeGetProperty(pAMDGPUEnt->fd, koutput->props[j]); - if (props && props->flags & DRM_MODE_PROP_ENUM && - !strcmp(props->name, "link-status") && - koutput->prop_values[j] == DRM_MODE_LINK_STATUS_BAD) { - xf86CrtcPtr crtc = output->crtc; - if (!crtc) - continue; + for (j = 0; j < drmmode_output->num_props; j++) { + drmmode_prop_ptr p = &drmmode_output->props[j]; + + if (!strcmp(p->mode_prop->name, "link-status")) { + if (p->value != DRM_MODE_LINK_STATUS_BAD) + break; /* the connector got a link failure, re-set the current mode */ drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation, @@ -2623,12 +2846,13 @@ xf86DrvMsg(scrn->scrnIndex, X_WARNING, "hotplug event: connector %u's link-state is BAD, " - "tried resetting the current mode. You may be left " - "with a black screen if this fails...\n", con_id); + "tried resetting the current mode. You may be left" + "with a black screen if this fails...\n", + drmmode_output->mode_output->connector_id); + + break; } - drmModeFreeProperty(props); } - drmModeFreeConnector(koutput); } mode_res = drmModeGetResources(pAMDGPUEnt->fd); @@ -2855,7 +3079,7 @@ } amdgpu_scanout_do_update(crtc, scanout_id, new_front, - &extents); + extents); drmmode_crtc_wait_pending_event(drmmode_crtc, pAMDGPUEnt->fd, drmmode_crtc->scanout_update_pending); diff -Nru xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/drmmode_display.h xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/drmmode_display.h --- xserver-xorg-video-amdgpu-hwe-16.04-1.4.0/src/drmmode_display.h 2017-09-08 07:27:57.000000000 +0000 +++ xserver-xorg-video-amdgpu-hwe-16.04-18.0.1/src/drmmode_display.h 2018-03-15 15:40:07.000000000 +0000 @@ -235,4 +235,7 @@ uint64_t *ust, uint32_t *result_seq); +miPointerSpriteFuncRec drmmode_sprite_funcs; + + #endif