2021-12-15 01:00:56

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 00/60] drm: Make all drivers to honour the nomodeset parameter

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 parameter and most DRM drivers would just ignore it.

This (huge) patch series makes all DRM drivers to honour this parameter. It
is posted as separate patches to make easier for drivers maintainers to ack
or pick them independently at their own pace.

Patches are quite trivial and just add an if (drm_firmware_drivers_only())
check and return -ENODEV if that's true. The condition is checked as early
as possible, that is in the module_init handler for drivers that have one
or in the probe function for drivers that are using the module_*_driver()
macros and don't have their own module init function.

I included all the DRM drivers that think makes sense. I only left the vc4
and v3d drivers, that Maxime is already handling in another patch series
and the vgem, vkms and simpledrm drivers that should ignore the param IMO.

I've built tested with 'make allmodconfig && make M=drivers/gpu/drm/', but
only booted in a few devices with and without nomodeset in the cmdline. So
testing and reviewing for all the drivers would be highly appreciated.

Best regards,
Javier


Javier Martinez Canillas (60):
drm/komeda: Add support for the nomodeset kernel parameter
drm/arm/hdlcd: Add support for the nomodeset kernel parameter
drm/malidp: Add support for the nomodeset kernel parameter
drm/armada: Add support for the nomodeset kernel parameter
drm/aspeed: Add support for the nomodeset kernel parameter
drm/atmel-hlcdc: Add support for the nomodeset kernel parameter
drm/etnaviv: Add support for the nomodeset kernel parameter
drm/exynos: Add support for the nomodeset kernel parameter
drm/fsl-dcu: Add support for the nomodeset kernel parameter
drm/gma500: Add support for the nomodeset kernel parameter
drm/gud: Add support for the nomodeset kernel parameter
drm/hisilicon/hibmc: Add support for the nomodeset kernel parameter
drm/hisilicon/kirin: Add support for the nomodeset kernel parameter
drm/hyperv: Add support for the nomodeset kernel parameter
drm/i810: Add support for the nomodeset kernel parameter
drm/imx/dcss: Add support for the nomodeset kernel parameter
drm/imx: Add support for the nomodeset kernel parameter
drm/ingenic: Add support for the nomodeset kernel parameter
drm/kmb: Add support for the nomodeset kernel parameter
drm/lima: Add support for the nomodeset kernel parameter
drm/mcde: Add support for the nomodeset kernel parameter
drm/mediatek: Add support for the nomodeset kernel parameter
drm/meson: Add support for the nomodeset kernel parameter
drm/mga: Add support for the nomodeset kernel parameter
drm/msm: Add support for the nomodeset kernel parameter
drm: mxsfb: Add support for the nomodeset kernel parameter
drm/omap: Add support for the nomodeset kernel parameter
drm/panel: ilitek-ili9341: Add support for the nomodeset kernel
parameter
drm/panfrost: Add support for the nomodeset kernel parameter
drm/pl111: Add support for the nomodeset kernel parameter
drm/r128: Add support for the nomodeset kernel parameter
drm: rcar-du: Add support for the nomodeset kernel parameter
drm/rockchip: Add support for the nomodeset kernel parameter
drm/savage: Add support for the nomodeset kernel parameter
drm/shmobile: Add support for the nomodeset kernel parameter
drm/sis: Add support for the nomodeset kernel parameter
drm/sprd: Add support for the nomodeset kernel parameter
drm/sti: Add support for the nomodeset kernel parameter
drm/stm: Add support for the nomodeset kernel parameter
drm/sun4i: Add support for the nomodeset kernel parameter
drm/tdfx: Add support for the nomodeset kernel parameter
drm/tegra: Add support for the nomodeset kernel parameter
drm/tidss: Add support for the nomodeset kernel parameter
drm/tilcdc: Add support for the nomodeset kernel parameter
drm/arc: Add support for the nomodeset kernel parameter
drm/gm12u320: Add support for the nomodeset kernel parameter
drm/hx8357d: Add support for the nomodeset kernel parameter
drm/ili9163: Add support for the nomodeset kernel parameter
drm/ili9225: Add support for the nomodeset kernel parameter
drm/ili9341: Add support for the nomodeset kernel parameter
drm/ili9486: Add support for the nomodeset kernel parameter
drm/mi0283qt: Add support for the nomodeset kernel parameter
drm/repaper: Add support for the nomodeset kernel parameter
drm/st7586: Add support for the nomodeset kernel parameter
drm/st7735r: Add support for the nomodeset kernel parameter
drm/tve200: Add support for the nomodeset kernel parameter
drm/udl: Add support for the nomodeset kernel parameter
drm/via: Add support for the nomodeset kernel parameter
drm/xen: Add support for the nomodeset kernel parameter
drm/xlnx: Add support for the nomodeset kernel parameter

drivers/gpu/drm/arm/display/komeda/komeda_drv.c | 4 ++++
drivers/gpu/drm/arm/hdlcd_drv.c | 3 +++
drivers/gpu/drm/arm/malidp_drv.c | 3 +++
drivers/gpu/drm/armada/armada_drv.c | 3 +++
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 3 +++
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 3 +++
drivers/gpu/drm/etnaviv/etnaviv_drv.c | 3 +++
drivers/gpu/drm/exynos/exynos_drm_drv.c | 3 +++
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 3 +++
drivers/gpu/drm/gma500/psb_drv.c | 3 +++
drivers/gpu/drm/gud/gud_drv.c | 3 +++
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 3 +++
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 3 +++
drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 3 +++
drivers/gpu/drm/i810/i810_drv.c | 3 +++
drivers/gpu/drm/imx/dcss/dcss-drv.c | 3 +++
drivers/gpu/drm/imx/imx-drm-core.c | 3 +++
drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 3 +++
drivers/gpu/drm/kmb/kmb_drv.c | 3 +++
drivers/gpu/drm/lima/lima_drv.c | 3 +++
drivers/gpu/drm/mcde/mcde_drv.c | 3 +++
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 3 +++
drivers/gpu/drm/meson/meson_drv.c | 3 +++
drivers/gpu/drm/mga/mga_drv.c | 3 +++
drivers/gpu/drm/msm/msm_drv.c | 3 +++
drivers/gpu/drm/mxsfb/mxsfb_drv.c | 3 +++
drivers/gpu/drm/omapdrm/omap_drv.c | 3 +++
drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 3 +++
drivers/gpu/drm/panfrost/panfrost_drv.c | 3 +++
drivers/gpu/drm/pl111/pl111_drv.c | 3 +++
drivers/gpu/drm/r128/r128_drv.c | 3 +++
drivers/gpu/drm/rcar-du/rcar_du_drv.c | 3 +++
drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 3 +++
drivers/gpu/drm/savage/savage_drv.c | 3 +++
drivers/gpu/drm/shmobile/shmob_drm_drv.c | 3 +++
drivers/gpu/drm/sis/sis_drv.c | 3 +++
drivers/gpu/drm/sprd/sprd_drm.c | 3 +++
drivers/gpu/drm/sti/sti_drv.c | 3 +++
drivers/gpu/drm/stm/drv.c | 3 +++
drivers/gpu/drm/sun4i/sun4i_drv.c | 3 +++
drivers/gpu/drm/tdfx/tdfx_drv.c | 3 +++
drivers/gpu/drm/tegra/drm.c | 3 +++
drivers/gpu/drm/tidss/tidss_drv.c | 3 +++
drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 +++
drivers/gpu/drm/tiny/arcpgu.c | 3 +++
drivers/gpu/drm/tiny/gm12u320.c | 3 +++
drivers/gpu/drm/tiny/hx8357d.c | 3 +++
drivers/gpu/drm/tiny/ili9163.c | 3 +++
drivers/gpu/drm/tiny/ili9225.c | 3 +++
drivers/gpu/drm/tiny/ili9341.c | 3 +++
drivers/gpu/drm/tiny/ili9486.c | 3 +++
drivers/gpu/drm/tiny/mi0283qt.c | 3 +++
drivers/gpu/drm/tiny/repaper.c | 3 +++
drivers/gpu/drm/tiny/st7586.c | 3 +++
drivers/gpu/drm/tiny/st7735r.c | 3 +++
drivers/gpu/drm/tve200/tve200_drv.c | 3 +++
drivers/gpu/drm/udl/udl_drv.c | 3 +++
drivers/gpu/drm/via/via_drv.c | 3 +++
drivers/gpu/drm/xen/xen_drm_front.c | 3 +++
drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 3 +++
60 files changed, 181 insertions(+)

--
2.33.1



2021-12-15 01:00:58

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 01/60] drm/komeda: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/arm/display/komeda/komeda_drv.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c
index e7933930a657..4f6d5c2103ec 100644
--- a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c
+++ b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c
@@ -9,6 +9,7 @@
#include <linux/platform_device.h>
#include <linux/component.h>
#include <linux/pm_runtime.h>
+#include <drm/drm_drv.h>
#include <drm/drm_of.h>
#include "komeda_dev.h"
#include "komeda_kms.h"
@@ -117,6 +118,9 @@ static int komeda_platform_probe(struct platform_device *pdev)
struct component_match *match = NULL;
struct device_node *child;

+ if (drm_firmware_drivers_only())
+ return -EINVAL;
+
if (!dev->of_node)
return -ENODEV;

--
2.33.1


2021-12-15 01:00:59

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 02/60] drm/arm/hdlcd: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/arm/hdlcd_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 479c2422a2e0..0939a64a9bd2 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -382,6 +382,9 @@ static int hdlcd_probe(struct platform_device *pdev)
struct device_node *port;
struct component_match *match = NULL;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
/* there is only one output port inside each device, find it */
port = of_graph_get_remote_node(pdev->dev.of_node, 0, 0);
if (!port)
--
2.33.1


2021-12-15 01:01:01

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 03/60] drm/malidp: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/arm/malidp_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
index 78d15b04b105..5da4168eb76d 100644
--- a/drivers/gpu/drm/arm/malidp_drv.c
+++ b/drivers/gpu/drm/arm/malidp_drv.c
@@ -938,6 +938,9 @@ static int malidp_platform_probe(struct platform_device *pdev)
struct device_node *port;
struct component_match *match = NULL;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
if (!pdev->dev.of_node)
return -ENODEV;

--
2.33.1


2021-12-15 01:01:04

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 04/60] drm/armada: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/armada/armada_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
index 8e3e98f13db4..4f9b0a9f13e3 100644
--- a/drivers/gpu/drm/armada/armada_drv.c
+++ b/drivers/gpu/drm/armada/armada_drv.c
@@ -273,6 +273,9 @@ static int __init armada_drm_init(void)
{
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
ret = platform_driver_register(&armada_lcd_platform_driver);
if (ret)
return ret;
--
2.33.1


2021-12-15 01:01:05

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 05/60] drm/aspeed: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
index b53fee6f1c17..c70d8f046816 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
@@ -310,6 +310,9 @@ static int aspeed_gfx_probe(struct platform_device *pdev)
struct aspeed_gfx *priv;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
priv = devm_drm_dev_alloc(&pdev->dev, &aspeed_gfx_driver,
struct aspeed_gfx, drm);
if (IS_ERR(priv))
--
2.33.1


2021-12-15 01:01:08

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 06/60] drm/atmel-hlcdc: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
index 1656d27b78b6..4637177184ce 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
@@ -747,6 +747,9 @@ static int atmel_hlcdc_dc_drm_probe(struct platform_device *pdev)
struct drm_device *ddev;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
ddev = drm_dev_alloc(&atmel_hlcdc_dc_driver, &pdev->dev);
if (IS_ERR(ddev))
return PTR_ERR(ddev);
--
2.33.1


2021-12-15 01:01:10

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 07/60] drm/etnaviv: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/etnaviv/etnaviv_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index 7dcc6392792d..58b092248f7b 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -635,6 +635,9 @@ static int __init etnaviv_init(void)
int ret;
struct device_node *np;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
etnaviv_validate_init();

ret = platform_driver_register(&etnaviv_gpu_driver);
--
2.33.1


2021-12-15 01:01:13

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 11/60] drm/gud: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/gud/gud_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c
index 3f9d4b9a1e3d..4d253d249512 100644
--- a/drivers/gpu/drm/gud/gud_drv.c
+++ b/drivers/gpu/drm/gud/gud_drv.c
@@ -446,6 +446,9 @@ static int gud_probe(struct usb_interface *intf, const struct usb_device_id *id)
u32 *formats;
int ret, i;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
ret = usb_find_bulk_out_endpoint(intf->cur_altsetting, &bulk_out);
if (ret)
return ret;
--
2.33.1


2021-12-15 01:01:15

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 10/60] drm/gma500: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/gma500/psb_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index 65cf1c79dd7c..eeb681be9c95 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -538,6 +538,9 @@ static struct pci_driver psb_pci_driver = {

static int __init psb_init(void)
{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
return pci_register_driver(&psb_pci_driver);
}

--
2.33.1


2021-12-15 01:01:20

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 09/60] drm/fsl-dcu: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
index 660fe573db96..9b9e1b200005 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -255,6 +255,9 @@ static int fsl_dcu_drm_probe(struct platform_device *pdev)
int ret;
u8 div_ratio_shift = 0;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
fsl_dev = devm_kzalloc(dev, sizeof(*fsl_dev), GFP_KERNEL);
if (!fsl_dev)
return -ENOMEM;
--
2.33.1


