From patchwork Wed Oct 28 12:41:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 310793 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=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 68CD5C56201 for ; Thu, 29 Oct 2020 02:01:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F0BF20791 for ; Thu, 29 Oct 2020 02:01:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726432AbgJ2CA5 (ORCPT ); Wed, 28 Oct 2020 22:00:57 -0400 Received: from new3-smtp.messagingengine.com ([66.111.4.229]:49927 "EHLO new3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728087AbgJ1Vux (ORCPT ); Wed, 28 Oct 2020 17:50:53 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 7CA9658012D; Wed, 28 Oct 2020 08:41:10 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 28 Oct 2020 08:41:10 -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=fm1; bh=IkmeIQpmF+jfh U/2m4u3cBU/jAxQu6NxvXUChDBnViU=; b=MnG6587tUm95xoi+Rgmokp/3mZ59A EPa79QE8rW3gbh75nmKwXXCbD97HrBaQMyoq/PT3UcJEPO0Ebpl35laBrqaRv94q ipqo4jhXDy5r8CWJIb+3a448o1dCljNw1p/gOD29udsrynP5OjzGPKY6/GH8Wn5A ae0561NGPLCgBj/FadzVBxI77mpL4PDzN12t1DY7yuD14IBCktM90avl/JcIzosK vvFLHoizCCZwgXu+8insFgU6uiXXflrvDi2/tyXG3dgE8St1/1nH5V5/XByd7EvM ryprLl0ygbaV8YtbJVfOc68gNRMWiuFnzTlHHthQMEYRWlLVJ9YptSZxQ== 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= fm1; bh=IkmeIQpmF+jfhU/2m4u3cBU/jAxQu6NxvXUChDBnViU=; b=ZdVXbQgs 4ItRi9FR/Qbv6dbRBhuXnRSDEHNzYf9qeKW7/i9wbXyC94/4kbsUxQzZJIimQ7Y1 f6pZykqR+P08u8vvkF9t6H1jpE26cSPULsZTnxftfBUnYRyblVfpgkgoeLbpkV11 nHNB+HnAClH2nXXfruVEHaC/VLuXtm+zkB335jHUcD36zwXnZWi2c5E7U23YGHvE DNkV0gEYKaIENY7AqN8QlL5emk3QJdCk5mPaGKHLSEjXzjpNIOGqiWrrFlYsboyb hzcp+r7EFj6X+9pYm3NFOLQt+qdlzylDgTZsN7I6naic1MaHQo6MYr+tsmZodZi/ EgXIPNg5ODEuMQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrledugdegvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh 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 EDBCD3280059; Wed, 28 Oct 2020 08:41:09 -0400 (EDT) From: Maxime Ripard To: Mark Rutland , Rob Herring , Frank Rowand , Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Eric Anholt Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-rpi-kernel@lists.infradead.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, Dave Stevenson , Tim Gover , Phil Elwell , Hoegeun Kwon Subject: [PATCH v2 3/7] drm/vc4: kms: Split the HVS muxing check in a separate function Date: Wed, 28 Oct 2020 13:41:00 +0100 Message-Id: <1f97f4d1dbe6801d6bbdff2667f6a2f0068c21c7.1603888799.git-series.maxime@cerno.tech> X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The code that assigns HVS channels during atomic_check is starting to grow a bit big, let's move it into a separate function. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_kms.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_kms.c b/drivers/gpu/drm/vc4/vc4_kms.c index 80378c74fcd6..4aa0577bd055 100644 --- a/drivers/gpu/drm/vc4/vc4_kms.c +++ b/drivers/gpu/drm/vc4/vc4_kms.c @@ -612,13 +612,13 @@ 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) +static int vc4_pv_muxing_atomic_check(struct drm_device *dev, + struct drm_atomic_state *state) { unsigned long unassigned_channels = GENMASK(HVS_NUM_CHANNELS - 1, 0); struct drm_crtc_state *old_crtc_state, *new_crtc_state; struct drm_crtc *crtc; - int i, ret; + unsigned int i; /* * Since the HVS FIFOs are shared across all the pixelvalves and @@ -691,6 +691,18 @@ vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) } } + return 0; +} + +static int +vc4_atomic_check(struct drm_device *dev, struct drm_atomic_state *state) +{ + int ret; + + ret = vc4_pv_muxing_atomic_check(dev, state); + if (ret) + return ret; + ret = vc4_ctm_atomic_check(dev, state); if (ret < 0) return ret;