From patchwork Sun Apr 23 23:02:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Kleiner X-Patchwork-Id: 9695329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8C1846037F for ; Sun, 23 Apr 2017 23:03:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EA6720683 for ; Sun, 23 Apr 2017 23:03:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 934A026530; Sun, 23 Apr 2017 23:03:26 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 16A9F20683 for ; Sun, 23 Apr 2017 23:03:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 018726E01E; Sun, 23 Apr 2017 23:03:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 98AD46E01B; Sun, 23 Apr 2017 23:03:21 +0000 (UTC) Received: by mail-wr0-x242.google.com with SMTP id w50so14147708wrc.0; Sun, 23 Apr 2017 16:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=4tMWhy2XeKjCw6JAWIHbGVwI4OSHzb1BsYKFgAAyd7w=; b=KEjJlQVgk2s1UKmjSrivScHaUkpsKtejnidf4Iz9puI0Fnn8cQqUCpAqk2VG4FExJ+ 4VqzAeYQKnLq/NblaOkSIkiBPxpFmzZ+aFL1cE1uSq2hllnqvA+qICK4AnNdBpG48xDD DVTj8oG6Qy6h6XbzpZFqeE1SvBQWHQU54V7NDSZPGSbNuAaGmoc2Gh4BQnD+gGuYU+94 6G78gLKu9t0qugnlgMnQhbdqV3NQ15OBMCMOKog/fIO9K7akwlpFePmpoAwDA7bS6p25 lUtM5yALy0ly1hJskHPLRvQ0egzwhIkOjLkZkaAuGS0+33DgT4APjRSNeZmgg5An4WCC aT9Q== 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; bh=4tMWhy2XeKjCw6JAWIHbGVwI4OSHzb1BsYKFgAAyd7w=; b=QLCWp8ZsuyfRfeoWNP4gvTdAmKAL/NBkToCLeE96SODmw6pdhOJhuhU2WStiKeCZRv D+uouSB4kVPbrZ7d8AzevIz5nLIhXxYlXL2cpSx3BTrIsF74rCR+XHW/B+eVc1KaM85X i2C4UUnv0049oD7frojp9vsJ8HDdMGtKbLpPnjhdsVpohIePHMUBcmPC8CzPHI+ClJ0f l1jpdXx7ejj5GOtyfjbVJNNlKaE7uP759EozAQxOc7GdeTvV4shERMAW4uFF5jBZoQJq /T1B7u/f4QXKxf4TrS88wLq7/6oojpME7iwa9ZJxC3J/WBPqwTeJgTvbEIy60Qh08uSL HmGQ== X-Gm-Message-State: AN3rC/7ufCTeQnu3n4R3svK9VvmL3cg5IF7L97ezByyYdqfq8F/1ModO SBmggkQFx8/DMw== X-Received: by 10.223.150.18 with SMTP id b18mr3302816wra.98.1492988600132; Sun, 23 Apr 2017 16:03:20 -0700 (PDT) Received: from twisty.cin.medizin.uni-tuebingen.de (cin-11.medizin.uni-tuebingen.de. [134.2.118.242]) by smtp.gmail.com with ESMTPSA id y190sm10828600wmy.15.2017.04.23.16.03.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 23 Apr 2017 16:03:19 -0700 (PDT) From: Mario Kleiner To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/amdgpu: Add missing lb_vblank_lead_lines setup to DCE-6 path. Date: Mon, 24 Apr 2017 01:02:46 +0200 Message-Id: <1492988566-9801-1-git-send-email-mario.kleiner.de@gmail.com> X-Mailer: git-send-email 2.7.0 Cc: Alex Deucher , stable@vger.kernel.org, amd-gfx@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This apparently got lost when implementing the new DCE-6 support and would cause failures in pageflip scheduling and timestamping. Signed-off-by: Mario Kleiner Cc: Alex Deucher Cc: stable@vger.kernel.org --- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c index 307269b..e146d25 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_v6_0.c @@ -979,7 +979,7 @@ static void dce_v6_0_program_watermarks(struct amdgpu_device *adev, u32 priority_a_mark = 0, priority_b_mark = 0; u32 priority_a_cnt = PRIORITY_OFF; u32 priority_b_cnt = PRIORITY_OFF; - u32 tmp, arb_control3; + u32 tmp, arb_control3, lb_vblank_lead_lines = 0; fixed20_12 a, b, c; if (amdgpu_crtc->base.enabled && num_heads && mode) { @@ -1091,6 +1091,8 @@ static void dce_v6_0_program_watermarks(struct amdgpu_device *adev, c.full = dfixed_div(c, a); priority_b_mark = dfixed_trunc(c); priority_b_cnt |= priority_b_mark & PRIORITY_MARK_MASK; + + lb_vblank_lead_lines = DIV_ROUND_UP(lb_size, mode->crtc_hdisplay); } /* select wm A */ @@ -1120,6 +1122,9 @@ static void dce_v6_0_program_watermarks(struct amdgpu_device *adev, /* save values for DPM */ amdgpu_crtc->line_time = line_time; amdgpu_crtc->wm_high = latency_watermark_a; + + /* Save number of lines the linebuffer leads before the scanout */ + amdgpu_crtc->lb_vblank_lead_lines = lb_vblank_lead_lines; } /* watermark setup */