2021-12-15 01:01:22

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 08/60] drm/exynos: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/exynos/exynos_drm_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index d8f1cf4d6b69..f9f10413a4f2 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -464,6 +464,9 @@ static int exynos_drm_init(void)
{
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
ret = exynos_drm_register_devices();
if (ret)
return ret;
--
2.33.1


2021-12-15 01:01:23

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 13/60] drm/hisilicon/kirin: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index 98ae9a48f3fe..2f4c81dc8681 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -274,6 +274,9 @@ static int kirin_drm_platform_probe(struct platform_device *pdev)
struct component_match *match = NULL;
struct device_node *remote;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
remote = of_graph_get_remote_node(np, 0, 0);
if (!remote)
return -ENODEV;
--
2.33.1


2021-12-15 01:01:29

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 14/60] drm/hyperv: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
index cd818a629183..8401a43c4d49 100644
--- a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
+++ b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
@@ -288,6 +288,9 @@ static int __init hyperv_init(void)
{
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
ret = pci_register_driver(&hyperv_pci_driver);
if (ret != 0)
return ret;
--
2.33.1


2021-12-15 01:01:31

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 12/60] drm/hisilicon/hibmc: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
Patch-cc:Tian Tao <[email protected]>
---

drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 610fc8e135f9..f66de93831c6 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -315,6 +315,9 @@ static int hibmc_pci_probe(struct pci_dev *pdev,
struct drm_device *dev;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &hibmc_driver);
if (ret)
return ret;
--
2.33.1


2021-12-15 01:01:32

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 16/60] drm/imx/dcss: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/imx/dcss/dcss-drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/imx/dcss/dcss-drv.c b/drivers/gpu/drm/imx/dcss/dcss-drv.c
index 8dc2f85c514b..5be591da7389 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-drv.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-drv.c
@@ -38,6 +38,9 @@ static int dcss_drv_platform_probe(struct platform_device *pdev)
int err = 0;
bool hdmi_output = true;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
if (!dev->of_node)
return -ENODEV;

--
2.33.1


2021-12-15 01:01:37

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 15/60] drm/i810: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/i810/i810_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c
index 0e53a066d4db..7ce268b54a18 100644
--- a/drivers/gpu/drm/i810/i810_drv.c
+++ b/drivers/gpu/drm/i810/i810_drv.c
@@ -80,6 +80,9 @@ static struct pci_driver i810_pci_driver = {

static int __init i810_init(void)
{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
if (num_possible_cpus() > 1) {
pr_err("drm/i810 does not support SMP\n");
return -EINVAL;
--
2.33.1


2021-12-15 01:01:45

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 17/60] drm/imx: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/imx/imx-drm-core.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c
index cb685fe2039b..a57812ec36b1 100644
--- a/drivers/gpu/drm/imx/imx-drm-core.c
+++ b/drivers/gpu/drm/imx/imx-drm-core.c
@@ -341,6 +341,9 @@ static struct platform_driver * const drivers[] = {

static int __init imx_drm_init(void)
{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
return platform_register_drivers(drivers, ARRAY_SIZE(drivers));
}
module_init(imx_drm_init);
--
2.33.1


2021-12-15 01:01:49

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 18/60] drm/ingenic: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
index b4943a56be09..8748cc5d2069 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -1487,6 +1487,9 @@ static int ingenic_drm_init(void)
{
int err;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
if (IS_ENABLED(CONFIG_DRM_INGENIC_IPU)) {
err = platform_driver_register(ingenic_ipu_driver_ptr);
if (err)
--
2.33.1


2021-12-15 01:01:53

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 19/60] drm/kmb: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/kmb/kmb_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/kmb/kmb_drv.c b/drivers/gpu/drm/kmb/kmb_drv.c
index ed2424350773..56a59ee71755 100644
--- a/drivers/gpu/drm/kmb/kmb_drv.c
+++ b/drivers/gpu/drm/kmb/kmb_drv.c
@@ -484,6 +484,9 @@ static int kmb_probe(struct platform_device *pdev)
struct device_node *dsi_node;
struct platform_device *dsi_pdev;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
/* The bridge (ADV 7535) will return -EPROBE_DEFER until it
* has a mipi_dsi_host to register its device to. So, we
* first register the DSI host during probe time, and then return
--
2.33.1


2021-12-15 01:02:01

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 21/60] drm/mcde: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/mcde/mcde_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
index 5b5afc6aaf8e..0b2910e69b42 100644
--- a/drivers/gpu/drm/mcde/mcde_drv.c
+++ b/drivers/gpu/drm/mcde/mcde_drv.c
@@ -491,6 +491,9 @@ static int __init mcde_drm_register(void)
{
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
ret = platform_register_drivers(component_drivers,
ARRAY_SIZE(component_drivers));
if (ret)
--
2.33.1


2021-12-15 01:02:07

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 20/60] drm/lima: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/lima/lima_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/lima/lima_drv.c b/drivers/gpu/drm/lima/lima_drv.c
index 7b8d7178d09a..9255073162db 100644
--- a/drivers/gpu/drm/lima/lima_drv.c
+++ b/drivers/gpu/drm/lima/lima_drv.c
@@ -375,6 +375,9 @@ static int lima_pdev_probe(struct platform_device *pdev)
struct drm_device *ddev;
int err;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
err = lima_sched_slab_init();
if (err)
return err;
--
2.33.1


2021-12-15 01:02:12

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 22/60] drm/mediatek: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/mediatek/mtk_drm_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
index aec39724ebeb..e336358fee20 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
@@ -210,6 +210,9 @@ static int mtk_drm_kms_init(struct drm_device *drm)
struct device *dma_dev;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
if (!iommu_present(&platform_bus_type))
return -EPROBE_DEFER;

--
2.33.1


2021-12-15 01:02:15

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 29/60] drm/panfrost: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/panfrost/panfrost_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c
index 96bb5a465627..6effe1fdc893 100644
--- a/drivers/gpu/drm/panfrost/panfrost_drv.c
+++ b/drivers/gpu/drm/panfrost/panfrost_drv.c
@@ -547,6 +547,9 @@ static int panfrost_probe(struct platform_device *pdev)
struct drm_device *ddev;
int err;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
pfdev = devm_kzalloc(&pdev->dev, sizeof(*pfdev), GFP_KERNEL);
if (!pfdev)
return -ENOMEM;
--
2.33.1


2021-12-15 01:02:17

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 25/60] drm/msm: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/msm/msm_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 7936e8d498dd..eb098475224b 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -518,6 +518,9 @@ static int msm_drm_init(struct device *dev, const struct drm_driver *drv)
struct msm_mdss *mdss;
int ret, i;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
ddev = drm_dev_alloc(drv, dev);
if (IS_ERR(ddev)) {
DRM_DEV_ERROR(dev, "failed to allocate drm_device\n");
--
2.33.1


2021-12-15 01:02:19

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 28/60] drm/panel: ilitek-ili9341: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c
index 2c3378a259b1..707c5a7bf256 100644
--- a/drivers/gpu/drm/panel/panel-ilitek-ili9341.c
+++ b/drivers/gpu/drm/panel/panel-ilitek-ili9341.c
@@ -611,6 +611,9 @@ static int ili9341_dbi_probe(struct spi_device *spi, struct gpio_desc *dc,
u32 rotation = 0;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
vcc = devm_regulator_get_optional(dev, "vcc");
if (IS_ERR(vcc))
dev_err(dev, "get optional vcc failed\n");
--
2.33.1


2021-12-15 01:02:21

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 30/60] drm/pl111: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/pl111/pl111_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index 520301b405f1..7a316c8d8301 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -243,6 +243,9 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
struct drm_device *drm;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
--
2.33.1


2021-12-15 01:02:23

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 31/60] drm/r128: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/r128/r128_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/r128/r128_drv.c b/drivers/gpu/drm/r128/r128_drv.c
index e35a3a1449bd..e49db9692df9 100644
--- a/drivers/gpu/drm/r128/r128_drv.c
+++ b/drivers/gpu/drm/r128/r128_drv.c
@@ -98,6 +98,9 @@ static struct pci_driver r128_pci_driver = {

static int __init r128_init(void)
{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
driver.num_ioctls = r128_max_ioctl;

return drm_legacy_pci_init(&driver, &r128_pci_driver);
--
2.33.1


2021-12-15 01:02:25

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 27/60] drm/omap: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/omapdrm/omap_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 2720a58ccd90..eaf67b9e5f12 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -727,6 +727,9 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)

DBG("%s", dev_name(dev));

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
/* Allocate and initialize the DRM device. */
ddev = drm_dev_alloc(&omap_drm_driver, dev);
if (IS_ERR(ddev))
--
2.33.1


2021-12-15 01:02:27

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 26/60] drm: mxsfb: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/mxsfb/mxsfb_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index 86d78634a979..1359fc99c6f0 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -342,6 +342,9 @@ static int mxsfb_probe(struct platform_device *pdev)
of_match_device(mxsfb_dt_ids, &pdev->dev);
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
if (!pdev->dev.of_node)
return -ENODEV;

--
2.33.1


2021-12-15 01:02:30

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 33/60] drm/rockchip: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
index bec207de4544..ac190e2b1f7a 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c
@@ -457,6 +457,9 @@ static int __init rockchip_drm_init(void)
{
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
num_rockchip_sub_drivers = 0;
ADD_ROCKCHIP_SUB_DRIVER(vop_platform_driver, CONFIG_DRM_ROCKCHIP);
ADD_ROCKCHIP_SUB_DRIVER(rockchip_lvds_driver,
--
2.33.1


2021-12-15 01:02:34

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 32/60] drm: rcar-du: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/rcar-du/rcar_du_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
index 5612a9e7a905..7b676b2f0f06 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
@@ -699,6 +699,9 @@ static struct platform_driver rcar_du_platform_driver = {

static int __init rcar_du_init(void)
{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
rcar_du_of_init(rcar_du_of_table);

return platform_driver_register(&rcar_du_platform_driver);
--
2.33.1


2021-12-15 01:02:36

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 24/60] drm/mga: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/mga/mga_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/mga/mga_drv.c b/drivers/gpu/drm/mga/mga_drv.c
index 71128e6f6ae9..dc4154d39133 100644
--- a/drivers/gpu/drm/mga/mga_drv.c
+++ b/drivers/gpu/drm/mga/mga_drv.c
@@ -87,6 +87,9 @@ static struct pci_driver mga_pci_driver = {

static int __init mga_init(void)
{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
driver.num_ioctls = mga_max_ioctl;
return drm_legacy_pci_init(&driver, &mga_pci_driver);
}
--
2.33.1


2021-12-15 01:02:39

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 23/60] drm/meson: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/meson/meson_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index 80f1d439841a..719724ad3c5b 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -456,6 +456,9 @@ static int meson_drv_probe(struct platform_device *pdev)
struct device_node *ep, *remote;
int count = 0;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
for_each_endpoint_of_node(np, ep) {
remote = of_graph_get_remote_port_parent(ep);
if (!remote || !of_device_is_available(remote)) {
--
2.33.1


2021-12-15 01:02:41

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 34/60] drm/savage: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/savage/savage_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/savage/savage_drv.c b/drivers/gpu/drm/savage/savage_drv.c
index 799bd11adb9c..bb3f12874178 100644
--- a/drivers/gpu/drm/savage/savage_drv.c
+++ b/drivers/gpu/drm/savage/savage_drv.c
@@ -74,6 +74,9 @@ static struct pci_driver savage_pci_driver = {

static int __init savage_init(void)
{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
driver.num_ioctls = savage_max_ioctl;
return drm_legacy_pci_init(&driver, &savage_pci_driver);
}
--
2.33.1


2021-12-15 01:02:44

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 35/60] drm/shmobile: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/shmobile/shmob_drm_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
index 80078a9fd7f6..7011c659a921 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
@@ -195,6 +195,9 @@ static int shmob_drm_probe(struct platform_device *pdev)
unsigned int i;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
if (pdata == NULL) {
dev_err(&pdev->dev, "no platform data\n");
return -EINVAL;
--
2.33.1


2021-12-15 01:02:47

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 36/60] drm/sis: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/sis/sis_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/sis/sis_drv.c b/drivers/gpu/drm/sis/sis_drv.c
index e35e719cf315..d592af70e8be 100644
--- a/drivers/gpu/drm/sis/sis_drv.c
+++ b/drivers/gpu/drm/sis/sis_drv.c
@@ -126,6 +126,9 @@ static struct pci_driver sis_pci_driver = {

static int __init sis_init(void)
{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
driver.num_ioctls = sis_max_ioctl;
return drm_legacy_pci_init(&driver, &sis_pci_driver);
}
--
2.33.1


2021-12-15 01:02:48

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 37/60] drm/sprd: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/sprd/sprd_drm.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/sprd/sprd_drm.c b/drivers/gpu/drm/sprd/sprd_drm.c
index a077e2d4d721..dd7e3de780f3 100644
--- a/drivers/gpu/drm/sprd/sprd_drm.c
+++ b/drivers/gpu/drm/sprd/sprd_drm.c
@@ -186,6 +186,9 @@ static struct platform_driver *sprd_drm_drivers[] = {

static int __init sprd_drm_init(void)
{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
return platform_register_drivers(sprd_drm_drivers,
ARRAY_SIZE(sprd_drm_drivers));
}
--
2.33.1


2021-12-15 01:02:49

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 38/60] drm/sti: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/sti/sti_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index c7efb43b83ee..860b2230aa08 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -287,6 +287,9 @@ static struct platform_driver * const drivers[] = {

static int sti_drm_init(void)
{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
return platform_register_drivers(drivers, ARRAY_SIZE(drivers));
}
module_init(sti_drm_init);
--
2.33.1


2021-12-15 01:02:52

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 39/60] drm/stm: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/stm/drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index 222869b232ae..91ac5437fa40 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -183,6 +183,9 @@ static int stm_drm_platform_probe(struct platform_device *pdev)

DRM_DEBUG("%s\n", __func__);

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
dma_set_coherent_mask(dev, DMA_BIT_MASK(32));

ddev = drm_dev_alloc(&drv_driver, dev);
--
2.33.1


2021-12-15 01:02:54

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 40/60] drm/sun4i: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/sun4i/sun4i_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
index b630614b3d72..174d3d7790e6 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -373,6 +373,9 @@ static int sun4i_drv_probe(struct platform_device *pdev)
struct endpoint_list list;
int i, ret, count = 0;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
INIT_KFIFO(list.fifo);

for (i = 0;; i++) {
--
2.33.1


2021-12-15 01:02:57

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 41/60] drm/tdfx: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tdfx/tdfx_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tdfx/tdfx_drv.c b/drivers/gpu/drm/tdfx/tdfx_drv.c
index 58c185c299f4..d0ae79ad437f 100644
--- a/drivers/gpu/drm/tdfx/tdfx_drv.c
+++ b/drivers/gpu/drm/tdfx/tdfx_drv.c
@@ -74,6 +74,9 @@ static struct pci_driver tdfx_pci_driver = {

static int __init tdfx_init(void)
{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
return drm_legacy_pci_init(&driver, &tdfx_pci_driver);
}

--
2.33.1


2021-12-15 01:02:58

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 42/60] drm/tegra: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tegra/drm.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index 8d37d6b00562..48e35d686473 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -1382,6 +1382,9 @@ static int __init host1x_drm_init(void)
{
int err;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
err = host1x_driver_register(&host1x_drm_driver);
if (err < 0)
return err;
--
2.33.1


2021-12-15 01:03:01

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 43/60] drm/tidss: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tidss/tidss_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c
index 7c784e90e40e..5a6ff5af6d26 100644
--- a/drivers/gpu/drm/tidss/tidss_drv.c
+++ b/drivers/gpu/drm/tidss/tidss_drv.c
@@ -124,6 +124,9 @@ static int tidss_probe(struct platform_device *pdev)

dev_dbg(dev, "%s\n", __func__);

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
tidss = devm_drm_dev_alloc(&pdev->dev, &tidss_driver,
struct tidss_device, ddev);
if (IS_ERR(tidss))
--
2.33.1


2021-12-15 01:03:03

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 48/60] drm/ili9163: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tiny/ili9163.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tiny/ili9163.c b/drivers/gpu/drm/tiny/ili9163.c
index bcc181351236..60afabc6bb35 100644
--- a/drivers/gpu/drm/tiny/ili9163.c
+++ b/drivers/gpu/drm/tiny/ili9163.c
@@ -146,6 +146,9 @@ static int ili9163_probe(struct spi_device *spi)
u32 rotation = 0;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
dbidev = devm_drm_dev_alloc(dev, &ili9163_driver,
struct mipi_dbi_dev, drm);
if (IS_ERR(dbidev))
--
2.33.1


2021-12-15 01:03:10

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 47/60] drm/hx8357d: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tiny/hx8357d.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tiny/hx8357d.c b/drivers/gpu/drm/tiny/hx8357d.c
index 9b33c05732aa..fd788d36efdd 100644
--- a/drivers/gpu/drm/tiny/hx8357d.c
+++ b/drivers/gpu/drm/tiny/hx8357d.c
@@ -225,6 +225,9 @@ static int hx8357d_probe(struct spi_device *spi)
u32 rotation = 0;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
dbidev = devm_drm_dev_alloc(dev, &hx8357d_driver,
struct mipi_dbi_dev, drm);
if (IS_ERR(dbidev))
--
2.33.1


2021-12-15 01:03:14

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 46/60] drm/gm12u320: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tiny/gm12u320.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c
index 6bc0c298739c..b9a5f4969337 100644
--- a/drivers/gpu/drm/tiny/gm12u320.c
+++ b/drivers/gpu/drm/tiny/gm12u320.c
@@ -636,6 +636,9 @@ static int gm12u320_usb_probe(struct usb_interface *interface,
struct drm_device *dev;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
/*
* The gm12u320 presents itself to the system as 2 usb mass-storage
* interfaces, we only care about / need the first one.
--
2.33.1


2021-12-15 01:03:16

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 50/60] drm/ili9341: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tiny/ili9341.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tiny/ili9341.c b/drivers/gpu/drm/tiny/ili9341.c
index 37e0c33399c8..5226b768c550 100644
--- a/drivers/gpu/drm/tiny/ili9341.c
+++ b/drivers/gpu/drm/tiny/ili9341.c
@@ -182,6 +182,9 @@ static int ili9341_probe(struct spi_device *spi)
u32 rotation = 0;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
dbidev = devm_drm_dev_alloc(dev, &ili9341_driver,
struct mipi_dbi_dev, drm);
if (IS_ERR(dbidev))
--
2.33.1


2021-12-15 01:03:18

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 49/60] drm/ili9225: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tiny/ili9225.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tiny/ili9225.c b/drivers/gpu/drm/tiny/ili9225.c
index 976d3209f164..1d193c534318 100644
--- a/drivers/gpu/drm/tiny/ili9225.c
+++ b/drivers/gpu/drm/tiny/ili9225.c
@@ -369,6 +369,9 @@ static int ili9225_probe(struct spi_device *spi)
u32 rotation = 0;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
dbidev = devm_drm_dev_alloc(dev, &ili9225_driver,
struct mipi_dbi_dev, drm);
if (IS_ERR(dbidev))
--
2.33.1


2021-12-15 01:03:21

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 45/60] drm/arc: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tiny/arcpgu.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
index f8531c50a072..9268f37762c8 100644
--- a/drivers/gpu/drm/tiny/arcpgu.c
+++ b/drivers/gpu/drm/tiny/arcpgu.c
@@ -378,6 +378,9 @@ static int arcpgu_probe(struct platform_device *pdev)
struct arcpgu_drm_private *arcpgu;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
arcpgu = devm_drm_dev_alloc(&pdev->dev, &arcpgu_drm_driver,
struct arcpgu_drm_private, drm);
if (IS_ERR(arcpgu))
--
2.33.1


2021-12-15 01:03:25

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 44/60] drm/tilcdc: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
index 3ddb7c710a3d..25fe1f8de6bd 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -606,6 +606,9 @@ static struct platform_driver tilcdc_platform_driver = {

static int __init tilcdc_drm_init(void)
{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
DBG("init");
tilcdc_panel_init();
return platform_driver_register(&tilcdc_platform_driver);
--
2.33.1


2021-12-15 01:03:27

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 59/60] drm/xen: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/xen/xen_drm_front.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_drm_front.c
index 434064c820e8..20d11ea79e0f 100644
--- a/drivers/gpu/drm/xen/xen_drm_front.c
+++ b/drivers/gpu/drm/xen/xen_drm_front.c
@@ -495,6 +495,9 @@ static int xen_drm_drv_init(struct xen_drm_front_info *front_info)
struct drm_device *drm_dev;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
DRM_INFO("Creating %s\n", xen_drm_driver.desc);

drm_info = kzalloc(sizeof(*drm_info), GFP_KERNEL);
--
2.33.1


2021-12-15 01:03:29

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 60/60] drm/xlnx: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
index ac37053412a1..cca55b8a8cf1 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
@@ -191,6 +191,9 @@ static int zynqmp_dpsub_probe(struct platform_device *pdev)
struct zynqmp_dpsub *dpsub;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
/* Allocate private data. */
dpsub = devm_drm_dev_alloc(&pdev->dev, &zynqmp_dpsub_drm_driver,
struct zynqmp_dpsub, drm);
--
2.33.1


2021-12-15 01:03:33

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 58/60] drm/via: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/via/via_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index 5da38082821f..57d63514f812 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -106,6 +106,9 @@ static struct pci_driver via_pci_driver = {

static int __init via_init(void)
{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
driver.num_ioctls = via_max_ioctl;
via_init_command_verifier();
return drm_legacy_pci_init(&driver, &via_pci_driver);
--
2.33.1


2021-12-15 01:03:36

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 57/60] drm/udl: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/udl/udl_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c
index 5703277c6f52..d5a0aa762ec8 100644
--- a/drivers/gpu/drm/udl/udl_drv.c
+++ b/drivers/gpu/drm/udl/udl_drv.c
@@ -91,6 +91,9 @@ static int udl_usb_probe(struct usb_interface *interface,
int r;
struct udl_device *udl;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
udl = udl_driver_create(interface);
if (IS_ERR(udl))
return PTR_ERR(udl);
--
2.33.1


2021-12-15 01:03:40

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 56/60] drm/tve200: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tve200/tve200_drv.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c
index 7fa71c8bb828..afa3a2771650 100644
--- a/drivers/gpu/drm/tve200/tve200_drv.c
+++ b/drivers/gpu/drm/tve200/tve200_drv.c
@@ -158,6 +158,9 @@ static int tve200_probe(struct platform_device *pdev)
int irq;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
--
2.33.1


2021-12-15 01:03:43

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 55/60] drm/st7735r: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tiny/st7735r.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tiny/st7735r.c b/drivers/gpu/drm/tiny/st7735r.c
index fc40dd10efa8..841ec1c7bb93 100644
--- a/drivers/gpu/drm/tiny/st7735r.c
+++ b/drivers/gpu/drm/tiny/st7735r.c
@@ -190,6 +190,9 @@ static int st7735r_probe(struct spi_device *spi)
u32 rotation = 0;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
cfg = device_get_match_data(&spi->dev);
if (!cfg)
cfg = (void *)spi_get_device_id(spi)->driver_data;
--
2.33.1


