aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2014-10-27 05:49:16 -0400
committerBen Skeggs <bskeggs@redhat.com>2014-12-02 00:43:59 -0500
commitc5d7ddf70a8445f711f5ab9ab92bd4f59f993262 (patch)
treeeb8202e6d766ab0e7879e4b4ee031ea46edb6cbd
parent5be5a15a43642de7e10d17da0c172ea2d28d22c4 (diff)
drm/nouveau: 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>
-rw-r--r--drivers/gpu/drm/nouveau/core/include/core/device.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/core/include/core/device.h b/drivers/gpu/drm/nouveau/core/include/core/device.h
index 1d9d893929bb..0d839e1ddaf4 100644
--- a/drivers/gpu/drm/nouveau/core/include/core/device.h
+++ b/drivers/gpu/drm/nouveau/core/include/core/device.h
@@ -158,6 +158,12 @@ nv_device_is_pci(struct nouveau_device *device)
158 return device->pdev != NULL; 158 return device->pdev != NULL;
159} 159}
160 160
161static inline bool
162nv_device_is_cpu_coherent(struct nouveau_device *device)
163{
164 return (!IS_ENABLED(CONFIG_ARM) && nv_device_is_pci(device));
165}
166
161static inline struct device * 167static inline struct device *
162nv_device_base(struct nouveau_device *device) 168nv_device_base(struct nouveau_device *device)
163{ 169{