This is an old revision of the document!
kgi_display_t
Data of a KGI display are:
- KGI display revision
kgi_u_t revision;
- Vendor and Model strings
kgi_ascii_t vendor[KGI_MAX_VENDOR_STRING]; kgi_ascii_t model[KGI_MAX_VENDOR_STRING];
- Flags about special capabilities
kgi_u32_t flags;
- Size of the private mode data
kgi_u_t mode_size;
- Current mode
kgi_mode_t *mode;
- The display id
kgi_u_t id;
- non-console device attached
kgi_u_t graphic;
- Previous display in linked list
struct kgi_display_s *prev;
The methods of a KGI display are:
kgi_display_refcount_fn *IncRefcount;
kgi_display_refcount_fn *DecRefcount;
kgi_display_check_mode_fn *CheckMode;
kgi_display_set_mode_fn *SetMode;
kgi_display_set_mode_fn *UnsetMode;
kgi_display_command_fn *Command;
struct kgi_device_s *focus;
kgi_register_display()
A display must register itself to offer its services to the KgiDevice.
kgi_s_t kgi_register_display( /* Comment: the preinitialized display to register */ kgi_display_t *dpy, /* Comment: the suggested id for the display */ kgi_u_t id );
A registration typically occur when loading a display module. The display must be initialized before registration: at least one KgiImage must be defined and the display resources must be described.
For example, for the FreeBSD native VESA display the description of the framebuffer is:
fb->meta = dpy; fb->type = KGI_RT_MMIO_FRAME_BUFFER; fb->prot = KGI_PF_APP_RWS | KGI_PF_LIB_RWS | KGI_PF_DRV_RWS; fb->name = "Frame buffer"; fb->access = 8 + 16 + 32 + 64; fb->align = 8 + 16; fb->win.size = (kgi_size_t)adp->va_window_size; fb->win.virt = (kgi_virt_addr_t)adp->va_window; fb->win.bus = (kgi_bus_addr_t)0; fb->win.phys = (kgi_phys_addr_t)adp->va_mem_base; fb->size = (kgi_size_t)adp->va_mem_size; fb->offset = 0; fb->SetOffset = dpysw_set_offset;
kgi_unregister_display()
void kgi_unregister_display( /* Comment: the display to unregister */ kgi_display_t *dpy );
kgi_display_registered()
kgi_display_registered shall be used to know if a display id is already bound to a registered display.
kgi_s_t kgi_display_registered( /* Comment: the display id */ kgi_u_t id );
Returns KGI_EOK if bound, KGI_ENODEV otherwise.