diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-09-04 12:22:54 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2017-09-04 12:22:54 -0400 |
| commit | a6cbfa1e6d38c4b3ab0ce7e3aea4bb4e744f24b8 (patch) | |
| tree | 8960e571a398b5d32e72bdb9c89ce965daa870ab /drivers/gpu/drm/amd | |
| parent | f5308d1b83eba20e69df5e0926ba7257c8dd9074 (diff) | |
| parent | 08d6ac9ee5fedd82040bc878705981b67a116a3f (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 4.14 merge window.
Diffstat (limited to 'drivers/gpu/drm/amd')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 10 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/atombios_crtc.c | 4 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 7 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 7 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 7 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 7 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | 95 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c | 20 |
10 files changed, 110 insertions, 52 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c index 1cf78f4dd339..1e8e1123ddf4 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | |||
| @@ -693,6 +693,10 @@ int amdgpu_atombios_get_clock_info(struct amdgpu_device *adev) | |||
| 693 | DRM_INFO("Changing default dispclk from %dMhz to 600Mhz\n", | 693 | DRM_INFO("Changing default dispclk from %dMhz to 600Mhz\n", |
| 694 | adev->clock.default_dispclk / 100); | 694 | adev->clock.default_dispclk / 100); |
| 695 | adev->clock.default_dispclk = 60000; | 695 | adev->clock.default_dispclk = 60000; |
| 696 | } else if (adev->clock.default_dispclk <= 60000) { | ||
| 697 | DRM_INFO("Changing default dispclk from %dMhz to 625Mhz\n", | ||
| 698 | adev->clock.default_dispclk / 100); | ||
| 699 | adev->clock.default_dispclk = 62500; | ||
| 696 | } | 700 | } |
| 697 | adev->clock.dp_extclk = | 701 | adev->clock.dp_extclk = |
| 698 | le16_to_cpu(firmware_info->info_21.usUniphyDPModeExtClkFreq); | 702 | le16_to_cpu(firmware_info->info_21.usUniphyDPModeExtClkFreq); |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index f2d705e6a75a..ab6b0d0febab 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | |||
| @@ -449,6 +449,7 @@ static const struct pci_device_id pciidlist[] = { | |||
| 449 | {0x1002, 0x6986, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, | 449 | {0x1002, 0x6986, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, |
| 450 | {0x1002, 0x6987, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, | 450 | {0x1002, 0x6987, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, |
| 451 | {0x1002, 0x6995, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, | 451 | {0x1002, 0x6995, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, |
| 452 | {0x1002, 0x6997, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, | ||
| 452 | {0x1002, 0x699F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, | 453 | {0x1002, 0x699F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12}, |
| 453 | /* Vega 10 */ | 454 | /* Vega 10 */ |
| 454 | {0x1002, 0x6860, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10|AMD_EXP_HW_SUPPORT}, | 455 | {0x1002, 0x6860, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_VEGA10|AMD_EXP_HW_SUPPORT}, |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c index a4831fe0223b..a2c59a08b2bd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | |||
| @@ -220,9 +220,9 @@ static void amdgpu_vram_mgr_debug(struct ttm_mem_type_manager *man, | |||
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | const struct ttm_mem_type_manager_func amdgpu_vram_mgr_func = { | 222 | const struct ttm_mem_type_manager_func amdgpu_vram_mgr_func = { |
| 223 | amdgpu_vram_mgr_init, | 223 | .init = amdgpu_vram_mgr_init, |
| 224 | amdgpu_vram_mgr_fini, | 224 | .takedown = amdgpu_vram_mgr_fini, |
| 225 | amdgpu_vram_mgr_new, | 225 | .get_node = amdgpu_vram_mgr_new, |
| 226 | amdgpu_vram_mgr_del, | 226 | .put_node = amdgpu_vram_mgr_del, |
| 227 | amdgpu_vram_mgr_debug | 227 | .debug = amdgpu_vram_mgr_debug |
| 228 | }; | 228 | }; |
diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c b/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c index 8c9bc75a9c2d..8a0818b23ea4 100644 --- a/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c +++ b/drivers/gpu/drm/amd/amdgpu/atombios_crtc.c | |||
| @@ -165,7 +165,7 @@ void amdgpu_atombios_crtc_powergate(struct drm_crtc *crtc, int state) | |||
| 165 | struct drm_device *dev = crtc->dev; | 165 | struct drm_device *dev = crtc->dev; |
| 166 | struct amdgpu_device *adev = dev->dev_private; | 166 | struct amdgpu_device *adev = dev->dev_private; |
| 167 | int index = GetIndexIntoMasterTable(COMMAND, EnableDispPowerGating); | 167 | int index = GetIndexIntoMasterTable(COMMAND, EnableDispPowerGating); |
| 168 | ENABLE_DISP_POWER_GATING_PARAMETERS_V2_1 args; | 168 | ENABLE_DISP_POWER_GATING_PS_ALLOCATION args; |
| 169 | 169 | ||
| 170 | memset(&args, 0, sizeof(args)); | 170 | memset(&args, 0, sizeof(args)); |
| 171 | 171 | ||
| @@ -178,7 +178,7 @@ void amdgpu_atombios_crtc_powergate(struct drm_crtc *crtc, int state) | |||
| 178 | void amdgpu_atombios_crtc_powergate_init(struct amdgpu_device *adev) | 178 | void amdgpu_atombios_crtc_powergate_init(struct amdgpu_device *adev) |
| 179 | { | 179 | { |
| 180 | int index = GetIndexIntoMasterTable(COMMAND, EnableDispPowerGating); | 180 | int index = GetIndexIntoMasterTable(COMMAND, EnableDispPowerGating); |
| 181 | ENABLE_DISP_POWER_GATING_PARAMETERS_V2_1 args; | 181 | ENABLE_DISP_POWER_GATING_PS_ALLOCATION args; |
| 182 | 182 | ||
| 183 | memset(&args, 0, sizeof(args)); | 183 | memset(&args, 0, sizeof(args)); |
| 184 | 184 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c index 0cdeb6a2e4a0..5dffa27afa45 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | |||
| @@ -1207,8 +1207,11 @@ static void dce_v10_0_program_watermarks(struct amdgpu_device *adev, | |||
| 1207 | u32 tmp, wm_mask, lb_vblank_lead_lines = 0; | 1207 | u32 tmp, wm_mask, lb_vblank_lead_lines = 0; |
| 1208 | 1208 | ||
| 1209 | if (amdgpu_crtc->base.enabled && num_heads && mode) { | 1209 | if (amdgpu_crtc->base.enabled && num_heads && mode) { |
| 1210 | active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock; | 1210 | active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000, |
| 1211 | line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535); | 1211 | (u32)mode->clock); |
| 1212 | line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000, | ||
| 1213 | (u32)mode->clock); | ||
| 1214 | line_time = min(line_time, (u32)65535); | ||
| 1212 | 1215 | ||
| 1213 | /* watermark for high clocks */ | 1216 | /* watermark for high clocks */ |
| 1214 | if (adev->pm.dpm_enabled) { | 1217 | if (adev->pm.dpm_enabled) { |
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c index 773654a19749..47bbc87f96d2 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | |||
| @@ -1176,8 +1176,11 @@ static void dce_v11_0_program_watermarks(struct amdgpu_device *adev, | |||
| 1176 | u32 tmp, wm_mask, lb_vblank_lead_lines = 0; | 1176 | u32 tmp, wm_mask, lb_vblank_lead_lines = 0; |
| 1177 | 1177 | ||
| 1178 | if (amdgpu_crtc->base.enabled && num_heads && mode) { | 1178 | if (amdgpu_crtc->base.enabled && num_heads && mode) { |
| 1179 | active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock; | 1179 | active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000, |
| 1180 | line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535); | 1180 | (u32)mode->clock); |
| 1181 | line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000, | ||
| 1182 | (u32)mode->clock); | ||
| 1183 | line_time = min(line_time, (u32)65535); | ||
| 1181 | 1184 | ||
| 1182 | /* watermark for high clocks */ | 1185 | /* watermark for high clocks */ |
| 1183 | if (adev->pm.dpm_enabled) { | 1186 | if (adev->pm.dpm_enabled) { |
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c index 1f3552967ba3..d8c9a959493e 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | |||
| @@ -983,8 +983,11 @@ static void dce_v6_0_program_watermarks(struct amdgpu_device *adev, | |||
| 983 | fixed20_12 a, b, c; | 983 | fixed20_12 a, b, c; |
| 984 | 984 | ||
| 985 | if (amdgpu_crtc->base.enabled && num_heads && mode) { | 985 | if (amdgpu_crtc->base.enabled && num_heads && mode) { |
| 986 | active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock; | 986 | active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000, |
| 987 | line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535); | 987 | (u32)mode->clock); |
| 988 | line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000, | ||
| 989 | (u32)mode->clock); | ||
| 990 | line_time = min(line_time, (u32)65535); | ||
| 988 | priority_a_cnt = 0; | 991 | priority_a_cnt = 0; |
| 989 | priority_b_cnt = 0; | 992 | priority_b_cnt = 0; |
| 990 | 993 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c index 3c558c170e5e..db30c6ba563a 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | |||
| @@ -1091,8 +1091,11 @@ static void dce_v8_0_program_watermarks(struct amdgpu_device *adev, | |||
| 1091 | u32 tmp, wm_mask, lb_vblank_lead_lines = 0; | 1091 | u32 tmp, wm_mask, lb_vblank_lead_lines = 0; |
| 1092 | 1092 | ||
| 1093 | if (amdgpu_crtc->base.enabled && num_heads && mode) { | 1093 | if (amdgpu_crtc->base.enabled && num_heads && mode) { |
| 1094 | active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock; | 1094 | active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000, |
| 1095 | line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535); | 1095 | (u32)mode->clock); |
| 1096 | line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000, | ||
| 1097 | (u32)mode->clock); | ||
| 1098 | line_time = min(line_time, (u32)65535); | ||
| 1096 | 1099 | ||
| 1097 | /* watermark for high clocks */ | 1100 | /* watermark for high clocks */ |
| 1098 | if (adev->pm.dpm_enabled) { | 1101 | if (adev->pm.dpm_enabled) { |
diff --git a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c index fb0819359909..90332f55cfba 100644 --- a/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vce_v3_0.c | |||
| @@ -77,13 +77,26 @@ static int vce_v3_0_set_clockgating_state(void *handle, | |||
| 77 | static uint64_t vce_v3_0_ring_get_rptr(struct amdgpu_ring *ring) | 77 | static uint64_t vce_v3_0_ring_get_rptr(struct amdgpu_ring *ring) |
| 78 | { | 78 | { |
| 79 | struct amdgpu_device *adev = ring->adev; | 79 | struct amdgpu_device *adev = ring->adev; |
| 80 | u32 v; | ||
| 81 | |||
| 82 | mutex_lock(&adev->grbm_idx_mutex); | ||
| 83 | if (adev->vce.harvest_config == 0 || | ||
| 84 | adev->vce.harvest_config == AMDGPU_VCE_HARVEST_VCE1) | ||
| 85 | WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(0)); | ||
| 86 | else if (adev->vce.harvest_config == AMDGPU_VCE_HARVEST_VCE0) | ||
| 87 | WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(1)); | ||
| 80 | 88 | ||
| 81 | if (ring == &adev->vce.ring[0]) | 89 | if (ring == &adev->vce.ring[0]) |
| 82 | return RREG32(mmVCE_RB_RPTR); | 90 | v = RREG32(mmVCE_RB_RPTR); |
| 83 | else if (ring == &adev->vce.ring[1]) | 91 | else if (ring == &adev->vce.ring[1]) |
| 84 | return RREG32(mmVCE_RB_RPTR2); | 92 | v = RREG32(mmVCE_RB_RPTR2); |
| 85 | else | 93 | else |
| 86 | return RREG32(mmVCE_RB_RPTR3); | 94 | v = RREG32(mmVCE_RB_RPTR3); |
| 95 | |||
| 96 | WREG32(mmGRBM_GFX_INDEX, mmGRBM_GFX_INDEX_DEFAULT); | ||
| 97 | mutex_unlock(&adev->grbm_idx_mutex); | ||
| 98 | |||
| 99 | return v; | ||
| 87 | } | 100 | } |
| 88 | 101 | ||
| 89 | /** | 102 | /** |
| @@ -96,13 +109,26 @@ static uint64_t vce_v3_0_ring_get_rptr(struct amdgpu_ring *ring) | |||
| 96 | static uint64_t vce_v3_0_ring_get_wptr(struct amdgpu_ring *ring) | 109 | static uint64_t vce_v3_0_ring_get_wptr(struct amdgpu_ring *ring) |
| 97 | { | 110 | { |
| 98 | struct amdgpu_device *adev = ring->adev; | 111 | struct amdgpu_device *adev = ring->adev; |
| 112 | u32 v; | ||
| 113 | |||
| 114 | mutex_lock(&adev->grbm_idx_mutex); | ||
| 115 | if (adev->vce.harvest_config == 0 || | ||
| 116 | adev->vce.harvest_config == AMDGPU_VCE_HARVEST_VCE1) | ||
| 117 | WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(0)); | ||
| 118 | else if (adev->vce.harvest_config == AMDGPU_VCE_HARVEST_VCE0) | ||
| 119 | WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(1)); | ||
| 99 | 120 | ||
| 100 | if (ring == &adev->vce.ring[0]) | 121 | if (ring == &adev->vce.ring[0]) |
| 101 | return RREG32(mmVCE_RB_WPTR); | 122 | v = RREG32(mmVCE_RB_WPTR); |
| 102 | else if (ring == &adev->vce.ring[1]) | 123 | else if (ring == &adev->vce.ring[1]) |
| 103 | return RREG32(mmVCE_RB_WPTR2); | 124 | v = RREG32(mmVCE_RB_WPTR2); |
| 104 | else | 125 | else |
| 105 | return RREG32(mmVCE_RB_WPTR3); | 126 | v = RREG32(mmVCE_RB_WPTR3); |
| 127 | |||
| 128 | WREG32(mmGRBM_GFX_INDEX, mmGRBM_GFX_INDEX_DEFAULT); | ||
| 129 | mutex_unlock(&adev->grbm_idx_mutex); | ||
| 130 | |||
| 131 | return v; | ||
| 106 | } | 132 | } |
| 107 | 133 | ||
| 108 | /** | 134 | /** |
| @@ -116,12 +142,22 @@ static void vce_v3_0_ring_set_wptr(struct amdgpu_ring *ring) | |||
| 116 | { | 142 | { |
| 117 | struct amdgpu_device *adev = ring->adev; | 143 | struct amdgpu_device *adev = ring->adev; |
| 118 | 144 | ||
| 145 | mutex_lock(&adev->grbm_idx_mutex); | ||
| 146 | if (adev->vce.harvest_config == 0 || | ||
| 147 | adev->vce.harvest_config == AMDGPU_VCE_HARVEST_VCE1) | ||
| 148 | WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(0)); | ||
| 149 | else if (adev->vce.harvest_config == AMDGPU_VCE_HARVEST_VCE0) | ||
| 150 | WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(1)); | ||
| 151 | |||
| 119 | if (ring == &adev->vce.ring[0]) | 152 | if (ring == &adev->vce.ring[0]) |
| 120 | WREG32(mmVCE_RB_WPTR, lower_32_bits(ring->wptr)); | 153 | WREG32(mmVCE_RB_WPTR, lower_32_bits(ring->wptr)); |
| 121 | else if (ring == &adev->vce.ring[1]) | 154 | else if (ring == &adev->vce.ring[1]) |
| 122 | WREG32(mmVCE_RB_WPTR2, lower_32_bits(ring->wptr)); | 155 | WREG32(mmVCE_RB_WPTR2, lower_32_bits(ring->wptr)); |
| 123 | else | 156 | else |
| 124 | WREG32(mmVCE_RB_WPTR3, lower_32_bits(ring->wptr)); | 157 | WREG32(mmVCE_RB_WPTR3, lower_32_bits(ring->wptr)); |
| 158 | |||
| 159 | WREG32(mmGRBM_GFX_INDEX, mmGRBM_GFX_INDEX_DEFAULT); | ||
| 160 | mutex_unlock(&adev->grbm_idx_mutex); | ||
| 125 | } | 161 | } |
| 126 | 162 | ||
| 127 | static void vce_v3_0_override_vce_clock_gating(struct amdgpu_device *adev, bool override) | 163 | static void vce_v3_0_override_vce_clock_gating(struct amdgpu_device *adev, bool override) |
| @@ -231,33 +267,38 @@ static int vce_v3_0_start(struct amdgpu_device *adev) | |||
| 231 | struct amdgpu_ring *ring; | 267 | struct amdgpu_ring *ring; |
| 232 | int idx, r; | 268 | int idx, r; |
| 233 | 269 | ||
| 234 | ring = &adev->vce.ring[0]; | ||
| 235 | WREG32(mmVCE_RB_RPTR, lower_32_bits(ring->wptr)); | ||
| 236 | WREG32(mmVCE_RB_WPTR, lower_32_bits(ring->wptr)); | ||
| 237 | WREG32(mmVCE_RB_BASE_LO, ring->gpu_addr); | ||
| 238 | WREG32(mmVCE_RB_BASE_HI, upper_32_bits(ring->gpu_addr)); | ||
| 239 | WREG32(mmVCE_RB_SIZE, ring->ring_size / 4); | ||
| 240 | |||
| 241 | ring = &adev->vce.ring[1]; | ||
| 242 | WREG32(mmVCE_RB_RPTR2, lower_32_bits(ring->wptr)); | ||
| 243 | WREG32(mmVCE_RB_WPTR2, lower_32_bits(ring->wptr)); | ||
| 244 | WREG32(mmVCE_RB_BASE_LO2, ring->gpu_addr); | ||
| 245 | WREG32(mmVCE_RB_BASE_HI2, upper_32_bits(ring->gpu_addr)); | ||
| 246 | WREG32(mmVCE_RB_SIZE2, ring->ring_size / 4); | ||
| 247 | |||
| 248 | ring = &adev->vce.ring[2]; | ||
| 249 | WREG32(mmVCE_RB_RPTR3, lower_32_bits(ring->wptr)); | ||
| 250 | WREG32(mmVCE_RB_WPTR3, lower_32_bits(ring->wptr)); | ||
| 251 | WREG32(mmVCE_RB_BASE_LO3, ring->gpu_addr); | ||
| 252 | WREG32(mmVCE_RB_BASE_HI3, upper_32_bits(ring->gpu_addr)); | ||
| 253 | WREG32(mmVCE_RB_SIZE3, ring->ring_size / 4); | ||
| 254 | |||
| 255 | mutex_lock(&adev->grbm_idx_mutex); | 270 | mutex_lock(&adev->grbm_idx_mutex); |
| 256 | for (idx = 0; idx < 2; ++idx) { | 271 | for (idx = 0; idx < 2; ++idx) { |
| 257 | if (adev->vce.harvest_config & (1 << idx)) | 272 | if (adev->vce.harvest_config & (1 << idx)) |
| 258 | continue; | 273 | continue; |
| 259 | 274 | ||
| 260 | WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(idx)); | 275 | WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(idx)); |
| 276 | |||
| 277 | /* Program instance 0 reg space for two instances or instance 0 case | ||
| 278 | program instance 1 reg space for only instance 1 available case */ | ||
| 279 | if (idx != 1 || adev->vce.harvest_config == AMDGPU_VCE_HARVEST_VCE0) { | ||
| 280 | ring = &adev->vce.ring[0]; | ||
| 281 | WREG32(mmVCE_RB_RPTR, lower_32_bits(ring->wptr)); | ||
| 282 | WREG32(mmVCE_RB_WPTR, lower_32_bits(ring->wptr)); | ||
| 283 | WREG32(mmVCE_RB_BASE_LO, ring->gpu_addr); | ||
| 284 | WREG32(mmVCE_RB_BASE_HI, upper_32_bits(ring->gpu_addr)); | ||
| 285 | WREG32(mmVCE_RB_SIZE, ring->ring_size / 4); | ||
| 286 | |||
| 287 | ring = &adev->vce.ring[1]; | ||
| 288 | WREG32(mmVCE_RB_RPTR2, lower_32_bits(ring->wptr)); | ||
| 289 | WREG32(mmVCE_RB_WPTR2, lower_32_bits(ring->wptr)); | ||
| 290 | WREG32(mmVCE_RB_BASE_LO2, ring->gpu_addr); | ||
| 291 | WREG32(mmVCE_RB_BASE_HI2, upper_32_bits(ring->gpu_addr)); | ||
| 292 | WREG32(mmVCE_RB_SIZE2, ring->ring_size / 4); | ||
| 293 | |||
| 294 | ring = &adev->vce.ring[2]; | ||
| 295 | WREG32(mmVCE_RB_RPTR3, lower_32_bits(ring->wptr)); | ||
| 296 | WREG32(mmVCE_RB_WPTR3, lower_32_bits(ring->wptr)); | ||
| 297 | WREG32(mmVCE_RB_BASE_LO3, ring->gpu_addr); | ||
| 298 | WREG32(mmVCE_RB_BASE_HI3, upper_32_bits(ring->gpu_addr)); | ||
| 299 | WREG32(mmVCE_RB_SIZE3, ring->ring_size / 4); | ||
| 300 | } | ||
| 301 | |||
| 261 | vce_v3_0_mc_resume(adev, idx); | 302 | vce_v3_0_mc_resume(adev, idx); |
| 262 | WREG32_FIELD(VCE_STATUS, JOB_BUSY, 1); | 303 | WREG32_FIELD(VCE_STATUS, JOB_BUSY, 1); |
| 263 | 304 | ||
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c index d5f53d04fa08..83e40fe51b62 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c | |||
| @@ -709,17 +709,17 @@ static int tf_vega10_thermal_disable_alert(struct pp_hwmgr *hwmgr, | |||
| 709 | 709 | ||
| 710 | static struct phm_master_table_item | 710 | static struct phm_master_table_item |
| 711 | vega10_thermal_start_thermal_controller_master_list[] = { | 711 | vega10_thermal_start_thermal_controller_master_list[] = { |
| 712 | {NULL, tf_vega10_thermal_initialize}, | 712 | { .tableFunction = tf_vega10_thermal_initialize }, |
| 713 | {NULL, tf_vega10_thermal_set_temperature_range}, | 713 | { .tableFunction = tf_vega10_thermal_set_temperature_range }, |
| 714 | {NULL, tf_vega10_thermal_enable_alert}, | 714 | { .tableFunction = tf_vega10_thermal_enable_alert }, |
| 715 | /* We should restrict performance levels to low before we halt the SMC. | 715 | /* We should restrict performance levels to low before we halt the SMC. |
| 716 | * On the other hand we are still in boot state when we do this | 716 | * On the other hand we are still in boot state when we do this |
| 717 | * so it would be pointless. | 717 | * so it would be pointless. |
| 718 | * If this assumption changes we have to revisit this table. | 718 | * If this assumption changes we have to revisit this table. |
| 719 | */ | 719 | */ |
| 720 | {NULL, tf_vega10_thermal_setup_fan_table}, | 720 | { .tableFunction = tf_vega10_thermal_setup_fan_table }, |
| 721 | {NULL, tf_vega10_thermal_start_smc_fan_control}, | 721 | { .tableFunction = tf_vega10_thermal_start_smc_fan_control }, |
| 722 | {NULL, NULL} | 722 | { } |
| 723 | }; | 723 | }; |
| 724 | 724 | ||
| 725 | static struct phm_master_table_header | 725 | static struct phm_master_table_header |
| @@ -731,10 +731,10 @@ vega10_thermal_start_thermal_controller_master = { | |||
| 731 | 731 | ||
| 732 | static struct phm_master_table_item | 732 | static struct phm_master_table_item |
| 733 | vega10_thermal_set_temperature_range_master_list[] = { | 733 | vega10_thermal_set_temperature_range_master_list[] = { |
| 734 | {NULL, tf_vega10_thermal_disable_alert}, | 734 | { .tableFunction = tf_vega10_thermal_disable_alert }, |
| 735 | {NULL, tf_vega10_thermal_set_temperature_range}, | 735 | { .tableFunction = tf_vega10_thermal_set_temperature_range }, |
| 736 | {NULL, tf_vega10_thermal_enable_alert}, | 736 | { .tableFunction = tf_vega10_thermal_enable_alert }, |
| 737 | {NULL, NULL} | 737 | { } |
| 738 | }; | 738 | }; |
| 739 | 739 | ||
| 740 | struct phm_master_table_header | 740 | struct phm_master_table_header |
