diff options
author | Ben Goz <ben.goz@amd.com> | 2015-01-02 16:43:19 -0500 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@amd.com> | 2015-01-02 16:43:19 -0500 |
commit | 08dcc57fcd240922347c8a9f14d18e67a3f9f1a9 (patch) | |
tree | 324c02f25a64bc9caa246da8b1a8ae3b0bcf43c9 /drivers/gpu/drm/radeon/cik.c | |
parent | fc83975348ebce07793e6b9f780edc3cbcffa9fc (diff) |
drm/radeon: Initialize compute vmid
This patch moves to radeon the initialization of compute vmid.
That initializations was done in kfd-->kgd interface, but doing it in radeon
as part of radeon's H/W initialization routines is more appropriate.
In addition, this simplifies the kfd-->kgd interface.
The patch removes the function from the interface file and from the interface
declaration file.
The function initializes memory apertures to fixed base/limit address and non
cached memory types.
Signed-off-by: Ben Goz <ben.goz@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/cik.c')
-rw-r--r-- | drivers/gpu/drm/radeon/cik.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index 6dcde3798b45..14d173e2a8f7 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c | |||
@@ -5707,6 +5707,28 @@ void cik_pcie_gart_tlb_flush(struct radeon_device *rdev) | |||
5707 | WREG32(VM_INVALIDATE_REQUEST, 0x1); | 5707 | WREG32(VM_INVALIDATE_REQUEST, 0x1); |
5708 | } | 5708 | } |
5709 | 5709 | ||
5710 | static void cik_pcie_init_compute_vmid(struct radeon_device *rdev) | ||
5711 | { | ||
5712 | int i; | ||
5713 | uint32_t sh_mem_bases, sh_mem_config; | ||
5714 | |||
5715 | sh_mem_bases = 0x6000 | 0x6000 << 16; | ||
5716 | sh_mem_config = ALIGNMENT_MODE(SH_MEM_ALIGNMENT_MODE_UNALIGNED); | ||
5717 | sh_mem_config |= DEFAULT_MTYPE(MTYPE_NONCACHED); | ||
5718 | |||
5719 | mutex_lock(&rdev->srbm_mutex); | ||
5720 | for (i = 8; i < 16; i++) { | ||
5721 | cik_srbm_select(rdev, 0, 0, 0, i); | ||
5722 | /* CP and shaders */ | ||
5723 | WREG32(SH_MEM_CONFIG, sh_mem_config); | ||
5724 | WREG32(SH_MEM_APE1_BASE, 1); | ||
5725 | WREG32(SH_MEM_APE1_LIMIT, 0); | ||
5726 | WREG32(SH_MEM_BASES, sh_mem_bases); | ||
5727 | } | ||
5728 | cik_srbm_select(rdev, 0, 0, 0, 0); | ||
5729 | mutex_unlock(&rdev->srbm_mutex); | ||
5730 | } | ||
5731 | |||
5710 | /** | 5732 | /** |
5711 | * cik_pcie_gart_enable - gart enable | 5733 | * cik_pcie_gart_enable - gart enable |
5712 | * | 5734 | * |
@@ -5820,6 +5842,8 @@ static int cik_pcie_gart_enable(struct radeon_device *rdev) | |||
5820 | cik_srbm_select(rdev, 0, 0, 0, 0); | 5842 | cik_srbm_select(rdev, 0, 0, 0, 0); |
5821 | mutex_unlock(&rdev->srbm_mutex); | 5843 | mutex_unlock(&rdev->srbm_mutex); |
5822 | 5844 | ||
5845 | cik_pcie_init_compute_vmid(rdev); | ||
5846 | |||
5823 | cik_pcie_gart_tlb_flush(rdev); | 5847 | cik_pcie_gart_tlb_flush(rdev); |
5824 | DRM_INFO("PCIE GART of %uM enabled (table at 0x%016llX).\n", | 5848 | DRM_INFO("PCIE GART of %uM enabled (table at 0x%016llX).\n", |
5825 | (unsigned)(rdev->mc.gtt_size >> 20), | 5849 | (unsigned)(rdev->mc.gtt_size >> 20), |