drm/amd/powerplay/smu7: enforce minimal VBITimeout (v2)

Submitted by Alex Deucher on Aug. 14, 2019, 8:41 p.m.

Details

Message ID 20190814204149.22226-1-alexander.deucher@amd.com
State New
Headers show
Series "drm/amd/powerplay/smu7: enforce minimal VBITimeout (v2)" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Alex Deucher Aug. 14, 2019, 8:41 p.m.
From: Ahzo <Ahzo@tutanota.com>

This fixes screen corruption/flickering on 75 Hz displays.

v2: make print statement debug only (Alex)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102646
Signed-off-by: Ahzo <Ahzo@tutanota.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index 10d66e3c7a9f..b468f634ffa1 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -4067,6 +4067,11 @@  static int smu7_program_display_gap(struct pp_hwmgr *hwmgr)
 
 	data->frame_time_x2 = frame_time_in_us * 2 / 100;
 
+	if (data->frame_time_x2 < 280) {
+		pr_debug("%s: enforce minimal VBITimeout: %d -> 280\n", __func__, data->frame_time_x2);
+		data->frame_time_x2 = 280;
+	}
+
 	display_gap2 = pre_vbi_time_in_us * (ref_clock / 100);
 
 	cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC, ixCG_DISPLAY_GAP_CNTL2, display_gap2);

Comments

Reviewed-by: Evan Quan <evan.quan@amd.com>


> -----Original Message-----

> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Alex

> Deucher

> Sent: Thursday, August 15, 2019 4:42 AM

> To: amd-gfx@lists.freedesktop.org

> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Ahzo

> <Ahzo@tutanota.com>

> Subject: [PATCH] drm/amd/powerplay/smu7: enforce minimal VBITimeout

> (v2)

> 

> From: Ahzo <Ahzo@tutanota.com>

> 

> This fixes screen corruption/flickering on 75 Hz displays.

> 

> v2: make print statement debug only (Alex)

> 

> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102646

> Signed-off-by: Ahzo <Ahzo@tutanota.com>

> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

> ---

>  drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 5 +++++

>  1 file changed, 5 insertions(+)

> 

> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c

> b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c

> index 10d66e3c7a9f..b468f634ffa1 100644

> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c

> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c

> @@ -4067,6 +4067,11 @@ static int smu7_program_display_gap(struct

> pp_hwmgr *hwmgr)

> 

>  	data->frame_time_x2 = frame_time_in_us * 2 / 100;

> 

> +	if (data->frame_time_x2 < 280) {

> +		pr_debug("%s: enforce minimal VBITimeout: %d -> 280\n",

> __func__, data->frame_time_x2);

> +		data->frame_time_x2 = 280;

> +	}

> +

>  	display_gap2 = pre_vbi_time_in_us * (ref_clock / 100);

> 

>  	cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,

> ixCG_DISPLAY_GAP_CNTL2, display_gap2);

> --

> 2.20.1

> 

> _______________________________________________

> amd-gfx mailing list

> amd-gfx@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/amd-gfx