From patchwork Mon Dec 13 16:26:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12695941 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 58BBEC433FE for ; Mon, 13 Dec 2021 16:29:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FUIrYhtN3ux1spYZvrb3cOnbOV2iCnF7snBSA6DAHyA=; b=fyP4M2SI4tn618 5qD/vTbu0YbvT0ey4tEaEIVMBlkAE1kf21YnjYWBjjmT364DbBnOXTXb5n7gpyCGs+iEaca7STbQp e/jQrZvfZe0EMNguefRp9zndOuqoaVjna31bxT0XYtmnANKM2FfoScDpSufrhPxghm5sfzEBk8nbz TYEHIK6U4lyzoh/kqfELwrRcJahHi1ktHjXfonvsk58tfHuqxhb9N0izLMGpLPLv87AO1hscMefu5 ogC6c3lEstlm7IMh1aZG9OYaRWqjQ+xECsA7HK6g6LpwXrmIzaJdQU7NQ4NIKjmqxmTodbXdSt4XZ tnvBbPHtZkcg01qIvboQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwoAf-00AaF9-1z; Mon, 13 Dec 2021 16:27:25 +0000 Received: from new4-smtp.messagingengine.com ([66.111.4.230]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mwo9y-00AZz5-71; Mon, 13 Dec 2021 16:26:43 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailnew.nyi.internal (Postfix) with ESMTP id 77CDC5801BD; Mon, 13 Dec 2021 11:26:41 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 13 Dec 2021 11:26:41 -0500 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=NYzTodFUSDTQ1 k8uArv9hmdu5xxvwWvdj/NMSohJE10=; b=hdQMscQAE9/i1zRx1WJA9ZO44OXr9 r04PGf1xlnG3tky5p8+ITEBkUrRS+esDZUCWIylWLlRaRp/ocUW7UrBD+xzra8xh sLzYGzxXysPfeJssXkmKXvWtdLKTUBmalZcOiuMaJ/pz5XjbJLWqRDFmSj1jnzeW v+LZH19KUS8e9wQs9VOaV6NgnKnybXLS+w9biUdDpSSgarrHT2C2ErpVvBBJfXxV JAmh4mj8Ez9iSUpM3Cr3iidFG0QDjhUa4dtl0u3NN5M/4s7/TJwxfH63i7OWWszd Z7YwdS0KlU9PNvNeQRdqhuFT65chXx87zDiwOMXrfF5GMtB7onEeRQAlQ== 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=NYzTodFUSDTQ1k8uArv9hmdu5xxvwWvdj/NMSohJE10=; b=aKJTiMR1 YfhzpE4JjhbmGoGaZc1Xh9AUviTeEpQNaiVCZI1idKl/PmepANLNRlUaq6Qfiqb0 ZX3DPeT322BeGl4zG34IyzDBgYdMRSxQEBd+3VOKvKHrx5lcCAklnv4iflJnTSrz 80kYHRGkyWQY2Una+ZwTkZ8hvbkJpuCyRozYl+CBiZHw8xRApum9VdmPkcGfQ5iC iMU/kdpTqVlDq1njysLIEJnct6nBiM2xMqZzZQidhMCjfIiDIhpCLsTrI16goNVi laxs+wAKtHEi8FhOeerKtpNL/1LvtOq94JHwOwoYpUgsYZOXiiDQASbO+In9SujL 6coOZ+/9XZkNww== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrkeekgdeklecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveevheeh vdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmrg igihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Dec 2021 11:26:40 -0500 (EST) From: Maxime Ripard To: Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard , Daniel Vetter , David Airlie , Florian Fainelli , Scott Branden , Nicolas Saenz Julienne , Rob Herring , Frank Rowand , Ray Jui Cc: Dave Stevenson , Phil Elwell , Tim Gover , Dom Cobley , bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-rpi-kernel@lists.infradead.org, devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH RESEND v4 v4 2/4] drm/vc4: Support nomodeset Date: Mon, 13 Dec 2021 17:26:33 +0100 Message-Id: <20211213162635.252582-3-maxime@cerno.tech> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211213162635.252582-1-maxime@cerno.tech> References: <20211213162635.252582-1-maxime@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211213_082642_385044_5F055355 X-CRM114-Status: GOOD ( 13.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org If we have nomodeset on the kernel command line we should have the firmware framebuffer driver kept as is and not try to load the full-blown KMS driver. In this case, let's just register the v3d driver. Signed-off-by: Maxime Ripard Reviewed-by: Javier Martinez Canillas --- drivers/gpu/drm/vc4/vc4_drv.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index 16abc3a3d601..12694e2201e7 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c @@ -357,12 +357,22 @@ static int __init vc4_drm_register(void) { int ret; - ret = platform_register_drivers(component_drivers, - ARRAY_SIZE(component_drivers)); - if (ret) - return ret; + if (!drm_firmware_drivers_only()) { + ret = platform_register_drivers(component_drivers, + ARRAY_SIZE(component_drivers)); + if (ret) + return ret; - return platform_driver_register(&vc4_platform_driver); + ret = platform_driver_register(&vc4_platform_driver); + if (ret) + return ret; + } else { + ret = platform_driver_register(&vc4_v3d_driver); + if (ret) + return ret; + } + + return 0; } static void __exit vc4_drm_unregister(void)