2021-12-15 01:03:47

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 54/60] drm/st7586: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tiny/st7586.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tiny/st7586.c b/drivers/gpu/drm/tiny/st7586.c
index 51b9b9fb3ead..55bf695861c7 100644
--- a/drivers/gpu/drm/tiny/st7586.c
+++ b/drivers/gpu/drm/tiny/st7586.c
@@ -305,6 +305,9 @@ static int st7586_probe(struct spi_device *spi)
size_t bufsize;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
dbidev = devm_drm_dev_alloc(dev, &st7586_driver,
struct mipi_dbi_dev, drm);
if (IS_ERR(dbidev))
--
2.33.1


2021-12-15 01:03:49

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 53/60] drm/repaper: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tiny/repaper.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tiny/repaper.c b/drivers/gpu/drm/tiny/repaper.c
index 97a775c48cea..ea97b8c06157 100644
--- a/drivers/gpu/drm/tiny/repaper.c
+++ b/drivers/gpu/drm/tiny/repaper.c
@@ -968,6 +968,9 @@ static int repaper_probe(struct spi_device *spi)
const void *match;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
match = device_get_match_data(dev);
if (match) {
model = (enum repaper_model)match;
--
2.33.1


2021-12-15 01:03:52

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 52/60] drm/mi0283qt: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tiny/mi0283qt.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tiny/mi0283qt.c b/drivers/gpu/drm/tiny/mi0283qt.c
index 023de49e7a8e..f96fd350d373 100644
--- a/drivers/gpu/drm/tiny/mi0283qt.c
+++ b/drivers/gpu/drm/tiny/mi0283qt.c
@@ -186,6 +186,9 @@ static int mi0283qt_probe(struct spi_device *spi)
u32 rotation = 0;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
dbidev = devm_drm_dev_alloc(dev, &mi0283qt_driver,
struct mipi_dbi_dev, drm);
if (IS_ERR(dbidev))
--
2.33.1


2021-12-15 01:03:55

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 51/60] drm/ili9486: Add support for the nomodeset kernel parameter

According to disable Documentation/admin-guide/kernel-parameters.txt, this
parameter can be used to disable kernel modesetting.

DRM drivers will not perform display-mode changes or accelerated rendering
and only the systewm system framebuffer will be available if it was set-up.

But only a few DRM drivers currently check for nomodeset, make this driver
to also support the command line parameter.

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/gpu/drm/tiny/ili9486.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/tiny/ili9486.c b/drivers/gpu/drm/tiny/ili9486.c
index e9a63f4b2993..8e46420e1a87 100644
--- a/drivers/gpu/drm/tiny/ili9486.c
+++ b/drivers/gpu/drm/tiny/ili9486.c
@@ -196,6 +196,9 @@ static int ili9486_probe(struct spi_device *spi)
u32 rotation = 0;
int ret;

+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
dbidev = devm_drm_dev_alloc(dev, &ili9486_driver,
struct mipi_dbi_dev, drm);
if (IS_ERR(dbidev))
--
2.33.1


2021-12-15 01:04:58

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 21/60] drm/mcde: Add support for the nomodeset kernel parameter

On Wed, Dec 15, 2021 at 2:01 AM Javier Martinez Canillas
<[email protected]> wrote:

> According to disable Documentation/admin-guide/kernel-parameters.txt, this
> parameter can be used to disable kernel modesetting.
>
> DRM drivers will not perform display-mode changes or accelerated rendering
> and only the systewm system framebuffer will be available if it was set-up.
>
> But only a few DRM drivers currently check for nomodeset, make this driver
> to also support the command line parameter.
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>

Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2021-12-15 01:05:07

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 56/60] drm/tve200: Add support for the nomodeset kernel parameter

On Wed, Dec 15, 2021 at 2:01 AM Javier Martinez Canillas
<[email protected]> wrote:

