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>
This commit is contained in:
Ben Skeggs
2017-12-14 11:19:27 +10:00
parent f29f18eb95
commit 74a39954a4
4 changed files with 43 additions and 17 deletions

View File

@@ -156,8 +156,8 @@ struct nouveau_drm {
struct nvif_object copy;
int mtrr;
int type_vram;
int type_host;
int type_ncoh;
int type_host[2];
int type_ncoh[2];
} ttm;
/* GEM interface support */
@@ -216,6 +216,13 @@ nouveau_drm(struct drm_device *dev)
return dev->dev_private;
}
static inline bool
nouveau_drm_use_coherent_gpu_mapping(struct nouveau_drm *drm)
{
struct nvif_mmu *mmu = &drm->client.mmu;
return !(mmu->type[drm->ttm.type_host[0]].type & NVIF_MEM_UNCACHED);
}
int nouveau_pmops_suspend(struct device *);
int nouveau_pmops_resume(struct device *);
bool nouveau_pmops_runtime(void);