From patchwork Thu Dec 1 10:30:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 13061164 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 0FFA6C43217 for ; Thu, 1 Dec 2022 10:31:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8DBEF10E125; Thu, 1 Dec 2022 10:31:08 +0000 (UTC) Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by gabe.freedesktop.org (Postfix) with ESMTPS id C590010E129; Thu, 1 Dec 2022 10:31:02 +0000 (UTC) Received: by mail-ej1-x62b.google.com with SMTP id td2so3127867ejc.5; Thu, 01 Dec 2022 02:31:02 -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=cbjbrXuT8E1s38jzvt5nDpI8pDGo9sLSQBn85SkcpzB/lfR+IYTvqkDDRNZgh2xaX/ hP1vgyrt14EfGicPI15NkWFmw9lTE/kIcwkC4CxR79Qb4UO8U40H2NsuNWNm5C4pfX2u rIzRBLpjE1qe6WpFfUuyXk5VT+VysTyjYVj2rc5S2Z8MZRuTlw7HqbLd0kM3wsDHqTCn 8+Pthl24i9yHneVK+ayw9VF3UPmkfz6hgvaPxBelDF/rW421wCOK5xLzwbdgkuzXniUL /3/iBh78lTW85/idYvXbRlu5I120sZoNtAGgusL10Du525UNHgpQEaPP1FeLcPibs77O aB1g== 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=Z0RWvvOw9PWalYN+P54FSyyt9oqsXuQ1TYpW7vJKp+0cyQ5NKkqvJ+rd8W3pL3gnwq 8ekTcEKfFfYWqpIkdeN0XCBcdsP7fQxqGEGWV5JaJIG0yOZWWvaJ4uvVnTBEaYFhSl/u l5uaSktrE8GL3FArWGsJikZkeuxDia+5HX05MpGpAaJr/mV58HAQ9nunTu9UsbsPCDHQ LaK/k6KFHAcCaFirwiiy4fveZGbP6FkV/5oqXTOSF/Jm8gx6KsrUpF4cpPJwhqySAERl 7JMT2ebIUyeL9VqW+aBo5bBgPBxZB31UqaGetWf/Nbus84xEJFdibmXR8QFXGn3nnFhL 7+oA== X-Gm-Message-State: ANoB5pml7z5NiuBwcJGAJBLsuo3CJJp6eTGulhjFb3Q6qyJJ2i9JjQor uKu7MuEFldgOASjVqR5yhPs= X-Google-Smtp-Source: AA0mqf6vLwJ1e3gG/cbesF5dC/cJZEejWxr7z+4bT4uuMCGBKShgh1K9ZWvRJXzcdKkZCuY8cmdu7w== X-Received: by 2002:a17:906:3510:b0:781:b7f2:bce9 with SMTP id r16-20020a170906351000b00781b7f2bce9mr56599893eja.269.1669890661370; Thu, 01 Dec 2022 02:31:01 -0800 (PST) Received: from cizrna.home (cst-prg-44-69.cust.vodafone.cz. [46.135.44.69]) by smtp.gmail.com with ESMTPSA id g1-20020a17090604c100b007c07b23a79bsm1592400eja.213.2022.12.01.02.31.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 02:31:00 -0800 (PST) From: Tomeu Vizoso To: Subject: [PATCH v5 5/7] drm/etnaviv: Add nn_core_count to chip feature struct Date: Thu, 1 Dec 2022 11:30:21 +0100 Message-Id: <20221201103026.53234-6-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221201103026.53234-1-tomeu.vizoso@collabora.com> References: <20221201103026.53234-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 Thu Dec 1 10:30:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 13061165 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 027D7C4321E for ; Thu, 1 Dec 2022 10:31:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D8BE010E5B0; Thu, 1 Dec 2022 10:31:10 +0000 (UTC) Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by gabe.freedesktop.org (Postfix) with ESMTPS id F2E7E10E129; Thu, 1 Dec 2022 10:31:03 +0000 (UTC) Received: by mail-ej1-x630.google.com with SMTP id vv4so3148815ejc.2; Thu, 01 Dec 2022 02:31:03 -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=a5RWL8PSQEK0iO8D8xGt8NT2AQ4OV/qzxmaspNDbxZCSpoxCIuJ8vexkpLEXothzvJ nA46USR5g+fZ8RmhwNme1mUk4fTwlPRvZ2Vr7Fo0BIC8HQU3oBI/FlZ0rNvwDOQCd7Zg ILeFDzoCJG6yn45os/rNOFjn5OgcOcNC5aX3frAWSqtE5f9UDhvVajhtcQx3dm4I0x1l zUMnMfHWHhYshJ2WSdzjW031qTsDlclT4TP7Ujld7X1y9znWkqpND/WFjphv37tki6qf npw9YXacBh/EakMCf80tDIHdhe2tBdzdrvOBJjQN4RC7Tp9EH3iYeRyN/NbDlPEsq8Yh eG7A== 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=YSR+MLUNgUHXgcDZ0PjQVHcVjDqcUCVpL93l3sN4mVPCvU2SqV1XONwQLkvnycENcx +u2hEXALRuaRUsF0yglwMTCE4Dd+7hLyTeVZ0M37Ipfk0WFD4LDrdwn72UxSGovO6dds ANBhC0lEd1Fh5Gqh0zIxlrt5QUUPLO1ajGKin/Jq4TO7GIvcjcTbCitsX7LECCJ8mr79 LyzdWbJEZZmHRfIpsjH4AznJN6sPzJtL8otOQDVVXv8BeZOPRTI+CFocWQl9LFr6TU3c 1bfIX53g5DPWpHo/AXlT38Go9sme1mFtbYYq6oXn852C+AY+RxkpgL43R3An6z6AkV3J m/YQ== X-Gm-Message-State: ANoB5pkuzny5IMeDwoGeX7BDeSPE1Qc1m2g3Qe9SOINJzefMXbXZurOB Sg0G2ROllYrMxVwAEo1Qc1I= X-Google-Smtp-Source: AA0mqf792BH1dkxj+elKYFKEKcD4i+q0VwaieVCNwc2KlVuSsd9a8B002/dcWUBiKX1TDLbx9Qr5UA== X-Received: by 2002:a17:906:c18c:b0:7b2:8a6e:c569 with SMTP id g12-20020a170906c18c00b007b28a6ec569mr56271431ejz.582.1669890662588; Thu, 01 Dec 2022 02:31:02 -0800 (PST) Received: from cizrna.home (cst-prg-44-69.cust.vodafone.cz. [46.135.44.69]) by smtp.gmail.com with ESMTPSA id g1-20020a17090604c100b007c07b23a79bsm1592400eja.213.2022.12.01.02.31.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 02:31:02 -0800 (PST) From: Tomeu Vizoso To: Subject: [PATCH v5 6/7] drm/etnaviv: Warn when probing on NPUs Date: Thu, 1 Dec 2022 11:30:22 +0100 Message-Id: <20221201103026.53234-7-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221201103026.53234-1-tomeu.vizoso@collabora.com> References: <20221201103026.53234-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 Thu Dec 1 10:30:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 13061166 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 EED4FC43217 for ; Thu, 1 Dec 2022 10:31:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D048C10E5BC; Thu, 1 Dec 2022 10:31:13 +0000 (UTC) Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8FA5510E125; Thu, 1 Dec 2022 10:31:05 +0000 (UTC) Received: by mail-ej1-x632.google.com with SMTP id ha10so3144430ejb.3; Thu, 01 Dec 2022 02:31:05 -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=cc2+71zSLRd6aORczf6VwydiioGC5ERV4dEKqnoGWiupso+Zv97xJSaSUG9NoDOC4L Ox8vRi1EW3ddGkNSkgRnFIfJF4Z1HJ+IqQzf6OMKQVUoXcDDzo6wQ/7T5G+PMfoqF2HT YHqD1xge3JGgEmQ4bp37AjPDJ5KlrfVRSPDWi+VadiEDN504svPMnqkzxq2E2YWemhoJ 69UTZGCNiYHy6FZ+dJgUR0l6zpobBAk663+rjTcWedCXVKNJJliORPf1dJdGo+UvW3z2 VTsYOkcE+SYDqeSA5RY2mBDon1V/qwuQUF9nrkPADmDUHbWMWwJWP1lU2bWA9ZgXMAdZ tzvA== 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=dcGFXy+iysasmx0+LtbaztobCtoIKMe4gPdtNxRQsiM9WorEMwx5z7tuW09VqJK9vS Y6LUv3ryiZatSw9QBOSVF0wc1dv1bW1ka+KevxOIwM0dmDCmLFpwkyZ3mFg5slDSPAtF 9geEr+6HOb2r33hpC9ZXvVUlr/YAny0Y3LmTeXi3Ij09QI+gbWvXmRo9hL+SNiRudHQF E+uf1UfNzwu4++DyNvDNpt6Ra1E+45dJRRL5drnVQV4IIweNkYNJcX+8yqLgguo/xCST LM4w4xKRFAtXvwV6yHM81RStwLN+ecptMo/t7/qlRgY5UePYPdhC9uqa7V7PzDEq6BqX lk2A== X-Gm-Message-State: ANoB5plZI1yiZ6wAwspR8IfLEzG1iQv3i7ScV7c7fguN16aBYR/+oIny qdsOSJOv+ARdUE0TlbK/Npo= X-Google-Smtp-Source: AA0mqf4roDdJ7X5AOMeo4c+BOzUOX3iZ5+TSETAMFDa6FBYU0p4nnryzGSyIFtBehtaFMD5MYiKeew== X-Received: by 2002:a17:907:7670:b0:78d:b713:7247 with SMTP id kk16-20020a170907767000b0078db7137247mr33837303ejc.706.1669890663829; Thu, 01 Dec 2022 02:31:03 -0800 (PST) Received: from cizrna.home (cst-prg-44-69.cust.vodafone.cz. [46.135.44.69]) by smtp.gmail.com with ESMTPSA id g1-20020a17090604c100b007c07b23a79bsm1592400eja.213.2022.12.01.02.31.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 02:31:03 -0800 (PST) From: Tomeu Vizoso To: Subject: [PATCH v5 7/7] drm/etnaviv: add HWDB entry for VIPNano-QI.7120.0055 Date: Thu, 1 Dec 2022 11:30:23 +0100 Message-Id: <20221201103026.53234-8-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221201103026.53234-1-tomeu.vizoso@collabora.com> References: <20221201103026.53234-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)