> According to disable Documentation/admin-guide/kernel-parameters.txt, this
> parameter can be used to disable kernel modesetting.
>
> DRM drivers will not perform display-mode changes or accelerated rendering
> and only the systewm system framebuffer will be available if it was set-up.
>
> But only a few DRM drivers currently check for nomodeset, make this driver
> to also support the command line parameter.
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>

Reviewed-by: Linus Walleij <[email protected]>

Yours,
Linus Walleij

2021-12-15 05:59:16

by Oleksandr Andrushchenko

[permalink] [raw]
Subject: Re: [PATCH 59/60] drm/xen: Add support for the nomodeset kernel parameter

Hi, Javier!

On 15.12.21 03:00, Javier Martinez Canillas wrote:
> According to disable Documentation/admin-guide/kernel-parameters.txt, this
> parameter can be used to disable kernel modesetting.
>
> DRM drivers will not perform display-mode changes or accelerated rendering
> and only the systewm system framebuffer will be available if it was set-up.
s/systewm system/system
>
> But only a few DRM drivers currently check for nomodeset, make this driver
> to also support the command line parameter.
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---
>
> drivers/gpu/drm/xen/xen_drm_front.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/xen/xen_drm_front.c b/drivers/gpu/drm/xen/xen_drm_front.c
> index 434064c820e8..20d11ea79e0f 100644
> --- a/drivers/gpu/drm/xen/xen_drm_front.c
> +++ b/drivers/gpu/drm/xen/xen_drm_front.c
> @@ -495,6 +495,9 @@ static int xen_drm_drv_init(struct xen_drm_front_info *front_info)
> struct drm_device *drm_dev;
> int ret;
>
> + if (drm_firmware_drivers_only())
This is not yet in the upstream kernel, right?
> + return -ENODEV;
> +
> DRM_INFO("Creating %s\n", xen_drm_driver.desc);
>
> drm_info = kzalloc(sizeof(*drm_info), GFP_KERNEL);
With the commit message fixed:
Reviewed-by: Oleksandr Andrushchenko <[email protected]>

Thank you,
Oleksandr

2021-12-15 08:14:50

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 59/60] drm/xen: Add support for the nomodeset kernel parameter

Hello Oleksandr,

On 12/15/21 06:58, Oleksandr Andrushchenko wrote:
> Hi, Javier!
>
> On 15.12.21 03:00, Javier Martinez Canillas wrote:
>> According to disable Documentation/admin-guide/kernel-parameters.txt, this
>> parameter can be used to disable kernel modesetting.
>>
>> DRM drivers will not perform display-mode changes or accelerated rendering
>> and only the systewm system framebuffer will be available if it was set-up.
> s/systewm system/system
>>

Thanks a lot for spotting this! I rewrote the commit message a couple of times
and didn't notice that ended with a sentence that was mangled.

Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat


2021-12-15 08:31:12

by Thomas Zimmermann

[permalink] [raw]
Subject: Re: [PATCH 00/60] drm: Make all drivers to honour the nomodeset parameter

Hi Javier,

nothing wrong with your patches, but I'd like to propose slightly
differnt solution.

For many USB drivers, you put the drm_firmware_drivers_only() call into
the probe function. For registering, these drivers use
module_usb_driver(), which expands to generic device-register functions.

I'd like to propose a similar macro for DRM drivers that includes the
test for drm_firmware_drivers_only().

In drm_drv.h :

#if defined(USB)
static int drm_usb_register(struct usb_driver *usb)
{
if (drm_firmware_drivers_only())
return -ENODEV;
return usb_register_driver(usb);
}
#define drm_module_usb_driver(__usb)
module_driver(drm_usb_register, usb_deregister)
#endif

In each of the USB-based DRM drivers, replace module_usb_driver with
drm_module_usb_driver.

And then there's PCI [3] and platform drivers, [4] which can be handled
similarly. Many PCI drivers open-code the module init and device
registering with the driver-specific enable parameter. Maybe adding a
driver-specific register function would make sense.

Best regards
Thomas

[1]
https://elixir.bootlin.com/linux/v5.15.8/source/include/linux/usb.h#L1306
[2]
https://elixir.bootlin.com/linux/v5.15.8/source/include/linux/device/driver.h#L258
[3]
https://elixir.bootlin.com/linux/v5.15.8/source/include/linux/pci.h#L1453
[4]
https://elixir.bootlin.com/linux/v5.15.8/source/include/linux/platform_device.h#L251


Am 15.12.21 um 01:59 schrieb Javier Martinez Canillas:
> 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 parameter and most DRM drivers would just ignore it.
>
> This (huge) patch series makes all DRM drivers to honour this parameter. It
> is posted as separate patches to make easier for drivers maintainers to ack
> or pick them independently at their own pace.
>
> Patches are quite trivial and just add an if (drm_firmware_drivers_only())
> check and return -ENODEV if that's true. The condition is checked as early
> as possible, that is in the module_init handler for drivers that have one
> or in the probe function for drivers that are using the module_*_driver()
> macros and don't have their own module init function.
>
> I included all the DRM drivers that think makes sense. I only left the vc4
> and v3d drivers, that Maxime is already handling in another patch series
> and the vgem, vkms and simpledrm drivers that should ignore the param IMO.
>
> I've built tested with 'make allmodconfig && make M=drivers/gpu/drm/', but
> only booted in a few devices with and without nomodeset in the cmdline. So
> testing and reviewing for all the drivers would be highly appreciated.
>
> Best regards,
> Javier
>
>
> Javier Martinez Canillas (60):
> drm/komeda: Add support for the nomodeset kernel parameter
> drm/arm/hdlcd: Add support for the nomodeset kernel parameter
> drm/malidp: Add support for the nomodeset kernel parameter
> drm/armada: Add support for the nomodeset kernel parameter
> drm/aspeed: Add support for the nomodeset kernel parameter
> drm/atmel-hlcdc: Add support for the nomodeset kernel parameter
> drm/etnaviv: Add support for the nomodeset kernel parameter
> drm/exynos: Add support for the nomodeset kernel parameter
> drm/fsl-dcu: Add support for the nomodeset kernel parameter
> drm/gma500: Add support for the nomodeset kernel parameter
> drm/gud: Add support for the nomodeset kernel parameter
> drm/hisilicon/hibmc: Add support for the nomodeset kernel parameter
> drm/hisilicon/kirin: Add support for the nomodeset kernel parameter
> drm/hyperv: Add support for the nomodeset kernel parameter
> drm/i810: Add support for the nomodeset kernel parameter
> drm/imx/dcss: Add support for the nomodeset kernel parameter
> drm/imx: Add support for the nomodeset kernel parameter
> drm/ingenic: Add support for the nomodeset kernel parameter
> drm/kmb: Add support for the nomodeset kernel parameter
> drm/lima: Add support for the nomodeset kernel parameter
> drm/mcde: Add support for the nomodeset kernel parameter
> drm/mediatek: Add support for the nomodeset kernel parameter
> drm/meson: Add support for the nomodeset kernel parameter
> drm/mga: Add support for the nomodeset kernel parameter
> drm/msm: Add support for the nomodeset kernel parameter
> drm: mxsfb: Add support for the nomodeset kernel parameter
> drm/omap: Add support for the nomodeset kernel parameter
> drm/panel: ilitek-ili9341: Add support for the nomodeset kernel
> parameter
> drm/panfrost: Add support for the nomodeset kernel parameter
> drm/pl111: Add support for the nomodeset kernel parameter
> drm/r128: Add support for the nomodeset kernel parameter
> drm: rcar-du: Add support for the nomodeset kernel parameter
> drm/rockchip: Add support for the nomodeset kernel parameter
> drm/savage: Add support for the nomodeset kernel parameter
> drm/shmobile: Add support for the nomodeset kernel parameter
> drm/sis: Add support for the nomodeset kernel parameter
> drm/sprd: Add support for the nomodeset kernel parameter
> drm/sti: Add support for the nomodeset kernel parameter
> drm/stm: Add support for the nomodeset kernel parameter
> drm/sun4i: Add support for the nomodeset kernel parameter
> drm/tdfx: Add support for the nomodeset kernel parameter
> drm/tegra: Add support for the nomodeset kernel parameter
> drm/tidss: Add support for the nomodeset kernel parameter
> drm/tilcdc: Add support for the nomodeset kernel parameter
> drm/arc: Add support for the nomodeset kernel parameter
> drm/gm12u320: Add support for the nomodeset kernel parameter
> drm/hx8357d: Add support for the nomodeset kernel parameter
> drm/ili9163: Add support for the nomodeset kernel parameter
> drm/ili9225: Add support for the nomodeset kernel parameter
> drm/ili9341: Add support for the nomodeset kernel parameter
> drm/ili9486: Add support for the nomodeset kernel parameter
> drm/mi0283qt: Add support for the nomodeset kernel parameter
> drm/repaper: Add support for the nomodeset kernel parameter
> drm/st7586: Add support for the nomodeset kernel parameter
> drm/st7735r: Add support for the nomodeset kernel parameter
> drm/tve200: Add support for the nomodeset kernel parameter
> drm/udl: Add support for the nomodeset kernel parameter
> drm/via: Add support for the nomodeset kernel parameter
> drm/xen: Add support for the nomodeset kernel parameter
> drm/xlnx: Add support for the nomodeset kernel parameter
>
> drivers/gpu/drm/arm/display/komeda/komeda_drv.c | 4 ++++
> drivers/gpu/drm/arm/hdlcd_drv.c | 3 +++
> drivers/gpu/drm/arm/malidp_drv.c | 3 +++
> drivers/gpu/drm/armada/armada_drv.c | 3 +++
> drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 3 +++
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 3 +++
> drivers/gpu/drm/etnaviv/etnaviv_drv.c | 3 +++
> drivers/gpu/drm/exynos/exynos_drm_drv.c | 3 +++
> drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 3 +++
> drivers/gpu/drm/gma500/psb_drv.c | 3 +++
> drivers/gpu/drm/gud/gud_drv.c | 3 +++
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 3 +++
> drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 3 +++
> drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 3 +++
> drivers/gpu/drm/i810/i810_drv.c | 3 +++
> drivers/gpu/drm/imx/dcss/dcss-drv.c | 3 +++
> drivers/gpu/drm/imx/imx-drm-core.c | 3 +++
> drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 3 +++
> drivers/gpu/drm/kmb/kmb_drv.c | 3 +++
> drivers/gpu/drm/lima/lima_drv.c | 3 +++
> drivers/gpu/drm/mcde/mcde_drv.c | 3 +++
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 3 +++
> drivers/gpu/drm/meson/meson_drv.c | 3 +++
> drivers/gpu/drm/mga/mga_drv.c | 3 +++
> drivers/gpu/drm/msm/msm_drv.c | 3 +++
> drivers/gpu/drm/mxsfb/mxsfb_drv.c | 3 +++
> drivers/gpu/drm/omapdrm/omap_drv.c | 3 +++
> drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 3 +++
> drivers/gpu/drm/panfrost/panfrost_drv.c | 3 +++
> drivers/gpu/drm/pl111/pl111_drv.c | 3 +++
> drivers/gpu/drm/r128/r128_drv.c | 3 +++
> drivers/gpu/drm/rcar-du/rcar_du_drv.c | 3 +++
> drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 3 +++
> drivers/gpu/drm/savage/savage_drv.c | 3 +++
> drivers/gpu/drm/shmobile/shmob_drm_drv.c | 3 +++
> drivers/gpu/drm/sis/sis_drv.c | 3 +++
> drivers/gpu/drm/sprd/sprd_drm.c | 3 +++
> drivers/gpu/drm/sti/sti_drv.c | 3 +++
> drivers/gpu/drm/stm/drv.c | 3 +++
> drivers/gpu/drm/sun4i/sun4i_drv.c | 3 +++
> drivers/gpu/drm/tdfx/tdfx_drv.c | 3 +++
> drivers/gpu/drm/tegra/drm.c | 3 +++
> drivers/gpu/drm/tidss/tidss_drv.c | 3 +++
> drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 +++
> drivers/gpu/drm/tiny/arcpgu.c | 3 +++
> drivers/gpu/drm/tiny/gm12u320.c | 3 +++
> drivers/gpu/drm/tiny/hx8357d.c | 3 +++
> drivers/gpu/drm/tiny/ili9163.c | 3 +++
> drivers/gpu/drm/tiny/ili9225.c | 3 +++
> drivers/gpu/drm/tiny/ili9341.c | 3 +++
> drivers/gpu/drm/tiny/ili9486.c | 3 +++
> drivers/gpu/drm/tiny/mi0283qt.c | 3 +++
> drivers/gpu/drm/tiny/repaper.c | 3 +++
> drivers/gpu/drm/tiny/st7586.c | 3 +++
> drivers/gpu/drm/tiny/st7735r.c | 3 +++
> drivers/gpu/drm/tve200/tve200_drv.c | 3 +++
> drivers/gpu/drm/udl/udl_drv.c | 3 +++
> drivers/gpu/drm/via/via_drv.c | 3 +++
> drivers/gpu/drm/xen/xen_drm_front.c | 3 +++
> drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 3 +++
> 60 files changed, 181 insertions(+)
>

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev


Attachments:
OpenPGP_signature (840.00 B)
OpenPGP digital signature

2021-12-15 08:50:45

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 00/60] drm: Make all drivers to honour the nomodeset parameter

Hello Thomas,

