2 * Copyright 2007-2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
12 #include "DriverInterface.h"
17 #ifdef ENABLE_DEBUG_TRACE
18 extern "C" void _sPrintf(const char* format
, ...);
19 # define TRACE(x...) _sPrintf("i810: " x)
21 # define TRACE(x...) ;
25 // Global data used by various source files of the accelerant.
26 struct AccelerantInfo
{
27 int deviceFileDesc
; // file descriptor of kernel driver
29 SharedInfo
* sharedInfo
; // address of info shared between
30 // accelerants & driver
31 area_id sharedInfoArea
; // shared info area ID
33 uint8
* regs
; // base address of MMIO register area
34 area_id regsArea
; // MMIO register area ID
36 display_mode
* modeList
; // list of standard display modes
37 area_id modeListArea
; // mode list area ID
39 bool bAccelerantIsClone
; // true if this is a cloned accelerant
42 extern AccelerantInfo gInfo
;
45 // Prototypes of the interface functions called by the app_server. Note that
46 // the functions that are unique to a particular chip family, will be prefixed
47 // with the name of the family, and the functions that are applicable to all
48 // chips will have no prefix.
49 // ================================================================
51 #if defined(__cplusplus)
56 status_t
InitAccelerant(int fd
);
57 ssize_t
AccelerantCloneInfoSize(void);
58 void GetAccelerantCloneInfo(void* data
);
59 status_t
CloneAccelerant(void* data
);
60 void UninitAccelerant(void);
61 status_t
GetAccelerantDeviceInfo(accelerant_device_info
* adi
);
64 uint32
AccelerantModeCount(void);
65 status_t
GetModeList(display_mode
* dm
);
66 status_t
ProposeDisplayMode(display_mode
* target
, const display_mode
* low
,
67 const display_mode
* high
);
68 status_t
SetDisplayMode(display_mode
* mode_to_set
);
69 status_t
GetDisplayMode(display_mode
* current_mode
);
70 status_t
GetFrameBufferConfig(frame_buffer_config
* a_frame_buffer
);
71 status_t
GetPixelClockLimits(display_mode
* dm
, uint32
* low
, uint32
* high
);
72 status_t
MoveDisplay(uint16 h_display_start
, uint16 v_display_start
);
73 void I810_SetIndexedColors(uint count
, uint8 first
, uint8
* color_data
,
75 status_t
GetEdidInfo(void* info
, size_t size
, uint32
* _version
);
78 uint32
I810_DPMSCapabilities(void);
79 uint32
I810_GetDPMSMode(void);
80 status_t
I810_SetDPMSMode(uint32 dpms_flags
);
83 uint32
AccelerantEngineCount(void);
84 status_t
AcquireEngine(uint32 capabilities
, uint32 max_wait
, sync_token
* st
,
86 status_t
ReleaseEngine(engine_token
* et
, sync_token
* st
);
87 void WaitEngineIdle(void);
88 status_t
GetSyncToken(engine_token
* et
, sync_token
* st
);
89 status_t
SyncToToken(sync_token
* st
);
91 #if defined(__cplusplus)
96 // Prototypes for other functions that are called from source files other than
97 // where they are defined.
98 // ============================================================================
99 status_t
CreateModeList(bool (*checkMode
)(const display_mode
* mode
));
100 bool IsModeUsable(const display_mode
* mode
);
102 // Intel 810 functions.
104 status_t
I810_Init(void);
105 bool I810_GetColorSpaceParams(int colorSpace
, uint8
& bpp
,
106 uint32
& maxPixelClk
);
107 uint32
I810_GetWatermark(const DisplayModeEx
& mode
);
109 void I810_AdjustFrame(const DisplayModeEx
& mode
);
110 status_t
I810_SetDisplayMode(const DisplayModeEx
& mode
);
113 #endif // _ACCELERANT_H