193ee2104SAxel Dörfler /* 2bfd4c59bSAxel Dörfler * Copyright 2005-2009, Axel Dörfler, axeld@pinc-software.de. 393ee2104SAxel Dörfler * Distributed under the terms of the MIT License. 493ee2104SAxel Dörfler */ 593ee2104SAxel Dörfler #ifndef VESA_INFO_H 693ee2104SAxel Dörfler #define VESA_INFO_H 793ee2104SAxel Dörfler 893ee2104SAxel Dörfler 993ee2104SAxel Dörfler #include <Drivers.h> 1093ee2104SAxel Dörfler #include <Accelerant.h> 1193ee2104SAxel Dörfler #include <PCI.h> 1293ee2104SAxel Dörfler 13d16ddc57SAxel Dörfler #include <edid.h> 1493ee2104SAxel Dörfler 15d16ddc57SAxel Dörfler 16d16ddc57SAxel Dörfler #define VESA_EDID_BOOT_INFO "vesa_edid/v1" 17e549b218SAxel Dörfler #define VESA_MODES_BOOT_INFO "vesa_modes/v1" 1893ee2104SAxel Dörfler 19e549b218SAxel Dörfler struct vesa_mode { 209f161845SAxel Dörfler uint16 mode; 21e549b218SAxel Dörfler uint16 width; 22e549b218SAxel Dörfler uint16 height; 23e549b218SAxel Dörfler uint8 bits_per_pixel; 24e549b218SAxel Dörfler }; 2593ee2104SAxel Dörfler 261005a276SAdrien Destugues enum bios_type_enum { 271005a276SAdrien Destugues kUnknownBiosType = 0, 281005a276SAdrien Destugues kIntelBiosType, 291005a276SAdrien Destugues kNVidiaBiosType, 301005a276SAdrien Destugues kAtomBiosType1, 311005a276SAdrien Destugues kAtomBiosType2 321005a276SAdrien Destugues }; 331005a276SAdrien Destugues 3493ee2104SAxel Dörfler struct vesa_shared_info { 3593ee2104SAxel Dörfler area_id mode_list_area; // area containing display mode list 3693ee2104SAxel Dörfler uint32 mode_count; 3793ee2104SAxel Dörfler display_mode current_mode; 3893ee2104SAxel Dörfler uint32 bytes_per_row; 3993ee2104SAxel Dörfler 4093ee2104SAxel Dörfler area_id frame_buffer_area; // area of frame buffer 41e549b218SAxel Dörfler uint8* frame_buffer; 42e549b218SAxel Dörfler // pointer to frame buffer (visible by all apps!) 4393ee2104SAxel Dörfler uint8* physical_frame_buffer; 4493ee2104SAxel Dörfler 45e549b218SAxel Dörfler uint32 vesa_mode_offset; 46e549b218SAxel Dörfler uint32 vesa_mode_count; 47d16ddc57SAxel Dörfler 48d16ddc57SAxel Dörfler edid1_info edid_info; 49d16ddc57SAxel Dörfler bool has_edid; 501005a276SAdrien Destugues bios_type_enum bios_type; 511005a276SAdrien Destugues uint16 mode_table_offset; 521005a276SAdrien Destugues // Atombios only: offset to the table of video modes in the bios, used for patching in 531005a276SAdrien Destugues // extra video modes. 54bfd4c59bSAxel Dörfler uint32 dpms_capabilities; 55*6a175a5dSAdrien Destugues 56*6a175a5dSAdrien Destugues char name[32]; 57*6a175a5dSAdrien Destugues uint32 vram_size; 5893ee2104SAxel Dörfler }; 5993ee2104SAxel Dörfler 6093ee2104SAxel Dörfler //----------------- ioctl() interface ---------------- 6193ee2104SAxel Dörfler 6293ee2104SAxel Dörfler // list ioctls 6393ee2104SAxel Dörfler enum { 6493ee2104SAxel Dörfler VESA_GET_PRIVATE_DATA = B_DEVICE_OP_CODES_END + 1, 6593ee2104SAxel Dörfler VESA_GET_DEVICE_NAME, 669f161845SAxel Dörfler VESA_SET_DISPLAY_MODE, 67bfd4c59bSAxel Dörfler VESA_GET_DPMS_MODE, 68bfd4c59bSAxel Dörfler VESA_SET_DPMS_MODE, 69bb693d77SAxel Dörfler VESA_SET_INDEXED_COLORS, 701005a276SAdrien Destugues VESA_SET_CUSTOM_DISPLAY_MODE, 710c6f7795SAxel Dörfler 720c6f7795SAxel Dörfler VGA_PLANAR_BLIT, 730c6f7795SAxel Dörfler }; 740c6f7795SAxel Dörfler 75bb693d77SAxel Dörfler struct vesa_set_indexed_colors_args { 760c6f7795SAxel Dörfler uint8 first; 770c6f7795SAxel Dörfler uint16 count; 780c6f7795SAxel Dörfler uint8* colors; 790c6f7795SAxel Dörfler }; 800c6f7795SAxel Dörfler 810c6f7795SAxel Dörfler struct vga_planar_blit_args { 820c6f7795SAxel Dörfler uint8* source; 830c6f7795SAxel Dörfler int32 source_bytes_per_row; 840c6f7795SAxel Dörfler int32 left; 850c6f7795SAxel Dörfler int32 top; 860c6f7795SAxel Dörfler int32 right; 870c6f7795SAxel Dörfler int32 bottom; 8893ee2104SAxel Dörfler }; 8993ee2104SAxel Dörfler 9093ee2104SAxel Dörfler #endif /* VESA_INFO_H */ 91