diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/aclocal.m4 xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/aclocal.m4 --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/aclocal.m4 2016-11-27 15:38:00.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/aclocal.m4 2017-02-08 16:42:42.000000000 +0000 @@ -720,17 +720,24 @@ fi]) # Test for the ability of xmlto to generate a text target +# +# NOTE: xmlto 0.0.27 or higher return a non-zero return code in the +# following test for empty XML docbook files. +# For compatibility reasons use the following empty XML docbook file and if +# it fails try it again with a non-empty XML file. have_xmlto_text=no cat > conftest.xml << "EOF" - - - EOF AS_IF([test "$have_xmlto" = yes], [AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], [have_xmlto_text=yes], - [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])]) + [# Try it again with a non-empty XML file. + cat > conftest.xml << "EOF" + +EOF + AS_IF([$XMLTO --skip-validation txt conftest.xml >/dev/null 2>&1], + [have_xmlto_text=yes], + [AC_MSG_WARN([xmlto cannot generate text format, this format skipped])])])]) rm -f conftest.xml AM_CONDITIONAL([HAVE_XMLTO_TEXT], [test $have_xmlto_text = yes]) AM_CONDITIONAL([HAVE_XMLTO], [test "$have_xmlto" = yes]) diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/autogen.sh xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/autogen.sh --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/autogen.sh 2014-01-03 08:39:42.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/autogen.sh 2017-02-08 16:42:15.000000000 +0000 @@ -1,14 +1,17 @@ #! /bin/sh -srcdir=`dirname $0` +srcdir=`dirname "$0"` test -z "$srcdir" && srcdir=. ORIGDIR=`pwd` -cd $srcdir +cd "$srcdir" autoreconf -v --install || exit 1 -cd $ORIGDIR || exit $? +cd "$ORIGDIR" || exit $? + +git config --local --get format.subjectPrefix >/dev/null 2>&1 || + git config --local format.subjectPrefix "PATCH xf86-video-intel" if test -z "$NOCONFIGURE"; then - $srcdir/configure "$@" + exec "$srcdir"/configure "$@" fi diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/ChangeLog xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/ChangeLog --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/ChangeLog 2016-11-27 15:38:05.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/ChangeLog 2017-02-08 16:42:48.000000000 +0000 @@ -1,9 +1,259 @@ -commit 50f6fbb60f07b9a40b8f41c6c6c2745f13bb23da +commit 30b79ad6420465a83d5dbe3a626407571e2257cf Author: Rico Tzschichholz -Date: Sun Nov 27 16:37:38 2016 +0100 +Date: Wed Feb 8 17:42:15 2017 +0100 Add debian tree from origin/ubuntu +commit e4fe79cf0d9a05ee3f3a027148ef0aeb2b1b34e1 +Author: Chris Wilson +Date: Sun Feb 5 22:24:04 2017 +0000 + + sna/gen2: Take combined vertex arrays into account for inline limit + + When extending the vertex array, we have to remove the currently used + inlined dwords from the available limit. + + Signed-off-by: Chris Wilson + +commit 38ac6b556dae914325980d135a81719c9dfda000 +Author: Chris Wilson +Date: Sun Feb 5 20:58:37 2017 +0000 + + sna/gen2: Cap number of vertices emitted in a single 3DPRIM + + There's a maximum of 2^18 dwords in a single command, or else we + overflow the lenth field. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99620 + Signed-off-by: Chris Wilson + +commit 8572955b019a27e8260f3e7e7681bf0b6aed6e65 +Author: Chris Wilson +Date: Wed Feb 1 15:37:47 2017 +0000 + + Revert "sna: Force CRTC off when DP-MST are unplugged" + + This reverts commit 2da23747c68cf5af40eb80a90cd0ee5cfe64bbf9 as it + is already applied by disable_unused_crtc() called when the output is + removed, and now we ensure that a residual active CRTC is disabled. + +commit 9fe04af4bce3057e3e94a6bf36a3d8d2e48d592c +Author: Chris Wilson +Date: Wed Feb 1 10:00:52 2017 +0000 + + sna: Explicitly disable unused CRTC + + This should be performed via DisableUnusedFunctions, but whilst we are + sanity checking, checking that the CRTC we believe to be off actually + are seems worthwhile. + + Signed-off-by: Chris Wilson + +commit fe0846b1e17da02ebb6f0925449a90c914e4f0a1 +Author: Chris Wilson +Date: Wed Feb 1 09:03:22 2017 +0000 + + sna: Remove bogus assert that the connector is a zombie before reattaching + + To know that the connector was unplugged before we discover it was + plugged back in again, requires handing the unplug notification in time. + This does not always happen and we may see the reattachment instead. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99432 + Signed-off-by: Chris Wilson + +commit 2da23747c68cf5af40eb80a90cd0ee5cfe64bbf9 +Author: Chris Wilson +Date: Wed Feb 1 09:01:52 2017 +0000 + + sna: Force CRTC off when DP-MST are unplugged + + New? modus operandi of the kernel is to keep the DP-MST around after it + is unplugged until the last remaining user is gone - that includes our + residual modeset. + + Signed-off-by: Chris Wilson + +commit 2d6f2e8b7092a36a623aea5f46eb6a15eb838aac +Author: Mihail Konev +Date: Thu Jan 26 14:00:21 2017 +1000 + + autogen: add default patch prefix + + Signed-off-by: Mihail Konev + +commit 2e6c9e26c0f60278e509a158211e87e10b369559 +Author: Emil Velikov +Date: Mon Mar 9 12:00:52 2015 +0000 + + autogen.sh: use quoted string variables + + Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent + fall-outs, when they contain space. + + Signed-off-by: Emil Velikov + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit dd913354e6bd4ff15ad6852115249fc25b8f6bcc +Author: Peter Hutterer +Date: Tue Jan 24 10:32:07 2017 +1000 + + autogen.sh: use exec instead of waiting for configure to finish + + Syncs the invocation of configure with the one from the server. + + Signed-off-by: Peter Hutterer + Reviewed-by: Emil Velikov + +commit 028c946df0855728b2a34d1d588701dc6c5ad4c1 +Author: Rodrigo Vivi +Date: Tue Jan 3 12:58:31 2017 -0800 + + intel: Update SKL SRV GT4 pci ids reference. + + No functional changes. Apparently spec has been changed + the valid table showing 0x192A as Server GT4 + while 0x193A is Server GT4e. + + Libdrm and Mesa already have this right. So let's fix the ref here. + + Kernel is also fixed with commit 5390974f981907. + "drm/i915: Update SKL SRV GT4 pci ids reference." + + Cc: Chris Wilson + Cc: Ben Widawsky + Signed-off-by: Rodrigo Vivi + +commit 169c74fa6c2cd9c28dd7bfacd9639cd245b8c8a8 +Author: Rodrigo Vivi +Date: Thu Nov 17 14:46:31 2016 -0800 + + intel: Adding Marketing names for Skylake, Kabylake and Apollolake/Broxton. + + This commit adding all known marketing names for latest gen9 platforms. + + v2: On top of simplified generic string names. + + Cc: Chris Wilson + Signed-off-by: Rodrigo Vivi + +commit 2948cf0531a5165787dc763028ae4c4ac1eed063 +Author: Rodrigo Vivi +Date: Thu Nov 17 14:46:30 2016 -0800 + + intel: Simplify new platform names. + + Modern Intel (R) platforms with integrated graphics comes with common + names varying the range numbers. So instead of listing all supported + platforms let's start using the generic marketing strings without + the numbers. + + And for the specific board we list it's actual marketing name if + available on detection. + + Cc: Chris Wilson + Signed-off-by: Rodrigo Vivi + +commit ff25ad3402be3bc20f7b6e680e49ad03d7c6e2af +Author: Chris Wilson +Date: Mon Dec 5 21:28:35 2016 +0000 + + sna: Reorder frontbuffer resize vs flip event queue draining + + If we are not careful, we may process an unflip in the middle of + resizing the frontbuffer - when the ScreenPixmap state is ill-defined. + First flush all the pending flip events, cancel any residual unflips, + then update the screen pixmap. This should be enough to close the race. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=98855#c11 + Signed-off-by: Chris Wilson + +commit fcf943f45b674b080dbd07b65f6bfbc89c427c21 +Author: Ander Conselvan de Oliveira +Date: Mon Dec 5 12:27:14 2016 +0200 + + Add Geminialke PCI IDs + + Same ids from kernel's + + commit 8363e3c3947d0e22955f94a6a87e4f17ce5087b4 + Author: Ander Conselvan de Oliveira + Date: Thu Nov 10 17:23:08 2016 +0200 + + drm/i915/glk: Add Geminilake PCI IDs + + Signed-off-by: Ander Conselvan de Oliveira + +commit a1b39eb6dd1717501a0546275d07df8321fe4905 +Author: James Clarke +Date: Mon Dec 5 11:30:27 2016 +0000 + + sna: Add missing NULL check for readdir result in has_connector_backlight + + Signed-off-by: James Clarke + +commit 4acd4a7d3d2f41227022fa7581cfb85a0b124eae +Author: Chris Wilson +Date: Mon Dec 5 15:13:24 2016 +0000 + + sna/gen9: Emit a dummy primitive between VertexElements + + References: https://bugs.freedesktop.org/show_bug.cgi?id=98999 + Signed-off-by: Chris Wilson + +commit 9ac7a3370ab265d4cbdbbf3dc588af88c37048e1 +Author: Chris Wilson +Date: Tue Nov 29 22:01:21 2016 +0000 + + sna: Handle xf86Randr12 gamma changes in xorg-xserver-1.19 + + commit 17213b74fd7fc4c4e2fe7a3781e7422dd482a0ab + Author: Michel Dänzer + Date: Tue Jun 21 16:44:20 2016 +0900 + + xfree86/modes: Remove xf86RandR12CrtcGetGamma + + removed the randr_crtc->palettes allocation and initialisation causing a + later dereference of the gamma table to crash. Looks like that was just + ABI misuse. + + References: https://bugs.freedesktop.org/show_bug.cgi?id=98855 + Signed-off-by: Chris Wilson + +commit f2901dd34d371113cb9ebe70ef91f700f45f7729 +Author: Chris Wilson +Date: Wed Nov 30 18:53:22 2016 +0000 + + sna: Always ask the client to reprobe after userspace + + This doesn't guarrantee that the client does, but the kernel insists. + + Signed-off-by: Chris Wilson + +commit 35473dd9c9455238721a090021b4665fd9259c0c +Author: Chris Wilson +Date: Wed Nov 30 23:39:05 2016 +0000 + + sna: Prevent switching to GPU rendering when given a SHM pixmap + + If we have a SHM pixmap, we only track rendering via the CPU bo for + synchronisation with the client. + + Signed-off-by: Chris Wilson + +commit cdd06717643f4d110a0d9c2b72851f9cb2c64b81 +Author: Chris Wilson +Date: Wed Nov 30 23:40:14 2016 +0000 + + tools/intel-virtual-output: Check for pending events before blocking + + If the xlib/xcb library has pulled events from the fd, then a poll on + that fd will block until new events arrive. If none do, we fail to + process the currently waiting events in a timely fashion. + + Signed-off-by: Chris Wilson + commit bde946054efbc1c7ae1483b84c3b4fa3c2c7e2ec Author: Chris Wilson Date: Thu Nov 17 19:22:02 2016 +0000 diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/debian/changelog xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/debian/changelog --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/debian/changelog 2017-02-08 16:58:17.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/debian/changelog 2017-02-08 16:58:19.000000000 +0000 @@ -1,11 +1,11 @@ -xserver-xorg-video-intel (2:2.99.917+git20161127.bde94605-0ubuntu0ricotz2) zesty; urgency=medium +xserver-xorg-video-intel (2:2.99.917+git20170208.e4fe79cf-0ubuntu0ricotz) zesty; urgency=medium - * Checkout from git 20161127 (master branch) up to commit - bde946054efbc1c7ae1483b84c3b4fa3c2c7e2ec + * Checkout from git 20170208 (master branch) up to commit + e4fe79cf0d9a05ee3f3a027148ef0aeb2b1b34e1 * Only added debian/ tree from origin/ubuntu * hook: Drop revert-dpms-fix.patch (maybe-fixed) - -- Rico Tzschichholz Sun, 27 Nov 2016 16:38:05 +0100 + -- Rico Tzschichholz Wed, 08 Feb 2017 17:42:48 +0100 xserver-xorg-video-intel (2:2.99.917+git20160706-1ubuntu1) yakkety; urgency=medium diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/.lastcommit xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/.lastcommit --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/.lastcommit 2016-11-27 15:37:38.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/.lastcommit 2017-02-08 16:42:15.000000000 +0000 @@ -1 +1 @@ -commit bde946054efbc1c7ae1483b84c3b4fa3c2c7e2ec +commit e4fe79cf0d9a05ee3f3a027148ef0aeb2b1b34e1 diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/man/intel.man xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/man/intel.man --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/man/intel.man 2016-07-06 11:46:45.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/man/intel.man 2017-02-08 16:42:15.000000000 +0000 @@ -27,9 +27,9 @@ 865G, 915G, 915GM, 945G, 945GM, 965G, 965Q, 946GZ, 965GM, 945GME, G33, Q33, Q35, G35, GM45, G45, Q45, G43, G41 chipsets, Pineview-M in Atom N400 series, Pineview-D in Atom D400/D500 series, -Intel(R) HD Graphics: 2000-6000, -Intel(R) Iris(TM) Graphics: 5100/6100, and -Intel(R) Iris(TM) Pro Graphics: 5200/6200/P6300. +Intel(R) HD Graphics, +Intel(R) Iris(TM) Graphics, +Intel(R) Iris(TM) Pro Graphics. .SH CONFIGURATION DETAILS Please refer to __xconfigfile__(__filemansuffix__) for general configuration diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/README xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/README --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/README 2014-09-10 05:52:38.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/README 2017-02-08 16:42:15.000000000 +0000 @@ -15,9 +15,9 @@ G/Q33,G/Q35,G41,G/Q43,G/GM/Q45 PineView-M (Atom N400 series) PineView-D (Atom D400/D500 series) - Intel(R) HD Graphics: 2000-6000, - Intel(R) Iris(TM) Graphics: 5100/6100, and - Intel(R) Iris(TM) Pro Graphics: 5200/6200/P6300. + Intel(R) HD Graphics, + Intel(R) Iris(TM) Graphics, + Intel(R) Iris(TM) Pro Graphics. Where to get more information about the driver ---------------------------------------------- diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/i915_pciids.h xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/i915_pciids.h --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/i915_pciids.h 2016-09-22 16:11:08.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/i915_pciids.h 2017-02-08 16:42:15.000000000 +0000 @@ -280,14 +280,14 @@ INTEL_VGA_DEVICE(0x1923, info), /* ULT GT3 */ \ INTEL_VGA_DEVICE(0x1926, info), /* ULT GT3 */ \ INTEL_VGA_DEVICE(0x1927, info), /* ULT GT3 */ \ - INTEL_VGA_DEVICE(0x192B, info), /* Halo GT3 */ \ - INTEL_VGA_DEVICE(0x192A, info) /* SRV GT3 */ + INTEL_VGA_DEVICE(0x192B, info) /* Halo GT3 */ \ #define INTEL_SKL_GT4_IDS(info) \ INTEL_VGA_DEVICE(0x1932, info), /* DT GT4 */ \ INTEL_VGA_DEVICE(0x193B, info), /* Halo GT4 */ \ INTEL_VGA_DEVICE(0x193D, info), /* WKS GT4 */ \ - INTEL_VGA_DEVICE(0x193A, info) /* SRV GT4 */ + INTEL_VGA_DEVICE(0x192A, info), /* SRV GT4 */ \ + INTEL_VGA_DEVICE(0x193A, info) /* SRV GT4e */ #define INTEL_SKL_IDS(info) \ INTEL_SKL_GT1_IDS(info), \ @@ -336,4 +336,8 @@ INTEL_KBL_GT3_IDS(info), \ INTEL_KBL_GT4_IDS(info) +#define INTEL_GLK_IDS(info) \ + INTEL_VGA_DEVICE(0x3184, info), \ + INTEL_VGA_DEVICE(0x3185, info) + #endif /* _I915_PCIIDS_H */ diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/intel_module.c xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/intel_module.c --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/intel_module.c 2016-11-27 15:37:38.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/intel_module.c 2017-02-08 16:42:15.000000000 +0000 @@ -134,6 +134,10 @@ .gen = 0112, }; +static const struct intel_device_info intel_geminilake_info = { + .gen = 0113, +}; + static const SymTabRec intel_chipsets[] = { {PCI_CHIP_I810, "i810"}, {PCI_CHIP_I810_DC100, "i810-dc100"}, @@ -272,6 +276,33 @@ {0x22b2, "HD Graphics"}, {0x22b3, "HD Graphics"}, + /* Skylake */ + {0x1902, "HD Graphics 510"}, + {0x1906, "HD Graphics 510"}, + {0x190B, "HD Graphics 510"}, + {0x1912, "HD Graphics 530"}, + {0x1916, "HD Graphics 520"}, + {0x191B, "HD Graphics 530"}, + {0x191D, "HD Graphics P530"}, + {0x191E, "HD Graphics 515"}, + {0x1921, "HD Graphics 520"}, + {0x1926, "Iris Graphics 540"}, + {0x1927, "Iris Graphics 550"}, + {0x192B, "Iris Graphics 555"}, + {0x192D, "Iris Graphics P555"}, + {0x1932, "Iris Pro Graphics 580"}, + {0x193A, "Iris Pro Graphics P580"}, + {0x193B, "Iris Pro Graphics 580"}, + {0x193D, "Iris Pro Graphics P580"}, + + /* Broxton (Apollolake) */ + {0x5A84, "HD Graphics 505"}, + {0x5A85, "HD Graphics 500"}, + + /* Kabylake */ + {0x5916, "HD Graphics 620"}, + {0x591E, "HD Graphics 615"}, + /* When adding new identifiers, also update: * 1. intel_identify() * 2. man/intel.man @@ -335,6 +366,8 @@ INTEL_KBL_IDS(&intel_kabylake_info), + INTEL_GLK_IDS(&intel_geminilake_info), + INTEL_VGA_DEVICE(PCI_MATCH_ANY, &intel_generic_info), #endif @@ -465,9 +498,9 @@ if (unique != stack) free(unique); - xf86Msg(X_INFO, INTEL_NAME ": Driver for Intel(R) HD Graphics: 2000-6000\n"); - xf86Msg(X_INFO, INTEL_NAME ": Driver for Intel(R) Iris(TM) Graphics: 5100, 6100\n"); - xf86Msg(X_INFO, INTEL_NAME ": Driver for Intel(R) Iris(TM) Pro Graphics: 5200, 6200, P6300\n"); + xf86Msg(X_INFO, INTEL_NAME ": Driver for Intel(R) HD Graphics\n"); + xf86Msg(X_INFO, INTEL_NAME ": Driver for Intel(R) Iris(TM) Graphics\n"); + xf86Msg(X_INFO, INTEL_NAME ": Driver for Intel(R) Iris(TM) Pro Graphics\n"); } static Bool intel_driver_func(ScrnInfoPtr pScrn, diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/gen2_render.c xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/gen2_render.c --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/gen2_render.c 2016-11-27 15:37:38.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/gen2_render.c 2017-02-08 16:42:15.000000000 +0000 @@ -49,6 +49,7 @@ #define MAX_3D_SIZE 2048 #define MAX_3D_PITCH 8192 +#define MAX_INLINE (1 << 18) #define BATCH(v) batch_emit(sna, v) #define BATCH_F(v) batch_emit_float(sna, v) @@ -1199,7 +1200,13 @@ sna->render.vertex_offset = sna->kgem.nbatch; BATCH(PRIM3D_INLINE | PRIM3D_RECTLIST); } - } + + need = 0; + } else + need = sna->kgem.nbatch - sna->render.vertex_offset; + + if (rem > MAX_INLINE - need) + rem = MAX_INLINE -need; if (want > 1 && want * size > rem) want = rem / size; @@ -3230,6 +3237,9 @@ int size = floats_per_vertex * 3; int rem = batch_space(sna) - 1; + if (rem > MAX_INLINE) + rem = MAX_INLINE; + if (size * want > rem) want = rem / size; diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/gen9_render.c xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/gen9_render.c --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/gen9_render.c 2016-11-27 15:37:38.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/gen9_render.c 2017-02-08 16:42:15.000000000 +0000 @@ -240,6 +240,11 @@ .urb = { .max_vs_entries = 960 }, }; +static const struct gt_info glk_gt_info = { + .name = "Geminilake (gen9)", + .urb = { .max_vs_entries = 320 }, +}; + static bool is_skl(struct sna *sna) { return sna->kgem.gen == 0110; @@ -255,6 +260,11 @@ return sna->kgem.gen == 0112; } +static bool is_glk(struct sna *sna) +{ + return sna->kgem.gen == 0113; +} + static inline bool too_large(int width, int height) { @@ -1101,6 +1111,17 @@ return; render->ve_id = id; + if (render->ve_dirty) { + /* dummy primitive to flush vertex before change? */ + OUT_BATCH(GEN9_3DPRIMITIVE | (7 - 2)); + OUT_BATCH(0); /* ignored, see VF_TOPOLOGY */ + OUT_BATCH(0); + OUT_BATCH(0); + OUT_BATCH(1); /* single instance */ + OUT_BATCH(0); /* start instance location */ + OUT_BATCH(0); /* index buffer offset, ignored */ + } + /* The VUE layout * dword 0-3: pad (0.0, 0.0, 0.0. 0.0) * dword 4-7: position (x, y, 1.0, 1.0), @@ -1198,6 +1219,8 @@ offset << VE_OFFSET_SHIFT); OUT_BATCH(dw); } + + render->ve_dirty = true; } inline static void @@ -1322,6 +1345,7 @@ OUT_BATCH(0); /* index buffer offset, ignored */ state->last_primitive = sna->kgem.nbatch; + state->ve_dirty = false; return true; } @@ -1508,6 +1532,7 @@ sna->render.vertex_start = sna->render.vertex_index; sna->render_state.gen9.last_primitive = sna->kgem.nbatch; + sna->render_state.gen9.ve_dirty = false; } static bool gen9_rectangle_begin(struct sna *sna, @@ -3967,6 +3992,7 @@ sna->render_state.gen9.emit_flush = false; sna->render_state.gen9.needs_invariant = true; sna->render_state.gen9.ve_id = 3 << 2; + sna->render_state.gen9.ve_dirty = false; sna->render_state.gen9.last_primitive = -1; sna->render_state.gen9.num_sf_outputs = 0; @@ -4012,6 +4038,8 @@ state->info = &bxt_gt_info; if (is_kbl(sna)) state->info = &kbl_gt_info; + if (is_glk(sna)) + state->info = &glk_gt_info; sna_static_stream_init(&general); diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_accel.c xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/sna_accel.c --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_accel.c 2016-11-27 15:37:38.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/sna_accel.c 2017-02-08 16:42:15.000000000 +0000 @@ -4044,26 +4044,28 @@ goto move_to_gpu; } - if ((priv->cpu_damage == NULL || flags & IGNORE_DAMAGE)) { - if (priv->gpu_bo && priv->gpu_bo->tiling) { - DBG(("%s: prefer to use GPU bo for rendering large pixmaps\n", __FUNCTION__)); - goto prefer_gpu_bo; + if (!priv->shm) { + if ((priv->cpu_damage == NULL || flags & IGNORE_DAMAGE)) { + if (priv->gpu_bo && priv->gpu_bo->tiling) { + DBG(("%s: prefer to use GPU bo for rendering large pixmaps\n", __FUNCTION__)); + goto prefer_gpu_bo; + } + + if (priv->cpu_bo->pitch >= 4096) { + DBG(("%s: prefer to use GPU bo for rendering wide pixmaps\n", __FUNCTION__)); + goto prefer_gpu_bo; + } } - if (priv->cpu_bo->pitch >= 4096) { - DBG(("%s: prefer to use GPU bo for rendering wide pixmaps\n", __FUNCTION__)); + if ((flags & IGNORE_DAMAGE) == 0 && priv->cpu_bo->snoop) { + DBG(("%s: prefer to use GPU bo for reading from snooped target bo\n", __FUNCTION__)); goto prefer_gpu_bo; } - } - if ((flags & IGNORE_DAMAGE) == 0 && priv->cpu_bo->snoop) { - DBG(("%s: prefer to use GPU bo for reading from snooped target bo\n", __FUNCTION__)); - goto prefer_gpu_bo; - } - - if (!sna->kgem.can_blt_cpu) { - DBG(("%s: can't render to CPU bo, try to use GPU bo\n", __FUNCTION__)); - goto prefer_gpu_bo; + if (!sna->kgem.can_blt_cpu) { + DBG(("%s: can't render to CPU bo, try to use GPU bo\n", __FUNCTION__)); + goto prefer_gpu_bo; + } } } diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_display.c xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/sna_display.c --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_display.c 2016-11-27 15:37:38.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/sna_display.c 2017-02-08 16:42:15.000000000 +0000 @@ -1033,6 +1033,9 @@ DBG(("%s: lookup %s\n", __FUNCTION__, path)); dir = opendir(path); + if (dir == NULL) + return NULL; + while ((de = readdir(dir))) { struct stat st; @@ -5092,7 +5095,6 @@ if (strcmp(output->name, name) == 0) { assert(output->scrn == scrn); assert(output->funcs == &sna_output_funcs); - assert(to_sna_output(output)->id == 0); sna_output_destroy(output); goto reset; } @@ -5257,8 +5259,10 @@ for (c = 0; c < sna->mode.num_real_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c]; - if (!crtc->enabled) + if (!crtc->enabled) { + sna_crtc_disable(crtc, false); continue; + } for (o = 0; o < sna->mode.num_real_output; o++) { xf86OutputPtr output = config->output[o]; @@ -5369,6 +5373,7 @@ { ScreenPtr screen = xf86ScrnToScreen(sna->scrn); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(sna->scrn); + bool force = sna->flags & SNA_REPROBE; struct drm_mode_card_res res; uint32_t connectors[32], now; unsigned changed = 0; @@ -5402,7 +5407,11 @@ if (serial == 0) serial = ++sna->mode.serial; - now = GetTimeInMillis(); + if (force) { + changed = 4; + now = 0; + } else + now = GetTimeInMillis(); for (i = 0; i < res.count_connectors; i++) { DBG(("%s: connector[%d] = %d\n", __FUNCTION__, i, connectors[i])); for (j = 0; j < sna->mode.num_real_output; j++) { @@ -5671,6 +5680,14 @@ assert(sna->mode.shadow_damage == NULL); assert(sna->mode.shadow == NULL); + /* Flush pending shadow updates */ + if (sna->mode.flip_active) { + DBG(("%s: waiting for %d outstanding TearFree flips\n", + __FUNCTION__, sna->mode.flip_active)); + while (sna->mode.flip_active && sna_mode_wait_for_event(sna)) + sna_mode_wakeup(sna); + } + /* Cancel a pending [un]flip (as the pixmaps no longer match) */ sna_present_cancel_flip(sna); copy_front(sna, sna->front, new_front); @@ -5684,14 +5701,6 @@ scrn->virtualY = height; scrn->displayWidth = width; - /* Flush pending shadow updates */ - if (sna->mode.flip_active) { - DBG(("%s: waiting for %d outstanding TearFree flips\n", - __FUNCTION__, sna->mode.flip_active)); - while (sna->mode.flip_active && sna_mode_wait_for_event(sna)) - sna_mode_wakeup(sna); - } - /* Only update the CRTCs if we are in control */ if (!scrn->vtSema) return TRUE; diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_display_fake.c xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/sna_display_fake.c --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_display_fake.c 2016-07-06 11:46:45.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/sna_display_fake.c 2017-02-08 16:42:15.000000000 +0000 @@ -96,12 +96,6 @@ } static void -sna_crtc_gamma_set(xf86CrtcPtr crtc, - CARD16 *red, CARD16 *green, CARD16 *blue, int size) -{ -} - -static void sna_crtc_destroy(xf86CrtcPtr crtc) { } @@ -109,7 +103,6 @@ static const xf86CrtcFuncsRec sna_crtc_funcs = { .dpms = sna_crtc_dpms, .set_mode_major = sna_crtc_set_mode_major, - .gamma_set = sna_crtc_gamma_set, .destroy = sna_crtc_destroy, }; @@ -298,7 +291,8 @@ RRCrtcSetRotations(crtc->randr_crtc, RR_Rotate_All | RR_Reflect_All); - RRCrtcGammaGet(crtc->randr_crtc); + if (!RRCrtcGammaSetSize(crtc->randr_crtc, 256)) + goto err; } sna->mode.num_fake++; diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_driver.c xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/sna_driver.c --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_driver.c 2016-11-27 15:37:38.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/sna_driver.c 2017-02-08 16:42:15.000000000 +0000 @@ -806,10 +806,12 @@ str = udev_device_get_property_value(dev, "HOTPLUG"); if (str && atoi(str) == 1) { str = udev_device_get_property_value(dev, "CONNECTOR"); - if (str) + if (str) { hotplug |= sna_mode_find_hotplug_connector(sna, atoi(str)); - else + } else { + sna->flags |= SNA_REPROBE; hotplug = true; + } } } diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna.h xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/sna.h --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna.h 2016-11-27 15:37:38.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/sna.h 2017-02-08 16:42:15.000000000 +0000 @@ -1367,6 +1367,9 @@ if (!priv->shm) return; + DBG(("%s: marking handle=%d for SHM flush\n", + __FUNCTION__, priv->cpu_bo->handle)); + assert(!priv->flush); sna_add_flush_pixmap(sna, priv, priv->cpu_bo); sna->needs_shm_flush = true; diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_present.c xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/sna_present.c --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_present.c 2016-11-27 15:37:38.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/sna_present.c 2017-02-08 16:42:15.000000000 +0000 @@ -926,12 +926,12 @@ goto notify; } - assert(sna_pixmap(screen->GetScreenPixmap(screen))->pinned & PIN_SCANOUT); - /* Are we unflipping after a failure that left our ScreenP in place? */ if (!sna_needs_page_flip(sna, bo)) goto notify; + assert(sna_pixmap(screen->GetScreenPixmap(screen))->pinned & PIN_SCANOUT); + if (sna->flags & SNA_HAS_ASYNC_FLIP) { DBG(("%s: trying async flip restore\n", __FUNCTION__)); if (flip__async(sna, NULL, event_id, 0, bo)) diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_render.h xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/sna_render.h --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/src/sna/sna_render.h 2016-07-06 11:46:45.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/src/sna/sna_render.h 2017-02-08 16:42:15.000000000 +0000 @@ -623,6 +623,7 @@ bool needs_invariant; bool emit_flush; + bool ve_dirty; }; struct sna_static_stream { diff -Nru xserver-xorg-video-intel-2.99.917+git20161127.bde94605/tools/virtual.c xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/tools/virtual.c --- xserver-xorg-video-intel-2.99.917+git20161127.bde94605/tools/virtual.c 2016-07-06 11:46:45.000000000 +0000 +++ xserver-xorg-video-intel-2.99.917+git20170208.e4fe79cf/tools/virtual.c 2017-02-08 16:42:15.000000000 +0000 @@ -3392,6 +3392,7 @@ uint64_t count; int daemonize = 1, bumblebee = 0, siblings = 0, singleton = 1; int i, ret, open, fail; + int idle; signal(SIGPIPE, SIG_IGN); @@ -3572,21 +3573,30 @@ ctx.command_continuation = 0; update_cursor_image(&ctx); + + idle = 0; while (!done) { XEvent e; int reconfigure = 0; int rr_update = 0; - DBG(POLL, ("polling - enable timer? %d, nfd=%d, ndisplay=%d\n", ctx.timer_active, ctx.nfd, ctx.ndisplay)); - ret = poll(ctx.pfd + !ctx.timer_active, ctx.nfd - !ctx.timer_active, -1); - if (ret <= 0) - break; + if (idle) { + DBG(POLL, ("polling - enable timer? %d, nfd=%d, ndisplay=%d\n", ctx.timer_active, ctx.nfd, ctx.ndisplay)); + ret = poll(ctx.pfd + !ctx.timer_active, ctx.nfd - !ctx.timer_active, -1); + if (ret <= 0) + break; + + DBG(POLL, ("poll reports %d fd awake\n", ret)); + } + idle = 1; /* pfd[0] is the timer, pfd[1] is the local display, pfd[2] is the mouse, pfd[3+] are the remotes */ - DBG(POLL, ("poll reports %d fd awake\n", ret)); if (ctx.pfd[1].revents || XPending(ctx.display[0].dpy)) { DBG(POLL,("%s woken up\n", DisplayString(ctx.display[0].dpy))); + ctx.pfd[1].revents = 0; + idle = 0; + do { XNextEvent(ctx.display->dpy, &e); @@ -3663,6 +3673,9 @@ if (ctx.pfd[i+2].revents == 0 && !XPending(ctx.display[i].dpy)) continue; + ctx.pfd[i+2].revents = 0; + idle = 0; + DBG(POLL, ("%s woken up\n", DisplayString(ctx.display[i].dpy))); do { XNextEvent(ctx.display[i].dpy, &e); @@ -3742,6 +3755,7 @@ DBG(TIMER, ("%s timer still active? %d\n", DisplayString(ctx.display->dpy), ret != 0)); ctx.timer_active = ret != 0; + idle = 0; } }