include/drm/drm_print.h
Source file repositories/reference/linux-study-clean/include/drm/drm_print.h
File Facts
- System
- Linux kernel
- Corpus path
include/drm/drm_print.h- Extension
.h- Size
- 23786 bytes
- Lines
- 797
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/compiler.hlinux/printk.hlinux/device.hlinux/dynamic_debug.hdrm/drm.hdrm/drm_device.h
Detected Declarations
struct debugfs_regset32struct drm_devicestruct seq_filestruct drm_printerstruct drm_print_iteratorstruct _ddebugenum drm_debug_categoryfunction drm_debug_enabled_rawfunction drm_vprintffunction Ofunction drm_coredump_printer_is_fullfunction drm_seq_file_printerfunction drm_info_printerfunction drm_dbg_printerfunction drm_err_printerfunction drm_line_printerfunction DRM_DEV_DEBUG
Annotated Snippet
struct drm_printer {
/* private: */
void (*printfn)(struct drm_printer *p, struct va_format *vaf);
void (*puts)(struct drm_printer *p, const char *str);
void *arg;
const void *origin;
const char *prefix;
struct {
unsigned int series;
unsigned int counter;
} line;
enum drm_debug_category category;
};
void __drm_printfn_coredump(struct drm_printer *p, struct va_format *vaf);
void __drm_puts_coredump(struct drm_printer *p, const char *str);
void __drm_printfn_seq_file(struct drm_printer *p, struct va_format *vaf);
void __drm_puts_seq_file(struct drm_printer *p, const char *str);
void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf);
void __drm_printfn_dbg(struct drm_printer *p, struct va_format *vaf);
void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf);
void __drm_printfn_line(struct drm_printer *p, struct va_format *vaf);
__printf(2, 3)
void drm_printf(struct drm_printer *p, const char *f, ...);
void drm_puts(struct drm_printer *p, const char *str);
void drm_print_regset32(struct drm_printer *p, struct debugfs_regset32 *regset);
void drm_print_bits(struct drm_printer *p, unsigned long value,
const char * const bits[], unsigned int nbits);
void drm_print_hex_dump(struct drm_printer *p, const char *prefix,
const u8 *buf, size_t len);
__printf(2, 0)
/**
* drm_vprintf - print to a &drm_printer stream
* @p: the &drm_printer
* @fmt: format string
* @va: the va_list
*/
static inline void
drm_vprintf(struct drm_printer *p, const char *fmt, va_list *va)
{
struct va_format vaf = { .fmt = fmt, .va = va };
p->printfn(p, &vaf);
}
/**
* drm_printf_indent - Print to a &drm_printer stream with indentation
* @printer: DRM printer
* @indent: Tab indentation level (max 5)
* @fmt: Format string
*/
#define drm_printf_indent(printer, indent, fmt, ...) \
drm_printf((printer), "%.*s" fmt, (indent), "\t\t\t\t\tX", ##__VA_ARGS__)
/**
* struct drm_print_iterator - local struct used with drm_printer_coredump
* @data: Pointer to the devcoredump output buffer, can be NULL if using
* drm_printer_coredump to determine size of devcoredump
* @start: The offset within the buffer to start writing
* @remain: The number of bytes to write for this iteration
*/
struct drm_print_iterator {
void *data;
ssize_t start;
ssize_t remain;
/* private: */
ssize_t offset;
};
/**
* drm_coredump_printer - construct a &drm_printer that can output to a buffer
* from the read function for devcoredump
* @iter: A pointer to a struct drm_print_iterator for the read instance
*
* This wrapper extends drm_printf() to work with a dev_coredumpm() callback
* function. The passed in drm_print_iterator struct contains the buffer
* pointer, size and offset as passed in from devcoredump.
*
* For example::
*
* void coredump_read(char *buffer, loff_t offset, size_t count,
* void *data, size_t datalen)
* {
* struct drm_print_iterator iter;
* struct drm_printer p;
*
* iter.data = buffer;
* iter.start = offset;
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/printk.h`, `linux/device.h`, `linux/dynamic_debug.h`, `drm/drm.h`, `drm/drm_device.h`.
- Detected declarations: `struct debugfs_regset32`, `struct drm_device`, `struct seq_file`, `struct drm_printer`, `struct drm_print_iterator`, `struct _ddebug`, `enum drm_debug_category`, `function drm_debug_enabled_raw`, `function drm_vprintf`, `function O`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.