xref: /haiku/src/add-ons/accelerants/intel_extreme/Pipes.h (revision 7aa55747139506809789e3048dbee94bb9437437)
1 /*
2  * Copyright 2011-2015, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Michael Lotz, mmlr@mlotz.ch
7  *		Alexander von Gluck IV, kallisti5@unixzen.com
8  */
9 #ifndef INTEL_PIPE_H
10 #define INTEL_PIPE_H
11 
12 
13 #include <edid.h>
14 
15 #include "intel_extreme.h"
16 
17 #include "pll.h"
18 #include "FlexibleDisplayInterface.h"
19 #include "PanelFitter.h"
20 
21 
22 #define MAX_PIPES	2
23 
24 
25 void program_pipe_color_modes(uint32 colorMode);
26 
27 //class FDILink;
28 //class PanelFitter;
29 
30 class Pipe {
31 public:
32 									Pipe(pipe_index pipeIndex);
33 									~Pipe();
34 
35 		pipe_index					Index()
36 										{ return fPipeIndex; }
37 
38 		bool						IsEnabled();
39 		void						Enable(bool enable);
40 		void						Disable();
41 
42 		void						Configure(display_mode* mode);
43 		void						ConfigureScalePos(display_mode* mode);
44 		void						ConfigureTimings(display_mode* mode,
45 										bool hardware = true);
46 		void						ConfigureClocks(
47 										const pll_divisors& divisors,
48 										uint32 pixelClock,
49 										uint32 extraFlags);
50 
51 		// access to the various parts of the pipe
52 		::FDILink*					FDI()
53 										{ return fFDILink; }
54 		::PanelFitter*				PFT()
55 										{ return fPanelFitter; }
56 
57 private:
58 		void						_ConfigureTranscoder(display_mode* mode);
59 
60 		bool						fHasTranscoder;
61 
62 		FDILink*					fFDILink;
63 		PanelFitter*				fPanelFitter;
64 
65 		pipe_index					fPipeIndex;
66 
67 		addr_t						fPipeOffset;
68 		addr_t						fPlaneOffset;
69 };
70 
71 
72 #endif // INTEL_PIPE_H
73