diff -Nru xserver-xorg-video-amdgpu-1.3.99+git1708010148.35106fc~x~padoka0/debian/changelog xserver-xorg-video-amdgpu-1.3.99+git1708141159.9caa9dd~x~padoka0/debian/changelog --- xserver-xorg-video-amdgpu-1.3.99+git1708010148.35106fc~x~padoka0/debian/changelog 2017-08-01 04:48:41.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.3.99+git1708141159.9caa9dd~x~padoka0/debian/changelog 2017-08-14 14:59:29.000000000 +0000 @@ -1,9 +1,9 @@ -xserver-xorg-video-amdgpu (1.3.99+git1708010148.35106fc~x~padoka0) xenial; urgency=medium +xserver-xorg-video-amdgpu (1.3.99+git1708141159.9caa9dd~x~padoka0) xenial; urgency=medium * Checkout from master git branch up to commit - 35106fc0a948957cbb7e1e9649c89993a3d5c95c + 9caa9dd9cc5eb9882c4bb85275bc318948dab71f - -- Paulo Dias Tue, 01 Aug 2017 01:48:41 -0300 + -- Paulo Dias Mon, 14 Aug 2017 11:59:29 -0300 xserver-xorg-video-amdgpu (0.0.01~git20150807-0ubuntu1) wily; urgency=medium diff -Nru xserver-xorg-video-amdgpu-1.3.99+git1708010148.35106fc~x~padoka0/man/amdgpu.man xserver-xorg-video-amdgpu-1.3.99+git1708141159.9caa9dd~x~padoka0/man/amdgpu.man --- xserver-xorg-video-amdgpu-1.3.99+git1708010148.35106fc~x~padoka0/man/amdgpu.man 2017-05-26 19:14:25.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.3.99+git1708141159.9caa9dd~x~padoka0/man/amdgpu.man 2017-08-14 14:48:43.000000000 +0000 @@ -77,7 +77,7 @@ tearing prevention using the hardware page flipping mechanism. TearFree is on for any CRTC associated with one or more outputs with TearFree on. Two separate scanout buffers need to be allocated for each CRTC with TearFree -on. While TearFree is on for any CRTC, it currently prevents clients from using +on. While TearFree is on for any CRTC, it may prevent clients from using DRI page flipping. If this option is set, the default value of the property is 'on' or 'off' accordingly. If this option isn't set, the default value of the property is diff -Nru xserver-xorg-video-amdgpu-1.3.99+git1708010148.35106fc~x~padoka0/src/amdgpu_dri2.c xserver-xorg-video-amdgpu-1.3.99+git1708141159.9caa9dd~x~padoka0/src/amdgpu_dri2.c --- xserver-xorg-video-amdgpu-1.3.99+git1708010148.35106fc~x~padoka0/src/amdgpu_dri2.c 2017-08-01 04:48:03.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.3.99+git1708141159.9caa9dd~x~padoka0/src/amdgpu_dri2.c 2017-08-14 14:48:43.000000000 +0000 @@ -600,18 +600,6 @@ struct dri2_buffer_priv *back_priv = back->driverPrivate; PixmapPtr front_pixmap; PixmapPtr back_pixmap = back_priv->pixmap; - xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - int i; - - for (i = 0; i < xf86_config->num_crtc; i++) { - xf86CrtcPtr crtc = xf86_config->crtc[i]; - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - - if (crtc->enabled && - (crtc->rotatedData || - drmmode_crtc->scanout[drmmode_crtc->scanout_id].bo)) - return FALSE; - } if (!update_front(draw, front)) return FALSE; @@ -635,9 +623,10 @@ } static Bool -can_flip(ScrnInfoPtr pScrn, DrawablePtr draw, +can_flip(xf86CrtcPtr crtc, DrawablePtr draw, DRI2BufferPtr front, DRI2BufferPtr back) { + ScrnInfoPtr pScrn = crtc->scrn; AMDGPUInfoPtr info = AMDGPUPTR(pScrn); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int num_crtcs_on; @@ -652,18 +641,10 @@ return FALSE; for (i = 0, num_crtcs_on = 0; i < config->num_crtc; i++) { - xf86CrtcPtr crtc = config->crtc[i]; - drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - - if (!crtc->enabled) - continue; - - if (!drmmode_crtc || drmmode_crtc->rotate.bo || - drmmode_crtc->scanout[drmmode_crtc->scanout_id].bo) - return FALSE; - - if (drmmode_crtc->pending_dpms_mode == DPMSModeOn) + if (drmmode_crtc_can_flip(config->crtc[i])) num_crtcs_on++; + else if (config->crtc[i] == crtc) + return FALSE; } return num_crtcs_on > 0 && can_exchange(pScrn, draw, front, back); @@ -748,7 +729,7 @@ switch (event->type) { case DRI2_FLIP: - if (can_flip(scrn, drawable, event->front, event->back) && + if (can_flip(crtc, drawable, event->front, event->back) && amdgpu_dri2_schedule_flip(crtc, event->client, drawable, @@ -1240,7 +1221,7 @@ current_msc &= 0xffffffff; /* Flips need to be submitted one frame before */ - if (can_flip(scrn, draw, front, back)) { + if (can_flip(crtc, draw, front, back)) { swap_info->type = DRI2_FLIP; flip = 1; } diff -Nru xserver-xorg-video-amdgpu-1.3.99+git1708010148.35106fc~x~padoka0/src/amdgpu_kms.c xserver-xorg-video-amdgpu-1.3.99+git1708141159.9caa9dd~x~padoka0/src/amdgpu_kms.c --- xserver-xorg-video-amdgpu-1.3.99+git1708010148.35106fc~x~padoka0/src/amdgpu_kms.c 2017-08-01 04:48:03.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.3.99+git1708141159.9caa9dd~x~padoka0/src/amdgpu_kms.c 2017-08-14 14:48:43.000000000 +0000 @@ -877,7 +877,7 @@ GCPtr gc = GetScratchGC(pDraw->depth, pScreen); ValidateGC(pDraw, gc); - (*gc->ops->CopyArea)(&pScreen->GetScreenPixmap(pScreen)->drawable, + (*gc->ops->CopyArea)(&pScreen->GetWindowPixmap(pScreen->root)->drawable, pDraw, gc, xf86_crtc->x + extents.x1, xf86_crtc->y + extents.y1, extents.x2 - extents.x1, extents.y2 - extents.y1, diff -Nru xserver-xorg-video-amdgpu-1.3.99+git1708010148.35106fc~x~padoka0/src/amdgpu_present.c xserver-xorg-video-amdgpu-1.3.99+git1708141159.9caa9dd~x~padoka0/src/amdgpu_present.c --- xserver-xorg-video-amdgpu-1.3.99+git1708010148.35106fc~x~padoka0/src/amdgpu_present.c 2017-08-01 04:48:03.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.3.99+git1708141159.9caa9dd~x~padoka0/src/amdgpu_present.c 2017-08-14 14:48:43.000000000 +0000 @@ -228,16 +228,7 @@ 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 || - drmmode_crtc->scanout[drmmode_crtc->scanout_id].bo) - return FALSE; - - if (drmmode_crtc->pending_dpms_mode == DPMSModeOn) + if (drmmode_crtc_can_flip(config->crtc[i])) num_crtcs_on++; } @@ -271,6 +262,9 @@ amdgpu_pixmap_get_tiling_info(screen->GetScreenPixmap(screen))) return FALSE; + if (!drmmode_crtc_can_flip(crtc->devPrivate)) + return FALSE; + return amdgpu_present_check_unflip(scrn); } diff -Nru xserver-xorg-video-amdgpu-1.3.99+git1708010148.35106fc~x~padoka0/src/drmmode_display.c xserver-xorg-video-amdgpu-1.3.99+git1708141159.9caa9dd~x~padoka0/src/drmmode_display.c --- xserver-xorg-video-amdgpu-1.3.99+git1708010148.35106fc~x~padoka0/src/drmmode_display.c 2017-08-01 04:48:03.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.3.99+git1708141159.9caa9dd~x~padoka0/src/drmmode_display.c 2017-08-14 14:48:43.000000000 +0000 @@ -471,11 +471,8 @@ &drmmode_crtc->scanout[1]); } - if (drmmode_crtc->scanout_damage) { + if (drmmode_crtc->scanout_damage) DamageDestroy(drmmode_crtc->scanout_damage); - drmmode_crtc->scanout_damage = NULL; - RegionUninit(&drmmode_crtc->scanout_last_region); - } } void @@ -543,6 +540,15 @@ damage->damage.data = NULL; } +static void +drmmode_screen_damage_destroy(DamagePtr damage, void *closure) +{ + drmmode_crtc_private_ptr drmmode_crtc = closure; + + drmmode_crtc->scanout_damage = NULL; + RegionUninit(&drmmode_crtc->scanout_last_region); +} + static Bool drmmode_can_use_hw_cursor(xf86CrtcPtr crtc) { @@ -730,9 +736,10 @@ if (!drmmode_crtc->scanout_damage) { drmmode_crtc->scanout_damage = DamageCreate(amdgpu_screen_damage_report, - NULL, DamageReportRawRegion, - TRUE, screen, NULL); - DamageRegister(&screen->GetScreenPixmap(screen)->drawable, + drmmode_screen_damage_destroy, + DamageReportRawRegion, + TRUE, screen, drmmode_crtc); + DamageRegister(&screen->root->drawable, drmmode_crtc->scanout_damage); } @@ -2807,7 +2814,7 @@ for (i = 0; i < config->num_crtc; i++) { crtc = config->crtc[i]; - if (!crtc->enabled) + if (!drmmode_crtc_can_flip(crtc)) continue; flipdata->flip_count++; diff -Nru xserver-xorg-video-amdgpu-1.3.99+git1708010148.35106fc~x~padoka0/src/drmmode_display.h xserver-xorg-video-amdgpu-1.3.99+git1708141159.9caa9dd~x~padoka0/src/drmmode_display.h --- xserver-xorg-video-amdgpu-1.3.99+git1708010148.35106fc~x~padoka0/src/drmmode_display.h 2017-08-01 04:48:03.000000000 +0000 +++ xserver-xorg-video-amdgpu-1.3.99+git1708141159.9caa9dd~x~padoka0/src/drmmode_display.h 2017-08-14 14:48:43.000000000 +0000 @@ -132,6 +132,19 @@ }; +/* Can the page flip ioctl be used for this CRTC? */ +static inline Bool +drmmode_crtc_can_flip(xf86CrtcPtr crtc) +{ + drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + + return crtc->enabled && + drmmode_crtc->pending_dpms_mode == DPMSModeOn && + !drmmode_crtc->rotate.bo && + !drmmode_crtc->scanout[drmmode_crtc->scanout_id].bo; +} + + static inline void drmmode_fb_reference_loc(int drm_fd, struct drmmode_fb **old, struct drmmode_fb *new, const char *caller, unsigned line)