1b01aed83SAlexander von Gluck IV /* 2b01aed83SAlexander von Gluck IV * Copyright 2011-2015, Haiku, Inc. All Rights Reserved. 3b01aed83SAlexander von Gluck IV * Distributed under the terms of the MIT License. 4b01aed83SAlexander von Gluck IV * 5b01aed83SAlexander von Gluck IV * Authors: 6b01aed83SAlexander von Gluck IV * Michael Lotz, mmlr@mlotz.ch 7b01aed83SAlexander von Gluck IV * Alexander von Gluck IV, kallisti5@unixzen.com 8b01aed83SAlexander von Gluck IV */ 9b01aed83SAlexander von Gluck IV #ifndef INTEL_PIPE_H 10b01aed83SAlexander von Gluck IV #define INTEL_PIPE_H 11b01aed83SAlexander von Gluck IV 12b01aed83SAlexander von Gluck IV 13b01aed83SAlexander von Gluck IV #include <edid.h> 14b01aed83SAlexander von Gluck IV 15b01aed83SAlexander von Gluck IV #include "intel_extreme.h" 16b01aed83SAlexander von Gluck IV 17b01aed83SAlexander von Gluck IV #include "pll.h" 18b01aed83SAlexander von Gluck IV #include "FlexibleDisplayInterface.h" 1916ea5aacSRudolf Cornelissen #include "PanelFitter.h" 20b01aed83SAlexander von Gluck IV 21b01aed83SAlexander von Gluck IV 22456e6f33SRudolf Cornelissen #define MAX_PIPES 4 // not all cards have this much though 23b01aed83SAlexander von Gluck IV 24b01aed83SAlexander von Gluck IV 25b01aed83SAlexander von Gluck IV void program_pipe_color_modes(uint32 colorMode); 26b01aed83SAlexander von Gluck IV 27b01aed83SAlexander von Gluck IV //class FDILink; 28b01aed83SAlexander von Gluck IV //class PanelFitter; 29b01aed83SAlexander von Gluck IV 30b01aed83SAlexander von Gluck IV class Pipe { 31b01aed83SAlexander von Gluck IV public: 32b01aed83SAlexander von Gluck IV Pipe(pipe_index pipeIndex); 33b01aed83SAlexander von Gluck IV ~Pipe(); 34b01aed83SAlexander von Gluck IV Index()35b01aed83SAlexander von Gluck IV pipe_index Index() 36b01aed83SAlexander von Gluck IV { return fPipeIndex; } 37b01aed83SAlexander von Gluck IV 38b01aed83SAlexander von Gluck IV bool IsEnabled(); 39b979c66cSAlexander von Gluck IV void Enable(bool enable); 40b01aed83SAlexander von Gluck IV void Disable(); 41b01aed83SAlexander von Gluck IV 42c9c61669SAlexander von Gluck IV void Configure(display_mode* mode); 43ed9bb4dcSRudolf Cornelissen status_t SetFDILink( 44ed9bb4dcSRudolf Cornelissen const display_timing& timing, 45ed9bb4dcSRudolf Cornelissen uint32 linkBandwidth, 46ed9bb4dcSRudolf Cornelissen uint32 lanes, 47ed9bb4dcSRudolf Cornelissen uint32 bitsPerPixel); 48b3bafaf6SRudolf Cornelissen void ConfigureScalePos(display_mode* mode); 49abcbfac6SAdrien Destugues void ConfigureTimings(display_mode* mode, 504b5e0c3bSRudolf Cornelissen bool hardware = true, 514b5e0c3bSRudolf Cornelissen port_index portIndex = INTEL_PORT_ANY); 52b979c66cSAlexander von Gluck IV void ConfigureClocks( 53b01aed83SAlexander von Gluck IV const pll_divisors& divisors, 54b01aed83SAlexander von Gluck IV uint32 pixelClock, 55b01aed83SAlexander von Gluck IV uint32 extraFlags); 56efde34c2SRudolf Cornelissen void ConfigureClocksSKL( 57efde34c2SRudolf Cornelissen const skl_wrpll_params& wrpll_params, 58efde34c2SRudolf Cornelissen uint32 pixelClock, 599ef22aa9SRudolf Cornelissen port_index pllForPort, 609ef22aa9SRudolf Cornelissen uint32* pllSel); 61*58bfdd0cSPulkoMandy uint32 TranscoderMode(); 62b01aed83SAlexander von Gluck IV 63b01aed83SAlexander von Gluck IV // access to the various parts of the pipe FDI()64b01aed83SAlexander von Gluck IV ::FDILink* FDI() 65b01aed83SAlexander von Gluck IV { return fFDILink; } PFT()6616ea5aacSRudolf Cornelissen ::PanelFitter* PFT() 6716ea5aacSRudolf Cornelissen { return fPanelFitter; } 68b01aed83SAlexander von Gluck IV 69b01aed83SAlexander von Gluck IV private: 70b979c66cSAlexander von Gluck IV void _ConfigureTranscoder(display_mode* mode); 71d35a52e8SAlexander von Gluck IV 72d35a52e8SAlexander von Gluck IV bool fHasTranscoder; 73b01aed83SAlexander von Gluck IV 74b01aed83SAlexander von Gluck IV FDILink* fFDILink; 7516ea5aacSRudolf Cornelissen PanelFitter* fPanelFitter; 76b01aed83SAlexander von Gluck IV 77b01aed83SAlexander von Gluck IV pipe_index fPipeIndex; 78b01aed83SAlexander von Gluck IV 79d35a52e8SAlexander von Gluck IV addr_t fPipeOffset; 80d35a52e8SAlexander von Gluck IV addr_t fPlaneOffset; 81b01aed83SAlexander von Gluck IV }; 82b01aed83SAlexander von Gluck IV 83b01aed83SAlexander von Gluck IV 84b01aed83SAlexander von Gluck IV #endif // INTEL_PIPE_H 85