aboutsummaryrefslogtreecommitdiff
path: root/vgasrc/vgafb.c
AgeCommit message (Collapse)AuthorFilesLines
2012-04-14Misc compile fixes for gcc v3.4.rel-1.7.0Kevin O'Connor1-0/+6
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-02vgabios: Fix screen attrs on cga scroll.Kevin O'Connor1-0/+4
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-02vgabios: Simplify cga/packed character screen writing.Kevin O'Connor1-37/+17
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-02-01vgabios: Move stdvga_set_mode() to stdvgamodes.c.Kevin O'Connor1-0/+1
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-21vgabios: Extract out current mode finding into new function.Kevin O'Connor1-6/+5
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-19vgabios: Simplify planar4 vgafb code.Kevin O'Connor1-49/+44
Don't bother programming the vga registers to manipulate the framebuffer when in planar4 mode. Instead, just switch between the four planes and do the manipulation with regular reads and writes. This makes the code simpler to understand (the vga hardware manipulations are arcane and complex). Note, this could make text scrolling in planar4 mode slower and more likely to result in tearing. However, it's unlikely anything important uses the vgabios in planar4 mode. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14vgabios: Extract out common parts of struct vgamode_s.Kevin O'Connor1-6/+6
Extract out the fields in 'struct vgamode_s' that are used in the main code. The remaining fields are specific to the standard vga hardware driver. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14vgabios: Unify page size calculations; remove page size from vgamode_s.Kevin O'Connor1-14/+6
The previous code could obtain the page size in different ways - from vmode_g->sslength, from SCREEN_MEM_START, or by manually multiplying cols and rows. Add a new func (calc_page_size) and use that in areas that need to calculate the page size. Convert readers of the page size to read it from the "video_pagesize" entry in the BDA instead of recalculating it. Remove the page size from struct vgamode_s (slength) as it is now calculated dynamically. The new calculated versions are different from the existing values exported in video_param_table. However, the existing values (for CGA) did not look correct - I compared the values to those exported by two other VGA BIOS manufacturers and used the values that look more standard. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14vgabios: Make struct vgamode_s more similar to bochs/cirrus mode tables.Kevin O'Connor1-5/+5
For graphics modes, store pixel width/height instead of text width/height. Add explicit char width field. Where needed, calculate text width/height from pixel width/height by dividing pixel count by character size. Rename some fields and change field sizes to match cirrus/bochs definitions. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-14vgabios: Use vesa style memory model flags in stdvga code.Kevin O'Connor1-25/+23
Replace the custom flags with the flags defined in the VBE spec. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-01vgabios: Add scrolling for linear (packed pixel) graphics mode.Kevin O'Connor1-2/+32
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-01vgabios: Minor - make FB scroll functions look similar.Kevin O'Connor1-26/+31
All three scroll function variants have the same format, but those that have an implicit character width or height of 1 have those multiplications omitted. Add those multiplications back in (the compiler will optimize them away) so all the variants look similar. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2012-01-01vgabios: Framebuffer fixes for CGA and planar graphics modes.Kevin O'Connor1-7/+7
Fix missing divide by 2 in CGA mode scroll. Consistently use cheight/2 for all uses. Planar graphics character write has a read to video memory with a side effect - mark that as volatile so the compiler doesn't optimize it away. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31vgabios: Refactor vga_set_mode and stdvga_set_mode.Kevin O'Connor1-18/+0
Split out the BDA setup part of vga_set_mode to new function modeswitch_set_bda. Move the remaining parts (palette loading, screen clearing, font loading) of vga_set_mode into stdvga_set_mode. Add new mode switching flags and pass them to stdvga_set_mode, so it does not need to inspect modeset_ctl directly. Move code needed by stdvga_set_mode (perform_gray_scale_summing, clear_screen) to stdvga.c. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31vgabios: Move vgafb_load_font to stdvga.c.Kevin O'Connor1-19/+0
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31vgabios: Rename vgahw_* functions to stdvga_*.Kevin O'Connor1-19/+19
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31vgabios: Rename vgaio.c to stdvga.c.Kevin O'Connor1-0/+1
Also, introduce stdvga.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-31vgabios: Rename vga.c to vgabios.c.Kevin O'Connor1-1/+1
Also, rename vgatables.h to vgabios.h. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2011-12-27vgabios: Use vgamode_s instead of video_param_table in code.Kevin O'Connor1-6/+3
Now that all the info in video_param_table is also in vgamode_s, use the info in vgamode_s throughout the code. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
2009-05-31VGA: Move direct in/out calls out of vgafb.c.Kevin O'Connor1-27/+21
Implement wrapper calls in vgaio.c and use them instead.
2009-05-31VGA: Comment and name update.Kevin O'Connor1-28/+27
Remove remaining "biosfn_" prefixes from functions. Don't use register names as function parameters. vgafb_read_pixel should return a value (instead of passing in a pointer)
2009-05-31VGA: Further simplify scrolling code.Kevin O'Connor1-163/+84
Introduce memcpy_stride and memset_stride functions. Simplify the moves and fills using src and dest pointers. Don't nest for loops - just use one loop for copies.
2009-05-31VGA: Simplify scrolling implementation.Kevin O'Connor1-48/+9
Check for nblines==0 in calling function. Eliminate full screen clearing optimization.
2009-05-31VGA: Fix bad commit to vgafb.c - missing '}'.Kevin O'Connor1-0/+1
2009-05-31VGA: Define clear_screen in terms of memmodel.Kevin O'Connor1-10/+12
Use vmode_g->memmodel instead of memmodel and svgamode.
2009-05-31VGA: Breakup biosfn_scroll.Kevin O'Connor1-145/+187
Rename biosfn_scroll to vgafb_scroll. Break function up into per-mode scroll function. Pass row/col params in a 'struct cursorpos'. Encode direction as sign in nblines. Move parameter checking to callers. Add enhancement to 'attr' for using mode specific default attribute. Also, make get_cursor_pos local to vga.c.
2009-05-26VGA: Simplify vgafb_write/read_char.Kevin O'Connor1-62/+71
Pass cursor position into vgafb_write_char and vgafb_read_char. Don't pass count into vgafb_write_char. Break text writing into separate function.
2009-05-25VGA: Remove vmode_g->class - store info in vmode_g->memmodel.Kevin O'Connor1-7/+6
2009-05-25VGA: Use struct for car/attr/WITH_ATTR.Kevin O'Connor1-80/+43
The three parameters are used frequently together - define a struct to hold them. Alos, merge biosfn_write_char_attr/_only into one function.
2009-05-25VGA: Combine x/y/page into one parameter.Kevin O'Connor1-32/+25
These three values are frequently used together - put them in a struct and pass the struct around.
2009-05-25VGA: Replace biosfn_load_text_* with vgafb_load_font().Kevin O'Connor1-49/+17
The functions font loading functions are nearly identical - replace with one common function.
2009-05-25VGA: Factor out hardware accesses from biosfn_set_video_mode.Kevin O'Connor1-0/+18
Create vgahw_set_mode() that handles low-level vga setup in vgaio.c. Move screen clearing to new function in vgafb.c.
2009-05-17VGA: Extract code from vga.c into new files vgaio.c and vgafb.c.Kevin O'Connor1-0/+642
Move hardware IO accessor functions to vgaio.c. Move framebuffer and font manipulation code to vgafb.c. Also, have biosfn_write_teletype use biosfn_write_char_attr/only. Also, breakout set_scan_lines() functionality from biosfn_load_text_X.