Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp115693ybg; Mon, 8 Jun 2020 18:03:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys/hrvbxS2XyL5U3LBdUy5WYpBsEynxPEvvm31YQAs2sXS3coYabSb+yvRvb6MSf5qcDa3 X-Received: by 2002:a17:906:2c10:: with SMTP id e16mr22382340ejh.189.1591664585073; Mon, 08 Jun 2020 18:03:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664585; cv=none; d=google.com; s=arc-20160816; b=dmR/lgOtVKiLe4e8T016cyJutxCFMVtPrbQtmPtPSa1sjIOT4dCh8U7jDO35mcsxPH GxbNfIYhpnrBu5emSAmdnen0+gXaUbjYyygzs5TV4ZMEeJmxECr8zg8tZ/WwNiwcSxa8 Ahc4dS5epgA5fpgP1xwtjTI55AzcENqnVLwZie4kSORxVKO1AHe2Jk3dsd2DztfTRfSi f3bsRSM9Z7fzcfI9BR3bv5l25H1iVFrXIx74EtIf4hgrpOnFw+ynIqROWkwJ9FMz0BYk LZS8qM7x0BFz2/Sv1O5atR/yhJFKW4aYdU+E0EJn7776Tzusjimd5FbcF+ShtHZgPNqg zAaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=mfVW5tWtvtcTdDsYK3THUo0dB7yxcHwvpgSkOuLJSFE=; b=GuD3VC7+qUHN5K+1jD1tOvuSBv2KTP0AqGqiuLsggHp6ZlE+JzhJurMd65Sujeb1l1 ZHgQJNDI75uoccG0dfgHmwpjg9pp1fqMtiNKsg1iW8td+b52DuODApa312TOUQ4duD7+ JG/XYcFh0oxX6Yvg4WHIBApPyIa5ubypQ1oP8OjHT9MT2Vkze/dOlUiX8SuZpjUYcXAX sR1xzf6I3M9aGljIfSNxAlCRFfvWvA7aoEk8cV2E9qp7/d8+bCRcWaSOkCGosNDr9g1l SR3ftu687fDzoyx0ZELsSqsyeKynEu4yqWlDgThsx8D7UMX0Ix53RlmCVJAR9357E2kr FeDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AR8Bew5N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i10si7291773edr.376.2020.06.08.18.02.38; Mon, 08 Jun 2020 18:03:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AR8Bew5N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388111AbgFIBAx (ORCPT + 99 others); Mon, 8 Jun 2020 21:00:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:53346 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728122AbgFHXIP (ORCPT ); Mon, 8 Jun 2020 19:08:15 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4717F20842; Mon, 8 Jun 2020 23:08:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657695; bh=h1T8WN4lKVZU17Fkg6U+9UkbB+FzXtXp0Ckcu6/lPss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AR8Bew5NPRB8LiSO6uflaDp8v5HK9mp+G9wE1TNxF+FKHg1qQoZFff36/ibycqFGU qgXAaL8JfP9U/ZtDTVLSYjLVxuGQ+dEnjNP4EnH3kJk4dSf/jdc5vXhKAZjdITmihW 05xV3lJ4GCgjw8D6uDhNmBeE1UB59raSj5qoVfbU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alvin Lee , Yongqiang Sun , Rodrigo Siqueira , Alex Deucher , Sasha Levin , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.7 095/274] drm/amd/display: Revert to old formula in set_vtg_params Date: Mon, 8 Jun 2020 19:03:08 -0400 Message-Id: <20200608230607.3361041-95-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alvin Lee [ Upstream commit a1a0e61f3c43c610f0a3c109348c14ce930c1977 ] [Why] New formula + cursor change causing underflow on certain configs [How] Rever to old formula Signed-off-by: Alvin Lee Reviewed-by: Yongqiang Sun Acked-by: Rodrigo Siqueira Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c index 17d96ec6acd8..ec0ab42becba 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c @@ -299,6 +299,7 @@ void optc1_set_vtg_params(struct timing_generator *optc, uint32_t asic_blank_end; uint32_t v_init; uint32_t v_fp2 = 0; + int32_t vertical_line_start; struct optc *optc1 = DCN10TG_FROM_TG(optc); @@ -315,8 +316,9 @@ void optc1_set_vtg_params(struct timing_generator *optc, patched_crtc_timing.v_border_top; /* if VSTARTUP is before VSYNC, FP2 is the offset, otherwise 0 */ - if (optc1->vstartup_start > asic_blank_end) - v_fp2 = optc1->vstartup_start - asic_blank_end; + vertical_line_start = asic_blank_end - optc1->vstartup_start + 1; + if (vertical_line_start < 0) + v_fp2 = -vertical_line_start; /* Interlace */ if (REG(OTG_INTERLACE_CONTROL)) { -- 2.25.1