Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp635733imu; Tue, 11 Dec 2018 05:14:54 -0800 (PST) X-Google-Smtp-Source: AFSGD/UIA/spZ6UXUbfcE1hvLf3vSt1tDVC/S8QWFE09b1XJdVCMehvwM5Gd3Qi3jKe9+sVk5SLk X-Received: by 2002:a63:6f0d:: with SMTP id k13mr14401475pgc.42.1544534094328; Tue, 11 Dec 2018 05:14:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544534094; cv=none; d=google.com; s=arc-20160816; b=cN15frvDm2zx0iyc0F53IbtoW7PIcMmTRDPNsUaBvjyGU7rsrFxeaZS+JS9/eLvUAU nKo4K9xbxt/IT+C/eYOoVxkx1E1zs1ymG5oCO7iy90XY96oj4YLbB8DRBSUy6MLC1yEf ltdObFQV6SrK6Ey4eiZQO1QmCZCjMyhbjM8K5rguLurh8oUPNCVKZ7xmuL6PzJ99XFc6 DFZZ+f6EDtNEH4X3IWiv42oSUX3kkLPFlpR0R5w0YD0yLbcPsK7zszQe/I3T0QXdpy+v p2t1gF60vM/bY20NjTjonr0WQz1s6TYKmYJMuqFJ+K+1audLVpGCYnmPScLnhk6/QfWP zlxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=VQlwzi+N7m8Wb+MPFkE/dqoEKI3Qfz8KXqya+6nMQ4Q=; b=xnJjB5H7ASlWZYWsuqc+NrwoVEa1mo9oVp5OETJvGueyXDo0Ws7LRd5ngzsPIB4ZNC 29KDINdeP2wzNanVpqqK+P/2//9RY1A+E9D+Jpv47Mh4fXBbkXxPmbLQLo20eC5zBIN/ IHPwIqFijsDuy8qgi43rZsGAhDDIDgfcD8QqfflAyW+Qwvk/q9Gd5AxO5rwatsCjyXcH XdvEzmgHPd6NJxnoMbygtzVj1gusuEFTzLKWn8wem21itVviHpPtCqkJkbfQAeWDZWXO 6B3NRSseW8OQgFgoSbf74dOWxEhnoS2J778gtnH7v+n1UUpsfGV9Bhc1oEv9Ts6nIm9p kxUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 10si11882073pgk.101.2018.12.11.05.14.39; Tue, 11 Dec 2018 05:14:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726465AbeLKNMh (ORCPT + 99 others); Tue, 11 Dec 2018 08:12:37 -0500 Received: from mail.bootlin.com ([62.4.15.54]:48339 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726135AbeLKNMh (ORCPT ); Tue, 11 Dec 2018 08:12:37 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id 2DE4620711; Tue, 11 Dec 2018 14:12:35 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.2 Received: from bbrezillon (aaubervilliers-681-1-89-7.w90-88.abo.wanadoo.fr [90.88.30.7]) by mail.bootlin.com (Postfix) with ESMTPSA id E1B992039F; Tue, 11 Dec 2018 14:12:34 +0100 (CET) Date: Tue, 11 Dec 2018 14:12:33 +0100 From: Boris Brezillon To: Paul Kocialkowski Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Eric Anholt , David Airlie , Maxime Ripard , Thomas Petazzoni Subject: Re: [PATCH v3] drm/vc4: Add a debugfs entry to disable/enable the load tracker Message-ID: <20181211141233.79709688@bbrezillon> In-Reply-To: <20181207134757.32437-1-paul.kocialkowski@bootlin.com> References: <20181207134757.32437-1-paul.kocialkowski@bootlin.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 7 Dec 2018 14:47:57 +0100 Paul Kocialkowski wrote: > diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c > index f3fd34faa812..e80b1ad5c938 100644 > --- a/drivers/gpu/drm/vc4/vc4_kms.c > +++ b/drivers/gpu/drm/vc4/vc4_kms.c > @@ -479,6 +479,7 @@ static const struct drm_private_state_funcs vc4_load_tracker_state_funcs = { > static int > vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) > { > + struct vc4_dev *vc4 = to_vc4_dev(dev); > int ret; > > ret = vc4_ctm_atomic_check(dev, state); > @@ -489,7 +490,10 @@ vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) > if (ret) > return ret; > > - return vc4_load_tracker_atomic_check(state); > + if (vc4->load_tracker_enabled) > + return vc4_load_tracker_atomic_check(state); Even if we don't return an error when ->load_tracker_enabled is false, we should keep updating the ->{hvs,membus}_load state, otherwise those fields will contain bad values if we activate the load tracker after the planes have been enabled. I suggest moving this test in vc4_load_tracker_atomic_check() just before if (load_state->membus_load > SZ_1G + SZ_512M)