On Tue, Aug 27, 2013 at 01:26:32PM +0200, Daniel Vetter wrote: > On Tue, Aug 27, 2013 at 1:22 PM, Rob Clark <robdclark@xxxxxxxxx> wrote: > >> right, but the cores on the SoC, and even any external encoder chips, > >> are not actually hot-pluggable. I have a similar scenario w/ msm drm, > > > > oh, and come to think of it, same approach it tilcdc. And I'm sure > > there are other drivers with the same scenario. > > i915 and nouveau also support encoder slaves, and they also have them > all built-in. And I think requesting the module at driver init time > (where I mean any point in time between when the master module loads > and userspace first starts using it) seems fraught with with deadlock > issues if we have to wait for it. > > So imo in the current drm state there is no way you can built slave > drivers as modules. It's simply broken. I agree that it'd be nice to > have a better solution, but atm I don't even have an idea what it is. > But applying duct-tape in ->firstopen is certainly not the right way. The imx-drm does not request modules itself. It also does not do hotplug. It also does not change the drm device structure while being opened. The drm device structure is only ever changed when the device is closed. Once it's opened it's completely static and will not be changed. All this 'core' stuff in the drm driver is only done to be able to separate the different encoders into linux platform_devices, module support is only a side effect of this. What the imx-drm driver does is: - collect subcomponents via imx_drm_add_connector, imx_drm_add_crtc and imx_drm_add_encoder - During drm device open time the try_module_get will make sure the modules providing encoders/crtcs do not get unloaded. once the device is opened imx_drm_add_* will return -EBUSY. - When the drm device is closed module_put is called and components are allowed to be registered/unregistered again. Indeed hotplug support for components would be nice, but as said this is not supported by drm and by the imx-drm driver. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel