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_v9_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_v9_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index 9a0029d80ff4..9f432e45b31b 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | |||
@@ -865,20 +865,28 @@ static int gfx_v9_0_mec_init(struct amdgpu_device *adev) | |||
865 | const __le32 *fw_data; | 865 | const __le32 *fw_data; |
866 | unsigned fw_size; | 866 | unsigned fw_size; |
867 | u32 *fw; | 867 | u32 *fw; |
868 | size_t mec_hpd_size; | ||
868 | 869 | ||
869 | const struct gfx_firmware_header_v1_0 *mec_hdr; | 870 | const struct gfx_firmware_header_v1_0 *mec_hdr; |
870 | 871 | ||
871 | /* | 872 | switch (adev->asic_type) { |
872 | * we assign only 1 pipe because all other pipes will | 873 | case CHIP_VEGA10: |
873 | * be handled by KFD | 874 | adev->gfx.mec.num_mec = 2; |
874 | */ | 875 | break; |
875 | adev->gfx.mec.num_mec = 1; | 876 | default: |
876 | adev->gfx.mec.num_pipe = 1; | 877 | adev->gfx.mec.num_mec = 1; |
877 | adev->gfx.mec.num_queue = adev->gfx.mec.num_mec * adev->gfx.mec.num_pipe * 8; | 878 | break; |
879 | } | ||
880 | |||
881 | adev->gfx.mec.num_pipe_per_mec = 4; | ||
882 | adev->gfx.mec.num_queue_per_pipe = 8; | ||
883 | |||
884 | /* only 1 pipe of the first MEC is owned by amdgpu */ | ||
885 | mec_hpd_size = 1 * 1 * adev->gfx.mec.num_queue_per_pipe * GFX9_MEC_HPD_SIZE; | ||
878 | 886 | ||
879 | if (adev->gfx.mec.hpd_eop_obj == NULL) { | 887 | if (adev->gfx.mec.hpd_eop_obj == NULL) { |
880 | r = amdgpu_bo_create(adev, | 888 | r = amdgpu_bo_create(adev, |
881 | adev->gfx.mec.num_queue * GFX9_MEC_HPD_SIZE, | 889 | mec_hpd_size, |
882 | PAGE_SIZE, true, | 890 | PAGE_SIZE, true, |
883 | AMDGPU_GEM_DOMAIN_GTT, 0, NULL, NULL, | 891 | AMDGPU_GEM_DOMAIN_GTT, 0, NULL, NULL, |
884 | &adev->gfx.mec.hpd_eop_obj); | 892 | &adev->gfx.mec.hpd_eop_obj); |