drm/tegra: vic: Export module device table
PATCH 1/1 drm/tegra: vic: Export module device table
From: Thierry Reding <[email protected]>
Export the module device table to ensure the VIC compatible strings are listed in the module's aliases table. This in turn causes the driver to be automatically loaded on boot if VIC is the only enabled subdevice of the logical host1x DRM device.
--- drivers/gpu/drm/tegra/vic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/tegra/vic.c +3 -2
@@ -386,13 +386,14 @@ static const struct vic_config vic_t194_config = { .supports_sid = true, }; -static const struct of_device_id vic_match[] = { +static const struct of_device_id tegra_vic_of_match[] = { { .compatible ="nvidia,tegra124-vic" , .data = &vic_t124_config }, { .compatible ="nvidia,tegra210-vic" , .data = &vic_t210_config }, { .compatible ="nvidia,tegra186-vic" , .data = &vic_t186_config }, { .compatible ="nvidia,tegra194-vic" , .data = &vic_t194_config }, { }, }; +MODULE_DEVICE_TABLE (of, tegra_vic_of_match);static int vic_probe (struct platform_device *pdev) {
@@ -516,7 +517,7 @@ static const struct dev_pm_ops vic_pm_ops = {struct platform_driver tegra_vic_driver = { .driver = { .name ="tegra-vic" , - .of_match_table = vic_match, + .of_match_table = tegra_vic_of_match, .pm = &vic_pm_ops }, .probe = vic_probe,
Signature · 6 lines
2.23.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 8 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Export the module device table to ensure the VIC compatible strings are listed in the module's aliases table. This in turn causes the driver to be automatically loaded on boot if VIC is the only enabled subdevice of the logical host1x DRM device.
Signed-off-by Thierry Reding <[email protected]>
I noticed that the drm subdev driver also lacks the matches. How does that work? Just by getting loaded when any of the subdev drivers match? -Daniel
Quoted 40 lines
--- drivers/gpu/drm/tegra/vic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/tegra/vic.c +3
-2@@ -386,13 +386,14 @@ static const struct vic_config vic_t194_config = { .supports_sid = true, }; -static const struct of_device_id vic_match[] = { +static const struct of_device_id tegra_vic_of_match[] = { { .compatible ="nvidia,tegra124-vic" , .data = &vic_t124_config }, { .compatible ="nvidia,tegra210-vic" , .data = &vic_t210_config }, { .compatible ="nvidia,tegra186-vic" , .data = &vic_t186_config }, { .compatible ="nvidia,tegra194-vic" , .data = &vic_t194_config }, { }, }; +MODULE_DEVICE_TABLE (of, tegra_vic_of_match);static int vic_probe (struct platform_device *pdev) {@@ -516,7 +517,7 @@ static const struct dev_pm_ops vic_pm_ops = {struct platform_driver tegra_vic_driver = { .driver = { .name ="tegra-vic" , - .of_match_table = vic_match, + .of_match_table = tegra_vic_of_match, .pm = &vic_pm_ops }, .probe = vic_probe,Signature · 6 lines
2.23.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 8 lines · Daniel Vetter
Quoted 7 lines · Thierry Reding
From: Thierry Reding <[email protected]>
Export the module device table to ensure the VIC compatible strings are listed in the module's aliases table. This in turn causes the driver to be automatically loaded on boot if VIC is the only enabled subdevice of the logical host1x DRM device.
Quoted 6 lines
Quoted 1 line
Signed-off-by Thierry Reding <[email protected]>Reviewed-by Daniel Vetter <[email protected]>I noticed that the drm subdev driver also lacks the matches. How does that work? Just by getting loaded when any of the subdev drivers match?
Yeah, basically the host1x DRM driver registration causes a logical device to be created. The driver will then finally bind to the device after all the subdevices have been registered. Since all the subdevice drivers are linked into a single module, all the module device tables end up in that kernel module and that's enough to trigger the whole process.
I ran into this issue when I was trying to run the Tegra DRM driver in a "headless" configuration where all the display-related devices were disabled via DT. Without exporting the VIC module device table, there were no entries in the module's aliases list that would match the set of devices registered to the system and the driver wouldn't load.
Thierry
Quoted 38 lines
-Daniel
Quoted 36 lines
--- drivers/gpu/drm/tegra/vic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/tegra/vic.c +3
-2@@ -386,13 +386,14 @@ static const struct vic_config vic_t194_config = { .supports_sid = true, }; -static const struct of_device_id vic_match[] = { +static const struct of_device_id tegra_vic_of_match[] = { { .compatible ="nvidia,tegra124-vic" , .data = &vic_t124_config }, { .compatible ="nvidia,tegra210-vic" , .data = &vic_t210_config }, { .compatible ="nvidia,tegra186-vic" , .data = &vic_t186_config }, { .compatible ="nvidia,tegra194-vic" , .data = &vic_t194_config }, { }, }; +MODULE_DEVICE_TABLE (of, tegra_vic_of_match);static int vic_probe (struct platform_device *pdev) {@@ -516,7 +517,7 @@ static const struct dev_pm_ops vic_pm_ops = {struct platform_driver tegra_vic_driver = { .driver = { .name ="tegra-vic" , - .of_match_table = vic_match, + .of_match_table = tegra_vic_of_match, .pm = &vic_pm_ops }, .probe = vic_probe,Signature · 1 line
2.23.0
Quoted 9 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel