From: "Zhang, Jerry (Junwei)" <Jerry.Zhang-5C7GfCeVMHo@public.gmane.org>
To: "Christian König"
<ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 6/7] drm/amdgpu: enable AGP aperture for GMC9
Date: Thu, 30 Aug 2018 12:13:36 +0800 [thread overview]
Message-ID: <5B876EF0.3090209@amd.com> (raw)
In-Reply-To: <20180829140809.1812-6-christian.koenig-5C7GfCeVMHo@public.gmane.org>
On 08/29/2018 10:08 PM, Christian König wrote:
> Enable the old AGP aperture to avoid GART mappings.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c | 10 +++++-----
> drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 1 +
> drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c | 10 +++++-----
> 3 files changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
> index 3403ded39d13..ffd0ec9586d1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c
> @@ -65,16 +65,16 @@ static void gfxhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev)
> {
> uint64_t value;
>
> - /* Disable AGP. */
> + /* Program the AGP BAR */
> WREG32_SOC15(GC, 0, mmMC_VM_AGP_BASE, 0);
> - WREG32_SOC15(GC, 0, mmMC_VM_AGP_TOP, 0);
> - WREG32_SOC15(GC, 0, mmMC_VM_AGP_BOT, 0xFFFFFFFF);
> + WREG32_SOC15(GC, 0, mmMC_VM_AGP_BOT, adev->gmc.agp_start >> 24);
> + WREG32_SOC15(GC, 0, mmMC_VM_AGP_TOP, adev->gmc.agp_end >> 24);
>
> /* Program the system aperture low logical page number. */
> WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
> - adev->gmc.vram_start >> 18);
> + min(adev->gmc.vram_start, adev->gmc.agp_start) >> 18);
> WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR,
> - adev->gmc.vram_end >> 18);
> + max(adev->gmc.vram_end, adev->gmc.agp_end) >> 18);
>
> /* Set default page address. */
> value = adev->vram_scratch.gpu_addr - adev->gmc.vram_start
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> index 04d50893a6f2..719f45cdaf6a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
> @@ -751,6 +751,7 @@ static void gmc_v9_0_vram_gtt_location(struct amdgpu_device *adev,
> base = mmhub_v1_0_get_fb_location(adev);
> amdgpu_gmc_vram_location(adev, &adev->gmc, base);
> amdgpu_gmc_gart_location(adev, mc);
> + amdgpu_gmc_agp_location(adev, mc);
> /* base offset of vram pages */
> adev->vm_manager.vram_base_offset = gfxhub_v1_0_get_mc_fb_offset(adev);
> }
> diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
> index 5f6a9c85488f..73d7c075dd33 100644
> --- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c
> @@ -76,16 +76,16 @@ static void mmhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev)
> uint64_t value;
> uint32_t tmp;
>
> - /* Disable AGP. */
> + /* Program the AGP BAR */
> WREG32_SOC15(MMHUB, 0, mmMC_VM_AGP_BASE, 0);
> - WREG32_SOC15(MMHUB, 0, mmMC_VM_AGP_TOP, 0);
> - WREG32_SOC15(MMHUB, 0, mmMC_VM_AGP_BOT, 0x00FFFFFF);
> + WREG32_SOC15(MMHUB, 0, mmMC_VM_AGP_BOT, adev->gmc.agp_start >> 24);
> + WREG32_SOC15(MMHUB, 0, mmMC_VM_AGP_TOP, adev->gmc.agp_end >> 24);
>
> /* Program the system aperture low logical page number. */
> WREG32_SOC15(MMHUB, 0, mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
> - adev->gmc.vram_start >> 18);
> + min(adev->gmc.vram_start, adev->gmc.agp_start) >> 18);
> WREG32_SOC15(MMHUB, 0, mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR,
> - adev->gmc.vram_end >> 18);
> + max(adev->gmc.vram_end, adev->gmc.agp_end) >> 18);
>
> /* Set default page address. */
> value = adev->vram_scratch.gpu_addr - adev->gmc.vram_start +
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2018-08-30 4:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-29 14:08 [PATCH 1/7] drm/amdgpu: correctly sign extend 48bit addresses v3 Christian König
[not found] ` <20180829140809.1812-1-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-08-29 14:08 ` [PATCH 2/7] drm/amdgpu: put GART away from VRAM v2 Christian König
[not found] ` <20180829140809.1812-2-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-08-30 2:51 ` Zhang, Jerry (Junwei)
2018-08-29 14:08 ` [PATCH 3/7] drm/amdgpu: add amdgpu_gmc_agp_location v2 Christian König
[not found] ` <20180829140809.1812-3-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-08-30 3:08 ` Zhang, Jerry (Junwei)
2018-08-29 14:08 ` [PATCH 4/7] drm/amdgpu: use the AGP aperture for system memory access v2 Christian König
[not found] ` <20180829140809.1812-4-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-08-30 3:20 ` Zhang, Jerry (Junwei)
[not found] ` <5B87627D.9050601-5C7GfCeVMHo@public.gmane.org>
2018-08-30 12:15 ` Christian König
[not found] ` <b7100847-7afc-5665-6752-99173e03934a-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-08-31 1:39 ` Zhang, Jerry (Junwei)
2018-08-29 14:08 ` [PATCH 5/7] drm/amdgpu: manually map the shadow BOs again Christian König
[not found] ` <20180829140809.1812-5-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-08-30 3:29 ` Zhang, Jerry (Junwei)
[not found] ` <5B876486.2060401-5C7GfCeVMHo@public.gmane.org>
2018-08-30 12:16 ` Christian König
2018-08-29 14:08 ` [PATCH 6/7] drm/amdgpu: enable AGP aperture for GMC9 Christian König
[not found] ` <20180829140809.1812-6-christian.koenig-5C7GfCeVMHo@public.gmane.org>
2018-08-30 4:13 ` Zhang, Jerry (Junwei) [this message]
2018-08-29 14:08 ` [PATCH 7/7] drm/amdgpu: try to make kernel allocations USWC Christian König
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5B876EF0.3090209@amd.com \
--to=jerry.zhang-5c7gfcevmho@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.