diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-22 15:04:22 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-22 15:09:40 +0000 |
commit | f68a99a55e1e63d7e76a13a7b77b4bb3f7802b9e (patch) | |
tree | f8abc9c6cf09cfde018f0cc61ad166577e46c3a0 | |
parent | 1f2cd536bc712843233de3f5c50802c388d63c72 (diff) |
sna: Mark fresh GPU only bo as being all damaged
Presume that we will not fallback and so treat a GPU only bo (one that
is initially created on the GPU) as being all-damaged. This makes future
operations cheaper as the damage tracking overhead is much reduced, and
the cost of the first readback will mainly be in the synchronisation
overhead.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 27fd3546..8756fab3 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1347,6 +1347,18 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap) assert(list_is_empty(&priv->list)); return NULL; } + + if (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); + } } if (priv->cpu_damage == NULL) |