Skip to contentSkip to conversation

drm/amdgpu/gmc6: disable legacy vga features in gmc init (v2)

PATCH In review Alex Deucher 8 participants 13 messages Jul 25, 2017 6 messages not in the archive

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

PATCH 1/4 drm/amdgpu/gmc6: disable legacy vga features in gmc init (v2)

Needs to be done when the MC is set up.

v2: make consistent with other asics

---
 drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +13 -1
index 117c4835..ab0a104 100644
@@ -249,7 +249,19 @@ static void gmc_v6_0_mc_program(struct amdgpu_device *adev)
 		dev_warn(adev->dev, "Wait for MC idle timedout !\n");
 	}
 
-	WREG32(mmVGA_HDP_CONTROL, VGA_HDP_CONTROL__VGA_MEMORY_DISABLE_MASK);
+	if (adev->mode_info.num_crtc) {
+		u32 tmp;
+
+		/* Lockout access through VGA aperture*/
+		tmp = RREG32(mmVGA_HDP_CONTROL);
+		tmp |= VGA_HDP_CONTROL__VGA_MEMORY_DISABLE_MASK;
+		WREG32(mmVGA_HDP_CONTROL, tmp);
+
+		/* disable VGA render */
+		tmp = RREG32(mmVGA_RENDER_CONTROL);
+		tmp &= ~VGA_VSTATUS_CNTL;
+		WREG32(mmVGA_RENDER_CONTROL, tmp);
+	}
 	/* Update configuration */
 	WREG32(mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
 	       adev->mc.vram_start >> 12);
Signature · 6 lines
2.5.5

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

A message that is not in the archive (sent off-list or not yet received): 1500953449-19470-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#2 lore raw

PATCH 2/4 drm/amdgpu/gmc7: disable legacy vga features in gmc init

Needs to be done when the MC is set up.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +14 -0
index 7ac92de..788e65e 100644
@@ -37,6 +37,9 @@
 #include "oss/oss_2_0_d.h"
 #include "oss/oss_2_0_sh_mask.h"
 
+#include "dce/dce_8_0_d.h"
+#include "dce/dce_8_0_sh_mask.h"
+
 #include "amdgpu_atombios.h"
 
 static void gmc_v7_0_set_gart_funcs(struct amdgpu_device *adev);
@@ -273,6 +276,17 @@ static void gmc_v7_0_mc_program(struct amdgpu_device *adev)
 	if (gmc_v7_0_wait_for_idle((void *)adev)) {
 		dev_warn(adev->dev, "Wait for MC idle timedout !\n");
 	}
+	if (adev->mode_info.num_crtc) {
+		/* Lockout access through VGA aperture*/
+		tmp = RREG32(mmVGA_HDP_CONTROL);
+		tmp = REG_SET_FIELD(tmp, VGA_HDP_CONTROL, VGA_MEMORY_DISABLE, 1);
+		WREG32(mmVGA_HDP_CONTROL, tmp);
+
+		/* disable VGA render */
+		tmp = RREG32(mmVGA_RENDER_CONTROL);
+		tmp = REG_SET_FIELD(tmp, VGA_RENDER_CONTROL, VGA_VSTATUS_CNTL, 0);
+		WREG32(mmVGA_RENDER_CONTROL, tmp);
+	}
 	/* Update configuration */
 	WREG32(mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
 	       adev->mc.vram_start >> 12);
Signature · 6 lines
2.5.5

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

PATCH 3/4 drm/amdgpu/gmc8: disable legacy vga features in gmc init

In reply to a message not in the archive

Needs to be done when the MC is set up.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +14 -0
index 04da556..8e20e50 100644
@@ -35,6 +35,9 @@
 #include "oss/oss_3_0_d.h"
 #include "oss/oss_3_0_sh_mask.h"
 
+#include "dce/dce_10_0_d.h"
+#include "dce/dce_10_0_sh_mask.h"
+
 #include "vid.h"
 #include "vi.h"
 
@@ -438,6 +441,17 @@ static void gmc_v8_0_mc_program(struct amdgpu_device *adev)
 	if (gmc_v8_0_wait_for_idle((void *)adev)) {
 		dev_warn(adev->dev, "Wait for MC idle timedout !\n");
 	}
