]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/printer: Allow NULL data in devcoredump printer
authorMatthew Brost <matthew.brost@intel.com>
Thu, 1 Aug 2024 15:41:17 +0000 (08:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:32 +0000 (15:11 +0200)
commit6aeb160ec5bde8313368ca59216623e9befd75df
treea5a57c6aa73160f63adede3ac5edd3b6d526e9be
parent1f9f8186e239222f1c8d3dd73bf3bc6ae86c5e76
drm/printer: Allow NULL data in devcoredump printer

[ Upstream commit 53369581dc0c68a5700ed51e1660f44c4b2bb524 ]

We want to determine the size of the devcoredump before writing it out.
To that end, we will run the devcoredump printer with NULL data to get
the size, alloc data based on the generated offset, then run the
devcorecump again with a valid data pointer to print.  This necessitates
not writing data to the data pointer on the initial pass, when it is
NULL.

v5:
 - Better commit message (Jonathan)
 - Add kerenl doc with examples (Jani)

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240801154118.2547543-3-matthew.brost@intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/drm_print.c
include/drm/drm_print.h