From: Jocelyn Falempe <jfalempe@redhat.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
John Ogness <john.ogness@linutronix.de>,
Javier Martinez Canillas <javierm@redhat.com>,
"Guilherme G . Piccoli" <gpiccoli@igalia.com>,
bluescreen_avenger@verizon.net,
Caleb Connolly <caleb.connolly@linaro.org>,
Petr Mladek <pmladek@suse.com>,
dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Cc: Jocelyn Falempe <jfalempe@redhat.com>
Subject: [PATCH v7 6/7] drm/log: Implement suspend/resume
Date: Fri, 8 Nov 2024 09:10:24 +0100 [thread overview]
Message-ID: <20241108082025.1004653-7-jfalempe@redhat.com> (raw)
In-Reply-To: <20241108082025.1004653-1-jfalempe@redhat.com>
Normally the console is already suspended when the graphic driver
suspend callback is called, but if the parameter no_console_suspend
is set, it might still be active.
So call console_stop()/console_start() in the suspend/resume
callbacks, to make sure it won't try to write to the framebuffer
while the graphic driver is suspended.
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Reviewed-by: John Ogness <john.ogness@linutronix.de>
Acked-by: Petr Mladek <pmladek@suse.com>
---
v6:
* Use console_stop() and console_start() in the suspend/resume callback (Petr Mladek).
drivers/gpu/drm/drm_log.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/drivers/gpu/drm/drm_log.c b/drivers/gpu/drm/drm_log.c
index 635dff7b37ce5..e6900c6b96436 100644
--- a/drivers/gpu/drm/drm_log.c
+++ b/drivers/gpu/drm/drm_log.c
@@ -310,10 +310,30 @@ static int drm_log_client_hotplug(struct drm_client_dev *client)
return 0;
}
+static int drm_log_client_suspend(struct drm_client_dev *client, bool _console_lock)
+{
+ struct drm_log *dlog = client_to_drm_log(client);
+
+ console_stop(&dlog->con);
+
+ return 0;
+}
+
+static int drm_log_client_resume(struct drm_client_dev *client, bool _console_lock)
+{
+ struct drm_log *dlog = client_to_drm_log(client);
+
+ console_start(&dlog->con);
+
+ return 0;
+}
+
static const struct drm_client_funcs drm_log_client_funcs = {
.owner = THIS_MODULE,
.unregister = drm_log_client_unregister,
.hotplug = drm_log_client_hotplug,
+ .suspend = drm_log_client_suspend,
+ .resume = drm_log_client_resume,
};
static void drm_log_write_thread(struct console *con, struct nbcon_write_context *wctxt)
--
2.47.0
next prev parent reply other threads:[~2024-11-08 8:21 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 8:10 [PATCH v7 0/7] drm/log: Introduce a new boot logger to draw the kmsg on the screen Jocelyn Falempe
2024-11-08 8:10 ` [PATCH v7 1/7] drm/panic: Move drawing functions to drm_draw Jocelyn Falempe
2024-11-11 13:03 ` Thomas Zimmermann
2024-11-08 8:10 ` [PATCH v7 2/7] drm/client: Always select DRM_CLIENT_LIB Jocelyn Falempe
2024-11-08 11:56 ` kernel test robot
2024-11-08 8:10 ` [PATCH v7 3/7] drm/log: Introduce a new boot logger to draw the kmsg on the screen Jocelyn Falempe
2024-11-08 12:27 ` kernel test robot
2024-11-08 13:08 ` kernel test robot
2024-11-08 8:10 ` [PATCH v7 4/7] drm/log: Do not draw if drm_master is taken Jocelyn Falempe
2024-11-08 13:33 ` Thomas Zimmermann
2024-11-08 13:51 ` Jocelyn Falempe
2024-11-08 8:10 ` [PATCH v7 5/7] drm/log: Color the timestamp, to improve readability Jocelyn Falempe
2024-11-08 8:10 ` Jocelyn Falempe [this message]
2024-11-08 8:10 ` [PATCH v7 7/7] drm/log: Add integer scaling support Jocelyn Falempe
2024-11-11 13:06 ` Thomas Zimmermann
2024-11-12 9:51 ` Jocelyn Falempe
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=20241108082025.1004653-7-jfalempe@redhat.com \
--to=jfalempe@redhat.com \
--cc=airlied@gmail.com \
--cc=bluescreen_avenger@verizon.net \
--cc=caleb.connolly@linaro.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=gpiccoli@igalia.com \
--cc=javierm@redhat.com \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=pmladek@suse.com \
--cc=tzimmermann@suse.de \
/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
all inboxes | Powered by JetHome®