2 * Copyright 2006-2008, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Axel Dörfler, axeld@pinc-software.de
8 #ifndef INTEL_EXTREME_ACCELERANT_H
9 #define INTEL_EXTREME_ACCELERANT_H
12 #include "intel_extreme.h"
15 #include <video_overlay.h>
22 overlay_buffer buffer
;
29 struct overlay_frame
{
36 struct accelerant_info
{
40 intel_shared_info
* shared_info
;
41 area_id shared_info_area
;
43 display_mode current_mode
; // pretty much a hack until per-display modes
45 display_mode
* mode_list
; // cloned list of standard display modes
46 area_id mode_list_area
;
48 struct overlay_registers
* overlay_registers
;
49 overlay
* current_overlay
;
50 overlay_view last_overlay_view
;
51 overlay_frame last_overlay_frame
;
52 uint32 last_horizontal_overlay_scale
;
53 uint32 last_vertical_overlay_scale
;
54 uint32 overlay_position_buffer_offset
;
57 Port
* ports
[MAX_PORTS
];
60 Pipe
* pipes
[MAX_PIPES
];
65 // limited 3D support for overlay on i965
67 uint32 context_offset
;
76 #define HEAD_MODE_A_ANALOG 0x0001
77 #define HEAD_MODE_B_DIGITAL 0x0002
78 #define HEAD_MODE_CLONE 0x0003
79 #define HEAD_MODE_LVDS_PANEL 0x0008
80 #define HEAD_MODE_TESTING 0x1000
81 #define HEAD_MODE_STIPPI 0x2000
83 extern accelerant_info
* gInfo
;
88 read32(uint32 encodedRegister
)
90 return *(volatile uint32
*)(gInfo
->registers
91 + gInfo
->shared_info
->register_blocks
[REGISTER_BLOCK(encodedRegister
)]
92 + REGISTER_REGISTER(encodedRegister
));
96 write32(uint32 encodedRegister
, uint32 value
)
98 *(volatile uint32
*)(gInfo
->registers
99 + gInfo
->shared_info
->register_blocks
[REGISTER_BLOCK(encodedRegister
)]
100 + REGISTER_REGISTER(encodedRegister
)) = value
;
103 void dump_registers(void);
106 extern void enable_display_plane(bool enable
);
107 extern void set_display_power_mode(uint32 mode
);
110 extern void uninit_ring_buffer(ring_buffer
&ringBuffer
);
111 extern void setup_ring_buffer(ring_buffer
&ringBuffer
, const char* name
);
114 extern void wait_for_vblank(void);
115 extern void set_frame_buffer_base(void);
116 extern status_t
create_mode_list(void);
119 extern void intel_free_memory(addr_t base
);
120 extern status_t
intel_allocate_memory(size_t size
, uint32 flags
, addr_t
&base
);
122 #endif /* INTEL_EXTREME_ACCELERANT_H */