drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.c- Extension
.c- Size
- 11805 bytes
- Lines
- 418
- 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
linux/gpio/machine.hlinux/pm_runtime.hamdgpu.hisp_v4_1_1.h
Detected Declarations
function isp_powerofffunction isp_poweronfunction isp_set_performance_statefunction isp_genpd_add_devicefunction isp_genpd_remove_devicefunction isp_suspend_devicefunction isp_resume_devicefunction isp_v4_1_1_hw_suspendfunction isp_v4_1_1_hw_resumefunction isp_v4_1_1_hw_initfunction isp_v4_1_1_hw_finifunction isp_v4_1_1_set_isp_funcs
Annotated Snippet
#include <linux/gpio/machine.h>
#include <linux/pm_runtime.h>
#include "amdgpu.h"
#include "isp_v4_1_1.h"
MODULE_FIRMWARE("amdgpu/isp_4_1_1.bin");
#define ISP_PERFORMANCE_STATE_LOW 0
#define ISP_PERFORMANCE_STATE_HIGH 1
#define ISP_HIGH_PERFORMANC_XCLK 788
#define ISP_HIGH_PERFORMANC_ICLK 788
static const unsigned int isp_4_1_1_int_srcid[MAX_ISP411_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 struct gpiod_lookup_table isp_gpio_table = {
.dev_id = "amd_isp_capture",
.table = {
GPIO_LOOKUP("AMDI0030:00", 85, "enable_isp", GPIO_ACTIVE_HIGH),
{ }
},
};
static struct gpiod_lookup_table isp_sensor_gpio_table = {
.dev_id = "i2c-ov05c10",
.table = {
GPIO_LOOKUP("amdisp-pinctrl", 0, "enable", GPIO_ACTIVE_HIGH),
{ }
},
};
static int isp_poweroff(struct generic_pm_domain *genpd)
{
struct amdgpu_isp *isp = container_of(genpd, struct amdgpu_isp, ispgpd);
struct amdgpu_device *adev = isp->adev;
return amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ISP, true, 0);
}
static int isp_poweron(struct generic_pm_domain *genpd)
{
struct amdgpu_isp *isp = container_of(genpd, struct amdgpu_isp, ispgpd);
struct amdgpu_device *adev = isp->adev;
return amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ISP, false, 0);
}
static int isp_set_performance_state(struct generic_pm_domain *genpd,
unsigned int state)
{
struct amdgpu_isp *isp = container_of(genpd, struct amdgpu_isp, ispgpd);
struct amdgpu_device *adev = isp->adev;
u32 iclk, xclk;
int ret;
switch (state) {
case ISP_PERFORMANCE_STATE_HIGH:
xclk = ISP_HIGH_PERFORMANC_XCLK;
iclk = ISP_HIGH_PERFORMANC_ICLK;
break;
case ISP_PERFORMANCE_STATE_LOW:
/* isp runs at default lowest clock-rate on power-on, do nothing */
return 0;
default:
return -EINVAL;
}
ret = amdgpu_dpm_set_soft_freq_range(adev, PP_ISPXCLK, xclk, 0);
if (ret) {
drm_err(&adev->ddev, "failed to set xclk %u to %u: %d\n",
xclk, state, ret);
return ret;
}
ret = amdgpu_dpm_set_soft_freq_range(adev, PP_ISPICLK, iclk, 0);
if (ret) {
drm_err(&adev->ddev, "failed to set iclk %u to %u: %d\n",
iclk, state, ret);
return ret;
}
Annotation
- Immediate include surface: `linux/gpio/machine.h`, `linux/pm_runtime.h`, `amdgpu.h`, `isp_v4_1_1.h`.
- Detected declarations: `function isp_poweroff`, `function isp_poweron`, `function isp_set_performance_state`, `function isp_genpd_add_device`, `function isp_genpd_remove_device`, `function isp_suspend_device`, `function isp_resume_device`, `function isp_v4_1_1_hw_suspend`, `function isp_v4_1_1_hw_resume`, `function isp_v4_1_1_hw_init`.
- 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.