OSDN Git Service

drm/amdgpu: Map all visible VRAM at startup
authorAmber Lin <Amber.Lin@amd.com>
Tue, 27 Feb 2018 15:01:59 +0000 (10:01 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 28 Feb 2018 20:38:46 +0000 (15:38 -0500)
commitf8f4b9a679e52298b14358db22c37a135e7086ec
treed832f1bc6717908756b81280b48d1c00e2b3f8b1
parent5d447f09b8d8346c64f4c952a67c61f7ce88d3c1
drm/amdgpu: Map all visible VRAM at startup

When using CPU to update page table, we need to kmap all the PDs/PTs after
they are allocated and that requires a TLB shot down on each CPU, which is
quite heavy.

Instead, we map the whole visible VRAM to a kernel address at once. Pages
can be obtained from the offset.

v2: move the mapping base from gmc to amdgpu_mman structure, and the
    implementation in amdgpu_ttm_* functions

Signed-off-by: Amber Lin <Amber.Lin@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h