Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[xsrc/trunk]: xsrc/external/mit/xf86-video-suncg6/dist/src Check the PROM for...
details: https://anonhg.NetBSD.org/xsrc/rev/51fc3236abfe
branches: trunk
changeset: 6957:51fc3236abfe
user: macallan <macallan%NetBSD.org@localhost>
date: Wed Mar 09 17:57:50 2022 +0000
description:
Check the PROM for the amount of available VRAM instead of guessing, and use
it all, now that we know we can.
thanks foo bar
diffstat:
external/mit/xf86-video-suncg6/dist/src/cg6_driver.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diffs (31 lines):
diff -r 024d3953c0e5 -r 51fc3236abfe external/mit/xf86-video-suncg6/dist/src/cg6_driver.c
--- a/external/mit/xf86-video-suncg6/dist/src/cg6_driver.c Fri Mar 04 05:56:55 2022 +0000
+++ b/external/mit/xf86-video-suncg6/dist/src/cg6_driver.c Wed Mar 09 17:57:50 2022 +0000
@@ -442,7 +442,8 @@
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
Cg6Ptr pCg6;
sbusDevicePtr psdp;
- int ret;
+ int ret, prom, len, vmsize;
+ char *b;
pCg6 = GET_CG6_FROM_SCRN(pScrn);
psdp = pCg6->psdp;
@@ -457,6 +458,17 @@
* usable VRAM ONLY. Works with NetBSD, may crash and burn on other OSes.
*/
pCg6->vidmem = 2 * 1024 * 1024;
+
+ prom = sparcPromInit();
+ b = sparcPromGetProperty(&psdp->node, "vmsize", &len);
+ if (len == 4 && b != NULL) {
+ memcpy(&vmsize, b, 4);
+ pCg6->vidmem = vmsize * 1024 * 1024;
+ }
+
+ if (prom)
+ sparcPromClose();
+
pCg6->fb = xf86MapSbusMem(psdp, CG6_RAM_VOFF, pCg6->vidmem);
if (pCg6->fb == NULL) {
Home |
Main Index |
Thread Index |
Old Index