On 12/15/21 09:31, Thomas Zimmermann wrote:
> Hi Javier,
>
> nothing wrong with your patches, but I'd like to propose slightly
> differnt solution.
>
> For many USB drivers, you put the drm_firmware_drivers_only() call into
> the probe function. For registering, these drivers use
> module_usb_driver(), which expands to generic device-register functions.
>
> I'd like to propose a similar macro for DRM drivers that includes the
> test for drm_firmware_drivers_only().
>
> In drm_drv.h :
>
> #if defined(USB)
> static int drm_usb_register(struct usb_driver *usb)
> {
> if (drm_firmware_drivers_only())
> return -ENODEV;
> return usb_register_driver(usb);
> }
> #define drm_module_usb_driver(__usb)
> module_driver(drm_usb_register, usb_deregister)
> #endif
>
> In each of the USB-based DRM drivers, replace module_usb_driver with
> drm_module_usb_driver.
>
> And then there's PCI [3] and platform drivers, [4] which can be handled
> similarly. Many PCI drivers open-code the module init and device

Thanks for the suggestion. I actually thought about this approach as well,
since seems unnecessary to have all that duplicated logic in every driver.

But at the end decided to just do the less intrusive change, because can't
do any testing for most of the drivers.

> registering with the driver-specific enable parameter. Maybe adding a
> driver-specific register function would make sense.
>

If I understood you correctly, suggested something similar in #dri-devel but
danvet's suggestion [0] was to keep it simple:

16:32 javierm: danvet: yes, I don't think we would be able to do it at this point. I'll add a function pointer
param to the check function so drivers can also define their own check besides nomodeset
16:33 danvet: javierm, uh that sounds a bit like overkill? just keep that part of the check in drivers?
16:33 javierm: danvet: Ok. Wanted to get rid of the duplicated code but I'm indeed over engineering this :)

[0]: https://people.freedesktop.org/~cbrill/dri-log/?channel=dri-devel&date=2021-11-02

> Best regards
> Thomas
>
Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat


2021-12-15 09:10:25

by Thomas Zimmermann

[permalink] [raw]
Subject: Re: [PATCH 00/60] drm: Make all drivers to honour the nomodeset parameter

Hi

Am 15.12.21 um 09:50 schrieb Javier Martinez Canillas:
> Hello Thomas,
>
> On 12/15/21 09:31, Thomas Zimmermann wrote:
>> Hi Javier,
>>
>> nothing wrong with your patches, but I'd like to propose slightly
>> differnt solution.
>>
>> For many USB drivers, you put the drm_firmware_drivers_only() call into
>> the probe function. For registering, these drivers use
>> module_usb_driver(), which expands to generic device-register functions.
>>
>> I'd like to propose a similar macro for DRM drivers that includes the
>> test for drm_firmware_drivers_only().
>>
>> In drm_drv.h :
>>
>> #if defined(USB)
>> static int drm_usb_register(struct usb_driver *usb)
>> {
>> if (drm_firmware_drivers_only())
>> return -ENODEV;
>> return usb_register_driver(usb);
>> }
>> #define drm_module_usb_driver(__usb)
>> module_driver(drm_usb_register, usb_deregister)
>> #endif
>>
>> In each of the USB-based DRM drivers, replace module_usb_driver with
>> drm_module_usb_driver.
>>
>> And then there's PCI [3] and platform drivers, [4] which can be handled
>> similarly. Many PCI drivers open-code the module init and device
>
> Thanks for the suggestion. I actually thought about this approach as well,
> since seems unnecessary to have all that duplicated logic in every driver.
>
> But at the end decided to just do the less intrusive change, because can't
> do any testing for most of the drivers.
>
>> registering with the driver-specific enable parameter. Maybe adding a
>> driver-specific register function would make sense.
>>
>
> If I understood you correctly, suggested something similar in #dri-devel but
> danvet's suggestion [0] was to keep it simple:
>
> 16:32 javierm: danvet: yes, I don't think we would be able to do it at this point. I'll add a function pointer
> param to the check function so drivers can also define their own check besides nomodeset
> 16:33 danvet: javierm, uh that sounds a bit like overkill? just keep that part of the check in drivers?
> 16:33 javierm: danvet: Ok. Wanted to get rid of the duplicated code but I'm indeed over engineering this :)

An extra pointer sounds indeed like over-engineering. If we take ast for
example, I'd just do something like this:

static ast_pci_register_driver(struct pci_driver *pci)
{
if (drm_firmware_drivers_only() && ast_modeset == -1)
return -ENODEV;
if (ast_modeset == 0)
return -ENODEV;

return pci_register_driver(pci);
}

module_driver(&ast_pci_driver, ast_pci_register_driver,
pci_unregister_driver)

That removes some of the boiler-plate module code without changing the
driver's behavior.

Best regards
Thomas

>
> [0]: https://people.freedesktop.org/~cbrill/dri-log/?channel=dri-devel&date=2021-11-02
>
>> Best regards
>> Thomas
>>
> Best regards,
>

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev


Attachments:
OpenPGP_signature (840.00 B)
OpenPGP digital signature

2021-12-15 09:12:20

by Thomas Zimmermann

[permalink] [raw]
Subject: Re: [PATCH 00/60] drm: Make all drivers to honour the nomodeset parameter

Hi

Am 15.12.21 um 09:31 schrieb Thomas Zimmermann:
> Hi Javier,
>
> nothing wrong with your patches, but I'd like to propose slightly
> differnt solution.
>
> For many USB drivers, you put the drm_firmware_drivers_only() call into
> the probe function. For registering, these drivers use
> module_usb_driver(), which expands to generic device-register functions.
>
> I'd like to propose a similar macro for DRM drivers that includes the
> test for drm_firmware_drivers_only().
>
> In drm_drv.h :
>
>   #if defined(USB)
>   static int drm_usb_register(struct usb_driver *usb)
>   {
>     if (drm_firmware_drivers_only())
>         return -ENODEV;
>     return usb_register_driver(usb);
>   }
>   #define drm_module_usb_driver(__usb)
>     module_driver(drm_usb_register, usb_deregister)
>   #endif
>
> In each of the USB-based DRM drivers, replace module_usb_driver with
> drm_module_usb_driver.
>
> And then there's PCI [3] and platform drivers, [4] which can be handled
> similarly. Many PCI drivers open-code the module init and device
> registering with the driver-specific enable parameter. Maybe adding a
> driver-specific register function would make sense.

Just want to point out that the next time we add a new driver, it will
call drm_firmware_drivers_only() automatically if it uses such a macro.

Best regards
Thomas

>
> Best regards
> Thomas
>
> [1]
> https://elixir.bootlin.com/linux/v5.15.8/source/include/linux/usb.h#L1306
> [2]
> https://elixir.bootlin.com/linux/v5.15.8/source/include/linux/device/driver.h#L258
>
> [3]
> https://elixir.bootlin.com/linux/v5.15.8/source/include/linux/pci.h#L1453
> [4]
> https://elixir.bootlin.com/linux/v5.15.8/source/include/linux/platform_device.h#L251
>
>
>
> Am 15.12.21 um 01:59 schrieb Javier Martinez Canillas:
>> 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 parameter and most DRM drivers would just ignore it.
>>
>> This (huge) patch series makes all DRM drivers to honour this
>> parameter. It
>> is posted as separate patches to make easier for drivers maintainers
>> to ack
>> or pick them independently at their own pace.
>>
>> Patches are quite trivial and just add an if
>> (drm_firmware_drivers_only())
>> check and return -ENODEV if that's true. The condition is checked as
>> early
>> as possible, that is in the module_init handler for drivers that have one
>> or in the probe function for drivers that are using the module_*_driver()
>> macros and don't have their own module init function.
>>
>> I included all the DRM drivers that think makes sense. I only left the
>> vc4
>> and v3d drivers, that Maxime is already handling in another patch series
>> and the vgem, vkms and simpledrm drivers that should ignore the param
>> IMO.
>>
>> I've built tested with 'make allmodconfig && make M=drivers/gpu/drm/',
>> but
>> only booted in a few devices with and without nomodeset in the
>> cmdline. So
>> testing and reviewing for all the drivers would be highly appreciated.
>>
>> Best regards,
>> Javier
>>
>>
>> Javier Martinez Canillas (60):
>>    drm/komeda: Add support for the nomodeset kernel parameter
>>    drm/arm/hdlcd: Add support for the nomodeset kernel parameter
>>    drm/malidp: Add support for the nomodeset kernel parameter
>>    drm/armada: Add support for the nomodeset kernel parameter
>>    drm/aspeed: Add support for the nomodeset kernel parameter
>>    drm/atmel-hlcdc: Add support for the nomodeset kernel parameter
>>    drm/etnaviv: Add support for the nomodeset kernel parameter
>>    drm/exynos: Add support for the nomodeset kernel parameter
>>    drm/fsl-dcu: Add support for the nomodeset kernel parameter
>>    drm/gma500: Add support for the nomodeset kernel parameter
>>    drm/gud: Add support for the nomodeset kernel parameter
>>    drm/hisilicon/hibmc: Add support for the nomodeset kernel parameter
>>    drm/hisilicon/kirin: Add support for the nomodeset kernel parameter
>>    drm/hyperv: Add support for the nomodeset kernel parameter
>>    drm/i810: Add support for the nomodeset kernel parameter
>>    drm/imx/dcss: Add support for the nomodeset kernel parameter
>>    drm/imx: Add support for the nomodeset kernel parameter
>>    drm/ingenic: Add support for the nomodeset kernel parameter
>>    drm/kmb: Add support for the nomodeset kernel parameter
>>    drm/lima: Add support for the nomodeset kernel parameter
>>    drm/mcde: Add support for the nomodeset kernel parameter
>>    drm/mediatek: Add support for the nomodeset kernel parameter
>>    drm/meson: Add support for the nomodeset kernel parameter
>>    drm/mga: Add support for the nomodeset kernel parameter
>>    drm/msm: Add support for the nomodeset kernel parameter
>>    drm: mxsfb: Add support for the nomodeset kernel parameter
>>    drm/omap: Add support for the nomodeset kernel parameter
>>    drm/panel: ilitek-ili9341: Add support for the nomodeset kernel
>>      parameter
>>    drm/panfrost: Add support for the nomodeset kernel parameter
>>    drm/pl111: Add support for the nomodeset kernel parameter
>>    drm/r128: Add support for the nomodeset kernel parameter
>>    drm: rcar-du: Add support for the nomodeset kernel parameter
>>    drm/rockchip: Add support for the nomodeset kernel parameter
>>    drm/savage: Add support for the nomodeset kernel parameter
>>    drm/shmobile: Add support for the nomodeset kernel parameter
>>    drm/sis: Add support for the nomodeset kernel parameter
>>    drm/sprd: Add support for the nomodeset kernel parameter
>>    drm/sti: Add support for the nomodeset kernel parameter
>>    drm/stm: Add support for the nomodeset kernel parameter
>>    drm/sun4i: Add support for the nomodeset kernel parameter
>>    drm/tdfx: Add support for the nomodeset kernel parameter
>>    drm/tegra: Add support for the nomodeset kernel parameter
>>    drm/tidss: Add support for the nomodeset kernel parameter
>>    drm/tilcdc: Add support for the nomodeset kernel parameter
>>    drm/arc: Add support for the nomodeset kernel parameter
>>    drm/gm12u320: Add support for the nomodeset kernel parameter
>>    drm/hx8357d: Add support for the nomodeset kernel parameter
>>    drm/ili9163: Add support for the nomodeset kernel parameter
>>    drm/ili9225: Add support for the nomodeset kernel parameter
>>    drm/ili9341: Add support for the nomodeset kernel parameter
>>    drm/ili9486: Add support for the nomodeset kernel parameter
>>    drm/mi0283qt: Add support for the nomodeset kernel parameter
>>    drm/repaper: Add support for the nomodeset kernel parameter
>>    drm/st7586: Add support for the nomodeset kernel parameter
>>    drm/st7735r: Add support for the nomodeset kernel parameter
>>    drm/tve200: Add support for the nomodeset kernel parameter
>>    drm/udl: Add support for the nomodeset kernel parameter
>>    drm/via: Add support for the nomodeset kernel parameter
>>    drm/xen: Add support for the nomodeset kernel parameter
>>    drm/xlnx: Add support for the nomodeset kernel parameter
>>
>>   drivers/gpu/drm/arm/display/komeda/komeda_drv.c | 4 ++++
>>   drivers/gpu/drm/arm/hdlcd_drv.c                 | 3 +++
>>   drivers/gpu/drm/arm/malidp_drv.c                | 3 +++
>>   drivers/gpu/drm/armada/armada_drv.c             | 3 +++
>>   drivers/gpu/drm/aspeed/aspeed_gfx_drv.c         | 3 +++
>>   drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c    | 3 +++
>>   drivers/gpu/drm/etnaviv/etnaviv_drv.c           | 3 +++
>>   drivers/gpu/drm/exynos/exynos_drm_drv.c         | 3 +++
>>   drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c       | 3 +++
>>   drivers/gpu/drm/gma500/psb_drv.c                | 3 +++
>>   drivers/gpu/drm/gud/gud_drv.c                   | 3 +++
>>   drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 3 +++
>>   drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 3 +++
>>   drivers/gpu/drm/hyperv/hyperv_drm_drv.c         | 3 +++
>>   drivers/gpu/drm/i810/i810_drv.c                 | 3 +++
>>   drivers/gpu/drm/imx/dcss/dcss-drv.c             | 3 +++
>>   drivers/gpu/drm/imx/imx-drm-core.c              | 3 +++
>>   drivers/gpu/drm/ingenic/ingenic-drm-drv.c       | 3 +++
>>   drivers/gpu/drm/kmb/kmb_drv.c                   | 3 +++
>>   drivers/gpu/drm/lima/lima_drv.c                 | 3 +++
>>   drivers/gpu/drm/mcde/mcde_drv.c                 | 3 +++
>>   drivers/gpu/drm/mediatek/mtk_drm_drv.c          | 3 +++
>>   drivers/gpu/drm/meson/meson_drv.c               | 3 +++
>>   drivers/gpu/drm/mga/mga_drv.c                   | 3 +++
>>   drivers/gpu/drm/msm/msm_drv.c                   | 3 +++
>>   drivers/gpu/drm/mxsfb/mxsfb_drv.c               | 3 +++
>>   drivers/gpu/drm/omapdrm/omap_drv.c              | 3 +++
>>   drivers/gpu/drm/panel/panel-ilitek-ili9341.c    | 3 +++
>>   drivers/gpu/drm/panfrost/panfrost_drv.c         | 3 +++
>>   drivers/gpu/drm/pl111/pl111_drv.c               | 3 +++
>>   drivers/gpu/drm/r128/r128_drv.c                 | 3 +++
>>   drivers/gpu/drm/rcar-du/rcar_du_drv.c           | 3 +++
>>   drivers/gpu/drm/rockchip/rockchip_drm_drv.c     | 3 +++
>>   drivers/gpu/drm/savage/savage_drv.c             | 3 +++
>>   drivers/gpu/drm/shmobile/shmob_drm_drv.c        | 3 +++
>>   drivers/gpu/drm/sis/sis_drv.c                   | 3 +++
>>   drivers/gpu/drm/sprd/sprd_drm.c                 | 3 +++
>>   drivers/gpu/drm/sti/sti_drv.c                   | 3 +++
>>   drivers/gpu/drm/stm/drv.c                       | 3 +++
>>   drivers/gpu/drm/sun4i/sun4i_drv.c               | 3 +++
>>   drivers/gpu/drm/tdfx/tdfx_drv.c                 | 3 +++
>>   drivers/gpu/drm/tegra/drm.c                     | 3 +++
>>   drivers/gpu/drm/tidss/tidss_drv.c               | 3 +++
>>   drivers/gpu/drm/tilcdc/tilcdc_drv.c             | 3 +++
>>   drivers/gpu/drm/tiny/arcpgu.c                   | 3 +++
>>   drivers/gpu/drm/tiny/gm12u320.c                 | 3 +++
>>   drivers/gpu/drm/tiny/hx8357d.c                  | 3 +++
>>   drivers/gpu/drm/tiny/ili9163.c                  | 3 +++
>>   drivers/gpu/drm/tiny/ili9225.c                  | 3 +++
>>   drivers/gpu/drm/tiny/ili9341.c                  | 3 +++
>>   drivers/gpu/drm/tiny/ili9486.c                  | 3 +++
>>   drivers/gpu/drm/tiny/mi0283qt.c                 | 3 +++
>>   drivers/gpu/drm/tiny/repaper.c                  | 3 +++
>>   drivers/gpu/drm/tiny/st7586.c                   | 3 +++
>>   drivers/gpu/drm/tiny/st7735r.c                  | 3 +++
>>   drivers/gpu/drm/tve200/tve200_drv.c             | 3 +++
>>   drivers/gpu/drm/udl/udl_drv.c                   | 3 +++
>>   drivers/gpu/drm/via/via_drv.c                   | 3 +++
>>   drivers/gpu/drm/xen/xen_drm_front.c             | 3 +++
>>   drivers/gpu/drm/xlnx/zynqmp_dpsub.c             | 3 +++
>>   60 files changed, 181 insertions(+)
>>
>

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev


