Skip to contentSkip to conversation

drm/amdgpu/display: set gpu vm flag for all asics which support it

PATCH In review Alex Deucher 4 participants 7 messages Jan 8, 2020 – Jan 9, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 drm/amdgpu/display: set gpu vm flag for all asics which support it

It won't get used unless the driver allows the gtt domain for display buffers which is controlled elsewhere.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8 -6
index 1123f9ce86ee..fdf4d202ea1f 100644
@@ -906,13 +906,15 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 
 	init_data.dce_environment = DCE_ENV_PRODUCTION_DRV;
 
-	/*
-	 * TODO debug why this doesn't work on Raven
-	 */
-	if (adev->flags & AMD_IS_APU &&
-	    adev->asic_type >= CHIP_CARRIZO &&
-	    adev->asic_type < CHIP_RAVEN)
+	switch (adev->asic_type) {
+	case CHIP_CARRIZO:
+	case CHIP_STONEY:
+	case CHIP_RAVEN:
 		init_data.flags.gpu_vm_support = true;
+		break;
+	default:
+		break;
+	}
 
 	if (amdgpu_dc_feature_mask & DC_FBC_MASK)
 		init_data.flags.fbc_support = true;
Signature · 6 lines
2.24.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

PATCH 2/3 drm/amdgpu: enable S/G display on PCO and RV2 (v2)

It should work on all Raven variants, but some users have reported issues with original Raven with IOMMU enabled. So far there have been no issues observed with PCO or RV2.

