include/drm/drm_panic.h
Source file repositories/reference/linux-study-clean/include/drm/drm_panic.h
File Facts
- System
- Linux kernel
- Corpus path
include/drm/drm_panic.h- Extension
.h- Size
- 6258 bytes
- Lines
- 190
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/types.hlinux/iosys-map.hdrm/drm_device.hdrm/drm_fourcc.h
Detected Declarations
struct drm_scanout_bufferfunction drm_dev_unregisterfunction drm_panic_lock
Annotated Snippet
struct drm_scanout_buffer {
/**
* @format:
*
* drm format of the scanout buffer.
*/
const struct drm_format_info *format;
/**
* @map:
*
* Virtual address of the scanout buffer, either in memory or iomem.
* The scanout buffer should be in linear format, and can be directly
* sent to the display hardware. Tearing is not an issue for the panic
* screen.
*/
struct iosys_map map[DRM_FORMAT_MAX_PLANES];
/**
* @pages: Optional, if the scanout buffer is not mapped, set this field
* to the array of pages of the scanout buffer. The panic code will use
* kmap_local_page_try_from_panic() to map one page at a time to write
* all the pixels. This array shouldn't be allocated from the
* get_scanoutbuffer() callback.
* The scanout buffer should be in linear format.
*/
struct page **pages;
/**
* @width: Width of the scanout buffer, in pixels.
*/
unsigned int width;
/**
* @height: Height of the scanout buffer, in pixels.
*/
unsigned int height;
/**
* @pitch: Length in bytes between the start of two consecutive lines.
*/
unsigned int pitch[DRM_FORMAT_MAX_PLANES];
/**
* @set_pixel: Optional function, to set a pixel color on the
* framebuffer. It allows to handle special tiling format inside the
* driver. It takes precedence over the @map and @pages fields.
*/
void (*set_pixel)(struct drm_scanout_buffer *sb, unsigned int x,
unsigned int y, u32 color);
/**
* @private: private pointer that you can use in the callbacks
* set_pixel()
*/
void *private;
};
#ifdef CONFIG_DRM_PANIC
/**
* drm_panic_trylock - try to enter the panic printing critical section
* @dev: struct drm_device
* @flags: unsigned long irq flags you need to pass to the unlock() counterpart
*
* This function must be called by any panic printing code. The panic printing
* attempt must be aborted if the trylock fails.
*
* Panic printing code can make the following assumptions while holding the
* panic lock:
*
* - Anything protected by drm_panic_lock() and drm_panic_unlock() pairs is safe
* to access.
*
* - Furthermore the panic printing code only registers in drm_dev_unregister()
* and gets removed in drm_dev_unregister(). This allows the panic code to
* safely access any state which is invariant in between these two function
* calls, like the list of planes &drm_mode_config.plane_list or most of the
* struct drm_plane structure.
*
* Specifically thanks to the protection around plane updates in
* drm_atomic_helper_swap_state() the following additional guarantees hold:
*
* - It is safe to deference the drm_plane.state pointer.
*
* - Anything in struct drm_plane_state or the driver's subclass thereof which
* stays invariant after the atomic check code has finished is safe to access.
* Specifically this includes the reference counted pointers to framebuffer
* and buffer objects.
Annotation
- Immediate include surface: `linux/module.h`, `linux/types.h`, `linux/iosys-map.h`, `drm/drm_device.h`, `drm/drm_fourcc.h`.
- Detected declarations: `struct drm_scanout_buffer`, `function drm_dev_unregister`, `function drm_panic_lock`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.