From patchwork Thu Jun 11 08:58:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 11599559 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E707D618 for ; Thu, 11 Jun 2020 08:59:32 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id C239420823 for ; Thu, 11 Jun 2020 08:59:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B5T4Tekl" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C239420823 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A40E56E8B6; Thu, 11 Jun 2020 08:59:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7F8E36E8B6 for ; Thu, 11 Jun 2020 08:59:29 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id l26so4230181wme.3 for ; Thu, 11 Jun 2020 01:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Vkpecle/NufRhIWFw6o8Icsy3Vg8yQBJnNwa3m6TOrY=; b=B5T4TeklMK2kiPUFPKuuVP7i4B9RaICOLmQ0X69pyuhRLLiYf66zl/t9yQbxri1F6x hhbN1Jtyz6XDvHQJMaZWpIo6w1GL4iKvhxLlinIrodsKoW2vSITvlTkWlfvkbvMvowKg FruLct+0aI/LfplSLqucAjJdDDa1Fq+j5pd/kuutGlFTwNx39exJ1+LtTp5exE1Q5XjG GaIrWDswsYmKIR11ri1CuhU3/PQRJHSzO6qOn+g+dSIE6/DT4553GanI+L0rcD13XLcn okgjyULRPyGPAFBnD/VaWjNnk/WDAPPFzueKAwimNMBfDm4+OQxPB4rjioBVVmASEHgs T0CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=Vkpecle/NufRhIWFw6o8Icsy3Vg8yQBJnNwa3m6TOrY=; b=nU68kTwsiHHUWIglA3qxEpq1KHW1GwoRH/yzxoPK5rqcTH82vFI5w5f23OLyOttWih K1gp0IemuGy7bHjH94aIOsCBjcl4QGFp1kC28E7jgeRYfj9az9uOywPgWXynwnBt8lIZ KqKBuwBeRZ5ME+Yeqwf6aAiSVNL8HESsP/a8QOFJrA9tDCej+g8+Om6wkDl3TZRTfxdT f5YmaZmPvaneIs23HcGZVwSM3g+5e6JNFSn0+ZGaGxbD0EII1IksGnPHOcyAL6+t9s/d cCQTwr0PJ4DTrsEKicS3m4UkJPX/cOUD4HgtZDjc95s/bSxJrNflui0pZHPSU2oCLqiB 0aMg== X-Gm-Message-State: AOAM5306I1OgfKRex6F/GVejEiu80LvAS33Ky1q/PGAGWiPdu8aFhHhq bet5opsqxawcf3cC36KKH70TYVXP X-Google-Smtp-Source: ABdhPJwa3GUi28/rl/kCJZRru/8f/xiKju5uiGyA5/rHbxua8XuJbAeq6aH2xxRhczSk1eclm+DSMQ== X-Received: by 2002:a1c:7414:: with SMTP id p20mr7011193wmc.124.1591865968099; Thu, 11 Jun 2020 01:59:28 -0700 (PDT) Received: from cizrna.lan ([109.72.12.141]) by smtp.gmail.com with ESMTPSA id o20sm4205023wra.29.2020.06.11.01.59.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2020 01:59:27 -0700 (PDT) From: Tomeu Vizoso To: LKML Subject: [PATCH 1/2] panfrost: Make sure GPU is powered on when reading GPU_LATEST_FLUSH_ID Date: Thu, 11 Jun 2020 10:58:43 +0200 Message-Id: <20200611085900.49740-1-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.21.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: Tomeu Vizoso , David Airlie , dri-devel@lists.freedesktop.org, Steven Price , Alyssa Rosenzweig Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Bifrost devices do support the flush reduction feature, so on first job submit we were trying to read the register while still powered off. If the GPU is powered off, the feature doesn't bring any benefit, so don't try to read. Signed-off-by: Tomeu Vizoso Tested-by: Heiko Stuebner Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_gpu.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/panfrost_gpu.c index f2c1ddc41a9b..e0f190e43813 100644 --- a/drivers/gpu/drm/panfrost/panfrost_gpu.c +++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "panfrost_device.h" #include "panfrost_features.h" @@ -368,7 +369,16 @@ void panfrost_gpu_fini(struct panfrost_device *pfdev) u32 panfrost_gpu_get_latest_flush_id(struct panfrost_device *pfdev) { - if (panfrost_has_hw_feature(pfdev, HW_FEATURE_FLUSH_REDUCTION)) - return gpu_read(pfdev, GPU_LATEST_FLUSH_ID); + u32 flush_id; + + if (panfrost_has_hw_feature(pfdev, HW_FEATURE_FLUSH_REDUCTION)) { + /* Flush reduction only makes sense when the GPU is kept powered on between jobs */ + if (pm_runtime_get_if_in_use(pfdev->dev)) { + flush_id = gpu_read(pfdev, GPU_LATEST_FLUSH_ID); + pm_runtime_put(pfdev->dev); + return flush_id; + } + } + return 0; } From patchwork Thu Jun 11 08:58:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 11599561 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BBF5C618 for ; Thu, 11 Jun 2020 08:59:37 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 993D720747 for ; Thu, 11 Jun 2020 08:59:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cNtnL98y" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 993D720747 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 55B0B6E8B5; Thu, 11 Jun 2020 08:59:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id 20D156E8B5 for ; Thu, 11 Jun 2020 08:59:35 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id p5so5273173wrw.9 for ; Thu, 11 Jun 2020 01:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yYF1qLiVcqC5+ofUdD+N961rSzft8TLHXK3pdCiJAf4=; b=cNtnL98yUbK2MCL+1+RKeOROIoB5KILcEmhKmzVSQ0JHP2sFlFMpJK5x2EyYKhMjev UWYHxlDYULDROij0/0uRsiQ7ejZvFyVLTCtOnTXZOy6SFSZgP/Um0CgXGUjh7L2HZZzD fxpqR3Hc6bXw3PHPrSq/6JElnTuXsntnW7cB3rappNwxzCynIC+beZ119+lurecYIHfz DUDRypO35acuvv2rERRb1XWP0578Z+NQGLRsa2VyEQ4cWvO3hFaYL39RyrPgjfUzY+2P +ILv81nreYMMHTMpuoJ+R43utIyD2ldbbWuPkOYdZsGJSWeMQSL3WzQ667IWnPZJ50Ph tEtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=yYF1qLiVcqC5+ofUdD+N961rSzft8TLHXK3pdCiJAf4=; b=W0H9AzZOqEmObmgMP7yeCkuqOMxWkCEaWSlX+tzyjbsf+lAvJX2M2AUrL9kxGPPsPB qdzzZ8ps4BH2lHdq81ELR/67XnhyKEiUZTQWlJa4VObkC2QzE7M440ZnZ4sYC24ymwiE 8Fl+YLXxe60DHLsIgcYAI2bYLAd9yUxEh9dqHEc2fXY3/pZ8y+tsMwj87Lh5is8NCk6S CwMz6jPGex2na/OixGPTJfIZnk/8cX2Q5I3SF4xIBdoIclRiHItuT7AO0jyfE0KwSgzR KHX95sYC1oqipBwRwWqnozpMuOpsZMwoowGxu1FH6wGj0t5iVcyhIBogOZoNUeNEkYWr LhGg== X-Gm-Message-State: AOAM530NLsBa83fbgtwyRgGbe0OsjlNDV8+FEO5c+2cipnC6WjPyCJ2X TZUo2+zcwW8g34TAjsFphWc= X-Google-Smtp-Source: ABdhPJzO7ZN5HbQmNp6JjblxAuLk8K1tfrLxFTX4g+Bjh4JseUCjO7OPQwFC79X7Kj44jaFBkZmWUw== X-Received: by 2002:adf:dcc3:: with SMTP id x3mr8137121wrm.93.1591865973844; Thu, 11 Jun 2020 01:59:33 -0700 (PDT) Received: from cizrna.lan ([109.72.12.141]) by smtp.gmail.com with ESMTPSA id o20sm4205023wra.29.2020.06.11.01.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jun 2020 01:59:33 -0700 (PDT) From: Tomeu Vizoso To: LKML Subject: [PATCH 2/2] panfrost: Add compatible string for bifrost Date: Thu, 11 Jun 2020 10:58:44 +0200 Message-Id: <20200611085900.49740-2-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200611085900.49740-1-tomeu.vizoso@collabora.com> References: <20200611085900.49740-1-tomeu.vizoso@collabora.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: Tomeu Vizoso , David Airlie , dri-devel@lists.freedesktop.org, Steven Price , Alyssa Rosenzweig Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Mesa now supports some Bifrost devices, so enable it. Signed-off-by: Tomeu Vizoso Tested-by: Heiko Stuebner Reviewed-by: Heiko Stuebner Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index 882fecc33fdb..8ff8e140f91e 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -677,6 +677,7 @@ static const struct of_device_id dt_match[] = { { .compatible = "arm,mali-t830", .data = &default_data, }, { .compatible = "arm,mali-t860", .data = &default_data, }, { .compatible = "arm,mali-t880", .data = &default_data, }, + { .compatible = "arm,mali-bifrost", .data = &default_data, }, {} }; MODULE_DEVICE_TABLE(of, dt_match);