Skip to content

Commit 6ba5b61

Browse files
committed
drm/amdgpu: add a module parameter to control the AGP aperture
Add a module parameter to control the AGP aperture. The AGP aperture is an aperture in the GPU's internal address space which provides direct non-paged access to the platform address space. This access is non-snooped so only uncached memory can be accessed. Add a knob so that we can toggle this for debugging. Fixes: 67318cb ("drm/amdgpu/gmc11: set gart placement GC11") Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Tested-by: Mario Limonciello <mario.limonciello@amd.com> # PHX & Navi33 Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 564ca1b commit 6ba5b61

5 files changed

Lines changed: 15 additions & 3 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ extern int amdgpu_umsch_mm;
248248
extern int amdgpu_seamless;
249249

250250
extern int amdgpu_user_partt_mode;
251+
extern int amdgpu_agp;
251252

252253
#define AMDGPU_VM_MAX_NUM_CTX 4096
253254
#define AMDGPU_SG_THRESHOLD (256*1024*1024)

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ int amdgpu_user_partt_mode = AMDGPU_AUTO_COMPUTE_PARTITION_MODE;
207207
int amdgpu_umsch_mm;
208208
int amdgpu_seamless = -1; /* auto */
209209
uint amdgpu_debug_mask;
210+
int amdgpu_agp = -1; /* auto */
210211

211212
static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work);
212213

@@ -961,6 +962,15 @@ module_param_named(seamless, amdgpu_seamless, int, 0444);
961962
MODULE_PARM_DESC(debug_mask, "debug options for amdgpu, disabled by default");
962963
module_param_named(debug_mask, amdgpu_debug_mask, uint, 0444);
963964

965+
/**
966+
* DOC: agp (int)
967+
* Enable the AGP aperture. This provides an aperture in the GPU's internal
968+
* address space for direct access to system memory. Note that these accesses
969+
* are non-snooped, so they are only used for access to uncached memory.
970+
*/
971+
MODULE_PARM_DESC(agp, "AGP (-1 = auto (default), 0 = disable, 1 = enable)");
972+
module_param_named(agp, amdgpu_agp, int, 0444);
973+
964974
/* These devices are not supported by amdgpu.
965975
* They are supported by the mach64, r128, radeon drivers
966976
*/

drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ static void gmc_v10_0_vram_gtt_location(struct amdgpu_device *adev,
675675
amdgpu_gmc_set_agp_default(adev, mc);
676676
amdgpu_gmc_vram_location(adev, &adev->gmc, base);
677677
amdgpu_gmc_gart_location(adev, mc, AMDGPU_GART_PLACEMENT_BEST_FIT);
678-
if (!amdgpu_sriov_vf(adev))
678+
if (!amdgpu_sriov_vf(adev) && (amdgpu_agp != 0))
679679
amdgpu_gmc_agp_location(adev, mc);
680680

681681
/* base offset of vram pages */

drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,8 @@ static void gmc_v11_0_vram_gtt_location(struct amdgpu_device *adev,
641641
amdgpu_gmc_vram_location(adev, &adev->gmc, base);
642642
amdgpu_gmc_gart_location(adev, mc, AMDGPU_GART_PLACEMENT_HIGH);
643643
if (!amdgpu_sriov_vf(adev) &&
644-
(amdgpu_ip_version(adev, GC_HWIP, 0) < IP_VERSION(11, 5, 0)))
644+
(amdgpu_ip_version(adev, GC_HWIP, 0) < IP_VERSION(11, 5, 0)) &&
645+
(amdgpu_agp != 0))
645646
amdgpu_gmc_agp_location(adev, mc);
646647

647648
/* base offset of vram pages */

drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1630,7 +1630,7 @@ static void gmc_v9_0_vram_gtt_location(struct amdgpu_device *adev,
16301630
} else {
16311631
amdgpu_gmc_vram_location(adev, mc, base);
16321632
amdgpu_gmc_gart_location(adev, mc, AMDGPU_GART_PLACEMENT_BEST_FIT);
1633-
if (!amdgpu_sriov_vf(adev))
1633+
if (!amdgpu_sriov_vf(adev) && (amdgpu_agp != 0))
16341634
amdgpu_gmc_agp_location(adev, mc);
16351635
}
16361636
/* base offset of vram pages */

0 commit comments

Comments
 (0)