.editorconfig | 3 ChangeLog | 539 ++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile.am | 2 autogen.sh | 11 - conf/10-radeon.conf | 5 conf/Makefile.am | 24 ++ configure.ac | 20 + debian/changelog | 6 man/radeon.man | 17 + src/ati.c | 40 +++ src/drmmode_display.c | 495 ++++++++++++++++++++++++++++++++------------- src/drmmode_display.h | 15 + src/radeon.h | 24 -- src/radeon_dri2.c | 42 ++- src/radeon_dri3.c | 37 +++ src/radeon_glamor.c | 11 - src/radeon_kms.c | 326 +++++++++++++++++------------- src/radeon_present.c | 19 + src/radeon_probe.h | 2 19 files changed, 1305 insertions(+), 333 deletions(-)
New commits: commit 86629562be50a24bab7b682583ad087a2e182455 Author: Timo Aaltonen <[email protected]> Date: Thu Mar 16 16:15:48 2017 +0200 update changelogs diff --git a/ChangeLog b/ChangeLog index db47757..049526f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,542 @@ +commit 66227060872219c1a0dc84fa4cea6264f7548446 +Author: Michel Dänzer <[email protected]> +Date: Thu Mar 16 16:38:15 2017 +0900 + + Bump version for 7.9.0 release + +commit 9a71445094b728f3d78db8f6808b4782ee19a453 +Author: Michel Dänzer <[email protected]> +Date: Wed Mar 8 17:42:56 2017 +0900 + + Pass TRUE to drmmode_set_desired_modes the first time for GPU screens + + This is the only place we call drmmode_set_desired_modes for GPU screens + during server startup. Without this change, the display outputs of + secondary GPUs may stay on even while Xorg isn't using them. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 67ae5e00a748ad52cf92738d401afff2947b1891 +Author: Michel Dänzer <[email protected]> +Date: Wed Mar 8 11:20:30 2017 +0900 + + Skip some initialization steps for GPU screens + + Xorg doesn't use the following functionality of GPU screens, so don't + bother initializing it: + + * DRI page flipping + * DRI3 / Present / SYNC fences + * XVideo / XvMC + * Root window with background None + + Reviewed-by: Alex Deucher <[email protected]> + +commit f0e7948e1c0e984fc27f235f365639e9cf628291 +Author: Jochen Rollwagen <[email protected]> +Date: Sun Mar 5 11:32:38 2017 +0100 + + Fix build for XServer 1.13 + + Latest git build stops with the error message + + radeon_kms.c: In function 'RADEONWindowExposures_oneshot': + radeon_kms.c:1644:45: error: expected expression before 'RegionPtr' + pScreen->WindowExposures(pWin, pRegion, RegionPtr pBSRegion); + + This patch fixes the build. + + Reviewed-by: Michel Dänzer <[email protected]> + +commit d63881623f0686a66a2e3e3c1f84e496aa52ec6b +Author: Michel Dänzer <[email protected]> +Date: Thu Mar 2 16:22:51 2017 +0900 + + Don't call radeon_cs_flush_indirect & radeon_bo_wait in drmmode_copy_fb + + RADEONWindowExposures_oneshot takes care of it. + + Reviewed-by: Alex Deucher <[email protected]> + +commit cc9d6b7db9c2078be1e530a64af6d517c6a42024 +Author: Michel Dänzer <[email protected]> +Date: Wed Mar 1 17:35:59 2017 +0900 + + Move DPMS check from radeon_scanout_do_update to radeon_scanout_flip + + When radeon_scanout_do_update is called from + drmmode_crtc_scanout_update, drmmode_crtc->pending_dpms_mode may still + be != DPMSModeOn, e.g. during server startup. + + Fixes intermittently showing garbage with TearFree enabled. + +commit 0a12bf1085505017068dfdfd31d23133e51b45b9 +Author: Michel Dänzer <[email protected]> +Date: Wed Mar 1 18:00:40 2017 +0900 + + Call drmmode_set_desired_modes from a WindowExposures hook + + This is the earliest opportunity where the root window contents are + guaranteed to be initialized, and prevents drmmode_set_mode_major from + getting called before drmmode_set_desired_modes via RADEONUnblank -> + drmmode_crtc_dpms. Also, in contrast to the BlockHandler hook, this is + called when running Xorg with -pogo. + + Fixes intermittently showing garbage on server startup or after server + reset. + + As a bonus, this avoids trouble due to higher layers (e.g. the tigervnc + Xorg module) calling RADEONBlockHandler_oneshot repeatedly even after + we set pScreen->BlockHandler = RADEONBlockHandler_KMS. + + v2: + * Drop spaces between XORG_VERSION_NUMERIC arguments + * Call radeon_bo_wait after radeon_cs_flush_indirect + + Bugzilla: https://bugs.freedesktop.org/99457 + Reviewed-by: Alex Deucher <[email protected]> (v1) + +commit df2d749a4db33298c8ce9f2cfb77c20c5538c9cc +Author: Michel Dänzer <[email protected]> +Date: Thu Mar 2 16:05:42 2017 +0900 + + Fix bogus indentation + + Trivial. + + Fixes: 58cd1600057e ("Allow toggling TearFree at runtime via output property") + +commit 9035b6abea557828e672ee455f0c84e43da0906f +Author: Michel Dänzer <[email protected]> +Date: Tue Feb 28 18:13:42 2017 +0900 + + present: Flush before flipping + + This isn't necessary for DRI clients, but the Present extension can also + be used for presenting normal pixmaps rendered to via the X11 protocol. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 0a4eb0e12f0c9c653cf4cea6fd62e1a507eb261c +Author: Michel Dänzer <[email protected]> +Date: Fri Feb 10 12:52:02 2017 +0900 + + present: Use async flip for unflip if possible + + In that case, unflip operations should finish faster in general. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 9a951a3e551db58ba50e7a594521ceac54d90615 +Author: Michel Dänzer <[email protected]> +Date: Tue Feb 28 18:06:55 2017 +0900 + + present: Also flush before using a flip to unflip + + Not doing so might result in intermittently scanning out stale contents + of the screen pixmap. + + Reviewed-by: Alex Deucher <[email protected]> + +commit f2bc882f1c1082bed9f496cfab6c8f07a76bc122 +Author: Michel Dänzer <[email protected]> +Date: Tue Feb 28 17:31:14 2017 +0900 + + Handle rotation in the driver also with Xorg 1.12-1.18 + + We cannot use the HW cursor in that case, but in turn we get more + efficient and less teary updates of rotated outputs. + + Reviewed-by: Alex Deucher <[email protected]> + +commit ae921a3150f69c38b5b3c88a9e37d54fdf0d5093 +Author: Michel Dänzer <[email protected]> +Date: Tue Feb 28 17:47:09 2017 +0900 + + Fold drmmode_crtc_scanout_allocate into drmmode_crtc_scanout_create + + Not used anywhere else anymore. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 987a34adb319923ad36e2b47a26837248f187c3e +Author: Michel Dänzer <[email protected]> +Date: Tue Feb 28 17:17:20 2017 +0900 + + Call drmmode_crtc_scanout_create in drmmode_crtc_shadow_allocate as well + + Calling drmmode_crtc_scanout_allocate in drmmode_crtc_shadow_allocate + resulted in drmmode_crtc_scanout_create called from + drmmode_crtc_shadow_create passing an uninitialized pitch value to + drmmode_create_bo_pixmap. + + Fixes issues such as failure to allocate the scanout pixmap or visual + corruption and GPUVM faults when attempting to use rotation with Xorg + <1.19. + + Bugzilla: https://bugs.freedesktop.org/99916 + Fixes: ea30d856ba5e ("Pass pitch from drmmode_crtc_scanout_allocate to drmmode_create_bo_pixmap") + Reviewed-by: Alex Deucher <[email protected]> + +commit 244d4bc7f8c8f6bc90f49556c0b9344c8aa40295 +Author: Michel Dänzer <[email protected]> +Date: Thu Feb 9 18:55:04 2017 +0900 + + present: Wait for screen pixmap BO idle before setting modes for unflip + + To make sure the screen pixmap contents are up to date when it starts + being scanned out. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 3ff29e5a14451916bc66b4e0028e9a317f0723f8 +Author: Michel Dänzer <[email protected]> +Date: Thu Feb 9 18:50:40 2017 +0900 + + present: Only call drmModeRmFB after setting modes for unflip + + Fixes display intermittently blanking when a modeset is used for unflip. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 0c29deb5a97d9a57e994cc0053c49ddf7aca6ecb +Author: Michel Dänzer <[email protected]> +Date: Tue Feb 21 16:56:27 2017 +0900 + + Use drmmode_crtc_scanout_free in drmmode_fini + + We were leaking drmmode_crtc->scanout_damage, which caused trouble on + server reset. Fixes server reset with active separate scanout pixmaps. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 58cd1600057e41aade0106d4acf78e23eac6e44f +Author: Michel Dänzer <[email protected]> +Date: Thu Dec 1 18:37:57 2016 +0900 + + Allow toggling TearFree at runtime via output property + + Option "TearFree" now sets the default value of the output property. + See the manpage update for details. + + TearFree is now enabled by default for outputs using rotation or other + RandR transforms, and for RandR 1.4 slave outputs. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 305e2cbf335837a2ab6a24e9ff65815afe038296 +Author: Michel Dänzer <[email protected]> +Date: Tue Feb 21 15:55:13 2017 +0900 + + Factor out drmmode_crtc_scanout_update helper + + Cleanup in preparation for following change, no functional change + intended. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 649644a88347a6d03de68f8c41db03a82deeb23b +Author: Michel Dänzer <[email protected]> +Date: Tue Feb 14 17:36:31 2017 +0900 + + Factor out radeon_prime_dirty_to_crtc helper + + Cleanup in preparation for the following change, no functional change + intended. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 1351e48efe7a2c28eab447e16f36a00fbd02ae48 +Author: Michel Dänzer <[email protected]> +Date: Tue Feb 7 18:43:56 2017 +0900 + + Don't destroy current FB if drmModeAddFB fails + + It would probably result in a black screen. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 481394e3c9f9f7d88bb66fe9ae8834c87952a8ab +Author: Michel Dänzer <[email protected]> +Date: Tue Feb 7 18:39:05 2017 +0900 + + Fix flip event data leak if calloc or drmModeAddFB fails + + Reviewed-by: Alex Deucher <[email protected]> + +commit 80fc78633962c1ec996b1721bfb757b98dc85bfc +Author: Michel Dänzer <[email protected]> +Date: Tue Jan 31 16:25:37 2017 +0900 + + Don't handle Option "SwapbuffersWait" at all with glamor + + It never had any effect with glamor. + + v2: Better formatting, no functional change from v1. + + Reviewed-by: Alex Deucher <[email protected]> (v1) + +commit d611d21d9bf9aaa100ff7a5762e5980634846207 +Author: Michel Dänzer <[email protected]> +Date: Tue Jan 24 18:05:45 2017 +0900 + + Enable tiling by default with glamor on PALM + + The DFS check is only relevant for EXA. + + The lack of tiling prevented DRI3 clients from using page flipping, + resulting in tearing. + + Bugzilla: https://bugs.freedesktop.org/99491 + Reviewed-by: Alex Deucher <[email protected]> + +commit 55a33205cb9bd8091b4bcd478c2d1d191248681b +Author: Michel Dänzer <[email protected]> +Date: Tue Jan 24 18:22:49 2017 +0900 + + Add 10-radeon.conf xorg.conf.d snippet + + This instructs Xorg >= 1.16 to try loading the radeon driver for devices + managed by the radeon kernel driver, even if the ati wrapper driver + isn't available. + + Copied from the amdgpu driver. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 8e6a4e96b7b27559e186f71b5547abb0a80b96dd +Author: Mihail Konev <[email protected]> +Date: Thu Jan 26 14:00:22 2017 +1000 + + autogen: add default patch prefix + + Signed-off-by: Mihail Konev <[email protected]> + +commit e062933b5489705bdcba7a266d14ba6fd3e767ba +Author: Emil Velikov <[email protected]> +Date: Mon Mar 9 12:00:52 2015 +0000 + + autogen.sh: use quoted string variables + + Place quotes around the $srcdir, $ORIGDIR and $0 variables to prevent + fall-outs, when they contain space. + + Signed-off-by: Emil Velikov <[email protected]> + Reviewed-by: Peter Hutterer <[email protected]> + Signed-off-by: Peter Hutterer <[email protected]> + +commit 4fe183111f82d412760b175b3c9c8583acba804a +Author: Peter Hutterer <[email protected]> +Date: Tue Jan 24 10:32:07 2017 +1000 + + autogen.sh: use exec instead of waiting for configure to finish + + Syncs the invocation of configure with the one from the server. + + Signed-off-by: Peter Hutterer <[email protected]> + Reviewed-by: Emil Velikov <[email protected]> + +commit a1787e4615a76ab0bb12498be66591c86a6b07ae +Author: Michel Dänzer <[email protected]> +Date: Wed Jan 18 19:07:11 2017 +0900 + + ati: Support loading the amdgpu driver from the ati wrapper + + If .../share/X11/xorg.conf.d/10-amdgpu.conf doesn't exist, but the ati + wrapper is loaded, it will otherwise try to use the radeon driver even + for GPUs driven by the amdgpu kernel driver. This can only fail, + potentially in bad ways. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 41b82c776b571e1556f300d77c715aebdd87d8e6 +Author: Michel Dänzer <[email protected]> +Date: Tue Jan 24 18:14:23 2017 +0900 + + .editorconfig: src/ati.c only uses spaces for indentation + + Trivial. + +commit ea30d856ba5e7274c8ea499293b8b0e721b8e082 +Author: Michel Dänzer <[email protected]> +Date: Fri Jan 6 17:36:05 2017 +0900 + + Pass pitch from drmmode_crtc_scanout_allocate to drmmode_create_bo_pixmap + + radeon_bo_get_tiling can fail, e.g. for linear BOs. + + Fixes TearFree not working in those cases. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97873 + Fixes: 040a7b80e1fc ("Explicitly set the fbcon pixmap pitch again") + Reviewed-by: Alex Deucher <[email protected]> + +commit 720dd07e79b5f5cbbf3ef8bd92300578c485d583 +Author: Jammy Zhou <[email protected]> +Date: Mon Dec 19 17:27:19 2016 +0900 + + Use render node for DRI3 if available + + Signed-off-by: Jammy Zhou <[email protected]> + (ported from amdgpu commit ea558e645786b08d75307716036045170e97b43e) + Reviewed-by: Alex Deucher <[email protected]> + [ Second attempt, let's see if there's any fallout this time... ] + +commit 92fc387a6256ce3c95d62142735783ea07162c54 +Author: Michel Dänzer <[email protected]> +Date: Thu Dec 15 12:44:47 2016 +0900 + + Simplify drmmode_handle_uevents + + No functional change intended. + + Reviewed-by: Jim Qu <[email protected]> + (Cherry picked from amdgpu commit edd276185d42962a13faf9ec9eeebc754ef284e7.) + +commit 404c64752774d23a2db9aa3134f6ada3155708c9 +Author: jimqu <[email protected]> +Date: Wed Dec 14 11:46:16 2016 +0900 + + udev_monitor_receive_device() will block when hotplug monitor + + udev_monitor_receive_device() will block and wait for the event of udev + use select() to ensure that this will not block. + + Signed-off-by: JimQu <[email protected]> + Reviewed-by: Michel Dänzer <[email protected]> + (Cherry picked from amdgpu commit 732cf4d3a248b288532ad0f3443da49e08dc7507) + +commit a89c0bced423ce3e09f66edafc35642a7cc03b2f +Author: Jochen Rollwagen <[email protected]> +Date: Fri Dec 2 10:56:39 2016 +0100 + + Calculate log base 2 in radeon.h based on clz for all platforms + + This commit replaces the inline assembler code (for x86 platforms) and + loop (for non-x86 platforms) in RADEONLog2 with a one-liner version + based on clz (count leading zeroes). + + Reviewed-by: Michel Dänzer <[email protected]> + +commit e2942449171fe628a7726e59bcaab65e27d88563 +Author: Michel Dänzer <[email protected]> +Date: Mon Nov 21 18:47:53 2016 +0900 + + Call radeon_drm_abort_entry on failure to flip to a scanout pixmap + + Fixes leaking the corresponding struct radeon_drm_queue list entry in + that case. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 14c3f59f5157885ad8f941f0bad6c0c5e3db12f8 +Author: Michel Dänzer <[email protected]> +Date: Mon Nov 21 18:45:30 2016 +0900 + + Call ValidateGC after ChangeClip in radeon_sync_scanout_pixmaps + + The wrong order meant that the clipping region wasn't actually applied, + so it always copied the full contents from the other scanout pixmap. + + Reviewed-by: Alex Deucher <[email protected]> + +commit a995f5830916a0fee5126263d1bfe48632be3a15 +Author: Michel Dänzer <[email protected]> +Date: Mon Nov 21 18:39:00 2016 +0900 + + Fix radeon_scanout_extents_intersect for GPU screens + + Fixes incorrect screen updates with TearFree enabled on PRIME slave + outputs which are not located at (0, 0). + + Reviewed-by: Alex Deucher <[email protected]> + +commit e543ef3a2fb304cbe3a965fb780632af2e4186f4 +Author: Michel Dänzer <[email protected]> +Date: Mon Nov 21 18:33:25 2016 +0900 + + Take current scanout_id into account everywhere involved with TearFree + + Fixes various potential issues with TearFree enabled, e.g. outputs + freezing after display configuration changes. + + Reviewed-by: Alex Deucher <[email protected]> + +commit f130b10e63f7526360b41aa0918b4940f63f662a +Author: Michel Dänzer <[email protected]> +Date: Fri Nov 25 18:12:40 2016 +0900 + + Add radeon_is_gpu_screen helper + + This will hopefully decrease the chance of accidentally breaking the + build against xserver < 1.13 in the future. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 487aa62a2a23b86e4ea4714fdfd465c9e513141f +Author: Jochen Rollwagen <[email protected]> +Date: Thu Nov 24 18:44:01 2016 +0100 + + fix build for xserver < 1.13 + + same procedure every few patches..... + + Fixes: 13c6bc5e3827 ("Don't install Flush/EventCallback for GPU screens") + Reviewed-by: Michel Dänzer <[email protected]> + +commit 5fea5ef2f07eee4a0f94baab427010b936f1d4b4 +Author: Michel Dänzer <[email protected]> +Date: Thu Nov 24 18:45:22 2016 +0900 + + Pass fb_id into drmmode_page_flip_target_absolute/relative + + drmmode->fb_id isn't what we need in the TearFree case. Fixes TearFree + freezing with + + (WW) RADEON(0): flip queue failed in radeon_scanout_flip: No such file or directory + + in the log file. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98834 + Fixes: 1106b2f773ad ("Use DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags when available") + +commit 13c6bc5e382765fe567091e1c616c0a26eec04ca +Author: Michel Dänzer <[email protected]> +Date: Mon Aug 1 18:11:57 2016 +0900 + + Don't install Flush/EventCallback for GPU screens + + Their purpose is to flush GPU rendering commands corresponding to damage + events, but there can be no damage events corresponding to GPU screen + rendering operations. + + Reviewed-by: Alex Deucher <[email protected]> + +commit f11531c99fcd6473f58b4d10efaf3efd84304d8e +Author: Michel Dänzer <[email protected]> +Date: Mon Nov 21 18:15:05 2016 +0900 + + Enable glamor by default with >= R600 and Xorg >= 1.18.3 + + glamor should now perform at least as well as EXA in general, and this + allows DRI3 to be enabled by default for >= R600. + + Reviewed-by: Alex Deucher <[email protected]> + +commit 1106b2f773ad0611c729b27f4c192a26b43ef1e7 +Author: Michel Dänzer <[email protected]> +Date: Wed Jul 6 15:25:33 2016 +0900 + + Use DRM_MODE_PAGE_FLIP_TARGET_ABSOLUTE/RELATIVE flags when available + + Reviewed-by: Alex Deucher <[email protected]> + +commit aab80d2203efb8569b26dd02a1c651c792e1ef0c +Author: Michel Dänzer <[email protected]> +Date: Fri Nov 18 12:11:38 2016 +0900 + + Post-release version bump + commit 5cbe1ee8e499e1b6b2646e341946292721d07e69 Author: Michel Dänzer <[email protected]> Date: Thu Nov 17 11:27:16 2016 +0900 diff --git a/debian/changelog b/debian/changelog index 63a8228..ee61960 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xserver-xorg-video-ati (1:7.9.0-1) UNRELEASED; urgency=medium + + * New upstream release. + + -- Timo Aaltonen <[email protected]> Thu, 16 Mar 2017 16:12:09 +0200 + xserver-xorg-video-ati (1:7.8.0-1) unstable; urgency=medium * New upstream release. commit 66227060872219c1a0dc84fa4cea6264f7548446 Author: Michel Dänzer <[email protected]> Date: Thu Mar 16 16:38:15 2017 +0900 Bump version for 7.9.0 release diff --git a/configure.ac b/configure.ac index 732f705..b83b18f 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-video-ati], - [7.8.99], + [7.9.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-video-ati]) commit 9a71445094b728f3d78db8f6808b4782ee19a453 Author: Michel Dänzer <[email protected]> Date: Wed Mar 8 17:42:56 2017 +0900 Pass TRUE to drmmode_set_desired_modes the first time for GPU screens This is the only place we call drmmode_set_desired_modes for GPU screens during server startup. Without this change, the display outputs of secondary GPUs may stay on even while Xorg isn't using them. Reviewed-by: Alex Deucher <[email protected]> diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 907ebfc..424f9f7 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -328,7 +328,8 @@ static Bool RADEONCreateScreenResources_KMS(ScreenPtr pScreen) } } - if (!drmmode_set_desired_modes(pScrn, &info->drmmode, FALSE)) + if (!drmmode_set_desired_modes(pScrn, &info->drmmode, + radeon_is_gpu_screen(pScreen))) return FALSE; drmmode_uevent_init(pScrn, &info->drmmode); commit 67ae5e00a748ad52cf92738d401afff2947b1891 Author: Michel Dänzer <[email protected]> Date: Wed Mar 8 11:20:30 2017 +0900 Skip some initialization steps for GPU screens Xorg doesn't use the following functionality of GPU screens, so don't bother initializing it: * DRI page flipping * DRI3 / Present / SYNC fences * XVideo / XvMC * Root window with background None Reviewed-by: Alex Deucher <[email protected]> diff --git a/src/radeon.h b/src/radeon.h index 815c12a..7374411 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -183,8 +183,10 @@ typedef enum { #if XF86_CRTC_VERSION >= 5 #define RADEON_PIXMAP_SHARING 1 #define radeon_is_gpu_screen(screen) (screen)->isGPU +#define radeon_is_gpu_scrn(scrn) (scrn)->is_gpu #else #define radeon_is_gpu_screen(screen) 0 +#define radeon_is_gpu_scrn(scrn) 0 #endif #define RADEON_VSYNC_TIMEOUT 20000 /* Maximum wait for VSYNC (in usecs) */ diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 7a561fa..907ebfc 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -1811,32 +1811,36 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags) info->tear_free == 2 ? "auto" : (info->tear_free ? "on" : "off")); } - if (info->dri2.pKernelDRMVersion->version_minor >= 8) { - Bool sw_cursor = xf86ReturnOptValBool(info->Options, OPTION_SW_CURSOR, FALSE); - - info->allowPageFlip = xf86ReturnOptValBool(info->Options, - OPTION_PAGE_FLIP, TRUE); - - if (sw_cursor || info->shadow_primary) { - xf86DrvMsg(pScrn->scrnIndex, - info->allowPageFlip ? X_WARNING : X_DEFAULT, - "KMS Pageflipping: disabled%s\n", - info->allowPageFlip ? - (sw_cursor ? " because of SWcursor" : - " because of ShadowPrimary") : ""); - info->allowPageFlip = FALSE; - } else { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "KMS Pageflipping: %sabled\n", info->allowPageFlip ? "en" : "dis"); + if (!radeon_is_gpu_scrn(pScrn)) { + if (info->dri2.pKernelDRMVersion->version_minor >= 8) { + Bool sw_cursor = xf86ReturnOptValBool(info->Options, + OPTION_SW_CURSOR, FALSE); + + info->allowPageFlip = xf86ReturnOptValBool(info->Options, + OPTION_PAGE_FLIP, TRUE); + + if (sw_cursor || info->shadow_primary) { + xf86DrvMsg(pScrn->scrnIndex, + info->allowPageFlip ? X_WARNING : X_DEFAULT, + "KMS Pageflipping: disabled%s\n", + info->allowPageFlip ? + (sw_cursor ? " because of SWcursor" : + " because of ShadowPrimary") : ""); + info->allowPageFlip = FALSE; + } else { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "KMS Pageflipping: %sabled\n", + info->allowPageFlip ? "en" : "dis"); + } } - } - if (!info->use_glamor) { - info->swapBuffersWait = - xf86ReturnOptValBool(info->Options, OPTION_SWAPBUFFERS_WAIT, TRUE); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "SwapBuffers wait for vsync: %sabled\n", - info->swapBuffersWait ? "en" : "dis"); + if (!info->use_glamor) { + info->swapBuffersWait = + xf86ReturnOptValBool(info->Options, OPTION_SWAPBUFFERS_WAIT, TRUE); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "SwapBuffers wait for vsync: %sabled\n", + info->swapBuffersWait ? "en" : "dis"); + } } if (xf86ReturnOptValBool(info->Options, OPTION_DELETE_DP12, FALSE)) { @@ -2244,33 +2248,35 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL) } #endif - if (xorgGetVersion() >= XORG_VERSION_NUMERIC(1,18,3,0,0)) - value = info->use_glamor; - else - value = FALSE; - from = X_DEFAULT; + if (!radeon_is_gpu_screen(pScreen)) { + if (xorgGetVersion() >= XORG_VERSION_NUMERIC(1,18,3,0,0)) + value = info->use_glamor; + else + value = FALSE; + from = X_DEFAULT; - if (!info->r600_shadow_fb) { - if (xf86GetOptValBool(info->Options, OPTION_DRI3, &value)) - from = X_CONFIG; + if (!info->r600_shadow_fb) { + if (xf86GetOptValBool(info->Options, OPTION_DRI3, &value)) + from = X_CONFIG; - if (xf86GetOptValInteger(info->Options, OPTION_DRI, &driLevel) && - (driLevel == 2 || driLevel == 3)) { - from = X_CONFIG; - value = driLevel == 3; + if (xf86GetOptValInteger(info->Options, OPTION_DRI, &driLevel) && + (driLevel == 2 || driLevel == 3)) { + from = X_CONFIG; + value = driLevel == 3; + } } - } - if (value) { - value = radeon_sync_init(pScreen) && - radeon_present_screen_init(pScreen) && - radeon_dri3_screen_init(pScreen); + if (value) { + value = radeon_sync_init(pScreen) && + radeon_present_screen_init(pScreen) && + radeon_dri3_screen_init(pScreen); - if (!value) - from = X_WARNING; - } + if (!value) + from = X_WARNING; + } - xf86DrvMsg(pScrn->scrnIndex, from, "DRI3 %sabled\n", value ? "en" : "dis"); + xf86DrvMsg(pScrn->scrnIndex, from, "DRI3 %sabled\n", value ? "en" : "dis"); + } pScrn->vtSema = TRUE; xf86SetBackingStore(pScreen); @@ -2325,7 +2331,8 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL) */ /* xf86DiDGAInit(pScreen, info->LinearAddr + pScrn->fbOffset); */ #endif - if (info->r600_shadow_fb == FALSE) { + if (info->r600_shadow_fb == FALSE && + !radeon_is_gpu_screen(pScreen)) { /* Init Xv */ xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, "Initializing Xv\n"); @@ -2341,12 +2348,14 @@ Bool RADEONScreenInit_KMS(SCREEN_INIT_ARGS_DECL) } pScrn->pScreen = pScreen; - if (serverGeneration == 1 && bgNoneRoot && info->accelOn) { - info->CreateWindow = pScreen->CreateWindow; - pScreen->CreateWindow = RADEONCreateWindow_oneshot; + if (!radeon_is_gpu_screen(pScreen)) { + if (serverGeneration == 1 && bgNoneRoot && info->accelOn) { + info->CreateWindow = pScreen->CreateWindow; + pScreen->CreateWindow = RADEONCreateWindow_oneshot; + } + info->WindowExposures = pScreen->WindowExposures; + pScreen->WindowExposures = RADEONWindowExposures_oneshot; } - info->WindowExposures = pScreen->WindowExposures; - pScreen->WindowExposures = RADEONWindowExposures_oneshot; /* Provide SaveScreen & wrap BlockHandler and CloseScreen */ /* Wrap CloseScreen */ commit f0e7948e1c0e984fc27f235f365639e9cf628291 Author: Jochen Rollwagen <[email protected]> Date: Sun Mar 5 11:32:38 2017 +0100 Fix build for XServer 1.13 Latest git build stops with the error message radeon_kms.c: In function 'RADEONWindowExposures_oneshot': radeon_kms.c:1644:45: error: expected expression before 'RegionPtr' pScreen->WindowExposures(pWin, pRegion, RegionPtr pBSRegion); This patch fixes the build. Reviewed-by: Michel Dänzer <[email protected]> diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 572dfcc..7a561fa 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -1641,7 +1641,7 @@ static void RADEONWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion pScreen->WindowExposures = info->WindowExposures; #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0) - pScreen->WindowExposures(pWin, pRegion, RegionPtr pBSRegion); + pScreen->WindowExposures(pWin, pRegion, pBSRegion); #else pScreen->WindowExposures(pWin, pRegion); #endif commit d63881623f0686a66a2e3e3c1f84e496aa52ec6b Author: Michel Dänzer <[email protected]> Date: Thu Mar 2 16:22:51 2017 +0900 Don't call radeon_cs_flush_indirect & radeon_bo_wait in drmmode_copy_fb RADEONWindowExposures_oneshot takes care of it. Reviewed-by: Alex Deucher <[email protected]> diff --git a/src/drmmode_display.c b/src/drmmode_display.c index a7904a3..ab11583 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -490,9 +490,6 @@ void drmmode_copy_fb(ScrnInfoPtr pScrn, drmmode_ptr drmmode) FreeScratchGC(gc); - radeon_cs_flush_indirect(pScrn); - radeon_bo_wait(info->front_bo); - pScreen->canDoBGNoneRoot = TRUE; destroy_pixmap_for_fbcon(pScrn); return; commit cc9d6b7db9c2078be1e530a64af6d517c6a42024 Author: Michel Dänzer <[email protected]> Date: Wed Mar 1 17:35:59 2017 +0900 Move DPMS check from radeon_scanout_do_update to radeon_scanout_flip When radeon_scanout_do_update is called from drmmode_crtc_scanout_update, drmmode_crtc->pending_dpms_mode may still be != DPMSModeOn, e.g. during server startup. Fixes intermittently showing garbage with TearFree enabled. diff --git a/src/radeon_kms.c b/src/radeon_kms.c index c2089eb..572dfcc 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -882,7 +882,6 @@ radeon_scanout_do_update(xf86CrtcPtr xf86_crtc, int scanout_id) Bool force; if (!xf86_crtc->enabled || - drmmode_crtc->pending_dpms_mode != DPMSModeOn || !drmmode_crtc->scanout[scanout_id].pixmap) return FALSE; @@ -1069,7 +1068,8 @@ radeon_scanout_flip(ScreenPtr pScreen, RADEONInfoPtr info, uintptr_t drm_queue_seq; unsigned scanout_id; - if (drmmode_crtc->scanout_update_pending) + if (drmmode_crtc->scanout_update_pending || + drmmode_crtc->pending_dpms_mode != DPMSModeOn) return; scanout_id = drmmode_crtc->scanout_id ^ 1; commit 0a12bf1085505017068dfdfd31d23133e51b45b9 Author: Michel Dänzer <[email protected]> Date: Wed Mar 1 18:00:40 2017 +0900 Call drmmode_set_desired_modes from a WindowExposures hook This is the earliest opportunity where the root window contents are guaranteed to be initialized, and prevents drmmode_set_mode_major from getting called before drmmode_set_desired_modes via RADEONUnblank -> drmmode_crtc_dpms. Also, in contrast to the BlockHandler hook, this is called when running Xorg with -pogo. Fixes intermittently showing garbage on server startup or after server reset. As a bonus, this avoids trouble due to higher layers (e.g. the tigervnc Xorg module) calling RADEONBlockHandler_oneshot repeatedly even after we set pScreen->BlockHandler = RADEONBlockHandler_KMS. v2: * Drop spaces between XORG_VERSION_NUMERIC arguments * Call radeon_bo_wait after radeon_cs_flush_indirect Bugzilla: https://bugs.freedesktop.org/99457 Reviewed-by: Alex Deucher <[email protected]> (v1) diff --git a/src/radeon.h b/src/radeon.h index bfff232..815c12a 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -523,6 +523,7 @@ typedef struct { CreateScreenResourcesProcPtr CreateScreenResources; CreateWindowProcPtr CreateWindow; + WindowExposuresProcPtr WindowExposures; Bool IsSecondary; diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 331f3f1..c2089eb 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -1137,17 +1137,6 @@ static void RADEONBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL) #endif } -static void RADEONBlockHandler_oneshot(BLOCKHANDLER_ARGS_DECL) -{ - SCREEN_PTR(arg); - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); - RADEONInfoPtr info = RADEONPTR(pScrn); - - RADEONBlockHandler_KMS(BLOCKHANDLER_ARGS); - - drmmode_set_desired_modes(pScrn, &info->drmmode, TRUE); -} - static Bool RADEONIsFastFBWorking(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); @@ -1636,6 +1625,32 @@ static Bool RADEONCreateWindow_oneshot(WindowPtr pWin) return ret; } +/* When the root window is mapped, set the initial modes */ +static void RADEONWindowExposures_oneshot(WindowPtr pWin, RegionPtr pRegion +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0) + , RegionPtr pBSRegion +#endif + ) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + RADEONInfoPtr info = RADEONPTR(pScrn); + + if (pWin != pScreen->root) + ErrorF("%s called for non-root window %p\n", __func__, pWin); + + pScreen->WindowExposures = info->WindowExposures; +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0) + pScreen->WindowExposures(pWin, pRegion, RegionPtr pBSRegion); +#else + pScreen->WindowExposures(pWin, pRegion); +#endif + + radeon_cs_flush_indirect(pScrn); + radeon_bo_wait(info->front_bo); + drmmode_set_desired_modes(pScrn, &info->drmmode, TRUE); +}

