diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2017-12-14 04:19:27 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2017-12-19 03:16:37 +0300 |
commit | 74a39954a4900a7dea7010e3063e2bf16b23934b (patch) | |
tree | f0f9dca38aec24eacabe89fa6cfb1b06d335627c /drivers/gpu/drm/nouveau/nouveau_mem.c | |
parent | f29f18eb952bc3e71deedf8bd8fc902f66853c48 (diff) | |
download | linux-74a39954a4900a7dea7010e3063e2bf16b23934b.tar.xz |
drm/nouveau: use alternate memory type for system-memory buffers with kind != 0
Fixes bug on Tegra where we'd strip kind information from system memory
(ie. all) buffers, resulting in misrendering.
Behaviour on dGPU should be unchanged.
Reported-by: Thierry Reding <treding@nvidia.com>
Fixes: d7722134b8 ("drm/nouveau: switch over to new memory and vmm interfaces")
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Tested-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_mem.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_mem.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c index 589a9621db76..c002f8968507 100644 --- a/drivers/gpu/drm/nouveau/nouveau_mem.c +++ b/drivers/gpu/drm/nouveau/nouveau_mem.c @@ -103,10 +103,10 @@ nouveau_mem_host(struct ttm_mem_reg *reg, struct ttm_dma_tt *tt) u8 type; int ret; - if (mmu->type[drm->ttm.type_host].type & NVIF_MEM_UNCACHED) - type = drm->ttm.type_ncoh; + if (!nouveau_drm_use_coherent_gpu_mapping(drm)) + type = drm->ttm.type_ncoh[!!mem->kind]; else - type = drm->ttm.type_host; + type = drm->ttm.type_host[0]; if (mem->kind && !(mmu->type[type].type & NVIF_MEM_KIND)) mem->comp = mem->kind = 0; |