diff options
author | Alexandre Courbot <acourbot@nvidia.com> | 2014-10-27 18:49:16 +0900 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2014-12-02 15:37:21 +1000 |
commit | 880f6ad837b1511b3bd27ecfc4257446e307984e (patch) | |
tree | 6bc5daf4a2f988eed2cc7e6b5e9ed707039cd0c9 /nvkm | |
parent | 8603ed7bffb9dabf58653a34927c3a04970c1a53 (diff) | |
download | nouveau-880f6ad837b1511b3bd27ecfc4257446e307984e.tar.gz |
drm: introduce nv_device_is_cpu_coherent()
Add a function allowing us to know whether a device is CPU-coherent,
i.e. accesses performed by the CPU on GPU-mapped buffers will
be immediately visible on the GPU side and vice-versa.
For now, a device is considered to be coherent if it uses the PCI bus on
a non-ARM architecture.
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'nvkm')
-rw-r--r-- | nvkm/include/core/device.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nvkm/include/core/device.h b/nvkm/include/core/device.h index 1d9d89392..0d839e1dd 100644 --- a/nvkm/include/core/device.h +++ b/nvkm/include/core/device.h @@ -158,6 +158,12 @@ nv_device_is_pci(struct nouveau_device *device) return device->pdev != NULL; } +static inline bool +nv_device_is_cpu_coherent(struct nouveau_device *device) +{ + return (!IS_ENABLED(CONFIG_ARM) && nv_device_is_pci(device)); +} + static inline struct device * nv_device_base(struct nouveau_device *device) { |