aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Courbot2015-05-21 01:08:28 -0500
committerMartin Peres2015-05-21 13:20:29 -0500
commita1acffd4e0968ffa65b673163574188a00c9ab7e (patch)
treeee10448a81d0dd01de719367eeff9559e7474040 /nouveau
parente9ea1f42d14e10852f292f3470aee260c7349978 (diff)
downloadexternal-libgbm-a1acffd4e0968ffa65b673163574188a00c9ab7e.tar.gz
external-libgbm-a1acffd4e0968ffa65b673163574188a00c9ab7e.tar.xz
external-libgbm-a1acffd4e0968ffa65b673163574188a00c9ab7e.zip
nouveau: add coherent BO attribute
Add a flag allowing Nouveau to specify that an object should be coherent at allocation time. This is required for some class of objects like fences which are randomly-accessed by both the CPU and GPU. This flag instructs the kernel driver to make sure the object remains coherent even on architectures for which coherency is not guaranteed by the bus. Reviewed-by: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Diffstat (limited to 'nouveau')
-rw-r--r--nouveau/abi16.c3
-rw-r--r--nouveau/nouveau.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/nouveau/abi16.c b/nouveau/abi16.c
index 538f3a73..4ca0bfba 100644
--- a/nouveau/abi16.c
+++ b/nouveau/abi16.c
@@ -195,6 +195,9 @@ abi16_bo_init(struct nouveau_bo *bo, uint32_t alignment,
195 if (bo->flags & NOUVEAU_BO_MAP) 195 if (bo->flags & NOUVEAU_BO_MAP)
196 info->domain |= NOUVEAU_GEM_DOMAIN_MAPPABLE; 196 info->domain |= NOUVEAU_GEM_DOMAIN_MAPPABLE;
197 197
198 if (bo->flags & NOUVEAU_BO_COHERENT)
199 info->domain |= NOUVEAU_GEM_DOMAIN_COHERENT;
200
198 if (!(bo->flags & NOUVEAU_BO_CONTIG)) 201 if (!(bo->flags & NOUVEAU_BO_CONTIG))
199 info->tile_flags = NOUVEAU_GEM_TILE_NONCONTIG; 202 info->tile_flags = NOUVEAU_GEM_TILE_NONCONTIG;
200 203
diff --git a/nouveau/nouveau.h b/nouveau/nouveau.h
index a55e2b02..4adda0e3 100644
--- a/nouveau/nouveau.h
+++ b/nouveau/nouveau.h
@@ -127,6 +127,7 @@ union nouveau_bo_config {
127#define NOUVEAU_BO_MAP 0x80000000 127#define NOUVEAU_BO_MAP 0x80000000
128#define NOUVEAU_BO_CONTIG 0x40000000 128#define NOUVEAU_BO_CONTIG 0x40000000
129#define NOUVEAU_BO_NOSNOOP 0x20000000 129#define NOUVEAU_BO_NOSNOOP 0x20000000
130#define NOUVEAU_BO_COHERENT 0x10000000
130 131
131struct nouveau_bo { 132struct nouveau_bo {
132 struct nouveau_device *device; 133 struct nouveau_device *device;