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>
main
Ben Skeggs 2009-10-19 09:04:37 +10:00
parent 3a387a983e
commit fdd960a95c
2 changed files with 21 additions and 0 deletions

View File

@ -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)
{

View File

@ -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