Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Brost <matthew.brost@intel.com>
To: intel-xe@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: [PATCH v2 3/4] drm/print: Add drm_printer_is_full
Date: Thu,  3 Apr 2025 13:27:04 -0700	[thread overview]
Message-ID: <20250403202705.18488-4-matthew.brost@intel.com> (raw)
In-Reply-To: <20250403202705.18488-1-matthew.brost@intel.com>

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.

Signed-off-by: Matthew Brost <matthew.brost@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
-- 
2.34.1


  parent reply	other threads:[~2025-04-03 20:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-03 20:27 [PATCH v2 0/4] Large devcoredump file support Matthew Brost
2025-04-03 20:27 ` [PATCH v2 1/4] drm/xe: Add devcoredump chunking Matthew Brost
2025-04-03 21:28   ` Cavitt, Jonathan
2025-04-03 21:39   ` John Harrison
2025-04-03 22:32     ` Matthew Brost
2025-04-03 22:41       ` John Harrison
2025-04-04  2:33         ` Matthew Brost
2025-04-03 20:27 ` [PATCH v2 2/4] drm/xe: Update xe_ttm_access_memory to use GPU for non-visible access Matthew Brost
2025-04-03 21:28   ` Cavitt, Jonathan
2025-04-10  3:58     ` Matthew Brost
2025-04-03 20:27 ` Matthew Brost [this message]
2025-04-03 21:28   ` [PATCH v2 3/4] drm/print: Add drm_printer_is_full Cavitt, Jonathan
2025-04-03 20:27 ` [PATCH v2 4/4] drm/xe: Abort printing coredump in VM printer output if full Matthew Brost
2025-04-03 21:28   ` Cavitt, Jonathan
2025-04-04  3:31 ` ✓ CI.Patch_applied: success for Large devcoredump file support (rev2) Patchwork
2025-04-04  3:32 ` ✓ CI.checkpatch: " Patchwork
2025-04-04  3:32 ` ✗ CI.KUnit: 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=20250403202705.18488-4-matthew.brost@intel.com \
    --to=matthew.brost@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.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