From: Jani Nikula <jani.nikula@linux.intel.com>
To: Matthew Brost <matthew.brost@intel.com>, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v3 3/4] drm/print: Add drm_printer_is_full
Date: Thu, 10 Apr 2025 15:06:32 +0300 [thread overview]
Message-ID: <87h62wuson.fsf@intel.com> (raw)
In-Reply-To: <20250410040622.238389-4-matthew.brost@intel.com>
On Wed, 09 Apr 2025, Matthew Brost <matthew.brost@intel.com> wrote:
> Add drm_printer_is_full which indicates if a drm printer's output is
> full. Useful to short circuit coredump printing once printer's output is
> full.
The function is presented as a generic drm_printer thing, but it's
really only valid for a coredump printer, and will return random results
for other printers. Which can't even be "full" in any meaningful sense,
making the documentation for the function seem completely weird.
BR,
Jani.
>
> Signed-off-by: Matthew Brost <matthew.brost@intel.com>
> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> ---
> include/drm/drm_print.h | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
> index f31eba1c7cab..db7517ee1b19 100644
> --- a/include/drm/drm_print.h
> +++ b/include/drm/drm_print.h
> @@ -242,6 +242,23 @@ struct drm_print_iterator {
> ssize_t offset;
> };
>
> +/**
> + * drm_printer_is_full() - DRM printer output is full
> + * @p: DRM printer
> + *
> + * DRM printer output is full, useful to short circuit coredump printing once
> + * printer is full.
> + *
> + * RETURNS:
> + * True if DRM printer output buffer is full, False otherwise
> + */
> +static inline bool drm_printer_is_full(struct drm_printer *p)
> +{
> + struct drm_print_iterator *iterator = p->arg;
> +
> + return !iterator->remain;
> +}
> +
> /**
> * drm_coredump_printer - construct a &drm_printer that can output to a buffer
> * from the read function for devcoredump
--
Jani Nikula, Intel
next prev parent reply other threads:[~2025-04-10 12:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 4:06 [PATCH v3 0/4] Large devcoredump file support Matthew Brost
2025-04-10 4:06 ` [PATCH v3 1/4] drm/xe: Add devcoredump chunking Matthew Brost
2025-04-10 17:47 ` John Harrison
2025-04-10 4:06 ` [PATCH v3 2/4] drm/xe: Update xe_ttm_access_memory to use GPU for non-visible access Matthew Brost
2025-04-10 4:06 ` [PATCH v3 3/4] drm/print: Add drm_printer_is_full Matthew Brost
2025-04-10 12:06 ` Jani Nikula [this message]
2025-04-15 17:10 ` Matthew Brost
2025-04-16 7:14 ` Jani Nikula
2025-04-10 4:06 ` [PATCH v3 4/4] drm/xe: Abort printing coredump in VM printer output if full Matthew Brost
2025-04-10 4:11 ` ✓ CI.Patch_applied: success for Large devcoredump file support Patchwork
2025-04-10 4:11 ` ✓ CI.checkpatch: " Patchwork
2025-04-10 4:12 ` ✓ CI.KUnit: " Patchwork
2025-04-10 4:28 ` ✗ CI.Build: failure " 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=87h62wuson.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.brost@intel.com \
/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).