From patchwork Thu Apr 18 03:51:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 10906465 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 0654917E0 for ; Thu, 18 Apr 2019 03:51:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E407428BDD for ; Thu, 18 Apr 2019 03:51:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D85EC28BE5; Thu, 18 Apr 2019 03:51:58 +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 9A66D28BDD for ; Thu, 18 Apr 2019 03:51:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A1BE6E0C0; Thu, 18 Apr 2019 03:51:55 +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 826116E0BF; Thu, 18 Apr 2019 03:51:53 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id k17so1011864wrx.10; Wed, 17 Apr 2019 20:51:53 -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=uOekskFVOcvEU90eCmDpnUcZ1AgAR8v5yeLg4ouAlUMOHLfSCtEv2uQqaLJbjuARMQ BeKgIDyz7NCuhO53iuWwkbXeGIEebe6t6d8BcrVistPXkdITofwdMqdKvlaL69ska77r GbHAtuyiNZjk26aXAWLzSC4uWX+1xdnfNf1Hom8Uyl1HjOk9mVvut23m6zvBAH6AK1Y1 1fXjPkOp2Nu4OpZOGJj3waaNCa6Kh3QVywpmRO6GI+K1Ne327NJCM4iVDWXA98O4pEIV HkE6Meh6WRFeM9G/usmJ0Jg23kGjy1M5scU3f7VQFQnuYeUcaPVWx85UFZrBf6VcLBJM 7+eA== X-Gm-Message-State: APjAAAXN7CUHU9K/oLupp1vNIBq9GTtan1IgLlqCzS0K4r3DksRc9yvW mwBc5Lu2qipiDj0EdhX7/GmKfLyS X-Google-Smtp-Source: APXvYqz6FJwf436Joz9qbousdjePbhsaq4EDLsFVvXGXmWL6tI9CX6qv6bzBYgUO6T71fHLds0lBcQ== X-Received: by 2002:adf:f5c7:: with SMTP id k7mr30435367wrp.197.1555559511682; Wed, 17 Apr 2019 20:51:51 -0700 (PDT) Received: from twisty.localdomain ([2a01:c23:7856:4600:55b4:804e:196c:cde9]) by smtp.gmail.com with ESMTPSA id x192sm665054wmf.48.2019.04.17.20.51.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 20:51:51 -0700 (PDT) From: Mario Kleiner To: amd-gfx@lists.freedesktop.org Subject: [PATCH 3/4] drm/amd/display: Enter VRR BTR earlier. Date: Thu, 18 Apr 2019 05:51:21 +0200 Message-Id: <20190418035122.15791-4-mario.kleiner.de@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190418035122.15791-1-mario.kleiner.de@gmail.com> References: <20190418035122.15791-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=qkdaz+RaW9JXc1EPBud/yVX5H6PLMj8Mf3eRGlkd/kLM5aU1jfx3827m00TRB+M0C1 tcqFyOfSjQGUHJHkO5nsIQgs8fWr+hGPWvcRHYARSWyZzC6JA61aAiQJ0GBFQhsj67Fa IjBjkMfkSeM5SjvO0NGGD1IkzSOo4UY+q3je8ghBTNEoB68MG8zCXn0nSwz4r81ypZ3/ 25omjhaE5yS4JHvv0VfQDuHEdNMypYrig4boNM2dUh7ZuCRhXYgbP0ij4sP3/oqxn1eH lzpvwlPIjTEA4GKL00EPB1U9WvT6n7MXKeXlbHteSWRjiC24GeB5rrcn+sHdS7enKKSh 7uRg== 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; }