From patchwork Thu Mar 11 17:06:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 12132191 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BF1CAC433DB for ; Thu, 11 Mar 2021 17:06:19 +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 6A9A164ECE for ; Thu, 11 Mar 2021 17:06:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A9A164ECE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 49DB76EA8A; Thu, 11 Mar 2021 17:06:18 +0000 (UTC) Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7622B6EA96 for ; Thu, 11 Mar 2021 17:06:16 +0000 (UTC) Received: by mail-lf1-x131.google.com with SMTP id k9so40933428lfo.12 for ; Thu, 11 Mar 2021 09:06:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PrdT1wQhy9IxbC6XumdouIDu0exhn3fHS2Os4khyfHU=; b=GMmSyrJfRU2L+dVXxXLx/8DqgviBZWz3HocHK7mj8r0efL5mxrYP0ppCFBnHBbxBGW U5o4ywGa8IIOH0Nz8MMgkoToZdddhZzlHLxxtQfnE29QrbN+OQKozJsL8xemqDgrrSCt BmC2kkjgTNn6jm7DqIUnMd0cl9OK0QFNTnY8EjAAmT43cIFRTts/SbLcWkBr//0YnciY kzBlmt89Y5M1gpGHpZk1ugljriB5kQWwZGUPj4k/iKWenQSOQw4D3HdjUf0MoEHwO2sq Lpuu74Hp3cQmRUPkl0LzDbswMDfJdRQK74ls9YHOyT2gKsDwNsW8kHB6efsFXdSSWmyB JkVg== 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:mime-version :content-transfer-encoding; bh=PrdT1wQhy9IxbC6XumdouIDu0exhn3fHS2Os4khyfHU=; b=ZJuKno3srj8wofL9fWuuaP3Po6KtBoyQ8GlyIjN6hUXkzqroXp6B8FRhc/Mpt11Tfo C27tWRuDesHFC4JvQMN7WAh+88DEeWDqBvLQ9GyutqVWc48rl2D0I/eqMiAfBwzSSvCZ oCYEAHboM/wcTlPmQRF7QJULZTLcybj/HPdxSpdy+DC/zVjqQ+LxLp6evE3xzmmdFICk lAf8q6fVHT6DHbbMukTUdMqdtLGSWDRgyfnCw/6sssyn9KAuejXwSOMq2MHaTctqoxcd t4KrKVCg8vKkuMmMXd+iIEpCdhMV4xXPHOmN9wpTZ9UhUzHVY2JJkyXsQ1FsOIeYDf7K YIyw== X-Gm-Message-State: AOAM533Ny19YkB5+0xTe7jcz5iII5CKDQNaX9otozt096vowt0HCDOOe nnXx4CD2k9TsOCqX3WpUxa4= X-Google-Smtp-Source: ABdhPJwrJiFcYr+8LThGxa9P1GY6Znhfa3CkzooW8UnHgQLBu8SQXV3ps13DVvhLzlk92OR4brVbJA== X-Received: by 2002:ac2:46d6:: with SMTP id p22mr2744651lfo.625.1615482374798; Thu, 11 Mar 2021 09:06:14 -0800 (PST) Received: from localhost.localdomain (109-252-193-52.dynamic.spd-mgts.ru. [109.252.193.52]) by smtp.gmail.com with ESMTPSA id p5sm1166009ljj.26.2021.03.11.09.06.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Mar 2021 09:06:14 -0800 (PST) From: Dmitry Osipenko To: Thierry Reding , Jonathan Hunter , Matt Merhar , Peter Geis , Nicolas Chauvet Subject: [PATCH v14 0/2] Add memory bandwidth management to NVIDIA Tegra DRM driver Date: Thu, 11 Mar 2021 20:06:04 +0300 Message-Id: <20210311170606.7543-1-digetx@gmail.com> X-Mailer: git-send-email 2.29.2 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: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-pm@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This series adds memory bandwidth management to the NVIDIA Tegra DRM driver, which is done using interconnect framework. It fixes display corruption that happens due to insufficient memory bandwidth. Changelog: v14: - Made improvements that were suggested by Michał Mirosław to v13: - Changed 'unsigned int' to 'bool'. - Renamed functions which calculate bandwidth state. - Reworked comment in the code that explains why downscaled plane require higher bandwidth. - Added round-up to bandwidth calculation. - Added sanity checks of the plane index and fixed out-of-bounds access which happened on T124 due to the cursor plane index. v13: - No code changes. Patches missed v5.12, re-sending them for v5.13. Dmitry Osipenko (2): drm/tegra: dc: Support memory bandwidth management drm/tegra: dc: Extend debug stats with total number of events drivers/gpu/drm/tegra/Kconfig | 1 + drivers/gpu/drm/tegra/dc.c | 362 ++++++++++++++++++++++++++++++++++ drivers/gpu/drm/tegra/dc.h | 19 ++ drivers/gpu/drm/tegra/drm.c | 14 ++ drivers/gpu/drm/tegra/hub.c | 3 + drivers/gpu/drm/tegra/plane.c | 127 ++++++++++++ drivers/gpu/drm/tegra/plane.h | 15 ++ 7 files changed, 541 insertions(+)