drivers/media/platform/amd/isp4/isp4_debug.c
Source file repositories/reference/linux-study-clean/drivers/media/platform/amd/isp4/isp4_debug.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/media/platform/amd/isp4/isp4_debug.c- Extension
.c- Size
- 6573 bytes
- Lines
- 272
- 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
isp4.hisp4_debug.hisp4_hw_reg.hisp4_interface.h
Detected Declarations
function Copyrightfunction isp_debugfs_removefunction isp_fw_fill_rb_logfunction isp_fw_log_printfunction isp4dbg_show_bufmeta_info
Annotated Snippet
if (cnt > rb_size) {
dev_err(dev, "fail bad fw log size %u\n", cnt);
goto quit;
}
memcpy(buf + offset, sys + rd_ptr, cnt);
offset += cnt;
total_cnt += cnt;
rd_ptr = (rd_ptr + cnt) % rb_size;
} while (rd_ptr < wr_ptr);
isp4hw_wreg(isp->mmio, ISP_LOG_RB_RPTR0, rd_ptr);
quit:
return total_cnt;
}
void isp_fw_log_print(struct isp4_subdev *isp)
{
struct isp4_interface *ispif = &isp->ispif;
char *fw_log_buf = isp->fw_log_output;
u32 cnt;
if (!isp->enable_fw_log || !fw_log_buf)
return;
cnt = isp_fw_fill_rb_log(isp, ispif->fw_log_buf->sys_addr,
ispif->fw_log_buf->mem_size);
if (cnt) {
char temp_ch;
char *str;
char *end;
/* line end */
char *le;
str = (char *)fw_log_buf;
end = ((char *)fw_log_buf + cnt);
fw_log_buf[cnt] = 0;
while (str < end) {
le = strchr(str, 0x0A);
if ((le && str + ISP4DBG_ONE_TIME_LOG_LEN >= le) ||
(!le && str + ISP4DBG_ONE_TIME_LOG_LEN >= end)) {
if (le)
*le = 0;
if (*str != '\0')
dev_dbg(isp->dev, "%s", str);
if (le) {
*le = 0x0A;
str = le + 1;
} else {
break;
}
} else {
u32 tmp_len = ISP4DBG_ONE_TIME_LOG_LEN;
temp_ch = str[tmp_len];
str[tmp_len] = 0;
dev_dbg(isp->dev, "%s", str);
str[tmp_len] = temp_ch;
str = &str[tmp_len];
}
}
}
}
#endif
char *isp4dbg_get_buf_src_str(u32 src)
{
switch (src) {
case ISP4FW_BUFFER_SOURCE_STREAM:
return ISP4DBG_MACRO_2_STR(ISP4FW_BUFFER_SOURCE_STREAM);
default:
return "Unknown buf source";
}
}
char *isp4dbg_get_buf_done_str(u32 status)
{
switch (status) {
case ISP4FW_BUFFER_STATUS_INVALID:
return ISP4DBG_MACRO_2_STR(ISP4FW_BUFFER_STATUS_INVALID);
case ISP4FW_BUFFER_STATUS_SKIPPED:
return ISP4DBG_MACRO_2_STR(ISP4FW_BUFFER_STATUS_SKIPPED);
case ISP4FW_BUFFER_STATUS_EXIST:
return ISP4DBG_MACRO_2_STR(ISP4FW_BUFFER_STATUS_EXIST);
Annotation
- Immediate include surface: `isp4.h`, `isp4_debug.h`, `isp4_hw_reg.h`, `isp4_interface.h`.
- Detected declarations: `function Copyright`, `function isp_debugfs_remove`, `function isp_fw_fill_rb_log`, `function isp_fw_log_print`, `function isp4dbg_show_bufmeta_info`.
- 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.