| .. | .. |
|---|
| 23 | 23 | * Authors: Dave Airlie |
|---|
| 24 | 24 | * Alex Deucher |
|---|
| 25 | 25 | */ |
|---|
| 26 | | -#include <drm/drmP.h> |
|---|
| 26 | + |
|---|
| 27 | 27 | #include <drm/drm_crtc_helper.h> |
|---|
| 28 | 28 | #include <drm/amdgpu_drm.h> |
|---|
| 29 | 29 | #include <drm/drm_fixed.h> |
|---|
| .. | .. |
|---|
| 41 | 41 | struct drm_display_mode *adjusted_mode) |
|---|
| 42 | 42 | { |
|---|
| 43 | 43 | struct drm_device *dev = crtc->dev; |
|---|
| 44 | | - struct amdgpu_device *adev = dev->dev_private; |
|---|
| 44 | + struct amdgpu_device *adev = drm_to_adev(dev); |
|---|
| 45 | 45 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); |
|---|
| 46 | 46 | SET_CRTC_OVERSCAN_PS_ALLOCATION args; |
|---|
| 47 | 47 | int index = GetIndexIntoMasterTable(COMMAND, SetCRTC_OverScan); |
|---|
| .. | .. |
|---|
| 84 | 84 | void amdgpu_atombios_crtc_scaler_setup(struct drm_crtc *crtc) |
|---|
| 85 | 85 | { |
|---|
| 86 | 86 | struct drm_device *dev = crtc->dev; |
|---|
| 87 | | - struct amdgpu_device *adev = dev->dev_private; |
|---|
| 87 | + struct amdgpu_device *adev = drm_to_adev(dev); |
|---|
| 88 | 88 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); |
|---|
| 89 | 89 | ENABLE_SCALER_PS_ALLOCATION args; |
|---|
| 90 | 90 | int index = GetIndexIntoMasterTable(COMMAND, EnableScaler); |
|---|
| .. | .. |
|---|
| 114 | 114 | { |
|---|
| 115 | 115 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); |
|---|
| 116 | 116 | struct drm_device *dev = crtc->dev; |
|---|
| 117 | | - struct amdgpu_device *adev = dev->dev_private; |
|---|
| 117 | + struct amdgpu_device *adev = drm_to_adev(dev); |
|---|
| 118 | 118 | int index = |
|---|
| 119 | 119 | GetIndexIntoMasterTable(COMMAND, UpdateCRTC_DoubleBufferRegisters); |
|---|
| 120 | 120 | ENABLE_CRTC_PS_ALLOCATION args; |
|---|
| .. | .. |
|---|
| 131 | 131 | { |
|---|
| 132 | 132 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); |
|---|
| 133 | 133 | struct drm_device *dev = crtc->dev; |
|---|
| 134 | | - struct amdgpu_device *adev = dev->dev_private; |
|---|
| 134 | + struct amdgpu_device *adev = drm_to_adev(dev); |
|---|
| 135 | 135 | int index = GetIndexIntoMasterTable(COMMAND, EnableCRTC); |
|---|
| 136 | 136 | ENABLE_CRTC_PS_ALLOCATION args; |
|---|
| 137 | 137 | |
|---|
| .. | .. |
|---|
| 147 | 147 | { |
|---|
| 148 | 148 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); |
|---|
| 149 | 149 | struct drm_device *dev = crtc->dev; |
|---|
| 150 | | - struct amdgpu_device *adev = dev->dev_private; |
|---|
| 150 | + struct amdgpu_device *adev = drm_to_adev(dev); |
|---|
| 151 | 151 | int index = GetIndexIntoMasterTable(COMMAND, BlankCRTC); |
|---|
| 152 | 152 | BLANK_CRTC_PS_ALLOCATION args; |
|---|
| 153 | 153 | |
|---|
| .. | .. |
|---|
| 163 | 163 | { |
|---|
| 164 | 164 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); |
|---|
| 165 | 165 | struct drm_device *dev = crtc->dev; |
|---|
| 166 | | - struct amdgpu_device *adev = dev->dev_private; |
|---|
| 166 | + struct amdgpu_device *adev = drm_to_adev(dev); |
|---|
| 167 | 167 | int index = GetIndexIntoMasterTable(COMMAND, EnableDispPowerGating); |
|---|
| 168 | 168 | ENABLE_DISP_POWER_GATING_PS_ALLOCATION args; |
|---|
| 169 | 169 | |
|---|
| .. | .. |
|---|
| 192 | 192 | { |
|---|
| 193 | 193 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); |
|---|
| 194 | 194 | struct drm_device *dev = crtc->dev; |
|---|
| 195 | | - struct amdgpu_device *adev = dev->dev_private; |
|---|
| 195 | + struct amdgpu_device *adev = drm_to_adev(dev); |
|---|
| 196 | 196 | SET_CRTC_USING_DTD_TIMING_PARAMETERS args; |
|---|
| 197 | 197 | int index = GetIndexIntoMasterTable(COMMAND, SetCRTC_UsingDTDTiming); |
|---|
| 198 | 198 | u16 misc = 0; |
|---|
| .. | .. |
|---|
| 307 | 307 | { |
|---|
| 308 | 308 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); |
|---|
| 309 | 309 | struct drm_device *dev = crtc->dev; |
|---|
| 310 | | - struct amdgpu_device *adev = dev->dev_private; |
|---|
| 310 | + struct amdgpu_device *adev = drm_to_adev(dev); |
|---|
| 311 | 311 | struct drm_encoder *encoder = amdgpu_crtc->encoder; |
|---|
| 312 | 312 | struct amdgpu_encoder *amdgpu_encoder = to_amdgpu_encoder(encoder); |
|---|
| 313 | 313 | struct drm_connector *connector = amdgpu_get_connector_for_encoder(encoder); |
|---|
| .. | .. |
|---|
| 588 | 588 | struct amdgpu_atom_ss *ss) |
|---|
| 589 | 589 | { |
|---|
| 590 | 590 | struct drm_device *dev = crtc->dev; |
|---|
| 591 | | - struct amdgpu_device *adev = dev->dev_private; |
|---|
| 591 | + struct amdgpu_device *adev = drm_to_adev(dev); |
|---|
| 592 | 592 | u8 frev, crev; |
|---|
| 593 | 593 | int index = GetIndexIntoMasterTable(COMMAND, SetPixelClock); |
|---|
| 594 | 594 | union set_pixel_clock args; |
|---|
| .. | .. |
|---|
| 749 | 749 | { |
|---|
| 750 | 750 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); |
|---|
| 751 | 751 | struct drm_device *dev = crtc->dev; |
|---|
| 752 | | - struct amdgpu_device *adev = dev->dev_private; |
|---|
| 752 | + struct amdgpu_device *adev = drm_to_adev(dev); |
|---|
| 753 | 753 | struct amdgpu_encoder *amdgpu_encoder = |
|---|
| 754 | 754 | to_amdgpu_encoder(amdgpu_crtc->encoder); |
|---|
| 755 | 755 | int encoder_mode = amdgpu_atombios_encoder_get_encoder_mode(amdgpu_crtc->encoder); |
|---|
| .. | .. |
|---|
| 818 | 818 | { |
|---|
| 819 | 819 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); |
|---|
| 820 | 820 | struct drm_device *dev = crtc->dev; |
|---|
| 821 | | - struct amdgpu_device *adev = dev->dev_private; |
|---|
| 821 | + struct amdgpu_device *adev = drm_to_adev(dev); |
|---|
| 822 | 822 | struct amdgpu_encoder *amdgpu_encoder = |
|---|
| 823 | 823 | to_amdgpu_encoder(amdgpu_crtc->encoder); |
|---|
| 824 | 824 | u32 pll_clock = mode->clock; |
|---|