Module Name:    src
Committed By:   riastradh
Date:           Fri Feb 14 04:38:13 UTC 2020

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/amd/amdgpu: amdgpu_display.c

Log Message:
Revert unnecessary change.

The only way this logic can reach the reference to stat is if repcnt
goes to zero, which -- since it starts at 4 -- can only happen if we
go through several iterations of the loop, which in turn implies that
stat is initialized.

If GCC still complains about this, it's wrong and should be dealt
with some other way.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
    src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c
diff -u src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c:1.5 src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c:1.6
--- src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c:1.5	Sat Feb 23 19:56:51 2019
+++ src/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c	Fri Feb 14 04:38:13 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: amdgpu_display.c,v 1.5 2019/02/23 19:56:51 kamil Exp $	*/
+/*	$NetBSD: amdgpu_display.c,v 1.6 2020/02/14 04:38:13 riastradh Exp $	*/
 
 /*
  * Copyright 2007-8 Advanced Micro Devices, Inc.
@@ -26,7 +26,7 @@
  *          Alex Deucher
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdgpu_display.c,v 1.5 2019/02/23 19:56:51 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: amdgpu_display.c,v 1.6 2020/02/14 04:38:13 riastradh Exp $");
 
 #include <drm/drmP.h>
 #include <drm/amdgpu_drm.h>
@@ -101,8 +101,7 @@ static void amdgpu_flip_work_func(struct
 	 * In practice this won't execute very often unless on very fast
 	 * machines because the time window for this to happen is very small.
 	 */
-	if (amdgpuCrtc->enabled) {
-	while (--repcnt) {
+	while (amdgpuCrtc->enabled && --repcnt) {
 		/* GET_DISTANCE_TO_VBLANKSTART returns distance to real vblank
 		 * start in hpos, and to the "fudged earlier" vblank start in
 		 * vpos.
@@ -135,7 +134,6 @@ static void amdgpu_flip_work_func(struct
 				 "hpos %d\n", work->crtc_id, min_udelay,
 				 vblank->framedur_ns / 1000,
 				 vblank->linedur_ns / 1000, stat, vpos, hpos);
-	}
 
 	/* do the flip (mmio) */
 	adev->mode_info.funcs->page_flip(adev, work->crtc_id, work->base);

Reply via email to