From: Thomas Zimmermann <tzimmermann@suse.de>
To: airlied@gmail.com, daniel@ffwll.ch,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
javierm@redhat.com
Cc: dri-devel@lists.freedesktop.org,
linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org,
intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
freedreno@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
linux-tegra@vger.kernel.org,
Thomas Zimmermann <tzimmermann@suse.de>
Subject: [PATCH v2 08/10] drm/fbdev-generic: Minimize client unregistering
Date: Tue, 24 Jan 2023 14:40:08 +0100 [thread overview]
Message-ID: <20230124134010.30263-9-tzimmermann@suse.de> (raw)
In-Reply-To: <20230124134010.30263-1-tzimmermann@suse.de>
For uninitialized framebuffers, only release the DRM client and
free the fbdev memory. Do not attempt to clean up the framebuffer.
DRM fbdev clients have a two-step initialization: first create
the DRM client; then create the framebuffer device on the first
successful hotplug event. In cases where the client never creates
the framebuffer, only the client state needs to be released. We
can detect which case it is, full or client-only cleanup, be
looking at the presence of fb_helper's info field.
v2:
* remove test for (fbi != NULL) in drm_fbdev_cleanup() (Sam)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
drivers/gpu/drm/drm_fbdev_generic.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/drm_fbdev_generic.c b/drivers/gpu/drm/drm_fbdev_generic.c
index dd8be5e0f271..9fe37903e3eb 100644
--- a/drivers/gpu/drm/drm_fbdev_generic.c
+++ b/drivers/gpu/drm/drm_fbdev_generic.c
@@ -51,12 +51,10 @@ static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper)
if (!fb_helper->dev)
return;
- if (fbi) {
- if (fbi->fbdefio)
- fb_deferred_io_cleanup(fbi);
- if (drm_fbdev_use_shadow_fb(fb_helper))
- shadow = fbi->screen_buffer;
- }
+ if (fbi->fbdefio)
+ fb_deferred_io_cleanup(fbi);
+ if (drm_fbdev_use_shadow_fb(fb_helper))
+ shadow = fbi->screen_buffer;
drm_fb_helper_fini(fb_helper);
@@ -362,11 +360,13 @@ static void drm_fbdev_client_unregister(struct drm_client_dev *client)
{
struct drm_fb_helper *fb_helper = drm_fb_helper_from_client(client);
- if (fb_helper->info)
- /* drm_fbdev_fb_destroy() takes care of cleanup */
+ if (fb_helper->info) {
drm_fb_helper_unregister_info(fb_helper);
- else
- drm_fbdev_release(fb_helper);
+ } else {
+ drm_fb_helper_unprepare(fb_helper);
+ drm_client_release(&fb_helper->client);
+ kfree(fb_helper);
+ }
}
static int drm_fbdev_client_restore(struct drm_client_dev *client)
--
2.39.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-01-24 13:41 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-24 13:40 [PATCH v2 00/10] drm/fb-helper: Various cleanups Thomas Zimmermann
2023-01-24 13:40 ` [PATCH v2 01/10] drm/client: Test for connectors before sending hotplug event Thomas Zimmermann
2023-01-25 8:30 ` Javier Martinez Canillas
2023-01-25 14:04 ` Thomas Zimmermann
2023-01-24 13:40 ` [PATCH v2 02/10] drm/client: Add hotplug_failed flag Thomas Zimmermann
2023-01-25 9:05 ` Javier Martinez Canillas
2023-01-24 13:40 ` [PATCH v2 03/10] drm/fb-helper: Introduce drm_fb_helper_unprepare() Thomas Zimmermann
2023-01-25 9:18 ` Javier Martinez Canillas
2023-01-25 14:11 ` Thomas Zimmermann
2023-01-24 13:40 ` [PATCH v2 04/10] drm/fbdev-generic: Initialize fb-helper structure in generic setup Thomas Zimmermann
2023-01-25 9:25 ` Javier Martinez Canillas
2023-01-24 13:40 ` [PATCH v2 05/10] drm/fb-helper: Remove preferred_bpp parameter from fbdev internals Thomas Zimmermann
2023-01-25 9:31 ` Javier Martinez Canillas
2023-01-24 13:40 ` [PATCH v2 06/10] drm/fb-helper: Initialize fb-helper's preferred BPP in prepare function Thomas Zimmermann
2023-01-25 4:51 ` [Intel-gfx] " kernel test robot
2023-01-25 9:41 ` Javier Martinez Canillas
2023-01-25 12:12 ` [Intel-gfx] " kernel test robot
2023-01-24 13:40 ` [PATCH v2 07/10] drm/fbdev-generic: Minimize hotplug error handling Thomas Zimmermann
2023-01-25 9:44 ` Javier Martinez Canillas
2023-01-24 13:40 ` Thomas Zimmermann [this message]
2023-01-25 9:50 ` [PATCH v2 08/10] drm/fbdev-generic: Minimize client unregistering Javier Martinez Canillas
2023-01-24 13:40 ` [PATCH v2 09/10] drm/fbdev-generic: Inline clean-up helpers into drm_fbdev_fb_destroy() Thomas Zimmermann
2023-01-25 9:52 ` Javier Martinez Canillas
2023-01-24 13:40 ` [PATCH v2 10/10] drm/fbdev-generic: Rename struct fb_info 'fbi' to 'info' Thomas Zimmermann
2023-01-25 9:54 ` Javier Martinez Canillas
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=20230124134010.30263-9-tzimmermann@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=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.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;
as well as URLs for NNTP newsgroup(s).