drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/amdgpu_isp.c- Extension
.c- Size
- 9257 bytes
- Lines
- 370
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/firmware.hlinux/mfd/core.hamdgpu.hamdgpu_isp.hisp_v4_1_0.hisp_v4_1_1.h
Detected Declarations
function Copyrightfunction isp_hw_finifunction isp_load_fw_by_pspfunction isp_early_initfunction isp_is_idlefunction isp_set_clockgating_statefunction isp_set_powergating_statefunction is_valid_isp_devicefunction isp_user_buffer_allocfunction isp_user_buffer_freefunction isp_kernel_buffer_allocfunction isp_kernel_buffer_freefunction isp_resumefunction isp_suspendexport isp_user_buffer_allocexport isp_user_buffer_freeexport isp_kernel_buffer_allocexport isp_kernel_buffer_free
Annotated Snippet
#include <linux/firmware.h>
#include <linux/mfd/core.h>
#include "amdgpu.h"
#include "amdgpu_isp.h"
#include "isp_v4_1_0.h"
#include "isp_v4_1_1.h"
#define ISP_MC_ADDR_ALIGN (1024 * 32)
/**
* isp_hw_init - start and test isp block
*
* @ip_block: Pointer to the amdgpu_ip_block for this hw instance.
*
*/
static int isp_hw_init(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = ip_block->adev;
struct amdgpu_isp *isp = &adev->isp;
if (isp->funcs->hw_init != NULL)
return isp->funcs->hw_init(isp);
return -ENODEV;
}
/**
* isp_hw_fini - stop the hardware block
*
* @ip_block: Pointer to the amdgpu_ip_block for this hw instance.
*
*/
static int isp_hw_fini(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_isp *isp = &ip_block->adev->isp;
if (isp->funcs->hw_fini != NULL)
return isp->funcs->hw_fini(isp);
return -ENODEV;
}
static int isp_load_fw_by_psp(struct amdgpu_device *adev)
{
const struct common_firmware_header *hdr;
char ucode_prefix[10];
int r = 0;
/* get isp fw binary name and path */
amdgpu_ucode_ip_version_decode(adev, ISP_HWIP, ucode_prefix,
sizeof(ucode_prefix));
/* read isp fw */
r = amdgpu_ucode_request(adev, &adev->isp.fw, AMDGPU_UCODE_OPTIONAL,
"amdgpu/%s.bin", ucode_prefix);
if (r) {
amdgpu_ucode_release(&adev->isp.fw);
return r;
}
hdr = (const struct common_firmware_header *)adev->isp.fw->data;
adev->firmware.ucode[AMDGPU_UCODE_ID_ISP].ucode_id =
AMDGPU_UCODE_ID_ISP;
adev->firmware.ucode[AMDGPU_UCODE_ID_ISP].fw = adev->isp.fw;
adev->firmware.fw_size +=
ALIGN(le32_to_cpu(hdr->ucode_size_bytes), PAGE_SIZE);
return r;
}
static int isp_early_init(struct amdgpu_ip_block *ip_block)
{
struct amdgpu_device *adev = ip_block->adev;
struct amdgpu_isp *isp = &adev->isp;
switch (amdgpu_ip_version(adev, ISP_HWIP, 0)) {
case IP_VERSION(4, 1, 0):
isp_v4_1_0_set_isp_funcs(isp);
break;
case IP_VERSION(4, 1, 1):
isp_v4_1_1_set_isp_funcs(isp);
break;
default:
return -EINVAL;
}
Annotation
- Immediate include surface: `linux/firmware.h`, `linux/mfd/core.h`, `amdgpu.h`, `amdgpu_isp.h`, `isp_v4_1_0.h`, `isp_v4_1_1.h`.
- Detected declarations: `function Copyright`, `function isp_hw_fini`, `function isp_load_fw_by_psp`, `function isp_early_init`, `function isp_is_idle`, `function isp_set_clockgating_state`, `function isp_set_powergating_state`, `function is_valid_isp_device`, `function isp_user_buffer_alloc`, `function isp_user_buffer_free`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: integration 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.