dp.h revision 63b02c37
1/*
2 * Copyright 2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *      Alexander von Gluck, kallisti5@unixzen.com
7 */
8#ifndef _DP_H
9#define _DP_H
10
11
12#include <Accelerant.h>
13#include "dp_raw.h"
14#include <GraphicsDefs.h>
15#include <OS.h>
16
17
18typedef struct {
19	// Required configuration
20	bool	valid;			// Is valid DP information
21	uint32	auxPin;			// Normally GPIO pin on GPU
22
23	uint8	config[DP_DPCD_SIZE]; // DP Configuration Data
24	int		laneCount;
25
26	uint32	linkRate;		// DP Link Speed 162000, 270000, 540000
27
28	// Internal State information
29	uint8	linkStatus[DP_LINK_STATUS_SIZE];
30
31	bool    trainingUseEncoder;
32
33	uint8   trainingAttempts;
34	uint8   trainingSet[4];
35	int     trainingReadInterval;
36
37} dp_info;
38
39typedef struct {
40	uint16	address;
41	uint8	request;
42	uint8	reply;
43	void*	buffer;
44	size_t	size;
45} dp_aux_msg;
46
47uint32 dp_encode_link_rate(uint32 linkRate);
48uint32 dp_decode_link_rate(uint32 rawLinkRate);
49
50uint32 dp_get_lane_count_max(dp_info* dpInfo);
51uint32 dp_get_link_rate_max(dp_info* dpInfo);
52
53uint32 dp_get_pixel_clock_max(int linkRate, int laneCount, int bpp);
54
55
56#endif /* _DP_H */
57