[PATCH 1/4] drm/amd/display: Add some debug output for VRR BTR.

Mario Kleiner mario.kleiner.de at gmail.com
Thu Apr 18 03:51:19 UTC 2019


Helps with debugging issues with low framerate compensation.

Signed-off-by: Mario Kleiner <mario.kleiner.de at gmail.com>
---
 .../amd/display/modules/freesync/freesync.c    | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
index 3d867e34f8b3..71274683da04 100644
--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
+++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c
@@ -1041,6 +1041,11 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync,
 		average_render_time_in_us += last_render_time_in_us;
 		average_render_time_in_us /= DC_PLANE_UPDATE_TIMES_MAX;
 
+		DRM_DEBUG_DRIVER("vrr flip: avg %d us, last %d us, max %d us\n",
+				 average_render_time_in_us,
+				 last_render_time_in_us,
+				 in_out_vrr->max_duration_in_us);
+
 		if (in_out_vrr->btr.btr_enabled) {
 			apply_below_the_range(core_freesync,
 					stream,
@@ -1053,6 +1058,10 @@ void mod_freesync_handle_preflip(struct mod_freesync *mod_freesync,
 				in_out_vrr);
 		}
 
+		DRM_DEBUG_DRIVER("vrr btr_active:%d - num %d of dur %d us\n",
+				 in_out_vrr->btr.btr_active,
+				 in_out_vrr->btr.frames_to_insert,
+				 in_out_vrr->btr.inserted_duration_in_us);
 	}
 }
 
@@ -1090,11 +1099,17 @@ void mod_freesync_handle_v_update(struct mod_freesync *mod_freesync,
 				in_out_vrr->btr.inserted_duration_in_us);
 			in_out_vrr->adjust.v_total_max =
 				in_out_vrr->adjust.v_total_min;
+			DRM_DEBUG_DRIVER("btr start: c=%d, vtotal=%d\n",
+					 in_out_vrr->btr.frames_to_insert,
+					 in_out_vrr->adjust.v_total_min);
 		}
 
 		if (in_out_vrr->btr.frame_counter > 0)
 			in_out_vrr->btr.frame_counter--;
 
+		DRM_DEBUG_DRIVER("btr upd: count %d\n",
+				 in_out_vrr->btr.frame_counter);
+
 		/* Restore FreeSync */
 		if (in_out_vrr->btr.frame_counter == 0) {
 			in_out_vrr->adjust.v_total_min =
@@ -1103,6 +1118,9 @@ void mod_freesync_handle_v_update(struct mod_freesync *mod_freesync,
 			in_out_vrr->adjust.v_total_max =
 				calc_v_total_from_refresh(stream,
 				in_out_vrr->min_refresh_in_uhz);
+			DRM_DEBUG_DRIVER("btr end: vtotal_min=%d/max=%d\n",
+					 in_out_vrr->adjust.v_total_min,
+					 in_out_vrr->adjust.v_total_max);
 		}
 	}
 
-- 
2.20.1



More information about the amd-gfx mailing list