2 Haiku S3 Savage driver adapted from the X.org Savage driver.
4 Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
5 Copyright (c) 2003-2006, X.Org Foundation
7 Copyright 2007-2008 Haiku, Inc. All rights reserved.
8 Distributed under the terms of the MIT license.
11 Gerald Zajac 2007-2008
24 GetI2CSignals(void* cookie
, int* _clock
, int* data
)
26 uint32 index
= (uint32
)cookie
;
27 uint8 value
= ReadCrtcReg(index
);
29 *_clock
= (value
& 0x4) != 0;
30 *data
= (value
& 0x8) != 0;
36 SetI2CSignals(void* cookie
, int _clock
, int data
)
38 uint32 index
= (uint32
)cookie
;
46 WriteCrtcReg(index
, value
);
53 Savage_GetEdidInfo(edid1_info
& edidInfo
)
55 // Get the EDID info and return true if successful.
57 SharedInfo
& si
= *gInfo
.sharedInfo
;
61 switch (si
.chipType
) {
72 case S3_PROSAVAGE_DDR
:
78 bus
.cookie
= (void*)DDCPort
;
79 bus
.set_signals
= &SetI2CSignals
;
80 bus
.get_signals
= &GetI2CSignals
;
81 ddc2_init_timing(&bus
);
83 uint8 tmp
= ReadCrtcReg(DDCPort
);
84 WriteCrtcReg(DDCPort
, tmp
| 0x13);
86 bool bResult
= (ddc2_read_edid1(&bus
, &edidInfo
, NULL
, NULL
) == B_OK
);
87 WriteCrtcReg(DDCPort
, tmp
);