Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp754791ybt; Wed, 8 Jul 2020 10:49:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZoVsxJjqDtSM57lZPeKjNKmrth7eiq61pdHkgK3M/0F/aZVB1rCxBCPoHiKiS74Hwlcus X-Received: by 2002:a17:906:4316:: with SMTP id j22mr3718324ejm.539.1594230581656; Wed, 08 Jul 2020 10:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594230581; cv=none; d=google.com; s=arc-20160816; b=g5moCpVtuM3jp4hQ9NAnHn2mh7Lyz3p3hP/OhhGw7NeU3OYJVZN1d3Y5b4NFq4z9Y/ F6ERkmi5ZTrRo7s3j/6CiT7VyaH8h4aKXgRgIMknk7oUQF6fsjzW1w6g9z58cR3uiHfn KrA0LK6F/j5TvzcHlCF3oXCPhcaKwxnt80qL7DLfcUo/g3PUJWplt90YV5Gmg8A0S2yj MQrAWyiWinyBdMsFkaL4HTLp5IQbWS1pfGDofcs7DGly8jdFUqvPl1Bj0+gjToCoJsmI usMu8Zs72PlbPj8BkqZhx+El9wGEuyJDtb3MYP47hMbyAu1PQ4rlcgmdE2t8TdmZZzeF 7VuA== 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:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=+GsL/PhEM1vcChoGS1OCu8EP3VmI+pijDvz5ksKewGI=; b=KZmoCS4H1rd6/k4vRFc3A4XbjgyoVuck2XtNUe0HxVdP6hycLhv47Zg8Or8E7XZJr8 NEVXPPKkPrXvAMozWRe0dspvs3CCUSDxh5L6cXw9eO71a4A0bbfUsquoVC6/9mzc0i8l eojV8v4rxFQbwPcQqaNiNdR0sQCx3tVKGQePcrcLHMCC/8pRf8jZBFHhuwyuEcY64ruV KqZnubyc40oh6QvfOnouDRDL0hplJlbS39P7X8VGXHLH8H/7CXxBJTVjkoOGlNXKSJPW 3sFruo+Jgi7ipHfgNOfOaoT9zKOVhTYcmEmb/gu5IGmLTpuO8xMEn0xHrk7HeZ+UGXO8 LpRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cerno.tech header.s=fm3 header.b=r2V6N3BP; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=WKTANOBb; 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=cerno.tech Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dd7si327893ejb.615.2020.07.08.10.49.19; Wed, 08 Jul 2020 10:49:41 -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=@cerno.tech header.s=fm3 header.b=r2V6N3BP; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=WKTANOBb; 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=cerno.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726660AbgGHRmz (ORCPT + 99 others); Wed, 8 Jul 2020 13:42:55 -0400 Received: from wnew4-smtp.messagingengine.com ([64.147.123.18]:39637 "EHLO wnew4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726541AbgGHRmw (ORCPT ); Wed, 8 Jul 2020 13:42:52 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 92339333; Wed, 8 Jul 2020 13:42:50 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Wed, 08 Jul 2020 13:42:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=+GsL/PhEM1vcC hoGS1OCu8EP3VmI+pijDvz5ksKewGI=; b=r2V6N3BPhoh5Ia8G9Z1LPUUcL+9xw Ogs5Kw2pcD43qODVazexU/nU3tvY4B2ELcumGAqphneygl1ILSI2JSD8Zn6f2UTQ gqkJZDeoy9uK1y5k1Klu1MVlRm7zKiLmwaBXFgtRiYEGcIoybV64SoZLm3oJ0L0D Qn8s7P0vsju6K7K8FlyAmoe/LgNBzHyqIe7kDnA25HQlKgddYEyM0u3Tq1Mxxiqw JQKKSey/W9oeCelvjWO91V6oNQT+kxltxJM+8R/6l231DL2V+5J1/llqciFT5Nwz nfnyQPk3U33PYmPwiIqcovEJG3/N8bhxlqZ65DDen3EKa4VskPMqbczAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=+GsL/PhEM1vcChoGS1OCu8EP3VmI+pijDvz5ksKewGI=; b=WKTANOBb CwZDaxzl7y+r1S1upxUrAw8aq/oNadwZOEh8eT9SkrUklb4c2O2wtaanHXNgiGGQ PFcwzEv/77gJza/9G22jVmch9Y9qrdi3h7LguXujEZ3r81NRYDQaEABH2Kt073KS Y9qLwjZ2wRTwR9zoJpWuN00djUVtI+oDfr/TiNTMxJeWbdF3d72HbdvrHuzvrO/5 m1//A69vMehvdwEQnEjjm2z/7/jE/RApDUDWd88HbVI3jFwayvU7BkrWzgzzIpHM yHuAMOzgF1p7ZtQHuSwjg9D+aUVZjvtvO9xuR2whCDUxBPe0lPCLo9SUJRdqUJqB PIj9X8jZXXRhAQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudejgdduudejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgepuddune curfgrrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id D279130600B1; Wed, 8 Jul 2020 13:42:49 -0400 (EDT) From: Maxime Ripard To: Nicolas Saenz Julienne , Eric Anholt Cc: dri-devel@lists.freedesktop.org, linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Dave Stevenson , Tim Gover , Phil Elwell , Maxime Ripard Subject: [PATCH v4 13/78] drm/vc4: kms: Convert to for_each_new_crtc_state Date: Wed, 8 Jul 2020 19:41:21 +0200 Message-Id: <8af06b31c58ec9745ce13c2aca4e532d6ca340e0.1594230107.git-series.maxime@cerno.tech> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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); - vc4_crtc = to_vc4_crtc(state->crtcs[i].ptr); vc4_hvs_mask_underrun(dev, vc4_crtc->channel); } -- git-series 0.9.1