Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1193864ybg; Wed, 29 Jul 2020 08:06:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWDwzUbNX61z+RuY2q3Js6rd/uXi97WifA9SHAt6QFNxnyxIK5zC3wqSzm026l9Eq/BTxZ X-Received: by 2002:aa7:c395:: with SMTP id k21mr17121850edq.386.1596035163354; Wed, 29 Jul 2020 08:06:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596035163; cv=none; d=google.com; s=arc-20160816; b=HaZLOD3L+Di7O3EHHWv1i9rJMYp5Y0f2+O5MBaoEB5/agnSNoJ/BW4YraPGoMCTPTw H+q/yBDGHjXSUtbHxkuDB7Cd6z1L5owQRb54HGUX7oxLPhteHQYzWCct9VWkAAHpUETl OvnsgcWTMnODeIgJfCgfwLqBv6uFAztlz6Lp7hsjijmFBIFyKar7Z4O5SIb08XemfKSR ddys55elLK8vi5nCC4Flwuk1cn3imssSp4ETJ8yerdxJkZCH2L0hjGZysP3N4LqI5Z8p MucVELhmCkLoPX9nfZx72/JOVvHj/5Rn2bMcxrWHtdutDvXweW+/lknl2lJLjy3ynfEi Gnqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=WGOW+4ED6By0KB5WrYSp9CvcqoKzYJSfhBgGcHuafBg=; b=Oys+IedAVuUYCRzu6s+6MW9mFiaP4HFX8RC3yzFobSV2HvVcbq5G317qlOcA+sZppn 15R4kl5b4Pu2QGbvkfjn2WAIY/oRfxqeFoMbGZ7Q0qfRtLneQjW39ypQyKCGV7IUeubY 8U2KDW+AwLDIs6BHitXFqEljXqoQ16KCAEnh7hmWFbRXFjGyI7bG/5IEtknTejMi5XjV lkoBZ1QDyxRJqxIoMq9Ik0K4lag7uqoUhBWDMigUy6+jRdVdJxVawBFInVAwEuEVgwDb 2t0uz4GSR/ykG1ZwWhKmZxHzSBkMxmoVYypnrWNBZxmT2yJOtwV6S61Qgh0bjBxNKjMn naSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=orYEuU8o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=raspberrypi.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v8si1636874edl.307.2020.07.29.08.05.34; Wed, 29 Jul 2020 08:06:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@raspberrypi.com header.s=google header.b=orYEuU8o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=raspberrypi.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726502AbgG2PCY (ORCPT + 99 others); Wed, 29 Jul 2020 11:02:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726054AbgG2PCY (ORCPT ); Wed, 29 Jul 2020 11:02:24 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 055D0C061794 for ; Wed, 29 Jul 2020 08:02:24 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id r12so21908987wrj.13 for ; Wed, 29 Jul 2020 08:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WGOW+4ED6By0KB5WrYSp9CvcqoKzYJSfhBgGcHuafBg=; b=orYEuU8o/GDPhYnOGzfx57QASwqpEIZoDm/xxfftrzRdtI0uqeCC4iHYKn7NFYTV4f KeJmDJjL+Rc2grMpL+jqLp4JEoXEcUBt/yYr+8KjrB/As0pJRdj9NkxcpJCh1QgA21/r 0CzGdw+Uf5iqy8NIQapkdVjptLD8AWiaVxdc9F17evrdOWcSRSrnf7Lb1byyXwV2op26 ecAwye9TLPD7MWudrrHQvAkNOCM7AJWXZ+r12RUpT0slzlQqHjJkOeYZnefZQX4kv/5c lLQWxOHM//odrJUMYt/FIBv1r6qGijXMx23gd1nSetLSZOZbrfPi8Rkk67b+lqzB5NV1 7cww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WGOW+4ED6By0KB5WrYSp9CvcqoKzYJSfhBgGcHuafBg=; b=OaiGGhrAqNXJRwrFzxKhid+cEYlGLJCqSloYPpdQ/YpZr0dMZ0ZOuIN5vw5WLvoMmJ hrDEh65MrXtgZJGpEUYi1KavSd3q/oSXPc/RVNafx/N0iQJ9xJGzUM8zCygo6AEXSjQQ bmkpQJnxH28PMv0XSrSS8e0CkadoPDmLmDqhFMdwXj6s6I+TcFjzqJWi+SKZeTSDRvHM oN3uJ9aMSpdDalqbegRp68ld89dzTXoqPUIT6M2mB66mKwnbhgT/iRQVKiIvbuv/huNa MyH/0ET0ioi9cbhWspHXKW+4Ky7XvVH8IUJXBL/gOMre+txhFRjBfeo5cQTpCwPbQNns cJxg== X-Gm-Message-State: AOAM533I2hGVk1nISiXK++J664RuV7jk7+ADdz2wBRv+M0jwdbFobamE gpKs0k9SjrNOCqoRmtbob081vLzxTJ6ZUV6mJ1QP6Q== X-Received: by 2002:adf:fdce:: with SMTP id i14mr24624163wrs.273.1596034942775; Wed, 29 Jul 2020 08:02:22 -0700 (PDT) MIME-Version: 1.0 References: <8af06b31c58ec9745ce13c2aca4e532d6ca340e0.1594230107.git-series.maxime@cerno.tech> In-Reply-To: <8af06b31c58ec9745ce13c2aca4e532d6ca340e0.1594230107.git-series.maxime@cerno.tech> From: Dave Stevenson Date: Wed, 29 Jul 2020 16:02:06 +0100 Message-ID: Subject: Re: [PATCH v4 13/78] drm/vc4: kms: Convert to for_each_new_crtc_state To: Maxime Ripard Cc: Nicolas Saenz Julienne , Eric Anholt , DRI Development , linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, LKML , Tim Gover , Phil Elwell Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maxime On Wed, 8 Jul 2020 at 18:42, Maxime Ripard wrote: > > The vc4 atomic commit loop has an handrolled loop that is basically > identical to for_each_new_crtc_state, let's convert it to that helper. > > Signed-off-by: Maxime Ripard > --- > drivers/gpu/drm/vc4/vc4_kms.c | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c > index 210cc2408087..717673b18132 100644 > --- a/drivers/gpu/drm/vc4/vc4_kms.c > +++ b/drivers/gpu/drm/vc4/vc4_kms.c > @@ -152,14 +152,13 @@ vc4_atomic_complete_commit(struct drm_atomic_state *state) > struct drm_device *dev = state->dev; > struct vc4_dev *vc4 = to_vc4_dev(dev); > struct vc4_hvs *hvs = vc4->hvs; > - struct vc4_crtc *vc4_crtc; > + struct drm_crtc_state *new_crtc_state; > + struct drm_crtc *crtc; > int i; > > - for (i = 0; i < dev->mode_config.num_crtc; i++) { > - if (!state->crtcs[i].ptr || !state->crtcs[i].commit) > - continue; > + for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { > + struct vc4_crtc *vc4_crtc = to_vc4_crtc(crtc); for_each_new_crtc_in_state doesn't check !state->crtcs[i].commit as the hand rolled loop did. Sorry, this is my lack of knowledge, but does that actually make any real difference? I see nothing wrong in calling vc4_hvs_mask_underrun multiple times anyway, so it's most likely going to be harmless anyway, but wanted to query it. Dave > > - vc4_crtc = to_vc4_crtc(state->crtcs[i].ptr); > vc4_hvs_mask_underrun(dev, vc4_crtc->channel); > } > > -- > git-series 0.9.1