From patchwork Mon Jan 2 10:02: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: 38061 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4093537wrt; Mon, 2 Jan 2023 02:05:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXv1cLP7tF8h7Jm3OYiqYD5DM9iuspzEhjHDL4gFhFHs7aD2hl5tBdvj94NyODr33Pu6ypoq X-Received: by 2002:aa7:da49:0:b0:470:489c:5369 with SMTP id w9-20020aa7da49000000b00470489c5369mr35727277eds.6.1672653958625; Mon, 02 Jan 2023 02:05:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672653958; cv=none; d=google.com; s=arc-20160816; b=pNNcjr0Rrgcg4dJcB0sHzY/5WIS1vHJZ1cJwicjsRwW760ztAicJvT3oGG7sFRId7p ilC0UROxmxZz4MqFR6YgAC3F93y4Er4kHAEYSuvmb6outDWIS52uIEpbcbC242u2a0Vs J8oqwUcrWI1UD+lCdzoMZyOSLl7hRRvyrE3/D7U7pEAhXB+p+kp9ZHzJcaNVfW8i/ZgD FueOQiTr/y89bRUbQQF1IA7/4/b4JzdoWCJzd3iA6zxFcN+0mig86Nk1ywz2j0LNz2kl sQAsitIYMzYtgNRJMVm5B6JSifjNP+op+wyrzn60avBvaoaGE8a0RdflrA6bq+Hkgt3S 4cbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=uUvNSUQPHRgkJykKaq60wHpn/k1eJNyp+U1eUmaZ3RQ=; b=IW4I4smQgZEOv3eVMBzKyeTV806oJc/VrbzedfpVY+J5uSZJw1garFjPoFmJCsFkTB Y/zyP/lqXOXMTSKsqkOcikl8MgXb27cA2OJk/rzDZu0jz2ETeoSnfpQvJ/BRxyxEdmRY CaYSYVJHVT1/lLYvcy4BwfKmg/PogK+A8qe77Bez7pjJn3tXtoZXYoY8AtCWnvLB7KGe HkTEgwniyfJX7E9NPyMJCEk9TNDBay4ezHrQ8kvLbADyCdlP4L3CeNx8AN0i+FK6vsgF lgZZP3LwbCm/qgswxd49+tW9eW/ZbhWNXXkz+dBeQKk6PHNgGpXhkI2jCqa8MwqSGxXy g7rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iCYYVJ9Y; 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 n16-20020a056402061000b0046f7741bd0esi22322844edv.598.2023.01.02.02.05.35; Mon, 02 Jan 2023 02:05:58 -0800 (PST) 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=iCYYVJ9Y; 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 S232541AbjABKCZ (ORCPT + 99 others); Mon, 2 Jan 2023 05:02:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231653AbjABKCH (ORCPT ); Mon, 2 Jan 2023 05:02:07 -0500 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8088F16 for ; Mon, 2 Jan 2023 02:02:05 -0800 (PST) Received: by mail-lj1-x22b.google.com with SMTP id f20so28648860lja.4 for ; Mon, 02 Jan 2023 02:02:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uUvNSUQPHRgkJykKaq60wHpn/k1eJNyp+U1eUmaZ3RQ=; b=iCYYVJ9YOn2urXXQ5oAg/nIvLhmW16eVFVswPtvi7YU1Ol8ahihnipPCpixMxuwB5k Dib96+ylAQwD5TvlJjvjfGBrCvwuoG/tH7K7xfLL226pY21IRFTjZYkeP0qhm/idmdz0 +rAuYkYaIFdtYC2JFVRITVbmbsRbmWbbUlKqzZMqmY27YRwKjRIqGIeQX7IwnX7FG+Gk UMfVAzA9ju+x1Ow+GuL/CGvt7dEIGsPXQzuEzrMktBdJ/xgFBfMhFfKuB/wGz/NqB7zH fWRRpJc0W8j3jVUa8kC0BUJg1kpQ3QR/KgAh9QfmAELdtaOkRNQJlO3/zRAoLFTedp72 jq9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=uUvNSUQPHRgkJykKaq60wHpn/k1eJNyp+U1eUmaZ3RQ=; b=io93Ec8tx39jfKkwrhYB5aHrCcbwdfyo12zC0HErb9ku+MBANkk3y/6o35lJ6anE7L WCFFbVh4uzmkpf1PTL9Gh3TI2mDGnFMla9jvxJS91fqXhohXF+c3XChItpJOmckJj4fc 3QMJ2mFr31V1dxnE1cuGk+4spXp3VflmHUlbSza3rr/Emh5YmdrPufVS7rCtHzORYzzR 9jFX+QWHpRrmJBu2bT75tekhDY1g3viNOH2DZVjYyQUJiX/eLTD43mQca91eFEqAKlGy mu/iOuo/xkmlbjO1B9gUgfG4xXOVg4EywCEH5AyybwIWYMZhIJ/c24NI9dM3abUJ8VyT 0u2g== X-Gm-Message-State: AFqh2kqlwXqP5FCDi+o5m2SPMqQoYU+8U7csBpSOzNZkbIQOxtN+JKuZ jhBAkAqMdawmaYoLNsSo3bu3DA== X-Received: by 2002:a2e:b011:0:b0:27f:e512:f2ef with SMTP id y17-20020a2eb011000000b0027fe512f2efmr2463676ljk.44.1672653724222; Mon, 02 Jan 2023 02:02:04 -0800 (PST) Received: from localhost.localdomain (abxi45.neoplus.adsl.tpnet.pl. [83.9.2.45]) by smtp.gmail.com with ESMTPSA id p21-20020a2e9a95000000b0027fc14cdfa5sm2132001lji.42.2023.01.02.02.02.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Jan 2023 02:02:03 -0800 (PST) From: Konrad Dybcio To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Cc: marijn.suijten@somainline.org, Konrad Dybcio , Dmitry Baryshkov , Rob Clark , Abhinav Kumar , Sean Paul , David Airlie , Daniel Vetter , Akhil P Oommen , Jeffrey Hugo , Jordan Crouse , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] drm/msm/adreno: Make adreno quirks not overwrite each other Date: Mon, 2 Jan 2023 11:02:00 +0100 Message-Id: <20230102100201.77286-1-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 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 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?1753904797332979134?= X-GMAIL-MSGID: =?utf-8?q?1753904797332979134?= So far the adreno quirks have all been assigned with an OR operator, which is problematic, because they were assigned consecutive integer values, which makes checking them with an AND operator kind of no bueno.. Switch to using BIT(n) so that only the quirks that the programmer chose are taken into account when evaluating info->quirks & ADRENO_QUIRK_... Fixes: 370063ee427a ("drm/msm/adreno: Add A540 support") Reviewed-by: Dmitry Baryshkov Reviewed-by: Marijn Suijten Reviewed-by: Rob Clark Signed-off-by: Konrad Dybcio Reviewed-by: Akhil P Oommen --- v1 -> v2: - pick up tags - correct the Fixes: tag drivers/gpu/drm/msm/adreno/adreno_gpu.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.h b/drivers/gpu/drm/msm/adreno/adreno_gpu.h index c85857c0a228..5eb254c9832a 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.h +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.h @@ -29,11 +29,9 @@ enum { ADRENO_FW_MAX, }; -enum adreno_quirks { - ADRENO_QUIRK_TWO_PASS_USE_WFI = 1, - ADRENO_QUIRK_FAULT_DETECT_MASK = 2, - ADRENO_QUIRK_LMLOADKILL_DISABLE = 3, -}; +#define ADRENO_QUIRK_TWO_PASS_USE_WFI BIT(0) +#define ADRENO_QUIRK_FAULT_DETECT_MASK BIT(1) +#define ADRENO_QUIRK_LMLOADKILL_DISABLE BIT(2) struct adreno_rev { uint8_t core; @@ -65,7 +63,7 @@ struct adreno_info { const char *name; const char *fw[ADRENO_FW_MAX]; uint32_t gmem; - enum adreno_quirks quirks; + u64 quirks; struct msm_gpu *(*init)(struct drm_device *dev); const char *zapfw; u32 inactive_period;