3 #include <klibc/string.h>
6 __vga_gfxa_update_profile(struct gfxa* gfxa)
8 struct vga* v = (struct vga*)gfxa->hw_obj;
9 struct disp_profile* profile = &gfxa->disp_info;
11 v->crt.depth = profile->mon.depth;
12 v->options = VGA_MODE_GFX;
15 v, profile->mon.w_px, profile->mon.h_px, profile->mon.freq, 0);
17 int err = vga_reload_config(v);
19 if (!err && profile->clut.val) {
20 vga_update_palette(v, profile->clut.val, profile->clut.len);
27 __vga_gfxa_rreads(struct gfxa* gfxa, u32_t* map, void* rxbuf, size_t map_sz)
33 __vga_gfxa_rwrites(struct gfxa* gfxa, u32_t* map, void* txbuf, size_t map_sz)
39 __vga_gfxa_vmcpy(struct gfxa* gfxa, void* buf, off_t off, size_t sz)
41 struct vga* v = (struct vga*)gfxa->hw_obj;
43 if (off + sz > v->fb_sz) {
47 ptr_t vram_start = v->fb + off;
48 memcpy((void*)vram_start, buf, sz);
54 __vga_gfxa_lfbcpy(struct gfxa* gfxa, void* buf, off_t off, size_t sz)
56 return __vga_gfxa_vmcpy(gfxa, buf, off, sz);
60 __vga_gfxa_hwioctl(struct gfxa* gfxa, int req, va_list args)
66 struct gfxa_ops vga_gfxa_ops = { .update_profile = __vga_gfxa_update_profile,
67 .rreads = __vga_gfxa_rreads,
68 .rwrites = __vga_gfxa_rwrites,
69 .vmcpy = __vga_gfxa_vmcpy,
70 .lfbcpy = __vga_gfxa_lfbcpy,
71 .hwioctl = __vga_gfxa_hwioctl };