xref: /haiku/src/add-ons/accelerants/intel_extreme/Pipes.h (revision 4c8e85b316c35a9161f5a1c50ad70bc91c83a76f)
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 		void						ConfigureClocksSKL(
51 										const skl_wrpll_params& wrpll_params,
52 										uint32 pixelClock,
53 										port_index pllForPort,
54 										uint32* pllSel);
55 
56 		// access to the various parts of the pipe
57 		::FDILink*					FDI()
58 										{ return fFDILink; }
59 		::PanelFitter*				PFT()
60 										{ return fPanelFitter; }
61 
62 private:
63 		void						_ConfigureTranscoder(display_mode* mode);
64 
65 		bool						fHasTranscoder;
66 
67 		FDILink*					fFDILink;
68 		PanelFitter*				fPanelFitter;
69 
70 		pipe_index					fPipeIndex;
71 
72 		addr_t						fPipeOffset;
73 		addr_t						fPlaneOffset;
74 };
75 
76 
77 #endif // INTEL_PIPE_H
78