[PATCH 2/2] drm/amdgpu: access stolen VRAM directly on CZ

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7 November 2016 at 19:21, Christian König <deathsimple at vodafone.de> wrote:
> From: Christian König <christian.koenig at amd.com>
>
> We don't need to use the PCI BAR on APUs. This allows us to access
> the full VRAM directly without being limited by the BAR size.

I'm feeling coherency issues, has this approach been validated with the hw team?

Dave.

>
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> index f7372d3..0323f5d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
> @@ -462,9 +462,16 @@ static int gmc_v8_0_mc_init(struct amdgpu_device *adev)
>         /* size in MB on si */
>         adev->mc.mc_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL;
>         adev->mc.real_vram_size = RREG32(mmCONFIG_MEMSIZE) * 1024ULL * 1024ULL;
> -       adev->mc.visible_vram_size = adev->mc.aper_size;
> +
> +#ifdef CONFIG_X86_64
> +       if (adev->flags & AMD_IS_APU) {
> +               adev->mc.aper_base = RREG32(mmMC_VM_FB_OFFSET) << 22ULL;
> +               adev->mc.aper_size = adev->mc.real_vram_size;
> +       }
> +#endif
>
>         /* In case the PCI BAR is larger than the actual amount of vram */
> +       adev->mc.visible_vram_size = adev->mc.aper_size;
>         if (adev->mc.visible_vram_size > adev->mc.real_vram_size)
>                 adev->mc.visible_vram_size = adev->mc.real_vram_size;
>
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux