From patchwork Fri Dec 2 11:52:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 13062685 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 137E3C4708E for ; Fri, 2 Dec 2022 11:52:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4CB9310E6E1; Fri, 2 Dec 2022 11:52:47 +0000 (UTC) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by gabe.freedesktop.org (Postfix) with ESMTPS id B596110E6DF; Fri, 2 Dec 2022 11:52:43 +0000 (UTC) Received: by mail-ed1-x529.google.com with SMTP id d14so1212460edj.11; Fri, 02 Dec 2022 03:52:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=vcT8YWVtzB1GH3wOdz9aZTQd5ehiQWJpYZBWZtycvm8=; b=n6rSQm2scPUp8G7dkrFMvAlrmDdT5HqkEFLp5tVgjnDhobTyndc90glH9j1b0mNhM4 PlCdqyRunGFcWaw40v1XO1FSXh9aTfLBBrupdRpb73kotN52w4f1n2ij3hFHRPRX2wa4 kacKVYbnJWeQHWjvGMvFfVlMplLd/isdSbjz2AqBN0jDpGu7R2+DvXsdJd7fNvJf4Zhq 3kTdiH0gyp40Vejo7JRT3g8aEMXlLccp97tvG1j6mQExD9L9JFARULn1LNhUHNas2AKl vp6Xn+JSyYqlVspuDjrELJGnySjWwMg2YjB61h3wwHglmL06xvpYDgkkhBaBCSJ8wvgk 0mjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=vcT8YWVtzB1GH3wOdz9aZTQd5ehiQWJpYZBWZtycvm8=; b=GjKn/efnOEPB0chzUeaKteTKNVBzULXYJH/TYGnzgScPRarz5EDWav/gocaTnM5biz dioz7eSVyrLzoe72581fHS3/PP40Syjujv2zxlOjziNbWbWMBGy3/mAc1TPVOxfNhs+D uKetOyJ4cPevnqoYGtraz1XoinlK1o1PQDMA3Q+Ijp/nKpcKSs1RsmQLL82PuB/rhO1F nEwtGCtCExU7B6Ijb0T76l7+aMv8VJDiQn8FLQsvgMv5PdlpWva01Vtr/Bc/CkzBy/UM ygbPIvknDIdO2/r7Cuv+xYfjbsqrLfLdFkvjxhQszejgJepPbQGf1X0kXiol8ZxMnySs 7AEA== X-Gm-Message-State: ANoB5plpY2LBXMbRyQ4cxXEj7OHiDtKHmkr3GW/9KKxBKLf9uvruamPN KWW4IdQF/l+mMnam2fLfVEs= X-Google-Smtp-Source: AA0mqf7z5O8rS3mctV42J+CAKDbBvQEW1qpHWHU4cS8Gyjn6lrLWf90VBV+FexZaVWvv37D7WFdRNw== X-Received: by 2002:a05:6402:1f89:b0:458:caec:8f1e with SMTP id c9-20020a0564021f8900b00458caec8f1emr62952822edc.280.1669981962298; Fri, 02 Dec 2022 03:52:42 -0800 (PST) Received: from cizrna.home (cst-prg-44-69.cust.vodafone.cz. [46.135.44.69]) by smtp.gmail.com with ESMTPSA id ha7-20020a170906a88700b007c0bb571da5sm1206762ejb.41.2022.12.02.03.52.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 03:52:41 -0800 (PST) From: Tomeu Vizoso To: Subject: [PATCH v6 5/8] drm/etnaviv: Add nn_core_count to chip feature struct Date: Fri, 2 Dec 2022 12:52:17 +0100 Message-Id: <20221202115223.39051-6-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221202115223.39051-1-tomeu.vizoso@collabora.com> References: <20221202115223.39051-1-tomeu.vizoso@collabora.com> 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: Tomeu Vizoso , italonicola@collabora.com, "moderated list:DRM DRIVERS FOR VIVANTE GPU IP" , "open list:DRM DRIVERS FOR VIVANTE GPU IP" , open list , Russell King Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We will use these for differentiating between GPUs and NPUs, as the downstream driver does. Signed-off-by: Tomeu Vizoso --- drivers/gpu/drm/etnaviv/etnaviv_gpu.h | 3 +++ drivers/gpu/drm/etnaviv/etnaviv_hwdb.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.h b/drivers/gpu/drm/etnaviv/etnaviv_gpu.h index 85eddd492774..c8f3ad2031ce 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.h +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.h @@ -50,6 +50,9 @@ struct etnaviv_chip_identity { /* Number of shader cores. */ u32 shader_core_count; + /* Number of Neural Network cores. */ + u32 nn_core_count; + /* Size of the vertex cache. */ u32 vertex_cache_size; diff --git a/drivers/gpu/drm/etnaviv/etnaviv_hwdb.c b/drivers/gpu/drm/etnaviv/etnaviv_hwdb.c index f2fc645c7956..44df273a5aae 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_hwdb.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_hwdb.c @@ -16,6 +16,7 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = { .register_max = 64, .thread_count = 128, .shader_core_count = 1, + .nn_core_count = 0, .vertex_cache_size = 8, .vertex_output_buffer_size = 1024, .pixel_pipes = 1, @@ -47,6 +48,7 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = { .register_max = 64, .thread_count = 512, .shader_core_count = 2, + .nn_core_count = 0, .vertex_cache_size = 16, .vertex_output_buffer_size = 1024, .pixel_pipes = 1, @@ -78,6 +80,7 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = { .register_max = 64, .thread_count = 512, .shader_core_count = 2, + .nn_core_count = 0, .vertex_cache_size = 16, .vertex_output_buffer_size = 1024, .pixel_pipes = 1, @@ -109,6 +112,7 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = { .register_max = 64, .thread_count = 1024, .shader_core_count = 4, + .nn_core_count = 0, .vertex_cache_size = 16, .vertex_output_buffer_size = 1024, .pixel_pipes = 2, From patchwork Fri Dec 2 11:52:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 13062686 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id AAD49C4167B for ; Fri, 2 Dec 2022 11:52:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8661F10E6DD; Fri, 2 Dec 2022 11:52:50 +0000 (UTC) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3596610E6DF; Fri, 2 Dec 2022 11:52:45 +0000 (UTC) Received: by mail-ed1-x530.google.com with SMTP id v8so6191633edi.3; Fri, 02 Dec 2022 03:52:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=NbApf1anPXhkyL1eMhU3x4CauZkX++vBii8PykYLja0=; b=Zaz1ET+G1SWchZ+VgoJoMcRplKphEziazSa2ThOiA/jFoSYOSbYC/0JWmbk7indYGE ZNKMyOgAmUOqNDEv9TUk/yPiJfFZkIKOcnLiuk7lFX+eXBoL6pMBgUrEf3KpCCqeJ/qo 5exqrQ1zKJlL05VIAa7DhkMb1bOyy9MePplKkiSQQh12oUA/OthYWtBMqG8Y/Fm2BMyi WlMKCLlUyCo+9gj9XV4nNWp1GoeRH4V3xkcy4dssda4Ap2EKC4gQoaH6o6deopLDVDPl 2YjPZ0RBftgHbuCkasZZbFvPihe9aeRTPIU1M+nLd/Ccoj7JLw1YSDnIs/jDREcL/5yG siUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=NbApf1anPXhkyL1eMhU3x4CauZkX++vBii8PykYLja0=; b=0dcELoobyXxqB2dlNk6Y+PKkXBrxRycJA4CSPo3mVjDleB2L0gCub3FEA1flQyYFyT 2WneypTHk+wEkmFfV5jLXv6ogt9nMp1V/viZl69/yiYStqtJDFCHJWp/8EMhyvP9P/R1 FLOCmDy/2urC7BagNTOnFoyBumltnklwzVDS0Sj/zq2x0U75bPTVFcGC13dHjTmhntxH I/PkNP/bZuBPqDHPPGT2Cu4SuJIz2eg2I2SHoybUvcWJXoVjGnkk1b0eV9lff+FuWXvB 72fxEvCGuGiMthVpdrMR4HqCVJyesBReth0TXYQDGwX8+abdRF+mkHN+dLhl1HmF7G0+ +fMA== X-Gm-Message-State: ANoB5plNnS5fl3aADSxBlHOaKITXDxzaYmHettKQQJvkXI7ffYGhkH2a EcF7rTve3yiFsKBWyp8HQ88= X-Google-Smtp-Source: AA0mqf5u8WJUjMkgmdOQWN0p+3lPuMNPUEsyeQq7hpK3juNAdPo9O2CUMmzQw/QKtlOmoJlwzM+H5w== X-Received: by 2002:a05:6402:2404:b0:467:67e1:ca61 with SMTP id t4-20020a056402240400b0046767e1ca61mr12816866eda.27.1669981963506; Fri, 02 Dec 2022 03:52:43 -0800 (PST) Received: from cizrna.home (cst-prg-44-69.cust.vodafone.cz. [46.135.44.69]) by smtp.gmail.com with ESMTPSA id ha7-20020a170906a88700b007c0bb571da5sm1206762ejb.41.2022.12.02.03.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 03:52:43 -0800 (PST) From: Tomeu Vizoso To: Subject: [PATCH v6 6/8] drm/etnaviv: Warn when probing on NPUs Date: Fri, 2 Dec 2022 12:52:18 +0100 Message-Id: <20221202115223.39051-7-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221202115223.39051-1-tomeu.vizoso@collabora.com> References: <20221202115223.39051-1-tomeu.vizoso@collabora.com> 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: Tomeu Vizoso , italonicola@collabora.com, "moderated list:DRM DRIVERS FOR VIVANTE GPU IP" , "open list:DRM DRIVERS FOR VIVANTE GPU IP" , open list , Russell King Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Userspace is still not making full use of the hardware, so we don't know yet if changes to the UAPI won't be needed. Warn about it. Signed-off-by: Tomeu Vizoso --- drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index 37018bc55810..3cbc82bbf8d4 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -765,6 +765,10 @@ int etnaviv_gpu_init(struct etnaviv_gpu *gpu) goto fail; } + if (gpu->identity.nn_core_count > 0) + dev_warn(gpu->dev, "etnaviv has been instantiated on a NPU, " + "for which the UAPI is still experimental\n"); + /* Exclude VG cores with FE2.0 */ if (gpu->identity.features & chipFeatures_PIPE_VG && gpu->identity.features & chipFeatures_FE20) { From patchwork Fri Dec 2 11:52:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 13062687 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 2473AC4321E for ; Fri, 2 Dec 2022 11:52:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A65B10E704; Fri, 2 Dec 2022 11:52:53 +0000 (UTC) Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 970EE10E6DF; Fri, 2 Dec 2022 11:52:46 +0000 (UTC) Received: by mail-ej1-x62c.google.com with SMTP id fy37so10953666ejc.11; Fri, 02 Dec 2022 03:52:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=Q2njBXO/jcTn1hW9BCGP1JQWTyTb5ivQ7E5VaL+5F8g=; b=PGqEPPKLMPgV0vs1JO0S4lzeqt1JVLn2xyAx1A9+XqqmsQA4aW7b2OGtkWZTtYA3Eg Z0+OCjTBDGEUvJZVWwBhd4GXirMMRQWepVJWj/kIkaFdxGN+0cyEeAOP4CaqICWSop+5 MhGsjaaGZUC02+BGwqJO78pXzl3AeZS+nSd5P8SiZAMc0ekU8MnPvuR36J3dJrJeUihs TlZjIuRUSmjtDzZorkt5kjUVuaspXtG+JM7dVqZNvCLb4YSjE3/fFfBfUYgFPwAHCPx1 xqXOSZ7Ud8M8UwiehMREoc+zKjdd6BdHaTn2sP6dtAoUTzIuFgAnPJGWLXVYc6Mg9oe3 W06Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Q2njBXO/jcTn1hW9BCGP1JQWTyTb5ivQ7E5VaL+5F8g=; b=gSps517bysJvgJmLciKwsn6YJs+vu8jQbHR2ZcivJ6zzC6HuyGTYZII7e1mxdOwSPj DyE/qdEpvbR1Uuc31oOizIANgvVB/h+b4TfB6USm4ozpnyj2Wqzb+BKMydxCWv+wc+So vWrOpeFz3FcYeF/j5jQMy9MhAwyc2m+pK/gMKu9/O9tVySxROvSI/azpem15cQc+IGXo N8J+ZTqwMRVnuX4OTGIih5k9Gyab5/EY+TUjCFgHIwMqA+SUfOB3VnaYDhBf6PkqNl5m yvITmpI+dKjCnq8A8V1PvGSPURBsOWZgCbtmWAJp5arN/gc8+/PoLxWB62+3RevYCsLg tbrw== X-Gm-Message-State: ANoB5pmL9l2TEOWeK3NxsfzPZiWv/fyz9YzLF84Epa1D6QXaywzXgEB2 3E/JNYXthVlE/3zA+M5qbOQ= X-Google-Smtp-Source: AA0mqf4fSMzOzi3Zl9q8HAMPixjYiZvqfbProtvQ+lQZi/7zRZUXdlor2DZsqaqo4HlonrVcIFxykg== X-Received: by 2002:a17:906:d0da:b0:7ad:9891:8756 with SMTP id bq26-20020a170906d0da00b007ad98918756mr60667631ejb.203.1669981964923; Fri, 02 Dec 2022 03:52:44 -0800 (PST) Received: from cizrna.home (cst-prg-44-69.cust.vodafone.cz. [46.135.44.69]) by smtp.gmail.com with ESMTPSA id ha7-20020a170906a88700b007c0bb571da5sm1206762ejb.41.2022.12.02.03.52.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 03:52:44 -0800 (PST) From: Tomeu Vizoso To: Subject: [PATCH v6 7/8] drm/etnaviv: add HWDB entry for VIPNano-QI.7120.0055 Date: Fri, 2 Dec 2022 12:52:19 +0100 Message-Id: <20221202115223.39051-8-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221202115223.39051-1-tomeu.vizoso@collabora.com> References: <20221202115223.39051-1-tomeu.vizoso@collabora.com> 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: Tomeu Vizoso , italonicola@collabora.com, "moderated list:DRM DRIVERS FOR VIVANTE GPU IP" , "open list:DRM DRIVERS FOR VIVANTE GPU IP" , open list , Russell King Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is a compute-only module marketed towards AI and vision acceleration. This particular version can be found on the Amlogic A311D SoC. The feature bits are taken from the Khadas downstream kernel driver 6.4.4.3.310723AAA. Signed-off-by: Tomeu Vizoso --- drivers/gpu/drm/etnaviv/etnaviv_hwdb.c | 31 ++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_hwdb.c b/drivers/gpu/drm/etnaviv/etnaviv_hwdb.c index 44df273a5aae..66b8ad6c7d26 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_hwdb.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_hwdb.c @@ -134,6 +134,37 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = { .minor_features10 = 0x90044250, .minor_features11 = 0x00000024, }, + { + .model = 0x8000, + .revision = 0x7120, + .product_id = 0x45080009, + .customer_id = 0x88, + .eco_id = 0, + .stream_count = 8, + .register_max = 64, + .thread_count = 256, + .shader_core_count = 1, + .vertex_cache_size = 16, + .vertex_output_buffer_size = 1024, + .pixel_pipes = 1, + .instruction_count = 512, + .num_constants = 320, + .buffer_size = 0, + .varyings_count = 16, + .features = 0xe0287cac, + .minor_features0 = 0xc1799eff, + .minor_features1 = 0xfefbfadb, + .minor_features2 = 0xeb9d6fbf, + .minor_features3 = 0xedfffced, + .minor_features4 = 0xd30dafc7, + .minor_features5 = 0x7b5ac333, + .minor_features6 = 0xfc8ee200, + .minor_features7 = 0x03fffa6f, + .minor_features8 = 0x00fe0ef0, + .minor_features9 = 0x0088003c, + .minor_features10 = 0x108048c0, + .minor_features11 = 0x00000010, + }, }; bool etnaviv_fill_identity_from_hwdb(struct etnaviv_gpu *gpu)