From 5fb3ac06b7f8e9522f4196688711eefbfd84931a Mon Sep 17 00:00:00 2001 From: Jung-uk Kim Date: Tue, 23 Mar 2010 22:35:52 +0000 Subject: [PATCH] Map entire video memory again. This is a partial backout of r203535. Although we do not use them all directly, it seems VGA render may access unmapped memory region and cause kernel panic. --- sys/dev/fb/vesa.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sys/dev/fb/vesa.c b/sys/dev/fb/vesa.c index 26024402d7be..2b11f788fd25 100644 --- a/sys/dev/fb/vesa.c +++ b/sys/dev/fb/vesa.c @@ -1209,7 +1209,7 @@ vesa_set_mode(video_adapter_t *adp, int mode) int10_set_mode(adp->va_initial_bios_mode); if (adp->va_info.vi_flags & V_INFO_LINEAR) pmap_unmapdev(adp->va_buffer, - adp->va_buffer_size); + vesa_adp_info->v_memsize * 64 * 1024); /* * Once (*prevvidsw->get_info)() succeeded, * (*prevvidsw->set_mode)() below won't fail... @@ -1246,7 +1246,8 @@ vesa_set_mode(video_adapter_t *adp, int mode) adp->va_flags |= V_ADP_DAC8; if (adp->va_info.vi_flags & V_INFO_LINEAR) - pmap_unmapdev(adp->va_buffer, adp->va_buffer_size); + pmap_unmapdev(adp->va_buffer, + vesa_adp_info->v_memsize * 64 * 1024); #if VESA_DEBUG > 0 printf("VESA: mode set!\n"); @@ -1263,7 +1264,7 @@ vesa_set_mode(video_adapter_t *adp, int mode) #endif vesa_adp->va_buffer = (vm_offset_t)pmap_mapdev_attr(info.vi_buffer, - info.vi_buffer_size, PAT_WRITE_COMBINING); + vesa_adp_info->v_memsize * 64 * 1024, PAT_WRITE_COMBINING); vesa_adp->va_window = vesa_adp->va_buffer; vesa_adp->va_window_size = info.vi_buffer_size / info.vi_planes; vesa_adp->va_window_gran = info.vi_buffer_size / info.vi_planes;