Skip to contentSkip to conversation

drm: Enable module autoloading

PATCH Applied Liao Chen 5 participants 9 messages Sep 2, 2024 – Oct 21, 2024

Subsystems (6)
lore
Share & tools
lore

Liao Chen

author
#0 lore raw

cover drm: Enable module autoloading

This patch enables the autoloading feature of drm module. By registering MDT, the kernel is allowed to automatically bind modules to devices that match the specified compatible strings.

Liao Chen (3):
drm/bridge: it6505: Enable module autoloading
drm/tegra: Enable module autoloading
drm/mcde: Enable module autoloading

 drivers/gpu/drm/bridge/ite-it6505.c | 1 +
 drivers/gpu/drm/mcde/mcde_drv.c     | 1 +
 drivers/gpu/drm/tegra/drm.c         | 1 +
 3 files changed, 3 insertions(+)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH 1/3 drm/bridge: it6505: Enable module autoloading

Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table.

---
 drivers/gpu/drm/bridge/ite-it6505.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/bridge/ite-it6505.c +1 -0
index 1e1c06fdf206..eef5ad449c16 100644
@@ -3498,6 +3498,7 @@ static const struct of_device_id it6505_of_match[] = {
 	{ .compatible = "ite,it6505" },
 	{ }
 };
+MODULE_DEVICE_TABLE(of, it6505_of_match);
 
 static struct i2c_driver it6505_i2c_driver = {
 	.driver = {
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH -next 1/3] drm/bridge: it6505: Enable module autoloading

Quoted 13 lines · Liao Chen

Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table.

---
  drivers/gpu/drm/bridge/ite-it6505.c | 1 +
  1 file changed, 1 insertion(+)
drivers/gpu/drm/bridge/ite-it6505.c +0 -0
index 1e1c06fdf206..eef5ad449c16 100644

drivers/gpu/drm/bridge/ite-it6505.c static const struct of_device_id it6505_of_match[] = { · line 3504

Quoted 7 lines
drivers/gpu/drm/bridge/ite-it6505.c +1 -0
@@ -3498,6 +3498,7 @@ static const struct of_device_id it6505_of_match[] = {
  	{ .compatible = "ite,it6505" },
  	{ }
  };
+MODULE_DEVICE_TABLE(of, it6505_of_match);
 
  static struct i2c_driver it6505_i2c_driver = {
  	.driver = {
author
#3 lore raw

PATCH 2/3 drm/tegra: Enable module autoloading

In reply to Liao Chen

Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table.

---
 drivers/gpu/drm/tegra/drm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/tegra/drm.c +1 -0
index 03d1c76aec2d..1a12f2eaad86 100644
@@ -1390,6 +1390,7 @@ static const struct of_device_id host1x_drm_subdevs[] = {
 	{ .compatible = "nvidia,tegra234-nvdec", },
 	{ /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, host1x_drm_subdevs);
 
 static struct host1x_driver host1x_drm_driver = {
 	.driver = {
Signature · 1 line
2.34.1
#4 lore raw

Re: [PATCH -next 2/3] drm/tegra: Enable module autoloading

Quoted 13 lines · Liao Chen

Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table.

---
 drivers/gpu/drm/tegra/drm.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/tegra/drm.c +0 -0
index 03d1c76aec2d..1a12f2eaad86 100644

drivers/gpu/drm/tegra/drm.c static const struct of_device_id host1x_drm_subdevs[] = { · line 1393

Quoted 4 lines
drivers/gpu/drm/tegra/drm.c +1 -0
@@ -1390,6 +1390,7 @@ static const struct of_device_id host1x_drm_subdevs[] = {
 	{ .compatible = "nvidia,tegra234-nvdec", },
 	{ /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, host1x_drm_subdevs);

I don't think it is correct. See how subdevs are handled in host1x_device_parse_dt(). I'll pick up two other patches though.

Quoted 6 lines
drivers/gpu/drm/tegra/drm.c +0 -0
 static struct host1x_driver host1x_drm_driver = {
 	.driver = {
Signature · 1 line
2.34.1
Signature · 2 lines
With best wishes
Dmitry
#5 lore raw

Re: [PATCH -next 2/3] drm/tegra: Enable module autoloading

Quoted 9 lines · Dmitry Baryshkov
Quoted 8 lines · Liao Chen

Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table.

---
 drivers/gpu/drm/tegra/drm.c | 1 +
 1 file changed, 1 insertion(+)
Quoted 12 lines

drivers/gpu/drm/tegra/drm.c static const struct of_device_id host1x_drm_subdevs[] = { · line 1393

Quoted 9 lines
drivers/gpu/drm/tegra/drm.c +1 -0
index 03d1c76aec2d..1a12f2eaad86 100644
@@ -1390,6 +1390,7 @@ static const struct of_device_id host1x_drm_subdevs[] = {
 	{ .compatible = "nvidia,tegra234-nvdec", },
 	{ /* sentinel */ }
 };
+MODULE_DEVICE_TABLE(of, host1x_drm_subdevs);

I don't think it is correct. See how subdevs are handled in host1x_device_parse_dt(). I'll pick up two other patches though.

Agreed. This shouldn't be needed since all of these compatible strings should show up in the OF device ID table of their corresponding drivers, which is where the export should happen.

Thierry

author
#6 lore raw

PATCH 3/3 drm/mcde: Enable module autoloading

In reply to Liao Chen

Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table.

---
 drivers/gpu/drm/mcde/mcde_drv.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/mcde/mcde_drv.c +1 -0
index 10c06440c7e7..f1bb38f4e673 100644
@@ -473,6 +473,7 @@ static const struct of_device_id mcde_of_match[] = {
 	},
 	{},
 };
+MODULE_DEVICE_TABLE(of, mcde_of_match);
 
 static struct platform_driver mcde_driver = {
 	.driver = {
Signature · 1 line
2.34.1
maintainer Applied
#8 lore raw

Re: (subset) [PATCH -next 0/3] drm: Enable module autoloading

In reply to Liao Chen

Hi,

Quoted 11 lines · Liao Chen

This patch enables the autoloading feature of drm module. By registering MDT, the kernel is allowed to automatically bind modules to devices that match the specified compatible strings.

Liao Chen (3):
drm/bridge: it6505: Enable module autoloading
drm/tegra: Enable module autoloading
drm/mcde: Enable module autoloading

[...]

Thanks, Applied to https://gitlab.freedesktop.org/drm/misc/kernel.git (drm-misc-next)

[1/3] drm/bridge: it6505: Enable module autoloading

      https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/d9c12481f980bdad9cf6fdb742e49c5b50622795
Signature · 1 line
Neil