summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2010-02-23 01:02:11 +0000
committerjkim <jkim@FreeBSD.org>2010-02-23 01:02:11 +0000
commit599d49780e716530b5aabb03f8f40285d5aadedc (patch)
treeccdb96cf5d6860f8472998f6cd56f1d004ac2a70 /sys/dev
parenta2e74371fc9914403efb07954f62376b8b97006d (diff)
downloadFreeBSD-src-599d49780e716530b5aabb03f8f40285d5aadedc.zip
FreeBSD-src-599d49780e716530b5aabb03f8f40285d5aadedc.tar.gz
Re-add accidentally removed pixel format for direct memory model.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/fb/vesa.c44
1 files changed, 42 insertions, 2 deletions
diff --git a/sys/dev/fb/vesa.c b/sys/dev/fb/vesa.c
index ec08cfb7..baebe85 100644
--- a/sys/dev/fb/vesa.c
+++ b/sys/dev/fb/vesa.c
@@ -919,9 +919,49 @@ vesa_bios_init(void)
vesa_vmode[modes].vi_buffer_size = bsize;
vesa_vmode[modes].vi_mem_model =
vesa_translate_mmodel(vmode.v_memmodel);
- if (vesa_vmode[modes].vi_mem_model == V_INFO_MM_PACKED ||
- vesa_vmode[modes].vi_mem_model == V_INFO_MM_DIRECT)
+ switch (vesa_vmode[modes].vi_mem_model) {
+ case V_INFO_MM_DIRECT:
+ if ((vmode.v_modeattr & V_MODELFB) != 0 &&
+ vers >= 0x0300) {
+ vesa_vmode[modes].vi_pixel_fields[0] =
+ vmode.v_linredfieldpos;
+ vesa_vmode[modes].vi_pixel_fields[1] =
+ vmode.v_lingreenfieldpos;
+ vesa_vmode[modes].vi_pixel_fields[2] =
+ vmode.v_linbluefieldpos;
+ vesa_vmode[modes].vi_pixel_fields[3] =
+ vmode.v_linresfieldpos;
+ vesa_vmode[modes].vi_pixel_fsizes[0] =
+ vmode.v_linredmasksize;
+ vesa_vmode[modes].vi_pixel_fsizes[1] =
+ vmode.v_lingreenmasksize;
+ vesa_vmode[modes].vi_pixel_fsizes[2] =
+ vmode.v_linbluemasksize;
+ vesa_vmode[modes].vi_pixel_fsizes[3] =
+ vmode.v_linresmasksize;
+ } else {
+ vesa_vmode[modes].vi_pixel_fields[0] =
+ vmode.v_redfieldpos;
+ vesa_vmode[modes].vi_pixel_fields[1] =
+ vmode.v_greenfieldpos;
+ vesa_vmode[modes].vi_pixel_fields[2] =
+ vmode.v_bluefieldpos;
+ vesa_vmode[modes].vi_pixel_fields[3] =
+ vmode.v_resfieldpos;
+ vesa_vmode[modes].vi_pixel_fsizes[0] =
+ vmode.v_redmasksize;
+ vesa_vmode[modes].vi_pixel_fsizes[1] =
+ vmode.v_greenmasksize;
+ vesa_vmode[modes].vi_pixel_fsizes[2] =
+ vmode.v_bluemasksize;
+ vesa_vmode[modes].vi_pixel_fsizes[3] =
+ vmode.v_resmasksize;
+ }
+ /* FALLTHROUGH */
+ case V_INFO_MM_PACKED:
vesa_vmode[modes].vi_pixel_size = (vmode.v_bpp + 7) / 8;
+ break;
+ }
vesa_vmode[modes].vi_flags =
vesa_translate_flags(vmode.v_modeattr) | V_INFO_VESA;
OpenPOWER on IntegriCloud