+	if (adev->mode_info.num_crtc) {
+		/* Lockout access through VGA aperture*/
+		tmp = RREG32(mmVGA_HDP_CONTROL);
+		tmp = REG_SET_FIELD(tmp, VGA_HDP_CONTROL, VGA_MEMORY_DISABLE, 1);
+		WREG32(mmVGA_HDP_CONTROL, tmp);
+
+		/* disable VGA render */
+		tmp = RREG32(mmVGA_RENDER_CONTROL);
+		tmp = REG_SET_FIELD(tmp, VGA_RENDER_CONTROL, VGA_VSTATUS_CNTL, 0);
+		WREG32(mmVGA_RENDER_CONTROL, tmp);
+	}
 	/* Update configuration */
 	WREG32(mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
 	       adev->mc.vram_start >> 12);
Signature · 6 lines
2.5.5

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

PATCH 4/4 drm/amdgpu/gmc9: disable legacy vga features in gmc init

In reply to a message not in the archive

Needs to be done when the MC is set up.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +16 -0
index 677181f..c22899a 100644
@@ -29,6 +29,8 @@
 #include "vega10/HDP/hdp_4_0_offset.h"
 #include "vega10/HDP/hdp_4_0_sh_mask.h"
 #include "vega10/GC/gc_9_0_sh_mask.h"
+#include "vega10/DC/dce_12_0_offset.h"
+#include "vega10/DC/dce_12_0_sh_mask.h"
 #include "vega10/vega10_enum.h"
 
 #include "soc15_common.h"
@@ -750,6 +752,20 @@ static int gmc_v9_0_hw_init(void *handle)
 	/* The sequence of these two function calls matters.*/
 	gmc_v9_0_init_golden_registers(adev);
 
+	if (adev->mode_info.num_crtc) {
+		u32 tmp;
+
+		/* Lockout access through VGA aperture*/
+		tmp = RREG32_SOC15(DCE, 0, mmVGA_HDP_CONTROL);
+		tmp = REG_SET_FIELD(tmp, VGA_HDP_CONTROL, VGA_MEMORY_DISABLE, 1);
+		WREG32_SOC15(DCE, 0, mmVGA_HDP_CONTROL, tmp);
+
+		/* disable VGA render */
+		tmp = RREG32_SOC15(DCE, 0, mmVGA_RENDER_CONTROL);
+		tmp = REG_SET_FIELD(tmp, VGA_RENDER_CONTROL, VGA_VSTATUS_CNTL, 0);
+		WREG32_SOC15(DCE, 0, mmVGA_RENDER_CONTROL, tmp);
+	}
+
 	r = gmc_v9_0_gart_enable(adev);
 
 	return r;
Signature · 6 lines
2.5.5

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

A message that is not in the archive (sent off-list or not yet received): 1500953449-19470-4-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org

#6 lore raw

RE: [PATCH 4/4] drm/amdgpu/gmc9: disable legacy vga features in gmc init

Quoted 11 lines

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Monday, July 24, 2017 11:31 PM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH 4/4] drm/amdgpu/gmc9: disable legacy vga features in gmc init

Needs to be done when the MC is set up.

Can someone see if this patch fixes the problem with the lower 8 MB of vram on vega10? I think this may explain what was messing with vram on resume that caused us to reserve the first 8 MB of vram.

Alex

Quoted 40 lines
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +16 -0
index 677181f..c22899a 100644
@@ -29,6 +29,8 @@
 #include "vega10/HDP/hdp_4_0_offset.h"
 #include "vega10/HDP/hdp_4_0_sh_mask.h"
 #include "vega10/GC/gc_9_0_sh_mask.h"
+#include "vega10/DC/dce_12_0_offset.h"
+#include "vega10/DC/dce_12_0_sh_mask.h"
 #include "vega10/vega10_enum.h"
 
 #include "soc15_common.h"
@@ -750,6 +752,20 @@ static int gmc_v9_0_hw_init(void *handle)
 	/* The sequence of these two function calls matters.*/
 	gmc_v9_0_init_golden_registers(adev);
 
+	if (adev->mode_info.num_crtc) {
+		u32 tmp;
+
+		/* Lockout access through VGA aperture*/
+		tmp = RREG32_SOC15(DCE, 0, mmVGA_HDP_CONTROL);
+		tmp = REG_SET_FIELD(tmp, VGA_HDP_CONTROL,
 VGA_MEMORY_DISABLE, 1);
+		WREG32_SOC15(DCE, 0, mmVGA_HDP_CONTROL, tmp);
+
+		/* disable VGA render */
+		tmp = RREG32_SOC15(DCE, 0, mmVGA_RENDER_CONTROL);
+		tmp = REG_SET_FIELD(tmp, VGA_RENDER_CONTROL,
 VGA_VSTATUS_CNTL, 0);
+		WREG32_SOC15(DCE, 0, mmVGA_RENDER_CONTROL, tmp);
+	}
+
 	r = gmc_v9_0_gart_enable(adev);
