1 #include "pipe/p_defines.h"
2 #include "pipe/p_context.h"
4 #include "nouveau/nouveau_screen.h"
5 #include "nouveau/nouveau_context.h"
7 #include "nouveau/nouveau_bo.h"
10 nouveau_reference_flags(struct nouveau_bo *bo)
15 bo_flags = nouveau_bo_pending(bo);
16 if (bo_flags & NOUVEAU_BO_RD)
17 flags |= PIPE_REFERENCED_FOR_READ;
18 if (bo_flags & NOUVEAU_BO_WR)
19 flags |= PIPE_REFERENCED_FOR_WRITE;
25 nouveau_is_texture_referenced(struct pipe_context *pipe,
26 struct pipe_texture *pt,
27 unsigned face, unsigned level)
29 struct nouveau_miptree *mt = nouveau_miptree(pt);
31 return nouveau_reference_flags(mt->bo);
35 nouveau_is_buffer_referenced(struct pipe_context *pipe, struct pipe_buffer *pb)
37 struct nouveau_bo *bo = nouveau_bo(pb);
39 return nouveau_reference_flags(bo);