diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-06 15:47:47 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-06 17:50:01 +0000 |
commit | c085de905c30cb5bae6b339841badf1e105c6ee6 (patch) | |
tree | 6161a50fe4cf86c57ac45b628a09186ef25d1a1e | |
parent | 9f1935bb4e894264053d94e53c99d5ad607700fb (diff) |
sna: Also mark a bo created by force-to-gpu as being all-damaged
Similar to the action taken into move-to-gpu so that we forgo the
overhead of damage tracking when the initial act of creation is on the
render paths.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 7ae76eba..e3816b39 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1507,6 +1507,20 @@ sna_pixmap_force_to_gpu(PixmapPtr pixmap, unsigned flags) return NULL; DBG(("%s: created gpu bo\n", __FUNCTION__)); + + if (flags & MOVE_WRITE && priv->cpu_damage == NULL) { + /* Presume that we will only ever write to the GPU + * bo. Readbacks are expensive but fairly constant + * in cost for all sizes i.e. it is the act of + * synchronisation that takes the most time. This is + * mitigated by avoiding fallbacks in the first place. + */ + sna_damage_all(&priv->gpu_damage, + pixmap->drawable.width, + pixmap->drawable.height); + DBG(("%s: marking as all-damaged for GPU\n", + __FUNCTION__)); + } } if (!sna_pixmap_move_to_gpu(pixmap, flags)) @@ -1557,6 +1571,8 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags) sna_damage_all(&priv->gpu_damage, pixmap->drawable.width, pixmap->drawable.height); + DBG(("%s: marking as all-damaged for GPU\n", + __FUNCTION__)); } } |