Skip to content

Commit a79d384

Browse files
Ben SkeggsLyude
authored andcommitted
drm/nouveau/mmu/gp100: Remove unused/broken support for compression
From GP100 onwards it's not possible to initialise comptag RAM without PMU firmware, which nouveau has no support for. As such, this code is essentially a no-op and will always revert to the equivalent non-compressed kind due to comptag allocation failure. It's also broken for the needs of VM_BIND/Vulkan. Remove the code entirely to make way for supporting compression on GPUs that support GSM-RM. Signed-off-by: Ben Skeggs <bskeggs@nvidia.com> Signed-off-by: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com> Signed-off-by: Mary Guillemard <mary@mary.zone> Reviewed-by: Lyude Paul <lyude@redhat.com> Reviewed-by: James Jones <jajones@nvidia.com> Signed-off-by: Lyude Paul <lyude@redhat.com> Link: https://patch.msgid.link/20251110-nouveau-compv6-v6-3-83b05475f57c@mary.zone
1 parent c488a94 commit a79d384

2 files changed

Lines changed: 6 additions & 37 deletions

File tree

drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgp100.c

Lines changed: 4 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
*/
2222
#include "vmm.h"
2323

24-
#include <core/client.h>
2524
#include <subdev/fb.h>
26-
#include <subdev/ltc.h>
2725
#include <subdev/timer.h>
2826
#include <engine/gr.h>
2927

@@ -117,8 +115,6 @@ gp100_vmm_pgt_pte(struct nvkm_vmm *vmm, struct nvkm_mmu_pt *pt,
117115
{
118116
u64 data = (addr >> 4) | map->type;
119117

120-
map->type += ptes * map->ctag;
121-
122118
while (ptes--) {
123119
VMM_WO064(pt, vmm, ptei++ * 8, data);
124120
data += map->next;
@@ -142,7 +138,6 @@ gp100_vmm_pgt_dma(struct nvkm_vmm *vmm, struct nvkm_mmu_pt *pt,
142138
while (ptes--) {
143139
const u64 data = (*map->dma++ >> 4) | map->type;
144140
VMM_WO064(pt, vmm, ptei++ * 8, data);
145-
map->type += map->ctag;
146141
}
147142
nvkm_done(pt->memory);
148143
return;
@@ -200,8 +195,6 @@ gp100_vmm_pd0_pte(struct nvkm_vmm *vmm, struct nvkm_mmu_pt *pt,
200195
{
201196
u64 data = (addr >> 4) | map->type;
202197

203-
map->type += ptes * map->ctag;
204-
205198
while (ptes--) {
206199
VMM_WO128(pt, vmm, ptei++ * 0x10, data, 0ULL);
207200
data += map->next;
@@ -411,8 +404,6 @@ gp100_vmm_valid(struct nvkm_vmm *vmm, void *argv, u32 argc,
411404
struct gp100_vmm_map_vn vn;
412405
struct gp100_vmm_map_v0 v0;
413406
} *args = argv;
414-
struct nvkm_device *device = vmm->mmu->subdev.device;
415-
struct nvkm_memory *memory = map->memory;
416407
u8 kind, kind_inv, priv, ro, vol;
417408
int kindn, aper, ret = -ENOSYS;
418409
const u8 *kindm;
@@ -450,30 +441,8 @@ gp100_vmm_valid(struct nvkm_vmm *vmm, void *argv, u32 argc,
450441
}
451442

452443
if (kindm[kind] != kind) {
453-
u64 tags = nvkm_memory_size(memory) >> 16;
454-
if (aper != 0 || !(page->type & NVKM_VMM_PAGE_COMP)) {
455-
VMM_DEBUG(vmm, "comp %d %02x", aper, page->type);
456-
return -EINVAL;
457-
}
458-
459-
if (!map->no_comp) {
460-
ret = nvkm_memory_tags_get(memory, device, tags,
461-
nvkm_ltc_tags_clear,
462-
&map->tags);
463-
if (ret) {
464-
VMM_DEBUG(vmm, "comp %d", ret);
465-
return ret;
466-
}
467-
}
468-
469-
if (!map->no_comp && map->tags->mn) {
470-
tags = map->tags->mn->offset + (map->offset >> 16);
471-
map->ctag |= ((1ULL << page->shift) >> 16) << 36;
472-
map->type |= tags << 36;
473-
map->next |= map->ctag;
474-
} else {
475-
kind = kindm[kind];
476-
}
444+
/* Revert to non-compressed kind. */
445+
kind = kindm[kind];
477446
}
478447

479448
map->type |= BIT(0);
@@ -592,8 +561,8 @@ gp100_vmm = {
592561
{ 47, &gp100_vmm_desc_16[4], NVKM_VMM_PAGE_Sxxx },
593562
{ 38, &gp100_vmm_desc_16[3], NVKM_VMM_PAGE_Sxxx },
594563
{ 29, &gp100_vmm_desc_16[2], NVKM_VMM_PAGE_Sxxx },
595-
{ 21, &gp100_vmm_desc_16[1], NVKM_VMM_PAGE_SVxC },
596-
{ 16, &gp100_vmm_desc_16[0], NVKM_VMM_PAGE_SVxC },
564+
{ 21, &gp100_vmm_desc_16[1], NVKM_VMM_PAGE_SVxx },
565+
{ 16, &gp100_vmm_desc_16[0], NVKM_VMM_PAGE_SVxx },
597566
{ 12, &gp100_vmm_desc_12[0], NVKM_VMM_PAGE_SVHx },
598567
{}
599568
}

drivers/gpu/drm/nouveau/nvkm/subdev/mmu/vmmgp10b.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ gp10b_vmm = {
3434
{ 47, &gp100_vmm_desc_16[4], NVKM_VMM_PAGE_Sxxx },
3535
{ 38, &gp100_vmm_desc_16[3], NVKM_VMM_PAGE_Sxxx },
3636
{ 29, &gp100_vmm_desc_16[2], NVKM_VMM_PAGE_Sxxx },
37-
{ 21, &gp100_vmm_desc_16[1], NVKM_VMM_PAGE_SxHC },
38-
{ 16, &gp100_vmm_desc_16[0], NVKM_VMM_PAGE_SxHC },
37+
{ 21, &gp100_vmm_desc_16[1], NVKM_VMM_PAGE_SxHx },
38+
{ 16, &gp100_vmm_desc_16[0], NVKM_VMM_PAGE_SxHx },
3939
{ 12, &gp100_vmm_desc_12[0], NVKM_VMM_PAGE_SxHx },
4040
{}
4141
}

0 commit comments

Comments
 (0)