Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795049100; b=ipsKT+I4NWWigns11/ZOluT8D3ux2dVkPeVbASkj1JaucpGQX6JP3xX6UxtEwYph3lXz Bnmuz4iWeg4zsAcSbrxqgG03LR+ufp1M3VetV7xGQnBv4uHMLdS9YfTLTId9vagwnnd/K z+2j38PGNSAoROrJwky/UOmIEJnZnFfR18TNqjKVmilSdW2fqrMk0FBaUftnmYLTLNLp6 Ryo1M5cqsE1hR52KjI67iAQg7f7/eKSNnM636BD69E/10QBy07Bev/LrXP755PIv8lMLd 9DBG6IqmZ1RPWWmNXpVIT8VGgk4sYVm5P9jrIDaEuVlunEI51b6jD/rwBkFQu12JBIQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795049100; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=Z7h3Kml9uJ+WO+JIKfWelkl9ncadGxoyL4d2akeINBw=; b=vdDFlaBdBNiOopxpbrp/ZY+WMScgMN/7iO4hTB2y2bWG1kX6Ss87FqLYXb3eSPCYbOnO X5mSQRqRDb9KLanvBrzlgkdHDGar54JBs0LjWuOfWP2A5eaeWZUzKGlL6f1SfSG6fbRr0 qxQzzvxzLbtj9Pm6IQMzUXb1PYQdR1C3R758cjQD47jq9XLa/odZB5j9fletFDxSrxv6K f8C9gVIbdtJjDK/GbdUuaeroxQzHBBvGCW4UTGGJicNlZdVPi8FMNowymYMkmzg60Wfwh r4AiwAZzzC15fiJfafq6eK20KxD2wOZgbdycETnX91Bof+0Q7+SDitlpzlvQYLYge3A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=TFkzNk2r; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55E45606A31C; Thu, 19 Nov 2026 00:45:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=TFkzNk2r Received: by smtp.kernel.org (Postfix) with ESMTPSA id A97781F000C4; Thu, 19 Nov 2026 00:44:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795049100; bh=Z7h3Kml9uJ+WO+JIKfWelkl9ncadGxoyL4d2akeINBw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TFkzNk2rSaf0RELO8J73NWbr+P5QSBCZJcfU/3XmGY6k72wHHXFw0kD6TJholX8dK SAegilCqoDYINEczPkCzNzQofYF+3J+b/MLpIa4ufaEva+8i7WlI4xYgbPmCOITcRh kDr4llQIY35p+gY8pmWjXM0yQxSYRv7qM1Bnadxc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Abhinav Kumar , Dmitry Baryshkov , Sasha Levin Subject: [PATCH 6.1 2189/2857] drm/msm/dpu: extract bandwidth aggregation function Date: Wed, 18 Nov 2026 15:53:43 +0100 Message-ID: <20261118150320.226489009@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150201.293410965@linuxfoundation.org> References: <20261118150201.293410965@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Dmitry Baryshkov [ Upstream commit b9aedd32a81792f5b4b7716815aba375ebaff526 ] In preparation to refactoring the dpu_core_perf debugfs interface, extract the bandwidth aggregation function from _dpu_core_perf_crtc_update_bus(). Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov Patchwork: https://patchwork.freedesktop.org/patch/636058/ Link: https://lore.kernel.org/r/20250209-dpu-perf-rework-v5-1-87e936cf3004@linaro.org Stable-dep-of: 480ba24aa340 ("drm/msm/dpu: compute the CRTC bandwidth from the state being checked") Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 45 ++++++++++--------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c index 1cec264f66042..d144111530086 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -204,36 +204,41 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc, return 0; } -static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms, - struct drm_crtc *crtc) +static void dpu_core_perf_aggregate(struct drm_device *ddev, + enum dpu_crtc_client_type curr_client_type, + struct dpu_core_perf_params *perf) { - struct dpu_core_perf_params perf = { 0 }; - enum dpu_crtc_client_type curr_client_type - = dpu_crtc_get_client_type(crtc); - struct drm_crtc *tmp_crtc; struct dpu_crtc_state *dpu_cstate; - int i, ret = 0; - u64 avg_bw; - - if (!kms->num_paths) - return 0; + struct drm_crtc *tmp_crtc; - drm_for_each_crtc(tmp_crtc, crtc->dev) { + drm_for_each_crtc(tmp_crtc, ddev) { if (tmp_crtc->enabled && - curr_client_type == - dpu_crtc_get_client_type(tmp_crtc)) { + curr_client_type == dpu_crtc_get_client_type(tmp_crtc)) { dpu_cstate = to_dpu_crtc_state(tmp_crtc->state); - perf.max_per_pipe_ib = max(perf.max_per_pipe_ib, - dpu_cstate->new_perf.max_per_pipe_ib); + perf->max_per_pipe_ib = max(perf->max_per_pipe_ib, + dpu_cstate->new_perf.max_per_pipe_ib); - perf.bw_ctl += dpu_cstate->new_perf.bw_ctl; + perf->bw_ctl += dpu_cstate->new_perf.bw_ctl; - DRM_DEBUG_ATOMIC("crtc=%d bw=%llu paths:%d\n", - tmp_crtc->base.id, - dpu_cstate->new_perf.bw_ctl, kms->num_paths); + DRM_DEBUG_ATOMIC("crtc=%d bw=%llu\n", + tmp_crtc->base.id, + dpu_cstate->new_perf.bw_ctl); } } +} + +static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms, + struct drm_crtc *crtc) +{ + struct dpu_core_perf_params perf = { 0 }; + int i, ret = 0; + u64 avg_bw; + + if (!kms->num_paths) + return 0; + + dpu_core_perf_aggregate(crtc->dev, dpu_crtc_get_client_type(crtc), &perf); avg_bw = perf.bw_ctl; do_div(avg_bw, (kms->num_paths * 1000)); /*Bps_to_icc*/ -- 2.53.0