diff -Nru xserver-xorg-video-amdgpu-1.1.2/aclocal.m4 xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/aclocal.m4 --- xserver-xorg-video-amdgpu-1.1.2/aclocal.m4 2016-09-16 09:02:49.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/aclocal.m4 2016-10-10 06:28:32.000000000 +0000 @@ -9068,7 +9068,7 @@ m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -dnl serial 11 (pkg-config-0.29) +dnl serial 11 (pkg-config-0.29.1) dnl dnl Copyright © 2004 Scott James Remnant . dnl Copyright © 2012-2015 Dan Nicholson @@ -9110,7 +9110,7 @@ dnl See the "Since" comment for each macro you use to see what version dnl of the macros you require. m4_defun([PKG_PREREQ], -[m4_define([PKG_MACROS_VERSION], [0.29]) +[m4_define([PKG_MACROS_VERSION], [0.29.1]) m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1, [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])]) ])dnl PKG_PREREQ @@ -9767,24 +9767,17 @@ 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], - [# 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])])])]) + [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-amdgpu-1.1.2/ChangeLog xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/ChangeLog --- xserver-xorg-video-amdgpu-1.1.2/ChangeLog 2016-10-10 06:31:18.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/ChangeLog 2016-10-10 06:28:35.000000000 +0000 @@ -1,12 +1,47 @@ -commit b407c1244d28a80f76275abca2239cdd4120f017 +commit 16888123fd1cd8042d45ec5dddb0ac44304bfdb2 +Author: Rico Tzschichholz +Date: Mon Oct 10 08:28:12 2016 +0200 + + Add debian tree from origin/debian-unstable + +commit d42773eb45baff5933730e26878a0b45fcf07b65 +Author: Michel Dänzer +Date: Wed Sep 28 18:17:53 2016 +0900 + + Rotate and reflect cursor hotspot position for drmModeSetCursor2 + + We were always passing the hotspot position in the X screen coordinate + space, but drmModeSetCursor2 needs it in the CRTC coordinate space. The + wrong hotspot position would cause the kernel driver to adjust the + HW cursor position incorrectly when the hotspot position changed. + + Reviewed-by: Alex Deucher + +commit bdee9f4dd4f21015e7696e06c4b485ab2b3a16dc Author: Michel Dänzer -Date: Fri Sep 16 18:11:31 2016 +0900 +Date: Wed Aug 31 16:46:56 2016 +0900 - Bump version for 1.1.2 release + Add support for ScreenPtr::SyncSharedPixmap + + This allows deferring shared pixmap updates between different drivers. + + (Ported from radeon commit 53be26b00e83f871f0afd39caa5a7a1d6ec4aea1) + Reviewed-by: Alex Deucher + +commit 97d7386caf7ba53d2cf398b8a9bb65d0a2a4770a +Author: Michel Dänzer +Date: Fri Sep 16 16:36:23 2016 +0900 + + Untangle HAS_XORG_CONF_DIR / --with-xorg-conf-dir lines in configure.ac + + $sysconfigdir used to be part of the default --with-xorg-conf-dir value, + but it no longer is. + + Reviewed-by: Alex Deucher -commit 82062157263d6f63ce8f645bf32101fd18bd98e5 +commit aa8a3fa2468094cd37959179e8417ba7ba0a326c Author: Michel Dänzer -Date: Fri Sep 16 18:01:41 2016 +0900 +Date: Fri Sep 16 15:59:16 2016 +0900 Fix handling of configure option --with-xorg-conf-dir @@ -28,17 +63,10 @@ Reported-by: Timo Aaltonen Reviewed-by: Julien Cristau - (Cherry picked from commit aa8a3fa2468094cd37959179e8417ba7ba0a326c) - -commit 6eb2b507d9ec8dcde2482a5ebf59c001933e10ea -Author: Michel Dänzer -Date: Wed Sep 14 18:26:50 2016 +0900 - - Bump version for the 1.1.1 release -commit 8761c46babe0ec01da784dd27db3dd9e769acbca +commit cd3acb75718dfd42dd25d58b4e7bd4db27b659d8 Author: Michel Dänzer -Date: Thu Sep 15 15:28:12 2016 +0900 +Date: Wed Sep 14 18:33:42 2016 +0900 Use --with-xorg-conf-dir=$prefix/share/X11/xorg.conf.d by default @@ -51,2371 +79,1311 @@ This matches what some (though not all) input drivers are doing for their xorg.conf.d snippets. - - (Cherry picked from commit cd3acb75718dfd42dd25d58b4e7bd4db27b659d8) -commit ca1cf24d4eb773f7380c0da3fa942a5c85074422 -Author: Marek Olšák -Date: Wed Sep 14 17:30:19 2016 +0900 +commit 0f8df8584ad61a3e47fe303b34cd7b0c4ed08bb0 +Author: Michel Dänzer +Date: Thu Sep 8 18:14:49 2016 +0900 - Fix cursor size for SI + Make TearFree effective with PRIME slave scanout - Reviewed-by: Michel Dänzer - Acked-by: Edward O'Callaghan - (Cherry picked from commit c4364520691d18961f0a6b77071baeeffaa80a11) - -commit ca84c49c88235e1909d11e192eada816b782f041 -Author: Ronie Salgado -Date: Wed Sep 14 17:30:30 2016 +0900 - - Add SI PCI IDs + TearFree can now prevent tearing with any possible display + configuration. - Reviewed-by: Michel Dänzer - (Cherry picked from commit 2eb5d77b841e55e7328df4b95c0d41fec30ce10f) + Note that there may still be inter-GPU tearing if the primary GPU uses + a different driver. + + (Ported from radeon commit 38797a33117222dadbc89e5f21ed8cd5deef9bea) + Reviewed-by: Alex Deucher -commit e80321016f7cab9d46f83b785d576d7f02e680ed +commit d6feed2cd78fe879aba4860a6d9bc2e388b9f135 Author: Michel Dänzer -Date: Wed Sep 14 17:20:28 2016 +0900 +Date: Thu Sep 8 17:56:24 2016 +0900 - Add missing Kaveri PCI ID (1318) + Synchronize scanout pixmaps for TearFree - Found by comparing src/pcidb/ati_pciids.csv with xf86-video-ati. + Copy the damaged areas which are still valid in the other scanout pixmap + from there, then only copy the remaining damaged area from the screen + pixmap. + + This is slightly more efficient (only needs one Damage record instead of + two, and only needs to copy each screen update across PCIe once with + ShadowPrimary and a discrete GPU), and will be significantly more + efficient for PRIME with the following change. + (Ported from radeon commit eda1f3df6aaed683036369fe8820da4dac3c2ae2) Reviewed-by: Alex Deucher - (Cherry picked from commit 7d050d15d49ef25e86e7abe88dafb52370715640) -commit 772e43d3e890b193ba24274bf629c8304f17cebc +commit 4927b84ec84bc0cb5055686cca6be54390f82803 Author: Michel Dänzer -Date: Wed Sep 14 17:19:58 2016 +0900 +Date: Thu Sep 8 17:52:25 2016 +0900 - Add Mullins PCI IDs + Move up amdgpu_scanout_extents_intersect - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97472 + Will be needed higher up by the following changes. No functional change. + + (Ported from radeon commit 2f6e5fb15f1a9ce523c85550e493f8bda9d0c00f) Reviewed-by: Alex Deucher - (Cherry picked from commit aa5492660958e359bdc2107cba9a211ff988c90e) -commit 3edf690d391b290066a3f39eb24695b8c8a0aaab -Author: Qiang Yu -Date: Wed Sep 14 17:19:29 2016 +0900 +commit 1c725f63961746258f6138b47037ec18bf508d78 +Author: Michel Dänzer +Date: Thu Sep 8 17:45:32 2016 +0900 - DRI2: Fix amdgpu_dri2_exchange_buffers width/height copy'n'paste error + Factor out transform_region helper - Signed-off-by: Qiang Yu + (Ported from radeon commit 5a57005178fc13b6f7e513458ca6dae72a3e5783) Reviewed-by: Alex Deucher - Reviewed-by: Michel Dänzer - (Cherry picked from commit 73c8dc000ad6b2b53ba3aa7155f5e8f6b55623b7) -commit 0b3bde7f9e42577b6720cb290d03fab3b05614b4 +commit c92842764f95fa09e145d81f80e9fa39ea8c453c Author: Michel Dänzer -Date: Wed Sep 14 17:18:51 2016 +0900 +Date: Thu Sep 8 17:26:18 2016 +0900 - DRI2: Add interpolated_vblanks in amdgpu_dri2_get_crtc_msc - - We need that in amdgpu_dri2_drawable_crtc as well for priv->vblank_delta - to work as intended. + Only copy from screen pixmap to shared pixmap on demand for slave scanout - amdgpu_dri2_get_msc was already doing this. + Only copy once for each time we update the corresponding scanout pixmap. + This can significantly reduce the bandwidth usage when there are + frequent updates to the screen pixmap. - Fixes hangs in some cases when using VDPAU via DRI2 and moving the - window between CRTCs. + This initial implementation only works when both the master and slave + screens use this driver. + (Ported from radeon commit 99232f64db52812a843cd616d263d3a6b90eef3d) Reviewed-by: Alex Deucher - (Cherry picked from commit abd1a7901c95e4bc78415cf1b7923623b9177152) -commit 2e6e81aa8d4b33eb326e674dca4e29b3d638cac0 +commit 61ceefe17fe9e6ffbaaad0e216b2bd37fd39f47d Author: Michel Dänzer -Date: Wed Sep 14 17:17:39 2016 +0900 +Date: Thu Sep 8 17:15:03 2016 +0900 - Only use RandR APIs if RandR is enabled + Track damage accurately for RandR 1.4 slave scanout - Fixes crash with Xinerama enabled, which disables RandR. - - Fixes: https://bugs.debian.org/827984 + This further reduces the PCIe bandwidth usage. - (Ported from radeon commit 3be841d0ae7d505cef325993205b12d15e98dba9) + (Ported from radeon commit b0867063abb197b9134166706d99fcbe5f204bb5, + plus leak fix from 5a57005178fc13b6f7e513458ca6dae72a3e5783) Reviewed-by: Alex Deucher - (Cherry picked from commit b5e2b964b7884c205a7c0fa578e05e867c176fcc) -commit 01565e4427b192c7c55a820f1fb762e852859903 +commit 6d31fb124d4418e64c949bde9ed1facf95967762 Author: Michel Dänzer -Date: Wed Sep 14 17:16:49 2016 +0900 +Date: Thu Sep 8 17:04:05 2016 +0900 - Destroy all dedicated scanout buffers during CloseScreen + Handle RandR 1.4 slave dirty updates via amdgpu_drm_queue - Fixes leaking active scanout buffers across a server reset, which also - fixes server reset with glamor and active scanout buffers. + This reduces PCIe bandwidth usage and tearing. + (Ported from radeon commit ad0a0656dd0e74683e6d7789decba827aa29c221) Reviewed-by: Alex Deucher - (Cherry picked from commit d96dabc71b1b32dc4b422a9633cdd4e0e95da052) -commit 7977f39d3c7847aeba2a06f4923f12eee27b4474 +commit b10ecdbd89b0a60a990c78c3e53bab6c4c96fe9f Author: Michel Dänzer -Date: Wed Sep 14 16:50:36 2016 +0900 +Date: Thu Sep 8 16:48:59 2016 +0900 - glamor: Reallocate linear pixmap BO if necessary for DRI2 PRIME + Use drmmode_crtc_scanout_* helpers for RandR 1.4 scanout pixmaps - Fixes corruption when using DRI2 PRIME render offloading with the master - screen using this driver. + This should allow using multiple CRTCs via RandR 1.4 even with xserver + < 1.17. It also simplifies the code a little, and paves the way for + following changes. - Reported-by: Qiang Yu + (Ported from radeon commits 4cfa4615f79f64062e5e771cd45dd7048f48b4f6 + and a92c27484703abc7c410b6ae0e4b8d1efbbb8e6f) Reviewed-by: Alex Deucher - Tested-by: Qiang Yu - (Cherry picked from commit 0007c2f018ba663303d91d847e7c085269a23062) -commit 062a7b9b81473969e5ca6034e5369106bf3088c4 +commit 9565981f751b0884cbfa885b8f3af3d41a965a2b Author: Michel Dänzer -Date: Wed Sep 14 16:49:53 2016 +0900 +Date: Wed Sep 7 18:49:54 2016 +0900 - Move DRI2's local fixup_glamor helper to amdgpu_glamor_set_pixmap_bo v2 + Wait for pending flips to complete before turning off an output or CRTC - So it can be used outside of the DRI2 code. + At least with older kernels, the flip may never complete otherwise, + which can result in us hanging in drmmode_set_mode_major. - v2: Keep pixmap refcnt increment in amdgpu_dri2_create_buffer2 (Qiang Yu) + Fixes: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-ati/+bug/1577170 + (Ported from radeon commits 9090309e057dc703d1a5bffd88e6cae14108cfc3, + e520ce0ec0adf91ddce5c932d4b3f9477fd49304, + a36fdaff40d5b4795a1400c348a80eee94892212 and + 4bd2d01552f18153afa03a8947b22eebf3d67c6b) Reviewed-by: Alex Deucher - Tested-by: Qiang Yu (v1) - (Cherry picked from commit 5518bf5d793439b5bab369e5fc18de9a4a3b9dd6) -commit 7dc2c5bae56a0c2aab38a9d8e77966b5d2f22ff2 +commit c7d27c94cb656899746898c2e55407c3e3d7cdc8 Author: Michel Dänzer -Date: Wed Sep 14 16:48:46 2016 +0900 +Date: Wed Sep 7 18:28:23 2016 +0900 - Consolidate get_drawable_pixmap helper + Keep track of damage event related flushes per-client - There were two static helpers for the same purpose. Consolidate them - into a single inline helper which can be used anywhere. + This further reduces the compositing slowdown due to flushing overhead, + by only flushing when the X server actually sends XDamageNotify events + to a client, and there hasn't been a flush yet in the meantime. + (Ported from radeon commit 121a6de72da5fcf9a32408eff36b2235f3dfbcfe) Reviewed-by: Alex Deucher - Tested-by: Qiang Yu - (Cherry picked from commit 641f4647b7f51dfd2da330376cd10fa9702b6423) -commit 5be3295cb2068d0b8234344f66ece245e4fa7999 +commit 58773d1945cfa8155d8a6c5eb3f95097535604ef Author: Michel Dänzer -Date: Wed Sep 14 16:43:48 2016 +0900 +Date: Wed Sep 7 18:14:10 2016 +0900 - Add amdgpu_pixmap_get_tiling_info + Use EventCallback to avoid flushing every time in the FlushCallback - Retrieves the tiling information about a pixmap BO from the kernel - driver. + We only need to flush for XDamageNotify events. + + Significantly reduces compositing slowdown due to flushing overhead, in + particular with glamor. + (Ported from radeon commit 9a1afbf61fbb2827c86bd86d295fa0848980d60b) Reviewed-by: Alex Deucher - Tested-by: Qiang Yu - (Cherry picked from commit 8e40f190e4704c2802bf0f073f17e742786d0f18) -commit 8cd5aa76c7d7fc48f42c31020306ea871e9edda2 +commit d166d04f6951f6a48d7d5ce5d31bba857fe0cb06 Author: Michel Dänzer -Date: Wed Sep 14 16:43:10 2016 +0900 +Date: Wed Sep 7 18:03:05 2016 +0900 - Remove amdgpu_share_pixmap_backing + Add explicit AMDGPU_DRM_QUEUE_ERROR define - Not used anymore. + Should make the amdgpu_drm_queue_alloc error handling clearer, and gets + rid of a compile warning about it returning NULL. + (Ported from radeon commit a37af701768b12d86868a831a79f1e02ee4968cf) Reviewed-by: Alex Deucher - Tested-by: Qiang Yu - (Cherry picked from commit e7eeb6ad1133b6023d34b4489959ae330a8e15dd) -commit 0af88ed18a22b7d038c735093236c54eadc3b118 +commit 6a1ba044c2b71081e6060d0c096917d6238f2145 Author: Michel Dänzer -Date: Wed Sep 14 16:42:39 2016 +0900 +Date: Mon Aug 29 16:43:59 2016 +0900 - glamor: Fix amdgpu_glamor_share_pixmap_backing for priv->bo == NULL - - Fixes crash when running a compositor and DRI_PRIME client via DRI2. + Only list each unique chipset family once in the log file - Reported-by: Qiang Yu + Acked-by: Christian König Reviewed-by: Alex Deucher - Tested-by: Qiang Yu - (Cherry picked from commit b36c77695ba77b59a0ccd868454e3af4fc04d5ff) -commit 0d5b6957aef95872dd34ba0eb4284ebe70ee685d -Author: Alex Deucher -Date: Wed Sep 14 16:41:46 2016 +0900 +commit 7d050d15d49ef25e86e7abe88dafb52370715640 +Author: Michel Dänzer +Date: Mon Aug 29 16:13:20 2016 +0900 - add missing bonaire pci id + Add missing Kaveri PCI ID (1318) - Signed-off-by: Alex Deucher - (Cherry picked from commit 60ced5026ebc34d9f32c7618430b6a7ef7c8eb4b) + Found by comparing src/pcidb/ati_pciids.csv with xf86-video-ati. + + Reviewed-by: Alex Deucher -commit 10ff4b42eaa946364b19e9433bc85748e1db2835 -Author: Flora Cui -Date: Wed Sep 14 16:41:16 2016 +0900 +commit aa5492660958e359bdc2107cba9a211ff988c90e +Author: Michel Dänzer +Date: Mon Aug 29 15:52:48 2016 +0900 - Add more Polaris 11 PCI IDs + Add Mullins PCI IDs - Signed-off-by: Flora Cui - Reviewed-by: Christian König - Signed-off-by: Alex Deucher - (Cherry picked from commit 8e89448ee00da16e05e6777f34bb75d2dd6f7025) + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97472 + Reviewed-by: Alex Deucher -commit af5d3932147390ee2dcf33f594f549dc562e5078 -Author: Flora Cui -Date: Wed Sep 14 16:40:43 2016 +0900 +commit 73c8dc000ad6b2b53ba3aa7155f5e8f6b55623b7 +Author: Qiang Yu +Date: Mon Aug 22 19:13:26 2016 +0800 - Add more Polaris 10 PCI IDs + DRI2: Fix amdgpu_dri2_exchange_buffers width/height copy'n'paste error - Signed-off-by: Flora Cui + Signed-off-by: Qiang Yu Reviewed-by: Alex Deucher Reviewed-by: Michel Dänzer - Signed-off-by: Alex Deucher - (Cherry picked from commit a59b23d64285741a7a25e314343f6261046d980f) -commit da820a6661357ae707e5793a549476c085d90236 -Author: Qiang Yu -Date: Wed Sep 14 17:18:23 2016 +0900 +commit 5a4d3267ac3823fe58b51b0b9075b82375d7180c +Author: Michel Dänzer +Date: Wed Aug 17 18:57:01 2016 +0900 - Fix amdgpu_mode_hotplug crash on multi GPU platform. + Remove unused lut_r/g/b arrays from drmmode_crtc_private_rec - On multi GPU platform, some screen is created by other GPU DDX. + Fixes: 1091f28e1fa2 ("Remove drmmode_load_palette") + Reviewed-by: Alex Deucher + +commit c4364520691d18961f0a6b77071baeeffaa80a11 +Author: Marek Olšák +Date: Fri Aug 19 12:42:38 2016 +0200 + + Fix cursor size for SI + + Reviewed-by: Michel Dänzer + Acked-by: Edward O'Callaghan + +commit 2eb5d77b841e55e7328df4b95c0d41fec30ce10f +Author: Ronie Salgado +Date: Thu Feb 11 03:00:14 2016 -0300 + + Add SI PCI IDs - Signed-off-by: Qiang Yu Reviewed-by: Michel Dänzer - (Cherry picked from commit 978242977e5dc905e1d5a46b1b0d34b356c7af26) -commit f8c6e51211d2fe2d01fa2223b4215f293e6a11f5 +commit abd1a7901c95e4bc78415cf1b7923623b9177152 Author: Michel Dänzer -Date: Wed Sep 14 16:39:55 2016 +0900 +Date: Wed Jun 29 17:54:26 2016 +0900 - Handle Zaphod mode correctly in amdgpu_mode_hotplug + DRI2: Add interpolated_vblanks in amdgpu_dri2_get_crtc_msc - We need to scan both screens of the entity for existing connectors, and - enumerate DVI & HDMI connectors consistently regardless of which screen - they're assigned to. + We need that in amdgpu_dri2_drawable_crtc as well for priv->vblank_delta + to work as intended. - Fixes crash when hot-(un)plugging connectors in Zaphod mode. + amdgpu_dri2_get_msc was already doing this. - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93415 - (Ported from radeon commit c801f9f10a5d72d935faf21e72f7e7808fb4f05f) + Fixes hangs in some cases when using VDPAU via DRI2 and moving the + window between CRTCs. Reviewed-by: Alex Deucher - (Cherry picked from commit 14606e127f4b6eb0b00fd42cec13d524a67e4c4a) - -commit 988b6de86658b845af50542cfd71a0c9c267991d -Author: Flora Cui -Date: Wed Sep 14 16:38:56 2016 +0900 - - add strato pci id - - Signed-off-by: Flora Cui - Reviewed-by: Jammy Zhou - (Cherry picked from commit 4822ec7a23d2253c88bc403f17abb6d7a053528c) -commit 804dd4be71733f5f5078e5b4824abe9a9bb1228d +commit 978242977e5dc905e1d5a46b1b0d34b356c7af26 Author: Qiang Yu -Date: Wed Sep 14 16:01:16 2016 +0900 +Date: Wed Jul 13 19:25:12 2016 +0800 - Remove RR_Capability_SinkOutput for GPU without CRTC. + Fix amdgpu_mode_hotplug crash on multi GPU platform. + + On multi GPU platform, some screen is created by other GPU DDX. Signed-off-by: Qiang Yu - Reviewed-by: Alex Deucher Reviewed-by: Michel Dänzer - (Cherry picked from commit a0bbb373f902e0ffc14570c85faec7e44134f62e) -commit a04f4015d6afef20c2b79e2779f6555836ee2b07 -Author: Michel Dänzer -Date: Thu Apr 7 16:47:25 2016 +0900 +commit fdd1209e26128b3e894f2867fac3a1b08fe1f29e +Author: Keith Packard +Date: Tue Jul 19 09:16:32 2016 -0700 - Bump version for 1.1.0 release + Use NotifyFd for drm fd + + NotifyFd is available after API 22, and must be used after API 23. + + Signed-off-by: Keith Packard -commit aed1c17c43b2c0c983f6fc0973a5224d0faf32d9 +commit 17c0cf49746a20fb25610c24a40c441f88c08365 +Author: Adam Jackson +Date: Tue Jul 19 10:03:56 2016 -0400 + + Adapt Block/WakeupHandler signature for ABI 23 + + Signed-off-by: Adam Jackson + +commit b5e2b964b7884c205a7c0fa578e05e867c176fcc Author: Michel Dänzer -Date: Mon Apr 4 18:28:02 2016 +0900 +Date: Wed Jul 6 17:46:56 2016 +0900 - glamor: Force GPU rendering to/from pixmaps created via DRI3 + Only use RandR APIs if RandR is enabled - Fixes crash when running DRI3 clients with ShadowPrimary enabled. + Fixes crash with Xinerama enabled, which disables RandR. - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94799 + Fixes: https://bugs.debian.org/827984 + (Ported from radeon commit 3be841d0ae7d505cef325993205b12d15e98dba9) Reviewed-by: Alex Deucher -commit faf9d720b7d650f5f1ea657a874d08eac3972e60 +commit 84496ebc89a9973347c774c13ff6f4667fcdbe69 Author: Michel Dänzer -Date: Fri Apr 1 16:09:51 2016 +0900 +Date: Wed Jul 6 17:43:36 2016 +0900 - Update manpage entry for Option "TearFree" + Add .editorconfig file - It's now effective for rotation as well. + Basically a conversion from .dir-locals.el. EditorConfig supports many + more editors and IDEs. + (Ported from radeon commit aa07b365d7b0610411e118f105e49daff5f5a5cf) Reviewed-by: Alex Deucher -commit 5ba95c3abeb8df82aa8d33a47596eae6403ea7af +commit a576430526cbc404de64b30e1377a356644e8024 Author: Michel Dänzer -Date: Fri Apr 1 15:29:26 2016 +0900 +Date: Fri Jun 24 16:28:25 2016 +0900 - Identify DRM event queue entries by sequence number instead of by pointer - - If the memory for an entry was allocated at the same address as that for - a previously cancelled entry, the handler could theoretically be called - prematurely, triggered by the DRM event which was submitted for the - cancelled entry. + Clear damage in amdgpu_scanout_update if it doesn't intersect the CRTC - (Ported from radeon commit 4693b1bd5b5c381e8b7b68a6f7f0c6696d6a68df) + There's no need to test that same damage again. Reviewed-by: Alex Deucher -commit 8ecfa69b5a833bd4c39e773a6acfd7eef9144d13 +commit ede7f2bcae63be65e05e3029bfe7c742e5978932 Author: Michel Dänzer -Date: Wed Mar 30 18:33:00 2016 +0900 +Date: Fri Jun 24 16:19:15 2016 +0900 - DRI3: Refuse to open DRM file descriptor for ssh clients - - Fixes hangs when attempting to use DRI3 on display connections forwarded - via SSH. - - Don't do this for Xorg > 1.18.99.1 since the corresponding xserver - change has landed in Git master. - - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93261 + Remove w/h parameters from amdgpu_scanout_extents_intersect - (Ported from radeon commit 0b3aac1de9db42bfca545fa331e4985836682ec7) + We can use the dimensions of the CRTC's mode instead. Reviewed-by: Alex Deucher -commit b2a2e114eec0967f7b67f030fbab8983cf980489 +commit bf000ea7ef91f5ecb59fc3c1ab8ed9eddcc0841d Author: Michel Dänzer -Date: Fri Mar 25 11:55:34 2016 +0900 +Date: Thu Jun 23 17:28:16 2016 +0900 - Revert "Use render node for DRI3 if available" - - This reverts commit ea558e645786b08d75307716036045170e97b43e. + Make the dedicated scanout mechanism work with arbitrary transforms v2 - It broke VDPAU<->GL interop with DRI3 enabled, because the Gallium VDPAU - code doesn't support DRI3 yet. We can consider re-enabling this once - there is a Mesa release where the Gallium VDPAU code supports DRI3. + This makes TearFree work with arbitrary transforms, and makes transforms + work better even without TearFree, with xserver >= 1.12. - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94675 + v2: Preserve clamping of transformed damage extents to CRTC boundaries. Reviewed-by: Alex Deucher -commit e31a2d668a1b5ebaf75d423c8123cbc8e0dcbae9 -Author: Flora Cui -Date: Wed Nov 18 16:44:13 2015 +0800 +commit d96dabc71b1b32dc4b422a9633cdd4e0e95da052 +Author: Michel Dänzer +Date: Thu Jun 23 16:27:45 2016 +0900 - add polaris10 pci id + Destroy all dedicated scanout buffers during CloseScreen - Reviewed-by: Michel Dänzer - Signed-off-by: Flora Cui - Reviewed-by: Jammy Zhou + Fixes leaking active scanout buffers across a server reset, which also + fixes server reset with glamor and active scanout buffers. + + Reviewed-by: Alex Deucher -commit 6e09b8deb77f76b9bb7d393cc1ad924ebba62eff -Author: Flora Cui -Date: Thu Nov 5 14:16:39 2015 +0800 +commit 1091f28e1fa239ee1a973d84a8376fa4a95d7247 +Author: Michel Dänzer +Date: Thu Jun 23 12:47:04 2016 +0900 - add polaris11 pci id + Remove drmmode_load_palette + + Not used by any supported version of xserver. - Reviewed-by: Michel Dänzer - Signed-off-by: Flora Cui - Reviewed-By: Jammy Zhou Reviewed-by: Alex Deucher -commit 7d32c43fff4c8df32cce150223094f793e036cf3 -Author: Alex Deucher -Date: Wed Oct 28 17:28:23 2015 -0400 +commit 4d506c23c9a628204fa23607931557b07ada3e31 +Author: Michel Dänzer +Date: Wed Jun 22 17:16:24 2016 +0900 - add Polaris chip families + present: Separate checks for flips vs unflips v2 - Reviewed-by: Michel Dänzer - Signed-off-by: Alex Deucher + All unflip checks apply to flips as well, but not vice versa. + + v2: Add comment above amdgpu_present_check_unflip (Alex) + Reviewed-by: Alex Deucher -commit fbf9ae18cd241b8b78936aa30441e5fbfd9ba1c5 +commit decabd574f90d3df397c80ec931b3fde8a4afb49 Author: Michel Dänzer -Date: Thu Mar 24 19:05:15 2016 +0900 +Date: Wed Jun 22 17:43:41 2016 +0900 - Require xserver 1.9 or newer + dri2: Don't allow flipping when using a dedicated scanout buffer - 1.9.0 was released in August 2010. + Fixes issues when mixing rotation and page flipping with current xserver + Git master. - We were already unintentionally relying on things not available in 1.8 - for at least a year, and nobody has complained. + Reviewed-by: Alex Deucher + +commit 3ed28ce7cd26f89969617ba901ff253091d0d469 +Author: Michel Dänzer +Date: Wed Jun 22 16:54:01 2016 +0900 + + present: Don't allow flipping when using a dedicated scanout buffer - (Ported from radeon commit e592f32f8b5f5873fcc18b10a69dd5e4ccf11073) + Fixes issues when mixing rotation and page flipping with current xserver + Git master. Reviewed-by: Alex Deucher -commit 912db5fbbc6b9b1121c8a03168cb4bd870474376 +commit 9c3324715fd395fd486ea341654d78f4f298b97f Author: Michel Dänzer -Date: Thu Mar 24 18:59:05 2016 +0900 +Date: Wed Jun 22 16:12:32 2016 +0900 - Fix build against older versions of xserver - - Also slightly clean up the error handling in amdgpu_scanout_do_update. + Make sure drmmode_crtc->scanout[] are destroyed when not needed - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94614 + We failed to do this when going back to scanning out directly from the + screen pixmap. - (Ported from radeon commit bde466e5d44cad64b4e4eceaa5de80fdbf86356e) + As a bonus, since we now destroy drmmode_crtc->scanout[] after setting + the new scanout buffer, we may avoid the CRTC turning off intermittently + in this case. Reviewed-by: Alex Deucher -commit 3fb6280ab3b104b02841c7cab8ed68c1d463c834 +commit 3bce0519a4008cf87c0e31a7a579e10f5dcdd2f3 Author: Michel Dänzer -Date: Thu Mar 24 18:56:44 2016 +0900 +Date: Wed Jun 22 16:19:07 2016 +0900 - DRI3 only works with acceleration - - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94214 - - (Ported from radeon commit d21ac4669a8b2cdd4eec5e5a94d1950b7423b8b5) - - Reviewed-by: Alex Deucher - -commit 3177fe817a5f2de4ed10860866a0dd6d6c6ba816 -Author: Michel Dänzer -Date: Thu Mar 24 18:51:59 2016 +0900 - - Check for xf86CursorResetCursor - - If it's available, Xorg calls it on each mode configuration change. It - does what xf86_reload_cursors does (and more), so we don't need to call - the latter anymore. - - (Ported from radeon commit d670c5c9851b4eff21c845d26c7d7e4eb5ee0fa9) - - Reviewed-by: Alex Deucher - -commit a3dfce7b24e1ea01c1aa62926025a545312cbe13 -Author: Michel Dänzer -Date: Thu Mar 24 18:45:46 2016 +0900 - - Don't try DRI2/Present flipping while the HW cursor can't be used - - Flipping doesn't interact correctly with SW cursor: A flip makes the SW - cursor disappear. It will only appear again when the cursor is moved, - but it will be surrounded by corruption, because the SW cursor code - will restore stale screen contents at the old cursor location before - drawing the cursor at the new location. - - (Ported from radeon commit 7f3d0780ca65a90117c2a61362dbc0899bd9c0b0) - - Reviewed-by: Alex Deucher - -commit ba9be8f32f0321689133e17c1681809dec8c6cf1 -Author: Michel Dänzer -Date: Thu Mar 24 18:44:30 2016 +0900 - - Factor out HW cursor checking code into drmmode_can_use_hw_cursor - - And add a check for RandR 1.4 multihead. - - (Ported from radeon commit 3de480e83c0a1824838d662d6d67c9fe85277298) - - Reviewed-by: Alex Deucher - -commit 4a60b4b1851a3cbc2d8ad9048d68eeb6947cf132 -Author: Michel Dänzer -Date: Thu Mar 24 12:03:38 2016 +0900 - - Call AMDGPUBlockHandler_KMS before setting initial modes - - Doing it the other way around meant that there was still a possibility - for the front buffer contents to be uninitialized when they start being - scanned out. - - Reviewed-by: Alex Deucher - -commit 37bd79652a8ec612b94a1863e8c580b1cfaf3960 -Author: Michel Dänzer -Date: Fri Mar 18 18:51:00 2016 +0900 - - present: Return rotated CRTCs from amdgpu_present_get_crtc - - Sync-to-vblank works fine with rotation. We're still checking for - rotation in amdgpu_present_check_flip. - - Returning NULL from here resulted in the xserver present code falling - back to the fake CRTC running at 1 fps. - - (Ported from radeon commit a03271de5ecdaa7790d1316e993c4450b91fe936) - - Reviewed-by: Alex Deucher - -commit 6b930fb3285dea4a6440e31099c96f08da508d49 -Author: Michel Dänzer -Date: Fri Mar 18 18:47:10 2016 +0900 - - present: Clear drmmode->fb_id before calling set_mode_major for unflip - - Without this, drmmode_set_mode_major may just re-set the FB for the - last flipped BO, in which case the display will probably freeze. - - Reproduction recipe: Enable rotation while a fullscreen client is - flipping. - - (Ported from radeon commit 40191d82370eb7e58bd34c44966cbf44c3703229) - - Reviewed-by: Alex Deucher - -commit 6889e091442b6ba1b9351e72bd067425e87d96e9 -Author: Michel Dänzer -Date: Fri Mar 18 18:18:04 2016 +0900 - - Make Option "TearFree" effective for rotated/reflected outputs as well - - Support varies by xserver version: - - < 1.12: No support for the driver handling rotation/reflection - 1.12-1.15: Support for driver handling rotation/reflection, but there's - a bug preventing the HW cursor from being visible everywhere - it should be on rotated outputs, so we can only support - TearFree for reflection. - >= 1.16: While the bug above is still there (fixes pending review), - the driver can force SW cursor for rotated outputs, so we - can support TearFree for rotation as well. - - (Ported from radeon commit 798c4fd16d339b1ad5fd729cc884be084c60e38b) - - Reviewed-by: Alex Deucher - -commit da4e0c66fcbcf63143372720e3d606a462332e3a -Author: Michel Dänzer -Date: Fri Mar 18 18:15:34 2016 +0900 - - Consolidate pScreen usage in drmmode_set_mode_major - - We were already relying on pScrn->pScreen being non-NULL in some cases, - which is supposedly always true ever since this function is no longer - getting called from ScreenInit. - - (Ported from radeon commit eb611a2e4ecce7a1ab85fd72b9b78e3269311dd5) - - Reviewed-by: Alex Deucher - -commit 0bbf09dd7ef54133b3e534becb3ba15c0cf3eed2 -Author: Michel Dänzer -Date: Fri Mar 18 18:14:28 2016 +0900 - - Remove check for XF86_CRTC_VERSION 3 - - We require xserver >= 1.8, which was already at version 3. - - (Ported from radeon commit 06602171386e538081c298645fb7ca1a70fe80cc) - - Reviewed-by: Alex Deucher - -commit 3485ca0051a224d00135d4024a97a6c4e85a9644 -Author: Michel Dänzer -Date: Fri Mar 18 18:07:07 2016 +0900 - - Deal with modesets and page flips crossing on a CRTC - - If we set a mode while a flip is pending, the kernel driver may program - the flip to the hardware after the modeset. If that happens, the hardware - will display the BO from the flip, whereas we will assume it displays the - BO from the modeset. In other words, the display will most likely freeze, - at least until another modeset. - - Prevent this condition by waiting for a pending flip to finish before - setting a mode. - - Fixes display freezing when setting rotation or a transform with - TearFree enabled. - - (Ported from radeon commit a88985f5d1e39caca49ceb65678aaa9cb622a0d2) - - Reviewed-by: Alex Deucher - -commit b9d00fa7aaf946d985897380bfa42faafbf1b3fb -Author: Michel Dänzer -Date: Fri Mar 18 17:18:00 2016 +0900 - - Make DRM event queue xf86CrtcPtr based instead of ScrnInfoPtr based - - This allows for a minor simplification of the code. - - (Ported from radeon commit f5d968cbba3c9b7ec202161f2157d8d64778c817) - - Reviewed-by: Alex Deucher - -commit e0ed26151bfeadf309da53d001751c0a014dbd24 -Author: Michel Dänzer -Date: Fri Mar 18 17:11:47 2016 +0900 - - Remove amdgpu_scanout_flip_handler - - No longer necessary now that amdgpu_drm_queue_handler can handle - e->handler == NULL. - - (Ported from radeon commit d5dbb07db22d5420c81dfebc060f0dd86e7b8a20) - - Reviewed-by: Alex Deucher - -commit acd5da56f502d6ad115501e77bce06fe72b1895c -Author: Michel Dänzer -Date: Fri Mar 18 17:14:49 2016 +0900 - - DRI2: Also clear dri2_flipping when client disconnects before event - - Fixes the following problem: - - With DRI3 enabled, run glxgears with LIBGL_DRI3_DISABLE=1, make it - fullscreen and press Escape while it's still fullscreen. This could - result in dri2_flipping not getting cleared, spuriously preventing apps - using DRI3 from flipping. - - (Ported from radeon commit e87365117acbd80b7d80fbb5eb30890ef7153291) - - Reviewed-by: Alex Deucher - -commit a58bfa98208cc092014d3f36a08714eb1e0d8814 -Author: Michel Dänzer -Date: Fri Mar 18 17:07:47 2016 +0900 - - drm_queue: Don't abort events immediately from amdgpu_drm_abort_client - - Keep them around until the DRM event arrives, but then call the abort - functions instead of the handler functions. - - This is a prerequisite for the following fix. - - (Ported from radeon commit 3989766edde85d1abe7024577b98fc9b007bc02a) - - Reviewed-by: Alex Deucher - -commit e4888df6e32bb817bf0d6166a22b19c14e189a84 -Author: Michel Dänzer -Date: Fri Mar 18 17:04:10 2016 +0900 - - Fix RandR CRTC transforms - - Currently, Xorg will only transform the cursor as of the first time the - cursor image changes after a transform is set. - - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80678 - - (Ported from radeon commit 9483a3d777919b224f70c3b4d01e4b320a57db31) - - Reviewed-by: Alex Deucher - -commit 43af92ede0968f2108f9562aa4c2c861ac703617 -Author: Michel Dänzer -Date: Fri Mar 18 16:58:07 2016 +0900 - - Build RandR 1.4 provider name from chipset name and bus ID - - Instead of just "amdgpu", it's now e.g. "TONGA @ pci:0000:01:00.0". - - (Ported from radeon commit c7cf00487cd6d4a5d0f39d5b92ff04f6420d6a32) - - Reviewed-by: Alex Deucher - -commit 5ec1797a2858d693d18d21326e2307d71555e1db -Author: Michel Dänzer -Date: Wed Feb 24 17:33:49 2016 +0900 - - DRI2: Use amdgpu_pixmap_get_handle - - Now we can share pixmaps with no struct amdgpu_buffer via DRI2. - - Fixes VDPAU video playback freezing when using an OpenGL compositor with - DRI3 enabled and mpv VAAPI hardware decoding with OpenGL output. - - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89755 - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93804 - - (ported from radeon commit f8b0f23e9f4af9f9097ee5e72d53b45173163c41) - - Reviewed-by: Alex Deucher - -commit df60c635e1e632233de9dd4b01d63c2b963003f8 -Author: Michel Dänzer -Date: Wed Feb 24 17:06:43 2016 +0900 - - glamor: Avoid generating GEM flink names for BOs shared via DRI3 (v2) - - We can't create our own struct amdgpu_buffer representation in this case - because destroying that would make the GEM handle inaccessible to glamor - as well. So just get the handle directly via dma-buf. - - (ported from radeon commit 391900a670addec39515f924265bfa9f8bfa9ec0, - extended to cache BO handles in the private for non-DRI3 pixmaps as - well) - - v2: Swap whole pixmap privates instead of just BOs in - amdgpu_dri2_exchange_buffers to avoid invalidating cached BO handles - - Reviewed-by: Alex Deucher - -commit e463b849f3e9d7b69e64a65619a22e00e78d297b -Author: Michel Dänzer -Date: Tue Feb 23 18:10:29 2016 +0900 - - Make amdgpu_do_pageflip take a pixmap instead of a BO - - (inspired by radeon commit 7b4fc4a677d252d01c2bf80d162bc35814059eaa) - - Reviewed-by: Alex Deucher - -commit 1ee341f9d909f3b7ba2984fc912dabdb98c34b19 -Author: Michel Dänzer -Date: Tue Feb 23 18:42:19 2016 +0900 - - Add amdgpu_pixmap_get_handle helper - - (inspired by radeon commits dfad91fffb5bd013785223b42d78886df839eacf - and ccbda955ebae1d457d35293833f12791e0f9fb0b) - - Reviewed-by: Alex Deucher - -commit a36bbfd98b96426bbe0be3923c64da7ec0e565d0 -Author: Michel Dänzer -Date: Mon Feb 15 18:41:51 2016 +0900 - - HAS_DIRTYTRACKING_ROTATION also supports multiple CRTCs - - (ported from radeon commit ff9a6b6f079a8419f4e6fadfee778060618bf735) - - Reviewed-by: Alex Deucher - -commit a37746ffceaed83e48e48fb05439be7e020dd2ea -Author: Michel Dänzer -Date: Mon Feb 15 18:35:54 2016 +0900 - - Load fb module before glamoregl/shadow modules - - Fixes unresolved symbols on some systems. - - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93105 - (ported from radeon commit 78fbca095ae9887a2d3de48bb07975e2d1126e68) - - Reviewed-by: Alex Deucher - -commit 59c0a6807110eca829c6708e16585a38f39a5c17 -Author: Michel Dänzer -Date: Mon Feb 15 18:28:13 2016 +0900 - - Don't advertise any PRIME offloading capabilities without acceleration - - Acceleration is required even for display offloading. Trying to enable - display offloading without acceleration resulted in a crash. - - (ported from radeon commit b19417e2fddf4df725951aea5ad5e9558338f59e) - Reviewed-by: Alex Deucher - -commit a3eac85d812ecc605436e6bd5b9ee7ebf307e3d3 -Author: Michel Dänzer -Date: Tue Jan 26 16:12:28 2016 +0900 - - Only map front buffer if glamor acceleration is disabled (v2) - - Otherwise the front buffer may not be accessible by the CPU, because Mesa - sets the AMDGPU_GEM_CREATE_NO_CPU_ACCESS flag for tiled buffers, because - accessing tiled buffers with the CPU makes little sense. - - v2: Also handle Option "AccelMethod" "none" - - Reviewed-by: Alex Deucher - -commit 2fcb7dadd3c71cd405cbbaafc777697538ca9c29 -Author: jimqu -Date: Mon Jan 25 09:47:00 2016 +0800 - - glamor: Return NullPixmap on failure to create shareable pixmap - - If we were asked to create a shareable pixmap, it doesn't make sense - to return a pixmap which isn't shareable. Doing so caused trouble down - the line such as a crash with older versions of glamor when trying to - use GLX pixmaps of bpp < 32 via DRI2. - - Signed-off-by: JimQu - Reviewed-by: Michel Dänzer - -commit 5269a2228bff6023c1a7f3e8534027e1d7addc25 -Author: jimqu -Date: Mon Jan 25 10:12:02 2016 +0800 - - Move amdgpu_glamor_destroy_pixmap before amdgpu_glamor_create_pixmap - - The next commit will call the former from the latter. No functional - change. - - Signed-off-by: JimQu - Reviewed-by: Michel Dänzer - -commit 54c959c163288caa87f612911b70df73f87d29d6 -Author: Tom St Denis -Date: Wed Jan 20 09:37:36 2016 -0500 - - Move memset() after variable declarations - - To make the code more "C" like move the function calls - after the variable declarations. - - Signed-off-by: Tom St Denis - Reviewed-by: Alex Deucher - Reviewed-by: Michel Dänzer - -commit 8853b07ae8169c409740c40d45cd335bd608f2a7 -Author: Michel Dänzer -Date: Tue Jan 19 17:35:11 2016 +0900 - - Set the RandR primary output on startup if Xorg hasn't - - Fixes xrandr (XRRGetOutputPrimary) not reporting any output as primary - after startup. - - (Ported from radeon commit b16856b25086ffb27365ac2249b8da921066ce62) - - Reviewed-by: Alex Deucher - -commit bd5c65daceaf633c36fcec86ff061df10c364bc0 -Author: Michel Dänzer -Date: Thu Jan 7 15:53:41 2016 +0900 - - Only call amdgpu_bus_id once in each probe path (v2) - - Instead of up to twice as before. - - v2: Remove free(busIdString) call from amdgpu_kernel_mode_enabled, the - bus ID string is now managed by its callers. - - Reviewed-by: Alex Deucher (v1) - -commit 6e42c58375a4c3229da93c27bbd104af145c6163 -Author: Michel Dänzer -Date: Thu Jan 7 15:57:38 2016 +0900 - - Remove pci_dev test from amdgpu_get_scrninfo - - The pci_dev parameter can never be NULL since we only support KMS. - - Reported-by: Tom St Denis - Reviewed-by: Alex Deucher - -commit 8e09180798a06af5afa030d754938e4ca06e272f -Author: Michel Dänzer -Date: Thu Jan 7 15:35:35 2016 +0900 - - Re-use PCI bus ID code from kernel_open_fd in kernel_mode_enabled - - Reviewed-by: Alex Deucher - -commit 4eb9cedca080b30c57ded349a397620ee7d0cd46 -Author: Mykola Lysenko -Date: Wed Jan 13 14:03:55 2016 +0800 - - Initialize drmmode_crtc dpms_mode to DPMSModeOff - - This disables query of disabled pipes for drmWaitVBlank on X start - - Signed-off-by: Mykola Lysenko - Reviewed-by: Michel Dänzer - -commit 1d0b0c1794e65e581a48aa9fb19679d928d82a5d -Author: Michel Dänzer -Date: Thu Dec 10 18:08:12 2015 +0900 - - sync: Check if miSyncShmScreenInit symbol is resolved at runtime - - It may be disabled in the Xorg build, either explicitly or because the - xshmfence library isn't available. - - Reviewed-by: Alex Deucher - -commit f4107f67f147e2500582fc36cf0f0f76bc1ef098 -Author: Mykola Lysenko -Date: Wed Dec 23 11:58:47 2015 -0500 - - Check for NULL koutput in drmmode_output_dpms - - This situation happens whit start of usage of DRM DP MST framework, - when connectors created and destroyed dynamically. - - Signed-off-by: Mykola Lysenko - Reviewed-by: Michel Dänzer - -commit ea558e645786b08d75307716036045170e97b43e -Author: Jammy Zhou -Date: Fri Nov 20 17:03:05 2015 +0800 - - Use render node for DRI3 if available - - Signed-off-by: Jammy Zhou - Reviewed-by: Michel Dänzer - -commit 43c2dc1aab682d5b6ad49d24983d6382c4f305bb -Author: Michel Dänzer -Date: Thu Nov 19 17:05:05 2015 +0900 - - glamor: Deal with glamor_egl_destroy_textured_pixmap being removed - - When it's not available, it's safe to call down to the glamor - DestroyPixmap hook instead. - - (ported from radeon commit 10b7c3def58bb34acc38f076bc230e25b454ab79) - - Reviewed-by: Alex Deucher - -commit 84cab5738a315e9825bd0864c4f0fc5b03eb81a1 -Author: Michel Dänzer -Date: Thu Nov 19 16:44:22 2015 +0900 - - glamor: Restore all ScreenRec hooks during CloseScreen - - (ported from radeon commit 535e5438b2c32f774b9c8c27ee0289b4749548ef) - - Reviewed-by: Alex Deucher - -commit a00c050c2e5667ed815c51979a3cadb5146136ff -Author: Michel Dänzer -Date: Thu Nov 19 17:55:53 2015 +0900 - - Post 1.0.0 release version bump - -commit 755e6ff2337cf615e3ba0854ccd533baec7144db -Author: Michel Dänzer -Date: Thu Nov 19 17:28:19 2015 +0900 - - Bump version for 1.0.0 release - -commit 49c7d2be99aaf6d040e553065bdc461ce8d4769a -Author: Michel Dänzer -Date: Thu Nov 19 17:14:54 2015 +0900 - - Add amdgpu_pixmap.h to src/Makefile.am's EXTRA_DIST - - Fixes make distcheck. - -commit d069ec5d27f5c8d2ab17b759b85293ef4113acf3 -Author: Stephen Chandler Paul -Date: Wed Nov 11 18:10:55 2015 +0900 - - Handle failures in setting a CRTC to a DRM mode properly - - This fixes a bug where running the card out of PPLL's when hotplugging - another monitor would result in all of the displays going blank and - failing to work properly until X was restarted or the user switched to - another VT. - - [Michel Dänzer: Pass errno instead of -ret to strerror()] - - Signed-off-by: Stephen Chandler Paul - (ported from radeon commit 7186a8713ba004de4991f21c1a9fc4abc62aeff4) - - Reviewed-by: Alex Deucher - -commit c8bddcf6c97b1338be3715f1fc5e0b17ce71c195 -Author: Michel Dänzer -Date: Wed Nov 11 18:09:59 2015 +0900 - - Call xf86CrtcRotate from initial drmmode_set_desired_modes call - - Fixes various problems when rotation is specified in xorg.conf. - - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92475 - - (ported from radeon commit 548e97b3b7d1e94075a54ca2bb4eb683025098a7) - - Reviewed-by: Alex Deucher - -commit 12815156f38ce3357f03901a78402db834577d11 -Author: Emil Velikov -Date: Wed Nov 11 18:04:01 2015 +0900 - - Do not link amdgpu_drv.so against libpciaccess - - Not used directly. - - Signed-off-by: Emil Velikov - (ported from radeon commit fcb32231a38f9461d12720cbf72f63502197a711) - - Reviewed-by: Alex Deucher - -commit a02982b0ae0b79d2f183a1628edc05cafed8703a -Author: Michel Dänzer -Date: Wed Nov 11 17:59:14 2015 +0900 - - Skip disabled CRTCs in amdgpu_scanout_(do_)update - - The vblank / page flip ioctls don't work as expected for a disabled CRTC. - - (ported from radeon commit acc11877423ecd81a6e0a7f38466f80e43efee20) - - Reviewed-by: Alex Deucher - -commit 0ddd20600d0046afd17aa47ffebe86dfd91a2215 -Author: Michel Dänzer -Date: Wed Nov 11 17:44:16 2015 +0900 - - Prefer drmModeSetCursor2 over drmModeSetCursor - - The former includes information about the position of the hotspot within - the cursor image. - - Copied from xf86-video-modesetting. + Simplify drmmode_set_mode_major error handling - (ported from radeon commit c9f8f642fd495937400618a4fc25ecae3f8888fc) + Initialize ret = FALSE and only set it to TRUE when we've succeeded. Reviewed-by: Alex Deucher -commit 83a47c0ebe17caa79d12a8b2f94b59cc945452f5 -Author: Michel Dänzer -Date: Wed Nov 11 17:37:54 2015 +0900 - - PRIME: Don't advertise offload capabilities when acceleration is disabled - - Xorg tends to crash if the user tries to actually use the offload - capabilities with acceleration disabled. - - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57200 - (ported from radeon commit c74de9fec13fac2c836bb2a07ae6f90e1d61e667) - - Reviewed-by: Alex Deucher - -commit 560b7fe6dc66405762020f00e9a05918a36f3a17 -Author: Michel Dänzer -Date: Wed Nov 11 17:31:34 2015 +0900 - - Rename Option "NoAccel" to "Accel" - - Removes the need for a double negation when forcing acceleration on. - - Note that this change is backwards compatible, as the option parser - automagically handles the 'No' prefix. - - (ported from radeon commit cc615d06db0332fc6e673b55632bcc7bf957b44b) - - Reviewed-by: Alex Deucher - -commit ad77ad32c4a723447d3191d527cfa6de9f54d7ce -Author: Adam Jackson -Date: Wed Nov 11 17:20:21 2015 +0900 - - Use own thunk function instead of shadowUpdatePackedWeak - - I plan to delete the Weak functions from a future server. - - Signed-off-by: Adam Jackson - (ported from radeon commit 851b2cf8714618843725f6d067915375485ade9d) - - Reviewed-by: Alex Deucher - -commit f5ccea99c03b62acf3a25984aba617c665d80b7c -Author: Michel Dänzer -Date: Wed Nov 11 17:16:58 2015 +0900 - - dri2: Handle PRIME for source buffer as well in amdgpu_dri2_copy_region2 - - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77810 - - (ported from radeon commit c84230d686c078aac1dc98d82153f8b02521b2e1) - - Reviewed-by: Alex Deucher - -commit 92e7c93d2f9c3036da1a17d7fccccb6f9e9eaa3d -Author: Michel Dänzer -Date: Mon Nov 2 18:29:24 2015 +0900 - - Move scrn/info declaration inside USE_GLAMOR in amdgpu_dri3_fd_from_pixmap - - Fixes warning when building with --disable-glamor: - - ../../src/amdgpu_dri3.c: In function 'amdgpu_dri3_fd_from_pixmap': - ../../src/amdgpu_dri3.c:135:16: warning: unused variable 'info' [-Wunused-variable] - AMDGPUInfoPtr info = AMDGPUPTR(scrn); - ^ - - Reported-by: Jammy Zhou - Reviewed-by: Alex Deucher +commit a3ca1500703837cbb8d49c554199a25dea7d5e1e +Author: Hans de Goede +Date: Wed Jun 1 15:14:32 2016 +0200 -commit c9bd1399a13cea2e1331af2c826ca054b88db071 -Author: Michel Dänzer -Date: Mon Nov 2 18:21:50 2015 +0900 - - Call AMDGPUFreeRec from AMDGPUFreeScreen_KMS even if info == NULL + Only add main fb if necessary - It's safe now. + If we're doing reverse-prime; or doing rotation the main fb is not used, + and there is no reason to add it in this case. + Signed-off-by: Hans de Goede + (Ported from xserver commit 4313122dea0df9affc280ee698e929489061ccc6) Reviewed-by: Alex Deucher -commit fb8444e731765588c0ff1e9053c1c7b73f5f0907 -Author: Michel Dänzer -Date: Mon Nov 2 18:20:41 2015 +0900 +commit 9ca1c24235ff5ab2e028333fc326e2eff008c574 +Author: Hans de Goede +Date: Wed Jun 1 15:11:05 2016 +0200 - Don't use AMDGPUEntPriv in AMDGPUFreeRec + Remove unnecessary fb addition from drmmode_xf86crtc_resize - It crashes if info == NULL. + drmmode_set_mode_major() is the only user of drmmode->fb_id and will + create it if necessary. + Signed-off-by: Hans de Goede + (Ported from xserver commit 877453212166fdc912e0d687cdecee11aba563b5) Reviewed-by: Alex Deucher -commit 8e7ee03f55c2f3874f6e84daeb5700f8b8037a51 -Author: Michel Dänzer -Date: Wed Oct 28 17:53:27 2015 +0900 - - Remove amdgpu_reference_drm_fd - - Increase pAMDGPUEnt->fd_ref in the probe code instead when we're reusing - the existing fd. - - The previous reference counting was imbalanced, so pAMDGPUEnt->fd_ref - could never go to 0. - - Reviewed-by: Jammy Zhou - -commit 6bab8fabb37eb131e131ce59446c214ded28f779 +commit 0d42082108c264568e2aadd15ace70e72388bc65 Author: Michel Dänzer -Date: Wed Oct 28 17:44:09 2015 +0900 +Date: Wed Jun 22 19:01:03 2016 +0900 - Remove info->dri2.drm_fd and info->drmmode->fd + Call amdgpu_glamor_create_screen_resources after ModifyPixmapHeader - Use pAMDGPUEnt->fd everywhere instead. - - Reviewed-by: Jammy Zhou - -commit 0530e39cc6b7340163e7f6bb6d82719d102ee6e9 -Author: Jammy Zhou -Date: Thu Oct 29 17:08:01 2015 +0900 - - Pass struct pci_device *pci_dev directly to amdgpu_get_scrninfo + Otherwise, glamor doesn't pick up the new screen pixmap size and + continues using the old size, leaving garbage in some areas after + enlarging the screen. - Instead of throwing away the type information by passing it as a void*. + Fixes regression from commit c315c00e44afc91a7c8e2eab5af836d9643ebb88 + ("Propagate failure from amdgpu_set_pixmap_bo"). - Signed-off-by: Michel Dänzer Reviewed-by: Alex Deucher -commit edf72afee3a25eae9827b4de3a013b541b78e213 -Author: Jammy Zhou -Date: Wed Oct 28 21:24:29 2015 +0800 - - Fix crash in PCI probe path (v4) - - The crash is caused by the NULL value returned by AMDGPUPTR(pScrn), - because the driverPrivate is not allocated yet in PciProbe phase, - and it is usually done in the PreInit phase. - - Use pAMDGPUEnt->fd instead of info->dri2.drm_fd to avoid AMDGPUInfoPtr - related code in amdgpu_open_drm_master, so that the crash can be fixed. - - v4: (md) Remove unused parameter entity_num, split out logically - separate changes - v3: some more cleanup - v2: switch to pAMDGPUEnt->fd, and update the commit message - - Signed-off-by: Jammy Zhou - Signed-off-by: Michel Dänzer - Reviewed-by: Alex Deucher (v3) - -commit cef725121eb0e56aa54d9c4665e36047373f4db7 -Author: Michel Dänzer -Date: Wed Oct 28 17:56:13 2015 +0900 - - Remove dead code from probe paths - - amdgpu_get_scrninfo allocates the memory pointed to by pAMDGPUEnt just - before it calls amdgpu_open_drm_master, so pAMDGPUEnt->fd is always 0 - in the latter. - - Also, no need to clear pAMDGPUEnt->fd just before freeing the memory - it's stored in. - - Reviewed-by: Jammy Zhou - -commit 3b0a3c89b53b3ebe21a9d703a4dbff6e57c65a57 -Author: Samuel Li -Date: Thu Oct 22 12:50:21 2015 -0400 - - Add Stoney support - - (agd): rebase - - Reviewed-by: Michel Dänzer - Signed-off-by: Samuel Li - -commit 9c8b7ebe15eec7abd5dc10ad6ccecbc57225494a +commit e7e71eabbbccdeabcae1bc6fffabc27c272090ab Author: Michel Dänzer -Date: Wed Oct 21 17:18:44 2015 +0900 +Date: Mon Mar 28 18:49:15 2016 +0900 - Revert "Handle RandR CRTC transforms properly" + Adapt to XF86_CRTC_VERSION 7 - This reverts commit 175251645fec1a3d19f498e1cd1e655374c67801. + Now the HW cursor can be used with TearFree rotation. - I accidentally pushed this patch. - -commit 0a6ba4bf50128464a30951721b0c72e748fb89bc -Author: Darren Powell -Date: Tue Oct 20 16:56:54 2015 -0400 - - Add Option "TearFree" to manpage + This also allows always using the separate scanout pixmap mechanism for + rotation, so that should be much smoother even without TearFree enabled. - This was missed in commit c57da33308a81fa575179238a0415abcb8b34908. - - Signed-off-by: Darren Powell + (Ported from radeon commit 7835558acdce318130ba4a09ef936fd675e3197d) Reviewed-by: Alex Deucher - Reviewed-by: Michel Dänzer - -commit 175251645fec1a3d19f498e1cd1e655374c67801 -Author: Michel Dänzer -Date: Thu Oct 15 16:35:51 2015 +0900 - - Handle RandR CRTC transforms properly - -commit 6000aef4e2f0a121b94023484406fb6f04688f74 -Author: Tom St Denis -Date: Wed Oct 14 13:25:59 2015 -0400 - - Clean up amdgpu_dri2_create_buffer2() - - Remove the depth_pixmap variable from the function and clear - out any dead/odd behaviour that results. - - Signed-off-by: Tom St Denis -commit 21e72fb2418b5cc7fc849a9cf951186e209036b0 +commit 7f7f9825caf3983902491da27c16d14cd8bf9b7d Author: Michel Dänzer -Date: Fri Oct 9 18:38:47 2015 +0900 +Date: Mon Jun 13 18:58:49 2016 +0900 - Properly handle drmModeAddFB failure in drmmode_crtc_scanout_allocate + Free priv in amdgpu_set_pixmap_bo also if priv->bo == NULL - We were printing an error message, but not propagating the failure. That - would probably lead to trouble down the road. + Fixes memory leak when destroying pixmaps with priv->bo == NULL. + Reported-by: Qiang Yu Reviewed-by: Alex Deucher -commit 8da1d0c870e1081d77925807d6e3bbc61a23f54f +commit 397aedafee437c125b8ac1feafb1c3b466842aeb Author: Michel Dänzer -Date: Fri Oct 9 18:59:16 2015 +0900 +Date: Mon Jun 13 18:34:11 2016 +0900 - Eliminate redundant data parameter from drmmode_crtc_scanout_create - - drmmode_crtc_scanout_create just needs to call - drmmode_crtc_scanout_allocate when scanout->bo is NULL. - - This makes it clearer to the reader / compiler that - drmmode_crtc_scanout_create doesn't dereference scanout->bo when it's - NULL. + glamor: Fix leak of pixmap private when replacing BO + Reported-by: Qiang Yu Reviewed-by: Alex Deucher -commit dc40582d5ff94d812cbc08f95cf14b80cd0f410d +commit 5b4a8a7a6ed70a50be252fa9b34d3b3a17cdf91a Author: Michel Dänzer -Date: Wed Oct 7 16:19:22 2015 +0900 - - Don't advertise rotation support without hardware acceleration v2 - - Rotation currently doesn't work without acceleration (doesn't actually - rotate with Option "NoAccel", crashes with Option "AccelMethod" "none" - or when glamor fails to initialize) and would probably be too slow - anyway. - - v2: Also remove now dead code checking for ShadowFB from - drmmode_crtc_scanout_allocate(). - - Reviewed-by: Alex Deucher - -commit 460560502a1bdf26d06f3c30df46fa9f28ffb9e5 -Author: Tom St Denis -Date: Tue Oct 6 08:49:54 2015 -0400 - - Simplify drmmode_set_mode_major() and avoid leaking memory. - - The function would leak the memory allocated for output_ids. This - patch addresses that as well as simplifies the logic somewhat. - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit 56398d6651dfc4935cbd117ad861e1800077c73c -Author: Tom St Denis -Date: Tue Oct 6 08:43:12 2015 -0400 - - Avoid NULL dereference if drmmode_crtc_scanout_allocate fails - - This avoids a NULL dereference if the memory allocation fails. - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit 4b92b960c7705be8b3a5dee17b2341864d7ca9bb -Author: Tom St Denis -Date: Mon Oct 5 10:00:09 2015 -0400 - - cleanup the entity rec - - Based on radeon commit: b32a0a3de84a44b9af4f1ca8be19f10d7fa31b12 - - Some of these were set, some of them were - always opposites, so clean things up. - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit fe100fd6bf483228eaf64b959c56a68e8dac4447 -Author: Tom St Denis -Date: Mon Oct 5 10:45:33 2015 -0400 - - present: Handle DPMS off in radeon_present_get_ust_msc - - Based on radeon commit: 95f5d09e3667ded027ae648c97eb4737d8bf67c5 - - The DRM_IOCTL_WAIT_VBLANK ioctl may return an error during DPMS off, - which would trigger an error message in drmmode_crtc_get_ust_msc. - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit bfa925a04815cee5fd57b99447cb2ee0e158036c -Author: Tom St Denis -Date: Mon Oct 5 10:10:51 2015 -0400 - - present: Look at all CRTCs to determine if we can flip - - Based on radeon commit 211862b777d0be251a4662f5dd24f2d400544c09 - - Inspired by modesetting driver change by Kenneth Graunke. - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer +Date: Tue Jun 14 19:00:18 2016 +0900 -commit a1e47e76322619ed037ebce27974a4e3792940c2 -Author: Tom St Denis -Date: Mon Oct 5 10:41:22 2015 -0400 - - present: Fall back to modeset for unflip operation - - Based on radeon commit: 802d33e474a82262d9cdf11b03568b0c4929cd0d - - It's not always possible to use the page flip ioctl for this, e.g. - during DPMS off. We were previously just skipping the unflip in that - case, which could result in hangs when setting DPMS off while a - fullscreen Present app is running, e.g. at the GNOME3 lock screen. - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit bac21dfc8e60a07f08158b13fab1f3a9b9d27d1b -Author: Tom St Denis -Date: Mon Oct 5 10:37:50 2015 -0400 - - Don't attempt a DRI2/Present page flip while the other one is flipping - - Based on radeon commit 49f5b0bc301414df049e00d226034e3d6e56421b - - Fixes corrupted display and hangs when switching between DRI2 and DRI3 - fullscreen apps, e.g. a compositor using DRI3 and a fullscreen app using - DRI2 or vice versa. - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit a5f7f2e68bad1935f5ad52286033237467f77302 -Author: Tom St Denis -Date: Mon Oct 5 13:12:23 2015 -0400 - - Move amdgpu_drm_handler/abort_proc fields to drmmode_flipdata_re - - Based on radeon commit de5ddd09db82141b263338dcf0c28e01f58268ee - - Their values are the same for all DRM flip ioctl calls within a single - radeon_do_pageflip() call. - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit e14e3560bff2537d3ad4c93d2b31442a122cde66 -Author: Tom St Denis -Date: Mon Oct 5 13:08:43 2015 -0400 - - Simplify amdgpu_do_pageflip() error handling slightly more - - Based on radeon commit e8c0f6319fbf4c3ea11e22ab1a68837031bdec8c - - We don't need the local variable old_fb_id. - - Signed-off-by: Tom St Denis - - [ Michel Dänzer: fix up slightly to better match radeon formatting ] - - Reviewed-by: Michel Dänzer - -commit e9621ec0e2400f62db320c560a739b29258edb87 -Author: Tom St Denis -Date: Mon Oct 5 09:34:47 2015 -0400 - - Increase robustness against DRM page flip ioctl failures - - Based on radeon commit 8fc22360d5520469c82092ccb0fcf2af330c573f - - Centralize cleanup, only clean up things that have been allocated for - the failed ioctl call. - - Fixes double-free after a flip ioctl failure. - - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89681 - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit db3bb2061b9ac16b0922d9afae99874820356a04 -Author: Tom St Denis -Date: Tue Sep 29 13:07:04 2015 -0400 - - Clean up allocation in AMDGPUInitVideo() - - The allocation of the adapters should use the correct sizeof (even if - allocating an array of pointers). - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit 94caf7ac777134b8396aa762a506053179bbb4c6 -Author: Tom St Denis -Date: Thu Oct 1 13:08:41 2015 -0400 - - Avoid leaking memory on output. - - Based on radeon commit 63dc36dc49f93cb00111b497ab6805194bc9d240 - - and 2nd patch: - - Proper leak fix, previous leak fix was bogus. - - Based on radeon commit b8ec9ed4fe86952763b963c86f0af0dcae69aa6c - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit f035faec041cb5df65c78effa58eb50197cedf88 -Author: Tom St Denis -Date: Thu Oct 1 12:56:05 2015 -0400 - - add support for DP 1.2 display hotplug - - Based on radeon commit 2f11dcd43966cf2ee26e61960fd72e6644f5e037 + Use amdgpu_set_pixmap_bo in amdgpu_set_shared_pixmap_backing - > This allows for dynamic creation of conneectors when the - > kernel tells us. - > - > v2: fix dpms off crash - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit aee72b29210d79dbf41bde6eef16d7fe817e6cf4 -Author: Tom St Denis -Date: Thu Oct 1 12:29:36 2015 -0400 - - move output name creation to its own function - - Based on radeon commit c88424d1f4aaa78b569e5d44f0b4a47de2f422f4 - - > The secondary indent is deliberate to make the next patch more - > parseable for mst support. - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit 0846abeace649d27a5f2c17373e717f92d246797 -Author: Tom St Denis -Date: Thu Oct 1 12:13:21 2015 -0400 - - stop caching mode resources - - Based on radeon commit 32b003cb7657e07d5af6338ad44d768eda87fd33 - - > This is step one towards MST connector hotplug support, - > it stop caching the mode resources structure, and - > just passes a pointer to it around. - - With a few tweaks to match the state of the AMDGPU tree. - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit 4ca8f957e0b417b099f625470db98a54531a731d -Author: Tom St Denis -Date: Thu Oct 1 13:16:15 2015 -0400 - - Silence type mismatch warning. - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit a79735ab1499c1f7814036d1b19ff465705c5f45 -Author: Tom St Denis -Date: Thu Oct 1 10:51:07 2015 -0400 - - Add support for server managed fds - - Based on radeon commit ed0cfbb4fe77146b0b38f777bc28f3a4ea6da07f - - and 2nd patch: - - Fix building on older servers without xf86platformBus.h - - Based on radeon commit b50da3b96c212086cb58501dbe988d64f1f35b6d - - Signed-off-by: Tom St Denis - - [ Michel Dänzer: Fixed up amdgpu_kernel_open_fd() not to need - AMDGPUEntPriv(), which doesn't work yet at that point ] - - Signed-off-by: Michel Dänzer - Reviewed-by: Michel Dänzer - -commit b93934a9ed5e92f3a6eac6554c5c4fa2967a6dd0 -Author: Tom St Denis -Date: Thu Oct 1 10:05:36 2015 -0400 - - Add amdgpu_open_drm_master helper function - - Based on radeon commit 3d7861fe112f25874319d4cdc12b745fbcd359cf - - > This is a preparation patch for adding server-managed-fd support without it - > turning into a goto fest. - - With appropriate modifications because the open call stack is different - in the amdgpu tree. - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit f5c3fd0b57cf9e392bf591110568637937a1d338 -Author: Tom St Denis -Date: Thu Oct 1 09:13:57 2015 -0400 - - Cleaning up for server-fd support - - Based on radeon commit a63342ad15408071437c80b411d14196f3288aed - - > radeon_open_drm_master get rid of unnecessary goto - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit 3055724aef76a624718f26d5f0f9e9d567ffbcfb -Author: Tom St Denis -Date: Thu Sep 24 13:08:31 2015 -0400 - - Simplify pick best crtc to fold two loops into one - - This patch folds the two for loops from amdgpu_pick_best_crtc() into - one to reduce the LOC and make the routine easier to read. - - Signed-off-by: Tom St Denis - Reviewed-by: Michel Dänzer - -commit 9945b4ae1664ab815b39ff07e7b66cfa7f942dfa -Author: Tom St Denis -Date: Wed Sep 9 09:38:02 2015 -0400 - - Avoid use-after-free in drmmode_output_destroy() + Fixes leaking any existing pixmap private. - The encoders array is freed before potentially all of the elements of - the array are individually freed. + While we're at it, also fix leaking the GBM BO if + amdgpu_glamor_create_textured_pixmap fails. - Signed-off-by: Tom St Denis - Reviewed-by: Christian König Reviewed-by: Alex Deucher - Signed-off-by: Michel Dänzer (cosmetic fixups) -commit 36b3faebdd1d2090a286616eeeb131d15e9a1386 -Author: Tom St Denis -Date: Wed Sep 9 09:36:59 2015 -0400 +commit c315c00e44afc91a7c8e2eab5af836d9643ebb88 +Author: Michel Dänzer +Date: Wed Jun 15 17:20:36 2016 +0900 - Avoid use-after-free in amdgpu_kernel_open_fd() + Propagate failure from amdgpu_set_pixmap_bo - If the device cannot be opened avoid re-using busid after it has been - freed. + Preparation for the following fixes. - Signed-off-by: Tom St Denis - Reviewed-by: Christian König Reviewed-by: Alex Deucher - Signed-off-by: Michel Dänzer (cosmetic fixups) -commit 8823c3d4c6db70cff7699b31088f2d92db8faaf4 -Author: Tom St Denis -Date: Wed Sep 9 09:34:38 2015 -0400 +commit 74602c4221e3c84949fd69f690cbc66dcae384ea +Author: Michel Dänzer +Date: Tue Jun 14 18:53:34 2016 +0900 - dri2: Avoid calculation with undefined msc value + glamor: Make amdgpu_glamor_create_textured_pixmap take amdgpu_buffer* - If the get_msc() call fails for any reason we should avoid updating the - vblank counter delta with undefined data. + Preparation for the following fixes. - Signed-off-by: Tom St Denis - Reviewed-by: Christian König - Acked-by: Alex Deucher - Signed-off-by: Michel Dänzer (minor fixups) + Reviewed-by: Alex Deucher -commit 63948ea091a9b324327ade7ec4fc5d67ca7e6f6f +commit 0007c2f018ba663303d91d847e7c085269a23062 Author: Michel Dänzer -Date: Fri Aug 14 18:41:57 2015 +0900 +Date: Wed Jun 8 16:27:33 2016 +0900 - DRI2: Keep MSC monotonic when moving window between CRTCs - - This mirrors the DRI3 implementation in xserver. Fixes VDPAU video - playback hanging when moving the window between CRTCs. + glamor: Reallocate linear pixmap BO if necessary for DRI2 PRIME - Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66384 + Fixes corruption when using DRI2 PRIME render offloading with the master + screen using this driver. + Reported-by: Qiang Yu Reviewed-by: Alex Deucher + Tested-by: Qiang Yu -commit 55a4461bd95698cb8d52f9f6c28583f8f81afb4e +commit 5518bf5d793439b5bab369e5fc18de9a4a3b9dd6 Author: Michel Dänzer -Date: Fri Aug 7 11:46:31 2015 +0900 +Date: Wed Jun 8 16:44:26 2016 +0900 - Wait for scanout BO initialization to finish before setting mode + Move DRI2's local fixup_glamor helper to amdgpu_glamor_set_pixmap_bo v2 - This should avoid intermittent artifacts which could sometimes be visible - when setting a new scanout pixmap, e.g. on server startup or when - changing resolutions. + So it can be used outside of the DRI2 code. - (Ported from radeon commit 3791fceabf2cb037467dc41c15364e9f9ec1e47e) + v2: Keep pixmap refcnt increment in amdgpu_dri2_create_buffer2 (Qiang Yu) Reviewed-by: Alex Deucher + Tested-by: Qiang Yu (v1) -commit 4c425e9c5c038504a0f0498dd800ab1fb40bf0c5 +commit 641f4647b7f51dfd2da330376cd10fa9702b6423 Author: Michel Dänzer -Date: Fri Aug 7 12:39:24 2015 +0900 +Date: Wed Jun 8 16:39:10 2016 +0900 - glamor: Add amdgpu_glamor_finish to wait for glamor rendering to finish + Consolidate get_drawable_pixmap helper - This is a bit sneaky, because it calls glFinish directly from the driver, - but it seems to work fine. + There were two static helpers for the same purpose. Consolidate them + into a single inline helper which can be used anywhere. Reviewed-by: Alex Deucher + Tested-by: Qiang Yu -commit bb989e173dc364a7d68e50d7e819d0e0ee133d2f +commit 8e40f190e4704c2802bf0f073f17e742786d0f18 Author: Michel Dänzer -Date: Fri Aug 7 11:43:48 2015 +0900 +Date: Wed Jun 8 16:00:21 2016 +0900 - Only call drmmode_copy_fb (at most) once on server startup - - It doesn't make sense to copy the screen contents from console when VT - switching back to Xorg or when Xorg resets. - - Fixes intermittent artifacts when VT switching back from console to the - gdm login screen. + Add amdgpu_pixmap_get_tiling_info - (Ported from radeon commit 4e3dfa69e4630df2e0ec0f5b81d61159757c4664) + Retrieves the tiling information about a pixmap BO from the kernel + driver. Reviewed-by: Alex Deucher + Tested-by: Qiang Yu -commit ebe2c020fbf2ef8de01fc50b201ab23ddb9fb13b -Author: Mario Kleiner -Date: Mon Aug 10 23:34:40 2015 +0200 +commit e7eeb6ad1133b6023d34b4489959ae330a8e15dd +Author: Michel Dänzer +Date: Wed Jun 8 15:42:01 2016 +0900 - Make selection between DRI2 and DRI3 consistent with other drivers. (v2) + Remove amdgpu_share_pixmap_backing - Add Option "DRI" to allow selection of maximum DRI level. + Not used anymore. - This allows the user to select the maximum level of DRI - implementation to use, DRI2 or DRI3. It replaces the old - option "DRI3" which had exactly the same purpose, but - differs from the method used in both intel ddx and nouveau ddx. - Make this consistent before a new stable driver is released. + Reviewed-by: Alex Deucher + Tested-by: Qiang Yu + +commit b36c77695ba77b59a0ccd868454e3af4fc04d5ff +Author: Michel Dänzer +Date: Wed Jun 8 15:38:57 2016 +0900 + + glamor: Fix amdgpu_glamor_share_pixmap_backing for priv->bo == NULL - v2: Retain handling of old Option "DRI3" for backwards - compatibility, but Option "DRI" will take precedence - over "DRI3" if both are provided. + Fixes crash when running a compositor and DRI_PRIME client via DRI2. - Signed-off-by: Mario Kleiner - Reviewed-by: Michel Dänzer + Reported-by: Qiang Yu + Reviewed-by: Alex Deucher + Tested-by: Qiang Yu -commit c9611a2aa0f8d3bb55c552353740d60f6e4f63a0 +commit 60ced5026ebc34d9f32c7618430b6a7ef7c8eb4b Author: Alex Deucher -Date: Tue Jul 7 22:46:34 2015 -0400 +Date: Tue May 17 16:59:41 2016 -0400 - add fiji pci id + add missing bonaire pci id - Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher -commit 2622ac1554761b8824bfbbb2e3051a632ee38ce7 -Author: Alex Deucher -Date: Tue Jul 7 22:46:08 2015 -0400 +commit 8e89448ee00da16e05e6777f34bb75d2dd6f7025 +Author: Flora Cui +Date: Tue May 17 11:02:09 2016 +0800 + + Add more Polaris 11 PCI IDs + + Signed-off-by: Flora Cui + Reviewed-by: Christian König + Signed-off-by: Alex Deucher + +commit a59b23d64285741a7a25e314343f6261046d980f +Author: Flora Cui +Date: Mon May 16 17:25:34 2016 +0800 - Add fiji support + Add more Polaris 10 PCI IDs + Signed-off-by: Flora Cui + Reviewed-by: Alex Deucher Reviewed-by: Michel Dänzer Signed-off-by: Alex Deucher -commit 7a49d8728d17875206a84fd1023f62b37c4a9f51 +commit 14606e127f4b6eb0b00fd42cec13d524a67e4c4a Author: Michel Dänzer -Date: Thu Aug 6 18:21:30 2015 +0900 +Date: Thu May 12 16:38:56 2016 +0900 - On screen resize, clear the new buffer before displaying it + Handle Zaphod mode correctly in amdgpu_mode_hotplug + + We need to scan both screens of the entity for existing connectors, and + enumerate DVI & HDMI connectors consistently regardless of which screen + they're assigned to. - Fixes garbage being intermittently visible during a screen resize. + Fixes crash when hot-(un)plugging connectors in Zaphod mode. - (Ported from radeon commit 80f3d727f93cb6efedd2b39338d2301035965fe2) + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93415 + (Ported from radeon commit c801f9f10a5d72d935faf21e72f7e7808fb4f05f) Reviewed-by: Alex Deucher -commit 9f988bf1dc9d4cb92926c051ed8f15e9ba58a016 +commit 861da1d5c243f51d6c1f76e5b13e5184aa608776 Author: Michel Dänzer -Date: Thu Aug 6 17:50:11 2015 +0900 +Date: Thu May 12 16:34:30 2016 +0900 - Make drmmode_copy_fb() work with glamor + Enable DRI3 by default when building for Xorg >= 1.18.3 - Needed for Xorg -background none. + Seems to work well enough in general now. - (Ported from radeon commit 3999bf88cdb192fe2f30b03bd2ed6f6a3f9f9057) + (Ported from radeon commit 1181b9c582f10b6c523e4b2988e2ce87ecf3d367) Reviewed-by: Alex Deucher -commit 13cf61bd8d46b0059f26120a8902da6f86e6bd11 +commit 86f991838824494e68ac277fa27cbd88c23a5ee8 Author: Michel Dänzer -Date: Thu Aug 6 17:46:38 2015 +0900 +Date: Tue May 10 15:57:04 2016 +0900 - Update scanout pixmap contents before setting a mode with it + present: Support async flips - This ensures the scanout pixmaps used for Option "TearFree" and Option - "ShadowPrimary" have been initialized when their initial mode is set. + The xserver Present code only calls radeon_present_flip with + sync_flip=FALSE if radeon_present_screen_init sets + PresentCapabilityAsync, and the latter only sets it if the kernel driver + advertises support for async flips. - (Ported from radeon commit a4a8cdbcc10c1c5f07485a2af9e9e81e490c3e1d) + (Ported from radeon commit 1ca677309720e2f6c953c9e76f5b34c22a4416c6) Reviewed-by: Alex Deucher -commit 15050aabf256c17250d1fca0bfac97fc6707b195 +commit 744ac5faff7f58e26fa76974b6bdc345ea4c7c79 Author: Michel Dänzer -Date: Thu Aug 6 17:37:11 2015 +0900 +Date: Tue May 10 15:47:55 2016 +0900 - Defer initial modeset until the first BlockHandler invocation + Add support for async flips to radeon_do_pageflip - This ensures that the screen pixmap contents have been initialized when - the initial modes are set. + Will be used by the next change. No functional change here. - (Ported from radeon commits 673e1c7637687c74fc9bdeeeffb7ace0d04b734f and - 1584dc545c78e0bce8d4b4b9f26b568e2c211453) + (Ported from radeon commit 90a915c62d012e99193833aecc93974e68880c60) Reviewed-by: Alex Deucher -commit 96b5364496222f1b3afb9caad458f16f156b6c47 -Author: Michel Dänzer -Date: Thu Aug 6 17:32:45 2015 +0900 +commit 4822ec7a23d2253c88bc403f17abb6d7a053528c +Author: Flora Cui +Date: Tue May 10 17:14:00 2016 +0900 - Defer initial drmmode_copy_fb call until root window creation + add strato pci id - That's late enough for acceleration to be fully initialized, but still - early enough to set pScreen->canDoBGNoneRoot. + Signed-off-by: Flora Cui + Reviewed-by: Jammy Zhou + +commit b93006714b8de972060492cfa311320921a73773 +Author: Tom St Denis +Date: Tue Apr 12 08:48:33 2016 -0400 + + dri3: Return NULL from amdgpu_dri3_pixmap_from_fd if calloc fails. - (Ported from radeon commit 37874a4eeace5df04b02c8fc28f67b824e3f0f5f) + Signed-off-by: Tom St Denis + Reviewed-by: Michel Dänzer + +commit a0bbb373f902e0ffc14570c85faec7e44134f62e +Author: Qiang Yu +Date: Fri Apr 8 17:29:17 2016 +0800 + + Remove RR_Capability_SinkOutput for GPU without CRTC. + Signed-off-by: Qiang Yu Reviewed-by: Alex Deucher + Reviewed-by: Michel Dänzer + +commit 1a29c4bcc0a286b14f37ab942eb0cad47bc4f337 +Author: Michel Dänzer +Date: Mon Apr 11 16:27:40 2016 +0900 + + Post 1.1.0 release version bump + +commit a04f4015d6afef20c2b79e2779f6555836ee2b07 +Author: Michel Dänzer +Date: Thu Apr 7 16:47:25 2016 +0900 + + Bump version for 1.1.0 release -commit 0fb45f2bba89379ba25d4c863091937b6384bda9 +commit aed1c17c43b2c0c983f6fc0973a5224d0faf32d9 Author: Michel Dänzer -Date: Thu Aug 6 17:25:53 2015 +0900 +Date: Mon Apr 4 18:28:02 2016 +0900 - Only copy fbcon BO contents if bgNoneRoot is TRUE + glamor: Force GPU rendering to/from pixmaps created via DRI3 - Otherwise, the X server will initialize the screen pixmap contents - anyway. + Fixes crash when running DRI3 clients with ShadowPrimary enabled. - (Ported from radeon commit 39c497f3efca5ca08343b884f44c93215dcdef31) + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94799 Reviewed-by: Alex Deucher -commit cac553d3b691d26eaad24fbdcba06097b6728a6d +commit faf9d720b7d650f5f1ea657a874d08eac3972e60 Author: Michel Dänzer -Date: Thu Aug 6 17:20:22 2015 +0900 +Date: Fri Apr 1 16:09:51 2016 +0900 - Add .dir-locals.el file with Emacs indentation settings + Update manpage entry for Option "TearFree" + + It's now effective for rotation as well. Reviewed-by: Alex Deucher -commit ea32253541959cc36a40fb0118200a8f493dc98a -Author: Jammy Zhou -Date: Wed Jul 15 11:26:28 2015 +0800 +commit 5ba95c3abeb8df82aa8d33a47596eae6403ea7af +Author: Michel Dänzer +Date: Fri Apr 1 15:29:26 2016 +0900 - Adapt to the interface change of amdgpu_bo_alloc v3 + Identify DRM event queue entries by sequence number instead of by pointer - The amdgpu_bo_alloc_result structure is removed from libdrm_amdgpu, - and the amdgpu_bo_handle is returned directly + If the memory for an entry was allocated at the same address as that for + a previously cancelled entry, the handler could theoretically be called + prematurely, triggered by the DRM event which was submitted for the + cancelled entry. - v2: remove the va_map/unmap - v3: simply the code a bit + (Ported from radeon commit 4693b1bd5b5c381e8b7b68a6f7f0c6696d6a68df) - Signed-off-by: Jammy Zhou - Reviewed-by: Michel Dänzer + Reviewed-by: Alex Deucher + +commit 8ecfa69b5a833bd4c39e773a6acfd7eef9144d13 +Author: Michel Dänzer +Date: Wed Mar 30 18:33:00 2016 +0900 -commit 3010d3259d3bc74263d526e54e02bc169c8d4b4d -Author: Mario Kleiner -Date: Wed Jul 15 09:54:59 2015 +0200 - - Allow/Fix use of multiple ZaphodHead outputs per x-screen. - - Defining multiple ZaphodHead outputs per x-screen in a - multiple x-screen's per gpu configuration caused all - outputs except one per x-screen to go dark, because - there was a fixed mapping x-screen number -> crtc number, - limiting the number of crtc's per x-screen to one. - - On a ZaphodHead's setup, be more clever and assign - as many crtc's to a given x-screen as there are - ZaphodHeads defined for that screen, assuming - there are enough unused crtc's available. + DRI3: Refuse to open DRM file descriptor for ssh clients - (Ported from radeon commit afab7839fc15722dbaa7203d00fe7f6ce5336b9d) + Fixes hangs when attempting to use DRI3 on display connections forwarded + via SSH. - Signed-off-by: Mario Kleiner - Reviewed-by: Michel Dänzer - -commit 159c5d460a330cf0a24678f3c6c3e2fbaf23c571 -Author: Dave Airlie -Date: Tue Jul 14 17:04:14 2015 +0900 - - Adopt for new X server dirty tracking APIs. + Don't do this for Xorg > 1.18.99.1 since the corresponding xserver + change has landed in Git master. - Signed-off-by: Dave Airlie + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93261 - (Ported from radeon commit b6d871bf299c7d0f106c07ee4d8bd3b2337f53cc) + (Ported from radeon commit 0b3aac1de9db42bfca545fa331e4985836682ec7) Reviewed-by: Alex Deucher -commit 7b3212e33cd36fb6f122774df27b56ec4e1a22b8 +commit b2a2e114eec0967f7b67f030fbab8983cf980489 Author: Michel Dänzer -Date: Thu Jul 9 17:57:29 2015 +0900 +Date: Fri Mar 25 11:55:34 2016 +0900 - DRI2: Don't ignore rotated CRTCs in amdgpu_dri2_drawable_crtc + Revert "Use render node for DRI3 if available" + + This reverts commit ea558e645786b08d75307716036045170e97b43e. + + It broke VDPAU<->GL interop with DRI3 enabled, because the Gallium VDPAU + code doesn't support DRI3 yet. We can consider re-enabling this once + there is a Mesa release where the Gallium VDPAU code supports DRI3. - Waiting for vblank interrupts works fine with rotated CRTCs. The only - case we can't handle with rotation is page flipping, which is handled - in can_exchange(). + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94675 - This fixes gnome-shell hanging on rotation, probably because - amdgpu_dri2_get_msc returned MSC/UST 0 for rotated CRTCs. + Reviewed-by: Alex Deucher + +commit e31a2d668a1b5ebaf75d423c8123cbc8e0dcbae9 +Author: Flora Cui +Date: Wed Nov 18 16:44:13 2015 +0800 + + add polaris10 pci id + Reviewed-by: Michel Dänzer + Signed-off-by: Flora Cui Reviewed-by: Jammy Zhou -commit 5587a7b43d02d6371ed4675a6260427492ebad94 -Author: Piotr Redlewski -Date: Wed Jul 8 20:59:14 2015 +0200 +commit 6e09b8deb77f76b9bb7d393cc1ad924ebba62eff +Author: Flora Cui +Date: Thu Nov 5 14:16:39 2015 +0800 - Do not try to enable already enabled CRTCs in DPMS hook + add polaris11 pci id - (Ported from radeon commit a8ed62010d5012dfb27773595c446b217f3c00c5) + Reviewed-by: Michel Dänzer + Signed-off-by: Flora Cui + Reviewed-By: Jammy Zhou + Reviewed-by: Alex Deucher + +commit 7d32c43fff4c8df32cce150223094f793e036cf3 +Author: Alex Deucher +Date: Wed Oct 28 17:28:23 2015 -0400 + + add Polaris chip families - Signed-off-by: Piotr Redlewski Reviewed-by: Michel Dänzer + Signed-off-by: Alex Deucher -commit b176e63df20b345cb378fe962afd14eed43421d3 -Author: Piotr Redlewski -Date: Sun Jun 28 23:20:22 2015 +0200 +commit fbf9ae18cd241b8b78936aa30441e5fbfd9ba1c5 +Author: Michel Dänzer +Date: Thu Mar 24 19:05:15 2016 +0900 - Enable/disable CRTCs in DPMS hook + Require xserver 1.9 or newer + + 1.9.0 was released in August 2010. - The CRTC DPMS hook hasn't enabled or disabled hardware CRTCs. + We were already unintentionally relying on things not available in 1.8 + for at least a year, and nobody has complained. - (Based on radeon commit 48e5be1d5a82c1e0ccf6b7d52924c92a630e52a8) + (Ported from radeon commit e592f32f8b5f5873fcc18b10a69dd5e4ccf11073) - Signed-off-by: Piotr Redlewski - Reviewed-by: Michel Dänzer + Reviewed-by: Alex Deucher -commit d94d4a609c593b46ab718544ee24c25530732f22 +commit 912db5fbbc6b9b1121c8a03168cb4bd870474376 Author: Michel Dänzer -Date: Thu Jun 11 17:49:33 2015 +0900 +Date: Thu Mar 24 18:59:05 2016 +0900 - Handle CRTC DPMS from output DPMS hooks + Fix build against older versions of xserver - This fixes at least two issues: + Also slightly clean up the error handling in amdgpu_scanout_do_update. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94614 + + (Ported from radeon commit bde466e5d44cad64b4e4eceaa5de80fdbf86356e) - The CRTC DPMS hook isn't called after a modeset, so the vertical blank - interrupt emulation code considered the CRTC disabled after a modeset. As - a side effect, page flipping was no longer used after a modeset. + Reviewed-by: Alex Deucher + +commit 3fb6280ab3b104b02841c7cab8ed68c1d463c834 +Author: Michel Dänzer +Date: Thu Mar 24 18:56:44 2016 +0900 + + DRI3 only works with acceleration - This change also makes sure the vertical blank interrupt emulation code - runs before the hardware CRTC is disabled and after it's enabled from the - output DPMS hook. The wrong order could cause gnome-shell to hang after - a suspend/resume and/or DPMS off/on cycle. + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94214 - (Ported from radeon commit c4ae0e2cbcc0e2ebf9f13ee92d59b5120254a1dc) + (Ported from radeon commit d21ac4669a8b2cdd4eec5e5a94d1950b7423b8b5) Reviewed-by: Alex Deucher -commit c57da33308a81fa575179238a0415abcb8b34908 +commit 3177fe817a5f2de4ed10860866a0dd6d6c6ba816 Author: Michel Dänzer -Date: Tue Jun 9 12:39:21 2015 +0900 +Date: Thu Mar 24 18:51:59 2016 +0900 - Add Option "TearFree" + Check for xf86CursorResetCursor - Avoids tearing by flipping between two scanout BOs per (non-rotated) CRTC + If it's available, Xorg calls it on each mode configuration change. It + does what xf86_reload_cursors does (and more), so we don't need to call + the latter anymore. - (Cherry picked from radeon commit 43159ef400c3b18b9f4d3e6fa1c4aef2d60d38fe) + (Ported from radeon commit d670c5c9851b4eff21c845d26c7d7e4eb5ee0fa9) Reviewed-by: Alex Deucher -commit bd0aca09770543fa77b934e1728a832c9c2dc90c +commit a3dfce7b24e1ea01c1aa62926025a545312cbe13 Author: Michel Dänzer -Date: Tue Jun 9 11:57:59 2015 +0900 +Date: Thu Mar 24 18:45:46 2016 +0900 - glamor: Remove the stride member of struct radeon_pixmap + Don't try DRI2/Present flipping while the HW cursor can't be used - Its value was always the same as that of the PixmapRec devKind member. + Flipping doesn't interact correctly with SW cursor: A flip makes the SW + cursor disappear. It will only appear again when the cursor is moved, + but it will be surrounded by corruption, because the SW cursor code + will restore stale screen contents at the old cursor location before + drawing the cursor at the new location. - (Cherry picked from radeon commit ed401f5b4f07375db17ff05e294907ec95fc946d) + (Ported from radeon commit 7f3d0780ca65a90117c2a61362dbc0899bd9c0b0) Reviewed-by: Alex Deucher -commit e5dfb6c2667994701ee451bf82c4142cbf343405 +commit ba9be8f32f0321689133e17c1681809dec8c6cf1 Author: Michel Dänzer -Date: Wed Mar 18 16:23:24 2015 +0900 +Date: Thu Mar 24 18:44:30 2016 +0900 - glamor: Add Option "ShadowPrimary" + Factor out HW cursor checking code into drmmode_can_use_hw_cursor + + And add a check for RandR 1.4 multihead. - When this option is enabled, most pixmaps (including the screen pixmap) - are allocated in system RAM and mostly accessed by the CPU. Changed areas - of the screen pixmap are copied to dedicated per-CRTC scanout pixmaps - regularly, triggered by the vblank interrupt. + (Ported from radeon commit 3de480e83c0a1824838d662d6d67c9fe85277298) - (Cherry picked from radeon commits ae92d1765fa370a8d94c2856ad6c45d273ec3c69 - and 1af044d7eee211fd4b248c236280274a68334da5) + Reviewed-by: Alex Deucher + +commit 4a60b4b1851a3cbc2d8ad9048d68eeb6947cf132 +Author: Michel Dänzer +Date: Thu Mar 24 12:03:38 2016 +0900 + + Call AMDGPUBlockHandler_KMS before setting initial modes - [ Michel Dänzer: Additional adjustements for the amdgpu driver ] + Doing it the other way around meant that there was still a possibility + for the front buffer contents to be uninitialized when they start being + scanned out. - Signed-off-by: Darren Powell Reviewed-by: Alex Deucher -commit 08da7b691d556735dcc22b1351c886a5079dfd3f +commit 37bd79652a8ec612b94a1863e8c580b1cfaf3960 Author: Michel Dänzer -Date: Wed Jun 10 16:21:21 2015 +0900 +Date: Fri Mar 18 18:51:00 2016 +0900 - Add AMDGPU_CREATE_PIXMAP_GTT flag + present: Return rotated CRTCs from amdgpu_present_get_crtc + + Sync-to-vblank works fine with rotation. We're still checking for + rotation in amdgpu_present_check_flip. - When set, the pixmap memory is allocated in GTT instead of in VRAM. + Returning NULL from here resulted in the xserver present code falling + back to the fake CRTC running at 1 fps. + + (Ported from radeon commit a03271de5ecdaa7790d1316e993c4450b91fe936) Reviewed-by: Alex Deucher -commit 59bdb578266a2637fda8d11168b9332f6845157c +commit 6b930fb3285dea4a6440e31099c96f08da508d49 Author: Michel Dänzer -Date: Wed Jun 10 12:04:29 2015 +0900 +Date: Fri Mar 18 18:47:10 2016 +0900 - Factor out amdgpu_bo_get_handle helper + present: Clear drmmode->fb_id before calling set_mode_major for unflip + + Without this, drmmode_set_mode_major may just re-set the FB for the + last flipped BO, in which case the display will probably freeze. + + Reproduction recipe: Enable rotation while a fullscreen client is + flipping. - The helper transparently handles BOs allocated from GBM and - libdrm_amdgpu. + (Ported from radeon commit 40191d82370eb7e58bd34c44966cbf44c3703229) Reviewed-by: Alex Deucher -commit 9a6eff506b6804481a6e8139d362355fc5ffdbfb +commit 6889e091442b6ba1b9351e72bd067425e87d96e9 Author: Michel Dänzer -Date: Wed Jun 10 12:10:24 2015 +0900 +Date: Fri Mar 18 18:18:04 2016 +0900 - Set AMDGPU_BO_FLAGS_GBM for cursor buffers allocated from GBM + Make Option "TearFree" effective for rotated/reflected outputs as well + + Support varies by xserver version: + + < 1.12: No support for the driver handling rotation/reflection + 1.12-1.15: Support for driver handling rotation/reflection, but there's + a bug preventing the HW cursor from being visible everywhere + it should be on rotated outputs, so we can only support + TearFree for reflection. + >= 1.16: While the bug above is still there (fixes pending review), + the driver can force SW cursor for rotated outputs, so we + can support TearFree for rotation as well. + + (Ported from radeon commit 798c4fd16d339b1ad5fd729cc884be084c60e38b) Reviewed-by: Alex Deucher -commit d3ea8a69b02b308f8f23662be6e0c7bd81c1a2c9 +commit da4e0c66fcbcf63143372720e3d606a462332e3a Author: Michel Dänzer -Date: Fri May 29 18:53:50 2015 +0900 +Date: Fri Mar 18 18:15:34 2016 +0900 - glamor: Add wrappers for the X server rendering hooks + Consolidate pScreen usage in drmmode_set_mode_major - They can choose between using the GPU or CPU for the operation. + We were already relying on pScrn->pScreen being non-NULL in some cases, + which is supposedly always true ever since this function is no longer + getting called from ScreenInit. - (cherry picked from radeon commits eea79472a84672ee4dc7adc4487cec6a4037048a - and e58fc380ccf2a581d28f041fd74b963626ca5404) + (Ported from radeon commit eb611a2e4ecce7a1ab85fd72b9b78e3269311dd5) - Signed-off-by: Darren Powell Reviewed-by: Alex Deucher -commit 895e4d73d5f042afa13065b64a78f5625ecb5612 +commit 0bbf09dd7ef54133b3e534becb3ba15c0cf3eed2 Author: Michel Dänzer -Date: Fri May 29 18:53:40 2015 +0900 +Date: Fri Mar 18 18:14:28 2016 +0900 - glamor: Remove unused function radeon_glamor_pixmap_is_offscreen + Remove check for XF86_CRTC_VERSION 3 - (cherry picked from radeon commit 2fa021f77372ca93375a3d13a0c43a9089674899) + We require xserver >= 1.8, which was already at version 3. + + (Ported from radeon commit 06602171386e538081c298645fb7ca1a70fe80cc) - Signed-off-by: Darren Powell Reviewed-by: Alex Deucher -commit cc5671c587d575b2a7d2802d17e8af0384a2cea5 +commit 3485ca0051a224d00135d4024a97a6c4e85a9644 Author: Michel Dänzer -Date: Fri May 29 18:53:36 2015 +0900 +Date: Fri Mar 18 18:07:07 2016 +0900 - Add RADEON_CREATE_PIXMAP_SCANOUT flag + Deal with modesets and page flips crossing on a CRTC + + If we set a mode while a flip is pending, the kernel driver may program + the flip to the hardware after the modeset. If that happens, the hardware + will display the BO from the flip, whereas we will assume it displays the + BO from the modeset. In other words, the display will most likely freeze, + at least until another modeset. - It means that the pixmap is used for scanout exclusively. + Prevent this condition by waiting for a pending flip to finish before + setting a mode. + + Fixes display freezing when setting rotation or a transform with + TearFree enabled. - (cherry picked from radeon commit e96349ba6281fd18b8bf9c76629128276b065e6c) + (Ported from radeon commit a88985f5d1e39caca49ceb65678aaa9cb622a0d2) - Signed-off-by: Darren Powell Reviewed-by: Alex Deucher -commit 21834953ee64920438dee1c94f3a1e53dc58b82d +commit b9d00fa7aaf946d985897380bfa42faafbf1b3fb Author: Michel Dänzer -Date: Fri May 29 18:53:32 2015 +0900 +Date: Fri Mar 18 17:18:00 2016 +0900 - Split out struct drmmode_scanout for rotation shadow buffer information + Make DRM event queue xf86CrtcPtr based instead of ScrnInfoPtr based - Will be used for other kinds of dedicated scanout buffers as well. + This allows for a minor simplification of the code. - (cherry picked from radeon commit 9be7dd382e86d2b804de81d4e2af7431b2e16843) + (Ported from radeon commit f5d968cbba3c9b7ec202161f2157d8d64778c817) - Signed-off-by: Darren Powell Reviewed-by: Alex Deucher -commit e4e4f7b83e7d7e43993fa0793d666d6dec2980f8 +commit e0ed26151bfeadf309da53d001751c0a014dbd24 Author: Michel Dänzer -Date: Fri May 29 18:53:21 2015 +0900 +Date: Fri Mar 18 17:11:47 2016 +0900 - Rename scanout_pixmap_x field to prime_pixmap_x + Remove amdgpu_scanout_flip_handler - To avoid confusion with upcoming changes. + No longer necessary now that amdgpu_drm_queue_handler can handle + e->handler == NULL. - (cherry picked from radeon commit c32b0530302739f6512755bccf281c2300617376) + (Ported from radeon commit d5dbb07db22d5420c81dfebc060f0dd86e7b8a20) - Signed-off-by: Darren Powell Reviewed-by: Alex Deucher -commit edfff6b1a3a19953644b8052b30076f76f7dc337 +commit acd5da56f502d6ad115501e77bce06fe72b1895c Author: Michel Dänzer -Date: Tue Jun 2 17:04:21 2015 +0900 +Date: Fri Mar 18 17:14:49 2016 +0900 - Add DRI3 support - - Must be enabled with + DRI2: Also clear dri2_flipping when client disconnects before event - Option "DRI3" + Fixes the following problem: - in xorg.conf. + With DRI3 enabled, run glxgears with LIBGL_DRI3_DISABLE=1, make it + fullscreen and press Escape while it's still fullscreen. This could + result in dri2_flipping not getting cleared, spuriously preventing apps + using DRI3 from flipping. - (Cherry picked from radeon commits 64e1e4dbdd3caee6f5d8f6b6c094b4533fa94953, - 694e04720b886060fe3eefdce59741f218c8269f, - f940fd741b15f03393037c5bb904cd74f012de9d, - fcd37f65f485291084c174666bd605e215bf1398, - 4b0997e56dec0053cb2cb793e0f4ae35055ff7e6, - f68d9b5ba0c91a725b5eec9386c61bea8824c299 and - 98fb4199e63fedd4607cddee64bf602d6398df81) + (Ported from radeon commit e87365117acbd80b7d80fbb5eb30890ef7153291) Reviewed-by: Alex Deucher -commit d295b5b3310bc5c23d232c4be4170165a057c090 +commit a58bfa98208cc092014d3f36a08714eb1e0d8814 Author: Michel Dänzer -Date: Tue Jun 2 17:01:06 2015 +0900 +Date: Fri Mar 18 17:07:47 2016 +0900 - amdgpu_set_shared_pixmap_backing: Add support for GBM / glamor v2 + drm_queue: Don't abort events immediately from amdgpu_drm_abort_client - v2: Initialize reference count of imported GBM BOs to 1, fixes leaking - them. + Keep them around until the DRM event arrives, but then call the abort + functions instead of the handler functions. - Reviewed-by: Alex Deucher [v1] - -commit 03ad0fa0185d215f7d4234006e04406af1ab63ca -Author: Michel Dänzer -Date: Fri May 29 18:53:45 2015 +0900 - - glamor: Add radeon_pixmap parameter to radeon_glamor_create_textured_pixmap + This is a prerequisite for the following fix. - (cherry picked from radeon commit 051d46382656ffc3e6cac1aab3aee7efdf5b623a) + (Ported from radeon commit 3989766edde85d1abe7024577b98fc9b007bc02a) - Reviewed-by: Michel Dänzer - Signed-off-by: Darren Powell Reviewed-by: Alex Deucher -commit fafb8c6ac925ad16073e5a60dbf60d5add11bb25 +commit e4888df6e32bb817bf0d6166a22b19c14e189a84 Author: Michel Dänzer -Date: Tue Jun 2 17:00:46 2015 +0900 +Date: Fri Mar 18 17:04:10 2016 +0900 - Add support for the Present extension + Fix RandR CRTC transforms - (Cherry picked from radeon commits 3c65fb849e1ba9fb6454bcaa55b696548902f3fc, - 694e04720b886060fe3eefdce59741f218c8269f, - e3be8b0a8cf484ff16597413a6172788178e80c8, - 80eede245d1eda27eaba108b0761a24bfd69aff6 and - 5f82a720374c9c1caebb42bfbeea1f0cf8847d28) + Currently, Xorg will only transform the cursor as of the first time the + cursor image changes after a transform is set. - Reviewed-by: Alex Deucher - -commit 5b51f0e7e396ea946ef85429a8e9be5c1d5c39c3 -Author: Michel Dänzer -Date: Tue Jun 2 16:58:27 2015 +0900 - - Add support for SYNC extension fences + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80678 - (Cherry picked from radeon commits 8fc9a241ab59ffbcdc178d6415332c88a54e85fe, - af1862a37570fa512a525ab47d72b30400d2e2d6, - aa7825eb29cdf6ac9d7b28ad18186807ff384687, - af6076241c0d322b295a4e898407ae2472bd8eb4 and - d64a13ebe0ecd241ee3260dbffd8f4a01e254183) + (Ported from radeon commit 9483a3d777919b224f70c3b4d01e4b320a57db31) Reviewed-by: Alex Deucher -commit a30060d22a42688371166a861e5050fdd5ce8f7b +commit 43af92ede0968f2108f9562aa4c2c861ac703617 Author: Michel Dänzer -Date: Mon Jun 1 18:33:33 2015 +0900 +Date: Fri Mar 18 16:58:07 2016 +0900 - DRI2: Split out helper for getting UST and MSC of a specific CRTC + Build RandR 1.4 provider name from chipset name and bus ID - (Cherry picked from radeon commits 76c2923ac5c7230a8b2f9f8329c308d28b44d9c0 - and d7c82731a8bf3d381bc571b94d80d9bb2dd6e40d) + Instead of just "amdgpu", it's now e.g. "TONGA @ pci:0000:01:00.0". + + (Ported from radeon commit c7cf00487cd6d4a5d0f39d5b92ff04f6420d6a32) Reviewed-by: Alex Deucher -commit 9a554a683b970660b467566cf05b921393705a20 +commit 5ec1797a2858d693d18d21326e2307d71555e1db Author: Michel Dänzer -Date: Mon Jun 1 17:32:56 2015 +0900 +Date: Wed Feb 24 17:33:49 2016 +0900 - DRI2: Use helper functions for DRM event queue management - - This is mostly in preparation for Present support, but it also simplifies - the DRI2 specific code a little. + DRI2: Use amdgpu_pixmap_get_handle - (Cherry picked from radeon commit 6c3a721cde9317233072b573f9502348dcd21b16) + Now we can share pixmaps with no struct amdgpu_buffer via DRI2. - Reviewed-by: Alex Deucher - -commit e6164ad340f65ff8ee6f6a6934302591af875a43 -Author: Michel Dänzer -Date: Mon Jun 1 17:29:30 2015 +0900 - - DRI2: Move amdgpu_dri2_flip_event_handler + Fixes VDPAU video playback freezing when using an OpenGL compositor with + DRI3 enabled and mpv VAAPI hardware decoding with OpenGL output. - In preparation for the next change, which will modify it to a static - function which needs to be in the new place. No functional change. + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89755 + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93804 - (Cherry picked from radeon commit c3fa22a479e61d1899fa9d327d9c4e2a7f64b0c1) + (ported from radeon commit f8b0f23e9f4af9f9097ee5e72d53b45173163c41) Reviewed-by: Alex Deucher -commit 5419e13da7ec3cffd43510ac88106076ea81124c +commit df60c635e1e632233de9dd4b01d63c2b963003f8 Author: Michel Dänzer -Date: Mon Jun 1 17:25:23 2015 +0900 +Date: Wed Feb 24 17:06:43 2016 +0900 - DRI2: Remove superfluous assignments to *_info->frame + glamor: Avoid generating GEM flink names for BOs shared via DRI3 (v2) - That field is only used for page flipping. + We can't create our own struct amdgpu_buffer representation in this case + because destroying that would make the GEM handle inaccessible to glamor + as well. So just get the handle directly via dma-buf. + + (ported from radeon commit 391900a670addec39515f924265bfa9f8bfa9ec0, + extended to cache BO handles in the private for non-DRI3 pixmaps as + well) - (Cherry picked from radeon commit 65045112fdc8a9fa36e0e00f46739a6152b775ff) + v2: Swap whole pixmap privates instead of just BOs in + amdgpu_dri2_exchange_buffers to avoid invalidating cached BO handles Reviewed-by: Alex Deucher -commit f4c2b640be17ab1f8694b35d4cb74ccfce3d1385 +commit e463b849f3e9d7b69e64a65619a22e00e78d297b Author: Michel Dänzer -Date: Mon Jun 1 17:11:30 2015 +0900 +Date: Tue Feb 23 18:10:29 2016 +0900 - DRI2: Simplify blit fallback handling for scheduled swaps - - Also use amdgpu_dri2_schedule_event when possible. + Make amdgpu_do_pageflip take a pixmap instead of a BO - (Cherry picked from radeon commit ad27f16f308079d06a2b1c788b3cb0947531253a) + (inspired by radeon commit 7b4fc4a677d252d01c2bf80d162bc35814059eaa) Reviewed-by: Alex Deucher -commit 13a7284e061081a12180b375d66f9b8394cf8753 +commit 1ee341f9d909f3b7ba2984fc912dabdb98c34b19 Author: Michel Dänzer -Date: Mon Jun 1 16:58:00 2015 +0900 +Date: Tue Feb 23 18:42:19 2016 +0900 - Add DRM event queue helpers + Add amdgpu_pixmap_get_handle helper - (Cherry picked from radeon commit b4af8a327ed8420f0ff4ea0f113f4a59406ed4d3) + (inspired by radeon commits dfad91fffb5bd013785223b42d78886df839eacf + and ccbda955ebae1d457d35293833f12791e0f9fb0b) Reviewed-by: Alex Deucher -commit eb7c6958dff5cb8b0aad02d1d5673483dae4e3d4 +commit a36bbfd98b96426bbe0be3923c64da7ec0e565d0 Author: Michel Dänzer -Date: Mon Jun 1 16:52:40 2015 +0900 +Date: Mon Feb 15 18:41:51 2016 +0900 - Move xorg_list backwards compatibility to new amdgpu_list.h header + HAS_DIRTYTRACKING_ROTATION also supports multiple CRTCs - (Cherry picked from radeon commits 7c3470f4b659206ed23f761948936ede3a2dba3d - and 4a98f60117c387a228d5cbaadb6e298fb4e865df) + (ported from radeon commit ff9a6b6f079a8419f4e6fadfee778060618bf735) Reviewed-by: Alex Deucher -commit 69d161a54b4ea0d8033a0873210f2857c91ceae8 +commit a37746ffceaed83e48e48fb05439be7e020dd2ea Author: Michel Dänzer -Date: Mon Jun 1 16:46:30 2015 +0900 +Date: Mon Feb 15 18:35:54 2016 +0900 - Require at least xserver 1.8 - - So we can rely on the list.h header. + Load fb module before glamoregl/shadow modules - xserver 1.8 was released in April 2010. + Fixes unresolved symbols on some systems. - (Cherry picked from radeon commit 7388d0b6c54b9d536fdb161e3aa61b326627b939) + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93105 + (ported from radeon commit 78fbca095ae9887a2d3de48bb07975e2d1126e68) Reviewed-by: Alex Deucher -commit 7363156b7c077def2aaf9a4573410817f5e92610 -Author: Jammy Zhou -Date: Sat May 30 00:31:44 2015 +0800 - - Check GBM_BO_USE_LINEAR correctly v2 - - v2: remove the check for gbm.h - - Signed-off-by: Jammy Zhou - Reviewed-by: Michel Dänzer - Reviewed-by: Alex Deucher [v1] - -commit e75e9f39c95b8b563885882bf29d776861cd6ca3 -Author: Brian Paterni -Date: Sat May 16 15:00:14 2015 -0500 +commit 59c0a6807110eca829c6708e16585a38f39a5c17 +Author: Michel Dänzer +Date: Mon Feb 15 18:28:13 2016 +0900 - extend conditional group GBM_BO_USE_LINEAR over both usages + Don't advertise any PRIME offloading capabilities without acceleration - Fixes 'GBM_BO_USE_LINEAR' undeclared error when compiling against older - libgbm + Acceleration is required even for display offloading. Trying to enable + display offloading without acceleration resulted in a crash. - Signed-off-by: Brian Paterni - Reviewed-by: Michel Dänzer + (ported from radeon commit b19417e2fddf4df725951aea5ad5e9558338f59e) + Reviewed-by: Alex Deucher -commit 37b389ee9e13f065fb080d1269f9a6aed616c210 +commit a3eac85d812ecc605436e6bd5b9ee7ebf307e3d3 Author: Michel Dänzer -Date: Fri May 15 10:24:24 2015 +0900 +Date: Tue Jan 26 16:12:28 2016 +0900 - glamor: Deal with glamor_glyphs_init being removed from xserver + Only map front buffer if glamor acceleration is disabled (v2) - Port of radeon commit 818c180c8932233b214a35ba0647af82f7bcec3d. - -commit 22917044e419023d487f816e0d4f094695b55fa6 -Author: Alex Deucher -Date: Tue May 12 13:29:00 2015 -0400 - - add some new tonga pci ids + Otherwise the front buffer may not be accessible by the CPU, because Mesa + sets the AMDGPU_GEM_CREATE_NO_CPU_ACCESS flag for tiled buffers, because + accessing tiled buffers with the CPU makes little sense. - Reviewed-by: Jammy Zhou - Reviewed-by: Michel Dänzer - Signed-off-by: Alex Deucher - -commit e71be4a22799ec4c02051b75c5fed16a3a953c7b -Author: Alex Deucher -Date: Tue May 12 13:25:02 2015 -0400 - - add new bonaire pci id + v2: Also handle Option "AccelMethod" "none" - Reviewed-by: Jammy Zhou - Reviewed-by: Michel Dänzer - Signed-off-by: Alex Deucher + Reviewed-by: Alex Deucher -commit b795d1e137b34a314b4b41d025d96ca9251d6bbe -Author: Michel Dänzer -Date: Thu May 7 18:05:32 2015 +0900 +commit 2fcb7dadd3c71cd405cbbaafc777697538ca9c29 +Author: jimqu +Date: Mon Jan 25 09:47:00 2016 +0800 - Link against libgbm - - Fixes unresolved symbol "gbm_create_device". + glamor: Return NullPixmap on failure to create shareable pixmap - Reported-and-Tested-by: Brian Paterni - -commit 7e3b27390a03e423772717fca3c757cf5cc4d7b4 -Author: Jammy Zhou -Date: Tue May 12 05:34:49 2015 +0800 - - Disable tiling for PRIME shared pixmap + If we were asked to create a shareable pixmap, it doesn't make sense + to return a pixmap which isn't shareable. Doing so caused trouble down + the line such as a crash with older versions of glamor when trying to + use GLX pixmaps of bpp < 32 via DRI2. - Signed-off-by: Jammy Zhou + Signed-off-by: JimQu Reviewed-by: Michel Dänzer -commit 4840f918ab7d61b4f55bcdff3afdac7b34e45d88 -Author: Jammy Zhou -Date: Tue May 12 00:09:42 2015 +0800 +commit 5269a2228bff6023c1a7f3e8534027e1d7addc25 +Author: jimqu +Date: Mon Jan 25 10:12:02 2016 +0800 - Use gbm_bo_get_fd to get DMA_BUF fd + Move amdgpu_glamor_destroy_pixmap before amdgpu_glamor_create_pixmap - When GBM is used for buffer allocation, gbm_bo_get_fd should be - used to get the DMA_BUF fd. + The next commit will call the former from the latter. No functional + change. - Signed-off-by: Jammy Zhou + Signed-off-by: JimQu Reviewed-by: Michel Dänzer -commit b69c5b3cc2d7da3bb85acd687db9b5a021258914 -Author: Marek Olšák -Date: Fri Mar 27 22:56:37 2015 +0100 +commit 54c959c163288caa87f612911b70df73f87d29d6 +Author: Tom St Denis +Date: Wed Jan 20 09:37:36 2016 -0500 - ddx: use amdgpu_query_crtc_from_id + Move memset() after variable declarations - Reviewed-by: Jammy Zhou + To make the code more "C" like move the function calls + after the variable declarations. + + Signed-off-by: Tom St Denis Reviewed-by: Alex Deucher + Reviewed-by: Michel Dänzer -commit 91aa694a7da7b690a3e5d59a1a8fa42cbb3ebda4 -Author: Marek Olšák -Date: Fri Mar 27 22:22:35 2015 +0100 +commit 8853b07ae8169c409740c40d45cd335bd608f2a7 +Author: Michel Dänzer +Date: Tue Jan 19 17:35:11 2016 +0900 - ddx: remove AMDGPUIsAccelWorking + Set the RandR primary output on startup if Xorg hasn't - libdrm fails to initialize without acceleration, so this always returns true. + Fixes xrandr (XRRGetOutputPrimary) not reporting any output as primary + after startup. - Reviewed-by: Jammy Zhou - Reviewed-by: Alex Deucher - -commit afc33040f862e2e13ba7f132bb363cf16fb6a1d7 -Author: Marek Olšák -Date: Fri Mar 27 22:14:37 2015 +0100 - - ddx: enable acceleration by default on Hawaii + (Ported from radeon commit b16856b25086ffb27365ac2249b8da921066ce62) - Reviewed-by: Jammy Zhou Reviewed-by: Alex Deucher -commit 8a34a8149860ac15e83ccdbd8d9a527d8d3e5997 -Author: Jammy Zhou -Date: Mon Apr 27 14:27:34 2015 +0800 +commit bd5c65daceaf633c36fcec86ff061df10c364bc0 +Author: Michel Dänzer +Date: Thu Jan 7 15:53:41 2016 +0900 - Remove throttling from amdgpu_dri2_copy_region2 + Only call amdgpu_bus_id once in each probe path (v2) - Throttling should be handled by the client-side drivers. + Instead of up to twice as before. - Signed-off-by: Jammy Zhou - Reviewed-by: Michel Dänzer - -commit 9f61a5506b1028d30c99cb5866abcec35d5c9cb8 -Author: Alex Deucher -Date: Fri Apr 24 11:47:32 2015 -0400 - - fixup README + v2: Remove free(busIdString) call from amdgpu_kernel_mode_enabled, the + bus ID string is now managed by its callers. - Reviewed-by: Michel Dänzer - Signed-off-by: Alex Deucher + Reviewed-by: Alex Deucher (v1) -commit a49ad11af18dad74506c2f69d7bbda07b67529d2 +commit 6e42c58375a4c3229da93c27bbd104af145c6163 Author: Michel Dänzer -Date: Fri Apr 24 09:57:27 2015 +0900 +Date: Thu Jan 7 15:57:38 2016 +0900 - Add 10-amdgpu.conf xorg.conf.d snippet - - This instructs Xorg >= 1.16 to try loading the amdgpu driver for devices - managed by the amdgpu kernel driver. + Remove pci_dev test from amdgpu_get_scrninfo - Reviewed-by: Alex Deucher - -commit fa4aed6cf56048a6520eac57514e38db3685cd15 -Author: Michel Dänzer -Date: Fri Apr 24 09:53:33 2015 +0900 - - Document Option "AccelMethod" in the manpage + The pci_dev parameter can never be NULL since we only support KMS. + Reported-by: Tom St Denis Reviewed-by: Alex Deucher -commit fe4a4b6836252cc8caa642a32fb3910c8590076b +commit 8e09180798a06af5afa030d754938e4ca06e272f Author: Michel Dänzer -Date: Fri Apr 24 09:52:04 2015 +0900 +Date: Thu Jan 7 15:35:35 2016 +0900 - Fix build when gbm.h doesn't define GBM_BO_USE_LINEAR - - Option "AccelMethod" "none" is ignored in that case. + Re-use PCI bus ID code from kernel_open_fd in kernel_mode_enabled Reviewed-by: Alex Deucher -commit 84df3e7114fb71b5e10c1a6f7869ab1505fef5b0 -Author: Michel Dänzer -Date: Fri Apr 24 09:51:22 2015 +0900 +commit 4eb9cedca080b30c57ded349a397620ee7d0cd46 +Author: Mykola Lysenko +Date: Wed Jan 13 14:03:55 2016 +0800 - glamor: Handle GLAMOR_* flags removed from xserver - - The behaviour is the same as when the removed flags were passed in. + Initialize drmmode_crtc dpms_mode to DPMSModeOff - (cherry picked from radeon commit b16609b453bb1a181198cf27778f205dc23fb642) + This disables query of disabled pipes for drmWaitVBlank on X start - Reviewed-by: Christian König + Signed-off-by: Mykola Lysenko + Reviewed-by: Michel Dänzer -commit b947f4bf4efa8841bea4d306d0b0d21c7511c724 +commit 1d0b0c1794e65e581a48aa9fb19679d928d82a5d Author: Michel Dänzer -Date: Fri Apr 24 09:50:51 2015 +0900 - - Move #include "radeon_glamor.h" from amdgpu_drv.h to where it's needed - - (cherry picked from radeon commit 4b8adebb80158bcf81ada83bb88517febe931b12) - - Reviewed-by: Christian König - -commit ff62bf6e9dce55dbde92baf4fa30193c7344ee8a -Author: Alex Deucher -Date: Mon Apr 20 11:57:52 2015 -0400 +Date: Thu Dec 10 18:08:12 2015 +0900 - amdgpu: add the xf86-video-amdgpu driver + sync: Check if miSyncShmScreenInit symbol is resolved at runtime - This adds the new xf86-video-amdgpu driver for - newer AMD GPUs. + It may be disabled in the Xorg build, either explicitly or because the + xshmfence library isn't available. - Signed-off-by: Alex Deucher + Reviewed-by: Alex Deucher diff -Nru xserver-xorg-video-amdgpu-1.1.2/config.guess xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/config.guess --- xserver-xorg-video-amdgpu-1.1.2/config.guess 2015-11-19 08:24:46.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/config.guess 2016-10-10 06:28:35.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2016 Free Software Foundation, Inc. -timestamp='2015-08-20' +timestamp='2016-04-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 @@ -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;hb=HEAD +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2016 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." @@ -237,6 +237,10 @@ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` 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} + exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; @@ -268,42 +272,42 @@ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # 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 @@ -376,16 +380,16 @@ exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build - SUN_ARCH="i386" + 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. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` @@ -410,7 +414,7 @@ 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} @@ -635,13 +639,13 @@ 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 - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 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 - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi @@ -680,11 +684,11 @@ 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 @@ -697,12 +701,12 @@ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} @@ -807,14 +811,14 @@ 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_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | 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_SYS=`uname -p | 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:*:*) @@ -896,7 +900,7 @@ exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${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 @@ -919,7 +923,7 @@ EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) @@ -965,6 +969,9 @@ ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; + k1om:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; @@ -1120,7 +1127,7 @@ # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1269,6 +1276,9 @@ SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux${UNAME_RELEASE} + exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; @@ -1282,9 +1292,9 @@ UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; 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) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in @@ -1306,7 +1316,7 @@ exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi @@ -1337,7 +1347,7 @@ # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" @@ -1379,7 +1389,7 @@ 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 @@ -1390,6 +1400,9 @@ x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs + exit ;; esac cat >&2 <. # @@ -591,8 +591,8 @@ # Identity of this package. PACKAGE_NAME='xf86-video-amdgpu' PACKAGE_TARNAME='xf86-video-amdgpu' -PACKAGE_VERSION='1.1.2' -PACKAGE_STRING='xf86-video-amdgpu 1.1.2' +PACKAGE_VERSION='1.1.99' +PACKAGE_STRING='xf86-video-amdgpu 1.1.99' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_URL='' @@ -651,9 +651,9 @@ LIBUDEV_TRUE LIBUDEV_LIBS LIBUDEV_CFLAGS +configdir HAS_XORG_CONF_DIR_FALSE HAS_XORG_CONF_DIR_TRUE -configdir HAVE_XEXTPROTO_71_FALSE HAVE_XEXTPROTO_71_TRUE XEXT_LIBS @@ -1408,7 +1408,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.1.2 to adapt to many kinds of systems. +\`configure' configures xf86-video-amdgpu 1.1.99 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1480,7 +1480,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xf86-video-amdgpu 1.1.2:";; + short | recursive ) echo "Configuration of xf86-video-amdgpu 1.1.99:";; esac cat <<\_ACEOF @@ -1642,7 +1642,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xf86-video-amdgpu configure 1.1.2 +xf86-video-amdgpu configure 1.1.99 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2057,7 +2057,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.1.2, which was +It was created by xf86-video-amdgpu $as_me 1.1.99, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2927,7 +2927,7 @@ # Define the identity of the package. PACKAGE='xf86-video-amdgpu' - VERSION='1.1.2' + VERSION='1.1.99' cat >>confdefs.h <<_ACEOF @@ -19366,7 +19366,6 @@ fi -# Define a configure option for an alternate X Server configuration directory # Section "OutputClass" is only supported as of xserver 1.16 if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"xorg-server >= 1.16\""; } >&5 @@ -19378,6 +19377,16 @@ else sysconfigdir="" fi + if test "x$sysconfigdir" != "x"; then + HAS_XORG_CONF_DIR_TRUE= + HAS_XORG_CONF_DIR_FALSE='#' +else + HAS_XORG_CONF_DIR_TRUE='#' + HAS_XORG_CONF_DIR_FALSE= +fi + + +# Define a configure option for an alternate X Server configuration directory # Check whether --with-xorg-conf-dir was given. if test "${with_xorg_conf_dir+set}" = set; then : @@ -19387,14 +19396,6 @@ fi - if test "x$sysconfigdir" != "x"; then - HAS_XORG_CONF_DIR_TRUE= - HAS_XORG_CONF_DIR_FALSE='#' -else - HAS_XORG_CONF_DIR_TRUE='#' - HAS_XORG_CONF_DIR_FALSE= -fi - # Check whether --enable-udev was given. if test "${enable_udev+set}" = set; then : @@ -20626,7 +20627,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.1.2, which was +This file was extended by xf86-video-amdgpu $as_me 1.1.99, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20692,7 +20693,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.1.2 +xf86-video-amdgpu config.status 1.1.99 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -Nru xserver-xorg-video-amdgpu-1.1.2/configure.ac xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/configure.ac --- xserver-xorg-video-amdgpu-1.1.2/configure.ac 2016-09-16 09:02:08.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/configure.ac 2016-10-10 06:28:11.000000000 +0000 @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-video-amdgpu], - [1.1.2], + [1.1.99], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-video-amdgpu]) @@ -82,18 +82,19 @@ HAVE_XEXTPROTO_71="no") AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ]) -# Define a configure option for an alternate X Server configuration directory # Section "OutputClass" is only supported as of xserver 1.16 PKG_CHECK_EXISTS([xorg-server >= 1.16], [sysconfigdir=`$PKG_CONFIG --variable=sysconfigdir xorg-server`], [sysconfigdir=""]) +AM_CONDITIONAL(HAS_XORG_CONF_DIR, [test "x$sysconfigdir" != "x"]) + +# Define a configure option for an alternate X Server configuration directory AC_ARG_WITH(xorg-conf-dir, AS_HELP_STRING([--with-xorg-conf-dir=DIR], [Default xorg.conf.d directory [[default=${prefix}/share/X11/xorg.conf.d]]]), [configdir="$withval"], [configdir='${prefix}/share/X11/xorg.conf.d']) AC_SUBST(configdir) -AM_CONDITIONAL(HAS_XORG_CONF_DIR, [test "x$sysconfigdir" != "x"]) AC_ARG_ENABLE([udev], AS_HELP_STRING([--disable-udev], [Disable libudev support [default=auto]]), diff -Nru xserver-xorg-video-amdgpu-1.1.2/debian/changelog xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/debian/changelog --- xserver-xorg-video-amdgpu-1.1.2/debian/changelog 2016-10-10 06:31:18.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/debian/changelog 2016-10-10 06:31:18.000000000 +0000 @@ -1,3 +1,11 @@ +xserver-xorg-video-amdgpu (1.1.99+git20161010.d42773eb-0ubuntu0ricotz) yakkety; urgency=medium + + * Checkout from git 20161010 (master branch) up to commit + d42773eb45baff5933730e26878a0b45fcf07b65 + * Only added debian/ tree from origin/debian-unstable + + -- Rico Tzschichholz Mon, 10 Oct 2016 08:28:35 +0200 + xserver-xorg-video-amdgpu (1.1.2-1) unstable; urgency=medium * New upstream release. diff -Nru xserver-xorg-video-amdgpu-1.1.2/debian/control xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/debian/control --- xserver-xorg-video-amdgpu-1.1.2/debian/control 2016-10-10 06:31:18.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/debian/control 2016-10-10 06:31:18.000000000 +0000 @@ -1,7 +1,8 @@ Source: xserver-xorg-video-amdgpu Section: x11 Priority: optional -Maintainer: Debian X Strike Force +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Debian X Strike Force Uploaders: Timo Aaltonen Build-Depends: debhelper (>= 9), diff -Nru xserver-xorg-video-amdgpu-1.1.2/.editorconfig xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/.editorconfig --- xserver-xorg-video-amdgpu-1.1.2/.editorconfig 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/.editorconfig 2016-10-10 06:28:11.000000000 +0000 @@ -0,0 +1,7 @@ +root=true + +[*] +indent_style=tab +tab_width=8 +indent_size=8 +charset=utf-8 diff -Nru xserver-xorg-video-amdgpu-1.1.2/.gitignore xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/.gitignore --- xserver-xorg-video-amdgpu-1.1.2/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/.gitignore 2016-10-10 06:28:09.000000000 +0000 @@ -0,0 +1,81 @@ +# +# X.Org module default exclusion patterns +# The next section if for module specific patterns +# +# Do not edit the following section +# GNU Build System (Autotools) +aclocal.m4 +autom4te.cache/ +autoscan.log +ChangeLog +compile +config.guess +config.h +config.h.in +config.log +config-ml.in +config.py +config.status +config.status.lineno +config.sub +configure +configure.scan +depcomp +.deps/ +INSTALL +install-sh +.libs/ +libtool +libtool.m4 +ltmain.sh +lt~obsolete.m4 +ltoptions.m4 +ltsugar.m4 +ltversion.m4 +Makefile +Makefile.in +mdate-sh +missing +mkinstalldirs +*.pc +py-compile +stamp-h? +symlink-tree +texinfo.tex +ylwrap + +# Do not edit the following section +# Edit Compile Debug Document Distribute +*~ +*.[0-9] +*.[0-9]x +*.bak +*.bin +core +*.dll +*.exe +*-ISO*.bdf +*-JIS*.bdf +*-KOI8*.bdf +*.kld +*.ko +*.ko.cmd +*.lai +*.l[oa] +*.[oa] +*.obj +*.patch +*.so +*.pcf.gz +*.pdb +*.tar.bz2 +*.tar.gz +*.swp +*.out +tags +# +# Add & Override patterns for xf86-video-ati +# +# Edit the following section as needed +# For example, !report.pc overrides *.pc. See 'man gitignore' +# diff -Nru xserver-xorg-video-amdgpu-1.1.2/INSTALL xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/INSTALL --- xserver-xorg-video-amdgpu-1.1.2/INSTALL 2016-09-16 09:26:54.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/INSTALL 1970-01-01 00:00:00.000000000 +0000 @@ -1,370 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, -Inc. - - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - -Basic Installation -================== - - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented -below. The lack of an optional feature in a given package is not -necessarily a bug. More recommendations for GNU packages can be found -in *note Makefile Conventions: (standards)Makefile Conventions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. Optionally, type `make installcheck' to repeat any self-tests, but - this time using the binaries in their final installed location. - This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required - root privileges, verifies that the installation completed - correctly. - - 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 7. Often, you can also type `make uninstall' to remove the installed - files again. In practice, not all packages have tested that - uninstallation works correctly, even though it is required by the - GNU Coding Standards. - - 8. Some packages, particularly those that use Automake, provide `make - distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -Installation Names -================== - - By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an -absolute file name. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory -specifications that were not explicitly provided. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - If the package supports it, you can cause programs to be installed -with an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - HP-UX `make' updates targets which have the same time stamps as -their prerequisites, which makes it generally unusable when shipped -generated files such as `configure' are involved. Use GNU `make' -instead. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS - KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff -Nru xserver-xorg-video-amdgpu-1.1.2/.lastcommit xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/.lastcommit --- xserver-xorg-video-amdgpu-1.1.2/.lastcommit 1970-01-01 00:00:00.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/.lastcommit 2016-10-10 06:28:12.000000000 +0000 @@ -0,0 +1 @@ +commit d42773eb45baff5933730e26878a0b45fcf07b65 diff -Nru xserver-xorg-video-amdgpu-1.1.2/ltmain.sh xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/ltmain.sh --- xserver-xorg-video-amdgpu-1.1.2/ltmain.sh 2016-02-19 03:10:50.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/ltmain.sh 2016-10-10 06:28:28.000000000 +0000 @@ -31,7 +31,7 @@ PROGRAM=libtool PACKAGE=libtool -VERSION="2.4.6 Debian-2.4.6-0.1" +VERSION="2.4.6 Debian-2.4.6-1" package_revision=2.4.6 @@ -1977,7 +1977,7 @@ # End: # Set a version string. -scriptversion='(GNU libtool) 2.4.6' +scriptversion='(GNU libtool) 2.4.6 Debian-2.4.6-1' # func_echo ARG... @@ -2068,7 +2068,7 @@ compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) - version: $progname (GNU libtool) 2.4.6 + version: $progname $scriptversion automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` diff -Nru xserver-xorg-video-amdgpu-1.1.2/Makefile.in xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/Makefile.in --- xserver-xorg-video-amdgpu-1.1.2/Makefile.in 2016-09-16 09:02:51.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/Makefile.in 2016-10-10 06:28:35.000000000 +0000 @@ -179,7 +179,7 @@ DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in COPYING \ ChangeLog INSTALL README compile config.guess config.sub \ - depcomp install-sh ltmain.sh missing + install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) diff -Nru xserver-xorg-video-amdgpu-1.1.2/man/amdgpu.man xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/man/amdgpu.man --- xserver-xorg-video-amdgpu-1.1.2/man/amdgpu.man 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/man/amdgpu.man 2016-10-10 06:28:11.000000000 +0000 @@ -64,6 +64,8 @@ .BI "Option \*qDRI\*q \*q" integer \*q Define the maximum level of DRI to enable. Valid values are 2 for DRI2 or 3 for DRI3. The default is +.B 3 for DRI3 +if the driver was compiled for Xorg >= 1.18.3, otherwise .B 2 for DRI2. .TP .BI "Option \*qEnablePageFlip\*q \*q" boolean \*q diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_bo_helper.c xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_bo_helper.c --- xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_bo_helper.c 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_bo_helper.c 2016-10-10 06:28:11.000000000 +0000 @@ -384,9 +384,10 @@ struct amdgpu_buffer *pixmap_buffer = NULL; int ihandle = (int)(long)fd_handle; uint32_t size = ppix->devKind * ppix->drawable.height; + Bool ret; if (info->gbm) { - struct amdgpu_pixmap *priv; + struct amdgpu_buffer *bo; struct gbm_import_fd_data data; uint32_t bo_use = GBM_BO_USE_RENDERING; @@ -395,16 +396,10 @@ if (data.format == ~0U) return FALSE; - priv = calloc(1, sizeof(struct amdgpu_pixmap)); - if (!priv) + bo = calloc(1, sizeof(struct amdgpu_buffer)); + if (!bo) return FALSE; - - priv->bo = calloc(1, sizeof(struct amdgpu_buffer)); - if (!priv->bo) { - free(priv); - return FALSE; - } - priv->bo->ref_count = 1; + bo->ref_count = 1; data.fd = ihandle; data.width = ppix->drawable.width; @@ -414,27 +409,27 @@ if (ppix->drawable.bitsPerPixel == pScrn->bitsPerPixel) bo_use |= GBM_BO_USE_SCANOUT; - priv->bo->bo.gbm = gbm_bo_import(info->gbm, GBM_BO_IMPORT_FD, - &data, bo_use); - if (!priv->bo->bo.gbm) { - free(priv->bo); - free(priv); + bo->bo.gbm = gbm_bo_import(info->gbm, GBM_BO_IMPORT_FD, &data, + bo_use); + if (!bo->bo.gbm) { + free(bo); return FALSE; } - priv->bo->flags |= AMDGPU_BO_FLAGS_GBM; + bo->flags |= AMDGPU_BO_FLAGS_GBM; #ifdef USE_GLAMOR if (info->use_glamor && - !amdgpu_glamor_create_textured_pixmap(ppix, priv)) { - free(priv->bo); - free(priv); + !amdgpu_glamor_create_textured_pixmap(ppix, bo)) { + amdgpu_bo_unref(&bo); return FALSE; } #endif - amdgpu_set_pixmap_private(ppix, priv); - return TRUE; + ret = amdgpu_set_pixmap_bo(ppix, bo); + /* amdgpu_set_pixmap_bo increments ref_count if it succeeds */ + amdgpu_bo_unref(&bo); + return ret; } pixmap_buffer = amdgpu_gem_bo_open_prime(pAMDGPUEnt->pDev, ihandle, size); @@ -442,13 +437,15 @@ return FALSE; } - amdgpu_set_pixmap_bo(ppix, pixmap_buffer); - close(ihandle); + + ret = amdgpu_set_pixmap_bo(ppix, pixmap_buffer); + /* we have a reference from the alloc and one from set pixmap bo, drop one */ amdgpu_bo_unref(&pixmap_buffer); - return TRUE; + + return ret; } #endif /* AMDGPU_PIXMAP_SHARING */ diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_chipset_gen.h xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_chipset_gen.h --- xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_chipset_gen.h 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_chipset_gen.h 2016-10-10 06:28:11.000000000 +0000 @@ -193,3 +193,24 @@ { PCI_CHIP_POLARIS10_67CF, "POLARIS10" }, { -1, NULL } }; + +SymTabRec AMDGPUUniqueChipsets[] = { + { 0, "BONAIRE" }, + { 0, "CARRIZO" }, + { 0, "FIJI" }, + { 0, "HAINAN" }, + { 0, "HAWAII" }, + { 0, "KABINI" }, + { 0, "KAVERI" }, + { 0, "MULLINS" }, + { 0, "OLAND" }, + { 0, "PITCAIRN" }, + { 0, "POLARIS10" }, + { 0, "POLARIS11" }, + { 0, "STONEY" }, + { 0, "TAHITI" }, + { 0, "TONGA" }, + { 0, "TOPAZ" }, + { 0, "VERDE" }, + { -1, NULL } +}; diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_dri2.c xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_dri2.c --- xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_dri2.c 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_dri2.c 2016-10-10 06:28:11.000000000 +0000 @@ -563,7 +563,7 @@ AMDGPU_DRM_QUEUE_ID_DEFAULT, flip_info, ref_crtc_hw_id, amdgpu_dri2_flip_event_handler, - amdgpu_dri2_flip_event_abort)) { + amdgpu_dri2_flip_event_abort, FLIP_VSYNC)) { info->drmmode.dri2_flipping = TRUE; return TRUE; } @@ -603,7 +603,10 @@ for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; - if (crtc->enabled && crtc->rotatedData) + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + if (crtc->enabled && + (crtc->rotatedData || drmmode_crtc->scanout[0].bo)) return FALSE; } @@ -1032,7 +1035,7 @@ drm_queue_seq = amdgpu_drm_queue_alloc(crtc, client, AMDGPU_DRM_QUEUE_ID_DEFAULT, wait_info, amdgpu_dri2_frame_event_handler, amdgpu_dri2_frame_event_abort); - if (!drm_queue_seq) { + if (drm_queue_seq == AMDGPU_DRM_QUEUE_ERROR) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Allocating DRM queue event entry failed.\n"); goto out_complete; @@ -1180,7 +1183,7 @@ drm_queue_seq = amdgpu_drm_queue_alloc(crtc, client, AMDGPU_DRM_QUEUE_ID_DEFAULT, swap_info, amdgpu_dri2_frame_event_handler, amdgpu_dri2_frame_event_abort); - if (!drm_queue_seq) { + if (drm_queue_seq == AMDGPU_DRM_QUEUE_ERROR) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Allocating DRM queue entry failed.\n"); goto blit_fallback; diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_dri3.c xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_dri3.c --- xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_dri3.c 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_dri3.c 2016-10-10 06:28:11.000000000 +0000 @@ -138,8 +138,13 @@ if (pixmap) { struct amdgpu_pixmap *priv = calloc(1, sizeof(*priv)); - amdgpu_set_pixmap_private(pixmap, priv); - return pixmap; + if (priv) { + amdgpu_set_pixmap_private(pixmap, priv); + return pixmap; + } + + screen->DestroyPixmap(pixmap); + return NULL; } } #endif diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_drm_queue.c xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_drm_queue.c --- xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_drm_queue.c 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_drm_queue.c 2016-10-10 06:28:11.000000000 +0000 @@ -92,10 +92,11 @@ e = calloc(1, sizeof(struct amdgpu_drm_queue_entry)); if (!e) - return NULL; + return AMDGPU_DRM_QUEUE_ERROR; + + if (_X_UNLIKELY(amdgpu_drm_queue_seq == AMDGPU_DRM_QUEUE_ERROR)) + amdgpu_drm_queue_seq++; - if (!amdgpu_drm_queue_seq) - amdgpu_drm_queue_seq = 1; e->seq = amdgpu_drm_queue_seq++; e->client = client; e->crtc = crtc; diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_drm_queue.h xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_drm_queue.h --- xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_drm_queue.h 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_drm_queue.h 2016-10-10 06:28:11.000000000 +0000 @@ -31,6 +31,8 @@ #include +#define AMDGPU_DRM_QUEUE_ERROR 0 + #define AMDGPU_DRM_QUEUE_CLIENT_DEFAULT serverClient #define AMDGPU_DRM_QUEUE_ID_DEFAULT ~0ULL diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_drv.h xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_drv.h --- xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_drv.h 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_drv.h 2016-10-10 06:28:11.000000000 +0000 @@ -185,6 +185,10 @@ uint32_t flags; }; +struct amdgpu_client_priv { + uint_fast32_t needs_flush; +}; + typedef struct { EntityInfoPtr pEnt; pciVideoPtr PciInfo; @@ -209,6 +213,7 @@ /* accel */ PixmapPtr fbcon_pixmap; + int callback_event_type; uint_fast32_t gpu_flushed; uint_fast32_t gpu_synced; Bool use_glamor; diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_glamor.c xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_glamor.c --- xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_glamor.c 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_glamor.c 2016-10-10 06:28:11.000000000 +0000 @@ -127,7 +127,7 @@ } Bool -amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_pixmap *priv) +amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_buffer *bo) { ScrnInfoPtr scrn = xf86ScreenToScrn(pixmap->drawable.pScreen); AMDGPUInfoPtr info = AMDGPUPTR(scrn); @@ -136,7 +136,7 @@ if ((info->use_glamor) == 0) return TRUE; - if (!amdgpu_bo_get_handle(priv->bo, &bo_handle)) + if (!amdgpu_bo_get_handle(bo, &bo_handle)) return FALSE; return glamor_egl_create_textured_pixmap(pixmap, bo_handle, @@ -233,7 +233,7 @@ pixmap->devPrivate.ptr = NULL; - if (!amdgpu_glamor_create_textured_pixmap(pixmap, priv)) + if (!amdgpu_glamor_create_textured_pixmap(pixmap, priv->bo)) goto fallback_glamor; } @@ -303,10 +303,9 @@ FreeScratchGC(gc); } - amdgpu_set_pixmap_private(pixmap, NULL); - /* And redirect the pixmap to the new bo (for 3D). */ glamor_egl_exchange_buffers(old, pixmap); + amdgpu_set_pixmap_private(pixmap, amdgpu_get_pixmap_private(old)); amdgpu_set_pixmap_private(old, priv); screen->ModifyPixmapHeader(old, @@ -372,7 +371,7 @@ priv = amdgpu_get_pixmap_private(pixmap); - if (!amdgpu_glamor_create_textured_pixmap(pixmap, priv)) { + if (!amdgpu_glamor_create_textured_pixmap(pixmap, priv->bo)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "Failed to get PRIME drawable for glamor pixmap.\n"); return FALSE; @@ -461,8 +460,9 @@ if (info->use_glamor) { glamor_block_handler(pScrn->pScreen); - info->gpu_flushed++; } + + info->gpu_flushed++; } void amdgpu_glamor_finish(ScrnInfoPtr pScrn) diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_glamor.h xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_glamor.h --- xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_glamor.h 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_glamor.h 2016-10-10 06:28:11.000000000 +0000 @@ -69,7 +69,7 @@ void amdgpu_glamor_finish(ScrnInfoPtr pScrn); Bool -amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_pixmap *priv); +amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_buffer *bo); void amdgpu_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst); PixmapPtr amdgpu_glamor_set_pixmap_bo(DrawablePtr drawable, PixmapPtr pixmap); diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_kms.c xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_kms.c --- xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_kms.c 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_kms.c 2016-10-10 06:28:11.000000000 +0000 @@ -39,6 +39,7 @@ #include "amdgpu_version.h" #include "shadow.h" +#include #include "amdpciids.h" @@ -50,12 +51,16 @@ #include #endif +#include + #include "amdgpu_chipinfo_gen.h" #include "amdgpu_bo_helper.h" #include "amdgpu_pixmap.h" #include +static DevScreenPrivateKeyRec amdgpu_client_private_key; + extern SymTabRec AMDGPUChipsets[]; static Bool amdgpu_setup_kernel_mem(ScreenPtr pScreen); @@ -163,8 +168,66 @@ shadowUpdatePacked(pScreen, pBuf); } +static Bool +callback_needs_flush(AMDGPUInfoPtr info, struct amdgpu_client_priv *client_priv) +{ + return (int)(client_priv->needs_flush - info->gpu_flushed) > 0; +} + +static void +amdgpu_event_callback(CallbackListPtr *list, + pointer user_data, pointer call_data) +{ + EventInfoRec *eventinfo = call_data; + ScrnInfoPtr pScrn = user_data; + ScreenPtr pScreen = pScrn->pScreen; + struct amdgpu_client_priv *client_priv = + dixLookupScreenPrivate(&eventinfo->client->devPrivates, + &amdgpu_client_private_key, pScreen); + struct amdgpu_client_priv *server_priv = + dixLookupScreenPrivate(&serverClient->devPrivates, + &amdgpu_client_private_key, pScreen); + AMDGPUInfoPtr info = AMDGPUPTR(pScrn); + int i; + + if (callback_needs_flush(info, client_priv) || + callback_needs_flush(info, server_priv)) + return; + + /* Don't let gpu_flushed get too far ahead of needs_flush, in order + * to prevent false positives in callback_needs_flush() + */ + client_priv->needs_flush = info->gpu_flushed; + server_priv->needs_flush = info->gpu_flushed; + + for (i = 0; i < eventinfo->count; i++) { + if (eventinfo->events[i].u.u.type == info->callback_event_type) { + client_priv->needs_flush++; + server_priv->needs_flush++; + return; + } + } +} + +static void +amdgpu_flush_callback(CallbackListPtr *list, + pointer user_data, pointer call_data) +{ + ScrnInfoPtr pScrn = user_data; + ScreenPtr pScreen = pScrn->pScreen; + ClientPtr client = call_data ? call_data : serverClient; + struct amdgpu_client_priv *client_priv = + dixLookupScreenPrivate(&client->devPrivates, + &amdgpu_client_private_key, pScreen); + AMDGPUInfoPtr info = AMDGPUPTR(pScrn); + + if (pScrn->vtSema && callback_needs_flush(info, client_priv)) + amdgpu_glamor_flush(pScrn); +} + static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen) { + ExtensionEntry *damage_ext = CheckExtension("DAMAGE"); ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); AMDGPUInfoPtr info = AMDGPUPTR(pScrn); PixmapPtr pixmap; @@ -208,103 +271,528 @@ if (info->dri2.enabled || info->use_glamor) { if (info->front_buffer) { PixmapPtr pPix = pScreen->GetScreenPixmap(pScreen); - amdgpu_set_pixmap_bo(pPix, info->front_buffer); + + if (!amdgpu_set_pixmap_bo(pPix, info->front_buffer)) + return FALSE; } } if (info->use_glamor) amdgpu_glamor_create_screen_resources(pScreen); + info->callback_event_type = -1; + if (damage_ext) { + info->callback_event_type = damage_ext->eventBase + XDamageNotify; + + if (!AddCallback(&FlushCallback, amdgpu_flush_callback, pScrn)) + return FALSE; + + if (!AddCallback(&EventCallback, amdgpu_event_callback, pScrn)) { + DeleteCallback(&FlushCallback, amdgpu_flush_callback, pScrn); + return FALSE; + } + + if (!dixRegisterScreenPrivateKey(&amdgpu_client_private_key, pScreen, + PRIVATE_CLIENT, sizeof(struct amdgpu_client_priv))) { + DeleteCallback(&FlushCallback, amdgpu_flush_callback, pScrn); + DeleteCallback(&EventCallback, amdgpu_event_callback, pScrn); + return FALSE; + } + } + return TRUE; } +static Bool +amdgpu_scanout_extents_intersect(xf86CrtcPtr xf86_crtc, BoxPtr extents) +{ + extents->x1 -= xf86_crtc->filter_width >> 1; + extents->x2 += xf86_crtc->filter_width >> 1; + extents->y1 -= xf86_crtc->filter_height >> 1; + extents->y2 += xf86_crtc->filter_height >> 1; + pixman_f_transform_bounds(&xf86_crtc->f_framebuffer_to_crtc, extents); + + extents->x1 = max(extents->x1, 0); + extents->y1 = max(extents->y1, 0); + extents->x2 = min(extents->x2, xf86_crtc->mode.HDisplay); + extents->y2 = min(extents->y2, xf86_crtc->mode.VDisplay); + + return (extents->x1 < extents->x2 && extents->y1 < extents->y2); +} + +static RegionPtr +transform_region(RegionPtr region, struct pict_f_transform *transform, + int w, int h) +{ + BoxPtr boxes = RegionRects(region); + int nboxes = RegionNumRects(region); + xRectanglePtr rects = malloc(nboxes * sizeof(*rects)); + RegionPtr transformed; + int nrects = 0; + BoxRec box; + int i; + + for (i = 0; i < nboxes; i++) { + box.x1 = boxes[i].x1; + box.x2 = boxes[i].x2; + box.y1 = boxes[i].y1; + box.y2 = boxes[i].y2; + pixman_f_transform_bounds(transform, &box); + + box.x1 = max(box.x1, 0); + box.y1 = max(box.y1, 0); + box.x2 = min(box.x2, w); + box.y2 = min(box.y2, h); + if (box.x1 >= box.x2 || box.y1 >= box.y2) + continue; + + rects[nrects].x = box.x1; + rects[nrects].y = box.y1; + rects[nrects].width = box.x2 - box.x1; + rects[nrects].height = box.y2 - box.y1; + nrects++; + } + + transformed = RegionFromRects(nrects, rects, CT_UNSORTED); + free(rects); + return transformed; +} + +static void +amdgpu_sync_scanout_pixmaps(xf86CrtcPtr xf86_crtc, RegionPtr new_region, + int scanout_id) +{ + drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private; + DrawablePtr dst = &drmmode_crtc->scanout[scanout_id].pixmap->drawable; + DrawablePtr src = &drmmode_crtc->scanout[scanout_id ^ 1].pixmap->drawable; + RegionPtr last_region = &drmmode_crtc->scanout_last_region; + ScrnInfoPtr scrn = xf86_crtc->scrn; + ScreenPtr pScreen = scrn->pScreen; + RegionRec remaining; + RegionPtr sync_region = NULL; + BoxRec extents; + GCPtr gc; + + if (RegionNil(last_region)) + return; + + RegionNull(&remaining); + RegionSubtract(&remaining, last_region, new_region); + if (RegionNil(&remaining)) + goto uninit; + + extents = *RegionExtents(&remaining); + if (!amdgpu_scanout_extents_intersect(xf86_crtc, &extents)) + goto uninit; + +#if XF86_CRTC_VERSION >= 4 + if (xf86_crtc->driverIsPerformingTransform) { + sync_region = transform_region(&remaining, + &xf86_crtc->f_framebuffer_to_crtc, + dst->width, dst->height); + } else +#endif /* XF86_CRTC_VERSION >= 4 */ + { + sync_region = RegionDuplicate(&remaining); + RegionTranslate(sync_region, -xf86_crtc->x, -xf86_crtc->y); + } + + gc = GetScratchGC(dst->depth, pScreen); + if (gc) { + ValidateGC(dst, gc); + gc->funcs->ChangeClip(gc, CT_REGION, sync_region, 0); + sync_region = NULL; + gc->ops->CopyArea(src, dst, gc, 0, 0, dst->width, dst->height, 0, 0); + FreeScratchGC(gc); + } + + uninit: + if (sync_region) + RegionDestroy(sync_region); + RegionUninit(&remaining); +} + #ifdef AMDGPU_PIXMAP_SHARING -static void redisplay_dirty(ScreenPtr screen, PixmapDirtyUpdatePtr dirty) + +static RegionPtr +dirty_region(PixmapDirtyUpdatePtr dirty) +{ + RegionPtr damageregion = DamageRegion(dirty->damage); + RegionPtr dstregion; + +#ifdef HAS_DIRTYTRACKING_ROTATION + if (dirty->rotation != RR_Rotate_0) { + dstregion = transform_region(damageregion, + &dirty->f_inverse, + dirty->slave_dst->drawable.width, + dirty->slave_dst->drawable.height); + } else +#endif + { + RegionRec pixregion; + + dstregion = RegionDuplicate(damageregion); + RegionTranslate(dstregion, -dirty->x, -dirty->y); + PixmapRegionInit(&pixregion, dirty->slave_dst); + RegionIntersect(dstregion, dstregion, &pixregion); + RegionUninit(&pixregion); + } + + return dstregion; +} + +static void +redisplay_dirty(PixmapDirtyUpdatePtr dirty, RegionPtr region) { - RegionRec pixregion; + ScrnInfoPtr scrn = xf86ScreenToScrn(dirty->src->drawable.pScreen); + + if (RegionNil(region)) + goto out; + + if (dirty->slave_dst->master_pixmap) + DamageRegionAppend(&dirty->slave_dst->drawable, region); - PixmapRegionInit(&pixregion, dirty->slave_dst); - DamageRegionAppend(&dirty->slave_dst->drawable, &pixregion); #ifdef HAS_DIRTYTRACKING_ROTATION PixmapSyncDirtyHelper(dirty); #else - PixmapSyncDirtyHelper(dirty, &pixregion); + PixmapSyncDirtyHelper(dirty, region); #endif - DamageRegionProcessPending(&dirty->slave_dst->drawable); - RegionUninit(&pixregion); + amdgpu_glamor_flush(scrn); + if (dirty->slave_dst->master_pixmap) + DamageRegionProcessPending(&dirty->slave_dst->drawable); + +out: + DamageEmpty(dirty->damage); } -static void amdgpu_dirty_update(ScreenPtr screen) +static void +amdgpu_prime_scanout_update_abort(xf86CrtcPtr crtc, void *event_data) { - RegionPtr region; + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + drmmode_crtc->scanout_update_pending = FALSE; +} + +void +amdgpu_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty) +{ + ScreenPtr master_screen = dirty->src->master_pixmap->drawable.pScreen; PixmapDirtyUpdatePtr ent; + RegionPtr region; - if (xorg_list_is_empty(&screen->pixmap_dirty_list)) - return; + xorg_list_for_each_entry(ent, &master_screen->pixmap_dirty_list, ent) { + if (ent->slave_dst != dirty->src) + continue; - xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) { - region = DamageRegion(ent->damage); - if (RegionNotEmpty(region)) { - redisplay_dirty(screen, ent); - DamageEmpty(ent->damage); - } + region = dirty_region(ent); + redisplay_dirty(ent, region); + RegionDestroy(region); } } -#endif + + +#if HAS_SYNC_SHARED_PIXMAP static Bool -amdgpu_scanout_extents_intersect(xf86CrtcPtr xf86_crtc, BoxPtr extents, int w, - int h) +master_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty) { - extents->x1 = max(extents->x1 - xf86_crtc->x, 0); - extents->y1 = max(extents->y1 - xf86_crtc->y, 0); + ScreenPtr master_screen = dirty->src->master_pixmap->drawable.pScreen; - switch (xf86_crtc->rotation & 0xf) { - case RR_Rotate_90: - case RR_Rotate_270: - extents->x2 = min(extents->x2 - xf86_crtc->x, h); - extents->y2 = min(extents->y2 - xf86_crtc->y, w); - break; - default: - extents->x2 = min(extents->x2 - xf86_crtc->x, w); - extents->y2 = min(extents->y2 - xf86_crtc->y, h); + return master_screen->SyncSharedPixmap != NULL; +} + +static Bool +slave_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty) +{ + ScreenPtr slave_screen = dirty->slave_dst->drawable.pScreen; + + return slave_screen->SyncSharedPixmap != NULL; +} + +static void +call_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty) +{ + ScreenPtr master_screen = dirty->src->master_pixmap->drawable.pScreen; + + master_screen->SyncSharedPixmap(dirty); +} + +#else /* !HAS_SYNC_SHARED_PIXMAP */ + +static Bool +master_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty) +{ + ScrnInfoPtr master_scrn = xf86ScreenToScrn(dirty->src->master_pixmap->drawable.pScreen); + + return master_scrn->driverName == scrn->driverName; +} + +static Bool +slave_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty) +{ + ScrnInfoPtr slave_scrn = xf86ScreenToScrn(dirty->slave_dst->drawable.pScreen); + + return slave_scrn->driverName == scrn->driverName; +} + +static void +call_sync_shared_pixmap(PixmapDirtyUpdatePtr dirty) +{ + amdgpu_sync_shared_pixmap(dirty); +} + +#endif /* HAS_SYNC_SHARED_PIXMAPS */ + + +static Bool +amdgpu_prime_scanout_do_update(xf86CrtcPtr crtc, unsigned scanout_id) +{ + ScrnInfoPtr scrn = crtc->scrn; + ScreenPtr screen = scrn->pScreen; + AMDGPUInfoPtr info = AMDGPUPTR(scrn); + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + PixmapPtr scanoutpix = crtc->randr_crtc->scanout_pixmap; + PixmapDirtyUpdatePtr dirty; + Bool ret = FALSE; + + xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list, ent) { + if (dirty->src == scanoutpix && dirty->slave_dst == + drmmode_crtc->scanout[scanout_id ^ info->tear_free].pixmap) { + RegionPtr region; + + if (master_has_sync_shared_pixmap(scrn, dirty)) + call_sync_shared_pixmap(dirty); + + region = dirty_region(dirty); + if (RegionNil(region)) + goto destroy; + + if (info->tear_free) { + RegionTranslate(region, crtc->x, crtc->y); + amdgpu_sync_scanout_pixmaps(crtc, region, scanout_id); + amdgpu_glamor_flush(scrn); + RegionCopy(&drmmode_crtc->scanout_last_region, region); + RegionTranslate(region, -crtc->x, -crtc->y); + dirty->slave_dst = drmmode_crtc->scanout[scanout_id].pixmap; + } + + redisplay_dirty(dirty, region); + ret = TRUE; + destroy: + RegionDestroy(region); + break; + } } - return (extents->x1 < extents->x2 && extents->y1 < extents->y2); + return ret; +} + +void +amdgpu_prime_scanout_update_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec, + void *event_data) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + amdgpu_prime_scanout_do_update(crtc, 0); + drmmode_crtc->scanout_update_pending = FALSE; +} + +static void +amdgpu_prime_scanout_update(PixmapDirtyUpdatePtr dirty) +{ + ScreenPtr screen = dirty->slave_dst->drawable.pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + xf86CrtcPtr xf86_crtc = NULL; + drmmode_crtc_private_ptr drmmode_crtc = NULL; + uintptr_t drm_queue_seq; + drmVBlank vbl; + int c; + + /* Find the CRTC which is scanning out from this slave pixmap */ + for (c = 0; c < xf86_config->num_crtc; c++) { + xf86_crtc = xf86_config->crtc[c]; + drmmode_crtc = xf86_crtc->driver_private; + if (drmmode_crtc->scanout[0].pixmap == dirty->slave_dst) + break; + } + + if (c == xf86_config->num_crtc || + !xf86_crtc->enabled || + drmmode_crtc->scanout_update_pending || + !drmmode_crtc->scanout[0].pixmap || + drmmode_crtc->pending_dpms_mode != DPMSModeOn) + return; + + drm_queue_seq = amdgpu_drm_queue_alloc(xf86_crtc, + AMDGPU_DRM_QUEUE_CLIENT_DEFAULT, + AMDGPU_DRM_QUEUE_ID_DEFAULT, NULL, + amdgpu_prime_scanout_update_handler, + amdgpu_prime_scanout_update_abort); + if (drm_queue_seq == AMDGPU_DRM_QUEUE_ERROR) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "amdgpu_drm_queue_alloc failed for PRIME update\n"); + return; + } + + vbl.request.type = DRM_VBLANK_RELATIVE | DRM_VBLANK_EVENT; + vbl.request.type |= amdgpu_populate_vbl_request_type(xf86_crtc); + vbl.request.sequence = 1; + vbl.request.signal = drm_queue_seq; + if (drmWaitVBlank(pAMDGPUEnt->fd, &vbl)) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "drmWaitVBlank failed for PRIME update: %s\n", + strerror(errno)); + amdgpu_drm_abort_entry(drm_queue_seq); + return; + } + + drmmode_crtc->scanout_update_pending = TRUE; +} + +static void +amdgpu_prime_scanout_flip_abort(xf86CrtcPtr crtc, void *event_data) +{ + drmmode_crtc_private_ptr drmmode_crtc = event_data; + + drmmode_crtc->scanout_update_pending = FALSE; + drmmode_clear_pending_flip(crtc); +} + +static void +amdgpu_prime_scanout_flip(PixmapDirtyUpdatePtr ent) +{ + ScreenPtr screen = ent->slave_dst->drawable.pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn); + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + xf86CrtcPtr crtc = NULL; + drmmode_crtc_private_ptr drmmode_crtc = NULL; + uintptr_t drm_queue_seq; + unsigned scanout_id; + int c; + + /* Find the CRTC which is scanning out from this slave pixmap */ + for (c = 0; c < xf86_config->num_crtc; c++) { + crtc = xf86_config->crtc[c]; + drmmode_crtc = crtc->driver_private; + scanout_id = drmmode_crtc->scanout_id; + if (drmmode_crtc->scanout[scanout_id].pixmap == ent->slave_dst) + break; + } + + if (c == xf86_config->num_crtc || + !crtc->enabled || + drmmode_crtc->scanout_update_pending || + !drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap || + drmmode_crtc->pending_dpms_mode != DPMSModeOn) + return; + + scanout_id = drmmode_crtc->scanout_id ^ 1; + if (!amdgpu_prime_scanout_do_update(crtc, scanout_id)) + return; + + drm_queue_seq = amdgpu_drm_queue_alloc(crtc, + AMDGPU_DRM_QUEUE_CLIENT_DEFAULT, + AMDGPU_DRM_QUEUE_ID_DEFAULT, + drmmode_crtc, NULL, + amdgpu_prime_scanout_flip_abort); + if (drm_queue_seq == AMDGPU_DRM_QUEUE_ERROR) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "Allocating DRM event queue entry failed for PRIME flip.\n"); + return; + } + + if (drmModePageFlip(pAMDGPUEnt->fd, drmmode_crtc->mode_crtc->crtc_id, + drmmode_crtc->scanout[scanout_id].fb_id, + DRM_MODE_PAGE_FLIP_EVENT, (void*)drm_queue_seq)) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue failed in %s: %s\n", + __func__, strerror(errno)); + return; + } + + drmmode_crtc->scanout_id = scanout_id; + drmmode_crtc->scanout_update_pending = TRUE; + drmmode_crtc->flip_pending = TRUE; } +static void +amdgpu_dirty_update(ScrnInfoPtr scrn) +{ + AMDGPUInfoPtr info = AMDGPUPTR(scrn); + ScreenPtr screen = scrn->pScreen; + PixmapDirtyUpdatePtr ent; + RegionPtr region; + + xorg_list_for_each_entry(ent, &screen->pixmap_dirty_list, ent) { + if (screen->isGPU) { + PixmapDirtyUpdatePtr region_ent = ent; + + if (master_has_sync_shared_pixmap(scrn, ent)) { + ScreenPtr master_screen = ent->src->master_pixmap->drawable.pScreen; + + xorg_list_for_each_entry(region_ent, &master_screen->pixmap_dirty_list, ent) { + if (region_ent->slave_dst == ent->src) + break; + } + } + + region = dirty_region(region_ent); + + if (RegionNotEmpty(region)) { + if (info->tear_free) + amdgpu_prime_scanout_flip(ent); + else + amdgpu_prime_scanout_update(ent); + } else { + DamageEmpty(region_ent->damage); + } + + RegionDestroy(region); + } else { + if (slave_has_sync_shared_pixmap(scrn, ent)) + continue; + + region = dirty_region(ent); + redisplay_dirty(ent, region); + RegionDestroy(region); + } + } +} +#endif + static Bool amdgpu_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id) { drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private; - DamagePtr pDamage; - RegionPtr pRegion; + RegionPtr pRegion = DamageRegion(drmmode_crtc->scanout_damage); + ScrnInfoPtr scrn = xf86_crtc->scrn; + ScreenPtr pScreen = scrn->pScreen; + AMDGPUInfoPtr info = AMDGPUPTR(scrn); DrawablePtr pDraw; - ScreenPtr pScreen; BoxRec extents; if (!xf86_crtc->enabled || - drmmode_crtc->dpms_mode != DPMSModeOn || + drmmode_crtc->pending_dpms_mode != DPMSModeOn || !drmmode_crtc->scanout[scanout_id].pixmap) return FALSE; - pDamage = drmmode_crtc->scanout[scanout_id].damage; - if (!pDamage) - return FALSE; - - pRegion = DamageRegion(pDamage); if (!RegionNotEmpty(pRegion)) return FALSE; pDraw = &drmmode_crtc->scanout[scanout_id].pixmap->drawable; - pScreen = pDraw->pScreen; extents = *RegionExtents(pRegion); - RegionEmpty(pRegion); - if (!amdgpu_scanout_extents_intersect(xf86_crtc, &extents, pDraw->width, - pDraw->height)) + if (!amdgpu_scanout_extents_intersect(xf86_crtc, &extents)) return FALSE; + if (info->tear_free) { + amdgpu_sync_scanout_pixmaps(xf86_crtc, pRegion, scanout_id); + RegionCopy(&drmmode_crtc->scanout_last_region, pRegion); + } + RegionEmpty(pRegion); + #if XF86_CRTC_VERSION >= 4 if (xf86_crtc->driverIsPerformingTransform) { SourceValidateProcPtr SourceValidate = pScreen->SourceValidate; @@ -341,12 +829,6 @@ SetPicturePictFilter(src, xf86_crtc->filter, xf86_crtc->params, xf86_crtc->nparams); - extents.x1 += xf86_crtc->x - (xf86_crtc->filter_width >> 1); - extents.x2 += xf86_crtc->x + (xf86_crtc->filter_width >> 1); - extents.y1 += xf86_crtc->y - (xf86_crtc->filter_height >> 1); - extents.y2 += xf86_crtc->y + (xf86_crtc->filter_height >> 1); - pixman_f_transform_bounds(&xf86_crtc->f_framebuffer_to_crtc, &extents); - pScreen->SourceValidate = NULL; CompositePicture(PictOpSrc, src, NULL, dst, @@ -406,16 +888,15 @@ drmVBlank vbl; DamagePtr pDamage; RegionPtr pRegion; - DrawablePtr pDraw; BoxRec extents; if (!xf86_crtc->enabled || drmmode_crtc->scanout_update_pending || !drmmode_crtc->scanout[0].pixmap || - drmmode_crtc->dpms_mode != DPMSModeOn) + drmmode_crtc->pending_dpms_mode != DPMSModeOn) return; - pDamage = drmmode_crtc->scanout[0].damage; + pDamage = drmmode_crtc->scanout_damage; if (!pDamage) return; @@ -423,11 +904,11 @@ if (!RegionNotEmpty(pRegion)) return; - pDraw = &drmmode_crtc->scanout[0].pixmap->drawable; extents = *RegionExtents(pRegion); - if (!amdgpu_scanout_extents_intersect(xf86_crtc, &extents, pDraw->width, - pDraw->height)) + if (!amdgpu_scanout_extents_intersect(xf86_crtc, &extents)) { + RegionEmpty(pRegion); return; + } scrn = xf86_crtc->scrn; drm_queue_seq = amdgpu_drm_queue_alloc(xf86_crtc, @@ -436,7 +917,7 @@ drmmode_crtc, amdgpu_scanout_update_handler, amdgpu_scanout_update_abort); - if (!drm_queue_seq) { + if (drm_queue_seq == AMDGPU_DRM_QUEUE_ERROR) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "amdgpu_drm_queue_alloc failed for scanout update\n"); return; @@ -464,7 +945,7 @@ drmmode_crtc_private_ptr drmmode_crtc = event_data; drmmode_crtc->scanout_update_pending = FALSE; - drmmode_crtc->flip_pending = FALSE; + drmmode_clear_pending_flip(crtc); } static void @@ -490,7 +971,7 @@ AMDGPU_DRM_QUEUE_ID_DEFAULT, drmmode_crtc, NULL, amdgpu_scanout_flip_abort); - if (!drm_queue_seq) { + if (drm_queue_seq == AMDGPU_DRM_QUEUE_ERROR) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Allocating DRM event queue entry failed.\n"); return; @@ -522,22 +1003,27 @@ (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS); pScreen->BlockHandler = AMDGPUBlockHandler_KMS; - for (c = 0; c < xf86_config->num_crtc; c++) { - if (info->tear_free) - amdgpu_scanout_flip(pScreen, info, xf86_config->crtc[c]); - else if (info->shadow_primary +#ifdef AMDGPU_PIXMAP_SHARING + if (!pScreen->isGPU) +#endif + { + for (c = 0; c < xf86_config->num_crtc; c++) { + if (info->tear_free) + amdgpu_scanout_flip(pScreen, info, xf86_config->crtc[c]); + else if (info->shadow_primary #if XF86_CRTC_VERSION >= 4 - || xf86_config->crtc[c]->driverIsPerformingTransform + || xf86_config->crtc[c]->driverIsPerformingTransform #endif - ) - amdgpu_scanout_update(xf86_config->crtc[c]); + ) + amdgpu_scanout_update(xf86_config->crtc[c]); + } } if (info->use_glamor) amdgpu_glamor_flush(pScrn); #ifdef AMDGPU_PIXMAP_SHARING - amdgpu_dirty_update(pScreen); + amdgpu_dirty_update(pScrn); #endif } @@ -552,17 +1038,6 @@ drmmode_set_desired_modes(pScrn, &info->drmmode, TRUE); } -static void -amdgpu_flush_callback(CallbackListPtr * list, - pointer user_data, pointer call_data) -{ - ScrnInfoPtr pScrn = user_data; - - if (pScrn->vtSema) { - amdgpu_glamor_flush(pScrn); - } -} - /* This is called by AMDGPUPreInit to set up the default visual */ static Bool AMDGPUPreInitVisual(ScrnInfoPtr pScrn) { @@ -1118,7 +1593,10 @@ drmmode_uevent_fini(pScrn, &info->drmmode); amdgpu_drm_queue_close(pScrn); - DeleteCallback(&FlushCallback, amdgpu_flush_callback, pScrn); + if (info->callback_event_type != -1) { + DeleteCallback(&EventCallback, amdgpu_event_callback, pScrn); + DeleteCallback(&FlushCallback, amdgpu_flush_callback, pScrn); + } amdgpu_sync_close(pScreen); amdgpu_drop_drm_master(pScrn); @@ -1239,7 +1717,11 @@ } #endif +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,18,3,0,0) + value = TRUE; +#else value = FALSE; +#endif from = X_DEFAULT; if (info->use_glamor) { @@ -1353,15 +1835,15 @@ info->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = AMDGPUBlockHandler_oneshot; - if (!AddCallback(&FlushCallback, amdgpu_flush_callback, pScrn)) - return FALSE; - info->CreateScreenResources = pScreen->CreateScreenResources; pScreen->CreateScreenResources = AMDGPUCreateScreenResources_KMS; #ifdef AMDGPU_PIXMAP_SHARING pScreen->StartPixmapTracking = PixmapStartDirtyTracking; pScreen->StopPixmapTracking = PixmapStopDirtyTracking; +#if HAS_SYNC_SHARED_PIXMAP + pScreen->SyncSharedPixmap = amdgpu_sync_shared_pixmap; +#endif #endif if (!xf86CrtcScreenInit(pScreen)) diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_pixmap.h xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_pixmap.h --- xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_pixmap.h 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_pixmap.h 2016-10-10 06:28:11.000000000 +0000 @@ -54,19 +54,19 @@ dixSetPrivate(&pixmap->devPrivates, &amdgpu_pixmap_index, priv); } -static inline void amdgpu_set_pixmap_bo(PixmapPtr pPix, struct amdgpu_buffer *bo) +static inline Bool amdgpu_set_pixmap_bo(PixmapPtr pPix, struct amdgpu_buffer *bo) { struct amdgpu_pixmap *priv; priv = amdgpu_get_pixmap_private(pPix); if (priv == NULL && bo == NULL) - return; + return TRUE; if (priv) { - if (priv->bo == bo) - return; - if (priv->bo) { + if (priv->bo == bo) + return TRUE; + amdgpu_bo_unref(&priv->bo); priv->handle_valid = FALSE; } @@ -81,13 +81,14 @@ if (!priv) { priv = calloc(1, sizeof(struct amdgpu_pixmap)); if (!priv) - goto out; + return FALSE; } amdgpu_bo_ref(bo); priv->bo = bo; } -out: + amdgpu_set_pixmap_private(pPix, priv); + return TRUE; } static inline struct amdgpu_buffer *amdgpu_get_pixmap_bo(PixmapPtr pPix) diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_present.c xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_present.c --- xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_present.c 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_present.c 2016-10-10 06:28:11.000000000 +0000 @@ -170,7 +170,7 @@ event_id, event, amdgpu_present_vblank_handler, amdgpu_present_vblank_abort); - if (!drm_queue_seq) { + if (drm_queue_seq == AMDGPU_DRM_QUEUE_ERROR) { free(event); return BadAlloc; } @@ -211,15 +211,13 @@ } /* - * Test to see if page flipping is possible on the target crtc + * Test to see if unflipping is possible + * + * These tests have to pass for flips as well */ static Bool -amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, - Bool sync_flip) +amdgpu_present_check_unflip(ScrnInfoPtr scrn) { - ScreenPtr screen = window->drawable.pScreen; - ScrnInfoPtr scrn = xf86ScreenToScrn(screen); - AMDGPUInfoPtr info = AMDGPUPTR(scrn); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int num_crtcs_on; int i; @@ -227,28 +225,17 @@ if (!scrn->vtSema) return FALSE; - if (!info->allowPageFlip) - return FALSE; - - if (info->hwcursor_disabled) - return FALSE; - - if (!sync_flip) - return FALSE; - - if (info->drmmode.dri2_flipping) - return FALSE; - for (i = 0, num_crtcs_on = 0; i < config->num_crtc; i++) { drmmode_crtc_private_ptr drmmode_crtc = config->crtc[i]->driver_private; if (!config->crtc[i]->enabled) continue; - if (!drmmode_crtc || drmmode_crtc->rotate.bo != NULL) + if (!drmmode_crtc || drmmode_crtc->rotate.bo || + drmmode_crtc->scanout[0].bo) return FALSE; - if (drmmode_crtc->dpms_mode == DPMSModeOn) + if (drmmode_crtc->pending_dpms_mode == DPMSModeOn) num_crtcs_on++; } @@ -256,6 +243,29 @@ } /* + * Test to see if page flipping is possible on the target crtc + */ +static Bool +amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, + Bool sync_flip) +{ + ScreenPtr screen = window->drawable.pScreen; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + AMDGPUInfoPtr info = AMDGPUPTR(scrn); + + if (!info->allowPageFlip) + return FALSE; + + if (info->hwcursor_disabled) + return FALSE; + + if (info->drmmode.dri2_flipping) + return FALSE; + + return amdgpu_present_check_unflip(scrn); +} + +/* * Once the flip has been completed on all CRTCs, notify the * extension code telling it when that happened */ @@ -311,7 +321,8 @@ ret = amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT, pixmap, event_id, event, crtc_id, amdgpu_present_flip_event, - amdgpu_present_flip_abort); + amdgpu_present_flip_abort, + sync_flip ? FLIP_VSYNC : FLIP_ASYNC); if (!ret) xf86DrvMsg(scrn->scrnIndex, X_ERROR, "present flip failed\n"); else @@ -334,7 +345,7 @@ PixmapPtr pixmap = screen->GetScreenPixmap(screen); int i; - if (!amdgpu_present_check_flip(NULL, screen->root, pixmap, TRUE)) + if (!amdgpu_present_check_unflip(scrn)) goto modeset; event = calloc(1, sizeof(struct amdgpu_present_vblank_event)); @@ -348,7 +359,7 @@ if (amdgpu_do_pageflip(scrn, AMDGPU_DRM_QUEUE_CLIENT_DEFAULT, pixmap, event_id, event, -1, amdgpu_present_flip_event, - amdgpu_present_flip_abort)) + amdgpu_present_flip_abort, FLIP_VSYNC)) return; modeset: @@ -365,7 +376,7 @@ if (!crtc->enabled) continue; - if (drmmode_crtc->dpms_mode == DPMSModeOn) + if (drmmode_crtc->pending_dpms_mode == DPMSModeOn) crtc->funcs->set_mode_major(crtc, &crtc->mode, crtc->rotation, crtc->x, crtc->y); else diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_probe.c xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_probe.c --- xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_probe.c 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_probe.c 2016-10-10 06:28:11.000000000 +0000 @@ -77,7 +77,7 @@ static void AMDGPUIdentify(int flags) { xf86PrintChipsets(AMDGPU_NAME, - "Driver for AMD Radeon chipsets", AMDGPUChipsets); + "Driver for AMD Radeon chipsets", AMDGPUUniqueChipsets); } static char *amdgpu_bus_id(ScrnInfoPtr pScrn, struct pci_device *dev) diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_video.c xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_video.c --- xserver-xorg-video-amdgpu-1.1.2/src/amdgpu_video.c 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/amdgpu_video.c 2016-10-10 06:28:11.000000000 +0000 @@ -67,7 +67,7 @@ Bool amdgpu_crtc_is_enabled(xf86CrtcPtr crtc) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - return drmmode_crtc->dpms_mode == DPMSModeOn; + return drmmode_crtc->pending_dpms_mode == DPMSModeOn; } xf86CrtcPtr diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/compat-api.h xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/compat-api.h --- xserver-xorg-video-amdgpu-1.1.2/src/compat-api.h 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/compat-api.h 2016-10-10 06:28:11.000000000 +0000 @@ -73,8 +73,17 @@ #define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv +#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(22,0) +#define HAVE_NOTIFY_FD 1 +#endif + +#if ABI_VIDEODRV_VERSION >= SET_ABI_VERSION(23, 0) +#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout +#define BLOCKHANDLER_ARGS arg, pTimeout +#else #define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask #define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask +#endif #define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen #define CLOSE_SCREEN_ARGS pScreen diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/drmmode_display.c xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/drmmode_display.c --- xserver-xorg-video-amdgpu-1.1.2/src/drmmode_display.c 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/drmmode_display.c 2016-10-10 06:28:11.000000000 +0000 @@ -111,19 +111,18 @@ return NULL; if (!(*pScreen->ModifyPixmapHeader) (pixmap, width, height, - depth, bpp, pitch, NULL)) { - return NULL; - } + depth, bpp, pitch, NULL)) + goto fail; - amdgpu_set_pixmap_bo(pixmap, bo); + if (!amdgpu_glamor_create_textured_pixmap(pixmap, bo)) + goto fail; - if (!amdgpu_glamor_create_textured_pixmap(pixmap, - amdgpu_get_pixmap_private(pixmap))) { - pScreen->DestroyPixmap(pixmap); - return NULL; - } + if (amdgpu_set_pixmap_bo(pixmap, bo)) + return pixmap; - return pixmap; +fail: + pScreen->DestroyPixmap(pixmap); + return NULL; } static void drmmode_destroy_bo_pixmap(PixmapPtr pixmap) @@ -250,9 +249,15 @@ CARD64 ust; int ret; + drmmode_crtc->pending_dpms_mode = mode; + if (drmmode_crtc->dpms_mode == DPMSModeOn && mode != DPMSModeOn) { drmVBlank vbl; + /* Wait for any pending flip to finish */ + if (drmmode_crtc->flip_pending) + return; + /* * On->Off transition: record the last vblank time, * sequence number and frame period. @@ -310,10 +315,14 @@ AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(crtc->scrn); /* Disable unused CRTCs and enable/disable active CRTCs */ - if (!crtc->enabled || mode != DPMSModeOn) + if (!crtc->enabled || mode != DPMSModeOn) { + /* Wait for any pending flip to finish */ + if (drmmode_crtc->flip_pending) + return; + drmModeSetCrtc(pAMDGPUEnt->fd, drmmode_crtc->mode_crtc->crtc_id, 0, 0, 0, NULL, 0, NULL); - else if (drmmode_crtc->dpms_mode != DPMSModeOn) + } else if (drmmode_crtc->dpms_mode != DPMSModeOn) crtc->funcs->set_mode_major(crtc, &crtc->mode, crtc->rotation, crtc->x, crtc->y); } @@ -453,10 +462,29 @@ amdgpu_bo_unref(&scanout->bo); scanout->bo = NULL; } +} - if (scanout->damage) { - DamageDestroy(scanout->damage); - scanout->damage = NULL; +static void +drmmode_crtc_scanout_free(drmmode_crtc_private_ptr drmmode_crtc) +{ + if (drmmode_crtc->flip_pending) { + drmmode_crtc->scanout_destroy[0] = drmmode_crtc->scanout[0]; + drmmode_crtc->scanout[0].pixmap = NULL; + drmmode_crtc->scanout[0].bo = NULL; + drmmode_crtc->scanout_destroy[1] = drmmode_crtc->scanout[1]; + drmmode_crtc->scanout[1].pixmap = NULL; + drmmode_crtc->scanout[1].bo = NULL; + } else { + drmmode_crtc_scanout_destroy(drmmode_crtc->drmmode, + &drmmode_crtc->scanout[0]); + drmmode_crtc_scanout_destroy(drmmode_crtc->drmmode, + &drmmode_crtc->scanout[1]); + } + + if (drmmode_crtc->scanout_damage) { + DamageDestroy(drmmode_crtc->scanout_damage); + drmmode_crtc->scanout_damage = NULL; + RegionUninit(&drmmode_crtc->scanout_last_region); } } @@ -466,15 +494,8 @@ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; - for (c = 0; c < xf86_config->num_crtc; c++) { - drmmode_crtc_private_ptr drmmode_crtc = - xf86_config->crtc[c]->driver_private; - - drmmode_crtc_scanout_destroy(drmmode_crtc->drmmode, - &drmmode_crtc->scanout[0]); - drmmode_crtc_scanout_destroy(drmmode_crtc->drmmode, - &drmmode_crtc->scanout[1]); - } + for (c = 0; c < xf86_config->num_crtc; c++) + drmmode_crtc_scanout_free(xf86_config->crtc[c]->driver_private); } static void * @@ -581,7 +602,7 @@ if (crtc->transformPresent) return FALSE; -#if XF86_CRTC_VERSION >= 4 +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7 /* Xorg doesn't correctly handle cursor position transform in the * rotation case */ @@ -604,11 +625,19 @@ static Bool drmmode_handle_transform(xf86CrtcPtr crtc) { - AMDGPUInfoPtr info = AMDGPUPTR(crtc->scrn); Bool ret; - crtc->driverIsPerformingTransform = info->tear_free && - !crtc->transformPresent && crtc->rotation != RR_Rotate_0; +#if XF86_CRTC_VERSION >= 7 + if (crtc->transformPresent || crtc->rotation != RR_Rotate_0) + crtc->driverIsPerformingTransform = XF86DriverTransformOutput; + else + crtc->driverIsPerformingTransform = XF86DriverTransformNone; +#else + AMDGPUInfoPtr info = AMDGPUPTR(crtc->scrn); + + crtc->driverIsPerformingTransform = crtc->transformPresent || + (info->tear_free && crtc->rotation != RR_Rotate_0); +#endif ret = xf86CrtcRotate(crtc); @@ -643,30 +672,12 @@ DisplayModeRec saved_mode; uint32_t *output_ids = NULL; int output_count = 0; - Bool ret = TRUE; + Bool ret = FALSE; int i; int fb_id; drmModeModeInfo kmode; uint32_t bo_handle; - if (drmmode->fb_id == 0) { - if (!amdgpu_bo_get_handle(info->front_buffer, &bo_handle)) { - ErrorF("failed to get BO handle for FB\n"); - return FALSE; - } - - ret = drmModeAddFB(pAMDGPUEnt->fd, - pScrn->virtualX, - pScrn->virtualY, - pScrn->depth, pScrn->bitsPerPixel, - pScrn->displayWidth * info->pixel_bytes, - bo_handle, &drmmode->fb_id); - if (ret < 0) { - ErrorF("failed to add fb\n"); - return FALSE; - } - } - saved_mode = crtc->mode; saved_x = crtc->x; saved_y = crtc->y; @@ -679,10 +690,8 @@ crtc->rotation = rotation; output_ids = calloc(sizeof(uint32_t), xf86_config->num_output); - if (!output_ids) { - ret = FALSE; + if (!output_ids) goto done; - } for (i = 0; i < xf86_config->num_output; i++) { xf86OutputPtr output = xf86_config->output[i]; @@ -708,65 +717,52 @@ fb_id = drmmode->fb_id; #ifdef AMDGPU_PIXMAP_SHARING if (crtc->randr_crtc && crtc->randr_crtc->scanout_pixmap) { - x = drmmode_crtc->prime_pixmap_x; - y = 0; - - drmmode_crtc_scanout_destroy(drmmode, &drmmode_crtc->scanout[0]); - drmmode_crtc_scanout_destroy(drmmode, &drmmode_crtc->scanout[1]); + fb_id = drmmode_crtc->scanout[0].fb_id; + x = y = 0; } else #endif if (drmmode_crtc->rotate.fb_id) { fb_id = drmmode_crtc->rotate.fb_id; x = y = 0; - - drmmode_crtc_scanout_destroy(drmmode, &drmmode_crtc->scanout[0]); - drmmode_crtc_scanout_destroy(drmmode, &drmmode_crtc->scanout[1]); - } else if (info->tear_free || + } else if ( +#ifdef AMDGPU_PIXMAP_SHARING + !pScreen->isGPU && +#endif + (info->tear_free || #if XF86_CRTC_VERSION >= 4 - crtc->driverIsPerformingTransform || + crtc->driverIsPerformingTransform || #endif - info->shadow_primary) { + info->shadow_primary)) { for (i = 0; i < (info->tear_free ? 2 : 1); i++) { drmmode_crtc_scanout_create(crtc, &drmmode_crtc->scanout[i], mode->HDisplay, mode->VDisplay); - - if (drmmode_crtc->scanout[i].pixmap) { - RegionPtr pRegion; - BoxPtr pBox; - - if (!drmmode_crtc->scanout[i].damage) { - drmmode_crtc->scanout[i].damage = - DamageCreate(amdgpu_screen_damage_report, - NULL, DamageReportRawRegion, - TRUE, pScreen, NULL); - DamageRegister(&pScreen->GetScreenPixmap(pScreen)->drawable, - drmmode_crtc->scanout[i].damage); - } - - pRegion = DamageRegion(drmmode_crtc->scanout[i].damage); - RegionUninit(pRegion); - pRegion->data = NULL; - pBox = RegionExtents(pRegion); - pBox->x1 = min(pBox->x1, x); - pBox->y1 = min(pBox->y1, y); - - switch (crtc->rotation & 0xf) { - case RR_Rotate_90: - case RR_Rotate_270: - pBox->x2 = max(pBox->x2, x + mode->VDisplay); - pBox->y2 = max(pBox->y2, y + mode->HDisplay); - break; - default: - pBox->x2 = max(pBox->x2, x + mode->HDisplay); - pBox->y2 = max(pBox->y2, y + mode->VDisplay); - } - } } if (drmmode_crtc->scanout[0].pixmap && (!info->tear_free || drmmode_crtc->scanout[1].pixmap)) { + RegionPtr pRegion; + BoxPtr pBox; + + if (!drmmode_crtc->scanout_damage) { + drmmode_crtc->scanout_damage = + DamageCreate(amdgpu_screen_damage_report, + NULL, DamageReportRawRegion, + TRUE, pScreen, NULL); + DamageRegister(&pScreen->GetScreenPixmap(pScreen)->drawable, + drmmode_crtc->scanout_damage); + } + + pRegion = DamageRegion(drmmode_crtc->scanout_damage); + RegionUninit(pRegion); + pRegion->data = NULL; + pBox = RegionExtents(pRegion); + pBox->x1 = 0; + pBox->y1 = 0; + pBox->x2 = max(pBox->x2, pScrn->virtualX); + pBox->y2 = max(pBox->y2, pScrn->virtualY); + drmmode_crtc->scanout_id = 0; fb_id = drmmode_crtc->scanout[0].fb_id; x = y = 0; @@ -776,6 +772,25 @@ } } + if (fb_id == 0) { + if (!amdgpu_bo_get_handle(info->front_buffer, &bo_handle)) { + ErrorF("failed to get BO handle for FB\n"); + goto done; + } + + if (drmModeAddFB(pAMDGPUEnt->fd, + pScrn->virtualX, + pScrn->virtualY, + pScrn->depth, pScrn->bitsPerPixel, + pScrn->displayWidth * info->pixel_bytes, + bo_handle, &drmmode->fb_id) < 0) { + ErrorF("failed to add fb\n"); + goto done; + } + + fb_id = drmmode->fb_id; + } + /* Wait for any pending flip to finish */ do {} while (drmmode_crtc->flip_pending && drmHandleEvent(pAMDGPUEnt->fd, @@ -787,7 +802,6 @@ output_count, &kmode) != 0) { xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, "failed to set mode: %s\n", strerror(errno)); - ret = FALSE; goto done; } else ret = TRUE; @@ -833,9 +847,13 @@ crtc->y = saved_y; crtc->rotation = saved_rotation; crtc->mode = saved_mode; - } else + } else { crtc->active = TRUE; + if (fb_id != drmmode_crtc->scanout[0].fb_id) + drmmode_crtc_scanout_free(drmmode_crtc); + } + return ret; } @@ -849,7 +867,7 @@ drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(crtc->scrn); -#if XF86_CRTC_VERSION >= 4 +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7 if (crtc->driverIsPerformingTransform) { x += crtc->x; y += crtc->y; @@ -860,7 +878,7 @@ drmModeMoveCursor(pAMDGPUEnt->fd, drmmode_crtc->mode_crtc->crtc_id, x, y); } -#if XF86_CRTC_VERSION >= 4 +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7 static int drmmode_cursor_src_offset(Rotation rotation, int width, int height, @@ -900,7 +918,7 @@ ScrnInfoPtr pScrn = crtc->scrn; AMDGPUInfoPtr info = AMDGPUPTR(pScrn); -#if XF86_CRTC_VERSION >= 4 +#if XF86_CRTC_VERSION >= 4 && XF86_CRTC_VERSION < 7 if (crtc->driverIsPerformingTransform) { uint32_t cursor_w = info->cursor_w, cursor_h = info->cursor_h; int dstx, dsty; @@ -990,13 +1008,43 @@ if (use_set_cursor2) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); CursorPtr cursor = xf86_config->cursor; + int xhot = cursor->bits->xhot; + int yhot = cursor->bits->yhot; int ret; + if (crtc->rotation != RR_Rotate_0 && + crtc->rotation != (RR_Rotate_180 | RR_Reflect_X | + RR_Reflect_Y)) { + int t; + + /* Reflect & rotate hotspot position */ + if (crtc->rotation & RR_Reflect_X) + xhot = info->cursor_w - xhot - 1; + if (crtc->rotation & RR_Reflect_Y) + yhot = info->cursor_h - yhot - 1; + + switch (crtc->rotation & 0xf) { + case RR_Rotate_90: + t = xhot; + xhot = yhot; + yhot = info->cursor_w - t - 1; + break; + case RR_Rotate_180: + xhot = info->cursor_w - xhot - 1; + yhot = info->cursor_h - yhot - 1; + break; + case RR_Rotate_270: + t = xhot; + xhot = info->cursor_h - yhot - 1; + yhot = t; + } + } + ret = drmModeSetCursor2(pAMDGPUEnt->fd, drmmode_crtc->mode_crtc->crtc_id, bo_handle, info->cursor_w, info->cursor_h, - cursor->bits->xhot, cursor->bits->yhot); + xhot, yhot); if (ret == -EINVAL) use_set_cursor2 = FALSE; else @@ -1052,66 +1100,38 @@ #ifdef AMDGPU_PIXMAP_SHARING static Bool drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) { - ScreenPtr screen = xf86ScrnToScreen(crtc->scrn); - PixmapPtr screenpix = screen->GetScreenPixmap(screen); - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - int c, total_width = 0, max_height = 0, this_x = 0; + AMDGPUInfoPtr info = AMDGPUPTR(crtc->scrn); if (!ppix) { if (crtc->randr_crtc->scanout_pixmap) - PixmapStopDirtyTracking(crtc-> - randr_crtc->scanout_pixmap, - screenpix); - drmmode_crtc->prime_pixmap_x = 0; + PixmapStopDirtyTracking(crtc->randr_crtc->scanout_pixmap, + drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap); + drmmode_crtc_scanout_free(drmmode_crtc); return TRUE; } - /* iterate over all the attached crtcs - - work out bounding box */ - for (c = 0; c < xf86_config->num_crtc; c++) { - xf86CrtcPtr iter = xf86_config->crtc[c]; - if (!iter->enabled && iter != crtc) - continue; - if (iter == crtc) { - this_x = total_width; - total_width += ppix->drawable.width; - if (max_height < ppix->drawable.height) - max_height = ppix->drawable.height; - } else { - total_width += iter->mode.HDisplay; - if (max_height < iter->mode.VDisplay) - max_height = iter->mode.VDisplay; - } -#if !defined(HAS_DIRTYTRACKING_ROTATION) && !defined(HAS_DIRTYTRACKING2) - if (iter != crtc) { - ErrorF - ("Cannot do multiple crtcs without X server dirty tracking 2 interface\n"); - return FALSE; - } -#endif - } - - if (total_width != screenpix->drawable.width || - max_height != screenpix->drawable.height) { - Bool ret; - ret = - drmmode_xf86crtc_resize(crtc->scrn, total_width, - max_height); - if (ret == FALSE) - return FALSE; + if (!drmmode_crtc_scanout_create(crtc, &drmmode_crtc->scanout[0], + ppix->drawable.width, + ppix->drawable.height)) + return FALSE; - screenpix = screen->GetScreenPixmap(screen); - screen->width = screenpix->drawable.width = total_width; - screen->height = screenpix->drawable.height = max_height; + if (info->tear_free && + !drmmode_crtc_scanout_create(crtc, &drmmode_crtc->scanout[1], + ppix->drawable.width, + ppix->drawable.height)) { + drmmode_crtc_scanout_free(drmmode_crtc); + return FALSE; } - drmmode_crtc->prime_pixmap_x = this_x; + #ifdef HAS_DIRTYTRACKING_ROTATION - PixmapStartDirtyTracking(ppix, screenpix, 0, 0, this_x, 0, RR_Rotate_0); + PixmapStartDirtyTracking(ppix, drmmode_crtc->scanout[0].pixmap, + 0, 0, 0, 0, RR_Rotate_0); #elif defined(HAS_DIRTYTRACKING2) - PixmapStartDirtyTracking2(ppix, screenpix, 0, 0, this_x, 0); + PixmapStartDirtyTracking2(ppix, drmmode_crtc->scanout[0].pixmap, + 0, 0, 0, 0); #else - PixmapStartDirtyTracking(ppix, screenpix, 0, 0); + PixmapStartDirtyTracking(ppix, drmmode_crtc->scanout[0].pixmap, 0, 0); #endif return TRUE; } @@ -1175,6 +1195,7 @@ drmModeGetCrtc(pAMDGPUEnt->fd, mode_res->crtcs[num]); drmmode_crtc->drmmode = drmmode; drmmode_crtc->dpms_mode = DPMSModeOff; + drmmode_crtc->pending_dpms_mode = DPMSModeOff; crtc->driver_private = drmmode_crtc; drmmode_crtc_hw_id(crtc); @@ -1302,9 +1323,16 @@ if (!koutput) return; - if (mode != DPMSModeOn && crtc) + if (mode != DPMSModeOn && crtc) { + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + drmmode_do_crtc_dpms(crtc, mode); + /* Wait for any pending flip to finish */ + if (drmmode_crtc->flip_pending) + return; + } + drmModeConnectorSetProperty(pAMDGPUEnt->fd, koutput->connector_id, drmmode_output->dpms_enum_id, mode); @@ -1886,7 +1914,6 @@ int i, pitch, old_width, old_height, old_pitch; int cpp = info->pixel_bytes; PixmapPtr ppix = screen->GetScreenPixmap(screen); - uint32_t bo_handle; void *fb_shadow; int hint = 0; xRectangle rect; @@ -1907,6 +1934,7 @@ old_height = scrn->virtualY; old_pitch = scrn->displayWidth; old_fb_id = drmmode->fb_id; + drmmode->fb_id = 0; old_front = info->front_buffer; scrn->virtualX = width; @@ -1931,23 +1959,8 @@ xf86DrvMsg(scrn->scrnIndex, X_INFO, " => pitch %d bytes\n", pitch); scrn->displayWidth = pitch / cpp; - if (!amdgpu_bo_get_handle(info->front_buffer, &bo_handle)) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "Failed to get front buffer handle\n"); - goto fail; - } - - if (drmModeAddFB(pAMDGPUEnt->fd, width, height, scrn->depth, - scrn->bitsPerPixel, pitch, - bo_handle, &drmmode->fb_id) != 0) { - xf86DrvMsg(scrn->scrnIndex, X_ERROR, - "drmModeAddFB failed for front buffer\n"); - goto fail; - } - if (info->use_glamor || (info->front_buffer->flags & AMDGPU_BO_FLAGS_GBM)) { - amdgpu_set_pixmap_bo(ppix, info->front_buffer); screen->ModifyPixmapHeader(ppix, width, height, -1, -1, pitch, info->front_buffer->cpu_ptr); } else { @@ -1964,8 +1977,14 @@ scrn->pixmapPrivate.ptr = ppix->devPrivate.ptr; #endif - if (info->use_glamor) - amdgpu_glamor_create_screen_resources(scrn->pScreen); + if (!amdgpu_glamor_create_screen_resources(scrn->pScreen)) + goto fail; + + if (info->use_glamor || + (info->front_buffer->flags & AMDGPU_BO_FLAGS_GBM)) { + if (!amdgpu_set_pixmap_bo(ppix, info->front_buffer)) + goto fail; + } /* Clear new buffer */ gc = GetScratchGC(ppix->drawable.depth, scrn->pScreen); @@ -2015,26 +2034,55 @@ drmmode_xf86crtc_resize }; +void +drmmode_clear_pending_flip(xf86CrtcPtr crtc) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + drmmode_crtc->flip_pending = FALSE; + + if (!crtc->enabled || + (drmmode_crtc->pending_dpms_mode != DPMSModeOn && + drmmode_crtc->dpms_mode != drmmode_crtc->pending_dpms_mode)) { + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + int o; + + for (o = 0; o < xf86_config->num_output; o++) { + xf86OutputPtr output = xf86_config->output[o]; + + if (output->crtc != crtc) + continue; + + drmmode_output_dpms(output, drmmode_crtc->pending_dpms_mode); + } + + drmmode_crtc_dpms(crtc, drmmode_crtc->pending_dpms_mode); + } + + drmmode_crtc_scanout_destroy(drmmode_crtc->drmmode, + &drmmode_crtc->scanout_destroy[0]); + drmmode_crtc_scanout_destroy(drmmode_crtc->drmmode, + &drmmode_crtc->scanout_destroy[1]); +} + static void drmmode_flip_abort(xf86CrtcPtr crtc, void *event_data) { - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_flipdata_ptr flipdata = event_data; if (--flipdata->flip_count == 0) { - if (flipdata->fe_crtc) - crtc = flipdata->fe_crtc; - flipdata->abort(crtc, flipdata->event_data); + if (!flipdata->fe_crtc) + flipdata->fe_crtc = crtc; + flipdata->abort(flipdata->fe_crtc, flipdata->event_data); free(flipdata); } - drmmode_crtc->flip_pending = FALSE; + drmmode_clear_pending_flip(crtc); } static void drmmode_flip_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec, void *event_data) { - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(crtc->scrn); drmmode_flipdata_ptr flipdata = event_data; @@ -2046,11 +2094,14 @@ } if (--flipdata->flip_count == 0) { - /* Deliver cached msc, ust from reference crtc to flip event handler */ + /* Deliver MSC & UST from reference/current CRTC to flip event + * handler + */ if (flipdata->fe_crtc) - crtc = flipdata->fe_crtc; - flipdata->handler(crtc, flipdata->fe_frame, flipdata->fe_usec, - flipdata->event_data); + flipdata->handler(flipdata->fe_crtc, flipdata->fe_frame, + flipdata->fe_usec, flipdata->event_data); + else + flipdata->handler(crtc, frame, usec, flipdata->event_data); /* Release framebuffer */ drmModeRmFB(pAMDGPUEnt->fd, flipdata->old_fb_id); @@ -2058,9 +2109,16 @@ free(flipdata); } - drmmode_crtc->flip_pending = FALSE; + drmmode_clear_pending_flip(crtc); } +#if HAVE_NOTIFY_FD +static void drmmode_notify_fd(int fd, int notify, void *data) +{ + drmmode_ptr drmmode = data; + drmHandleEvent(fd, &drmmode->event_context); +} +#else static void drm_wakeup_handler(pointer data, int err, pointer p) { drmmode_ptr drmmode = data; @@ -2071,6 +2129,7 @@ drmHandleEvent(pAMDGPUEnt->fd, &drmmode->event_context); } } +#endif Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp) { @@ -2149,9 +2208,13 @@ info->drmmode_inited = TRUE; if (pAMDGPUEnt->fd_wakeup_registered != serverGeneration) { +#if HAVE_NOTIFY_FD + SetNotifyFd(pAMDGPUEnt->fd, drmmode_notify_fd, X_NOTIFY_READ, drmmode); +#else AddGeneralSocket(pAMDGPUEnt->fd); RegisterBlockAndWakeupHandlers((BlockHandlerProcPtr) NoopDDA, drm_wakeup_handler, drmmode); +#endif pAMDGPUEnt->fd_wakeup_registered = serverGeneration; pAMDGPUEnt->fd_wakeup_ref = 1; } else @@ -2170,9 +2233,13 @@ if (pAMDGPUEnt->fd_wakeup_registered == serverGeneration && !--pAMDGPUEnt->fd_wakeup_ref) { +#if HAVE_NOTIFY_FD + RemoveNotifyFd(pAMDGPUEnt->fd); +#else RemoveGeneralSocket(pAMDGPUEnt->fd); RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr) NoopDDA, drm_wakeup_handler, drmmode); +#endif } for (c = 0; c < config->num_crtc; c++) { @@ -2275,75 +2342,6 @@ return TRUE; } -static void drmmode_load_palette(ScrnInfoPtr pScrn, int numColors, - int *indices, LOCO * colors, VisualPtr pVisual) -{ - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - uint16_t lut_r[256], lut_g[256], lut_b[256]; - int index, j, i; - int c; - - for (c = 0; c < xf86_config->num_crtc; c++) { - xf86CrtcPtr crtc = xf86_config->crtc[c]; - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - - for (i = 0; i < 256; i++) { - lut_r[i] = drmmode_crtc->lut_r[i] << 6; - lut_g[i] = drmmode_crtc->lut_g[i] << 6; - lut_b[i] = drmmode_crtc->lut_b[i] << 6; - } - - switch (pScrn->depth) { - case 15: - for (i = 0; i < numColors; i++) { - index = indices[i]; - for (j = 0; j < 8; j++) { - lut_r[index * 8 + j] = - colors[index].red << 6; - lut_g[index * 8 + j] = - colors[index].green << 6; - lut_b[index * 8 + j] = - colors[index].blue << 6; - } - } - break; - case 16: - for (i = 0; i < numColors; i++) { - index = indices[i]; - - if (i <= 31) { - for (j = 0; j < 8; j++) { - lut_r[index * 8 + j] = - colors[index].red << 6; - lut_b[index * 8 + j] = - colors[index].blue << 6; - } - } - - for (j = 0; j < 4; j++) { - lut_g[index * 4 + j] = - colors[index].green << 6; - } - } - break; - default: - for (i = 0; i < numColors; i++) { - index = indices[i]; - lut_r[index] = colors[index].red << 6; - lut_g[index] = colors[index].green << 6; - lut_b[index] = colors[index].blue << 6; - } - break; - } - - /* Make the change through RandR */ - if (crtc->randr_crtc) - RRCrtcGammaSet(crtc->randr_crtc, lut_r, lut_g, lut_b); - else - crtc->funcs->gamma_set(crtc, lut_r, lut_g, lut_b, 256); - } -} - Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); @@ -2355,7 +2353,7 @@ return FALSE; /* all amdgpus support 10 bit CLUTs */ if (!xf86HandleColormaps(pScreen, 256, 10, - drmmode_load_palette, NULL, + NULL, NULL, CMAP_PALETTED_TRUECOLOR #if 0 /* This option messes up text mode! (eich@suse.de) */ | CMAP_LOAD_EVEN_IF_OFFSCREEN @@ -2530,7 +2528,8 @@ Bool amdgpu_do_pageflip(ScrnInfoPtr scrn, ClientPtr client, PixmapPtr new_front, uint64_t id, void *data, int ref_crtc_hw_id, amdgpu_drm_handler_proc handler, - amdgpu_drm_abort_proc abort) + amdgpu_drm_abort_proc abort, + enum drmmode_flip_sync flip_sync) { AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); @@ -2538,6 +2537,7 @@ drmmode_crtc_private_ptr drmmode_crtc = config->crtc[0]->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; int i; + uint32_t flip_flags = DRM_MODE_PAGE_FLIP_EVENT; drmmode_flipdata_ptr flipdata; uintptr_t drm_queue_seq = 0; uint32_t new_front_handle; @@ -2579,6 +2579,9 @@ flipdata->handler = handler; flipdata->abort = abort; + if (flip_sync == FLIP_ASYNC) + flip_flags |= DRM_MODE_PAGE_FLIP_ASYNC; + for (i = 0; i < config->num_crtc; i++) { crtc = config->crtc[i]; @@ -2598,14 +2601,14 @@ flipdata, drmmode_flip_handler, drmmode_flip_abort); - if (!drm_queue_seq) { + if (drm_queue_seq == AMDGPU_DRM_QUEUE_ERROR) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Allocating DRM queue event entry failed.\n"); goto error; } if (drmModePageFlip(pAMDGPUEnt->fd, drmmode_crtc->mode_crtc->crtc_id, - drmmode->fb_id, DRM_MODE_PAGE_FLIP_EVENT, + drmmode->fb_id, flip_flags, (void*)drm_queue_seq)) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue failed: %s\n", strerror(errno)); diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/drmmode_display.h xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/drmmode_display.h --- xserver-xorg-video-amdgpu-1.1.2/src/drmmode_display.h 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/drmmode_display.h 2016-10-10 06:28:11.000000000 +0000 @@ -73,7 +73,6 @@ struct drmmode_scanout { struct amdgpu_buffer *bo; PixmapPtr pixmap; - DamagePtr damage; unsigned fb_id; int width, height; }; @@ -85,15 +84,18 @@ struct amdgpu_buffer *cursor_buffer; struct drmmode_scanout rotate; struct drmmode_scanout scanout[2]; + struct drmmode_scanout scanout_destroy[2]; + DamagePtr scanout_damage; + RegionRec scanout_last_region; unsigned scanout_id; Bool scanout_update_pending; int dpms_mode; + /* For when a flip is pending when DPMS off requested */ + int pending_dpms_mode; CARD64 dpms_last_ust; uint32_t dpms_last_seq; int dpms_last_fps; uint32_t interpolated_vblanks; - uint16_t lut_r[256], lut_g[256], lut_b[256]; - int prime_pixmap_x; /* Modeset needed for DPMS on */ Bool need_modeset; @@ -121,6 +123,13 @@ int enc_clone_mask; } drmmode_output_private_rec, *drmmode_output_private_ptr; + +enum drmmode_flip_sync { + FLIP_VSYNC, + FLIP_ASYNC, +}; + + extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp); extern void drmmode_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode); extern void drmmode_fini(ScrnInfoPtr pScrn, drmmode_ptr drmmode); @@ -141,10 +150,12 @@ extern int drmmode_get_crtc_id(xf86CrtcPtr crtc); extern int drmmode_get_pitch_align(ScrnInfoPtr scrn, int bpe); +extern void drmmode_clear_pending_flip(xf86CrtcPtr crtc); Bool amdgpu_do_pageflip(ScrnInfoPtr scrn, ClientPtr client, PixmapPtr new_front, uint64_t id, void *data, int ref_crtc_hw_id, amdgpu_drm_handler_proc handler, - amdgpu_drm_abort_proc abort); + amdgpu_drm_abort_proc abort, + enum drmmode_flip_sync flip_sync); int drmmode_crtc_get_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc); int drmmode_get_current_ust(int drm_fd, CARD64 * ust); diff -Nru xserver-xorg-video-amdgpu-1.1.2/src/pcidb/parse_pci_ids.pl xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/pcidb/parse_pci_ids.pl --- xserver-xorg-video-amdgpu-1.1.2/src/pcidb/parse_pci_ids.pl 2016-09-16 09:01:22.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.1.99+git20161010.d42773eb/src/pcidb/parse_pci_ids.pl 2016-10-10 06:28:11.000000000 +0000 @@ -16,6 +16,8 @@ my $amdgpuchipsetfile = 'amdgpu_chipset_gen.h'; my $amdgpuchipinfofile = 'amdgpu_chipinfo_gen.h'; +my %uniquechipsets; + my $csv = Text::CSV_XS->new(); open (CSV, "<", $file) or die $!; @@ -48,6 +50,7 @@ print PCIDEVICEMATCH " ATI_DEVICE_MATCH( PCI_CHIP_$columns[1], 0 ),\n"; print AMDGPUCHIPSET " { PCI_CHIP_$columns[1], \"$columns[3]\" },\n"; + $uniquechipsets{$columns[3]} = 1; print AMDGPUCHIPINFO " { $columns[0], CHIP_FAMILY_$columns[2] },\n"; } @@ -59,6 +62,10 @@ } print AMDGPUCHIPINFO "};\n"; +print AMDGPUCHIPSET " { -1, NULL }\n};\n\nSymTabRec AMDGPUUniqueChipsets[] = {\n"; +foreach (sort keys %uniquechipsets) { + print AMDGPUCHIPSET " { 0, \"$_\" },\n"; +} print AMDGPUCHIPSET " { -1, NULL }\n};\n"; print PCICHIPSET " { -1, -1, RES_UNDEFINED }\n};\n"; print PCIDEVICEMATCH " { 0, 0, 0 }\n};\n";