diff options
author | Monk Liu <Monk.Liu@amd.com> | 2017-01-22 21:49:33 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-03-29 23:52:40 -0400 |
commit | ce137c04ff4bb7862a952e32d5200c301e620601 (patch) | |
tree | d8901a2063274fded4040c711756556e93581637 /drivers/gpu | |
parent | cbabc8b343953e7bc6d70b5a22aaebbd73ae9934 (diff) |
drm/amdgpu:cg & pg shouldn't active on VF device
CG & PG function changes engine clock/gating, which is
not appropriate for VF device, because one vf doesn't know
the whole picture of engine's overall workload.
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/vi.c | 6 |
4 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index 67afc901905c..e0a96ca583a4 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |||
@@ -5841,6 +5841,9 @@ static int gfx_v8_0_set_powergating_state(void *handle, | |||
5841 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 5841 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
5842 | bool enable = (state == AMD_PG_STATE_GATE) ? true : false; | 5842 | bool enable = (state == AMD_PG_STATE_GATE) ? true : false; |
5843 | 5843 | ||
5844 | if (amdgpu_sriov_vf(adev)) | ||
5845 | return 0; | ||
5846 | |||
5844 | switch (adev->asic_type) { | 5847 | switch (adev->asic_type) { |
5845 | case CHIP_CARRIZO: | 5848 | case CHIP_CARRIZO: |
5846 | case CHIP_STONEY: | 5849 | case CHIP_STONEY: |
@@ -5898,6 +5901,9 @@ static void gfx_v8_0_get_clockgating_state(void *handle, u32 *flags) | |||
5898 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 5901 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
5899 | int data; | 5902 | int data; |
5900 | 5903 | ||
5904 | if (amdgpu_sriov_vf(adev)) | ||
5905 | *flags = 0; | ||
5906 | |||
5901 | /* AMD_CG_SUPPORT_GFX_MGCG */ | 5907 | /* AMD_CG_SUPPORT_GFX_MGCG */ |
5902 | data = RREG32(mmRLC_CGTT_MGCG_OVERRIDE); | 5908 | data = RREG32(mmRLC_CGTT_MGCG_OVERRIDE); |
5903 | if (!(data & RLC_CGTT_MGCG_OVERRIDE__CPF_MASK)) | 5909 | if (!(data & RLC_CGTT_MGCG_OVERRIDE__CPF_MASK)) |
@@ -6411,6 +6417,9 @@ static int gfx_v8_0_set_clockgating_state(void *handle, | |||
6411 | { | 6417 | { |
6412 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 6418 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
6413 | 6419 | ||
6420 | if (amdgpu_sriov_vf(adev)) | ||
6421 | return 0; | ||
6422 | |||
6414 | switch (adev->asic_type) { | 6423 | switch (adev->asic_type) { |
6415 | case CHIP_FIJI: | 6424 | case CHIP_FIJI: |
6416 | case CHIP_CARRIZO: | 6425 | case CHIP_CARRIZO: |
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c index 65025080a4b8..8c9e7307853f 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | |||
@@ -1434,6 +1434,9 @@ static int gmc_v8_0_set_clockgating_state(void *handle, | |||
1434 | { | 1434 | { |
1435 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 1435 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
1436 | 1436 | ||
1437 | if (amdgpu_sriov_vf(adev)) | ||
1438 | return 0; | ||
1439 | |||
1437 | switch (adev->asic_type) { | 1440 | switch (adev->asic_type) { |
1438 | case CHIP_FIJI: | 1441 | case CHIP_FIJI: |
1439 | fiji_update_mc_medium_grain_clock_gating(adev, | 1442 | fiji_update_mc_medium_grain_clock_gating(adev, |
@@ -1458,6 +1461,9 @@ static void gmc_v8_0_get_clockgating_state(void *handle, u32 *flags) | |||
1458 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 1461 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
1459 | int data; | 1462 | int data; |
1460 | 1463 | ||
1464 | if (amdgpu_sriov_vf(adev)) | ||
1465 | *flags = 0; | ||
1466 | |||
1461 | /* AMD_CG_SUPPORT_MC_MGCG */ | 1467 | /* AMD_CG_SUPPORT_MC_MGCG */ |
1462 | data = RREG32(mmMC_HUB_MISC_HUB_CG); | 1468 | data = RREG32(mmMC_HUB_MISC_HUB_CG); |
1463 | if (data & MC_HUB_MISC_HUB_CG__ENABLE_MASK) | 1469 | if (data & MC_HUB_MISC_HUB_CG__ENABLE_MASK) |
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c index 011800f621c6..47e6f146aa25 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | |||
@@ -1512,6 +1512,9 @@ static int sdma_v3_0_set_clockgating_state(void *handle, | |||
1512 | { | 1512 | { |
1513 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 1513 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
1514 | 1514 | ||
1515 | if (amdgpu_sriov_vf(adev)) | ||
1516 | return 0; | ||
1517 | |||
1515 | switch (adev->asic_type) { | 1518 | switch (adev->asic_type) { |
1516 | case CHIP_FIJI: | 1519 | case CHIP_FIJI: |
1517 | case CHIP_CARRIZO: | 1520 | case CHIP_CARRIZO: |
@@ -1538,6 +1541,9 @@ static void sdma_v3_0_get_clockgating_state(void *handle, u32 *flags) | |||
1538 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 1541 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
1539 | int data; | 1542 | int data; |
1540 | 1543 | ||
1544 | if (amdgpu_sriov_vf(adev)) | ||
1545 | *flags = 0; | ||
1546 | |||
1541 | /* AMD_CG_SUPPORT_SDMA_MGCG */ | 1547 | /* AMD_CG_SUPPORT_SDMA_MGCG */ |
1542 | data = RREG32(mmSDMA0_CLK_CTRL + sdma_offsets[0]); | 1548 | data = RREG32(mmSDMA0_CLK_CTRL + sdma_offsets[0]); |
1543 | if (!(data & SDMA0_CLK_CTRL__SOFT_OVERRIDE0_MASK)) | 1549 | if (!(data & SDMA0_CLK_CTRL__SOFT_OVERRIDE0_MASK)) |
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c index 4a785d6acfb9..7fa314c217c9 100644 --- a/drivers/gpu/drm/amd/amdgpu/vi.c +++ b/drivers/gpu/drm/amd/amdgpu/vi.c | |||
@@ -1391,6 +1391,9 @@ static int vi_common_set_clockgating_state(void *handle, | |||
1391 | { | 1391 | { |
1392 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 1392 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
1393 | 1393 | ||
1394 | if (amdgpu_sriov_vf(adev)) | ||
1395 | return 0; | ||
1396 | |||
1394 | switch (adev->asic_type) { | 1397 | switch (adev->asic_type) { |
1395 | case CHIP_FIJI: | 1398 | case CHIP_FIJI: |
1396 | vi_update_bif_medium_grain_light_sleep(adev, | 1399 | vi_update_bif_medium_grain_light_sleep(adev, |
@@ -1435,6 +1438,9 @@ static void vi_common_get_clockgating_state(void *handle, u32 *flags) | |||
1435 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 1438 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
1436 | int data; | 1439 | int data; |
1437 | 1440 | ||
1441 | if (amdgpu_sriov_vf(adev)) | ||
1442 | *flags = 0; | ||
1443 | |||
1438 | /* AMD_CG_SUPPORT_BIF_LS */ | 1444 | /* AMD_CG_SUPPORT_BIF_LS */ |
1439 | data = RREG32_PCIE(ixPCIE_CNTL2); | 1445 | data = RREG32_PCIE(ixPCIE_CNTL2); |
1440 | if (data & PCIE_CNTL2__SLV_MEM_LS_EN_MASK) | 1446 | if (data & PCIE_CNTL2__SLV_MEM_LS_EN_MASK) |