From patchwork Tue Nov 21 16:21:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 167818 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2b07:b0:403:3b70:6f57 with SMTP id io7csp740795vqb; Tue, 21 Nov 2023 08:22:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBtHIO2xoveICALjaem4/PjKsYD1lh2gz+/lF8Q1HiEgLxXpuRKGfS5MQmXo4D8BrEdgdf X-Received: by 2002:a05:6a00:194c:b0:6cb:4361:9f75 with SMTP id s12-20020a056a00194c00b006cb43619f75mr9929750pfk.22.1700583724884; Tue, 21 Nov 2023 08:22:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700583724; cv=none; d=google.com; s=arc-20160816; b=TI5Kp6cWVcxNZo5AkpNvtzTQaXvkVqM/4Lvz3T1chFOu3iisum6NebM6jLCPUs+632 us25eP08wHHvWUK2fi2vCx3TaVkSQNNtoLsZ8AuOYkVmVGe9Nzan2FtoFdxjDO9601jk VXlSrZi8xpkNEkck/X27Op1xP/26/KLOL0+P8sue+KS9gDDfuRHlVmBxynI3ZvwX7AJ/ QjTk1RdJLA00a8SNAzF7BLziUK0bmQaO9dRLe16HAikuHY91eZnA56aVVLGW1vL69Stu fNagF9O5kCqVu6ACbSNVHsSWpWfTkUoKmj/jHswRM/6Uzt2kLDIp9gzfk7w42u2ff8ev QpXA== 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=KTFRsgH40UD7MzukJZyHOiKKI64hMJVUbzazPe+Qj2U=; fh=kA489uJkJYrod5/HxjRoa/wAfQ4gWjzjL6wZzBBAb9c=; b=FzbC2gNHhYZ71pNYOKmh+/6VZ6Pddh4TTy4pZjz69Mf4++miycLwozqsxhliHnWKA6 hiTPTXZm+sbjsn2FPK++go3o0ZKDDA9/rpR+w8GeYqxBZ4zQFcMaWtAd286PYJ1U/XWX qB4+4Iyg2FKjfFQLPxyGHdPF9ned30jczmj5nc8nuOZvDw5ydZhMXM/qMrxBYpqjDe8v AnrjlwwOydSCJgdVwP/YmgvEzagFH0x7YahhfBcryyoxNW9IBEp1SNlQ/8HnWvJEMwyX QhbsXlnJD7Kxg7sFgOQcVAwHvvlN6YnoRkjRSV68oqW5rnxm9XS8/oixS/K0ze0F57Qm FEaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WipS5yOl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id bm22-20020a656e96000000b005bdd9ef451bsi10976561pgb.874.2023.11.21.08.22.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 08:22:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=WipS5yOl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 3ECEA8024598; Tue, 21 Nov 2023 08:21:57 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230464AbjKUQV4 (ORCPT + 99 others); Tue, 21 Nov 2023 11:21:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbjKUQVy (ORCPT ); Tue, 21 Nov 2023 11:21:54 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4EF58112; Tue, 21 Nov 2023 08:21:51 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2839cf9ea95so2679990a91.1; Tue, 21 Nov 2023 08:21:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700583711; x=1701188511; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=KTFRsgH40UD7MzukJZyHOiKKI64hMJVUbzazPe+Qj2U=; b=WipS5yOlOG4RrpSzlFf3OGQb1AGAVj0GBR70jIC/Yn0Y6NreTMet4+TvQ72NV+QykB BTglDf/9E5sXb4wnWXyk0ZdOdQiXPjJvuAsH/vsrFhRfSTuvkCCmE2+k6qYfeBQYmJDf MTfx1/Lbx1vRSVNduyDcm4hn3uxzwIV7KBe4lR1C1XDk+WUhQbuqPX6wWSvdN3dFZDtA d3UJ2rfL/erP/l/1koQem4ZjqPD+x2kW5LHbjQJc7704MuwyNvRZRCEDZNFa4irDPOyS xj7xOgHKBfkRroXgl4HrDqZHvvKD2JC3K1im/cBWO/nSvRsSze4pOc0ObDSxRXND4Dmu ujow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700583711; x=1701188511; 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=KTFRsgH40UD7MzukJZyHOiKKI64hMJVUbzazPe+Qj2U=; b=M0+VNxSQWemGDB0yn466DxgL/HjjlHMSbEYE2ZaeMUV9220tgwEKzSGUuAacDgJjZT wRBOxkNkZNj6RLd31MGNeGjWbv2UHBXJrQVMuhJ1GZiShkrJt2OPXyDd8oguSYoBzl32 tTSZnnFgAEzYMTr5BkLTZ4bKmd0HCaoWp+prEFvGVXJebGpb2sHrWj+gacW4VKpUVJWt gvSY41KkqSKpxFYaz8/ZOcisBWkibSds9zWEAEWdfXqJDKF+FI3cQXsBPgFgVrrEird6 f6vzLj9RMfCA7kQdhmVYSnopIQElaWLGvmshnt2nx4WOlH+fLZBXFfb1B8nuLdBmxzT/ dFsA== X-Gm-Message-State: AOJu0YyMDY6+eMzwO366TthaXVpcGIayHQHotrHd6cgysEp1IGmk1TLw nGG5ZYBQc8w/FqknfHBYV18= X-Received: by 2002:a17:90a:19c:b0:280:4f82:68ac with SMTP id 28-20020a17090a019c00b002804f8268acmr8403000pjc.24.1700583710574; Tue, 21 Nov 2023 08:21:50 -0800 (PST) Received: from localhost ([47.215.232.245]) by smtp.gmail.com with ESMTPSA id t2-20020a17090aae0200b00274262bcf8dsm9306648pjq.41.2023.11.21.08.21.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Nov 2023 08:21:49 -0800 (PST) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Danylo Piliaiev , Rob Clark , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Konrad Dybcio , Akhil P Oommen , Douglas Anderson , Bjorn Andersson , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] drm/msm/a690: Fix reg values for a690 Date: Tue, 21 Nov 2023 08:21:34 -0800 Message-ID: <20231121162137.60488-1-robdclark@gmail.com> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Tue, 21 Nov 2023 08:21:57 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783191279634831636 X-GMAIL-MSGID: 1783191279634831636 From: Danylo Piliaiev KGSL doesn't support a690 so all reg values were the same as on a660. Now we know the values and they are different from the windows driver. This fixes hangs on D3D12 games and some CTS tests. Signed-off-by: Danylo Piliaiev Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index 8176ea8da7a7..75e1ea0404d3 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1326,6 +1326,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu) amsbc = 1; rgb565_predicator = 1; uavflagprd_inv = 2; + ubwc_mode = 2; } if (adreno_is_7c3(adreno_gpu)) { @@ -1741,7 +1742,9 @@ static int hw_init(struct msm_gpu *gpu) /* Setting the primFifo thresholds default values, * and vccCacheSkipDis=1 bit (0x200) for A640 and newer */ - if (adreno_is_a650(adreno_gpu) || adreno_is_a660(adreno_gpu) || adreno_is_a690(adreno_gpu)) + if (adreno_is_a690(adreno_gpu)) + gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00800200); + else if (adreno_is_a650(adreno_gpu) || adreno_is_a660(adreno_gpu)) gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00300200); else if (adreno_is_a640_family(adreno_gpu) || adreno_is_7c3(adreno_gpu)) gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00200200); @@ -1775,6 +1778,8 @@ static int hw_init(struct msm_gpu *gpu) if (adreno_is_a730(adreno_gpu) || adreno_is_a740_family(adreno_gpu)) gpu_write(gpu, REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL, (1 << 30) | 0xcfffff); + else if (adreno_is_a690(adreno_gpu)) + gpu_write(gpu, REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL, (1 << 30) | 0x4fffff); else if (adreno_is_a619(adreno_gpu)) gpu_write(gpu, REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL, (1 << 30) | 0x3fffff); else if (adreno_is_a610(adreno_gpu)) @@ -1782,7 +1787,10 @@ static int hw_init(struct msm_gpu *gpu) else gpu_write(gpu, REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL, (1 << 30) | 0x1fffff); - gpu_write(gpu, REG_A6XX_UCHE_CLIENT_PF, 1); + if (adreno_is_a690(adreno_gpu)) + gpu_write(gpu, REG_A6XX_UCHE_CLIENT_PF, 0x81); + else + gpu_write(gpu, REG_A6XX_UCHE_CLIENT_PF, 1); /* Set weights for bicubic filtering */ if (adreno_is_a650_family(adreno_gpu)) { @@ -1808,12 +1816,17 @@ static int hw_init(struct msm_gpu *gpu) a6xx_set_cp_protect(gpu); if (adreno_is_a660_family(adreno_gpu)) { - gpu_write(gpu, REG_A6XX_CP_CHICKEN_DBG, 0x1); + if (adreno_is_a690(adreno_gpu)) + gpu_write(gpu, REG_A6XX_CP_CHICKEN_DBG, 0x00028801); + else + gpu_write(gpu, REG_A6XX_CP_CHICKEN_DBG, 0x1); gpu_write(gpu, REG_A6XX_RBBM_GBIF_CLIENT_QOS_CNTL, 0x0); } + if (adreno_is_a690(adreno_gpu)) + gpu_write(gpu, REG_A6XX_UCHE_CMDQ_CONFIG, 0x90); /* Set dualQ + disable afull for A660 GPU */ - if (adreno_is_a660(adreno_gpu)) + else if (adreno_is_a660(adreno_gpu)) gpu_write(gpu, REG_A6XX_UCHE_CMDQ_CONFIG, 0x66906); else if (adreno_is_a7xx(adreno_gpu)) gpu_write(gpu, REG_A6XX_UCHE_CMDQ_CONFIG, From patchwork Sat Nov 25 19:11:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 169772 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp2114132vqx; Sat, 25 Nov 2023 11:12:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IFk4hRs+7FiX2DCgvz5ZVigwfGiljx60rjHeR/yecM/pldv1R0T1loGAfYfY02eNuARD2DB X-Received: by 2002:a05:6e02:174e:b0:35c:9c52:45b6 with SMTP id y14-20020a056e02174e00b0035c9c5245b6mr2097397ill.9.1700939533257; Sat, 25 Nov 2023 11:12:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700939533; cv=none; d=google.com; s=arc-20160816; b=AugdhU2kRJReAdIozuhqlXqfDvhR7qG2z2zHNUOebJ+TU1VVvfwROjSZQLBqm91aun yH4r/BJuQ3t/nthQd8LrB+ZztdxSA2w7oIJbjG9Jq9JbXr2jLNfQS77n5XiLI5GBu4bv 6kAQDovJI6AKXSM/JeGXSlwhuDuPBoRXkwdcmASk04vlhk8r3kXKxxZy9UrvUlvWysOP tsphJVMZLvBAjisrgyrxNgGz/hYqBzVmNjNGhw0lLPWvZpFmdwopFSu68mEVXbTcm61R 9lEWGC94z+DlPsMgYacSbDha6v0be/vZvmENQ1FkqZf8jlAcojWk2bnQZ5CymuPPnMFH 57zg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=InO944iGhkpnbZZ89M4jhM8BqOJsrw18SbpUTux2+2c=; fh=kA489uJkJYrod5/HxjRoa/wAfQ4gWjzjL6wZzBBAb9c=; b=t6uJl3/Lu4CYz9xtRsp/+h/YN+mSlSwf9wBOg7Oktk3iUMcv2VoF2hMsYHaqbRRokJ Z6fBfBYNaMYBlJ8ZOZlAp4YfINwhwWcTu0++L73BXc5+5q6sYRr/vDqICtizGxLdBZY8 BP+Xg/4RarFfj3WgRUzgxXgV1r/BmJfVs3ZbPXVF6yFRNt5BeFtQCwjgoZLCxq6LBZXx MhX6WPJYytN8tp1SguV0LQqCAEfrQRreqfN1AHyScnc70zWFwbxKIZo5wwnEzR3y0YH1 MfVuH39u20JoJaiegqpKCA61O98Tycfar/1ptL6FtM429ytPL+WUC2jGb6Bhc9zSOPXL tJ1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=k+YMqppF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a15-20020a65640f000000b005b92b8e70f1si6288738pgv.27.2023.11.25.11.12.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 11:12:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=k+YMqppF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 58712806502A; Sat, 25 Nov 2023 11:12:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232315AbjKYTMC (ORCPT + 99 others); Sat, 25 Nov 2023 14:12:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230286AbjKYTMB (ORCPT ); Sat, 25 Nov 2023 14:12:01 -0500 Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8BA2F3; Sat, 25 Nov 2023 11:12:07 -0800 (PST) Received: by mail-il1-x12e.google.com with SMTP id e9e14a558f8ab-35b1d57d7dbso9903695ab.3; Sat, 25 Nov 2023 11:12:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700939527; x=1701544327; darn=vger.kernel.org; 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=InO944iGhkpnbZZ89M4jhM8BqOJsrw18SbpUTux2+2c=; b=k+YMqppFCgYM1JhOmczim9wumLqHRSQ5wTsAUydNqfiPkGr8UMorkDPLO9g3PriZDg yjyXFeXAQkeSAtjJHg5NbhXXqXdN/jYoDpLqJHEBcMBf4Tt6cEhN3Lw32QnK14TSpG6V Z39s90+c88e1ebKN5kDObSbRglxvzEJ42mqcWymXJAAKzeVp3+JUqoK3mNvy1c17MRKh k7neeObKGRm0UHSvyvcS6Q3uMbOI/yT4VOOnWIJai3OgiXUuWVtV7dcRpFybG7Jak42Y e3G6eR+3iUQ0ZM5b20/mQnigiezIFYw6Vd/R9mPd8TUpfFlGAu/uY9IPzRcYB6pYCf7k 4+pA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700939527; x=1701544327; 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=InO944iGhkpnbZZ89M4jhM8BqOJsrw18SbpUTux2+2c=; b=RM2taXz8zGpVM3rp+ERURd9AMcxEGDibt0OuvvmEmeWsV60cF6NiIzdpr3fzYoADKi R/FwOlBFX9Jy7pH7KWlBI48jAka8YkBaOkQGABLhWdVwsaOg0RwqhezEop6rRmAxkoh2 Pz5oaWnjRI8KtA0SuxvOBPP3jJOQWKjRMRQW5FcxA31iINO6p2a0C7s6E97AC2AtgX56 CH3Uas4DH3gAvkzxBvmsC6Gzw4XrtghZ2q4bPQ9z1eFkotmAyb4pfIyZIibi2hk086RR BClqKXeoA1SpFCZ2U1ShFeD3uxmD/6Tih8QC24DZ6Ms8Eze5dCfyKMO1CUoK1rXTFqg1 5WMg== X-Gm-Message-State: AOJu0YzLa+DpLw6h75nn5Fuqym4ypx9DoUVBHk/qUBRYhhl2oYpZ9UhO Qb2M6eufwddcuJx0fOd/BCzTyTtlAYY= X-Received: by 2002:a05:6e02:2142:b0:35c:9577:dee with SMTP id d2-20020a056e02214200b0035c95770deemr2672154ilv.1.1700939527119; Sat, 25 Nov 2023 11:12:07 -0800 (PST) Received: from localhost (c-73-37-105-206.hsd1.or.comcast.net. [73.37.105.206]) by smtp.gmail.com with ESMTPSA id d25-20020aa78159000000b006cbae51f335sm4817092pfn.144.2023.11.25.11.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 11:12:06 -0800 (PST) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, Danylo Piliaiev , Rob Clark , Rob Clark , Abhinav Kumar , Dmitry Baryshkov , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Konrad Dybcio , Akhil P Oommen , Douglas Anderson , Bjorn Andersson , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 2/2] drm/msm/a690: Fix reg values for a690 Date: Sat, 25 Nov 2023 11:11:51 -0800 Message-ID: <20231125191155.5375-2-robdclark@gmail.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231121162137.60488-1-robdclark@gmail.com> References: <20231121162137.60488-1-robdclark@gmail.com> 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,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Sat, 25 Nov 2023 11:12:12 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783191279634831636 X-GMAIL-MSGID: 1783564371712599302 From: Danylo Piliaiev KGSL doesn't support a690 so all reg values were the same as on a660. Now we know the values and they are different from the windows driver. This fixes hangs on D3D12 games and some CTS tests. Signed-off-by: Danylo Piliaiev Signed-off-by: Rob Clark Acked-by: Konrad Dybcio --- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index d10b22eeda74..7784d7d39192 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -1312,6 +1312,7 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu) if (adreno_is_a650(adreno_gpu) || adreno_is_a660(adreno_gpu) || + adreno_is_a690(adreno_gpu) || adreno_is_a730(adreno_gpu) || adreno_is_a740_family(adreno_gpu)) { /* TODO: get ddr type from bootloader and use 2 for LPDDR4 */ @@ -1321,13 +1322,6 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu) uavflagprd_inv = 2; } - if (adreno_is_a690(adreno_gpu)) { - hbb_lo = 2; - amsbc = 1; - rgb565_predicator = 1; - uavflagprd_inv = 2; - } - if (adreno_is_7c3(adreno_gpu)) { hbb_lo = 1; amsbc = 1; @@ -1741,7 +1735,9 @@ static int hw_init(struct msm_gpu *gpu) /* Setting the primFifo thresholds default values, * and vccCacheSkipDis=1 bit (0x200) for A640 and newer */ - if (adreno_is_a650(adreno_gpu) || adreno_is_a660(adreno_gpu) || adreno_is_a690(adreno_gpu)) + if (adreno_is_a690(adreno_gpu)) + gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00800200); + else if (adreno_is_a650(adreno_gpu) || adreno_is_a660(adreno_gpu)) gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00300200); else if (adreno_is_a640_family(adreno_gpu) || adreno_is_7c3(adreno_gpu)) gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00200200); @@ -1775,6 +1771,8 @@ static int hw_init(struct msm_gpu *gpu) if (adreno_is_a730(adreno_gpu) || adreno_is_a740_family(adreno_gpu)) gpu_write(gpu, REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL, (1 << 30) | 0xcfffff); + else if (adreno_is_a690(adreno_gpu)) + gpu_write(gpu, REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL, (1 << 30) | 0x4fffff); else if (adreno_is_a619(adreno_gpu)) gpu_write(gpu, REG_A6XX_RBBM_INTERFACE_HANG_INT_CNTL, (1 << 30) | 0x3fffff); else if (adreno_is_a610(adreno_gpu)) @@ -1808,12 +1806,17 @@ static int hw_init(struct msm_gpu *gpu) a6xx_set_cp_protect(gpu); if (adreno_is_a660_family(adreno_gpu)) { - gpu_write(gpu, REG_A6XX_CP_CHICKEN_DBG, 0x1); + if (adreno_is_a690(adreno_gpu)) + gpu_write(gpu, REG_A6XX_CP_CHICKEN_DBG, 0x00028801); + else + gpu_write(gpu, REG_A6XX_CP_CHICKEN_DBG, 0x1); gpu_write(gpu, REG_A6XX_RBBM_GBIF_CLIENT_QOS_CNTL, 0x0); } + if (adreno_is_a690(adreno_gpu)) + gpu_write(gpu, REG_A6XX_UCHE_CMDQ_CONFIG, 0x90); /* Set dualQ + disable afull for A660 GPU */ - if (adreno_is_a660(adreno_gpu)) + else if (adreno_is_a660(adreno_gpu)) gpu_write(gpu, REG_A6XX_UCHE_CMDQ_CONFIG, 0x66906); else if (adreno_is_a7xx(adreno_gpu)) gpu_write(gpu, REG_A6XX_UCHE_CMDQ_CONFIG,