summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2009-10-19 09:04:37 +1000
committerBen Skeggs <bskeggs@redhat.com>2009-10-19 09:07:45 +1000
commitfdd960a95cca00b19d912a437a2ca3e69fee017e (patch)
tree38e87f89ac47328947f0a085c194205cce05e0a0
parent3a387a983ec40cd443e22c1f8d9a6b5b5a8fa0d1 (diff)
nouveau: function to return status of bo being referenced in pushbuf
Will be used to implement gallium's is_{texture,buffer}_referenced() callbacks properly. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--libdrm/nouveau/nouveau_bo.c18
-rw-r--r--libdrm/nouveau/nouveau_bo.h3
2 files changed, 21 insertions, 0 deletions
diff --git a/libdrm/nouveau/nouveau_bo.c b/libdrm/nouveau/nouveau_bo.c
index 520d5d73..b7e6d867 100644
--- a/libdrm/nouveau/nouveau_bo.c
+++ b/libdrm/nouveau/nouveau_bo.c
@@ -552,6 +552,24 @@ nouveau_bo_busy(struct nouveau_bo *bo, uint32_t access)
return nouveau_bo_wait(bo, (access & NOUVEAU_BO_WR), 1, 1);
}
+uint32_t
+nouveau_bo_pending(struct nouveau_bo *bo)
+{
+ struct nouveau_bo_priv *nvbo = nouveau_bo(bo);
+ uint32_t flags;
+
+ if (!nvbo->pending)
+ return 0;
+
+ flags = 0;
+ if (nvbo->pending->read_domains)
+ flags |= NOUVEAU_BO_RD;
+ if (nvbo->pending->write_domains)
+ flags |= NOUVEAU_BO_WR;
+
+ return flags;
+}
+
struct drm_nouveau_gem_pushbuf_bo *
nouveau_bo_emit_buffer(struct nouveau_channel *chan, struct nouveau_bo *bo)
{
diff --git a/libdrm/nouveau/nouveau_bo.h b/libdrm/nouveau/nouveau_bo.h
index 97ad2d7b..fdad63ef 100644
--- a/libdrm/nouveau/nouveau_bo.h
+++ b/libdrm/nouveau/nouveau_bo.h
@@ -106,4 +106,7 @@ nouveau_bo_unpin(struct nouveau_bo *);
int
nouveau_bo_busy(struct nouveau_bo *, uint32_t access);
+uint32_t
+nouveau_bo_pending(struct nouveau_bo *);
+
#endif