All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau: mark last megabyte as usable
@ 2013-08-07 15:24 Maarten Lankhorst
  2013-08-12  0:01 ` [Nouveau] " Ben Skeggs
  0 siblings, 1 reply; 2+ messages in thread
From: Maarten Lankhorst @ 2013-08-07 15:24 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
  Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org

It's my megabyte, I want to use it! At this point in init
vbios is copied over already, so there's no reason it cannot
used to hold other data now.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst-Z7WLFzj8eWMS+FvcfC7Uqw@public.gmane.org>
---
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c b/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
index cf97c4d..507d35d 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
@@ -119,7 +119,6 @@ nvc0_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
 	struct nouveau_bios *bios = nouveau_bios(pfb);
 	struct nouveau_ram *ram;
 	const u32 rsvd_head = ( 256 * 1024) >> 12; /* vga memory */
-	const u32 rsvd_tail = (1024 * 1024) >> 12; /* vbios etc */
 	u32 parts = nv_rd32(pfb, 0x022438);
 	u32 pmask = nv_rd32(pfb, 0x022554);
 	u32 bsize = nv_rd32(pfb, 0x10f20c);
@@ -156,7 +155,7 @@ nvc0_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
 	/* if all controllers have the same amount attached, there's no holes */
 	if (uniform) {
 		offset = rsvd_head;
-		length = (ram->size >> 12) - rsvd_head - rsvd_tail;
+		length = (ram->size >> 12) - rsvd_head;
 		ret = nouveau_mm_init(&pfb->vram, offset, length, 1);
 	} else {
 		/* otherwise, address lowest common amount from 0GiB */
@@ -167,7 +166,7 @@ nvc0_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
 
 		/* and the rest starting from (8GiB + common_size) */
 		offset = (0x0200000000ULL >> 12) + (bsize << 8);
-		length = (ram->size >> 12) - (bsize << 8) - rsvd_tail;
+		length = (ram->size >> 12) - (bsize << 8);
 
 		ret = nouveau_mm_init(&pfb->vram, offset, length, 0);
 		if (ret)

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Nouveau] [PATCH] drm/nouveau: mark last megabyte as usable
  2013-08-07 15:24 [PATCH] drm/nouveau: mark last megabyte as usable Maarten Lankhorst
@ 2013-08-12  0:01 ` Ben Skeggs
  0 siblings, 0 replies; 2+ messages in thread
From: Ben Skeggs @ 2013-08-12  0:01 UTC (permalink / raw)
  To: Maarten Lankhorst
  Cc: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org

On Thu, Aug 8, 2013 at 1:24 AM, Maarten Lankhorst
<maarten.lankhorst@canonical.com> wrote:
> It's my megabyte, I want to use it! At this point in init
> vbios is copied over already, so there's no reason it cannot
> used to hold other data now.
I believe there's areas in here where the SBIOS/VBIOS can communicate
to the driver on various events actually, at least in some situations.
 I'd rather leave it reserved for the moment.  Also, if/when we do do
this, we'll want to stick the vbios image back on module unload so
it's there for reload too.

Ben.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
> ---
> diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c b/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
> index cf97c4d..507d35d 100644
> --- a/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
> +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c
> @@ -119,7 +119,6 @@ nvc0_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
>         struct nouveau_bios *bios = nouveau_bios(pfb);
>         struct nouveau_ram *ram;
>         const u32 rsvd_head = ( 256 * 1024) >> 12; /* vga memory */
> -       const u32 rsvd_tail = (1024 * 1024) >> 12; /* vbios etc */
>         u32 parts = nv_rd32(pfb, 0x022438);
>         u32 pmask = nv_rd32(pfb, 0x022554);
>         u32 bsize = nv_rd32(pfb, 0x10f20c);
> @@ -156,7 +155,7 @@ nvc0_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
>         /* if all controllers have the same amount attached, there's no holes */
>         if (uniform) {
>                 offset = rsvd_head;
> -               length = (ram->size >> 12) - rsvd_head - rsvd_tail;
> +               length = (ram->size >> 12) - rsvd_head;
>                 ret = nouveau_mm_init(&pfb->vram, offset, length, 1);
>         } else {
>                 /* otherwise, address lowest common amount from 0GiB */
> @@ -167,7 +166,7 @@ nvc0_ram_create(struct nouveau_object *parent, struct nouveau_object *engine,
>
>                 /* and the rest starting from (8GiB + common_size) */
>                 offset = (0x0200000000ULL >> 12) + (bsize << 8);
> -               length = (ram->size >> 12) - (bsize << 8) - rsvd_tail;
> +               length = (ram->size >> 12) - (bsize << 8);
>
>                 ret = nouveau_mm_init(&pfb->vram, offset, length, 0);
>                 if (ret)
>
> _______________________________________________
> Nouveau mailing list
> Nouveau@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-12  0:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-07 15:24 [PATCH] drm/nouveau: mark last megabyte as usable Maarten Lankhorst
2013-08-12  0:01 ` [Nouveau] " Ben Skeggs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.