diff options
author | Andres Rodriguez <andresx7@gmail.com> | 2017-02-01 19:08:23 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-05-31 16:48:52 -0400 |
commit | 42794b27cc628d44db28f62f3333bd12416b597f (patch) | |
tree | 893f1c3b7572c1baadcaacb61dce15d8881efe2b /drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |
parent | d59095f7dd8810e67bdad7a65131903646ebc444 (diff) |
drm/amdgpu: take ownership of per-pipe configuration v3
Make amdgpu the owner of all per-pipe state of the HQDs.
This change will allow us to split the queues between kfd and amdgpu
with a queue granularity instead of pipe granularity.
This patch fixes kfd allocating an HDP_EOP region for its 3 pipes which
goes unused.
v2: support for gfx9
v3: fix gfx7 HPD intitialization
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index 467a0e3ff5a5..8c2241631ade 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |||
@@ -1426,18 +1426,33 @@ static int gfx_v8_0_mec_init(struct amdgpu_device *adev) | |||
1426 | { | 1426 | { |
1427 | int r; | 1427 | int r; |
1428 | u32 *hpd; | 1428 | u32 *hpd; |
1429 | size_t mec_hpd_size; | ||
1429 | 1430 | ||
1430 | /* | 1431 | switch (adev->asic_type) { |
1431 | * we assign only 1 pipe because all other pipes will | 1432 | case CHIP_FIJI: |
1432 | * be handled by KFD | 1433 | case CHIP_TONGA: |
1433 | */ | 1434 | case CHIP_POLARIS11: |
1434 | adev->gfx.mec.num_mec = 1; | 1435 | case CHIP_POLARIS12: |
1435 | adev->gfx.mec.num_pipe = 1; | 1436 | case CHIP_POLARIS10: |
1436 | adev->gfx.mec.num_queue = adev->gfx.mec.num_mec * adev->gfx.mec.num_pipe * 8; | 1437 | case CHIP_CARRIZO: |
1438 | adev->gfx.mec.num_mec = 2; | ||
1439 | break; | ||
1440 | case CHIP_TOPAZ: | ||
1441 | case CHIP_STONEY: | ||
1442 | default: | ||
1443 | adev->gfx.mec.num_mec = 1; | ||
1444 | break; | ||
1445 | } | ||
1446 | |||
1447 | adev->gfx.mec.num_pipe_per_mec = 4; | ||
1448 | adev->gfx.mec.num_queue_per_pipe = 8; | ||
1449 | |||
1450 | /* only 1 pipe of the first MEC is owned by amdgpu */ | ||
1451 | mec_hpd_size = 1 * 1 * adev->gfx.mec.num_queue_per_pipe * GFX8_MEC_HPD_SIZE; | ||
1437 | 1452 | ||
1438 | if (adev->gfx.mec.hpd_eop_obj == NULL) { | 1453 | if (adev->gfx.mec.hpd_eop_obj == NULL) { |
1439 | r = amdgpu_bo_create(adev, | 1454 | r = amdgpu_bo_create(adev, |
1440 | adev->gfx.mec.num_queue * GFX8_MEC_HPD_SIZE, | 1455 | mec_hpd_size, |
1441 | PAGE_SIZE, true, | 1456 | PAGE_SIZE, true, |
1442 | AMDGPU_GEM_DOMAIN_GTT, 0, NULL, NULL, | 1457 | AMDGPU_GEM_DOMAIN_GTT, 0, NULL, NULL, |
1443 | &adev->gfx.mec.hpd_eop_obj); | 1458 | &adev->gfx.mec.hpd_eop_obj); |
@@ -1466,7 +1481,7 @@ static int gfx_v8_0_mec_init(struct amdgpu_device *adev) | |||
1466 | return r; | 1481 | return r; |
1467 | } | 1482 | } |
1468 | 1483 | ||
1469 | memset(hpd, 0, adev->gfx.mec.num_queue * GFX8_MEC_HPD_SIZE); | 1484 | memset(hpd, 0, mec_hpd_size); |
1470 | 1485 | ||
1471 | amdgpu_bo_kunmap(adev->gfx.mec.hpd_eop_obj); | 1486 | amdgpu_bo_kunmap(adev->gfx.mec.hpd_eop_obj); |
1472 | amdgpu_bo_unreserve(adev->gfx.mec.hpd_eop_obj); | 1487 | amdgpu_bo_unreserve(adev->gfx.mec.hpd_eop_obj); |