Attachments:
OpenPGP_signature (840.00 B)
OpenPGP digital signature

2021-12-15 09:18:35

by Lucas Stach

[permalink] [raw]
Subject: Re: [PATCH 07/60] drm/etnaviv: Add support for the nomodeset kernel parameter

Hi Javier,

Am Mittwoch, dem 15.12.2021 um 01:59 +0100 schrieb Javier Martinez Canillas:
> According to disable Documentation/admin-guide/kernel-parameters.txt, this
> parameter can be used to disable kernel modesetting.
>
> DRM drivers will not perform display-mode changes or accelerated rendering
> and only the systewm system framebuffer will be available if it was set-up.
>
Etnaviv is a render-only driver, so will no perform any modesetting on
a display device, so I'm not sure if it's sensible to cover it under
the nomodeset parameter. I see that it is consistent with the other
drivers that deal with a combined render/display device, where the
render device also gets disabled with the nomodeset param, but it
doesn't really match the description of what the parameter is supposed
to do.

I'm not opposed to take this patch for consistency reasons, but I would
like to hear some more opinions from other DRM folks.

Regards,
Lucas

> But only a few DRM drivers currently check for nomodeset, make this driver
> to also support the command line parameter.
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---
>
> drivers/gpu/drm/etnaviv/etnaviv_drv.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> index 7dcc6392792d..58b092248f7b 100644
> --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
> @@ -635,6 +635,9 @@ static int __init etnaviv_init(void)
> int ret;
> struct device_node *np;
>
> + if (drm_firmware_drivers_only())
> + return -ENODEV;
> +
> etnaviv_validate_init();
>
> ret = platform_driver_register(&etnaviv_gpu_driver);



2021-12-15 09:20:37

by Lucas Stach

[permalink] [raw]
Subject: Re: [PATCH 16/60] drm/imx/dcss: Add support for the nomodeset kernel parameter

Am Mittwoch, dem 15.12.2021 um 01:59 +0100 schrieb Javier Martinez Canillas:
> According to disable Documentation/admin-guide/kernel-parameters.txt, this
> parameter can be used to disable kernel modesetting.
>
> DRM drivers will not perform display-mode changes or accelerated rendering
> and only the systewm system framebuffer will be available if it was set-up.
^ typo in all the patches.
>
> But only a few DRM drivers currently check for nomodeset, make this driver
> to also support the command line parameter.
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>

Reviewed-by: Lucas Stach <[email protected]>

> ---
>
> drivers/gpu/drm/imx/dcss/dcss-drv.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/imx/dcss/dcss-drv.c b/drivers/gpu/drm/imx/dcss/dcss-drv.c
> index 8dc2f85c514b..5be591da7389 100644
> --- a/drivers/gpu/drm/imx/dcss/dcss-drv.c
> +++ b/drivers/gpu/drm/imx/dcss/dcss-drv.c
> @@ -38,6 +38,9 @@ static int dcss_drv_platform_probe(struct platform_device *pdev)
> int err = 0;
> bool hdmi_output = true;
>
> + if (drm_firmware_drivers_only())
> + return -ENODEV;
> +
> if (!dev->of_node)
> return -ENODEV;
>



2021-12-15 09:25:43

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 00/60] drm: Make all drivers to honour the nomodeset parameter

Hello Thomas,

On 12/15/21 10:12, Thomas Zimmermann wrote:

[snip]

>>
>> In each of the USB-based DRM drivers, replace module_usb_driver with
>> drm_module_usb_driver.
>>
>> And then there's PCI [3] and platform drivers, [4] which can be handled
>> similarly. Many PCI drivers open-code the module init and device
>> registering with the driver-specific enable parameter. Maybe adding a
>> driver-specific register function would make sense.
>
> Just want to point out that the next time we add a new driver, it will
> call drm_firmware_drivers_only() automatically if it uses such a macro.
>

Yes, and it could also be used as an extension point in case we need more
logic like the drm_firmware_drivers_only() check for all drivers in the
future. So your suggestion is certainly the way to go.

I'll post a v2 when I get some time to work on this again.

Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat


2021-12-15 09:39:07

by Thomas Zimmermann

[permalink] [raw]
Subject: Re: [PATCH 07/60] drm/etnaviv: Add support for the nomodeset kernel parameter

(cc'ing Maxime)

Hi

Am 15.12.21 um 10:18 schrieb Lucas Stach:
> Hi Javier,
>
> Am Mittwoch, dem 15.12.2021 um 01:59 +0100 schrieb Javier Martinez Canillas:
>> According to disable Documentation/admin-guide/kernel-parameters.txt, this
>> parameter can be used to disable kernel modesetting.
>>
>> DRM drivers will not perform display-mode changes or accelerated rendering
>> and only the systewm system framebuffer will be available if it was set-up.
>>
> Etnaviv is a render-only driver, so will no perform any modesetting on
> a display device, so I'm not sure if it's sensible to cover it under
> the nomodeset parameter. I see that it is consistent with the other
> drivers that deal with a combined render/display device, where the
> render device also gets disabled with the nomodeset param, but it
> doesn't really match the description of what the parameter is supposed
> to do.
>
> I'm not opposed to take this patch for consistency reasons, but I would
> like to hear some more opinions from other DRM folks.

Our assumption is that we want to disable all DRM drivers; except those
that operate on the firmware's original framebuffer. That's why the the
test is called drm_firmware_drivers_only().

We know that nomodeset is a terrible name. We only kept it because it
was already there, widely used, and already does what we need.

We had similar concerns with the v3d driver of vc4. Javier, maybe we
should leave-out such special cases for now and discuss them separately?

Best regards
Thomas

>
> Regards,
> Lucas
>
>> But only a few DRM drivers currently check for nomodeset, make this driver
>> to also support the command line parameter.
>>
>> Signed-off-by: Javier Martinez Canillas <[email protected]>
>> ---
>>
>> drivers/gpu/drm/etnaviv/etnaviv_drv.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
>> index 7dcc6392792d..58b092248f7b 100644
>> --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
>> +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
>> @@ -635,6 +635,9 @@ static int __init etnaviv_init(void)
>> int ret;
>> struct device_node *np;
>>
>> + if (drm_firmware_drivers_only())
>> + return -ENODEV;
>> +
>> etnaviv_validate_init();
>>
>> ret = platform_driver_register(&etnaviv_gpu_driver);
>
>

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev


Attachments:
OpenPGP_signature (840.00 B)
OpenPGP digital signature

2021-12-15 09:45:13

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 07/60] drm/etnaviv: Add support for the nomodeset kernel parameter

[adding Erico Nunes to Cc list]

On 12/15/21 10:39, Thomas Zimmermann wrote:
> (cc'ing Maxime)
>
> Hi
>
> Am 15.12.21 um 10:18 schrieb Lucas Stach:
>> Hi Javier,
>>
>> Am Mittwoch, dem 15.12.2021 um 01:59 +0100 schrieb Javier Martinez Canillas:
>>> According to disable Documentation/admin-guide/kernel-parameters.txt, this
>>> parameter can be used to disable kernel modesetting.
>>>
>>> DRM drivers will not perform display-mode changes or accelerated rendering
>>> and only the systewm system framebuffer will be available if it was set-up.
>>>
>> Etnaviv is a render-only driver, so will no perform any modesetting on
>> a display device, so I'm not sure if it's sensible to cover it under
>> the nomodeset parameter. I see that it is consistent with the other
>> drivers that deal with a combined render/display device, where the
>> render device also gets disabled with the nomodeset param, but it
>> doesn't really match the description of what the parameter is supposed
>> to do.
>>
>> I'm not opposed to take this patch for consistency reasons, but I would
>> like to hear some more opinions from other DRM folks.
>
> Our assumption is that we want to disable all DRM drivers; except those
> that operate on the firmware's original framebuffer. That's why the the
> test is called drm_firmware_drivers_only().
>

Yes, we tried to document the implicit "nomodeset" semantics to make that
clear: https://cgit.freedesktop.org/drm/drm-misc/commit/?id=b22a15a5aca34c8f59b770f858b1c21d347175e0

> We know that nomodeset is a terrible name. We only kept it because it
> was already there, widely used, and already does what we need.
>
> We had similar concerns with the v3d driver of vc4. Javier, maybe we
> should leave-out such special cases for now and discuss them separately?
>

I was discussing the same with Erico (one of the lima driver developers).

Agree that we could leave those for now. Will drop from the patch-set all
the DRM drivers that don't have the DRIVER_MODESET .driver_features flag.

> Best regards
> Thomas
>

Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat


2021-12-15 21:37:47

by Noralf Trønnes

[permalink] [raw]
Subject: Re: [PATCH 11/60] drm/gud: Add support for the nomodeset kernel parameter



Den 15.12.2021 01.59, skrev Javier Martinez Canillas:
> According to disable Documentation/admin-guide/kernel-parameters.txt, this
> parameter can be used to disable kernel modesetting.
>
> DRM drivers will not perform display-mode changes or accelerated rendering
> and only the systewm system framebuffer will be available if it was set-up.
>
> But only a few DRM drivers currently check for nomodeset, make this driver
> to also support the command line parameter.
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---
>

I don't understand why this is applicable to USB drivers, there's no way
the firmware can setup a framebuffer and continue pushing pixels over
USB when Linux has been given control over the USB bus?

The same argument goes for the SPI drivers in drm/tiny/ as well.

Noralf.

> drivers/gpu/drm/gud/gud_drv.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c
> index 3f9d4b9a1e3d..4d253d249512 100644
> --- a/drivers/gpu/drm/gud/gud_drv.c
> +++ b/drivers/gpu/drm/gud/gud_drv.c
> @@ -446,6 +446,9 @@ static int gud_probe(struct usb_interface *intf, const struct usb_device_id *id)
> u32 *formats;
> int ret, i;
>
> + if (drm_firmware_drivers_only())
> + return -ENODEV;
> +
> ret = usb_find_bulk_out_endpoint(intf->cur_altsetting, &bulk_out);
> if (ret)
> return ret;
>

2021-12-15 21:50:48

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 11/60] drm/gud: Add support for the nomodeset kernel parameter

