Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3709511imu; Mon, 28 Jan 2019 09:24:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN5lHfXt1X4ifETJdS2ku2tw4MU5jrZ6mg54WMBA9qmhBwmVCexwjeZ826Nt/H4JBiCEoJlI X-Received: by 2002:a17:902:8607:: with SMTP id f7mr22027957plo.123.1548696297566; Mon, 28 Jan 2019 09:24:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548696297; cv=none; d=google.com; s=arc-20160816; b=wxolkbgxn1Kt+YYwPIv2RG9Rg5nEpCm5rO2BdusfBXw1rRRJaZo2bwGMoiSuwK+hhq Fe7NxVoDT04x6lGmp+mkhpgT5vVafvPqDbSSkuJk6DgN64jPT+0KkPEWhueGrYMVBumB JpwrJ+DFoYkrPUBj3GZz8JdEKED/lmUGNgoc6mYmEFSPAoHnkfFAn9lBwk6K8brYNyd5 kLO/wo2jyKRD+/AO6e9Rz+cwaa1Q2anKhJQieZOejA66Zdryn/Sfx/qUIaiGEuyVdR6/ POHGNPwkJwo31ZrN+sPY6H8l4hPn82Az9OXNP+mtoHMX+tW6MCCIDNiS4xVXDYUsUG5+ 1ULg== 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=dAahSultjAa38McWBCiLMn8uvqzWoWsN5bipCieoANE=; b=wEwu9FLWKiYnC+rtq4PPV7ufALees5QEsxjz2zBFNuqpKWfzXCkZSbh0vAv/HD2Jim pn41sFfokK4L2UgQPbqsB3eVdBbj0UkVmC2CeVpfhD1SLAixQNUNrzv0VZRZyFXqw8Aw M0Lv3e+bwBelOAbM624Rb79xuE20nSg/J99D0CgTE6HdR81wMdU14ao+8sn+QqIlyx3t EqGqlM5GCkIXQ/zczgjD3XzNjMlhJ+imHxwJy9c/0z8R+ieP1a0oU5Sz/2y5vOApEMXM rSC5gf6KSqzsL1zXrz3y2PPHzMJHMq/dVXaUEzrvMP7ec6gW5NK8B2IoJSf41IZSFvdX Nb/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=j3RUCCRm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h189si8756328pfc.211.2019.01.28.09.24.42; Mon, 28 Jan 2019 09:24:57 -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=j3RUCCRm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731065AbfA1QBj (ORCPT + 99 others); Mon, 28 Jan 2019 11:01:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:46886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727105AbfA1QBi (ORCPT ); Mon, 28 Jan 2019 11:01:38 -0500 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 C024021852; Mon, 28 Jan 2019 16:01:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691297; bh=ifmOylCZuBdJr2UJX+sEuI/nP79HYcEt4jS6DuErTd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j3RUCCRmm8jV1MrPz2WRa6TtTyt+iIE/KEvyUY6Us7bgBHaZY4GWkq4SRJRoVeC+z 4bY16tJtdtxBL5bYetM9Kd0blSqLIJ0PIckVgkJ3w2qnX5mv+Fjtqc+ZosEpb/UV2F FnajP7WOZJpsLbfJqUGyqXmL8V5GHXj//ZzTKNwg= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yogesh Mohan Marimuthu , Alex Deucher , Sasha Levin , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 4.19 049/258] drm/amd/display: calculate stream->phy_pix_clk before clock mapping Date: Mon, 28 Jan 2019 10:55:55 -0500 Message-Id: <20190128155924.51521-49-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-1-sashal@kernel.org> MIME-Version: 1.0 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: Yogesh Mohan Marimuthu [ Upstream commit 08e1c28dd521c7b08d1b0af0bae9fb22ccc012a4 ] [why] phy_pix_clk is one of the variable used to check if one PLL can be shared with displays having common mode set configuration. As of now phy_pix_clock varialbe is calculated in function dc_validate_stream(). dc_validate_stream() function is called after clocks are assigned for the new display. Due to this during hotplug, when PLL sharing conditions are checked for new display phy_pix_clk variable will be 0 and for displays that are already enabled phy_pix_clk will have some value. Hence PLL will not be shared and if the display hardware doesn't have any more PLL to assign, mode set will fail due to resource unavailability. [how] Instead of only calculating the phy_pix_clk variable after the PLL is assigned for new display, this patch calculates phy_pix_clk also during the before assigning the PLL for new display. Signed-off-by: Yogesh Mohan Marimuthu Reviewed-by: Harry Wentland Acked-by: Bhawanpreet Lakha Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c index ea6beccfd89d..87bf422f16be 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c @@ -1917,6 +1917,8 @@ enum dc_status resource_map_pool_resources( } */ + calculate_phy_pix_clks(stream); + /* acquire new resources */ pipe_idx = acquire_first_free_pipe(&context->res_ctx, pool, stream); -- 2.19.1