Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/amd/amdgpu Revert unnecessary...



details:   https://anonhg.NetBSD.org/src/rev/015b0a860939
branches:  trunk
changeset: 1007318:015b0a860939
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Feb 14 04:38:13 2020 +0000

description:
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.

diffstat:

 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (36 lines):

diff -r 64d644b65c05 -r 015b0a860939 sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c
--- a/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c        Fri Feb 14 04:37:43 2020 +0000
+++ b/sys/external/bsd/drm2/dist/drm/amd/amdgpu/amdgpu_display.c        Fri Feb 14 04:38:13 2020 +0000
@@ -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 @@
         * 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 @@
                                 "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);



Home | Main Index | Thread Index | Old Index