From patchwork Wed Jul 12 22:11:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 702869 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8D9FCEB64DD for ; Wed, 12 Jul 2023 22:11:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232441AbjGLWLq (ORCPT ); Wed, 12 Jul 2023 18:11:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232443AbjGLWLp (ORCPT ); Wed, 12 Jul 2023 18:11:45 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D5A91FE4 for ; Wed, 12 Jul 2023 15:11:43 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4fba74870abso106437e87.0 for ; Wed, 12 Jul 2023 15:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689199901; x=1689804701; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZC0/5bXEsuHujngkcxb69wPizikqv0P8Uq9N9rSIaSc=; b=y6Aij3ypLT4DY9P0gTIiefxjzrnk6WuPzUxvlbcdt+U4RtC1LqcbZGMzhbYFc4UOjX OoU+VtQU4PzKzjdVinPZMePXPcapuODlz+6nGnAYdnmpOt6c7dMEkF0ZGkGmCABZ09Jt lzyqGvXLYmLQ+CTkiRxUKy7/rJ+dD9Lhw+M0SjawUldB280OvLZza21FCYmsOSRBpWOy eXWOk3f2uAzwV9odfEpOIMbGfVduRyJOCoaMFAOw3naC/lZVlzWI8Z6MjFCUXIsf0oT8 /UsBC3TnZLC7yu3Iw0O9e8Ky4gJH9WdMfqDLtqdxFJPCEd1G91Wy/IhmDJS3MMnrs2af nSXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689199901; x=1689804701; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZC0/5bXEsuHujngkcxb69wPizikqv0P8Uq9N9rSIaSc=; b=J9rZsgmj5rc56lpdYUlOqNekALxcOLDbvReHJB+Av0+NLeCa0qDhUGFSJekaFHtEm1 7pRTIlo7R+4UV+qRXejh0BjdQ4ycJFR6F/oCPNSh+AGJEq6kqqQox8DycLMgmKPCZhJ1 M1vSECQkgMTaulbF72AVn7RkGuvKhc4StS/LhXP9eQPIiWEfHWDekyFVExB4Xnozgxdz ofhh2T7SW+fg/ZcizvsDfxPBZ//4C06UPFprPHnTpkbpNfhKn7k67IbRFQmAiKzo3C0E LmyC8NJ+XKbwBfdUvIWfvpIKbAmzzrrEETs46yaQ+JG8Sv/l7DCfsw6ueQV7gDLtsCx/ KT6g== X-Gm-Message-State: ABy/qLbi2DQfslT/4rdoxVDpfZXN2aVWG0nagvAvtk2A7dkMQxeRhsAY qslLfhzeIrbsjQey2+a2T/5jxQ== X-Google-Smtp-Source: APBJJlFaw9K1LJyJZUnlJHZ0Fh4QWBPwE6TMCr//rkPpnfoKf4qUL3Ik4q3HAJhInGPAMO0PUEq3QA== X-Received: by 2002:a05:6512:2351:b0:4fb:99c6:8533 with SMTP id p17-20020a056512235100b004fb99c68533mr20924345lfu.33.1689199901060; Wed, 12 Jul 2023 15:11:41 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id q16-20020ac25290000000b004f62fdf61fdsm856193lfm.204.2023.07.12.15.11.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 15:11:40 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Konrad Dybcio Subject: [PATCH v4 01/11] drm/msm/dpu: drop enum dpu_core_perf_data_bus_id Date: Thu, 13 Jul 2023 01:11:29 +0300 Message-Id: <20230712221139.313729-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> References: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Drop the leftover of bus-client -> interconnect conversion, the enum dpu_core_perf_data_bus_id. Fixes: cb88482e2570 ("drm/msm/dpu: clean up references of DPU custom bus scaling") Reviewed-by: Konrad Dybcio Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h index e3795995e145..29bb8ee2bc26 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h @@ -14,19 +14,6 @@ #define DPU_PERF_DEFAULT_MAX_CORE_CLK_RATE 412500000 -/** - * enum dpu_core_perf_data_bus_id - data bus identifier - * @DPU_CORE_PERF_DATA_BUS_ID_MNOC: DPU/MNOC data bus - * @DPU_CORE_PERF_DATA_BUS_ID_LLCC: MNOC/LLCC data bus - * @DPU_CORE_PERF_DATA_BUS_ID_EBI: LLCC/EBI data bus - */ -enum dpu_core_perf_data_bus_id { - DPU_CORE_PERF_DATA_BUS_ID_MNOC, - DPU_CORE_PERF_DATA_BUS_ID_LLCC, - DPU_CORE_PERF_DATA_BUS_ID_EBI, - DPU_CORE_PERF_DATA_BUS_ID_MAX, -}; - /** * struct dpu_core_perf_params - definition of performance parameters * @max_per_pipe_ib: maximum instantaneous bandwidth request From patchwork Wed Jul 12 22:11:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 701914 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9130EC001B0 for ; Wed, 12 Jul 2023 22:11:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232415AbjGLWLr (ORCPT ); Wed, 12 Jul 2023 18:11:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232382AbjGLWLp (ORCPT ); Wed, 12 Jul 2023 18:11:45 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 638C61FEE for ; Wed, 12 Jul 2023 15:11:43 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-4fb7373dd35so1636473e87.1 for ; Wed, 12 Jul 2023 15:11:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689199901; x=1689804701; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=NjoI3Dx1Y7JEO/QjjX2Gq34JkRG4tKXD0+CPY31Fy3E=; b=j0/D7wxA4iyH+b7ICVgO4R7WWGxeJrcBs3PzaFpHruiCWDmfPgpDC5T5dTiwIfz5ze teLLgrvkNHULKDrJHgFVYNH5eqUqVq83KVjzTK62+f/2co38A97/vGpm4gtB7dOkby4e X/HyQKcFUdtCxebjznnsaJpiEew17IehcpPRwB8e9ysJMJoCfWx82qTLDkc5D2grgwUX IkYwLPNQ4R9EcS2byO0LIy2dksKIbg6fwoK3QMjiw7UMfdcjT8xhMIkhSOQ142eKSBe5 o+MOhfgiUYK4FGViGv+oe+KZcQMz3O8TDAgr/kcWz4i5/jiEGKHG4u3goqELBJuCGYLK L/kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689199901; x=1689804701; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NjoI3Dx1Y7JEO/QjjX2Gq34JkRG4tKXD0+CPY31Fy3E=; b=Yi8Dh/0jrUMkYw8Y/sYaCmH6a4AJIVm6xb7CQvzoWILC3sHHTDAw2yLmfxdlNPA8rW MAH2gKxEAFUFuhD8ohvFd/3lIjCaMAI5i6wvvf/uMHOsK06iNuzEhN79FfvkMLezb7E+ wXH/F37/jQ4nUoeU9Vfr5EpjLS8FtaIFnQSNZ8cN2IvN8UtYSGToLhaDN5Nz3goAUxHs X41GtDY6q/DQ/qNOkQH0fDiC4p4tTRDx6tW9eZJGFAaN38sAp8DSDSTpl+sMGh3kmRHZ SplPS+GuE84SbLMsrTPnm2nkhV+Adb5bSaqItCkaJc9fokSeYwuDG6JgkjRaOdf8ZcrZ N1kA== X-Gm-Message-State: ABy/qLZryzdMJ3nPW+L2tIewAGMOTytqqQSzsTW8tjdP+Jp9KoA+R6SY GjjrSrjOKENfk98LEkmjwSAVjQ== X-Google-Smtp-Source: APBJJlFXWUYjQidB1ObvXIK2k2OVBloUYCnZ3YxIu1veI2yPlLZehMX4vOhmglglknfvr10Tu37Q/A== X-Received: by 2002:a05:6512:3f18:b0:4f8:6e50:d6d0 with SMTP id y24-20020a0565123f1800b004f86e50d6d0mr1217938lfa.31.1689199901809; Wed, 12 Jul 2023 15:11:41 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id q16-20020ac25290000000b004f62fdf61fdsm856193lfm.204.2023.07.12.15.11.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 15:11:41 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v4 02/11] drm/msm/dpu: core_perf: extract bandwidth aggregation function Date: Thu, 13 Jul 2023 01:11:30 +0300 Message-Id: <20230712221139.313729-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> References: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org In preparation to refactoring the dpu_core_perf debugfs interface, extract the bandwidth aggregation function from _dpu_core_perf_crtc_update_bus(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 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 1d9d83d7b99e..333dcfe57800 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -206,33 +206,38 @@ 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; + 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; + + dpu_core_perf_aggregate(crtc->dev, dpu_crtc_get_client_type(crtc), &perf); if (!kms->num_paths) return 0; From patchwork Wed Jul 12 22:11:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 702868 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A0BFC001DF for ; Wed, 12 Jul 2023 22:11:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229572AbjGLWLs (ORCPT ); Wed, 12 Jul 2023 18:11:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232392AbjGLWLq (ORCPT ); Wed, 12 Jul 2023 18:11:46 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EF04A2 for ; Wed, 12 Jul 2023 15:11:44 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2b6f943383eso122670071fa.2 for ; Wed, 12 Jul 2023 15:11:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689199902; x=1689804702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ln26l+vUCSi4edYTgivRAGgTHzh3pendnmUbrCgVtyc=; b=eUQJCuEGxoNyAgK0GQU7bsh0VzSVckuvMBafrWEJstVAupgtuOL7xp0UCV8AY/Bvy/ N3X7xcBUHIMr7x/hwSHsippDRjIZV6TboLIDmIWlVnDlX0Qbsj/q28ydHIVcT6rEVrkQ d1jBsCMk7totRPk0u+TsWmUfTut317VYbAypkURiykvzGHNw7EnEueJ2SQJ3n4O7Kp1k M/G2TjTWHkyTkeQUtzV0QguF4wm+h3fY1MLeYby8b0mc4IYmrj8scuD+//ehPL/N6V9Z v3qBwC7usWB7s3av551I0iJjUhCd8RGSNj6XWOtYLtpX8O7FF4kS7eoYwK9x9i+VLmYf xHdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689199902; x=1689804702; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ln26l+vUCSi4edYTgivRAGgTHzh3pendnmUbrCgVtyc=; b=XWsMsrTSxvgiiZ89t106e0+v3c2D3TJ+tUQwI3d9q8XUNswvQu6q2UiK+kYkGp7CcR yX9KKYWS837jel3wtwsi29JbWDtrQP3VH/wtrbdcg0q67Ecv82NyJDgHxytvTNlA59Kq afghN3dOmQhd0H4p62k0ZUyMjVmCVLWoi890ie7PMB+d6yJJSjzGMCrJ8gLYtYqEmhh7 srYAKY751jQzLx6foVwM2G6AoFhlD+lumkN1PXojdJ3SQ1MzIXqGlIrXbGjLQE9jE0e6 tBSa0/dFvd8XX8GurzG/U63jsDAPtKjeBuMI84uZByWIYIXFiWtTyDgW0nRycBdps5q1 Ndpg== X-Gm-Message-State: ABy/qLa+hVI9v3E+X5Oxa3+3ko2p37KvF5/j7xwJ9Pm+MRFvZ9oQDQQi N8dmm1VrMskjtx3G4y7h0jypGQ== X-Google-Smtp-Source: APBJJlHAcG8o4Mk5Otmnqxt/jCoQlHMizSXykFGZPee/W038aHNo+Hqo6dCCDHs5kBHu5cGYiOPtAQ== X-Received: by 2002:a19:6504:0:b0:4fb:8b78:4a93 with SMTP id z4-20020a196504000000b004fb8b784a93mr1712790lfb.7.1689199902781; Wed, 12 Jul 2023 15:11:42 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id q16-20020ac25290000000b004f62fdf61fdsm856193lfm.204.2023.07.12.15.11.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 15:11:42 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v4 03/11] drm/msm/dpu: core_perf: bail earlier if there are no ICC paths Date: Thu, 13 Jul 2023 01:11:31 +0300 Message-Id: <20230712221139.313729-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> References: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Skip bandwidth aggregation and return early if there are no interconnect paths defined for the DPU device. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 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 333dcfe57800..05d340aa18c5 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -237,11 +237,11 @@ static int _dpu_core_perf_crtc_update_bus(struct dpu_kms *kms, int i, ret = 0; u64 avg_bw; - dpu_core_perf_aggregate(crtc->dev, dpu_crtc_get_client_type(crtc), &perf); - 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*/ From patchwork Wed Jul 12 22:11:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 701913 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B85CEB64DA for ; Wed, 12 Jul 2023 22:11:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232380AbjGLWLs (ORCPT ); Wed, 12 Jul 2023 18:11:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232443AbjGLWLr (ORCPT ); Wed, 12 Jul 2023 18:11:47 -0400 Received: from mail-lf1-x132.google.com (mail-lf1-x132.google.com [IPv6:2a00:1450:4864:20::132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FB571FCC for ; Wed, 12 Jul 2023 15:11:45 -0700 (PDT) Received: by mail-lf1-x132.google.com with SMTP id 2adb3069b0e04-4fbf1f6c771so93817e87.1 for ; Wed, 12 Jul 2023 15:11:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689199903; x=1689804703; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5XWChv4vT18nWUgbzPeiVwsxo15cumrt9rjiPAkOKEw=; b=LrfA6udGKNXPT3NP5hqNTSnny5daWC5bP5r3Sk0GJmvUkXFSqps87WFxUaXvK/NUjb nb3Qga+6cfwtIvWUwdUTScwQraEfzOZ3jo7UIuU8krHCd/wjmlxGVylJNY24x9eBZWmJ fdzGeKKz1CGOhHgsmuVCo12/ewaCU5aNGTgoMsvSrzE2cCt2o3g2mHIOGuROBV6oiMOr RgWx6yVLOE6AkuG1ScxJoN86HJI0+YmxL5y8xgwBHLQxEwt4rY3ExnMqjfG9kPLVVj7k 8CHhrzDHMfhpGUP8KYpbhn6o/1UXX57ngTWeBxtaFmabC+aU1CIdFO6W2Jk69s3GP7wP uTNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689199903; x=1689804703; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5XWChv4vT18nWUgbzPeiVwsxo15cumrt9rjiPAkOKEw=; b=EzW2vcptd/0vXMMIrv3F38Inp2UkKiWIJL1LicFV2tRcvrdiYznQpBESOoSD1/AsYH rHXK8dh7stYFkaPns0VenW9875KjuAHFHwdRsCJutJk0Re37j83t48usnAEB6+5VGhRB ifgju2ONk98jSN0GurSAvu2QCpDiedUTRegl2VcY7dL30RqtS5CFLNIrT0dPu4HMD4lb CwGcdlB5H9MEghoyg1dww8PKBIWlMaael5pAS1yqsEcbqSFhDoV6/JA+rCL85ovPDnFj sa4JXmXZqT9V8w2fNRLhJjDnSuihdK5BUQL/ubT1ID2xnQLRPhbcJbtnNESGmTZoyE+r jA9g== X-Gm-Message-State: ABy/qLaN9MA5jw5BAkJrnpPw5cGqxvbRJNmkGFgFU9o/19R5Tqn6Tqf1 yZgDTS1lhL4Gwp2hnSXyke67Tw== X-Google-Smtp-Source: APBJJlHH4t/mhmlGvZmAiZMvEvV4olCUNQRCaJ74OGgbFzq250PCTZKzdTQWh3x0WZhsYV3wpmE7ZQ== X-Received: by 2002:a05:6512:344f:b0:4fb:92a9:cbe8 with SMTP id j15-20020a056512344f00b004fb92a9cbe8mr14592262lfr.18.1689199903547; Wed, 12 Jul 2023 15:11:43 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id q16-20020ac25290000000b004f62fdf61fdsm856193lfm.204.2023.07.12.15.11.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 15:11:43 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v4 04/11] drm/msm/dpu: drop separate dpu_core_perf_tune overrides Date: Thu, 13 Jul 2023 01:11:32 +0300 Message-Id: <20230712221139.313729-5-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> References: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The values in struct dpu_core_perf_tune are fixed per the core perf mode. Drop the 'tune' values and substitute them with known values when performing perf management. Note: min_bus_vote was not used at all, so it is just silently dropped. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 27 ++++++++----------- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 4 --- 2 files changed, 11 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 05d340aa18c5..f9f44cfcfbf2 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -291,10 +291,16 @@ void dpu_core_perf_crtc_release_bw(struct drm_crtc *crtc) static u64 _dpu_core_perf_get_core_clk_rate(struct dpu_kms *kms) { - u64 clk_rate = kms->perf.perf_tune.min_core_clk; + u64 clk_rate; struct drm_crtc *crtc; struct dpu_crtc_state *dpu_cstate; + if (kms->perf.perf_tune.mode == DPU_PERF_MODE_FIXED) + return kms->perf.fix_core_clk_rate; + + if (kms->perf.perf_tune.mode == DPU_PERF_MODE_MINIMUM) + return kms->perf.max_core_clk_rate; + drm_for_each_crtc(crtc, kms->dev) { if (crtc->enabled) { dpu_cstate = to_dpu_crtc_state(crtc->state); @@ -305,11 +311,6 @@ static u64 _dpu_core_perf_get_core_clk_rate(struct dpu_kms *kms) } } - if (kms->perf.perf_tune.mode == DPU_PERF_MODE_FIXED) - clk_rate = kms->perf.fix_core_clk_rate; - - DRM_DEBUG_ATOMIC("clk:%llu\n", clk_rate); - return clk_rate; } @@ -397,6 +398,8 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, if (update_clk) { clk_rate = _dpu_core_perf_get_core_clk_rate(kms); + DRM_DEBUG_ATOMIC("clk:%llu\n", clk_rate); + trace_dpu_core_perf_update_clk(kms->dev, stop_req, clk_rate); clk_rate = min(clk_rate, kms->perf.max_core_clk_rate); @@ -418,7 +421,6 @@ static ssize_t _dpu_core_perf_mode_write(struct file *file, const char __user *user_buf, size_t count, loff_t *ppos) { struct dpu_core_perf *perf = file->private_data; - const struct dpu_perf_cfg *cfg = perf->catalog->perf; u32 perf_mode = 0; int ret; @@ -433,14 +435,9 @@ static ssize_t _dpu_core_perf_mode_write(struct file *file, DRM_INFO("fix performance mode\n"); } else if (perf_mode == DPU_PERF_MODE_MINIMUM) { /* run the driver with max clk and BW vote */ - perf->perf_tune.min_core_clk = perf->max_core_clk_rate; - perf->perf_tune.min_bus_vote = - (u64) cfg->max_bw_high * 1000; DRM_INFO("minimum performance mode\n"); } else if (perf_mode == DPU_PERF_MODE_NORMAL) { /* reset the perf tune params to 0 */ - perf->perf_tune.min_core_clk = 0; - perf->perf_tune.min_bus_vote = 0; DRM_INFO("normal performance mode\n"); } perf->perf_tune.mode = perf_mode; @@ -456,10 +453,8 @@ static ssize_t _dpu_core_perf_mode_read(struct file *file, char buf[128]; len = scnprintf(buf, sizeof(buf), - "mode %d min_mdp_clk %llu min_bus_vote %llu\n", - perf->perf_tune.mode, - perf->perf_tune.min_core_clk, - perf->perf_tune.min_bus_vote); + "mode %d\n", + perf->perf_tune.mode); return simple_read_from_buffer(buff, count, ppos, buf, len); } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h index 29bb8ee2bc26..c965dfbc3007 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h @@ -29,13 +29,9 @@ struct dpu_core_perf_params { /** * struct dpu_core_perf_tune - definition of performance tuning control * @mode: performance mode - * @min_core_clk: minimum core clock - * @min_bus_vote: minimum bus vote */ struct dpu_core_perf_tune { u32 mode; - u64 min_core_clk; - u64 min_bus_vote; }; /** From patchwork Wed Jul 12 22:11:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 702867 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AC33AC001B0 for ; Wed, 12 Jul 2023 22:11:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232392AbjGLWLt (ORCPT ); Wed, 12 Jul 2023 18:11:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232382AbjGLWLs (ORCPT ); Wed, 12 Jul 2023 18:11:48 -0400 Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FEE41FEE for ; Wed, 12 Jul 2023 15:11:46 -0700 (PDT) Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2b701e41cd3so124748471fa.3 for ; Wed, 12 Jul 2023 15:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689199904; x=1689804704; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M10VgP9//AsaJyB3rDz2tLQzN4SdFxlisowXmDtHg2k=; b=rVuupT85qWdSAbnUF3rDBecpUJzSwFPoZDWDdmyJ7XQ4KRb9vuiiOQU2WseFdV6glE Yv6SiAOeoW9Dyn88J3dbXayLGmVwVMRWi/zQVYMuScrI8+S3bM5RiFhRuskt2wEaiens 0g8Y52AoIQzeG5vz01diRLIkSKdfqMG3xy6AHC9COGSq+WGU2+KARqu6EG0RFt5T7+LO fgjO1tyzS/N7jocbp7S5W+S9+4EV14YxMrb3uGGTbACky6EcdCvS5ANKk0skxpd/wiFR 7MBpiSeBiztIz/egBUcWqj9Aw2a5BSO1e/SWCAU2Ggnf6M4jlMMXSpExC976Y4lBu4Nr dBIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689199904; x=1689804704; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M10VgP9//AsaJyB3rDz2tLQzN4SdFxlisowXmDtHg2k=; b=Y/3e4JbFEAuT11vrXBF/tHCDpZuJP63No9MdarVw5XTmNYkWrKpNiFoyoy+LJ+kNTA xJBB4Lnbarcs1WPXYjeLOsxcuCAamXYZRuy0eJfb/BsfBls5TsrDR22pmeTcaGzR3pNj gb7IStxOGDuaENTU4Ipwwk2ddbuFsHSGBmGIk1Z1mQwhN5IyQtpFs/IIrRd4ftFEqjov IJplB1OEZLn6fxAfzs8HEgZcaKBd+gzw4CAvkFRvb6CXU1A6YxS3ADASJtspdGhIjMnz ILv2j5bJ6+CweVMdcpE8bNMrYleAbGKNVIH45CgOcYJ/C8i7Ctsr9gAns2XKqORxUey/ vOpw== X-Gm-Message-State: ABy/qLb0NfYrKRwEG8nbIiwfTogpFkFXR4k4kDUSGk91F7TliDSMC+k3 YqOeSiYsUJIKIpQfFz6WTr7wdw== X-Google-Smtp-Source: APBJJlGQNS1YTzCBpsZUchsi6L/GVRPzj9zzQdd8jYukqlbz5CtMlEj14dRIljkdXqQ+0+paMHFqfQ== X-Received: by 2002:a05:6512:3b3:b0:4f9:571d:c50e with SMTP id v19-20020a05651203b300b004f9571dc50emr15810889lfp.36.1689199904391; Wed, 12 Jul 2023 15:11:44 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id q16-20020ac25290000000b004f62fdf61fdsm856193lfm.204.2023.07.12.15.11.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 15:11:43 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Konrad Dybcio Subject: [PATCH v4 05/11] drm/msm/dpu: rework indentation in dpu_core_perf Date: Thu, 13 Jul 2023 01:11:33 +0300 Message-Id: <20230712221139.313729-6-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> References: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org dpu_core_perf.c contains several multi-line conditions which are hard to comprehent because of the indentation. Rework the identation of these conditions to make it easier to understand them. Reviewed-by: Abhinav Kumar Acked-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 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 f9f44cfcfbf2..841e1fc0c6a7 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -173,8 +173,8 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc, drm_for_each_crtc(tmp_crtc, crtc->dev) { if (tmp_crtc->enabled && - (dpu_crtc_get_client_type(tmp_crtc) == - curr_client_type) && (tmp_crtc != crtc)) { + dpu_crtc_get_client_type(tmp_crtc) == curr_client_type && + tmp_crtc != crtc) { struct dpu_crtc_state *tmp_cstate = to_dpu_crtc_state(tmp_crtc->state); @@ -365,10 +365,8 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, update_bus = true; } - if ((params_changed && - (new->core_clk_rate > old->core_clk_rate)) || - (!params_changed && - (new->core_clk_rate < old->core_clk_rate))) { + if ((params_changed && new->core_clk_rate > old->core_clk_rate) || + (!params_changed && new->core_clk_rate < old->core_clk_rate)) { old->core_clk_rate = new->core_clk_rate; update_clk = true; } From patchwork Wed Jul 12 22:11:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 701912 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08D65EB64DA for ; Wed, 12 Jul 2023 22:11:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232382AbjGLWLw (ORCPT ); Wed, 12 Jul 2023 18:11:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232428AbjGLWLv (ORCPT ); Wed, 12 Jul 2023 18:11:51 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3BCA1FE9 for ; Wed, 12 Jul 2023 15:11:46 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4fb7b2e3dacso107670e87.0 for ; Wed, 12 Jul 2023 15:11:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689199905; x=1689804705; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=69k8fQ2msFBx8smoqv6Ghq5v6ba+yjgk59I3z2zgS4M=; b=y4YUMCUHBjoYrBK1UTx/RhzL/iwKpfcaGqiXEVHD0b+HW35gbKPPgvFZaSUF2SOcmN 8mv7xZ9SGEVSWnKCiv3yIn3EZdZSHJ1IrPzTDRwodGuqlwHxQDtnSnDqYZVJrg16/KvM j+sJEKwGfq59qXSwTd08HKY8o2VoZzeWZUCQbnxvkscI5M6FBqKPGaesLJkbocU8Nuz7 xoR4Rpd/Bw12nw5RGs7H+Fsmuf6LDcWFCM0Qc3fGX/yPIz9LW8rnkDOOALZ5jon3POXC N12XXEfi6fuHyBi/bm/GzlWox0EEgi3p/3VMVCtiqZHnpsY//908lWEXD9NFi3x9zHdP I64w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689199905; x=1689804705; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=69k8fQ2msFBx8smoqv6Ghq5v6ba+yjgk59I3z2zgS4M=; b=apeOrdX9rO1xgvydG9UTLpFtk1vjEi3hcVfvymaNAnnPGdfqdfWKhFvG3iRaS4wuKQ iRqvP53J5T1Y+53YgxJeKMX+TnJzBZ6Hhhi7n3xXoX0Lz7LDMERTu21GZi+ATsXMbfQ9 DTjWgIbKCjmr1gPEChMP/0R14CrOwY8j0ya8lcWC9uiCQEykvotpYndNUqFdycNShe6U JYrXFS+1dTwpp2PvNJ/z83Rm4ALVhqswEg4V7oU/8ZQm1j4fR/3IAq+nWNrfQeL1N7hP zR1qg/Ngl8BI+8nepjzOVhwYaW93RJVUBwaRjX5lplkeGAJ/32ijAdmKyfZsO4+mYFH9 43IA== X-Gm-Message-State: ABy/qLbTSrkknEHUXMi8GSmvWBKGeMP0sKuFlI9yqehIyxw64AlZ7Knr +3voySaHMsFc4Dj40ghebcKnNw== X-Google-Smtp-Source: APBJJlGaB0ZubOqqbSsGnIi/l9pAQ5hPfTNVdj72JV/lQ0f4NQC8L4F6Y1SpdZOEc4PcY12qEfyRig== X-Received: by 2002:a05:6512:159a:b0:4fb:8987:734e with SMTP id bp26-20020a056512159a00b004fb8987734emr20217446lfb.68.1689199905188; Wed, 12 Jul 2023 15:11:45 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id q16-20020ac25290000000b004f62fdf61fdsm856193lfm.204.2023.07.12.15.11.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 15:11:44 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v4 06/11] drm/msm/dpu: drop the dpu_core_perf_crtc_update()'s stop_req param Date: Thu, 13 Jul 2023 01:11:34 +0300 Message-Id: <20230712221139.313729-7-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> References: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The stop_req is true only in the dpu_crtc_disable() case, when crtc->enable has already been set to false. This renders the stop_req argument useless. Remove it completely. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 12 ++++++------ drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 3 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 6 +++--- 3 files changed, 10 insertions(+), 11 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 841e1fc0c6a7..3b3c2659297d 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -315,7 +315,7 @@ static u64 _dpu_core_perf_get_core_clk_rate(struct dpu_kms *kms) } int dpu_core_perf_crtc_update(struct drm_crtc *crtc, - int params_changed, bool stop_req) + int params_changed) { struct dpu_core_perf_params *new, *old; bool update_bus = false, update_clk = false; @@ -339,13 +339,13 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, dpu_crtc = to_dpu_crtc(crtc); dpu_cstate = to_dpu_crtc_state(crtc->state); - DRM_DEBUG_ATOMIC("crtc:%d stop_req:%d core_clk:%llu\n", - crtc->base.id, stop_req, kms->perf.core_clk_rate); + DRM_DEBUG_ATOMIC("crtc:%d enabled:%d core_clk:%llu\n", + crtc->base.id, crtc->enabled, kms->perf.core_clk_rate); old = &dpu_crtc->cur_perf; new = &dpu_cstate->new_perf; - if (crtc->enabled && !stop_req) { + if (crtc->enabled) { /* * cases for bus bandwidth update. * 1. new bandwidth vote - "ab or ib vote" is higher @@ -378,7 +378,7 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, } trace_dpu_perf_crtc_update(crtc->base.id, new->bw_ctl, - new->core_clk_rate, stop_req, update_bus, update_clk); + new->core_clk_rate, !crtc->enabled, update_bus, update_clk); if (update_bus) { ret = _dpu_core_perf_crtc_update_bus(kms, crtc); @@ -398,7 +398,7 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, DRM_DEBUG_ATOMIC("clk:%llu\n", clk_rate); - trace_dpu_core_perf_update_clk(kms->dev, stop_req, clk_rate); + trace_dpu_core_perf_update_clk(kms->dev, !crtc->enabled, clk_rate); clk_rate = min(clk_rate, kms->perf.max_core_clk_rate); ret = dev_pm_opp_set_rate(&kms->pdev->dev, clk_rate); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h index c965dfbc3007..c0097b67f9dd 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h @@ -75,11 +75,10 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc, * dpu_core_perf_crtc_update - update performance of the given crtc * @crtc: Pointer to crtc * @params_changed: true if crtc parameters are modified - * @stop_req: true if this is a stop request * return: zero if success, or error code otherwise */ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, - int params_changed, bool stop_req); + int params_changed); /** * dpu_core_perf_crtc_release_bw - release bandwidth of the given crtc diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 1edf2b6b0a26..8ce7586e2ddf 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -718,7 +718,7 @@ static void dpu_crtc_frame_event_cb(void *data, u32 event) void dpu_crtc_complete_commit(struct drm_crtc *crtc) { trace_dpu_crtc_complete_commit(DRMID(crtc)); - dpu_core_perf_crtc_update(crtc, 0, false); + dpu_core_perf_crtc_update(crtc, 0); _dpu_crtc_complete_flip(crtc); } @@ -884,7 +884,7 @@ static void dpu_crtc_atomic_flush(struct drm_crtc *crtc, return; /* update performance setting before crtc kickoff */ - dpu_core_perf_crtc_update(crtc, 1, false); + dpu_core_perf_crtc_update(crtc, 1); /* * Final plane updates: Give each plane a chance to complete all @@ -1100,7 +1100,7 @@ static void dpu_crtc_disable(struct drm_crtc *crtc, atomic_set(&dpu_crtc->frame_pending, 0); } - dpu_core_perf_crtc_update(crtc, 0, true); + dpu_core_perf_crtc_update(crtc, 0); drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) dpu_encoder_register_frame_event_callback(encoder, NULL, NULL); From patchwork Wed Jul 12 22:11:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 702866 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2BBBEC001B0 for ; Wed, 12 Jul 2023 22:11:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232383AbjGLWLy (ORCPT ); Wed, 12 Jul 2023 18:11:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232412AbjGLWLx (ORCPT ); Wed, 12 Jul 2023 18:11:53 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD9DDC0 for ; Wed, 12 Jul 2023 15:11:47 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4fbf1f6c771so93873e87.1 for ; Wed, 12 Jul 2023 15:11:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689199906; x=1689804706; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/xXiotgg0GEwf2bGvLMM/To/LRv6KFOudFNtkJYumEM=; b=nuLUm72slarHs/aLS7aizeWSnl4qA5KytxViS0f01nx41XHLtuPziuVbXIUIdYatLZ m6szK/Qm/qR6mbcvuCEHgvy9uGZOYqM9PNWHiu4tXueC8YO7Q+o4A3JH7DhnxtywQooG 8CT74g6UJLGKE2q3JW4kN5ekbjhfc6vp3/paRx/gtUpUwIo80kxMIddswAezE6/volCH 9iIs9X4eFk4gW9Cd/enp/iZgV0AkHPUd6018UXkyf/qgxlT3/mBgN5xk95q7e5RphFz5 yZkqsI3g7gvtcrp2VFL2CchSN2DriOdbOVMWFpon5XpShLtMC1xoZnxpMOc2748m6bBP iTqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689199906; x=1689804706; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/xXiotgg0GEwf2bGvLMM/To/LRv6KFOudFNtkJYumEM=; b=QNt71C6plc0UOQIpqPdV6TgREmgTY9bRgqLf8UQmi07WVaWuYhQ/ASeScCK2Y0t698 r7zlJVdhp2r02P64EAy8kbH5Vlu8YKWeaUk28nKZ2pQiDXOLf5d1tDenYtlMK6d8rRjt 281cuHr1aht1SAn15pP0di+XHmph/yiiM8ybH8gM8gBQFPofOcTRWFfyHZhqWubq+jCZ iBLssWczQfsdA/OYdgdHJWW9l0pj1+osI+ONqtwml54KsywrpJ7vSWmhyLklkMepJk93 IuiZwwvJf9QjFXK8vrLkwk3Z8M0EKkL1rP7fmf6RZBT9I50knosPzY+i2TSLLJwzB+cY Beag== X-Gm-Message-State: ABy/qLZBJ0p4agGEm6z4n40bU4BjgJ7a98YoQwFm/y4OtiMDqsQqWlkZ +93UcX6Z3f5lFqkGNELLGxkJt5v5IOZJ2EdImXU= X-Google-Smtp-Source: APBJJlH9z4m+l3rXPw6OAbrnWXrV255A64S8yAtmrCqRstmlR28v442StbZ9//nPsMETCmaw6ngikA== X-Received: by 2002:a05:6512:39c3:b0:4fb:896d:bd70 with SMTP id k3-20020a05651239c300b004fb896dbd70mr19543018lfu.46.1689199905994; Wed, 12 Jul 2023 15:11:45 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id q16-20020ac25290000000b004f62fdf61fdsm856193lfm.204.2023.07.12.15.11.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 15:11:45 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Konrad Dybcio Subject: [PATCH v4 07/11] drm/msm/dpu: use dpu_perf_cfg in DPU core_perf code Date: Thu, 13 Jul 2023 01:11:35 +0300 Message-Id: <20230712221139.313729-8-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> References: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Simplify dpu_core_perf code by using only dpu_perf_cfg instead of using full-featured catalog data. Acked-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 73 ++++++++----------- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 8 +- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 +- 3 files changed, 35 insertions(+), 48 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 3b3c2659297d..27a0312bd140 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -33,11 +33,11 @@ enum dpu_perf_mode { /** * _dpu_core_perf_calc_bw() - to calculate BW per crtc - * @kms: pointer to the dpu_kms + * @perf_cfg: performance configuration * @crtc: pointer to a crtc * Return: returns aggregated BW for all planes in crtc. */ -static u64 _dpu_core_perf_calc_bw(struct dpu_kms *kms, +static u64 _dpu_core_perf_calc_bw(const struct dpu_perf_cfg *perf_cfg, struct drm_crtc *crtc) { struct drm_plane *plane; @@ -53,7 +53,7 @@ static u64 _dpu_core_perf_calc_bw(struct dpu_kms *kms, crtc_plane_bw += pstate->plane_fetch_bw; } - bw_factor = kms->catalog->perf->bw_inefficiency_factor; + bw_factor = perf_cfg->bw_inefficiency_factor; if (bw_factor) { crtc_plane_bw *= bw_factor; do_div(crtc_plane_bw, 100); @@ -64,12 +64,12 @@ static u64 _dpu_core_perf_calc_bw(struct dpu_kms *kms, /** * _dpu_core_perf_calc_clk() - to calculate clock per crtc - * @kms: pointer to the dpu_kms + * @perf_cfg: performance configuration * @crtc: pointer to a crtc * @state: pointer to a crtc state * Return: returns max clk for all planes in crtc. */ -static u64 _dpu_core_perf_calc_clk(struct dpu_kms *kms, +static u64 _dpu_core_perf_calc_clk(const struct dpu_perf_cfg *perf_cfg, struct drm_crtc *crtc, struct drm_crtc_state *state) { struct drm_plane *plane; @@ -90,7 +90,7 @@ static u64 _dpu_core_perf_calc_clk(struct dpu_kms *kms, crtc_clk = max(pstate->plane_clk, crtc_clk); } - clk_factor = kms->catalog->perf->clk_inefficiency_factor; + clk_factor = perf_cfg->clk_inefficiency_factor; if (clk_factor) { crtc_clk *= clk_factor; do_div(crtc_clk, 100); @@ -106,30 +106,32 @@ static struct dpu_kms *_dpu_crtc_get_kms(struct drm_crtc *crtc) return to_dpu_kms(priv->kms); } -static void _dpu_core_perf_calc_crtc(struct dpu_kms *kms, - struct drm_crtc *crtc, - struct drm_crtc_state *state, - struct dpu_core_perf_params *perf) +static void _dpu_core_perf_calc_crtc(const struct dpu_core_perf *core_perf, + struct drm_crtc *crtc, + struct drm_crtc_state *state, + struct dpu_core_perf_params *perf) { - if (!kms || !kms->catalog || !crtc || !state || !perf) { + const struct dpu_perf_cfg *perf_cfg = core_perf->perf_cfg; + + if (!perf_cfg || !crtc || !state || !perf) { DPU_ERROR("invalid parameters\n"); return; } memset(perf, 0, sizeof(struct dpu_core_perf_params)); - if (kms->perf.perf_tune.mode == DPU_PERF_MODE_MINIMUM) { + if (core_perf->perf_tune.mode == DPU_PERF_MODE_MINIMUM) { perf->bw_ctl = 0; perf->max_per_pipe_ib = 0; perf->core_clk_rate = 0; - } else if (kms->perf.perf_tune.mode == DPU_PERF_MODE_FIXED) { - perf->bw_ctl = kms->perf.fix_core_ab_vote; - perf->max_per_pipe_ib = kms->perf.fix_core_ib_vote; - perf->core_clk_rate = kms->perf.fix_core_clk_rate; + } else if (core_perf->perf_tune.mode == DPU_PERF_MODE_FIXED) { + perf->bw_ctl = core_perf->fix_core_ab_vote; + perf->max_per_pipe_ib = core_perf->fix_core_ib_vote; + perf->core_clk_rate = core_perf->fix_core_clk_rate; } else { - perf->bw_ctl = _dpu_core_perf_calc_bw(kms, crtc); - perf->max_per_pipe_ib = kms->catalog->perf->min_dram_ib; - perf->core_clk_rate = _dpu_core_perf_calc_clk(kms, crtc, state); + perf->bw_ctl = _dpu_core_perf_calc_bw(perf_cfg, crtc); + perf->max_per_pipe_ib = perf_cfg->min_dram_ib; + perf->core_clk_rate = _dpu_core_perf_calc_clk(perf_cfg, crtc, state); } DRM_DEBUG_ATOMIC( @@ -154,10 +156,6 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc, } kms = _dpu_crtc_get_kms(crtc); - if (!kms->catalog) { - DPU_ERROR("invalid parameters\n"); - return 0; - } /* we only need bandwidth check on real-time clients (interfaces) */ if (dpu_crtc_get_client_type(crtc) == NRT_CLIENT) @@ -166,7 +164,7 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc, dpu_cstate = to_dpu_crtc_state(state); /* obtain new values */ - _dpu_core_perf_calc_crtc(kms, crtc, state, &dpu_cstate->new_perf); + _dpu_core_perf_calc_crtc(&kms->perf, crtc, state, &dpu_cstate->new_perf); bw_sum_of_intfs = dpu_cstate->new_perf.bw_ctl; curr_client_type = dpu_crtc_get_client_type(crtc); @@ -189,7 +187,7 @@ int dpu_core_perf_crtc_check(struct drm_crtc *crtc, bw = DIV_ROUND_UP_ULL(bw_sum_of_intfs, 1000); DRM_DEBUG_ATOMIC("calculated bandwidth=%uk\n", bw); - threshold = kms->catalog->perf->max_bw_high; + threshold = kms->perf.perf_cfg->max_bw_high; DRM_DEBUG_ATOMIC("final threshold bw limit = %d\n", threshold); @@ -270,11 +268,6 @@ void dpu_core_perf_crtc_release_bw(struct drm_crtc *crtc) } kms = _dpu_crtc_get_kms(crtc); - if (!kms->catalog) { - DPU_ERROR("invalid kms\n"); - return; - } - dpu_crtc = to_dpu_crtc(crtc); if (atomic_dec_return(&kms->bandwidth_ref) > 0) @@ -331,10 +324,6 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, } kms = _dpu_crtc_get_kms(crtc); - if (!kms->catalog) { - DPU_ERROR("invalid kms\n"); - return -EINVAL; - } dpu_crtc = to_dpu_crtc(crtc); dpu_cstate = to_dpu_crtc_state(crtc->state); @@ -466,7 +455,6 @@ static const struct file_operations dpu_core_perf_mode_fops = { int dpu_core_perf_debugfs_init(struct dpu_kms *dpu_kms, struct dentry *parent) { struct dpu_core_perf *perf = &dpu_kms->perf; - const struct dpu_mdss_cfg *catalog = perf->catalog; struct dentry *entry; entry = debugfs_create_dir("core_perf", parent); @@ -478,15 +466,15 @@ int dpu_core_perf_debugfs_init(struct dpu_kms *dpu_kms, struct dentry *parent) debugfs_create_u32("enable_bw_release", 0600, entry, (u32 *)&perf->enable_bw_release); debugfs_create_u32("threshold_low", 0600, entry, - (u32 *)&catalog->perf->max_bw_low); + (u32 *)&perf->perf_cfg->max_bw_low); debugfs_create_u32("threshold_high", 0600, entry, - (u32 *)&catalog->perf->max_bw_high); + (u32 *)&perf->perf_cfg->max_bw_high); debugfs_create_u32("min_core_ib", 0600, entry, - (u32 *)&catalog->perf->min_core_ib); + (u32 *)&perf->perf_cfg->min_core_ib); debugfs_create_u32("min_llcc_ib", 0600, entry, - (u32 *)&catalog->perf->min_llcc_ib); + (u32 *)&perf->perf_cfg->min_llcc_ib); debugfs_create_u32("min_dram_ib", 0600, entry, - (u32 *)&catalog->perf->min_dram_ib); + (u32 *)&perf->perf_cfg->min_dram_ib); debugfs_create_file("perf_mode", 0600, entry, (u32 *)perf, &dpu_core_perf_mode_fops); debugfs_create_u64("fix_core_clk_rate", 0600, entry, @@ -509,17 +497,16 @@ void dpu_core_perf_destroy(struct dpu_core_perf *perf) perf->max_core_clk_rate = 0; perf->core_clk = NULL; - perf->catalog = NULL; perf->dev = NULL; } int dpu_core_perf_init(struct dpu_core_perf *perf, struct drm_device *dev, - const struct dpu_mdss_cfg *catalog, + const struct dpu_perf_cfg *perf_cfg, struct clk *core_clk) { perf->dev = dev; - perf->catalog = catalog; + perf->perf_cfg = perf_cfg; perf->core_clk = core_clk; perf->max_core_clk_rate = clk_get_rate(core_clk); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h index c0097b67f9dd..f4b84e67138c 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h @@ -38,7 +38,7 @@ struct dpu_core_perf_tune { * struct dpu_core_perf - definition of core performance context * @dev: Pointer to drm device * @debugfs_root: top level debug folder - * @catalog: Pointer to catalog configuration + * @perf_cfg: Platform-specific performance configuration * @core_clk: Pointer to the core clock * @core_clk_rate: current core clock rate * @max_core_clk_rate: maximum allowable core clock rate @@ -51,7 +51,7 @@ struct dpu_core_perf_tune { struct dpu_core_perf { struct drm_device *dev; struct dentry *debugfs_root; - const struct dpu_mdss_cfg *catalog; + const struct dpu_perf_cfg *perf_cfg; struct clk *core_clk; u64 core_clk_rate; u64 max_core_clk_rate; @@ -96,12 +96,12 @@ void dpu_core_perf_destroy(struct dpu_core_perf *perf); * dpu_core_perf_init - initialize the given core performance context * @perf: Pointer to core performance context * @dev: Pointer to drm device - * @catalog: Pointer to catalog + * @perf_cfg: Pointer to platform performance configuration * @core_clk: pointer to core clock */ int dpu_core_perf_init(struct dpu_core_perf *perf, struct drm_device *dev, - const struct dpu_mdss_cfg *catalog, + const struct dpu_perf_cfg *perf_cfg, struct clk *core_clk); struct dpu_kms; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index c1d06e19b237..074c032cd24e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -1156,7 +1156,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms) dpu_kms->hw_vbif[vbif->id] = hw; } - rc = dpu_core_perf_init(&dpu_kms->perf, dev, dpu_kms->catalog, + rc = dpu_core_perf_init(&dpu_kms->perf, dev, dpu_kms->catalog->perf, msm_clk_bulk_get_clock(dpu_kms->clocks, dpu_kms->num_clocks, "core")); if (rc) { DPU_ERROR("failed to init perf %d\n", rc); From patchwork Wed Jul 12 22:11:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 702865 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6FC08EB64DA for ; Wed, 12 Jul 2023 22:11:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232422AbjGLWLz (ORCPT ); Wed, 12 Jul 2023 18:11:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60372 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232428AbjGLWLy (ORCPT ); Wed, 12 Jul 2023 18:11:54 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B728E1FE1 for ; Wed, 12 Jul 2023 15:11:48 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4fb761efa7aso105984e87.0 for ; Wed, 12 Jul 2023 15:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689199907; x=1689804707; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=oEVSbE1/ce06xrGzvQ/IXrEdLz2Ykt/bguR+64ZLVSg=; b=Xc+qMmKEncGdAxd3ZS8oNpmWu9cSED0Dofo6zdEPGszPXndlFsYJ+YFPLwaCVbx+0w nP6yQ0E18ICbkK+iYdkQb2EwHRrYo9NpPLPukU+ZBLAlTak3j9Frp1dshPEwY31D5yeH vfGqJSd0jH1DS/4JAK/wbH/g+Z23a5D6177VJCotiX96oY/UaRih/78TBFJuAsPpZAHT TmVLKC+tBRBMCiFKzH+yhz8pScFbPAw5TB2821tjcOGux4c1efQc0iXjuy39QlR5mTkL 6D+jFGzAQq2Jr8/X5f4HyJQiFod5DXUeZyLvB2FoODzjI6bh2HsqprmwcdY+jCZPIQVs N9dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689199907; x=1689804707; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oEVSbE1/ce06xrGzvQ/IXrEdLz2Ykt/bguR+64ZLVSg=; b=ECDIxpsUxchrMoaheUqQhgEOsAPKUfL4UudcwAjohBnwgFFvrrer5TPSy/GuToX+TB 9aRTd46LUbcpDKysM7ZBDVv+4F2uNvEjuiq/uBvjXZi+qMkhY+Oz37ldU8rR3fXtmWsA tYHyTTMMtU6HEyHPNE6HbWhTOxprNyjoxLW5MQHjR+n9HbGt8XTzaAPEH0gT904JKnHp Zm4XRng43Q9B3Iv1QnTnd0kePnaSqH3C58PH/wY2vDVdsMGSLbxvM2DW60DUn595AJbY pHenHGH3zCOugrbPUFVK2WeIzAqoX7vVQ9w25P+CMjBcDN0uf4Y9wGmAHyat7Y0H6JRg kwkA== X-Gm-Message-State: ABy/qLZVjdOYPg4xeDb++L4kJ0Nn7TmZg8aQvObEzCuGO56GjciFaUF1 EbFQBFOnTVRnYD5IVIrInAztfA== X-Google-Smtp-Source: APBJJlH2fxRPQvztM/SBnX9UCMBin6bn/eO/hso7htdhdIEtvBTybNNpfsE+ckKxDB7hI1U0ma239A== X-Received: by 2002:a05:6512:3b3:b0:4f9:571d:c50e with SMTP id v19-20020a05651203b300b004f9571dc50emr15810950lfp.36.1689199906917; Wed, 12 Jul 2023 15:11:46 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id q16-20020ac25290000000b004f62fdf61fdsm856193lfm.204.2023.07.12.15.11.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 15:11:46 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Konrad Dybcio Subject: [PATCH v4 08/11] drm/msm/dpu: remove unused fields from struct dpu_core_perf Date: Thu, 13 Jul 2023 01:11:36 +0300 Message-Id: <20230712221139.313729-9-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> References: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Remove dpu_core_perf::dev and dpu_core_perf::debugfs_root fields, they are not used by the code. Reviewed-by: Konrad Dybcio Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 3 --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 6 ------ drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 2 +- 3 files changed, 1 insertion(+), 10 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 27a0312bd140..d8c88ce5190d 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -497,15 +497,12 @@ void dpu_core_perf_destroy(struct dpu_core_perf *perf) perf->max_core_clk_rate = 0; perf->core_clk = NULL; - perf->dev = NULL; } int dpu_core_perf_init(struct dpu_core_perf *perf, - struct drm_device *dev, const struct dpu_perf_cfg *perf_cfg, struct clk *core_clk) { - perf->dev = dev; perf->perf_cfg = perf_cfg; perf->core_clk = core_clk; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h index f4b84e67138c..e718d523ff30 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h @@ -36,8 +36,6 @@ struct dpu_core_perf_tune { /** * struct dpu_core_perf - definition of core performance context - * @dev: Pointer to drm device - * @debugfs_root: top level debug folder * @perf_cfg: Platform-specific performance configuration * @core_clk: Pointer to the core clock * @core_clk_rate: current core clock rate @@ -49,8 +47,6 @@ struct dpu_core_perf_tune { * @fix_core_ab_vote: fixed core ab vote in bps used in mode 2 */ struct dpu_core_perf { - struct drm_device *dev; - struct dentry *debugfs_root; const struct dpu_perf_cfg *perf_cfg; struct clk *core_clk; u64 core_clk_rate; @@ -95,12 +91,10 @@ void dpu_core_perf_destroy(struct dpu_core_perf *perf); /** * dpu_core_perf_init - initialize the given core performance context * @perf: Pointer to core performance context - * @dev: Pointer to drm device * @perf_cfg: Pointer to platform performance configuration * @core_clk: pointer to core clock */ int dpu_core_perf_init(struct dpu_core_perf *perf, - struct drm_device *dev, const struct dpu_perf_cfg *perf_cfg, struct clk *core_clk); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 074c032cd24e..80e08302680c 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -1156,7 +1156,7 @@ static int dpu_kms_hw_init(struct msm_kms *kms) dpu_kms->hw_vbif[vbif->id] = hw; } - rc = dpu_core_perf_init(&dpu_kms->perf, dev, dpu_kms->catalog->perf, + rc = dpu_core_perf_init(&dpu_kms->perf, dpu_kms->catalog->perf, msm_clk_bulk_get_clock(dpu_kms->clocks, dpu_kms->num_clocks, "core")); if (rc) { DPU_ERROR("failed to init perf %d\n", rc); From patchwork Wed Jul 12 22:11:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 701911 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C92DC001DE for ; Wed, 12 Jul 2023 22:11:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232428AbjGLWL4 (ORCPT ); Wed, 12 Jul 2023 18:11:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232420AbjGLWLz (ORCPT ); Wed, 12 Jul 2023 18:11:55 -0400 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 999DF1FF5 for ; Wed, 12 Jul 2023 15:11:49 -0700 (PDT) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-4fb7769f15aso111548e87.0 for ; Wed, 12 Jul 2023 15:11:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689199907; x=1689804707; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FyJ8LHBlB4JYqr4VmTzP1Gcl6WI23AmqWBSQtKIAL6Q=; b=csxw0/68ovU2HjpA7dabaOzCJdarHffyEVOfxtcCJhdBle2lLR56vYO1FPdiieTUid G3r4VZtcdot3JDRsVPBswSFTMpG8p952hOFybG+Xu09u25/Dq3myAweEI3R7puOekePg EYBbq5ZMaKZgmeUOMT1ynlTKRDafotup9k97bAn3di3iXW+mHQywpC/o1m/ecIowWf1c ynG7r5z/2T3yTrrbvQlV3eGYeBQM6/okas+gWyTyvTxLIJqXXJHjo77Q9nL7T1Fl325+ wm1TLDPzwHiq5BRewnckkfM+6Ym8gYqiL1NEjQEK1ALv7ED7gZJHqVI7GDFwc4Fx6yy1 Y/nQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689199907; x=1689804707; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FyJ8LHBlB4JYqr4VmTzP1Gcl6WI23AmqWBSQtKIAL6Q=; b=EzC+vobbcbyh9HvZ3wahoDIM0TNO7NQC8Dcnvi3JQGkSh9XyyENVrm/mGANECaR3RK Nzxv+O2n/Q9k7azpyUMnMclCCWzSPTv5OZ1lLHRoA7HRyk0+pKaInjCZDoS/y/1nK8pT itMTza5fbJ2F9mvLJGNGpyhqHYgia01FUSv9uyc4KGzBFV/e1Um2iABgRAYfZwPl/IRm m+fwP+3yG4B3jMSA8vUG2pd52XoMS65OxdMWvabaj74DlokPrZA1c35fD3Qgbm3jlF01 p/BnCealnnxVojQSMCiSpkWwkb5cbxl39Wrrp71ru2QDzUSQPcsCmb1xTu+EHwi9VPR4 Rkew== X-Gm-Message-State: ABy/qLZj+PNwGfC02vxgzM6c2QM7n8TVeM09ahL+J+kUsa8AuH5Fkk4l InzyPZCzvk0wlSzXFVyVzvbojw== X-Google-Smtp-Source: APBJJlEwSUud4GbTUOnON+/BbQ5489WbbX8IXPFWNlylLCwZy3hnUzMjoQzgllSNanUeRq4pQwcXPQ== X-Received: by 2002:a19:7702:0:b0:4fb:8bea:f5f6 with SMTP id s2-20020a197702000000b004fb8beaf5f6mr14327418lfc.34.1689199907594; Wed, 12 Jul 2023 15:11:47 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id q16-20020ac25290000000b004f62fdf61fdsm856193lfm.204.2023.07.12.15.11.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 15:11:47 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v4 09/11] drm/msm/dpu: remove extra clk_round_rate() call Date: Thu, 13 Jul 2023 01:11:37 +0300 Message-Id: <20230712221139.313729-10-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> References: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The dev_pm_opp_set_rate() already contains a call for clk_round_rate for the passed value. Stop calling it manually from _dpu_core_perf_get_core_clk_rate(). It is slightly incorrect to call it this way, as we should round the final calculated clock rate rather than rounding all the intermediate values. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 2 -- 1 file changed, 2 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 d8c88ce5190d..896e87b13dbe 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -299,8 +299,6 @@ static u64 _dpu_core_perf_get_core_clk_rate(struct dpu_kms *kms) dpu_cstate = to_dpu_crtc_state(crtc->state); clk_rate = max(dpu_cstate->new_perf.core_clk_rate, clk_rate); - clk_rate = clk_round_rate(kms->perf.core_clk, - clk_rate); } } From patchwork Wed Jul 12 22:11:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 701910 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52997EB64DD for ; Wed, 12 Jul 2023 22:11:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232412AbjGLWL5 (ORCPT ); Wed, 12 Jul 2023 18:11:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232444AbjGLWLz (ORCPT ); Wed, 12 Jul 2023 18:11:55 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB3C51FF7 for ; Wed, 12 Jul 2023 15:11:49 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4fba74870abso106575e87.0 for ; Wed, 12 Jul 2023 15:11:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689199908; x=1689804708; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Sb/58smK4QA8GZRG0BTTatT01e0cBQtMbD8OLWYEOmE=; b=zL+/ogyRIlx43/gIAW13h0XusjJumIQXNfVkOzvZZ31ysIeZQhcif2QHg6Mbqqn5MO JXilO9/kmzuckGscySeM+06IcMzyHcJ28YMybj/f5+xBwdn1D9tLWf80X8/FVf0+PlWc bvUzq4TJVdLfmkdywMgnEKv2Kv+l8Mu4SHwi3aTxpVVBMYOgj7/8ijZD+Kqd0SLVUD59 IW0KHKSS8frCGvJUi9M7DlreQELn8+SJIl2Dfb96udScEu6HSJBrtN2Di9c0XQ3uy1Vo hWcfmNRIrkirwg1Vlp9oRGf6XQzw4T0ji4IXBLUHZtK68l9EBZTWQlS6hozd3kE2LpmV FnbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689199908; x=1689804708; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Sb/58smK4QA8GZRG0BTTatT01e0cBQtMbD8OLWYEOmE=; b=Cp9qi7Q5RoU4Us35RXA2jFRXqIhv66wDlxtoUyeAbRpa+AF3Vr0xlRRR4yrQ/Tg4o1 2gfucQYXklPevEo6yIOylgNBxqxTBMPp2yd91jFc6nrkckqcTMOReQWj6IZapIuPsY1Z lqNS4DZEpsUmWxN8qLizp4fkhYUbMEVvNK6FeeFAYdkpj14PoYTRMyokUb6YPP6Z5PmA CJkK2VfwtVzmxCZz1BvFUogswLWzR/ZM6C+P6H6TYV7WrxBJfr4dr0B46mKWkrL4MGKW gx/6QET88A8T6ZBEs+rbCv7T2Tueo/4n2NJAEFgHwV9+1pP7L0bq9IHqEvGH6P/Kby1A r8eA== X-Gm-Message-State: ABy/qLatxyMPHWE6WKlwwBQjtqtD1/ZLBdDJ/PkaS98ukgscWE267a2g /syq9JFU/Y4GgAg5EA7WP3tvoA== X-Google-Smtp-Source: APBJJlHg0t/wk9o6pn+nG3LVS+daQu6IglLbXVQS3gWW/jgkN98i2RrON4KUCkmg/raLiRjarfJUPw== X-Received: by 2002:a05:6512:311c:b0:4fb:7be5:4870 with SMTP id n28-20020a056512311c00b004fb7be54870mr15437202lfb.46.1689199908348; Wed, 12 Jul 2023 15:11:48 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id q16-20020ac25290000000b004f62fdf61fdsm856193lfm.204.2023.07.12.15.11.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 15:11:47 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v4 10/11] drm/msm/dpu: move max clock decision to dpu_kms. Date: Thu, 13 Jul 2023 01:11:38 +0300 Message-Id: <20230712221139.313729-11-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> References: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org dpu_core_perf should not make decisions on the maximum possible core clock rate. Pass the value from dpu_kms_hw_init(). Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 11 ++--------- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 8 ++------ drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 13 +++++++++++-- 3 files changed, 15 insertions(+), 17 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 896e87b13dbe..16a4d6c67f4d 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -494,21 +494,14 @@ void dpu_core_perf_destroy(struct dpu_core_perf *perf) } perf->max_core_clk_rate = 0; - perf->core_clk = NULL; } int dpu_core_perf_init(struct dpu_core_perf *perf, const struct dpu_perf_cfg *perf_cfg, - struct clk *core_clk) + unsigned long max_core_clk_rate) { perf->perf_cfg = perf_cfg; - perf->core_clk = core_clk; - - perf->max_core_clk_rate = clk_get_rate(core_clk); - if (!perf->max_core_clk_rate) { - DPU_DEBUG("optional max core clk rate, use default\n"); - perf->max_core_clk_rate = DPU_PERF_DEFAULT_MAX_CORE_CLK_RATE; - } + perf->max_core_clk_rate = max_core_clk_rate; return 0; } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h index e718d523ff30..8cc55752db5e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h @@ -12,8 +12,6 @@ #include "dpu_hw_catalog.h" -#define DPU_PERF_DEFAULT_MAX_CORE_CLK_RATE 412500000 - /** * struct dpu_core_perf_params - definition of performance parameters * @max_per_pipe_ib: maximum instantaneous bandwidth request @@ -37,7 +35,6 @@ struct dpu_core_perf_tune { /** * struct dpu_core_perf - definition of core performance context * @perf_cfg: Platform-specific performance configuration - * @core_clk: Pointer to the core clock * @core_clk_rate: current core clock rate * @max_core_clk_rate: maximum allowable core clock rate * @perf_tune: debug control for performance tuning @@ -48,7 +45,6 @@ struct dpu_core_perf_tune { */ struct dpu_core_perf { const struct dpu_perf_cfg *perf_cfg; - struct clk *core_clk; u64 core_clk_rate; u64 max_core_clk_rate; struct dpu_core_perf_tune perf_tune; @@ -92,11 +88,11 @@ void dpu_core_perf_destroy(struct dpu_core_perf *perf); * dpu_core_perf_init - initialize the given core performance context * @perf: Pointer to core performance context * @perf_cfg: Pointer to platform performance configuration - * @core_clk: pointer to core clock + * @max_core_clk_rate: Maximum core clock rate */ int dpu_core_perf_init(struct dpu_core_perf *perf, const struct dpu_perf_cfg *perf_cfg, - struct clk *core_clk); + unsigned long max_core_clk_rate); struct dpu_kms; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 80e08302680c..5bfea4868e43 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -1051,11 +1051,14 @@ unsigned long dpu_kms_get_clk_rate(struct dpu_kms *dpu_kms, char *clock_name) return clk_get_rate(clk); } +#define DPU_PERF_DEFAULT_MAX_CORE_CLK_RATE 412500000 + static int dpu_kms_hw_init(struct msm_kms *kms) { struct dpu_kms *dpu_kms; struct drm_device *dev; int i, rc = -EINVAL; + unsigned long max_core_clk_rate; u32 core_rev; if (!kms) { @@ -1156,8 +1159,14 @@ static int dpu_kms_hw_init(struct msm_kms *kms) dpu_kms->hw_vbif[vbif->id] = hw; } - rc = dpu_core_perf_init(&dpu_kms->perf, dpu_kms->catalog->perf, - msm_clk_bulk_get_clock(dpu_kms->clocks, dpu_kms->num_clocks, "core")); + /* TODO: use the same max_freq as in dpu_kms_hw_init */ + max_core_clk_rate = dpu_kms_get_clk_rate(dpu_kms, "core"); + if (!max_core_clk_rate) { + DPU_DEBUG("max core clk rate not determined, using default\n"); + max_core_clk_rate = DPU_PERF_DEFAULT_MAX_CORE_CLK_RATE; + } + + rc = dpu_core_perf_init(&dpu_kms->perf, dpu_kms->catalog->perf, max_core_clk_rate); if (rc) { DPU_ERROR("failed to init perf %d\n", rc); goto perf_err; From patchwork Wed Jul 12 22:11:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 702864 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AD18C001B0 for ; Wed, 12 Jul 2023 22:11:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232444AbjGLWL6 (ORCPT ); Wed, 12 Jul 2023 18:11:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232443AbjGLWL4 (ORCPT ); Wed, 12 Jul 2023 18:11:56 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C25A210C for ; Wed, 12 Jul 2023 15:11:50 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4fbaef9871cso112189e87.0 for ; Wed, 12 Jul 2023 15:11:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1689199909; x=1689804709; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gWwNSVsmh1bG+GHUN/mVATtu1UgwWBFt1a+c6iz+eLk=; b=aSC8OmNhmNYBmv27p0LBeT//vmWVquIGlNLAo9DVDuyMUpao3hRhtVbkxLwaIgYjIf 9aN/oFL5YGvo0ML548i7zQra6CVrmrnum5pOjjRsSmwtNNnQa7HlhPCqJd2yc9kI3UUP J7o61wgvilevHxjd+wd7HPUaSOVr/VXtmc523hiOo02VhOFoGTwaFX2phF/zxoQmJTZA t52oDhjY7fdXKoTx5IWX/cSx7iSnJc9axn2DlKN3dxp9OmQvCSkO5ttteZ8rC2ZYnBdc CzfYvbEhRAypUVi58iA9BkVyGLjO/Ortm/lbrqm6RrmfnNHZ/xM23QtKyoA3vBWPvLVq oTlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689199909; x=1689804709; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gWwNSVsmh1bG+GHUN/mVATtu1UgwWBFt1a+c6iz+eLk=; b=ZSHmTNCfA92MyuplPCxF3AFJOxHX7WOm6gSGx/5f2KqYeMpUNxdMWyKqYYFGHgexuA YvMz9lxwwLICVg7VoTdga21zA41JApr9V5EZRSYLnvPAOKUpqHai5F0F39Q4lyJFiAef 0h+RbuJWWdwypQqu7vOK1ujg8NUkcd9AcOpw6tPofKXjnj3H/tfgAZjvzv8Th9FknZ87 7YPB7idCctsB/CyP1epCJTeqBeXpXzxJT3bWDot4WwwzR7PcVg9Xljjn06Iwmn/heSqs ZRZXogIcZkBamSSQF70Mfr0tL5v5/cs9KWMX9Ls9gWK8iL7O4kGx2xyrjiVBIJMnsHd7 E6bg== X-Gm-Message-State: ABy/qLaM1tenSUB8Vuh6XriBp+jpSWp/N8uv8DF3KuwCr6BnOQP/ZDuS 3a73D+SHFV1EUhYi5BPV0XvE3g== X-Google-Smtp-Source: APBJJlGE6umXBMHF2GTMhqi3lKCFZW01eI3qr0kPway+oAWpXZmXrZFIpTBWl8K7REtfJgAIu1eD/w== X-Received: by 2002:a05:6512:34cf:b0:4f9:69af:9857 with SMTP id w15-20020a05651234cf00b004f969af9857mr15813885lfr.51.1689199909151; Wed, 12 Jul 2023 15:11:49 -0700 (PDT) Received: from umbar.unikie.fi ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id q16-20020ac25290000000b004f62fdf61fdsm856193lfm.204.2023.07.12.15.11.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jul 2023 15:11:48 -0700 (PDT) From: Dmitry Baryshkov To: Rob Clark , Sean Paul , Abhinav Kumar , Marijn Suijten Cc: Stephen Boyd , David Airlie , Daniel Vetter , Bjorn Andersson , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Konrad Dybcio Subject: [PATCH v4 11/11] drm/msm/dpu: drop dpu_core_perf_destroy() Date: Thu, 13 Jul 2023 01:11:39 +0300 Message-Id: <20230712221139.313729-12-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> References: <20230712221139.313729-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org This function does nothing, just clears one struct field. Drop it now. Acked-by: Konrad Dybcio Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c | 10 ---------- drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h | 6 ------ drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 1 - 3 files changed, 17 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 16a4d6c67f4d..31813a322afd 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.c @@ -486,16 +486,6 @@ int dpu_core_perf_debugfs_init(struct dpu_kms *dpu_kms, struct dentry *parent) } #endif -void dpu_core_perf_destroy(struct dpu_core_perf *perf) -{ - if (!perf) { - DPU_ERROR("invalid parameters\n"); - return; - } - - perf->max_core_clk_rate = 0; -} - int dpu_core_perf_init(struct dpu_core_perf *perf, const struct dpu_perf_cfg *perf_cfg, unsigned long max_core_clk_rate) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h index 8cc55752db5e..4186977390bd 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_core_perf.h @@ -78,12 +78,6 @@ int dpu_core_perf_crtc_update(struct drm_crtc *crtc, */ void dpu_core_perf_crtc_release_bw(struct drm_crtc *crtc); -/** - * dpu_core_perf_destroy - destroy the given core performance context - * @perf: Pointer to core performance context - */ -void dpu_core_perf_destroy(struct dpu_core_perf *perf); - /** * dpu_core_perf_init - initialize the given core performance context * @perf: Pointer to core performance context diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 5bfea4868e43..76ba86d3e436 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -1212,7 +1212,6 @@ static int dpu_kms_hw_init(struct msm_kms *kms) return 0; drm_obj_init_err: - dpu_core_perf_destroy(&dpu_kms->perf); hw_intr_init_err: perf_err: power_error: