From patchwork Fri Apr 26 10:50: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: 10919025 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 C8B8A14C0 for ; Fri, 26 Apr 2019 10:51:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8DEA28BCA for ; Fri, 26 Apr 2019 10:51:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACE9928DF9; Fri, 26 Apr 2019 10:51:07 +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 6A8B428DFC for ; Fri, 26 Apr 2019 10:51:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 01D0189193; Fri, 26 Apr 2019 10:51:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by gabe.freedesktop.org (Postfix) with ESMTPS id 89C6E88ED5; Fri, 26 Apr 2019 10:51:04 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id c12so3793621wrt.8; Fri, 26 Apr 2019 03:51:04 -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=OAsWBN/G2rhbWIiCPM5JwtTii5VwYnIMPlj38ZtWwzczuA6cYS3KHtzbpiZok7N1N9 WD+b3Sk0QMnkNv21oTBVBjwVn10KSlZEhLCYc519YFtWKkHvOxLcVz3aWZKDvyErOiu3 difTFUJZafApk3/ewNOpyTZpQg2c5IzwUseUdHNbduQ+I5h1zJlMPY3Mg05LRtEoPz6S 5QOkCDK+zzvaieNhOJeWn2swdv9AqWmo+GGqnEe8BZ19440rY9DuqU3Q7FSSEF9vhCU7 7SgV9+DGZ1vZhv5yLQ31IHVj4TeOyuuBByDtNlNxckae2Jng99XQJWnvkQ5hXiqQG1Qa a3XQ== X-Gm-Message-State: APjAAAWriqgE5eij34b80SkbvefWEivcdDcST258rloc0e6jBFbASOFN nmJVaYOCudKPfNZ2VBGt8dpWwdnt X-Google-Smtp-Source: APXvYqwy86xO4ra6Vd5EcorCgmdDOwiixGS8jUt2aHfsUjRkU9GiVW6EDgDj3dElGY5r9xD8dYu9/g== X-Received: by 2002:adf:e711:: with SMTP id c17mr14727205wrm.57.1556275862868; Fri, 26 Apr 2019 03:51:02 -0700 (PDT) Received: from twisty.localdomain ([2a01:c22:c870:100:55b4:804e:196c:cde9]) by smtp.gmail.com with ESMTPSA id f128sm31201538wme.28.2019.04.26.03.51.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Apr 2019 03:51:02 -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 12:50:15 +0200 Message-Id: <20190426105016.12210-3-mario.kleiner.de@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190426105016.12210-1-mario.kleiner.de@gmail.com> References: <20190426105016.12210-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=k9PA/0GEDj+stpgAEpee4BehTzvKgFKLnXu4k3u52+KuT6aKYzYDo2SYcGbhwnlXeB eXobKSLzJVhPi+CGuhA0XCgDrnoQR+f0iGRR5ltKHxmawvWvHiLzyn5mNk6YSmqiNTaP XoT4I1Z5g8+BmjBChUcigBqPCtV0WEMpp2iaK6grtsNZoh4TCIXyJkMdZiNYYpNtwMPj r99abHDxUaV1dRDgtOqoDgsDkekB2fTnu2RV5k/RwNMqrHyHqwkKVJP6meGCOkdmAHAG fSL+Th3TiGlOv2wmp0YtfqZCkaLq6UB/a18RMcgj9S3phJWFsG9NN4indz4OHbEtjk8A nqsg== 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; }