Quoted 3 lines

return r;
--
2.5.5

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

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB16521CF9048567F549713682F7B80-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#8 lore raw

Re: [PATCH 4/4] drm/amdgpu/gmc9: disable legacy vga features in gmc init

Quoted 8 lines · Alexander
Quoted 8 lines

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Monday, July 24, 2017 11:31 PM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH 4/4] drm/amdgpu/gmc9: disable legacy vga features in gmc init

Quoted 6 lines
Quoted 3 lines

Needs to be done when the MC is set up.

Can someone see if this patch fixes the problem with the lower 8 MB of vram on vega10? I think this may explain what was messing with vram on resume that caused us to reserve the first 8 MB of vram.

Let me have a try. The start of vram overwrite is probably still caused by VGA mode. So, here, you disable it at first.

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

#9 lore raw

Re: [PATCH 4/4] drm/amdgpu/gmc9: disable legacy vga features in gmc init

Quoted 11 lines · Huang Rui
Quoted 10 lines · Alexander
Quoted 10 lines

-----Original Message-----
From: Alex Deucher [mailto:[email protected]]
Sent: Monday, July 24, 2017 11:31 PM
To: [email protected]
Cc: Deucher, Alexander
Subject: [PATCH 4/4] drm/amdgpu/gmc9: disable legacy vga features in gmc init

Needs to be done when the MC is set up.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Can someone see if this patch fixes the problem with the lower 8 MB of vram on vega10? I think this may explain what was messing with vram on resume that caused us to reserve the first 8 MB of vram.

Let me have a try. The start of vram overwrite is probably still caused by VGA mode. So, here, you disable it at first.

This patch doesn't fix the start 8 MB of vram corruption.
But I just found the 8M corruption issue only encountered when DC is disabled.

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

Reviewed-by
#10 lore raw
In reply to a message not in the archive
Quoted 3 lines · Alex Deucher

Needs to be done when the MC is set up.

v2: make consistent with other asics

Thanks for that. The series is

Signature · 6 lines
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by Junwei Zhang
#11 lore raw
In reply to a message not in the archive
Quoted 14 lines · Alex Deucher

Needs to be done when the MC is set up.

v2: make consistent with other asics

---
  drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 14 +++++++++++++-
  1 file changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +0 -0
index 117c4835..ab0a104 100644

drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c static void gmc_v6_0_mc_program(struct amdgpu_device *adev) · line 257

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +6 -1
@@ -249,7 +249,19 @@ static void gmc_v6_0_mc_program(struct amdgpu_device *adev)
  		dev_warn(adev->dev, "Wait for MC idle timedout !\n");
  	}
 
-	WREG32(mmVGA_HDP_CONTROL, VGA_HDP_CONTROL__VGA_MEMORY_DISABLE_MASK);
+	if (adev->mode_info.num_crtc) {
+		u32 tmp;
+
+		/* Lockout access through VGA aperture*/
+		tmp = RREG32(mmVGA_HDP_CONTROL);
+		tmp |= VGA_HDP_CONTROL__VGA_MEMORY_DISABLE_MASK;

Shall we use VGA_MEMORY_DISABLE like others?
It's available in sid.h.

Apart from that, all patches are

Jerry

drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c static void gmc_v6_0_mc_program(struct amdgpu_device *adev) · line 267

Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +7 -0
+		WREG32(mmVGA_HDP_CONTROL, tmp);
+
+		/* disable VGA render */
+		tmp = RREG32(mmVGA_RENDER_CONTROL);
+		tmp &= ~VGA_VSTATUS_CNTL;
+		WREG32(mmVGA_RENDER_CONTROL, tmp);
+	}
  	/* Update configuration */
  	WREG32(mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
  	       adev->mc.vram_start >> 12);

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

#12 lore raw
In reply to a message not in the archive

Am 25.07.2017 um 05:30 schrieb Alex Deucher:

Quoted 5 lines

Needs to be done when the MC is set up.

v2: make consistent with other asics

On first glance it kind of looks a bit odd to have that in the GMC code, but on second glance it actually makes sense.

Christian.

Quoted 19 lines
---
  drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 14 +++++++++++++-
  1 file changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +6 -1