Hello Noralf,

On 12/15/21 22:37, Noralf Trønnes wrote:
>
>
> Den 15.12.2021 01.59, skrev Javier Martinez Canillas:
>> According to disable Documentation/admin-guide/kernel-parameters.txt, this
>> parameter can be used to disable kernel modesetting.
>>
>> DRM drivers will not perform display-mode changes or accelerated rendering
>> and only the systewm system framebuffer will be available if it was set-up.
>>
>> But only a few DRM drivers currently check for nomodeset, make this driver
>> to also support the command line parameter.
>>
>> Signed-off-by: Javier Martinez Canillas <[email protected]>
>> ---
>>
>
> I don't understand why this is applicable to USB drivers, there's no way
> the firmware can setup a framebuffer and continue pushing pixels over
> USB when Linux has been given control over the USB bus?
>
> The same argument goes for the SPI drivers in drm/tiny/ as well.
>

That's a very good point. I included these mostly for consistency but if it's
OK for the KMS drivers to just ignore the "nomodeset" parameter, I could drop
all that are not for devices in the PCI or platform buses.

Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat


2021-12-15 23:26:40

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 00/60] drm: Make all drivers to honour the nomodeset parameter

On 12/15/21 10:10, Thomas Zimmermann wrote:

[snip]

>
> An extra pointer sounds indeed like over-engineering. If we take ast for
> example, I'd just do something like this:
>
> static ast_pci_register_driver(struct pci_driver *pci)
> {
> if (drm_firmware_drivers_only() && ast_modeset == -1)
> return -ENODEV;
> if (ast_modeset == 0)
> return -ENODEV;
>
> return pci_register_driver(pci);
> }
>
> module_driver(&ast_pci_driver, ast_pci_register_driver,
> pci_unregister_driver)
>
> That removes some of the boiler-plate module code without changing the
> driver's behavior.
>

Agreed that would be a nice cleanup and could allow to for example get rid
of the following module exit function that's just a wrapper:

static void __exit ast_exit(void)
{
pci_unregister_driver(&ast_pci_driver);
}

But I think these cleanups are out of scope for this series and could be
done as a follow-up. Since the drm_firmware_drivers_only() check would
be needed in the module init function anyways.

> Best regards
> Thomas
>
Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat


2021-12-15 23:35:11

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH 00/60] drm: Make all drivers to honour the nomodeset parameter

Hi Javier,

Thank you for the patches.

On Wed, Dec 15, 2021 at 01:59:08AM +0100, Javier Martinez Canillas wrote:
> 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 parameter and most DRM drivers would just ignore it.
>
> This (huge) patch series makes all DRM drivers to honour this parameter. It
> is posted as separate patches to make easier for drivers maintainers to ack
> or pick them independently at their own pace.
>
> Patches are quite trivial and just add an if (drm_firmware_drivers_only())
> check and return -ENODEV if that's true. The condition is checked as early
> as possible, that is in the module_init handler for drivers that have one
> or in the probe function for drivers that are using the module_*_driver()
> macros and don't have their own module init function.
>
> I included all the DRM drivers that think makes sense. I only left the vc4
> and v3d drivers, that Maxime is already handling in another patch series
> and the vgem, vkms and simpledrm drivers that should ignore the param IMO.
>
> I've built tested with 'make allmodconfig && make M=drivers/gpu/drm/', but
> only booted in a few devices with and without nomodeset in the cmdline. So
> testing and reviewing for all the drivers would be highly appreciated.

The fact that the series is so big makes me think it would be better to
handle this in the DRM core. Is there any way we could do so ? Otherwise
we'll chase this issue forever in new drivers, and will be plagued with
cargo cult problems.

> Javier Martinez Canillas (60):
> drm/komeda: Add support for the nomodeset kernel parameter
> drm/arm/hdlcd: Add support for the nomodeset kernel parameter
> drm/malidp: Add support for the nomodeset kernel parameter
> drm/armada: Add support for the nomodeset kernel parameter
> drm/aspeed: Add support for the nomodeset kernel parameter
> drm/atmel-hlcdc: Add support for the nomodeset kernel parameter
> drm/etnaviv: Add support for the nomodeset kernel parameter
> drm/exynos: Add support for the nomodeset kernel parameter
> drm/fsl-dcu: Add support for the nomodeset kernel parameter
> drm/gma500: Add support for the nomodeset kernel parameter
> drm/gud: Add support for the nomodeset kernel parameter
> drm/hisilicon/hibmc: Add support for the nomodeset kernel parameter
> drm/hisilicon/kirin: Add support for the nomodeset kernel parameter
> drm/hyperv: Add support for the nomodeset kernel parameter
> drm/i810: Add support for the nomodeset kernel parameter
> drm/imx/dcss: Add support for the nomodeset kernel parameter
> drm/imx: Add support for the nomodeset kernel parameter
> drm/ingenic: Add support for the nomodeset kernel parameter
> drm/kmb: Add support for the nomodeset kernel parameter
> drm/lima: Add support for the nomodeset kernel parameter
> drm/mcde: Add support for the nomodeset kernel parameter
> drm/mediatek: Add support for the nomodeset kernel parameter
> drm/meson: Add support for the nomodeset kernel parameter
> drm/mga: Add support for the nomodeset kernel parameter
> drm/msm: Add support for the nomodeset kernel parameter
> drm: mxsfb: Add support for the nomodeset kernel parameter
> drm/omap: Add support for the nomodeset kernel parameter
> drm/panel: ilitek-ili9341: Add support for the nomodeset kernel
> parameter
> drm/panfrost: Add support for the nomodeset kernel parameter
> drm/pl111: Add support for the nomodeset kernel parameter
> drm/r128: Add support for the nomodeset kernel parameter
> drm: rcar-du: Add support for the nomodeset kernel parameter
> drm/rockchip: Add support for the nomodeset kernel parameter
> drm/savage: Add support for the nomodeset kernel parameter
> drm/shmobile: Add support for the nomodeset kernel parameter
> drm/sis: Add support for the nomodeset kernel parameter
> drm/sprd: Add support for the nomodeset kernel parameter
> drm/sti: Add support for the nomodeset kernel parameter
> drm/stm: Add support for the nomodeset kernel parameter
> drm/sun4i: Add support for the nomodeset kernel parameter
> drm/tdfx: Add support for the nomodeset kernel parameter
> drm/tegra: Add support for the nomodeset kernel parameter
> drm/tidss: Add support for the nomodeset kernel parameter
> drm/tilcdc: Add support for the nomodeset kernel parameter
> drm/arc: Add support for the nomodeset kernel parameter
> drm/gm12u320: Add support for the nomodeset kernel parameter
> drm/hx8357d: Add support for the nomodeset kernel parameter
> drm/ili9163: Add support for the nomodeset kernel parameter
> drm/ili9225: Add support for the nomodeset kernel parameter
> drm/ili9341: Add support for the nomodeset kernel parameter
> drm/ili9486: Add support for the nomodeset kernel parameter
> drm/mi0283qt: Add support for the nomodeset kernel parameter
> drm/repaper: Add support for the nomodeset kernel parameter
> drm/st7586: Add support for the nomodeset kernel parameter
> drm/st7735r: Add support for the nomodeset kernel parameter
> drm/tve200: Add support for the nomodeset kernel parameter
> drm/udl: Add support for the nomodeset kernel parameter
> drm/via: Add support for the nomodeset kernel parameter
> drm/xen: Add support for the nomodeset kernel parameter
> drm/xlnx: Add support for the nomodeset kernel parameter
>
> drivers/gpu/drm/arm/display/komeda/komeda_drv.c | 4 ++++
> drivers/gpu/drm/arm/hdlcd_drv.c | 3 +++
> drivers/gpu/drm/arm/malidp_drv.c | 3 +++
> drivers/gpu/drm/armada/armada_drv.c | 3 +++
> drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 3 +++
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 3 +++
> drivers/gpu/drm/etnaviv/etnaviv_drv.c | 3 +++
> drivers/gpu/drm/exynos/exynos_drm_drv.c | 3 +++
> drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 3 +++
> drivers/gpu/drm/gma500/psb_drv.c | 3 +++
> drivers/gpu/drm/gud/gud_drv.c | 3 +++
> drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 3 +++
> drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 3 +++
> drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 3 +++
> drivers/gpu/drm/i810/i810_drv.c | 3 +++
> drivers/gpu/drm/imx/dcss/dcss-drv.c | 3 +++
> drivers/gpu/drm/imx/imx-drm-core.c | 3 +++
> drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 3 +++
> drivers/gpu/drm/kmb/kmb_drv.c | 3 +++
> drivers/gpu/drm/lima/lima_drv.c | 3 +++
> drivers/gpu/drm/mcde/mcde_drv.c | 3 +++
> drivers/gpu/drm/mediatek/mtk_drm_drv.c | 3 +++
> drivers/gpu/drm/meson/meson_drv.c | 3 +++
> drivers/gpu/drm/mga/mga_drv.c | 3 +++
> drivers/gpu/drm/msm/msm_drv.c | 3 +++
> drivers/gpu/drm/mxsfb/mxsfb_drv.c | 3 +++
> drivers/gpu/drm/omapdrm/omap_drv.c | 3 +++
> drivers/gpu/drm/panel/panel-ilitek-ili9341.c | 3 +++
> drivers/gpu/drm/panfrost/panfrost_drv.c | 3 +++
> drivers/gpu/drm/pl111/pl111_drv.c | 3 +++
> drivers/gpu/drm/r128/r128_drv.c | 3 +++
> drivers/gpu/drm/rcar-du/rcar_du_drv.c | 3 +++
> drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 3 +++
> drivers/gpu/drm/savage/savage_drv.c | 3 +++
> drivers/gpu/drm/shmobile/shmob_drm_drv.c | 3 +++
> drivers/gpu/drm/sis/sis_drv.c | 3 +++
> drivers/gpu/drm/sprd/sprd_drm.c | 3 +++
> drivers/gpu/drm/sti/sti_drv.c | 3 +++
> drivers/gpu/drm/stm/drv.c | 3 +++
> drivers/gpu/drm/sun4i/sun4i_drv.c | 3 +++
> drivers/gpu/drm/tdfx/tdfx_drv.c | 3 +++
> drivers/gpu/drm/tegra/drm.c | 3 +++
> drivers/gpu/drm/tidss/tidss_drv.c | 3 +++
> drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 +++
> drivers/gpu/drm/tiny/arcpgu.c | 3 +++
> drivers/gpu/drm/tiny/gm12u320.c | 3 +++
> drivers/gpu/drm/tiny/hx8357d.c | 3 +++
> drivers/gpu/drm/tiny/ili9163.c | 3 +++
> drivers/gpu/drm/tiny/ili9225.c | 3 +++
> drivers/gpu/drm/tiny/ili9341.c | 3 +++
> drivers/gpu/drm/tiny/ili9486.c | 3 +++
> drivers/gpu/drm/tiny/mi0283qt.c | 3 +++
> drivers/gpu/drm/tiny/repaper.c | 3 +++
> drivers/gpu/drm/tiny/st7586.c | 3 +++
> drivers/gpu/drm/tiny/st7735r.c | 3 +++
> drivers/gpu/drm/tve200/tve200_drv.c | 3 +++
> drivers/gpu/drm/udl/udl_drv.c | 3 +++
> drivers/gpu/drm/via/via_drv.c | 3 +++
> drivers/gpu/drm/xen/xen_drm_front.c | 3 +++
> drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 3 +++
> 60 files changed, 181 insertions(+)

--
Regards,

Laurent Pinchart

2021-12-16 00:14:05

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 00/60] drm: Make all drivers to honour the nomodeset parameter

Hello Laurent,

On 12/16/21 00:35, Laurent Pinchart wrote:

[snip]

>>
>> I've built tested with 'make allmodconfig && make M=drivers/gpu/drm/', but
>> only booted in a few devices with and without nomodeset in the cmdline. So
>> testing and reviewing for all the drivers would be highly appreciated.
>
> The fact that the series is so big makes me think it would be better to
> handle this in the DRM core. Is there any way we could do so ? Otherwise
> we'll chase this issue forever in new drivers, and will be plagued with
> cargo cult problems.
>

Yes, what Thomas suggested is to add a set of drm_module_{pci,platform}_driver()
macros in include/drm/drm_drv.h, that will just check whether the driver should
be registered or not and call the {pci,platform}_register_driver() functions.

That way the change in the drivers would just be something like the following:

-module_platform_driver(malidp_platform_driver);
+drm_module_platform_driver(malidp_platform_driver);

There are some drivers that still need a custom module init functions for various
reasons (e.g: register a set of devices/drivers, need to be a late init call, etc)
but at least for most drivers this should be handled transparently as long as they
use these drm_*_register_driver() macros.

So just ignore this series and I'll post a v2 soon.

Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat


2021-12-16 00:24:41

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH 00/60] drm: Make all drivers to honour the nomodeset parameter

Hi Javier,

