From: Thomas Zimmermann <tzimmermann@suse.de>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: freedreno@lists.freedesktop.org,
linux-samsung-soc@vger.kernel.org, amd-gfx@lists.freedesktop.org,
linux-arm-msm@vger.kernel.org, intel-gfx@lists.freedesktop.org,
javierm@redhat.com, mripard@kernel.org,
dri-devel@lists.freedesktop.org, daniel@ffwll.ch,
linux-tegra@vger.kernel.org, airlied@gmail.com,
linux-arm-kernel@lists.infradead.org
Subject: Re: [Intel-gfx] [PATCH v3 02/10] drm/client: Add hotplug_failed flag
Date: Fri, 27 Jan 2023 15:17:01 +0100 [thread overview]
Message-ID: <c40df153-df30-436e-5bc6-5d039a351ffa@suse.de> (raw)
In-Reply-To: <Y9GXxcwSnuftoUQh@ravnborg.org>
[-- Attachment #1.1: Type: text/plain, Size: 3388 bytes --]
Hi
Am 25.01.23 um 21:57 schrieb Sam Ravnborg:
> Hi Thomas,
>
> On Wed, Jan 25, 2023 at 09:04:07PM +0100, Thomas Zimmermann wrote:
>> 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,
> I failed to find where we clear the pointers. What do I miss?
Those pointer fields, dev and funcs, where allocated with kzalloc(). The
error path in drm_fbdev_client_hotplug() later reset them to NULL again
if an error occured.
Best regards
Thomas
> (I had assumed we would stop clearing the pointers after this change).
>
> Sam
>
> 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 <tzimmermann@suse.de>
>> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
>> ---
>> drivers/gpu/drm/drm_client.c | 5 +++++
>> drivers/gpu/drm/drm_fbdev_generic.c | 4 ----
>> include/drm/drm_client.h | 8 ++++++++
>> 3 files changed, 13 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c
>> index 09ac191c202d..009e7b10455c 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 3d455a2e3fb5..135d58b8007b 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 4fc8018eddda..39482527a775 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,
>> --
>> 2.39.0
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
next prev parent reply other threads:[~2023-01-27 14:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-25 20:04 [Intel-gfx] [PATCH v3 00/10] drm/fb-helper: Various cleanups Thomas Zimmermann
2023-01-25 20:04 ` [Intel-gfx] [PATCH v3 01/10] drm/client: Test for connectors before sending hotplug event Thomas Zimmermann
2023-01-25 20:52 ` Sam Ravnborg
2023-01-27 14:13 ` Thomas Zimmermann
2023-01-27 17:33 ` Sam Ravnborg
2023-01-27 18:02 ` Simon Ser
2023-01-30 8:40 ` Thomas Zimmermann
2023-01-25 20:04 ` [Intel-gfx] [PATCH v3 02/10] drm/client: Add hotplug_failed flag Thomas Zimmermann
2023-01-25 20:57 ` Sam Ravnborg
2023-01-27 14:17 ` Thomas Zimmermann [this message]
2023-01-25 20:04 ` [Intel-gfx] [PATCH v3 03/10] drm/fb-helper: Introduce drm_fb_helper_unprepare() Thomas Zimmermann
2023-01-25 20:04 ` [Intel-gfx] [PATCH v3 04/10] drm/fbdev-generic: Initialize fb-helper structure in generic setup Thomas Zimmermann
2023-01-25 21:03 ` Sam Ravnborg
2023-01-27 14:21 ` Thomas Zimmermann
2023-01-27 17:35 ` Sam Ravnborg
2023-01-25 20:04 ` [Intel-gfx] [PATCH v3 05/10] drm/fb-helper: Remove preferred_bpp parameter from fbdev internals Thomas Zimmermann
2023-01-25 20:04 ` [Intel-gfx] [PATCH v3 06/10] drm/fb-helper: Initialize fb-helper's preferred BPP in prepare function Thomas Zimmermann
2023-01-25 20:04 ` [Intel-gfx] [PATCH v3 07/10] drm/fbdev-generic: Minimize hotplug error handling Thomas Zimmermann
2023-01-25 20:04 ` [Intel-gfx] [PATCH v3 08/10] drm/fbdev-generic: Minimize client unregistering Thomas Zimmermann
2023-01-25 20:04 ` [Intel-gfx] [PATCH v3 09/10] drm/fbdev-generic: Inline clean-up helpers into drm_fbdev_fb_destroy() Thomas Zimmermann
2023-01-25 20:04 ` [Intel-gfx] [PATCH v3 10/10] drm/fbdev-generic: Rename struct fb_info 'fbi' to 'info' Thomas Zimmermann
2023-01-26 2:22 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for drm/fb-helper: Various cleanups (rev3) Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c40df153-df30-436e-5bc6-5d039a351ffa@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=sam@ravnborg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox