return -1;
}
+int
+cbvga_minimum_linelength(struct vgamode_s *vmode_g)
+{
+ /* Can't change mode, always report active pitch. */
+ return GET_GLOBAL(CBlinelength);
+}
+
int
cbvga_get_linelength(struct vgamode_s *curmode_g)
{
return 0;
}
-int
-cbvga_get_linesize(struct vgamode_s *vmode_g)
-{
- /* Can't change mode, always report active pitch. */
- return GET_GLOBAL(CBlinelength);
-}
-
#define CB_TAG_FRAMEBUFFER 0x0012
struct cb_framebuffer {
u32 tag;
return -1;
}
+// Minimum framebuffer bytes between each vertical line for given mode
+int
+stdvga_minimum_linelength(struct vgamode_s *vmode_g)
+{
+ return DIV_ROUND_UP(GET_GLOBAL(vmode_g->width) * vga_bpp(vmode_g), 8);
+}
+
+// Return number of framebuffer bytes between start of each vertical line
int
stdvga_get_linelength(struct vgamode_s *curmode_g)
{
return val * 8 / stdvga_vram_ratio(curmode_g);
}
+// Set number of framebuffer bytes between start of each vertical line
int
stdvga_set_linelength(struct vgamode_s *curmode_g, int val)
{
return 0;
}
+// Return framebuffer offset of first byte of displayed content
int
stdvga_get_displaystart(struct vgamode_s *curmode_g)
{
return addr * 4 / stdvga_vram_ratio(curmode_g);
}
+// Set framebuffer offset of first byte of displayed content
int
stdvga_set_displaystart(struct vgamode_s *curmode_g, int val)
{
return -1;
}
-int
-stdvga_get_linesize(struct vgamode_s *vmode_g)
-{
- return DIV_ROUND_UP(GET_GLOBAL(vmode_g->width) * vga_bpp(vmode_g), 8);
-}
/****************************************************************
* Save/Restore state
u16 stdvga_get_vde(void);
int stdvga_get_window(struct vgamode_s *curmode_g, int window);
int stdvga_set_window(struct vgamode_s *curmode_g, int window, int val);
+int stdvga_minimum_linelength(struct vgamode_s *vmode_g);
int stdvga_get_linelength(struct vgamode_s *curmode_g);
int stdvga_set_linelength(struct vgamode_s *curmode_g, int val);
int stdvga_get_displaystart(struct vgamode_s *curmode_g);
// Basic information about mode.
int width = GET_GLOBAL(vmode_g->width);
int height = GET_GLOBAL(vmode_g->height);
- int linesize = vgahw_get_linesize(vmode_g);
+ int linesize = vgahw_minimum_linelength(vmode_g);
SET_FARVAR(seg, info->bytes_per_scanline, linesize);
SET_FARVAR(seg, info->xres, width);
SET_FARVAR(seg, info->yres, height);
return stdvga_get_linelength(curmode_g);
}
+static inline int vgahw_minimum_linelength(struct vgamode_s *vmode_g) {
+ if (CONFIG_VGA_EMULATE_TEXT)
+ return cbvga_minimum_linelength(vmode_g);
+ return stdvga_minimum_linelength(vmode_g);
+}
+
static inline int vgahw_set_linelength(struct vgamode_s *curmode_g, int val) {
if (CONFIG_VGA_CIRRUS)
return clext_set_linelength(curmode_g, val);
return stdvga_save_restore(cmd, seg, data);
}
-static inline int vgahw_get_linesize(struct vgamode_s *vmode_g) {
- if (CONFIG_VGA_EMULATE_TEXT)
- return cbvga_get_linesize(vmode_g);
- return stdvga_get_linesize(vmode_g);
-}
-
#endif // vgahw.h
void cbvga_list_modes(u16 seg, u16 *dest, u16 *last);
int cbvga_get_window(struct vgamode_s *curmode_g, int window);
int cbvga_set_window(struct vgamode_s *curmode_g, int window, int val);
+int cbvga_minimum_linelength(struct vgamode_s *vmode_g);
int cbvga_get_linelength(struct vgamode_s *curmode_g);
int cbvga_set_linelength(struct vgamode_s *curmode_g, int val);
int cbvga_get_displaystart(struct vgamode_s *curmode_g);
int cbvga_set_dacformat(struct vgamode_s *curmode_g, int val);
int cbvga_save_restore(int cmd, u16 seg, void *data);
int cbvga_set_mode(struct vgamode_s *vmode_g, int flags);
-int cbvga_get_linesize(struct vgamode_s *vmode_g);
void cbvga_setup_modes(u64 addr, u8 bpp, u32 xlines, u32 ylines, u32 linelength);
int cbvga_setup(void);
void stdvga_build_video_param(void);
void stdvga_override_crtc(int mode, u8 *crtc);
int stdvga_set_mode(struct vgamode_s *vmode_g, int flags);
-int stdvga_get_linesize(struct vgamode_s *vmode_g);
void stdvga_set_packed_palette(void);
// swcursor.c