From patchwork Wed Jun 28 20:35:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 114046 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9196463vqr; Wed, 28 Jun 2023 13:41:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4goZuX/k6Bbw7hyLbx8sXcIsSvP9Al47j9s/ZtREUJVVmYTRe5LfytmS5ZNnJW9sxI5oBm X-Received: by 2002:a05:6a00:1d18:b0:668:70af:b5c1 with SMTP id a24-20020a056a001d1800b0066870afb5c1mr1050514pfx.1.1687984892323; Wed, 28 Jun 2023 13:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687984892; cv=none; d=google.com; s=arc-20160816; b=ZYawJizXgqISjtmUne4OLN++V0kUxd5frfRm+tfmqdQMhswhPchEVd+7BBCSE9MMga qHCpVDYSrC6BKcAbojDuvHY2E4qusS24LCr1LOkGNlqPy1X7EZ/2HVsolPzqmWb3iTAu xnK/b4jTGYOya0miMTlwu2986NVWO725libe3aWAFnt7+YwTOsoYwvZCJQQaWoTCM17Q 2ZSsAlS/9t9QX+/SMXoqm62WAl+CDYlVogQrhgp+zUIDjB35FMG5yw3cYH/Y5HWjXyPI OmAUBU0XPf2x5Irk3zOjIojy01BsUse61bJlIEVxU91cHeEljdackhD7o+ZEgYDnYg8e 2IFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=sX61xLzrSqpunz5ev7NdqhGboO2e1ygKVlT8rjAfgIw=; fh=y5CufWdCvRG/D46wPUQAs6a5TaO9Xg7IL+UXm/FDyGE=; b=JMLYrwyeV4xqDiDE75/+PsPgvx4wf07Lx55N6PTzNDTeQ8En5N+TQ2uPUwWd6TXr82 1yLGtImVw8xhtBtd5o5IAKlG+4OsUk2T0ALX9BPDG2Ajd0R1ws+UZxQ38OuISyeiBYUm 3cqfLIphB5PyGTUdRFv6Rs8NERZ9v//8pjV9N0rqjsyO45nHv/F0S2n1XnPgv9rOMjYB EB5iv+ip/tP+1EgWfR7BQgzoYionl5VMSZmoZ9rnhERnxbS+g8/4zA0u4EoTm6CmOpdh GfDBhmMGWnvw2Eu+j6d9pQkV8SG1pFPlWRmrbHpUl5eCmebCKHa0B/BecJ9V0bnVkRZ1 UJnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CKlYnjbh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a631d09000000b005576ebe8047si9311228pgd.322.2023.06.28.13.41.18; Wed, 28 Jun 2023 13:41:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CKlYnjbh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232169AbjF1UgC (ORCPT + 99 others); Wed, 28 Jun 2023 16:36:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232039AbjF1Ufi (ORCPT ); Wed, 28 Jun 2023 16:35:38 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 065912713 for ; Wed, 28 Jun 2023 13:35:35 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-4f957a45b10so118372e87.0 for ; Wed, 28 Jun 2023 13:35:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687984534; x=1690576534; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=sX61xLzrSqpunz5ev7NdqhGboO2e1ygKVlT8rjAfgIw=; b=CKlYnjbhvmTX5qxXcW486aoyEsOIGjb6TgKAKUMd4xm9mgYeCF3Isk8/IbA364cL9z 2eF54eO3/ge5Ua/6l3tHvGFnwZDP3BsVlihmENcF5HCI6SAbImPBQ2K/NxNNefSGydz0 eig1dL2XxLXGcWsHZLuLJbViXuiueTsnsbbNswb1Bcfj/yKtMJ9mxkq4TiOGlE6UTaZ0 5X3WOOm5U4U4RGE0+gYxzrlWDXpjx/tAkTHb3tgbG8jkOMHIrAZYMt6q0qGrTN+3RuMF 9HuIL9KVnzpD05afFiOTPM+cGPl6iCScOamGlqZtVe8GaGR04E7AUGF8H9GPWe06Gq4W QyXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687984534; x=1690576534; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sX61xLzrSqpunz5ev7NdqhGboO2e1ygKVlT8rjAfgIw=; b=YS0tsDSORr0vnSaiUQIBQ2tf045vfE0oUqt+n8eNpqq0kS3HwBi5Te/A5F1RqqH7fq lMvP6Mu6V6ZpFFnU40eyjSZmA1OJuY36ctNdvqok9irEgKm/jcmHEPUNtVzCk63fro+i nDUNmcqaUfK7WvsccmwRneRPqTlytn8tUgb+x4cBgd67XeGPw3fDSzacSJmtWDAWEo5c f1VEpdRCKWPIxY9ogdWNOlR0o+kJlmt/YVTiDIQlorzBdFN5j9luXjrTS3yoaGJqMDeN 6ZRW7nSbmImT9+TUURlIlPMnIn2Ob3BCd/m8nG5mDOSFKbVVxMFeyMVaYX/0WtyVuug1 S+3g== X-Gm-Message-State: AC+VfDy/HJbNPFkqTnyoEVt31TBqfeD3y1+6Qd9pWAOzxLxc7YWnfeKf d0yDVfFrXMYb7XsModtCtHRjCg== X-Received: by 2002:a05:6512:3f1d:b0:4fa:ce08:a9d0 with SMTP id y29-20020a0565123f1d00b004face08a9d0mr8697767lfa.57.1687984534316; Wed, 28 Jun 2023 13:35:34 -0700 (PDT) Received: from [192.168.1.101] (abyk82.neoplus.adsl.tpnet.pl. [83.9.30.82]) by smtp.gmail.com with ESMTPSA id m25-20020a056512015900b004fb86c89fa1sm753363lfo.135.2023.06.28.13.35.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 13:35:34 -0700 (PDT) From: Konrad Dybcio Date: Wed, 28 Jun 2023 22:35:06 +0200 Subject: [PATCH 06/14] drm/msm/a6xx: Move LLC accessors to the common header MIME-Version: 1.0 Message-Id: <20230628-topic-a7xx_drmmsm-v1-6-a7f4496e0c12@linaro.org> References: <20230628-topic-a7xx_drmmsm-v1-0-a7f4496e0c12@linaro.org> In-Reply-To: <20230628-topic-a7xx_drmmsm-v1-0-a7f4496e0c12@linaro.org> To: Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Marijn Suijten , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Konrad Dybcio X-Mailer: b4 0.12.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1687984524; l=2053; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=3i7Z22FP2QVKu6xop0YI/VspQ/V2L4DBdczgpDJONsc=; b=r4Q1pP42KzKhFjKsyVrb/P+HQX12W0EiaS/EiByIjNmqcHcX7aVTaUVQS+18tL0ZQKrQvVoWY uruPmivoCPwBWUKURF/S4An4Dnrod1wUsjYRXHU00JAzDBsnv3jqobc X-Developer-Key: i=konrad.dybcio@linaro.org; a=ed25519; pk=iclgkYvtl2w05SSXO5EjjSYlhFKsJ+5OSZBjOkQuEms= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769980446107533374?= X-GMAIL-MSGID: =?utf-8?q?1769980446107533374?= Move these wrappers in preparation for use in a6xx_gmu.c Signed-off-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 15 --------------- drivers/gpu/drm/msm/adreno/a6xx_gpu.h | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index a70e36178058..c1c76fe288b2 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1735,21 +1735,6 @@ static irqreturn_t a6xx_irq(struct msm_gpu *gpu) return IRQ_HANDLED; } -static void a6xx_llc_rmw(struct a6xx_gpu *a6xx_gpu, u32 reg, u32 mask, u32 or) -{ - return msm_rmw(a6xx_gpu->llc_mmio + (reg << 2), mask, or); -} - -static u32 a6xx_llc_read(struct a6xx_gpu *a6xx_gpu, u32 reg) -{ - return msm_readl(a6xx_gpu->llc_mmio + (reg << 2)); -} - -static void a6xx_llc_write(struct a6xx_gpu *a6xx_gpu, u32 reg, u32 value) -{ - msm_writel(value, a6xx_gpu->llc_mmio + (reg << 2)); -} - static void a6xx_llc_deactivate(struct a6xx_gpu *a6xx_gpu) { llcc_slice_deactivate(a6xx_gpu->llc_slice); diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h b/drivers/gpu/drm/msm/adreno/a6xx_gpu.h index c788b06e72da..39d1f1f5a6d1 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.h +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.h @@ -62,6 +62,21 @@ static inline bool a6xx_has_gbif(struct adreno_gpu *gpu) return true; } +static inline void a6xx_llc_rmw(struct a6xx_gpu *a6xx_gpu, u32 reg, u32 mask, u32 or) +{ + return msm_rmw(a6xx_gpu->llc_mmio + (reg << 2), mask, or); +} + +static inline u32 a6xx_llc_read(struct a6xx_gpu *a6xx_gpu, u32 reg) +{ + return msm_readl(a6xx_gpu->llc_mmio + (reg << 2)); +} + +static inline void a6xx_llc_write(struct a6xx_gpu *a6xx_gpu, u32 reg, u32 value) +{ + msm_writel(value, a6xx_gpu->llc_mmio + (reg << 2)); +} + #define shadowptr(_a6xx_gpu, _ring) ((_a6xx_gpu)->shadow_iova + \ ((_ring)->id * sizeof(uint32_t)))