drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.c- Extension
.c- Size
- 5904 bytes
- Lines
- 191
- Domain
- Driver Families
- Bucket
- drivers/gpu
- 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
amdgpu.hisp_v4_1_0.h
Detected Declarations
function isp_v4_1_0_hw_initfunction isp_v4_1_0_hw_finifunction isp_v4_1_0_set_isp_funcs
Annotated Snippet
#include "amdgpu.h"
#include "isp_v4_1_0.h"
static const unsigned int isp_4_1_0_int_srcid[MAX_ISP410_INT_SRC] = {
ISP_4_1__SRCID__ISP_RINGBUFFER_WPT9,
ISP_4_1__SRCID__ISP_RINGBUFFER_WPT10,
ISP_4_1__SRCID__ISP_RINGBUFFER_WPT11,
ISP_4_1__SRCID__ISP_RINGBUFFER_WPT12,
ISP_4_1__SRCID__ISP_RINGBUFFER_WPT13,
ISP_4_1__SRCID__ISP_RINGBUFFER_WPT14,
ISP_4_1__SRCID__ISP_RINGBUFFER_WPT15,
ISP_4_1__SRCID__ISP_RINGBUFFER_WPT16
};
static int isp_v4_1_0_hw_init(struct amdgpu_isp *isp)
{
struct amdgpu_device *adev = isp->adev;
int idx, int_idx, num_res, r;
u64 isp_base;
if (adev->rmmio_size == 0 || adev->rmmio_size < 0x5289)
return -EINVAL;
isp_base = adev->rmmio_base;
isp->isp_cell = kzalloc_objs(struct mfd_cell, 3);
if (!isp->isp_cell) {
r = -ENOMEM;
drm_err(&adev->ddev,
"%s: isp mfd cell alloc failed\n", __func__);
goto failure;
}
num_res = MAX_ISP410_MEM_RES + MAX_ISP410_INT_SRC;
isp->isp_res = kzalloc_objs(struct resource, num_res);
if (!isp->isp_res) {
r = -ENOMEM;
drm_err(&adev->ddev,
"%s: isp mfd res alloc failed\n", __func__);
goto failure;
}
isp->isp_pdata = kzalloc_obj(*isp->isp_pdata);
if (!isp->isp_pdata) {
r = -ENOMEM;
drm_err(&adev->ddev,
"%s: isp platform data alloc failed\n", __func__);
goto failure;
}
/* initialize isp platform data */
isp->isp_pdata->adev = (void *)adev;
isp->isp_pdata->asic_type = adev->asic_type;
isp->isp_pdata->base_rmmio_size = adev->rmmio_size;
isp->isp_res[0].name = "isp_4_1_0_reg";
isp->isp_res[0].flags = IORESOURCE_MEM;
isp->isp_res[0].start = isp_base;
isp->isp_res[0].end = isp_base + ISP_REGS_OFFSET_END;
isp->isp_res[1].name = "isp_4_1_phy0_reg";
isp->isp_res[1].flags = IORESOURCE_MEM;
isp->isp_res[1].start = isp_base + ISP410_PHY0_OFFSET;
isp->isp_res[1].end = isp_base + ISP410_PHY0_OFFSET + ISP410_PHY0_SIZE;
for (idx = MAX_ISP410_MEM_RES, int_idx = 0; idx < num_res; idx++, int_idx++) {
isp->isp_res[idx].name = "isp_4_1_0_irq";
isp->isp_res[idx].flags = IORESOURCE_IRQ;
isp->isp_res[idx].start =
amdgpu_irq_create_mapping(adev, isp_4_1_0_int_srcid[int_idx]);
isp->isp_res[idx].end =
isp->isp_res[idx].start;
}
isp->isp_cell[0].name = "amd_isp_capture";
isp->isp_cell[0].num_resources = num_res;
isp->isp_cell[0].resources = &isp->isp_res[0];
isp->isp_cell[0].platform_data = isp->isp_pdata;
isp->isp_cell[0].pdata_size = sizeof(struct isp_platform_data);
/* initialize isp i2c platform data */
isp->isp_i2c_res = kzalloc_objs(struct resource, 1);
if (!isp->isp_i2c_res) {
r = -ENOMEM;
drm_err(&adev->ddev,
"%s: isp mfd res alloc failed\n", __func__);
goto failure;
}
isp->isp_i2c_res[0].name = "isp_i2c0_reg";
Annotation
- Immediate include surface: `amdgpu.h`, `isp_v4_1_0.h`.
- Detected declarations: `function isp_v4_1_0_hw_init`, `function isp_v4_1_0_hw_fini`, `function isp_v4_1_0_set_isp_funcs`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.