2 * Copyright 2005, Haiku.
3 * Distributed under the terms of the MIT License.
6 * Michael Lotz <mmlr@mlotz.ch>
7 * Stephan Aßmus <superstippi@gmx.de>
9 #ifndef ACCELERANT_HW_INTERFACE_H
10 #define ACCELERANT_HW_INTERFACE_H
15 #include <Accelerant.h>
21 //class AccelerantBuffer;
24 class AccelerantHWInterface
: public BLocker
/* : public HWInterface*/ {
26 AccelerantHWInterface();
27 virtual ~AccelerantHWInterface();
29 virtual status_t
Initialize();
30 virtual status_t
Shutdown();
32 /* virtual status_t SetMode(const display_mode &mode);
33 virtual void GetMode(display_mode *mode);
35 virtual status_t GetDeviceInfo(accelerant_device_info *info);
36 virtual status_t GetFrameBufferConfig(frame_buffer_config& config);
38 virtual status_t GetModeList(display_mode **mode_list,
40 virtual status_t GetPixelClockLimits(display_mode *mode,
41 uint32 *low, uint32 *high);
42 virtual status_t GetTimingConstraints(display_timing_constraints *dtc);
43 virtual status_t ProposeMode(display_mode *candidate,
44 const display_mode *low,
45 const display_mode *high);
47 virtual sem_id RetraceSemaphore();
48 virtual status_t WaitForRetrace(bigtime_t timeout = B_INFINITE_TIMEOUT);
50 virtual status_t SetDPMSMode(const uint32 &state);
51 virtual uint32 DPMSMode();
52 virtual uint32 DPMSCapabilities();*/
54 // query for available hardware accleration and perform it
55 virtual uint32
AvailableHWAcceleration() const;
57 virtual void CopyRegion(const clipping_rect
* sortedRectList
,
59 int32 xOffset
, int32 yOffset
);
60 virtual void FillRegion(/*const*/ BRegion
& region
,
61 const rgb_color
& color
);
62 virtual void InvertRegion(/*const*/ BRegion
& region
);
65 /*virtual void SetCursor(ServerCursor* cursor);
66 virtual void SetCursorVisible(bool visible);
67 virtual void MoveCursorTo(const float& x,
70 // frame buffer access
71 //virtual RenderingBuffer* FrontBuffer() const;
72 //virtual RenderingBuffer* BackBuffer() const;
73 //virtual bool IsDoubleBuffered() const;
76 //virtual void _DrawCursor(BRect area) const;
79 int _OpenGraphicsDevice(int deviceNumber
);
80 status_t
_OpenAccelerant(int device
);
81 status_t
_SetupDefaultHooks();
82 status_t
_UpdateModeList();
83 status_t
_UpdateFrameBufferConfig();
84 void _RegionToRectParams(/*const*/ BRegion
* region
,
85 fill_rect_params
** params
,
87 uint32
_NativeColor(const rgb_color
& color
) const;
90 image_id fAccelerantImage
;
91 GetAccelerantHook fAccelerantHook
;
92 engine_token
*fEngineToken
;
93 sync_token fSyncToken
;
95 // required hooks - guaranteed to be valid
96 acquire_engine fAccAcquireEngine
;
97 release_engine fAccReleaseEngine
;
98 sync_to_token fAccSyncToToken
;
99 accelerant_mode_count fAccGetModeCount
;
100 get_mode_list fAccGetModeList
;
101 get_frame_buffer_config fAccGetFrameBufferConfig
;
102 set_display_mode fAccSetDisplayMode
;
103 get_display_mode fAccGetDisplayMode
;
104 get_pixel_clock_limits fAccGetPixelClockLimits
;
106 // optional accelerant hooks
107 get_timing_constraints fAccGetTimingConstraints
;
108 propose_display_mode fAccProposeDisplayMode
;
109 fill_rectangle fAccFillRect
;
110 invert_rectangle fAccInvertRect
;
111 screen_to_screen_blit fAccScreenBlit
;
112 set_cursor_shape fAccSetCursorShape
;
113 move_cursor fAccMoveCursor
;
114 show_cursor fAccShowCursor
;
116 BString fCardNameInDevFS
;
118 /* dpms_capabilities fAccDPMSCapabilities;
119 dpms_mode fAccDPMSMode;
120 set_dpms_mode fAccSetDPMSMode;
122 frame_buffer_config fFrameBufferConfig;
124 display_mode *fModeList;*/
127 // MallocBuffer *fBackBuffer;
128 // AccelerantBuffer *fFrontBuffer;
131 // display_mode fDisplayMode;
134 #endif // ACCELERANT_HW_INTERFACE_H