From patchwork Wed Jun 28 20:35:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Konrad Dybcio X-Patchwork-Id: 11409 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9198618vqr; Wed, 28 Jun 2023 13:46:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlHKdq6XchdRWzGeJGZLYIQ7TddmB3Uj6rdBKqe67MW/d56tIRs15uNePDIC2VwuAlLxQAjS X-Received: by 2002:a05:6000:12c8:b0:313:dfa5:291c with SMTP id l8-20020a05600012c800b00313dfa5291cmr558934wrx.7.1687985177168; Wed, 28 Jun 2023 13:46:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687985177; cv=none; d=google.com; s=arc-20160816; b=dCAvjJ1YMfoAg9xOi5IgpJmaJYa5VmV8spXvHS8slkkzWwWT+u5N72tMrlwJ762kcc jOv7oejGAICIX/vf3+ji1dDNdtbdQ45BYptlhVHEicqsHAncDARwTIrGM7NTCDCBmH16 KUHOk9gRMb5lNMUaE2EmwdSeMkz8ySPHw79b2Ag6ljq2PQ/MlD5uKEWnwY4JuWFeV+K0 KmGu8CEmXgybTxCUJjgH7ZZtKl68My79V4B/1OyMUoiRboVT0X72twx5+8V7n4Y5wh8b PvOZttzRHabOGayfRw5xsjbNIPlqBlMgQOtEXVkIRSSak0zhedaM8QDNy/bICH0Bay19 j3Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=+wRQYdXn3x7iIszNaVENCFzwMuf2uBkWw5PZau30MuI=; fh=y5CufWdCvRG/D46wPUQAs6a5TaO9Xg7IL+UXm/FDyGE=; b=zkxD2GySj4OFQhCAkFrQnPz+MSfbbRW+amxw4EGRiUxLeu9A+G4aY6wVQ+KdG5XWj5 wB8rCwhfhtZ4Vndw+TKmf0sGRxsbcxKRXem1hg+eA6Zt+BcdyBHBKEXzGeAMvLoEUAaM nbieo9y09+7NH7PD2XJfOMnZ4XXS97QVqEHbwMvLM5FiJmrvJPoZDOa2OMJdiWbLnUe/ zZxPIhpvx+ynikHXo4NtLSJHxCcWdcicO7C1WTbKcgB25FqzjUD0jp12JxBhXJentoX9 MabaSpj3dFZfx3xnOUa5LsuXKYRJ6sap+Iuf9mWKA1x0oCA8A8IE+j//ysw5kNQrDmbV HqGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RiFTPc7U; 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 i20-20020a056402055400b0051d9c72d8b1si3868829edx.526.2023.06.28.13.45.52; Wed, 28 Jun 2023 13:46:17 -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=RiFTPc7U; 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 S232050AbjF1Ufi (ORCPT + 99 others); Wed, 28 Jun 2023 16:35:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231421AbjF1Uf3 (ORCPT ); Wed, 28 Jun 2023 16:35:29 -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 24D751FFA for ; Wed, 28 Jun 2023 13:35:28 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-4f8775126d3so101407e87.1 for ; Wed, 28 Jun 2023 13:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687984526; x=1690576526; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=+wRQYdXn3x7iIszNaVENCFzwMuf2uBkWw5PZau30MuI=; b=RiFTPc7UsojgzUuT8i+bbCX1wYS/u2oYh0TjpifxhtmQxHaCoH58VnyiQ6UyX6ETIE ZxJlLgetRmZ2IYsy4/SNeN9nEhRlD5nOnTbppfE2yadro6mJITmJr0ijrF4A0YB/jdTq tPWzgSW49ubQ0xMU8Ky1dFwKagKA7D5MGEkZmmcirr+eJL4boES/GmnKzV+qh0GtrRZr RbPAVoMdKG65cbFqWKSWgoKNIlM1oLlj1U+cu0c6bPRR60agw64xf6QiyFnmsUFBnEwu bfS2WiERtuAQvTH4/HZNble2AdUqn/Vc2/nfJdFPZ/v5BmuKxTA2EDYyTqBfDUzAqzr0 rhrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687984526; x=1690576526; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+wRQYdXn3x7iIszNaVENCFzwMuf2uBkWw5PZau30MuI=; b=ZAGQ0CwQEqszxICLjvWiriPWg3LUSm2mMF5331Avwp9DHQ2C90UUFVm3zYuLejOw1T Z//sqkJkTQTrJe6U/krOA0nn3U8jTb4BF1+ejUcAc+1Pk2N3C35Q0TnIi3UMwiN6eaJU KshJXRREgT0xBk4lRVtGt9uzmmHROEmVTceSrSRlaAfKTmO4Nv9biyEHsB/SGCYsZ9U+ Rp7ZnAyr6TGP5ZAl9/7cvO4fNuHnRlnJa1owO0PXM6f4nuQdZHpTfNS8tvPOVh2oCipM KdNeLDYeFBbY0wsRgasmNNqnjJkQ+D1giUIO5z6lEAdhwOUcbAzRnmuhwi2wh7AHbgNK QxQA== X-Gm-Message-State: AC+VfDwKEsCo3qMMSYvnZ3Pa+2EBb4++0pLfwv5E7/zCTTE6Vqii4viy OlgBqJ+EwqJC8mErHpXRPQM+Dw== X-Received: by 2002:a05:6512:ea7:b0:4f4:c6ab:f119 with SMTP id bi39-20020a0565120ea700b004f4c6abf119mr27288580lfb.64.1687984526179; Wed, 28 Jun 2023 13:35:26 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 13:35:25 -0700 (PDT) From: Konrad Dybcio Subject: [PATCH 00/14] A7xx support Date: Wed, 28 Jun 2023 22:35:00 +0200 Message-Id: <20230628-topic-a7xx_drmmsm-v1-0-a7f4496e0c12@linaro.org> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAHSZnGQC/x2N0QrDIAwAf6XkeQGrUMd+ZYxhNa6BakuyDaH03 yd7vIPjDlASJoXbcIDQl5W32mG8DBCXUF+EnDqDNdaZyV7xve0cMfjWnklK0YKjddmZ5KeYPfR uDko4S6hx6WX9rGuXu1Dm9h/dH+f5A4Pr46t4AAAA 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=3802; i=konrad.dybcio@linaro.org; s=20230215; h=from:subject:message-id; bh=Z7jlwfWNBT9lUj5uikuMSfyXKZlfykMWYJqb93QRUjU=; b=Q9rGg7Lhf4vvAUnJ5JxpZ6ePIoqS150jNswvaYQhFXC6Ahuv7pG7/pAt5+m37hrpvjgkiuh9d qc1sm3bLa18AyDZyFvwwgOJPi2swBJyqfTXz6ChV8R0YYgND10NVwq+ 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=ham 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?1769980745083591297?= X-GMAIL-MSGID: =?utf-8?q?1769980745083591297?= This series attempts to introduce Adreno 700 support (with A730 and A740 found on SM8450 and SM8550 respectively), reusing much of the existing A6xx code. This submission largely lays the groundwork for expansion and more or less gives us feature parity (on the kernel side, that is) with existing A6xx parts. On top of introducing a very messy set of three (!) separate and obfuscated deivce identifiers for each 7xx part, this generation introduces very sophisticated hardware multi-threading and (on some SKUs) hardware ray-tracing (not supported yet). After this series, a long-overdue cleanup of drm/msm/adreno is planned in preparation for adding more features and removing some hardcoding. The last patch is a hack that may or may not be necessary depending on your board's humour.. eh.. :/ Developed atop (and hence depends on) [1] The corresponding devicetree patches are initially available at [2] and will be posted after this series gets merged. To test it, you'll also need firmware that you need to obtain from your board (there's none with a redistributable license, sorry..). Most likely it will be in one of these directories on your stock android installation: * /vendor/firmware * /vendor/firmware_mnt * /system ..but some vendors make it hard and you have to do some grepping ;) Requires [3] to work on the userspace side. You'll almost cerainly want to test it alongside Zink with a lot of debug flags (early impl), like: TU_DEBUG=sysmem,nolrz,flushall,noubwc MESA_LOADER_DRIVER_OVERRIDE=zink kmscube [1] https://lore.kernel.org/linux-arm-msm/20230517-topic-a7xx_prep-v4-0-b16f273a91d4@linaro.org/ [2] https://github.com/SoMainline/linux/commits/topic/a7xx_dt [3] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23217 Signed-off-by: Konrad Dybcio Tested-by: Dmitry Baryshkov # sm8450 Tested-by: Neil Armstrong # on SM8550-QRD --- Konrad Dybcio (14): dt-bindings: display/msm/gmu: Add Adreno 7[34]0 GMU dt-bindings: display/msm/gmu: Allow passing QMP handle dt-bindings: display/msm/gpu: Allow A7xx SKUs drm/msm/a6xx: Add missing regs for A7XX drm/msm/a6xx: Introduce a6xx_llc_read drm/msm/a6xx: Move LLC accessors to the common header drm/msm/a6xx: Bail out early if setting GPU OOB fails drm/msm/a6xx: Add skeleton A7xx support drm/msm/a6xx: Send ACD state to QMP at GMU resume drm/msm/a6xx: Mostly implement A7xx gpu_state drm/msm/a6xx: Add A730 support drm/msm/a6xx: Add A740 support drm/msm/a6xx: Vastly increase HFI timeout [RFC] drm/msm/a6xx: Poll for GBIF unhalt status in hw_init .../devicetree/bindings/display/msm/gmu.yaml | 47 +- .../devicetree/bindings/display/msm/gpu.yaml | 4 +- drivers/gpu/drm/msm/adreno/a6xx.xml.h | 9 + drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 188 ++++-- drivers/gpu/drm/msm/adreno/a6xx_gmu.h | 3 + drivers/gpu/drm/msm/adreno/a6xx_gmu.xml.h | 8 + drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 658 ++++++++++++++++++--- drivers/gpu/drm/msm/adreno/a6xx_gpu.h | 15 + drivers/gpu/drm/msm/adreno/a6xx_gpu_state.c | 52 +- drivers/gpu/drm/msm/adreno/a6xx_gpu_state.h | 61 +- drivers/gpu/drm/msm/adreno/a6xx_hfi.c | 90 ++- drivers/gpu/drm/msm/adreno/adreno_device.c | 26 + drivers/gpu/drm/msm/adreno/adreno_gpu.c | 7 +- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 24 +- drivers/gpu/drm/msm/msm_ringbuffer.h | 2 + 15 files changed, 1070 insertions(+), 124 deletions(-) --- base-commit: 6f9b660e9cbb30669fcfec83288d527c0844717d change-id: 20230628-topic-a7xx_drmmsm-123f30d76cf7 Best regards,