Package: release.debian.org Severity: normal User: release.debian....@packages.debian.org Usertags: unblock
Please unblock package xserver-xorg-video-ati It forwards the git snapshot upload 1:18.1.99+git20190207-1 to the final release including additional fixes and another small stable release with further fixes. >From the Debian changelog: xserver-xorg-video-ati (1:19.0.1-1) unstable; urgency=medium [ Timo Aaltonen ] * New bugfix release. - Use radeon_finish in drmmode_crtc_scanout_update. Fixes a crash if using exa acceleration (Closes: #924540). - Revert "glamor: Avoid glamor_create_pixmap for pixmaps backing windows". Fixes visual corruption issues (LP: #1822075). -- Andreas Boll <ab...@debian.org> Sat, 06 Apr 2019 21:38:04 +0200 xserver-xorg-video-ati (1:19.0.0-1) unstable; urgency=medium * New upstream release. -- Timo Aaltonen <tjaal...@debian.org> Tue, 12 Mar 2019 18:40:57 +0200 xserver-xorg-video-ati (1:18.1.99+git20190207-1) unstable; urgency=medium I've attached a git-diff with the following command: git diff xserver-xorg-video-ati-1_18.1.99+git20190207-1..xserver-xorg-video-ati-1_19.0.1-1 Further I've attached the output of git-shortlog to list all commit titles. unblock xserver-xorg-video-ati/1:19.0.1-1 Thanks, Andreas
diff --git a/configure.ac b/configure.ac index 84f25cfd..49e82fc8 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-video-ati], - [18.1.99], + [19.0.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/Radeon], [xf86-video-ati]) diff --git a/debian/changelog b/debian/changelog index 6d2f0e6f..0c3bda3a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,20 @@ +xserver-xorg-video-ati (1:19.0.1-1) unstable; urgency=medium + + [ Timo Aaltonen ] + * New bugfix release. + - Use radeon_finish in drmmode_crtc_scanout_update. Fixes a crash if + using exa acceleration (Closes: #924540). + - Revert "glamor: Avoid glamor_create_pixmap for pixmaps backing + windows". Fixes visual corruption issues (LP: #1822075). + + -- Andreas Boll <ab...@debian.org> Sat, 06 Apr 2019 21:38:04 +0200 + +xserver-xorg-video-ati (1:19.0.0-1) unstable; urgency=medium + + * New upstream release. + + -- Timo Aaltonen <tjaal...@debian.org> Tue, 12 Mar 2019 18:40:57 +0200 + xserver-xorg-video-ati (1:18.1.99+git20190207-1) unstable; urgency=medium * New upstream snapshot. diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 71f3539f..0e9e2474 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -785,7 +785,7 @@ drmmode_crtc_scanout_update(xf86CrtcPtr crtc, DisplayModePtr mode, screen->GetWindowPixmap(screen->root), extents)) { RegionEmpty(DamageRegion(drmmode_crtc->scanout_damage)); - radeon_glamor_finish(scrn); + radeon_finish(scrn, drmmode_crtc->scanout[scanout_id].bo); if (!drmmode_crtc->flip_pending) { radeon_drm_abort_entry(drmmode_crtc-> @@ -1576,6 +1576,51 @@ drmmode_output_mode_valid(xf86OutputPtr output, DisplayModePtr pModes) return MODE_OK; } +static void +drmmode_output_attach_tile(xf86OutputPtr output) +{ +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1, 17, 99, 901, 0) + drmmode_output_private_ptr drmmode_output = output->driver_private; + drmModeConnectorPtr koutput = drmmode_output->mode_output; + RADEONEntPtr pRADEONEnt = RADEONEntPriv(output->scrn); + struct xf86CrtcTileInfo tile_info, *set = NULL; + int i; + + if (!koutput) { + xf86OutputSetTile(output, NULL); + return; + } + + /* look for a TILE property */ + for (i = 0; i < koutput->count_props; i++) { + drmModePropertyPtr props; + props = drmModeGetProperty(pRADEONEnt->fd, koutput->props[i]); + if (!props) + continue; + + if (!(props->flags & DRM_MODE_PROP_BLOB)) { + drmModeFreeProperty(props); + continue; + } + + if (!strcmp(props->name, "TILE")) { + drmModeFreePropertyBlob(drmmode_output->tile_blob); + drmmode_output->tile_blob = + drmModeGetPropertyBlob(pRADEONEnt->fd, + koutput->prop_values[i]); + } + drmModeFreeProperty(props); + } + if (drmmode_output->tile_blob) { + if (xf86OutputParseKMSTile(drmmode_output->tile_blob->data, + drmmode_output->tile_blob->length, + &tile_info) == TRUE) + set = &tile_info; + } + xf86OutputSetTile(output, set); +#endif +} + static int koutput_get_prop_idx(int fd, drmModeConnectorPtr koutput, int type, const char *name) @@ -1648,6 +1693,8 @@ drmmode_output_get_modes(xf86OutputPtr output) } xf86OutputSetEDID(output, mon); + drmmode_output_attach_tile(output); + /* modes should already be available */ for (i = 0; i < koutput->count_modes; i++) { Mode = xnfalloc(sizeof(DisplayModeRec)); @@ -1665,8 +1712,11 @@ drmmode_output_destroy(xf86OutputPtr output) drmmode_output_private_ptr drmmode_output = output->driver_private; int i; - if (drmmode_output->edid_blob) - drmModeFreePropertyBlob(drmmode_output->edid_blob); + drmModeFreePropertyBlob(drmmode_output->edid_blob); +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1, 17, 99, 901, 0) + drmModeFreePropertyBlob(drmmode_output->tile_blob); +#endif + for (i = 0; i < drmmode_output->num_props; i++) { drmModeFreeProperty(drmmode_output->props[i].mode_prop); free(drmmode_output->props[i].atoms); @@ -2651,12 +2701,14 @@ drmmode_flip_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec, void *even flipdata->fe_usec = usec; } - if (drmmode_crtc->flip_pending == *fb) { - drmmode_fb_reference(pRADEONEnt->fd, - &drmmode_crtc->flip_pending, NULL); + if (*fb) { + if (drmmode_crtc->flip_pending == *fb) { + drmmode_fb_reference(pRADEONEnt->fd, + &drmmode_crtc->flip_pending, NULL); + } + drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->fb, *fb); + drmmode_fb_reference(pRADEONEnt->fd, fb, NULL); } - drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->fb, *fb); - drmmode_fb_reference(pRADEONEnt->fd, fb, NULL); if (--flipdata->flip_count == 0) { /* Deliver MSC & UST from reference/current CRTC to flip event @@ -3492,9 +3544,10 @@ Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr client, drmmode_crtc->ignore_damage = TRUE; } - next: drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->flip_pending, flipdata->fb[crtc_id]); + + next: drm_queue_seq = 0; } diff --git a/src/drmmode_display.h b/src/drmmode_display.h index 2c2c3d57..96eaef0a 100644 --- a/src/drmmode_display.h +++ b/src/drmmode_display.h @@ -142,6 +142,9 @@ typedef struct { drmModeConnectorPtr mode_output; drmModeEncoderPtr *mode_encoders; drmModePropertyBlobPtr edid_blob; +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1, 17, 99, 901, 0) + drmModePropertyBlobPtr tile_blob; +#endif int dpms_enum_id; int num_props; drmmode_prop_ptr props; diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c index 922ed4fb..a9f14e8d 100644 --- a/src/radeon_dri2.c +++ b/src/radeon_dri2.c @@ -252,6 +252,12 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen, } else if (is_glamor_pixmap) { pixmap = radeon_glamor_set_pixmap_bo(drawable, pixmap); pixmap->refcnt++; + + /* The copy operation from radeon_glamor_set_pixmap_bo needs to + * be flushed to the kernel driver before the client starts + * using the pixmap storage for direct rendering. + */ + radeon_cs_flush_indirect(pScrn); } if (!radeon_get_flink_name(pRADEONEnt, pixmap, &buffers->name)) @@ -973,12 +979,18 @@ CARD32 radeon_dri2_deferred_event(OsTimerPtr timer, CARD32 now, pointer data) if (ret) { xf86DrvMsg(scrn->scrnIndex, X_ERROR, "%s cannot get current time\n", __func__); - if (event_info->drm_queue_seq) + + if (event_info->drm_queue_seq) { drmmode_crtc->drmmode->event_context. vblank_handler(pRADEONEnt->fd, 0, 0, 0, (void*)event_info->drm_queue_seq); - else + drmmode_crtc->wait_flip_nesting_level++; + radeon_drm_queue_handle_deferred(crtc); + + } else { radeon_dri2_frame_event_handler(crtc, 0, 0, data); + } + return 0; } /* @@ -989,13 +1001,18 @@ CARD32 radeon_dri2_deferred_event(OsTimerPtr timer, CARD32 now, pointer data) delta_seq = delta_t * drmmode_crtc->dpms_last_fps; delta_seq /= 1000000; frame = (CARD64)drmmode_crtc->dpms_last_seq + delta_seq; - if (event_info->drm_queue_seq) + + if (event_info->drm_queue_seq) { drmmode_crtc->drmmode->event_context. vblank_handler(pRADEONEnt->fd, frame, drm_now / 1000000, drm_now % 1000000, (void*)event_info->drm_queue_seq); - else + drmmode_crtc->wait_flip_nesting_level++; + radeon_drm_queue_handle_deferred(crtc); + } else { radeon_dri2_frame_event_handler(crtc, frame, drm_now, data); + } + return 0; } diff --git a/src/radeon_dri3.c b/src/radeon_dri3.c index 25078bae..73353bf5 100644 --- a/src/radeon_dri3.c +++ b/src/radeon_dri3.c @@ -37,6 +37,7 @@ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> +#include <gbm.h> #include <errno.h> #include <libgen.h> @@ -218,8 +219,34 @@ static int radeon_dri3_fd_from_pixmap(ScreenPtr screen, ScrnInfoPtr scrn = xf86ScreenToScrn(screen); RADEONInfoPtr info = RADEONPTR(scrn); - if (info->use_glamor) - return glamor_fd_from_pixmap(screen, pixmap, stride, size); + if (info->use_glamor) { + Bool need_flush = TRUE; + int ret = -1; +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,19,99,904,0) + struct gbm_bo *gbm_bo = glamor_gbm_bo_from_pixmap(screen, pixmap); + + if (gbm_bo) { + ret = gbm_bo_get_fd(gbm_bo); + gbm_bo_destroy(gbm_bo); + + if (ret >= 0) + need_flush = FALSE; + } +#endif + + if (ret < 0) + ret = glamor_fd_from_pixmap(screen, pixmap, stride, size); + + /* glamor might have needed to reallocate the pixmap storage and + * copy the pixmap contents to the new storage. The copy + * operation needs to be flushed to the kernel driver before the + * client starts using the pixmap storage for direct rendering. + */ + if (ret >= 0 && need_flush) + radeon_cs_flush_indirect(scrn); + + return ret; + } #endif bo = radeon_get_pixmap_bo(pixmap); diff --git a/src/radeon_drm_queue.c b/src/radeon_drm_queue.c index d8a8243c..fc043605 100644 --- a/src/radeon_drm_queue.c +++ b/src/radeon_drm_queue.c @@ -30,6 +30,8 @@ #include "config.h" #endif +#include <errno.h> + #include <xorg-server.h> #include <X11/Xdefs.h> #include <list.h> @@ -277,7 +279,20 @@ radeon_drm_handle_event(int fd, drmEventContext *event_context) struct radeon_drm_queue_entry *e; int r; - r = drmHandleEvent(fd, event_context); + /* Retry drmHandleEvent if it was interrupted by a signal in read() */ + do { + r = drmHandleEvent(fd, event_context); + } while (r < 0 && (errno == EINTR || errno == EAGAIN)); + + if (r < 0) { + static Bool printed; + + if (!printed) { + ErrorF("%s: drmHandleEvent returned %d, errno=%d (%s)\n", + __func__, r, errno, strerror(errno)); + printed = TRUE; + } + } while (!xorg_list_is_empty(&radeon_drm_flip_signalled)) { e = xorg_list_first_entry(&radeon_drm_flip_signalled, @@ -310,7 +325,7 @@ void radeon_drm_wait_pending_flip(xf86CrtcPtr crtc) while (drmmode_crtc->flip_pending && radeon_drm_handle_event(pRADEONEnt->fd, - &drmmode_crtc->drmmode->event_context) > 0); + &drmmode_crtc->drmmode->event_context) >= 0); } /* diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 67f42e0f..ff4f8dcf 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -526,10 +526,14 @@ radeon_scanout_flip_abort(xf86CrtcPtr crtc, void *event_data) { RADEONEntPtr pRADEONEnt = RADEONEntPriv(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + struct drmmode_fb *fb = event_data; drmmode_crtc->scanout_update_pending = 0; - drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->flip_pending, - NULL); + + if (drmmode_crtc->flip_pending == fb) { + drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->flip_pending, + NULL); + } } static void @@ -538,9 +542,9 @@ radeon_scanout_flip_handler(xf86CrtcPtr crtc, uint32_t msc, uint64_t usec, { RADEONEntPtr pRADEONEnt = RADEONEntPriv(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; + struct drmmode_fb *fb = event_data; - drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->fb, - drmmode_crtc->flip_pending); + drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->fb, fb); radeon_scanout_flip_abort(crtc, event_data); } @@ -821,24 +825,31 @@ radeon_prime_scanout_flip(PixmapDirtyUpdatePtr ent) drmmode_crtc_private_ptr drmmode_crtc; uintptr_t drm_queue_seq; unsigned scanout_id; + struct drmmode_fb *fb; if (!crtc || !crtc->enabled) return; drmmode_crtc = crtc->driver_private; + scanout_id = drmmode_crtc->scanout_id ^ 1; if (drmmode_crtc->scanout_update_pending || - !drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap || + !drmmode_crtc->scanout[scanout_id].pixmap || drmmode_crtc->dpms_mode != DPMSModeOn) return; - scanout_id = drmmode_crtc->scanout_id ^ 1; if (!radeon_prime_scanout_do_update(crtc, scanout_id)) return; + fb = radeon_pixmap_get_fb(drmmode_crtc->scanout[scanout_id].pixmap); + if (!fb) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "Failed to get FB for PRIME flip.\n"); + return; + } + drm_queue_seq = radeon_drm_queue_alloc(crtc, RADEON_DRM_QUEUE_CLIENT_DEFAULT, - RADEON_DRM_QUEUE_ID_DEFAULT, - NULL, + RADEON_DRM_QUEUE_ID_DEFAULT, fb, radeon_scanout_flip_handler, radeon_scanout_flip_abort, TRUE); if (drm_queue_seq == RADEON_DRM_QUEUE_ERROR) { @@ -847,18 +858,9 @@ radeon_prime_scanout_flip(PixmapDirtyUpdatePtr ent) return; } - drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->flip_pending, - radeon_pixmap_get_fb(drmmode_crtc->scanout[scanout_id].pixmap)); - if (!drmmode_crtc->flip_pending) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "Failed to get FB for PRIME flip.\n"); - radeon_drm_abort_entry(drm_queue_seq); - return; - } - if (drmmode_page_flip_target_relative(pRADEONEnt, drmmode_crtc, - drmmode_crtc->flip_pending->handle, - 0, drm_queue_seq, 0) != 0) { + fb->handle, 0, drm_queue_seq, 1) + != 0) { if (!(drmmode_crtc->scanout_status & DRMMODE_SCANOUT_FLIP_FAILED)) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue failed in %s: %s, TearFree inactive\n", @@ -877,6 +879,7 @@ radeon_prime_scanout_flip(PixmapDirtyUpdatePtr ent) drmmode_crtc->scanout_id = scanout_id; drmmode_crtc->scanout_update_pending = drm_queue_seq; + drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->flip_pending, fb); } static void @@ -1137,6 +1140,7 @@ radeon_scanout_flip(ScreenPtr pScreen, RADEONInfoPtr info, RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn); uintptr_t drm_queue_seq; unsigned scanout_id; + struct drmmode_fb *fb; if (drmmode_crtc->scanout_update_pending || drmmode_crtc->flip_pending || @@ -1152,10 +1156,16 @@ radeon_scanout_flip(ScreenPtr pScreen, RADEONInfoPtr info, radeon_cs_flush_indirect(scrn); RegionEmpty(region); + fb = radeon_pixmap_get_fb(drmmode_crtc->scanout[scanout_id].pixmap); + if (!fb) { + xf86DrvMsg(scrn->scrnIndex, X_WARNING, + "Failed to get FB for scanout flip.\n"); + return; + } + drm_queue_seq = radeon_drm_queue_alloc(xf86_crtc, RADEON_DRM_QUEUE_CLIENT_DEFAULT, - RADEON_DRM_QUEUE_ID_DEFAULT, - NULL, + RADEON_DRM_QUEUE_ID_DEFAULT, fb, radeon_scanout_flip_handler, radeon_scanout_flip_abort, TRUE); if (drm_queue_seq == RADEON_DRM_QUEUE_ERROR) { @@ -1164,18 +1174,9 @@ radeon_scanout_flip(ScreenPtr pScreen, RADEONInfoPtr info, return; } - drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->flip_pending, - radeon_pixmap_get_fb(drmmode_crtc->scanout[scanout_id].pixmap)); - if (!drmmode_crtc->flip_pending) { - xf86DrvMsg(scrn->scrnIndex, X_WARNING, - "Failed to get FB for scanout flip.\n"); - radeon_drm_abort_entry(drm_queue_seq); - return; - } - if (drmmode_page_flip_target_relative(pRADEONEnt, drmmode_crtc, - drmmode_crtc->flip_pending->handle, - 0, drm_queue_seq, 0) != 0) { + fb->handle, 0, drm_queue_seq, 1) + != 0) { if (!(drmmode_crtc->scanout_status & DRMMODE_SCANOUT_FLIP_FAILED)) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, "flip queue failed in %s: %s, TearFree inactive\n", @@ -1201,6 +1202,7 @@ radeon_scanout_flip(ScreenPtr pScreen, RADEONInfoPtr info, drmmode_crtc->scanout_id = scanout_id; drmmode_crtc->scanout_update_pending = drm_queue_seq; + drmmode_fb_reference(pRADEONEnt->fd, &drmmode_crtc->flip_pending, fb); } static void RADEONBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL) diff --git a/src/radeon_present.c b/src/radeon_present.c index 0b55117e..38a9a6b7 100644 --- a/src/radeon_present.c +++ b/src/radeon_present.c @@ -256,7 +256,7 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, ScrnInfoPtr scrn = xf86_crtc->scrn; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); RADEONInfoPtr info = RADEONPTR(scrn); - PixmapPtr screen_pixmap; + PixmapPtr screen_pixmap = screen->GetScreenPixmap(screen); int num_crtcs_on; int i; @@ -272,10 +272,14 @@ radeon_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 */ - screen_pixmap = screen->GetScreenPixmap(screen); if (radeon_present_get_pixmap_tiling_flags(info, pixmap) != radeon_present_get_pixmap_tiling_flags(info, screen_pixmap)) return FALSE;
Andreas Boll (2): Extend changelog entry Upload to unstable Dave Airlie (1): modesetting: add tile property support Michel Dänzer (13): dri3: Flush if necessary in dri3_fd_from_pixmap dri2: Flush in dri2_create_buffer2 after calling glamor_set_pixmap_bo glamor: Avoid glamor_create_pixmap for pixmaps backing windows Don't allow TearFree scanout flips to complete in the same vblank period Only update drmmode_crtc->flip_pending after actually submitting a flip Call drmHandleEvent again if it was interrupted by a signal Keep waiting for a pending flip if drm_handle_event returns 0 present: Check that flip and screen pixmap pitches match dri2: Call drm_queue_handle_deferred in dri2_deferred_event Bump version for 19.0.0 release Revert "glamor: Avoid glamor_create_pixmap for pixmaps backing windows" Use radeon_finish in drmmode_crtc_scanout_update Bump version for 19.0.1 release Timo Aaltonen (6): Merge branch 'upstream-unstable' into debian-unstable bump the version release to unstable Merge branch 'upstream-unstable' into debian-unstable bump the version close some bugs