diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2019-02-27 18:43:27 +0100 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2019-02-27 18:43:27 +0100 |
commit | a636f42b496b0604ca00a144690ece61d1a88a27 (patch) | |
tree | c11cd9610e9bd54ad0f95d95c3dede06a286f5bb /src | |
parent | bd090f389f19f1f4a3f662ffdd891345a3899539 (diff) |
present: Check that flip and screen pixmap pitches match
If they don't, flipping will result in corrupted display.
Test case:
* Run Xorg at 1920x1080 with no window manager
* glxgears -geometry 2048x1080
The Present extension code in xserver 1.21 will check for this.
Tested-by: Jax Lin <jax.lin@amd.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/amdgpu_present.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c index 2fbcd25..ce88bd8 100644 --- a/src/amdgpu_present.c +++ b/src/amdgpu_present.c @@ -255,6 +255,7 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, xf86CrtcPtr xf86_crtc = crtc->devPrivate; ScreenPtr screen = window->drawable.pScreen; ScrnInfoPtr scrn = xf86_crtc->scrn; + PixmapPtr screen_pixmap = screen->GetScreenPixmap(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); AMDGPUInfoPtr info = AMDGPUPTR(scrn); int num_crtcs_on; @@ -272,11 +273,16 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, if (info->drmmode.dri2_flipping) return FALSE; +#if XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(1, 20, 99, 1, 0) + if (pixmap->devKind != screen_pixmap->devKind) + return FALSE; +#endif + /* The kernel driver doesn't handle flipping between BOs with different * tiling parameters correctly yet */ if (amdgpu_pixmap_get_tiling_info(pixmap) != - amdgpu_pixmap_get_tiling_info(screen->GetScreenPixmap(screen))) + amdgpu_pixmap_get_tiling_info(screen_pixmap)) return FALSE; for (i = 0, num_crtcs_on = 0; i < config->num_crtc; i++) { |