From: Thomas Zimmermann Date: Wed, 25 Jan 2023 20:04:07 +0000 (+0100) Subject: drm/client: Add hotplug_failed flag X-Git-Tag: v6.6.17~3937^2~23^2~837 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6a9d5ad3af65a1e7af97f25bbf83ce97bcfbab72;p=platform%2Fkernel%2Flinux-rpi.git drm/client: Add hotplug_failed flag Signal failed hotplugging with a flag in struct drm_client_dev. If set, the client helpers will not further try to set up the fbdev display. This used to be signalled with a combination of cleared pointers in struct drm_fb_helper, which prevents us from initializing these pointers early after allocation. The change also harmonizes behavior among DRM clients. Additional DRM clients will now handle failed hotplugging like fbdev does. Signed-off-by: Thomas Zimmermann Reviewed-by: Javier Martinez Canillas Link: https://patchwork.freedesktop.org/patch/msgid/20230125200415.14123-3-tzimmermann@suse.de --- diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c index 09ac191..009e7b1 100644 --- a/drivers/gpu/drm/drm_client.c +++ b/drivers/gpu/drm/drm_client.c @@ -208,8 +208,13 @@ void drm_client_dev_hotplug(struct drm_device *dev) if (!client->funcs || !client->funcs->hotplug) continue; + if (client->hotplug_failed) + continue; + ret = client->funcs->hotplug(client); drm_dbg_kms(dev, "%s: ret=%d\n", client->name, ret); + if (ret) + client->hotplug_failed = true; } mutex_unlock(&dev->clientlist_mutex); } diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c index 3d455a2..135d58b 100644 --- a/drivers/gpu/drm/drm_fbdev_generic.c +++ b/drivers/gpu/drm/drm_fbdev_generic.c @@ -382,10 +382,6 @@ static int drm_fbdev_client_hotplug(struct drm_client_dev *client) struct drm_device *dev = client->dev; int ret; - /* Setup is not retried if it has failed */ - if (!fb_helper->dev && fb_helper->funcs) - return 0; - if (dev->fb_helper) return drm_fb_helper_hotplug_event(dev->fb_helper); diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h index 4fc8018..3948252 100644 --- a/include/drm/drm_client.h +++ b/include/drm/drm_client.h @@ -106,6 +106,14 @@ struct drm_client_dev { * @modesets: CRTC configurations */ struct drm_mode_set *modesets; + + /** + * @hotplug failed: + * + * Set by client hotplug helpers if the hotplugging failed + * before. It is usually not tried again. + */ + bool hotplug_failed; }; int drm_client_init(struct drm_device *dev, struct drm_client_dev *client,