diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-05-14 08:42:48 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-05-14 11:01:29 +0100 |
commit | 09e26d38e9eca33e27fd0b30524e75814d5d3ad9 (patch) | |
tree | b79a36c4b7edf6281ddae19aa0123df274b38e7d /src/sna/sna_accel.c | |
parent | 7303c6c75df135d2d01f126f240a270ad26201c6 (diff) |
sna: Avoid promoting SHM Pixmaps for DRI
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_accel.c')
-rw-r--r-- | src/sna/sna_accel.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 61210b12..ef0c5ef1 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -959,11 +959,14 @@ fallback: } pixmap = create_pixmap_hdr(sna, screen, width, height, depth, 0, &priv); - if (pixmap == NullPixmap) + if (pixmap == NullPixmap) { + DBG(("%s: allocation failed\n", __FUNCTION__)); goto fallback; + } priv->cpu_bo = kgem_create_map(&sna->kgem, addr, pitch*height, false); if (priv->cpu_bo == NULL) { + DBG(("%s: mapping SHM segment failed\n", __FUNCTION__)); priv->header = true; sna_pixmap_destroy(pixmap); goto fallback; @@ -1001,7 +1004,7 @@ sna_pixmap_create_unattached(ScreenPtr screen, { return create_pixmap(to_sna_from_screen(screen), screen, width, height, depth, - CREATE_PIXMAP_USAGE_SCRATCH); + -1); } static PixmapPtr @@ -3074,6 +3077,11 @@ __sna_pixmap_for_gpu(struct sna *sna, PixmapPtr pixmap, unsigned flags) if ((flags & __MOVE_DRI) == 0) return NULL; + if (pixmap->usage_hint == -1) { + DBG(("%s: not promoting SHM Pixmap for DRI\n", __FUNCTION__)); + return NULL; + } + DBG(("%s: forcing the creation on the GPU\n", __FUNCTION__)); priv = sna_pixmap_attach(pixmap); |