Browse Source

drm/nvc0-/fb/ram: fix use of non-existant ram if partitions aren't uniform

Likely a large part of the GK106 woes..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs 11 years ago
parent
commit
3d9e3921f4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c

+ 2 - 2
drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c

@@ -554,13 +554,13 @@ nvc0_ram_create_(struct nouveau_object *parent, struct nouveau_object *engine,
 	} else {
 	} else {
 		/* otherwise, address lowest common amount from 0GiB */
 		/* otherwise, address lowest common amount from 0GiB */
 		ret = nouveau_mm_init(&pfb->vram, rsvd_head,
 		ret = nouveau_mm_init(&pfb->vram, rsvd_head,
-				      (bsize << 8) * parts, 1);
+				      (bsize << 8) * parts - rsvd_head, 1);
 		if (ret)
 		if (ret)
 			return ret;
 			return ret;
 
 
 		/* and the rest starting from (8GiB + common_size) */
 		/* and the rest starting from (8GiB + common_size) */
 		offset = (0x0200000000ULL >> 12) + (bsize << 8);
 		offset = (0x0200000000ULL >> 12) + (bsize << 8);
-		length = (ram->size >> 12) - (bsize << 8) - rsvd_tail;
+		length = (ram->size >> 12) - ((bsize * parts) << 8) - rsvd_tail;
 
 
 		ret = nouveau_mm_init(&pfb->vram, offset, length, 0);
 		ret = nouveau_mm_init(&pfb->vram, offset, length, 0);
 		if (ret)
 		if (ret)