index 117c4835..ab0a104 100644
@@ -249,7 +249,19 @@ static void gmc_v6_0_mc_program(struct amdgpu_device *adev)
  		dev_warn(adev->dev, "Wait for MC idle timedout !\n");
  	}
 
-	WREG32(mmVGA_HDP_CONTROL, VGA_HDP_CONTROL__VGA_MEMORY_DISABLE_MASK);
+	if (adev->mode_info.num_crtc) {
+		u32 tmp;
+
+		/* Lockout access through VGA aperture*/
+		tmp = RREG32(mmVGA_HDP_CONTROL);
+		tmp |= VGA_HDP_CONTROL__VGA_MEMORY_DISABLE_MASK;

drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c static void gmc_v6_0_mc_program(struct amdgpu_device *adev) · line 267

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +7 -0
+		WREG32(mmVGA_HDP_CONTROL, tmp);
+
+		/* disable VGA render */
+		tmp = RREG32(mmVGA_RENDER_CONTROL);
+		tmp &= ~VGA_VSTATUS_CNTL;
+		WREG32(mmVGA_RENDER_CONTROL, tmp);
+	}
  	/* Update configuration */
  	WREG32(mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
  	       adev->mc.vram_start >> 12);

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

A message that is not in the archive (sent off-list or not yet received): 3fe89777-6e9e-69f4-1052-dca5879f242e-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#14 lore raw

Hi Christian:

Could you share your minds when you are on second glance?

Thanks
JimQu

________________________________________
发件人: amd-gfx <[email protected]> 代表 Christian König <[email protected]> 发送时间: 2017年7月25日 17:17
收件人: Alex Deucher; [email protected]
抄送: Deucher, Alexander
主题: Re: [PATCH 1/4] drm/amdgpu/gmc6: disable legacy vga features in gmc init (v2)

Am 25.07.2017 um 05:30 schrieb Alex Deucher:

Quoted 5 lines

Needs to be done when the MC is set up.

v2: make consistent with other asics

On first glance it kind of looks a bit odd to have that in the GMC code, but on second glance it actually makes sense.

Christian.

Quoted 19 lines
---
  drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 14 +++++++++++++-
  1 file changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +6 -1
index 117c4835..ab0a104 100644
@@ -249,7 +249,19 @@ static void gmc_v6_0_mc_program(struct amdgpu_device *adev)
              dev_warn(adev->dev, "Wait for MC idle timedout !\n");
      }
 
-     WREG32(mmVGA_HDP_CONTROL, VGA_HDP_CONTROL__VGA_MEMORY_DISABLE_MASK);
+     if (adev->mode_info.num_crtc) {
+             u32 tmp;
+
+             /* Lockout access through VGA aperture*/
+             tmp = RREG32(mmVGA_HDP_CONTROL);
+             tmp |= VGA_HDP_CONTROL__VGA_MEMORY_DISABLE_MASK;

drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c static void gmc_v6_0_mc_program(struct amdgpu_device *adev) · line 267

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +7 -0
+             WREG32(mmVGA_HDP_CONTROL, tmp);
+
+             /* disable VGA render */
+             tmp = RREG32(mmVGA_RENDER_CONTROL);
+             tmp &= ~VGA_VSTATUS_CNTL;
+             WREG32(mmVGA_RENDER_CONTROL, tmp);
+     }
      /* Update configuration */
      WREG32(mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
             adev->mc.vram_start >> 12);

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

A message that is not in the archive (sent off-list or not yet received): DM3PR12MB0873C12EF55F95694CB4BCCB99B80-4hRkV8tDpBiYEITDcfEJ8AdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#16 lore raw

The term "legacy VGA" sounds like the whole render functionality which actually isn't part of the GMC AFAIK.

But what Alex primary disables here is the old VGA BAR in the CPU address space and that is part of the GMC (or at least related to it).

BTW: Patch are Acked-by: Christian König <[email protected]>.

Christian.

Am 25.07.2017 um 11:26 schrieb Qu, Jim:

Quoted 51 lines

Hi Christian:

Could you share your minds when you are on second glance?

Thanks
JimQu

________________________________________
发件人: amd-gfx <[email protected]> 代表 Christian König <[email protected]> 发送时间: 2017年7月25日 17:17
收件人: Alex Deucher; [email protected]
抄送: Deucher, Alexander
主题: Re: [PATCH 1/4] drm/amdgpu/gmc6: disable legacy vga features in gmc init (v2)

