summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Courbot <acourbot@nvidia.com>2016-04-11 16:57:43 +0900
committerAlexandre Courbot <acourbot@nvidia.com>2016-07-13 15:25:04 +0900
commita3b5043d1f50e3d572b5fe3cca7c96bc1a3f57c3 (patch)
treea23d9fb34b6ee8e56ad0a8243bd0755a5bc61de7
parentc6428e4fd8f0f894b2f0bc1ac5baa95f241a497b (diff)
downloadnouveau-staging/bo.tar.gz
bus: remove cpu_coherent flagstaging/bo
This flag's only remaining function is to ignore the uncached flag for BOs on coherent architectures. However the reason for allocating an object uncache on a non-coherent architecture (namely because the cost of doing explicit flushes/ invalidations is higher than the benefit of caching the data because accesses are few and far between) should also apply on architectures for which coherency is maintained implicitly. Thus allocate coherent objects as uncached on all architectures. Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
-rw-r--r--drm/nouveau/include/nvkm/core/device.h1
-rw-r--r--drm/nouveau/nouveau_bo.c3
-rw-r--r--drm/nouveau/nvkm/engine/device/pci.c1
-rw-r--r--drm/nouveau/nvkm/engine/device/tegra.c1
-rw-r--r--lib/include/nvif/os.h6
5 files changed, 1 insertions, 11 deletions
diff --git a/drm/nouveau/include/nvkm/core/device.h b/drm/nouveau/include/nvkm/core/device.h
index 6bc712f32..7ea8aa7ca 100644
--- a/drm/nouveau/include/nvkm/core/device.h
+++ b/drm/nouveau/include/nvkm/core/device.h
@@ -175,7 +175,6 @@ struct nvkm_device_func {
void (*fini)(struct nvkm_device *, bool suspend);
resource_size_t (*resource_addr)(struct nvkm_device *, unsigned bar);
resource_size_t (*resource_size)(struct nvkm_device *, unsigned bar);
- bool cpu_coherent;
};
struct nvkm_device_quirk {
diff --git a/drm/nouveau/nouveau_bo.c b/drm/nouveau/nouveau_bo.c
index 711592798..fbb603623 100644
--- a/drm/nouveau/nouveau_bo.c
+++ b/drm/nouveau/nouveau_bo.c
@@ -209,8 +209,7 @@ nouveau_bo_new(struct drm_device *dev, int size, int align,
nvbo->tile_flags = tile_flags;
nvbo->bo.bdev = &drm->ttm.bdev;
- if (!nvxx_device(&drm->device)->func->cpu_coherent)
- nvbo->force_coherent = flags & TTM_PL_FLAG_UNCACHED;
+ nvbo->force_coherent = flags & TTM_PL_FLAG_UNCACHED;
nvbo->page_shift = 12;
if (drm->client.vm) {
diff --git a/drm/nouveau/nvkm/engine/device/pci.c b/drm/nouveau/nvkm/engine/device/pci.c
index 62ad0300c..b1b693219 100644
--- a/drm/nouveau/nvkm/engine/device/pci.c
+++ b/drm/nouveau/nvkm/engine/device/pci.c
@@ -1614,7 +1614,6 @@ nvkm_device_pci_func = {
.fini = nvkm_device_pci_fini,
.resource_addr = nvkm_device_pci_resource_addr,
.resource_size = nvkm_device_pci_resource_size,
- .cpu_coherent = !IS_ENABLED(CONFIG_ARM),
};
int
diff --git a/drm/nouveau/nvkm/engine/device/tegra.c b/drm/nouveau/nvkm/engine/device/tegra.c
index 9b638bd90..939682f18 100644
--- a/drm/nouveau/nvkm/engine/device/tegra.c
+++ b/drm/nouveau/nvkm/engine/device/tegra.c
@@ -245,7 +245,6 @@ nvkm_device_tegra_func = {
.fini = nvkm_device_tegra_fini,
.resource_addr = nvkm_device_tegra_resource_addr,
.resource_size = nvkm_device_tegra_resource_size,
- .cpu_coherent = false,
};
int
diff --git a/lib/include/nvif/os.h b/lib/include/nvif/os.h
index c265ab446..c13db8d0f 100644
--- a/lib/include/nvif/os.h
+++ b/lib/include/nvif/os.h
@@ -124,12 +124,6 @@ typedef dma_addr_t resource_size_t;
#define __printf(a,b)
#define __user
-#if defined(CONFIG_ARM)
-#define IS_ENABLED_CONFIG_ARM 1
-#else
-#define IS_ENABLED_CONFIG_ARM 0
-#endif
-
#if defined(CONFIG_IOMMU_API)
#define IS_ENABLED_CONFIG_IOMMU_API 1
#else