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)
committerMatthew Brost <matthew.brost@intel.com>
Thu, 1 Aug 2024 18:00:12 +0000 (11:00 -0700)
commit53369581dc0c68a5700ed51e1660f44c4b2bb524
treed9eea326859f049e4df4bced7c3af8934b405eed
parentc3bc97d2f102ddd5a8341eeb2dbae2a3e98bb46a
drm/printer: Allow NULL data in devcoredump printer

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
drivers/gpu/drm/drm_print.c
include/drm/drm_print.h