vfs: check userland buffers before reading them.
[haiku.git] / headers / private / graphics / common / dp.h
blobb6f01ede41624d22437cb93f67a87b360ae87d87
1 /*
2 * Copyright 2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Alexander von Gluck, kallisti5@unixzen.com
7 */
8 #ifndef _DP_H
9 #define _DP_H
12 #include <Accelerant.h>
13 #include "dp_raw.h"
14 #include <GraphicsDefs.h>
15 #include <OS.h>
18 typedef struct {
19 // Required configuration
20 bool valid; // Is valid DP information
21 uint32 auxPin; // Normally GPIO pin on GPU
22 uint8 revision; // DP Revision from DPCD
24 int laneCount;
25 uint32 linkRate; // DP Link Speed 162000, 270000, 540000
27 // Internal State information
28 uint8 linkStatus[DP_LINK_STATUS_SIZE];
30 uint8 trainingAttempts;
31 uint8 trainingSet[4];
32 int trainingReadInterval;
34 } dp_info;
36 typedef struct {
37 uint16 address;
38 uint8 request;
39 uint8 reply;
40 void* buffer;
41 size_t size;
42 } dp_aux_msg;
44 uint32 dp_encode_link_rate(uint32 linkRate);
45 uint32 dp_decode_link_rate(uint32 rawLinkRate);
47 uint32 dp_get_pixel_clock_max(int linkRate, int laneCount, int bpp);
50 #endif /* _DP_H */