1 /* 2 * Copyright 2005-2009, Axel Dörfler, axeld@pinc-software.de. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef VESA_INFO_H 6 #define VESA_INFO_H 7 8 9 #include <Drivers.h> 10 #include <Accelerant.h> 11 #include <PCI.h> 12 13 #include <edid.h> 14 15 16 #define VESA_EDID_BOOT_INFO "vesa_edid/v1" 17 #define VESA_MODES_BOOT_INFO "vesa_modes/v1" 18 19 struct vesa_mode { 20 uint16 mode; 21 uint16 width; 22 uint16 height; 23 uint8 bits_per_pixel; 24 }; 25 26 enum bios_type_enum { 27 kUnknownBiosType = 0, 28 kIntelBiosType, 29 kNVidiaBiosType, 30 kAtomBiosType1, 31 kAtomBiosType2 32 }; 33 34 struct vesa_shared_info { 35 area_id mode_list_area; // area containing display mode list 36 uint32 mode_count; 37 display_mode current_mode; 38 uint32 bytes_per_row; 39 40 area_id frame_buffer_area; // area of frame buffer 41 uint8* frame_buffer; 42 // pointer to frame buffer (visible by all apps!) 43 uint8* physical_frame_buffer; 44 45 uint32 vesa_mode_offset; 46 uint32 vesa_mode_count; 47 48 edid1_info edid_info; 49 bool has_edid; 50 bios_type_enum bios_type; 51 uint16 mode_table_offset; 52 // Atombios only: offset to the table of video modes in the bios, used for patching in 53 // extra video modes. 54 uint32 dpms_capabilities; 55 56 char name[32]; 57 uint32 vram_size; 58 }; 59 60 //----------------- ioctl() interface ---------------- 61 62 // list ioctls 63 enum { 64 VESA_GET_PRIVATE_DATA = B_DEVICE_OP_CODES_END + 1, 65 VESA_GET_DEVICE_NAME, 66 VESA_SET_DISPLAY_MODE, 67 VESA_GET_DPMS_MODE, 68 VESA_SET_DPMS_MODE, 69 VESA_SET_INDEXED_COLORS, 70 VESA_SET_CUSTOM_DISPLAY_MODE, 71 72 VGA_PLANAR_BLIT, 73 }; 74 75 struct vesa_set_indexed_colors_args { 76 uint8 first; 77 uint16 count; 78 uint8* colors; 79 }; 80 81 struct vga_planar_blit_args { 82 uint8* source; 83 int32 source_bytes_per_row; 84 int32 left; 85 int32 top; 86 int32 right; 87 int32 bottom; 88 }; 89 90 #endif /* VESA_INFO_H */ 91