sna: Only use copy redisplay fast path if we have a source GPU bo

Odd as it may seem, but we can end up attempting to copy from a source
CRTC pixmap that is not on the GPU. Here we need to use the heavyweight
path to handle its composition normally.

Reported-by: Christoph Haag <haagch@frickel.club>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84653
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-10-05 08:12:52 +01:00
parent 7d60a9be3d
commit e50e1bb3fd
2 changed files with 16 additions and 4 deletions

View File

@ -938,6 +938,8 @@ create_pixmap_hdr(struct sna *sna, ScreenPtr screen,
pixmap->refcnt = 1;
}
DBG(("%s: pixmap=%ld, width=%d, height=%d, usage=%d\n", __FUNCTION__,
pixmap->drawable.serialNumber, width, height, usage));
pixmap->drawable.width = width;
pixmap->drawable.height = height;
pixmap->usage_hint = usage;
@ -1105,13 +1107,14 @@ sna_share_pixmap_backing(PixmapPtr pixmap, ScreenPtr slave, void **fd_handle)
struct kgem_bo *bo;
BoxRec box;
DBG(("%s: removing tiling %d, and aligning pitch for %dx%d pixmap=%ld\n",
__FUNCTION__, priv->gpu_bo->tiling,
DBG(("%s: removing tiling %d, and aligning pitch %d for %dx%d pixmap=%ld\n",
__FUNCTION__, priv->gpu_bo->tiling, priv->gpu_bo->pitch,
pixmap->drawable.width, pixmap->drawable.height,
pixmap->drawable.serialNumber));
if (priv->pinned) {
DBG(("%s: can't convert pinned bo\n", __FUNCTION__));
DBG(("%s: can't convert pinned %x bo\n", __FUNCTION__,
priv->pinned));
return FALSE;
}
@ -1222,7 +1225,8 @@ sna_create_pixmap_shared(struct sna *sna, ScreenPtr screen,
PixmapPtr pixmap;
struct sna_pixmap *priv;
DBG(("%s: depth=%d\n", __FUNCTION__, depth));
DBG(("%s: width=%d, height=%d, depth=%d\n",
__FUNCTION__, width, height, depth));
/* Create a stub to be attached later */
pixmap = create_pixmap_hdr(sna, screen,

View File

@ -6559,10 +6559,17 @@ inline static DrawablePtr crtc_source(xf86CrtcPtr crtc, int16_t *sx, int16_t *sy
{
struct sna_crtc *sna_crtc = to_sna_crtc(crtc);
if (sna_crtc->slave_pixmap) {
DBG(("%s: using slave pixmap=%ld, offset (%d, %d)\n",
__FUNCTION__,
sna_crtc->slave_pixmap->drawable.serialNumber,
-crtc->x, -crtc->y));
*sx = -crtc->x;
*sy = -crtc->y;
return &sna_crtc->slave_pixmap->drawable;
} else {
DBG(("%s: using Screen pixmap=%ld)\n",
__FUNCTION__,
to_sna(crtc->scrn)->front->drawable.serialNumber));
*sx = *sy = 0;
return &to_sna(crtc->scrn)->front->drawable;
}
@ -6793,6 +6800,7 @@ sna_crtc_redisplay(xf86CrtcPtr crtc, RegionPtr region, struct kgem_bo *bo)
}
if (crtc->filter == NULL &&
priv->gpu_bo &&
sna_transform_is_integer_translation(&crtc->crtc_to_framebuffer,
&tx, &ty)) {
DrawableRec tmp;