diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-11-05 08:49:28 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-11-05 09:06:19 +0000 |
commit | dc61705a6e425952de4c81c2320382af07cf948a (patch) | |
tree | 438f68920eedf661bb9f3fba5a675632ac4e6a77 /src/sna/sna_accel.c | |
parent | f3225fcb38686f3b9701725bf3a11ecf1c100c3f (diff) |
sna: Use an inplace exchange for large untiled BO
On older architectures, large BO have to be untiled and so we can reuse
an existing CPU bo by adjusting its caching mode.
References: https://bugs.freedesktop.org/show_bug.cgi?id=70924
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 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 28cdd740..2aae0e2f 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -3772,6 +3772,20 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags) tiling = (flags & MOVE_SOURCE_HINT) ? I915_TILING_Y : DEFAULT_TILING; tiling = sna_pixmap_choose_tiling(pixmap, tiling); + if (tiling == I915_TILING_NONE && + priv->cpu_bo && !priv->shm && + kgem_bo_convert_to_gpu(&sna->kgem, priv->cpu_bo)) { + assert(!priv->mapped); + priv->gpu_bo = priv->cpu_bo; + priv->cpu_bo = NULL; + priv->ptr = NULL; + sna_damage_all(&priv->gpu_damage, + pixmap->drawable.width, + pixmap->drawable.height); + sna_damage_destroy(&priv->cpu_damage); + goto done; + } + create = 0; if (flags & MOVE_INPLACE_HINT || (priv->cpu_damage && priv->cpu_bo == NULL)) create = CREATE_GTT_MAP | CREATE_INACTIVE; |