From patchwork Wed Dec 22 08:28:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 12697071 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 ABDE1C433F5 for ; Wed, 22 Dec 2021 08:30:31 +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: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:In-Reply-To:References: List-Owner; bh=LQYz0KJvWjC9wItixoOczagMmNwHEheMACV++ClRH7g=; b=Gyd6S0OnvgUGca ssWelpoTZD54sV3JxmWRpeWlKzx8wW0tKtg+yoE57UZ90fj0oEx187AMBRicH/wwPftFUgtSHTUCf YnIM8kRSQMKqzRQBkYmRwsyOVNNJ40A0ZxunCTglrRL/q9EkGHBYJOXNvvJ1D9Gjiq3ZbTxTr09VS UMGam1730ZzhOz2dcazBrtGGrjTOQZfX0hnV8reCG8bToE3WF56WYFej0qT1VFNK257eF/d6nV2oY XcaqnEZ8ztZ4Gs5KV/08WPf4yskv4lODKyTE03n/PtgVs4iHmhfpEARarESUVqeFCXK4iKicMYm2j +XCdlkdMI9FvqP6A958Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzwzU-009gb2-JH; Wed, 22 Dec 2021 08:28:53 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mzwzN-009gY5-RI for linux-arm-kernel@lists.infradead.org; Wed, 22 Dec 2021 08:28:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640161723; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E4JXbmbKDkqfAMNbIkv/r6xGh5or/gMN+DXKn1vGRis=; b=BcRIfC/Fb0vUofEyunt+GN4JYY4MaqaSfBiOEDjT73jF4ps9M6g0peKTYgacxJZGoWeM/J DA2ErGz/d1iV7dFm09FOqSQkOU34QeURkzJ4LI3zZVXKzm1enHcpzzTJ+UDrx2vMgRgpzV 90q6SILFbq5IewG9K5d+bZV+HMjRENI= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-660-4BpBcE3sOpGyflNLGc2c3Q-1; Wed, 22 Dec 2021 03:28:42 -0500 X-MC-Unique: 4BpBcE3sOpGyflNLGc2c3Q-1 Received: by mail-wm1-f72.google.com with SMTP id v190-20020a1cacc7000000b003456d598510so2606835wme.6 for ; Wed, 22 Dec 2021 00:28:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=E4JXbmbKDkqfAMNbIkv/r6xGh5or/gMN+DXKn1vGRis=; b=1xKZNQz6QNC6zLUpdviFguBhCC8E0yxcbcoYpIn5X2SWMadelQtIDXcfQVRE5iEnfd c1X97zYBohd0sHQJwBVR7G1Q/DF6NgdXXautUJ3/dyUBpLniwgk11tjIOt36WpvS7sHg 9m0DV6b4+mnV8R9CUhiPg39dTfrVsXxyyqroEWlX32sfSdRtUsH5V0hu4AxHYnYjj3sB QOuO63fBgl1fngoQPkYnIP8J3ejMcPaL33rA22KE20hVhBOeb/oaxfjWqM01RMUYDvhV gR2mg8jVDFKRvRe0vxeOCxKzsA+tMObKWjHz7hixrr3dIOWC3XqTmDHFsnRsgFDJCXup 93+Q== X-Gm-Message-State: AOAM533M1SA+VBUshvVttSDqGCgSrFnMd5lbzrAGGzkZdkdZB7voZgeg AnvysnWoTcMMwmYE9J7Dcl7vbwDp1fH0YvjCWobQLiUKi5M7eJ8NE72Smc9mUBwAQNj7xfwa4u0 ZI37N2CvaTS6DjC+ej46T2i2F1/iJlcoPNdw= X-Received: by 2002:adf:80ca:: with SMTP id 68mr1271914wrl.528.1640161720885; Wed, 22 Dec 2021 00:28:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkoCJtHVX3pDhOPdiUKxxW7/e5x5c7YtwSOGtxy8UoUjYgTN5fseYcbOxjAI29EVId5+1dNg== X-Received: by 2002:adf:80ca:: with SMTP id 68mr1271896wrl.528.1640161720623; Wed, 22 Dec 2021 00:28:40 -0800 (PST) Received: from minerva.home ([92.176.231.205]) by smtp.gmail.com with ESMTPSA id m17sm1247080wrz.91.2021.12.22.00.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Dec 2021 00:28:40 -0800 (PST) From: Javier Martinez Canillas To: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: Javier Martinez Canillas , Brian Starkey , Chen Feng , Daniel Vetter , Dave Airlie , David Airlie , Fabio Estevam , Gerd Hoffmann , "James (Qian) Wang" , John Stultz , Jonathan Corbet , Laurentiu Palcu , Liviu Dudau , Lucas Stach , Maarten Lankhorst , Maxime Ripard , Mihail Atanassov , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Sascha Hauer , Shawn Guo , Thomas Zimmermann , Tian Tao , Xinliang Liu , Xinwei Kong , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: [PATCH v3 00/10] drm: Make drivers to honour the nomodeset parameter Date: Wed, 22 Dec 2021 09:28:21 +0100 Message-Id: <20211222082831.196562-1-javierm@redhat.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=javierm@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211222_002846_024835_25AA4A16 X-CRM114-Status: GOOD ( 20.71 ) 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 The nomodeset kernel command line parameter is used to prevent the KMS/DRM drivers to be registered/probed. But only a few drivers implement support for this and most DRM drivers just ignore it. This patch series is a v3 to make DRM drivers to honour nomodeset. It is posted as separate patches to make easier for drivers maintainers to ack or pick them independently at their own pace. The drm_module_{pci,platform}_driver() helper macros are added, which are just wrappers around module_{pci,platform}_driver() but adding a check for drm_firmware_drivers_only() and returning -ENODEV if that is true. PCI and platform DRM drivers are then modified in the following patches to make use of those macros. Only KMS drivers will be ported to use these new macros, and only for PCI and platform DRM drivers. A follow-up series might do the same for drivers that are rendering-only and for USB/SPI/I2C devices, but it will need more discussion to agree whether that's desirable or not. Not all drivers were posted in v3 to avoid flooding the list with too many patches. I'm only including the patches adding the macros and some patches as an example of their usage. I've built tested with 'make allmodconfig && make M=drivers/gpu/drm' but I don't have hardware to test the drivers, so review/testing is appreciated. Best regards, Javier Changes in v3: - Include Thomas Zimmermann's patches in the series and rebase on top. - Add collected Acked-by tags from v2. Changes in v2: - Add drm_module_{pci,platform}_driver() macros and put the check there (Thomas Zimmermann). - Use the drm_module_*_driver() macros if possible (Thomas Zimmermann). - Leave the DRM drivers that don't set the DRIVER_MODESET driver feature (Lucas Stach). - Leave USB/SPI/I2C drivers and only include PCI and platform ones (Noralf Trønnes). - Add collected Reviewed-by tags Javier Martinez Canillas (5): drm: Provide platform module-init macro drm/imx/dcss: Replace module initialization with DRM helpers drm/komeda: Replace module initialization with DRM helpers drm/arm/hdlcd: Replace module initialization with DRM helpers drm/malidp: Replace module initialization with DRM helpers Thomas Zimmermann (5): drm: Provide PCI module-init macros drm/ast: Replace module-init boiler-plate code with DRM helpers drm/bochs: Replace module-init boiler-plate code with DRM helpers drm/cirrus: Replace module-init boiler-plate code with DRM helpers drm/hisilicon/hibmc: Replace module initialization with DRM helpers Documentation/gpu/drm-internals.rst | 6 + .../gpu/drm/arm/display/komeda/komeda_drv.c | 3 +- drivers/gpu/drm/arm/hdlcd_drv.c | 3 +- drivers/gpu/drm/arm/malidp_drv.c | 3 +- drivers/gpu/drm/ast/ast_drv.c | 18 +-- .../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 3 +- drivers/gpu/drm/imx/dcss/dcss-drv.c | 3 +- drivers/gpu/drm/tiny/bochs.c | 20 +-- drivers/gpu/drm/tiny/cirrus.c | 17 +-- include/drm/drm_module.h | 125 ++++++++++++++++++ 10 files changed, 147 insertions(+), 54 deletions(-) create mode 100644 include/drm/drm_module.h Acked-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas