From patchwork Tue Jul 4 16:36:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 13301465 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 322E3EB64D9 for ; Tue, 4 Jul 2023 16:36:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229647AbjGDQgu (ORCPT ); Tue, 4 Jul 2023 12:36:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231292AbjGDQgt (ORCPT ); Tue, 4 Jul 2023 12:36:49 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51013C9 for ; Tue, 4 Jul 2023 09:36:48 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-55ba895d457so1097635a12.0 for ; Tue, 04 Jul 2023 09:36:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688488608; x=1691080608; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LFRDc3E8OmLDCka2bpsiEu+dF663MCo3+8JyB3tlqiA=; b=b8lDTLFAR2docihZsVjV18uNg9C8vC/+5Q0wSbALcHKwcbEq5Ff+VF+6DTFrHT1U6d ct4yryNfOCCR0UftSWdth2TX5yqzp8eGg/bJ9farhTywo+5aWW6iqxdhslhTDHwsGND0 rkNhb232i9REaZeEgcoN48m237QjGAW9P8cmYpQ3xjRjOhIXyOxqWc0WXIW4KfCKDipC JoRQwvdyXvFWDAGN3D/o+tyrXe8SE7rfbLYyg+YffM4PFnCmNX/5QzTIQhXPQ4yNqHZR DpXo0rINg6gg/hn/acFSGOQM21bImVdG1ZJ4Uto6TT5BeyXc+bg7nAY8Pb0VEUveC+8H qUxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688488608; x=1691080608; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LFRDc3E8OmLDCka2bpsiEu+dF663MCo3+8JyB3tlqiA=; b=PMtYzM1pdNGM6Ob8cCv0+VAIiC8fPmXTmmIcUhgbMN0T2vycXGBu6aVmgY5VyHLmG+ WHKXtdixEhHSoghAq07MjsxU55Qzmx8EbJISzF0SV1qmnbTNDVPzQcYWeSMDFTXhxZSk oOKlFsFxs9I3v7jvfYtQjMKMrCUcxtmomiHIwEOhFMsnA+lv7lm3hMCopMTlXNoDt3AL bpIq4kxVzacZDwaOaDsehmWoKuGrOwYG053D+td6Ig/aPJZ7h73JNDx1OERkxgsD3q/r XFPHyk08JnassiO26tHguWVxqeWAGzPj2JpI1G6rPcw2hBHX71o5NzLsiK5H7nb3EE3w IcEA== X-Gm-Message-State: ABy/qLZIcmYBSmToPbYqIgpg1dc9iZ9ABfCCGejFZuhOFhGLLwuOjluW z+JZSDk380DArzpU5AL5PRU= X-Google-Smtp-Source: APBJJlEbj7WnCbDxIv9ZoCO8MVBlhz3BBSYckJj3OB/5xPq/MNXLATSeykAMPdtKJgs3TAubTtnI9g== X-Received: by 2002:a05:6a20:a11a:b0:12f:7a6b:63d2 with SMTP id q26-20020a056a20a11a00b0012f7a6b63d2mr620338pzk.6.1688488607612; Tue, 04 Jul 2023 09:36:47 -0700 (PDT) Received: from localhost ([2601:1c0:5000:d5c:ae1c:de46:682a:206]) by smtp.gmail.com with ESMTPSA id m12-20020aa78a0c000000b00679d3fb2f92sm13044627pfa.154.2023.07.04.09.36.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 09:36:47 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Rob Clark , Konrad Dybcio Subject: [PATCH 1/2] drm/msm/adreno: Fix warn splat for devices without revn Date: Tue, 4 Jul 2023 09:36:39 -0700 Message-ID: <20230704163640.6162-1-robdclark@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Rob Clark Recently, a WARN_ON() was introduced to ensure that revn is filled before adreno_is_aXYZ is called. This however doesn't work very well when revn is 0 by design (such as for A635). Cc: Konrad Dybcio Fixes: cc943f43ece7 ("drm/msm/adreno: warn if chip revn is verified before being set") Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov Tested-by: Abhinav Kumar # sc7280 --- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h index 65379e4824d9..ef1bcb6b624e 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h @@ -149,7 +149,8 @@ bool adreno_cmp_rev(struct adreno_rev rev1, struct adreno_rev rev2); static inline bool adreno_is_revn(const struct adreno_gpu *gpu, uint32_t revn) { - WARN_ON_ONCE(!gpu->revn); + /* revn can be zero, but if not is set at same time as info */ + WARN_ON_ONCE(!gpu->info); return gpu->revn == revn; } @@ -161,14 +162,16 @@ static inline bool adreno_has_gmu_wrapper(const struct adreno_gpu *gpu) static inline bool adreno_is_a2xx(const struct adreno_gpu *gpu) { - WARN_ON_ONCE(!gpu->revn); + /* revn can be zero, but if not is set at same time as info */ + WARN_ON_ONCE(!gpu->info); return (gpu->revn < 300); } static inline bool adreno_is_a20x(const struct adreno_gpu *gpu) { - WARN_ON_ONCE(!gpu->revn); + /* revn can be zero, but if not is set at same time as info */ + WARN_ON_ONCE(!gpu->info); return (gpu->revn < 210); } From patchwork Tue Jul 4 16:36:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 13301466 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 97DE6EB64DA for ; Tue, 4 Jul 2023 16:36:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231523AbjGDQgv (ORCPT ); Tue, 4 Jul 2023 12:36:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231418AbjGDQgu (ORCPT ); Tue, 4 Jul 2023 12:36:50 -0400 Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68EF7119 for ; Tue, 4 Jul 2023 09:36:49 -0700 (PDT) Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3a3373211a1so4079369b6e.0 for ; Tue, 04 Jul 2023 09:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688488608; x=1691080608; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wsDIOc3R7jPNwTF/e6mDLa85oKfSVIk5sf29NNlXYoo=; b=BNGhEo+uWE2gf6vcAtz9IUj1pNkWKnQ/9F72dBHhIdx5lmFGHct7rGrHWMJMrEidQE WixrlzXEOD2kSQrWV4ukAl68JI5CNYt59zH9oSxi/OySWJLvLG9L8Bvod+YhIeFUVO8q U+aS926WL2MznTIUSAjaG/+aBHvNuXkQOSjJ3i5pMGVqU9kUCyPGLnmKRyr4M795My8I ftgZVQ0jURW1323MrK2KzwJW+nJpeVofDL/78Y7m2oY4v2prYJt/ElLRTvwCkP8YGPZY 3Usy/Wy0BPRPwGvdbOPc6c43vzXfBuzZ3LdXvb6SNyKh4udJBTDJK6p4jN1Ynn25AsBa yBxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688488608; x=1691080608; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wsDIOc3R7jPNwTF/e6mDLa85oKfSVIk5sf29NNlXYoo=; b=dW2wdyvNmlWqOCeeHnFq9IFo+3nBpOwaMxaDTZ9yTvg2gGvck370OTgPuUUi6K5/E/ DZblHNcSQ6rJp4GBhs9Z27aqiGOVsG7HI7awYgqPiWgcWZ9+siNnUzx9hVr+WoNIjpHZ +W5isaHYja4MMOF2UHTTw88EqB8L2oVSbHCMxtlJpZwtu9Zm8E0j6IuaqITq6M0VbZWV CyIo6P1UWCmyWBIvELUt+pbwgaukCdy8Gc68olQbYFADjy7s34CrqbD1EMwY3fP1nQ/z m0ki1dYNutkjhtzB1vRvK2T0qRTJ/HAPnj9E8UVhQ0xiH+nXhfwCpc5IVP7YOigz/bQb 4Iow== X-Gm-Message-State: AC+VfDyfn1gTG8RpnSsQOd1wy1zOpWKsPdi6fmbSXZkWD/qbcS2d/5Qu /rRCDAAGj/14fSsXmX93N2V9jWnx+DY= X-Google-Smtp-Source: ACHHUZ5CifixBgOlH8+wBhSbr7oMIhcVC4UGtOJbSsbDi9p06FpbFUtR6PZoChSy3HyYsBG5FxRCNA== X-Received: by 2002:a05:6808:1792:b0:3a3:69de:d385 with SMTP id bg18-20020a056808179200b003a369ded385mr18508474oib.6.1688488608703; Tue, 04 Jul 2023 09:36:48 -0700 (PDT) Received: from localhost ([2601:1c0:5000:d5c:ae1c:de46:682a:206]) by smtp.gmail.com with ESMTPSA id k23-20020aa792d7000000b00682ad247e5fsm1013081pfa.179.2023.07.04.09.36.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 09:36:48 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Rob Clark Subject: [PATCH 2/2] drm/msm/a690: Remove revn and name Date: Tue, 4 Jul 2023 09:36:40 -0700 Message-ID: <20230704163640.6162-2-robdclark@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230704163640.6162-1-robdclark@gmail.com> References: <20230704163640.6162-1-robdclark@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Rob Clark These fields are deprecated. But any userspace new enough to support a690 also knows how to identify the GPU based on chip-id. Signed-off-by: Rob Clark Reviewed-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/adreno/adreno_device.c | 2 -- drivers/gpu/drm/msm/adreno/adreno_gpu.h | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_device.c b/drivers/gpu/drm/msm/adreno/adreno_device.c index cb94cfd137a8..ce8d0b2475bf 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_device.c +++ b/drivers/gpu/drm/msm/adreno/adreno_device.c @@ -369,8 +369,6 @@ static const struct adreno_info gpulist[] = { .hwcg = a640_hwcg, }, { .rev = ADRENO_REV(6, 9, 0, ANY_ID), - .revn = 690, - .name = "A690", .fw = { [ADRENO_FW_SQE] = "a660_sqe.fw", [ADRENO_FW_GMU] = "a690_gmu.bin", diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h index ef1bcb6b624e..cf45007400c8 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h @@ -310,7 +310,8 @@ static inline int adreno_is_a680(const struct adreno_gpu *gpu) static inline int adreno_is_a690(const struct adreno_gpu *gpu) { - return adreno_is_revn(gpu, 690); + /* The order of args is important here to handle ANY_ID correctly */ + return adreno_cmp_rev(ADRENO_REV(6, 9, 0, ANY_ID), gpu->rev); }; /* check for a615, a616, a618, a619 or any derivatives */ static inline int adreno_is_a615_family(const struct adreno_gpu *gpu)