From patchwork Wed Feb 14 06:46:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 128313 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp293046ljc; Tue, 13 Feb 2018 22:47:05 -0800 (PST) X-Google-Smtp-Source: AH8x226EaWRnlesZTv26zncol5s+D8NmGqBHqRFje8uAKin4BwhWir1i7qZ68Rf7HjEaWlL4hBbG X-Received: by 10.99.127.29 with SMTP id a29mr1103301pgd.451.1518590825649; Tue, 13 Feb 2018 22:47:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518590825; cv=none; d=google.com; s=arc-20160816; b=dz6v094Kvh1bA6akMG5k2d0i3INNOtKE+ty8ji40+FORx00fjhPx4rDprKjWyayD9k J9wXG/754X7vZaIJA7HZzRnkMBWdHI/blznMTl6f+wrrnuJCEJ2ZqJMTFJLnpTW+GCcJ IrkD0KQt6R+4QD5JRke/OgASMAwMA/e/HV/FBDTjYy2CeUCK9tPijbMt9CSDIyCvjX3N +BffKCj5Ixgr2mx2xjDsasd4nfWVQJfth9EoZWiQHJRRIKwnxgOZ9d+SOJE0DdHiRdpQ XTl2APp/MB2mQ2DnlvoWUc+Aqk8oN4wgHKT6/TEXCvPcrQ2jEASkNirGFKWOcx8RO+Nl 4osA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=NOT7J9jrOU/+LJjxB7M6IIPJjV40kBuuAYCYFxocZJQ=; b=fslPTYZFhouWFHPTrwsuSXygsI+tGdukPz0QLjVaWxzJuYQGYii8rEFV+y6OE2nAlC 6eUkGD4UOv+y+TgElJBrUtOoui/pb6NWoStWjfLg1Bnes+fXN/95yk6vGunGm3fmr7cK yEl3kxEjNkIL4dyMYawwTmv19fHxNnVqASyzEU+wUU/FwxYh1Hg2BLgbl3MyhoTOoRDw oMAocq8vtbotbNHcPagw5fQ64gKR9smNa49Rp1uHLbh8WoWMrycNJ2XlLqPpZTXsaUeo 4lLuOlBJL32z9kbUf9mA9wdiCbl0GZ9dN/fgQwIIOGDe8cUAj75HZGnzTF1kXC1hlVDC Da9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=cpmKp9sV; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e15si2300024pgv.204.2018.02.13.22.47.05; Tue, 13 Feb 2018 22:47:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=cpmKp9sV; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754388AbeBNGrD (ORCPT + 10 others); Wed, 14 Feb 2018 01:47:03 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:36953 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754364AbeBNGrC (ORCPT ); Wed, 14 Feb 2018 01:47:02 -0500 Received: by mail-pl0-f67.google.com with SMTP id ay8so8042885plb.4 for ; Tue, 13 Feb 2018 22:47:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=KHggAL1Aj2Kl9uA+Qe2DcvOxpsLNc6LdZYqvXQe9c3o=; b=cpmKp9sVz6FZXQWmBn6L6odQvtGbtpz0vNf77T1RWhu0xoSRM7WjErr2FmmbWBekC8 KuZFwjZxNdgUDKguIOaV+RQ12hJW/YHO8rdWPwvrb891Aw88vFgVyPPhe0wq2AHnl5hA CKusEpV0eYgX51Sla3aWReHFtKR3T1AS2j10Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=KHggAL1Aj2Kl9uA+Qe2DcvOxpsLNc6LdZYqvXQe9c3o=; b=GI8SnJwTFMrmT56MMRF7XJV89phlGmbz0T8fFN4vkVm9/4n7vOdjyzSWW8kxCYtg21 nBqq7eqMIOGN9QGMLgSxMySIwxOe/VOHbwiCPCKajCNHO0m5BZLVRcltTUpPae2bkMea kvy4vGrzzQNPZyn+hAL/nR4X3s5/g+ymw9uIW6PymK8Y0lxrJK7Fg+DLd13w5EJGUZe+ ZE57u1fKmL8zKcokV7pbSSJIy+X+SIlpe0QOVvYC+9Oz04aQL7A2Me4YS2HG8L1GOkZH LM5nZJ80f/Pf72ViT7RQpk7rE/wUF/tD3TdfGnPKrBI6PSyrkx6nrw/+alHixH7YYPSZ hMUQ== X-Gm-Message-State: APf1xPDSPeRR7ZpTl33WJVhisCWerlIW8GDWZh9EY9Jopk+r3ykywbxw FuqKY6CRs9qDavSNG5WXWHRpCw== X-Received: by 2002:a17:902:5a3:: with SMTP id f32-v6mr3545891plf.48.1518590821934; Tue, 13 Feb 2018 22:47:01 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id m4sm22891925pfh.150.2018.02.13.22.47.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Feb 2018 22:47:01 -0800 (PST) From: Bjorn Andersson To: Rob Clark , Jordan Crouse Cc: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [RFT PATCH] drm/msm: Trigger fence completion from GPU Date: Tue, 13 Feb 2018 22:46:58 -0800 Message-Id: <20180214064658.15741-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.15.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Interrupt commands causes the CP to trigger an interrupt as the command is processed, regardless of the GPU being done processing previous commands. This is seen by the interrupt being delivered before the fence is written on 8974 and is likely the cause of the additional CP_WAIT_FOR_IDLE workaround found for a306, which would cause the CP to wait for the GPU to go idle before triggering the interrupt. Instead we can set the (undocumented) BIT(31) of the CACHE_FLUSH_TS which will cause a special CACHE_FLUSH_TS interrupt to be triggered from the GPU as the write event is processed. Add CACHE_FLUSH_TS to the IRQ masks of A3xx and A4xx and remove the workaround for A306. Suggested-by: Jordan Crouse Signed-off-by: Bjorn Andersson --- This is only tested on 8974. drivers/gpu/drm/msm/adreno/a3xx_gpu.c | 1 + drivers/gpu/drm/msm/adreno/a4xx_gpu.c | 1 + drivers/gpu/drm/msm/adreno/adreno_gpu.c | 18 ++---------------- 3 files changed, 4 insertions(+), 16 deletions(-) -- 2.15.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c index 4baef2738178..a3a43be920d0 100644 --- a/drivers/gpu/drm/msm/adreno/a3xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a3xx_gpu.c @@ -35,6 +35,7 @@ A3XX_INT0_CP_RB_INT | \ A3XX_INT0_CP_REG_PROTECT_FAULT | \ A3XX_INT0_CP_AHB_ERROR_HALT | \ + A3XX_INT0_CACHE_FLUSH_TS | \ A3XX_INT0_UCHE_OOB_ACCESS) extern bool hang_debug; diff --git a/drivers/gpu/drm/msm/adreno/a4xx_gpu.c b/drivers/gpu/drm/msm/adreno/a4xx_gpu.c index 8199a4b9f2fa..b44cd0d90621 100644 --- a/drivers/gpu/drm/msm/adreno/a4xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a4xx_gpu.c @@ -27,6 +27,7 @@ A4XX_INT0_CP_RB_INT | \ A4XX_INT0_CP_REG_PROTECT_FAULT | \ A4XX_INT0_CP_AHB_ERROR_HALT | \ + A4XX_INT0_CACHE_FLUSH_TS | \ A4XX_INT0_UCHE_OOB_ACCESS) extern bool hang_debug; diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c index de63ff26a062..5806f9942514 100644 --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c @@ -293,26 +293,12 @@ void adreno_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit, OUT_RING(ring, 0x00000000); } + /* BIT(31) of CACHE_FLUSH_TS triggers CACHE_FLUSH_TS IRQ from GPU */ OUT_PKT3(ring, CP_EVENT_WRITE, 3); - OUT_RING(ring, CACHE_FLUSH_TS); + OUT_RING(ring, CACHE_FLUSH_TS | BIT(31)); OUT_RING(ring, rbmemptr(ring, fence)); OUT_RING(ring, submit->seqno); - /* we could maybe be clever and only CP_COND_EXEC the interrupt: */ - OUT_PKT3(ring, CP_INTERRUPT, 1); - OUT_RING(ring, 0x80000000); - - /* Workaround for missing irq issue on 8x16/a306. Unsure if the - * root cause is a platform issue or some a306 quirk, but this - * keeps things humming along: - */ - if (adreno_is_a306(adreno_gpu)) { - OUT_PKT3(ring, CP_WAIT_FOR_IDLE, 1); - OUT_RING(ring, 0x00000000); - OUT_PKT3(ring, CP_INTERRUPT, 1); - OUT_RING(ring, 0x80000000); - } - #if 0 if (adreno_is_a3xx(adreno_gpu)) { /* Dummy set-constant to trigger context rollover */