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: 13301468 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 85454C001B0 for ; Tue, 4 Jul 2023 16:36:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B872010E301; Tue, 4 Jul 2023 16:36:51 +0000 (UTC) Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by gabe.freedesktop.org (Postfix) with ESMTPS id D0E6710E2FF; Tue, 4 Jul 2023 16:36:49 +0000 (UTC) Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-55bc22375b9so495754a12.2; 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: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=UzSRJv8XLjOwu9N9SkRNl3GeeEbA/mczRoKE42KhUZBDpLnN8SMVwB0uenRfuJCN8b waaHIpUMh17xvkfddRCBX+M+Vun5oaZivhuHWCkprAE+WvkX26Wsim7/YW9e91a0WIGh TdrccTADvAQrLlUDXTYGWl8l+UIBYllK/pZhof75h2JqPcWdOwujWBHh778kbuI/xwid VDCqvRUW1XL6xvfKc91nF0gQLlJpTaacnVqtfbDPwJC57GOt+blEvXi91YDVEr2s3gH1 EmY3miJ3sxylCn2XtGeXkuYSoLK9vc4PtH+KNDylyB3fJjvfOqPI9lKgYxX5uMLnNxY/ 6Ssg== X-Gm-Message-State: ABy/qLaIjzZEa3DETH4ziYcn35mZsgyi21GuSC7ip0A7Ho1ESQ4f+hjg nyzTT04l7JSJv2/2B4NCtLe/efefpQI= 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 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 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: Rob Clark , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Konrad Dybcio Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 13301467 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 2668DEB64DD for ; Tue, 4 Jul 2023 16:36:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 509BC10E2FF; Tue, 4 Jul 2023 16:36:51 +0000 (UTC) Received: from mail-oi1-x22a.google.com (mail-oi1-x22a.google.com [IPv6:2607:f8b0:4864:20::22a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1B50B10E301; Tue, 4 Jul 2023 16:36:50 +0000 (UTC) Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-392116b8f31so4065661b6e.2; Tue, 04 Jul 2023 09:36:50 -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=jjuYUrPr/8g1+b21elZrpTsCiOfiRAP2wEz3xVxFSBvptVtqYke/cq5P93OyXS0Nyc dYA+wYhkBtM1UFtSELRByZ6TUgvo9yhSbAP7mxT2aztesZz45Atj0nodf22LDeRyUY3B oBr+yZRJSpo5UwpmTZHeLLpUoeZhYJRg6I2lxBLBM6vStE0jH009wst7x8zECi8E5vS7 rIeZNdlmM8IrULVLrcrLYoJ8joa5qAOFwGnkgQT09y//uenDbetG47utFW0fpVFpQT+o Wp1NGG3NAzbQNo7QP/CbhWnme5WCj2NYZ9lxdr7BGySxv8G/4BffEm+B5pAZPbYMw1Td rVsQ== X-Gm-Message-State: AC+VfDyLN3qLxdquHUzpk++PN2uX+SlanXQ1BYVCXFPmiYjm6v39I0Ua k+rpPnWvJnprByYW89HA40rpLrjDB/s= 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 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 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: Rob Clark , linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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)