From patchwork Fri Apr 26 21:40:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 10919749 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6FF1292A for ; Fri, 26 Apr 2019 21:40:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60B262818E for ; Fri, 26 Apr 2019 21:40:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5569828DD5; Fri, 26 Apr 2019 21:40:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 147EB2818E for ; Fri, 26 Apr 2019 21:40:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8CD7C89237; Fri, 26 Apr 2019 21:40:43 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 75A6889237; Fri, 26 Apr 2019 21:40:42 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id t17so6211860wrw.13; Fri, 26 Apr 2019 14:40:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BESZkc6wbEkzEo4EMB8XfajzL1iBb9J7EwpQt4g0Ino=; b=CaUxVHxch8Xm4kRsZDkv9rT4gwN+QkdkhM6fQCBvN6XVHL3eAw5LnBTagxV0EXE/Fc BgfznTaEBmXOQPZQWojs3BIQWc6so/ZDjOOl64ECwg9vW37gjnEQpoTCNZhLz3xdvPBh 2t2QwF1BHRfXJC7JXYWKRMVbTR7sVyKwmjuhkW6r4tJ2woQLI9Cd6VEoSZBTS7xCW4r7 a/oV8ZePkqHOREQKqx4OCqwSQ5F8x+sqz9JMMD6RDOAjebG+SARBvoQDxBl8m3bSrVFy 2VWj+drl2LWsqGn6lLLLxpWeCarf2G+8qAdHLE46eA+JC5F9RcIXr0Z3vPp6T5PCe3EZ /lkw== X-Gm-Message-State: APjAAAUe509u+rjk1fZ0xPFnbOXB9bPSrk+w7efA7guk2UrPMct6QQbj rIl9h0za5b0xub0CDdoyGO5VJBNw X-Google-Smtp-Source: APXvYqzKsjSNUHOgNRJ9epJYXL0FCaCmsHadMWHl2/qUOWmpZv1O2MRrXUNrJ3jJutL+0EtDUCvXQQ== X-Received: by 2002:adf:ebd0:: with SMTP id v16mr3897747wrn.175.1556314841023; Fri, 26 Apr 2019 14:40:41 -0700 (PDT) Received: from twisty.localdomain ([2a01:c22:c870:100:55b4:804e:196c:cde9]) by smtp.gmail.com with ESMTPSA id p18sm14091408wrp.38.2019.04.26.14.40.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Apr 2019 14:40:40 -0700 (PDT) From: Mario Kleiner To: amd-gfx@lists.freedesktop.org Subject: [PATCH 2/3] drm/amd/display: Enter VRR BTR earlier. Date: Fri, 26 Apr 2019 23:40:15 +0200 Message-Id: <20190426214016.24667-3-mario.kleiner.de@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190426214016.24667-1-mario.kleiner.de@gmail.com> References: <20190426214016.24667-1-mario.kleiner.de@gmail.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BESZkc6wbEkzEo4EMB8XfajzL1iBb9J7EwpQt4g0Ino=; b=hf2i4ui1ngv9zpAKrP/f2bV1o5m2HmEodT8611xyKhkI8HmdxQtoj6cP0pK6V6yCE7 sJDBXqLTqgn+7DLUHusRZiPDnpt0rfSeHFob1BdG3zph80xhBOXiPbS9dJqV+w7ZjoUi pHA893jjG+TgA2fYxTKcE3FFDcLVhrDe52OE4ZkOzy9D0achjM9Ms1xn3Y6m0P/sTvbf 76jFOeaU0hFFETpPhkj6UR6bb/9oNv3dgw/C11Fk7y4326FC1QMFhiQmJbnGmR8oqWbi iS7DYO3vSeplFc5LtK4WcpSHdq53UZPIObO9UY/N4uTQkzMh4mx9+s/5/9DCUjphxmV/ EPLw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nicholas.kazlauskas@amd.com, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use a 2 msecs switching headroom not only for slightly delayed exiting of BTR mode, but now also for entering it a bit before the max frame duration is exceeded. With slowly changing time delay between successive flips or with a bit of jitter in arrival of flips, this adapts vblank early and prevents missed vblanks at the border between non-BTR and BTR. Testing on DCE-8, DCE-11 and DCN-1.0 shows that this more often avoids skipped frames when moving across the BTR boundary, especially on DCE-8 and DCE-11 with the followup commit for dealing with pre-DCE-12 hw. Signed-off-by: Mario Kleiner --- drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c index e56543c36eba..a965ab5466dc 100644 --- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c +++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c @@ -350,7 +350,7 @@ static void apply_below_the_range(struct core_freesync *core_freesync, in_out_vrr->btr.frame_counter = 0; in_out_vrr->btr.btr_active = false; } - } else if (last_render_time_in_us > max_render_time_in_us) { + } else if (last_render_time_in_us + BTR_EXIT_MARGIN > max_render_time_in_us) { /* Enter Below the Range */ in_out_vrr->btr.btr_active = true; }