Am 25.07.2017 um 05:30 schrieb Alex Deucher:

Quoted 5 lines

Needs to be done when the MC is set up.

v2: make consistent with other asics

On first glance it kind of looks a bit odd to have that in the GMC code, but on second glance it actually makes sense.

Christian.

Quoted 26 lines
---
   drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 14 +++++++++++++-
   1 file changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +13 -1
index 117c4835..ab0a104 100644
@@ -249,7 +249,19 @@ static void gmc_v6_0_mc_program(struct amdgpu_device *adev)
               dev_warn(adev->dev, "Wait for MC idle timedout !\n");
       }
 
-     WREG32(mmVGA_HDP_CONTROL, VGA_HDP_CONTROL__VGA_MEMORY_DISABLE_MASK);
+     if (adev->mode_info.num_crtc) {
+             u32 tmp;
+
+             /* Lockout access through VGA aperture*/
+             tmp = RREG32(mmVGA_HDP_CONTROL);
+             tmp |= VGA_HDP_CONTROL__VGA_MEMORY_DISABLE_MASK;
+             WREG32(mmVGA_HDP_CONTROL, tmp);
+
+             /* disable VGA render */
+             tmp = RREG32(mmVGA_RENDER_CONTROL);
+             tmp &= ~VGA_VSTATUS_CNTL;
+             WREG32(mmVGA_RENDER_CONTROL, tmp);
+     }
Quoted 8 lines

drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c static void gmc_v6_0_mc_program(struct amdgpu_device *adev) · line 267

Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +0 -0
       /* Update configuration */
       WREG32(mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
              adev->mc.vram_start >> 12);

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

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

A message that is not in the archive (sent off-list or not yet received): d3405b22-0e0a-cff3-9089-9f6380e96c84-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#18 lore raw

Not an expert on GMC but this seems to be the best place to disable VGA render.

Series is Acked-by: Harry Wentland <[email protected]>

Harry

Quoted 77 lines · Christian König

The term "legacy VGA" sounds like the whole render functionality which actually isn't part of the GMC AFAIK.

But what Alex primary disables here is the old VGA BAR in the CPU address space and that is part of the GMC (or at least related to it).

BTW: Patch are Acked-by: Christian König <[email protected]>.

Christian.

Am 25.07.2017 um 11:26 schrieb Qu, Jim:

Quoted 56 lines

Hi Christian:

Could you share your minds when you are on second glance?

Thanks
JimQu

________________________________________
发件人: amd-gfx <[email protected]> 代表 Christian König <[email protected]>
发送时间: 2017年7月25日 17:17
收件人: Alex Deucher; [email protected]
抄送: Deucher, Alexander
主题: Re: [PATCH 1/4] drm/amdgpu/gmc6: disable legacy vga features in gmc init (v2)

Am 25.07.2017 um 05:30 schrieb Alex Deucher:

Quoted 5 lines

Needs to be done when the MC is set up.

v2: make consistent with other asics

On first glance it kind of looks a bit odd to have that in the GMC code, but on second glance it actually makes sense.

Christian.

Quoted 29 lines
---
   drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c | 14 +++++++++++++-
   1 file changed, 13 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +13 -1
index 117c4835..ab0a104 100644
@@ -249,7 +249,19 @@ static void gmc_v6_0_mc_program(struct
 amdgpu_device *adev)
               dev_warn(adev->dev, "Wait for MC idle timedout !\n");
       }
 
-     WREG32(mmVGA_HDP_CONTROL,
 VGA_HDP_CONTROL__VGA_MEMORY_DISABLE_MASK);
+     if (adev->mode_info.num_crtc) {
+             u32 tmp;
+
+             /* Lockout access through VGA aperture*/
+             tmp = RREG32(mmVGA_HDP_CONTROL);
+             tmp |= VGA_HDP_CONTROL__VGA_MEMORY_DISABLE_MASK;
+             WREG32(mmVGA_HDP_CONTROL, tmp);
+
+             /* disable VGA render */
+             tmp = RREG32(mmVGA_RENDER_CONTROL);
+             tmp &= ~VGA_VSTATUS_CNTL;
+             WREG32(mmVGA_RENDER_CONTROL, tmp);
+     }
Quoted 8 lines
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +0 -0
       /* Update configuration */
       WREG32(mmMC_VM_SYSTEM_APERTURE_LOW_ADDR,
              adev->mc.vram_start >> 12);

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

Quoted 4 lines

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

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