summaryrefslogtreecommitdiff
path: root/src/sna/kgem.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-06 16:58:45 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-06 22:13:06 +0100
commita378196fddcf3043257a7e56225060e5e36cfa7b (patch)
treeed81ef5b38f383c6619f695e825a90db5b988a0b /src/sna/kgem.h
parent23840bd329cf4da3a4bdd5a1a466125a95473534 (diff)
sna: Auto-retire upload proxies
This was disabled in commit 9f4f855ba37966fb91d31e9081d03cf72affb154 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon May 26 07:06:18 2014 +0100 sna: Implicit release of upload buffers considered bad as retiring the buffers during the command setup could free one of the earlier bo used in the command. But discarding the snooped bo could still be advantageous. So restore the automatic discard of upload proxies, but make sure we only do between operations. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Matti Hämäläinen <ccr@tnsp.org>
Diffstat (limited to 'src/sna/kgem.h')
-rw-r--r--src/sna/kgem.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 370894be..a52287d1 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -260,6 +260,7 @@ struct kgem_bo *kgem_upload_source_image(struct kgem *kgem,
const void *data,
const BoxRec *box,
int stride, int bpp);
+void kgem_proxy_bo_attach(struct kgem_bo *bo, struct kgem_bo **ptr);
int kgem_choose_tiling(struct kgem *kgem,
int tiling, int width, int height, int bpp);
@@ -316,6 +317,21 @@ uint32_t kgem_bo_get_binding(struct kgem_bo *bo, uint32_t format);
void kgem_bo_set_binding(struct kgem_bo *bo, uint32_t format, uint16_t offset);
bool kgem_retire(struct kgem *kgem);
+void kgem_retire__buffers(struct kgem *kgem);
+
+static inline bool kgem_bo_discard_cache(struct kgem_bo *bo, bool force)
+{
+ if (bo == NULL || bo->proxy == NULL)
+ return false;
+
+ if (force)
+ return true;
+
+ if (bo->proxy->rq)
+ return false;
+
+ return bo->snoop;
+}
bool __kgem_ring_is_idle(struct kgem *kgem, int ring);
static inline bool kgem_ring_is_idle(struct kgem *kgem, int ring)