drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c- Extension
.c- Size
- 12426 bytes
- Lines
- 458
- Domain
- Driver Families
- Bucket
- drivers/media
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- 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/slab.hdelta.hdelta-ipc.hdelta-mjpeg.hdelta-mjpeg-fw.h
Detected Declarations
struct delta_mjpeg_ctxfunction is_stream_errorfunction delta_mjpeg_check_statusfunction delta_mjpeg_ipc_openfunction delta_mjpeg_ipc_decodefunction delta_mjpeg_openfunction delta_mjpeg_closefunction delta_mjpeg_get_streaminfofunction delta_mjpeg_decodefunction delta_mjpeg_get_frame
Annotated Snippet
struct delta_mjpeg_ctx {
/* jpeg header */
struct mjpeg_header header_struct;
struct mjpeg_header *header;
/* ipc */
void *ipc_hdl;
struct delta_buf *ipc_buf;
/* decoded output frame */
struct delta_frame *out_frame;
unsigned char str[3000];
};
#define to_ctx(ctx) ((struct delta_mjpeg_ctx *)(ctx)->priv)
static char *ipc_open_param_str(struct jpeg_video_decode_init_params_t *p,
char *str, unsigned int len)
{
char *b = str;
if (!p)
return "";
b += snprintf(b, len,
"jpeg_video_decode_init_params_t\n"
"circular_buffer_begin_addr_p 0x%x\n"
"circular_buffer_end_addr_p 0x%x\n",
p->circular_buffer_begin_addr_p,
p->circular_buffer_end_addr_p);
return str;
}
static char *ipc_decode_param_str(struct jpeg_decode_params_t *p,
char *str, unsigned int len)
{
char *b = str;
if (!p)
return "";
b += snprintf(b, len,
"jpeg_decode_params_t\n"
"picture_start_addr_p 0x%x\n"
"picture_end_addr_p 0x%x\n"
"decoding_mode %d\n"
"display_buffer_addr.display_decimated_luma_p 0x%x\n"
"display_buffer_addr.display_decimated_chroma_p 0x%x\n"
"main_aux_enable %d\n"
"additional_flags 0x%x\n"
"field_flag %x\n"
"is_jpeg_image %x\n",
p->picture_start_addr_p,
p->picture_end_addr_p,
p->decoding_mode,
p->display_buffer_addr.display_decimated_luma_p,
p->display_buffer_addr.display_decimated_chroma_p,
p->main_aux_enable, p->additional_flags,
p->field_flag,
p->is_jpeg_image);
return str;
}
static inline bool is_stream_error(enum jpeg_decoding_error_t err)
{
switch (err) {
case JPEG_DECODER_UNDEFINED_HUFF_TABLE:
case JPEG_DECODER_BAD_RESTART_MARKER:
case JPEG_DECODER_BAD_SOS_SPECTRAL:
case JPEG_DECODER_BAD_SOS_SUCCESSIVE:
case JPEG_DECODER_BAD_HEADER_LENGTH:
case JPEG_DECODER_BAD_COUNT_VALUE:
case JPEG_DECODER_BAD_DHT_MARKER:
case JPEG_DECODER_BAD_INDEX_VALUE:
case JPEG_DECODER_BAD_NUMBER_HUFFMAN_TABLES:
case JPEG_DECODER_BAD_QUANT_TABLE_LENGTH:
case JPEG_DECODER_BAD_NUMBER_QUANT_TABLES:
case JPEG_DECODER_BAD_COMPONENT_COUNT:
return true;
default:
return false;
}
}
static inline const char *err_str(enum jpeg_decoding_error_t err)
{
switch (err) {
Annotation
- Immediate include surface: `linux/slab.h`, `delta.h`, `delta-ipc.h`, `delta-mjpeg.h`, `delta-mjpeg-fw.h`.
- Detected declarations: `struct delta_mjpeg_ctx`, `function is_stream_error`, `function delta_mjpeg_check_status`, `function delta_mjpeg_ipc_open`, `function delta_mjpeg_ipc_decode`, `function delta_mjpeg_open`, `function delta_mjpeg_close`, `function delta_mjpeg_get_streaminfo`, `function delta_mjpeg_decode`, `function delta_mjpeg_get_frame`.
- Atlas domain: Driver Families / drivers/media.
- 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.