Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2281991ybl; Thu, 19 Dec 2019 10:58:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxou7xhrMC8dI80Jh1RvcaqAXiIW9gsRxRpcZfRJMmpCbMIKzYrbdde71oQ3NFGuKjukPK/ X-Received: by 2002:a05:6830:2006:: with SMTP id e6mr9733648otp.367.1576781898159; Thu, 19 Dec 2019 10:58:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576781898; cv=none; d=google.com; s=arc-20160816; b=Y042NvMvf97jWlFCCxFwOddkEgOwoi1D8ZagOU0cv2wC5W47vk+cyeqZcPKKOwcypp 2GQ5itn8GLiC7EtM2agb2ddYKk3KTJfW/hmvXXRLxVzJI5UOilIXpzqE/D8phUhGQZgW srR/LMBvqKJyZEN0FfeDkM/wNGO29oWm5To4x+MlJ6OMzewTKx2g2WyI8Va4E4gssYsK UNsyP+eizAsxVWSWj/XVgZhH5yqOxNN7SSvbOPe/sieT+b8D1feGAPXi53OTCPbefkDU 0yRQRKIffYYyXjndaKeJ2zhOYf4rGic+dsGF45ELQQVrsf3O1l7eS/NFysfOUDfgBLnN GJog== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6nO+89Xh16HPzmTLEOVmbHvjDCXEjdbKKOofSYTSGro=; b=XOLKsGZfdYVeGYzpImLwtIUlag6ECeu+xoYZFOXHQW4L/S6IiKAlAK5NVVd2LrnDO9 Uqd5UitLh+zngj76M8J8sfbKO8bARxpMaxKk2QNP4vr/Fmh1kLw60lsQEs1cttxCzLRT v6zhe1a8KMPaPhLC52jdnPzBZgnQxeLZ3XMzpdyZAuNehbQNNO0DAJuaC1QDMOHn4JDQ qvJz1kwH+TSKxZw9Z9Cz6GZXz5BK0wC1kRG4Meq7zYz/O/ncnmG0cqzjmEBjqjsf+/z/ 2QngMS/oYrZv0FB8c9fJ5zvlLroJTUJpCVKHWStjXm6O9NHy3uR7v4+ZMQZVLgpyZrKV qelA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ypV6kO4e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20si3655124otf.271.2019.12.19.10.58.06; Thu, 19 Dec 2019 10:58:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ypV6kO4e; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728377AbfLSS4P (ORCPT + 99 others); Thu, 19 Dec 2019 13:56:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:52674 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730785AbfLSS4M (ORCPT ); Thu, 19 Dec 2019 13:56:12 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 303BE206EC; Thu, 19 Dec 2019 18:56:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576781771; bh=DXRwfcdkeourfhTF/yaOngZc4nLdbMz9SJBOFGWLNRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ypV6kO4eBTkU9RRhH92+Rl8d9Xdp/p+qJOOLvJ6Qx9d16Z23IrlsVzhpgjNkSWu9o hwR/nawdpsYO6pW+HXfC3xBngjyAPSKl8Trh4IJjCOgeiBsto4CPsiIGIkARXCbgV7 tWkzwlmPoHHm9WV9GK1SReVQ/xfM48Cg9CGFld2w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Harry Wentland , Alex Deucher Subject: [PATCH 5.4 72/80] drm/amd/display: re-enable wait in pipelock, but add timeout Date: Thu, 19 Dec 2019 19:35:04 +0100 Message-Id: <20191219183143.088145146@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191219183031.278083125@linuxfoundation.org> References: <20191219183031.278083125@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alex Deucher commit 627f75d18910b287472593a4a2c41de9a386f5a2 upstream. Removing this causes hangs in some games, so re-add it, but add a timeout so we don't hang while switching flip types. Bug: https://bugzilla.kernel.org/show_bug.cgi?id=205169 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=112266 Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) --- a/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c @@ -1103,6 +1103,25 @@ void dcn20_pipe_control_lock( if (pipe->plane_state != NULL) flip_immediate = pipe->plane_state->flip_immediate; + if (flip_immediate && lock) { + const int TIMEOUT_FOR_FLIP_PENDING = 100000; + int i; + + for (i = 0; i < TIMEOUT_FOR_FLIP_PENDING; ++i) { + if (!pipe->plane_res.hubp->funcs->hubp_is_flip_pending(pipe->plane_res.hubp)) + break; + udelay(1); + } + + if (pipe->bottom_pipe != NULL) { + for (i = 0; i < TIMEOUT_FOR_FLIP_PENDING; ++i) { + if (!pipe->bottom_pipe->plane_res.hubp->funcs->hubp_is_flip_pending(pipe->bottom_pipe->plane_res.hubp)) + break; + udelay(1); + } + } + } + /* In flip immediate and pipe splitting case, we need to use GSL * for synchronization. Only do setup on locking and on flip type change. */