Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F166275511
D33600.id100459.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D33600.id100459.diff
View Options
diff --git a/stand/common/gfx_fb.h b/stand/common/gfx_fb.h
--- a/stand/common/gfx_fb.h
+++ b/stand/common/gfx_fb.h
@@ -217,6 +217,7 @@
struct vt_font tg_font;
struct gen_fb tg_fb;
uint32_t *tg_shadow_fb; /* units of 4 bytes */
+ size_t tg_shadow_sz; /* units of pages */
teken_funcs_t *tg_functions;
void *tg_private;
} teken_gfx_t;
diff --git a/stand/efi/loader/framebuffer.c b/stand/efi/loader/framebuffer.c
--- a/stand/efi/loader/framebuffer.c
+++ b/stand/efi/loader/framebuffer.c
@@ -634,9 +634,18 @@
gfx_state->tg_fb.fb_bpp = fls(efifb.fb_mask_red | efifb.fb_mask_green |
efifb.fb_mask_blue | efifb.fb_mask_reserved);
- free(gfx_state->tg_shadow_fb);
- gfx_state->tg_shadow_fb = malloc(efifb.fb_height * efifb.fb_width *
+ if (gfx_state->tg_shadow_fb != NULL)
+ BS->FreePages((EFI_PHYSICAL_ADDRESS)gfx_state->tg_shadow_fb,
+ gfx_state->tg_shadow_sz);
+ gfx_state->tg_shadow_sz =
+ EFI_SIZE_TO_PAGES(efifb.fb_height * efifb.fb_width *
sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL));
+ status = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData,
+ gfx_state->tg_shadow_sz,
+ (EFI_PHYSICAL_ADDRESS *)&gfx_state->tg_shadow_fb);
+ if (status != EFI_SUCCESS)
+ gfx_state->tg_shadow_fb = NULL;
+
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Aug 13, 4:04 PM (7 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36659430
Default Alt Text
D33600.id100459.diff (1 KB)
Attached To
Mode
D33600: loader.efi: to preserve heap space, use AllocatePages() for shadow_fb
Attached
Detach File
Event Timeline
Log In to Comment