diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/ChangeLog xserver-xorg-video-intel-2.99.917+git20161127.bde94605/ChangeLog --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/ChangeLog 2016-10-10 06:23:54.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/ChangeLog 2016-11-27 15:38:05.000000000 +0000 @@ -1,9 +1,322 @@ -commit 028215a25b7f18ad3e0928fb352f9ad332e8e6d3 +commit 50f6fbb60f07b9a40b8f41c6c6c2745f13bb23da Author: Rico Tzschichholz -Date: Mon Oct 10 08:23:23 2016 +0200 +Date: Sun Nov 27 16:37:38 2016 +0100 Add debian tree from origin/ubuntu +commit bde946054efbc1c7ae1483b84c3b4fa3c2c7e2ec +Author: Chris Wilson +Date: Thu Nov 17 19:22:02 2016 +0000 + + backlight: Protect iface writes against signal interruptions + + Handle EINTR (and EAGAIN) by repeating until the write is complete. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=98759 + Signed-off-by: Chris Wilson + +commit 04491bbdaa461aff1a6734a4c2cda093a8ce3482 +Author: Chris Wilson +Date: Fri Nov 18 16:31:44 2016 +0000 + + sna: Set reprobe flag on attached connectors after setcrtc failure + + The most common cause of SETCRTC failure is if the connectors disappear. + Force the reprobe on these after a failure. + + Signed-off-by: Chris Wilson + +commit a1a0f76e55d8dfbbf27a288b71b4bd3edbfbe836 +Author: Matt Roper +Date: Tue Nov 15 14:36:19 2016 -0800 + + sna: Ensure we re-calculate fb_to_cursor transform if sharing cursor + + If we find that we're sharing the cursor, we wind up bailing out of + __sna_get_cursor() before the fb_to_cursor transform is computed. For + rotated displays, this can prevent the hotspot transformation from + happening properly, so the cursor's visible position won't match the + software's idea of where it is. + + Cc: Chris Wilson + Signed-off-by: Matt Roper + +commit 0472b1f0fe1510c9709279d30ae033d766f44118 +Author: Chris Wilson +Date: Tue Nov 15 22:01:10 2016 +0000 + + sna: Acquire cursor before use in sna_cursor_set_position() + + sna_cursor_set_position() requires an already computed cursor + transformation matrix in order to determine whether the cursor is + visible. This is computed in __sna_get_cursor() which is currently only + called for visible cursors - i.e. we were using uninitialised state. + + Reported-by: Matt Roper + Signed-off-by: Chris Wilson + +commit 01114334dd893863ad4bbe72fc94a278aa36bfa5 +Author: Chris Wilson +Date: Tue Nov 15 21:58:26 2016 +0000 + + sna: Recompute the cursor after a modeset + + As a modeset may adjust the rotation or the transform of the cursor, we + may need to recompute the cursor image afterwards. + + Reported-by: Matt Roper + Signed-off-by: Chris Wilson + +commit d1d14f20cfd6412adbd6f937f54c814c2a332e6f +Author: Sergei Trofimovich +Date: Fri Nov 11 09:00:15 2016 +0000 + + brw_eu_emit.c: fix wrong test on a register type + + Caught by gcc-6 as: + brw_eu_emit.c:180:49: warning: logical 'and' of equal expressions [-Wlogical-op] + + if (reg.file == BRW_ARCHITECTURE_REGISTER_FILE && + reg.file == BRW_ARF_NULL) + return; + + Change uses 'reg.nr' test for 'BRW_ARF_NULL'. + + Signed-off-by: Sergei Trofimovich + Signed-off-by: Chris Wilson + +commit dad64e9f76c718033402be7bfd2129866d492304 +Author: Chris Wilson +Date: Thu Nov 10 15:38:18 2016 +0000 + + sna/video: Mark the bo as clean after a setplane + + The kernel will flush it, so we can treat it as clean after a successful + setplane. + + Signed-off-by: Chris Wilson + +commit 65b680e6cf6b710e6feb23d707f728e89bee4a22 +Author: Chris Wilson +Date: Thu Nov 10 15:36:23 2016 +0000 + + sna/video: Don't skip setplane if this frame.bo is the same as the last + + Always show the image, even if the bo doesn't appear to change as the + client may have put fresh data in the shared buffer and repositioned the + image. + + Suggested-by: Ville Syrjala + Signed-off-by: Chris Wilson + +commit 6d7e13f78b63bc21f82056ca6814c54f39adb9e8 +Author: Chris Wilson +Date: Thu Nov 10 15:28:56 2016 +0000 + + sna/video: Add tiling modifiers for addfb2 + + In case we do end up with a tiled buffer, create the framebuffer + appropriately. + + Suggested-by: Ville Syrjala + Signed-off-by: Chris Wilson + +commit f3809df493bfc825fe4068566bb3210e772a6594 +Author: Chris Wilson +Date: Thu Nov 10 15:26:14 2016 +0000 + + sna/video: Pass the dst extents to xf86XVClipVideoHelper() + + xf86XVClipVideoHelper wants to measure from the origin of the target + extents to the clip in order to determine the right offset into the + source. + + Suggested-by: Ville Syrjala + Signed-off-by: Chris Wilson + +commit 6c8fc4434330ee37a290b6cf466af3282d09a8b3 +Author: Chris Wilson +Date: Sat Nov 5 23:40:28 2016 +0000 + + sna: Mark up CPU writes for scanout flush + + When we flip to a bo, the kernel will flush it from the CPU write domain + and so afterwards we need to do a new set-domain to mark up a subsequent + CPU write (and flush before another flip). + + References: https://bugs.freedesktop.org/show_bug.cgi?id=95414 + Signed-off-by: Chris Wilson + +commit bf7316a4539afdf7a742d2b2ccbbaa5f27918255 +Author: Chris Wilson +Date: Thu Nov 3 10:38:19 2016 +0000 + + sna/dri2: Don't request a signal following a dead flip completion + + If we do flip to restore the bo after the current Window is destroyed, + we should not request that we send an event back to the client. + + Signed-off-by: Chris Wilson + +commit 40e3be34367141c952678f456f0e0d4632b6c266 +Author: Chris Wilson +Date: Thu Nov 3 10:18:32 2016 +0000 + + sna/dri2: Complete the final flip in a chain after the window is destroyed + + When the pending flip is queued, we update all the Windows to use the + next bo as their rendering target. However, that bo is not yet the + scanout until the future flip is performed. If the current fullscreen + Window is destroyed, we still must allow that flip to proceed or else + the old bo is left on the scanout. + + And yes, this is indeed a fix to one of the debug patches that intended + to detect the error causing #93844. Irony. + + Fixes: 7817949314a2 ("sna/dri2: Avoiding marking a pending-signal on a dead Drawable") + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93844 + Reported-by: Diego Viola + Signed-off-by: Chris Wilson + +commit 47da17fe745efeef61a6f5106f5b888fd7abfb06 +Author: Chris Wilson +Date: Thu Oct 27 18:13:31 2016 +0100 + + sna: Load DRI3 if try to load DRI2 and fail + + As a backup in case DRI2 is disabled due to the presence of vgaarb, make + sure we have DRI3 loaded. + + Signed-off-by: Chris Wilson + +commit 714052fb32a3c521efb295f2c400a673d515fb77 +Author: Chris Wilson +Date: Mon Oct 24 22:22:44 2016 +0100 + + sna: Keep the backlight iface name on the heap + + When finding the per-connector backlight interface, we have to take a + copy of the interface name for later use, as in this case it is not + constant. + + Signed-off-by: Chris Wilson + +commit 325570e731b5819e28ce6bae72242914bb2d7f8e +Author: Chris Wilson +Date: Mon Oct 24 15:23:33 2016 +0100 + + sna: Check for the per-connector backlight sysfs interface + + Modern kernels include a link from the sysfs connector directory to the + backlight interface on that connector. Try to find that link first as + this should allow us to enable backlight interfaces on connectors other + than the presumed solitary panel. + + Signed-off-by: Chris Wilson + +commit 388fd4a65411f4984768132eab380b9a67f14e3c +Author: Chris Wilson +Date: Sun Oct 23 20:52:55 2016 +0100 + + sna: Check current fb id before flip as well as after + + More debug sanity checks that pageflips work. + + Signed-off-by: Chris Wilson + +commit 90172d81ea762eeca4cfb3796fab83cff9f0acaa +Author: Chris Wilson +Date: Sat Oct 22 21:06:11 2016 +0100 + + sna: Allow Option DPMS to switch on (but not off) + + We start off the system with the screens blanked, waiting the first + dixSaveScreen unblank, where we then apply the accumulated modesets. + This means we have to allow that even if Option DPMS off, and so we + restrict the Option to only enable DPMS (then once enabled they will not + turn off). + + References: https://bugs.freedesktop.org/show_bug.cgi?id=98375 + Signed-off-by: Chris Wilson + +commit b7d6f695ddab02b7afef0f1ca3ae132f4fdbfd43 +Author: Chris Wilson +Date: Fri Oct 21 23:11:42 2016 +0100 + + sna: Disable screen saver if Option "DPMS" is specified + + The defacto standard is that the screensaver only blanks the screen but + keeps the outputs alive. We differ by actually disabling the CRTC when + the screen saver kicks in (to save power), however this circumvents + Option "DPMS". + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98375 + Signed-off-by: Chris Wilson + +commit f18c7620cfba8412b0d141748fbb195670984ad2 +Author: Chris Wilson +Date: Sun Oct 16 13:31:42 2016 +0100 + + sna: Only apply the CRTC fixup when attempting to turn DPMS off + + If we were attempting to switch DPMS leave the state as is if the kernel + reports an error. + + Signed-off-by: Chris Wilson + +commit b9cebe59f9ddc1b38e47514e04a37b6de4efe2df +Author: Chris Wilson +Date: Fri Oct 21 09:52:18 2016 +0100 + + sna: Ignore the current CRTC mode following a hotplug event + + If we detect a change in the output status, ignore the residual mode on + the CRTC. We use this CRTC mode during inheritance to provide + continuity and to make xrandr look neat we ensure that the mode is + included in the output list. However, following a hotplug event the + current mode may now be invalid and needs to be pruned. + + Signed-off-by: Chris Wilson + +commit 6a2e5bca4214a3785f20fa8ba3dce5325ef75a27 +Author: Chris Wilson +Date: Fri Oct 21 09:46:23 2016 +0100 + + sna: Force a reprobe for the specified hotplug connector + + If the kernel can provide us with the exact connector that needs + reprobing following a hotplug event, use it. + + Signed-off-by: Chris Wilson + +commit a43455d4a317a13fe422c92b86083ed8a4fbeab9 +Author: Manasi Navare +Date: Mon Oct 17 15:31:24 2016 -0700 + + sna: Reprobe if kernel updates the connector mode list + + Output_check_status() should return a false if it detects + that the connector mode list has changed so that sna_mode_discover + can reprobe. + + Fixes: eb01cc549d4d (sna: Refresh mode list if the kernel updates) + + Signed-off-by: Manasi Navare + Cc: Chris Wilson + Cc: Ville Syrjala + +commit eb01cc549d4d5544833ff6da4d79bc63587fd5ca +Author: Chris Wilson +Date: Wed Oct 12 17:35:37 2016 +0100 + + sna: Refresh mode list if the kernel updates + + If the kernel changes its list of modes, make sure we update. (This is a + losing battle since X will add whatever modes it finds from the EDID + despite what the kernel is telling it.) + + Signed-off-by: Chris Wilson + commit 696f58f69f2bac5717d19f7a1a2278fee50a083e Author: Chris Wilson Date: Fri Oct 7 23:32:12 2016 +0100 @@ -2301,11 +2614,3 @@ Reported-by: Raffael Herzog References: https://bugs.freedesktop.org/show_bug.cgi?id=93562 Signed-off-by: Chris Wilson - -commit ec92e2584ffa0bf2a7f5bd724b69e68687e11c96 -Author: Chris Wilson -Date: Sun Dec 20 18:37:38 2015 +0000 - - sna: Add fault-injection for cursor ioctls - - Signed-off-by: Chris Wilson diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/config.guess xserver-xorg-video-intel-2.99.917+git20161127.bde94605/config.guess --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/config.guess 2016-10-10 06:23:52.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/config.guess 2016-11-27 15:38:03.000000000 +0000 @@ -2,7 +2,7 @@ # Attempt to guess a canonical system name. # Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2016-04-02' +timestamp='2016-10-02' # 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 @@ -186,9 +186,12 @@ *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. + # to ELF recently (or will in the future) and ABI. case "${UNAME_MACHINE_ARCH}" in - arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ @@ -997,6 +1000,9 @@ 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} + exit ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; @@ -1029,6 +1035,9 @@ ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; @@ -1408,18 +1417,17 @@ cat >&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/config.sub xserver-xorg-video-intel-2.99.917+git20161127.bde94605/config.sub --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/config.sub 2016-10-10 06:23:52.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/config.sub 2016-11-27 15:38:03.000000000 +0000 @@ -2,7 +2,7 @@ # Configuration validation subroutine script. # Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2016-03-30' +timestamp='2016-11-04' # 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 @@ -117,7 +117,7 @@ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | \ + kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -301,6 +301,7 @@ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ + | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ @@ -428,6 +429,7 @@ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ + | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ @@ -643,6 +645,14 @@ basic_machine=m68k-bull os=-sysv3 ;; + e500v[12]) + basic_machine=powerpc-unknown + os=$os"spe" + ;; + e500v[12]-*) + basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + os=$os"spe" + ;; ebmon29k) basic_machine=a29k-amd os=-ebmon @@ -1022,7 +1032,7 @@ ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppcle | powerpclittle | ppc-le | powerpc-little) + ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) @@ -1032,7 +1042,7 @@ ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) + ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) @@ -1389,7 +1399,7 @@ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ + | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ @@ -1399,7 +1409,7 @@ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos*) + | -onefs* | -tirtos* | -phoenix* | -fuchsia*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/debian/changelog xserver-xorg-video-intel-2.99.917+git20161127.bde94605/debian/changelog --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/debian/changelog 2016-11-27 15:49:35.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/debian/changelog 2016-11-27 15:49:36.000000000 +0000 @@ -1,10 +1,11 @@ -xserver-xorg-video-intel (2:2.99.917+git20161010.696f58f6-0ubuntu0ricotz~xenial) xenial; urgency=medium +xserver-xorg-video-intel (2:2.99.917+git20161127.bde94605-0ubuntu0ricotz~xenial) xenial; urgency=medium - * Checkout from git 20161010 (master branch) up to commit - 696f58f69f2bac5717d19f7a1a2278fee50a083e + * Checkout from git 20161127 (master branch) up to commit + bde946054efbc1c7ae1483b84c3b4fa3c2c7e2ec * Only added debian/ tree from origin/ubuntu + * hook: Drop revert-dpms-fix.patch (maybe-fixed) - -- Rico Tzschichholz Mon, 10 Oct 2016 08:23:54 +0200 + -- Rico Tzschichholz Sun, 27 Nov 2016 16:38:05 +0100 xserver-xorg-video-intel (2:2.99.917+git20160706-1ubuntu1) yakkety; urgency=medium diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/debian/patches/series xserver-xorg-video-intel-2.99.917+git20161127.bde94605/debian/patches/series --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/debian/patches/series 2016-11-27 15:49:35.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/debian/patches/series 2016-11-27 15:49:36.000000000 +0000 @@ -3,5 +3,5 @@ # ubuntu -revert-dpms-fix.patch +#revert-dpms-fix.patch install-dri3info.diff diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/.lastcommit xserver-xorg-video-intel-2.99.917+git20161127.bde94605/.lastcommit --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/.lastcommit 2016-10-10 06:23:23.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/.lastcommit 2016-11-27 15:37:38.000000000 +0000 @@ -1 +1 @@ -commit 696f58f69f2bac5717d19f7a1a2278fee50a083e +commit bde946054efbc1c7ae1483b84c3b4fa3c2c7e2ec diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/ltmain.sh xserver-xorg-video-intel-2.99.917+git20161127.bde94605/ltmain.sh --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/ltmain.sh 2016-10-10 06:23:41.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/ltmain.sh 2016-11-27 15:37:52.000000000 +0000 @@ -31,7 +31,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.6 Debian-2.4.6-1" +VERSION="2.4.6 Debian-2.4.6-2" package_revision=2.4.6 @@ -1977,7 +1977,7 @@ # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.6 Debian-2.4.6-1' +scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... @@ -2068,7 +2068,7 @@ compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname $scriptversion + version: $progname $scriptversion Debian-2.4.6-2 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/backlight.c xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/backlight.c --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/backlight.c 2015-07-03 12:03:14.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/backlight.c 2016-11-27 15:37:38.000000000 +0000 @@ -48,6 +48,7 @@ #include #include #include +#include #include #include @@ -216,6 +217,24 @@ } static int +writen(int fd, const char *value, int len) +{ + int ret; + + do { + ret = write(fd, value, len); + if (ret < 0) { + if (errno == EAGAIN || errno == EINTR) + continue; + + return ret; + } + } while (value += ret, len -= ret); + + return 0; +} + +static int __backlight_write(const char *iface, const char *file, const char *value) { int fd, ret; @@ -224,7 +243,7 @@ if (fd < 0) return -1; - ret = write(fd, value, strlen(value)+1); + ret = writen(fd, value, strlen(value)+1); close(fd); return ret; @@ -458,7 +477,7 @@ int backlight_set(struct backlight *b, int level) { char val[BACKLIGHT_VALUE_LEN]; - int len, ret = 0; + int len; if (b->iface == NULL) return 0; @@ -467,10 +486,7 @@ level = b->max; len = snprintf(val, BACKLIGHT_VALUE_LEN, "%d\n", level); - if (write(b->fd, val, len) != len) - ret = -1; - - return ret; + return writen(b->fd, val, len); } int backlight_get(struct backlight *b) diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/brw/brw_eu_emit.c xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/brw/brw_eu_emit.c --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/brw/brw_eu_emit.c 2015-07-03 12:03:14.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/brw/brw_eu_emit.c 2016-11-27 15:37:38.000000000 +0000 @@ -178,7 +178,7 @@ } if (reg.file == BRW_ARCHITECTURE_REGISTER_FILE && - reg.file == BRW_ARF_NULL) + reg.nr == BRW_ARF_NULL) return; assert(reg.hstride >= 0 && reg.hstride < ARRAY_SIZE(hstride_for_reg)); diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/kgem.c xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/kgem.c --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/kgem.c 2016-10-10 06:23:23.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/kgem.c 2016-11-27 15:37:38.000000000 +0000 @@ -5353,7 +5353,7 @@ VG_CLEAR(tiling); tiling.handle = bo->handle; - tiling.tiling_mode = 0; + tiling.tiling_mode = bo->tiling; (void)do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_GET_TILING, &tiling); return tiling.tiling_mode == bo->tiling; /* assume pitch is fine! */ } @@ -6179,9 +6179,7 @@ /* Whatever actually happens, we can regard the GTT write domain * as being flushed. */ - bo->gtt_dirty = false; - bo->needs_flush = false; - bo->domain = DOMAIN_NONE; + __kgem_bo_clear_dirty(bo); } inline static bool nearly_idle(struct kgem *kgem) @@ -7107,6 +7105,7 @@ bo->needs_flush = false; kgem_bo_retire(kgem, bo); bo->domain = DOMAIN_CPU; + bo->gtt_dirty = true; } } @@ -7147,10 +7146,11 @@ DBG(("%s: sync: GPU hang detected\n", __FUNCTION__)); kgem_throttle(kgem); } + bo->needs_flush = false; if (write) { - bo->needs_flush = false; kgem_bo_retire(kgem, bo); bo->domain = DOMAIN_CPU; + bo->gtt_dirty = true; } else { if (bo->exec == NULL) kgem_bo_maybe_retire(kgem, bo); diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/kgem.h xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/kgem.h --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/kgem.h 2016-07-06 11:46:45.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/kgem.h 2016-11-27 15:37:38.000000000 +0000 @@ -638,17 +638,24 @@ } } -inline static void __kgem_bo_clear_busy(struct kgem_bo *bo) +static inline void __kgem_bo_clear_dirty(struct kgem_bo *bo) { DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle)); - bo->rq = NULL; - list_del(&bo->request); bo->domain = DOMAIN_NONE; bo->needs_flush = false; bo->gtt_dirty = false; } +inline static void __kgem_bo_clear_busy(struct kgem_bo *bo) +{ + DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle)); + bo->rq = NULL; + list_del(&bo->request); + + __kgem_bo_clear_dirty(bo); +} + static inline bool kgem_bo_is_busy(struct kgem_bo *bo) { DBG(("%s: handle=%d, domain: %d exec? %d, rq? %d\n", __FUNCTION__, diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/sna_display.c xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_display.c --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/sna_display.c 2016-10-10 06:23:57.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_display.c 2016-11-27 15:37:38.000000000 +0000 @@ -39,6 +39,7 @@ #include #include #include +#include #if HAVE_ALLOCA_H #include @@ -253,6 +254,8 @@ unsigned int is_panel : 1; unsigned int add_default_modes : 1; + int connector_type; + int connector_type_id; uint32_t edid_idx; uint32_t edid_blob_id; @@ -272,7 +275,9 @@ uint32_t last_detect; uint32_t status; + unsigned int hotplug_count; bool update_properties; + bool reprobe; int num_modes; struct drm_mode_modeinfo *modes; @@ -562,6 +567,15 @@ #define assert_scanout(k, b, w, h) #endif +static void assert_crtc_fb(struct sna *sna, struct sna_crtc *crtc) +{ +#ifndef NDEBUG + struct drm_mode_crtc mode = { .crtc_id = __sna_crtc_id(crtc) }; + drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode); + assert(mode.fb_id == fb_id(crtc->bo)); +#endif +} + static unsigned get_fb(struct sna *sna, struct kgem_bo *bo, int width, int height) { @@ -963,6 +977,90 @@ return strdup(str); } +static int get_device_minor(int fd) +{ + struct stat st; + + if (fstat(fd, &st) || !S_ISCHR(st.st_mode)) + return -1; + + return st.st_rdev & 0x63; +} + +static const char * const sysfs_connector_types[] = { + /* DRM_MODE_CONNECTOR_Unknown */ "Unknown", + /* DRM_MODE_CONNECTOR_VGA */ "VGA", + /* DRM_MODE_CONNECTOR_DVII */ "DVI-I", + /* DRM_MODE_CONNECTOR_DVID */ "DVI-D", + /* DRM_MODE_CONNECTOR_DVIA */ "DVI-A", + /* DRM_MODE_CONNECTOR_Composite */ "Composite", + /* DRM_MODE_CONNECTOR_SVIDEO */ "SVIDEO", + /* DRM_MODE_CONNECTOR_LVDS */ "LVDS", + /* DRM_MODE_CONNECTOR_Component */ "Component", + /* DRM_MODE_CONNECTOR_9PinDIN */ "DIN", + /* DRM_MODE_CONNECTOR_DisplayPort */ "DP", + /* DRM_MODE_CONNECTOR_HDMIA */ "HDMI-A", + /* DRM_MODE_CONNECTOR_HDMIB */ "HDMI-B", + /* DRM_MODE_CONNECTOR_TV */ "TV", + /* DRM_MODE_CONNECTOR_eDP */ "eDP", + /* DRM_MODE_CONNECTOR_VIRTUAL */ "Virtual", + /* DRM_MODE_CONNECTOR_DSI */ "DSI", + /* DRM_MODE_CONNECTOR_DPI */ "DPI" +}; + +static char *has_connector_backlight(xf86OutputPtr output) +{ + struct sna_output *sna_output = output->driver_private; + struct sna *sna = to_sna(output->scrn); + char path[1024]; + DIR *dir; + struct dirent *de; + int minor, len; + char *str = NULL; + + if (sna_output->connector_type >= ARRAY_SIZE(sysfs_connector_types)) + return NULL; + + minor = get_device_minor(sna->kgem.fd); + if (minor < 0) + return NULL; + + len = snprintf(path, sizeof(path), + "/sys/class/drm/card%d-%s-%d", + minor, + sysfs_connector_types[sna_output->connector_type], + sna_output->connector_type_id); + DBG(("%s: lookup %s\n", __FUNCTION__, path)); + + dir = opendir(path); + while ((de = readdir(dir))) { + struct stat st; + + if (*de->d_name == '.') + continue; + + snprintf(path + len, sizeof(path) - len, + "/%s", de->d_name); + + if (stat(path, &st)) + continue; + + if (!S_ISDIR(st.st_mode)) + continue; + + DBG(("%s: testing %s as backlight\n", + __FUNCTION__, de->d_name)); + + if (backlight_exists(de->d_name)) { + str = strdup(de->d_name); /* leak! */ + break; + } + } + + closedir(dir); + return str; +} + static void sna_output_backlight_init(xf86OutputPtr output) { @@ -975,11 +1073,20 @@ return; #endif - from = X_CONFIG; - best_iface = has_user_backlight_override(output); + if (sna_output->is_panel) { + from = X_CONFIG; + best_iface = has_user_backlight_override(output); + if (best_iface) + goto done; + } + + best_iface = has_connector_backlight(output); if (best_iface) goto done; + if (!sna_output->is_panel) + return; + /* XXX detect right backlight for multi-GPU/panels */ from = X_PROBED; pci = xf86GetPciInfoForEntity(to_sna(output->scrn)->pEnt->index); @@ -2771,6 +2878,13 @@ } else crtc->transform_in_use = sna_crtc->rotation != RR_Rotate_0; + /* Recompute the cursor after a potential change in transform */ + if (sna_crtc->cursor) { + assert(sna_crtc->cursor->ref > 0); + sna_crtc->cursor->ref--; + sna_crtc->cursor = NULL; + } + if (needs_transform) { sna_crtc->hwcursor = is_affine(&f_fb_to_crtc); sna_crtc->cursor_transform = @@ -2897,6 +3011,21 @@ } } +static void reprobe_connectors(xf86CrtcPtr crtc) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + struct sna *sna = to_sna(crtc->scrn); + int i; + + for (i = 0; i < sna->mode.num_real_output; i++) { + xf86OutputPtr output = config->output[i]; + if (output->crtc == crtc) + to_sna_output(output)->reprobe = true; + } + + sna_mode_discover(sna, true); +} + static Bool __sna_crtc_set_mode(xf86CrtcPtr crtc) { @@ -2930,8 +3059,10 @@ } /* Prevent recursion when enabling outputs during execbuffer */ - if (bo->exec && RQ(bo->rq)->bo == NULL) + if (bo->exec && RQ(bo->rq)->bo == NULL) { _kgem_submit(&sna->kgem); + __kgem_bo_clear_dirty(bo); + } sna_crtc->bo = bo; ret = sna_crtc_apply(crtc); @@ -2989,7 +3120,8 @@ sna_crtc->cursor_transform = saved_cursor_transform; sna_crtc->hwcursor = saved_hwcursor; sna_crtc->bo = saved_bo; - sna_mode_discover(sna, true); + + reprobe_connectors(crtc); return FALSE; } @@ -3548,6 +3680,7 @@ DBG(("%s(%s): found %d modes, connection status=%d\n", __FUNCTION__, output->name, sna_output->num_modes, compat_conn.conn.connection)); + sna_output->reprobe = false; sna_output->last_detect = now; switch (compat_conn.conn.connection) { case DRM_MODE_CONNECTED: @@ -3969,7 +4102,7 @@ sna_output_attach_tile(output); current = NULL; - if (output->crtc) { + if (output->crtc && !sna_output->hotplug_count) { struct drm_mode_crtc mode; VG_CLEAR(mode); @@ -4123,7 +4256,7 @@ dpms)) { DBG(("%s(%s:%d): failed to set DPMS to %d (fixup? %d)\n", __FUNCTION__, output->name, sna_output->id, dpms, fixup)); - if (fixup) { + if (fixup && dpms != DPMSModeOn) { sna_crtc_disable(output->crtc, false); return; } @@ -4475,7 +4608,8 @@ /* DRM_MODE_CONNECTOR_TV */ "TV", /* DRM_MODE_CONNECTOR_eDP */ "eDP", /* DRM_MODE_CONNECTOR_VIRTUAL */ "Virtual", - /* DRM_MODE_CONNECTOR_DSI */ "DSI" + /* DRM_MODE_CONNECTOR_DSI */ "DSI", + /* DRM_MODE_CONNECTOR_DPI */ "DPI" }; static bool @@ -4899,6 +5033,8 @@ if (!sna_output) return -1; + sna_output->connector_type = compat_conn.conn.connector_type; + sna_output->connector_type_id = compat_conn.conn.connector_type_id; sna_output->num_props = compat_conn.conn.count_props; sna_output->prop_ids = malloc(sizeof(uint32_t)*compat_conn.conn.count_props); sna_output->prop_values = malloc(sizeof(uint64_t)*compat_conn.conn.count_props); @@ -5028,8 +5164,7 @@ sna_output->base = output; backlight_init(&sna_output->backlight); - if (sna_output->is_panel) - sna_output_backlight_init(output); + sna_output_backlight_init(output); output->possible_crtcs = possible_crtcs & count_to_mask(sna->mode.num_real_crtc); output->interlaceAllowed = TRUE; @@ -5147,6 +5282,22 @@ return update; } +bool sna_mode_find_hotplug_connector(struct sna *sna, unsigned id) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); + int i; + + for (i = 0; i < sna->mode.num_real_output; i++) { + struct sna_output *output = to_sna_output(config->output[i]); + if (output->id == id) { + output->reprobe = true; + return true; + } + } + + return false; +} + static bool output_check_status(struct sna *sna, struct sna_output *output) { @@ -5156,6 +5307,9 @@ xf86OutputStatus status; char *edid; + if (output->reprobe) + return false; + VG_CLEAR(compat_conn); compat_conn.conn.connection = -1; @@ -5190,6 +5344,9 @@ if (status != XF86OutputStatusConnected) return true; + if (output->num_modes != compat_conn.conn.count_modes) + return false; + if (output->edid_len == 0) return false; @@ -5234,7 +5391,7 @@ res.count_connectors, sna->mode.num_real_output, res.count_encoders, res.count_crtcs)); if (res.count_connectors > 32) - return; + res.count_connectors = 32; assert(sna->mode.num_real_crtc == res.count_crtcs || is_zaphod(sna->scrn)); assert(sna->mode.max_crtc_width == res.max_width); @@ -5278,6 +5435,7 @@ } else { DBG(("%s: output %s (id=%d), changed state, reprobing\n", __FUNCTION__, output->name, sna_output->id)); + sna_output->hotplug_count++; sna_output->last_detect = 0; changed |= 4; } @@ -5697,20 +5855,6 @@ transformed = to_sna_crtc(crtc)->cursor_transform; rotation = (!transformed && crtc->transform_in_use) ? crtc->rotation : RR_Rotate_0; - /* Don't allow phys cursor sharing */ - if (sna->cursor.use_gtt && !transformed) { - for (cursor = sna->cursor.cursors; cursor; cursor = cursor->next) { - if (cursor->serial == sna->cursor.serial && - cursor->rotation == rotation && - !cursor->transformed) { - __DBG(("%s: reusing handle=%d, serial=%d, rotation=%d, size=%d\n", - __FUNCTION__, cursor->handle, cursor->serial, cursor->rotation, cursor->size)); - assert(cursor->size == sna->cursor.size); - return cursor; - } - } - } - if (transformed) { struct pixman_box16 box; @@ -5768,6 +5912,20 @@ to_sna_crtc(crtc)->cursor_to_fb.m[2][2])); } + /* Don't allow phys cursor sharing */ + if (sna->cursor.use_gtt && !transformed) { + for (cursor = sna->cursor.cursors; cursor; cursor = cursor->next) { + if (cursor->serial == sna->cursor.serial && + cursor->rotation == rotation && + !cursor->transformed) { + __DBG(("%s: reusing handle=%d, serial=%d, rotation=%d, size=%d\n", + __FUNCTION__, cursor->handle, cursor->serial, cursor->rotation, cursor->size)); + assert(cursor->size == sna->cursor.size); + return cursor; + } + } + } + cursor = to_sna_crtc(crtc)->cursor; if (cursor && cursor->alloc < 4*size*size) cursor = NULL; @@ -6154,6 +6312,14 @@ if (sna_crtc->bo == NULL) goto disable; + cursor = __sna_get_cursor(sna, crtc); + if (cursor == NULL) + cursor = sna_crtc->cursor; + if (cursor == NULL) { + __DBG(("%s: failed to grab cursor, disabling\n", __FUNCTION__)); + goto disable; + } + if (crtc->transform_in_use) { int xhot = sna->cursor.ref->bits->xhot; int yhot = sna->cursor.ref->bits->yhot; @@ -6178,15 +6344,6 @@ if (arg.x < crtc->mode.HDisplay && arg.x > -sna->cursor.size && arg.y < crtc->mode.VDisplay && arg.y > -sna->cursor.size) { - cursor = __sna_get_cursor(sna, crtc); - if (cursor == NULL) - cursor = sna_crtc->cursor; - if (cursor == NULL) { - __DBG(("%s: failed to grab cursor, disabling\n", - __FUNCTION__)); - goto disable; - } - if (sna_crtc->cursor != cursor || sna_crtc->last_cursor_size != cursor->size) { arg.flags |= DRM_MODE_CURSOR_BO; arg.handle = cursor->handle; @@ -6583,6 +6740,7 @@ return false; crtc->offset = y << 16 | x; + __kgem_bo_clear_dirty(bo); return true; } @@ -6665,6 +6823,7 @@ return 0; kgem_bo_submit(&sna->kgem, bo); + __kgem_bo_clear_dirty(bo); sigio = sigio_block(); for (i = 0; i < sna->mode.num_real_crtc; i++) { @@ -6683,6 +6842,7 @@ assert(crtc->bo->refcnt >= crtc->bo->active_scanout); assert(crtc->flip_bo == NULL); + assert_crtc_fb(sna, crtc); if (data == NULL && crtc->bo == bo) goto next_crtc; @@ -8854,7 +9014,9 @@ sna_crtc_redisplay(crtc, &damage, bo); kgem_bo_submit(&sna->kgem, bo); + __kgem_bo_clear_dirty(bo); + assert_crtc_fb(sna, sna_crtc); arg.crtc_id = __sna_crtc_id(sna_crtc); arg.fb_id = get_fb(sna, bo, crtc->mode.HDisplay, @@ -8957,6 +9119,7 @@ arg.reserved = 0; kgem_bo_submit(&sna->kgem, new); + __kgem_bo_clear_dirty(new); sigio = sigio_block(); for (i = 0; i < sna->mode.num_real_crtc; i++) { @@ -8972,6 +9135,7 @@ assert(config->crtc[i]->enabled); assert(crtc->flip_bo == NULL); + assert_crtc_fb(sna, crtc); arg.crtc_id = __sna_crtc_id(crtc); arg.user_data = (uintptr_t)crtc; @@ -9187,14 +9351,6 @@ assert(crtc->bo->active_scanout); assert(crtc->bo->refcnt >= crtc->bo->active_scanout); -#ifndef NDEBUG - { - struct drm_mode_crtc mode = { .crtc_id = __sna_crtc_id(crtc) }; - drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_GETCRTC, &mode); - assert(mode.fb_id == fb_id(crtc->flip_bo)); - } -#endif - crtc->bo->active_scanout--; kgem_bo_destroy(&sna->kgem, crtc->bo); @@ -9205,6 +9361,8 @@ crtc->bo = crtc->flip_bo; crtc->flip_bo = NULL; + + assert_crtc_fb(sna, crtc); } else { crtc->flip_bo->active_scanout--; kgem_bo_destroy(&sna->kgem, crtc->flip_bo); diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/sna_dri2.c xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_dri2.c --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/sna_dri2.c 2016-10-10 06:23:23.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_dri2.c 2016-11-27 15:37:38.000000000 +0000 @@ -2845,11 +2845,8 @@ info->type = info->flip_continue; info->flip_continue = 0; - if (info->draw == NULL) - return false; - assert(!info->signal); - info->signal = info->type == FLIP_THROTTLE; + info->signal = info->type == FLIP_THROTTLE && info->draw; if (info->sna->mode.front_active == 0) return false; @@ -2866,7 +2863,6 @@ info->sna->dri2.flip_pending == info); info->sna->dri2.flip_pending = info; info->queued = true; - assert(info->draw); return true; } diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/sna_driver.c xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_driver.c --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/sna_driver.c 2016-10-10 06:23:23.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_driver.c 2016-11-27 15:37:38.000000000 +0000 @@ -308,7 +308,7 @@ * back on. */ if (mode != DPMSModeOn) { - if (sna->mode.hidden == 0) { + if (sna->mode.hidden == 0 && !(sna->flags & SNA_NO_DPMS)) { DBG(("%s: hiding %d outputs\n", __FUNCTION__, config->num_output)); for (i = 0; i < config->num_output; i++) { @@ -433,16 +433,24 @@ unsigned level; sna->dri2.available = false; + sna->dri2.enable = false; sna->dri3.available = false; + sna->dri3.enable = false; + sna->dri3.override = false; level = intel_option_cast_to_unsigned(sna->Options, OPTION_DRI, DEFAULT_DRI_LEVEL); #if HAVE_DRI3 + sna->dri3.available = !!xf86LoadSubModule(sna->scrn, "dri3"); + sna->dri3.override = + !sna->dri3.available || + xf86IsOptionSet(sna->Options, OPTION_DRI); if (level >= 3 && sna->kgem.gen >= 040) - sna->dri3.available = !!xf86LoadSubModule(sna->scrn, "dri3"); + sna->dri3.enable = sna->dri3.available; #endif #if HAVE_DRI2 + sna->dri2.available = !!xf86LoadSubModule(sna->scrn, "dri2"); if (level >= 2) - sna->dri2.available = !!xf86LoadSubModule(sna->scrn, "dri2"); + sna->dri2.enable = sna->dri2.available; #endif } @@ -796,8 +804,13 @@ const char *str; str = udev_device_get_property_value(dev, "HOTPLUG"); - if (str && atoi(str) == 1) - hotplug = true; + if (str && atoi(str) == 1) { + str = udev_device_get_property_value(dev, "CONNECTOR"); + if (str) + hotplug |= sna_mode_find_hotplug_connector(sna, atoi(str)); + else + hotplug = true; + } } udev_device_unref(dev); @@ -1054,12 +1067,13 @@ { char str[128] = ""; - if (sna->dri2.available) + if (sna->dri2.enable) sna->dri2.open = sna_dri2_open(sna, screen); if (sna->dri2.open) strcat(str, "DRI2 "); - if (sna->dri3.available) + /* Load DRI3 in case DRI2 doesn't work, e.g. vgaarb */ + if (sna->dri3.enable || (!sna->dri2.open && !sna->dri3.override)) sna->dri3.open = sna_dri3_open(sna, screen); if (sna->dri3.open) strcat(str, "DRI3 "); @@ -1204,6 +1218,8 @@ CMAP_PALETTED_TRUECOLOR)) return FALSE; + if (!xf86CheckBoolOption(scrn->options, "dpms", TRUE)) + sna->flags |= SNA_NO_DPMS; xf86DPMSInit(screen, sna_dpms_set, 0); sna_uevent_init(sna); diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/sna.h xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna.h --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/sna.h 2016-10-10 06:23:23.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna.h 2016-11-27 15:37:38.000000000 +0000 @@ -264,6 +264,7 @@ #define SNA_FLUSH_GTT 0x800 #define SNA_PERFORMANCE 0x1000 #define SNA_POWERSAVE 0x2000 +#define SNA_NO_DPMS 0x4000 #define SNA_HAS_FLIP 0x10000 #define SNA_HAS_ASYNC_FLIP 0x20000 #define SNA_LINEAR_FB 0x40000 @@ -361,8 +362,9 @@ } cursor; struct sna_dri2 { - bool available; - bool open; + bool available : 1; + bool enable : 1; + bool open : 1; #if HAVE_DRI2 void *flip_pending; @@ -371,8 +373,11 @@ } dri2; struct sna_dri3 { - bool available; - bool open; + bool available :1; + bool override : 1; + bool enable : 1; + bool open :1; + #if HAVE_DRI3 SyncScreenCreateFenceFunc create_fence; struct list pixmaps; @@ -470,6 +475,7 @@ extern bool sna_pixmap_discard_shadow_damage(struct sna_pixmap *priv, const RegionRec *region); extern void sna_mode_set_primary(struct sna *sna); +extern bool sna_mode_find_hotplug_connector(struct sna *sna, unsigned id); extern void sna_mode_close(struct sna *sna); extern void sna_mode_fini(struct sna *sna); diff -Nru xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/sna_video_sprite.c xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_video_sprite.c --- xserver-xorg-video-intel-2.99.917+git20161010.696f58f6/src/sna/sna_video_sprite.c 2016-09-22 16:11:08.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_video_sprite.c 2016-11-27 15:37:38.000000000 +0000 @@ -261,10 +261,6 @@ video->color_key_changed &= ~(1 << pipe); } - assert(pipe < ARRAY_SIZE(video->bo)); - if (video->bo[pipe] == frame->bo) - return true; - update_dst_box_to_crtc_coords(sna, crtc, dstBox); if (frame->rotation & (RR_Rotate_90 | RR_Rotate_270)) { int tmp = frame->width; @@ -282,15 +278,30 @@ uint32_t handles[4]; uint32_t pitches[4]; /* pitch for each plane */ uint32_t offsets[4]; /* offset of each plane */ + uint64_t modifiers[4]; } f; bool purged = true; memset(&f, 0, sizeof(f)); f.width = frame->width; f.height = frame->height; + f.flags = 1 << 1; /* +modifiers */ f.handles[0] = frame->bo->handle; f.pitches[0] = frame->pitch[0]; + switch (frame->bo->tiling) { + case I915_TILING_NONE: + break; + case I915_TILING_X: + /* I915_FORMAT_MOD_X_TILED */ + f.modifiers[0] = (uint64_t)1 << 56 | 1; + break; + case I915_TILING_Y: + /* I915_FORMAT_MOD_X_TILED */ + f.modifiers[0] = (uint64_t)1 << 56 | 2; + break; + } + switch (frame->id) { case FOURCC_RGB565: f.pixel_format = DRM_FORMAT_RGB565; @@ -359,7 +370,7 @@ return false; } - frame->bo->domain = DOMAIN_NONE; + __kgem_bo_clear_dirty(frame->bo); if (video->bo[pipe]) kgem_bo_destroy(&sna->kgem, video->bo[pipe]); @@ -373,9 +384,11 @@ struct sna *sna = video->sna; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); RegionRec clip; + BoxRec draw_extents; int ret, i; init_video_region(&clip, draw, drw_x, drw_y, drw_w, drw_h); + draw_extents = clip.extents; DBG(("%s: always_on_top=%d\n", __FUNCTION__, video->AlwaysOnTop)); if (!video->AlwaysOnTop) { @@ -402,9 +415,9 @@ for (i = 0; i < video->sna->mode.num_real_crtc; i++) { xf86CrtcPtr crtc = config->crtc[i]; struct sna_video_frame frame; + BoxRec dst = draw_extents; int pipe; INT32 x1, x2, y1, y2; - BoxRec dst; RegionRec reg; Rotation rotation; bool cache_bo; @@ -436,8 +449,6 @@ y1 = src_y; y2 = src_y + src_h; - dst = clip.extents; - ret = xf86XVClipVideoHelper(&dst, &x1, &x2, &y1, &y2, ®, frame.width, frame.height); RegionUninit(®); @@ -569,7 +580,6 @@ ret = BadAlloc; } - frame.bo->domain = DOMAIN_NONE; if (cache_bo) sna_video_buffer_fini(video); else