Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp177670lqo; Tue, 7 May 2024 16:51:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWBU/fQGgV9/4G9YhSjbMXhCjIUC/it79dnyk4UW9+Iog4/T8I4Y5dnmHXbXwkVwHKwTtJ2z8cDvDypjdwCA7ck9KxWIEr5aUR+QKcNsQ== X-Google-Smtp-Source: AGHT+IHbdRRhmGg29wgVJIJYdqeqmP6JOhpS796qnfxOZqlKMI/7Y1JYajyRyXJE9mpL9VqX7Tph X-Received: by 2002:a17:903:50c:b0:1ee:4c96:787 with SMTP id d9443c01a7336-1eeb0795fa1mr9094795ad.50.1715125871861; Tue, 07 May 2024 16:51:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715125871; cv=pass; d=google.com; s=arc-20160816; b=NLjIQ/FdAxBFAn7sc+9fLjKxgWW+2/zni9HBh9Rn+EgTST0u+cUjXYquykvzFdrE/w RWNL4kSnj+1Z0ANQbOMRckjDQ9PV03QlZu5oxJ057GyEn9JfhDmkuzoP+wCZqTqr2vLY /kduq4NtbHE9ISCiVt+xSv2HzFsRkZtl07zwI0yJmQ+ZPZAZiJEmLsZwTrkfjZxtEZbS HY8DzFyU7A/JKKELtsc7WGRowmHsq75OO4q55+KNz79tBC3V4WNb3h1/caign1TZtl0M PsmaUtIzcubIeXBe0U/0IYRf5S1VtY2AQsonvhzalYfYVcooKzQY74+y/CT3gR3lve8C N3ug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3RHH3uUJgLUNt6d29zwgRXe1HvOrt82qSfuSzOv5HCc=; fh=a1H5IaOKvexhoXUfoWVUqTODnHQ1vf/qtTQEj0V3yts=; b=OO1eYnW4/hmGhnUeCLEWnHHwbcxORo8Zo8esSYGhuP/B0s5GzQMKwSfgCCzZd6dPwT lMO4dKV23YbLoWG5TzTLopv0hDVad8Qu3NBDkntIWDU6K2NEYllRolesUgoCNFadpYfO kLnGdW2EPwhuUQ9zwLRLwfnoPZOWu0GKcJGYH6rZzbyMFkOcOeiRmUGh+pG0+c2KDmcJ 2enHbpDssq/MW05yglUrAuG6vJ6lboDR2IhS68qKP7ChXDZmTuUglGX0KSgaA8UIIiqO 1fUIS3MqPnj2Vpb6swmoaHO0dMP32yILag6FnGjtOsbyQd9kK7p778BCrmuLPr1UMTc9 03RA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZXgKTcKu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172380-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172380-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q12-20020a170902eb8c00b001eb48a19568si11676089plg.578.2024.05.07.16.51.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 16:51:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-172380-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZXgKTcKu; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-172380-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-172380-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 097E0B28382 for ; Tue, 7 May 2024 23:31:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EF50614533D; Tue, 7 May 2024 23:09:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZXgKTcKu" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2125413541F; Tue, 7 May 2024 23:09:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123363; cv=none; b=YCXVK4YsV5nCirE7sFPWL60XyQLYHsGE6q97vd4/27L8/oGY6rmrGql3Y7YigjJdjcQimpvwpoIp2D8ZTfV/puFCOZDAR31emO98mL3O/lxn3uIZoq4blgwIZj2J+4HJ5d15HGb8b8BKDCeChvFApGs5pBF8QnBuJ35UOE70jCU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715123363; c=relaxed/simple; bh=f4ZwjyZMrs5dHXlwR9n+9/SQ3bYChV9o/PuEE9WNtm4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rEXt/0SXDKWUnl5v4jpkUU5LH1ndbCEmPq0ukXl3+vqPqruf41TTs6Xt2fBPJKknPbWaiIfZAsq8IJ3Kv04S4n66bHFOXB7ZXR9467+eh9XwTNWk0uHn0LrekOn7NEqxKx6S+8yWAeeLiNB6AZ6YmDDwwJ1LrSec8/GpOnOj7Wk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZXgKTcKu; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FD43C3277B; Tue, 7 May 2024 23:09:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715123362; bh=f4ZwjyZMrs5dHXlwR9n+9/SQ3bYChV9o/PuEE9WNtm4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZXgKTcKukrOiGFhwxFa74IRJpAU4laeT2hQcKEvgao5mwmmSp/FgSI6zu+wYmK2Zl Of9sGCJcT81/lkXVBqUrnPL8wZGEAEwD4cT65+5WcCPb0qqdVX9+JbX+/MYyxKPYEI n6iVGnBZjOD2ChQJ0H4Dx5BriBOQyJHXqzO5i5CGzVaI7gxEIX5LkA2f0ttBU/jnnl gD7yxlnL+gYYlBnnn4fZdD6kRtNekQ+JY04Sx6PM5b8gj1gEZ0UbRb9+skYBsit4yb BvOZ50Tkq5ZKlxwTWcNXmIFMQ/EXji0eKu38F048jvl5nQz5QDlADTrJ4naMk/28dZ RLCNe57vX1ZtQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Swapnil Patel , Dmytro Laktyushkin , Aurabindo Pillai , Daniel Wheeler , Alex Deucher , Sasha Levin , harry.wentland@amd.com, sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, chiahsuan.chung@amd.com, charlene.liu@amd.com, nicholas.kazlauskas@amd.com, qingqing.zhuo@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.8 37/52] drm/amd/display: Add dtbclk access to dcn315 Date: Tue, 7 May 2024 19:07:03 -0400 Message-ID: <20240507230800.392128-37-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240507230800.392128-1-sashal@kernel.org> References: <20240507230800.392128-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.8.9 Content-Transfer-Encoding: 8bit From: Swapnil Patel [ Upstream commit a01b64f31d65bdc917d1afb4cec9915beb6931be ] [Why & How] Currently DCN315 clk manager is missing code to enable/disable dtbclk. Because of this, "optimized_required" flag is constantly set and this prevents FreeSync from engaging for certain high bandwidth display Modes which require DTBCLK. Reviewed-by: Dmytro Laktyushkin Acked-by: Aurabindo Pillai Signed-off-by: Swapnil Patel Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- .../drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c index 644da46373209..5506cf9b3672f 100644 --- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c +++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c @@ -145,6 +145,10 @@ static void dcn315_update_clocks(struct clk_mgr *clk_mgr_base, */ clk_mgr_base->clks.zstate_support = new_clocks->zstate_support; if (safe_to_lower) { + if (clk_mgr_base->clks.dtbclk_en && !new_clocks->dtbclk_en) { + dcn315_smu_set_dtbclk(clk_mgr, false); + clk_mgr_base->clks.dtbclk_en = new_clocks->dtbclk_en; + } /* check that we're not already in lower */ if (clk_mgr_base->clks.pwr_state != DCN_PWR_STATE_LOW_POWER) { display_count = dcn315_get_active_display_cnt_wa(dc, context); @@ -160,6 +164,10 @@ static void dcn315_update_clocks(struct clk_mgr *clk_mgr_base, } } } else { + if (!clk_mgr_base->clks.dtbclk_en && new_clocks->dtbclk_en) { + dcn315_smu_set_dtbclk(clk_mgr, true); + clk_mgr_base->clks.dtbclk_en = new_clocks->dtbclk_en; + } /* check that we're not already in D0 */ if (clk_mgr_base->clks.pwr_state != DCN_PWR_STATE_MISSION_MODE) { union display_idle_optimization_u idle_info = { 0 }; -- 2.43.0