v2: split out the dm init and domain changes into separate
patches.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 22 +++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +16 -6
index 78733af5cc85..ca9056b0472a 100644
@@ -513,13 +513,23 @@ uint32_t amdgpu_display_supported_domains(struct amdgpu_device *adev,
 	 * will not allow USWC mappings.
 	 * Also, don't allow GTT domain if the BO doens't have USWC falg set.
 	 */
-	if (adev->asic_type >= CHIP_CARRIZO &&
-	    adev->asic_type < CHIP_RAVEN &&
-	    (adev->flags & AMD_IS_APU) &&
-	    (bo_flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC) &&
+	if ((bo_flags & AMDGPU_GEM_CREATE_CPU_GTT_USWC) &&
 	    amdgpu_bo_support_uswc(bo_flags) &&
-	    amdgpu_device_asic_has_dc_support(adev->asic_type))
-		domain |= AMDGPU_GEM_DOMAIN_GTT;
+	    amdgpu_device_asic_has_dc_support(adev->asic_type)) {
+		switch (adev->asic_type) {
+		case CHIP_CARRIZO:
+		case CHIP_STONEY:
+			domain |= AMDGPU_GEM_DOMAIN_GTT;
+			break;
+		case CHIP_RAVEN:
+			/* enable S/G on PCO and RV2 */
+			if (adev->rev_id >= 0x8 || adev->pdev->device == 0x15d8)
+				domain |= AMDGPU_GEM_DOMAIN_GTT;
+			break;
+		default:
+			break;
+		}
+	}
 #endif
 
 	return domain;
Signature · 6 lines
2.24.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw

PATCH 3/3 drm/amdgpu/display: set gpu vm flag for renoir

In reply to Alex Deucher

It won't get used unless the driver allows the gtt domain for display buffers which is controlled elsewhere.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
index fdf4d202ea1f..d0c9a5725813 100644
@@ -910,6 +910,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 	case CHIP_CARRIZO:
 	case CHIP_STONEY:
 	case CHIP_RAVEN:
+	case CHIP_RENOIR:
 		init_data.flags.gpu_vm_support = true;
 		break;
 	default:
Signature · 6 lines
2.24.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by Acked-by on v1 3/3
#3 lore raw

Re: [PATCH 3/3] drm/amdgpu/display: set gpu vm flag for renoir

Patches 1 & 3 are

Patch 2 is

Harry

Quoted 14 lines · Alex Deucher

It won't get used unless the driver allows the gtt domain for display buffers which is controlled elsewhere.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index fdf4d202ea1f..d0c9a5725813 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 916

Quoted 7 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -0
@@ -910,6 +910,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 	case CHIP_CARRIZO:
 	case CHIP_STONEY:
 	case CHIP_RAVEN:
+	case CHIP_RENOIR:
 		init_data.flags.gpu_vm_support = true;
 		break;
 	default:

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#4 lore raw
In reply to Alex Deucher
Quoted 4 lines · Alex Deucher

It won't get used unless the driver allows the gtt domain for display buffers which is controlled elsewhere.

Series are Acked-by: Huang Rui <[email protected]>

Any suggestion for testing, I would like to give a try in my renoir platform.

Thanks,
Ray

Quoted 37 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8 -6
index 1123f9ce86ee..fdf4d202ea1f 100644
@@ -906,13 +906,15 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 
 	init_data.dce_environment = DCE_ENV_PRODUCTION_DRV;
 
-	/*
-	 * TODO debug why this doesn't work on Raven
-	 */
-	if (adev->flags & AMD_IS_APU &&
-	    adev->asic_type >= CHIP_CARRIZO &&
-	    adev->asic_type < CHIP_RAVEN)
+	switch (adev->asic_type) {
+	case CHIP_CARRIZO:
+	case CHIP_STONEY:
+	case CHIP_RAVEN:
 		init_data.flags.gpu_vm_support = true;
+		break;
+	default:
+		break;
+	}
 
 	if (amdgpu_dc_feature_mask & DC_FBC_MASK)
 		init_data.flags.fbc_support = true;
Signature · 6 lines
2.24.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cray.huang%40amd.com%7C2abbd206df9a4078e3d208d7948d01b1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637141205928856098&amp;sdata=T%2Fetyq5T01NBu4x9l3jtZVC2%2BGwQv9z0KUlhJkxaa9I%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#5 lore raw
Quoted 11 lines · Huang Rui
Quoted 4 lines · Alex Deucher

It won't get used unless the driver allows the gtt domain for display buffers which is controlled elsewhere.

Series are Acked-by: Huang Rui <[email protected]>

Any suggestion for testing, I would like to give a try in my renoir platform.

Thanks, Aaron tested the first patch set which enabled GTT for display and it didn't work on renoir, so that still needs additional investigation before we can enable support for renoir.

Alex

Quoted 37 lines

Thanks,
Ray

Quoted 33 lines
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8 -7
index 1123f9ce86ee..fdf4d202ea1f 100644
@@ -906,13 +906,15 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 
      init_data.dce_environment = DCE_ENV_PRODUCTION_DRV;
 
-     /*
-      * TODO debug why this doesn't work on Raven
-      */
-     if (adev->flags & AMD_IS_APU &&
-         adev->asic_type >= CHIP_CARRIZO &&
-         adev->asic_type < CHIP_RAVEN)
+     switch (adev->asic_type) {
+     case CHIP_CARRIZO:
+     case CHIP_STONEY:
+     case CHIP_RAVEN:
              init_data.flags.gpu_vm_support = true;
+             break;
+     default:
+             break;
+     }
 
      if (amdgpu_dc_feature_mask & DC_FBC_MASK)
              init_data.flags.fbc_support = true;
--

2.24.1

Quoted 4 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cray.huang%40amd.com%7C2abbd206df9a4078e3d208d7948d01b1%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637141205928856098&amp;sdata=T%2Fetyq5T01NBu4x9l3jtZVC2%2BGwQv9z0KUlhJkxaa9I%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Acked-by on v1 1/3
#6 lore raw
In reply to Alex Deucher

Am 08.01.20 um 23:49 schrieb Alex Deucher:

Quoted 4 lines

It won't get used unless the driver allows the gtt domain for display buffers which is controlled elsewhere.

Quoted 20 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++++++++------
  1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -6
index 1123f9ce86ee..fdf4d202ea1f 100644
@@ -906,13 +906,15 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 
  	init_data.dce_environment = DCE_ENV_PRODUCTION_DRV;
 
-	/*
-	 * TODO debug why this doesn't work on Raven
-	 */
-	if (adev->flags & AMD_IS_APU &&
-	    adev->asic_type >= CHIP_CARRIZO &&
-	    adev->asic_type < CHIP_RAVEN)
+	switch (adev->asic_type) {
+	case CHIP_CARRIZO:

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int amdgpu_dm_init(struct amdgpu_device *adev) · line 920

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +6 -0
+	case CHIP_STONEY:
+	case CHIP_RAVEN:
  		init_data.flags.gpu_vm_support = true;
+		break;
+	default:
+		break;
+	}
 
  	if (amdgpu_dc_feature_mask & DC_FBC_MASK)
  		init_data.flags.fbc_support = true;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx