2 * Copyright 2012-2016, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Alexander von Gluck, kallisti5@unixzen.com
15 extern "C" void _sPrintf(const char* format
, ...);
16 # define TRACE(x...) _sPrintf("dp_common: " x)
18 # define TRACE(x...) ;
21 #define ERROR(x...) _sPrintf("dp_common: " x)
25 dp_encode_link_rate(uint32 linkRate
)
30 return DP_LINK_RATE_162
;
33 return DP_LINK_RATE_270
;
36 return DP_LINK_RATE_540
;
39 ERROR("%s: Unknown DisplayPort Link Rate! (0x%" B_PRIX32
")\n",
41 return DP_LINK_RATE_162
;
46 dp_decode_link_rate(uint32 rawLinkRate
)
48 switch (rawLinkRate
) {
49 case DP_LINK_RATE_162
:
51 case DP_LINK_RATE_270
:
53 case DP_LINK_RATE_540
:
56 ERROR("%s: Unknown DisplayPort Link Rate! (0x%" B_PRIX32
")\n",
57 __func__
, rawLinkRate
);
63 dp_get_pixel_clock_max(int linkRate
, int laneCount
, int bpp
)
65 return (linkRate
* laneCount
* 8) / bpp
;