The nomodeset kernel command line parameter is used to prevent the KMS/DRM
drivers to be registered/probed. But only a few drivers implement support
for this and most DRM drivers just ignore it.
This patch series is a v2 to make DRM drivers to honour nomodeset. It is
posted as separate patches to make easier for drivers maintainers to ack
or pick them independently at their own pace.
The drm_module_{pci,platform}_driver() helper macros are added, which are
just wrappers around module_{pci,platform}_driver() but adding a check for
drm_firmware_drivers_only() and returning -ENODEV if that is true.
PCI and platform DRM drivers are then modified in the following patches to
make use of those macros.
For drivers that have custom module init/exit, the check is added to these
functions instead. Since the drm_*_module_driver() macros are only for the
default case when the init/exit just register/unregister the driver type.
In v1 all KMS/DRM drivers were included but v2 only includes KMS drivers,
and only the the PCI and platform DRM drivers. A follow-up series might
do the same for rendering-only and USB/SPI/I2C drivers, but it will need
more discussion to agree if that's desirable.
I've built tested with 'make allmodconfig && make M=drivers/gpu/drm' but I
don't have hardware to test the drivers, so review/testing is appreciated.
Best regards,
Javier
Changes in v2:
- Add drm_module_{pci,platform}_driver() macros and put the check there
(Thomas Zimmermann).
- Use the drm_module_*_driver() macros if possible (Thomas Zimmermann).
- Leave the DRM drivers that don't set the DRIVER_MODESET driver feature
(Lucas Stach).
- Leave USB/SPI/I2C drivers and only include PCI and platform ones
(Noralf Trønnes).
- Add collected Reviewed-by tags
Javier Martinez Canillas (37):
drm: Add drm_module_{pci,platform}_driver() helper macros
drm/hisilicon/hibmc: Use drm_module_pci_driver() to register the
driver
drm/komeda: Use drm_module_platform_driver() to register the driver
drm/arm/hdlcd: Use drm_module_platform_driver() to register the driver
drm/malidp: Use drm_module_platform_driver() to register the driver
drm/aspeed: Use drm_module_platform_driver() to register the driver
drm/atmel-hlcdc: Use drm_module_platform_driver() to register the
driver
drm/fsl-dcu: Use drm_module_platform_driver() to register the driver
drm/hisilicon/kirin: Use drm_module_platform_driver() to register the
driver
drm/imx/dcss: Use drm_module_platform_driver() to register the driver
drm/kmb: Use drm_module_platform_driver() to register the driver
drm/meson: Use drm_module_platform_driver() to register the driver
drm: mxsfb: Use drm_module_platform_driver() to register the driver
drm/shmobile: Use drm_module_platform_driver() to register the driver
drm/stm: Use drm_module_platform_driver() to register the driver
drm/sun4i: Use drm_module_platform_driver() to register the driver
drm/tidss: Use drm_module_platform_driver() to register the driver
drm/arc: Use drm_module_platform_driver() to register the driver
drm/tve200: Use drm_module_platform_driver() to register the driver
drm/xlnx: Use drm_module_platform_driver() to register the driver
drm/armada: Add support for the nomodeset kernel parameter
drm/exynos: Add support for the nomodeset kernel parameter
drm/gma500: Add support for the nomodeset kernel parameter
drm/hyperv: 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/mcde: Add support for the nomodeset kernel parameter
drm/mediatek: Add support for the nomodeset kernel parameter
drm/msm: Add support for the nomodeset kernel parameter
drm/omap: 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/sprd: Add support for the nomodeset kernel parameter
drm/sti: Add support for the nomodeset kernel parameter
drm/tegra: Add support for the nomodeset kernel parameter
drm/tilcdc: Add support for the nomodeset kernel parameter
drm/xen: Add support for the nomodeset kernel parameter
.../gpu/drm/arm/display/komeda/komeda_drv.c | 3 +-
drivers/gpu/drm/arm/hdlcd_drv.c | 2 +-
drivers/gpu/drm/arm/malidp_drv.c | 2 +-
drivers/gpu/drm/armada/armada_drv.c | 3 ++
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 2 +-
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 +-
drivers/gpu/drm/exynos/exynos_drm_drv.c | 3 ++
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 +-
drivers/gpu/drm/gma500/psb_drv.c | 3 ++
.../gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 +-
.../gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 +-
drivers/gpu/drm/hyperv/hyperv_drm_drv.c | 3 ++
drivers/gpu/drm/imx/dcss/dcss-drv.c | 2 +-
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 | 2 +-
drivers/gpu/drm/mcde/mcde_drv.c | 3 ++
drivers/gpu/drm/mediatek/mtk_drm_drv.c | 3 ++
drivers/gpu/drm/meson/meson_drv.c | 2 +-
drivers/gpu/drm/msm/msm_drv.c | 3 ++
drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 +-
drivers/gpu/drm/omapdrm/omap_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/shmobile/shmob_drm_drv.c | 2 +-
drivers/gpu/drm/sprd/sprd_drm.c | 3 ++
drivers/gpu/drm/sti/sti_drv.c | 3 ++
drivers/gpu/drm/stm/drv.c | 2 +-
drivers/gpu/drm/sun4i/sun4i_drv.c | 2 +-
drivers/gpu/drm/tegra/drm.c | 3 ++
drivers/gpu/drm/tidss/tidss_drv.c | 2 +-
drivers/gpu/drm/tilcdc/tilcdc_drv.c | 3 ++
drivers/gpu/drm/tiny/arcpgu.c | 2 +-
drivers/gpu/drm/tve200/tve200_drv.c | 2 +-
drivers/gpu/drm/xen/xen_drm_front.c | 3 ++
drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 2 +-
include/drm/drm_drv.h | 50 +++++++++++++++++++
37 files changed, 121 insertions(+), 19 deletions(-)
--
2.33.1
The macro calls to a DRM specific PCI driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
index 610fc8e135f9..398a68b1a08c 100644
--- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c
@@ -379,7 +379,7 @@ static struct pci_driver hibmc_pci_driver = {
.driver.pm = &hibmc_pm_ops,
};
-module_pci_driver(hibmc_pci_driver);
+drm_module_pci_driver(hibmc_pci_driver);
MODULE_DEVICE_TABLE(pci, hibmc_pci_table);
MODULE_AUTHOR("RongrongZou <[email protected]>");
--
2.33.1
According to disable Documentation/admin-guide/kernel-parameters.txt, the
nomodeset parameter can be used to disable kernel modesetting.
DRM drivers will not perform display-mode changes or accelerated rendering
and only the system framebuffer will be available if it was set-up.
But only a few DRM drivers currently check for nomodeset, so let's add two
helper macros that can be used by DRM drivers for PCI and platform devices
to have module init functions that checks if the drivers could be loaded.
Suggested-by: Thomas Zimmermann <[email protected]>
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
include/drm/drm_drv.h | 50 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index f6159acb8856..4001d73428c5 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -29,6 +29,8 @@
#include <linux/list.h>
#include <linux/irqreturn.h>
+#include <linux/pci.h>
+#include <linux/platform_device.h>
#include <drm/drm_device.h>
@@ -604,4 +606,52 @@ int drm_dev_set_unique(struct drm_device *dev, const char *name);
extern bool drm_firmware_drivers_only(void);
+/**
+ * drm_pci_register_driver() - register a DRM driver for PCI devices
+ * @drv: PCI driver structure
+ *
+ * Returns zero on success or a negative errno code on failure.
+ */
+static inline int drm_pci_register_driver(struct pci_driver *drv)
+{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
+ return pci_register_driver(drv);
+}
+
+/**
+ * drm_module_pci_driver() - helper macro for registering a DRM PCI driver
+ *
+ * Helper macro for DRM PCI drivers which do not do anything special in their
+ * module init/exit and just need the DRM specific module init.
+ */
+#define drm_module_pci_driver(__pci_driver) \
+ module_driver(__pci_driver, drm_pci_register_driver, \
+ pci_unregister_driver)
+
+/**
+ * drm_platform_driver_register - register a DRM driver for platform devices
+ * @drv: platform driver structure
+ *
+ * Returns zero on success or a negative errno code on failure.
+ */
+static inline int drm_platform_driver_register(struct platform_driver *drv)
+{
+ if (drm_firmware_drivers_only())
+ return -ENODEV;
+
+ return platform_driver_register(drv);
+}
+
+/**
+ * drm_module_platform_driver() - helper macro for registering a DRM platform driver
+ *
+ * Helper macro for DRM platform drivers which do not do anything special in their
+ * module init/exit and just need the DRM specific module init.
+ */
+#define drm_module_platform_driver(__platform_driver) \
+ module_driver(__platform_driver, drm_platform_driver_register, \
+ platform_driver_unregister)
+
#endif
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/arm/hdlcd_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 479c2422a2e0..1959ee7592c4 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -434,7 +434,7 @@ static struct platform_driver hdlcd_platform_driver = {
},
};
-module_platform_driver(hdlcd_platform_driver);
+drm_module_platform_driver(hdlcd_platform_driver);
MODULE_AUTHOR("Liviu Dudau");
MODULE_DESCRIPTION("ARM HDLCD DRM driver");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/arm/display/komeda/komeda_drv.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_drv.c b/drivers/gpu/drm/arm/display/komeda/komeda_drv.c
index e7933930a657..0d426240b1c9 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"
@@ -198,7 +199,7 @@ static struct platform_driver komeda_platform_driver = {
},
};
-module_platform_driver(komeda_platform_driver);
+drm_module_platform_driver(komeda_platform_driver);
MODULE_AUTHOR("James.Qian.Wang <[email protected]>");
MODULE_DESCRIPTION("Komeda KMS driver");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/arm/malidp_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
index 78d15b04b105..fe3215ec39c4 100644
--- a/drivers/gpu/drm/arm/malidp_drv.c
+++ b/drivers/gpu/drm/arm/malidp_drv.c
@@ -1008,7 +1008,7 @@ static struct platform_driver malidp_platform_driver = {
},
};
-module_platform_driver(malidp_platform_driver);
+drm_module_platform_driver(malidp_platform_driver);
MODULE_AUTHOR("Liviu Dudau <[email protected]>");
MODULE_DESCRIPTION("ARM Mali DP DRM driver");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
index 65f172807a0d..383799378c97 100644
--- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
+++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c
@@ -359,7 +359,7 @@ static struct platform_driver aspeed_gfx_platform_driver = {
},
};
-module_platform_driver(aspeed_gfx_platform_driver);
+drm_module_platform_driver(aspeed_gfx_platform_driver);
MODULE_AUTHOR("Joel Stanley <[email protected]>");
MODULE_DESCRIPTION("ASPEED BMC DRM/KMS driver");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
index 1656d27b78b6..3c01ede792bb 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.c
@@ -833,7 +833,7 @@ static struct platform_driver atmel_hlcdc_dc_platform_driver = {
.of_match_table = atmel_hlcdc_dc_of_match,
},
};
-module_platform_driver(atmel_hlcdc_dc_platform_driver);
+drm_module_platform_driver(atmel_hlcdc_dc_platform_driver);
MODULE_AUTHOR("Jean-Jacques Hiblot <[email protected]>");
MODULE_AUTHOR("Boris Brezillon <[email protected]>");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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..b24265f69523 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
@@ -368,7 +368,7 @@ static struct platform_driver fsl_dcu_drm_platform_driver = {
},
};
-module_platform_driver(fsl_dcu_drm_platform_driver);
+drm_module_platform_driver(fsl_dcu_drm_platform_driver);
MODULE_DESCRIPTION("Freescale DCU DRM Driver");
MODULE_LICENSE("GPL");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
Reviewed-by: Lucas Stach <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/imx/dcss/dcss-drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/imx/dcss/dcss-drv.c b/drivers/gpu/drm/imx/dcss/dcss-drv.c
index 8dc2f85c514b..f3d2bb07facb 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-drv.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-drv.c
@@ -131,7 +131,7 @@ static struct platform_driver dcss_platform_driver = {
},
};
-module_platform_driver(dcss_platform_driver);
+drm_module_platform_driver(dcss_platform_driver);
MODULE_AUTHOR("Laurentiu Palcu <[email protected]>");
MODULE_DESCRIPTION("DCSS driver for i.MX8MQ");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index 98ae9a48f3fe..2ac125edb0a1 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -307,7 +307,7 @@ static struct platform_driver kirin_drm_platform_driver = {
},
};
-module_platform_driver(kirin_drm_platform_driver);
+drm_module_platform_driver(kirin_drm_platform_driver);
MODULE_AUTHOR("Xinliang Liu <[email protected]>");
MODULE_AUTHOR("Xinliang Liu <[email protected]>");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/kmb/kmb_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/kmb/kmb_drv.c b/drivers/gpu/drm/kmb/kmb_drv.c
index ed2424350773..4a835f90fe3a 100644
--- a/drivers/gpu/drm/kmb/kmb_drv.c
+++ b/drivers/gpu/drm/kmb/kmb_drv.c
@@ -628,7 +628,7 @@ static struct platform_driver kmb_platform_driver = {
},
};
-module_platform_driver(kmb_platform_driver);
+drm_module_platform_driver(kmb_platform_driver);
MODULE_AUTHOR("Intel Corporation");
MODULE_DESCRIPTION("Keembay Display driver");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/mxsfb/mxsfb_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
index 86d78634a979..c843314d5b49 100644
--- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c
+++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c
@@ -410,7 +410,7 @@ static struct platform_driver mxsfb_platform_driver = {
},
};
-module_platform_driver(mxsfb_platform_driver);
+drm_module_platform_driver(mxsfb_platform_driver);
MODULE_AUTHOR("Marek Vasut <[email protected]>");
MODULE_DESCRIPTION("Freescale MXS DRM/KMS driver");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/meson/meson_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c
index 80f1d439841a..36a107e9bafa 100644
--- a/drivers/gpu/drm/meson/meson_drv.c
+++ b/drivers/gpu/drm/meson/meson_drv.c
@@ -541,7 +541,7 @@ static struct platform_driver meson_drm_platform_driver = {
},
};
-module_platform_driver(meson_drm_platform_driver);
+drm_module_platform_driver(meson_drm_platform_driver);
MODULE_AUTHOR("Jasper St. Pierre <[email protected]>");
MODULE_AUTHOR("Neil Armstrong <[email protected]>");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/sun4i/sun4i_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c
index b630614b3d72..4a2555509e7d 100644
--- a/drivers/gpu/drm/sun4i/sun4i_drv.c
+++ b/drivers/gpu/drm/sun4i/sun4i_drv.c
@@ -441,7 +441,7 @@ static struct platform_driver sun4i_drv_platform_driver = {
.pm = &sun4i_drv_drm_pm_ops,
},
};
-module_platform_driver(sun4i_drv_platform_driver);
+drm_module_platform_driver(sun4i_drv_platform_driver);
MODULE_AUTHOR("Boris Brezillon <[email protected]>");
MODULE_AUTHOR("Maxime Ripard <[email protected]>");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/tidss/tidss_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tidss/tidss_drv.c b/drivers/gpu/drm/tidss/tidss_drv.c
index 7c784e90e40e..121fd413a75e 100644
--- a/drivers/gpu/drm/tidss/tidss_drv.c
+++ b/drivers/gpu/drm/tidss/tidss_drv.c
@@ -251,7 +251,7 @@ static struct platform_driver tidss_platform_driver = {
},
};
-module_platform_driver(tidss_platform_driver);
+drm_module_platform_driver(tidss_platform_driver);
MODULE_AUTHOR("Tomi Valkeinen <[email protected]>");
MODULE_DESCRIPTION("TI Keystone DSS Driver");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/tiny/arcpgu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
index f8531c50a072..42c5a7137a47 100644
--- a/drivers/gpu/drm/tiny/arcpgu.c
+++ b/drivers/gpu/drm/tiny/arcpgu.c
@@ -427,7 +427,7 @@ static struct platform_driver arcpgu_platform_driver = {
},
};
-module_platform_driver(arcpgu_platform_driver);
+drm_module_platform_driver(arcpgu_platform_driver);
MODULE_AUTHOR("Carlos Palminha <[email protected]>");
MODULE_DESCRIPTION("ARC PGU DRM driver");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/tve200/tve200_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tve200/tve200_drv.c b/drivers/gpu/drm/tve200/tve200_drv.c
index 7fa71c8bb828..b1c35c13faeb 100644
--- a/drivers/gpu/drm/tve200/tve200_drv.c
+++ b/drivers/gpu/drm/tve200/tve200_drv.c
@@ -266,7 +266,7 @@ static struct platform_driver tve200_driver = {
.probe = tve200_probe,
.remove = tve200_remove,
};
-module_platform_driver(tve200_driver);
+drm_module_platform_driver(tve200_driver);
MODULE_DESCRIPTION(DRIVER_DESC);
MODULE_AUTHOR("Linus Walleij <[email protected]>");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/xlnx/zynqmp_dpsub.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
index ac37053412a1..311796106b70 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_dpsub.c
@@ -286,7 +286,7 @@ static struct platform_driver zynqmp_dpsub_driver = {
},
};
-module_platform_driver(zynqmp_dpsub_driver);
+drm_module_platform_driver(zynqmp_dpsub_driver);
MODULE_AUTHOR("Xilinx, Inc.");
MODULE_DESCRIPTION("ZynqMP DP Subsystem Driver");
--
2.33.1
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 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]>
---
(no changes since v1)
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
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 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]>
---
(no changes since v1)
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
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/stm/drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index 222869b232ae..143b508b68db 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -236,7 +236,7 @@ static struct platform_driver stm_drm_platform_driver = {
},
};
-module_platform_driver(stm_drm_platform_driver);
+drm_module_platform_driver(stm_drm_platform_driver);
MODULE_AUTHOR("Philippe Cornu <[email protected]>");
MODULE_AUTHOR("Yannick Fertre <[email protected]>");
--
2.33.1
The macro calls to a DRM specific platform driver init handler that checks
whether the driver is allowed to be registered or not.
Signed-off-by: Javier Martinez Canillas <[email protected]>
---
(no changes since v1)
drivers/gpu/drm/shmobile/shmob_drm_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/shmobile/shmob_drm_drv.c b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
index 80078a9fd7f6..c99adb8e74ce 100644
--- a/drivers/gpu/drm/shmobile/shmob_drm_drv.c
+++ b/drivers/gpu/drm/shmobile/shmob_drm_drv.c
@@ -295,7 +295,7 @@ static struct platform_driver shmob_drm_platform_driver = {
},
};
-module_platform_driver(shmob_drm_platform_driver);
+drm_module_platform_driver(shmob_drm_platform_driver);
MODULE_AUTHOR("Laurent Pinchart <[email protected]>");
MODULE_DESCRIPTION("Renesas SH Mobile DRM Driver");
--
2.33.1
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 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]>
---
(no changes since v1)
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
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 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]>
---
(no changes since v1)
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 00e53de4812b..4a8941fa0815 100644
--- a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
+++ b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
@@ -305,6 +305,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
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 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]>
---
(no changes since v1)
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
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 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]>
---
(no changes since v1)
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 542c4af70661..7f10d6eed549 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c
@@ -1543,6 +1543,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
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 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]>
---
(no changes since v1)
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
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 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]>
---
(no changes since v1)
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 892c04365239..8f30e68ae3b5 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
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 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]>
---
(no changes since v1)
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
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 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]>
---
(no changes since v1)
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
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 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]>
---
(no changes since v1)
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 5a8131ef81d5..982e450233ed 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
@@ -701,6 +701,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
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 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]>
---
(no changes since v1)
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
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 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]>
---
(no changes since v1)
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
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 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: Oleksandr Andrushchenko <[email protected]>
---
(no changes since v1)
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 e63088c2121d..0d8e6bd1ccbf 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
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 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]>
---
(no changes since v1)
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
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 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]>
---
(no changes since v1)
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 cc567c87057d..eee3c447fbac 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
@@ -604,6 +604,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
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 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]>
---
(no changes since v1)
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
On 2021-12-17 2:37, 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 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: Jyri Sarha <[email protected]>
> ---
>
> (no changes since v1)
>
> 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 cc567c87057d..eee3c447fbac 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> @@ -604,6 +604,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);
Hi Javier,
looks good already. Some comments are below.
Am 17.12.21 um 01:37 schrieb Javier Martinez Canillas:
> According to disable Documentation/admin-guide/kernel-parameters.txt, the
> nomodeset parameter can be used to disable kernel modesetting.
>
> DRM drivers will not perform display-mode changes or accelerated rendering
> and only the system framebuffer will be available if it was set-up.
>
> But only a few DRM drivers currently check for nomodeset, so let's add two
> helper macros that can be used by DRM drivers for PCI and platform devices
> to have module init functions that checks if the drivers could be loaded.
>
> Suggested-by: Thomas Zimmermann <[email protected]>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---
>
> (no changes since v1)
>
> include/drm/drm_drv.h | 50 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 50 insertions(+)
>
> diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
I worked on a similar patch today and found that drm_drv.h is actually
not a good place. Half of DRM includes this file and now it all depends
on linux/pci.h and linux/platform.h (and probably other later).
I propose to put the module helpers into <drm/drm_module.h> and include
it where necessary.
> index f6159acb8856..4001d73428c5 100644
> --- a/include/drm/drm_drv.h
> +++ b/include/drm/drm_drv.h
> @@ -29,6 +29,8 @@
>
> #include <linux/list.h>
> #include <linux/irqreturn.h>
> +#include <linux/pci.h>
> +#include <linux/platform_device.h>
>
> #include <drm/drm_device.h>
>
> @@ -604,4 +606,52 @@ int drm_dev_set_unique(struct drm_device *dev, const char *name);
>
> extern bool drm_firmware_drivers_only(void);
>
> +/**
> + * drm_pci_register_driver() - register a DRM driver for PCI devices
> + * @drv: PCI driver structure
> + *
> + * Returns zero on success or a negative errno code on failure.
> + */
> +static inline int drm_pci_register_driver(struct pci_driver *drv)
This should be declared as __init, so it goes into a separate section of
the module. IIRC the page in the init section are released after the
module has been loaded.
I'd either not document the register functions, or explicitly say that
the module macros are the preferred way of using them.
> +{
> + if (drm_firmware_drivers_only())
> + return -ENODEV;
> +
> + return pci_register_driver(drv);
> +}
> +
> +/**
> + * drm_module_pci_driver() - helper macro for registering a DRM PCI driver
Docs for the __pci_driver argument
> + *
> + * Helper macro for DRM PCI drivers which do not do anything special in their
> + * module init/exit and just need the DRM specific module init.
> + */
> +#define drm_module_pci_driver(__pci_driver) \
> + module_driver(__pci_driver, drm_pci_register_driver, \
> + pci_unregister_driver)
> +
> +/**
> + * drm_platform_driver_register - register a DRM driver for platform devices
> + * @drv: platform driver structure
> + *
> + * Returns zero on success or a negative errno code on failure.
> + */
> +static inline int drm_platform_driver_register(struct platform_driver *drv)
> +{
> + if (drm_firmware_drivers_only())
> + return -ENODEV;
> +
> + return platform_driver_register(drv);
> +}
> +
> +/**
> + * drm_module_platform_driver() - helper macro for registering a DRM platform driver
Docs for the __platform_driver argument
Best regards
Thomas
> + *
> + * Helper macro for DRM platform drivers which do not do anything special in their
> + * module init/exit and just need the DRM specific module init.
> + */
> +#define drm_module_platform_driver(__platform_driver) \
> + module_driver(__platform_driver, drm_platform_driver_register, \
> + platform_driver_unregister)
> +
> #endif
>
--
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
Hi Javier,
I love your patch! Yet something to improve:
[auto build test ERROR on next-20211215]
[also build test ERROR on v5.16-rc5]
[cannot apply to drm/drm-next shawnguo/for-next pinchartl-media/drm/du/next drm-exynos/exynos-drm-next v5.16-rc5 v5.16-rc4 v5.16-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Javier-Martinez-Canillas/drm-Make-drivers-to-honour-the-nomodeset-parameter/20211217-084031
base: 93bf6eee76c0e716f6b32de690b1c52991547bb4
config: arm64-randconfig-r034-20211216 (https://download.01.org/0day-ci/archive/20211217/[email protected]/config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/c7b8e02dcec35660bbc9101ae0c1db11e5f7d1ab
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Javier-Martinez-Canillas/drm-Make-drivers-to-honour-the-nomodeset-parameter/20211217-084031
git checkout c7b8e02dcec35660bbc9101ae0c1db11e5f7d1ab
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/gpu/drm/imx/dcss/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
All error/warnings (new ones prefixed by >>):
>> drivers/gpu/drm/imx/dcss/dcss-drv.c:134:1: warning: data definition has no type or storage class
134 | drm_module_platform_driver(dcss_platform_driver);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/gpu/drm/imx/dcss/dcss-drv.c:134:1: error: type defaults to 'int' in declaration of 'drm_module_platform_driver' [-Werror=implicit-int]
>> drivers/gpu/drm/imx/dcss/dcss-drv.c:134:1: warning: parameter names (without types) in function declaration
drivers/gpu/drm/imx/dcss/dcss-drv.c:124:31: warning: 'dcss_platform_driver' defined but not used [-Wunused-variable]
124 | static struct platform_driver dcss_platform_driver = {
| ^~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +134 drivers/gpu/drm/imx/dcss/dcss-drv.c
133
> 134 drm_module_platform_driver(dcss_platform_driver);
135
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
On Thu, Dec 16, 2021 at 4:38 PM 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 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: Deepak Rawat <[email protected]>
>
> (no changes since v1)
>
> 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 00e53de4812b..4a8941fa0815 100644
> --- a/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
> +++ b/drivers/gpu/drm/hyperv/hyperv_drm_drv.c
> @@ -305,6 +305,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
>
On 12/17/21 01:37, 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 and most DRM drivers just ignore it.
>
> This patch series is a v2 to make DRM drivers to honour nomodeset. It is
> posted as separate patches to make easier for drivers maintainers to ack
> or pick them independently at their own pace.
>
Pushed the remaining of the drivers patches from this set to drm-misc-next.
Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat
Hi Javier,
Quoting Javier Martinez Canillas (2021-12-17 00:37:46)
> 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 system framebuffer will be available if it was set-up.
What is the 'system framebuffer' in this instance? Reading
https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt
it sounds like that means anything already set up by the bootloader.
> 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]>
> ---
>
> (no changes since v1)
>
> 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 5a8131ef81d5..982e450233ed 100644
> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> @@ -701,6 +701,9 @@ static struct platform_driver rcar_du_platform_driver = {
>
> static int __init rcar_du_init(void)
> {
> + if (drm_firmware_drivers_only())
> + return -ENODEV;
> +
This will completely disable all control of the display device when
nomodeset is enabled.
Is there any requirement for us to support outputting to the display if
it was previously set up? presumably without setting or changing any
modes, but simply allowing the existing frame to be updated?
I think the implication is that 'firmware drivers' would mean a display
could be updated through some firmware interface, which we won't have
... so it seems reasonable to accept that this whole driver can be
disabled in that instance.
Reading your mail that brought this thread up in my inbox, I think
you've already hit merge on this, so don't worry about adding a tag in
that instance, but I think this is ok.
Reviewed-by: Kieran Bingham <[email protected]>
> rcar_du_of_init(rcar_du_of_table);
>
> return platform_driver_register(&rcar_du_platform_driver);
> --
> 2.33.1
>
Hi
Am 28.01.22 um 10:13 schrieb Kieran Bingham:
> Hi Javier,
>
> Quoting Javier Martinez Canillas (2021-12-17 00:37:46)
>> 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 system framebuffer will be available if it was set-up.
>
> What is the 'system framebuffer' in this instance? Reading
> https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt
> it sounds like that means anything already set up by the bootloader.
Exactly this.
>
>> 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]>
>> ---
>>
>> (no changes since v1)
>>
>> 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 5a8131ef81d5..982e450233ed 100644
>> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
>> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
>> @@ -701,6 +701,9 @@ static struct platform_driver rcar_du_platform_driver = {
>>
>> static int __init rcar_du_init(void)
>> {
>> + if (drm_firmware_drivers_only())
>> + return -ENODEV;
>> +
>
> This will completely disable all control of the display device when
> nomodeset is enabled.
>
> Is there any requirement for us to support outputting to the display if
> it was previously set up? presumably without setting or changing any
> modes, but simply allowing the existing frame to be updated?
There's no requirement for your driver. We just want a parameter where
we can conveniently disable most of DRM's drivers and reduce it to a
minimum. Helps distributions to provide a simple fallback mode. Most
PCI-based drivers already support that. Now we're added it to the other
drivers as well.
>
> I think the implication is that 'firmware drivers' would mean a display
> could be updated through some firmware interface, which we won't have
> ... so it seems reasonable to accept that this whole driver can be
> disabled in that instance.
It cannot be 'mode-setted'. We get a pre-configured framebuffer from the
firmware or bootloader. Whatever we draw there shows up on the screen.
Best regards
Thomas
>
> Reading your mail that brought this thread up in my inbox, I think
> you've already hit merge on this, so don't worry about adding a tag in
> that instance, but I think this is ok.
>
> Reviewed-by: Kieran Bingham <[email protected]>
>
>> rcar_du_of_init(rcar_du_of_table);
>>
>> return platform_driver_register(&rcar_du_platform_driver);
>> --
>> 2.33.1
>>
--
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
Hi Thomas,
On Fri, Jan 28, 2022 at 10:33:21AM +0100, Thomas Zimmermann wrote:
> Am 28.01.22 um 10:13 schrieb Kieran Bingham:
> > Quoting Javier Martinez Canillas (2021-12-17 00:37:46)
> >> 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 system framebuffer will be available if it was set-up.
> >
> > What is the 'system framebuffer' in this instance? Reading
> > https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt
> > it sounds like that means anything already set up by the bootloader.
>
> Exactly this.
>
> >> 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]>
> >> ---
> >>
> >> (no changes since v1)
> >>
> >> 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 5a8131ef81d5..982e450233ed 100644
> >> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> >> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> >> @@ -701,6 +701,9 @@ static struct platform_driver rcar_du_platform_driver = {
> >>
> >> static int __init rcar_du_init(void)
> >> {
> >> + if (drm_firmware_drivers_only())
> >> + return -ENODEV;
> >> +
> >
> > This will completely disable all control of the display device when
> > nomodeset is enabled.
> >
> > Is there any requirement for us to support outputting to the display if
> > it was previously set up? presumably without setting or changing any
> > modes, but simply allowing the existing frame to be updated?
>
> There's no requirement for your driver. We just want a parameter where
> we can conveniently disable most of DRM's drivers and reduce it to a
> minimum. Helps distributions to provide a simple fallback mode. Most
> PCI-based drivers already support that. Now we're added it to the other
> drivers as well.
>
> >
> > I think the implication is that 'firmware drivers' would mean a display
> > could be updated through some firmware interface, which we won't have
> > ... so it seems reasonable to accept that this whole driver can be
> > disabled in that instance.
>
> It cannot be 'mode-setted'. We get a pre-configured framebuffer from the
> firmware or bootloader. Whatever we draw there shows up on the screen.
I doubt that's going to work as you expect, clocks and regulators will
get disabled at boot if not used by any driver.
> > Reading your mail that brought this thread up in my inbox, I think
> > you've already hit merge on this, so don't worry about adding a tag in
> > that instance, but I think this is ok.
> >
> > Reviewed-by: Kieran Bingham <[email protected]>
> >
> >> rcar_du_of_init(rcar_du_of_table);
> >>
> >> return platform_driver_register(&rcar_du_platform_driver);
--
Regards,
Laurent Pinchart
Hi Thomas,
On Fri, Jan 28, 2022 at 11:46:49AM +0100, Thomas Zimmermann wrote:
> Am 28.01.22 um 11:34 schrieb Laurent Pinchart:
> > On Fri, Jan 28, 2022 at 10:33:21AM +0100, Thomas Zimmermann wrote:
> >> Am 28.01.22 um 10:13 schrieb Kieran Bingham:
> >>> Quoting Javier Martinez Canillas (2021-12-17 00:37:46)
> >>>> 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 system framebuffer will be available if it was set-up.
> >>>
> >>> What is the 'system framebuffer' in this instance? Reading
> >>> https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt
> >>> it sounds like that means anything already set up by the bootloader.
> >>
> >> Exactly this.
> >>
> >>>> 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]>
> >>>> ---
> >>>>
> >>>> (no changes since v1)
> >>>>
> >>>> 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 5a8131ef81d5..982e450233ed 100644
> >>>> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> >>>> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> >>>> @@ -701,6 +701,9 @@ static struct platform_driver rcar_du_platform_driver = {
> >>>>
> >>>> static int __init rcar_du_init(void)
> >>>> {
> >>>> + if (drm_firmware_drivers_only())
> >>>> + return -ENODEV;
> >>>> +
> >>>
> >>> This will completely disable all control of the display device when
> >>> nomodeset is enabled.
> >>>
> >>> Is there any requirement for us to support outputting to the display if
> >>> it was previously set up? presumably without setting or changing any
> >>> modes, but simply allowing the existing frame to be updated?
> >>
> >> There's no requirement for your driver. We just want a parameter where
> >> we can conveniently disable most of DRM's drivers and reduce it to a
> >> minimum. Helps distributions to provide a simple fallback mode. Most
> >> PCI-based drivers already support that. Now we're added it to the other
> >> drivers as well.
> >>
> >>>
> >>> I think the implication is that 'firmware drivers' would mean a display
> >>> could be updated through some firmware interface, which we won't have
> >>> ... so it seems reasonable to accept that this whole driver can be
> >>> disabled in that instance.
> >>
> >> It cannot be 'mode-setted'. We get a pre-configured framebuffer from the
> >> firmware or bootloader. Whatever we draw there shows up on the screen.
> >
> > I doubt that's going to work as you expect, clocks and regulators will
> > get disabled at boot if not used by any driver.
>
> Simpledrm and simplefb attach to these firmware framebuffers. Both
> drivers look at the device tree nodes to acquire the relevant clocks and
> regulators.
How about clocks and regulators for the ancillary devices, such as
encoders, or in the R-Car case, the external composer handled by the
vsp1 driver (in drivers/media/platform/vsp1) ?
This approach may work fine on x86 desktop systems, but for ARM-based
devices, the situation is usually more complex.
> >>> Reading your mail that brought this thread up in my inbox, I think
> >>> you've already hit merge on this, so don't worry about adding a tag in
> >>> that instance, but I think this is ok.
> >>>
> >>> Reviewed-by: Kieran Bingham <[email protected]>
> >>>
> >>>> rcar_du_of_init(rcar_du_of_table);
> >>>>
> >>>> return platform_driver_register(&rcar_du_platform_driver);
--
Regards,
Laurent Pinchart
Hi
Am 28.01.22 um 11:34 schrieb Laurent Pinchart:
> Hi Thomas,
>
> On Fri, Jan 28, 2022 at 10:33:21AM +0100, Thomas Zimmermann wrote:
>> Am 28.01.22 um 10:13 schrieb Kieran Bingham:
>>> Quoting Javier Martinez Canillas (2021-12-17 00:37:46)
>>>> 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 system framebuffer will be available if it was set-up.
>>>
>>> What is the 'system framebuffer' in this instance? Reading
>>> https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt
>>> it sounds like that means anything already set up by the bootloader.
>>
>> Exactly this.
>>
>>>> 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]>
>>>> ---
>>>>
>>>> (no changes since v1)
>>>>
>>>> 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 5a8131ef81d5..982e450233ed 100644
>>>> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
>>>> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
>>>> @@ -701,6 +701,9 @@ static struct platform_driver rcar_du_platform_driver = {
>>>>
>>>> static int __init rcar_du_init(void)
>>>> {
>>>> + if (drm_firmware_drivers_only())
>>>> + return -ENODEV;
>>>> +
>>>
>>> This will completely disable all control of the display device when
>>> nomodeset is enabled.
>>>
>>> Is there any requirement for us to support outputting to the display if
>>> it was previously set up? presumably without setting or changing any
>>> modes, but simply allowing the existing frame to be updated?
>>
>> There's no requirement for your driver. We just want a parameter where
>> we can conveniently disable most of DRM's drivers and reduce it to a
>> minimum. Helps distributions to provide a simple fallback mode. Most
>> PCI-based drivers already support that. Now we're added it to the other
>> drivers as well.
>>
>>>
>>> I think the implication is that 'firmware drivers' would mean a display
>>> could be updated through some firmware interface, which we won't have
>>> ... so it seems reasonable to accept that this whole driver can be
>>> disabled in that instance.
>>
>> It cannot be 'mode-setted'. We get a pre-configured framebuffer from the
>> firmware or bootloader. Whatever we draw there shows up on the screen.
>
> I doubt that's going to work as you expect, clocks and regulators will
> get disabled at boot if not used by any driver.
Simpledrm and simplefb attach to these firmware framebuffers. Both
drivers look at the device tree nodes to acquire the relevant clocks and
regulators.
Best regards
Thomas
>
>>> Reading your mail that brought this thread up in my inbox, I think
>>> you've already hit merge on this, so don't worry about adding a tag in
>>> that instance, but I think this is ok.
>>>
>>> Reviewed-by: Kieran Bingham <[email protected]>
>>>
>>>> rcar_du_of_init(rcar_du_of_table);
>>>>
>>>> return platform_driver_register(&rcar_du_platform_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
On 1/28/22 11:46, Thomas Zimmermann wrote:
> Am 28.01.22 um 11:34 schrieb Laurent Pinchart:
[snip]
>>>
>>> It cannot be 'mode-setted'. We get a pre-configured framebuffer from the
>>> firmware or bootloader. Whatever we draw there shows up on the screen.
>>
>> I doubt that's going to work as you expect, clocks and regulators will
>> get disabled at boot if not used by any driver.
>
> Simpledrm and simplefb attach to these firmware framebuffers. Both
> drivers look at the device tree nodes to acquire the relevant clocks and
> regulators.
>
Laurent is correct that in some cases it might be an issue. For example, if
a SystemReady ES image is booted using the U-boot EFI stub instead of bootz.
In this case the system will be presented as EFI and the firmware framebuffer
just taken from the EFI GOP. There won't be any Device Tree node describing
the clocks, regulators, etc that are required for the framebuffer to work.
The user then will have to pass clk_ignore_unused, pd_ignore_unused and maybe
other cmdline params (or even hack a DT to set regulator-always-on for needed
regulators).
But that is also true if the user wants to disable the real DRM driver with
modprobe.blacklist=rcar-du-drm.
What this patch does is just to make all DRM drivers consistent and honour the
nomodeset param (whose name is really misleading but we can't change that).
Best regards,
--
Javier Martinez Canillas
Linux Engineering
Red Hat
Hi
Am 28.01.22 um 12:04 schrieb Laurent Pinchart:
> Hi Thomas,
>
> On Fri, Jan 28, 2022 at 11:46:49AM +0100, Thomas Zimmermann wrote:
>> Am 28.01.22 um 11:34 schrieb Laurent Pinchart:
>>> On Fri, Jan 28, 2022 at 10:33:21AM +0100, Thomas Zimmermann wrote:
>>>> Am 28.01.22 um 10:13 schrieb Kieran Bingham:
>>>>> Quoting Javier Martinez Canillas (2021-12-17 00:37:46)
>>>>>> 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 system framebuffer will be available if it was set-up.
>>>>>
>>>>> What is the 'system framebuffer' in this instance? Reading
>>>>> https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt
>>>>> it sounds like that means anything already set up by the bootloader.
>>>>
>>>> Exactly this.
>>>>
>>>>>> 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]>
>>>>>> ---
>>>>>>
>>>>>> (no changes since v1)
>>>>>>
>>>>>> 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 5a8131ef81d5..982e450233ed 100644
>>>>>> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
>>>>>> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
>>>>>> @@ -701,6 +701,9 @@ static struct platform_driver rcar_du_platform_driver = {
>>>>>>
>>>>>> static int __init rcar_du_init(void)
>>>>>> {
>>>>>> + if (drm_firmware_drivers_only())
>>>>>> + return -ENODEV;
>>>>>> +
>>>>>
>>>>> This will completely disable all control of the display device when
>>>>> nomodeset is enabled.
>>>>>
>>>>> Is there any requirement for us to support outputting to the display if
>>>>> it was previously set up? presumably without setting or changing any
>>>>> modes, but simply allowing the existing frame to be updated?
>>>>
>>>> There's no requirement for your driver. We just want a parameter where
>>>> we can conveniently disable most of DRM's drivers and reduce it to a
>>>> minimum. Helps distributions to provide a simple fallback mode. Most
>>>> PCI-based drivers already support that. Now we're added it to the other
>>>> drivers as well.
>>>>
>>>>>
>>>>> I think the implication is that 'firmware drivers' would mean a display
>>>>> could be updated through some firmware interface, which we won't have
>>>>> ... so it seems reasonable to accept that this whole driver can be
>>>>> disabled in that instance.
>>>>
>>>> It cannot be 'mode-setted'. We get a pre-configured framebuffer from the
>>>> firmware or bootloader. Whatever we draw there shows up on the screen.
>>>
>>> I doubt that's going to work as you expect, clocks and regulators will
>>> get disabled at boot if not used by any driver.
>>
>> Simpledrm and simplefb attach to these firmware framebuffers. Both
>> drivers look at the device tree nodes to acquire the relevant clocks and
>> regulators.
>
> How about clocks and regulators for the ancillary devices, such as
> encoders, or in the R-Car case, the external composer handled by the
> vsp1 driver (in drivers/media/platform/vsp1) ?
>
> This approach may work fine on x86 desktop systems, but for ARM-based
> devices, the situation is usually more complex.
Well, in that case the problem has always been there. We don't make it
worse.
Best regards
Thomas
>
>>>>> Reading your mail that brought this thread up in my inbox, I think
>>>>> you've already hit merge on this, so don't worry about adding a tag in
>>>>> that instance, but I think this is ok.
>>>>>
>>>>> Reviewed-by: Kieran Bingham <[email protected]>
>>>>>
>>>>>> rcar_du_of_init(rcar_du_of_table);
>>>>>>
>>>>>> return platform_driver_register(&rcar_du_platform_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
Hi Thomas,
On Fri, Jan 28, 2022 at 12:26:03PM +0100, Thomas Zimmermann wrote:
> Am 28.01.22 um 12:04 schrieb Laurent Pinchart:
> > On Fri, Jan 28, 2022 at 11:46:49AM +0100, Thomas Zimmermann wrote:
> >> Am 28.01.22 um 11:34 schrieb Laurent Pinchart:
> >>> On Fri, Jan 28, 2022 at 10:33:21AM +0100, Thomas Zimmermann wrote:
> >>>> Am 28.01.22 um 10:13 schrieb Kieran Bingham:
> >>>>> Quoting Javier Martinez Canillas (2021-12-17 00:37:46)
> >>>>>> 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 system framebuffer will be available if it was set-up.
> >>>>>
> >>>>> What is the 'system framebuffer' in this instance? Reading
> >>>>> https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt
> >>>>> it sounds like that means anything already set up by the bootloader.
> >>>>
> >>>> Exactly this.
> >>>>
> >>>>>> 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]>
> >>>>>> ---
> >>>>>>
> >>>>>> (no changes since v1)
> >>>>>>
> >>>>>> 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 5a8131ef81d5..982e450233ed 100644
> >>>>>> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> >>>>>> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
> >>>>>> @@ -701,6 +701,9 @@ static struct platform_driver rcar_du_platform_driver = {
> >>>>>>
> >>>>>> static int __init rcar_du_init(void)
> >>>>>> {
> >>>>>> + if (drm_firmware_drivers_only())
> >>>>>> + return -ENODEV;
> >>>>>> +
> >>>>>
> >>>>> This will completely disable all control of the display device when
> >>>>> nomodeset is enabled.
> >>>>>
> >>>>> Is there any requirement for us to support outputting to the display if
> >>>>> it was previously set up? presumably without setting or changing any
> >>>>> modes, but simply allowing the existing frame to be updated?
> >>>>
> >>>> There's no requirement for your driver. We just want a parameter where
> >>>> we can conveniently disable most of DRM's drivers and reduce it to a
> >>>> minimum. Helps distributions to provide a simple fallback mode. Most
> >>>> PCI-based drivers already support that. Now we're added it to the other
> >>>> drivers as well.
> >>>>
> >>>>>
> >>>>> I think the implication is that 'firmware drivers' would mean a display
> >>>>> could be updated through some firmware interface, which we won't have
> >>>>> ... so it seems reasonable to accept that this whole driver can be
> >>>>> disabled in that instance.
> >>>>
> >>>> It cannot be 'mode-setted'. We get a pre-configured framebuffer from the
> >>>> firmware or bootloader. Whatever we draw there shows up on the screen.
> >>>
> >>> I doubt that's going to work as you expect, clocks and regulators will
> >>> get disabled at boot if not used by any driver.
> >>
> >> Simpledrm and simplefb attach to these firmware framebuffers. Both
> >> drivers look at the device tree nodes to acquire the relevant clocks and
> >> regulators.
> >
> > How about clocks and regulators for the ancillary devices, such as
> > encoders, or in the R-Car case, the external composer handled by the
> > vsp1 driver (in drivers/media/platform/vsp1) ?
> >
> > This approach may work fine on x86 desktop systems, but for ARM-based
> > devices, the situation is usually more complex.
>
> Well, in that case the problem has always been there. We don't make it
> worse.
What's the point of adding nomodeset support in those drivers then, if
it's known not to work ?
> >>>>> Reading your mail that brought this thread up in my inbox, I think
> >>>>> you've already hit merge on this, so don't worry about adding a tag in
> >>>>> that instance, but I think this is ok.
> >>>>>
> >>>>> Reviewed-by: Kieran Bingham <[email protected]>
> >>>>>
> >>>>>> rcar_du_of_init(rcar_du_of_table);
> >>>>>>
> >>>>>> return platform_driver_register(&rcar_du_platform_driver);
--
Regards,
Laurent Pinchart
Hi
Am 28.01.22 um 12:36 schrieb Laurent Pinchart:
> Hi Thomas,
>
> On Fri, Jan 28, 2022 at 12:26:03PM +0100, Thomas Zimmermann wrote:
>> Am 28.01.22 um 12:04 schrieb Laurent Pinchart:
>>> On Fri, Jan 28, 2022 at 11:46:49AM +0100, Thomas Zimmermann wrote:
>>>> Am 28.01.22 um 11:34 schrieb Laurent Pinchart:
>>>>> On Fri, Jan 28, 2022 at 10:33:21AM +0100, Thomas Zimmermann wrote:
>>>>>> Am 28.01.22 um 10:13 schrieb Kieran Bingham:
>>>>>>> Quoting Javier Martinez Canillas (2021-12-17 00:37:46)
>>>>>>>> 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 system framebuffer will be available if it was set-up.
>>>>>>>
>>>>>>> What is the 'system framebuffer' in this instance? Reading
>>>>>>> https://www.kernel.org/doc/Documentation/admin-guide/kernel-parameters.txt
>>>>>>> it sounds like that means anything already set up by the bootloader.
>>>>>>
>>>>>> Exactly this.
>>>>>>
>>>>>>>> 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]>
>>>>>>>> ---
>>>>>>>>
>>>>>>>> (no changes since v1)
>>>>>>>>
>>>>>>>> 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 5a8131ef81d5..982e450233ed 100644
>>>>>>>> --- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
>>>>>>>> +++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
>>>>>>>> @@ -701,6 +701,9 @@ static struct platform_driver rcar_du_platform_driver = {
>>>>>>>>
>>>>>>>> static int __init rcar_du_init(void)
>>>>>>>> {
>>>>>>>> + if (drm_firmware_drivers_only())
>>>>>>>> + return -ENODEV;
>>>>>>>> +
>>>>>>>
>>>>>>> This will completely disable all control of the display device when
>>>>>>> nomodeset is enabled.
>>>>>>>
>>>>>>> Is there any requirement for us to support outputting to the display if
>>>>>>> it was previously set up? presumably without setting or changing any
>>>>>>> modes, but simply allowing the existing frame to be updated?
>>>>>>
>>>>>> There's no requirement for your driver. We just want a parameter where
>>>>>> we can conveniently disable most of DRM's drivers and reduce it to a
>>>>>> minimum. Helps distributions to provide a simple fallback mode. Most
>>>>>> PCI-based drivers already support that. Now we're added it to the other
>>>>>> drivers as well.
>>>>>>
>>>>>>>
>>>>>>> I think the implication is that 'firmware drivers' would mean a display
>>>>>>> could be updated through some firmware interface, which we won't have
>>>>>>> ... so it seems reasonable to accept that this whole driver can be
>>>>>>> disabled in that instance.
>>>>>>
>>>>>> It cannot be 'mode-setted'. We get a pre-configured framebuffer from the
>>>>>> firmware or bootloader. Whatever we draw there shows up on the screen.
>>>>>
>>>>> I doubt that's going to work as you expect, clocks and regulators will
>>>>> get disabled at boot if not used by any driver.
>>>>
>>>> Simpledrm and simplefb attach to these firmware framebuffers. Both
>>>> drivers look at the device tree nodes to acquire the relevant clocks and
>>>> regulators.
>>>
>>> How about clocks and regulators for the ancillary devices, such as
>>> encoders, or in the R-Car case, the external composer handled by the
>>> vsp1 driver (in drivers/media/platform/vsp1) ?
>>>
>>> This approach may work fine on x86 desktop systems, but for ARM-based
>>> devices, the situation is usually more complex.
>>
>> Well, in that case the problem has always been there. We don't make it
>> worse.
>
> What's the point of adding nomodeset support in those drivers then, if
> it's known not to work ?
But nomodeset is know to work: it disables the driver. The behavior is
consistent among all hardware-specific drivers.
Javier mentioned that there are kernel parameters to keep unused
clocks/regulators working.
From the distribution POV, if we have users with broken graphics
drivers we want to give them an easy workaround until we find a
solution. Passing 'nomodeset ...' on the command line gives us that.
Best regards
Thomas
>
>>>>>>> Reading your mail that brought this thread up in my inbox, I think
>>>>>>> you've already hit merge on this, so don't worry about adding a tag in
>>>>>>> that instance, but I think this is ok.
>>>>>>>
>>>>>>> Reviewed-by: Kieran Bingham <[email protected]>
>>>>>>>
>>>>>>>> rcar_du_of_init(rcar_du_of_table);
>>>>>>>>
>>>>>>>> return platform_driver_register(&rcar_du_platform_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