drm/client: Test for connectors before sending hotplug event
Test for connectors in the client code and remove a similar test from the generic fbdev emulation. Do nothing if the test fails. Not having connectors indicates a driver bug. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230125200415.14123-2-tzimmermann@suse.de
This commit is contained in:
parent
da2b1a0a40
commit
c2bb3be64e
|
@ -198,6 +198,11 @@ void drm_client_dev_hotplug(struct drm_device *dev)
|
||||||
if (!drm_core_check_feature(dev, DRIVER_MODESET))
|
if (!drm_core_check_feature(dev, DRIVER_MODESET))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!dev->mode_config.num_connector) {
|
||||||
|
drm_dbg_kms(dev, "No connectors found, will not send hotplug events!\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mutex_lock(&dev->clientlist_mutex);
|
mutex_lock(&dev->clientlist_mutex);
|
||||||
list_for_each_entry(client, &dev->clientlist, list) {
|
list_for_each_entry(client, &dev->clientlist, list) {
|
||||||
if (!client->funcs || !client->funcs->hotplug)
|
if (!client->funcs || !client->funcs->hotplug)
|
||||||
|
|
|
@ -389,11 +389,6 @@ static int drm_fbdev_client_hotplug(struct drm_client_dev *client)
|
||||||
if (dev->fb_helper)
|
if (dev->fb_helper)
|
||||||
return drm_fb_helper_hotplug_event(dev->fb_helper);
|
return drm_fb_helper_hotplug_event(dev->fb_helper);
|
||||||
|
|
||||||
if (!dev->mode_config.num_connector) {
|
|
||||||
drm_dbg_kms(dev, "No connectors found, will not create framebuffer!\n");
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
drm_fb_helper_prepare(dev, fb_helper, &drm_fb_helper_generic_funcs);
|
drm_fb_helper_prepare(dev, fb_helper, &drm_fb_helper_generic_funcs);
|
||||||
|
|
||||||
ret = drm_fb_helper_init(dev, fb_helper);
|
ret = drm_fb_helper_init(dev, fb_helper);
|
||||||
|
|
Loading…
Reference in New Issue