-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drm/nouveau/fb/gp102-ga100: switch to simpler vram size detection method
Also exposes this for use by upcoming GSP-RM initialisation code. v2: add SPDX header Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Karol Herbst <kherbst@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230525003106.3853741-3-skeggsb@gmail.com
- Loading branch information
Ben Skeggs
authored and
Karol Herbst
committed
Jul 6, 2023
1 parent
ba1efd8
commit 2c0c15a
Showing
10 changed files
with
72 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// SPDX-License-Identifier: MIT | ||
#include "ram.h" | ||
|
||
#include <subdev/bios.h> | ||
|
||
static const struct nvkm_ram_func | ||
gp102_ram = { | ||
}; | ||
|
||
int | ||
gp102_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram) | ||
{ | ||
enum nvkm_ram_type type = nvkm_fb_bios_memtype(fb->subdev.device->bios); | ||
const u32 rsvd_head = ( 256 * 1024); /* vga memory */ | ||
const u32 rsvd_tail = (1024 * 1024); /* vbios etc */ | ||
u64 size = fb->func->vidmem.size(fb); | ||
int ret; | ||
|
||
ret = nvkm_ram_new_(&gp102_ram, fb, type, size, pram); | ||
if (ret) | ||
return ret; | ||
|
||
nvkm_mm_fini(&(*pram)->vram); | ||
|
||
return nvkm_mm_init(&(*pram)->vram, NVKM_RAM_MM_NORMAL, | ||
rsvd_head >> NVKM_RAM_MM_SHIFT, | ||
(size - rsvd_head - rsvd_tail) >> NVKM_RAM_MM_SHIFT, | ||
1); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters