From patchwork Wed Apr 21 05:28:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Boichat X-Patchwork-Id: 12215451 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 849D2C433B4 for ; Wed, 21 Apr 2021 05:29:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3277861419 for ; Wed, 21 Apr 2021 05:29:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3277861419 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 382ED6E945; Wed, 21 Apr 2021 05:29:06 +0000 (UTC) Received: from mail-pf1-x432.google.com (mail-pf1-x432.google.com [IPv6:2607:f8b0:4864:20::432]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6BCB86E945 for ; Wed, 21 Apr 2021 05:29:05 +0000 (UTC) Received: by mail-pf1-x432.google.com with SMTP id c3so8815496pfo.3 for ; Tue, 20 Apr 2021 22:29:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kxnhLi78DPDSYFjxJIM+qzcCyplsSYCFm1pDPKchpRM=; b=hmTmxKk7RkXuD+YrXgXMT7YbIC9neJ63/n1UtLtvvY3ocKbGWYT7FRURBUJSutrmJW qxVfRy5vX/W6NqaKXQNqwkiwlb7RR0HTYRciruFEEb8N2oQPOaTQsSbNON3gBZ2l/Bdi FZqMALQbvzzM42Np2JYnVdxQGwEWEkli7Uq6Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kxnhLi78DPDSYFjxJIM+qzcCyplsSYCFm1pDPKchpRM=; b=BjFUWVbbIaqeX1hBS2DeYjjfPAUGmRhlkXMGwwFDB6MJhVtH2pyahyKRU4DhWnDruR GnHGeJgywVaFfiZHaj4SBxZBcgYwQdlF5/X1QpiSbecSTZAk9pav58xdnG3ymXo5Vvwb uIPYcwMQgV6QjbF+1FdF544o/ciOXbIWGAivzv3WG4cb0CC5yPZM55i4JviiFXuoKDwv G3MhOnxPGNjvlTXrGcMpRzjZi8TxITTidanBnRF9TVsEEcEreclTcMWaNT41aXECni7c wokNQ/vS9q0usp6lESsERi9XuuCgn9rJMlVVWd5opxwIgMrnoqw8YU0/8t4q2I7aoVpE 7MHg== X-Gm-Message-State: AOAM530HHzGqZvJWjOV6j+MtSItB8y9E6voKVzTrWZhOSpth2fw/xbuD mXUi0o7PGfxVIwmRHlIO23fevg== X-Google-Smtp-Source: ABdhPJyhb2uM0S9Pz4wG6iMzL3FZiBTC1btTNtARSLk++FAK0bWUnZI684adzhBP8AOcY3vu81YTNg== X-Received: by 2002:a62:aa09:0:b029:25c:3c28:e2b with SMTP id e9-20020a62aa090000b029025c3c280e2bmr18791955pff.39.1618982945075; Tue, 20 Apr 2021 22:29:05 -0700 (PDT) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:b3e5:49c0:4843:2bbe]) by smtp.gmail.com with ESMTPSA id b6sm602537pfa.185.2021.04.20.22.29.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 22:29:04 -0700 (PDT) From: Nicolas Boichat To: Rob Herring , Steven Price , Alyssa Rosenzweig Subject: [PATCH v13 1/4] dt-bindings: gpu: mali-bifrost: Add Mediatek MT8183 Date: Wed, 21 Apr 2021 13:28:52 +0800 Message-Id: <20210421132841.v13.1.Ie74d3355761aab202d4825ac6f66d990bba0130e@changeid> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog In-Reply-To: <20210421052855.1279713-1-drinkcat@chromium.org> References: <20210421052855.1279713-1-drinkcat@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Nicolas Boichat , Tomeu Vizoso , Neil Armstrong , David Airlie , fshao@chromium.org, linux-kernel@vger.kernel.org, Rob Herring , boris.brezillon@collabora.com, linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, hsinyi@chromium.org, Matthias Brugger , hoegsberg@chromium.org, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Define a compatible string for the Mali Bifrost GPU found in Mediatek's MT8183 SoCs. Signed-off-by: Nicolas Boichat Reviewed-by: Rob Herring --- (no changes since v12) Changes in v12: - binding: Fix min/maxItems logic (Rob Herring) Changes in v11: - binding: power-domain-names not power-domainS-names Changes in v10: - Fix the binding to make sure sram-supply property can be provided. Changes in v6: - Rebased, actually tested with recent mesa driver. Changes in v5: - Rename "2d" power domain to "core2" Changes in v4: - Add power-domain-names description (kept Alyssa's reviewed-by as the change is minor) .../bindings/gpu/arm,mali-bifrost.yaml | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml index 184492162e7e..b22cd8f1b015 100644 --- a/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml +++ b/Documentation/devicetree/bindings/gpu/arm,mali-bifrost.yaml @@ -17,6 +17,7 @@ properties: items: - enum: - amlogic,meson-g12a-mali + - mediatek,mt8183-mali - realtek,rtd1619-mali - rockchip,px30-mali - const: arm,mali-bifrost # Mali Bifrost GPU model/revision is fully discoverable @@ -41,10 +42,13 @@ properties: mali-supply: true + sram-supply: true + operating-points-v2: true power-domains: - maxItems: 1 + minItems: 1 + maxItems: 3 resets: maxItems: 2 @@ -87,6 +91,30 @@ allOf: then: required: - resets + - if: + properties: + compatible: + contains: + const: mediatek,mt8183-mali + then: + properties: + power-domains: + minItems: 3 + power-domain-names: + items: + - const: core0 + - const: core1 + - const: core2 + + required: + - sram-supply + - power-domains + - power-domain-names + else: + properties: + power-domains: + maxItems: 1 + sram-supply: false examples: - | From patchwork Wed Apr 21 05:28:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Boichat X-Patchwork-Id: 12215453 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D846C43460 for ; Wed, 21 Apr 2021 05:29:14 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F3EC461415 for ; Wed, 21 Apr 2021 05:29:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F3EC461415 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 504CC6E946; Wed, 21 Apr 2021 05:29:13 +0000 (UTC) Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9AC796E946 for ; Wed, 21 Apr 2021 05:29:12 +0000 (UTC) Received: by mail-pg1-x52f.google.com with SMTP id y32so28662286pga.11 for ; Tue, 20 Apr 2021 22:29:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=S9cFyFhO9R2yAwKrT8XRyCRc7wvjemRTlbN3hfsszKw=; b=GT2Mj0spMd/69rT4+Fhdj1pS4MN1vIrov8lSPUi/QFrEy7oGA7K7MmZZ1+0t07zuQZ 87Jy+zbUfAP3B0gYZYGYN4mBxnffj+twRcqVepho+einnzZUKjVnU37e3EoA6u+Gbmhf ydsF6en+tAM9NroZp8rB2CV9mTcPYkDO5modg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=S9cFyFhO9R2yAwKrT8XRyCRc7wvjemRTlbN3hfsszKw=; b=qJP5kHMZDIUjtiDAN79r6zWDu78cXX5ycC/v/fqhmJz6LxzWBEyYCshX0iodr/C2Lt dCiYBzorIROFZ0CwvKGZTDVIe/cWMMdocN4SbjmrqaPD10QqFZb//Wjww8dDSEj++1Uw x57hdN1th1Y9jz9WOp9vE7rS+qdXSFsHN56sEAz9x0jQEVpqReu+hb+SydjYKx3jO+lU HS6Dbc3SwgolRZ+VeVeoEx1t3gPcFoXlf+aUvN/CAu3xgC9jxzvPI0q7MKdX86ORzBep 9FeOK586reOYwfE5fsNRJJddbRlpEUZ8aZc3d1hPETAzgsgAGhBwkI/JekAlKq4SU+q2 6YOw== X-Gm-Message-State: AOAM530L3G8cDysCl8GVA4slA3enV9dyV/c12jBv0E6YU2/3qoLQFQp1 He7wk4T9adJGtYqBFxnikVk1YQ== X-Google-Smtp-Source: ABdhPJxBMqVZ6+h/34Wk2pJLfm7hRZQgqp/mXZcC9Tsu2PNfWfLWzrLQJFgTRN03I7fqZ9CG1bO0og== X-Received: by 2002:aa7:9817:0:b029:25d:f866:4a71 with SMTP id e23-20020aa798170000b029025df8664a71mr16154245pfl.47.1618982952228; Tue, 20 Apr 2021 22:29:12 -0700 (PDT) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:b3e5:49c0:4843:2bbe]) by smtp.gmail.com with ESMTPSA id b6sm602537pfa.185.2021.04.20.22.29.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 22:29:10 -0700 (PDT) From: Nicolas Boichat To: Rob Herring , Steven Price , Alyssa Rosenzweig Subject: [PATCH v13 3/4] drm/panfrost: devfreq: Disable devfreq when num_supplies > 1 Date: Wed, 21 Apr 2021 13:28:54 +0800 Message-Id: <20210421132841.v13.3.I3af068abe30c9c85cabc4486385c52e56527a509@changeid> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog In-Reply-To: <20210421052855.1279713-1-drinkcat@chromium.org> References: <20210421052855.1279713-1-drinkcat@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicolas Boichat , Tomeu Vizoso , Neil Armstrong , David Airlie , fshao@chromium.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, boris.brezillon@collabora.com, hsinyi@chromium.org, hoegsberg@chromium.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" GPUs with more than a single regulator (e.g. G72 on MT8183) will require platform-specific handling for devfreq, for 2 reasons: 1. The opp core (drivers/opp/core.c:_generic_set_opp_regulator) does not support multiple regulators, so we'll need custom handlers. 2. Generally, platforms with 2 regulators have platform-specific constraints on how the voltages should be set (e.g. minimum/maximum voltage difference between them), so we should not just create generic handlers that simply change the voltages without taking care of those constraints. Disable devfreq for now on those GPUs. Signed-off-by: Nicolas Boichat Reviewed-by: Tomeu Vizoso Reviewed-by: Steven Price --- Changes in v13: - devfreq: Fix conflict resolution mistake when rebasing, didn't even compile. Oops. Changes in v9: - Explain why devfreq needs to be disabled for GPUs with >1 regulators. Changes in v8: - Use DRM_DEV_INFO instead of ERROR Changes in v7: - Fix GPU ID in commit message Changes in v6: - devfreq: New change drivers/gpu/drm/panfrost/panfrost_devfreq.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index 47d27e54a34f..3644652f726f 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -92,6 +92,15 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) struct thermal_cooling_device *cooling; struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; + if (pfdev->comp->num_supplies > 1) { + /* + * GPUs with more than 1 supply require platform-specific handling: + * continue without devfreq + */ + DRM_DEV_INFO(dev, "More than 1 supply is not supported yet\n"); + return 0; + } + ret = devm_pm_opp_set_regulators(dev, pfdev->comp->supply_names, pfdev->comp->num_supplies); if (ret) { From patchwork Wed Apr 21 05:28:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Boichat X-Patchwork-Id: 12215455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D314C433ED for ; Wed, 21 Apr 2021 05:29:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1177D61419 for ; Wed, 21 Apr 2021 05:29:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1177D61419 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3358D6E948; Wed, 21 Apr 2021 05:29:17 +0000 (UTC) Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by gabe.freedesktop.org (Postfix) with ESMTPS id EFB2B6E947 for ; Wed, 21 Apr 2021 05:29:15 +0000 (UTC) Received: by mail-pf1-x42c.google.com with SMTP id h15so9921668pfv.2 for ; Tue, 20 Apr 2021 22:29:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5hFZoL/B1X+TSHMC73OVlRCB/m5eFhUPf/0EsulpbQc=; b=GSqR/tNLV3h2WeySeGfMGXOdlSgUpYvKwLbgArv7aByT94uKy05vclZyhRVEgxk6z1 y2lzKfsYfERoExvktOFnGzS6Nit5WD4J93WIFbcrCCn5ypodHnnkR6Xb9ApUv4tRIkTX X4dQbkBfnwKACwTorawRek4NP46rAGerLZ384= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5hFZoL/B1X+TSHMC73OVlRCB/m5eFhUPf/0EsulpbQc=; b=MmcbU60badcC1s054YbBySsJXWASEe/PdYmQZjLtdk98/X33oDF0gRGR0Aag1dTYhA fZzqNJnJMwcm4n6LDf+w4PaKDJ7GCK1UXTGC21DNH6GGLxcbLZWiqGAlhigBCNi1tRz6 GmtxTNNl2Uhw4iiqBkXIm1GCX4oNG9RY2+bE0f7coRza+mypbhGXoQSqVuOY9XL+Fsd3 BZIx13ynAnk7sbPZObwGimE79QPyHsn3ZcbPcDQDEyKRqVmtWkftpJtLJAxTblY3n1UT vWi25mpDuRjQCawYMrTQtrOCf3evH/htnYE9O9tGgpI3mnh1ciek4rkDDtzkdyQKfDT1 2osw== X-Gm-Message-State: AOAM531lYzw9m6LvfrqPVfjDdRJpnoY4HNobIMRTtesAtcN+qMKdgccQ 6gMbe2K4CXkWKqtTMYCXicQ46Q== X-Google-Smtp-Source: ABdhPJyZDRqJdOcJWbtPfs6X/UaeVpCly9Jbo3Ob3dn5LLzwTPwfK1AOmwpC17pOPG6/nzFx3YPVUw== X-Received: by 2002:a17:90b:808:: with SMTP id bk8mr9347798pjb.128.1618982955584; Tue, 20 Apr 2021 22:29:15 -0700 (PDT) Received: from drinkcat2.tpe.corp.google.com ([2401:fa00:1:b:b3e5:49c0:4843:2bbe]) by smtp.gmail.com with ESMTPSA id b6sm602537pfa.185.2021.04.20.22.29.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 22:29:15 -0700 (PDT) From: Nicolas Boichat To: Rob Herring , Steven Price , Alyssa Rosenzweig Subject: [PATCH v13 4/4] drm/panfrost: Add mt8183-mali compatible string Date: Wed, 21 Apr 2021 13:28:55 +0800 Message-Id: <20210421132841.v13.4.I5f6b04431828ec9c3e41e65f3337cec6a127480d@changeid> X-Mailer: git-send-email 2.31.1.368.gbe11c130af-goog In-Reply-To: <20210421052855.1279713-1-drinkcat@chromium.org> References: <20210421052855.1279713-1-drinkcat@chromium.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicolas Boichat , Tomeu Vizoso , Neil Armstrong , David Airlie , fshao@chromium.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, boris.brezillon@collabora.com, linux-mediatek@lists.infradead.org, hsinyi@chromium.org, Matthias Brugger , hoegsberg@chromium.org, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add support for MT8183's G72 Bifrost. Signed-off-by: Nicolas Boichat Reviewed-by: Tomeu Vizoso Reviewed-by: Steven Price --- (no changes since v7) Changes in v7: - Fix GPU ID in commit message Changes in v6: - Context conflicts, reflow the code. - Use ARRAY_SIZE for power domains too. Changes in v5: - Change power domain name from 2d to core2. Changes in v4: - Add power domain names. Changes in v3: - Match mt8183-mali instead of bifrost, as we require special handling for the 2 regulators and 3 power domains. drivers/gpu/drm/panfrost/panfrost_drv.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 83a461bdeea8..ca07098a6141 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -665,6 +665,15 @@ static const struct panfrost_compatible amlogic_data = { .vendor_quirk = panfrost_gpu_amlogic_quirk, }; +const char * const mediatek_mt8183_supplies[] = { "mali", "sram" }; +const char * const mediatek_mt8183_pm_domains[] = { "core0", "core1", "core2" }; +static const struct panfrost_compatible mediatek_mt8183_data = { + .num_supplies = ARRAY_SIZE(mediatek_mt8183_supplies), + .supply_names = mediatek_mt8183_supplies, + .num_pm_domains = ARRAY_SIZE(mediatek_mt8183_pm_domains), + .pm_domain_names = mediatek_mt8183_pm_domains, +}; + static const struct of_device_id dt_match[] = { /* Set first to probe before the generic compatibles */ { .compatible = "amlogic,meson-gxm-mali", @@ -681,6 +690,7 @@ static const struct of_device_id dt_match[] = { { .compatible = "arm,mali-t860", .data = &default_data, }, { .compatible = "arm,mali-t880", .data = &default_data, }, { .compatible = "arm,mali-bifrost", .data = &default_data, }, + { .compatible = "mediatek,mt8183-mali", .data = &mediatek_mt8183_data }, {} }; MODULE_DEVICE_TABLE(of, dt_match);