Skip to contentSkip to conversation

drm/nv10: disable perf hack on low memory cards

PATCH In review Marcin Slusarz 2 participants 2 messages Nov 6, 2011 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nv10: disable perf hack on low memory cards

On 16MB cards it's too easy to hit ENOMEM with 2D use when this perf hack is enabled.

This should fix https://bugs.freedesktop.org/show_bug.cgi?id=42384

---
 drivers/gpu/drm/nouveau/nouveau_bo.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +1 -0
index 7226f41..a692648 100644
@@ -148,6 +148,7 @@ set_placement_range(struct nouveau_bo *nvbo, uint32_t type)
 
 	if (dev_priv->card_type == NV_10 &&
 	    nvbo->tile_mode && (type & TTM_PL_FLAG_VRAM) &&
+	    dev_priv->vram_size >= 32 * 1024 * 1024 &&
 	    nvbo->bo.mem.num_pages < vram_pages / 2) {
 		/*
 		 * Make sure that the color and depth buffers are handled
Signature · 1 line
1.7.7

A message that is not in the archive (sent off-list or not yet received): 1320607930-21794-3-git-send-email-marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org

#2 lore raw
Quoted 3 lines · Marcin Slusarz

On 16MB cards it's too easy to hit ENOMEM with 2D use when this perf hack is enabled.

AFAIK the "hack" still makes sense on such low memory cards. I guess the right way to fix this corner case would be to have fall-back placement ranges in TTM the same way there's a list of allowed placement types right now.

But, it's probably not worth the effort. For now I've just pushed a patch changing the BO size threshold that determines whether to set the placement range or not. That's likely to behave better than a hard memory limit of this kind, both when you have a <32MB card with small enough render buffers or a >32MB card with huge render buffers that would otherwise hit the same bug.

Quoted 13 lines

This should fix https://bugs.freedesktop.org/show_bug.cgi?id=42384

---
 drivers/gpu/drm/nouveau/nouveau_bo.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/gpu/drm/nouveau/nouveau_bo.c +0 -0
index 7226f41..a692648 100644

drivers/gpu/drm/nouveau/nouveau_bo.c set_placement_range(struct nouveau_bo *nvbo, uint32_t type) · line 154

Quoted 7 lines
drivers/gpu/drm/nouveau/nouveau_bo.c +1 -0
@@ -148,6 +148,7 @@ set_placement_range(struct nouveau_bo *nvbo, uint32_t type)
 
 	if (dev_priv->card_type == NV_10 &&
 	    nvbo->tile_mode && (type & TTM_PL_FLAG_VRAM) &&
+	    dev_priv->vram_size >= 32 * 1024 * 1024 &&
 	    nvbo->bo.mem.num_pages < vram_pages / 2) {
 		/*
 		 * Make sure that the color and depth buffers are handled

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau