xref: /haiku/headers/private/graphics/vesa/vesa_info.h (revision 1acbe440b8dd798953bec31d18ee589aa3f71b73)
1 /*
2  * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
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 
14 #define DEVICE_NAME				"vesa"
15 #define VESA_ACCELERANT_NAME	"vesa.accelerant"
16 
17 
18 struct vesa_shared_info {
19 	int32			type;
20 	area_id			mode_list_area;		// area containing display mode list
21 	uint32			mode_count;
22 	display_mode	current_mode;
23 	uint32			bytes_per_row;
24 
25 	area_id			registers_area;		// area of memory mapped registers
26 	area_id			frame_buffer_area;	// area of frame buffer
27 	uint8			*frame_buffer;		// pointer to frame buffer (visible by all apps!)
28 	uint8			*physical_frame_buffer;
29 };
30 
31 struct vesa_info {
32 	uint32			cookie_magic;
33 	int32			open_count;
34 	int32			id;
35 	pci_info		*pci;
36 	uint8			*registers;
37 	area_id			registers_area;
38 	struct vesa_shared_info *shared_info;
39 	area_id			shared_area;
40 	uint8			*reloc_io;
41 	area_id			reloc_io_area;
42 };
43 
44 //----------------- ioctl() interface ----------------
45 
46 // list ioctls
47 enum {
48 	VESA_GET_PRIVATE_DATA = B_DEVICE_OP_CODES_END + 1,
49 	VESA_GET_DEVICE_NAME,
50 
51 	VGA_SET_INDEXED_COLORS,
52 	VGA_PLANAR_BLIT,
53 };
54 
55 struct vga_set_indexed_colors_args {
56 	uint8	first;
57 	uint16	count;
58 	uint8	*colors;
59 };
60 
61 struct vga_planar_blit_args {
62 	uint8	*source;
63 	int32	source_bytes_per_row;
64 	int32	left;
65 	int32	top;
66 	int32	right;
67 	int32	bottom;
68 };
69 
70 //----------------------------------------------------------
71 
72 extern status_t vesa_init(vesa_info &info);
73 extern void vesa_uninit(vesa_info &info);
74 
75 #endif	/* VESA_INFO_H */
76