2 * Copyright 2011, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Michael Lotz, mmlr@mlotz.ch
10 #include "PanelFitter.h"
12 #include "accelerant.h"
13 #include "intel_extreme.h"
22 # define TRACE(x...) _sPrintf("intel_extreme: " x)
27 #define ERROR(x...) _sPrintf("intel_extreme: " x)
28 #define CALLED(x...) TRACE("CALLED %s\n", __PRETTY_FUNCTION__)
31 // #pragma mark - PanelFitter
34 PanelFitter::PanelFitter(int32 pipeIndex
)
36 fBaseRegister(PCH_PANEL_FITTER_BASE_REGISTER
37 + pipeIndex
* PCH_PANEL_FITTER_PIPE_OFFSET
)
43 PanelFitter::IsEnabled()
45 return (read32(fBaseRegister
+ PCH_PANEL_FITTER_CONTROL
)
46 & PANEL_FITTER_ENABLED
) != 0;
51 PanelFitter::Enable(const display_mode
& mode
)
53 // TODO: program the right window size and position based on the mode
59 PanelFitter::Disable()
66 PanelFitter::_Enable(bool enable
)
68 uint32 targetRegister
= fBaseRegister
+ PCH_PANEL_FITTER_CONTROL
;
69 write32(targetRegister
, read32(targetRegister
) & ~PANEL_FITTER_ENABLED
70 | (enable
? PANEL_FITTER_ENABLED
| 0));
71 read32(targetRegister
);