On Thu, Dec 16, 2021 at 01:13:56AM +0100, Javier Martinez Canillas wrote:
> Hello Laurent,
>
> On 12/16/21 00:35, Laurent Pinchart wrote:
>
> [snip]
>
> >>
> >> I've built tested with 'make allmodconfig && make M=drivers/gpu/drm/', but
> >> only booted in a few devices with and without nomodeset in the cmdline. So
> >> testing and reviewing for all the drivers would be highly appreciated.
> >
> > The fact that the series is so big makes me think it would be better to
> > handle this in the DRM core. Is there any way we could do so ? Otherwise
> > we'll chase this issue forever in new drivers, and will be plagued with
> > cargo cult problems.
> >
>
> Yes, what Thomas suggested is to add a set of drm_module_{pci,platform}_driver()
> macros in include/drm/drm_drv.h, that will just check whether the driver should
> be registered or not and call the {pci,platform}_register_driver() functions.
>
> That way the change in the drivers would just be something like the following:
>
> -module_platform_driver(malidp_platform_driver);
> +drm_module_platform_driver(malidp_platform_driver);
>
> There are some drivers that still need a custom module init functions for various
> reasons (e.g: register a set of devices/drivers, need to be a late init call, etc)
> but at least for most drivers this should be handled transparently as long as they
> use these drm_*_register_driver() macros.

Another option could be to return an error from drm_dev_alloc(). That
may avoid changes in the drivers.

> So just ignore this series and I'll post a v2 soon.

--
Regards,

Laurent Pinchart

2021-12-16 00:38:51

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 00/60] drm: Make all drivers to honour the nomodeset parameter

On 12/16/21 01:24, Laurent Pinchart wrote:
> Hi Javier,
>
> On Thu, Dec 16, 2021 at 01:13:56AM +0100, Javier Martinez Canillas wrote:
>> Hello Laurent,
>>
>> On 12/16/21 00:35, Laurent Pinchart wrote:
>>
>> [snip]
>>
>>>>
>>>> I've built tested with 'make allmodconfig && make M=drivers/gpu/drm/', but
>>>> only booted in a few devices with and without nomodeset in the cmdline. So
>>>> testing and reviewing for all the drivers would be highly appreciated.
>>>
>>> The fact that the series is so big makes me think it would be better to
>>> handle this in the DRM core. Is there any way we could do so ? Otherwise
>>> we'll chase this issue forever in new drivers, and will be plagued with
>>> cargo cult problems.
>>>
>>
>> Yes, what Thomas suggested is to add a set of drm_module_{pci,platform}_driver()
>> macros in include/drm/drm_drv.h, that will just check whether the driver should
>> be registered or not and call the {pci,platform}_register_driver() functions.
>>
>> That way the change in the drivers would just be something like the following:
>>
>> -module_platform_driver(malidp_platform_driver);
>> +drm_module_platform_driver(malidp_platform_driver);
>>
>> There are some drivers that still need a custom module init functions for various
>> reasons (e.g: register a set of devices/drivers, need to be a late init call, etc)
>> but at least for most drivers this should be handled transparently as long as they
>> use these drm_*_register_driver() macros.
>
> Another option could be to return an error from drm_dev_alloc(). That
> may avoid changes in the drivers.
>

That was actually the first approach I proposed but was told that it wouldn't work
for two reasons:

1) Usually that's called in the driver's probe function and the goal was to make it
fail as early as possible if nomodeset is present, so that means it is desirable
for this to be in the module init function (and is how most drivers implement).

2) Not all KMS drivers should fail if nomodeset is used. For example the simpledrm
driver still needs to be registered and probed since is what users would want
as a fallback / troubleshooting option if their native driver doesn't work.

Solving (2) is easy since we could just add a new .driver_features flag to indicate
that the driver should not fail if nomodeset is present. That way only the drivers
that are the exception would need to be modified.

But (1) is more tricky since this may be DRM driver maintainers preference.

Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat


2021-12-16 08:20:47

by Thomas Zimmermann

[permalink] [raw]
Subject: Re: [PATCH 11/60] drm/gud: Add support for the nomodeset kernel parameter

Hi

Am 15.12.21 um 22:37 schrieb Noralf Trønnes:
>
>
> Den 15.12.2021 01.59, skrev Javier Martinez Canillas:
>> According to disable Documentation/admin-guide/kernel-parameters.txt, this
>> parameter can be used to disable kernel modesetting.
>>
>> DRM drivers will not perform display-mode changes or accelerated rendering
>> and only the systewm system framebuffer will be available if it was set-up.
>>
>> But only a few DRM drivers currently check for nomodeset, make this driver
>> to also support the command line parameter.
>>
>> Signed-off-by: Javier Martinez Canillas <[email protected]>
>> ---
>>
>
> I don't understand why this is applicable to USB drivers, there's no way
> the firmware can setup a framebuffer and continue pushing pixels over
> USB when Linux has been given control over the USB bus?
>
> The same argument goes for the SPI drivers in drm/tiny/ as well.

The intended semantics of the option is to disable every display output
except for the buffer provided by the firmware.

With USB it still would still disable the driver. That's useful if only
for debugging. There are also systems with hard-wired USB displays where
one cannot just unplug the adapter.

Admittedly, USB graphics is a bit of an odd use case, but neither is it
too far fetched IMHO.

Best regards
Thomas

>
> Noralf.
>
>> drivers/gpu/drm/gud/gud_drv.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c
>> index 3f9d4b9a1e3d..4d253d249512 100644
>> --- a/drivers/gpu/drm/gud/gud_drv.c
>> +++ b/drivers/gpu/drm/gud/gud_drv.c
>> @@ -446,6 +446,9 @@ static int gud_probe(struct usb_interface *intf, const struct usb_device_id *id)
>> u32 *formats;
>> int ret, i;
>>
>> + if (drm_firmware_drivers_only())
>> + return -ENODEV;
>> +
>> ret = usb_find_bulk_out_endpoint(intf->cur_altsetting, &bulk_out);
>> if (ret)
>> return ret;
>>

--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev


Attachments:
OpenPGP_signature (840.00 B)
OpenPGP digital signature

2021-12-16 15:47:56

by Noralf Trønnes

[permalink] [raw]
Subject: Re: [PATCH 11/60] drm/gud: Add support for the nomodeset kernel parameter



Den 16.12.2021 09.20, skrev Thomas Zimmermann:
> Hi
>
> Am 15.12.21 um 22:37 schrieb Noralf Trønnes:
>>
>>
>> Den 15.12.2021 01.59, skrev Javier Martinez Canillas:
>>> According to disable Documentation/admin-guide/kernel-parameters.txt,
>>> this
>>> parameter can be used to disable kernel modesetting.
>>>
>>> DRM drivers will not perform display-mode changes or accelerated
>>> rendering
>>> and only the systewm system framebuffer will be available if it was
>>> set-up.
>>>
>>> But only a few DRM drivers currently check for nomodeset, make this
>>> driver
>>> to also support the command line parameter.
>>>
>>> Signed-off-by: Javier Martinez Canillas <[email protected]>
>>> ---
>>>
>>
>> I don't understand why this is applicable to USB drivers, there's no way
>> the firmware can setup a framebuffer and continue pushing pixels over
>> USB when Linux has been given control over the USB bus?
>>
>> The same argument goes for the SPI drivers in drm/tiny/ as well.
>
> The intended semantics of the option is to disable every display output
> except for the buffer provided by the firmware.
>

If that's the case this patch is:

Acked-by: Noralf Trønnes <[email protected]>

> With USB it still would still disable the driver. That's useful if only
> for debugging. There are also systems with hard-wired USB displays where
> one cannot just unplug the adapter.
>
> Admittedly, USB graphics is a bit of an odd use case, but neither is it
> too far fetched IMHO.
>
> Best regards
> Thomas
>
>>
>> Noralf.
>>
>>>   drivers/gpu/drm/gud/gud_drv.c | 3 +++
>>>   1 file changed, 3 insertions(+)
>>>
>>> diff --git a/drivers/gpu/drm/gud/gud_drv.c
>>> b/drivers/gpu/drm/gud/gud_drv.c
>>> index 3f9d4b9a1e3d..4d253d249512 100644
>>> --- a/drivers/gpu/drm/gud/gud_drv.c
>>> +++ b/drivers/gpu/drm/gud/gud_drv.c
>>> @@ -446,6 +446,9 @@ static int gud_probe(struct usb_interface *intf,
>>> const struct usb_device_id *id)
>>>       u32 *formats;
>>>       int ret, i;
>>>   +    if (drm_firmware_drivers_only())
>>> +        return -ENODEV;
>>> +
>>>       ret = usb_find_bulk_out_endpoint(intf->cur_altsetting, &bulk_out);
>>>       if (ret)
>>>           return ret;
>>>
>

2021-12-16 15:48:09

by Noralf Trønnes

[permalink] [raw]
Subject: Re: [PATCH 52/60] drm/mi0283qt: Add support for the nomodeset kernel parameter



Den 15.12.2021 02.00, skrev Javier Martinez Canillas:
> According to disable Documentation/admin-guide/kernel-parameters.txt, this
> parameter can be used to disable kernel modesetting.
>
> DRM drivers will not perform display-mode changes or accelerated rendering
> and only the systewm system framebuffer will be available if it was set-up.
>
> But only a few DRM drivers currently check for nomodeset, make this driver
> to also support the command line parameter.
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---

Acked-by: Noralf Trønnes <[email protected]>

2021-12-16 15:48:16

by Noralf Trønnes

[permalink] [raw]
Subject: Re: [PATCH 53/60] drm/repaper: Add support for the nomodeset kernel parameter



Den 15.12.2021 02.00, skrev Javier Martinez Canillas:
> According to disable Documentation/admin-guide/kernel-parameters.txt, this
> parameter can be used to disable kernel modesetting.
>
> DRM drivers will not perform display-mode changes or accelerated rendering
> and only the systewm system framebuffer will be available if it was set-up.
>
> But only a few DRM drivers currently check for nomodeset, make this driver
> to also support the command line parameter.
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---

Acked-by: Noralf Trønnes <[email protected]>

2022-01-24 19:38:57

by Carsten Haitzler

[permalink] [raw]
Subject: Re: [PATCH 03/60] drm/malidp: Add support for the nomodeset kernel parameter

Seems fine to me.

Reviewed-by: Carsten Haitzler <[email protected]>

On 12/15/21 00:59, Javier Martinez Canillas wrote:
> According to disable Documentation/admin-guide/kernel-parameters.txt, this
> parameter can be used to disable kernel modesetting.
>
> DRM drivers will not perform display-mode changes or accelerated rendering
> and only the systewm system framebuffer will be available if it was set-up.
>
> But only a few DRM drivers currently check for nomodeset, make this driver
> to also support the command line parameter.
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---
>
> drivers/gpu/drm/arm/malidp_drv.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
> index 78d15b04b105..5da4168eb76d 100644
> --- a/drivers/gpu/drm/arm/malidp_drv.c
> +++ b/drivers/gpu/drm/arm/malidp_drv.c
> @@ -938,6 +938,9 @@ static int malidp_platform_probe(struct platform_device *pdev)
> struct device_node *port;
> struct component_match *match = NULL;
>
> + if (drm_firmware_drivers_only())
> + return -ENODEV;
> +
> if (!pdev->dev.of_node)
> return -ENODEV;
>

2022-01-24 19:38:58

by Carsten Haitzler

[permalink] [raw]
Subject: Re: [PATCH 01/60] drm/komeda: Add support for the nomodeset kernel parameter

Seems fine.

Reviewed-by: Carsten Haitzler <[email protected]>

On 12/15/21 00:59, Javier Martinez Canillas wrote:
> According to disable Documentation/admin-guide/kernel-parameters.txt, this
> parameter can be used to disable kernel modesetting.
>
> DRM drivers will not perform display-mode changes or accelerated rendering
> and only the systewm system framebuffer will be available if it was set-up.
>
> But only a few DRM drivers currently check for nomodeset, make this driver
> to also support the command line parameter.
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---
>
> drivers/gpu/drm/arm/display/komeda/komeda_drv.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c
> index e7933930a657..4f6d5c2103ec 100644
> --- a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c
> +++ b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c
> @@ -9,6 +9,7 @@
> #include <linux/platform_device.h>
> #include <linux/component.h>
> #include <linux/pm_runtime.h>
> +#include <drm/drm_drv.h>
> #include <drm/drm_of.h>
> #include "komeda_dev.h"
> #include "komeda_kms.h"
> @@ -117,6 +118,9 @@ static int komeda_platform_probe(struct platform_device *pdev)
> struct component_match *match = NULL;
> struct device_node *child;
>
> + if (drm_firmware_drivers_only())
> + return -EINVAL;
> +
> if (!dev->of_node)
> return -ENODEV;
>

2022-01-24 19:39:00

by Carsten Haitzler

[permalink] [raw]
Subject: Re: [PATCH 02/60] drm/arm/hdlcd: Add support for the nomodeset kernel parameter

Seems fine.

Reviewed-by: Carsten Haitzler <[email protected]>

On 12/15/21 00:59, Javier Martinez Canillas wrote:
> According to disable Documentation/admin-guide/kernel-parameters.txt, this
> parameter can be used to disable kernel modesetting.
>
> DRM drivers will not perform display-mode changes or accelerated rendering
> and only the systewm system framebuffer will be available if it was set-up.
>
> But only a few DRM drivers currently check for nomodeset, make this driver
> to also support the command line parameter.
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---
>
> drivers/gpu/drm/arm/hdlcd_drv.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index 479c2422a2e0..0939a64a9bd2 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -382,6 +382,9 @@ static int hdlcd_probe(struct platform_device *pdev)
> struct device_node *port;
> struct component_match *match = NULL;
>
> + if (drm_firmware_drivers_only())
> + return -ENODEV;
> +
> /* there is only one output port inside each device, find it */
> port = of_graph_get_remote_node(pdev->dev.of_node, 0, 0);
> if (!port)